From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 03:48:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 441C68E3; Tue, 1 Jan 2013 03:48:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26E9C8FC0A; Tue, 1 Jan 2013 03:48:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r013meD9074876; Tue, 1 Jan 2013 03:48:40 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r013meFP074875; Tue, 1 Jan 2013 03:48:40 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301010348.r013meFP074875@svn.freebsd.org> From: Andrew Turner Date: Tue, 1 Jan 2013 03:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244919 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 03:48:40 -0000 Author: andrew Date: Tue Jan 1 03:48:39 2013 New Revision: 244919 URL: http://svnweb.freebsd.org/changeset/base/244919 Log: Document the known values of the RTL release field in the cache is register Modified: head/sys/arm/include/pl310.h Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue Jan 1 00:45:28 2013 (r244918) +++ head/sys/arm/include/pl310.h Tue Jan 1 03:48:39 2013 (r244919) @@ -37,8 +37,16 @@ #define PL310_CACHE_ID 0x000 #define CACHE_ID_RELEASE_SHIFT 0 #define CACHE_ID_RELEASE_MASK 0x3f +#define CACHE_ID_RELEASE_r0p0 0x00 +#define CACHE_ID_RELEASE_r1p0 0x02 +#define CACHE_ID_RELEASE_r2p0 0x04 +#define CACHE_ID_RELEASE_r3p0 0x05 +#define CACHE_ID_RELEASE_r3p1 0x06 +#define CACHE_ID_RELEASE_r3p2 0x08 +#define CACHE_ID_RELEASE_r3p3 0x09 #define CACHE_ID_PARTNUM_SHIFT 6 #define CACHE_ID_PARTNUM_MASK 0xf +#define CACHE_ID_PARTNUM_VALUE 0x3 #define PL310_CACHE_TYPE 0x004 #define PL310_CTRL 0x100 #define CTRL_ENABLED 0x01 From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 04:05:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE007C47; Tue, 1 Jan 2013 04:05:07 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.187]) by mx1.freebsd.org (Postfix) with ESMTP id A66868FC08; Tue, 1 Jan 2013 04:05:07 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by skoda.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1Tpt19-0006fx-Vy; Mon, 31 Dec 2012 19:59:55 -0800 Received: from localhost (unverified [49.226.227.85]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Mon, 31 Dec 2012 22:59:56 -0500 Date: Tue, 1 Jan 2013 16:59:15 +1300 From: Andrew Turner To: Oleksandr Tymoshenko Subject: Re: svn commit: r244914 - in head/sys/arm: arm include ti/omap4 Message-ID: <20130101165915.1f903645@fubar.geek.nz> In-Reply-To: <50E20F2B.7080704@freebsd.org> References: <201212312119.qBVLJi3V009555@svn.freebsd.org> <20130101105353.14492943@fubar.geek.nz> <50E20F2B.7080704@freebsd.org> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 04:05:07 -0000 On Mon, 31 Dec 2012 14:18:19 -0800 Oleksandr Tymoshenko wrote: > On 12/31/2012 1:53 PM, Andrew Turner wrote: > > On Mon, 31 Dec 2012 21:19:44 +0000 (UTC) > > Oleksandr Tymoshenko wrote: > >> Modified: head/sys/arm/arm/pl310.c > >> ============================================================================== > >> --- head/sys/arm/arm/pl310.c Mon Dec 31 21:09:39 2012 > >> (r244913) +++ head/sys/arm/arm/pl310.c Mon Dec 31 21:19:44 > > ... > >> @@ -157,29 +131,46 @@ pl310_wait_background_op(uint32_t off, u > >> static __inline void > >> pl310_cache_sync(void) > >> { > >> - pl310_write4(PL310_CACHE_SYNC, 0); > >> + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) > >> + return; > >> + > >> +#ifdef PL310_ERRATA_753970 > >> + /* Write uncached PL310 register */ > >> + pl310_write4(pl310_softc, 0x740, 0xffffffff); > >> +#else > >> + pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); > >> +#endif > >> } > > How hard would it be to detect if we need this errata at boot? From > > the errata document it appears to only be present in the r3p0 > > revision of the controller. We can then do something like: > > > > #ifdef PL310_ERRATA_753970 > > if (errata_753970) > > pl310_write4(pl310_softc, 0x740, 0xffffffff); > > else > > #endif > > pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); > > > > > > > I think we can use RTL release field of Cache ID register to > determine actual hardware release > and act accordingly. > > Yes, that appears to be correct, I have committed the known values of the RTL release field, from the ARM documentation, in r244919. I can have a look at detecting which cache controller we are on and adjust our behaviour accordingly but won't have any hardware to test with until the end of the week. Andrew From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 04:35:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A63BF7A; Tue, 1 Jan 2013 04:35:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.188]) by mx1.freebsd.org (Postfix) with ESMTP id 457A48FC12; Tue, 1 Jan 2013 04:35:06 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by opel.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1TptZB-00083E-V7; Mon, 31 Dec 2012 20:35:05 -0800 Received: from localhost (unverified [49.226.227.85]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Mon, 31 Dec 2012 23:35:06 -0500 Date: Tue, 1 Jan 2013 17:34:37 +1300 From: Andrew Turner To: Oleksandr Tymoshenko Subject: Re: svn commit: r244914 - in head/sys/arm: arm include ti/omap4 Message-ID: <20130101173437.33f43ce8@fubar.geek.nz> In-Reply-To: <20130101165915.1f903645@fubar.geek.nz> References: <201212312119.qBVLJi3V009555@svn.freebsd.org> <20130101105353.14492943@fubar.geek.nz> <50E20F2B.7080704@freebsd.org> <20130101165915.1f903645@fubar.geek.nz> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/hZkhpjxOqNpMwuDhuhq7=ut" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 04:35:06 -0000 --MP_/hZkhpjxOqNpMwuDhuhq7=ut Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 1 Jan 2013 16:59:15 +1300 Andrew Turner wrote: > On Mon, 31 Dec 2012 14:18:19 -0800 > Oleksandr Tymoshenko wrote: > > I think we can use RTL release field of Cache ID register to > > determine actual hardware release > > and act accordingly. > > > > > Yes, that appears to be correct, I have committed the known values of > the RTL release field, from the ARM documentation, in r244919. I can > have a look at detecting which cache controller we are on and adjust > our behaviour accordingly but won't have any hardware to test with > until the end of the week. I have this untested patch that should only enable the errata when we detect it is required. Andrew --MP_/hZkhpjxOqNpMwuDhuhq7=ut Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=pl310_errata.diff Index: sys/arm/include/pl310.h =================================================================== --- sys/arm/include/pl310.h (revision 244919) +++ sys/arm/include/pl310.h (working copy) @@ -131,6 +131,7 @@ struct pl310_softc { void* sc_irq_h; int sc_enabled; struct mtx sc_mtx; + u_int sc_rtl_revision; }; /** Index: sys/arm/arm/pl310.c =================================================================== --- sys/arm/arm/pl310.c (revision 244918) +++ sys/arm/arm/pl310.c (working copy) @@ -135,11 +135,12 @@ pl310_cache_sync(void) return; #ifdef PL310_ERRATA_753970 - /* Write uncached PL310 register */ - pl310_write4(pl310_softc, 0x740, 0xffffffff); -#else - pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + /* Write uncached PL310 register */ + pl310_write4(pl310_softc, 0x740, 0xffffffff); + else #endif + pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); } @@ -152,13 +153,17 @@ pl310_wbinv_all(void) PL310_LOCK(pl310_softc); #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 3); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 3); #endif pl310_write4(pl310_softc, PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_wait_background_op(PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_cache_sync(); #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 0); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 0); #endif PL310_UNLOCK(pl310_softc); } @@ -182,27 +187,32 @@ pl310_wbinv_range(vm_paddr_t start, vm_s #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 3); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 3); #endif while (size > 0) { #ifdef PL310_ERRATA_588369 - /* - * Errata 588369 says that clean + inv may keep the - * cache line if it was clean, the recommanded workaround - * is to clean then invalidate the cache line, with - * write-back and cache linefill disabled - */ - - pl310_write4(pl310_softc, PL310_CLEAN_LINE_PA, start); - pl310_write4(pl310_softc, PL310_INV_LINE_PA, start); -#else - pl310_write4(pl310_softc, PL310_CLEAN_INV_LINE_PA, start); + if (sc->sc_rtl_release <= CACHE_ID_RELEASE_r1p0) { + /* + * Errata 588369 says that clean + inv may keep the + * cache line if it was clean, the recommanded + * workaround is to clean then invalidate the cache + * line, with write-back and cache linefill disabled. + */ + pl310_write4(pl310_softc, PL310_CLEAN_LINE_PA, start); + pl310_write4(pl310_softc, PL310_INV_LINE_PA, start); + } else #endif + pl310_write4(pl310_softc, PL310_CLEAN_INV_LINE_PA, + start); start += g_l2cache_line_size; size -= g_l2cache_line_size; } #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 0); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 0); #endif pl310_cache_sync(); @@ -307,6 +317,8 @@ pl310_attach(device_t dev) pl310_filter, NULL, sc, &sc->sc_irq_h); cache_id = pl310_read4(sc, PL310_CACHE_ID); + sc->sc_rtl_release = (cache_id >> CACHE_ID_RELEASE_SHIFT) & + CACHE_ID_RELEASE_MASK; device_printf(dev, "Part number: 0x%x, release: 0x%x\n", (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); --MP_/hZkhpjxOqNpMwuDhuhq7=ut-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 12:48:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F26910C; Tue, 1 Jan 2013 12:48:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2618FC08; Tue, 1 Jan 2013 12:48:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01CmO5r060813; Tue, 1 Jan 2013 12:48:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01CmOn5060812; Tue, 1 Jan 2013 12:48:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301011248.r01CmOn5060812@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 1 Jan 2013 12:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244924 - head/tools/regression/bin/sh/errors X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 12:48:25 -0000 Author: jilles Date: Tue Jan 1 12:48:24 2013 New Revision: 244924 URL: http://svnweb.freebsd.org/changeset/base/244924 Log: sh: Fix a Subversion property. Test scripts should have keywords; only pure output that must match exactly should have keywords disabled. Modified: Directory Properties: head/tools/regression/bin/sh/errors/write-error1.0 (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 16:14:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 733D5AF0; Tue, 1 Jan 2013 16:14:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37DFB8FC08; Tue, 1 Jan 2013 16:14:49 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01GEnrd093103; Tue, 1 Jan 2013 16:14:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01GEmKA093100; Tue, 1 Jan 2013 16:14:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301011614.r01GEmKA093100@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 1 Jan 2013 16:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244925 - in head/sys: kern sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 16:14:49 -0000 Author: kib Date: Tue Jan 1 16:14:48 2013 New Revision: 244925 URL: http://svnweb.freebsd.org/changeset/base/244925 Log: The process_deferred_inactive() function locks the vnodes of the ufs mount, which means that is must not be called while the snaplock is owned. The vfs_write_resume(9) does call the function as the VFS_SUSP_CLEAN() method, which is too early and falls into the region still protected by snaplock. Add yet another flag for the vfs_write_resume_flags() to avoid calling suspension cleanup handler after the suspend is lifted, and use it in the ffs_snapshot() call to vfs_write_resume. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Jan 1 12:48:24 2013 (r244924) +++ head/sys/kern/vfs_vnops.c Tue Jan 1 16:14:48 2013 (r244925) @@ -1667,7 +1667,8 @@ vfs_write_resume_flags(struct mount *mp, mp->mnt_writeopcount++; } MNT_IUNLOCK(mp); - VFS_SUSP_CLEAN(mp); + if ((flags & VR_NO_SUSPCLR) == 0) + VFS_SUSP_CLEAN(mp); } else if ((flags & VR_START_WRITE) != 0) { MNT_REF(mp); vn_start_write_locked(mp, 0); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Jan 1 12:48:24 2013 (r244924) +++ head/sys/sys/vnode.h Tue Jan 1 16:14:48 2013 (r244925) @@ -393,6 +393,7 @@ extern int vttoif_tab[]; #define V_XSLEEP 0x0004 /* vn_start_write: just return after sleep */ #define VR_START_WRITE 0x0001 /* vfs_write_resume: start write atomically */ +#define VR_NO_SUSPCLR 0x0002 /* vfs_write_resume: do not clear suspension */ #define VREF(vp) vref(vp) Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 1 12:48:24 2013 (r244924) +++ head/sys/ufs/ffs/ffs_snapshot.c Tue Jan 1 16:14:48 2013 (r244925) @@ -687,7 +687,7 @@ out1: /* * Resume operation on filesystem. */ - vfs_write_resume_flags(vp->v_mount, VR_START_WRITE); + vfs_write_resume_flags(vp->v_mount, VR_START_WRITE | VR_NO_SUSPCLR); if (collectsnapstats && starttime.tv_sec > 0) { nanotime(&endtime); timespecsub(&endtime, &starttime); From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:16:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD944C30; Tue, 1 Jan 2013 18:16:51 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B58188FC08; Tue, 1 Jan 2013 18:16:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01IGpet012382; Tue, 1 Jan 2013 18:16:51 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01IGoaV012375; Tue, 1 Jan 2013 18:16:50 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201301011816.r01IGoaV012375@svn.freebsd.org> From: Antoine Brodin Date: Tue, 1 Jan 2013 18:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244926 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:16:51 -0000 Author: antoine Date: Tue Jan 1 18:16:49 2013 New Revision: 244926 URL: http://svnweb.freebsd.org/changeset/base/244926 Log: Remove unneeded semicolons. Reviewed by: md5 of the object files Modified: head/sys/dev/agp/agp_ali.c head/sys/dev/agp/agp_amd.c head/sys/dev/agp/agp_amd64.c head/sys/dev/agp/agp_ati.c head/sys/dev/agp/agp_intel.c head/sys/dev/agp/agp_sis.c head/sys/dev/agp/agp_via.c Modified: head/sys/dev/agp/agp_ali.c ============================================================================== --- head/sys/dev/agp/agp_ali.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_ali.c Tue Jan 1 18:16:49 2013 (r244926) @@ -69,7 +69,7 @@ agp_ali_match(device_t dev) return ("Ali M1541 host to AGP bridge"); case 0x162110b9: return ("Ali M1621 host to AGP bridge"); - }; + } return NULL; } Modified: head/sys/dev/agp/agp_amd.c ============================================================================== --- head/sys/dev/agp/agp_amd.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_amd.c Tue Jan 1 18:16:49 2013 (r244926) @@ -191,7 +191,7 @@ agp_amd_match(device_t dev) return ("AMD 761 host to AGP bridge"); case 0x700c1022: return ("AMD 762 host to AGP bridge"); - }; + } return NULL; } Modified: head/sys/dev/agp/agp_amd64.c ============================================================================== --- head/sys/dev/agp/agp_amd64.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_amd64.c Tue Jan 1 18:16:49 2013 (r244926) @@ -113,7 +113,7 @@ agp_amd64_match(device_t dev) return ("VIA K8T800Pro host to PCI bridge"); case 0x31881106: return ("VIA 8385 host to PCI bridge"); - }; + } return (NULL); } Modified: head/sys/dev/agp/agp_ati.c ============================================================================== --- head/sys/dev/agp/agp_ati.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_ati.c Tue Jan 1 18:16:49 2013 (r244926) @@ -99,7 +99,7 @@ agp_ati_match(device_t dev) return ("ATI RS300_166 AGP bridge"); case 0x58331002: return ("ATI RS300_200 AGP bridge"); - }; + } return NULL; } @@ -199,7 +199,7 @@ agp_ati_attach(device_t dev) default: /* Unknown chipset */ return EINVAL; - }; + } rid = ATI_GART_MMADDR; sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); Modified: head/sys/dev/agp/agp_intel.c ============================================================================== --- head/sys/dev/agp/agp_intel.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_intel.c Tue Jan 1 18:16:49 2013 (r244926) @@ -105,7 +105,7 @@ agp_intel_match(device_t dev) return ("Intel 82845G host to AGP bridge"); case 0x35808086: return ("Intel 82855GM host to AGP bridge"); - }; + } return (NULL); } Modified: head/sys/dev/agp/agp_sis.c ============================================================================== --- head/sys/dev/agp/agp_sis.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_sis.c Tue Jan 1 18:16:49 2013 (r244926) @@ -101,7 +101,7 @@ agp_sis_match(device_t dev) return ("SiS 745 host to AGP bridge"); case 0x07461039: return ("SiS 746 host to AGP bridge"); - }; + } return NULL; } Modified: head/sys/dev/agp/agp_via.c ============================================================================== --- head/sys/dev/agp/agp_via.c Tue Jan 1 16:14:48 2013 (r244925) +++ head/sys/dev/agp/agp_via.c Tue Jan 1 18:16:49 2013 (r244926) @@ -135,7 +135,7 @@ agp_via_match(device_t dev) return ("VIA PT880 host to PCI bridge"); case 0xb1981106: return ("VIA VT83xx/VT87xx/KTxxx/Px8xx host to PCI bridge"); - }; + } return NULL; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:25:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DACD5E69; Tue, 1 Jan 2013 18:25:14 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD38C8FC08; Tue, 1 Jan 2013 18:25:14 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01IPEkJ013729; Tue, 1 Jan 2013 18:25:14 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01IPESx013728; Tue, 1 Jan 2013 18:25:14 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201301011825.r01IPESx013728@svn.freebsd.org> From: Antoine Brodin Date: Tue, 1 Jan 2013 18:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244927 - head/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:25:14 -0000 Author: antoine Date: Tue Jan 1 18:25:14 2013 New Revision: 244927 URL: http://svnweb.freebsd.org/changeset/base/244927 Log: Add missing DPADD. Modified: head/usr.bin/m4/Makefile Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Tue Jan 1 18:16:49 2013 (r244926) +++ head/usr.bin/m4/Makefile Tue Jan 1 18:25:14 2013 (r244927) @@ -6,6 +6,7 @@ PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib +DPADD= ${LIBY} ${LIBL} ${LIBM} LDADD= -ly -ll -lm # clang needs 1 while with gcc we can use 2 #WARNS= 1 From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:28:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE3BC1C5; Tue, 1 Jan 2013 18:28:21 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C38098FC08; Tue, 1 Jan 2013 18:28:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01ISLhA014269; Tue, 1 Jan 2013 18:28:21 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01ISLSB014268; Tue, 1 Jan 2013 18:28:21 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201301011828.r01ISLSB014268@svn.freebsd.org> From: Antoine Brodin Date: Tue, 1 Jan 2013 18:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244929 - head/sbin/pflogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:28:21 -0000 Author: antoine Date: Tue Jan 1 18:28:21 2013 New Revision: 244929 URL: http://svnweb.freebsd.org/changeset/base/244929 Log: pflogd does not depend on libutil Modified: head/sbin/pflogd/Makefile Modified: head/sbin/pflogd/Makefile ============================================================================== --- head/sbin/pflogd/Makefile Tue Jan 1 18:26:12 2013 (r244928) +++ head/sbin/pflogd/Makefile Tue Jan 1 18:28:21 2013 (r244929) @@ -9,7 +9,7 @@ MAN= pflogd.8 CFLAGS+=-include ${.CURDIR}/../../lib/libpcap/config.h LDADD= -lpcap -DPADD= ${LIBPCAP} ${LIBUTIL} +DPADD= ${LIBPCAP} WARNS?= 2 From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:29:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB83248C; Tue, 1 Jan 2013 18:29:26 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8ED428FC0A; Tue, 1 Jan 2013 18:29:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01ITQXJ014503; Tue, 1 Jan 2013 18:29:26 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01ITQdp014502; Tue, 1 Jan 2013 18:29:26 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201301011829.r01ITQdp014502@svn.freebsd.org> From: Antoine Brodin Date: Tue, 1 Jan 2013 18:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244931 - head/lib/libbsnmp/libbsnmp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:29:26 -0000 Author: antoine Date: Tue Jan 1 18:29:25 2013 New Revision: 244931 URL: http://svnweb.freebsd.org/changeset/base/244931 Log: Add missing DPADD Modified: head/lib/libbsnmp/libbsnmp/Makefile Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Tue Jan 1 18:29:04 2013 (r244930) +++ head/lib/libbsnmp/libbsnmp/Makefile Tue Jan 1 18:29:25 2013 (r244931) @@ -15,6 +15,7 @@ CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES .if ${MK_OPENSSL} != "no" CFLAGS+= -DHAVE_LIBCRYPTO +DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto .endif From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:31:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC0EC786; Tue, 1 Jan 2013 18:31:21 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFFDC8FC0C; Tue, 1 Jan 2013 18:31:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01IVLqw014964; Tue, 1 Jan 2013 18:31:21 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01IVLFG014963; Tue, 1 Jan 2013 18:31:21 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201301011831.r01IVLFG014963@svn.freebsd.org> From: Antoine Brodin Date: Tue, 1 Jan 2013 18:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244933 - head/gnu/usr.bin/dialog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:31:22 -0000 Author: antoine Date: Tue Jan 1 18:31:21 2013 New Revision: 244933 URL: http://svnweb.freebsd.org/changeset/base/244933 Log: Fix a dependency Modified: head/gnu/usr.bin/dialog/Makefile Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Tue Jan 1 18:30:57 2013 (r244932) +++ head/gnu/usr.bin/dialog/Makefile Tue Jan 1 18:31:21 2013 (r244933) @@ -3,7 +3,7 @@ DIALOG= ${.CURDIR}/../../../contrib/dialog PROG= dialog -DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBM} +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} LDADD= -ldialog -lncursesw -lm CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:34:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82EC2A18; Tue, 1 Jan 2013 18:34:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by mx1.freebsd.org (Postfix) with ESMTP id 155358FC08; Tue, 1 Jan 2013 18:34:37 +0000 (UTC) Received: by mail-ob0-f174.google.com with SMTP id ta14so12260234obb.19 for ; Tue, 01 Jan 2013 10:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8KAVvu0mk/CrwoJl5rke+7qmD4TK8LGUghwqXYUGCc4=; b=ihGFcO/FcdGcp6i7xTmF733PDOfHdxWkrnPiwtWB0kROuiT8sYiOpWmLrL8ib8Uxb0 T+qjO0RmNbkt2N8qm5eLwG4t3YYVIQ7WXCsw75K0oVogKFOUj3+de7lAzu0mnqc5JjA8 rcOvz3O9ctNoCBYEM/qbuT724fuMvaSUeRb/YdTD68WXCIg6TVJY+WZxKu5Gin/RmIaZ Wf2zbsC+Hz/GtGrCGyquXxW8zZOxJWfE5jmTOUNwIFS+r72LpfmLHYOIWOMJ2e5V2ao/ c5gIWVSEhphEyyZHcbNeNmfpRgRgq1EfVDrRoZNWTjf+lTcjwb3qr+BqzuueyFTekelV ZanA== MIME-Version: 1.0 Received: by 10.60.172.178 with SMTP id bd18mr25446294oec.133.1357065271109; Tue, 01 Jan 2013 10:34:31 -0800 (PST) Received: by 10.76.143.33 with HTTP; Tue, 1 Jan 2013 10:34:30 -0800 (PST) In-Reply-To: <201212311106.qBVB6chM016661@svn.freebsd.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> Date: Tue, 1 Jan 2013 10:34:30 -0800 Message-ID: Subject: Re: svn commit: r244899 - head/sys/mips/beri From: Garrett Cooper To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:34:38 -0000 On Mon, Dec 31, 2012 at 3:06 AM, Robert Watson wrote: > Author: rwatson > Date: Mon Dec 31 11:06:37 2012 > New Revision: 244899 > URL: http://svnweb.freebsd.org/changeset/base/244899 > > Log: > If FDT is compiled into a FreeBSD/beri kernel, initialise OpenFirmware. > > Sponsored by: DARPA, AFRL This broke the mips:mips64 tinderbox: /obj/src/make.amd64/make -V CFILES_NOZFS -V SYSTEM_CFILES -V GEN_CFILES | MKDEP_CPP="cc -E" CC="cc" xargs mkdep -a -f .newdep -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ipfilter -I/src/sys/dev/ath -I/src/sys/dev/ath/ath_hal -I/src/sys/contrib/ngatm -I/src/sys/dev/twa -I/src/sys/dev/cxgb -I/src/sys/dev/cxgbe -I/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000 -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0xffffffff80100000 -march=mips64 -mabi=64 -msoft-float -ffreestanding In file included from /src/sys/dev/fdt/fdt_common.h:37, from /src/sys/mips/beri/beri_machdep.c:58: /src/sys/dev/ofw/ofw_bus.h:36:24: error: ofw_bus_if.h: No such file or directory mkdep: compile failed *** [.depend] Error code 1 The patch I committed to my git repo fixes that by adding ofw_bus_if.m to files.beri ( https://github.com/yaneurabeya/freebsd/commit/ac9221dc567c67822b6f61cadbfac3fc1e32df04 ). Thanks! -Garrett [gcooper@bayonetta /scratch/git/github/yaneurabeya-freebsd-head]$ make KERNCONF=BERI_DE4_MDROOT TARGET=mips TARGET_ARCH=mips64 buildkernel ... cc -shared -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0xffffffff80100000 -march=mips64 -mabi=64 -nostdlib hack.c -o hack.So rm -f hack.c sed s/KERNLOADADDR/0xffffffff80100000/g /scratch/git/github/yaneurabeya-freebsd-head/sys/conf/ldscript.mips > ldscript.mips MAKE=make sh /scratch/git/github/yaneurabeya-freebsd-head/sys/conf/newvers.sh BERI_DE4_MDROOT cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/scratch/git/github/yaneurabeya-freebsd-head/sys -I/scratch/git/github/yaneurabeya-freebsd-head/sys/contrib/altq -I/scratch/git/github/yaneurabeya-freebsd-head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000 -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0xffffffff80100000 -march=mips64 -mabi=64 -msoft-float -ffreestanding -Werror vers.c linking kernel.debug text data bss dec hex filename 4108957 8653440 283024 13045421 c70ead kernel.debug objcopy --only-keep-debug kernel.debug kernel.symbols objcopy --strip-debug --add-gnu-debuglink=kernel.symbols kernel.debug kernel objcopy --strip-symbol '$d' --strip-symbol '$a' -g --strip-symbol '$t' kernel.debug kernel.tmp sed -e s/0xffffffff80100000/0x807963c0/ -e s/" + SIZEOF_HEADERS"// ldscript.mips > ldscript.mips.tramp.noheader cc -O -nostdlib -I. -I/scratch/git/github/yaneurabeya-freebsd-head/sys -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0xffffffff80100000 -march=mips64 -mabi=64 -Xlinker -T -Xlinker ldscript.mips.tramp.noheader -DKERNNAME="\"kernel.tmp\"" -DELFSIZE=64 /scratch/git/github/yaneurabeya-freebsd-head/sys/mips/mips/elf_trampoline.c /scratch/git/github/yaneurabeya-freebsd-head/sys/mips/mips/inckern.S -o kernel.tramp.elf objcopy -S -O binary kernel.tramp.elf kernel.tramp.bin cd /scratch/git/github/yaneurabeya-freebsd-head/sys/modules; MAKEOBJDIRPREFIX=/usr/obj/mips.mips64/scratch/git/github/yaneurabeya-freebsd-head/sys/BERI_DE4_MDROOT/modules KMODDIR=/boot/kernel MACHINE_CPUARCH=mips MODULES_OVERRIDE="""" DEBUG_FLAGS="-g" MACHINE=mips MACHINE_ARCH=mips64 KERNBUILDDIR="/usr/obj/mips.mips64/scratch/git/github/yaneurabeya-freebsd-head/sys/BERI_DE4_MDROOT" SYSDIR="/scratch/git/github/yaneurabeya-freebsd-head/sys" make all -------------------------------------------------------------- >>> Kernel build for BERI_DE4_MDROOT completed on Tue Jan 1 10:31:25 PST 2013 -------------------------------------------------------------- From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 18:55:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92AE46BA; Tue, 1 Jan 2013 18:55:05 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 74ACA8FC0A; Tue, 1 Jan 2013 18:55:05 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01It5IT019025; Tue, 1 Jan 2013 18:55:05 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01It5p7019023; Tue, 1 Jan 2013 18:55:05 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301011855.r01It5p7019023@svn.freebsd.org> From: Tim Kientzle Date: Tue, 1 Jan 2013 18:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244939 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 18:55:05 -0000 Author: kientzle Date: Tue Jan 1 18:55:04 2013 New Revision: 244939 URL: http://svnweb.freebsd.org/changeset/base/244939 Log: Overhauled CPSW driver for TI CPSW Ethernet module (as used in AM335x SoC for BeagleBone). Among other things: * Watchdog reset doesn't hang the driver. * Disconnecting cable doesn't hang the driver. * ifconfig up/down doesn't hang the driver * Out-of-memory no longer panics the driver. Known issues: * Doesn't have good support for fragmented packets (calls m_defrag() on TX, assumes RX packets are never fragmented) * Promisc and allmulti still unimplimented * addmulti and delmulti still unimplemented * TX queue still stalls (but watchdog now consistently recovers in ~5s) * No sysctl monitoring * Only supports port0 * No switch configuration support * Not tested on anything but BeagleBone Committed from: BeagleBone Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Tue Jan 1 18:54:55 2013 (r244938) +++ head/sys/arm/ti/cpsw/if_cpsw.c Tue Jan 1 18:55:04 2013 (r244939) @@ -95,9 +95,9 @@ static void cpsw_start(struct ifnet *ifp static void cpsw_start_locked(struct ifnet *ifp); static void cpsw_stop_locked(struct cpsw_softc *sc); static int cpsw_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static int cpsw_allocate_dma(struct cpsw_softc *sc); -static int cpsw_free_dma(struct cpsw_softc *sc); -static int cpsw_new_rxbuf(struct cpsw_softc *sc, uint32_t i, uint32_t next); +static int cpsw_init_slot_lists(struct cpsw_softc *sc); +static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); +static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); static void cpsw_watchdog(struct cpsw_softc *sc); static void cpsw_intr_rx_thresh(void *arg); @@ -156,10 +156,10 @@ static struct { driver_intr_t *handler; char * description; } cpsw_intrs[CPSW_INTR_COUNT + 1] = { - { cpsw_intr_rx_thresh,"CPSW RX threshold interrupt" }, + { cpsw_intr_rx_thresh, "CPSW RX threshold interrupt" }, { cpsw_intr_rx, "CPSW RX interrupt" }, { cpsw_intr_tx, "CPSW TX interrupt" }, - { cpsw_intr_misc,"CPSW misc interrupt" }, + { cpsw_intr_misc, "CPSW misc interrupt" }, }; /* Locking macros */ @@ -199,6 +199,34 @@ static struct { } while (0) +#include +static void +cpsw_debugf_head(const char *funcname) +{ + int t = (int)(time_second % (24 * 60 * 60)); + + printf("%02d:%02d:%02d %s ", t / (60 * 60), (t / 60) % 60, t % 60, funcname); +} + +static void +cpsw_debugf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); + +} + +#define CPSW_DEBUGF(a) do { \ + if (sc->cpsw_if_flags & IFF_DEBUG) { \ + cpsw_debugf_head(__func__); \ + cpsw_debugf a; \ + } \ +} while (0) + static int cpsw_probe(device_t dev) { @@ -213,18 +241,20 @@ cpsw_probe(device_t dev) static int cpsw_attach(device_t dev) { - struct cpsw_softc *sc; + struct cpsw_softc *sc = device_get_softc(dev); struct mii_softc *miisc; struct ifnet *ifp; + void *phy_sc; int i, error, phy; uint32_t reg; - sc = device_get_softc(dev); + CPSW_DEBUGF(("")); + sc->dev = dev; sc->node = ofw_bus_get_node(dev); /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, sc->dev, &phy, (void **)&sc->phy_sc) != 0) { + if (fdt_get_phyaddr(sc->node, sc->dev, &phy, &phy_sc) != 0) { device_printf(dev, "failed to get PHY address from FDT\n"); return (ENXIO); } @@ -246,14 +276,32 @@ cpsw_attach(device_t dev) device_printf(dev, "Version %d.%d (%d)\n", (reg >> 8 & 0x7), reg & 0xFF, (reg >> 11) & 0x1F); - /* Allocate DMA, buffers, buffer descriptors */ - error = cpsw_allocate_dma(sc); + //cpsw_add_sysctls(sc); TODO + + /* Allocate a busdma tag and DMA safe memory for mbufs. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->mbuf_dtag); /* dmatag */ if (error) { + device_printf(dev, "bus_dma_tag_create failed\n"); cpsw_detach(dev); - return (ENXIO); + return (ENOMEM); } - //cpsw_add_sysctls(sc); TODO + /* Initialize the tx_avail and rx_avail lists. */ + error = cpsw_init_slot_lists(sc); + if (error) { + device_printf(dev, "failed to allocate dmamaps\n"); + cpsw_detach(dev); + return (ENOMEM); + } /* Allocate network interface */ ifp = sc->ifp = if_alloc(IFT_ETHER); @@ -294,7 +342,7 @@ cpsw_attach(device_t dev) /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ - cpsw_write_4(MDIOCONTROL, (1<<30) | (1<<18) | 0xFF); + cpsw_write_4(MDIOCONTROL, 1 << 30 | 1 << 18 | 0xFF); /* Attach PHY(s) */ error = mii_attach(dev, &sc->miibus, ifp, cpsw_ifmedia_upd, @@ -310,7 +358,7 @@ cpsw_attach(device_t dev) miisc = LIST_FIRST(&sc->mii->mii_phys); /* Select PHY and enable interrupts */ - cpsw_write_4(MDIOUSERPHYSEL0, (1 << 6) | (miisc->mii_phy & 0x1F)); + cpsw_write_4(MDIOUSERPHYSEL0, 1 << 6 | (miisc->mii_phy & 0x1F)); /* Attach interrupt handlers */ for (i = 1; i <= CPSW_INTR_COUNT; ++i) { @@ -332,17 +380,22 @@ cpsw_attach(device_t dev) static int cpsw_detach(device_t dev) { - struct cpsw_softc *sc; - int error,i; + struct cpsw_softc *sc = device_get_softc(dev); + int error, i; - sc = device_get_softc(dev); + CPSW_DEBUGF(("")); /* Stop controller and free TX queue */ - if (sc->ifp) - cpsw_shutdown(dev); + if (device_is_attached(dev)) { + ether_ifdetach(sc->ifp); + CPSW_GLOBAL_LOCK(sc); + cpsw_stop_locked(sc); + CPSW_GLOBAL_UNLOCK(sc); + callout_drain(&sc->wd_callout); + } - /* Wait for stopping ticks */ - callout_drain(&sc->wd_callout); + bus_generic_detach(dev); + device_delete_child(dev, sc->miibus); /* Stop and release all interrupts */ for (i = 0; i < CPSW_INTR_COUNT; ++i) { @@ -355,14 +408,17 @@ cpsw_detach(device_t dev) cpsw_intrs[i + 1].description); } - /* Detach network interface */ - if (sc->ifp) { - ether_ifdetach(sc->ifp); - if_free(sc->ifp); + /* Free dmamaps and mbufs */ + for (i = 0; i < CPSW_MAX_TX_BUFFERS; i++) { + cpsw_free_slot(sc, &sc->_tx_slots[i]); + } + for (i = 0; i < CPSW_MAX_RX_BUFFERS; i++) { + cpsw_free_slot(sc, &sc->_rx_slots[i]); } - /* Free DMA resources */ - cpsw_free_dma(sc); + /* Free DMA tag */ + error = bus_dma_tag_destroy(sc->mbuf_dtag); + KASSERT(error == 0, ("Unable to destroy DMA tag")); /* Free IO memory handler */ bus_release_resources(dev, res_spec, sc->res); @@ -377,15 +433,19 @@ cpsw_detach(device_t dev) static int cpsw_suspend(device_t dev) { + struct cpsw_softc *sc = device_get_softc(dev); - device_printf(dev, "%s\n", __FUNCTION__); + CPSW_DEBUGF(("")); + CPSW_GLOBAL_LOCK(sc); + cpsw_stop_locked(sc); + CPSW_GLOBAL_UNLOCK(sc); return (0); } static int cpsw_resume(device_t dev) { - + /* XXX TODO XXX */ device_printf(dev, "%s\n", __FUNCTION__); return (0); } @@ -395,208 +455,132 @@ cpsw_shutdown(device_t dev) { struct cpsw_softc *sc = device_get_softc(dev); + CPSW_DEBUGF(("")); CPSW_GLOBAL_LOCK(sc); - cpsw_stop_locked(sc); - CPSW_GLOBAL_UNLOCK(sc); - return (0); } static int -cpsw_miibus_readreg(device_t dev, int phy, int reg) +cpsw_miibus_ready(struct cpsw_softc *sc) { - struct cpsw_softc *sc; - uint32_t r; - uint32_t retries = CPSW_MIIBUS_RETRIES; + uint32_t r, retries = CPSW_MIIBUS_RETRIES; - sc = device_get_softc(dev); - - /* Wait until interface is ready by watching GO bit */ - while(--retries && (cpsw_read_4(MDIOUSERACCESS0) & (1 << 31)) ) + while (--retries) { + r = cpsw_read_4(MDIOUSERACCESS0); + if ((r & 1 << 31) == 0) + return 1; DELAY(CPSW_MIIBUS_DELAY); - if (!retries) - device_printf(dev, "Timeout while waiting for MDIO.\n"); + } + return 0; +} - /* Set GO, phy and reg */ - cpsw_write_4(MDIOUSERACCESS0, (1 << 31) | - ((reg & 0x1F) << 21) | ((phy & 0x1F) << 16)); +static int +cpsw_miibus_readreg(device_t dev, int phy, int reg) +{ + struct cpsw_softc *sc = device_get_softc(dev); + uint32_t cmd, r; - while(--retries && (cpsw_read_4(MDIOUSERACCESS0) & (1 << 31)) ) - DELAY(CPSW_MIIBUS_DELAY); - if (!retries) - device_printf(dev, "Timeout while waiting for MDIO.\n"); + if (!cpsw_miibus_ready(sc)) { + device_printf(dev, "MDIO not ready to read\n"); + return 0; + } + + /* Set GO, reg, phy */ + cmd = 1 << 31 | (reg & 0x1F) << 21 | (phy & 0x1F) << 16; + cpsw_write_4(MDIOUSERACCESS0, cmd); + + if (!cpsw_miibus_ready(sc)) { + device_printf(dev, "MDIO timed out during read\n"); + return 0; + } r = cpsw_read_4(MDIOUSERACCESS0); - /* Check for ACK */ - if(r & (1<<29)) { - return (r & 0xFFFF); + if((r & 1 << 29) == 0) { + device_printf(dev, "Failed to read from PHY.\n"); + r = 0; } - device_printf(dev, "Failed to read from PHY.\n"); - return 0; + return (r & 0xFFFF); } static int cpsw_miibus_writereg(device_t dev, int phy, int reg, int value) { - struct cpsw_softc *sc; - uint32_t retries = CPSW_MIIBUS_RETRIES; - - sc = device_get_softc(dev); - - /* Wait until interface is ready by watching GO bit */ - while(--retries && (cpsw_read_4(MDIOUSERACCESS0) & (1 << 31)) ) - DELAY(CPSW_MIIBUS_DELAY); - if (!retries) - device_printf(dev, "Timeout while waiting for MDIO.\n"); + struct cpsw_softc *sc = device_get_softc(dev); + uint32_t cmd; - /* Set GO, WRITE, phy, reg and value */ - cpsw_write_4(MDIOUSERACCESS0, (value & 0xFFFF) | (3 << 30) | - ((reg & 0x1F) << 21) | ((phy & 0x1F) << 16)); + if (!cpsw_miibus_ready(sc)) { + device_printf(dev, "MDIO not ready to write\n"); + return 0; + } - while(--retries && (cpsw_read_4(MDIOUSERACCESS0) & (1 << 31)) ) - DELAY(CPSW_MIIBUS_DELAY); - if (!retries) - device_printf(dev, "Timeout while waiting for MDIO.\n"); + /* Set GO, WRITE, reg, phy, and value */ + cmd = 3 << 30 | (reg & 0x1F) << 21 | (phy & 0x1F) << 16 + | (value & 0xFFFF); + cpsw_write_4(MDIOUSERACCESS0, cmd); - /* Check for ACK */ - if(cpsw_read_4(MDIOUSERACCESS0) & (1<<29)) { + if (!cpsw_miibus_ready(sc)) { + device_printf(dev, "MDIO timed out during write\n"); return 0; } - device_printf(dev, "Failed to write to PHY.\n"); + + if((cpsw_read_4(MDIOUSERACCESS0) & (1 << 29)) == 0) + device_printf(dev, "Failed to write to PHY.\n"); return 0; } static int -cpsw_allocate_dma(struct cpsw_softc *sc) +cpsw_init_slot_lists(struct cpsw_softc *sc) { - int err; int i; - /* Allocate a busdma tag and DMA safe memory for tx mbufs. */ - err = bus_dma_tag_create( - bus_get_dma_tag(sc->dev), /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES, 1, /* maxsize, nsegments */ - MCLBYTES, 0, /* maxsegsz, flags */ - NULL, NULL, /* lockfunc, lockfuncarg */ - &sc->mbuf_dtag); /* dmatag */ + STAILQ_INIT(&sc->rx_active); + STAILQ_INIT(&sc->rx_avail); + STAILQ_INIT(&sc->tx_active); + STAILQ_INIT(&sc->tx_avail); - if (err) - return (ENOMEM); + /* Put the slot descriptors onto the avail lists. */ for (i = 0; i < CPSW_MAX_TX_BUFFERS; i++) { - if ( bus_dmamap_create(sc->mbuf_dtag, 0, &sc->tx_dmamap[i])) { - if_printf(sc->ifp, "failed to create dmamap for rx mbuf\n"); + struct cpsw_slot *slot = &sc->_tx_slots[i]; + slot->index = i; + /* XXX TODO: Remove this from here; allocate dmamaps lazily + in the encap routine to reduce memory usage. */ + if (bus_dmamap_create(sc->mbuf_dtag, 0, &slot->dmamap)) { + if_printf(sc->ifp, "failed to create dmamap for tx mbuf\n"); return (ENOMEM); } + STAILQ_INSERT_TAIL(&sc->tx_avail, slot, next); } for (i = 0; i < CPSW_MAX_RX_BUFFERS; i++) { - if ( bus_dmamap_create(sc->mbuf_dtag, 0, &sc->rx_dmamap[i])) { + struct cpsw_slot *slot = &sc->_rx_slots[i]; + slot->index = i; + if (bus_dmamap_create(sc->mbuf_dtag, 0, &slot->dmamap)) { if_printf(sc->ifp, "failed to create dmamap for rx mbuf\n"); return (ENOMEM); } + STAILQ_INSERT_TAIL(&sc->rx_avail, slot, next); } return (0); } -static int -cpsw_free_dma(struct cpsw_softc *sc) -{ - (void)sc; /* UNUSED */ - // TODO - return 0; -} - -static int -cpsw_new_rxbuf(struct cpsw_softc *sc, uint32_t i, uint32_t next) -{ - bus_dma_segment_t seg[1]; - struct cpsw_cpdma_bd bd; - int error; - int nsegs; - - sc->rx_mbuf[i] = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (sc->rx_mbuf[i] == NULL) - return (ENOBUFS); - - sc->rx_mbuf[i]->m_len = sc->rx_mbuf[i]->m_pkthdr.len = sc->rx_mbuf[i]->m_ext.ext_size; - - error = bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->rx_dmamap[i], - sc->rx_mbuf[i], seg, &nsegs, BUS_DMA_NOWAIT); - - KASSERT(nsegs == 1, ("Too many segments returned!")); - if (nsegs != 1 || error) - panic("%s: nsegs(%d), error(%d)",__func__, nsegs, error); - - bus_dmamap_sync(sc->mbuf_dtag, sc->rx_dmamap[i], BUS_DMASYNC_PREREAD); - - /* Create and submit new rx descriptor*/ - bd.next = next; - bd.bufptr = seg->ds_addr; - bd.buflen = MCLBYTES-1; - bd.bufoff = 2; /* make IP hdr aligned with 4 */ - bd.pktlen = 0; - bd.flags = CPDMA_BD_OWNER; - cpsw_cpdma_write_rxbd(i, &bd); - - return (0); -} - - -static int -cpsw_encap(struct cpsw_softc *sc, struct mbuf *m0) +static void +cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot) { - bus_dma_segment_t seg[1]; - struct cpsw_cpdma_bd bd; int error; - int nsegs; - int idx; - if (sc->txbd_queue_size == CPSW_MAX_TX_BUFFERS) - return (ENOBUFS); - - idx = sc->txbd_head + sc->txbd_queue_size; - - if (idx >= (CPSW_MAX_TX_BUFFERS) ) - idx -= CPSW_MAX_TX_BUFFERS; - - /* Create mapping in DMA memory */ - error = bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->tx_dmamap[idx], m0, seg, &nsegs, - BUS_DMA_NOWAIT); - sc->tc[idx]++; - if (error != 0 || nsegs != 1 ) { - bus_dmamap_unload(sc->mbuf_dtag, sc->tx_dmamap[idx]); - return ((error != 0) ? error : -1); - } - bus_dmamap_sync(sc->mbuf_dtag, sc->tx_dmamap[idx], BUS_DMASYNC_PREWRITE); - - /* Fill descriptor data */ - bd.next = 0; - bd.bufptr = seg->ds_addr; - bd.bufoff = 0; - bd.buflen = seg->ds_len; - bd.pktlen = seg->ds_len; - /* Set OWNERSHIP, SOP, EOP */ - bd.flags = (7<<13); - - /* Write descriptor */ - cpsw_cpdma_write_txbd(idx, &bd); - sc->tx_mbuf[idx] = m0; - - /* Previous descriptor should point to us */ - cpsw_cpdma_write_txbd_next(((idx-1<0)?(CPSW_MAX_TX_BUFFERS-1):(idx-1)), - cpsw_cpdma_txbd_paddr(idx)); - - sc->txbd_queue_size++; - - return (0); + if (slot->dmamap) { + error = bus_dmamap_destroy(sc->mbuf_dtag, slot->dmamap); + KASSERT(error == 0, ("Mapping still active")); + slot->dmamap = NULL; + } + if (slot->mbuf) { + m_freem(slot->mbuf); + slot->mbuf = NULL; + } } /* @@ -655,10 +639,13 @@ cpsw_start(struct ifnet *ifp) static void cpsw_start_locked(struct ifnet *ifp) { + bus_dma_segment_t seg[1]; + struct cpsw_cpdma_bd bd; struct cpsw_softc *sc = ifp->if_softc; + struct cpsw_queue newslots = STAILQ_HEAD_INITIALIZER(newslots); + struct cpsw_slot *slot, *prev_slot = NULL, *first_new_slot; struct mbuf *m0, *mtmp; - uint32_t queued = 0; - int error; + int error, nsegs, enqueued = 0; CPSW_TX_LOCK_ASSERT(sc); @@ -666,44 +653,111 @@ cpsw_start_locked(struct ifnet *ifp) IFF_DRV_RUNNING) return; + /* Pull pending packets from IF queue and prep them for DMA. */ for (;;) { - /* Get packet from the queue */ + slot = STAILQ_FIRST(&sc->tx_avail); + if (slot == NULL) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } + IF_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) break; if ((error = cpsw_pad(m0))) { + if_printf(ifp, + "%s: Dropping packet; could not pad\n", __func__); m_freem(m0); continue; } + /* TODO: don't defragment here, queue each + packet fragment as a separate entry. */ mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; - if (cpsw_encap(sc, m0)) { - IF_PREPEND(&ifp->if_snd, m0); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + slot->mbuf = m0; + /* Create mapping in DMA memory */ + error = bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, slot->dmamap, + m0, seg, &nsegs, BUS_DMA_NOWAIT); + KASSERT(nsegs == 1, ("More than one segment (nsegs=%d)", nsegs)); + KASSERT(error == 0, ("DMA error (error=%d)", error)); + if (error != 0 || nsegs != 1) { + if_printf(ifp, + "%s: Can't load packet for DMA (nsegs=%d, error=%d), dropping packet\n", + __func__, nsegs, error); + bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); + m_freem(m0); break; } - queued++; + bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, + BUS_DMASYNC_PREWRITE); + + if (prev_slot != NULL) + cpsw_cpdma_write_txbd_next(prev_slot->index, + cpsw_cpdma_txbd_paddr(slot->index)); + bd.next = 0; + bd.bufptr = seg->ds_addr; + bd.bufoff = 0; + bd.buflen = seg->ds_len; + bd.pktlen = seg->ds_len; + bd.flags = 7 << 13; /* Set OWNERSHIP, SOP, EOP */ + cpsw_cpdma_write_txbd(slot->index, &bd); + ++enqueued; + + prev_slot = slot; + STAILQ_REMOVE_HEAD(&sc->tx_avail, next); + STAILQ_INSERT_TAIL(&newslots, slot, next); BPF_MTAP(ifp, m0); } - if (!queued) + if (STAILQ_EMPTY(&newslots)) return; - if (sc->eoq) { - cpsw_write_4(CPSW_CPDMA_TX_HDP(0), cpsw_cpdma_txbd_paddr(sc->txbd_head)); - sc->eoq = 0; + /* Attach new segments to the hardware TX queue. */ + prev_slot = STAILQ_LAST(&sc->tx_active, cpsw_slot, next); + first_new_slot = STAILQ_FIRST(&newslots); + STAILQ_CONCAT(&sc->tx_active, &newslots); + if (prev_slot == NULL) { + /* Start the TX queue fresh. */ + cpsw_write_4(CPSW_CPDMA_TX_HDP(0), + cpsw_cpdma_txbd_paddr(first_new_slot->index)); + } else { + /* Add packets to current queue. */ + /* Race: The hardware might have sent the last packet + * on the queue and stopped the transmitter just + * before we got here. In that case, this is a no-op, + * but it also means there's a TX interrupt waiting + * to be processed as soon as we release the lock here. + * That TX interrupt can detect and recover from this + * situation; see cpsw_intr_tx_locked. + */ + cpsw_cpdma_write_txbd_next(prev_slot->index, + cpsw_cpdma_txbd_paddr(first_new_slot->index)); + } + /* If tx_retires hasn't changed, then we may have + lost a TX interrupt, so let the timer tick. */ + sc->tx_enqueues += enqueued; + if (sc->tx_retires_at_wd_reset != sc->tx_retires) { + sc->tx_retires_at_wd_reset = sc->tx_retires; + sc->wd_timer = 5; + } + sc->tx_queued += enqueued; + if (sc->tx_queued > sc->tx_max_queued) { + sc->tx_max_queued = sc->tx_queued; + CPSW_DEBUGF(("New TX high water mark %d", sc->tx_queued)); } - sc->wd_timer = 5; } static void cpsw_stop_locked(struct cpsw_softc *sc) { struct ifnet *ifp; + int i; + + CPSW_DEBUGF(("")); CPSW_GLOBAL_LOCK_ASSERT(sc); @@ -712,15 +766,89 @@ cpsw_stop_locked(struct cpsw_softc *sc) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - /* Stop tick engine */ - callout_stop(&sc->wd_callout); - /* Disable interface */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + /* Stop tick engine */ + callout_stop(&sc->wd_callout); sc->wd_timer = 0; - /* Disable interrupts TODO */ + /* Wait for hardware to clear pending ops. */ + CPSW_GLOBAL_UNLOCK(sc); + CPSW_DEBUGF(("starting RX and TX teardown")); + cpsw_write_4(CPSW_CPDMA_RX_TEARDOWN, 0); + cpsw_write_4(CPSW_CPDMA_TX_TEARDOWN, 0); + i = 0; + cpsw_intr_rx(sc); // Try clearing without delay. + cpsw_intr_tx(sc); + while (sc->rx_running || sc->tx_running) { + DELAY(10); + cpsw_intr_rx(sc); + cpsw_intr_tx(sc); + ++i; + } + CPSW_DEBUGF(("finished RX and TX teardown (%d tries)", i)); + CPSW_GLOBAL_LOCK(sc); + + /* All slots are now available */ + STAILQ_CONCAT(&sc->rx_avail, &sc->rx_active); + STAILQ_CONCAT(&sc->tx_avail, &sc->tx_active); + CPSW_DEBUGF(("%d buffers dropped at TX reset", sc->tx_queued)); + sc->tx_queued = 0; + + /* Reset writer */ + cpsw_write_4(CPSW_WR_SOFT_RESET, 1); + while (cpsw_read_4(CPSW_WR_SOFT_RESET) & 1) + ; + + /* Reset SS */ + cpsw_write_4(CPSW_SS_SOFT_RESET, 1); + while (cpsw_read_4(CPSW_SS_SOFT_RESET) & 1) + ; + + /* Reset Sliver port 1 and 2 */ + for (i = 0; i < 2; i++) { + /* Reset */ + cpsw_write_4(CPSW_SL_SOFT_RESET(i), 1); + while (cpsw_read_4(CPSW_SL_SOFT_RESET(i)) & 1) + ; + } + + /* Reset CPDMA */ + cpsw_write_4(CPSW_CPDMA_SOFT_RESET, 1); + while (cpsw_read_4(CPSW_CPDMA_SOFT_RESET) & 1) + ; + + /* Disable TX & RX DMA */ + cpsw_write_4(CPSW_CPDMA_TX_CONTROL, 0); + cpsw_write_4(CPSW_CPDMA_RX_CONTROL, 0); + + /* Disable TX and RX interrupts for all cores. */ + for (i = 0; i < 3; ++i) { + cpsw_write_4(CPSW_WR_C_TX_EN(i), 0x00); + cpsw_write_4(CPSW_WR_C_RX_EN(i), 0x00); + cpsw_write_4(CPSW_WR_C_MISC_EN(i), 0x00); + } + + /* Clear all interrupt Masks */ + cpsw_write_4(CPSW_CPDMA_RX_INTMASK_CLEAR, 0xFFFFFFFF); + cpsw_write_4(CPSW_CPDMA_TX_INTMASK_CLEAR, 0xFFFFFFFF); +} + +static void +cpsw_set_promisc(struct cpsw_softc *sc, int set) +{ + if (set) { + printf("Promiscuous mode unimplemented\n"); + } +} +static void +cpsw_set_allmulti(struct cpsw_softc *sc, int set) +{ + if (set) { + printf("All-multicast mode unimplemented\n"); + } } static int @@ -729,53 +857,48 @@ cpsw_ioctl(struct ifnet *ifp, u_long com struct cpsw_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error; - uint32_t flags; + uint32_t changed; + CPSW_DEBUGF(("command=0x%lx", command)); error = 0; - // FIXME switch (command) { case SIOCSIFFLAGS: CPSW_GLOBAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - flags = ifp->if_flags ^ sc->cpsw_if_flags; - if (flags & IFF_PROMISC) - printf("%s: SIOCSIFFLAGS " - "IFF_PROMISC unimplemented\n", - __func__); - - if (flags & IFF_ALLMULTI) - printf("%s: SIOCSIFFLAGS " - "IFF_ALLMULTI unimplemented\n", - __func__); + changed = ifp->if_flags ^ sc->cpsw_if_flags; + CPSW_DEBUGF(("SIOCSIFFLAGS: UP & RUNNING (changed=0x%x)", changed)); + if (changed & IFF_PROMISC) + cpsw_set_promisc(sc, + ifp->if_flags & IFF_PROMISC); + if (changed & IFF_ALLMULTI) + cpsw_set_allmulti(sc, + ifp->if_flags & IFF_ALLMULTI); } else { - printf("%s: SIOCSIFFLAGS cpsw_init_locked\n", __func__); - //cpsw_init_locked(sc); + CPSW_DEBUGF(("SIOCSIFFLAGS: UP but not RUNNING")); + cpsw_init_locked(sc); } - } - else if (ifp->if_drv_flags & IFF_DRV_RUNNING) + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + CPSW_DEBUGF(("SIOCSIFFLAGS: not UP but RUNNING")); cpsw_stop_locked(sc); + } sc->cpsw_if_flags = ifp->if_flags; CPSW_GLOBAL_UNLOCK(sc); break; case SIOCADDMULTI: - printf("%s: SIOCADDMULTI\n",__func__); + CPSW_DEBUGF(("SIOCADDMULTI unimplemented")); break; case SIOCDELMULTI: - printf("%s: SIOCDELMULTI\n",__func__); - break; - case SIOCSIFCAP: - printf("%s: SIOCSIFCAP\n",__func__); + CPSW_DEBUGF(("SIOCDELMULTI unimplemented")); break; case SIOCGIFMEDIA: - error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); - break; case SIOCSIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); break; default: + CPSW_DEBUGF(("ether ioctl")); error = ether_ioctl(ifp, command, data); } return (error); @@ -787,6 +910,7 @@ cpsw_ifmedia_sts(struct ifnet *ifp, stru struct cpsw_softc *sc = ifp->if_softc; struct mii_data *mii; + CPSW_DEBUGF(("")); CPSW_TX_LOCK(sc); mii = sc->mii; @@ -804,13 +928,12 @@ cpsw_ifmedia_upd(struct ifnet *ifp) { struct cpsw_softc *sc = ifp->if_softc; + CPSW_DEBUGF(("")); if (ifp->if_flags & IFF_UP) { CPSW_GLOBAL_LOCK(sc); - sc->cpsw_media_status = sc->mii->mii_media.ifm_media; mii_mediachg(sc->mii); cpsw_init_locked(sc); - CPSW_GLOBAL_UNLOCK(sc); } @@ -820,15 +943,18 @@ cpsw_ifmedia_upd(struct ifnet *ifp) static void cpsw_intr_rx_thresh(void *arg) { - (void)arg; /* UNUSED */ + struct cpsw_softc *sc = arg; + CPSW_DEBUGF(("")); } static void cpsw_intr_rx(void *arg) { struct cpsw_softc *sc = arg; + CPSW_RX_LOCK(sc); cpsw_intr_rx_locked(arg); + cpsw_write_4(CPSW_CPDMA_CPDMA_EOI_VECTOR, 1); CPSW_RX_UNLOCK(sc); } @@ -837,63 +963,155 @@ cpsw_intr_rx_locked(void *arg) { struct cpsw_softc *sc = arg; struct cpsw_cpdma_bd bd; + struct cpsw_slot *slot, *last_slot = NULL; struct ifnet *ifp; - int i; ifp = sc->ifp; + if (!sc->rx_running) + return; - i = sc->rxbd_head; - cpsw_cpdma_read_rxbd(i, &bd); - - while (bd.flags & CPDMA_BD_SOP) { - cpsw_write_4(CPSW_CPDMA_RX_CP(0), cpsw_cpdma_rxbd_paddr(i)); + /* Pull completed packets off hardware RX queue. */ + slot = STAILQ_FIRST(&sc->rx_active); + while (slot != NULL) { + cpsw_cpdma_read_rxbd(slot->index, &bd); + if (bd.flags & CPDMA_BD_OWNER) + break; /* Still in use by hardware */ + + if (bd.flags & CPDMA_BD_TDOWNCMPLT) { + CPSW_DEBUGF(("RX teardown in progress")); + cpsw_write_4(CPSW_CPDMA_RX_CP(0), 0xfffffffc); + sc->rx_running = 0; + return; + } - bus_dmamap_sync(sc->mbuf_dtag, sc->rx_dmamap[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->mbuf_dtag, sc->rx_dmamap[i]); + bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); /* Fill mbuf */ - sc->rx_mbuf[i]->m_hdr.mh_data += bd.bufoff; - sc->rx_mbuf[i]->m_hdr.mh_len = bd.pktlen - 4; - sc->rx_mbuf[i]->m_pkthdr.len = bd.pktlen - 4; - sc->rx_mbuf[i]->m_flags |= M_PKTHDR; - sc->rx_mbuf[i]->m_pkthdr.rcvif = ifp; + /* TODO: track SOP/EOP bits to assemble a full mbuf + out of received fragments. */ + slot->mbuf->m_hdr.mh_data += bd.bufoff; + slot->mbuf->m_hdr.mh_len = bd.pktlen - 4; + slot->mbuf->m_pkthdr.len = bd.pktlen - 4; + slot->mbuf->m_flags |= M_PKTHDR; + slot->mbuf->m_pkthdr.rcvif = ifp; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* check for valid CRC by looking into pkt_err[5:4] */ - if ( (bd.flags & CPDMA_BD_PKT_ERR_MASK) == 0 ) { - sc->rx_mbuf[i]->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - sc->rx_mbuf[i]->m_pkthdr.csum_flags |= CSUM_IP_VALID; - sc->rx_mbuf[i]->m_pkthdr.csum_data = 0xffff; + if ((bd.flags & CPDMA_BD_PKT_ERR_MASK) == 0) { + slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; + slot->mbuf->m_pkthdr.csum_data = 0xffff; } } /* Handover packet */ CPSW_RX_UNLOCK(sc); - (*ifp->if_input)(ifp, sc->rx_mbuf[i]); - sc->rx_mbuf[i] = NULL; + (*ifp->if_input)(ifp, slot->mbuf); + slot->mbuf = NULL; CPSW_RX_LOCK(sc); - /* Allocate new buffer for current descriptor */ - cpsw_new_rxbuf(sc, i, 0); + last_slot = slot; + STAILQ_REMOVE_HEAD(&sc->rx_active, next); + STAILQ_INSERT_TAIL(&sc->rx_avail, slot, next); + slot = STAILQ_FIRST(&sc->rx_active); + } + + /* Tell hardware last slot we processed. */ + if (last_slot) + cpsw_write_4(CPSW_CPDMA_RX_CP(0), + cpsw_cpdma_rxbd_paddr(last_slot->index)); - /* we are not at tail so old tail BD should point to new one */ - cpsw_cpdma_write_rxbd_next(sc->rxbd_tail, - cpsw_cpdma_rxbd_paddr(i)); - - /* Check if EOQ is reached */ - if (cpsw_cpdma_read_rxbd_flags(sc->rxbd_tail) & CPDMA_BD_EOQ) { - cpsw_write_4(CPSW_CPDMA_RX_HDP(0), cpsw_cpdma_rxbd_paddr(i)); + /* Repopulate hardware RX queue. */ + cpsw_fill_rx_queue_locked(sc); +} + +static void +cpsw_fill_rx_queue_locked(struct cpsw_softc *sc) +{ + bus_dma_segment_t seg[1]; + struct cpsw_queue tmpqueue = STAILQ_HEAD_INITIALIZER(tmpqueue); + struct cpsw_cpdma_bd bd; + struct cpsw_slot *slot, *prev_slot, *next_slot; + int error, nsegs; + + /* Try to allocate new mbufs. */ + STAILQ_FOREACH(slot, &sc->rx_avail, next) { + if (slot->mbuf != NULL) + continue; + slot->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (slot->mbuf == NULL) { + if_printf(sc->ifp, "Unable to fill RX queue\n"); + break; } - sc->rxbd_tail = i; + slot->mbuf->m_len = slot->mbuf->m_pkthdr.len = slot->mbuf->m_ext.ext_size; + } + + /* Register new mbufs with hardware. */ + prev_slot = NULL; + while (!STAILQ_EMPTY(&sc->rx_avail)) { + slot = STAILQ_FIRST(&sc->rx_avail); + if (slot->mbuf == NULL) + break; + + error = bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, slot->dmamap, + slot->mbuf, seg, &nsegs, BUS_DMA_NOWAIT); + + KASSERT(nsegs == 1, ("More than one segment (nsegs=%d)", nsegs)); + KASSERT(error == 0, ("DMA error (error=%d)", error)); + if (nsegs != 1 || error) { + if_printf(sc->ifp, + "%s: Can't prep RX buf for DMA (nsegs=%d, error=%d)\n", + __func__, nsegs, error); + m_freem(slot->mbuf); + slot->mbuf = NULL; + break; + } + + bus_dmamap_sync(sc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_PREREAD); - /* read next descriptor */ - if (++i == CPSW_MAX_RX_BUFFERS) - i = 0; - cpsw_cpdma_read_rxbd(i, &bd); - sc->rxbd_head = i; + /* Create and submit new rx descriptor*/ + bd.next = 0; + bd.bufptr = seg->ds_addr; + bd.buflen = MCLBYTES-1; + bd.bufoff = 2; /* make IP hdr aligned with 4 */ + bd.pktlen = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 19:20:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 695EFF2F; Tue, 1 Jan 2013 19:20:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB1B8FC13; Tue, 1 Jan 2013 19:20:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01JKqPG023562; Tue, 1 Jan 2013 19:20:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01JKqkI023561; Tue, 1 Jan 2013 19:20:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301011920.r01JKqkI023561@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 1 Jan 2013 19:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244941 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 19:20:52 -0000 Author: pfg Date: Tue Jan 1 19:20:51 2013 New Revision: 244941 URL: http://svnweb.freebsd.org/changeset/base/244941 Log: libedit: bind the correct command when using "bind -k". "ed-argument-digit" (i. e. command 0) was incorrectly used instead. This bug comes from the original sources imported in 1994 and has been confirmed in upstream NetBSD. Reported by: Yamagi Burmeister Submitted by: Christoph Mallon MFC after: 3 days Modified: head/lib/libedit/map.c Modified: head/lib/libedit/map.c ============================================================================== --- head/lib/libedit/map.c Tue Jan 1 18:55:49 2013 (r244940) +++ head/lib/libedit/map.c Tue Jan 1 19:20:51 2013 (r244941) @@ -1250,7 +1250,7 @@ map_bind(EditLine *el, int argc, const c char inbuf[EL_BUFSIZ]; char outbuf[EL_BUFSIZ]; const char *in = NULL; - char *out = NULL; + char *out; el_bindings_t *bp, *ep; int cmd; int key; @@ -1368,7 +1368,7 @@ map_bind(EditLine *el, int argc, const c return (-1); } if (key) - term_set_arrow(el, in, key_map_str(el, out), ntype); + term_set_arrow(el, in, key_map_cmd(el, cmd), ntype); else { if (in[1]) { key_add(el, in, key_map_cmd(el, cmd), ntype); From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 19:25:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB879140; Tue, 1 Jan 2013 19:25:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.183]) by mx1.freebsd.org (Postfix) with ESMTP id 839628FC0C; Tue, 1 Jan 2013 19:25:08 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by skoda.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1Tq7Le-0004XC-T4; Tue, 01 Jan 2013 11:18:02 -0800 Received: from localhost (unverified [49.224.140.241]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Tue, 1 Jan 2013 14:18:02 -0500 Date: Wed, 2 Jan 2013 08:17:46 +1300 From: Andrew Turner To: Robert Watson Subject: Re: svn commit: r244899 - head/sys/mips/beri Message-ID: <20130102081746.5435db05@fubar.geek.nz> In-Reply-To: <201212311106.qBVB6chM016661@svn.freebsd.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/uEzSZj7HLXP7TyeAYwWWOYE" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 19:25:09 -0000 --MP_/uEzSZj7HLXP7TyeAYwWWOYE Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 31 Dec 2012 11:06:38 +0000 (UTC) Robert Watson wrote: > Author: rwatson > Date: Mon Dec 31 11:06:37 2012 > New Revision: 244899 > URL: http://svnweb.freebsd.org/changeset/base/244899 > > Log: > If FDT is compiled into a FreeBSD/beri kernel, initialise > OpenFirmware. > Sponsored by: DARPA, AFRL > > Modified: > head/sys/mips/beri/beri_machdep.c > > Modified: head/sys/mips/beri/beri_machdep.c > ============================================================================== > --- head/sys/mips/beri/beri_machdep.c Mon Dec 31 07:50:02 > 2012 (r244898) +++ head/sys/mips/beri/beri_machdep.c > Mon Dec 31 11:06:37 2012 (r244899) @@ -1,7 +1,12 @@ > /*- > * Copyright (c) 2006 Wojciech A. Koszek > + * Copyright (c) 2012 Robert N. M. Watson > * All rights reserved. > * > + * This software was developed by SRI International and the > University of > + * Cambridge Computer Laboratory under DARPA/AFRL contract > (FA8750-10-C-0237) > + * ("CTSRD"), as part of the DARPA CRASH research programme. > + * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > @@ -27,6 +32,7 @@ > __FBSDID("$FreeBSD$"); > > #include "opt_ddb.h" > +#include "opt_platform.h" > > #include > #include > @@ -49,6 +55,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > +#include > + > #include > #include > #include > @@ -76,6 +85,17 @@ mips_init(void) > { > int i; > > +#ifdef FDT > +#ifndef FDT_DTB_STATIC > +#error "mips_init with FDT requires FDT_DTB_STATIC" > +#endif > + > + if (OF_install(OFW_FDT, 0) == FALSE) > + while (1); > + if (OF_init(&fdt_static_dtb) != 0) > + while (1); > +#endif > + > for (i = 0; i < 10; i++) { > phys_avail[i] = 0; > } > > This looks like it is too late in the boot process. If you are using FDT you will need to use the FDT uart which is initialised in cninit. You will also need a patch similar to the untested one attached to fix the build. Andrew --MP_/uEzSZj7HLXP7TyeAYwWWOYE Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=beri_fdt.diff Index: beri/beri_machdep.c =================================================================== --- beri/beri_machdep.c (revision 244940) +++ beri/beri_machdep.c (working copy) @@ -55,8 +55,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT #include #include +#endif #include #include --MP_/uEzSZj7HLXP7TyeAYwWWOYE-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 19:42:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2C7672; Tue, 1 Jan 2013 19:42:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8138FC0A; Tue, 1 Jan 2013 19:42:07 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r01Jg7BL026963; Tue, 1 Jan 2013 19:42:07 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r01Jg72I026961; Tue, 1 Jan 2013 19:42:07 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301011942.r01Jg72I026961@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Jan 2013 19:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244942 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 19:42:07 -0000 Author: rwatson Date: Tue Jan 1 19:42:06 2013 New Revision: 244942 URL: http://svnweb.freebsd.org/changeset/base/244942 Log: Merge @219932 from Perforce: FDT headers can't be included if the kernel is compiled without FDT support, due to dependence on generated kobj headers. BERI supports both FDT and non-FDT kernels. Spotted by: bz Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Tue Jan 1 19:20:51 2013 (r244941) +++ head/sys/mips/beri/beri_machdep.c Tue Jan 1 19:42:06 2013 (r244942) @@ -55,8 +55,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT #include #include +#endif #include #include From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 19:44:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44DC27FC; Tue, 1 Jan 2013 19:44:49 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F21668FC13; Tue, 1 Jan 2013 19:44:48 +0000 (UTC) Received: from [192.168.2.119] (host86-129-88-139.range86-129.btcentralplus.com [86.129.88.139]) by cyrus.watson.org (Postfix) with ESMTPSA id B30CE46B39; Tue, 1 Jan 2013 14:44:41 -0500 (EST) Subject: Re: svn commit: r244899 - head/sys/mips/beri Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: "Robert N. M. Watson" In-Reply-To: Date: Tue, 1 Jan 2013 19:44:39 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7E6051EE-8632-4A95-BB54-7FC31C972795@freebsd.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 19:44:49 -0000 Hi Garrett: Thanks for the report -- I didn't realise tinderbox was now building all = kernels, or I would have merged my fix from P4 more quickly. The patch you've attached isn't quite the right one -- BERI supports = both FDT and non-FDT kernels, so we shouldn't build the Openfirmware = headers in the non-FDT case. Instead, I've ifdef'd inclusion of the = headers. However, as is probably clear from my breaking the non-FDT = kernel configuration, I have been working only with FDT kernels. :-) Thanks, Robert On 1 Jan 2013, at 18:34, Garrett Cooper wrote: > On Mon, Dec 31, 2012 at 3:06 AM, Robert Watson = wrote: >> Author: rwatson >> Date: Mon Dec 31 11:06:37 2012 >> New Revision: 244899 >> URL: http://svnweb.freebsd.org/changeset/base/244899 >>=20 >> Log: >> If FDT is compiled into a FreeBSD/beri kernel, initialise = OpenFirmware. >>=20 >> Sponsored by: DARPA, AFRL >=20 > This broke the mips:mips64 tinderbox: >=20 > /obj/src/make.amd64/make -V CFILES_NOZFS -V SYSTEM_CFILES -V > GEN_CFILES | MKDEP_CPP=3D"cc -E" CC=3D"cc" xargs mkdep -a -f .newdep = -O > -pipe -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions > -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. > -I/src/sys -I/src/sys/contrib/altq -I/src/sys/contrib/ipfilter > -I/src/sys/dev/ath -I/src/sys/dev/ath/ath_hal -I/src/sys/contrib/ngatm > -I/src/sys/dev/twa -I/src/sys/dev/cxgb -I/src/sys/dev/cxgbe > -I/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS > -include opt_global.h -fno-common -finline-limit=3D8000 --param > inline-unit-growth=3D10000 --param large-function-growth=3D100000 = --param > max-inline-insns-single=3D10000 -fno-pic -mno-abicalls -G0 > -DKERNLOADADDR=3D0xffffffff80100000 -march=3Dmips64 -mabi=3D64 = -msoft-float > -ffreestanding > In file included from /src/sys/dev/fdt/fdt_common.h:37, > from /src/sys/mips/beri/beri_machdep.c:58: > /src/sys/dev/ofw/ofw_bus.h:36:24: error: ofw_bus_if.h: No such file or = directory > mkdep: compile failed > *** [.depend] Error code 1 >=20 > The patch I committed to my git repo fixes that by adding > ofw_bus_if.m to files.beri ( > = https://github.com/yaneurabeya/freebsd/commit/ac9221dc567c67822b6f61cadbfa= c3fc1e32df04 > ). > Thanks! > -Garrett >=20 >=20 > [gcooper@bayonetta /scratch/git/github/yaneurabeya-freebsd-head]$ make > KERNCONF=3DBERI_DE4_MDROOT TARGET=3Dmips TARGET_ARCH=3Dmips64 = buildkernel > ... > cc -shared -fno-pic -mno-abicalls -G0 > -DKERNLOADADDR=3D0xffffffff80100000 -march=3Dmips64 -mabi=3D64 = -nostdlib > hack.c -o hack.So > rm -f hack.c > sed s/KERNLOADADDR/0xffffffff80100000/g > /scratch/git/github/yaneurabeya-freebsd-head/sys/conf/ldscript.mips > > ldscript.mips > MAKE=3Dmake sh = /scratch/git/github/yaneurabeya-freebsd-head/sys/conf/newvers.sh > BERI_DE4_MDROOT > cc -c -O -pipe -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions > -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. > -I/scratch/git/github/yaneurabeya-freebsd-head/sys > -I/scratch/git/github/yaneurabeya-freebsd-head/sys/contrib/altq > -I/scratch/git/github/yaneurabeya-freebsd-head/sys/contrib/libfdt > -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h > -fno-common -finline-limit=3D8000 --param inline-unit-growth=3D10000 > --param large-function-growth=3D100000 --param > max-inline-insns-single=3D10000 -fno-pic -mno-abicalls -G0 > -DKERNLOADADDR=3D0xffffffff80100000 -march=3Dmips64 -mabi=3D64 = -msoft-float > -ffreestanding -Werror vers.c > linking kernel.debug > text data bss dec hex filename > 4108957 8653440 283024 13045421 c70ead kernel.debug > objcopy --only-keep-debug kernel.debug kernel.symbols > objcopy --strip-debug --add-gnu-debuglink=3Dkernel.symbols = kernel.debug kernel > objcopy --strip-symbol '$d' --strip-symbol '$a' -g --strip-symbol > '$t' kernel.debug kernel.tmp > sed -e s/0xffffffff80100000/0x807963c0/ -e s/" + SIZEOF_HEADERS"// > ldscript.mips > ldscript.mips.tramp.noheader > cc -O -nostdlib -I. -I/scratch/git/github/yaneurabeya-freebsd-head/sys > -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=3D0xffffffff80100000 > -march=3Dmips64 -mabi=3D64 -Xlinker -T -Xlinker > ldscript.mips.tramp.noheader -DKERNNAME=3D"\"kernel.tmp\"" = -DELFSIZE=3D64 > = /scratch/git/github/yaneurabeya-freebsd-head/sys/mips/mips/elf_trampoline.= c > /scratch/git/github/yaneurabeya-freebsd-head/sys/mips/mips/inckern.S > -o kernel.tramp.elf > objcopy -S -O binary kernel.tramp.elf kernel.tramp.bin > cd /scratch/git/github/yaneurabeya-freebsd-head/sys/modules; > = MAKEOBJDIRPREFIX=3D/usr/obj/mips.mips64/scratch/git/github/yaneurabeya-fre= ebsd-head/sys/BERI_DE4_MDROOT/modules > KMODDIR=3D/boot/kernel MACHINE_CPUARCH=3Dmips MODULES_OVERRIDE=3D"""" > DEBUG_FLAGS=3D"-g" MACHINE=3Dmips MACHINE_ARCH=3Dmips64 > = KERNBUILDDIR=3D"/usr/obj/mips.mips64/scratch/git/github/yaneurabeya-freebs= d-head/sys/BERI_DE4_MDROOT" > SYSDIR=3D"/scratch/git/github/yaneurabeya-freebsd-head/sys" make all > -------------------------------------------------------------- >>>> Kernel build for BERI_DE4_MDROOT completed on Tue Jan 1 10:31:25 = PST 2013 > -------------------------------------------------------------- From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 19:49:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2709BC; Tue, 1 Jan 2013 19:49:52 +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 471AB8FC13; Tue, 1 Jan 2013 19:49:52 +0000 (UTC) Received: from [192.168.2.119] (host86-129-88-139.range86-129.btcentralplus.com [86.129.88.139]) by cyrus.watson.org (Postfix) with ESMTPSA id DDC9746B39; Tue, 1 Jan 2013 14:49:50 -0500 (EST) Subject: Re: svn commit: r244899 - head/sys/mips/beri Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20130102081746.5435db05@fubar.geek.nz> Date: Tue, 1 Jan 2013 19:49:48 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 19:49:52 -0000 On 1 Jan 2013, at 19:17, Andrew Turner wrote: >> @@ -76,6 +85,17 @@ mips_init(void) >> { >> int i; >>=20 >> +#ifdef FDT >> +#ifndef FDT_DTB_STATIC >> +#error "mips_init with FDT requires FDT_DTB_STATIC" >> +#endif >> + >> + if (OF_install(OFW_FDT, 0) =3D=3D FALSE) >> + while (1); >> + if (OF_init(&fdt_static_dtb) !=3D 0) >> + while (1); >> +#endif >> + >> for (i =3D 0; i < 10; i++) { >> phys_avail[i] =3D 0; >> } >>=20 >>=20 >=20 > This looks like it is too late in the boot process. If you are using > FDT you will need to use the FDT uart which is initialised in cninit. Hi Andrew: The current BERI low-level UART, as with several others in MIPS-space, = has excessively intimate knowledge of the location of the console UART = instance. Once we fix the console driver, you're right -- it will need = to move to platform_init() or similar. > You will also need a patch similar to the untested one attached to fix = the build. Thanks -- I had actually committed an identical patch to Perforce this = morning, but failed to merge it to head. It would be nice if we didn't = have to conditionally include headers. Robert= From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 20:56:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BEF632; Tue, 1 Jan 2013 20:56:20 +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 4FE9A8FC08; Tue, 1 Jan 2013 20:56:20 +0000 (UTC) Received: from [192.168.2.119] (host86-129-88-139.range86-129.btcentralplus.com [86.129.88.139]) by cyrus.watson.org (Postfix) with ESMTPSA id 83CAE46B2E; Tue, 1 Jan 2013 15:56:18 -0500 (EST) Subject: Re: svn commit: r244899 - head/sys/mips/beri Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20130102081746.5435db05@fubar.geek.nz> Date: Tue, 1 Jan 2013 20:56:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 20:56:20 -0000 On 1 Jan 2013, at 19:17, Andrew Turner wrote: > This looks like it is too late in the boot process. If you are using > FDT you will need to use the FDT uart which is initialised in cninit. On a semi-related note: the current obstacle to moving more devices over = to using FDT on BERI is that our FDT implementation appears to require a = PIC to be configured. We're not actually using a PIC on BERI currently. = It works fine attached to nexus, as the implied fallback for not having = a PIC is to simply use the suitably numbered interrupt wires direct into = the MIPS. However, trying the same setup described using FDT leads to an = interrupt-related warning at boot, and no interrupt being provided to = the driver. I suspect I need to provide a PIC-alike software component = as a fall-back for the non-PIC case. =46rom a brief e-mail exchange with = JC, it sounds like the XLP FDT setup is actually not using interrupts = either, currently. Robert= From owner-svn-src-head@FreeBSD.ORG Tue Jan 1 22:09:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A2C4119; Tue, 1 Jan 2013 22:09:19 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.184]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1698FC0A; Tue, 1 Jan 2013 22:09:19 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by opel.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1TqA1O-0006bW-Tf; Tue, 01 Jan 2013 14:09:18 -0800 Received: from localhost (unverified [49.224.140.241]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Tue, 1 Jan 2013 17:09:22 -0500 Date: Wed, 2 Jan 2013 11:08:56 +1300 From: Andrew Turner To: "Robert N. M. Watson" Subject: Re: svn commit: r244899 - head/sys/mips/beri Message-ID: <20130102110856.7c280fd5@fubar.geek.nz> In-Reply-To: References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 01 Jan 2013 22:09:19 -0000 On Tue, 1 Jan 2013 20:56:15 +0000 "Robert N. M. Watson" wrote: > > On 1 Jan 2013, at 19:17, Andrew Turner wrote: > > > This looks like it is too late in the boot process. If you are using > > FDT you will need to use the FDT uart which is initialised in > > cninit. > > On a semi-related note: the current obstacle to moving more devices > over to using FDT on BERI is that our FDT implementation appears to > require a PIC to be configured. We're not actually using a PIC on > BERI currently. It works fine attached to nexus, as the implied > fallback for not having a PIC is to simply use the suitably numbered > interrupt wires direct into the MIPS. However, trying the same setup > described using FDT leads to an interrupt-related warning at boot, > and no interrupt being provided to the driver. I suspect I need to > provide a PIC-alike software component as a fall-back for the non-PIC > case. From a brief e-mail exchange with JC, it sounds like the XLP > FDT setup is actually not using interrupts either, currently. I'm not sure if a PIC is required. From my reading of the code it appears not. By the look of it if you are using the nexus to handle interrupts you need to put an interrupts property in the device and "#interrupt-cells = <1>;" in the soc node. You will also need to implement an interrupt decode function and add it to the fdt_pic_table array. ARM has a number of almost identical copies of this function you can use for inspration. Andrew From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 00:38:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 446F0B96; Wed, 2 Jan 2013 00:38:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25CA38FC08; Wed, 2 Jan 2013 00:38:03 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r020c3Vi074353; Wed, 2 Jan 2013 00:38:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r020c1fN074342; Wed, 2 Jan 2013 00:38:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020038.r020c1fN074342@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 00:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244943 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 00:38:03 -0000 Author: adrian Date: Wed Jan 2 00:38:01 2013 New Revision: 244943 URL: http://svnweb.freebsd.org/changeset/base/244943 Log: Bring over the basic spectral scan framework code from Qualcomm Atheros. This includes the HAL routines to setup, enable/activate/disable spectral scan and configure the relevant registers. This still requires driver interaction to enable spectral scan reporting. Specifically: * call ah_spectralConfigure() to configure and enable spectral scan; * .. there's currently no way to disable spectral scan... that will have to follow. * call ah_spectralStart() to force start a spectral report; * call ah_spectralStop() to force stop an active spectral report. The spectral scan results appear as PHY errors (type 0x5 on the AR9280, same as radar) but with the spectral scan bit set (0x10 in the last byte of the frame) identifying it as a spectral report rather than a radar FFT report. Caveats: * It's likely quite difficult to run spectral _and_ radar at the same time. Enabling spectral scan disables the radar thresholds but leaves radar enabled. Thus, the driver (for now) needs to ensure that only one or the other is enabled. * .. it needs testing on HT40 mode. Tested: * AR9280 in STA mode, HT/20 only TODO: * Test on AR9285, AR9287; * Test in both HT20 and HT40 modes; * .. all the driver glue. Obtained from: Qualcomm Atheros Added: head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Jan 2 00:38:01 2013 (r244943) @@ -265,6 +265,16 @@ extern HAL_BOOL ar5416ProcessRadarEvent( HAL_DFS_EVENT *event); extern HAL_BOOL ar5416IsFastClockEnabled(struct ath_hal *ah); +/* ar9280_spectral.c */ +extern void ar5416ConfigureSpectralScan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss); +extern void ar5416GetSpectralParams(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss); +extern HAL_BOOL ar5416IsSpectralActive(struct ath_hal *ah); +extern HAL_BOOL ar5416IsSpectralEnabled(struct ath_hal *ah); +extern void ar5416StartSpectralScan(struct ath_hal *ah); +extern void ar5416StopSpectralScan(struct ath_hal *ah); +extern uint32_t ar5416GetSpectralConfig(struct ath_hal *ah); +extern void ar5416RestoreSpectralConfig(struct ath_hal *ah, uint32_t restoreval); + extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip); extern HAL_POWER_MODE ar5416GetPowerMode(struct ath_hal *ah); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Jan 2 00:38:01 2013 (r244943) @@ -161,6 +161,14 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_procRadarEvent = ar5416ProcessRadarEvent; ah->ah_isFastClockEnabled = ar5416IsFastClockEnabled; + /* Spectral Scan Functions */ + ah->ah_spectralConfigure = ar5416ConfigureSpectralScan; + ah->ah_spectralGetConfig = ar5416GetSpectralParams; + ah->ah_spectralStart = ar5416StartSpectralScan; + ah->ah_spectralStop = ar5416StopSpectralScan; + ah->ah_spectralIsEnabled = ar5416IsSpectralEnabled; + ah->ah_spectralIsActive = ar5416IsSpectralActive; + /* Power Management Functions */ ah->ah_setPowerMode = ar5416SetPowerMode; @@ -918,6 +926,7 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */ pCap->halTsfAddSupport = AH_TRUE; pCap->hal4AddrAggrSupport = AH_FALSE; /* Broken in Owl */ + pCap->halSpectralScanSupport = AH_FALSE; /* AR9280 and later */ if (ath_hal_eepromGet(ah, AR_EEP_MAXQCU, &val) == HAL_OK) pCap->halTotalQueues = val; Added: head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Wed Jan 2 00:38:01 2013 (r244943) @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2012 Qualcomm Atheros, All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" +#include "ah_desc.h" /* NB: for HAL_PHYERR* */ + +#include "ar5416/ar5416.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" + +/* + * Default AR9280 spectral scan parameters + */ +#define AR5416_SPECTRAL_SCAN_ENA 0 +#define AR5416_SPECTRAL_SCAN_ACTIVE 0 +#define AR5416_SPECTRAL_SCAN_FFT_PERIOD 8 +#define AR5416_SPECTRAL_SCAN_PERIOD 1 +#define AR5416_SPECTRAL_SCAN_COUNT 16 //used to be 128 +#define AR5416_SPECTRAL_SCAN_SHORT_REPEAT 1 + +/* constants */ +#define MAX_RADAR_RSSI_THRESH 0x3f +#define MAX_RADAR_HEIGHT 0x3f +#define ENABLE_ALL_PHYERR 0xffffffff + +static void ar5416DisableRadar(struct ath_hal *ah); +static void ar5416PrepSpectralScan(struct ath_hal *ah); + +static void +ar5416DisableRadar(struct ath_hal *ah) +{ + uint32_t val; + + // Enable radar FFT + val = OS_REG_READ(ah, AR_PHY_RADAR_0); + val |= AR_PHY_RADAR_0_FFT_ENA; + + // set radar detect thresholds to max to effectively disable radar + val &= ~AR_PHY_RADAR_0_RRSSI; + val |= SM(MAX_RADAR_RSSI_THRESH, AR_PHY_RADAR_0_RRSSI); + + val &= ~AR_PHY_RADAR_0_HEIGHT; + val |= SM(MAX_RADAR_HEIGHT, AR_PHY_RADAR_0_HEIGHT); + + val &= ~(AR_PHY_RADAR_0_ENA); + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); + + // disable extension radar detect + val = OS_REG_READ(ah, AR_PHY_RADAR_EXT); + OS_REG_WRITE(ah, AR_PHY_RADAR_EXT, val & ~AR_PHY_RADAR_EXT_ENA); + + val = OS_REG_READ(ah, AR_RX_FILTER); + val |= (1<<13); + OS_REG_WRITE(ah, AR_RX_FILTER, val); +} + +static void +ar5416PrepSpectralScan(struct ath_hal *ah) +{ + + ar5416DisableRadar(ah); + OS_REG_WRITE(ah, AR_PHY_ERR, ENABLE_ALL_PHYERR); +} + +void +ar5416ConfigureSpectralScan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss) +{ + uint32_t val; + + ar5416PrepSpectralScan(ah); + + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + + if (ss->ss_fft_period != HAL_SPECTRAL_PARAM_NOVAL) { + val &= ~AR_PHY_SPECTRAL_SCAN_FFT_PERIOD; + val |= SM(ss->ss_fft_period, AR_PHY_SPECTRAL_SCAN_FFT_PERIOD); + } + + if (ss->ss_period != HAL_SPECTRAL_PARAM_NOVAL) { + val &= ~AR_PHY_SPECTRAL_SCAN_PERIOD; + val |= SM(ss->ss_period, AR_PHY_SPECTRAL_SCAN_PERIOD); + } + + if (ss->ss_period != HAL_SPECTRAL_PARAM_NOVAL) { + val &= ~AR_PHY_SPECTRAL_SCAN_PERIOD; + val |= SM(ss->ss_period, AR_PHY_SPECTRAL_SCAN_PERIOD); + } + + /* This section is different for Kiwi and Merlin */ + if (AR_SREV_MERLIN(ah) ) { + if (ss->ss_count != HAL_SPECTRAL_PARAM_NOVAL) { + val &= ~AR_PHY_SPECTRAL_SCAN_COUNT; + val |= SM(ss->ss_count, AR_PHY_SPECTRAL_SCAN_COUNT); + } + + if (ss->ss_short_report == AH_TRUE) { + val |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; + } else { + val &= ~AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; + } + } else { + if (ss->ss_count != HAL_SPECTRAL_PARAM_NOVAL) { + /* + * In Merlin, for continous scan, scan_count = 128. + * In case of Kiwi, this value should be 0 + */ + if (ss->ss_count == 128) + ss->ss_count = 0; + val &= ~AR_PHY_SPECTRAL_SCAN_COUNT_KIWI; + val |= SM(ss->ss_count, AR_PHY_SPECTRAL_SCAN_COUNT_KIWI); + } + + if (ss->ss_short_report == AH_TRUE) { + val |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI; + } else { + val &= ~AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI; + } + + //Select the mask to be same as before + val |= AR_PHY_SPECTRAL_SCAN_PHYERR_MASK_SELECT_KIWI; + } + // Enable spectral scan + OS_REG_WRITE(ah, AR_PHY_SPECTRAL_SCAN, val | AR_PHY_SPECTRAL_SCAN_ENA); + + ar5416GetSpectralParams(ah, ss); +} + +/* + * Get the spectral parameter values and return them in the pe + * structure + */ +void +ar5416GetSpectralParams(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss) +{ + uint32_t val; + + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + + ss->ss_fft_period = MS(val, AR_PHY_SPECTRAL_SCAN_FFT_PERIOD); + ss->ss_period = MS(val, AR_PHY_SPECTRAL_SCAN_PERIOD); + if (AR_SREV_MERLIN(ah) ) { + ss->ss_count = MS(val, AR_PHY_SPECTRAL_SCAN_COUNT); + ss->ss_short_report = MS(val, AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT); + } else { + ss->ss_count = MS(val, AR_PHY_SPECTRAL_SCAN_COUNT_KIWI); + ss->ss_short_report = MS(val, AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI); + } + val = OS_REG_READ(ah, AR_PHY_RADAR_1); + ss->radar_bin_thresh_sel = MS(val, AR_PHY_RADAR_1_BIN_THRESH_SELECT); +} + +HAL_BOOL +ar5416IsSpectralActive(struct ath_hal *ah) +{ + uint32_t val; + + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + return MS(val, AR_PHY_SPECTRAL_SCAN_ACTIVE); +} + +HAL_BOOL +ar5416IsSpectralEnabled(struct ath_hal *ah) +{ + uint32_t val; + + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + return MS(val,AR_PHY_SPECTRAL_SCAN_ENA); +} + +void +ar5416StartSpectralScan(struct ath_hal *ah) +{ + uint32_t val; + + ar5416PrepSpectralScan(ah); + + // Activate spectral scan + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + val |= AR_PHY_SPECTRAL_SCAN_ENA; + val |= AR_PHY_SPECTRAL_SCAN_ACTIVE; + OS_REG_WRITE(ah, AR_PHY_SPECTRAL_SCAN, val); + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + val = OS_REG_READ(ah, AR_PHY_ERR_MASK_REG); + OS_REG_WRITE(ah, AR_PHY_ERR_MASK_REG, val | AR_PHY_ERR_RADAR); +} + +void +ar5416StopSpectralScan(struct ath_hal *ah) +{ + uint32_t val; + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + + // Deactivate spectral scan + val &= ~AR_PHY_SPECTRAL_SCAN_ENA; + val &= ~AR_PHY_SPECTRAL_SCAN_ACTIVE; + OS_REG_WRITE(ah, AR_PHY_SPECTRAL_SCAN, val); + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + val = OS_REG_READ(ah, AR_PHY_ERR_MASK_REG) & (~AR_PHY_ERR_RADAR); + OS_REG_WRITE(ah, AR_PHY_ERR_MASK_REG, val); +} + +uint32_t +ar5416GetSpectralConfig(struct ath_hal *ah) +{ + uint32_t val; + + val = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + return val; +} + +void +ar5416RestoreSpectralConfig(struct ath_hal *ah, uint32_t restoreval) +{ + uint32_t curval; + + ar5416PrepSpectralScan(ah); + + curval = OS_REG_READ(ah, AR_PHY_SPECTRAL_SCAN); + + if (restoreval != curval) { + restoreval |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; + OS_REG_WRITE(ah, AR_PHY_SPECTRAL_SCAN, restoreval); + } + return; +} + Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Wed Jan 2 00:38:01 2013 (r244943) @@ -66,10 +66,27 @@ #define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD_S 4 #define AR_PHY_SPECTRAL_SCAN_PERIOD 0x0000FF00 #define AR_PHY_SPECTRAL_SCAN_PERIOD_S 8 + +/* Scan count and Short repeat flags are different for Kiwi and Merlin */ #define AR_PHY_SPECTRAL_SCAN_COUNT 0x00FF0000 #define AR_PHY_SPECTRAL_SCAN_COUNT_S 16 +#define AR_PHY_SPECTRAL_SCAN_COUNT_KIWI 0x0FFF0000 +#define AR_PHY_SPECTRAL_SCAN_COUNT_KIWI_S 16 + #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT 0x01000000 #define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 24 +#define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI 0x10000000 +#define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI_S 28 + +/* + * Kiwi only, bit 30 is used to set the error type, if set it is 0x5 (HAL_PHYERR_RADAR) + * Else it is 38 (new error type) + */ +#define AR_PHY_SPECTRAL_SCAN_PHYERR_MASK_SELECT_KIWI 0x40000000 /* Spectral Error select bit mask */ +#define AR_PHY_SPECTRAL_SCAN_PHYERR_MASK_SELECT_KIWI_S 30 /* Spectral Error select bit 30 */ + +#define AR_PHY_SPECTRAL_SCAN_PRIORITY_SELECT_KIWI 0x20000000 /* Spectral Error select bit mask */ +#define AR_PHY_SPECTRAL_SCAN_PRIORITY_SELECT_SELECT_KIWI_S 29 /* Spectral Error select bit 30 */ /* For AR_PHY_RADAR0 */ #define AR_PHY_RADAR_0_FFT_ENA 0x80000000 @@ -78,8 +95,8 @@ #define AR_PHY_RADAR_EXT_ENA 0x00004000 #define AR_PHY_RADAR_1 0x9958 -#define AR_PHY_RADAR_1_BIN_THRESH_SEL 0x07000000 -#define AR_PHY_RADAR_1_BIN_THRESH_SEL_S 24 +#define AR_PHY_RADAR_1_BIN_THRESH_SELECT 0x07000000 +#define AR_PHY_RADAR_1_BIN_THRESH_SELECT_S 24 #define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000 #define AR_PHY_RADAR_1_USE_FIR128 0x00400000 #define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Jan 2 00:38:01 2013 (r244943) @@ -179,6 +179,7 @@ #define AR_2040_MODE 0x8318 #define AR_EXTRCCNT 0x8328 /* extension channel rx clear count */ #define AR_SELFGEN_MASK 0x832c /* rx and cal chain masks */ +#define AR_PHY_ERR_MASK_REG 0x8338 #define AR_PCU_TXBUF_CTRL 0x8340 #define AR_PCU_MISC_MODE2 0x8344 Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Jan 2 00:38:01 2013 (r244943) @@ -900,6 +900,7 @@ ar9280FillCapabilityInfo(struct ath_hal pCap->halHasRxSelfLinkedTail = AH_FALSE; pCap->halMbssidAggrSupport = AH_TRUE; pCap->hal4AddrAggrSupport = AH_TRUE; + pCap->halSpectralScanSupport = AH_TRUE; if (AR_SREV_MERLIN_20(ah)) { pCap->halPSPollBroken = AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Jan 2 00:38:01 2013 (r244943) @@ -524,6 +524,7 @@ ar9285FillCapabilityInfo(struct ath_hal pCap->halHasRxSelfLinkedTail = AH_FALSE; pCap->halMbssidAggrSupport = AH_TRUE; pCap->hal4AddrAggrSupport = AH_TRUE; + pCap->halSpectralScanSupport = AH_TRUE; if (AR_SREV_KITE_12_OR_LATER(ah)) pCap->halPSPollBroken = AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Tue Jan 1 19:42:06 2013 (r244942) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Jan 2 00:38:01 2013 (r244943) @@ -453,6 +453,7 @@ ar9287FillCapabilityInfo(struct ath_hal /* Disable this so Block-ACK works correctly */ pCap->halHasRxSelfLinkedTail = AH_FALSE; pCap->halPSPollBroken = AH_FALSE; + pCap->halSpectralScanSupport = AH_TRUE; /* Hardware supports (at least) single-stream STBC TX/RX */ pCap->halRxStbcSupport = 1; From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 01:24:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8164EF91; Wed, 2 Jan 2013 01:24:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A2558FC0A; Wed, 2 Jan 2013 01:24:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r021ObY1081838; Wed, 2 Jan 2013 01:24:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r021Oag5081836; Wed, 2 Jan 2013 01:24:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020124.r021Oag5081836@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 01:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244945 - in head/sys: conf modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 01:24:37 -0000 Author: adrian Date: Wed Jan 2 01:24:36 2013 New Revision: 244945 URL: http://svnweb.freebsd.org/changeset/base/244945 Log: Add missing update to link ar5416_spectral.c into the build. Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 2 01:07:08 2013 (r244944) +++ head/sys/conf/files Wed Jan 2 01:24:36 2013 (r244945) @@ -918,6 +918,10 @@ dev/ath/ath_hal/ar5416/ar5416_reset.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar5416/ar5416_spectral.c \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_xmit.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ ath_ar9287 \ Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Wed Jan 2 01:07:08 2013 (r244944) +++ head/sys/modules/ath/Makefile Wed Jan 2 01:24:36 2013 (r244945) @@ -89,7 +89,7 @@ SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \ ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \ ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \ ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \ - ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_radar.c \ + ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_radar.c ar5416_spectral.c \ ar5416_recv.c ar5416_reset.c ar5416_xmit.c # RF backend for 5416, 9130 and 9160 From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 01:36:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 515CF3C8; Wed, 2 Jan 2013 01:36:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC788FC08; Wed, 2 Jan 2013 01:36:11 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r021aATW083693; Wed, 2 Jan 2013 01:36:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r021aAl9083691; Wed, 2 Jan 2013 01:36:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020136.r021aAl9083691@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 01:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244946 - in head/sys/dev/ath: . ath_dfs/null X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 01:36:11 -0000 Author: adrian Date: Wed Jan 2 01:36:10 2013 New Revision: 244946 URL: http://svnweb.freebsd.org/changeset/base/244946 Log: Add a method to explicitly disable radar reporting if required. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/if_athdfs.h Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Wed Jan 2 01:24:36 2013 (r244945) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Wed Jan 2 01:36:10 2013 (r244946) @@ -146,6 +146,26 @@ ath_dfs_radar_enable(struct ath_softc *s } /* + * Explicity disable radar reporting. + * + * Return 0 if it was disabled, < 0 on error. + */ +int +ath_dfs_radar_disable(struct ath_softc *sc) +{ +#if 0 + HAL_PHYERR_PARAM pe; + + (void) ath_hal_getdfsthresh(sc->sc_ah, &pe); + pe.pe_enabled = 0; + (void) ath_hal_enabledfs(sc->sc_ah, &pe); + return (0); +#else + return (0); +#endif +} + +/* * Process DFS related PHY errors * * The mbuf is not "ours" and if we want a copy, we have Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Wed Jan 2 01:24:36 2013 (r244945) +++ head/sys/dev/ath/if_athdfs.h Wed Jan 2 01:36:10 2013 (r244946) @@ -35,6 +35,7 @@ extern int ath_dfs_attach(struct ath_sof extern int ath_dfs_detach(struct ath_softc *sc); extern int ath_dfs_radar_enable(struct ath_softc *, struct ieee80211_channel *chan); +extern int ath_dfs_radar_disable(struct ath_softc *sc); extern void ath_dfs_process_phy_err(struct ath_softc *sc, struct mbuf *m, uint64_t tsf, struct ath_rx_status *rxstat); extern int ath_dfs_process_radar_event(struct ath_softc *sc, From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 01:40:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7BA2559; Wed, 2 Jan 2013 01:40:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA9228FC0C; Wed, 2 Jan 2013 01:40:23 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r021eNmS084339; Wed, 2 Jan 2013 01:40:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r021eNmi084338; Wed, 2 Jan 2013 01:40:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020140.r021eNmi084338@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 01:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244947 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 01:40:23 -0000 Author: adrian Date: Wed Jan 2 01:40:23 2013 New Revision: 244947 URL: http://svnweb.freebsd.org/changeset/base/244947 Log: Add spectral HAL accessor methods. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Jan 2 01:36:10 2013 (r244946) +++ head/sys/dev/ath/if_athvar.h Wed Jan 2 01:40:23 2013 (r244947) @@ -1299,4 +1299,13 @@ void ath_intr(void *); #define ath_hal_get_chan_ext_busy(_ah) \ ((*(_ah)->ah_get11nExtBusy)((_ah))) +#define ath_hal_spectral_get_config(_ah, _p) \ + ((*(_ah)->ah_spectralGetConfig)((_ah), (_p))) +#define ath_hal_spectral_configure(_ah, _p) \ + ((*(_ah)->ah_spectralConfigure)((_ah), (_p))) +#define ath_hal_spectral_start(_ah) \ + ((*(_ah)->ah_spectralStart)((_ah))) +#define ath_hal_spectral_stop(_ah) \ + ((*(_ah)->ah_spectralStop)((_ah))) + #endif /* _DEV_ATH_ATHVAR_H */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 03:56:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E409DB; Wed, 2 Jan 2013 03:56:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD7828FC14; Wed, 2 Jan 2013 03:56:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r023uKAn006545; Wed, 2 Jan 2013 03:56:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r023uKxV006543; Wed, 2 Jan 2013 03:56:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020356.r023uKxV006543@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 03:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244950 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 03:56:20 -0000 Author: adrian Date: Wed Jan 2 03:56:20 2013 New Revision: 244950 URL: http://svnweb.freebsd.org/changeset/base/244950 Log: Fix the short repeat option code to not flip the option to 0 when we call this w/ NOVAL set. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Wed Jan 2 02:44:54 2013 (r244949) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c Wed Jan 2 03:56:20 2013 (r244950) @@ -113,7 +113,7 @@ ar5416ConfigureSpectralScan(struct ath_h if (ss->ss_short_report == AH_TRUE) { val |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; - } else { + } else if (ss->ss_short_report != HAL_SPECTRAL_PARAM_NOVAL) { val &= ~AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT; } } else { @@ -130,7 +130,7 @@ ar5416ConfigureSpectralScan(struct ath_h if (ss->ss_short_report == AH_TRUE) { val |= AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI; - } else { + } else if (ss->ss_short_report != HAL_SPECTRAL_PARAM_NOVAL) { val &= ~AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_KIWI; } From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 03:59:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0E6BB7B; Wed, 2 Jan 2013 03:59:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89FBF8FC15; Wed, 2 Jan 2013 03:59:03 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r023x3WT006972; Wed, 2 Jan 2013 03:59:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r023x2rH006964; Wed, 2 Jan 2013 03:59:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020359.r023x2rH006964@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 03:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244951 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 03:59:03 -0000 Author: adrian Date: Wed Jan 2 03:59:02 2013 New Revision: 244951 URL: http://svnweb.freebsd.org/changeset/base/244951 Log: Add a new (skeleton) spectral mode manager module. Added: head/sys/dev/ath/if_ath_spectral.c (contents, props changed) head/sys/dev/ath/if_ath_spectral.h (contents, props changed) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Jan 2 03:56:20 2013 (r244950) +++ head/sys/dev/ath/if_ath.c Wed Jan 2 03:59:02 2013 (r244951) @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef ATH_TX99_DIAG @@ -510,6 +511,14 @@ ath_attach(u_int16_t devid, struct ath_s goto bad2; } + /* Attach spectral module */ + if (ath_spectral_attach(sc) < 0) { + device_printf(sc->sc_dev, + "%s: unable to attach spectral\n", __func__); + error = EIO; + goto bad2; + } + /* Start DFS processing tasklet */ TASK_INIT(&sc->sc_dfstask, 0, ath_dfs_tasklet, sc); @@ -967,6 +976,7 @@ ath_detach(struct ath_softc *sc) if_ath_alq_tidyup(&sc->sc_alq); #endif + ath_spectral_detach(sc); ath_dfs_detach(sc); ath_desc_free(sc); ath_txdma_teardown(sc); @@ -1489,6 +1499,9 @@ ath_resume(struct ath_softc *sc) /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); + /* Let spectral at in case spectral is enabled */ + ath_spectral_enable(sc, ic->ic_curchan); + /* Restore the LED configuration */ ath_led_config(sc); ath_hal_setledstate(ah, HAL_LED_INIT); @@ -1918,6 +1931,9 @@ ath_init(void *arg) /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); + /* Let spectral at in case spectral is enabled */ + ath_spectral_enable(sc, ic->ic_curchan); + /* * Likewise this is set during reset so update * state cached in the driver. @@ -2226,6 +2242,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, ic->ic_curchan); + /* Let spectral at in case spectral is enabled */ + ath_spectral_enable(sc, ic->ic_curchan); + if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); /* @@ -4402,6 +4421,9 @@ ath_chan_set(struct ath_softc *sc, struc /* Let DFS at it in case it's a DFS channel */ ath_dfs_radar_enable(sc, chan); + /* Let spectral at in case spectral is enabled */ + ath_spectral_enable(sc, chan); + /* * Re-enable rx framework. */ @@ -5384,6 +5406,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr); break; #endif + case SIOCGATHSPECTRAL: + error = ath_ioctl_spectral(sc,(struct ath_diag*) ifr); + break; case SIOCGATHNODERATESTATS: error = ath_ioctl_ratestats(sc, (struct ath_rateioctl *) ifr); break; Added: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_spectral.c Wed Jan 2 03:59:02 2013 (r244951) @@ -0,0 +1,224 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +/* + * Implement some basic spectral scan control logic. + */ +#include "opt_ath.h" +#include "opt_inet.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include /* XXX for ether_sprintf */ + +#include + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include + +#include + +struct ath_spectral_state { + HAL_SPECTRAL_PARAM spectral_state; + int spectral_active; + int spectral_enabled; +}; + +/* + * Methods which are required + */ + +/* + * Attach DFS to the given interface + */ +int +ath_spectral_attach(struct ath_softc *sc) +{ + struct ath_spectral_state *ss; + + ss = malloc(sizeof(struct ath_spectral_state), + M_TEMP, M_WAITOK | M_ZERO); + + if (ss == NULL) { + device_printf(sc->sc_dev, "%s: failed to alloc memory\n", + __func__); + return (-ENOMEM); + } + + sc->sc_spectral = ss; + + (void) ath_hal_spectral_get_config(sc->sc_ah, &ss->spectral_state); + + return (0); +} + +/* + * Detach DFS from the given interface + */ +int +ath_spectral_detach(struct ath_softc *sc) +{ + if (sc->sc_spectral != NULL) { + free(sc->sc_spectral, M_TEMP); + } + return (0); +} + +/* + * Check whether spectral needs enabling and if so, + * flip it on. + */ +int +ath_spectral_enable(struct ath_softc *sc, struct ieee80211_channel *ch) +{ + + return (0); +} + +/* + * Handle ioctl requests from the diagnostic interface. + * + * The initial part of this code resembles ath_ioctl_diag(); + * it's likely a good idea to reduce duplication between + * these two routines. + */ +int +ath_ioctl_spectral(struct ath_softc *sc, struct ath_diag *ad) +{ + unsigned int id = ad->ad_id & ATH_DIAG_ID; + void *indata = NULL; + void *outdata = NULL; + u_int32_t insize = ad->ad_in_size; + u_int32_t outsize = ad->ad_out_size; + int error = 0; + HAL_SPECTRAL_PARAM peout; + HAL_SPECTRAL_PARAM *pe; + struct ath_spectral_state *ss = sc->sc_spectral; + + if (ad->ad_id & ATH_DIAG_IN) { + /* + * Copy in data. + */ + indata = malloc(insize, M_TEMP, M_NOWAIT); + if (indata == NULL) { + error = ENOMEM; + goto bad; + } + error = copyin(ad->ad_in_data, indata, insize); + if (error) + goto bad; + } + if (ad->ad_id & ATH_DIAG_DYN) { + /* + * Allocate a buffer for the results (otherwise the HAL + * returns a pointer to a buffer where we can read the + * results). Note that we depend on the HAL leaving this + * pointer for us to use below in reclaiming the buffer; + * may want to be more defensive. + */ + outdata = malloc(outsize, M_TEMP, M_NOWAIT); + if (outdata == NULL) { + error = ENOMEM; + goto bad; + } + } + switch (id) { + case SPECTRAL_CONTROL_GET_PARAMS: + memset(&peout, 0, sizeof(peout)); + outsize = sizeof(HAL_SPECTRAL_PARAM); + ath_hal_spectral_get_config(sc->sc_ah, &peout); + pe = (HAL_SPECTRAL_PARAM *) outdata; + memcpy(pe, &peout, sizeof(*pe)); + break; + case SPECTRAL_CONTROL_SET_PARAMS: + if (insize < sizeof(HAL_SPECTRAL_PARAM)) { + error = EINVAL; + break; + } + pe = (HAL_SPECTRAL_PARAM *) indata; + ath_hal_spectral_configure(sc->sc_ah, pe); + /* Save a local copy of the updated parameters */ + ath_hal_spectral_get_config(sc->sc_ah, + &ss->spectral_state); + break; + case SPECTRAL_CONTROL_START: + ath_hal_spectral_configure(sc->sc_ah, + &ss->spectral_state); + (void) ath_hal_spectral_start(sc->sc_ah); + break; + case SPECTRAL_CONTROL_STOP: + (void) ath_hal_spectral_stop(sc->sc_ah); + break; + case SPECTRAL_CONTROL_ENABLE: + /* XXX TODO */ + case SPECTRAL_CONTROL_DISABLE: + /* XXX TODO */ + break; + default: + error = EINVAL; + } + if (outsize < ad->ad_out_size) + ad->ad_out_size = outsize; + if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_size)) + error = EFAULT; +bad: + if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL) + free(indata, M_TEMP); + if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) + free(outdata, M_TEMP); + return (error); +} + Added: head/sys/dev/ath/if_ath_spectral.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_spectral.h Wed Jan 2 03:59:02 2013 (r244951) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2013 Adrian Chadd + * 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$ + */ +#ifndef __IF_ATH_SPECTRAL_H__ +#define __IF_ATH_SPECTRAL_H__ + +extern int ath_spectral_attach(struct ath_softc *sc); +extern int ath_spectral_detach(struct ath_softc *sc); +extern int ath_ioctl_spectral(struct ath_softc *sc, struct ath_diag *ad); +extern int ath_spectral_enable(struct ath_softc *sc, + struct ieee80211_channel *ch); + +#endif /* __IF_ATH_SPECTRAL_H__ */ Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Wed Jan 2 03:56:20 2013 (r244950) +++ head/sys/dev/ath/if_athioctl.h Wed Jan 2 03:59:02 2013 (r244951) @@ -406,4 +406,26 @@ struct ath_tx_radiotap_header { #define DFS_PARAM_ENABLE 32 #define DFS_PARAM_EN_EXTCH 33 +/* + * Spectral ioctl parameter types + */ +#define SPECTRAL_PARAM_FFT_PERIOD 1 +#define SPECTRAL_PARAM_SS_PERIOD 2 +#define SPECTRAL_PARAM_SS_COUNT 3 +#define SPECTRAL_PARAM_SS_SHORT_RPT 4 +#define SPECTRAL_PARAM_ENABLED 5 +#define SPECTRAL_PARAM_ACTIVE 6 + +/* + * Spectral control parameters + */ +#define SIOCGATHSPECTRAL _IOWR('i', 151, struct ath_diag) + +#define SPECTRAL_CONTROL_ENABLE 2 +#define SPECTRAL_CONTROL_DISABLE 3 +#define SPECTRAL_CONTROL_START 4 +#define SPECTRAL_CONTROL_STOP 5 +#define SPECTRAL_CONTROL_GET_PARAMS 6 +#define SPECTRAL_CONTROL_SET_PARAMS 7 + #endif /* _DEV_ATH_ATHIOCTL_H */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Jan 2 03:56:20 2013 (r244950) +++ head/sys/dev/ath/if_athvar.h Wed Jan 2 03:59:02 2013 (r244951) @@ -750,6 +750,10 @@ struct ath_softc { int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ + /* Spectral related state */ + void *sc_spectral; + int sc_dospectral; + /* ALQ */ #ifdef ATH_DEBUG_ALQ struct if_ath_alq sc_alq; From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 04:00:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44659D01; Wed, 2 Jan 2013 04:00:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7C28FC08; Wed, 2 Jan 2013 04:00:55 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0240s1Q007381; Wed, 2 Jan 2013 04:00:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0240sQY007378; Wed, 2 Jan 2013 04:00:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020400.r0240sQY007378@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 04:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244952 - in head/sys: conf modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 04:00:55 -0000 Author: adrian Date: Wed Jan 2 04:00:54 2013 New Revision: 244952 URL: http://svnweb.freebsd.org/changeset/base/244952 Log: Link if_ath_spectral.c into the build. Modified: head/sys/conf/files head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 2 03:59:02 2013 (r244951) +++ head/sys/conf/files Wed Jan 2 04:00:54 2013 (r244952) @@ -726,6 +726,8 @@ dev/ath/if_ath_rx.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_rx_edma.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_spectral.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Wed Jan 2 03:59:02 2013 (r244951) +++ head/sys/modules/ath/Makefile Wed Jan 2 04:00:54 2013 (r244952) @@ -37,7 +37,7 @@ ATH_RATE?= sample # tx rate control alg KMOD= if_ath SRCS= if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c -SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c +SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c if_ath_spectral.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 04:02:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B0E8E78; Wed, 2 Jan 2013 04:02:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03BA78FC08; Wed, 2 Jan 2013 04:02:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0242S0F007819; Wed, 2 Jan 2013 04:02:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0242Sfd007814; Wed, 2 Jan 2013 04:02:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301020402.r0242Sfd007814@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 04:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244953 - in head/tools/tools/ath: . athspectral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 04:02:29 -0000 Author: adrian Date: Wed Jan 2 04:02:27 2013 New Revision: 244953 URL: http://svnweb.freebsd.org/changeset/base/244953 Log: Add a very skeletal spectral scan control application. The main use for this is to manually trigger spectral scan operations (athspectral -i athX start) whilst doing debugging. Added: head/tools/tools/ath/athspectral/ head/tools/tools/ath/athspectral/Makefile (contents, props changed) head/tools/tools/ath/athspectral/athspectral.c (contents, props changed) Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Wed Jan 2 04:00:54 2013 (r244952) +++ head/tools/tools/ath/Makefile Wed Jan 2 04:02:27 2013 (r244953) @@ -3,6 +3,6 @@ SUBDIR= arcode athdebug athdecode athkey athpoke athprom athrd athregs SUBDIR+= athstats ath_prom_read athradar athaggrstats SUBDIR+= ath_ee_v14_print ath_ee_v4k_print ath_ee_9287_print -SUBDIR+= athsurvey athratestats +SUBDIR+= athsurvey athratestats athspectral .include Added: head/tools/tools/ath/athspectral/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athspectral/Makefile Wed Jan 2 04:02:27 2013 (r244953) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +PROG= athspectral + +.include <../Makefile.inc> + +SRCS= athspectral.c +SRCS+= opt_ah.h +CLEANFILES+= opt_ah.h + +opt_ah.h: + echo "#define AH_DEBUG 1" > opt_ah.h + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h + echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h + +.include Added: head/tools/tools/ath/athspectral/athspectral.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athspectral/athspectral.c Wed Jan 2 04:02:27 2013 (r244953) @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2013 Adrian Chadd + * + * 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$ + */ + +#include "diag.h" + +#include "ah.h" +#include "ah_internal.h" + +#ifndef ATH_DEFAULT +#define ATH_DEFAULT "ath0" +#endif + +#include +#include +#include +#include +#include +#include +#include + +struct spectralhandler { + struct ath_diag atd; + int s; + struct ifreq ifr; + int ah_devid; +}; + +int +spectral_opendev(struct spectralhandler *spectral, const char *devid) +{ + HAL_REVS revs; + + spectral->s = socket(AF_INET, SOCK_DGRAM, 0); + if (spectral->s < 0) { + warn("socket"); + return 0; + } + + strncpy(spectral->atd.ad_name, devid, sizeof (spectral->atd.ad_name)); + + /* Get the hardware revision, just to verify things are working */ + spectral->atd.ad_id = HAL_DIAG_REVS; + spectral->atd.ad_out_data = (caddr_t) &revs; + spectral->atd.ad_out_size = sizeof(revs); + if (ioctl(spectral->s, SIOCGATHDIAG, &spectral->atd) < 0) { + warn(spectral->atd.ad_name); + return 0; + } + spectral->ah_devid = revs.ah_devid; + return 1; +} + +void +spectral_closedev(struct spectralhandler *spectral) +{ + close(spectral->s); + spectral->s = -1; +} + +void +spectralset(struct spectralhandler *spectral, int op, u_int32_t param) +{ + HAL_SPECTRAL_PARAM pe; + + pe.ss_fft_period = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_period = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_count = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_short_report = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_spectral_pri = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_fft_period = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_enabled = HAL_SPECTRAL_PARAM_NOVAL; + pe.ss_active = HAL_SPECTRAL_PARAM_NOVAL; + + switch (op) { + case SPECTRAL_PARAM_FFT_PERIOD: + pe.ss_fft_period = param; + break; + case SPECTRAL_PARAM_SS_PERIOD: + pe.ss_period = param; + break; + case SPECTRAL_PARAM_SS_COUNT: + pe.ss_count = param; + break; + case SPECTRAL_PARAM_SS_SHORT_RPT: + pe.ss_short_report = param; + break; + } + + spectral->atd.ad_id = SPECTRAL_CONTROL_SET_PARAMS | ATH_DIAG_IN; + spectral->atd.ad_out_data = NULL; + spectral->atd.ad_out_size = 0; + spectral->atd.ad_in_data = (caddr_t) &pe; + spectral->atd.ad_in_size = sizeof(HAL_SPECTRAL_PARAM); + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); +} + +static void +spectral_get(struct spectralhandler *spectral) +{ + HAL_SPECTRAL_PARAM pe; + + spectral->atd.ad_id = SPECTRAL_CONTROL_GET_PARAMS | ATH_DIAG_DYN; + memset(&pe, 0, sizeof(pe)); + + spectral->atd.ad_in_data = NULL; + spectral->atd.ad_in_size = 0; + spectral->atd.ad_out_data = (caddr_t) &pe; + spectral->atd.ad_out_size = sizeof(pe); + + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); + + printf("Spectral parameters (raw):\n"); + printf(" ss_enabled: %d\n", pe.ss_enabled); + printf(" ss_active: %d\n", pe.ss_active); + printf(" ss_count: %d\n", pe.ss_count); + printf(" ss_fft_period: %d\n", pe.ss_fft_period); + printf(" ss_period: %d\n", pe.ss_period); + printf(" ss_short_report: %d\n", pe.ss_short_report); + printf(" radar_bin_thresh_sel: %d\n", pe.radar_bin_thresh_sel); +} + +static void +spectral_start(struct spectralhandler *spectral) +{ + HAL_SPECTRAL_PARAM pe; + + spectral->atd.ad_id = SPECTRAL_CONTROL_START | ATH_DIAG_DYN; + memset(&pe, 0, sizeof(pe)); + + /* + * XXX don't need these, but need to eliminate the ATH_DIAG_DYN flag + * and debug + */ + spectral->atd.ad_in_data = NULL; + spectral->atd.ad_in_size = 0; + spectral->atd.ad_out_data = (caddr_t) &pe; + spectral->atd.ad_out_size = sizeof(pe); + + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); +} + +static void +spectral_stop(struct spectralhandler *spectral) +{ + HAL_SPECTRAL_PARAM pe; + + spectral->atd.ad_id = SPECTRAL_CONTROL_STOP | ATH_DIAG_DYN; + memset(&pe, 0, sizeof(pe)); + + /* + * XXX don't need these, but need to eliminate the ATH_DIAG_DYN flag + * and debug + */ + spectral->atd.ad_in_data = NULL; + spectral->atd.ad_in_size = 0; + spectral->atd.ad_out_data = (caddr_t) &pe; + spectral->atd.ad_out_size = sizeof(pe); + + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); +} + +static int +spectral_set_param(struct spectralhandler *spectral, const char *param, + const char *val) +{ + int v; + + v = atoi(val); + + if (strcmp(param, "ss_short_report") == 0) { + spectralset(spectral, SPECTRAL_PARAM_SS_SHORT_RPT, v); + } else if (strcmp(param, "ss_fft_period") == 0) { + spectralset(spectral, SPECTRAL_PARAM_FFT_PERIOD, v); + } else if (strcmp(param, "ss_period") == 0) { + spectralset(spectral, SPECTRAL_PARAM_SS_PERIOD, v); + } else if (strcmp(param, "ss_count") == 0) { + spectralset(spectral, SPECTRAL_PARAM_SS_COUNT, v); + } else { + return (0); + } + +#if 0 + if (strcmp(param, "enabled") == 0) { + spectralset(spectral, DFS_PARAM_ENABLE, v); + } else if (strcmp(param, "firpwr") == 0) { + spectralset(spectral, DFS_PARAM_FIRPWR, v); + } else if (strcmp(param, "rrssi") == 0) { + spectralset(spectral, DFS_PARAM_RRSSI, v); + } else if (strcmp(param, "height") == 0) { + spectralset(spectral, DFS_PARAM_HEIGHT, v); + } else if (strcmp(param, "prssi") == 0) { + spectralset(spectral, DFS_PARAM_PRSSI, v); + } else if (strcmp(param, "inband") == 0) { + spectralset(spectral, DFS_PARAM_INBAND, v); + } else if (strcmp(param, "relpwr") == 0) { + spectralset(spectral, DFS_PARAM_RELPWR, v); + } else if (strcmp(param, "relstep") == 0) { + spectralset(spectral, DFS_PARAM_RELSTEP, v); + } else if (strcmp(param, "maxlen") == 0) { + spectralset(spectral, DFS_PARAM_MAXLEN, v); + } else if (strcmp(param, "usefir128") == 0) { + spectralset(spectral, DFS_PARAM_USEFIR128, v); + } else if (strcmp(param, "blockspectral") == 0) { + spectralset(spectral, DFS_PARAM_BLOCKRADAR, v); + } else if (strcmp(param, "enmaxrssi") == 0) { + spectralset(spectral, DFS_PARAM_MAXRSSI_EN, v); + } else if (strcmp(param, "extchannel") == 0) { + spectralset(spectral, DFS_PARAM_EN_EXTCH, v); + } else if (strcmp(param, "enrelpwr") == 0) { + spectralset(spectral, DFS_PARAM_RELPWR_EN, v); + } else if (strcmp(param, "en_relstep_check") == 0) { + spectralset(spectral, DFS_PARAM_RELSTEP_EN, v); + } else { + return 0; + } +#endif + + return 1; +} + +void +usage(const char *progname) +{ + printf("Usage:\n"); + printf("\t%s: [-i ] ()\n", progname); + printf("\t%s: [-h]\n", progname); + printf("\n"); + printf("Valid commands:\n"); + printf("\tget:\t\tGet current spectral parameters\n"); + printf("\tset :\t\tSet spectral parameter\n"); + printf("\tstart: Start spectral scan\n"); + printf("\tstop: Stop spectral scan\n"); +} + +int +main(int argc, char *argv[]) +{ + struct spectralhandler spectral; + const char *devname = ATH_DEFAULT; + const char *progname = argv[0]; + + memset(&spectral, 0, sizeof(spectral)); + + /* Parse command line options */ + if (argc >= 2 && strcmp(argv[1], "-h") == 0) { + usage(progname); + exit(0); + } + if (argc >= 2 && strcmp(argv[1], "-?") == 0) { + usage(progname); + exit(0); + } + + if (argc >= 2 && strcmp(argv[1], "-i") == 0) { + if (argc == 2) { + usage(progname); + exit(127); + } + devname = argv[2]; + argc -= 2; argv += 2; + } + + /* At this point we require at least one command */ + if (argc == 1) { + usage(progname); + exit(127); + } + + if (spectral_opendev(&spectral, devname) == 0) + exit(127); + + if (strcasecmp(argv[1], "get") == 0) { + spectral_get(&spectral); + } else if (strcasecmp(argv[1], "set") == 0) { + if (argc < 4) { + usage(progname); + exit(127); + } + if (spectral_set_param(&spectral, argv[2], argv[3]) == 0) { + usage(progname); + exit(127); + } + } else if (strcasecmp(argv[1], "start") == 0) { + spectral_start(&spectral); + } else if (strcasecmp(argv[1], "stop") == 0) { + spectral_stop(&spectral); + } else { + usage(progname); + exit(127); + } + + /* wrap up */ + spectral_closedev(&spectral); + exit(0); +} From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 07:33:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2496DB9B; Wed, 2 Jan 2013 07:33:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06F8B8FC16; Wed, 2 Jan 2013 07:33:44 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r027XhZX041096; Wed, 2 Jan 2013 07:33:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r027XhMr041095; Wed, 2 Jan 2013 07:33:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301020733.r027XhMr041095@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 2 Jan 2013 07:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244957 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 07:33:44 -0000 Author: hselasky Date: Wed Jan 2 07:33:43 2013 New Revision: 244957 URL: http://svnweb.freebsd.org/changeset/base/244957 Log: Add missing dependancy. Submitted by: Michael Butler MFC after: 1 week Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 2 07:33:19 2013 (r244956) +++ head/sys/conf/files Wed Jan 2 07:33:43 2013 (r244957) @@ -2188,7 +2188,7 @@ dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | smsc | udav + rue | smsc | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 11:01:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 897B1CB8; Wed, 2 Jan 2013 11:01: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 587268FC0C; Wed, 2 Jan 2013 11:01:31 +0000 (UTC) Received: from [192.168.2.119] (host86-129-88-139.range86-129.btcentralplus.com [86.129.88.139]) by cyrus.watson.org (Postfix) with ESMTPSA id AAEE146B2D; Wed, 2 Jan 2013 06:01:29 -0500 (EST) Subject: Re: svn commit: r244899 - head/sys/mips/beri Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20130102110856.7c280fd5@fubar.geek.nz> Date: Wed, 2 Jan 2013 11:01:27 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 11:01:31 -0000 On 1 Jan 2013, at 22:08, Andrew Turner wrote: >> On a semi-related note: the current obstacle to moving more devices >> over to using FDT on BERI is that our FDT implementation appears to >> require a PIC to be configured. We're not actually using a PIC on >> BERI currently. It works fine attached to nexus, as the implied >> fallback for not having a PIC is to simply use the suitably numbered >> interrupt wires direct into the MIPS. However, trying the same setup >> described using FDT leads to an interrupt-related warning at boot, >> and no interrupt being provided to the driver. I suspect I need to >> provide a PIC-alike software component as a fall-back for the non-PIC >> case. =46rom a brief e-mail exchange with JC, it sounds like the XLP >> FDT setup is actually not using interrupts either, currently. >=20 > I'm not sure if a PIC is required. =46rom my reading of the code it > appears not. By the look of it if you are using the nexus to > handle interrupts you need to put an interrupts property in the device > and "#interrupt-cells =3D <1>;" in the soc node. >=20 > You will also need to implement an interrupt decode function and add = it > to the fdt_pic_table array. ARM has a number of almost identical = copies > of this function you can use for inspration. This seemed to do the trick; what do you think of the attached? This = isn't a board-specific change, so I dropped it into the common = fdt_mips.c code. On the other hand, this left it a bit open as to what = the right compatible=3D line to use was, so feedback there most welcome. Robert Change 219933 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 = 09:32:16 Implement an FDT PIC decode routine to use when no PIC has been configured, which assumes a cascade back to the nexus bus (e.g., the on-board CP0 interrupt management parts on the MIPS). If = the soc bus in a MIPS DTS file is declared as = "mips4k,cp0"-compatible, then this will be enabled. This is sufficient to allow IRQs to = be configured on BERI. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#2 edit Differences ... =3D=3D=3D=3D //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#2 = (text+ko) =3D=3D=3D=3D @@ -49,8 +49,26 @@ { NULL, NULL } }; +/* + * For PIC-free boards, provide a PIC decoder to be used with mips4k = CP0 + * interrupt control directly. + */ +static int +fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int = *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "mips4k,cp0")) + return (ENXIO); + + *interrupt =3D fdt32_to_cpu(intr[0]); + *trig =3D INTR_TRIGGER_CONFORM; + *pol =3D INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] =3D { - NULL, - NULL, + &fdt_pic_decode_mips4k_cp0, NULL }; From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 13:25:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96592659; Wed, 2 Jan 2013 13:25:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8BF8FC15; Wed, 2 Jan 2013 13:25:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02DPCF6094189; Wed, 2 Jan 2013 13:25:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02DPCod094188; Wed, 2 Jan 2013 13:25:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201301021325.r02DPCod094188@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Jan 2013 13:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244958 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 13:25:12 -0000 Author: nwhitehorn Date: Wed Jan 2 13:25:11 2013 New Revision: 244958 URL: http://svnweb.freebsd.org/changeset/base/244958 Log: Make sade actually be a symlink to partedit, as per the commit message in r244859, rather than a hardlink. This fixes installation if /usr/sbin is on a different filesystem than /usr/libexec. Submitted by: se Modified: head/usr.sbin/bsdinstall/partedit/Makefile Modified: head/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/partedit/Makefile Wed Jan 2 07:33:43 2013 (r244957) +++ head/usr.sbin/bsdinstall/partedit/Makefile Wed Jan 2 13:25:11 2013 (r244958) @@ -2,7 +2,8 @@ BINDIR= /usr/libexec/bsdinstall PROG= partedit -LINKS= ${BINDIR}/partedit ${BINDIR}/autopart ${BINDIR}/partedit /usr/sbin/sade +LINKS= ${BINDIR}/partedit ${BINDIR}/autopart +SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:03:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9144327; Wed, 2 Jan 2013 18:03:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAF4B19DC; Wed, 2 Jan 2013 18:03:19 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02I3Jx1036005; Wed, 2 Jan 2013 18:03:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02I3JjE036004; Wed, 2 Jan 2013 18:03:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021803.r02I3JjE036004@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244960 - head/tools/tools/ath/arcode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:03:19 -0000 Author: adrian Date: Wed Jan 2 18:03:19 2013 New Revision: 244960 URL: http://svnweb.freebsd.org/changeset/base/244960 Log: Fix incorrect format string. Modified: head/tools/tools/ath/arcode/arcode.c Modified: head/tools/tools/ath/arcode/arcode.c ============================================================================== --- head/tools/tools/ath/arcode/arcode.c Wed Jan 2 16:47:23 2013 (r244959) +++ head/tools/tools/ath/arcode/arcode.c Wed Jan 2 18:03:19 2013 (r244960) @@ -106,7 +106,7 @@ main(int argc, const char *argv[]) op_mark(&a); break; default: - printf("op: %s; reg: %x; val: %x\n", + printf("op: %d; reg: 0x%x; val: 0x%x\n", a.op, a.reg, a.val); } } From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:05:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D7E4069F; Wed, 2 Jan 2013 18:05:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C800419F4; Wed, 2 Jan 2013 18:05:42 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02I5aHU036323; Wed, 2 Jan 2013 18:05:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02I5aGC036317; Wed, 2 Jan 2013 18:05:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021805.r02I5aGC036317@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244961 - head/tools/tools/ath/athdebug X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:05:42 -0000 Author: adrian Date: Wed Jan 2 18:05:31 2013 New Revision: 244961 URL: http://svnweb.freebsd.org/changeset/base/244961 Log: Fix some printf() formats. Found by: clang Modified: head/tools/tools/ath/athdebug/athdebug.c Modified: head/tools/tools/ath/athdebug/athdebug.c ============================================================================== --- head/tools/tools/ath/athdebug/athdebug.c Wed Jan 2 18:03:19 2013 (r244960) +++ head/tools/tools/ath/athdebug/athdebug.c Wed Jan 2 18:05:31 2013 (r244961) @@ -206,20 +206,20 @@ main(int argc, char *argv[]) bit = strtoul(cp, NULL, 0); else errx(1, "unknown flag %.*s", - tp-cp, cp); + (int) (tp-cp), cp); } ndebug = bit; } } while (*(cp = tp) != '\0'); } if (debug != ndebug) { - printf("%s: 0x%x => ", oid, debug); + printf("%s: 0x%llx => ", oid, (long long) debug); if (sysctlbyname(oid, NULL, NULL, &ndebug, sizeof(ndebug)) < 0) err(1, "sysctl-set(%s)", oid); - printf("0x%x", ndebug); + printf("0x%llx", (long long) ndebug); debug = ndebug; } else - printf("%s: 0x%x", oid, debug); + printf("%s: 0x%llx", oid, (long long) debug); sep = "<"; for (i = 0; i < N(flags); i++) if (debug & flags[i].bit) { From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:09:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF361A7F; Wed, 2 Jan 2013 18:09:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B121C1A42; Wed, 2 Jan 2013 18:09:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02I9ZKQ036978; Wed, 2 Jan 2013 18:09:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02I9ZVT036959; Wed, 2 Jan 2013 18:09:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021809.r02I9ZVT036959@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244962 - head/tools/tools/ath/athdecode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:09:52 -0000 Author: adrian Date: Wed Jan 2 18:09:30 2013 New Revision: 244962 URL: http://svnweb.freebsd.org/changeset/base/244962 Log: * Add missing format specifier for err() * add missing exit(0) * Fix some operator evaluation complaints. Thanks to: clang Modified: head/tools/tools/ath/athdecode/main.c Modified: head/tools/tools/ath/athdecode/main.c ============================================================================== --- head/tools/tools/ath/athdecode/main.c Wed Jan 2 18:05:31 2013 (r244961) +++ head/tools/tools/ath/athdecode/main.c Wed Jan 2 18:09:30 2013 (r244962) @@ -69,7 +69,7 @@ main(int argc, char *argv[]) filename = argv[1]; fd = open(filename, O_RDONLY); if (fd < 0) - err(1, filename); + err(1, "open: %s", filename); if (fstat(fd, &sb) < 0) err(1, "fstat"); addr = mmap(0, sb.st_size, PROT_READ, MAP_PRIVATE|MAP_NOCORE, fd, 0); @@ -192,6 +192,7 @@ opmark(FILE *fd, int i, const struct ath fprintf(fd, "mark #%u value %u/0x%x", r->reg, r->val, r->val); break; } + exit(0); } #include "ah_devid.h" @@ -302,8 +303,8 @@ register_regs(struct dumpreg *chipregs, */ if (nr->addr == r->addr && (nr->name == r->name || - nr->name != NULL && r->name != NULL && - strcmp(nr->name, r->name) == 0)) { + (nr->name != NULL && r->name != NULL && + strcmp(nr->name, r->name) == 0))) { if (nr->srevMin < r->srevMin && (r->srevMin <= nr->srevMax && nr->srevMax+1 <= r->srevMax)) { From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:12:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 408BF159; Wed, 2 Jan 2013 18:12:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 329E11A8B; Wed, 2 Jan 2013 18:12:27 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02ICRBc037574; Wed, 2 Jan 2013 18:12:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02ICBae037474; Wed, 2 Jan 2013 18:12:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021812.r02ICBae037474@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244963 - head/tools/tools/ath/athkey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:12:27 -0000 Author: adrian Date: Wed Jan 2 18:12:06 2013 New Revision: 244963 URL: http://svnweb.freebsd.org/changeset/base/244963 Log: * Add missing err() string formats; * Fix up a printf() type mismatch. Thanks to: clang Modified: head/tools/tools/ath/athkey/athkey.c Modified: head/tools/tools/ath/athkey/athkey.c ============================================================================== --- head/tools/tools/ath/athkey/athkey.c Wed Jan 2 18:09:30 2013 (r244962) +++ head/tools/tools/ath/athkey/athkey.c Wed Jan 2 18:12:06 2013 (r244963) @@ -83,8 +83,8 @@ getdata(const char *arg, u_int8_t *data, } if (len > maxlen) { fprintf(stderr, - "%s: too much data in %s, max %u bytes\n", - progname, arg, maxlen); + "%s: too much data in %s, max %llu bytes\n", + progname, arg, (unsigned long long) maxlen); } data[len++] = (b0<<4) | b1; } @@ -178,7 +178,7 @@ main(int argc, char *argv[]) atd.ad_in_data = (caddr_t) &keyix; atd.ad_in_size = sizeof(u_int16_t); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); return 0; case HAL_DIAG_SETKEY: if (argc != 3 && argc != 4) @@ -196,7 +196,7 @@ main(int argc, char *argv[]) atd.ad_in_data = (caddr_t) &setkey; atd.ad_in_size = sizeof(setkey); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); return 0; } return -1; From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:14:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9877C2DF; Wed, 2 Jan 2013 18:14:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A79B1AAD; Wed, 2 Jan 2013 18:14:28 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02IEQAq037876; Wed, 2 Jan 2013 18:14:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02IEQoT037875; Wed, 2 Jan 2013 18:14:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021814.r02IEQoT037875@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244964 - head/tools/tools/ath/athprom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:14:28 -0000 Author: adrian Date: Wed Jan 2 18:14:26 2013 New Revision: 244964 URL: http://svnweb.freebsd.org/changeset/base/244964 Log: Add missing err() format strings. Thanks to: clang Modified: head/tools/tools/ath/athprom/athprom.c Modified: head/tools/tools/ath/athprom/athprom.c ============================================================================== --- head/tools/tools/ath/athprom/athprom.c Wed Jan 2 18:12:06 2013 (r244963) +++ head/tools/tools/ath/athprom/athprom.c Wed Jan 2 18:14:26 2013 (r244964) @@ -159,7 +159,7 @@ main(int argc, char *argv[]) atd.ad_out_data = (caddr_t) &eep; atd.ad_out_size = sizeof(eep); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); if (fd == NULL) { fd = opentemplate(DIR_TEMPLATE); if (fd == NULL) @@ -186,7 +186,7 @@ eeread(u_int16_t off) atd.ad_out_size = sizeof(eedata); atd.ad_out_data = (caddr_t) &eedata; if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); return eedata; } @@ -204,7 +204,7 @@ eewrite(uint16_t off, uint16_t value) atd.ad_out_size = 0; atd.ad_out_data = NULL; if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); } #define MAXID 128 @@ -332,7 +332,7 @@ setmode(int mode) + sizeof(EXPN_DATA_PER_CHANNEL_5112) * exp->numChannels; atd.ad_out_data = (caddr_t) malloc(atd.ad_out_size); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); exp->pChannels = (void *) atd.ad_out_data; exp->pDataPerChannel = (void *)((char *)atd.ad_out_data + roundup(sizeof(u_int16_t) * exp->numChannels, sizeof(u_int32_t))); From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:21:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F17608BC; Wed, 2 Jan 2013 18:21:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA9961B41; Wed, 2 Jan 2013 18:21:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02ILOYY038826; Wed, 2 Jan 2013 18:21:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02ILOdA038825; Wed, 2 Jan 2013 18:21:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021821.r02ILOdA038825@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244965 - head/tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:21:25 -0000 Author: adrian Date: Wed Jan 2 18:21:24 2013 New Revision: 244965 URL: http://svnweb.freebsd.org/changeset/base/244965 Log: Fix up some warnings from clang. This still triggers a bug in clang.. Modified: head/tools/tools/ath/athstats/athstats.c Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Wed Jan 2 18:14:26 2013 (r244964) +++ head/tools/tools/ath/athstats/athstats.c Wed Jan 2 18:21:24 2013 (r244965) @@ -490,7 +490,7 @@ ath_zerostats(struct athstatfoo *wf0) struct athstatfoo_p *wf = (struct athstatfoo_p *) wf0; if (ioctl(wf->s, SIOCZATHSTATS, &wf->ifr) < 0) - err(-1, wf->ifr.ifr_name); + err(-1, "ioctl: %s", wf->ifr.ifr_name); } static void @@ -498,21 +498,21 @@ ath_collect(struct athstatfoo_p *wf, str { wf->ifr.ifr_data = (caddr_t) &stats->ath; if (ioctl(wf->s, SIOCGATHSTATS, &wf->ifr) < 0) - err(1, wf->ifr.ifr_name); + err(1, "ioctl: %s", wf->ifr.ifr_name); #ifdef ATH_SUPPORT_ANI if (wf->optstats & ATHSTATS_ANI) { wf->atd.ad_id = 5; wf->atd.ad_out_data = (caddr_t) &stats->ani_state; wf->atd.ad_out_size = sizeof(stats->ani_state); if (ioctl(wf->s, SIOCGATHDIAG, &wf->atd) < 0) { - warn(wf->atd.ad_name); + warn("ioctl: %s", wf->atd.ad_name); wf->optstats &= ~ATHSTATS_ANI; } wf->atd.ad_id = 8; wf->atd.ad_out_data = (caddr_t) &stats->ani_stats; wf->atd.ad_out_size = sizeof(stats->ani_stats); if (ioctl(wf->s, SIOCGATHDIAG, &wf->atd) < 0) - warn(wf->atd.ad_name); + warn("ioctl: %s", wf->atd.ad_name); } #endif /* ATH_SUPPORT_ANI */ } @@ -574,12 +574,14 @@ ath_get_curstat(struct statfoo *sf, int switch (s) { case S_INPUT: snprintf(b, bs, "%lu", - (wf->cur.ath.ast_rx_packets - wf->total.ath.ast_rx_packets) - - (wf->cur.ath.ast_rx_mgt - wf->total.ath.ast_rx_mgt)); + (unsigned long) + ((wf->cur.ath.ast_rx_packets - wf->total.ath.ast_rx_packets) - + (wf->cur.ath.ast_rx_mgt - wf->total.ath.ast_rx_mgt))); return 1; case S_OUTPUT: snprintf(b, bs, "%lu", - wf->cur.ath.ast_tx_packets - wf->total.ath.ast_tx_packets); + (unsigned long) + (wf->cur.ath.ast_tx_packets - wf->total.ath.ast_tx_packets)); return 1; case S_RATE: snprintrate(b, bs, wf->cur.ath.ast_tx_rate); From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:26:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1AE0BC19; Wed, 2 Jan 2013 18:26:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3BE1BF7; Wed, 2 Jan 2013 18:26:33 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02IQWiH039419; Wed, 2 Jan 2013 18:26:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02IQWBu039418; Wed, 2 Jan 2013 18:26:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021826.r02IQWBu039418@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244966 - head/tools/tools/ath/athratestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:26:33 -0000 Author: adrian Date: Wed Jan 2 18:26:32 2013 New Revision: 244966 URL: http://svnweb.freebsd.org/changeset/base/244966 Log: Fix some clang warnings! Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Wed Jan 2 18:21:24 2013 (r244965) +++ head/tools/tools/ath/athratestats/main.c Wed Jan 2 18:26:32 2013 (r244966) @@ -118,9 +118,9 @@ ath_sample_stats(struct ath_ratestats *r uint32_t mask; int rix, y; - PRINTMSG("static_rix (%d) ratemask 0x%x\n", + PRINTMSG("static_rix (%d) ratemask 0x%llx\n", sn->static_rix, - sn->ratemask); + (long long) sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD); @@ -241,7 +241,7 @@ rate_node_stats(struct ath_ratestats *r, fprintf(stderr, "unexpected TLV len (got %d bytes, " "expected %d bytes\n", av->tlv_len, - sizeof(struct ath_rateioctl_rt)); + (int) sizeof(struct ath_rateioctl_rt)); exit(127); } rt = (void *) (buf + sizeof(struct ath_rateioctl_tlv)); @@ -260,7 +260,7 @@ rate_node_stats(struct ath_ratestats *r, fprintf(stderr, "unexpected TLV len (got %d bytes, " "expected %d bytes\n", av->tlv_len, - sizeof(struct sample_node)); + (int) sizeof(struct sample_node)); exit(127); } sn = (void *) (buf + sizeof(struct ath_rateioctl_tlv) + @@ -268,6 +268,8 @@ rate_node_stats(struct ath_ratestats *r, sizeof(struct ath_rateioctl_tlv)); ath_sample_stats(r, rt, sn); + + return (0); } static void From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:29:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B26AAEF0; Wed, 2 Jan 2013 18:29:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A42621C3A; Wed, 2 Jan 2013 18:29:11 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02ITB3f039730; Wed, 2 Jan 2013 18:29:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02ITBnA039729; Wed, 2 Jan 2013 18:29:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021829.r02ITBnA039729@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244967 - head/tools/tools/ath/athratestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:29:11 -0000 Author: adrian Date: Wed Jan 2 18:29:11 2013 New Revision: 244967 URL: http://svnweb.freebsd.org/changeset/base/244967 Log: Fix some conversions to keep clang happy. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Wed Jan 2 18:26:32 2013 (r244966) +++ head/tools/tools/ath/athratestats/main.c Wed Jan 2 18:29:11 2013 (r244967) @@ -203,7 +203,7 @@ ath_setifname(struct ath_ratestats *r, c } static void -ath_setsta(struct ath_ratestats *r, const char *mac) +ath_setsta(struct ath_ratestats *r, uint8_t *mac) { memcpy(&r->re.is_u.macaddr, mac, sizeof(r->re.is_u.macaddr)); @@ -224,7 +224,7 @@ rate_node_stats(struct ath_ratestats *r, struct sample_node *sn = NULL; struct ath_rateioctl_rt *rt = NULL; int error = 0; - uint8_t *buf = r->re.buf; + uint8_t *buf = (uint8_t *) r->re.buf; /* * For now, hard-code the TLV order and contents. Ew! @@ -355,7 +355,7 @@ main(int argc, char *argv[]) if (buf == NULL) err(1, "calloc"); - r.re.buf = buf; + r.re.buf = (char *) buf; r.re.len = STATS_BUF_SIZE; r.s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:29:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E80B0E2; Wed, 2 Jan 2013 18:29:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9F5A1C4B; Wed, 2 Jan 2013 18:29:54 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02ITsOU039821; Wed, 2 Jan 2013 18:29:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02ITs1t039820; Wed, 2 Jan 2013 18:29:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021829.r02ITs1t039820@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244968 - head/tools/tools/ath/athsurvey X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:29:55 -0000 Author: adrian Date: Wed Jan 2 18:29:54 2013 New Revision: 244968 URL: http://svnweb.freebsd.org/changeset/base/244968 Log: Fix missing err() format string. Modified: head/tools/tools/ath/athsurvey/athsurvey.c Modified: head/tools/tools/ath/athsurvey/athsurvey.c ============================================================================== --- head/tools/tools/ath/athsurvey/athsurvey.c Wed Jan 2 18:29:11 2013 (r244967) +++ head/tools/tools/ath/athsurvey/athsurvey.c Wed Jan 2 18:29:54 2013 (r244968) @@ -66,7 +66,7 @@ get_survey_stats(int s, const char *ifna strncpy(atd.ad_name, ifname, sizeof(atd.ad_name)); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) { - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); return (0); } return (1); From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:33:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6EE8644C; Wed, 2 Jan 2013 18:33:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60A481C89; Wed, 2 Jan 2013 18:33:49 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02IXnFg040459; Wed, 2 Jan 2013 18:33:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02IXnk0040457; Wed, 2 Jan 2013 18:33:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021833.r02IXnk0040457@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244969 - head/tools/tools/ath/ath_prom_read X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:33:49 -0000 Author: adrian Date: Wed Jan 2 18:33:48 2013 New Revision: 244969 URL: http://svnweb.freebsd.org/changeset/base/244969 Log: Add missing err() format string. Modified: head/tools/tools/ath/ath_prom_read/ath_prom_read.c Modified: head/tools/tools/ath/ath_prom_read/ath_prom_read.c ============================================================================== --- head/tools/tools/ath/ath_prom_read/ath_prom_read.c Wed Jan 2 18:29:54 2013 (r244968) +++ head/tools/tools/ath/ath_prom_read/ath_prom_read.c Wed Jan 2 18:33:48 2013 (r244969) @@ -123,7 +123,7 @@ main(int argc, char *argv[]) atd.ad_out_data = (caddr_t) eep; atd.ad_out_size = sizeof(eep); if (ioctl(s, SIOCGATHDIAG, &atd) < 0) - err(1, atd.ad_name); + err(1, "ioctl: %s", atd.ad_name); /* Dump file? Then just write to it */ if (dumpname != NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 18:49:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CB2CDA2B; Wed, 2 Jan 2013 18:49:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBFF91D55; Wed, 2 Jan 2013 18:49:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02IneVT042569; Wed, 2 Jan 2013 18:49:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02IneTJ042568; Wed, 2 Jan 2013 18:49:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301021849.r02IneTJ042568@svn.freebsd.org> From: Adrian Chadd Date: Wed, 2 Jan 2013 18:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244970 - head/tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 18:49:40 -0000 Author: adrian Date: Wed Jan 2 18:49:40 2013 New Revision: 244970 URL: http://svnweb.freebsd.org/changeset/base/244970 Log: Disable clang for athstats for now. Modified: head/tools/tools/ath/athstats/Makefile Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Wed Jan 2 18:33:48 2013 (r244969) +++ head/tools/tools/ath/athstats/Makefile Wed Jan 2 18:49:40 2013 (r244970) @@ -4,6 +4,10 @@ PROG= athstats +# Because of a clang preprocessor parser limitation causing this +# to not compile, use gcc for now. +CC= gcc + SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h CLEANFILES+= opt_ah.h From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 20:58:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0DBFEB90; Wed, 2 Jan 2013 20:58:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EEB912CC; Wed, 2 Jan 2013 20:58:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02KwkF8061954; Wed, 2 Jan 2013 20:58:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02Kwk9b061953; Wed, 2 Jan 2013 20:58:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301022058.r02Kwk9b061953@svn.freebsd.org> From: Xin LI Date: Wed, 2 Jan 2013 20:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244974 - head/crypto/openssl/crypto/bn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 20:58:47 -0000 Author: delphij Date: Wed Jan 2 20:58:46 2013 New Revision: 244974 URL: http://svnweb.freebsd.org/changeset/base/244974 Log: MFV r244973: Integrate OpenSSL changeset 22950 (appro): bn_word.c: fix overflow bug in BN_add_word. MFC after: 2 weeks Modified: head/crypto/openssl/crypto/bn/bn_word.c Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/crypto/bn/bn_word.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_word.c Wed Jan 2 20:56:53 2013 (r244973) +++ head/crypto/openssl/crypto/bn/bn_word.c Wed Jan 2 20:58:46 2013 (r244974) @@ -144,26 +144,17 @@ int BN_add_word(BIGNUM *a, BN_ULONG w) a->neg=!(a->neg); return(i); } - /* Only expand (and risk failing) if it's possibly necessary */ - if (((BN_ULONG)(a->d[a->top - 1] + 1) == 0) && - (bn_wexpand(a,a->top+1) == NULL)) - return(0); - i=0; - for (;;) + for (i=0;w!=0 && itop;i++) { - if (i >= a->top) - l=w; - else - l=(a->d[i]+w)&BN_MASK2; - a->d[i]=l; - if (w > l) - w=1; - else - break; - i++; + a->d[i] = l = (a->d[i]+w)&BN_MASK2; + w = (w>l)?1:0; } - if (i >= a->top) + if (w && i==a->top) + { + if (bn_wexpand(a,a->top+1) == NULL) return 0; a->top++; + a->d[i]=w; + } bn_check_top(a); return(1); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 21:00:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BEE99D0B; Wed, 2 Jan 2013 21:00:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B23462DB; Wed, 2 Jan 2013 21:00:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02L00Pl062200; Wed, 2 Jan 2013 21:00:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02L00Ff062199; Wed, 2 Jan 2013 21:00:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301022100.r02L00Ff062199@svn.freebsd.org> From: Xin LI Date: Wed, 2 Jan 2013 21:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244975 - head/crypto/openssl/crypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 21:00:00 -0000 Author: delphij Date: Wed Jan 2 21:00:00 2013 New Revision: 244975 URL: http://svnweb.freebsd.org/changeset/base/244975 Log: Indicate that we are using OpenSSL with some local modifications. X-MFC after: with r244974 Modified: head/crypto/openssl/crypto/opensslv.h Modified: head/crypto/openssl/crypto/opensslv.h ============================================================================== --- head/crypto/openssl/crypto/opensslv.h Wed Jan 2 20:58:46 2013 (r244974) +++ head/crypto/openssl/crypto/opensslv.h Wed Jan 2 21:00:00 2013 (r244975) @@ -29,7 +29,7 @@ #ifdef OPENSSL_FIPS #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c-fips 10 May 2012" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c 10 May 2012" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c-freebsd 10 May 2012" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 21:03:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4796F9F; Wed, 2 Jan 2013 21:03:48 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.187]) by mx1.freebsd.org (Postfix) with ESMTP id A5BA4301; Wed, 2 Jan 2013 21:03:47 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by lada.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1TqVTR-0005HB-Ut; Wed, 02 Jan 2013 13:03:41 -0800 Received: from localhost (unverified [49.224.182.145]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Wed, 2 Jan 2013 16:03:44 -0500 Date: Thu, 3 Jan 2013 10:02:58 +1300 From: Andrew Turner To: "Robert N. M. Watson" Subject: Re: svn commit: r244899 - head/sys/mips/beri Message-ID: <20130103100258.2e22763f@fubar.geek.nz> In-Reply-To: <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 21:03:48 -0000 On Wed, 2 Jan 2013 11:01:27 +0000 "Robert N. M. Watson" wrote: > > On 1 Jan 2013, at 22:08, Andrew Turner wrote: > > >> On a semi-related note: the current obstacle to moving more devices > >> over to using FDT on BERI is that our FDT implementation appears to > >> require a PIC to be configured. We're not actually using a PIC on > >> BERI currently. It works fine attached to nexus, as the implied > >> fallback for not having a PIC is to simply use the suitably > >> numbered interrupt wires direct into the MIPS. However, trying the > >> same setup described using FDT leads to an interrupt-related > >> warning at boot, and no interrupt being provided to the driver. I > >> suspect I need to provide a PIC-alike software component as a > >> fall-back for the non-PIC case. From a brief e-mail exchange with > >> JC, it sounds like the XLP FDT setup is actually not using > >> interrupts either, currently. > > > > I'm not sure if a PIC is required. From my reading of the code it > > appears not. By the look of it if you are using the nexus to > > handle interrupts you need to put an interrupts property in the > > device and "#interrupt-cells = <1>;" in the soc node. > > > > You will also need to implement an interrupt decode function and > > add it to the fdt_pic_table array. ARM has a number of almost > > identical copies of this function you can use for inspration. > > > This seemed to do the trick; what do you think of the attached? This > isn't a board-specific change, so I dropped it into the common > fdt_mips.c code. On the other hand, this left it a bit open as to > what the right compatible= line to use was, so feedback there most > welcome. The patch looks good. From my reading of [1] the compatible value should be something like "mips,mips4k" as it's value is of the form ",". I have been thinking the best way of merging these almost identical decode functions. Linux appears to do it by providing a per-controller function that can translate between the interrupt spec and the configuration allowing them to have a generic parsing function that doesn't need to check if the controller is compatible. I would like us to have something similar as it will remove the duplicate function. Andrew [1] http://www.devicetree.org/Device_Tree_Usage From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 21:45:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F0B1D57; Wed, 2 Jan 2013 21:45:21 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4848465D; Wed, 2 Jan 2013 21:45:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02LjLUq069449; Wed, 2 Jan 2013 21:45:21 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02LjKnP069447; Wed, 2 Jan 2013 21:45:20 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201301022145.r02LjKnP069447@svn.freebsd.org> From: Jack F Vogel Date: Wed, 2 Jan 2013 21:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244977 - head/sys/dev/ichwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 21:45:21 -0000 Author: jfv Date: Wed Jan 2 21:45:20 2013 New Revision: 244977 URL: http://svnweb.freebsd.org/changeset/base/244977 Log: Add support for new Intel Lynx Point PCH - Watchdog Timer Device IDs Modified: head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Wed Jan 2 21:27:32 2013 (r244976) +++ head/sys/dev/ichwd/ichwd.c Wed Jan 2 21:45:20 2013 (r244977) @@ -191,6 +191,9 @@ static struct ichwd_device ichwd_devices { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10 }, { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10 }, { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10 }, + { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 }, + { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { 0, NULL, 0 }, }; Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Wed Jan 2 21:27:32 2013 (r244976) +++ head/sys/dev/ichwd/ichwd.h Wed Jan 2 21:45:20 2013 (r244977) @@ -177,6 +177,38 @@ struct ichwd_softc { #define DEVICEID_3400 0x3b12 #define DEVICEID_3420 0x3b14 #define DEVICEID_3450 0x3b16 +#define DEVICEID_LPT0 0x8c40 +#define DEVICEID_LPT1 0x8c41 +#define DEVICEID_LPT2 0x8c42 +#define DEVICEID_LPT3 0x8c43 +#define DEVICEID_LPT4 0x8c44 +#define DEVICEID_LPT5 0x8c45 +#define DEVICEID_LPT6 0x8c46 +#define DEVICEID_LPT7 0x8c47 +#define DEVICEID_LPT8 0x8c48 +#define DEVICEID_LPT9 0x8c49 +#define DEVICEID_LPT10 0x8c4a +#define DEVICEID_LPT11 0x8c4b +#define DEVICEID_LPT12 0x8c4c +#define DEVICEID_LPT13 0x8c4d +#define DEVICEID_LPT14 0x8c4e +#define DEVICEID_LPT15 0x8c4f +#define DEVICEID_LPT16 0x8c50 +#define DEVICEID_LPT17 0x8c51 +#define DEVICEID_LPT18 0x8c52 +#define DEVICEID_LPT19 0x8c53 +#define DEVICEID_LPT20 0x8c54 +#define DEVICEID_LPT21 0x8c55 +#define DEVICEID_LPT22 0x8c56 +#define DEVICEID_LPT23 0x8c57 +#define DEVICEID_LPT24 0x8c58 +#define DEVICEID_LPT25 0x8c59 +#define DEVICEID_LPT26 0x8c5a +#define DEVICEID_LPT27 0x8c5b +#define DEVICEID_LPT28 0x8c5c +#define DEVICEID_LPT29 0x8c5d +#define DEVICEID_LPT30 0x8c5e +#define DEVICEID_LPT31 0x8c5f /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 21:56:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A960503; Wed, 2 Jan 2013 21:56:59 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42B046C8; Wed, 2 Jan 2013 21:56:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02Luxwi071404; Wed, 2 Jan 2013 21:56:59 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02LuwRj071402; Wed, 2 Jan 2013 21:56:58 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201301022156.r02LuwRj071402@svn.freebsd.org> From: Jack F Vogel Date: Wed, 2 Jan 2013 21:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244980 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 21:56:59 -0000 Author: jfv Date: Wed Jan 2 21:56:58 2013 New Revision: 244980 URL: http://svnweb.freebsd.org/changeset/base/244980 Log: Add Intel Lynx Point PCH HD Audio Device IDs Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Jan 2 21:54:37 2013 (r244979) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Jan 2 21:56:58 2013 (r244980) @@ -81,6 +81,8 @@ static const struct { { HDA_INTEL_CPT, "Intel Cougar Point", 0, 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0, 0 }, { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, + { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Jan 2 21:54:37 2013 (r244979) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Jan 2 21:56:58 2013 (r244980) @@ -54,6 +54,8 @@ #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_PCH2 HDA_MODEL_CONSTRUCT(INTEL, 0x3b57) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) +#define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) +#define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 22:01:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC6CF91E; Wed, 2 Jan 2013 22:01:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96D94714; Wed, 2 Jan 2013 22:01:27 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02M1RGI072176; Wed, 2 Jan 2013 22:01:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02M1R1L072175; Wed, 2 Jan 2013 22:01:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201301022201.r02M1R1L072175@svn.freebsd.org> From: Jack F Vogel Date: Wed, 2 Jan 2013 22:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244981 - head/sys/dev/ichsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 22:01:27 -0000 Author: jfv Date: Wed Jan 2 22:01:26 2013 New Revision: 244981 URL: http://svnweb.freebsd.org/changeset/base/244981 Log: Add Intel Lynx Point PCH SMBus Device IDs Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed Jan 2 21:56:58 2013 (r244980) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed Jan 2 22:01:26 2013 (r244981) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #define ID_PATSBURG 0x1d228086 #define ID_CPT 0x1c228086 #define ID_PPT 0x1e228086 +#define ID_LPT 0x8c228086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -188,6 +189,9 @@ ichsmb_pci_probe(device_t dev) case ID_PPT: device_set_desc(dev, "Intel Panther Point SMBus controller"); break; + case ID_LPT: + device_set_desc(dev, "Intel Lynx Point SMBus controller"); + break; default: return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 22:26:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C12092C4; Wed, 2 Jan 2013 22:26:47 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF0467DE; Wed, 2 Jan 2013 22:26:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02MQlmH076448; Wed, 2 Jan 2013 22:26:47 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02MQl5a076444; Wed, 2 Jan 2013 22:26:47 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201301022226.r02MQl5a076444@svn.freebsd.org> From: Jack F Vogel Date: Wed, 2 Jan 2013 22:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244983 - in head/sys/dev: ahci ata ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 22:26:47 -0000 Author: jfv Date: Wed Jan 2 22:26:46 2013 New Revision: 244983 URL: http://svnweb.freebsd.org/changeset/base/244983 Log: Add Intel Lynx Point PCH SATA Controller Device IDs Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Jan 2 22:14:18 2013 (r244982) +++ head/sys/dev/ahci/ahci.c Wed Jan 2 22:26:46 2013 (r244983) @@ -179,6 +179,14 @@ static struct { {0x1e078086, 0x00, "Intel Panther Point", 0}, {0x1e0e8086, 0x00, "Intel Panther Point", 0}, {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x8c028086, 0x00, "Intel Lynx Point", 0}, + {0x8c038086, 0x00, "Intel Lynx Point", 0}, + {0x8c048086, 0x00, "Intel Lynx Point", 0}, + {0x8c058086, 0x00, "Intel Lynx Point", 0}, + {0x8c068086, 0x00, "Intel Lynx Point", 0}, + {0x8c078086, 0x00, "Intel Lynx Point", 0}, + {0x8c0e8086, 0x00, "Intel Lynx Point", 0}, + {0x8c0f8086, 0x00, "Intel Lynx Point", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Jan 2 22:14:18 2013 (r244982) +++ head/sys/dev/ata/ata-pci.h Wed Jan 2 22:26:46 2013 (r244983) @@ -260,6 +260,19 @@ struct ata_pci_controller { #define ATA_PPT_R5 0x1e0e8086 #define ATA_PPT_R6 0x1e0f8086 +#define ATA_LPT_S1 0x8c008086 +#define ATA_LPT_S2 0x8c018086 +#define ATA_LPT_AH1 0x8c028086 +#define ATA_LPT_AH2 0x8c038086 +#define ATA_LPT_R1 0x8c048086 +#define ATA_LPT_R2 0x8c058086 +#define ATA_LPT_R3 0x8c068086 +#define ATA_LPT_R4 0x8c078086 +#define ATA_LPT_S3 0x8c088086 +#define ATA_LPT_S4 0x8c098086 +#define ATA_LPT_R5 0x8c0e8086 +#define ATA_LPT_R6 0x8c0f8086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Wed Jan 2 22:14:18 2013 (r244982) +++ head/sys/dev/ata/chipsets/ata-intel.c Wed Jan 2 22:26:46 2013 (r244983) @@ -211,6 +211,18 @@ ata_intel_probe(device_t dev) { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_LPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 23:17:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4FB12209; Wed, 2 Jan 2013 23:17:51 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33BC5988; Wed, 2 Jan 2013 23:17:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02NHpps084589; Wed, 2 Jan 2013 23:17:51 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02NHoCM084585; Wed, 2 Jan 2013 23:17:50 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201301022317.r02NHoCM084585@svn.freebsd.org> From: Juli Mallett Date: Wed, 2 Jan 2013 23:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244984 - in head/sys: conf contrib/octeon-sdk mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 23:17:51 -0000 Author: jmallett Date: Wed Jan 2 23:17:50 2013 New Revision: 244984 URL: http://svnweb.freebsd.org/changeset/base/244984 Log: Add basic support for the Ubiquiti EdgeRouter Lite. Note that USB does not currently work, and the flash is connected via USB, so local storage is not working. Modified: head/sys/conf/options.mips head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/mips/conf/OCTEON1 Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Wed Jan 2 22:26:46 2013 (r244983) +++ head/sys/conf/options.mips Wed Jan 2 23:17:50 2013 (r244984) @@ -73,6 +73,7 @@ MAXMEM opt_global.h # OCTEON_MODEL opt_cvmx.h OCTEON_VENDOR_LANNER opt_cvmx.h +OCTEON_VENDOR_UBIQUITI opt_cvmx.h OCTEON_VENDOR_RADISYS opt_cvmx.h OCTEON_BOARD_CAPK_0100ND opt_cvmx.h Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Wed Jan 2 22:26:46 2013 (r244983) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Wed Jan 2 23:17:50 2013 (r244984) @@ -299,6 +299,9 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002, CVMX_BOARD_TYPE_CUST_LANNER_MR321X=20007, #endif +#if defined(OCTEON_VENDOR_UBIQUITI) + CVMX_BOARD_TYPE_CUST_UBIQUITI_E100=20002, +#endif #if defined(OCTEON_VENDOR_RADISYS) CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002, #endif @@ -426,6 +429,9 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR321X) #endif +#if defined(OCTEON_VENDOR_UBIQUITI) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_UBIQUITI_E100) +#endif #if defined(OCTEON_VENDOR_RADISYS) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) #endif Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan 2 22:26:46 2013 (r244983) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan 2 23:17:50 2013 (r244984) @@ -592,6 +592,12 @@ int cvmx_helper_board_get_mii_address(in return -1; } #endif +#if defined(OCTEON_VENDOR_UBIQUITI) + case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: + if (ipd_port > 2) + return -1; + return (7 - ipd_port); +#endif #if defined(OCTEON_VENDOR_RADISYS) case CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE: /* No MII. */ Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Jan 2 22:26:46 2013 (r244983) +++ head/sys/mips/conf/OCTEON1 Wed Jan 2 23:17:50 2013 (r244984) @@ -39,6 +39,7 @@ makeoptions DEBUG=-g #Build kernel with # Board-specific support that cannot be auto-detected at runtime. #options OCTEON_VENDOR_LANNER # Support for Lanner boards. #options OCTEON_VENDOR_RADISYS # Support for Radisys boards. +#options OCTEON_VENDOR_UBIQUITI # Support for Ubiquiti boards. #options OCTEON_BOARD_CAPK_0100ND # Support for CAPK-0100nd. # Compile for a specified Octeon model. If not specified, support for From owner-svn-src-head@FreeBSD.ORG Wed Jan 2 23:29:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 51A9A4FF; Wed, 2 Jan 2013 23:29:55 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4366F9E9; Wed, 2 Jan 2013 23:29:55 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r02NTtpi086232; Wed, 2 Jan 2013 23:29:55 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r02NTtVI086231; Wed, 2 Jan 2013 23:29:55 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201301022329.r02NTtVI086231@svn.freebsd.org> From: Juli Mallett Date: Wed, 2 Jan 2013 23:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244985 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 02 Jan 2013 23:29:55 -0000 Author: jmallett Date: Wed Jan 2 23:29:54 2013 New Revision: 244985 URL: http://svnweb.freebsd.org/changeset/base/244985 Log: Use the right USB clock type on the EdgeRouter Lite. This fixes USB. Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan 2 23:17:50 2013 (r244984) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Wed Jan 2 23:29:54 2013 (r244985) @@ -1469,6 +1469,9 @@ cvmx_helper_board_usb_clock_types_t __cv case CVMX_BOARD_TYPE_CUST_LANNER_MR320: case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: #endif +#if defined(OCTEON_VENDOR_UBIQUITI) + case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: +#endif #if defined(OCTEON_BOARD_CAPK_0100ND) case CVMX_BOARD_TYPE_CN3010_EVB_HS5: #endif From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 00:49:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E7A5E9; Thu, 3 Jan 2013 00:49:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98BC4CCE; Thu, 3 Jan 2013 00:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r030nCOT098000; Thu, 3 Jan 2013 00:49:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r030nCYm097999; Thu, 3 Jan 2013 00:49:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301030049.r030nCYm097999@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 00:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244986 - head/usr.sbin/daemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 00:49:12 -0000 Author: marius Date: Thu Jan 3 00:49:11 2013 New Revision: 244986 URL: http://svnweb.freebsd.org/changeset/base/244986 Log: Remove bogus '-' from getopt(3) string hit when porting daemon(8) to GNU/Linux *duck*. MFC after: 1 week Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Wed Jan 2 23:29:54 2013 (r244985) +++ head/usr.sbin/daemon/daemon.c Thu Jan 3 00:49:11 2013 (r244986) @@ -62,7 +62,7 @@ main(int argc, char *argv[]) nochdir = noclose = 1; restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { + while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 01:09:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 185F1A9A; Thu, 3 Jan 2013 01:09:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09435D7A; Thu, 3 Jan 2013 01:09:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0319oG6001350; Thu, 3 Jan 2013 01:09:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0319ogV001349; Thu, 3 Jan 2013 01:09:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301030109.r0319ogV001349@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 01:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244987 - head/sys/i386/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 01:09:51 -0000 Author: marius Date: Thu Jan 3 01:09:50 2013 New Revision: 244987 URL: http://svnweb.freebsd.org/changeset/base/244987 Log: Fix !INVARIANTS && !SMP build. MFC after: 3 days Modified: head/sys/i386/xen/xen_machdep.c Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Thu Jan 3 00:49:11 2013 (r244986) +++ head/sys/i386/xen/xen_machdep.c Thu Jan 3 01:09:50 2013 (r244987) @@ -216,7 +216,9 @@ static mmu_update_t xpq_queue[MAX_VIRT_C #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; +#ifdef INVARIANTS static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; +#endif static int xpq_idx = 0; #define XPQ_QUEUE_LOG xpq_queue_log From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 07:25:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0AD126B3; Thu, 3 Jan 2013 07:25:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8937200; Thu, 3 Jan 2013 07:25:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r037PVEN057659; Thu, 3 Jan 2013 07:25:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r037PUCY057653; Thu, 3 Jan 2013 07:25:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301030725.r037PUCY057653@svn.freebsd.org> From: Xin LI Date: Thu, 3 Jan 2013 07:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244988 - head/contrib/one-true-awk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 07:25:32 -0000 Author: delphij Date: Thu Jan 3 07:25:30 2013 New Revision: 244988 URL: http://svnweb.freebsd.org/changeset/base/244988 Log: MFV: one-true-awk 20121220. MFC after: 1 month Modified: head/contrib/one-true-awk/FIXES head/contrib/one-true-awk/main.c head/contrib/one-true-awk/makefile head/contrib/one-true-awk/proto.h head/contrib/one-true-awk/run.c head/contrib/one-true-awk/tran.c Directory Properties: head/contrib/one-true-awk/ (props changed) Modified: head/contrib/one-true-awk/FIXES ============================================================================== --- head/contrib/one-true-awk/FIXES Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/FIXES Thu Jan 3 07:25:30 2013 (r244988) @@ -25,6 +25,22 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Dec 20, 2012: + fiddled makefile to get correct yacc and bison flags. pick yacc + (linux) or bison (mac) as necessary. + + added __attribute__((__noreturn__)) to a couple of lines in + proto.h, to silence someone's enthusiastic checker. + + fixed obscure call by value bug in split(a[1],a) reported on + 9fans. the management of temporary values is just a mess; i + took a shortcut by making an extra string copy. thanks + to paul patience and arnold robbins for passing it on and for + proposed patches. + + tiny fiddle in setfval to eliminate -0 results in T.expr, which + has irritated me for 20+ years. + Aug 10, 2011: another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/main.c Thu Jan 3 07:25:30 2013 (r244988) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110810 (FreeBSD)"; +const char *version = "version 20121220 (FreeBSD)"; #define DEBUG #include Modified: head/contrib/one-true-awk/makefile ============================================================================== --- head/contrib/one-true-awk/makefile Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/makefile Thu Jan 3 07:25:30 2013 (r244988) @@ -26,15 +26,15 @@ CFLAGS = -g CFLAGS = -O2 CFLAGS = -CC = gcc -Wall -g -CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing -YACC = bison -y -YACC = yacc -YFLAGS = -d +YACC = bison -d -y +YACC = yacc -d -S +#YFLAGS = -d -S + # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o Modified: head/contrib/one-true-awk/proto.h ============================================================================== --- head/contrib/one-true-awk/proto.h Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/proto.h Thu Jan 3 07:25:30 2013 (r244988) @@ -46,7 +46,7 @@ extern void freetr(Node *); extern int hexstr(uschar **); extern int quoted(uschar **); extern char *cclenter(const char *); -extern void overflo(const char *); +extern void overflo(const char *) __attribute__((__noreturn__)); extern void cfoll(fa *, Node *); extern int first(Node *); extern void follow(Node *); @@ -132,7 +132,7 @@ extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...); +extern void FATAL(const char *, ...) __attribute__((__noreturn__)); extern void WARNING(const char *, ...); extern void error(void); extern void eprint(void); Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/run.c Thu Jan 3 07:25:30 2013 (r244988) @@ -1213,13 +1213,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1339,6 +1339,7 @@ Cell *split(Node **a, int nnn) /* split( } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Thu Jan 3 01:09:50 2013 (r244987) +++ head/contrib/one-true-awk/tran.c Thu Jan 3 07:25:30 2013 (r244988) @@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ + if (f == -0) /* who would have thought this possible? */ + f = 0; dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 10:21:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AEC4FE00; Thu, 3 Jan 2013 10:21:29 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 893E8DF4; Thu, 3 Jan 2013 10:21:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03ALTd4084264; Thu, 3 Jan 2013 10:21:29 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03ALTKa084262; Thu, 3 Jan 2013 10:21:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201301031021.r03ALTKa084262@svn.freebsd.org> From: Peter Wemm Date: Thu, 3 Jan 2013 10:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244989 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 10:21:29 -0000 Author: peter Date: Thu Jan 3 10:21:28 2013 New Revision: 244989 URL: http://svnweb.freebsd.org/changeset/base/244989 Log: Temporarily revert rev 244678. This is causing loopback problems with the lo (loopback) interfaces. Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Jan 3 07:25:30 2013 (r244988) +++ head/sys/netinet/in.c Thu Jan 3 10:21:28 2013 (r244989) @@ -819,19 +819,14 @@ in_ifinit(struct ifnet *ifp, struct in_i return (error); /* - * Give the interface a chance to initialize if this is its first - * address, and to validate the address if necessary. - * - * Historically, drivers managed IFF_UP flag theirselves, so we - * need to check whether driver did that. + * Give the interface a chance to initialize + * if this is its first address, + * and to validate the address if necessary. */ - flags = ifp->if_flags; if (ifp->if_ioctl != NULL && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia)) != 0) /* LIST_REMOVE(ia, ia_hash) is done in in_control */ return (error); - if ((ifp->if_flags & IFF_UP) && (flags & IFF_UP) == 0) - if_up(ifp); /* * Be compatible with network classes, if netmask isn't supplied, Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Jan 3 07:25:30 2013 (r244988) +++ head/sys/netinet6/in6.c Thu Jan 3 10:21:28 2013 (r244989) @@ -1874,18 +1874,9 @@ in6_ifinit(struct ifnet *ifp, struct in6 ia->ia_addr = *sin6; if (ifacount <= 1 && ifp->if_ioctl) { - int flags; - - /* - * Historically, drivers managed IFF_UP flag theirselves, so we - * need to check whether driver did that. - */ - flags = ifp->if_flags; error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); if (error) return (error); - if ((ifp->if_flags & IFF_UP) && (flags & IFF_UP) == 0) - if_up(ifp); } ia->ia_ifa.ifa_metric = ifp->if_metric; From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 13:42:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B093FCC; Thu, 3 Jan 2013 13:42:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2CF8BC; Thu, 3 Jan 2013 13:42:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03DgkeT015746; Thu, 3 Jan 2013 13:42:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03DgkxH015745; Thu, 3 Jan 2013 13:42:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301031342.r03DgkxH015745@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 13:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244990 - head/sys/dev/xen/control X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 13:42:46 -0000 Author: marius Date: Thu Jan 3 13:42:45 2013 New Revision: 244990 URL: http://svnweb.freebsd.org/changeset/base/244990 Log: - Fix !SMP build. - Replace incorrect function names in printf(9) strings with __func__. - Make xctrl_shutdown_reasons table const. - Use nitems() rather than rolling an own version. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. MFC after: 3 days Modified: head/sys/dev/xen/control/control.c Modified: head/sys/dev/xen/control/control.c ============================================================================== --- head/sys/dev/xen/control/control.c Thu Jan 3 10:21:28 2013 (r244989) +++ head/sys/dev/xen/control/control.c Thu Jan 3 13:42:45 2013 (r244990) @@ -125,7 +125,6 @@ __FBSDID("$FreeBSD$"); #include #endif - #include #include @@ -145,8 +144,6 @@ __FBSDID("$FreeBSD$"); #include -#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*(x))) - /*--------------------------- Forward Declarations --------------------------*/ /** Function signature for shutdown event handlers. */ typedef void (xctrl_shutdown_handler_t)(void); @@ -165,7 +162,7 @@ struct xctrl_shutdown_reason { }; /** Lookup table for shutdown event name to handler. */ -static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { +static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "poweroff", xctrl_poweroff }, { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, @@ -198,7 +195,6 @@ extern void xencons_resume(void); static void xctrl_suspend() { - u_int cpuid; int i, j, k, fpp; unsigned long max_pfn, start_info_mfn; @@ -207,6 +203,8 @@ xctrl_suspend() #ifdef SMP struct thread *td; cpuset_t map; + u_int cpuid; + /* * Bind us to CPU 0 and stop any other VCPUs. */ @@ -231,7 +229,7 @@ xctrl_suspend() mtx_lock(&Giant); if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); #ifdef SMP if (!CPU_EMPTY(&map)) restart_cpus(map); @@ -343,9 +341,9 @@ xctrl_suspend() * drivers need this. */ mtx_lock(&Giant); - if (DEVICE_SUSPEND(root_bus)) { + if (DEVICE_SUSPEND(root_bus) != 0) { mtx_unlock(&Giant); - printf("xen_suspend: device_suspend failed\n"); + printf("%s: device_suspend failed\n", __func__); return; } mtx_unlock(&Giant); @@ -396,8 +394,8 @@ xctrl_halt() static void xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len) { - struct xctrl_shutdown_reason *reason; - struct xctrl_shutdown_reason *last_reason; + const struct xctrl_shutdown_reason *reason; + const struct xctrl_shutdown_reason *last_reason; char *result; int error; int result_len; @@ -408,7 +406,7 @@ xctrl_on_watch_event(struct xs_watch *wa return; reason = xctrl_shutdown_reasons; - last_reason = reason + NUM_ELEMENTS(xctrl_shutdown_reasons); + last_reason = reason + nitems(xctrl_shutdown_reasons); while (reason < last_reason) { if (!strcmp(result, reason->name)) { @@ -511,10 +509,10 @@ static device_method_t xctrl_methods[] = DEVMETHOD(device_attach, xctrl_attach), DEVMETHOD(device_detach, xctrl_detach), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(xctrl, xctrl_driver, xctrl_methods, sizeof(struct xctrl_softc)); devclass_t xctrl_devclass; -DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, 0, 0); +DRIVER_MODULE(xctrl, xenstore, xctrl_driver, xctrl_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 13:44:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40BD029D; Thu, 3 Jan 2013 13:44:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32EA48D1; Thu, 3 Jan 2013 13:44:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03DiQn6016081; Thu, 3 Jan 2013 13:44:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03DiQGE016080; Thu, 3 Jan 2013 13:44:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301031344.r03DiQGE016080@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 13:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244991 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 13:44:26 -0000 Author: marius Date: Thu Jan 3 13:44:25 2013 New Revision: 244991 URL: http://svnweb.freebsd.org/changeset/base/244991 Log: - Replace partially incorrect function names in panic(9) strings with __func__ and add some missing ones. - Remove a stale comment. - Remove unused NUM_ELEMENTS macro. - Remove extra empty lines. - Use DEVMETHOD_END. - Use NULL rather than 0 for pointers. MFC after: 3 days Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jan 3 13:42:45 2013 (r244990) +++ head/sys/dev/xen/netfront/netfront.c Thu Jan 3 13:44:25 2013 (r244991) @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -208,8 +207,6 @@ struct xn_chain_data { struct mbuf *xn_rx_chain[NET_RX_RING_SIZE+1]; }; -#define NUM_ELEMENTS(x) (sizeof(x)/sizeof(*x)) - struct net_device_stats { u_long rx_packets; /* total packets received */ @@ -244,7 +241,6 @@ struct net_device_stats }; struct netfront_info { - struct ifnet *xn_ifp; #if __FreeBSD_version >= 700000 struct lro_ctrl xn_lro; @@ -329,12 +325,6 @@ struct netfront_rx_info { /* Access macros for acquiring freeing slots in xn_free_{tx,rx}_idxs[]. */ - - -/* - * Access macros for acquiring freeing slots in tx_skbs[]. - */ - static inline void add_id_to_freelist(struct mbuf **list, uintptr_t id) { @@ -517,7 +507,6 @@ netfront_resume(device_t dev) return (0); } - /* Common code used when first setting up, and when resuming. */ static int talk_to_backend(device_t dev, struct netfront_info *info) @@ -605,7 +594,6 @@ talk_to_backend(device_t dev, struct net return err; } - static int setup_device(device_t dev, struct netfront_info *info) { @@ -794,7 +782,7 @@ netif_release_tx_bufs(struct netfront_in add_id_to_freelist(np->tx_mbufs, i); np->xn_cdata.xn_tx_chain_cnt--; if (np->xn_cdata.xn_tx_chain_cnt < 0) { - panic("netif_release_tx_bufs: tx_chain_cnt must be >= 0"); + panic("%s: tx_chain_cnt must be >= 0", __func__); } m_free(m); } @@ -946,7 +934,6 @@ refill: reservation.domid = DOMID_SELF; if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_ALL; @@ -958,15 +945,11 @@ refill: /* Zap PTEs and give away pages in one big multicall. */ (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - /* Check return status of HYPERVISOR_dom_mem_op(). */ - if (unlikely(sc->rx_mcl[i].result != i)) - panic("Unable to reduce memory reservation\n"); - } else { - if (HYPERVISOR_memory_op( - XENMEM_decrease_reservation, &reservation) - != i) - panic("Unable to reduce memory " - "reservation\n"); + if (unlikely(sc->rx_mcl[i].result != i || + HYPERVISOR_memory_op(XENMEM_decrease_reservation, + &reservation) != i)) + panic("%s: unable to reduce memory " + "reservation\n", __func__); } } else { wmb(); @@ -1169,8 +1152,8 @@ xn_txeof(struct netfront_info *np) ifp->if_opackets++; if (unlikely(gnttab_query_foreign_access( np->grant_tx_ref[id]) != 0)) { - panic("grant id %u still in use by the backend", - id); + panic("%s: grant id %u still in use by the " + "backend", __func__, id); } gnttab_end_foreign_access_ref( np->grant_tx_ref[id]); @@ -1210,7 +1193,6 @@ xn_txeof(struct netfront_info *np) netif_wake_queue(dev); #endif } - } static void @@ -1240,7 +1222,6 @@ xn_intr(void *xsc) xn_start(ifp); } - static void xennet_move_rx_slot(struct netfront_info *np, struct mbuf *m, grant_ref_t ref) @@ -1319,17 +1300,15 @@ xennet_get_responses(struct netfront_inf m0 = m = m_prev = xennet_get_rx_mbuf(np, *cons); - if (rx->flags & NETRXF_extra_info) { err = xennet_get_extras(np, extras, rp, cons); } - if (m0 != NULL) { m0->m_pkthdr.len = 0; m0->m_next = NULL; } - + for (;;) { u_long mfn; @@ -1468,10 +1447,8 @@ xn_tick_locked(struct netfront_info *sc) callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); /* XXX placeholder for printing debug information */ - } - static void xn_tick(void *xsc) { @@ -1481,7 +1458,6 @@ xn_tick(void *xsc) XN_RX_LOCK(sc); xn_tick_locked(sc); XN_RX_UNLOCK(sc); - } /** @@ -1595,10 +1571,12 @@ xn_assemble_tx_request(struct netfront_i tx = RING_GET_REQUEST(&sc->tx, sc->tx.req_prod_pvt); id = get_id_from_freelist(sc->tx_mbufs); if (id == 0) - panic("xn_start_locked: was allocated the freelist head!\n"); + panic("%s: was allocated the freelist head!\n", + __func__); sc->xn_cdata.xn_tx_chain_cnt++; if (sc->xn_cdata.xn_tx_chain_cnt > NET_TX_RING_SIZE) - panic("xn_start_locked: tx_chain_cnt must be <= NET_TX_RING_SIZE\n"); + panic("%s: tx_chain_cnt must be <= NET_TX_RING_SIZE\n", + __func__); sc->tx_mbufs[id] = m; tx->id = id; ref = gnttab_claim_grant_reference(&sc->gref_tx_head); @@ -1710,7 +1688,6 @@ xn_start_locked(struct ifnet *ifp) } } - static void xn_start(struct ifnet *ifp) { @@ -1744,10 +1721,8 @@ xn_ifinit_locked(struct netfront_info *s if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); - } - static void xn_ifinit(void *xsc) { @@ -1756,10 +1731,8 @@ xn_ifinit(void *xsc) XN_LOCK(sc); xn_ifinit_locked(sc); XN_UNLOCK(sc); - } - static int xn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -2261,7 +2234,7 @@ static device_method_t netfront_methods[ /* Xenbus interface */ DEVMETHOD(xenbus_otherend_changed, netfront_backend_changed), - { 0, 0 } + DEVMETHOD_END }; static driver_t netfront_driver = { @@ -2271,4 +2244,5 @@ static driver_t netfront_driver = { }; devclass_t netfront_devclass; -DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, 0, 0); +DRIVER_MODULE(xe, xenbusb_front, netfront_driver, netfront_devclass, NULL, + NULL); From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 14:30:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 151A9CC; Thu, 3 Jan 2013 14:30:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE0DAAB6; Thu, 3 Jan 2013 14:30:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03EUPmh023438; Thu, 3 Jan 2013 14:30:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03EUOmo023431; Thu, 3 Jan 2013 14:30:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201301031430.r03EUOmo023431@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 3 Jan 2013 14:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244992 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 14:30:26 -0000 Author: des Date: Thu Jan 3 14:30:24 2013 New Revision: 244992 URL: http://svnweb.freebsd.org/changeset/base/244992 Log: As discussed on -current last October, remove the firewire drivers from GENERIC. Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/amd64/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -317,15 +317,6 @@ device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/i386/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -331,15 +331,6 @@ device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/ia64/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -77,7 +77,6 @@ options WITNESS_SKIPSPIN # Don't run wi options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Various "busses" -device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support device scbus # SCSI bus (required for ATA/SCSI) Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/pc98/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -270,7 +270,6 @@ device bpf # Berkeley packet filter #device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support -#device firewire # FireWire bus code #device sbp # SCSI over FireWire (Requires scbus and da) #device fwe # Ethernet over FireWire (non-standard!) Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/powerpc/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -183,12 +183,6 @@ device kue # Kawasaki LSI USB Ethernet options IEEE80211_SUPPORT_MESH options AH_SUPPORT_AR5416 -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) - # Misc device iicbus # I2C bus code device kiic # Keywest I2C Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu Jan 3 13:44:25 2013 (r244991) +++ head/sys/sparc64/conf/GENERIC Thu Jan 3 14:30:24 2013 (r244992) @@ -238,15 +238,6 @@ device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_audiocs # Crystal Semiconductor CS4231 From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 15:31:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 68BE88C2; Thu, 3 Jan 2013 15:31:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B44EED0; Thu, 3 Jan 2013 15:31:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03FVOls032811; Thu, 3 Jan 2013 15:31:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03FVOX1032810; Thu, 3 Jan 2013 15:31:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301031531.r03FVOX1032810@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 15:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244993 - in head/sys/dev/xen: evtchn xenpci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 15:31:24 -0000 Author: marius Date: Thu Jan 3 15:31:23 2013 New Revision: 244993 URL: http://svnweb.freebsd.org/changeset/base/244993 Log: Remove files not connected to the build. It's confusing enough that we still have two not quite the same evtchn.c left over. MFC after: 3 day Deleted: head/sys/dev/xen/evtchn/ head/sys/dev/xen/xenpci/machine_reboot.c From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 15:48:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A689A977; Thu, 3 Jan 2013 15:48:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97966FE0; Thu, 3 Jan 2013 15:48:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03Fm0nL035754; Thu, 3 Jan 2013 15:48:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03Fm0lV035753; Thu, 3 Jan 2013 15:48:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301031548.r03Fm0lV035753@svn.freebsd.org> From: Devin Teske Date: Thu, 3 Jan 2013 15:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244994 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 15:48:00 -0000 Author: dteske Date: Thu Jan 3 15:48:00 2013 New Revision: 244994 URL: http://svnweb.freebsd.org/changeset/base/244994 Log: Comments. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Thu Jan 3 15:31:23 2013 (r244993) +++ head/usr.sbin/bsdconfig/share/common.subr Thu Jan 3 15:48:00 2013 (r244994) @@ -64,10 +64,16 @@ export UNAME_R="$(uname -r)" # Release L ############################################################ FUNCTIONS +# f_dprintf $fmt [ $opts ... ] # # Sensible debug function. Override in ~/.bsdconfigrc if desired. # See /usr/share/examples/bsdconfig/bsdconfigrc for example. # +# If $debug is set and non-NULL, prints DEBUG info using printf(1) syntax: +# + To $debugFile, if set and non-NULL +# + To standard output if $debugFile is either NULL or unset +# + To both if $debugFile begins with a single plus-sign (`+') +# f_dprintf() { [ "$debug" ] || return $SUCCESS From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 16:11:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 801AB2B9; Thu, 3 Jan 2013 16:11:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72826188; Thu, 3 Jan 2013 16:11:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03GBP8g039692; Thu, 3 Jan 2013 16:11:25 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03GBPlL039691; Thu, 3 Jan 2013 16:11:25 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301031611.r03GBPlL039691@svn.freebsd.org> From: Mark Johnston Date: Thu, 3 Jan 2013 16:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244995 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 16:11:25 -0000 Author: markj Date: Thu Jan 3 16:11:24 2013 New Revision: 244995 URL: http://svnweb.freebsd.org/changeset/base/244995 Log: Fix a typo in an error message. Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 15:48:00 2013 (r244994) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 16:11:24 2013 (r244995) @@ -1582,7 +1582,7 @@ delete_oldest_timelog(const struct conf_ oldlogs[i].fname); else if (unlinkat(dir_fd, oldlogs[i].fname, 0) != 0) { snprintf(errbuf, sizeof(errbuf), - "Could not delet old logfile '%s'", + "Could not delete old logfile '%s'", oldlogs[i].fname); perror(errbuf); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 16:12:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AEA4F5C6; Thu, 3 Jan 2013 16:12:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D34D19A; Thu, 3 Jan 2013 16:12:49 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03GCnxY040019; Thu, 3 Jan 2013 16:12:49 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03GCnob040017; Thu, 3 Jan 2013 16:12:49 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301031612.r03GCnob040017@svn.freebsd.org> From: Mark Johnston Date: Thu, 3 Jan 2013 16:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244996 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 16:12:49 -0000 Author: markj Date: Thu Jan 3 16:12:48 2013 New Revision: 244996 URL: http://svnweb.freebsd.org/changeset/base/244996 Log: Have -n imply -r, since dry-run mode obviously doesn't require root privileges. Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.8 head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Thu Jan 3 16:11:24 2013 (r244995) +++ head/usr.sbin/newsyslog/newsyslog.8 Thu Jan 3 16:12:48 2013 (r244996) @@ -125,7 +125,9 @@ reasons for either trimming that log or Cause .Nm not to trim the logs, but to print out what it would do if this option -were not specified. +were not specified. This option implies the +.Fl r +option. .It Fl r Remove the restriction that .Nm Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 16:11:24 2013 (r244995) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 16:12:48 2013 (r244996) @@ -644,7 +644,7 @@ parse_args(int argc, char **argv) break; case 'n': noaction++; - break; + /* FALLTHROUGH */ case 'r': needroot = 0; break; From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 16:14:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C5BB76A; Thu, 3 Jan 2013 16:14:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F33291BE; Thu, 3 Jan 2013 16:14:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03GEpNl040371; Thu, 3 Jan 2013 16:14:51 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03GEpGi040370; Thu, 3 Jan 2013 16:14:51 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301031614.r03GEpGi040370@svn.freebsd.org> From: Mark Johnston Date: Thu, 3 Jan 2013 16:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244997 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 16:14:52 -0000 Author: markj Date: Thu Jan 3 16:14:51 2013 New Revision: 244997 URL: http://svnweb.freebsd.org/changeset/base/244997 Log: Make sure to update the mtime of a logfile after archiving it. This ensures that the next rotation happens at the correct time when using interval-based rotations. PR: bin/174438 Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 16:12:48 2013 (r244996) +++ head/usr.sbin/newsyslog/newsyslog.c Thu Jan 3 16:14:51 2013 (r244997) @@ -1814,12 +1814,21 @@ do_rotate(const struct conf_entry *ent) printf("\tcp %s %s\n", ent->log, file1); else printf("\tln %s %s\n", ent->log, file1); + printf("\ttouch %s\t\t" + "# Update mtime for 'when'-interval processing\n", + file1); } else { if (!(flags & CE_BINARY)) { /* Report the trimming to the old log */ log_trim(ent->log, ent); } savelog(ent->log, file1); + /* + * Interval-based rotations are done using the mtime of + * the most recently archived log, so make sure it gets + * updated during a rotation. + */ + utimes(file1, NULL); } change_attrs(file1, ent); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 16:15:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3C128DE; Thu, 3 Jan 2013 16:15:36 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC7BA1C6; Thu, 3 Jan 2013 16:15:36 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03GFaPB040525; Thu, 3 Jan 2013 16:15:36 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03GFZjC040519; Thu, 3 Jan 2013 16:15:35 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201301031615.r03GFZjC040519@svn.freebsd.org> From: Peter Wemm Date: Thu, 3 Jan 2013 16:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244998 - in head/share/examples: . cvsup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 16:15:37 -0000 Author: peter Date: Thu Jan 3 16:15:35 2013 New Revision: 244998 URL: http://svnweb.freebsd.org/changeset/base/244998 Log: Tone down the encouragement to use cvsup. Add directions to the handbook pages that cover the more current methods and bring closer to reality. Deleted: head/share/examples/cvsup/gnats-supfile Modified: head/share/examples/Makefile head/share/examples/cvsup/README head/share/examples/cvsup/cvs-supfile head/share/examples/cvsup/ports-supfile head/share/examples/cvsup/stable-supfile head/share/examples/cvsup/standard-supfile Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/Makefile Thu Jan 3 16:15:35 2013 (r244998) @@ -52,7 +52,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ csh/dot.cshrc \ cvsup/README \ cvsup/cvs-supfile \ - cvsup/gnats-supfile \ cvsup/ports-supfile \ cvsup/refuse \ cvsup/refuse.README \ Modified: head/share/examples/cvsup/README ============================================================================== --- head/share/examples/cvsup/README Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/cvsup/README Thu Jan 3 16:15:35 2013 (r244998) @@ -1,5 +1,15 @@ # $FreeBSD$ +BEWARE, CVS is deprecated and no longer supported by the FreeBSD project. + +The primary development work happens in Subversion and is temporarily +exported to the legacy CVS system with significant time delays. + +You should NOT set up a new consumer of FreeBSD source code via CVS. +Please see: +http://www.freebsd.org/doc/handbook/svn.html +http://www.freebsd.org/doc/handbook/svn-mirrors.html + This directory contains sample "supfiles" for obtaining and updating the FreeBSD sources via the Internet. These supfiles will work with CVSup version 14.0 or later. For general information on CVSup @@ -20,10 +30,6 @@ FreeBSD, use: cvs-supfile Main source tree and ports collection -To maintain a copy of the FreeBSD bug database, use the file: - - gnats-supfile FreeBSD bug database - IMPORTANT: Before you use any of the supfiles in this directory, you will need to edit in an appropriate "host" setting. See: Modified: head/share/examples/cvsup/cvs-supfile ============================================================================== --- head/share/examples/cvsup/cvs-supfile Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/cvsup/cvs-supfile Thu Jan 3 16:15:35 2013 (r244998) @@ -1,7 +1,14 @@ # $FreeBSD$ # -# This file contains all of the "CVSup collections" that make up the -# CVS development tree of the FreeBSD system. +# BEWARE, CVS is deprecated and no longer supported by the FreeBSD project. +# +# The primary development work happens in Subversion and is temporarily +# exported to the legacy CVS system with significant time delays. +# +# You should NOT set up a new consumer of FreeBSD source code via CVS. +# Please see: +# http://www.freebsd.org/doc/handbook/svn.html +# http://www.freebsd.org/doc/handbook/svn-mirrors.html # # csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily @@ -61,36 +68,6 @@ # mega-collection. It includes all of the individual "src-*" collections. src-all -# These are the individual collections that make up "src-all". If you -# use these, be sure to comment out "src-all" above. -#src-base -#src-bin -#src-cddl -#src-contrib -#src-etc -#src-games -#src-gnu -#src-include -#src-kerberos5 -#src-kerberosIV -#src-lib -#src-libexec -#src-release -#src-rescue -#src-sbin -#src-share -#src-sys -#src-tools -#src-usrbin -#src-usrsbin -# These are the individual collections that make up FreeBSD's crypto -# collection. They are no longer export-restricted and are a part of -# src-all -#src-crypto -#src-eBones -#src-secure -#src-sys-crypto - ## Ports Collection. # # The easiest way to get the ports tree is to use the "ports-all" @@ -98,77 +75,6 @@ src-all # collections, ports-all -# These are the individual collections that make up "ports-all". If you -# use these, be sure to comment out "ports-all" above and always include -# "ports-base" if you use any of the other individual collections below. -# Your ports may not build correctly without an up-to-date "ports-base". -# -#ports-base -# -#ports-accessibility -#ports-arabic -#ports-archivers -#ports-astro -#ports-audio -#ports-benchmarks -#ports-biology -#ports-cad -#ports-chinese -#ports-comms -#ports-converters -#ports-databases -#ports-deskutils -#ports-devel -#ports-dns -#ports-editors -#ports-emulators -#ports-finance -#ports-french -#ports-ftp -#ports-games -#ports-german -#ports-graphics -#ports-hebrew -#ports-hungarian -#ports-irc -#ports-japanese -#ports-java -#ports-korean -#ports-lang -#ports-mail -#ports-math -#ports-misc -#ports-multimedia -#ports-net -#ports-net-im -#ports-net-mgmt -#ports-net-p2p -#ports-news -#ports-palm -#ports-picobsd -#ports-polish -#ports-ports-mgmt -#ports-portuguese -#ports-print -#ports-russian -#ports-science -#ports-security -#ports-shells -#ports-sysutils -#ports-textproc -#ports-ukrainian -#ports-vietnamese -#ports-www -#ports-x11 -#ports-x11-clocks -#ports-x11-drivers -#ports-x11-fm -#ports-x11-fonts -#ports-x11-servers -#ports-x11-themes -#ports-x11-toolkits -#ports-x11-wm - ## Projects # # This collection retrieves the projects tree of the FreeBSD @@ -179,11 +85,3 @@ projects-all # # This is to get the control files that cvs(1) needs and the commit logs. cvsroot-all - -# These are the individual collections that make up "cvsroot-all" If you -# use these, be sure to comment out "cvsroot-all" above. "cvsroot-common" -# is a synthetic CVSROOT that has all the modules from the other CVSROOT-* -# directories merged into one, and merged commitlogs via symlinks. -#cvsroot-common -#cvsroot-src -#cvsroot-ports Modified: head/share/examples/cvsup/ports-supfile ============================================================================== --- head/share/examples/cvsup/ports-supfile Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/cvsup/ports-supfile Thu Jan 3 16:15:35 2013 (r244998) @@ -1,7 +1,14 @@ # $FreeBSD$ # -# This file contains all of the "CVSup collections" that make up the -# ports collection. +# BEWARE, CVS is deprecated and no longer supported by the FreeBSD project. +# +# The primary development work happens in Subversion and is temporarily +# exported to the legacy CVS system with significant time delays. +# +# You should NOT set up a new consumer of FreeBSD source code via CVS. +# Please see: +# http://www.freebsd.org/doc/handbook/svn.html +# http://www.freebsd.org/doc/handbook/svn-mirrors.html # # csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily @@ -65,76 +72,3 @@ # mega-collection. It includes all of the individual "ports-*" # collections, ports-all - -# These are the individual collections that make up "ports-all". If you -# use these, be sure to comment out "ports-all" above. - -# Be sure to ALWAYS cvsup the ports-base collection if you use any of the -# other individual collections below. ports-base is a mandatory collection -# for the ports collection, and your ports may not build correctly if it -# is not kept up to date. -# -# Use of individual collections is not a supported configuration. -#ports-base -#ports-accessibility -#ports-arabic -#ports-archivers -#ports-astro -#ports-audio -#ports-benchmarks -#ports-biology -#ports-cad -#ports-chinese -#ports-comms -#ports-converters -#ports-databases -#ports-deskutils -#ports-devel -#ports-dns -#ports-editors -#ports-emulators -#ports-finance -#ports-french -#ports-ftp -#ports-games -#ports-german -#ports-graphics -#ports-hebrew -#ports-hungarian -#ports-irc -#ports-japanese -#ports-java -#ports-korean -#ports-lang -#ports-mail -#ports-math -#ports-misc -#ports-multimedia -#ports-net -#ports-net-im -#ports-net-mgmt -#ports-net-p2p -#ports-news -#ports-palm -#ports-polish -#ports-ports-mgmt -#ports-portuguese -#ports-print -#ports-russian -#ports-science -#ports-security -#ports-shells -#ports-sysutils -#ports-textproc -#ports-ukrainian -#ports-vietnamese -#ports-www -#ports-x11 -#ports-x11-clocks -#ports-x11-drivers -#ports-x11-fm -#ports-x11-fonts -#ports-x11-servers -#ports-x11-themes -#ports-x11-toolkits -#ports-x11-wm Modified: head/share/examples/cvsup/stable-supfile ============================================================================== --- head/share/examples/cvsup/stable-supfile Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/cvsup/stable-supfile Thu Jan 3 16:15:35 2013 (r244998) @@ -1,7 +1,14 @@ # $FreeBSD$ # -# This file contains all of the "CVSup collections" that make up the -# FreeBSD-stable source tree. +# BEWARE, CVS is deprecated and no longer supported by the FreeBSD project. +# +# The primary development work happens in Subversion and is temporarily +# exported to the legacy CVS system with significant time delays. +# +# You should NOT set up a new consumer of FreeBSD source code via CVS. +# Please see: +# http://www.freebsd.org/doc/handbook/svn.html +# http://www.freebsd.org/doc/handbook/svn-mirrors.html # # csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily @@ -80,33 +87,3 @@ # mega-collection. It includes all of the individual "src-*" collections. # Please note: If you want to track -STABLE, leave this uncommented. src-all - -# These are the individual collections that make up "src-all". If you -# use these, be sure to comment out "src-all" above. -#src-base -#src-bin -#src-cddl -#src-contrib -#src-etc -#src-games -#src-gnu -#src-include -#src-kerberos5 -#src-kerberosIV -#src-lib -#src-libexec -#src-release -#src-rescue -#src-sbin -#src-share -#src-sys -#src-tools -#src-usrbin -#src-usrsbin -# These are the individual collections that make up FreeBSD's crypto -# collection. They are no longer export-restricted and are a part of -# src-all -#src-crypto -#src-eBones -#src-secure -#src-sys-crypto Modified: head/share/examples/cvsup/standard-supfile ============================================================================== --- head/share/examples/cvsup/standard-supfile Thu Jan 3 16:14:51 2013 (r244997) +++ head/share/examples/cvsup/standard-supfile Thu Jan 3 16:15:35 2013 (r244998) @@ -1,7 +1,14 @@ # $FreeBSD$ # -# This file contains all of the "CVSup collections" that make up the -# FreeBSD-current source tree. +# BEWARE, CVS is deprecated and no longer supported by the FreeBSD project. +# +# The primary development work happens in Subversion and is temporarily +# exported to the legacy CVS system with significant time delays. +# +# You should NOT set up a new consumer of FreeBSD source code via CVS. +# Please see: +# http://www.freebsd.org/doc/handbook/svn.html +# http://www.freebsd.org/doc/handbook/svn-mirrors.html # # csup (CVS Update Protocol) allows you to download the latest CVS # tree (or any branch of development therefrom) to your system easily @@ -59,33 +66,3 @@ # The easiest way to get the main source tree is to use the "src-all" # mega-collection. It includes all of the individual "src-*" collections. src-all - -# These are the individual collections that make up "src-all". If you -# use these, be sure to comment out "src-all" above. -#src-base -#src-bin -#src-cddl -#src-contrib -#src-etc -#src-games -#src-gnu -#src-include -#src-kerberos5 -#src-kerberosIV -#src-lib -#src-libexec -#src-release -#src-rescue -#src-sbin -#src-share -#src-sys -#src-tools -#src-usrbin -#src-usrsbin -# These are the individual collections that make up FreeBSD's crypto -# collection. They are no longer export-restricted and are a part of -# src-all -#src-crypto -#src-eBones -#src-secure -#src-sys-crypto From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 18:57:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADFEE119; Thu, 3 Jan 2013 18:57:51 +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 8ABD3B52; Thu, 3 Jan 2013 18:57:51 +0000 (UTC) Received: from [192.168.2.119] (host109-157-116-32.range109-157.btcentralplus.com [109.157.116.32]) by cyrus.watson.org (Postfix) with ESMTPSA id 0782F46B3F; Thu, 3 Jan 2013 13:57:49 -0500 (EST) Subject: Re: svn commit: r244899 - head/sys/mips/beri Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20130103100258.2e22763f@fubar.geek.nz> Date: Thu, 3 Jan 2013 18:57:48 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7D95B3E5-5F9C-45D8-9C79-C0F6D4CE625D@FreeBSD.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> <20130103100258.2e22763f@fubar.geek.nz> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 18:57:51 -0000 On 2 Jan 2013, at 21:02, Andrew Turner wrote: >> This seemed to do the trick; what do you think of the attached? This >> isn't a board-specific change, so I dropped it into the common >> fdt_mips.c code. On the other hand, this left it a bit open as to >> what the right compatible=3D line to use was, so feedback there most >> welcome. >=20 > The patch looks good. =46rom my reading of [1] the compatible value > should be something like "mips,mips4k" as it's value is of the form > ",". >=20 > I have been thinking the best way of merging these almost identical > decode functions. Linux appears to do it by providing a per-controller > function that can translate between the interrupt spec and the > configuration allowing them to have a generic parsing function that > doesn't need to check if the controller is compatible. I would like us > to have something similar as it will remove the duplicate function. Sounds good on tweaking the compatible value -- I'll do that my local = tree and merge to head fairly soon. I've now finished adapting our = current suite of device drivers to use FDT, which took a couple of days = but was fairly painless. On combining countless overlapping implementations: sounds reasonable to = me. Having a single implementation of a default parsing function = certainly wouldn't hurt -- or a single implementation of a generic one. Thanks, Robert= From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:01:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4CBF2E6; Thu, 3 Jan 2013 19:01:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C733CBDB; Thu, 3 Jan 2013 19:01:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03J1uwf065528; Thu, 3 Jan 2013 19:01:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03J1u7R065527; Thu, 3 Jan 2013 19:01:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301031901.r03J1u7R065527@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Jan 2013 19:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245000 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:01:56 -0000 Author: kib Date: Thu Jan 3 19:01:56 2013 New Revision: 245000 URL: http://svnweb.freebsd.org/changeset/base/245000 Log: Remove the last use of the deprecated MNT_VNODE_FOREACH interface in the tree. With the help from: mjg Tested by: Ronald Klop MFC after: 2 weeks Modified: head/sys/fs/nandfs/nandfs_segment.c Modified: head/sys/fs/nandfs/nandfs_segment.c ============================================================================== --- head/sys/fs/nandfs/nandfs_segment.c Thu Jan 3 18:50:27 2013 (r244999) +++ head/sys/fs/nandfs/nandfs_segment.c Thu Jan 3 19:01:56 2013 (r245000) @@ -478,39 +478,19 @@ nandfs_iterate_dirty_vnodes(struct mount struct nandfs_node *nandfs_node; struct vnode *vp, *mvp; struct thread *td; - int error, lockreq, update; + int error, update; td = curthread; - lockreq = LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY; - MNT_ILOCK(mp); - - MNT_VNODE_FOREACH(vp, mp, mvp) { + MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { update = 0; - if (mp->mnt_syncer == vp) - continue; - if (VOP_ISLOCKED(vp)) - continue; - - VI_LOCK(vp); - MNT_IUNLOCK(mp); - if (vp->v_iflag & VI_DOOMED) { + if (mp->mnt_syncer == vp || VOP_ISLOCKED(vp)) { VI_UNLOCK(vp); - MNT_ILOCK(mp); - continue; - } - - if ((error = vget(vp, lockreq, td)) != 0) { - MNT_ILOCK(mp); continue; } - - if (vp->v_iflag & VI_DOOMED) { - vput(vp); - MNT_ILOCK(mp); + if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT, td) != 0) continue; - } nandfs_node = VTON(vp); if (nandfs_node->nn_flags & IN_MODIFIED) { @@ -532,12 +512,8 @@ nandfs_iterate_dirty_vnodes(struct mount if (update) nandfs_node_update(nandfs_node); - - MNT_ILOCK(mp); } - MNT_IUNLOCK(mp); - return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:02:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F854539; Thu, 3 Jan 2013 19:02:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 418C1BED; Thu, 3 Jan 2013 19:02:53 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03J2rSM065807; Thu, 3 Jan 2013 19:02:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03J2qfP065805; Thu, 3 Jan 2013 19:02:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301031902.r03J2qfP065805@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Jan 2013 19:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245001 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:02:53 -0000 Author: kib Date: Thu Jan 3 19:02:52 2013 New Revision: 245001 URL: http://svnweb.freebsd.org/changeset/base/245001 Log: Remove the deprecated MNT_VNODE_FOREACH interface. Use the MNT_VNODE_FOREACH_ALL instead. Modified: head/sys/kern/vfs_mount.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Jan 3 19:01:56 2013 (r245000) +++ head/sys/kern/vfs_mount.c Thu Jan 3 19:02:52 2013 (r245001) @@ -1705,103 +1705,6 @@ vfs_copyopt(opts, name, dest, len) return (ENOENT); } -/* - * These are helper functions for filesystems to traverse all - * their vnodes. See MNT_VNODE_FOREACH() in sys/mount.h. - * - * This interface has been deprecated in favor of MNT_VNODE_FOREACH_ALL. - */ - -MALLOC_DECLARE(M_VNODE_MARKER); - -struct vnode * -__mnt_vnode_next(struct vnode **mvp, struct mount *mp) -{ - struct vnode *vp; - - mtx_assert(MNT_MTX(mp), MA_OWNED); - - KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - if (should_yield()) { - MNT_IUNLOCK(mp); - kern_yield(PRI_USER); - MNT_ILOCK(mp); - } - vp = TAILQ_NEXT(*mvp, v_nmntvnodes); - while (vp != NULL && vp->v_type == VMARKER) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - - /* Check if we are done */ - if (vp == NULL) { - __mnt_vnode_markerfree(mvp, mp); - return (NULL); - } - TAILQ_REMOVE(&mp->mnt_nvnodelist, *mvp, v_nmntvnodes); - TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); - return (vp); -} - -struct vnode * -__mnt_vnode_first(struct vnode **mvp, struct mount *mp) -{ - struct vnode *vp; - - mtx_assert(MNT_MTX(mp), MA_OWNED); - - vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - while (vp != NULL && vp->v_type == VMARKER) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - - /* Check if we are done */ - if (vp == NULL) { - *mvp = NULL; - return (NULL); - } - MNT_REF(mp); - MNT_IUNLOCK(mp); - *mvp = (struct vnode *) malloc(sizeof(struct vnode), - M_VNODE_MARKER, - M_WAITOK | M_ZERO); - MNT_ILOCK(mp); - (*mvp)->v_type = VMARKER; - - vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - while (vp != NULL && vp->v_type == VMARKER) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - - /* Check if we are done */ - if (vp == NULL) { - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - MNT_ILOCK(mp); - *mvp = NULL; - MNT_REL(mp); - return (NULL); - } - (*mvp)->v_mount = mp; - TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); - return (vp); -} - - -void -__mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp) -{ - - if (*mvp == NULL) - return; - - mtx_assert(MNT_MTX(mp), MA_OWNED); - - KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - TAILQ_REMOVE(&mp->mnt_nvnodelist, *mvp, v_nmntvnodes); - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - MNT_ILOCK(mp); - *mvp = NULL; - MNT_REL(mp); -} - int __vfs_statfs(struct mount *mp, struct statfs *sbp) { Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu Jan 3 19:01:56 2013 (r245000) +++ head/sys/sys/mount.h Thu Jan 3 19:02:52 2013 (r245001) @@ -225,29 +225,6 @@ void __mnt_vnode_markerfree_act #define MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp) \ __mnt_vnode_markerfree_active(&(mvp), (mp)) -/* - * Definitions for MNT_VNODE_FOREACH. - * - * This interface has been deprecated in favor of MNT_VNODE_FOREACH_ALL. - */ -struct vnode *__mnt_vnode_next(struct vnode **mvp, struct mount *mp); -struct vnode *__mnt_vnode_first(struct vnode **mvp, struct mount *mp); -void __mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp); - -#define MNT_VNODE_FOREACH(vp, mp, mvp) \ - for (vp = __mnt_vnode_first(&(mvp), (mp)); \ - (vp) != NULL; vp = __mnt_vnode_next(&(mvp), (mp))) - -#define MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp) \ - __mnt_vnode_markerfree(&(mvp), (mp)) - -#define MNT_VNODE_FOREACH_ABORT(mp, mvp) \ - do { \ - MNT_ILOCK(mp); \ - MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); \ - MNT_IUNLOCK(mp); \ - } while (0) - #define MNT_ILOCK(mp) mtx_lock(&(mp)->mnt_mtx) #define MNT_ITRYLOCK(mp) mtx_trylock(&(mp)->mnt_mtx) #define MNT_IUNLOCK(mp) mtx_unlock(&(mp)->mnt_mtx) From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:03:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 14C0265A; Thu, 3 Jan 2013 19:03:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2E43BF1; Thu, 3 Jan 2013 19:03:03 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03J33Fd065891; Thu, 3 Jan 2013 19:03:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03J33an065889; Thu, 3 Jan 2013 19:03:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301031903.r03J33an065889@svn.freebsd.org> From: Adrian Chadd Date: Thu, 3 Jan 2013 19:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245002 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:03:04 -0000 Author: adrian Date: Thu Jan 3 19:03:03 2013 New Revision: 245002 URL: http://svnweb.freebsd.org/changeset/base/245002 Log: Don't call the spectral methods for NICS that don't implement them. Modified: head/sys/dev/ath/if_ath_spectral.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Thu Jan 3 19:02:52 2013 (r245001) +++ head/sys/dev/ath/if_ath_spectral.c Thu Jan 3 19:03:03 2013 (r245002) @@ -82,13 +82,20 @@ struct ath_spectral_state { */ /* - * Attach DFS to the given interface + * Attach spectral to the given interface */ int ath_spectral_attach(struct ath_softc *sc) { struct ath_spectral_state *ss; + /* + * If spectral isn't supported, don't error - just + * quietly complete. + */ + if (! ath_hal_spectral_supported(sc->sc_ah)) + return (0); + ss = malloc(sizeof(struct ath_spectral_state), M_TEMP, M_WAITOK | M_ZERO); @@ -106,11 +113,15 @@ ath_spectral_attach(struct ath_softc *sc } /* - * Detach DFS from the given interface + * Detach spectral from the given interface */ int ath_spectral_detach(struct ath_softc *sc) { + + if (! ath_hal_spectral_supported(sc->sc_ah)) + return (0); + if (sc->sc_spectral != NULL) { free(sc->sc_spectral, M_TEMP); } @@ -148,6 +159,9 @@ ath_ioctl_spectral(struct ath_softc *sc, HAL_SPECTRAL_PARAM *pe; struct ath_spectral_state *ss = sc->sc_spectral; + if (! ath_hal_spectral_supported(sc->sc_ah)) + return (EINVAL); + if (ad->ad_id & ATH_DIAG_IN) { /* * Copy in data. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jan 3 19:02:52 2013 (r245001) +++ head/sys/dev/ath/if_athvar.h Thu Jan 3 19:03:03 2013 (r245002) @@ -1303,6 +1303,8 @@ void ath_intr(void *); #define ath_hal_get_chan_ext_busy(_ah) \ ((*(_ah)->ah_get11nExtBusy)((_ah))) +#define ath_hal_spectral_supported(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_SPECTRAL_SCAN, 0, NULL) == HAL_OK) #define ath_hal_spectral_get_config(_ah, _p) \ ((*(_ah)->ah_spectralGetConfig)((_ah), (_p))) #define ath_hal_spectral_configure(_ah, _p) \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:03:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 577228A7; Thu, 3 Jan 2013 19:03:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49B03BFE; Thu, 3 Jan 2013 19:03:43 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03J3hDH066024; Thu, 3 Jan 2013 19:03:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03J3g5k066011; Thu, 3 Jan 2013 19:03:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301031903.r03J3g5k066011@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Jan 2013 19:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245003 - in head/sys: amd64/conf i386/conf ia64/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:03:43 -0000 Author: kib Date: Thu Jan 3 19:03:41 2013 New Revision: 245003 URL: http://svnweb.freebsd.org/changeset/base/245003 Log: Enable the UFS quotas for big-iron GENERIC kernels. Discussed with: mckusick MFC after: 2 weeks Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/amd64/conf/GENERIC Thu Jan 3 19:03:41 2013 (r245003) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/i386/conf/GENERIC Thu Jan 3 19:03:41 2013 (r245003) @@ -37,6 +37,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/ia64/conf/GENERIC Thu Jan 3 19:03:41 2013 (r245003) @@ -60,6 +60,7 @@ options SYSVSHM # SYSV-style shared me options UFS_ACL # Support for access control lists options UFS_DIRHASH # Hash-based directory lookup scheme options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions # Debugging support. Always need this: Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/powerpc/conf/GENERIC Thu Jan 3 19:03:41 2013 (r245003) @@ -41,6 +41,7 @@ options SOFTUPDATES #Enable FFS soft u options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories options UFS_GJOURNAL #Enable gjournal-based UFS journaling +options QUOTA #Enable disk quotas for UFS options MD_ROOT #MD is a potential root device options NFSCL #New Network Filesystem Client options NFSD #New Network Filesystem Server Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/powerpc/conf/GENERIC64 Thu Jan 3 19:03:41 2013 (r245003) @@ -40,6 +40,7 @@ options SOFTUPDATES #Enable FFS soft u options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories options UFS_GJOURNAL #Enable gjournal-based UFS journaling +options QUOTA #Enable disk quotas for UFS options MD_ROOT #MD is a potential root device options NFSCL #New Network Filesystem Client options NFSD #New Network Filesystem Server Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu Jan 3 19:03:03 2013 (r245002) +++ head/sys/sparc64/conf/GENERIC Thu Jan 3 19:03:41 2013 (r245003) @@ -36,6 +36,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:17:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FC44C28; Thu, 3 Jan 2013 19:17:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23885D0D; Thu, 3 Jan 2013 19:17:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03JHwMt068393; Thu, 3 Jan 2013 19:17:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03JHwlY068389; Thu, 3 Jan 2013 19:17:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301031917.r03JHwlY068389@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Jan 2013 19:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245004 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:17:59 -0000 Author: kib Date: Thu Jan 3 19:17:57 2013 New Revision: 245004 URL: http://svnweb.freebsd.org/changeset/base/245004 Log: Add the "nocache" nullfs mount option, which disables the caching of the free nullfs vnodes, switching nullfs behaviour to pre-r240285. The option is mostly intended as the last-resort when higher pressure on the vnode cache due to doubling of the vnode counts is not desirable. Note that disabling the cache costs more than 2x wall time in the metadata-hungry scenarious. The default is "cache". Tested and benchmarked by: pho (previous version) MFC after: 2 weeks Modified: head/sys/fs/nullfs/null.h head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null.h ============================================================================== --- head/sys/fs/nullfs/null.h Thu Jan 3 19:03:41 2013 (r245003) +++ head/sys/fs/nullfs/null.h Thu Jan 3 19:17:57 2013 (r245004) @@ -34,9 +34,15 @@ * $FreeBSD$ */ +#ifndef FS_NULL_H +#define FS_NULL_H + +#define NULLM_CACHE 0x0001 + struct null_mount { struct mount *nullm_vfs; struct vnode *nullm_rootvp; /* Reference to root null_node */ + uint64_t nullm_flags; }; #ifdef _KERNEL @@ -80,3 +86,5 @@ MALLOC_DECLARE(M_NULLFSNODE); #endif /* NULLFS_DEBUG */ #endif /* _KERNEL */ + +#endif Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Thu Jan 3 19:03:41 2013 (r245003) +++ head/sys/fs/nullfs/null_subr.c Thu Jan 3 19:17:57 2013 (r245004) @@ -224,6 +224,9 @@ null_nodeget(mp, lowervp, vpp) * provide ready to use vnode. */ if (VOP_ISLOCKED(lowervp) != LK_EXCLUSIVE) { + KASSERT((MOUNTTONULLMOUNT(mp)->nullm_flags & NULLM_CACHE) == 0, + ("lowervp %p is not excl locked and cache is disabled", + lowervp)); vn_lock(lowervp, LK_UPGRADE | LK_RETRY); if ((lowervp->v_iflag & VI_DOOMED) != 0) { vput(lowervp); Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Thu Jan 3 19:03:41 2013 (r245003) +++ head/sys/fs/nullfs/null_vfsops.c Thu Jan 3 19:17:57 2013 (r245004) @@ -67,6 +67,15 @@ static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp; +/* Mount options that we support. */ +static const char *nullfs_opts[] = { + "cache", + "export", + "from", + "target", + NULL +}; + /* * Mount null layer */ @@ -86,9 +95,11 @@ nullfs_mount(struct mount *mp) if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_NULLFS)) return (EPERM); - if (mp->mnt_flag & MNT_ROOTFS) return (EOPNOTSUPP); + if (vfs_filteropt(mp->mnt_optnew, nullfs_opts)) + return (EINVAL); + /* * Update is a no-op */ @@ -149,7 +160,7 @@ nullfs_mount(struct mount *mp) } xmp = (struct null_mount *) malloc(sizeof(struct null_mount), - M_NULLFSMNT, M_WAITOK); + M_NULLFSMNT, M_WAITOK | M_ZERO); /* * Save reference to underlying FS @@ -187,16 +198,27 @@ nullfs_mount(struct mount *mp) mp->mnt_flag |= MNT_LOCAL; MNT_IUNLOCK(mp); } + + xmp->nullm_flags |= NULLM_CACHE; + if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) + xmp->nullm_flags &= ~NULLM_CACHE; + MNT_ILOCK(mp); - mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & - (MNTK_SHARED_WRITES | MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED); + if ((xmp->nullm_flags & NULLM_CACHE) != 0) { + mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & + (MNTK_SHARED_WRITES | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED); + } mp->mnt_kern_flag |= MNTK_LOOKUP_EXCL_DOTDOT; MNT_IUNLOCK(mp); mp->mnt_data = xmp; vfs_getnewfsid(mp); - MNT_ILOCK(xmp->nullm_vfs); - TAILQ_INSERT_TAIL(&xmp->nullm_vfs->mnt_uppers, mp, mnt_upper_link); - MNT_IUNLOCK(xmp->nullm_vfs); + if ((xmp->nullm_flags & NULLM_CACHE) != 0) { + MNT_ILOCK(xmp->nullm_vfs); + TAILQ_INSERT_TAIL(&xmp->nullm_vfs->mnt_uppers, mp, + mnt_upper_link); + MNT_IUNLOCK(xmp->nullm_vfs); + } vfs_mountedfrom(mp, target); @@ -234,13 +256,15 @@ nullfs_unmount(mp, mntflags) */ mntdata = mp->mnt_data; ump = mntdata->nullm_vfs; - MNT_ILOCK(ump); - while ((ump->mnt_kern_flag & MNTK_VGONE_UPPER) != 0) { - ump->mnt_kern_flag |= MNTK_VGONE_WAITER; - msleep(&ump->mnt_uppers, &ump->mnt_mtx, 0, "vgnupw", 0); + if ((mntdata->nullm_flags & NULLM_CACHE) != 0) { + MNT_ILOCK(ump); + while ((ump->mnt_kern_flag & MNTK_VGONE_UPPER) != 0) { + ump->mnt_kern_flag |= MNTK_VGONE_WAITER; + msleep(&ump->mnt_uppers, &ump->mnt_mtx, 0, "vgnupw", 0); + } + TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); + MNT_IUNLOCK(ump); } - TAILQ_REMOVE(&ump->mnt_uppers, mp, mnt_upper_link); - MNT_IUNLOCK(ump); mp->mnt_data = NULL; free(mntdata, M_NULLFSMNT); return (0); Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jan 3 19:03:41 2013 (r245003) +++ head/sys/fs/nullfs/null_vnops.c Thu Jan 3 19:17:57 2013 (r245004) @@ -692,7 +692,22 @@ null_unlock(struct vop_unlock_args *ap) static int null_inactive(struct vop_inactive_args *ap __unused) { + struct vnode *vp; + struct mount *mp; + struct null_mount *xmp; + vp = ap->a_vp; + mp = vp->v_mount; + xmp = MOUNTTONULLMOUNT(mp); + if ((xmp->nullm_flags & NULLM_CACHE) == 0) { + /* + * If this is the last reference and caching of the + * nullfs vnodes is not enabled, then free up the + * vnode so as not to tie up the lower vnodes. + */ + vp->v_object = NULL; + vrecycle(vp); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 19:18:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDB23DA9; Thu, 3 Jan 2013 19:18:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B75F3D1F; Thu, 3 Jan 2013 19:18:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03JIkoB068537; Thu, 3 Jan 2013 19:18:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03JIkp7068536; Thu, 3 Jan 2013 19:18:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301031918.r03JIkp7068536@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Jan 2013 19:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245005 - head/sbin/mount_nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 19:18:46 -0000 Author: kib Date: Thu Jan 3 19:18:46 2013 New Revision: 245005 URL: http://svnweb.freebsd.org/changeset/base/245005 Log: Allow to specify "cache" and "nocache" as an option for mount_nullfs(8). Tested by: pho MFC after: 2 weeks Modified: head/sbin/mount_nullfs/mount_nullfs.c Modified: head/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- head/sbin/mount_nullfs/mount_nullfs.c Thu Jan 3 19:17:57 2013 (r245004) +++ head/sbin/mount_nullfs/mount_nullfs.c Thu Jan 3 19:18:46 2013 (r245005) @@ -57,27 +57,35 @@ static const char rcsid[] = #include "mntopts.h" -static struct mntopt mopts[] = { - MOPT_STDOPTS, - MOPT_END -}; - int subdir(const char *, const char *); static void usage(void) __dead2; int main(int argc, char *argv[]) { - struct iovec iov[6]; - int ch, mntflags; + struct iovec *iov; + char *p, *val; char source[MAXPATHLEN]; char target[MAXPATHLEN]; + char errmsg[255]; + int ch, mntflags, iovlen; + char nullfs[] = "nullfs"; + iov = NULL; + iovlen = 0; mntflags = 0; + errmsg[0] = '\0'; while ((ch = getopt(argc, argv, "o:")) != -1) switch(ch) { case 'o': - getmntopts(optarg, mopts, &mntflags, 0); + val = strdup(""); + p = strchr(optarg, '='); + if (p != NULL) { + free(val); + *p = '\0'; + val = p + 1; + } + build_iovec(&iov, &iovlen, optarg, val, (size_t)-1); break; case '?': default: @@ -99,21 +107,16 @@ main(int argc, char *argv[]) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", argv[0], target, argv[1]); - iov[0].iov_base = strdup("fstype"); - iov[0].iov_len = sizeof("fstype"); - iov[1].iov_base = strdup("nullfs"); - iov[1].iov_len = strlen(iov[1].iov_base) + 1; - iov[2].iov_base = strdup("fspath"); - iov[2].iov_len = sizeof("fspath"); - iov[3].iov_base = source; - iov[3].iov_len = strlen(source) + 1; - iov[4].iov_base = strdup("target"); - iov[4].iov_len = sizeof("target"); - iov[5].iov_base = target; - iov[5].iov_len = strlen(target) + 1; - - if (nmount(iov, 6, mntflags)) - err(1, NULL); + build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1); + build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1); + build_iovec(&iov, &iovlen, "target", target, (size_t)-1); + build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); + if (nmount(iov, iovlen, mntflags) < 0) { + if (errmsg[0] != 0) + err(1, "%s: %s", source, errmsg); + else + err(1, "%s", source); + } exit(0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 20:31:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E154C5D2; Thu, 3 Jan 2013 20:31:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF2CD18E; Thu, 3 Jan 2013 20:31:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03KVj1A079229; Thu, 3 Jan 2013 20:31:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03KVjc1079228; Thu, 3 Jan 2013 20:31:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301032031.r03KVjc1079228@svn.freebsd.org> From: Xin LI Date: Thu, 3 Jan 2013 20:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245006 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 20:31:46 -0000 Author: delphij Date: Thu Jan 3 20:31:45 2013 New Revision: 245006 URL: http://svnweb.freebsd.org/changeset/base/245006 Log: Sync with driver. MFC after: 2 weeks Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Thu Jan 3 19:18:46 2013 (r245005) +++ head/share/man/man4/mps.4 Thu Jan 3 20:31:45 2013 (r245006) @@ -34,7 +34,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd June 30, 2012 +.Dd January 3, 2013 .Dt MPS 4 .Os .Sh NAME @@ -62,7 +62,7 @@ controllers and WarpDrive solid state st .Sh HARDWARE The .Nm -driver supports the following controllers: +driver supports the following hardware: .Pp .Bl -bullet -compact .It @@ -80,6 +80,19 @@ LSI Logic SAS2116 (16 Port .It LSI Logic SAS2208 (8 Port .Tn SAS ) +.It +LSI Logic SAS2308 (8 Port +.Tn SAS ) +.It +LSI Logic SSS6200 Solid State Storage +.It +Intel Integrated RAID Module RMS25JB040 +.It +Intel Integrated RAID Module RMS25JB080 +.It +Intel Integrated RAID Module RMS25KB040 +.It +Intel Integrated RAID Module RMS25KB080 .El .Sh CONFIGURATION To disable MSI interrupts for all From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 20:50:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3728B2CA; Thu, 3 Jan 2013 20:50:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7547D2EE; Thu, 3 Jan 2013 20:50:12 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 66CF4B9AD; Thu, 3 Jan 2013 15:50:09 -0500 (EST) From: John Baldwin To: Jim Harris Subject: Re: svn commit: r244549 - head/sys/dev/nvme Date: Thu, 3 Jan 2013 15:44:52 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201212211913.qBLJDmpm019837@svn.freebsd.org> <201212211424.16934.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201301031544.52750.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 03 Jan 2013 15:50:11 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 20:50:13 -0000 On Friday, December 21, 2012 04:49:13 PM Jim Harris wrote: > On Fri, Dec 21, 2012 at 12:24 PM, John Baldwin wrote: > > On Friday, December 21, 2012 2:13:48 pm Jim Harris wrote: > > > Author: jimharris > > > Date: Fri Dec 21 19:13:48 2012 > > > New Revision: 244549 > > > URL: http://svnweb.freebsd.org/changeset/base/244549 > > > > > > Log: > > > Put kthreads under curproc so they are attached to nvmecontrol rather > > > than pid 0. > > > > > > Sponsored by: Intel > > > > Hmm, is this really wise? I'm not sure how well the kernel would handle > > a kthread belonging to a userland process. You could just have each > > test create a new kproc that holds the associated threads for that test > > instead perhaps? > > Just so I'm aware, what sorts of problems might you expect if a kthread > belongs to a userland process? I'm not opposed to changing this as you > suggest, but would like to know for my own understanding since I haven't > observed any problems with it on my system. I'm not sure what might break. :( I just know that I have always expected a kthread to belong to a kernel process, and it wouldn't surprise me if there wasn't some code somewhere that assumed TDP_KTHREAD implied that the associated process as a kernel process (P_SYSTEM). Perhaps it would work, but I don't think many folks have considered that edge case or coded for it. OTOH, it might be an interesting way to implement aio (though I think aio should be implemented directly in userland using user threads, though possibly not pthreads so a single-threaded application doesn't pay a penalty). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 21:58:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 574AD80; Thu, 3 Jan 2013 21:58:29 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 31DAD942; Thu, 3 Jan 2013 21:58:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03LwTiO092140; Thu, 3 Jan 2013 21:58:29 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03LwT3a092139; Thu, 3 Jan 2013 21:58:29 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201301032158.r03LwT3a092139@svn.freebsd.org> From: Warren Block Date: Thu, 3 Jan 2013 21:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245012 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 21:58:29 -0000 Author: wblock (doc committer) Date: Thu Jan 3 21:58:28 2013 New Revision: 245012 URL: http://svnweb.freebsd.org/changeset/base/245012 Log: Document the output of the show command. Modified version of patch provided by Bas Smeelen . Use of 'gpart list' suggested by by Andrey V. Elsukov . PR: docs/174270 Submitted by: Ronald F.Guilmette Reviewed by: ae (block sizes) MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu Jan 3 21:54:44 2013 (r245011) +++ head/sbin/geom/class/part/gpart.8 Thu Jan 3 21:58:28 2013 (r245012) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2012 +.Dd January 3, 2013 .Dt GPART 8 .Os .Sh NAME @@ -453,8 +453,14 @@ about its use. .El .\" ==== SHOW ==== .It Cm show -Show the current partition information of the specified geoms -or all geoms if none are specified. +Show current partition information for the specified geoms, or all +geoms if none are specified. +The default output includes the logical starting block of each +partition, the partition size in blocks, the partition index number, +the partition type, and a human readable partition size. +Block sizes and locations are based on the device's Sectorsize +as shown by +.Cm gpart list . Additional options include: .Bl -tag -width 10n .It Fl l @@ -919,7 +925,7 @@ and .Cm list will report about corrupt tables. .Pp -If the size of the device has changed (e.g.\& volume expansion) the +If the size of the device has changed (e.g.,\& volume expansion) the secondary GPT header will no longer be located in the last sector. This is not a metadata corruption, but it is dangerous because any corruption of the primary GPT will lead to loss of the partition table. @@ -979,14 +985,14 @@ This may break a mirrored volume and lea Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES Create a GPT scheme on -.Pa ad0 : +.Pa ada0 : .Bd -literal -offset indent -/sbin/gpart create -s GPT ad0 +/sbin/gpart create -s GPT ada0 .Ed .Pp Embed GPT bootstrap code into a protective MBR: .Bd -literal -offset indent -/sbin/gpart bootcode -b /boot/pmbr ad0 +/sbin/gpart bootcode -b /boot/pmbr ada0 .Ed .Pp Create a dedicated @@ -1011,15 +1017,15 @@ aligned on a 64 kB boundary without the offset or alignment. The boot partition itself is aligned on a 4 kB boundary. .Bd -literal -offset indent -/sbin/gpart add -b 40 -s 88 -t freebsd-boot ad0 -/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 +/sbin/gpart add -b 40 -s 88 -t freebsd-boot ada0 +/sbin/gpart bootcode -p /boot/gptboot -i 1 ada0 .Ed .Pp Create a 512MB-sized .Cm freebsd-ufs partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent -/sbin/gpart add -s 512M -t freebsd-ufs ad0 +/sbin/gpart add -s 512M -t freebsd-ufs ada0 .Ed .Pp Create an MBR scheme on From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 22:05:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D0B203A5; Thu, 3 Jan 2013 22:05:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAB89979; Thu, 3 Jan 2013 22:05:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03M5Khu093499; Thu, 3 Jan 2013 22:05:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03M5KpE093498; Thu, 3 Jan 2013 22:05:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301032205.r03M5KpE093498@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 22:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245013 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 22:05:20 -0000 Author: marius Date: Thu Jan 3 22:05:20 2013 New Revision: 245013 URL: http://svnweb.freebsd.org/changeset/base/245013 Log: Record my ports commit bit. Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Jan 3 21:58:28 2013 (r245012) +++ head/share/misc/committers-ports.dot Thu Jan 3 22:05:20 2013 (r245013) @@ -140,6 +140,7 @@ maho [label="Maho Nakata\nmaho@FreeBSD.o makc [label="Max Brazhnikov\nmakc@FreeBSD.org\n2008/08/25"] mandree [label="Matthias Andree\nmandree@FreeBSD.org\n2009/11/18"] marcus [label="Joe Marcus Clarke\nmarcus@FreeBSD.org\n2002/04/05"] +marius [label="Marius Strobl\nmarius@FreeBSD.org\n2012/12/29"] markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2004/02/21"] martymac [label="Ganael Laplanche\nmartymac@FreeBSD.org\n2010/09/24"] mat [label="Mathieu Arnold\nmat@FreeBSD.org\n2003/08/15"] @@ -235,8 +236,10 @@ avilla -> rakuco bapt -> bdrewery bapt -> eadler bapt -> jlaffaye +bapt -> marius beat -> decke +beat -> marius beat -> sperber beat -> uqs From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 22:24:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4560CB7E; Thu, 3 Jan 2013 22:24:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F601A4E; Thu, 3 Jan 2013 22:24:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03MOdcw096651; Thu, 3 Jan 2013 22:24:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03MOdTP096649; Thu, 3 Jan 2013 22:24:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201301032224.r03MOdTP096649@svn.freebsd.org> From: Rick Macklem Date: Thu, 3 Jan 2013 22:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245014 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 22:24:40 -0000 Author: rmacklem Date: Thu Jan 3 22:24:39 2013 New Revision: 245014 URL: http://svnweb.freebsd.org/changeset/base/245014 Log: Fix r244604 so that it builds when MK_KERBEROS_SUPPORT == "no". Reported by: bf Tested by: bf Reviewed by: gcooper MFC after: 3 days Modified: head/usr.sbin/gssd/Makefile head/usr.sbin/gssd/gssd.c Modified: head/usr.sbin/gssd/Makefile ============================================================================== --- head/usr.sbin/gssd/Makefile Thu Jan 3 22:05:20 2013 (r245013) +++ head/usr.sbin/gssd/Makefile Thu Jan 3 22:24:39 2013 (r245014) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= gssd MAN= gssd.8 SRCS= gssd.c gssd.h gssd_svc.c gssd_xdr.c gssd_prot.c @@ -7,8 +9,14 @@ SRCS= gssd.c gssd.h gssd_svc.c gssd_xdr. CFLAGS+= -I. WARNS?= 1 -DPADD= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} -LDADD= -lgssapi -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto +DPADD= ${LIBGSSAPI} +LDADD= -lgssapi +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} ${LIBCRYPT} ${LIBCRYPTO} +LDADD+= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err -lcrypt -lcrypto +.else +CFLAGS+= -DWITHOUT_KERBEROS +.endif CLEANFILES= gssd_svc.c gssd.h Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Thu Jan 3 22:05:20 2013 (r245013) +++ head/usr.sbin/gssd/gssd.c Thu Jan 3 22:24:39 2013 (r245014) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifndef WITHOUT_KERBEROS #include +#endif #include #include #include @@ -102,12 +104,17 @@ main(int argc, char **argv) debug_level++; break; case 's': +#ifndef WITHOUT_KERBEROS /* * Set the directory search list. This enables use of * find_ccache_file() to search the directories for a * suitable credentials cache file. */ strlcpy(ccfile_dirlist, optarg, sizeof(ccfile_dirlist)); +#else + errx(1, "This option not available when built" + " without MK_KERBEROS\n"); +#endif break; case 'c': /* @@ -814,6 +821,7 @@ static int is_a_valid_tgt_cache(const char *filepath, uid_t uid, int *retrating, time_t *retexptime) { +#ifndef WITHOUT_KERBEROS krb5_context context; krb5_principal princ; krb5_ccache ccache; @@ -913,5 +921,8 @@ is_a_valid_tgt_cache(const char *filepat *retexptime = exptime; } return (ret); +#else /* WITHOUT_KERBEROS */ + return (0); +#endif /* !WITHOUT_KERBEROS */ } From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 22:27:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 662EAD1F; Thu, 3 Jan 2013 22:27:58 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F192A6E; Thu, 3 Jan 2013 22:27:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03MRwFd097113; Thu, 3 Jan 2013 22:27:58 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03MRw1Z097112; Thu, 3 Jan 2013 22:27:58 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201301032227.r03MRw1Z097112@svn.freebsd.org> From: Hiroki Sato Date: Thu, 3 Jan 2013 22:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245015 - head/usr.sbin/ifmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 22:27:58 -0000 Author: hrs Date: Thu Jan 3 22:27:57 2013 New Revision: 245015 URL: http://svnweb.freebsd.org/changeset/base/245015 Log: - Print scopeid for link-local scope addresses. - Do not print the flags= part when flags == 0. Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Thu Jan 3 22:24:39 2013 (r245014) +++ head/usr.sbin/ifmcstat/ifmcstat.c Thu Jan 3 22:27:57 2013 (r245015) @@ -296,7 +296,8 @@ in_ifinfo(struct igmp_ifinfo *igi) printf("igmpv?(%d)", igi->igi_version); break; } - printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK"); + if (igi->igi_flags) + printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK"); if (igi->igi_version == IGMP_VERSION_3) { printf(" rv %u qi %u qri %u uri %u", igi->igi_rv, igi->igi_qi, igi->igi_qri, igi->igi_uri); @@ -752,7 +753,8 @@ in6_ifinfo(struct mld_ifinfo *mli) printf("mldv?(%d)", mli->mli_version); break; } - printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW"); + if (mli->mli_flags) + printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW"); if (mli->mli_version == MLD_VERSION_2) { printf(" rv %u qi %u qri %u uri %u", mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); @@ -1129,7 +1131,14 @@ ifmcstat_getifmaddrs(void) break; } - fprintf(stdout, "\t%s %s\n", pafname, addrbuf); + fprintf(stdout, "\t%s %s", pafname, addrbuf); +#ifdef INET6 + if (pifasa->sa.sa_family == AF_INET6 && + pifasa->sin6.sin6_scope_id) + fprintf(stdout, " scopeid 0x%x", + pifasa->sin6.sin6_scope_id); +#endif + fprintf(stdout, "\n"); #ifdef INET /* * Print per-link IGMP information, if available. @@ -1202,6 +1211,12 @@ next_ifnet: } fprintf(stdout, "\t\tgroup %s", addrbuf); +#ifdef INET6 + if (pgsa->sa.sa_family == AF_INET6 && + pgsa->sin6.sin6_scope_id) + fprintf(stdout, " scopeid 0x%x", + pgsa->sin6.sin6_scope_id); +#endif #ifdef INET if (pgsa->sa.sa_family == AF_INET) { inm_print_sources_sysctl(thisifindex, From owner-svn-src-head@FreeBSD.ORG Thu Jan 3 23:12:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 72B8A7DD; Thu, 3 Jan 2013 23:12:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDE5CDA; Thu, 3 Jan 2013 23:12:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r03NC9OQ004083; Thu, 3 Jan 2013 23:12:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r03NC9K0004082; Thu, 3 Jan 2013 23:12:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201301032312.r03NC9K0004082@svn.freebsd.org> From: Marius Strobl Date: Thu, 3 Jan 2013 23:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245017 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 03 Jan 2013 23:12:09 -0000 Author: marius Date: Thu Jan 3 23:12:08 2013 New Revision: 245017 URL: http://svnweb.freebsd.org/changeset/base/245017 Log: Revert bogus part of r241740. Reported by: Michael Moll MFC after: 3 days Modified: head/sys/sparc64/sparc64/interrupt.S Modified: head/sys/sparc64/sparc64/interrupt.S ============================================================================== --- head/sys/sparc64/sparc64/interrupt.S Thu Jan 3 23:09:16 2013 (r245016) +++ head/sys/sparc64/sparc64/interrupt.S Thu Jan 3 23:12:08 2013 (r245017) @@ -83,13 +83,13 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - srlx %g3, 60, %g6 + brnz,pt %g3, 1f /* * NB: Zeus CPUs set some undocumented bits in the first data word. */ - jmpl %g4, %g0 and %g3, IV_MAX - 1, %g3 + jmpl %g4, %g0 + nop /* NOTREACHED */ /* @@ -98,7 +98,8 @@ ENTRY(intr_vector) * 4 bits of the 1st data word specify a priority, and the 2nd and * 3rd a function and argument. */ -1: brnz,a,pn %g6, 2f +1: srlx %g3, 60, %g6 + brnz,a,pn %g6, 2f clr %g3 /* From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 06:28:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A012B3C6; Fri, 4 Jan 2013 06:28:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7ABD4EFD; Fri, 4 Jan 2013 06:28:35 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r046SZsr070319; Fri, 4 Jan 2013 06:28:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r046SZ3e070318; Fri, 4 Jan 2013 06:28:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301040628.r046SZ3e070318@svn.freebsd.org> From: Adrian Chadd Date: Fri, 4 Jan 2013 06:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245031 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 06:28:35 -0000 Author: adrian Date: Fri Jan 4 06:28:34 2013 New Revision: 245031 URL: http://svnweb.freebsd.org/changeset/base/245031 Log: For PHY error frames, populate the configured channel flags rather than based on the received frame. PHY errors don't have the relevant HT or 40MHz MCS flag set. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Fri Jan 4 05:53:17 2013 (r245030) +++ head/sys/dev/ath/if_ath_rx.c Fri Jan 4 06:28:34 2013 (r245031) @@ -423,7 +423,21 @@ ath_rx_tap(struct ifnet *ifp, struct mbu sc->sc_rx_th.wr_flags = sc->sc_hwmap[rix].rxflags; #ifdef AH_SUPPORT_AR5416 sc->sc_rx_th.wr_chan_flags &= ~CHAN_HT; - if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ + if (rs->rs_status & HAL_RXERR_PHY) { + struct ieee80211com *ic = ifp->if_l2com; + + /* + * PHY error - make sure the channel flags + * reflect the actual channel configuration, + * not the received frame. + */ + if (IEEE80211_IS_CHAN_HT40U(ic->ic_curchan)) + sc->sc_rx_th.wr_chan_flags |= CHAN_HT40U; + else if (IEEE80211_IS_CHAN_HT40D(ic->ic_curchan)) + sc->sc_rx_th.wr_chan_flags |= CHAN_HT40D; + else if (IEEE80211_IS_CHAN_HT20(ic->ic_curchan)) + sc->sc_rx_th.wr_chan_flags |= CHAN_HT20; + } else if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ struct ieee80211com *ic = ifp->if_l2com; if ((rs->rs_flags & HAL_RX_2040) == 0) @@ -435,6 +449,7 @@ ath_rx_tap(struct ifnet *ifp, struct mbu if ((rs->rs_flags & HAL_RX_GI) == 0) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTGI; } + #endif sc->sc_rx_th.wr_tsf = htole64(ath_extend_tsf(sc, rs->rs_tstamp, tsf)); if (rs->rs_status & HAL_RXERR_CRC) From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 07:52:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EFE6F0B; Fri, 4 Jan 2013 07:52:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7602C0; Fri, 4 Jan 2013 07:52:48 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r047qmr7082681; Fri, 4 Jan 2013 07:52:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r047qmev082680; Fri, 4 Jan 2013 07:52:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301040752.r047qmev082680@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Jan 2013 07:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245033 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 07:52:48 -0000 Author: kib Date: Fri Jan 4 07:52:47 2013 New Revision: 245033 URL: http://svnweb.freebsd.org/changeset/base/245033 Log: Fix reversed condition in the assertion. Pointy hat to: kib MFC after: 13 days Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Fri Jan 4 06:29:52 2013 (r245032) +++ head/sys/fs/nullfs/null_subr.c Fri Jan 4 07:52:47 2013 (r245033) @@ -224,7 +224,7 @@ null_nodeget(mp, lowervp, vpp) * provide ready to use vnode. */ if (VOP_ISLOCKED(lowervp) != LK_EXCLUSIVE) { - KASSERT((MOUNTTONULLMOUNT(mp)->nullm_flags & NULLM_CACHE) == 0, + KASSERT((MOUNTTONULLMOUNT(mp)->nullm_flags & NULLM_CACHE) != 0, ("lowervp %p is not excl locked and cache is disabled", lowervp)); vn_lock(lowervp, LK_UPGRADE | LK_RETRY); From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 09:15:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C994921B; Fri, 4 Jan 2013 09:15:59 +0000 (UTC) (envelope-from erwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B21327A6; Fri, 4 Jan 2013 09:15:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r049FxVQ095728; Fri, 4 Jan 2013 09:15:59 GMT (envelope-from erwin@svn.freebsd.org) Received: (from erwin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r049FxDh095727; Fri, 4 Jan 2013 09:15:59 GMT (envelope-from erwin@svn.freebsd.org) Message-Id: <201301040915.r049FxDh095727@svn.freebsd.org> From: Erwin Lansing Date: Fri, 4 Jan 2013 09:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245034 - head/etc/namedb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 09:15:59 -0000 Author: erwin Date: Fri Jan 4 09:15:59 2013 New Revision: 245034 URL: http://svnweb.freebsd.org/changeset/base/245034 Log: Update with new IPv4 address for D root. Approved by: delphij (mentor) Modified: head/etc/namedb/named.root Modified: head/etc/namedb/named.root ============================================================================== --- head/etc/namedb/named.root Fri Jan 4 07:52:47 2013 (r245033) +++ head/etc/namedb/named.root Fri Jan 4 09:15:59 2013 (r245034) @@ -7,14 +7,14 @@ ; (e.g. reference this file in the "cache . " ; configuration file of BIND domain name servers). ; -; This file is made available by InterNIC +; This file is made available by InterNIC ; under anonymous FTP as -; file /domain/named.root +; file /domain/named.cache ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Jun 8, 2011 -; related version of root zone: 2011060800 +; last update: Jan 3, 2013 +; related version of root zone: 2013010300 ; ; formerly NS.INTERNIC.NET ; @@ -35,7 +35,7 @@ C.ROOT-SERVERS.NET. 3600000 A ; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. -D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 +D.ROOT-SERVERS.NET. 3600000 A 199.7.91.13 D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2D::D ; ; FORMERLY NS.NASA.GOV From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 09:52:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 51D10A51; Fri, 4 Jan 2013 09:52:10 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C02E8ED; Fri, 4 Jan 2013 09:52:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r049qAng000839; Fri, 4 Jan 2013 09:52:10 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r049q9IX000838; Fri, 4 Jan 2013 09:52:09 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201301040952.r049q9IX000838@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 4 Jan 2013 09:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245035 - head/sys/pc98/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 09:52:10 -0000 Author: nyan Date: Fri Jan 4 09:52:09 2013 New Revision: 245035 URL: http://svnweb.freebsd.org/changeset/base/245035 Log: MFi386: r232521 Exclude USB drivers (except umass and ukbd) from main kernel image. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Fri Jan 4 09:15:59 2013 (r245034) +++ head/sys/pc98/conf/GENERIC Fri Jan 4 09:52:09 2013 (r245035) @@ -238,44 +238,11 @@ device bpf # Berkeley packet filter #device ohci # OHCI PCI->USB interface #device ehci # EHCI PCI->USB interface (USB 2.0) #device usb # USB Bus (required) -#device udbp # USB Double Bulk Pipe devices (needs netgraph) -#device uhid # "Human Interface Devices" #device ukbd # Keyboard -#device ulpt # Printer #device umass # Disks/Mass storage - Requires scbus and da -#device ums # Mouse -#device urio # Diamond Rio 500 MP3 player -# USB Serial devices -#device uark # Technologies ARK3116 based serial adapters -#device ubsa # Belkin F5U103 and compatible serial adapters -#device ubser # BWCT console serial adapters -#device uftdi # For FTDI usb serial adapters -#device uipaq # Some WinCE based devices -#device uplcom # Prolific PL-2303 serial adapters -#device uslcom # SI Labs CP2101/CP2102 serial adapters -#device uvisor # Visor and Palm devices -#device uvscom # USB serial support for DDI pocket's PHS -# USB Ethernet, requires miibus -#device aue # ADMtek USB Ethernet -#device axe # ASIX Electronics USB Ethernet -#device cdce # Generic USB over Ethernet -#device cue # CATC USB Ethernet -#device kue # Kawasaki LSI USB Ethernet -#device rue # RealTek RTL8150 USB Ethernet -#device udav # Davicom DM9601E USB -# USB Wireless -#device rum # Ralink Technology RT2501USB wireless NICs -#device uath # Atheros AR5523 wireless NICs -#device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zd1211/zd1211b wireless NICs - -# FireWire support -#device sbp # SCSI over FireWire (Requires scbus and da) -#device fwe # Ethernet over FireWire (non-standard!) # Sound support #device sound # Generic sound driver (required) #device snd_mss # Microsoft Sound System #device "snd_sb16" # Sound Blaster 16 #device snd_sbc # Sound Blaster -#device snd_uaudio # USB Audio From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 09:57:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 946F5E08; Fri, 4 Jan 2013 09:57:16 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3D78D93C; Fri, 4 Jan 2013 09:57:16 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id r049vB5b025190; Fri, 4 Jan 2013 18:57:13 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Fri, 04 Jan 2013 18:57:10 +0900 (JST) Message-Id: <20130104.185710.737004071260803581.nyan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r245035 - head/sys/pc98/conf From: TAKAHASHI Yoshihiro In-Reply-To: <201301040952.r049q9IX000838@svn.freebsd.org> References: <201301040952.r049q9IX000838@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 09:57:16 -0000 In article <201301040952.r049q9IX000838@svn.freebsd.org> Takahashi Yoshihiro writes: > Author: nyan > Date: Fri Jan 4 09:52:09 2013 > New Revision: 245035 > URL: http://svnweb.freebsd.org/changeset/base/245035 > > Log: > MFi386: r232521 > > Exclude USB drivers (except umass and ukbd) from main kernel image. It is also merging r244992 completely that removes the firewire drivers. --- TAKAHASHI Yoshihiro From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 11:11:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5188922E; Fri, 4 Jan 2013 11:11:13 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 428E0C41; Fri, 4 Jan 2013 11:11:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r04BBD7G013381; Fri, 4 Jan 2013 11:11:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r04BBDjZ013380; Fri, 4 Jan 2013 11:11:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201301041111.r04BBDjZ013380@svn.freebsd.org> From: David Xu Date: Fri, 4 Jan 2013 11:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245036 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 11:11:13 -0000 Author: davidxu Date: Fri Jan 4 11:11:12 2013 New Revision: 245036 URL: http://svnweb.freebsd.org/changeset/base/245036 Log: Revert revision 244760 because strncpy pads trailing space with zero, this prevents kernel data from being leaked. Noticed by: Joerg Sonnenberger < joerg at britannica dot bec dot de > Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Jan 4 09:52:09 2013 (r245035) +++ head/sys/kern/vfs_mount.c Fri Jan 4 11:11:12 2013 (r245036) @@ -559,7 +559,7 @@ vfs_donmount(struct thread *td, uint64_t if (error || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) - strlcpy(errmsg, "Invalid fstype", errmsg_len); + strncpy(errmsg, "Invalid fstype", errmsg_len); goto bail; } fspathlen = 0; @@ -567,7 +567,7 @@ vfs_donmount(struct thread *td, uint64_t if (error || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) - strlcpy(errmsg, "Invalid fspath", errmsg_len); + strncpy(errmsg, "Invalid fspath", errmsg_len); goto bail; } @@ -1447,7 +1447,7 @@ vfs_filteropt(struct vfsoptlist *opts, c if (ret != 0) { TAILQ_FOREACH(opt, opts, link) { if (strcmp(opt->name, "errmsg") == 0) { - strlcpy((char *)opt->value, errmsg, opt->len); + strncpy((char *)opt->value, errmsg, opt->len); break; } } From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 11:34:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E77147DD; Fri, 4 Jan 2013 11:34:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id EA68AD7A; Fri, 4 Jan 2013 11:34:09 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id es5so7675602wgb.29 for ; Fri, 04 Jan 2013 03:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=fAOViSm/l7fvZ/0fa1ezUqN7CqiImDeKm8T58JhRwvs=; b=J2Lv8UaufI8oewkNw0CK1+17uTR2O19+zBum/M6iDMeF10OKVNZlxtUqcl0jSOt3JR JrMlg81/oMH76qFTG37TBY3hgC6G/gUtf7PLjxeAYnP7m/425R75NhLaG+RVArbHfrGB rNA/FJotu+U/YkbodpVPIz+/o/3B81dn09B347rfwCGHc36M+MqJcrOKA0QXeEvqIIxX RAB5TJBVoh+kIOprQYTqYbHS2e8qNmw4i9bTZfwfsorzleUpKkvShZc42LsVdaxvzTtA n2eh3TP1sfoaYDxIxzVjeMmf+sZr4V8KP4pIq3XngMRmQP9zp9LKStlcrYaWDoWrO+W7 f9/Q== X-Received: by 10.180.93.133 with SMTP id cu5mr72553842wib.32.1357299248715; Fri, 04 Jan 2013 03:34:08 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id hu8sm71515049wib.6.2013.01.04.03.34.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 03:34:07 -0800 (PST) Date: Fri, 4 Jan 2013 12:33:54 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r245036 - head/sys/kern Message-ID: <20130104113354.GB26239@dft-labs.eu> References: <201301041111.r04BBDjZ013380@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201301041111.r04BBDjZ013380@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 11:34:11 -0000 On Fri, Jan 04, 2013 at 11:11:13AM +0000, David Xu wrote: > Author: davidxu > Date: Fri Jan 4 11:11:12 2013 > New Revision: 245036 > URL: http://svnweb.freebsd.org/changeset/base/245036 > > Log: > Revert revision 244760 because strncpy pads trailing space with zero, > this prevents kernel data from being leaked. > I think it would be better to teach strlcpy to zero-pad as well. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 15:28:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7BAC72F2; Fri, 4 Jan 2013 15:28:25 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3228E4; Fri, 4 Jan 2013 15:28:25 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 04116358C58; Fri, 4 Jan 2013 16:28:23 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id E34B72848C; Fri, 4 Jan 2013 16:28:22 +0100 (CET) Date: Fri, 4 Jan 2013 16:28:22 +0100 From: Jilles Tjoelker To: Mateusz Guzik Subject: Re: svn commit: r245036 - head/sys/kern Message-ID: <20130104152822.GA69526@stack.nl> References: <201301041111.r04BBDjZ013380@svn.freebsd.org> <20130104113354.GB26239@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130104113354.GB26239@dft-labs.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 15:28:25 -0000 On Fri, Jan 04, 2013 at 12:33:54PM +0100, Mateusz Guzik wrote: > On Fri, Jan 04, 2013 at 11:11:13AM +0000, David Xu wrote: > > Author: davidxu > > Date: Fri Jan 4 11:11:12 2013 > > New Revision: 245036 > > URL: http://svnweb.freebsd.org/changeset/base/245036 > > Log: > > Revert revision 244760 because strncpy pads trailing space with zero, > > this prevents kernel data from being leaked. > I think it would be better to teach strlcpy to zero-pad as well. Because the buffer is usually much bigger than the string and overwriting the entire buffer is usually not necessary, I think changing strlcpy to fill the buffer would needlessly give up performance. Besides, there are many existing implementations of strlcpy that do not fill the buffer. Therefore, portable code still needs to zero-pad if it relies on that. Also, zero-padding will actively break incorrect programs that pass too high size parameters to strlcpy but strings that fit in the actual buffer. This might threaten the stability of head. If you want this, it makes more sense to create a new function. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 15:29:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9BC38640; Fri, 4 Jan 2013 15:29:51 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE708F8; Fri, 4 Jan 2013 15:29:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r04FTpna052415; Fri, 4 Jan 2013 15:29:51 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r04FTpRp052414; Fri, 4 Jan 2013 15:29:51 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201301041529.r04FTpRp052414@svn.freebsd.org> From: Hiroki Sato Date: Fri, 4 Jan 2013 15:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245044 - head/sys/ia64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 15:29:51 -0000 Author: hrs Date: Fri Jan 4 15:29:50 2013 New Revision: 245044 URL: http://svnweb.freebsd.org/changeset/base/245044 Log: Remove firewire devices missed in r244992. Modified: head/sys/ia64/conf/GENERIC Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Fri Jan 4 14:40:25 2013 (r245043) +++ head/sys/ia64/conf/GENERIC Fri Jan 4 15:29:50 2013 (r245044) @@ -190,11 +190,6 @@ options IEEE80211_SUPPORT_MESH # builds everything including AR5416 (and later 11n NIC) support. options AH_SUPPORT_AR5416 -# FireWire support -device fwip # IP over FireWire (RFC 2734,3146) -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (need scbus & da) - # Various (pseudo) devices device ether # Ethernet support device faith # IPv6-to-IPv4 relaying (translation) From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 17:21:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC59EEC2; Fri, 4 Jan 2013 17:21:02 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABD5E6C; Fri, 4 Jan 2013 17:21:02 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A634BB93E; Fri, 4 Jan 2013 12:21:01 -0500 (EST) From: John Baldwin To: Jaakko Heinonen Subject: Re: svn commit: r244585 - in head: . sys/geom/label Date: Fri, 4 Jan 2013 12:18:07 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201212221343.qBMDhCHa086834@svn.freebsd.org> In-Reply-To: <201212221343.qBMDhCHa086834@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301041218.07804.john@baldwin.cx> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 04 Jan 2013 12:21:01 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 17:21:02 -0000 On Saturday, December 22, 2012 08:43:12 AM Jaakko Heinonen wrote: > Author: jh > Date: Sat Dec 22 13:43:12 2012 > New Revision: 244585 > URL: http://svnweb.freebsd.org/changeset/base/244585 > > Log: > Mangle label names containing spaces, non-printable characters '%' or > '"'. Mangling is only done for label names read from file system > metadata. Encoding resembles URL encoding. For example, the space > character becomes %20. > > Help by: kib > Discussed with: imp, kib, pjd Ouch, mangling spaces seems unfortunate. I guess fixing the devctl protocol is too hard, and/or we can't just encode it at the protocol layer but leave the actual device names untouched? OS X preserves spaces in volume names and those can be quite common on ISO images, so mangling them really does seem to be a shame if we can avoid it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 17:24:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FFD9154; Fri, 4 Jan 2013 17:24:09 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id C87FFE96; Fri, 4 Jan 2013 17:24:08 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from wanderer.tachypleus.net (dhcp107-17-54-205.hil-sfofhhh.sfo.wayport.net [107.17.54.205]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MG400CET3039B00@smtpauth3.wiscmail.wisc.edu>; Fri, 04 Jan 2013 11:24:08 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.4.171223, SenderIP=107.17.54.205 X-Spam-Report: AuthenticatedSender=yes, SenderIP=107.17.54.205 X-Wisc-Sender: whitehorn@wisc.edu Message-id: <50E71033.3040702@freebsd.org> Date: Fri, 04 Jan 2013 12:24:03 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 To: John Baldwin Subject: Re: svn commit: r244585 - in head: . sys/geom/label References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301041218.07804.john@baldwin.cx> In-reply-to: <201301041218.07804.john@baldwin.cx> Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 17:24:09 -0000 On 01/04/13 12:18, John Baldwin wrote: > On Saturday, December 22, 2012 08:43:12 AM Jaakko Heinonen wrote: >> Author: jh >> Date: Sat Dec 22 13:43:12 2012 >> New Revision: 244585 >> URL: http://svnweb.freebsd.org/changeset/base/244585 >> >> Log: >> Mangle label names containing spaces, non-printable characters '%' or >> '"'. Mangling is only done for label names read from file system >> metadata. Encoding resembles URL encoding. For example, the space >> character becomes %20. >> >> Help by: kib >> Discussed with: imp, kib, pjd > Ouch, mangling spaces seems unfortunate. I guess fixing the devctl protocol > is too hard, and/or we can't just encode it at the protocol layer but leave > the actual device names untouched? OS X preserves spaces in volume names and > those can be quite common on ISO images, so mangling them really does seem to > be a shame if we can avoid it. > On a related note, it would be *really* helpful if gpart labels were actually managed by gpart. This kind of thing makes predicting the path of a newly-labeled GPT partition extremely hard and, combined with race conditions and synchronization issues in glabel updating in response to changes in gpart, is why the installer doesn't use labels in fstab. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 18:11:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CA0B5B44; Fri, 4 Jan 2013 18:11:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id A4F06C7; Fri, 4 Jan 2013 18:11:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from wanderer.tachypleus.net (dhcp107-17-54-205.hil-sfofhhh.sfo.wayport.net [107.17.54.205]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MG4003ND2E6KM20@smtpauth3.wiscmail.wisc.edu>; Fri, 04 Jan 2013 11:11:00 -0600 (CST) X-Spam-PmxInfo: Server=avs-3, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.4.165714, SenderIP=107.17.54.205 X-Spam-Report: AuthenticatedSender=yes, SenderIP=107.17.54.205 X-Wisc-Sender: whitehorn@wisc.edu Message-id: <50E70D1E.5060208@freebsd.org> Date: Fri, 04 Jan 2013 12:10:54 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 To: Andrew Turner Subject: Re: svn commit: r244899 - head/sys/mips/beri References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> <20130103100258.2e22763f@fubar.geek.nz> In-reply-to: <20130103100258.2e22763f@fubar.geek.nz> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 18:11:06 -0000 On 01/02/13 16:02, Andrew Turner wrote: > On Wed, 2 Jan 2013 11:01:27 +0000 > "Robert N. M. Watson" wrote: > >> On 1 Jan 2013, at 22:08, Andrew Turner wrote: >> >>>> On a semi-related note: the current obstacle to moving more devices >>>> over to using FDT on BERI is that our FDT implementation appears to >>>> require a PIC to be configured. We're not actually using a PIC on >>>> BERI currently. It works fine attached to nexus, as the implied >>>> fallback for not having a PIC is to simply use the suitably >>>> numbered interrupt wires direct into the MIPS. However, trying the >>>> same setup described using FDT leads to an interrupt-related >>>> warning at boot, and no interrupt being provided to the driver. I >>>> suspect I need to provide a PIC-alike software component as a >>>> fall-back for the non-PIC case. From a brief e-mail exchange with >>>> JC, it sounds like the XLP FDT setup is actually not using >>>> interrupts either, currently. >>> I'm not sure if a PIC is required. From my reading of the code it >>> appears not. By the look of it if you are using the nexus to >>> handle interrupts you need to put an interrupts property in the >>> device and "#interrupt-cells = <1>;" in the soc node. >>> >>> You will also need to implement an interrupt decode function and >>> add it to the fdt_pic_table array. ARM has a number of almost >>> identical copies of this function you can use for inspration. >> >> This seemed to do the trick; what do you think of the attached? This >> isn't a board-specific change, so I dropped it into the common >> fdt_mips.c code. On the other hand, this left it a bit open as to >> what the right compatible= line to use was, so feedback there most >> welcome. > The patch looks good. From my reading of [1] the compatible value > should be something like "mips,mips4k" as it's value is of the form > ",". > > I have been thinking the best way of merging these almost identical > decode functions. Linux appears to do it by providing a per-controller > function that can translate between the interrupt spec and the > configuration allowing them to have a generic parsing function that > doesn't need to check if the controller is compatible. I would like us > to have something similar as it will remove the duplicate function. > > Andrew > > [1] http://www.devicetree.org/Device_Tree_Usage PowerPC does something very much like this currently in the real OF case. Looking at the contents of /sys/dev/fdt, it seems like there is a lot of code duplication in particular with interrupts and PCI handling compared to the equivalent parts of /sys/dev/ofw (and a few extra things that are actually MI like /sys/powerpc/ofw_pci*). It would be very nice if we could make FDT follow the normal OF codepaths instead of (partially) reinventing the wheel. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 20:29:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E3D7BCA5; Fri, 4 Jan 2013 20:29:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp-out3.electric.net (smtp-out3.electric.net [72.35.12.188]) by mx1.freebsd.org (Postfix) with ESMTP id C79EE7A7; Fri, 4 Jan 2013 20:29:06 +0000 (UTC) Received: from [204.11.168.155] (helo=securemail.onebox.com) by opel.electric.net with esmtp (Exim 4.77) (envelope-from ) id 1TrDsx-0008Ma-Us; Fri, 04 Jan 2013 12:28:59 -0800 Received: from localhost (unverified [49.225.56.12]) by securemail.onebox.com (Rockliffe SMTPRA 9.3.1) with ESMTP id ; Fri, 4 Jan 2013 15:29:01 -0500 Date: Sat, 5 Jan 2013 09:28:42 +1300 From: Andrew Turner To: Nathan Whitehorn Subject: Re: svn commit: r244899 - head/sys/mips/beri Message-ID: <20130105092842.15c64ac5@fubar.geek.nz> In-Reply-To: <50E70D1E.5060208@freebsd.org> References: <201212311106.qBVB6chM016661@svn.freebsd.org> <20130102081746.5435db05@fubar.geek.nz> <20130102110856.7c280fd5@fubar.geek.nz> <0E1E1A5C-BB34-4B82-828F-6FEE770A6037@FreeBSD.org> <20130103100258.2e22763f@fubar.geek.nz> <50E70D1E.5060208@freebsd.org> Organization: SMTP: smtp.paradise.net.nz X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) X-Pirate: Arrrr 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, "Robert N. M. Watson" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 20:29:07 -0000 On Fri, 04 Jan 2013 12:10:54 -0500 Nathan Whitehorn wrote: > On 01/02/13 16:02, Andrew Turner wrote: > > The patch looks good. From my reading of [1] the compatible value > > should be something like "mips,mips4k" as it's value is of the form > > ",". > > > > I have been thinking the best way of merging these almost identical > > decode functions. Linux appears to do it by providing a > > per-controller function that can translate between the interrupt > > spec and the configuration allowing them to have a generic parsing > > function that doesn't need to check if the controller is > > compatible. I would like us to have something similar as it will > > remove the duplicate function. > > > > Andrew > > > > [1] http://www.devicetree.org/Device_Tree_Usage > PowerPC does something very much like this currently in the real OF > case. Looking at the contents of /sys/dev/fdt, it seems like there is > a lot of code duplication in particular with interrupts and PCI > handling compared to the equivalent parts of /sys/dev/ofw (and a few > extra things that are actually MI like /sys/powerpc/ofw_pci*). It > would be very nice if we could make FDT follow the normal OF > codepaths instead of (partially) reinventing the wheel. > -Nathan Ok, I'll look to figure out how much of this code we can use with FDT. Andrew From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 20:38:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3397914E; Fri, 4 Jan 2013 20:38:37 +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 F0D71805; Fri, 4 Jan 2013 20:38:36 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B6F9D46B3C; Fri, 4 Jan 2013 15:38:32 -0500 (EST) Date: Fri, 4 Jan 2013 20:38:32 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mateusz Guzik Subject: Re: svn commit: r245036 - head/sys/kern In-Reply-To: <20130104113354.GB26239@dft-labs.eu> Message-ID: References: <201301041111.r04BBDjZ013380@svn.freebsd.org> <20130104113354.GB26239@dft-labs.eu> 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, David Xu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 20:38:37 -0000 On Fri, 4 Jan 2013, Mateusz Guzik wrote: > On Fri, Jan 04, 2013 at 11:11:13AM +0000, David Xu wrote: >> Author: davidxu >> Date: Fri Jan 4 11:11:12 2013 >> New Revision: 245036 >> URL: http://svnweb.freebsd.org/changeset/base/245036 >> >> Log: >> Revert revision 244760 because strncpy pads trailing space with zero, >> this prevents kernel data from being leaked. > > I think it would be better to teach strlcpy to zero-pad as well. I'd rather we created new functions with new names that add the non-portable zeroing behaviour -- perhaps strlpcpy() and strnpcpy(), or something equally incomprehensible. This semantic may actually trigger bugs in code that is correct (albeit badly written) using strncpy() and strlcpy() in a way that never fully fills the buffer (due to some external invariant) and has an incorrect bounds check -- and potentially trigger performance problems when target buffers are much larger than the copied data. Robert From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 20:44:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 78FE849D; Fri, 4 Jan 2013 20:44:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FA3A84A; Fri, 4 Jan 2013 20:44:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r04KiIXt028677; Fri, 4 Jan 2013 20:44:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r04KiIbu028675; Fri, 4 Jan 2013 20:44:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301042044.r04KiIbu028675@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 4 Jan 2013 20:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245047 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 20:44:18 -0000 Author: hselasky Date: Fri Jan 4 20:44:17 2013 New Revision: 245047 URL: http://svnweb.freebsd.org/changeset/base/245047 Log: Fix for "run0: wcid=xx out of range" error message. MFC after: 1 week PR: usb/174963 Submitted by: PseudoCylon Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Jan 4 19:29:23 2013 (r245046) +++ head/sys/dev/usb/wlan/if_run.c Fri Jan 4 20:44:17 2013 (r245047) @@ -2019,7 +2019,8 @@ run_key_set_cb(void *arg) wcid = 0; /* NB: update WCID0 for group keys */ base = RT2860_SKEY(RUN_VAP(vap)->rvp_id, k->wk_keyix); } else { - wcid = RUN_AID2WCID(associd); + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(associd); base = RT2860_PKEY(wcid); } @@ -2374,9 +2375,12 @@ run_newassoc(struct ieee80211_node *ni, struct run_softc *sc = ic->ic_ifp->if_softc; uint8_t rate; uint8_t ridx; - uint8_t wcid = RUN_AID2WCID(ni->ni_associd); + uint8_t wcid; int i, j; + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + if (wcid > RT2870_WCID_MAX) { device_printf(sc->sc_dev, "wcid=%d out of range\n", wcid); return; @@ -3044,8 +3048,12 @@ run_tx(struct run_softc *sc, struct mbuf txd->flags = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - txwi->wcid = IEEE80211_IS_MULTICAST(wh->i_addr1) ? - 0 : RUN_AID2WCID(ni->ni_associd); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + txwi->wcid = 0; + } else { + txwi->wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + } /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 20:57:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E20B939; Fri, 4 Jan 2013 20:57:01 +0000 (UTC) (envelope-from oleg.moskalenko@citrix.com) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) by mx1.freebsd.org (Postfix) with ESMTP id DB3CD8DB; Fri, 4 Jan 2013 20:56:59 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.84,412,1355097600"; d="scan'208";a="2571987" Received: from sjcpmailmx02.citrite.net ([10.216.14.75]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 04 Jan 2013 20:56:57 +0000 Received: from SJCPMAILBOX01.citrite.net ([10.216.4.72]) by SJCPMAILMX02.citrite.net ([10.216.14.75]) with mapi; Fri, 4 Jan 2013 12:56:56 -0800 From: Oleg Moskalenko To: 'Robert Watson' , Mateusz Guzik Date: Fri, 4 Jan 2013 12:56:56 -0800 Subject: RE: svn commit: r245036 - head/sys/kern Thread-Topic: svn commit: r245036 - head/sys/kern Thread-Index: Ac3qu4LzQPwSTJxEQJuLzMOdgYHntQAAZboQ Message-ID: <031222CBCF33214AB2EB4ABA279428A3012CA8FA98F2@SJCPMAILBOX01.citrite.net> References: <201301041111.r04BBDjZ013380@svn.freebsd.org> <20130104113354.GB26239@dft-labs.eu> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David Xu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 20:57:01 -0000 > -----Original Message----- > > I think it would be better to teach strlcpy to zero-pad as well. >=20 > I'd rather we created new functions with new names that add the non-porta= ble > zeroing behaviour -- perhaps strlpcpy() and strnpcpy(), or something equa= lly > incomprehensible. This semantic may actually trigger bugs in code that i= s > correct (albeit badly written) using strncpy() and strlcpy() in a way tha= t never fully > fills the buffer (due to some external invariant) and has an incorrect bo= unds > check -- and potentially trigger performance problems when target buffers= are > much larger than the copied data. >=20 > Robert > _______________________________________________ Robert is right - this is not a good idea to rely on a non-standard "smart"= behavior of basic functions. If the developer wants to code it "securely",= he/she always can use his own wrappers around the strncpy() etc. Any inher= ent built-in behavior that is not "standard" is affecting future maintenanc= e of the code. =20 Oleg From owner-svn-src-head@FreeBSD.ORG Fri Jan 4 23:44:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D91999F; Fri, 4 Jan 2013 23:44:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39CFAEDC; Fri, 4 Jan 2013 23:44:23 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r04NiNlB081480; Fri, 4 Jan 2013 23:44:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r04NiNZA081479; Fri, 4 Jan 2013 23:44:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301042344.r04NiNZA081479@svn.freebsd.org> From: Xin LI Date: Fri, 4 Jan 2013 23:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245048 - head/usr.bin/apply X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 04 Jan 2013 23:44:23 -0000 Author: delphij Date: Fri Jan 4 23:44:22 2013 New Revision: 245048 URL: http://svnweb.freebsd.org/changeset/base/245048 Log: Constify arguments. While I'm there, also add a static for usage(). MFC after: 2 weeks Modified: head/usr.bin/apply/apply.c Modified: head/usr.bin/apply/apply.c ============================================================================== --- head/usr.bin/apply/apply.c Fri Jan 4 20:44:17 2013 (r245047) +++ head/usr.bin/apply/apply.c Fri Jan 4 23:44:22 2013 (r245048) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define EXEC "exec " -static int exec_shell(const char *, char *, char *); +static int exec_shell(const char *, const char *, const char *); static void usage(void); int @@ -222,7 +222,7 @@ main(int argc, char *argv[]) * arguments. */ static int -exec_shell(const char *command, char *use_shell, char *use_name) +exec_shell(const char *command, const char *use_shell, const char *use_name) { pid_t pid; int omask, pstat; @@ -250,7 +250,7 @@ exec_shell(const char *command, char *us return(pid == -1 ? -1 : pstat); } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 00:23:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 227D2D8D; Sat, 5 Jan 2013 00:23:27 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6794FB7; Sat, 5 Jan 2013 00:23:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r050NQwT093190; Sat, 5 Jan 2013 00:23:26 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r050NQHO093188; Sat, 5 Jan 2013 00:23:26 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201301050023.r050NQHO093188@svn.freebsd.org> From: Benjamin Kaduk Date: Sat, 5 Jan 2013 00:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245049 - in head: share/man/man9 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 00:23:27 -0000 Author: bjk (doc committer) Date: Sat Jan 5 00:23:26 2013 New Revision: 245049 URL: http://svnweb.freebsd.org/changeset/base/245049 Log: Fix some minor inaccuracies introduced in r243251. Also correct the comment in kern_synch.c which was the source of the problematic text. Reviewed by: kib (previous version) Approved by: hrs (mentor) Modified: head/share/man/man9/sleep.9 head/sys/kern/kern_synch.c Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Fri Jan 4 23:44:22 2013 (r245048) +++ head/share/man/man9/sleep.9 Sat Jan 5 00:23:26 2013 (r245049) @@ -102,12 +102,11 @@ If .Fa priority includes the .Dv PCATCH -flag, pending -signals are checked before and after sleeping, otherwise signals are -not checked. +flag, pending signals are allowed to interrupt the sleep, otherwise +pending signals are ignored during the sleep. If .Dv PCATCH -is set and a signal needs to be delivered, +is set and a signal becomes pending, .Er ERESTART is returned if the current system call should be restarted if possible, and @@ -119,9 +118,10 @@ If the .Dv PBDRY flag is specified in addition to .Dv PCATCH , -then the sleeping thread is not stopped upon delivery of +then the sleeping thread is not stopped when .Dv SIGSTOP -or other stop action while it is sleeping. +becomes pending +or some other stop action occurs while it is sleeping. Instead, it is woken up, with the assumption that the stop will occur on reaching a stop point when returning to usermode. Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri Jan 4 23:44:22 2013 (r245048) +++ head/sys/kern/kern_synch.c Sat Jan 5 00:23:26 2013 (r245049) @@ -133,10 +133,10 @@ sleepinit(void) * General sleep call. Suspends the current thread until a wakeup is * performed on the specified identifier. The thread will then be made * runnable with the specified priority. Sleeps at most timo/hz seconds - * (0 means no timeout). If pri includes PCATCH flag, signals are checked - * before and after sleeping, else signals are not checked. Returns 0 if + * (0 means no timeout). If pri includes the PCATCH flag, let signals + * interrupt the sleep, otherwise ignore them while sleeping. Returns 0 if * awakened, EWOULDBLOCK if the timeout expires. If PCATCH is set and a - * signal needs to be delivered, ERESTART is returned if the current system + * signal becomes pending, ERESTART is returned if the current system * call should be restarted if possible, and EINTR is returned if the system * call should be interrupted by the signal (return EINTR). * From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 00:23:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D6D8EFE; Sat, 5 Jan 2013 00:23:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CA8DFC0; Sat, 5 Jan 2013 00:23:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r050NxRN093288; Sat, 5 Jan 2013 00:23:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r050NxQP093287; Sat, 5 Jan 2013 00:23:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301050023.r050NxQP093287@svn.freebsd.org> From: Xin LI Date: Sat, 5 Jan 2013 00:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245050 - head/usr.bin/xargs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 00:23:59 -0000 Author: delphij Date: Sat Jan 5 00:23:58 2013 New Revision: 245050 URL: http://svnweb.freebsd.org/changeset/base/245050 Log: Follow calloc convention in other code, this is functionally identical to its previous form. Modified: head/usr.bin/xargs/strnsubst.c Modified: head/usr.bin/xargs/strnsubst.c ============================================================================== --- head/usr.bin/xargs/strnsubst.c Sat Jan 5 00:23:26 2013 (r245049) +++ head/usr.bin/xargs/strnsubst.c Sat Jan 5 00:23:58 2013 (r245050) @@ -48,7 +48,7 @@ strnsubst(char **str, const char *match, match = NULL; maxsize = strlen(s1) + 1; } - s2 = calloc(maxsize, 1); + s2 = calloc(1, maxsize); if (s2 == NULL) err(1, "calloc"); From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 00:27:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B83F193; Sat, 5 Jan 2013 00:27:09 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 075F2FDD; Sat, 5 Jan 2013 00:27:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r050R8eN093781; Sat, 5 Jan 2013 00:27:08 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r050R8AR093780; Sat, 5 Jan 2013 00:27:08 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201301050027.r050R8AR093780@svn.freebsd.org> From: Benjamin Kaduk Date: Sat, 5 Jan 2013 00:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245051 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 00:27:09 -0000 Author: bjk (doc committer) Date: Sat Jan 5 00:27:08 2013 New Revision: 245051 URL: http://svnweb.freebsd.org/changeset/base/245051 Log: Grammar fixes and some wordsmithing Discussed with: rmacklem Approved by: hrs (mentor) MFC after: 2 weeks Modified: head/usr.sbin/gssd/gssd.8 Modified: head/usr.sbin/gssd/gssd.8 ============================================================================== --- head/usr.sbin/gssd/gssd.8 Sat Jan 5 00:23:58 2013 (r245050) +++ head/usr.sbin/gssd/gssd.8 Sat Jan 5 00:27:08 2013 (r245051) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2012 +.Dd December 30, 2012 .Dt GSSD 8 .Os .Sh NAME @@ -53,25 +53,22 @@ will not fork when it starts. Look for an appropriate credential cache file in this list of directories. The list should be full pathnames from root, separated by ':' characters. Usually this list will simply be "/tmp". -Without this option, the +Without this option, .Nm -daemon assumes that the credential cache file is called /tmp/krb5cc_, +assumes that the credential cache file is called /tmp/krb5cc_, where is the effective uid for the RPC caller. .It Fl c Ar file-substring Set a file-substring for the credential cache file names. Only files with this substring embedded in their names will be -selected as candidates when the +selected as candidates when .Fl s has been specified. If not specified, it defaults to "krb5cc_". .It Fl r Ar preferred-realm -Set a preferred Kerberos realm for the search of the directory list for -a credentials cache file. -When set, files with TGT credentials for this realm will be selected over -other credential files. -This option is only meaningful when the -.Fl s -option has been specified. +Use Kerberos credentials for this realm when searching for +credentials in directories specified with +.Fl s . +If not specified, the default Kerberos realm will be used. .El .Sh FILES .Bl -tag -width ".Pa /etc/krb5.keytab" -compact From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 02:08:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4829E4D; Sat, 5 Jan 2013 02:08:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B73572F4; Sat, 5 Jan 2013 02:08:49 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0528n5n023489; Sat, 5 Jan 2013 02:08:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0528m5x023476; Sat, 5 Jan 2013 02:08:48 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301050208.r0528m5x023476@svn.freebsd.org> From: Devin Teske Date: Sat, 5 Jan 2013 02:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245052 - in head/usr.sbin/bsdconfig: . include share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 02:08:49 -0000 Author: dteske Date: Sat Jan 5 02:08:47 2013 New Revision: 245052 URL: http://svnweb.freebsd.org/changeset/base/245052 Log: Add support for scripting (sysinstall style). Reviewed by: jilles Added: head/usr.sbin/bsdconfig/share/script.subr (contents, props changed) head/usr.sbin/bsdconfig/share/variable.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/USAGE head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/bsdconfig.8 head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/USAGE Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/USAGE Sat Jan 5 02:08:47 2013 (r245052) @@ -31,6 +31,9 @@ Usage: @PROGRAM_NAME@ [OPTIONS] [command [OPTIONS]] OPTIONS: + -f file Load file as script and then exit. If multiple occurrences, + program will only exit after last occurrence. If file is a + single dash (`-'), @PROGRAM_NAME@ reads from standard input. -h Print usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/bsdconfig Sat Jan 5 02:08:47 2013 (r245052) @@ -204,25 +204,45 @@ dialog_menu_main() ############################################################ MAIN # -# If $0 is not "bsdconfig", interpret it as a keyword to a menuitem +# If $0 is not "bsdconfig", interpret it either as a keyword to a menuitem or +# as a valid resword (see script.subr for additional details about reswords). # -if [ "$pgm" != "bsdconfig" ] && - indexfile=$( f_index_file "$pgm" ) && - cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) -then - exec "$cmd" "$@" || exit 1 +if [ "$pgm" != "bsdconfig" ]; then + if indexfile=$( f_index_file "$pgm" ) && + cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) + then + f_dprintf "pgm=[%s] indexfile=[%s] cmd=[%s]" \ + "$pgm" "$indexfile" "$cmd" + exec "$cmd" "$@" || exit 1 + else + f_include $BSDCFG_SHARE/script.subr + for resword in $RESWORDS; do + [ "$pgm" = "$resword" ] || continue + # Found a match + f_dprintf "pgm=[%s] A valid resWord!" "$pgm" + f_dispatch $resword + exit $? + done + fi fi # # Process command-line arguments # -while getopts hSX flag; do +scripts_loaded=0 +while getopts f:hSX flag; do case "$flag" in + f) [ $scripts_loaded -eq 0 ] && f_include $BSDCFG_SHARE/script.subr + f_script_load "$OPTARG" + scripts_loaded=$(( $scripts_loaded + 1 ));; h|\?) usage;; esac done shift $(( $OPTIND -1 )) +# If we've loaded any scripts, do not continue any further +[ $scripts_loaded -gt 0 ] && exit + # # Initialize # Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Sat Jan 5 02:08:47 2013 (r245052) @@ -85,6 +85,17 @@ a master menu listing the available comm .Pp The following options are available: .Bl -tag -width indent+ +.It Fl f Ar file +Load +.Ar file +as script and then exit. +If multiple occurrences, program will only exit after last occurrence. +If +.Ar file +is a single dash +.Pq Sq Fl , +.Nm +reads from standard input. .It Fl h Print usage statement and exit. .It Fl S Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/include/messages.subr Sat Jan 5 02:08:47 2013 (r245052) @@ -34,6 +34,7 @@ msg_becoming_root_via_sudo="Becoming roo msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" +msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted." msg_created_path="Created %s" msg_directory_not_found="%s: Directory not found." msg_exit="Exit" @@ -56,6 +57,7 @@ msg_secure_mode_requires_x11="Secure-mod msg_secure_mode_requires_root="Secure-mode requires root-access!" msg_sorry_try_again="Sorry, try again." msg_try_sudo_only_this_once="Try sudo(8) only this once" +msg_unable_to_open="Unable to open %s" msg_unknown_user="Unknown user: %s" msg_usage="Usage" msg_user_disallowed="User disallowed: %s" Modified: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/Makefile Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/share/Makefile Sat Jan 5 02:08:47 2013 (r245052) @@ -3,7 +3,8 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr dialog.subr mustberoot.subr strings.subr sysrc.subr +FILES= common.subr dialog.subr mustberoot.subr script.subr \ + strings.subr sysrc.subr variable.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Sat Jan 5 00:27:08 2013 (r245051) +++ head/usr.sbin/bsdconfig/share/common.subr Sat Jan 5 02:08:47 2013 (r245052) @@ -114,6 +114,30 @@ f_have() f_quietly type "$@" } +# f_getvar $var_to_get [$var_to_set] +# +# Utility function designed to go along with the already-builtin setvar. +# Allows clean variable name indirection without forking or sub-shells. +# +# Returns error status if the requested variable ($var_to_get) is not set. +# +# If $var_to_set is missing or NULL, the value of $var_to_get is printed to +# standard output for capturing in a sub-shell (which is less-recommended +# because of performance degredation; for example, when called in a loop). +# +f_getvar() +{ + local var_to_get="$1" var_to_set="$2" + [ "$var_to_set" ] || local value + eval ${var_to_set:-value}=\"\${$var_to_get}\" + eval [ \"\${$var_to_get+set}\" ] + local retval=$? + eval f_dprintf '"f_getvar: var=[%s] value=[%s] r=%u"' \ + \"\$var_to_get\" \"\$${var_to_set:-value}\" \$retval + [ "$var_to_set" ] || { [ "$value" ] && echo "$value"; } + return $retval +} + # f_die [ $status [ $fmt [ $opts ... ]]] # # Abruptly terminate due to an error optionally displaying a message in a Added: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/script.subr Sat Jan 5 02:08:47 2013 (r245052) @@ -0,0 +1,139 @@ +if [ ! "$_SCRIPT_SUBR" ]; then _SCRIPT_SUBR=1 +# +# Copyright (c) 2012 Devin Teske +# 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 (INLUDING, 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." script.subr +f_include $BSDCFG_SHARE/variable.subr + +############################################################ GLOBALS + +RESWORDS= + +############################################################ FUNCTIONS + +# f_resword_new $resword $function +# +# Create a new `reserved' word for scripting purposes. Reswords call pre- +# defined functions but differ from those functions in the following ways: +# +# + Reswords do not take arguments but instead get all their data from +# the environment variable namespace. +# + Unless noError is set (must be non-NULL), if calling the resword +# results in failure, the application will terminate prematurely. +# + noError is unset after each/every resword is called. +# +# Reswords should not be used in bsdconfig itself (hence the name `reserved +# word') but instead only in scripts loaded through f_script_load()). +# +f_resword_new() +{ + local resword="$1" func="$2" + [ "$resword" ] || return $FAILURE + f_dprintf "script.subr: New resWord %s -> %s" "$resword" "$func" + eval $resword\(\){ f_dispatch $func $resword\; } + RESWORDS="$RESWORDS${RESWORDS:+ }$resword" +} + +# f_dispatch $func [$resword] +# +# Wrapper function used by `reserved words' (reswords) to call other functions. +# If $noError is set and non-NULL, a failure result from $func is ignored, +# otherwise the application is prematurely terminated using f_die(). +# +# NOTE: $noError is unset after every call. +# +f_dispatch() +{ + local func="$1" resword="${2:-$1}" + f_dprintf "f_dispatch: calling resword \`%s'" "$resword" + eval $func + local retval=$? _ignore_this_error + f_getvar $VAR_NO_ERROR _ignore_this_error + [ $retval -eq $SUCCESS ] || + [ "$_ignore_this_error" ] || f_die $retval \ + "$msg_command_failed_rest_of_script_aborted" "$resword" + unset $VAR_NO_ERROR +} + +# f_script_load [$file] +# +# Load a script (usually filled with reswords). If $file is missing or NULL, +# use one of the following instead (in order): +# +# $configFile +# install.cfg +# /stand/install.fg +# /tmp/install.cfg +# +# Unknown/unregistered reswords will generate sh(1) syntax errors but not cause +# premature termination. +# +# Returns success if a script was loaded and itself returned success. +# +f_script_load() +{ + local script="$1" config_file + + f_dprintf "f_script_load: script=[%s]" "$script" + if [ ! "$script" ]; then + f_getvar $VAR_CONFIG_FILE config_file + for script in \ + $config_file \ + install.cfg \ + /stand/install.cfg \ + /tmp/install.cfg \ + ; do + [ -e "$script" ] && break + done + elif [ "$script" = "-" ]; then + f_dprintf "f_script_load: Loading script from stdin" + eval "$( cat )" + else + f_dprintf "f_script_load: Loading script \`%s'" "$script" + if [ ! -e "$script" ]; then + f_show_msg "$msg_unable_to_open" "$script" + return $FAILURE + fi + . "$script" + fi +} + +############################################################ MAIN + +# +# Reserved words meant for scripting +# +f_resword_new dumpVariables f_dump_variables +f_resword_new loadConfig f_script_load + +f_dprintf "%s: Successfully loaded." script.subr + +fi # ! $_SCRIPT_SUBR Added: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/variable.subr Sat Jan 5 02:08:47 2013 (r245052) @@ -0,0 +1,185 @@ +if [ ! "$_VARIABLE_SUBR" ]; then _VARIABLE_SUBR=1 +# +# Copyright (c) 2012 Devin Teske +# 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 (INLUDING, 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." variable.subr +f_include $BSDCFG_SHARE/dialog.subr + +############################################################ GLOBALS + +VARIABLES= + +# +# Default behavior is to call f_variable_set_defaults() when loaded. +# +: ${VARIABLE_SELF_INITIALIZE=1} + +# +# File to write when f_dump_variables() is called. +# +: ${VARIABLE_DUMPFILE:=/etc/bsdconfig.vars} + +############################################################ FUNCTIONS + +# f_variable_new $handle $variable +# +# Register a new variable named $variable with the given reference-handle +# $handle. The environment variable $handle is set to $variable allowing you to +# use the f_getvar() function (from common.subr) with $handle to get the value +# of environment variable $variable. For example: +# +# f_variable_new VAR_ABC abc +# +# allows the later indirection: +# +# f_getvar $VAR_ABC +# +# to return the value of environment variable `abc'. Variables registered in +# this manner are recorded in the $VARIABLES environment variable for later +# allowing dynamic enumeration of so-called `registered/advertised' variables. +# +f_variable_new() +{ + local handle="$1" variable="$2" + [ "$handle" ] || return $FAILURE + f_dprintf "variable.subr: New variable %s -> %s" "$handle" "$variable" + setvar $handle $variable + VARIABLES="$VARIABLES${VARIABLES:+ }$handle" +} + +# f_variable_get_value $var [ $fmt [ $opts ... ] ] +# +# Unless nonInteractive is set, prompt the user with a given value (pre-filled +# with the value of $var) and give them the chance to change the value. +# +# Unlike f_getvar() (from common.subr) which can return a variable to the +# caller on standard output, this function has no [meaningful] output. +# +# Returns success unless $var is either NULL or missing. +# +f_variable_get_value() +{ + local var="$1" cp + + [ "$var" ] || return $FAILURE + + if ! { f_getvar $var cp && ! f_interactive; }; then + shift 1 # var + cp=$( f_dialog_input "$( printf "$@" )" "$cp" ) && + setvar $var "$cp" + fi + + return $SUCCESS +} + +# f_variable_set_defaults +# +# Installs sensible defaults for registered/advertised variables. +# +f_variable_set_defaults() +{ + # + # Initialize various user-edittable values to their defaults + # + setvar $VAR_RELNAME "$UNAME_R" + + f_dprintf "f_variable_set_defaults: Defaults initialized." +} + +# f_dump_variables +# +# Dump a list of registered/advertised variables and their respective values to +# $VARIABLE_DUMPFILE. Returns success unless the file couldn't be written. If +# an error occurs, it is displayed using f_show_msg() (from common.subr). +# +f_dump_variables() +{ + local err sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }" + if ! err=$( + ( for handle in $VARIABLES; do + f_getvar $handle var || continue + f_getvar $var value || continue + value=$( echo "$value" | awk "$sanitize_awk" ) + printf "%s='%s'\n" "$var" "$value" + done > "$VARIABLE_DUMPFILE" ) 2>&1 + ); then + f_show_msg "%s" "$err" + return $FAILURE + fi +} + +# f_debugging +# +# Are we in debug mode? Returns success if extra DEBUG information has been +# requested (by setting $debug to non-NULL), otherwise false. +# +f_debugging() +{ + local value + f_getvar $VAR_DEBUG value && [ "$value" ] +} + +# f_interactive() +# +# Are we running interactively? Return error if $nonInteractive is set and non- +# NULL, otherwise return success. +# +f_interactive() +{ + local value + ! f_getvar $VAR_NONINTERACTIVE value || [ ! "$value" ] +} + +############################################################ MAIN + +# +# Variables that can be tweaked from config files +# +f_variable_new VAR_CONFIG_FILE configFile +f_variable_new VAR_DEBUG debug +f_variable_new VAR_DEBUG_FILE debugFile +f_variable_new VAR_NO_ERROR noError +f_variable_new VAR_NONINTERACTIVE nonInteractive +f_variable_new VAR_RELNAME releaseName + +# +# Self-initialize unless requested otherwise +# +f_dprintf "%s: VARIABLE_SELF_INITIALIZE=[%s]" \ + variable.subr "$VARIABLE_SELF_INITIALIZE" +case "$VARIABLE_SELF_INITIALIZE" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_variable_set_defaults +esac + +f_dprintf "%s: Successfully loaded." variable.subr + +fi # ! $_VARIABLE_SUBR From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 04:20:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29D172F0; Sat, 5 Jan 2013 04:20:15 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 05FCE8BC; Sat, 5 Jan 2013 04:20:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r054KEtV063067; Sat, 5 Jan 2013 04:20:14 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r054KEad063066; Sat, 5 Jan 2013 04:20:14 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301050420.r054KEad063066@svn.freebsd.org> From: Neel Natu Date: Sat, 5 Jan 2013 04:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245055 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 04:20:15 -0000 Author: neel Date: Sat Jan 5 04:20:14 2013 New Revision: 245055 URL: http://svnweb.freebsd.org/changeset/base/245055 Log: Add macros required to enable VMX operation on Intel processors. Obtained from: NetApp Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Jan 5 03:35:30 2013 (r245054) +++ head/sys/x86/include/specialreg.h Sat Jan 5 04:20:14 2013 (r245055) @@ -68,6 +68,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_VMXE 0x00002000 /* enable VMX operation (Intel-specific) */ #define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ #define CR4_PCIDE 0x00020000 /* Enable Context ID */ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ @@ -310,6 +311,7 @@ #define MSR_APICBASE 0x01b #define MSR_EBL_CR_POWERON 0x02a #define MSR_TEST_CTL 0x033 +#define MSR_IA32_FEATURE_CONTROL 0x03a #define MSR_BIOS_UPDT_TRIG 0x079 #define MSR_BBL_CR_D0 0x088 #define MSR_BBL_CR_D1 0x089 From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 09:30:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16EF21D0; Sat, 5 Jan 2013 09:30:10 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id CBA59692; Sat, 5 Jan 2013 09:30:09 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 8124B15150F; Sat, 5 Jan 2013 11:22:53 +0200 (EET) Date: Sat, 5 Jan 2013 11:22:52 +0200 From: Jaakko Heinonen To: John Baldwin Subject: Re: svn commit: r244585 - in head: . sys/geom/label Message-ID: <20130105092252.GA1832@a91-153-116-96.elisa-laajakaista.fi> References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301041218.07804.john@baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201301041218.07804.john@baldwin.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 09:30:10 -0000 On 2013-01-04, John Baldwin wrote: > > New Revision: 244585 > > Log: > > Mangle label names containing spaces, non-printable characters '%' or > > '"'. Mangling is only done for label names read from file system > > metadata. Encoding resembles URL encoding. For example, the space > > character becomes %20. > > Ouch, mangling spaces seems unfortunate. I guess fixing the devctl protocol > is too hard, and/or we can't just encode it at the protocol layer but leave > the actual device names untouched? I initially proposed changing the devctl protocol but in a private discussion people preferred to not change the protocol. However, I think that allowing the space character only might be possible without changing the protocol as devd(8) can already handle strings enclosed in double quotes. usb(4) already uses such devctl variables. > OS X preserves spaces in volume names and those can be quite common on > ISO images, so mangling them really does seem to be a shame if we can > avoid it. How important do you think this is? I understand that it's annoyance for people upgrading their systems but labels with spaces can still be used. -- Jaakko From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 14:52:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65F6A946; Sat, 5 Jan 2013 14:52:32 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58686FDF; Sat, 5 Jan 2013 14:52:32 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05EqW9a051826; Sat, 5 Jan 2013 14:52:32 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05EqWHt051825; Sat, 5 Jan 2013 14:52:32 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201301051452.r05EqWHt051825@svn.freebsd.org> From: Gabor Kovesdan Date: Sat, 5 Jan 2013 14:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245057 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 14:52:32 -0000 Author: gabor Date: Sat Jan 5 14:52:31 2013 New Revision: 245057 URL: http://svnweb.freebsd.org/changeset/base/245057 Log: - Fix handling of the case when multiple patterns are specified in a single command line argument, separated by newlines PR: bin/173673 Submitted by: ache MFC after: 1 week Modified: head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sat Jan 5 11:13:48 2013 (r245056) +++ head/usr.bin/grep/grep.c Sat Jan 5 14:52:31 2013 (r245057) @@ -479,7 +479,13 @@ main(int argc, char *argv[]) grepbehave = GREP_EXTENDED; break; case 'e': - add_pattern(optarg, strlen(optarg)); + { + char *token; + char *string = strdup(optarg); + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); + } needpattern = 0; break; case 'F': @@ -668,7 +674,11 @@ main(int argc, char *argv[]) /* Process patterns from command line */ if (aargc != 0 && needpattern) { - add_pattern(*aargv, strlen(*aargv)); + char *token; + char *string = strdup(*aargv); + + while ((token = strsep(&string, "\n")) != NULL) + add_pattern(token, strlen(token)); --aargc; ++aargv; } From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 17:59:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F33B87C; Sat, 5 Jan 2013 17:59:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 28DBA986; Sat, 5 Jan 2013 17:59:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05HxjKn006612; Sat, 5 Jan 2013 17:59:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05HxiOX006608; Sat, 5 Jan 2013 17:59:44 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301051759.r05HxiOX006608@svn.freebsd.org> From: Tim Kientzle Date: Sat, 5 Jan 2013 17:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245064 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 17:59:45 -0000 Author: kientzle Date: Sat Jan 5 17:59:44 2013 New Revision: 245064 URL: http://svnweb.freebsd.org/changeset/base/245064 Log: While trying to track down the root cause for TX stalls in this driver, I've also had some time to evaluate the effectiveness of different watchdog strategies. This is the latest attempt, which consolidates all of the watchdog logic in one place and consistently detects TX stalls and resets within a couple of seconds. Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 17:41:21 2013 (r245063) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 17:59:44 2013 (r245064) @@ -98,7 +98,7 @@ static int cpsw_ioctl(struct ifnet *ifp, static int cpsw_init_slot_lists(struct cpsw_softc *sc); static void cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot); static void cpsw_fill_rx_queue_locked(struct cpsw_softc *sc); -static void cpsw_watchdog(struct cpsw_softc *sc); +static void cpsw_tx_watchdog(struct cpsw_softc *sc); static void cpsw_intr_rx_thresh(void *arg); static void cpsw_intr_rx(void *arg); @@ -737,13 +737,7 @@ cpsw_start_locked(struct ifnet *ifp) cpsw_cpdma_write_txbd_next(prev_slot->index, cpsw_cpdma_txbd_paddr(first_new_slot->index)); } - /* If tx_retires hasn't changed, then we may have - lost a TX interrupt, so let the timer tick. */ sc->tx_enqueues += enqueued; - if (sc->tx_retires_at_wd_reset != sc->tx_retires) { - sc->tx_retires_at_wd_reset = sc->tx_retires; - sc->wd_timer = 5; - } sc->tx_queued += enqueued; if (sc->tx_queued > sc->tx_max_queued) { sc->tx_max_queued = sc->tx_queued; @@ -771,7 +765,6 @@ cpsw_stop_locked(struct cpsw_softc *sc) /* Stop tick engine */ callout_stop(&sc->wd_callout); - sc->wd_timer = 0; /* Wait for hardware to clear pending ops. */ CPSW_GLOBAL_UNLOCK(sc); @@ -1185,7 +1178,6 @@ cpsw_intr_tx_locked(void *arg) } sc->tx_retires += retires; sc->tx_queued -= retires; - sc->wd_timer = 0; } } @@ -1206,7 +1198,7 @@ cpsw_tick(void *msc) struct cpsw_softc *sc = msc; /* Check for TX timeout */ - cpsw_watchdog(sc); + cpsw_tx_watchdog(sc); mii_tick(sc->mii); @@ -1222,21 +1214,28 @@ cpsw_tick(void *msc) } static void -cpsw_watchdog(struct cpsw_softc *sc) +cpsw_tx_watchdog(struct cpsw_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp = sc->ifp; - ifp = sc->ifp; CPSW_GLOBAL_LOCK(sc); - if (sc->wd_timer == 0 || --sc->wd_timer) { - CPSW_GLOBAL_UNLOCK(sc); - return; + if (sc->tx_retires > sc->tx_retires_at_last_tick) { + sc->tx_wd_timer = 0; /* Stuff got sent. */ + } else if (sc->tx_queued == 0) { + sc->tx_wd_timer = 0; /* Nothing to send. */ + } else { + /* There was something to send but we didn't. */ + ++sc->tx_wd_timer; + if (sc->tx_wd_timer > 3) { + sc->tx_wd_timer = 0; + ifp->if_oerrors++; + if_printf(ifp, "watchdog timeout\n"); + cpsw_stop_locked(sc); + cpsw_init_locked(sc); + CPSW_DEBUGF(("watchdog reset completed\n")); + } } - - ifp->if_oerrors++; - if_printf(ifp, "watchdog timeout\n"); - cpsw_stop_locked(sc); - cpsw_init_locked(sc); + sc->tx_retires_at_last_tick = sc->tx_retires; CPSW_GLOBAL_UNLOCK(sc); } @@ -1381,7 +1380,7 @@ cpsw_init_locked(void *arg) /* Activate network interface */ sc->rx_running = 1; sc->tx_running = 1; - sc->wd_timer = 0; + sc->tx_wd_timer = 0; callout_reset(&sc->wd_callout, hz, cpsw_tick, sc); sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 5 17:41:21 2013 (r245063) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 5 17:59:44 2013 (r245064) @@ -63,7 +63,7 @@ struct cpsw_softc { int cpsw_media_status; struct callout wd_callout; - int wd_timer; + int tx_wd_timer; bus_dma_tag_t mbuf_dtag; @@ -82,7 +82,7 @@ struct cpsw_softc { /* Statistics */ uint32_t tx_enqueues; /* total TX bufs added to queue */ uint32_t tx_retires; /* total TX bufs removed from queue */ - uint32_t tx_retires_at_wd_reset; /* used for watchdog */ + uint32_t tx_retires_at_last_tick; /* used for watchdog */ /* Note: tx_queued != tx_enqueues - tx_retires At driver reset, packets can be discarded from TX queue without being retired. */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 18:48:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3048AC7; Sat, 5 Jan 2013 18:48:24 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 91738D22; Sat, 5 Jan 2013 18:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05ImOx6021376; Sat, 5 Jan 2013 18:48:24 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05ImOeG021375; Sat, 5 Jan 2013 18:48:24 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301051848.r05ImOeG021375@svn.freebsd.org> From: Neel Natu Date: Sat, 5 Jan 2013 18:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245065 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 18:48:24 -0000 Author: neel Date: Sat Jan 5 18:48:23 2013 New Revision: 245065 URL: http://svnweb.freebsd.org/changeset/base/245065 Log: Add quirk to indicate that the bhyve hostbridge is capable of supporting MSI and MSI-X even though it does not advertise the PCI-E capability itself. Obtained from: NetApp Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sat Jan 5 17:59:44 2013 (r245064) +++ head/sys/dev/pci/pci.c Sat Jan 5 18:48:23 2013 (r245065) @@ -244,6 +244,7 @@ static const struct pci_quirk pci_quirks * but support MSI just fine. QEMU uses the Intel 82440. */ { 0x12378086, PCI_QUIRK_ENABLE_MSI_VM, 0, 0 }, + { 0x12751275, PCI_QUIRK_ENABLE_MSI_VM, 0, 0 }, /* bhyve */ /* * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 19:18:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1BF6402; Sat, 5 Jan 2013 19:18:51 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD2FE94; Sat, 5 Jan 2013 19:18:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05JIpFT030510; Sat, 5 Jan 2013 19:18:51 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05JIptx030509; Sat, 5 Jan 2013 19:18:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301051918.r05JIptx030509@svn.freebsd.org> From: Neel Natu Date: Sat, 5 Jan 2013 19:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245066 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 19:18:51 -0000 Author: neel Date: Sat Jan 5 19:18:50 2013 New Revision: 245066 URL: http://svnweb.freebsd.org/changeset/base/245066 Log: Teach the kernel to recognize that it is executing inside a bhyve virtual machine. Obtained from: NetApp Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Sat Jan 5 18:48:23 2013 (r245065) +++ head/sys/kern/subr_param.c Sat Jan 5 19:18:50 2013 (r245066) @@ -160,6 +160,7 @@ static const char *const vm_bnames[] = { "Plex86", /* Plex86 */ "Bochs", /* Bochs */ "Xen", /* Xen */ + "BHYVE", /* bhyve */ NULL }; From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 20:30:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF028CF5; Sat, 5 Jan 2013 20:30:10 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D65D613E; Sat, 5 Jan 2013 20:30:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05KUAa8051422; Sat, 5 Jan 2013 20:30:10 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05KUArt051421; Sat, 5 Jan 2013 20:30:10 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301052030.r05KUArt051421@svn.freebsd.org> From: Tim Kientzle Date: Sat, 5 Jan 2013 20:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245068 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 20:30:11 -0000 Author: kientzle Date: Sat Jan 5 20:30:10 2013 New Revision: 245068 URL: http://svnweb.freebsd.org/changeset/base/245068 Log: Prefer the new NFS modules Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sat Jan 5 20:07:28 2013 (r245067) +++ head/sys/arm/conf/BEAGLEBONE Sat Jan 5 20:30:10 2013 (r245068) @@ -62,11 +62,11 @@ options WITNESS_SKIPSPIN #Don't run wit # NFS support #options NFSCL -#options NFSSERVER #Network Filesystem Server -#options NFSCLIENT #Network Filesystem Client +#options NFSD +#options NFSLOCKD # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options NFS_ROOT #NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 20:35:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 154B7E87; Sat, 5 Jan 2013 20:35:39 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 3734C15D; Sat, 5 Jan 2013 20:35:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 991E28E; Sat, 5 Jan 2013 21:33:16 +0100 (CET) Date: Sat, 5 Jan 2013 21:35:35 +0100 From: Pawel Jakub Dawidek To: Nathan Whitehorn Subject: Re: svn commit: r244585 - in head: . sys/geom/label Message-ID: <20130105203534.GF1390@garage.freebsd.pl> References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301041218.07804.john@baldwin.cx> <50E71033.3040702@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pmKUVAsxJ35RhmJn" Content-Disposition: inline In-Reply-To: <50E71033.3040702@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: John Baldwin , Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 20:35:39 -0000 --pmKUVAsxJ35RhmJn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 04, 2013 at 12:24:03PM -0500, Nathan Whitehorn wrote: > On 01/04/13 12:18, John Baldwin wrote: > > On Saturday, December 22, 2012 08:43:12 AM Jaakko Heinonen wrote: > >> Author: jh > >> Date: Sat Dec 22 13:43:12 2012 > >> New Revision: 244585 > >> URL: http://svnweb.freebsd.org/changeset/base/244585 > >> > >> Log: > >> Mangle label names containing spaces, non-printable characters '%' or > >> '"'. Mangling is only done for label names read from file system > >> metadata. Encoding resembles URL encoding. For example, the space > >> character becomes %20. > >> > >> Help by: kib > >> Discussed with: imp, kib, pjd > > Ouch, mangling spaces seems unfortunate. I guess fixing the devctl pro= tocol=20 > > is too hard, and/or we can't just encode it at the protocol layer but l= eave=20 > > the actual device names untouched? OS X preserves spaces in volume nam= es and=20 > > those can be quite common on ISO images, so mangling them really does s= eem to=20 > > be a shame if we can avoid it. > > >=20 > On a related note, it would be *really* helpful if gpart labels were > actually managed by gpart. This kind of thing makes predicting the path > of a newly-labeled GPT partition extremely hard and, combined with race > conditions and synchronization issues in glabel updating in response to > changes in gpart, is why the installer doesn't use labels in fstab. I fully agree that gpart should manage GEOM providers based on labels on its own, especially that it doesn't update label by writing to underlying provider, so GEOM tasting cannot tell glabel about changes. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --pmKUVAsxJ35RhmJn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDojpYACgkQForvXbEpPzS/CgCgvmIykrzHsdOBmFVvVZAGYsS+ 054AmwTckQoNGXYZuSLWSI8/N4bsdHN6 =tvXp -----END PGP SIGNATURE----- --pmKUVAsxJ35RhmJn-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 20:37:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F3E819C; Sat, 5 Jan 2013 20:37:41 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52BC1177; Sat, 5 Jan 2013 20:37:41 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05Kbfq0053880; Sat, 5 Jan 2013 20:37:41 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05KbfXW053879; Sat, 5 Jan 2013 20:37:41 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201301052037.r05KbfXW053879@svn.freebsd.org> From: Tim Kientzle Date: Sat, 5 Jan 2013 20:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245070 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 20:37:41 -0000 Author: kientzle Date: Sat Jan 5 20:37:40 2013 New Revision: 245070 URL: http://svnweb.freebsd.org/changeset/base/245070 Log: Shuffle the TX underrun to work the same way as the RX underrun, as suggested by YongHyeon PYUN. Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 20:37:14 2013 (r245069) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 5 20:37:40 2013 (r245070) @@ -716,26 +716,22 @@ cpsw_start_locked(struct ifnet *ifp) if (STAILQ_EMPTY(&newslots)) return; - /* Attach new segments to the hardware TX queue. */ + /* Attach the list of new buffers to the hardware TX queue. */ prev_slot = STAILQ_LAST(&sc->tx_active, cpsw_slot, next); first_new_slot = STAILQ_FIRST(&newslots); STAILQ_CONCAT(&sc->tx_active, &newslots); if (prev_slot == NULL) { /* Start the TX queue fresh. */ cpsw_write_4(CPSW_CPDMA_TX_HDP(0), - cpsw_cpdma_txbd_paddr(first_new_slot->index)); + cpsw_cpdma_txbd_paddr(first_new_slot->index)); } else { - /* Add packets to current queue. */ - /* Race: The hardware might have sent the last packet - * on the queue and stopped the transmitter just - * before we got here. In that case, this is a no-op, - * but it also means there's a TX interrupt waiting - * to be processed as soon as we release the lock here. - * That TX interrupt can detect and recover from this - * situation; see cpsw_intr_tx_locked. - */ + /* Add buffers to end of current queue. */ cpsw_cpdma_write_txbd_next(prev_slot->index, cpsw_cpdma_txbd_paddr(first_new_slot->index)); + /* If underrun, restart queue. */ + if (cpsw_cpdma_read_txbd_flags(prev_slot->index) & CPDMA_BD_EOQ) + cpsw_write_4(CPSW_CPDMA_TX_HDP(0), + cpsw_cpdma_txbd_paddr(first_new_slot->index)); } sc->tx_enqueues += enqueued; sc->tx_queued += enqueued; @@ -1091,14 +1087,10 @@ cpsw_fill_rx_queue_locked(struct cpsw_so cpsw_write_4(CPSW_CPDMA_RX_HDP(0), cpsw_cpdma_rxbd_paddr(next_slot->index)); } else { - /* Extend an existing RX queue. */ + /* Add buffers to end of current queue. */ cpsw_cpdma_write_rxbd_next(prev_slot->index, cpsw_cpdma_rxbd_paddr(next_slot->index)); - /* XXX Order matters: Previous write must complete - before next read begins in order to avoid an - end-of-queue race. I think bus_write and bus_read have - sufficient barriers built-in to ensure this. XXX */ - /* If old RX queue was stopped, restart it. */ + /* If underrun, restart queue. */ if (cpsw_cpdma_read_rxbd_flags(prev_slot->index) & CPDMA_BD_EOQ) { cpsw_write_4(CPSW_CPDMA_RX_HDP(0), cpsw_cpdma_rxbd_paddr(next_slot->index)); @@ -1170,12 +1162,6 @@ cpsw_intr_tx_locked(void *arg) /* Tell hardware the last item we dequeued. */ cpsw_write_4(CPSW_CPDMA_TX_CP(0), cpsw_cpdma_txbd_paddr(last_slot->index)); - /* If transmitter stopped and there's more, restart it. */ - /* This resolves the race described in tx_start above. */ - if ((last_flags & CPDMA_BD_EOQ) && (slot != NULL)) { - cpsw_write_4(CPSW_CPDMA_TX_HDP(0), - cpsw_cpdma_txbd_paddr(slot->index)); - } sc->tx_retires += retires; sc->tx_queued -= retires; } From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 21:05:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59926A28; Sat, 5 Jan 2013 21:05:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33D1D37C; Sat, 5 Jan 2013 21:05:17 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05L5HU6062564; Sat, 5 Jan 2013 21:05:17 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05L5GQU062562; Sat, 5 Jan 2013 21:05:16 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301052105.r05L5GQU062562@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 5 Jan 2013 21:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245071 - in head/sys/arm: broadcom/bcm2835 versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 21:05:17 -0000 Author: gonzo Date: Sat Jan 5 21:05:16 2013 New Revision: 245071 URL: http://svnweb.freebsd.org/changeset/base/245071 Log: Fix background color calculation Spotted by: ray@ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/versatile/versatile_clcd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sat Jan 5 20:37:40 2013 (r245070) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sat Jan 5 21:05:16 2013 (r245071) @@ -891,7 +891,7 @@ bcmfb_putc(video_adapter_t *adp, vm_offs + (sc->depth/8) * (col + sc->xmargin); fg = a & 0xf ; - bg = (a >> 8) & 0xf; + bg = (a >> 4) & 0xf; for (i = 0; i < BCMFB_FONT_HEIGHT; i++) { for (j = 0, k = 7; j < 8; j++, k--) { Modified: head/sys/arm/versatile/versatile_clcd.c ============================================================================== --- head/sys/arm/versatile/versatile_clcd.c Sat Jan 5 20:37:40 2013 (r245070) +++ head/sys/arm/versatile/versatile_clcd.c Sat Jan 5 21:05:16 2013 (r245071) @@ -892,7 +892,7 @@ versatilefb_putc(video_adapter_t *adp, v + (sc->depth/8) * (col + sc->xmargin); fg = a & 0xf ; - bg = (a >> 8) & 0xf; + bg = (a >> 4) & 0xf; for (i = 0; i < VERSATILE_FONT_HEIGHT; i++) { for (j = 0, k = 7; j < 8; j++, k--) { From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 21:42:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E377139; Sat, 5 Jan 2013 21:42:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60F32772; Sat, 5 Jan 2013 21:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05LgF6l073907; Sat, 5 Jan 2013 21:42:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05LgFiZ073905; Sat, 5 Jan 2013 21:42:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301052142.r05LgFiZ073905@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Jan 2013 21:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245072 - head/sbin/geom/class/journal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 21:42:15 -0000 Author: kib Date: Sat Jan 5 21:42:14 2013 New Revision: 245072 URL: http://svnweb.freebsd.org/changeset/base/245072 Log: Do not round up the size of the UFS filesystem to the fragment size when comparing its size with the size of the media, to determine if the last disk block is unused. Submitted by: Andreas Longwitz Reviewed by: pjd MFC after: 2 weeks Modified: head/sbin/geom/class/journal/geom_journal_ufs.c Modified: head/sbin/geom/class/journal/geom_journal_ufs.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:05:16 2013 (r245071) +++ head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:42:14 2013 (r245072) @@ -70,9 +70,9 @@ g_journal_ufs_using_last_sector(const ch fs = read_superblock(prov); if (fs == NULL) return (0); - /* Provider size in 512 bytes blocks. */ - psize = g_get_mediasize(prov) / DEV_BSIZE; - /* File system size in 512 bytes blocks. */ - fssize = fsbtodb(fs, dbtofsb(fs, psize)); - return (psize == fssize); + /* Provider size in 512 bytes blocks. */ + psize = g_get_mediasize(prov) / DEV_BSIZE; + /* File system size in 512 bytes blocks. */ + fssize = fsbtodb(fs, fs->fs_size); + return (psize <= fssize); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 21:52:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F4AB4BF; Sat, 5 Jan 2013 21:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8751D7C5; Sat, 5 Jan 2013 21:52:39 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05LqdRr076862; Sat, 5 Jan 2013 21:52:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05LqdPs076861; Sat, 5 Jan 2013 21:52:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301052152.r05LqdPs076861@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Jan 2013 21:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245074 - head/sbin/geom/class/journal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 21:52:39 -0000 Author: kib Date: Sat Jan 5 21:52:38 2013 New Revision: 245074 URL: http://svnweb.freebsd.org/changeset/base/245074 Log: Use tabs for indentation. MFC after: 2 weeks Modified: head/sbin/geom/class/journal/geom_journal_ufs.c Modified: head/sbin/geom/class/journal/geom_journal_ufs.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:52:01 2013 (r245073) +++ head/sbin/geom/class/journal/geom_journal_ufs.c Sat Jan 5 21:52:38 2013 (r245074) @@ -70,9 +70,9 @@ g_journal_ufs_using_last_sector(const ch fs = read_superblock(prov); if (fs == NULL) return (0); - /* Provider size in 512 bytes blocks. */ - psize = g_get_mediasize(prov) / DEV_BSIZE; - /* File system size in 512 bytes blocks. */ - fssize = fsbtodb(fs, fs->fs_size); - return (psize <= fssize); + /* Provider size in 512 bytes blocks. */ + psize = g_get_mediasize(prov) / DEV_BSIZE; + /* File system size in 512 bytes blocks. */ + fssize = fsbtodb(fs, fs->fs_size); + return (psize <= fssize); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 22:04:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DC938925; Sat, 5 Jan 2013 22:04:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDC7E843; Sat, 5 Jan 2013 22:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05M4en0080199; Sat, 5 Jan 2013 22:04:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05M4euk080198; Sat, 5 Jan 2013 22:04:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201301052204.r05M4euk080198@svn.freebsd.org> From: Mark Johnston Date: Sat, 5 Jan 2013 22:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245075 - head/usr.bin/grep/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 22:04:40 -0000 Author: markj Date: Sat Jan 5 22:04:40 2013 New Revision: 245075 URL: http://svnweb.freebsd.org/changeset/base/245075 Log: Fix a segfault when bsdgrep -i is given an empty pattern string. PR: bin/172865 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week Modified: head/usr.bin/grep/regex/tre-fastmatch.c Modified: head/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- head/usr.bin/grep/regex/tre-fastmatch.c Sat Jan 5 21:52:38 2013 (r245074) +++ head/usr.bin/grep/regex/tre-fastmatch.c Sat Jan 5 22:04:40 2013 (r245075) @@ -468,7 +468,7 @@ static int fastcmp(const fastmatch_t *fg fg->nosub = (cflags & REG_NOSUB); \ \ /* Cannot handle REG_ICASE with MB string */ \ - if (fg->icase && (TRE_MB_CUR_MAX > 1)) \ + if (fg->icase && (TRE_MB_CUR_MAX > 1) && n > 0) \ { \ DPRINT(("Cannot use fast matcher for MBS with REG_ICASE\n")); \ return REG_BADPAT; \ From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 23:08:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 486BA601; Sat, 5 Jan 2013 23:08:11 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 227569C0; Sat, 5 Jan 2013 23:08:11 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05N8AF2098837; Sat, 5 Jan 2013 23:08:10 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05N8ABK098835; Sat, 5 Jan 2013 23:08:10 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301052308.r05N8ABK098835@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 5 Jan 2013 23:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245079 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 23:08:11 -0000 Author: gonzo Date: Sat Jan 5 23:08:10 2013 New Revision: 245079 URL: http://svnweb.freebsd.org/changeset/base/245079 Log: Add hw.board.serial and hw.board.revision for exporting board-specific info Modified: head/sys/arm/arm/machdep.c head/sys/arm/include/machdep.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Jan 5 22:56:16 2013 (r245078) +++ head/sys/arm/arm/machdep.c Sat Jan 5 23:08:10 2013 (r245079) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -162,8 +163,6 @@ const struct pmap_devmap *pmap_devmap_bo uint32_t board_id; struct arm_lbabi_tag *atag_list; -uint32_t revision; -uint64_t serial; char linux_command_line[LBABI_MAX_COMMAND_LINE + 1]; char atags[LBABI_MAX_COMMAND_LINE * 2]; uint32_t memstart[LBABI_MAX_BANKS]; @@ -171,6 +170,31 @@ uint32_t memsize[LBABI_MAX_BANKS]; uint32_t membanks; #endif +static uint32_t board_revision; +/* hex representation of uint64_t */ +static char board_serial[32]; + +SYSCTL_NODE(_hw, OID_AUTO, board, CTLFLAG_RD, 0, "Board attributes"); +SYSCTL_UINT(_hw_board, OID_AUTO, revision, CTLFLAG_RD, + &board_revision, 0, "Board revision"); +SYSCTL_STRING(_hw_board, OID_AUTO, serial, CTLFLAG_RD, + board_serial, 0, "Board serial"); + +void +board_set_serial(uint64_t serial) +{ + + snprintf(board_serial, sizeof(board_serial)-1, + "%016jx", serial); +} + +void +board_set_revision(uint32_t revision) +{ + + board_revision = revision; +} + void sendsig(catcher, ksi, mask) sig_t catcher; @@ -849,6 +873,8 @@ vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp) { struct arm_lbabi_tag *walker; + uint32_t revision; + uint64_t serial; /* * Linux boot ABI: r0 = 0, r1 is the board type (!= 0) and r2 @@ -883,9 +909,11 @@ linux_parse_boot_param(struct arm_boot_p case ATAG_SERIAL: serial = walker->u.tag_sn.low | ((uint64_t)walker->u.tag_sn.high << 32); + board_set_serial(serial); break; case ATAG_REVISION: revision = walker->u.tag_rev.rev; + board_set_revision(revision); break; case ATAG_CMDLINE: /* XXX open question: Parse this for boothowto? */ Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Jan 5 22:56:16 2013 (r245078) +++ head/sys/arm/include/machdep.h Sat Jan 5 23:08:10 2013 (r245079) @@ -37,6 +37,10 @@ void initarm_gpio_init(void); void initarm_late_init(void); int platform_devmap_init(void); +/* Board-specific attributes */ +void board_set_serial(uint64_t); +void board_set_revision(uint32_t); + /* Needs to be initialised by platform_devmap_init */ extern const struct pmap_devmap *pmap_devmap_bootstrap_table; From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 23:08:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D5F2377C; Sat, 5 Jan 2013 23:08:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7BD09D8; Sat, 5 Jan 2013 23:08:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r05N8wwM098989; Sat, 5 Jan 2013 23:08:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r05N8wIg098988; Sat, 5 Jan 2013 23:08:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301052308.r05N8wIg098988@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 5 Jan 2013 23:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245080 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 23:08:58 -0000 Author: gonzo Date: Sat Jan 5 23:08:58 2013 New Revision: 245080 URL: http://svnweb.freebsd.org/changeset/base/245080 Log: Export board serial and board revision obtained from FDT blob Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Jan 5 23:08:10 2013 (r245079) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Jan 5 23:08:58 2013 (r245080) @@ -78,6 +78,25 @@ initarm_gpio_init(void) void initarm_late_init(void) { + phandle_t system; + pcell_t cells[2]; + int len; + + /* + * It seems there is no way to let syscons framework know + * that framebuffer resolution has changed. So just try + * to fetch data from FDT and go with defaults if failed + */ + system = OF_finddevice("/system"); + if (system != 0) { + len = OF_getprop(system, "linux,serial", &cells, sizeof(cells)); + if (len > 0) + board_set_serial(fdt64_to_cpu(*((uint64_t *)cells))); + + len = OF_getprop(system, "linux,revision", &cells, sizeof(cells)); + if (len > 0) + board_set_revision(fdt32_to_cpu(*((uint32_t *)cells))); + } } #define FDT_DEVMAP_MAX (2) // FIXME From owner-svn-src-head@FreeBSD.ORG Sat Jan 5 23:54:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF8E3CCE for ; Sat, 5 Jan 2013 23:54:14 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx1.freebsd.org (Postfix) with ESMTP id 4E77CA99 for ; Sat, 5 Jan 2013 23:54:13 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ej20so12276391lab.35 for ; Sat, 05 Jan 2013 15:54:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:disposition-notification-to:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :openpgp:content-type:content-transfer-encoding:x-gm-message-state; bh=JW5vGkFnSzqu2a58iF6mXcVvnta2xy5FhtdrV+6tr3o=; b=JC7nLXy1GGECbhWW50r/Djx0VEcdZjovvb7ehdugk+aIBkNwXHOIrx61RYtxHFu+U3 pFxTudYNhrhOehRrVvD1+z0ePf/FTnkdv3omdxoflwlJPMxr0kmJG+MReubrems0d6lD fw4ZucwwIPjndSLvKxQxjZrdKrbM4+ajan1KZKU45QE7wxhp2plkcBfSpHRMNz9tpzgH erIRPCu9/LIvTjyF6oIJLpUPMcYY0QTfy2nfKtDQdKUDS0cFZI/7lqmVmwUlHZ2TyYV+ 0utRN1qyU9yQIDW/AGgOzf3nFXhMykRRAr9v1OkF1nJwCUIPUbmm9QGvXHOsl8eOjzEG +oyg== X-Received: by 10.112.88.7 with SMTP id bc7mr23476639lbb.108.1357430046681; Sat, 05 Jan 2013 15:54:06 -0800 (PST) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPS id fj2sm19274601lbb.6.2013.01.05.15.54.05 (version=SSLv3 cipher=OTHER); Sat, 05 Jan 2013 15:54:06 -0800 (PST) Message-ID: <50E8BD1D.7030209@freebsd.org> Date: Sun, 06 Jan 2013 03:54:05 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gabor Kovesdan Subject: Re: svn commit: r245057 - head/usr.bin/grep References: <201301051452.r05EqWHt051825@svn.freebsd.org> In-Reply-To: <201301051452.r05EqWHt051825@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmXf5HwA30KdOrXScS0JPCp5ZhuNa7M5G3ll/fH50aqG6hMfuq/UKExL5uEyMOdkPIrjGqs Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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, 05 Jan 2013 23:54:14 -0000 Thanks. I think the fix below can be improved further, because strdup(3) is unneeded here and can be omitted. We don't have either constant argument nor want to preserve it. On 05.01.2013 18:52, Gabor Kovesdan wrote: > case 'e': > - add_pattern(optarg, strlen(optarg)); > + { > + char *token; > + char *string = strdup(optarg); > + > + while ((token = strsep(&string, "\n")) != NULL) > + add_pattern(token, strlen(token)); > + } > needpattern = 0; > break; > case 'F': > @@ -668,7 +674,11 @@ main(int argc, char *argv[]) > > /* Process patterns from command line */ > if (aargc != 0 && needpattern) { > - add_pattern(*aargv, strlen(*aargv)); > + char *token; > + char *string = strdup(*aargv); > + > + while ((token = strsep(&string, "\n")) != NULL) > + add_pattern(token, strlen(token)); > --aargc; > ++aargv; > } >