From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 02:57:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941A21065670; Sun, 14 Dec 2008 02:57:41 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80EDB8FC1B; Sun, 14 Dec 2008 02:57:41 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBE2vfdv047247; Sun, 14 Dec 2008 02:57:41 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBE2vfVr047246; Sun, 14 Dec 2008 02:57:41 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200812140257.mBE2vfVr047246@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 14 Dec 2008 02:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186073 - head/sys/boot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 02:57:41 -0000 Author: nyan Date: Sun Dec 14 02:57:41 2008 New Revision: 186073 URL: http://svn.freebsd.org/changeset/base/186073 Log: Disconnect the efi from pc98. It's not needed. Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Sun Dec 14 02:51:17 2008 (r186072) +++ head/sys/boot/Makefile Sun Dec 14 02:57:41 2008 (r186073) @@ -12,7 +12,7 @@ SUBDIR+= ficl .endif # Build EFI library. -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64" SUBDIR+= efi .endif From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 06:40:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23AF51065670; Sun, 14 Dec 2008 06:40:05 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1280C8FC08; Sun, 14 Dec 2008 06:40:05 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBE6e55l051610; Sun, 14 Dec 2008 06:40:05 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBE6e4kA051604; Sun, 14 Dec 2008 06:40:04 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200812140640.mBE6e4kA051604@svn.freebsd.org> From: Ken Smith Date: Sun, 14 Dec 2008 06:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186075 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 06:40:05 -0000 Author: kensmith Date: Sun Dec 14 06:40:04 2008 New Revision: 186075 URL: http://svn.freebsd.org/changeset/base/186075 Log: Clean out the remaining alpha-isms. Modified: head/usr.sbin/sysinstall/cdrom.c head/usr.sbin/sysinstall/label.c head/usr.sbin/sysinstall/main.c head/usr.sbin/sysinstall/sysinstall.8 head/usr.sbin/sysinstall/sysinstall.h head/usr.sbin/sysinstall/system.c Modified: head/usr.sbin/sysinstall/cdrom.c ============================================================================== --- head/usr.sbin/sysinstall/cdrom.c Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/cdrom.c Sun Dec 14 06:40:04 2008 (r186075) @@ -164,9 +164,7 @@ mediaInitCDROM(Device *dev) } if ((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) { if (strcmp(cp, "any") && -#ifdef __alpha__ - strcmp(cp, "alpha")) { -#elif defined(PC98) +#if defined(PC98) strcmp(cp, "pc98")) { #elif defined(__sparc64__) strcmp(cp, "sparc64")) { Modified: head/usr.sbin/sysinstall/label.c ============================================================================== --- head/usr.sbin/sysinstall/label.c Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/label.c Sun Dec 14 06:40:04 2008 (r186075) @@ -61,7 +61,7 @@ /* * Minimum partition sizes */ -#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) || defined(__amd64__) +#if defined(__ia64__) || defined(__sparc64__) || defined(__amd64__) #define ROOT_MIN_SIZE 128 #else #define ROOT_MIN_SIZE 118 @@ -1094,27 +1094,6 @@ diskLabel(Device *dev) break; } -#ifdef __alpha__ - /* - * SRM requires that the root partition is at the - * begining of the disk and cannot boot otherwise. - * Warn Alpha users if they are about to shoot themselves in - * the foot in this way. - * - * Since partitions may not start precisely at offset 0 we - * check for a "close to 0" instead. :-( - */ - if ((flags & CHUNK_IS_ROOT) && (tmp->offset > 1024)) { - msgConfirm("Your root partition `a' does not seem to be the first\n" - "partition. The Alpha's firmware can only boot from the\n" - "first partition. So it is unlikely that your current\n" - "disk layout will be bootable boot after installation.\n" - "\n" - "Please allocate the root partition before allocating\n" - "any others.\n"); - } -#endif /* alpha */ - tmp->private_data = p; tmp->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) Modified: head/usr.sbin/sysinstall/main.c ============================================================================== --- head/usr.sbin/sysinstall/main.c Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/main.c Sun Dec 14 06:40:04 2008 (r186075) @@ -198,7 +198,7 @@ main(int argc, char **argv) choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 -#if defined(__alpha__) || defined(__sparc64__) +#if defined(__sparc64__) || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/sysinstall.8 Sun Dec 14 06:40:04 2008 (r186075) @@ -878,9 +878,9 @@ This property is normally only used with .Fx products that contain CDs for different architectures, to provide better error messages if -users try to install Alpha packages on an i386 machine. +users try to install packages built for the wrong architecture. For example, -.Dq Li "CD_MACHINE_ARCH = alpha" . +.Dq Li "CD_MACHINE_ARCH = amd64" . .It Va CD_VOLUME In a multi-volume collection (such as the .Fx Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/sysinstall.h Sun Dec 14 06:40:04 2008 (r186075) @@ -52,7 +52,7 @@ /*** Defines ***/ -#if defined(__i386__) || defined(__alpha__) || defined(__amd64__) +#if defined(__i386__) || defined(__amd64__) #define WITH_SYSCONS #define WITH_MICE #endif Modified: head/usr.sbin/sysinstall/system.c ============================================================================== --- head/usr.sbin/sysinstall/system.c Sun Dec 14 02:59:07 2008 (r186074) +++ head/usr.sbin/sysinstall/system.c Sun Dec 14 06:40:04 2008 (r186075) @@ -190,10 +190,6 @@ systemInitialize(int argc, char **argv) setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1); setbuf(stdin, 0); setbuf(stderr, 0); -#ifdef __alpha__ - i = 0; - sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); -#endif #if 0 signal(SIGCHLD, reap_children); #endif @@ -261,7 +257,7 @@ systemShutdown(int status) if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); -#if defined(__alpha__) || defined(__sparc64__) +#if defined(__sparc64__) reboot(RB_HALT); #else reboot(RB_AUTOBOOT); From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 09:06:28 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D771065670; Sun, 14 Dec 2008 09:06:28 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C73AF8FC12; Sun, 14 Dec 2008 09:06:28 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBE96Sww054273; Sun, 14 Dec 2008 09:06:28 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBE96SEZ054272; Sun, 14 Dec 2008 09:06:28 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200812140906.mBE96SEZ054272@svn.freebsd.org> From: Joseph Koshy Date: Sun, 14 Dec 2008 09:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186076 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 09:06:28 -0000 Author: jkoshy Date: Sun Dec 14 09:06:28 2008 New Revision: 186076 URL: http://svn.freebsd.org/changeset/base/186076 Log: Bug fix: %ebx needs to be preserved in the user callchain capture path. Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sun Dec 14 06:40:04 2008 (r186075) +++ head/sys/amd64/amd64/exception.S Sun Dec 14 09:06:28 2008 (r186076) @@ -459,9 +459,9 @@ nmi_calltrap: */ movq %rsp,%rsi /* source stack pointer */ movq $TF_SIZE,%rcx - movq PCPU(RSP0),%rbx - subq %rcx,%rbx - movq %rbx,%rdi /* destination stack pointer */ + movq PCPU(RSP0),%rdx + subq %rcx,%rdx + movq %rdx,%rdi /* destination stack pointer */ shrq $3,%rcx /* trap frame size in long words */ cld @@ -470,7 +470,7 @@ nmi_calltrap: movl %ss,%eax pushq %rax /* tf_ss */ - pushq %rbx /* tf_rsp (on kernel stack) */ + pushq %rdx /* tf_rsp (on kernel stack) */ pushfq /* tf_rflags */ movl %cs,%eax pushq %rax /* tf_cs */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 09:08:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A41A8106564A; Sun, 14 Dec 2008 09:08:10 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by mx1.freebsd.org (Postfix) with ESMTP id 636A08FC1A; Sun, 14 Dec 2008 09:08:10 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2237508rvf.43 for ; Sun, 14 Dec 2008 01:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=IIg5u38gBtlXLSbDqOs0Bqi2bTkurSu7sNJHUS2P6ZI=; b=A+ZHjMzFZbmVH/AMif+Cdh88hAanIGNdN14b/wzOQckb/DceUYpZflzaFXmds+/QDo l0l9buB9Yd5k4ebwWEIG4LHeGTgfdYJfl1X/KPscrMdehlZoVKP41J9I+GIsTZLtiroi pCLBRvSISexhCJv626A2HsQ6lX1GurnKfFOhw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=jLnX6TXjN2H5Ci9MDQ4jug3PnS8IBz52YDICPub+BNka8jhLZqH/13TmxfrjRutjr3 nHio2erhVbTmyzk8TQFQ7EPjXwr4GEskH5BzOC8kHneZHgULF7xToxteNDPlJg3JrY+9 7EIVD2ZEgQwV++SBsXE8Uo9Og5bY/N4Gm3vdA= Received: by 10.140.188.10 with SMTP id l10mr2980094rvf.94.1229245690197; Sun, 14 Dec 2008 01:08:10 -0800 (PST) Received: by 10.140.158.13 with HTTP; Sun, 14 Dec 2008 01:08:10 -0800 (PST) Message-ID: <7d6fde3d0812140108l4b0c75e1o229c667c0b86dd7e@mail.gmail.com> Date: Sun, 14 Dec 2008 01:08:10 -0800 From: "Garrett Cooper" To: "Joseph Koshy" In-Reply-To: <200812140906.mBE96SEZ054272@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812140906.mBE96SEZ054272@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186076 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 09:08:10 -0000 On Sun, Dec 14, 2008 at 1:06 AM, Joseph Koshy wrote: > Author: jkoshy > Date: Sun Dec 14 09:06:28 2008 > New Revision: 186076 > URL: http://svn.freebsd.org/changeset/base/186076 > > Log: > Bug fix: %ebx needs to be preserved in the user callchain capture > path. > > Modified: > head/sys/amd64/amd64/exception.S > > Modified: head/sys/amd64/amd64/exception.S > ============================================================================== > --- head/sys/amd64/amd64/exception.S Sun Dec 14 06:40:04 2008 (r186075) > +++ head/sys/amd64/amd64/exception.S Sun Dec 14 09:06:28 2008 (r186076) > @@ -459,9 +459,9 @@ nmi_calltrap: > */ > movq %rsp,%rsi /* source stack pointer */ > movq $TF_SIZE,%rcx > - movq PCPU(RSP0),%rbx > - subq %rcx,%rbx > - movq %rbx,%rdi /* destination stack pointer */ > + movq PCPU(RSP0),%rdx > + subq %rcx,%rdx > + movq %rdx,%rdi /* destination stack pointer */ > > shrq $3,%rcx /* trap frame size in long words */ > cld > @@ -470,7 +470,7 @@ nmi_calltrap: > > movl %ss,%eax > pushq %rax /* tf_ss */ > - pushq %rbx /* tf_rsp (on kernel stack) */ > + pushq %rdx /* tf_rsp (on kernel stack) */ > pushfq /* tf_rflags */ > movl %cs,%eax > pushq %rax /* tf_cs */ Stupid question -- where's the change? All I see are potentially whitespace modifications.. -Garrett From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 09:32:34 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF621065670; Sun, 14 Dec 2008 09:32:34 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB268FC08; Sun, 14 Dec 2008 09:32:33 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2241747rvf.43 for ; Sun, 14 Dec 2008 01:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BXyVz2p5yWurasHVY0pZi8hhlyKXtCaIxRD/SZeYiNE=; b=AI1kLsATa5mfoKG5XTar/aquFDxF3hHuaU3N+pNC27ZWU24IS2eJ7OOF2P2LF4XL1E 1DNoDKU3eqs9wO0NzQACby9HFAZSMpG7tRcpD9hyL1poraiuNJPP66o2MydtaDBhYHcu N7YhtXa8MOv65jSpioRXEqATVjgHLsgykwOvk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=G8amJe4C+rnFFxCUUPvEnsHkZPoYWA1DG/HOr3xiTOR68nLlR/BUHNzqLJw7wWnlvp JIiUyBXynTJaQ2hHM2u4uY1mbnEA9RBI/Q+W6+jJEt4bd0vBU0OHgzJ/q9rvUklp7OO2 PjtKMNPiUGTNzPXqtwRjKCY8xNyt5mE2RvSs8= Received: by 10.141.177.10 with SMTP id e10mr2980210rvp.137.1229247153752; Sun, 14 Dec 2008 01:32:33 -0800 (PST) Received: by 10.140.158.13 with HTTP; Sun, 14 Dec 2008 01:32:33 -0800 (PST) Message-ID: <7d6fde3d0812140132u54d9785chb81f96aa3e10d204@mail.gmail.com> Date: Sun, 14 Dec 2008 01:32:33 -0800 From: "Garrett Cooper" To: "Niclas Zeising" In-Reply-To: <4944D17E.9080900@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812140906.mBE96SEZ054272@svn.freebsd.org> <7d6fde3d0812140108l4b0c75e1o229c667c0b86dd7e@mail.gmail.com> <4944D17E.9080900@gmail.com> Cc: svn-src-head@freebsd.org, Joseph Koshy , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186076 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 09:32:34 -0000 On Sun, Dec 14, 2008 at 1:27 AM, Niclas Zeising wrote: > Garrett Cooper wrote: >> >> On Sun, Dec 14, 2008 at 1:06 AM, Joseph Koshy wrote: >>> >>> Author: jkoshy >>> Date: Sun Dec 14 09:06:28 2008 >>> New Revision: 186076 >>> URL: http://svn.freebsd.org/changeset/base/186076 >>> >>> Log: >>> Bug fix: %ebx needs to be preserved in the user callchain capture >>> path. >>> >>> Modified: >>> head/sys/amd64/amd64/exception.S >>> >>> Modified: head/sys/amd64/amd64/exception.S >>> >>> ============================================================================== >>> --- head/sys/amd64/amd64/exception.S Sun Dec 14 06:40:04 2008 >>> (r186075) >>> +++ head/sys/amd64/amd64/exception.S Sun Dec 14 09:06:28 2008 >>> (r186076) >>> @@ -459,9 +459,9 @@ nmi_calltrap: >>> */ >>> movq %rsp,%rsi /* source stack pointer */ >>> movq $TF_SIZE,%rcx >>> - movq PCPU(RSP0),%rbx >>> - subq %rcx,%rbx >>> - movq %rbx,%rdi /* destination stack pointer */ >>> + movq PCPU(RSP0),%rdx >>> + subq %rcx,%rdx >>> + movq %rdx,%rdi /* destination stack pointer */ >>> >>> shrq $3,%rcx /* trap frame size in long words */ >>> cld >>> @@ -470,7 +470,7 @@ nmi_calltrap: >>> >>> movl %ss,%eax >>> pushq %rax /* tf_ss */ >>> - pushq %rbx /* tf_rsp (on kernel stack) */ >>> + pushq %rdx /* tf_rsp (on kernel stack) */ > > ^^^^^^ >>> >>> pushfq /* tf_rflags */ >>> movl %cs,%eax >>> pushq %rax /* tf_cs */ >> >> Stupid question -- where's the change? All I see are potentially >> whitespace modifications.. >> -Garrett > > %rbx is changed to a %rdx in some places, I hilighted one. > Regards! > //Niclas Yeah, I know. I'm just blind as a bat ><. -Garrett From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 09:55:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B2E106564A; Sun, 14 Dec 2008 09:55:13 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf2.bahnhof.se (mxf2.bahnhof.se [213.80.101.26]) by mx1.freebsd.org (Postfix) with ESMTP id 52CE48FC0C; Sun, 14 Dec 2008 09:55:13 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mxf2.local [127.0.0.1]) by mxf2-reinject (Postfix) with ESMTP id 415626BD072; Sun, 14 Dec 2008 10:27:27 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 2.777 X-Spam-Level: ** X-Spam-Status: No, score=2.777 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708, SPF_NEUTRAL=1.069] Received: from mxf2.bahnhof.se ([127.0.0.1]) by localhost (mxf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kvvUZK2Acp7X; Sun, 14 Dec 2008 10:27:26 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mxf2.bahnhof.se (Postfix) with ESMTP id 28DC46BD035; Sun, 14 Dec 2008 10:27:26 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.176 [270.9.17/1847]); Sun, 14 Dec 2008 10:27:26 +0100 Message-ID: <4944D17E.9080900@gmail.com> Date: Sun, 14 Dec 2008 10:27:26 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Garrett Cooper References: <200812140906.mBE96SEZ054272@svn.freebsd.org> <7d6fde3d0812140108l4b0c75e1o229c667c0b86dd7e@mail.gmail.com> In-Reply-To: <7d6fde3d0812140108l4b0c75e1o229c667c0b86dd7e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Joseph Koshy , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186076 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 09:55:13 -0000 Garrett Cooper wrote: > On Sun, Dec 14, 2008 at 1:06 AM, Joseph Koshy wrote: >> Author: jkoshy >> Date: Sun Dec 14 09:06:28 2008 >> New Revision: 186076 >> URL: http://svn.freebsd.org/changeset/base/186076 >> >> Log: >> Bug fix: %ebx needs to be preserved in the user callchain capture >> path. >> >> Modified: >> head/sys/amd64/amd64/exception.S >> >> Modified: head/sys/amd64/amd64/exception.S >> ============================================================================== >> --- head/sys/amd64/amd64/exception.S Sun Dec 14 06:40:04 2008 (r186075) >> +++ head/sys/amd64/amd64/exception.S Sun Dec 14 09:06:28 2008 (r186076) >> @@ -459,9 +459,9 @@ nmi_calltrap: >> */ >> movq %rsp,%rsi /* source stack pointer */ >> movq $TF_SIZE,%rcx >> - movq PCPU(RSP0),%rbx >> - subq %rcx,%rbx >> - movq %rbx,%rdi /* destination stack pointer */ >> + movq PCPU(RSP0),%rdx >> + subq %rcx,%rdx >> + movq %rdx,%rdi /* destination stack pointer */ >> >> shrq $3,%rcx /* trap frame size in long words */ >> cld >> @@ -470,7 +470,7 @@ nmi_calltrap: >> >> movl %ss,%eax >> pushq %rax /* tf_ss */ >> - pushq %rbx /* tf_rsp (on kernel stack) */ >> + pushq %rdx /* tf_rsp (on kernel stack) */ ^^^^^^ >> pushfq /* tf_rflags */ >> movl %cs,%eax >> pushq %rax /* tf_cs */ > > Stupid question -- where's the change? All I see are potentially > whitespace modifications.. > -Garrett %rbx is changed to a %rdx in some places, I hilighted one. Regards! //Niclas From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 11:47:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E7E106564A; Sun, 14 Dec 2008 11:47:39 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6D8A8FC19; Sun, 14 Dec 2008 11:47:39 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEBldDx058139; Sun, 14 Dec 2008 11:47:39 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEBldRL058138; Sun, 14 Dec 2008 11:47:39 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812141147.mBEBldRL058138@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 14 Dec 2008 11:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186077 - head/sbin/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 11:47:39 -0000 Author: phk Date: Sun Dec 14 11:47:39 2008 New Revision: 186077 URL: http://svn.freebsd.org/changeset/base/186077 Log: Clarify that configuration files must be named '*.conf' Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Sun Dec 14 09:06:28 2008 (r186076) +++ head/sbin/devd/devd.conf.5 Sun Dec 14 11:47:39 2008 (r186077) @@ -110,7 +110,7 @@ statement. .It Ic directory Qq Ar /some/path ; Adds the given directory to the list of directories from which .Xr devd 8 -will read +will read all files named "*.conf" as further configuration files. Any number of .Ic directory From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 11:48:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F21CE106564A; Sun, 14 Dec 2008 11:48:51 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21D18FC0C; Sun, 14 Dec 2008 11:48:51 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEBmpS8058203; Sun, 14 Dec 2008 11:48:51 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEBmpf3058202; Sun, 14 Dec 2008 11:48:51 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812141148.mBEBmpf3058202@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 14 Dec 2008 11:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186078 - head/sbin/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 11:48:52 -0000 Author: phk Date: Sun Dec 14 11:48:51 2008 New Revision: 186078 URL: http://svn.freebsd.org/changeset/base/186078 Log: Send all debug to stderr. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Sun Dec 14 11:47:39 2008 (r186077) +++ head/sbin/devd/devd.cc Sun Dec 14 11:48:51 2008 (r186078) @@ -307,7 +307,7 @@ void config::parse_one_file(const char *fn) { if (Dflag) - printf("Parsing %s\n", fn); + fprintf(stderr, "Parsing %s\n", fn); yyin = fopen(fn, "r"); if (yyin == NULL) err(1, "Cannot open config file %s", fn); @@ -325,7 +325,7 @@ config::parse_files_in_dir(const char *d char path[PATH_MAX]; if (Dflag) - printf("Parsing files in %s\n", dirname); + fprintf(stderr, "Parsing files in %s\n", dirname); dirp = opendir(dirname); if (dirp == NULL) return; From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 12:56:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 325151065670; Sun, 14 Dec 2008 12:56:57 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21BAD8FC0C; Sun, 14 Dec 2008 12:56:57 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBECuuNC059474; Sun, 14 Dec 2008 12:56:56 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBECuu0E059473; Sun, 14 Dec 2008 12:56:56 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812141256.mBECuu0E059473@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 14 Dec 2008 12:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186079 - head/sbin/atacontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 12:56:57 -0000 Author: ru Date: Sun Dec 14 12:56:56 2008 New Revision: 186079 URL: http://svn.freebsd.org/changeset/base/186079 Log: Fix the fallouts from r146267: - Add the forgotten "mode" argument to the "mode" command. - Move the description of "info" to where it belongs. Modified: head/sbin/atacontrol/atacontrol.8 Modified: head/sbin/atacontrol/atacontrol.8 ============================================================================== --- head/sbin/atacontrol/atacontrol.8 Sun Dec 14 11:48:51 2008 (r186078) +++ head/sbin/atacontrol/atacontrol.8 Sun Dec 14 12:56:56 2008 (r186079) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2008 +.Dd December 14, 2008 .Dt ATACONTROL 8 .Os .Sh NAME @@ -63,6 +63,7 @@ .Nm .Ic mode .Ar device +.Op Ar mode .Nm .Ic info .Ar channel @@ -94,7 +95,7 @@ The .Ar channel argument is the ATA channel device (e.g., ata0) on which to operate. The following commands are supported: -.Bl -tag -width "rebuild" +.Bl -tag -width ".Ic addspare" .It Ic attach Attach an ATA .Ar channel . @@ -162,9 +163,13 @@ Rebuild a RAID1 array on a RAID capable .It Ic status Get the status of an ATA RAID. .It Ic mode -Without the mode argument, the current transfer modes of the +Without the +.Ar mode +argument, the current transfer mode of the device are printed. -If the mode argument is given, the ATA driver +If the +.Ar mode +argument is given, the ATA driver is asked to change the transfer mode to the one given. The ATA driver will reject modes that are not supported by the hardware. @@ -190,13 +195,12 @@ and .Cm UDMA6 (alias .Cm UDMA133 ) . -The device name and manufacture/version strings are shown. .It Ic cap Show detailed info about the device on .Ar device . .It Ic spindown Set or report timeout after which the -.Ar device +.Ar device will be spun down. To arm the timeout the device needs at least one more request after setting the timeout. @@ -205,6 +209,7 @@ No further actions are needed in this ca .It Ic info Show info about the attached devices on the .Ar channel . +The device name and manufacture/version strings are shown. .It Ic list Show info about all attached devices on all active controllers. .El @@ -312,7 +317,7 @@ If the system has a pure software array RAID controller, then shut the system down, make sure that the disk that was still working is moved to the bootable position (channel 0 or whatever the BIOS allows the system to boot from) and the blank disk -is placed in the secondary position, then boot the system into +is placed in the secondary position, then boot the system into single-user mode and issue the command: .Pp .Dl "atacontrol addspare ar0 ad6" From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:41:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FEA31065675; Sun, 14 Dec 2008 15:41:16 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 655558FC24; Sun, 14 Dec 2008 15:41:16 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEFfG3J062566; Sun, 14 Dec 2008 15:41:16 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEFfGJL062565; Sun, 14 Dec 2008 15:41:16 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141541.mBEFfGJL062565@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 15:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186080 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 15:41:16 -0000 Author: ume Date: Sun Dec 14 15:41:14 2008 New Revision: 186080 URL: http://svn.freebsd.org/changeset/base/186080 Log: Open vendor/resolver Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Sun Dec 14 12:56:56 2008 (r186079) +++ svnadmin/conf/paths Sun Dec 14 15:41:14 2008 (r186080) @@ -53,6 +53,7 @@ ^vendor/openbsm ^vendor/openpam ^vendor/pf +^vendor/resolver ^vendor/sendmail ^vendor/tcsh ^vendor/top From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 15:43:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3EC31065678; Sun, 14 Dec 2008 15:43:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03678FC19; Sun, 14 Dec 2008 15:43:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEFh01U062628; Sun, 14 Dec 2008 15:43:00 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEFh0vu062627; Sun, 14 Dec 2008 15:43:00 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141543.mBEFh0vu062627@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186081 - in vendor/resolver/dist: include include/arpa lib/libc/include lib/libc/include/isc lib/libc/inet lib/libc/isc lib/libc/nameser lib/libc/resolv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 15:43:00 -0000 Author: ume Date: Sun Dec 14 15:43:00 2008 New Revision: 186081 URL: http://svn.freebsd.org/changeset/base/186081 Log: Cleaning up Modified: vendor/resolver/dist/include/arpa/inet.h (props changed) vendor/resolver/dist/include/arpa/nameser.h (props changed) vendor/resolver/dist/include/arpa/nameser_compat.h (props changed) vendor/resolver/dist/include/res_update.h (props changed) vendor/resolver/dist/include/resolv.h (props changed) vendor/resolver/dist/lib/libc/include/isc/eventlib.h (props changed) vendor/resolver/dist/lib/libc/include/isc/list.h (props changed) vendor/resolver/dist/lib/libc/include/resolv_mt.h (props changed) vendor/resolver/dist/lib/libc/inet/inet_addr.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_cidr_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_cidr_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_lnaof.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_makeaddr.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_net_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_net_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_neta.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_netof.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_network.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_ntoa.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/nsap_addr.c (props changed) vendor/resolver/dist/lib/libc/isc/ev_streams.c (props changed) vendor/resolver/dist/lib/libc/isc/ev_timers.c (props changed) vendor/resolver/dist/lib/libc/isc/eventlib_p.h (props changed) vendor/resolver/dist/lib/libc/nameser/ns_name.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_netint.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_parse.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_print.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_samedomain.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_ttl.c (props changed) vendor/resolver/dist/lib/libc/resolv/herror.c (props changed) vendor/resolver/dist/lib/libc/resolv/mtctxres.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_comp.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_data.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_debug.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_debug.h (props changed) vendor/resolver/dist/lib/libc/resolv/res_findzonecut.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_init.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_mkquery.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_mkupdate.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_private.h (props changed) vendor/resolver/dist/lib/libc/resolv/res_query.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_send.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_update.c (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:09:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90DEF106564A; Sun, 14 Dec 2008 16:09:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65D898FC17; Sun, 14 Dec 2008 16:09:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEG9rMi063249; Sun, 14 Dec 2008 16:09:53 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEG9rDr063248; Sun, 14 Dec 2008 16:09:53 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141609.mBEG9rDr063248@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186082 - in head: . tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:09:53 -0000 Author: ume Date: Sun Dec 14 16:09:53 2008 New Revision: 186082 URL: http://svn.freebsd.org/changeset/base/186082 Log: Bootstrapping merge history for resolver. Modified: head/tools/regression/bin/sh/builtins/type1.0.stderr (props changed) Changes in other areas also in this revision: Modified: head/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:09:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA7CA1065676; Sun, 14 Dec 2008 16:09:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903DE8FC18; Sun, 14 Dec 2008 16:09:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEG9rD0063254; Sun, 14 Dec 2008 16:09:53 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEG9rMF063253; Sun, 14 Dec 2008 16:09:53 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141609.mBEG9rMF063253@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org X-SVN-Group: defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186082 - in head: . tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:09:53 -0000 Author: ume Date: Sun Dec 14 16:09:53 2008 New Revision: 186082 URL: http://svn.freebsd.org/changeset/base/186082 Log: Bootstrapping merge history for resolver. Modified: head/ (props changed) Changes in other areas also in this revision: Modified: head/tools/regression/bin/sh/builtins/type1.0.stderr (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:47:22 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 143291065670; Sun, 14 Dec 2008 16:47:22 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B878FC19; Sun, 14 Dec 2008 16:47:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEGlLxn063978; Sun, 14 Dec 2008 16:47:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEGlLEa063969; Sun, 14 Dec 2008 16:47:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141647.mBEGlLEa063969@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186083 - in vendor/resolver/dist: include include/arpa lib/libc/include/isc lib/libc/inet lib/libc/resolv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:47:22 -0000 Author: ume Date: Sun Dec 14 16:47:21 2008 New Revision: 186083 URL: http://svn.freebsd.org/changeset/base/186083 Log: Import the resolver part of BIND 9.4.3. Modified: vendor/resolver/dist/include/arpa/nameser.h vendor/resolver/dist/include/resolv.h vendor/resolver/dist/lib/libc/include/isc/eventlib.h vendor/resolver/dist/lib/libc/inet/inet_net_pton.c vendor/resolver/dist/lib/libc/inet/inet_network.c vendor/resolver/dist/lib/libc/resolv/res_debug.c vendor/resolver/dist/lib/libc/resolv/res_mkquery.c vendor/resolver/dist/lib/libc/resolv/res_query.c vendor/resolver/dist/lib/libc/resolv/res_send.c Modified: vendor/resolver/dist/include/arpa/nameser.h ============================================================================== --- vendor/resolver/dist/include/arpa/nameser.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/include/arpa/nameser.h Sun Dec 14 16:47:21 2008 (r186083) @@ -49,7 +49,7 @@ */ /* - * $Id: nameser.h,v 1.7.18.1 2005/04/27 05:00:50 sra Exp $ + * $Id: nameser.h,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $ */ #ifndef _ARPA_NAMESER_H_ @@ -427,9 +427,10 @@ typedef enum __ns_cert_types { #define NS_NXT_MAX 127 /*% - * EDNS0 extended flags, host order. + * EDNS0 extended flags and option codes, host order. */ #define NS_OPT_DNSSEC_OK 0x8000U +#define NS_OPT_NSID 3 /*% * Inline versions of get/put short/long. Pointer is advanced. Modified: vendor/resolver/dist/include/resolv.h ============================================================================== --- vendor/resolver/dist/include/resolv.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/include/resolv.h Sun Dec 14 16:47:21 2008 (r186083) @@ -50,7 +50,7 @@ /*% * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * $Id: resolv.h,v 1.19.18.3 2005/08/25 04:43:51 marka Exp $ + * $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $ */ #ifndef _RESOLV_H_ @@ -250,6 +250,7 @@ union res_sockaddr_union { #define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */ #define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */ #define RES_BLAST 0x00020000 /*%< blast all recursive servers */ +#define RES_NSID 0x00040000 /*%< request name server ID */ #define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */ #define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */ /* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */ @@ -396,6 +397,7 @@ extern const struct res_sym __p_rcode_sy #define sym_ntos __sym_ntos #define sym_ston __sym_ston #define res_nopt __res_nopt +#define res_nopt_rdata __res_nopt_rdata #define res_ndestroy __res_ndestroy #define res_nametoclass __res_nametoclass #define res_nametotype __res_nametotype @@ -482,6 +484,8 @@ int res_findzonecut2 __P((res_state, co union res_sockaddr_union *, int)); void res_nclose __P((res_state)); int res_nopt __P((res_state, int, u_char *, int, int)); +int res_nopt_rdata __P((res_state, int, u_char *, int, u_char *, + u_short, u_short, u_char *)); void res_send_setqhook __P((res_send_qhook)); void res_send_setrhook __P((res_send_rhook)); int __res_vinit __P((res_state, int)); Modified: vendor/resolver/dist/lib/libc/include/isc/eventlib.h ============================================================================== --- vendor/resolver/dist/lib/libc/include/isc/eventlib.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/include/isc/eventlib.h Sun Dec 14 16:47:21 2008 (r186083) @@ -18,7 +18,7 @@ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $ + * $Id: eventlib.h,v 1.3.18.3 2008/01/23 02:12:01 marka Exp $ */ #ifndef _EVENTLIB_H @@ -29,6 +29,8 @@ #include #include +#include + #ifndef __P # define __EVENTLIB_P_DEFINED # ifdef __STDC__ Modified: vendor/resolver/dist/lib/libc/inet/inet_net_pton.c ============================================================================== --- vendor/resolver/dist/lib/libc/inet/inet_net_pton.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/inet/inet_net_pton.c Sun Dec 14 16:47:21 2008 (r186083) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; #endif #include "port_before.h" @@ -133,11 +133,11 @@ inet_net_pton_ipv4(const char *src, u_ch INSIST(n >= 0 && n <= 9); bits *= 10; bits += n; + if (bits > 32) + goto enoent; } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); if (ch != '\0') goto enoent; - if (bits > 32) - goto emsgsize; } /* Firey death and destruction unless we prefetched EOS. */ Modified: vendor/resolver/dist/lib/libc/inet/inet_network.c ============================================================================== --- vendor/resolver/dist/lib/libc/inet/inet_network.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/inet/inet_network.c Sun Dec 14 16:47:21 2008 (r186083) @@ -84,9 +84,9 @@ again: } if (!digit) return (INADDR_NONE); + if (pp >= parts + 4 || val > 0xffU) + return (INADDR_NONE); if (*cp == '.') { - if (pp >= parts + 4 || val > 0xffU) - return (INADDR_NONE); *pp++ = val, cp++; goto again; } Modified: vendor/resolver/dist/lib/libc/resolv/res_debug.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_debug.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_debug.c Sun Dec 14 16:47:21 2008 (r186083) @@ -95,7 +95,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.5 2005/07/28 07:38:11 marka Exp $"; +static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.6 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -189,10 +189,56 @@ do_section(const res_state statp, p_type(ns_rr_type(rr)), p_class(ns_rr_class(rr))); else if (section == ns_s_ar && ns_rr_type(rr) == ns_t_opt) { + u_int16_t optcode, optlen, rdatalen = ns_rr_rdlen(rr); u_int32_t ttl = ns_rr_ttl(rr); + fprintf(file, "; EDNS: version: %u, udp=%u, flags=%04x\n", (ttl>>16)&0xff, ns_rr_class(rr), ttl&0xffff); + + while (rdatalen >= 4) { + const u_char *cp = ns_rr_rdata(rr); + int i; + + GETSHORT(optcode, cp); + GETSHORT(optlen, cp); + + if (optcode == NS_OPT_NSID) { + fputs("; NSID: ", file); + if (optlen == 0) { + fputs("; NSID\n", file); + } else { + fputs("; NSID: ", file); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i])? + cp[i] : '.'); + fputs(")\n", file); + } + } else { + if (optlen == 0) { + fprintf(file, "; OPT=%u\n", + optcode); + } else { + fprintf(file, "; OPT=%u: ", + optcode); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i]) ? + cp[i] : '.'); + fputs(")\n", file); + } + } + rdatalen -= 4 + optlen; + } } else { n = ns_sprintrr(handle, &rr, NULL, NULL, buf, buflen); @@ -204,7 +250,7 @@ do_section(const res_state statp, buf = malloc(buflen += 1024); if (buf == NULL) { fprintf(file, - ";; memory allocation failure\n"); + ";; memory allocation failure\n"); return; } continue; @@ -381,7 +427,7 @@ const struct res_sym __p_default_section {ns_s_an, "ANSWER", (char *)0}, {ns_s_ns, "AUTHORITY", (char *)0}, {ns_s_ar, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; const struct res_sym __p_update_section_syms[] = { @@ -389,7 +435,7 @@ const struct res_sym __p_update_section_ {S_PREREQ, "PREREQUISITE", (char *)0}, {S_UPDATE, "UPDATE", (char *)0}, {S_ADDT, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; const struct res_sym __p_key_syms[] = { @@ -617,6 +663,7 @@ p_option(u_long option) { case RES_USE_INET6: return "inet6"; #ifdef RES_USE_EDNS0 /*%< KAME extension */ case RES_USE_EDNS0: return "edns0"; + case RES_NSID: return "nsid"; #endif #ifdef RES_USE_DNAME case RES_USE_DNAME: return "dname"; Modified: vendor/resolver/dist/lib/libc/resolv/res_mkquery.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_mkquery.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_mkquery.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -203,9 +203,6 @@ res_nmkquery(res_state statp, #ifdef RES_USE_EDNS0 /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ -#ifndef T_OPT -#define T_OPT 41 -#endif int res_nopt(res_state statp, @@ -230,13 +227,14 @@ res_nopt(res_state statp, if ((ep - cp) < 1 + RRFIXEDSZ) return (-1); - *cp++ = 0; /*%< "." */ - ns_put16(T_OPT, cp); /*%< TYPE */ + *cp++ = 0; /*%< "." */ + ns_put16(ns_t_opt, cp); /*%< TYPE */ cp += INT16SZ; - ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ + ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ cp += INT16SZ; - *cp++ = NOERROR; /*%< extended RCODE */ - *cp++ = 0; /*%< EDNS version */ + *cp++ = NOERROR; /*%< extended RCODE */ + *cp++ = 0; /*%< EDNS version */ + if (statp->options & RES_USE_DNSSEC) { #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -246,12 +244,60 @@ res_nopt(res_state statp, } ns_put16(flags, cp); cp += INT16SZ; - ns_put16(0, cp); /*%< RDLEN */ + + ns_put16(0U, cp); /*%< RDLEN */ cp += INT16SZ; + hp->arcount = htons(ntohs(hp->arcount) + 1); return (cp - buf); } + +/* + * Construct variable data (RDATA) block for OPT psuedo-RR, append it + * to the buffer, then update the RDLEN field (previously set to zero by + * res_nopt()) with the new RDATA length. + */ +int +res_nopt_rdata(res_state statp, + int n0, /*%< current offset in buffer */ + u_char *buf, /*%< buffer to put query */ + int buflen, /*%< size of buffer */ + u_char *rdata, /*%< ptr to start of opt rdata */ + u_short code, /*%< OPTION-CODE */ + u_short len, /*%< OPTION-LENGTH */ + u_char *data) /*%< OPTION_DATA */ +{ + register u_char *cp, *ep; + +#ifdef DEBUG + if ((statp->options & RES_DEBUG) != 0U) + printf(";; res_nopt_rdata()\n"); +#endif + + cp = buf + n0; + ep = buf + buflen; + + if ((ep - cp) < (4 + len)) + return (-1); + + if (rdata < (buf + 2) || rdata >= ep) + return (-1); + + ns_put16(code, cp); + cp += INT16SZ; + + ns_put16(len, cp); + cp += INT16SZ; + + memcpy(cp, data, len); + cp += len; + + len = cp - rdata; + ns_put16(len, rdata - 2); /* Update RDLEN field */ + + return (cp - buf); +} #endif /*! \file */ Modified: vendor/resolver/dist/lib/libc/resolv/res_query.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_query.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_query.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_query.c,v 1.7.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_query.c,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -116,8 +116,9 @@ res_nquery(res_state statp, { u_char buf[MAXPACKET]; HEADER *hp = (HEADER *) answer; - int n; u_int oflags; + u_char *rdata; + int n; oflags = statp->_flags; @@ -132,8 +133,14 @@ again: buf, sizeof(buf)); #ifdef RES_USE_EDNS0 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && - (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U) + (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); + rdata = &buf[n]; + if (n > 0 && (statp->options & RES_NSID) != 0U) { + n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, + NS_OPT_NSID, 0, NULL); + } + } #endif if (n <= 0) { #ifdef DEBUG @@ -143,6 +150,7 @@ again: RES_SET_H_ERRNO(statp, NO_RECOVERY); return (n); } + n = res_nsend(statp, buf, n, answer, anslen); if (n < 0) { #ifdef RES_USE_EDNS0 Modified: vendor/resolver/dist/lib/libc/resolv/res_send.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_send.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_send.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_send.c,v 1.9.18.8 2006/10/16 23:00:58 marka Exp $"; +static const char rcsid[] = "$Id: res_send.c,v 1.9.18.10 2008/01/27 02:06:26 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /*! \file @@ -293,7 +293,7 @@ int res_nsend(res_state statp, const u_char *buf, int buflen, u_char *ans, int anssiz) { - int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; + int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n; char abuf[NI_MAXHOST]; #ifdef USE_POLL @@ -405,7 +405,7 @@ res_nsend(res_state statp, /* * Send request, RETRY times, or until successful. */ - for (try = 0; try < statp->retry; try++) { + for (tries = 0; tries < statp->retry; tries++) { for (ns = 0; ns < statp->nscount; ns++) { struct sockaddr *nsap; int nsaplen; @@ -453,7 +453,7 @@ res_nsend(res_state statp, if (v_circuit) { /* Use VC; at most one attempt per server. */ - try = statp->retry; + tries = statp->retry; n = send_vc(statp, buf, buflen, ans, anssiz, &terrno, ns); if (n < 0) @@ -464,7 +464,7 @@ res_nsend(res_state statp, } else { /* Use datagrams. */ n = send_dg(statp, buf, buflen, ans, anssiz, &terrno, - ns, try, &v_circuit, &gotsomewhere); + ns, tries, &v_circuit, &gotsomewhere); if (n < 0) goto fail; if (n == 0) @@ -601,6 +601,9 @@ send_vc(res_state statp, u_short len; u_char *cp; void *tmp; +#ifdef SO_NOSIGPIPE + int on = 1; +#endif nsap = get_nsaddr(statp, ns); nsaplen = get_salen(nsap); @@ -646,6 +649,17 @@ send_vc(res_state statp, return (-1); } } +#ifdef SO_NOSIGPIPE + /* + * Disable generation of SIGPIPE when writing to a closed + * socket. Write should return -1 and set errno to EPIPE + * instead. + * + * Push on even if setsockopt(SO_NOSIGPIPE) fails. + */ + (void)setsockopt(statp->_vcsock, SOL_SOCKET, SO_NOSIGPIPE, &on, + sizeof(on)); +#endif errno = 0; if (connect(statp->_vcsock, nsap, nsaplen) < 0) { *terrno = errno; @@ -773,7 +787,7 @@ send_vc(res_state statp, static int send_dg(res_state statp, const u_char *buf, int buflen, u_char *ans, - int anssiz, int *terrno, int ns, int try, int *v_circuit, + int anssiz, int *terrno, int ns, int tries, int *v_circuit, int *gotsomewhere) { const HEADER *hp = (const HEADER *) buf; @@ -855,7 +869,7 @@ send_dg(res_state statp, const u_char *b /* * Wait for reply. */ - seconds = (statp->retrans << try); + seconds = (statp->retrans << tries); if (ns > 0) seconds /= statp->nscount; if (seconds <= 0) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:49:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13FE81065670; Sun, 14 Dec 2008 16:49:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDA8E8FC16; Sun, 14 Dec 2008 16:49:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEGneeO064058; Sun, 14 Dec 2008 16:49:40 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEGne20064057; Sun, 14 Dec 2008 16:49:40 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141649.mBEGne20064057@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186084 - vendor/resolver/9.4.3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:49:41 -0000 Author: ume Date: Sun Dec 14 16:49:40 2008 New Revision: 186084 URL: http://svn.freebsd.org/changeset/base/186084 Log: Tagging for 9.4.3 import. Added: vendor/resolver/9.4.3/ - copied from r186083, vendor/resolver/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 16:56:48 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 753611065672; Sun, 14 Dec 2008 16:56:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 633A98FC18; Sun, 14 Dec 2008 16:56:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEGult5064250; Sun, 14 Dec 2008 16:56:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEGulI4064249; Sun, 14 Dec 2008 16:56:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812141656.mBEGulI4064249@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 14 Dec 2008 16:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186085 - head/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:56:48 -0000 Author: bz Date: Sun Dec 14 16:56:47 2008 New Revision: 186085 URL: http://svn.freebsd.org/changeset/base/186085 Log: Make sure that the direct jls invocations prints something reasonable close to and in the same format as it had always. r185435 said it would try that but I had been living with jail patches for too long to actually remember the single-line format when adding backwards compatibility back in p4. Reported by: Philipp Wuensche Tested by: Philipp Wuensche MFC after: 4 weeks (just for me to get the mail) Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Sun Dec 14 16:49:40 2008 (r186084) +++ head/usr.sbin/jls/jls.c Sun Dec 14 16:56:47 2008 (r186085) @@ -48,7 +48,7 @@ #ifdef SUPPORT_OLD_XPRISON static -char *print_xprison_v1(void *p, char *end) +char *print_xprison_v1(void *p, char *end, unsigned flags) { struct xprison_v1 *xp; struct in_addr in; @@ -57,15 +57,18 @@ char *print_xprison_v1(void *p, char *en errx(1, "Invalid length for jail"); xp = (struct xprison_v1 *)p; - printf("%6d %-29.29s %.74s\n", - xp->pr_id, xp->pr_host, xp->pr_path); - - /* We are not printing an empty line here for state and name. */ - /* We are not printing an empty line here for cpusetid. */ - - /* IPv4 address. */ - in.s_addr = htonl(xp->pr_ip); - printf("%6s %-15.15s\n", "", inet_ntoa(in)); + if (flags & FLAG_V) { + printf("%6d %-29.29s %.74s\n", + xp->pr_id, xp->pr_host, xp->pr_path); + /* We are not printing an empty line here for state and name. */ + /* We are not printing an empty line here for cpusetid. */ + /* IPv4 address. */ + in.s_addr = htonl(xp->pr_ip); + printf("%6s %-15.15s\n", "", inet_ntoa(in)); + } else { + printf("%6d %-15.15s %-29.29s %.74s\n", + xp->pr_id, inet_ntoa(in), xp->pr_host, xp->pr_path); + } return ((char *)(xp + 1)); } @@ -104,8 +107,9 @@ char *print_xprison_v3(void *p, char *en return (q); } - printf("%6d %-29.29s %.74s\n", - xp->pr_id, xp->pr_host, xp->pr_path); + if (flags & FLAG_V) + printf("%6d %-29.29s %.74s\n", + xp->pr_id, xp->pr_host, xp->pr_path); /* Jail state and name. */ if (flags & FLAG_V) @@ -123,11 +127,12 @@ char *print_xprison_v3(void *p, char *en q += (xp->pr_ip4s * sizeof(struct in_addr)); if (q > end) errx(1, "Invalid length for jail"); + in.s_addr = 0; for (i = 0; i < xp->pr_ip4s; i++) { - if (i == 0 || flags & FLAG_V) { + if (i == 0 || flags & FLAG_V) in.s_addr = iap[i].s_addr; + if (flags & FLAG_V) printf("%6s %-15.15s\n", "", inet_ntoa(in)); - } } /* IPv6 addresses. */ ia6p = (struct in6_addr *)(void *)q; @@ -141,6 +146,12 @@ char *print_xprison_v3(void *p, char *en } } + /* If requested print the old style single line version. */ + if (!(flags & FLAG_V)) + printf("%6d %-15.15s %-29.29s %.74s\n", + xp->pr_id, (in.s_addr) ? inet_ntoa(in) : "", + xp->pr_host, xp->pr_path); + return (q); } @@ -206,12 +217,15 @@ main(int argc, char *argv[]) if (version > XPRISON_VERSION) errx(1, "Sci-Fi prison. Kernel/userland out of sync?"); - printf(" JID Hostname Path\n"); if (flags & FLAG_V) { + printf(" JID Hostname Path\n"); printf(" Name State\n"); printf(" CPUSetID\n"); + printf(" IP Address(es)\n"); + } else { + printf(" JID IP Address Hostname" + " Path\n"); } - printf(" IP Address(es)\n"); for (; q != NULL && (char *)q + sizeof(int) < (char *)p + len;) { version = *(int *)q; if (version > XPRISON_VERSION) @@ -219,7 +233,7 @@ main(int argc, char *argv[]) switch (version) { #ifdef SUPPORT_OLD_XPRISON case 1: - q = print_xprison_v1(q, (char *)p + len); + q = print_xprison_v1(q, (char *)p + len, flags); break; case 2: errx(1, "Version 2 was used by multi-IPv4 jail " From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 17:47:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D872D1065679; Sun, 14 Dec 2008 17:47:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA37C8FC18; Sun, 14 Dec 2008 17:47:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEHlXse065235; Sun, 14 Dec 2008 17:47:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEHlXGF065234; Sun, 14 Dec 2008 17:47:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812141747.mBEHlXGF065234@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 14 Dec 2008 17:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186086 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 17:47:34 -0000 Author: bz Date: Sun Dec 14 17:47:33 2008 New Revision: 186086 URL: http://svn.freebsd.org/changeset/base/186086 Log: Add a check, that is currently under discussion for 8 but that we need to keep for 7-STABLE when MFCing in_pcbladdr() to not change the behaviour there. With this a destination route via a loopback interface is treated as a valid and reachable thing for IPv4 source address selection, even though nothing of that network is ever directly reachable, but it is more like a blackhole route. With this the source address will be selected and IPsec can grab the packets before we would discard them at a later point, encapsulate them and send them out from a different tunnel endpoint IP. Discussed on: net Reported by: Frank Behrens Tested by: Frank Behrens MFC after: 4 weeks (just so that I get the mail) Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Dec 14 16:56:47 2008 (r186085) +++ head/sys/netinet/in_pcb.c Sun Dec 14 17:47:33 2008 (r186086) @@ -695,6 +695,10 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); if (cred == NULL || !jailed(cred)) { +#if __FreeBSD_version < 800000 + if (ia == NULL) + ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa; +#endif if (ia == NULL) { error = ENETUNREACH; goto done; From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 18:53:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD261065673; Sun, 14 Dec 2008 18:53:37 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6073B8FC13; Sun, 14 Dec 2008 18:53:37 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEIrbVY066533; Sun, 14 Dec 2008 18:53:37 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEIrbah066532; Sun, 14 Dec 2008 18:53:37 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141853.mBEIrbah066532@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 18:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186087 - head/lib/libc/include/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 18:53:37 -0000 Author: ume Date: Sun Dec 14 18:53:37 2008 New Revision: 186087 URL: http://svn.freebsd.org/changeset/base/186087 Log: prop change Modified: head/lib/libc/include/isc/eventlib.h (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 19:21:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F6C91065670; Sun, 14 Dec 2008 19:21:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206045082.chello.pl [87.206.45.82]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD498FC17; Sun, 14 Dec 2008 19:21:08 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7EEE745B26; Sun, 14 Dec 2008 20:21:05 +0100 (CET) Received: from localhost (chello087206045082.chello.pl [87.206.45.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E5EE64569A; Sun, 14 Dec 2008 20:20:59 +0100 (CET) Date: Sun, 14 Dec 2008 20:21:01 +0100 From: Pawel Jakub Dawidek To: Ulf Lilleengen Message-ID: <20081214192100.GB16926@garage.freebsd.pl> References: <200812131414.mBDEEu0A031376@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline In-Reply-To: <200812131414.mBDEEu0A031376@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:21:09 -0000 --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 13, 2008 at 02:14:56PM +0000, Ulf Lilleengen wrote: > Author: lulf > Date: Sat Dec 13 14:14:56 2008 > New Revision: 186038 > URL: http://svn.freebsd.org/changeset/base/186038 >=20 > Log: > - When writing metadata to a geom provider, open the it as read-write s= ince it > might do subsequent reads from other providers. This stopped geli (and > probably other classes using g_metadata_store as well) from being put= on top > of gvinum raid5 volumes. > =20 > Note: > The reason it fails in the gvinum raid5 case is that gvinum will read b= ack the > old parity stripe before calculating the new parity stripe to be writte= n out > again. The write will then fail because the underlying disk to be read= is > opened write only. I think we discussed this in the past. In my opinion this change is incorrect. The intend here is to only write something, that's why I use O_WRONLY. If gvinum/raid5 needs also read something to satisfy the write, this is gvinum/raid5's internal detail and should be handled there. RAID5 by design needs to read before it can write (in most cases), does it mean that the O_WRONLY flag became bogus suddenly? No. The flag given to open(2) describes caller's intend, not provider's internals. > Modified: > head/sbin/geom/misc/subr.c >=20 > Modified: head/sbin/geom/misc/subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/misc/subr.c Sat Dec 13 13:07:12 2008 (r186037) > +++ head/sbin/geom/misc/subr.c Sat Dec 13 14:14:56 2008 (r186038) > @@ -211,7 +211,7 @@ g_metadata_store(const char *name, u_cha > sector =3D NULL; > error =3D 0; > =20 > - fd =3D open(path, O_WRONLY); > + fd =3D open(path, O_RDWR); > if (fd =3D=3D -1) > return (errno); > mediasize =3D g_get_mediasize(name); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --H+4ONPRPur6+Ovig Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJRVybForvXbEpPzQRAgc3AJ9DzXxiEepsESTEcxQpnh4UIrBKHQCg1n7F pr0qTfPiyIFilu/4mEZuAbQ= =IphU -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 19:23:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ABC1106564A; Sun, 14 Dec 2008 19:23:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35898FC16; Sun, 14 Dec 2008 19:23:19 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEJNJVD067845; Sun, 14 Dec 2008 19:23:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEJNJFp067844; Sun, 14 Dec 2008 19:23:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141923.mBEJNJFp067844@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 19:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186088 - head/lib/libc/include/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:23:20 -0000 Author: ume Date: Sun Dec 14 19:23:19 2008 New Revision: 186088 URL: http://svn.freebsd.org/changeset/base/186088 Log: delete svn:keywords. Modified: head/lib/libc/include/isc/eventlib.h (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 19:35:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D591106564A; Sun, 14 Dec 2008 19:35:43 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 124868FC12; Sun, 14 Dec 2008 19:35:43 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEJZg33068479; Sun, 14 Dec 2008 19:35:42 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEJZgjm068478; Sun, 14 Dec 2008 19:35:42 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141935.mBEJZgjm068478@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 19:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186089 - head/lib/libc/include/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:35:43 -0000 Author: ume Date: Sun Dec 14 19:35:42 2008 New Revision: 186089 URL: http://svn.freebsd.org/changeset/base/186089 Log: prop change. Modified: head/lib/libc/include/isc/eventlib.h (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 19:39:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A4581065675; Sun, 14 Dec 2008 19:39:54 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35DEA8FC08; Sun, 14 Dec 2008 19:39:54 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEJdrIm068622; Sun, 14 Dec 2008 19:39:53 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEJdr8i068613; Sun, 14 Dec 2008 19:39:53 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141939.mBEJdr8i068613@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 19:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186090 - in head: include include/arpa lib/libc/include/isc lib/libc/inet lib/libc/resolv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:39:54 -0000 Author: ume Date: Sun Dec 14 19:39:53 2008 New Revision: 186090 URL: http://svn.freebsd.org/changeset/base/186090 Log: Merge the resolver part of BIND 9.4.3 into HEAD. It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz Added: head/lib/libc/include/isc/platform.h (contents, props changed) Modified: head/include/arpa/nameser.h head/include/resolv.h head/lib/libc/include/isc/eventlib.h (contents, props changed) head/lib/libc/inet/inet_net_pton.c head/lib/libc/resolv/res_debug.c head/lib/libc/resolv/res_mkquery.c head/lib/libc/resolv/res_query.c head/lib/libc/resolv/res_send.c Modified: head/include/arpa/nameser.h ============================================================================== --- head/include/arpa/nameser.h Sun Dec 14 19:35:42 2008 (r186089) +++ head/include/arpa/nameser.h Sun Dec 14 19:39:53 2008 (r186090) @@ -49,7 +49,7 @@ */ /* - * $Id: nameser.h,v 1.7.18.1 2005/04/27 05:00:50 sra Exp $ + * $Id: nameser.h,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $ * $FreeBSD$ */ @@ -424,9 +424,10 @@ typedef enum __ns_cert_types { #define NS_NXT_MAX 127 /*% - * EDNS0 extended flags, host order. + * EDNS0 extended flags and option codes, host order. */ #define NS_OPT_DNSSEC_OK 0x8000U +#define NS_OPT_NSID 3 /*% * Inline versions of get/put short/long. Pointer is advanced. Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Sun Dec 14 19:35:42 2008 (r186089) +++ head/include/resolv.h Sun Dec 14 19:39:53 2008 (r186090) @@ -50,7 +50,7 @@ /*% * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * $Id: resolv.h,v 1.19.18.3 2005/08/25 04:43:51 marka Exp $ + * $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $ * $FreeBSD$ */ @@ -245,6 +245,7 @@ union res_sockaddr_union { #define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */ #define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */ #define RES_BLAST 0x00020000 /*%< blast all recursive servers */ +#define RES_NSID 0x00040000 /*%< request name server ID */ #define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */ #define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */ /* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */ @@ -386,6 +387,7 @@ extern const struct res_sym __p_rcode_sy #define sym_ntos __sym_ntos #define sym_ston __sym_ston #define res_nopt __res_nopt +#define res_nopt_rdata __res_nopt_rdata #define res_ndestroy __res_ndestroy #define res_nametoclass __res_nametoclass #define res_nametotype __res_nametotype @@ -474,6 +476,8 @@ int res_findzonecut2(res_state, const c union res_sockaddr_union *, int); void res_nclose(res_state); int res_nopt(res_state, int, u_char *, int, int); +int res_nopt_rdata(res_state, int, u_char *, int, u_char *, + u_short, u_short, u_char *); void res_send_setqhook(res_send_qhook); void res_send_setrhook(res_send_rhook); int __res_vinit(res_state, int); Modified: head/lib/libc/include/isc/eventlib.h ============================================================================== --- head/lib/libc/include/isc/eventlib.h Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/include/isc/eventlib.h Sun Dec 14 19:39:53 2008 (r186090) @@ -18,7 +18,7 @@ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $ + * $Id: eventlib.h,v 1.3.18.3 2008/01/23 02:12:01 marka Exp $ */ #ifndef _EVENTLIB_H @@ -29,6 +29,8 @@ #include #include +#include + #ifndef __P # define __EVENTLIB_P_DEFINED # ifdef __STDC__ Added: head/lib/libc/include/isc/platform.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/include/isc/platform.h Sun Dec 14 19:39:53 2008 (r186090) @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC") + * + * 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 ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC 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. + */ + +/* $Id: platform.h.in,v 1.2.6.2 2008/01/23 02:15:02 tbox Exp $ */ +/* $FreeBSD$ */ + +/*! \file */ + +#ifndef ISC_PLATFORM_H +#define ISC_PLATFORM_H + +/* + * Define if the OS does not define struct timespec. + */ +#undef ISC_PLATFORM_NEEDTIMESPEC +#ifdef ISC_PLATFORM_NEEDTIMESPEC +#include /* For time_t */ +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; +#endif + +#endif Modified: head/lib/libc/inet/inet_net_pton.c ============================================================================== --- head/lib/libc/inet/inet_net_pton.c Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/inet/inet_net_pton.c Sun Dec 14 19:39:53 2008 (r186090) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; #endif #include __FBSDID("$FreeBSD$"); @@ -135,11 +135,11 @@ inet_net_pton_ipv4(const char *src, u_ch assert(n >= 0 && n <= 9); bits *= 10; bits += n; + if (bits > 32) + goto enoent; } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); if (ch != '\0') goto enoent; - if (bits > 32) - goto emsgsize; } /* Firey death and destruction unless we prefetched EOS. */ Modified: head/lib/libc/resolv/res_debug.c ============================================================================== --- head/lib/libc/resolv/res_debug.c Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/resolv/res_debug.c Sun Dec 14 19:39:53 2008 (r186090) @@ -91,7 +91,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.5 2005/07/28 07:38:11 marka Exp $"; +static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.6 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -187,10 +187,56 @@ do_section(const res_state statp, p_type(ns_rr_type(rr)), p_class(ns_rr_class(rr))); else if (section == ns_s_ar && ns_rr_type(rr) == ns_t_opt) { + u_int16_t optcode, optlen, rdatalen = ns_rr_rdlen(rr); u_int32_t ttl = ns_rr_ttl(rr); + fprintf(file, "; EDNS: version: %u, udp=%u, flags=%04x\n", (ttl>>16)&0xff, ns_rr_class(rr), ttl&0xffff); + + while (rdatalen >= 4) { + const u_char *cp = ns_rr_rdata(rr); + int i; + + GETSHORT(optcode, cp); + GETSHORT(optlen, cp); + + if (optcode == NS_OPT_NSID) { + fputs("; NSID: ", file); + if (optlen == 0) { + fputs("; NSID\n", file); + } else { + fputs("; NSID: ", file); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i])? + cp[i] : '.'); + fputs(")\n", file); + } + } else { + if (optlen == 0) { + fprintf(file, "; OPT=%u\n", + optcode); + } else { + fprintf(file, "; OPT=%u: ", + optcode); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i]) ? + cp[i] : '.'); + fputs(")\n", file); + } + } + rdatalen -= 4 + optlen; + } } else { n = ns_sprintrr(handle, &rr, NULL, NULL, buf, buflen); @@ -202,7 +248,7 @@ do_section(const res_state statp, buf = malloc(buflen += 1024); if (buf == NULL) { fprintf(file, - ";; memory allocation failure\n"); + ";; memory allocation failure\n"); return; } continue; @@ -379,7 +425,7 @@ static const struct res_sym __p_default_ {ns_s_an, "ANSWER", (char *)0}, {ns_s_ns, "AUTHORITY", (char *)0}, {ns_s_ar, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; static const struct res_sym __p_update_section_syms[] = { @@ -387,7 +433,7 @@ static const struct res_sym __p_update_s {S_PREREQ, "PREREQUISITE", (char *)0}, {S_UPDATE, "UPDATE", (char *)0}, {S_ADDT, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; const struct res_sym __p_key_syms[] = { @@ -615,6 +661,7 @@ p_option(u_long option) { case RES_USE_INET6: return "inet6"; #ifdef RES_USE_EDNS0 /*%< KAME extension */ case RES_USE_EDNS0: return "edns0"; + case RES_NSID: return "nsid"; #endif #ifdef RES_USE_DNAME case RES_USE_DNAME: return "dname"; Modified: head/lib/libc/resolv/res_mkquery.c ============================================================================== --- head/lib/libc/resolv/res_mkquery.c Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/resolv/res_mkquery.c Sun Dec 14 19:39:53 2008 (r186090) @@ -66,7 +66,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -201,9 +201,6 @@ res_nmkquery(res_state statp, #ifdef RES_USE_EDNS0 /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ -#ifndef T_OPT -#define T_OPT 41 -#endif int res_nopt(res_state statp, @@ -228,15 +225,16 @@ res_nopt(res_state statp, if ((ep - cp) < 1 + RRFIXEDSZ) return (-1); - *cp++ = 0; /*%< "." */ - ns_put16(T_OPT, cp); /*%< TYPE */ + *cp++ = 0; /*%< "." */ + ns_put16(ns_t_opt, cp); /*%< TYPE */ cp += INT16SZ; if (anslen > 0xffff) anslen = 0xffff; /* limit to 16bit value */ - ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ + ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ cp += INT16SZ; - *cp++ = NOERROR; /*%< extended RCODE */ - *cp++ = 0; /*%< EDNS version */ + *cp++ = NOERROR; /*%< extended RCODE */ + *cp++ = 0; /*%< EDNS version */ + if (statp->options & RES_USE_DNSSEC) { #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -246,12 +244,60 @@ res_nopt(res_state statp, } ns_put16(flags, cp); cp += INT16SZ; - ns_put16(0, cp); /*%< RDLEN */ + + ns_put16(0U, cp); /*%< RDLEN */ cp += INT16SZ; + hp->arcount = htons(ntohs(hp->arcount) + 1); return (cp - buf); } + +/* + * Construct variable data (RDATA) block for OPT psuedo-RR, append it + * to the buffer, then update the RDLEN field (previously set to zero by + * res_nopt()) with the new RDATA length. + */ +int +res_nopt_rdata(res_state statp, + int n0, /*%< current offset in buffer */ + u_char *buf, /*%< buffer to put query */ + int buflen, /*%< size of buffer */ + u_char *rdata, /*%< ptr to start of opt rdata */ + u_short code, /*%< OPTION-CODE */ + u_short len, /*%< OPTION-LENGTH */ + u_char *data) /*%< OPTION_DATA */ +{ + register u_char *cp, *ep; + +#ifdef DEBUG + if ((statp->options & RES_DEBUG) != 0U) + printf(";; res_nopt_rdata()\n"); +#endif + + cp = buf + n0; + ep = buf + buflen; + + if ((ep - cp) < (4 + len)) + return (-1); + + if (rdata < (buf + 2) || rdata >= ep) + return (-1); + + ns_put16(code, cp); + cp += INT16SZ; + + ns_put16(len, cp); + cp += INT16SZ; + + memcpy(cp, data, len); + cp += len; + + len = cp - rdata; + ns_put16(len, rdata - 2); /* Update RDLEN field */ + + return (cp - buf); +} #endif /*! \file */ Modified: head/lib/libc/resolv/res_query.c ============================================================================== --- head/lib/libc/resolv/res_query.c Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/resolv/res_query.c Sun Dec 14 19:39:53 2008 (r186090) @@ -66,7 +66,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_query.c,v 1.7.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_query.c,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -115,8 +115,9 @@ res_nquery(res_state statp, { u_char buf[MAXPACKET]; HEADER *hp = (HEADER *) answer; - int n; u_int oflags; + u_char *rdata; + int n; oflags = statp->_flags; @@ -131,8 +132,14 @@ again: buf, sizeof(buf)); #ifdef RES_USE_EDNS0 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && - (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U) + (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); + rdata = &buf[n]; + if (n > 0 && (statp->options & RES_NSID) != 0U) { + n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, + NS_OPT_NSID, 0, NULL); + } + } #endif if (n <= 0) { #ifdef DEBUG @@ -142,6 +149,7 @@ again: RES_SET_H_ERRNO(statp, NO_RECOVERY); return (n); } + n = res_nsend(statp, buf, n, answer, anslen); if (n < 0) { #ifdef RES_USE_EDNS0 Modified: head/lib/libc/resolv/res_send.c ============================================================================== --- head/lib/libc/resolv/res_send.c Sun Dec 14 19:35:42 2008 (r186089) +++ head/lib/libc/resolv/res_send.c Sun Dec 14 19:39:53 2008 (r186090) @@ -66,7 +66,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_send.c,v 1.9.18.8 2006/10/16 23:00:58 marka Exp $"; +static const char rcsid[] = "$Id: res_send.c,v 1.9.18.10 2008/01/27 02:06:26 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -302,7 +302,7 @@ int res_nsend(res_state statp, const u_char *buf, int buflen, u_char *ans, int anssiz) { - int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; + int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n; #ifdef USE_KQUEUE int kq; #endif @@ -420,7 +420,7 @@ res_nsend(res_state statp, /* * Send request, RETRY times, or until successful. */ - for (try = 0; try < statp->retry; try++) { + for (tries = 0; tries < statp->retry; tries++) { for (ns = 0; ns < statp->nscount; ns++) { struct sockaddr *nsap; int nsaplen; @@ -471,7 +471,7 @@ res_nsend(res_state statp, if (v_circuit) { /* Use VC; at most one attempt per server. */ - try = statp->retry; + tries = statp->retry; n = send_vc(statp, buf, buflen, ans, anssiz, &terrno, ns); if (n < 0) @@ -486,7 +486,7 @@ res_nsend(res_state statp, kq, #endif buf, buflen, ans, anssiz, &terrno, - ns, try, &v_circuit, &gotsomewhere); + ns, tries, &v_circuit, &gotsomewhere); if (n < 0) goto fail; if (n == 0) @@ -632,6 +632,9 @@ send_vc(res_state statp, u_short len; u_char *cp; void *tmp; +#ifdef SO_NOSIGPIPE + int on = 1; +#endif nsap = get_nsaddr(statp, ns); nsaplen = get_salen(nsap); @@ -679,6 +682,17 @@ send_vc(res_state statp, return (-1); } } +#ifdef SO_NOSIGPIPE + /* + * Disable generation of SIGPIPE when writing to a closed + * socket. Write should return -1 and set errno to EPIPE + * instead. + * + * Push on even if setsockopt(SO_NOSIGPIPE) fails. + */ + (void)_setsockopt(statp->_vcsock, SOL_SOCKET, SO_NOSIGPIPE, &on, + sizeof(on)); +#endif errno = 0; if (_connect(statp->_vcsock, nsap, nsaplen) < 0) { *terrno = errno; @@ -811,7 +825,7 @@ send_dg(res_state statp, int kq, #endif const u_char *buf, int buflen, u_char *ans, - int anssiz, int *terrno, int ns, int try, int *v_circuit, + int anssiz, int *terrno, int ns, int tries, int *v_circuit, int *gotsomewhere) { const HEADER *hp = (const HEADER *) buf; @@ -915,7 +929,7 @@ send_dg(res_state statp, /* * Wait for reply. */ - seconds = (statp->retrans << try); + seconds = (statp->retrans << tries); if (ns > 0) seconds /= statp->nscount; if (seconds <= 0) From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 20:03:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D7D106564A; Sun, 14 Dec 2008 20:03:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459E48FC13; Sun, 14 Dec 2008 20:03:47 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEK3lPW069823; Sun, 14 Dec 2008 20:03:47 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEK3lRR069821; Sun, 14 Dec 2008 20:03:47 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812142003.mBEK3lRR069821@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 14 Dec 2008 20:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186091 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 20:03:47 -0000 Author: phk Date: Sun Dec 14 20:03:46 2008 New Revision: 186091 URL: http://svn.freebsd.org/changeset/base/186091 Log: Move the code that injects received characters into the tty system into a separate public function ucomrxchars(), to avoid requirement of simple metadata prefixing on the USB data stream. Modified: head/sys/dev/usb/ucom.c head/sys/dev/usb/ucomvar.h Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Sun Dec 14 19:39:53 2008 (r186090) +++ head/sys/dev/usb/ucom.c Sun Dec 14 20:03:46 2008 (r186091) @@ -700,11 +700,30 @@ ucomstartread(struct ucom_softc *sc) return (USBD_NORMAL_COMPLETION); } +void +ucomrxchars(struct ucom_softc *sc, u_char *cp, u_int32_t cc) +{ + struct tty *tp = sc->sc_tty; + + /* Give characters to tty layer. */ + while (cc > 0) { + DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); + if (ttydisc_rint(tp, *cp, 0) == -1) { + /* XXX what should we do? */ + printf("%s: lost %d chars\n", + device_get_nameunit(sc->sc_dev), cc); + break; + } + cc--; + cp++; + } + ttydisc_rint_done(tp); +} + static void ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status) { struct ucom_softc *sc = (struct ucom_softc *)p; - struct tty *tp = sc->sc_tty; usbd_status err; u_int32_t cc; u_char *cp; @@ -737,22 +756,8 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_p device_get_nameunit(sc->sc_dev), cc); goto resubmit; } - if (cc < 1) - goto resubmit; - - /* Give characters to tty layer. */ - while (cc > 0) { - DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); - if (ttydisc_rint(tp, *cp, 0) == -1) { - /* XXX what should we do? */ - printf("%s: lost %d chars\n", - device_get_nameunit(sc->sc_dev), cc); - break; - } - cc--; - cp++; - } - ttydisc_rint_done(tp); + if (cc > 0) + ucomrxchars(sc, cp, cc); resubmit: err = ucomstartread(sc); Modified: head/sys/dev/usb/ucomvar.h ============================================================================== --- head/sys/dev/usb/ucomvar.h Sun Dec 14 19:39:53 2008 (r186090) +++ head/sys/dev/usb/ucomvar.h Sun Dec 14 20:03:46 2008 (r186091) @@ -166,3 +166,4 @@ void ucom_attach_tty(struct ucom_softc * int ucom_attach(struct ucom_softc *); int ucom_detach(struct ucom_softc *); void ucom_status_change(struct ucom_softc *); +void ucomrxchars(struct ucom_softc *sc, u_char *cp, u_int32_t cc); From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 20:05:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 612E4106564A; Sun, 14 Dec 2008 20:05:04 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F58F8FC0C; Sun, 14 Dec 2008 20:05:04 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEK54tQ069886; Sun, 14 Dec 2008 20:05:04 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEK54YC069885; Sun, 14 Dec 2008 20:05:04 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812142005.mBEK54YC069885@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 14 Dec 2008 20:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186092 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 20:05:04 -0000 Author: phk Date: Sun Dec 14 20:05:03 2008 New Revision: 186092 URL: http://svn.freebsd.org/changeset/base/186092 Log: Bump the FTDI receive buffer size to 256 in order to improve throughput. Modified: head/sys/dev/usb/uftdi.c Modified: head/sys/dev/usb/uftdi.c ============================================================================== --- head/sys/dev/usb/uftdi.c Sun Dec 14 20:03:46 2008 (r186091) +++ head/sys/dev/usb/uftdi.c Sun Dec 14 20:05:03 2008 (r186092) @@ -100,7 +100,7 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu * These are the maximum number of bytes transferred per frame. * The output buffer size cannot be increased due to the size encoding. */ -#define UFTDIIBUFSIZE 64 +#define UFTDIIBUFSIZE 256 #define UFTDIOBUFSIZE 64 struct uftdi_softc { @@ -458,32 +458,33 @@ uftdi_read(void *vsc, int portno, u_char { struct uftdi_softc *sc = vsc; u_char msr, lsr; + unsigned l; - DPRINTFN(15,("uftdi_read: sc=%p, port=%d count=%d\n", sc, portno, - *count)); - - msr = FTDI_GET_MSR(*ptr); - lsr = FTDI_GET_LSR(*ptr); - -#ifdef USB_DEBUG - if (*count != 2) - DPRINTFN(10,("uftdi_read: sc=%p, port=%d count=%d data[0]=" - "0x%02x\n", sc, portno, *count, (*ptr)[2])); -#endif + DPRINTFN(15,("uftdi_read: sc=%p, port=%d count=%d\n", + sc, portno, *count)); + while (*count > 0) { + l = *count; + if (l > 64) + l = 64; + + msr = FTDI_GET_MSR(*ptr); + lsr = FTDI_GET_LSR(*ptr); + + if (sc->sc_msr != msr || + (sc->sc_lsr & FTDI_LSR_MASK) != (lsr & FTDI_LSR_MASK)) { + DPRINTF(("uftdi_read: status change msr=0x%02x(0x%02x) " + "lsr=0x%02x(0x%02x)\n", msr, sc->sc_msr, + lsr, sc->sc_lsr)); + sc->sc_msr = msr; + sc->sc_lsr = lsr; + ucom_status_change(&sc->sc_ucom); + } - if (sc->sc_msr != msr || - (sc->sc_lsr & FTDI_LSR_MASK) != (lsr & FTDI_LSR_MASK)) { - DPRINTF(("uftdi_read: status change msr=0x%02x(0x%02x) " - "lsr=0x%02x(0x%02x)\n", msr, sc->sc_msr, - lsr, sc->sc_lsr)); - sc->sc_msr = msr; - sc->sc_lsr = lsr; - ucom_status_change(&sc->sc_ucom); + if (l > 2) + ucomrxchars(&sc->sc_ucom, (*ptr) + 2, l - 2); + *ptr += l; + *count -= l; } - - /* Pick up status and adjust data part. */ - *ptr += 2; - *count -= 2; } static size_t From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 20:15:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 730471065676; Sun, 14 Dec 2008 20:15:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A478FC19; Sun, 14 Dec 2008 20:15:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEKFV5r070479; Sun, 14 Dec 2008 20:15:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEKFVjW070478; Sun, 14 Dec 2008 20:15:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812142015.mBEKFVjW070478@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Dec 2008 20:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186093 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 20:15:31 -0000 Author: mav Date: Sun Dec 14 20:15:30 2008 New Revision: 186093 URL: http://svn.freebsd.org/changeset/base/186093 Log: To avoid one doubtless netgraph SMP scalability limitation point, switch node queues processing from single swi:net thread to several specialized threads. Reviewed by: julian Tested with: Netperf Cluster Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Sun Dec 14 20:05:03 2008 (r186092) +++ head/sys/netgraph/ng_base.c Sun Dec 14 20:15:30 2008 (r186093) @@ -62,6 +62,9 @@ #include #include #include +#include +#include +#include #include #include @@ -211,7 +214,7 @@ static int ng_generic_msg(node_p here, i static ng_ID_t ng_decodeidname(const char *name); static int ngb_mod_event(module_t mod, int event, void *data); static void ng_worklist_add(node_p node); -static void ngintr(void); +static void ngthread(void *); static int ng_apply_item(node_p node, item_p item, int rw); static void ng_flush_input_queue(node_p node); static node_p ng_ID2noderef(ng_ID_t ID); @@ -259,6 +262,10 @@ MALLOC_DEFINE(M_NETGRAPH_MSG, "netgraph_ mtx_lock(&ng_worklist_mtx) #define NG_WORKLIST_UNLOCK() \ mtx_unlock(&ng_worklist_mtx) +#define NG_WORKLIST_SLEEP() \ + mtx_sleep(&ng_worklist, &ng_worklist_mtx, PI_NET, "sleep", 0) +#define NG_WORKLIST_WAKEUP() \ + wakeup_one(&ng_worklist) #ifdef NETGRAPH_DEBUG /*----------------------------------------------*/ /* @@ -2868,9 +2875,13 @@ out: uma_zone_t ng_qzone; uma_zone_t ng_qdzone; +static int numthreads = 0; /* number of queue threads */ static int maxalloc = 4096;/* limit the damage of a leak */ static int maxdata = 512; /* limit the damage of a DoS */ +TUNABLE_INT("net.graph.threads", &numthreads); +SYSCTL_INT(_net_graph, OID_AUTO, threads, CTLFLAG_RDTUN, &numthreads, + 0, "Number of queue processing threads"); TUNABLE_INT("net.graph.maxalloc", &maxalloc); SYSCTL_INT(_net_graph, OID_AUTO, maxalloc, CTLFLAG_RDTUN, &maxalloc, 0, "Maximum number of non-data queue items to allocate"); @@ -3064,7 +3075,9 @@ ng_mod_event(module_t mod, int event, vo static int ngb_mod_event(module_t mod, int event, void *data) { - int error = 0; + struct proc *p; + struct thread *td; + int i, error = 0; switch (event) { case MOD_LOAD: @@ -3091,7 +3104,18 @@ ngb_mod_event(module_t mod, int event, v ng_qdzone = uma_zcreate("NetGraph data items", sizeof(struct ng_item), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); uma_zone_set_max(ng_qdzone, maxdata); - netisr_register(NETISR_NETGRAPH, (netisr_t *)ngintr, NULL, 0); + /* Autoconfigure number of threads. */ + if (numthreads <= 0) + numthreads = mp_ncpus; + /* Create threads. */ + p = NULL; /* start with no process */ + for (i = 0; i < numthreads; i++) { + if (kproc_kthread_add(ngthread, NULL, &p, &td, + RFHIGHPID, 0, "ng_queue", "ng_queue%d", i)) { + numthreads = i; + break; + } + } break; case MOD_UNLOAD: /* You can't unload it because an interface may be using it. */ @@ -3246,25 +3270,20 @@ SYSCTL_PROC(_debug, OID_AUTO, ng_dump_it /*********************************************************************** * Worklist routines **********************************************************************/ -/* NETISR thread enters here */ /* * Pick a node off the list of nodes with work, - * try get an item to process off it. - * If there are no more, remove the node from the list. + * try get an item to process off it. Remove the node from the list. */ static void -ngintr(void) +ngthread(void *arg) { for (;;) { node_p node; /* Get node from the worklist. */ NG_WORKLIST_LOCK(); - node = STAILQ_FIRST(&ng_worklist); - if (!node) { - NG_WORKLIST_UNLOCK(); - break; - } + while ((node = STAILQ_FIRST(&ng_worklist)) == NULL) + NG_WORKLIST_SLEEP(); STAILQ_REMOVE_HEAD(&ng_worklist, nd_input_queue.q_work); NG_WORKLIST_UNLOCK(); CTR3(KTR_NET, "%20s: node [%x] (%p) taken off worklist", @@ -3320,9 +3339,9 @@ ng_worklist_add(node_p node) NG_WORKLIST_LOCK(); STAILQ_INSERT_TAIL(&ng_worklist, node, nd_input_queue.q_work); NG_WORKLIST_UNLOCK(); - schednetisr(NETISR_NETGRAPH); CTR3(KTR_NET, "%20s: node [%x] (%p) put on worklist", __func__, node->nd_ID, node); + NG_WORKLIST_WAKEUP(); } else { CTR3(KTR_NET, "%20s: node [%x] (%p) already on worklist", __func__, node->nd_ID, node); From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 20:26:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC57C106567B; Sun, 14 Dec 2008 20:26:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 86C118FC12; Sun, 14 Dec 2008 20:26:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id F330BFEF7; Mon, 15 Dec 2008 09:26:29 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTE420bcgnEn; Mon, 15 Dec 2008 09:26:25 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 15 Dec 2008 09:26:25 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 2CE711142E; Mon, 15 Dec 2008 09:26:25 +1300 (NZDT) Date: Sun, 14 Dec 2008 12:26:25 -0800 From: Andrew Thompson To: Poul-Henning Kamp Message-ID: <20081214202625.GB80520@citylink.fud.org.nz> References: <200812142003.mBEK3lRR069821@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812142003.mBEK3lRR069821@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186091 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 20:26:32 -0000 On Sun, Dec 14, 2008 at 08:03:47PM +0000, Poul-Henning Kamp wrote: > Author: phk > Date: Sun Dec 14 20:03:46 2008 > New Revision: 186091 > URL: http://svn.freebsd.org/changeset/base/186091 > > Log: > Move the code that injects received characters into the tty system into > a separate public function ucomrxchars(), to avoid requirement of > simple metadata prefixing on the USB data stream. > > Modified: > head/sys/dev/usb/ucom.c > head/sys/dev/usb/ucomvar.h > > Modified: head/sys/dev/usb/ucom.c > ============================================================================== > --- head/sys/dev/usb/ucom.c Sun Dec 14 19:39:53 2008 (r186090) > +++ head/sys/dev/usb/ucom.c Sun Dec 14 20:03:46 2008 (r186091) > @@ -700,11 +700,30 @@ ucomstartread(struct ucom_softc *sc) > return (USBD_NORMAL_COMPLETION); > } > > +void > +ucomrxchars(struct ucom_softc *sc, u_char *cp, u_int32_t cc) > +{ > + struct tty *tp = sc->sc_tty; > + > + /* Give characters to tty layer. */ > + while (cc > 0) { > + DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); > + if (ttydisc_rint(tp, *cp, 0) == -1) { > + /* XXX what should we do? */ > + printf("%s: lost %d chars\n", > + device_get_nameunit(sc->sc_dev), cc); > + break; > + } > + cc--; > + cp++; > + } > + ttydisc_rint_done(tp); > +} How about passing the whole buffer before doing a per-char handoff. Andrew Index: ucom.c =================================================================== --- ucom.c (revision 186092) +++ ucom.c (working copy) @@ -704,8 +704,15 @@ void ucomrxchars(struct ucom_softc *sc, u_char *cp, u_int32_t cc) { struct tty *tp = sc->sc_tty; + size_t len; /* Give characters to tty layer. */ + if (ttydisc_can_bypass(tp)) { + DPRINTFN(7, ("ucomreadcb: buf=%*D\n", cc, cp, "")); + len = ttydisc_rint_bypass(tp, cp, cc); + cp += len; + cc -= len; + } while (cc > 0) { DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); if (ttydisc_rint(tp, *cp, 0) == -1) { From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 22:24:52 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AB9A1065676; Sun, 14 Dec 2008 22:24:52 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from mta1.eidsiva.net (mta1.eidsiva.net [82.147.40.130]) by mx1.freebsd.org (Postfix) with ESMTP id 3654A8FC17; Sun, 14 Dec 2008 22:24:51 +0000 (UTC) (envelope-from lulf@FreeBSD.org) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcsANgVRUlX+AYSPGdsb2JhbACTSQEBAQE1uS6Cfg X-IronPort-AV: E=Sophos;i="4.36,220,1228086000"; d="scan'208";a="16410579" Received: from 18.6.erx-lhm.eidsiva.net (HELO @) ([87.248.6.18]) by mtc1.eidsiva.net with ESMTP; 14 Dec 2008 23:21:32 +0100 Date: Sun, 14 Dec 2008 22:21:33 +0100 From: Ulf Lilleengen To: Pawel Jakub Dawidek Message-ID: <20081214212133.GB3575@nobby> References: <200812131414.mBDEEu0A031376@svn.freebsd.org> <20081214192100.GB16926@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081214192100.GB16926@garage.freebsd.pl> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ... List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 22:24:52 -0000 On Sun, Dec 14, 2008 at 08:21:01PM +0100, Pawel Jakub Dawidek wrote: > On Sat, Dec 13, 2008 at 02:14:56PM +0000, Ulf Lilleengen wrote: > > Author: lulf > > Date: Sat Dec 13 14:14:56 2008 > > New Revision: 186038 > > URL: http://svn.freebsd.org/changeset/base/186038 > > > > Log: > > - When writing metadata to a geom provider, open the it as read-write since it > > might do subsequent reads from other providers. This stopped geli (and > > probably other classes using g_metadata_store as well) from being put on top > > of gvinum raid5 volumes. > > > > Note: > > The reason it fails in the gvinum raid5 case is that gvinum will read back the > > old parity stripe before calculating the new parity stripe to be written out > > again. The write will then fail because the underlying disk to be read is > > opened write only. > > I think we discussed this in the past. In my opinion this change is > incorrect. The intend here is to only write something, that's why I use > O_WRONLY. If gvinum/raid5 needs also read something to satisfy the > write, this is gvinum/raid5's internal detail and should be handled > there. RAID5 by design needs to read before it can write (in most > cases), does it mean that the O_WRONLY flag became bogus suddenly? No. > The flag given to open(2) describes caller's intend, not provider's > internals. > Nevermind, I can just add to acr for the internal providers when doing g_access right? -- Ulf Lilleengen From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 22:26:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D10161065670; Sun, 14 Dec 2008 22:26:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEC248FC08; Sun, 14 Dec 2008 22:26:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEMQvjP075813; Sun, 14 Dec 2008 22:26:57 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEMQv8X075811; Sun, 14 Dec 2008 22:26:57 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812142226.mBEMQv8X075811@svn.freebsd.org> From: Sam Leffler Date: Sun, 14 Dec 2008 22:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186094 - in head/sys/modules: . ath ath_rate_amrr ath_rate_onoe ath_rate_sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 22:26:58 -0000 Author: sam Date: Sun Dec 14 22:26:57 2008 New Revision: 186094 URL: http://svn.freebsd.org/changeset/base/186094 Log: Combine ath rate control modules with ath after bringing ath_hal src into the tree. The old split was balanced on module dependencies and symbol exposure that no longer exists. Users that want a module setup with rate control algorithm other than sample must override ATH_RATE in the ath module Makefile. Reviewed by: imp Deleted: head/sys/modules/ath_rate_amrr/ head/sys/modules/ath_rate_onoe/ head/sys/modules/ath_rate_sample/ Modified: head/sys/modules/Makefile head/sys/modules/ath/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Dec 14 20:15:30 2008 (r186093) +++ head/sys/modules/Makefile Sun Dec 14 22:26:57 2008 (r186094) @@ -30,9 +30,6 @@ SUBDIR= ${_3dfx} \ ${_asr} \ ata \ ath \ - ath_rate_amrr \ - ath_rate_onoe \ - ath_rate_sample \ aue \ ${_auxio} \ axe \ Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sun Dec 14 20:15:30 2008 (r186093) +++ head/sys/modules/ath/Makefile Sun Dec 14 22:26:57 2008 (r186094) @@ -29,44 +29,80 @@ # $FreeBSD$ # -.PATH: ${.CURDIR}/../../dev/ath \ - ${.CURDIR}/../../dev/ath/ath_hal \ - ${.CURDIR}/../../dev/ath/ath_hal/ar5210 \ - ${.CURDIR}/../../dev/ath/ath_hal/ar5211 \ - ${.CURDIR}/../../dev/ath/ath_hal/ar5212 \ - ${.CURDIR}/../../dev/ath/ath_hal/ar5416 +ATH_RATE?= sample # tx rate control algorithm -AR5210_SRCS=ah_eeprom_v1.c \ +.PATH: ${.CURDIR}/../../dev/ath +.PATH: ${.CURDIR}/../../dev/ath/ath_hal + +KMOD= if_ath +SRCS= if_ath.c if_ath_pci.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 + +# +# AR5210 support; these are first generation 11a-only devices. +# +.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5210 +SRCS+= ah_eeprom_v1.c \ ar5210_attach.c ar5210_beacon.c ar5210_interrupts.c \ ar5210_keycache.c ar5210_misc.c ar5210_phy.c ar5210_power.c \ ar5210_recv.c ar5210_reset.c ar5210_xmit.c -AR5211_SRCS=ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \ + +# +# AR5211 support; these are second generation 11b/g/a devices +# (but 11g was OFDM only and is not supported). +# +.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5211 +SRCS+= ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \ ar5211_keycache.c ar5211_misc.c ar5211_phy.c ar5211_power.c \ ar5211_recv.c ar5211_reset.c ar5211_xmit.c -AR5212_SRCS=ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \ + +# +# AR5212 support; this covers all other pci/cardbus legacy parts. +# +.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5212 +SRCS+= ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \ ar5212_gpio.c ar5212_interrupts.c ar5212_keycache.c ar5212_misc.c \ ar5212_phy.c ar5212_power.c ar5212_recv.c ar5212_reset.c \ - ar5212_rfgain.c ar5212_xmit.c \ - ar2413.c ar2425.c ar5111.c ar5112.c ar5413.c -AR5416_SRCS=ah_eeprom_v14.c \ + ar5212_rfgain.c ar5212_xmit.c +# RF backends +SRCS+= ar5111.c +SRCS+= ar5112.c +SRCS+= ar2413.c +SRCS+= ar2425.c +SRCS+= ar5413.c + +# +# AR5416, AR9160 support; these are 11n parts but only really +# supported (right now) operating in legacy mode. Note enabling +# this support requires defining AH_SUPPORT_AR5416 in opt_ah.h +# so the 11n tx/rx descriptor format is handled. +# +# NB: 9160 depends on 5416 but 5416 does not require 9160 +# +.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5416 +SRCS+= ah_eeprom_v14.c \ ar5416_ani.c ar5416_attach.c ar5416_beacon.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_recv.c \ - ar5416_reset.c ar5416_xmit.c \ - ar2133.c -AR9160_SRCS=ar9160_attach.c - -KMOD= if_ath -SRCS= if_ath.c if_ath_pci.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+= ${AR5210_SRCS} -SRCS+= ${AR5211_SRCS} -SRCS+= ${AR5212_SRCS} -SRCS+= ${AR5416_SRCS} -SRCS+= ${AR9160_SRCS} -SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h + ar5416_reset.c ar5416_xmit.c +SRCS+= ar9160_attach.c +# RF backend for 5416 and 9160 +SRCS+= ar2133.c + +# NB: rate control is bound to the driver by symbol names so only pick one +.if ${ATH_RATE} == "sample" +.PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample +SRCS+= sample.c opt_wlan.h +.elif ${ATH_RATE} == "onoe" +.PATH: ${.CURDIR}/../../dev/ath/ath_rate/onoe +SRCS+= onoe.c +.elif ${ATH_RATE} == "amrr" +.PATH: ${.CURDIR}/../../dev/ath/ath_rate/amrr +SRCS+= amrr.c +.endif CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 22:43:52 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D4C106564A; Sun, 14 Dec 2008 22:43:52 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from mta2.eidsiva.net (mta2.eidsiva.net [82.147.40.138]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0428FC1A; Sun, 14 Dec 2008 22:43:51 +0000 (UTC) (envelope-from lulf@FreeBSD.org) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcsALsTRUlX+AYSPGdsb2JhbACTSQEBAQE1uS6Cfg X-IronPort-AV: E=Sophos;i="4.36,220,1228086000"; d="scan'208";a="6698280" Received: from 18.6.erx-lhm.eidsiva.net (HELO @) ([87.248.6.18]) by mtc2.eidsiva.net with ESMTP; 14 Dec 2008 23:13:41 +0100 Date: Sun, 14 Dec 2008 22:13:41 +0100 From: Ulf Lilleengen To: Pawel Jakub Dawidek Message-ID: <20081214211341.GA3575@nobby> References: <200812131414.mBDEEu0A031376@svn.freebsd.org> <20081214192100.GB16926@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081214192100.GB16926@garage.freebsd.pl> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 22:43:52 -0000 On Sun, Dec 14, 2008 at 08:21:01PM +0100, Pawel Jakub Dawidek wrote: > On Sat, Dec 13, 2008 at 02:14:56PM +0000, Ulf Lilleengen wrote: > > Author: lulf > > Date: Sat Dec 13 14:14:56 2008 > > New Revision: 186038 > > URL: http://svn.freebsd.org/changeset/base/186038 > > > > Log: > > - When writing metadata to a geom provider, open the it as read-write since it > > might do subsequent reads from other providers. This stopped geli (and > > probably other classes using g_metadata_store as well) from being put on top > > of gvinum raid5 volumes. > > > > Note: > > The reason it fails in the gvinum raid5 case is that gvinum will read back the > > old parity stripe before calculating the new parity stripe to be written out > > again. The write will then fail because the underlying disk to be read is > > opened write only. > > I think we discussed this in the past. In my opinion this change is > incorrect. The intend here is to only write something, that's why I use > O_WRONLY. If gvinum/raid5 needs also read something to satisfy the > write, this is gvinum/raid5's internal detail and should be handled > there. RAID5 by design needs to read before it can write (in most > cases), does it mean that the O_WRONLY flag became bogus suddenly? No. > The flag given to open(2) describes caller's intend, not provider's > internals. > Hmm, I understand your reasoning. But how can gvinum read from these internal providers then? Is there some way to override this internally in GEOM? -- Ulf Lilleengen From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 22:48:48 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A10BD1065672; Sun, 14 Dec 2008 22:48:48 +0000 (UTC) (envelope-from murray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7F98FC08; Sun, 14 Dec 2008 22:48:48 +0000 (UTC) (envelope-from murray@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEMmmVF076329; Sun, 14 Dec 2008 22:48:48 GMT (envelope-from murray@svn.freebsd.org) Received: (from murray@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEMmmrS076328; Sun, 14 Dec 2008 22:48:48 GMT (envelope-from murray@svn.freebsd.org) Message-Id: <200812142248.mBEMmmrS076328@svn.freebsd.org> From: Murray Stokely Date: Sun, 14 Dec 2008 22:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186095 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 22:48:48 -0000 Author: murray Date: Sun Dec 14 22:48:48 2008 New Revision: 186095 URL: http://svn.freebsd.org/changeset/base/186095 Log: Add an ENVIRONMENT section to note that the RSH variable can be set to override the use of the rsh(1) program in rcmd(3). PR: docs/51133 Obtained from: NetBSD, partially MFC after: 3 weeks Modified: head/lib/libc/net/rcmd.3 Modified: head/lib/libc/net/rcmd.3 ============================================================================== --- head/lib/libc/net/rcmd.3 Sun Dec 14 22:26:57 2008 (r186094) +++ head/lib/libc/net/rcmd.3 Sun Dec 14 22:48:48 2008 (r186095) @@ -238,6 +238,13 @@ For .Fn rcmd_af , .Dv PF_UNSPEC is also allowed. +.Sh ENVIRONMENT +.Bl -tag -width RSH +.It Ev RSH +When using the +.Fn rcmd +function, this variable is used as the program to run instead of +.Xr rsh 1 . .Sh DIAGNOSTICS The .Fn rcmd From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 23:12:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57087106564A; Sun, 14 Dec 2008 23:12:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 456E08FC12; Sun, 14 Dec 2008 23:12:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBENCa0x076804; Sun, 14 Dec 2008 23:12:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBENCaor076803; Sun, 14 Dec 2008 23:12:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200812142312.mBENCaor076803@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 14 Dec 2008 23:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186096 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 23:12:37 -0000 Author: marcel Date: Sun Dec 14 23:12:36 2008 New Revision: 186096 URL: http://svn.freebsd.org/changeset/base/186096 Log: Add __packed to the part sub-structure to compensate for the 32-bit default structure alignment on ARM. Modified: head/sys/sys/vtoc.h Modified: head/sys/sys/vtoc.h ============================================================================== --- head/sys/sys/vtoc.h Sun Dec 14 22:48:48 2008 (r186095) +++ head/sys/sys/vtoc.h Sun Dec 14 23:12:36 2008 (r186096) @@ -72,7 +72,7 @@ struct vtoc8 { struct { uint16_t tag; uint16_t flag; - } part[VTOC8_NPARTS]; + } part[VTOC8_NPARTS] __packed; uint16_t __alignment; uint32_t bootinfo[3]; uint32_t sanity; From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 23:24:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE0E31065675; Sun, 14 Dec 2008 23:24:00 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC6E78FC17; Sun, 14 Dec 2008 23:24:00 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBENO0w7077038; Sun, 14 Dec 2008 23:24:00 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBENO0FE077037; Sun, 14 Dec 2008 23:24:00 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200812142324.mBENO0FE077037@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 14 Dec 2008 23:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186097 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 23:24:01 -0000 Author: phk Date: Sun Dec 14 23:24:00 2008 New Revision: 186097 URL: http://svn.freebsd.org/changeset/base/186097 Log: Make the tp pointer available for debugging. Modified: head/sys/dev/usb/ucom.c Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Sun Dec 14 23:12:36 2008 (r186096) +++ head/sys/dev/usb/ucom.c Sun Dec 14 23:24:00 2008 (r186097) @@ -724,10 +724,12 @@ static void ucomreadcb(usbd_xfer_handle xfer, usbd_private_handle p, usbd_status status) { struct ucom_softc *sc = (struct ucom_softc *)p; + struct tty *tp = sc->sc_tty; usbd_status err; u_int32_t cc; u_char *cp; + (void)tp; /* Used for debugging */ DPRINTF(("ucomreadcb: status = %d\n", status)); if (status != USBD_NORMAL_COMPLETION) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 00:29:26 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C06D71065672; Mon, 15 Dec 2008 00:29:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADAF68FC12; Mon, 15 Dec 2008 00:29:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF0TQWM078246; Mon, 15 Dec 2008 00:29:26 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF0TQVW078245; Mon, 15 Dec 2008 00:29:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150029.mBF0TQVW078245@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 00:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186098 - head/sys/dev/ath/ath_hal/ar5312 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 00:29:26 -0000 Author: sam Date: Mon Dec 15 00:29:26 2008 New Revision: 186098 URL: http://svn.freebsd.org/changeset/base/186098 Log: fix ini setup Submitted by: Jiri Fojtasek Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Sun Dec 14 23:24:00 2008 (r186097) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Mon Dec 15 00:29:26 2008 (r186098) @@ -122,7 +122,7 @@ ar5312Attach(uint16_t devid, HAL_SOFTC s /* setup common ini data; rf backends handle remainder */ HAL_INI_INIT(&ahp->ah_ini_modes, ar5212Modes, 6); - HAL_INI_INIT(&ahp->ah_ini_common, ar5212Common, 6); + HAL_INI_INIT(&ahp->ah_ini_common, ar5212Common, 2); if (!ar5312ChipReset(ah, AH_NULL)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 00:43:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A8241065675; Mon, 15 Dec 2008 00:43:01 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-bw0-f14.google.com (mail-bw0-f14.google.com [209.85.218.14]) by mx1.freebsd.org (Postfix) with ESMTP id 64E268FC18; Mon, 15 Dec 2008 00:43:00 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by bwz7 with SMTP id 7so5749264bwz.19 for ; Sun, 14 Dec 2008 16:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=kXj3qOtIe3yBa25CTHCtt/hwdLqjSA3FR2tij/Nk9EE=; b=WxdhtVST4qmf06G0KuZQzR5JU7aY85iM85EuqeAJLKhLy/tSUH3JJEaeYTfH8FIqJQ ZZSdeJbi34p1Mm6TiHBYQVVMln92IsWbyDd43Va4Ixo9nooi6YsvXV9tqr//zMWCvpfZ aFEEPgk8Kebu4bGmlQl4B++y3gaow/SIklxFY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=UOKLhoepeJRYpZfUiR6ZeRSF8sUToesE2aGYFSG/lRbDCDcE7kalxFRrepfsX/DOYz jnIeXiYaS37Tt8inDWUrEnKwfcZMYMaE5BqeO3lmQ1DOBXbDsaWHxnzxdjKWH4SCcVeh zacsRcTFmcm2107NEyDJI3S2PNnOnN67yB/iQ= Received: by 10.181.134.12 with SMTP id l12mr2322238bkn.26.1229301778951; Sun, 14 Dec 2008 16:42:58 -0800 (PST) Received: by 10.181.203.1 with HTTP; Sun, 14 Dec 2008 16:42:58 -0800 (PST) Message-ID: <9bbcef730812141642m554913cau6121a2f51458a49f@mail.gmail.com> Date: Mon, 15 Dec 2008 01:42:58 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Ulf Lilleengen" In-Reply-To: <20081214211341.GA3575@nobby> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200812131414.mBDEEu0A031376@svn.freebsd.org> <20081214192100.GB16926@garage.freebsd.pl> <20081214211341.GA3575@nobby> X-Google-Sender-Auth: ba9bcd3d69489adf Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 00:43:01 -0000 2008/12/14 Ulf Lilleengen : > On Sun, Dec 14, 2008 at 08:21:01PM +0100, Pawel Jakub Dawidek wrote: >> On Sat, Dec 13, 2008 at 02:14:56PM +0000, Ulf Lilleengen wrote: >> > Author: lulf >> > Date: Sat Dec 13 14:14:56 2008 >> > New Revision: 186038 >> > URL: http://svn.freebsd.org/changeset/base/186038 >> > >> > Log: >> > - When writing metadata to a geom provider, open the it as read-write since it >> > might do subsequent reads from other providers. This stopped geli (and >> > probably other classes using g_metadata_store as well) from being put on top >> > of gvinum raid5 volumes. >> > >> > Note: >> > The reason it fails in the gvinum raid5 case is that gvinum will read back the >> > old parity stripe before calculating the new parity stripe to be written out >> > again. The write will then fail because the underlying disk to be read is >> > opened write only. >> >> I think we discussed this in the past. In my opinion this change is >> incorrect. The intend here is to only write something, that's why I use >> O_WRONLY. If gvinum/raid5 needs also read something to satisfy the >> write, this is gvinum/raid5's internal detail and should be handled >> there. RAID5 by design needs to read before it can write (in most >> cases), does it mean that the O_WRONLY flag became bogus suddenly? No. >> The flag given to open(2) describes caller's intend, not provider's >> internals. >> > Hmm, I understand your reasoning. But how can gvinum read from these internal > providers then? Is there some way to override this internally in GEOM? Can't you just convert (0,1,x) permission to (1,1,x) in your g_access? (i.e. convert all write-only openings to read-write) From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 00:47:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D11E71065672; Mon, 15 Dec 2008 00:47:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37858FC1F; Mon, 15 Dec 2008 00:47:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF0lO2h079014; Mon, 15 Dec 2008 00:47:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF0lObJ079009; Mon, 15 Dec 2008 00:47:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150047.mBF0lObJ079009@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 00:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186099 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 00:47:25 -0000 Author: sam Date: Mon Dec 15 00:47:24 2008 New Revision: 186099 URL: http://svn.freebsd.org/changeset/base/186099 Log: Replace adhoc checks in ieee80211_start with a per-node flag that indicates if an association id is required before outbound traffic is permitted. This cleans up the previous change that broke mcast traffic "to the stack" in ap mode as a side effect. Reviewed by: sephe, thompsa, weongyo Modified: head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Mon Dec 15 00:29:26 2008 (r186098) +++ head/sys/net80211/ieee80211_ddb.c Mon Dec 15 00:47:24 2008 (r186099) @@ -92,7 +92,8 @@ __FBSDID("$FreeBSD$"); #define IEEE80211_NODE_BITS \ "\20\1AUTH\2QOS\3ERP\5PWR_MGT\6AREF\7HT\10HTCOMPAT\11WPS\12TSN" \ - "\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS\20SGI20\21SGI40" + "\13AMPDU_RX\14AMPDU_TX\15MIMO_PS\16MIMO_RTS\17RIFS\20SGI20\21SGI40" \ + "\22ASSOCID" #define IEEE80211_ERP_BITS \ "\20\1NON_ERP_PRESENT\2USE_PROTECTION\3LONG_PREAMBLE" Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Mon Dec 15 00:29:26 2008 (r186098) +++ head/sys/net80211/ieee80211_hostap.c Mon Dec 15 00:47:24 2008 (r186099) @@ -928,6 +928,11 @@ hostap_auth_open(struct ieee80211_node * * after the transaction completes. */ ni->ni_flags |= IEEE80211_NODE_AREF; + /* + * Mark the node as requiring a valid associatio id + * before outbound traffic is permitted. + */ + ni->ni_flags |= IEEE80211_NODE_ASSOCID; if (vap->iv_acl != NULL && vap->iv_acl->iac_getpolicy(vap) == IEEE80211_MACCMD_POLICY_RADIUS) { @@ -1054,6 +1059,11 @@ hostap_auth_shared(struct ieee80211_node * after the transaction completes. */ ni->ni_flags |= IEEE80211_NODE_AREF; + /* + * Mark the node as requiring a valid associatio id + * before outbound traffic is permitted. + */ + ni->ni_flags |= IEEE80211_NODE_ASSOCID; IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = noise; ni->ni_rstamp = rstamp; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Mon Dec 15 00:29:26 2008 (r186098) +++ head/sys/net80211/ieee80211_node.c Mon Dec 15 00:47:24 2008 (r186099) @@ -732,6 +732,7 @@ ieee80211_sta_join(struct ieee80211vap * ni->ni_erp = se->se_erp; IEEE80211_RSSI_LPF(ni->ni_avgrssi, se->se_rssi); ni->ni_noise = se->se_noise; + ni->ni_flags |= IEEE80211_NODE_ASSOCID; if (ieee80211_ies_init(&ni->ni_ies, se->se_ies.data, se->se_ies.len)) { ieee80211_ies_expand(&ni->ni_ies); @@ -898,8 +899,10 @@ node_cleanup(struct ieee80211_node *ni) * has happened. This is probably not needed as the node * should always be removed from the table so not found but * do it just in case. + * Likewise clear the ASSOCID flag as these flags are intended + * to be managed in tandem. */ - ni->ni_flags &= ~IEEE80211_NODE_AREF; + ni->ni_flags &= ~(IEEE80211_NODE_AREF | IEEE80211_NODE_ASSOCID); /* * Drain power save queue and, if needed, clear TIM. @@ -1511,19 +1514,8 @@ ieee80211_find_txnode(struct ieee80211va vap->iv_opmode == IEEE80211_M_WDS || IEEE80211_IS_MULTICAST(macaddr)) ni = ieee80211_ref_node(vap->iv_bss); - else { + else ni = ieee80211_find_node_locked(nt, macaddr); - if (vap->iv_opmode == IEEE80211_M_HOSTAP && - (ni != NULL && ni->ni_associd == 0)) { - /* - * Station is not associated; don't permit the - * data frame to be sent by returning NULL. This - * is kinda a kludge but the least intrusive way - * to add this check into all drivers. - */ - ieee80211_unref_node(&ni); /* NB: null's ni */ - } - } IEEE80211_NODE_UNLOCK(nt); if (ni == NULL) { Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Mon Dec 15 00:29:26 2008 (r186098) +++ head/sys/net80211/ieee80211_node.h Mon Dec 15 00:47:24 2008 (r186099) @@ -117,6 +117,7 @@ struct ieee80211_node { #define IEEE80211_NODE_RIFS 0x004000 /* RIFS enabled */ #define IEEE80211_NODE_SGI20 0x008000 /* Short GI in HT20 enabled */ #define IEEE80211_NODE_SGI40 0x010000 /* Short GI in HT40 enabled */ +#define IEEE80211_NODE_ASSOCID 0x020000 /* xmit requires associd */ uint16_t ni_associd; /* association ID */ uint16_t ni_vlan; /* vlan tag */ uint16_t ni_txpower; /* current transmit power */ Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Dec 15 00:29:26 2008 (r186098) +++ head/sys/net80211/ieee80211_output.c Mon Dec 15 00:47:24 2008 (r186099) @@ -203,10 +203,8 @@ ieee80211_start(struct ifnet *ifp) continue; } /* XXX AUTH'd */ - /* XXX mark vap to identify if associd is required */ if (ni->ni_associd == 0 && - (vap->iv_opmode == IEEE80211_M_STA || - vap->iv_opmode == IEEE80211_M_HOSTAP || IS_DWDS(vap))) { + (ni->ni_flags & IEEE80211_NODE_ASSOCID)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, eh->ether_dhost, NULL, "sta not associated (type 0x%04x)", From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:00:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A76B1065676; Mon, 15 Dec 2008 01:00:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAF0C8FC0C; Mon, 15 Dec 2008 01:00:18 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF10INu079336; Mon, 15 Dec 2008 01:00:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF10IJk079334; Mon, 15 Dec 2008 01:00:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150100.mBF10IJk079334@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186100 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:00:21 -0000 Author: sam Date: Mon Dec 15 01:00:18 2008 New Revision: 186100 URL: http://svn.freebsd.org/changeset/base/186100 Log: Improve regdomain.xml parser: o store XML_Parser in the state block so we can report line numbers for errors o complain about netband w/o mode o complain about unknown modes o complain about band w/o enclosing netband o complain about duplicate freqband o complain about unknown channel flags o complain about band w/o freqband's o complain about band w/o maxpower o complain about country w/o ISO cc o complain about country w/o regdomain reference Modified: head/sbin/ifconfig/regdomain.c head/sbin/ifconfig/regdomain.h Modified: head/sbin/ifconfig/regdomain.c ============================================================================== --- head/sbin/ifconfig/regdomain.c Mon Dec 15 00:47:24 2008 (r186099) +++ head/sbin/ifconfig/regdomain.c Mon Dec 15 01:00:18 2008 (r186100) @@ -48,6 +48,7 @@ static const char rcsid[] = "$FreeBSD$"; #define MAXLEVEL 20 struct mystate { + XML_Parser parser; struct regdata *rdp; struct regdomain *rd; /* current domain */ struct netband *netband; /* current netband */ @@ -107,7 +108,8 @@ start_element(void *data, const char *na } if (iseq(name, "netband") && mt->curband == NULL && mt->rd != NULL) { if (mode == NULL) { - /* XXX complain */ + warnx("no mode for netband at line %ld", + XML_GetCurrentLineNumber(mt->parser)); return; } if (iseq(mode, "11b")) @@ -120,12 +122,16 @@ start_element(void *data, const char *na mt->curband = &mt->rd->bands_11ng; else if (iseq(mode, "11na")) mt->curband = &mt->rd->bands_11na; - /* XXX else complain */ + else + warnx("unknown mode \"%s\" at line %ld", + __DECONST(char *, mode), + XML_GetCurrentLineNumber(mt->parser)); return; } if (iseq(name, "band") && mt->netband == NULL) { if (mt->curband == NULL) { - /* XXX complain */ + warnx("band without enclosing netband at line %ld", + XML_GetCurrentLineNumber(mt->parser)); return; } mt->netband = calloc(1, sizeof(struct netband)); @@ -135,6 +141,8 @@ start_element(void *data, const char *na if (iseq(name, "freqband") && mt->freqband == NULL && mt->netband != NULL) { /* XXX handle inlines and merge into table? */ if (mt->netband->band != NULL) { + warnx("duplicate freqband at line %ld ignored", + XML_GetCurrentLineNumber(mt->parser)); /* XXX complain */ } else mt->netband->band = (void *)strdup(ref); @@ -144,6 +152,7 @@ start_element(void *data, const char *na if (iseq(name, "country") && mt->country == NULL) { mt->country = calloc(1, sizeof(struct country)); mt->country->isoname = strdup(id); + mt->country->code = NO_COUNTRY; mt->nident++; LIST_INSERT_HEAD(&mt->rdp->countries, mt->country, next); return; @@ -159,8 +168,8 @@ start_element(void *data, const char *na #undef iseq } -static uint32_t -decode_flag(const char *p, int len) +static int +decode_flag(struct mystate *mt, const char *p, int len) { #define iseq(a,b) (strcasecmp(a,b) == 0) static const struct { @@ -168,7 +177,7 @@ decode_flag(const char *p, int len) int len; uint32_t value; } flags[] = { -#define FLAG(x) { #x, sizeof(#x), x } +#define FLAG(x) { #x, sizeof(#x)-1, x } FLAG(IEEE80211_CHAN_A), FLAG(IEEE80211_CHAN_B), FLAG(IEEE80211_CHAN_G), @@ -205,6 +214,8 @@ decode_flag(const char *p, int len) for (i = 0; i < sizeof(flags)/sizeof(flags[0]); i++) if (len == flags[i].len && iseq(p, flags[i].name)) return flags[i].value; + warnx("unknown flag \"%.*s\" at line %ld ignored", + len, p, XML_GetCurrentLineNumber(mt->parser)); return 0; #undef iseq } @@ -241,11 +252,12 @@ end_element(void *data, const char *name } if (iseq(name, "flags")) { if (mt->freqband != NULL) - mt->freqband->flags |= decode_flag(p, len); + mt->freqband->flags |= decode_flag(mt, p, len); else if (mt->netband != NULL) - mt->netband->flags |= decode_flag(p, len); + mt->netband->flags |= decode_flag(mt, p, len); else { - /* XXX complain */ + warnx("flags without freqband or netband at line %ld ignored", + XML_GetCurrentLineNumber(mt->parser)); } goto done; } @@ -289,7 +301,8 @@ end_element(void *data, const char *name } if (len != 0) { - printf("Unexpected XML: name \"%s\" data \"%s\"\n", name, p); + warnx("unexpected XML token \"%s\" data \"%s\" at line %ld", + name, p, XML_GetCurrentLineNumber(mt->parser)); /* XXX goto done? */ } /* */ @@ -307,15 +320,12 @@ end_element(void *data, const char *name /* */ if (iseq(name, "band") && mt->netband != NULL) { if (mt->netband->band == NULL) { - printf("No frequency band information at line %d\n", -#if 0 - XML_GetCurrentLineNumber(parser)); -#else - 0); -#endif + warnx("no freqbands for band at line %ld", + XML_GetCurrentLineNumber(mt->parser)); } if (mt->netband->maxPower == 0) { - /* XXX complain */ + warnx("no maxpower for band at line %ld", + XML_GetCurrentLineNumber(mt->parser)); } /* default max power w/ DFS to max power */ if (mt->netband->maxPowerDFS == 0) @@ -330,14 +340,17 @@ end_element(void *data, const char *name } /* */ if (iseq(name, "country") && mt->country != NULL) { - if (mt->country->code == 0) { - /* XXX must have iso cc */ + if (mt->country->code == NO_COUNTRY) { + warnx("no ISO cc for country at line %ld", + XML_GetCurrentLineNumber(mt->parser)); } if (mt->country->name == NULL) { - /* XXX must have name */ + warnx("no name for country at line %ld", + XML_GetCurrentLineNumber(mt->parser)); } if (mt->country->rd == NULL) { - /* XXX? rd ref? */ + warnx("no regdomain reference for country at line %ld", + XML_GetCurrentLineNumber(mt->parser)); } mt->country = NULL; goto done; @@ -383,7 +396,6 @@ findid(struct regdata *rdp, const void * int lib80211_regdomain_readconfig(struct regdata *rdp, const void *p, size_t len) { - XML_Parser parser; struct mystate *mt; struct regdomain *dp; struct country *cp; @@ -398,17 +410,17 @@ lib80211_regdomain_readconfig(struct reg return ENOMEM; /* parse the XML input */ mt->rdp = rdp; - parser = XML_ParserCreate(NULL); - XML_SetUserData(parser, mt); - XML_SetElementHandler(parser, start_element, end_element); - XML_SetCharacterDataHandler(parser, char_data); - if (XML_Parse(parser, p, len, 1) != XML_STATUS_OK) { + mt->parser = XML_ParserCreate(NULL); + XML_SetUserData(mt->parser, mt); + XML_SetElementHandler(mt->parser, start_element, end_element); + XML_SetCharacterDataHandler(mt->parser, char_data); + if (XML_Parse(mt->parser, p, len, 1) != XML_STATUS_OK) { warnx("%s: %s at line %ld", __func__, - XML_ErrorString(XML_GetErrorCode(parser)), - XML_GetCurrentLineNumber(parser)); + XML_ErrorString(XML_GetErrorCode(mt->parser)), + XML_GetCurrentLineNumber(mt->parser)); return -1; } - XML_ParserFree(parser); + XML_ParserFree(mt->parser); /* setup the identifer table */ rdp->ident = calloc(sizeof(struct ident), mt->nident + 1); Modified: head/sbin/ifconfig/regdomain.h ============================================================================== --- head/sbin/ifconfig/regdomain.h Mon Dec 15 00:47:24 2008 (r186099) +++ head/sbin/ifconfig/regdomain.h Mon Dec 15 01:00:18 2008 (r186100) @@ -73,6 +73,7 @@ struct regdomain { struct country { enum ISOCountryCode code; +#define NO_COUNTRY 0xffff const struct regdomain *rd; const char* isoname; const char* name; From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:06:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95DA31065675; Mon, 15 Dec 2008 01:06:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829708FC17; Mon, 15 Dec 2008 01:06:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF16ngY079548; Mon, 15 Dec 2008 01:06:49 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF16n3l079546; Mon, 15 Dec 2008 01:06:49 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150106.mBF16n3l079546@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186101 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:06:49 -0000 Author: sam Date: Mon Dec 15 01:06:49 2008 New Revision: 186101 URL: http://svn.freebsd.org/changeset/base/186101 Log: o distinguish between adhoc and ahdemo modes o do not require 1/2 and 1/4 rate channels be present in the calibration list when doing a gsm regulatory change; the existing 900MHz cards are not self-identifying so there is no way (using the calibration channel list) to check Modified: head/sbin/ifconfig/ifieee80211.c head/sbin/ifconfig/ifvlan.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:00:18 2008 (r186100) +++ head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:06:49 2008 (r186101) @@ -1770,14 +1770,21 @@ regdomain_addchans(struct ieee80211req_c printf("%u: skip, flags 0x%x not available\n", freq, chanFlags); continue; } + /* + * NB: don't enforce 1/2 and 1/4 rate channels being + * specified in the device's calibration list for + * 900MHz cards because most are not self-identifying. + */ if ((flags & IEEE80211_CHAN_HALF) && - (chanFlags & IEEE80211_CHAN_HALF) == 0) { + ((chanFlags & IEEE80211_CHAN_HALF) == 0 && + (flags & IEEE80211_CHAN_GSM) == 0)) { if (verbose) printf("%u: skip, device does not support half-rate channels\n", freq); continue; } if ((flags & IEEE80211_CHAN_QUARTER) && - (chanFlags & IEEE80211_CHAN_QUARTER) == 0) { + ((chanFlags & IEEE80211_CHAN_HALF) == 0 && + (flags & IEEE80211_CHAN_GSM) == 0)) { if (verbose) printf("%u: skip, device does not support quarter-rate channels\n", freq); continue; @@ -3534,8 +3541,12 @@ get80211opmode(int s) (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { - if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) - return IEEE80211_M_IBSS; /* XXX ahdemo */ + if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) { + if (ifmr.ifm_current & IFM_FLAG0) + return IEEE80211_M_AHDEMO; + else + return IEEE80211_M_IBSS; + } if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) return IEEE80211_M_HOSTAP; if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) @@ -4244,6 +4255,7 @@ end: } } } + if (get80211val(s, IEEE80211_IOC_BEACON_INTERVAL, &val) != -1) { /* XXX default define not visible */ if (val != 100 || verbose) Modified: head/sbin/ifconfig/ifvlan.c ============================================================================== --- head/sbin/ifconfig/ifvlan.c Mon Dec 15 01:00:18 2008 (r186100) +++ head/sbin/ifconfig/ifvlan.c Mon Dec 15 01:06:49 2008 (r186101) @@ -119,10 +119,9 @@ vlan_set(int s, struct ifreq *ifr) } } -static -DECL_CMD_FUNC(setvlantag, val, d) +static void +getvlantag(const char *val) { - struct vlanreq vreq; u_long ul; char *endp; @@ -133,24 +132,42 @@ DECL_CMD_FUNC(setvlantag, val, d) /* check if the value can be represented in vlr_tag */ if (params.vlr_tag != ul) errx(1, "value for vlan out of range"); +} - if (getvlan(s, &ifr, &vreq) != -1) - vlan_set(s, &ifr); - else - clone_setcallback(vlan_create); +static +DECL_CMD_FUNC(setvlantag_clone, val, d) +{ + getvlantag(val); + clone_setcallback(vlan_create); } static -DECL_CMD_FUNC(setvlandev, val, d) +DECL_CMD_FUNC(setvlantag, val, d) { struct vlanreq vreq; + getvlantag(val); + if (getvlan(s, &ifr, &vreq) == -1) + errx(1, "no existing vlan"); + vlan_set(s, &ifr); +} + +static +DECL_CMD_FUNC(setvlandev_clone, val, d) +{ strlcpy(params.vlr_parent, val, sizeof(params.vlr_parent)); + clone_setcallback(vlan_create); +} + +static +DECL_CMD_FUNC(setvlandev, val, d) +{ + struct vlanreq vreq; + strlcpy(params.vlr_parent, val, sizeof(params.vlr_parent)); if (getvlan(s, &ifr, &vreq) != -1) - vlan_set(s, &ifr); - else - clone_setcallback(vlan_create); + errx(1, "no existing vlan"); + vlan_set(s, &ifr); } static @@ -172,8 +189,8 @@ DECL_CMD_FUNC(unsetvlandev, val, d) } static struct cmd vlan_cmds[] = { - DEF_CLONE_CMD_ARG("vlan", setvlantag), - DEF_CLONE_CMD_ARG("vlandev", setvlandev), + DEF_CLONE_CMD_ARG("vlan", setvlantag_clone), + DEF_CLONE_CMD_ARG("vlandev", setvlandev_clone), /* NB: non-clone cmds */ DEF_CMD_ARG("vlan", setvlantag), DEF_CMD_ARG("vlandev", setvlandev), From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:09:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA681065672; Mon, 15 Dec 2008 01:09:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9B1E8FC17; Mon, 15 Dec 2008 01:09:01 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF19165079635; Mon, 15 Dec 2008 01:09:01 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF191l2079634; Mon, 15 Dec 2008 01:09:01 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150109.mBF191l2079634@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186102 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:09:02 -0000 Author: sam Date: Mon Dec 15 01:09:01 2008 New Revision: 186102 URL: http://svn.freebsd.org/changeset/base/186102 Log: 0 is a potential ISO CC; use new NO_COUNTRY #define to identify when the CC is not set. Note NO_COUNTRY is set to 0xffff for now (must be 16 bits as ieee80211_regdomain struct defines sku's and cc's as uint16_t which may need fixing). Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:06:49 2008 (r186101) +++ head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:09:01 2008 (r186102) @@ -425,7 +425,7 @@ setregdomain_cb(int s, void *arg) struct ieee80211_devcaps_req dc; struct regdata *rdp = getregdata(); - if (rd->country != 0) { + if (rd->country != NO_COUNTRY) { const struct country *cc; /* * Check current country seting to make sure it's @@ -456,7 +456,7 @@ setregdomain_cb(int s, void *arg) errx(1, "country %s (%s) is not usable with " "regdomain %d", cc->isoname, cc->name, rd->regdomain); - else if (rp->cc != 0 && rp->cc != cc) + else if (rp->cc != NULL && rp->cc != cc) errx(1, "country %s (%s) is not usable with " "regdomain %s", cc->isoname, cc->name, rp->name); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:10:08 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF3ED1065672; Mon, 15 Dec 2008 01:10:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC8918FC0C; Mon, 15 Dec 2008 01:10:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF1A8LC079694; Mon, 15 Dec 2008 01:10:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF1A8g3079693; Mon, 15 Dec 2008 01:10:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150110.mBF1A8g3079693@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186103 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:10:09 -0000 Author: sam Date: Mon Dec 15 01:10:08 2008 New Revision: 186103 URL: http://svn.freebsd.org/changeset/base/186103 Log: fix handling of unknown country codes; atoi doesn't return -1 for an invalid string as I thought; so use strtol instead Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:09:01 2008 (r186102) +++ head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:10:08 2008 (r186103) @@ -1982,8 +1982,12 @@ DECL_CMD_FUNC(set80211country, val, d) cc = lib80211_country_findbyname(rdp, val); if (cc == NULL) { - cc = lib80211_country_findbycc(rdp, atoi(val)); - if (cc == NULL) + char *eptr; + long code = strtol(val, &eptr, 0); + + if (eptr != val) + cc = lib80211_country_findbycc(rdp, code); + if (eptr == val || cc == NULL) errx(1, "unknown ISO country code %s", val); } getregdomain(s); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:10:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3411065672; Mon, 15 Dec 2008 01:10:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 287BE8FC16; Mon, 15 Dec 2008 01:10:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF1ArmL079742; Mon, 15 Dec 2008 01:10:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF1ArWe079741; Mon, 15 Dec 2008 01:10:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150110.mBF1ArWe079741@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186104 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:10:53 -0000 Author: sam Date: Mon Dec 15 01:10:52 2008 New Revision: 186104 URL: http://svn.freebsd.org/changeset/base/186104 Log: fix handling of sku codes like country codes Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:10:08 2008 (r186103) +++ head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:10:52 2008 (r186104) @@ -1958,8 +1958,12 @@ DECL_CMD_FUNC(set80211regdomain, val, d) rd = lib80211_regdomain_findbyname(rdp, val); if (rd == NULL) { - rd = lib80211_regdomain_findbysku(rdp, atoi(val)); - if (rd == NULL) + char *eptr; + long sku = strtol(val, &eptr, 0); + + if (eptr != val) + rd = lib80211_regdomain_findbysku(rdp, sku); + if (eptr == val || rd == NULL) errx(1, "unknown regdomain %s", val); } getregdomain(s); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:15:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFD0106564A; Mon, 15 Dec 2008 01:15:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7E6F8FC16; Mon, 15 Dec 2008 01:15:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF1FF53079880; Mon, 15 Dec 2008 01:15:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF1FFEj079879; Mon, 15 Dec 2008 01:15:15 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150115.mBF1FFEj079879@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186105 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:15:15 -0000 Author: sam Date: Mon Dec 15 01:15:15 2008 New Revision: 186105 URL: http://svn.freebsd.org/changeset/base/186105 Log: move channel parsing to a getchannel routine so it can be reused to check the channel argument supplied to chanswitch Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:10:52 2008 (r186104) +++ head/sbin/ifconfig/ifieee80211.c Mon Dec 15 01:15:15 2008 (r186105) @@ -664,30 +664,38 @@ getchannelflags(const char *val, int fre } static void -set80211channel(const char *val, int d, int s, const struct afswtch *rafp) +getchannel(int s, struct ieee80211_channel *chan, const char *val) { - struct ieee80211_channel chan; - - memset(&chan, 0, sizeof(chan)); - if (!isanyarg(val)) { - int v, flags; - char *ep; + int v, flags; + char *eptr; - getchaninfo(s); - v = strtol(val, &ep, 10); - if (val[0] == '\0' || val == ep || errno == ERANGE || - /* channel may be suffixed with nothing, :flag, or /width */ - (ep[0] != '\0' && ep[0] != ':' && ep[0] != '/')) - errx(1, "invalid channel specification"); - flags = getchannelflags(val, v); - if (v > 255) { /* treat as frequency */ - mapfreq(&chan, v, flags); - } else { - mapchan(&chan, v, flags); - } + memset(chan, 0, sizeof(*chan)); + if (isanyarg(val)) { + chan->ic_freq = IEEE80211_CHAN_ANY; + return; + } + getchaninfo(s); + errno = 0; + v = strtol(val, &eptr, 10); + if (val[0] == '\0' || val == eptr || errno == ERANGE || + /* channel may be suffixed with nothing, :flag, or /width */ + (eptr[0] != '\0' && eptr[0] != ':' && eptr[0] != '/')) + errx(1, "invalid channel specification%s", + errno == ERANGE ? " (out of range)" : ""); + flags = getchannelflags(val, v); + if (v > 255) { /* treat as frequency */ + mapfreq(chan, v, flags); } else { - chan.ic_freq = IEEE80211_CHAN_ANY; + mapchan(chan, v, flags); } +} + +static void +set80211channel(const char *val, int d, int s, const struct afswtch *rafp) +{ + struct ieee80211_channel chan; + + getchannel(s, &chan, val); set80211(s, IEEE80211_IOC_CURCHAN, 0, sizeof(chan), &chan); } @@ -695,17 +703,8 @@ static void set80211chanswitch(const char *val, int d, int s, const struct afswtch *rafp) { struct ieee80211_chanswitch_req csr; - int v, flags; - memset(&csr, 0, sizeof(csr)); - getchaninfo(s); - v = atoi(val); - flags = getchannelflags(val, v); - if (v > 255) { /* treat as frequency */ - mapfreq(&csr.csa_chan, v, flags); - } else { - mapchan(&csr.csa_chan, v, flags); - } + getchannel(s, &csr.csa_chan, val); csr.csa_mode = 1; csr.csa_count = 5; set80211(s, IEEE80211_IOC_CHANSWITCH, 0, sizeof(csr), &csr); From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 01:18:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE3D7106564A; Mon, 15 Dec 2008 01:18:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B5898FC1B; Mon, 15 Dec 2008 01:18:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBF1IB1H079971; Mon, 15 Dec 2008 01:18:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBF1IBAo079970; Mon, 15 Dec 2008 01:18:11 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812150118.mBF1IBAo079970@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Dec 2008 01:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186106 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2008 01:18:11 -0000 Author: sam Date: Mon Dec 15 01:18:11 2008 New Revision: 186106 URL: http://svn.freebsd.org/changeset/base/186106 Log: o fix DEBUG sku definition o add definitions for 900MHz radios: Ubiquiti SR9 and XR9, and ZComax GZ-901 Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Mon Dec 15 01:15:15 2008 (r186105) +++ head/etc/regdomain.xml Mon Dec 15 01:18:11 2008 (r186106) @@ -39,7 +39,7 @@ --> DEBUG - 0 + 0x1ff @@ -1080,6 +1080,75 @@ + + + SR9 + 0x0298 + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + + + XR9 + 0x299 + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + + + GZ901 + 0x29a + + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + + 30 + IEEE80211_CHAN_G + + + @@ -1201,6 +1270,9 @@ 320 Guatemala + + 5002 ZComax GZ-901 + 340 Honduras @@ -1396,6 +1468,12 @@ 792 Turkey + + 5000 Ubiquiti SR9 + + + 5001 Ubiquiti XR9 + 804 Ukraine @@ -1426,6 +1504,10 @@ 716 Zimbabwe + + + 0 Debug + 165820 170878 --> 170959 173195 --> 173328 176810 --> 178718 These two changes were not propagated back to stable/6 and are cosmetic. 173196 white space 173214 dup .Pp sort SEE ALSO The following checkins implement: 182911 fixups for fwcontrol for multiple firewire boards add commandline ability to parse multiple arguments 182048 man page cleanups and usage() display updates 185996 add NetBSD compatibility in compile Modified: stable/6/usr.sbin/fwcontrol/ (props changed) stable/6/usr.sbin/fwcontrol/fwcontrol.8 stable/6/usr.sbin/fwcontrol/fwcontrol.c stable/6/usr.sbin/fwcontrol/fwmpegts.c Modified: stable/6/usr.sbin/fwcontrol/fwcontrol.8 ============================================================================== --- stable/6/usr.sbin/fwcontrol/fwcontrol.8 Thu Dec 18 04:50:44 2008 (r186266) +++ stable/6/usr.sbin/fwcontrol/fwcontrol.8 Thu Dec 18 04:58:22 2008 (r186267) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd September 12, 2008 .Dt FWCONTROL 8 .Os .Sh NAME @@ -60,6 +60,7 @@ The following options are available: .Bl -tag -width indent .It Fl u Ar bus_num Specify the FireWire bus number to be operated on. +The default is bus 0. .It Fl r Initiate bus reset. .It Fl t @@ -81,11 +82,14 @@ Load hex dump file of the configuration .It Fl f Ar node Force specified .Ar node -to be the root node on the next bus reset. +to be the root node on the next bus reset by sending a PHY config packet. +Valid values are 0 - 63. .It Fl g Ar gap_count -Broadcast +Broadcast new .Ar gap_count -by phy_config packet. +by sending a PHY_config packet. +By default this value is 63 on all nodes. +Valid values are 0 - 63. .It Fl i Ar pri_req Set the .Dv PRIORITY_BUDGET @@ -98,13 +102,18 @@ or mode for the incoming stream. Only meaningful in case of and must precede the .Fl R -option. If not specified, the program will try to guess. If you get -an error complaining about "format 0x20", try to force the "mpeg" mode. +option. +If not specified, the program will try to guess. +In case of +.Dq format 0x20 +error, try to force the +.Dq mpeg +mode. .It Fl R Ar filename Receive DV or MPEG TS stream and dump it to a file. -Use Ctrl-C to stop the receiving. +Use ^C to stop the receiving. Some DV cameras seem not to send the stream if a bus manager exists. -If you cannot get the stream, try the following commands: +If it is impossible to get the stream, try the following commands: .Bd -literal -offset indent sysctl hw.firewire.try_bmr=0 fwcontrol -r @@ -116,14 +125,17 @@ It can be handled by .Nm libdv in the .Fx -Ports Collection. Resulting MPEG TS stream can be played and sent over a +Ports Collection. +Resulting MPEG TS stream can be played and sent over a network using the VideoLAN .Nm vlc -tool in the +tool in the .Fx -Ports Collection. The stream can be piped directly to +Ports Collection. +The stream can be piped directly to .Nm vlc, -see EXAMPLES. +see +.Sx EXAMPLES . .It Fl S Ar filename Send a DV file as isochronous stream. .It Fl m Ar EUI64 | hostname @@ -161,38 +173,38 @@ with .Pp .Dl "fwcontrol -R file.m2t .Pp -Receive an MPEG TS stream from a camera producing MPEG transport stream. This -has been tested with SONY HDR-FX1E camera that produces HD MPEG-2 stream at -25 Mbps bandwidth. +Receive an MPEG TS stream from a camera producing MPEG transport stream. +This has been tested with SONY HDR-FX1E camera that produces HD MPEG-2 +stream at 25 Mbps bandwidth. .Pp -To send the stream from the camera over the network using TCP (which supprisingly works better with vlc), you can use +To send the stream from the camera over the network using TCP (which +supprisingly works better with vlc), you can use .Dl "fwcontrol -R - | nc 192.168.10.11 9000 with .Nm netcat from ports and to receive the stream, use .Dl nc -l -p 9000 | vlc - .Pp -To netcast via UDP, you need to use -.Nm buffer +To netcast via UDP, you need to use +.Nm buffer program from ports, since vlc is not fast enough to read UDP packets from -buffers and thus it experiences dropouts when run directly. The sending side -can use +buffers and thus it experiences dropouts when run directly. +The sending side can use .Dl "fwcontrol -R - | nc 192.168.10.11 9000 and to receive the stream, use .Dl nc -l -u -p 9000 | buffer -s 10k -b 1000 -m 20m -p 5 | vlc - .Pp -.Pp For more information on how to work with .Nm vlc see its docs. .Sh SEE ALSO +.Xr mplayer 1 , +.Xr vlc 1 , .Xr firewire 4 , .Xr fwe 4 , .Xr fwip 4 , .Xr fwohci 4 , -.Xr sbp 4 , -.Xr mplayer 1 , -.Xr vlc 1 +.Xr sbp 4 .Sh HISTORY The .Nm Modified: stable/6/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- stable/6/usr.sbin/fwcontrol/fwcontrol.c Thu Dec 18 04:50:44 2008 (r186266) +++ stable/6/usr.sbin/fwcontrol/fwcontrol.c Thu Dec 18 04:58:22 2008 (r186267) @@ -32,8 +32,10 @@ * SUCH DAMAGE. */ +#if defined(__FreeBSD__) #include __FBSDID("$FreeBSD$"); +#endif #include #include @@ -42,11 +44,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(__FreeBSD__) #include #include #include #include #include +#elif defined(__NetBSD__) +#include "eui64.h" +#include +#include +#include +#include +#else +#warning "You need to add support for your OS" +#endif + #include #include @@ -56,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "fwmethods.h" static void sysctl_set_int(const char *, int); @@ -64,25 +79,27 @@ static void usage(void) { fprintf(stderr, - "fwcontrol [-u bus_num] [-rt] [-f node] [-g gap_count] " - "[-o node] " - "[-b pri_req] [-c node] [-d node] [-l file] " - "[-R file] [-S file] [-m target]\n" + "%s [-u bus_num] [-prt] [-c node] [-d node] [-o node] [-s node]\n" + "\t [-l file] [-g gap_count] [-f force_root ] [-b pri_req]\n" + "\t [-M mode] [-R filename] [-S filename] [-m EUI64 | hostname]\n" "\t-u: specify bus number\n" - "\t-f: broadcast force_root by phy_config packet\n" - "\t-g: broadcast gap_count by phy_config packet\n" - "\t-o: send link-on packet to the node\n" - "\t-s: write RESET_START register on the node\n" - "\t-b: set PRIORITY_BUDGET register on all supported nodes\n" - "\t-c: read configuration ROM\n" + "\t-p: Display current PHY register settings\n" "\t-r: bus reset\n" "\t-t: read topology map\n" + "\t-c: read configuration ROM\n" "\t-d: hex dump of configuration ROM\n" + "\t-o: send link-on packet to the node\n" + "\t-s: write RESET_START register on the node\n" "\t-l: load and parse hex dump file of configuration ROM\n" + "\t-g: set gap count\n" + "\t-f: force root node\n" + "\t-b: set PRIORITY_BUDGET register on all supported nodes\n" + "\t-M: specify dv or mpeg\n" "\t-R: Receive DV or MPEG TS stream\n" "\t-S: Send DV stream\n" - "\t-m: set fwmem target\n"); - exit(EX_USAGE); + "\t-m: set fwmem target\n" + , getprogname() ); + fprintf(stderr, "\n"); } static void @@ -92,18 +109,14 @@ fweui2eui64(const struct fw_eui64 *fweui *(u_int32_t*)&(eui->octet[4]) = htonl(fweui->lo); } -static struct fw_devlstreq * -get_dev(int fd) +static void +get_dev(int fd, struct fw_devlstreq *data) { - struct fw_devlstreq *data; - - data = (struct fw_devlstreq *)malloc(sizeof(struct fw_devlstreq)); if (data == NULL) - err(1, "malloc"); + err(EX_SOFTWARE, "%s: data malloc", __func__); if( ioctl(fd, FW_GDEVLST, data) < 0) { - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); } - return data; } static int @@ -130,17 +143,25 @@ str2node(int fd, const char *nodestr) if (eui64_hostton(nodestr, &eui) != 0 && eui64_aton(nodestr, &eui) != 0) return (-1); - data = get_dev(fd); + data = (struct fw_devlstreq *)malloc(sizeof(struct fw_devlstreq)); + if (data == NULL) + err(EX_SOFTWARE, "%s: data malloc", __func__); + get_dev(fd,data); for (i = 0; i < data->info_len; i++) { fweui2eui64(&data->dev[i].eui, &tmpeui); if (memcmp(&eui, &tmpeui, sizeof(struct eui64)) == 0) { node = data->dev[i].dst; + if (data != NULL) + free(data); goto gotnode; } } - if (i >= data->info_len) + if (i >= data->info_len) { + if (data != NULL) + free(data); return (-1); + } gotnode: if (node < 0 || node > 63) @@ -158,7 +179,10 @@ list_dev(int fd) char addr[EUI64_SIZ], hostname[40]; int i; - data = get_dev(fd); + data = (struct fw_devlstreq *)malloc(sizeof(struct fw_devlstreq)); + if (data == NULL) + err(EX_SOFTWARE, "%s:data malloc", __func__); + get_dev(fd, data); printf("%d devices (info_len=%d)\n", data->n, data->info_len); printf("node EUI64 status hostname\n"); for (i = 0; i < data->info_len; i++) { @@ -184,6 +208,8 @@ read_write_quad(int fd, struct fw_eui64 u_int32_t *qld, res; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 16); + if (asyreq == NULL) + err(EX_SOFTWARE, "%s:asyreq malloc", __func__); asyreq->req.len = 16; #if 0 asyreq->req.type = FWASREQNODE; @@ -206,7 +232,7 @@ read_write_quad(int fd, struct fw_eui64 asyreq->pkt.mode.wreqq.data = htonl(data); if (ioctl(fd, FW_ASYREQ, asyreq) < 0) { - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); } res = qld[3]; free(asyreq); @@ -216,37 +242,56 @@ read_write_quad(int fd, struct fw_eui64 return 0; } +/* + * Send a PHY Config Packet + * ieee 1394a-2005 4.3.4.3 + * + * Message ID Root ID R T Gap Count + * 00(2 bits) (6 bits) 1 1 (6 bits) + * + * if "R" is set, then Root ID will be the next + * root node upon the next bus reset. + * if "T" is set, then Gap Count will be the + * value that all nodes use for their Gap Count + * if "R" and "T" are not set, then this message + * is either ignored or interpreted as an extended + * PHY config Packet as per 1394a-2005 4.3.4.4 + */ static void send_phy_config(int fd, int root_node, int gap_count) { struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 12); + if (asyreq == NULL) + err(EX_SOFTWARE, "%s:asyreq malloc", __func__); asyreq->req.len = 12; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.ld[0] = 0; asyreq->pkt.mode.ld[1] = 0; asyreq->pkt.mode.common.tcode = FWTCODE_PHY; if (root_node >= 0) - asyreq->pkt.mode.ld[1] |= (root_node & 0x3f) << 24 | 1 << 23; + asyreq->pkt.mode.ld[1] |= ((root_node << 24) | (1 << 23)); if (gap_count >= 0) - asyreq->pkt.mode.ld[1] |= 1 << 22 | (gap_count & 0x3f) << 16; + asyreq->pkt.mode.ld[1] |= ((1 << 22) | (gap_count << 16)); asyreq->pkt.mode.ld[2] = ~asyreq->pkt.mode.ld[1]; printf("send phy_config root_node=%d gap_count=%d\n", root_node, gap_count); if (ioctl(fd, FW_ASYREQ, asyreq) < 0) - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); free(asyreq); } static void -send_link_on(int fd, int node) +link_on(int fd, int node) { struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 12); + if (asyreq == NULL) + err(EX_SOFTWARE, "%s:asyreq malloc", __func__); asyreq->req.len = 12; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.common.tcode = FWTCODE_PHY; @@ -254,7 +299,7 @@ send_link_on(int fd, int node) asyreq->pkt.mode.ld[2] = ~asyreq->pkt.mode.ld[1]; if (ioctl(fd, FW_ASYREQ, asyreq) < 0) - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); free(asyreq); } @@ -264,6 +309,8 @@ reset_start(int fd, int node) struct fw_asyreq *asyreq; asyreq = (struct fw_asyreq *)malloc(sizeof(struct fw_asyreq_t) + 16); + if (asyreq == NULL) + err(EX_SOFTWARE, "%s:asyreq malloc", __func__); asyreq->req.len = 16; asyreq->req.type = FWASREQNODE; asyreq->pkt.mode.wreqq.dst = FWLOCALBUS | (node & 0x3f); @@ -276,7 +323,7 @@ reset_start(int fd, int node) asyreq->pkt.mode.wreqq.data = htonl(0x1); if (ioctl(fd, FW_ASYREQ, asyreq) < 0) - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); free(asyreq); } @@ -290,7 +337,10 @@ set_pri_req(int fd, u_int32_t pri_req) u_int32_t max, reg, old; int i; - data = get_dev(fd); + data = (struct fw_devlstreq *)malloc(sizeof(struct fw_devlstreq)); + if (data == NULL) + err(EX_SOFTWARE, "%s:data malloc", __func__); + get_dev(fd, data); #define BUGET_REG 0xf0000218 for (i = 0; i < data->info_len; i++) { devinfo = &data->dev[i]; @@ -344,7 +394,10 @@ get_crom(int fd, int node, void *crom_bu int i, error; struct fw_devlstreq *data; - data = get_dev(fd); + data = (struct fw_devlstreq *)malloc(sizeof(struct fw_devlstreq)); + if (data == NULL) + err(EX_SOFTWARE, "%s:data malloc", __func__); + get_dev(fd, data); for (i = 0; i < data->info_len; i++) { if (data->dev[i].dst == node && data->dev[i].eui.lo != 0) @@ -360,7 +413,7 @@ get_crom(int fd, int node, void *crom_bu buf.ptr = crom_buf; bzero(crom_buf, len); if ((error = ioctl(fd, FW_GCROM, &buf)) < 0) { - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); } return error; @@ -449,7 +502,7 @@ load_crom(char *filename, u_int32_t *p) int len=1024, i; if ((file = fopen(filename, "r")) == NULL) - err(1, "load_crom"); + err(1, "load_crom %s", filename); for (i = 0; i < len/(4*8); i ++) { fscanf(file, DUMP_FORMAT, p, p+1, p+2, p+3, p+4, p+5, p+6, p+7); @@ -469,9 +522,9 @@ show_topology_map(int fd) static const char *speed[] = {"S100", "S200", "S400", "S800"}; tmap = malloc(sizeof(struct fw_topology_map)); if (tmap == NULL) - return; + err(EX_SOFTWARE, "%s:tmap malloc", __func__); if (ioctl(fd, FW_GTPMAP, tmap) < 0) { - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); } printf("crc_len: %d generation:%d node_count:%d sid_count:%d\n", tmap->crc_len, tmap->generation, @@ -512,7 +565,7 @@ read_phy_registers(int fd, u_int8_t *buf for (i = 0; i < len; i++) { reg.addr = offset + i; if (ioctl(fd, FWOHCI_RDPHYREG, ®) < 0) - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); buf[i] = (u_int8_t) reg.data; printf("0x%02x ", reg.data); } @@ -527,7 +580,7 @@ read_phy_page(int fd, u_int8_t *buf, int reg.addr = 0x7; reg.data = ((page & 7) << 5) | (port & 0xf); if (ioctl(fd, FWOHCI_WRPHYREG, ®) < 0) - err(1, "ioctl"); + err(EX_IOERR, "%s: ioctl", __func__); read_phy_registers(fd, buf, 8, 8); } @@ -590,22 +643,16 @@ dump_phy_registers(int fd) ); } -static void -open_dev(int *fd, char *devbase) +static int +open_dev(int *fd, char *devname) { - char name[256]; - int i; - if (*fd < 0) { - for (i = 0; i < 4; i++) { - snprintf(name, sizeof(name), "%s.%d", devbase, i); - if ((*fd = open(name, O_RDWR)) >= 0) - break; - } + *fd = open(devname, O_RDWR); if (*fd < 0) - err(1, "open"); + return(-1); } + return(0); } static void @@ -625,25 +672,40 @@ detect_recv_fn(int fd, char ich) u_int32_t *ptr; struct ciphdr *ciph; fwmethod *retfn; +#define RECV_NUM_PACKET 16 +#define RECV_PACKET_SZ 1024 bufreq.rx.nchunk = 8; - bufreq.rx.npacket = 16; - bufreq.rx.psize = 1024; + bufreq.rx.npacket = RECV_NUM_PACKET; + bufreq.rx.psize = RECV_PACKET_SZ; bufreq.tx.nchunk = 0; bufreq.tx.npacket = 0; bufreq.tx.psize = 0; if (ioctl(fd, FW_SSTBUF, &bufreq) < 0) - err(1, "ioctl FW_SSTBUF"); + err(EX_IOERR, "%s: ioctl FW_SSTBUF", __func__); isoreq.ch = ich & 0x3f; isoreq.tag = (ich >> 6) & 3; if (ioctl(fd, FW_SRSTREAM, &isoreq) < 0) - err(1, "ioctl FW_SRSTREAM"); + err(EX_IOERR, "%s: ioctl FW_SRSTREAM", __func__); - buf = (char *)malloc(1024*16); - len = read(fd, buf, 1024*16); + buf = (char *)malloc(RECV_NUM_PACKET * RECV_PACKET_SZ); + if (buf == NULL) + err(EX_SOFTWARE, "%s:buf malloc", __func__); + /* + * fwdev.c seems to return EIO on error and + * the return value of the last uiomove + * on success. For now, checking that the + * return is not less than zero should be + * sufficient. fwdev.c::fw_read() should + * return the total length read, not the value + * of the last uiomove(). + */ + len = read(fd, buf, RECV_NUM_PACKET * RECV_PACKET_SZ); + if (len < 0) + err(EX_IOERR, "%s: error reading from device", __func__); ptr = (u_int32_t *) buf; ciph = (struct ciphdr *)(ptr + 1); @@ -666,102 +728,170 @@ detect_recv_fn(int fd, char ich) int main(int argc, char **argv) { +#define MAX_BOARDS 10 u_int32_t crom_buf[1024/4]; - char devbase[1024] = "/dev/fw0"; - int fd, ch, len=1024; + u_int32_t crom_buf_hex[1024/4]; + char devbase[64]; + const char *device_string = "/dev/fw"; + int fd = -1, ch, len=1024; + int32_t current_board = 0; + /* + * If !command_set, then -u will display the nodes for the board. + * This emulates the previous behavior when -u is passed by itself + */ + bool command_set = false; + bool open_needed = false; long tmp; struct fw_eui64 eui; struct eui64 target; fwmethod *recvfn = NULL; - - fd = -1; +/* + * Holders for which functions + * to iterate through + */ + bool display_board_only = false; + bool display_crom = false; + bool send_bus_reset = false; + bool display_crom_hex = false; + bool load_crom_from_file = false; + bool set_fwmem_target = false; + bool dump_topology = false; + bool dump_phy_reg = false; + + int32_t priority_budget = -1; + int32_t set_root_node = -1; + int32_t set_gap_count = -1; + int32_t send_link_on = -1; + int32_t send_reset_start = -1; + + char *crom_string = NULL; + char *crom_string_hex = NULL; + char *recv_data = NULL; + char *send_data = NULL; if (argc < 2) { - open_dev(&fd, devbase); - list_dev(fd); + for (current_board = 0; current_board < MAX_BOARDS; current_board++) { + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); + if (open_dev(&fd, devbase) < 0) { + if (current_board == 0) { + usage(); + err(EX_IOERR, "%s: Error opening firewire controller #%d %s", + __func__, current_board, devbase); + } + return(EIO); + } + list_dev(fd); + close(fd); + fd = -1; + } } - - while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) + /* + * Parse all command line options, then execute requested operations. + */ + while ((ch = getopt(argc, argv, "M:f:g:m:o:s:b:prtc:d:l:u:R:S:")) != -1) { switch(ch) { case 'b': - tmp = strtol(optarg, NULL, 0); - if (tmp < 0 || tmp > (long)0xffffffff) - errx(EX_USAGE, "invalid number: %s", optarg); - open_dev(&fd, devbase); - set_pri_req(fd, tmp); + priority_budget = strtol(optarg, NULL, 0); + if (priority_budget < 0 || priority_budget > INT32_MAX) + errx(EX_USAGE, "%s: priority_budget out of range: %s", __func__, optarg); + command_set = true; + open_needed = true; + display_board_only = false; break; case 'c': - open_dev(&fd, devbase); - tmp = str2node(fd, optarg); - get_crom(fd, tmp, crom_buf, len); - show_crom(crom_buf); + crom_string = malloc(strlen(optarg)+1); + if (crom_string == NULL) + err(EX_SOFTWARE, "%s:crom_string malloc", __func__); + if ( (strtol(crom_string, NULL, 0) < 0) || strtol(crom_string, NULL, 0) > MAX_BOARDS) + errx(EX_USAGE, "%s:Invalid value for node", __func__); + strcpy(crom_string, optarg); + display_crom = 1; + open_needed = true; + command_set = true; + display_board_only = false; break; case 'd': - open_dev(&fd, devbase); - tmp = str2node(fd, optarg); - get_crom(fd, tmp, crom_buf, len); - dump_crom(crom_buf); + crom_string_hex = malloc(strlen(optarg)+1); + if (crom_string_hex == NULL) + err(EX_SOFTWARE, "%s:crom_string_hex malloc", __func__); + strcpy(crom_string_hex, optarg); + display_crom_hex = 1; + open_needed = true; + command_set = true; + display_board_only = false; break; case 'f': - tmp = strtol(optarg, NULL, 0); - open_dev(&fd, devbase); - send_phy_config(fd, tmp, -1); +#define MAX_PHY_CONFIG 0x3f + set_root_node = strtol(optarg, NULL, 0); + if ( (set_root_node < 0) || (set_root_node > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s:set_root_node out of range", __func__); + open_needed = true; + command_set = true; + display_board_only = false; break; case 'g': - tmp = strtol(optarg, NULL, 0); - open_dev(&fd, devbase); - send_phy_config(fd, -1, tmp); + set_gap_count = strtol(optarg, NULL, 0); + if ( (set_gap_count < 0) || (set_gap_count > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s:set_gap_count out of range", __func__); + open_needed = true; + command_set = true; + display_board_only = false; break; case 'l': + load_crom_from_file = 1; load_crom(optarg, crom_buf); - show_crom(crom_buf); + command_set = true; + display_board_only = false; break; case 'm': - if (eui64_hostton(optarg, &target) != 0 && - eui64_aton(optarg, &target) != 0) - errx(EX_USAGE, "invalid target: %s", optarg); - eui.hi = ntohl(*(u_int32_t*)&(target.octet[0])); - eui.lo = ntohl(*(u_int32_t*)&(target.octet[4])); - sysctl_set_int("hw.firewire.fwmem.eui64_hi", eui.hi); - sysctl_set_int("hw.firewire.fwmem.eui64_lo", eui.lo); + set_fwmem_target = 1; + open_needed = 0; + command_set = true; + display_board_only = false; + if (eui64_hostton(optarg, &target) != 0 && + eui64_aton(optarg, &target) != 0) + errx(EX_USAGE, "%s: invalid target: %s", __func__, optarg); break; case 'o': - open_dev(&fd, devbase); - tmp = str2node(fd, optarg); - send_link_on(fd, tmp); + send_link_on = str2node(fd, optarg); + if ( (send_link_on < 0) || (send_link_on > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s: node out of range: %s\n",__func__, optarg); + open_needed = true; + command_set = true; + display_board_only = false; break; case 'p': - open_dev(&fd, devbase); - dump_phy_registers(fd); + dump_phy_reg = 1; + open_needed = true; + command_set = true; + display_board_only = false; break; case 'r': - open_dev(&fd, devbase); - if(ioctl(fd, FW_IBUSRST, &tmp) < 0) - err(1, "ioctl"); + send_bus_reset = 1; + open_needed = true; + command_set = true; + display_board_only = false; break; case 's': - open_dev(&fd, devbase); - tmp = str2node(fd, optarg); - reset_start(fd, tmp); + send_reset_start = str2node(fd, optarg); + if ( (send_reset_start < 0) || (send_reset_start > MAX_PHY_CONFIG) ) + errx(EX_USAGE, "%s: node out of range: %s\n", __func__, optarg); + open_needed = true; + command_set = true; + display_board_only = false; break; case 't': - open_dev(&fd, devbase); - show_topology_map(fd); + dump_topology = 1; + open_needed = true; + command_set = true; + display_board_only = false; break; case 'u': - tmp = strtol(optarg, NULL, 0); - snprintf(devbase, sizeof(devbase), "/dev/fw%ld", tmp); - if (fd > 0) { - close(fd); - fd = -1; - } - if (argc == optind) { - open_dev(&fd, devbase); - list_dev(fd); - } + if(!command_set) + display_board_only = true; + current_board = strtol(optarg, NULL, 0); + open_needed = true; break; -#define TAG (1<<6) -#define CHANNEL 63 case 'M': switch (optarg[0]) { case 'm': @@ -774,22 +904,186 @@ main(int argc, char **argv) errx(EX_USAGE, "unrecognized method: %s", optarg); } + command_set = true; + display_board_only = false; break; case 'R': - open_dev(&fd, devbase); - if (recvfn == NULL) /* guess... */ - recvfn = detect_recv_fn(fd, TAG | CHANNEL); - close(fd); - fd = -1; - open_dev(&fd, devbase); - (*recvfn)(fd, optarg, TAG | CHANNEL, -1); + recv_data = malloc(strlen(optarg)+1); + if (recv_data == NULL) + err(EX_SOFTWARE, "%s:recv_data malloc", __func__); + strcpy(recv_data, optarg); + open_needed = false; + command_set = true; + display_board_only = false; break; case 'S': - open_dev(&fd, devbase); - dvsend(fd, optarg, TAG | CHANNEL, -1); + send_data = malloc(strlen(optarg)+1); + if (send_data == NULL) + err(EX_SOFTWARE, "%s:send_data malloc", __func__); + strcpy(send_data, optarg); + open_needed = true; + command_set = true; + display_board_only = false; break; + case '?': default: usage(); + warnc(EINVAL, "%s: Unknown command line arguments", __func__); + return 0; + } + } /* end while */ + + /* + * Catch the error case when the user + * executes the command with non ''-'' + * delimited arguments. + * Generate the usage() display and exit. + */ + if (!command_set && !display_board_only) { + usage(); + warnc(EINVAL, "%s: Unknown command line arguments", __func__); + return 0; + } + + /* + * If -u is passed, execute + * command for that card only. + * + * If -u is not passed, execute + * command for card 0 only. + * + */ + if(open_needed){ + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); + if (open_dev(&fd, devbase) < 0) { + err(EX_IOERR, "%s: Error opening firewire controller #%d %s", __func__, current_board, devbase); + } + } + /* + * display the nodes on this board "-u" + * only + */ + if (display_board_only) + list_dev(fd); + + /* + * dump_phy_reg "-p" + */ + if (dump_phy_reg) + dump_phy_registers(fd); + + /* + * send a BUS_RESET Event "-r" + */ + if (send_bus_reset) { + if(ioctl(fd, FW_IBUSRST, &tmp) < 0) + err(EX_IOERR, "%s: Ioctl of bus reset failed for %s", __func__, devbase); + } + /* + * Print out the CROM for this node "-c" + */ + if (display_crom) { + tmp = str2node(fd, crom_string); + get_crom(fd, tmp, crom_buf, len); + show_crom(crom_buf); + free(crom_string); + } + /* + * Hex Dump the CROM for this node "-d" + */ + if (display_crom_hex) { + tmp = str2node(fd, crom_string_hex); + get_crom(fd, tmp, crom_buf_hex, len); + dump_crom(crom_buf_hex); + free(crom_string_hex); + } + /* + * Set Priority Budget to value for this node "-b" + */ + if (priority_budget >= 0) + set_pri_req(fd, priority_budget); + + /* + * Explicitly set the root node of this bus to value "-f" + */ + if (set_root_node >= 0) + send_phy_config(fd, set_root_node, -1); + + /* + * Set the gap count for this card/bus "-g" + */ + if (set_gap_count >= 0) + send_phy_config(fd, -1, set_gap_count); + + /* + * Load a CROM from a file "-l" + */ + if (load_crom_from_file) + show_crom(crom_buf); + /* + * Set the fwmem target for a node to argument "-m" + */ + if (set_fwmem_target) { + eui.hi = ntohl(*(u_int32_t*)&(target.octet[0])); + eui.lo = ntohl(*(u_int32_t*)&(target.octet[4])); +#if defined(__FreeBSD__) + sysctl_set_int("hw.firewire.fwmem.eui64_hi", eui.hi); + sysctl_set_int("hw.firewire.fwmem.eui64_lo", eui.lo); +#elif defined(__NetBSD__) + sysctl_set_int("hw.fwmem.eui64_hi", eui.hi); + sysctl_set_int("hw.fwmem.eui64_lo", eui.lo); +#else +#warning "You need to add support for your OS" +#endif + + } + + /* + * Send a link on to this board/bus "-o" + */ + if (send_link_on >= 0) + link_on(fd, send_link_on); + + /* + * Send a reset start to this board/bus "-s" + */ + if (send_reset_start >= 0) + reset_start(fd, send_reset_start); + + /* + * Dump the node topology for this board/bus "-t" + */ + if (dump_topology) + show_topology_map(fd); + + /* + * Recieve data file from node "-R" + */ +#define TAG (1<<6) +#define CHANNEL 63 + if (recv_data != NULL){ + if (recvfn == NULL) { /* guess... */ + recvfn = detect_recv_fn(fd, TAG | CHANNEL); + close(fd); } + snprintf(devbase, sizeof(devbase), "%s%d.0", device_string, current_board); + if (open_dev(&fd, devbase) < 0) + err(EX_IOERR, "%s: Error opening firewire controller #%d %s in recv_data\n", __func__, current_board, devbase); + (*recvfn)(fd, recv_data, TAG | CHANNEL, -1); + free(recv_data); + } + + /* + * Send data file to node "-S" + */ + if (send_data != NULL){ + dvsend(fd, send_data, TAG | CHANNEL, -1); + free(send_data); + } + + if (fd > 0) { + close(fd); + fd = -1; + } return 0; } Modified: stable/6/usr.sbin/fwcontrol/fwmpegts.c ============================================================================== --- stable/6/usr.sbin/fwcontrol/fwmpegts.c Thu Dec 18 04:50:44 2008 (r186266) +++ stable/6/usr.sbin/fwcontrol/fwmpegts.c Thu Dec 18 04:58:22 2008 (r186267) @@ -52,8 +52,16 @@ #include #include +#if defined(__FreeBSD__) #include #include +#elif defined(__NetBSD__) +#include +#include +#else +#warning "You need to add support for your OS" +#endif + #include "fwmethods.h" From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 05:05:07 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF5A1065670; Thu, 18 Dec 2008 05:05:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A93288FC1A; Thu, 18 Dec 2008 05:05:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBI557r0027965; Thu, 18 Dec 2008 05:05:07 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBI557lg027964; Thu, 18 Dec 2008 05:05:07 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200812180505.mBI557lg027964@svn.freebsd.org> From: Sean Bruno Date: Thu, 18 Dec 2008 05:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186268 - stable/6/usr.sbin/fwcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 05:05:08 -0000 Author: sbruno Date: Thu Dec 18 05:05:07 2008 New Revision: 186268 URL: http://svn.freebsd.org/changeset/base/186268 Log: Approved by: slong (scottl@samsco.org) Clear r163712 as it was merged by hand in changeset 165820 Modified: stable/6/usr.sbin/fwcontrol/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 06:38:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17DDD1065670; Thu, 18 Dec 2008 06:38:12 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1106F8FC0C; Thu, 18 Dec 2008 06:38:12 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBI6cBUK029965; Thu, 18 Dec 2008 06:38:11 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBI6cBie029964; Thu, 18 Dec 2008 06:38:11 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200812180638.mBI6cBie029964@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 18 Dec 2008 06:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186274 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 06:38:12 -0000 Author: maxim Date: Thu Dec 18 06:38:11 2008 New Revision: 186274 URL: http://svn.freebsd.org/changeset/base/186274 Log: o Synchronize comment and example. Add missed comma. PR: misc/129699 Submitted by: Glen Barber [1] MFC after: 2 weeks Modified: head/usr.sbin/sysinstall/config.c Modified: head/usr.sbin/sysinstall/config.c ============================================================================== --- head/usr.sbin/sysinstall/config.c Thu Dec 18 06:10:26 2008 (r186273) +++ head/usr.sbin/sysinstall/config.c Thu Dec 18 06:38:11 2008 (r186274) @@ -817,7 +817,7 @@ configNFSServer(dialogMenuItem *self) "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); - vsystem("echo '#/usr/src and /usr/ports read-only to machines named after trouble makers' >> /etc/exports"); + vsystem("echo '#/usr/src and /usr/obj read-only to machines named after trouble makers,' >> /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, /a to a network of privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 09:59:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B39001065673; Thu, 18 Dec 2008 09:59:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43B18FC0C; Thu, 18 Dec 2008 09:59:24 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBI9xODk034206; Thu, 18 Dec 2008 09:59:24 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBI9xOPf034205; Thu, 18 Dec 2008 09:59:24 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812180959.mBI9xOPf034205@svn.freebsd.org> From: Kip Macy Date: Thu, 18 Dec 2008 09:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186275 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 09:59:24 -0000 Author: kmacy Date: Thu Dec 18 09:59:24 2008 New Revision: 186275 URL: http://svn.freebsd.org/changeset/base/186275 Log: if_rtdel is always called with the RADIX_NODE_HEAD lock held Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Dec 18 06:38:11 2008 (r186274) +++ head/sys/net/if.c Thu Dec 18 09:59:24 2008 (r186275) @@ -1120,7 +1120,7 @@ if_rtdel(struct radix_node *rn, void *ar return (0); err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), rt->rt_flags, + rt_mask(rt), rt->rt_flags|RTF_RNH_LOCKED, (struct rtentry **) NULL, rt->rt_fibnum); if (err) { log(LOG_WARNING, "if_rtdel: error %d\n", err); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 11:58:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F6651065676; Thu, 18 Dec 2008 11:58:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1548FC1A; Thu, 18 Dec 2008 11:58:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIBwCLM039691; Thu, 18 Dec 2008 11:58:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIBwC50039690; Thu, 18 Dec 2008 11:58:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812181158.mBIBwC50039690@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 18 Dec 2008 11:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186276 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 11:58:13 -0000 Author: kib Date: Thu Dec 18 11:58:12 2008 New Revision: 186276 URL: http://svn.freebsd.org/changeset/base/186276 Log: Do not return success and doomed vnode from lookup. LK_UPGRADE allows the vnode to be reclaimed. Tested by: pho MFC after: 1 month Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Dec 18 09:59:24 2008 (r186275) +++ head/sys/kern/vfs_lookup.c Thu Dec 18 11:58:12 2008 (r186276) @@ -814,6 +814,10 @@ success: if ((cnp->cn_flags & (ISLASTCN | LOCKSHARED | LOCKLEAF)) == (ISLASTCN | LOCKLEAF) && VOP_ISLOCKED(dp) != LK_EXCLUSIVE) { vn_lock(dp, LK_UPGRADE | LK_RETRY); + if (dp->v_iflag & VI_DOOMED) { + error = ENOENT; + goto bad2; + } } if (vfslocked && dvfslocked) VFS_UNLOCK_GIANT(dvfslocked); /* Only need one */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 12:01:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B28161065674; Thu, 18 Dec 2008 12:01:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1C298FC31; Thu, 18 Dec 2008 12:01:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIC1JDA039810; Thu, 18 Dec 2008 12:01:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIC1JFo039809; Thu, 18 Dec 2008 12:01:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812181201.mBIC1JFo039809@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 18 Dec 2008 12:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186277 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 12:01:19 -0000 Author: kib Date: Thu Dec 18 12:01:19 2008 New Revision: 186277 URL: http://svn.freebsd.org/changeset/base/186277 Log: The quotactl, statfs and fstatfs syscall implementations may dereference NULL pointer to struct mount if the looked up vnode is reclaimed. Also, these syscalls only mnt_ref() the mp, still allowing it to be unmounted; only struct mount memory is kept from being reused. Lock the vnode when doing name lookup, then reference its mount point, unlock the vnode and vfs_busy the mountpoint. This sequence shall take care of both races. Reported and tested by: pho Discussed with: attilio MFC after: 1 month Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Dec 18 11:58:12 2008 (r186276) +++ head/sys/kern/vfs_syscalls.c Thu Dec 18 12:01:19 2008 (r186277) @@ -200,19 +200,21 @@ quotactl(td, uap) AUDIT_ARG(uid, uap->uid); if (jailed(td->td_ucred) && !prison_quotas) return (EPERM); - NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); mp = nd.ni_vp->v_mount; - if ((error = vfs_busy(mp, 0))) { - vrele(nd.ni_vp); + vfs_ref(mp); + vput(nd.ni_vp); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error) { VFS_UNLOCK_GIANT(vfslocked); return (error); } - vrele(nd.ni_vp); error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg, td); vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); @@ -306,6 +308,12 @@ kern_statfs(struct thread *td, char *pat vfs_ref(mp); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error) { + VFS_UNLOCK_GIANT(vfslocked); + return (error); + } #ifdef MAC error = mac_mount_check_stat(td->td_ucred, mp); if (error) @@ -329,7 +337,7 @@ kern_statfs(struct thread *td, char *pat } *buf = *sp; out: - vfs_rel(mp); + vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); if (mtx_owned(&Giant)) printf("statfs(%d): %s: %d\n", vfslocked, path, error); @@ -391,6 +399,10 @@ kern_fstatfs(struct thread *td, int fd, error = EBADF; goto out; } + error = vfs_busy(mp, 0); + vfs_rel(mp); + if (error) + goto out; #ifdef MAC error = mac_mount_check_stat(td->td_ucred, mp); if (error) @@ -415,7 +427,7 @@ kern_fstatfs(struct thread *td, int fd, *buf = *sp; out: if (mp) - vfs_rel(mp); + vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 12:01:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 213891065680; Thu, 18 Dec 2008 12:01:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114048FC1C; Thu, 18 Dec 2008 12:01:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIC1rGu039853; Thu, 18 Dec 2008 12:01:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIC1rq4039852; Thu, 18 Dec 2008 12:01:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812181201.mBIC1rq4039852@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 18 Dec 2008 12:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186278 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 12:01:54 -0000 Author: kib Date: Thu Dec 18 12:01:53 2008 New Revision: 186278 URL: http://svn.freebsd.org/changeset/base/186278 Log: Do not busy twice the mount point where a quota operation is performed. Tested by: pho MFC after: 1 month Modified: head/sys/ufs/ufs/ufs_vfsops.c Modified: head/sys/ufs/ufs/ufs_vfsops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vfsops.c Thu Dec 18 12:01:19 2008 (r186277) +++ head/sys/ufs/ufs/ufs_vfsops.c Thu Dec 18 12:01:53 2008 (r186278) @@ -118,9 +118,6 @@ ufs_quotactl(mp, cmds, id, arg, td) if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, MBF_NOWAIT)) - return (0); - switch (cmd) { case Q_QUOTAON: error = quotaon(td, mp, type, arg); @@ -150,7 +147,6 @@ ufs_quotactl(mp, cmds, id, arg, td) error = EINVAL; break; } - vfs_unbusy(mp); return (error); #endif } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 12:16:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B478106564A; Thu, 18 Dec 2008 12:16:51 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A1378FC13; Thu, 18 Dec 2008 12:16:51 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBICGpxw040230; Thu, 18 Dec 2008 12:16:51 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBICGpis040225; Thu, 18 Dec 2008 12:16:51 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200812181216.mBICGpis040225@svn.freebsd.org> From: Max Khon Date: Thu, 18 Dec 2008 12:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186279 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 12:16:51 -0000 Author: fjoe Date: Thu Dec 18 12:16:51 2008 New Revision: 186279 URL: http://svn.freebsd.org/changeset/base/186279 Log: Exit with error code 2 when run with -k (continue if errors) and build failed. Modified: head/usr.bin/make/globals.h head/usr.bin/make/job.c head/usr.bin/make/job.h head/usr.bin/make/main.c head/usr.bin/make/make.c Modified: head/usr.bin/make/globals.h ============================================================================== --- head/usr.bin/make/globals.h Thu Dec 18 12:01:53 2008 (r186278) +++ head/usr.bin/make/globals.h Thu Dec 18 12:16:51 2008 (r186279) @@ -70,6 +70,7 @@ extern struct Path parseIncPath; extern struct Path sysIncPath; extern int jobLimit; /* -j argument: maximum number of jobs */ +extern int makeErrors; /* Number of targets not remade due to errors */ extern Boolean jobsRunning; /* True if jobs are running */ extern Boolean compatMake; /* True if we are make compatible */ extern Boolean ignoreErrors; /* True if should ignore all errors */ Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Thu Dec 18 12:01:53 2008 (r186278) +++ head/usr.bin/make/job.c Thu Dec 18 12:16:51 2008 (r186279) @@ -263,7 +263,6 @@ TAILQ_HEAD(JobList, Job); /* * error handling variables */ -static int errors = 0; /* number of errors reported */ static int aborting = 0; /* why is the make aborting? */ #define ABORT_ERROR 1 /* Because of an error */ #define ABORT_INTERRUPT 2 /* Because it was interrupted */ @@ -849,7 +848,7 @@ JobClose(Job *job) * * If we got an error and are aborting (aborting == ABORT_ERROR) and * the job list is now empty, we are done for the day. - * If we recognized an error (errors !=0), we set the aborting flag + * If we recognized an error (makeErrors !=0), we set the aborting flag * to ABORT_ERROR so no more jobs will be started. */ static void @@ -1124,7 +1123,7 @@ JobFinish(Job *job, int *status) free(job); } else if (*status != 0) { - errors += 1; + makeErrors++; free(job); } @@ -1133,7 +1132,7 @@ JobFinish(Job *job, int *status) /* * Set aborting if any error. */ - if (errors && !keepgoing && aborting != ABORT_INTERRUPT) { + if (makeErrors && !keepgoing && aborting != ABORT_INTERRUPT) { /* * If we found any errors in this batch of children and the -k * flag wasn't given, we set the aborting flag so no more jobs @@ -1146,7 +1145,7 @@ JobFinish(Job *job, int *status) /* * If we are aborting and the job table is now empty, we finish. */ - Finish(errors); + Finish(makeErrors); } } @@ -2347,7 +2346,7 @@ Job_Init(int maxproc) nJobs = 0; aborting = 0; - errors = 0; + makeErrors = 0; lastNode = NULL; @@ -2539,14 +2538,14 @@ JobInterrupt(int runINTERRUPT, int signo * attached to the .END target. * * Results: - * Number of errors reported. + * None. */ -int +void Job_Finish(void) { if (postCommands != NULL && !Lst_IsEmpty(&postCommands->commands)) { - if (errors) { + if (makeErrors) { Error("Errors reported so .END ignored"); } else { JobStart(postCommands, JOB_SPECIAL | JOB_IGNDOTS, NULL); @@ -2563,7 +2562,6 @@ Job_Finish(void) if (fifoMaster) unlink(fifoName); } - return (errors); } /** @@ -3327,7 +3325,6 @@ void Compat_Run(Lst *targs) { GNode *gn = NULL; /* Current root target */ - int error_cnt; /* Number of targets not remade due to errors */ LstNode *ln; Compat_InstallSignalHandlers(); @@ -3360,7 +3357,7 @@ Compat_Run(Lst *targs) * ABORTED gn was not remade because one of its inferiors * could not be made due to errors. */ - error_cnt = 0; + makeErrors = 0; while (!Lst_IsEmpty(targs)) { gn = Lst_DeQueue(targs); Compat_Make(gn, gn); @@ -3370,18 +3367,17 @@ Compat_Run(Lst *targs) } else if (gn->made == ABORTED) { printf("`%s' not remade because of errors.\n", gn->name); - error_cnt += 1; + makeErrors++; } } /* * If the user has defined a .END target, run its commands. */ - if (error_cnt == 0) { + if (makeErrors == 0) { LST_FOREACH(ln, &ENDNode->commands) { if (Compat_RunCommand(Lst_Datum(ln), ENDNode)) break; } } } - Modified: head/usr.bin/make/job.h ============================================================================== --- head/usr.bin/make/job.h Thu Dec 18 12:01:53 2008 (r186278) +++ head/usr.bin/make/job.h Thu Dec 18 12:16:51 2008 (r186279) @@ -64,7 +64,7 @@ void Job_Make(struct GNode *); void Job_Init(int); Boolean Job_Full(void); Boolean Job_Empty(void); -int Job_Finish(void); +void Job_Finish(void); void Job_Wait(void); void Job_AbortAll(void); Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Thu Dec 18 12:01:53 2008 (r186278) +++ head/usr.bin/make/main.c Thu Dec 18 12:16:51 2008 (r186279) @@ -130,6 +130,7 @@ Boolean compatMake; /* -B argument */ int debug; /* -d flag */ Boolean ignoreErrors; /* -i flag */ int jobLimit; /* -j argument */ +int makeErrors; /* Number of targets not remade due to errors */ Boolean jobsRunning; /* TRUE if the jobs might be running */ Boolean keepgoing; /* -k flag */ Boolean noExecute; /* -n flag */ @@ -1311,9 +1312,11 @@ main(int argc, char **argv) if (DEBUG(GRAPH2)) Targ_PrintGraph(2); - if (queryFlag && outOfDate) - return (1); - else - return (0); -} + if (queryFlag) + return (outOfDate); + + if (makeErrors != 0) + Finish(makeErrors); + return (0); +} Modified: head/usr.bin/make/make.c ============================================================================== --- head/usr.bin/make/make.c Thu Dec 18 12:01:53 2008 (r186278) +++ head/usr.bin/make/make.c Thu Dec 18 12:16:51 2008 (r186279) @@ -713,7 +713,6 @@ Make_Run(Lst *targs) GNode *gn; /* a temporary pointer */ GNode *cgn; Lst examine; /* List of targets to examine */ - int errors; /* Number of errors the Job module reports */ LstNode *ln; Lst_Init(&examine); @@ -793,15 +792,14 @@ Make_Run(Lst *targs) MakeStartJobs(); } - errors = Job_Finish(); + Job_Finish(); /* * Print the final status of each target. E.g. if it wasn't made * because some inferior reported an error. */ - errors = ((errors == 0) && (numNodes != 0)); LST_FOREACH(ln, targs) - MakePrintStatus(Lst_Datum(ln), errors); + MakePrintStatus(Lst_Datum(ln), (makeErrors == 0) && (numNodes != 0)); return (TRUE); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 14:19:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F4DA1065675; Thu, 18 Dec 2008 14:19:55 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57A6D8FC08; Thu, 18 Dec 2008 14:19:55 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIEJthu043464; Thu, 18 Dec 2008 14:19:55 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIEJt0B043463; Thu, 18 Dec 2008 14:19:55 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200812181419.mBIEJt0B043463@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 18 Dec 2008 14:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186280 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 14:19:55 -0000 Author: nyan Date: Thu Dec 18 14:19:54 2008 New Revision: 186280 URL: http://svn.freebsd.org/changeset/base/186280 Log: Increase my limit temporarily. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Thu Dec 18 12:16:51 2008 (r186279) +++ svnadmin/conf/sizelimit.conf Thu Dec 18 14:19:54 2008 (r186280) @@ -18,3 +18,4 @@ #grog #kan des +nyan From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 14:21:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B705106564A; Thu, 18 Dec 2008 14:21:36 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0718FC16; Thu, 18 Dec 2008 14:21:36 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIELabJ043595; Thu, 18 Dec 2008 14:21:36 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIELZ0k043593; Thu, 18 Dec 2008 14:21:35 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200812181421.mBIELZ0k043593@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 18 Dec 2008 14:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186282 - in head/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 14:21:36 -0000 Author: gnn Date: Thu Dec 18 14:21:35 2008 New Revision: 186282 URL: http://svn.freebsd.org/changeset/base/186282 Log: Check in the actual module recognition code for the Chelsio driver. Obtained from: Chelsio Inc. Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_ael1002.c Thu Dec 18 14:21:06 2008 (r186281) +++ head/sys/dev/cxgb/common/cxgb_ael1002.c Thu Dec 18 14:21:35 2008 (r186282) @@ -71,6 +71,74 @@ struct reg_val { unsigned short set_bits; }; +static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr); + +static int get_module_type (struct cphy *phy, int hint) +{ + int v; + + v = hint ? hint : ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0); + if (v < 0) + return v; + + if (v == 0x3) { + /* SFP: see SFF-8472 for below */ + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3); + if (v < 0) + return v; + + if (v == 0x1) + return phy_modtype_twinax; + if (v == 0x10) + return phy_modtype_sr; + if (v == 0x20) + return phy_modtype_lr; + if (v == 0x40) + return phy_modtype_lrm; + + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6); + if (v < 0) + return v; + if (v != 4) + return phy_modtype_unknown; + + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10); + if (v < 0) + return v; + + if (v & 0x80) { + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); + if (v < 0) + return v; + return v > 10 ? phy_modtype_twinax_long : + phy_modtype_twinax; + } + } else if (v == 0x6) { + /* XFP: See INF-8077i for details. */ + + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 127); + if (v < 0) + return v; + + if (v != 1) { + /* XXX: set page select to table 1 yourself */ + return phy_modtype_unknown; + } + + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 131); + if (v < 0) + return v; + if (v == 0x10) + return phy_modtype_lrm; + if (v == 0x40) + return phy_modtype_lr; + if (v == 0x80) + return phy_modtype_sr; + } + + return phy_modtype_unknown; +} + static int set_phy_regs(struct cphy *phy, const struct reg_val *rv) { int err; @@ -107,6 +175,18 @@ static int ael1002_power_down(struct cph return err; } +static int ael1002_get_module_type(struct cphy *phy, int delay_ms) +{ + int v; + + if (delay_ms) + msleep(delay_ms); + + v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0); + + return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy, v); +} + static int ael1002_reset(struct cphy *phy, int wait) { int err; @@ -119,6 +199,11 @@ static int ael1002_reset(struct cphy *ph (err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, AEL1002_LB_EN, 0, 1 << 5))) return err; + + err = ael1002_get_module_type(phy, 300); + if (err >= 0) + phy->modtype = err; + return 0; } @@ -182,10 +267,17 @@ static struct cphy_ops ael1002_ops = { int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, const struct mdio_ops *mdio_ops) { + int err; + cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE, "10GBASE-R"); ael100x_txon(phy); + + err = ael1002_get_module_type(phy, 0); + if (err >= 0) + phy->modtype = err; + return 0; } @@ -983,7 +1075,7 @@ static int ael2005_i2c_rd(struct cphy *p return -ETIMEDOUT; } -static int get_module_type(struct cphy *phy, int delay_ms) +static int ael2005_get_module_type(struct cphy *phy, int delay_ms) { int v; unsigned int stat; @@ -998,36 +1090,8 @@ static int get_module_type(struct cphy * if (delay_ms) msleep(delay_ms); - /* see SFF-8472 for below */ - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3); - if (v < 0) - return v; - - if (v == 0x10) - return phy_modtype_sr; - if (v == 0x20) - return phy_modtype_lr; - if (v == 0x40) - return phy_modtype_lrm; - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6); - if (v < 0) - return v; - if (v != 4) - goto unknown; - - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10); - if (v < 0) - return v; + return get_module_type(phy, 0); - if (v & 0x80) { - v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); - if (v < 0) - return v; - return v > 10 ? phy_modtype_twinax_long : phy_modtype_twinax; - } -unknown: - return phy_modtype_unknown; } static int ael2005_intr_enable(struct cphy *phy) @@ -1084,7 +1148,7 @@ static int ael2005_reset(struct cphy *ph msleep(50); - err = get_module_type(phy, 0); + err = ael2005_get_module_type(phy, 0); if (err < 0) return err; phy->modtype = (u8)err; @@ -1122,7 +1186,7 @@ static int ael2005_intr_handler(struct c return ret; /* modules have max 300 ms init time after hot plug */ - ret = get_module_type(phy, 300); + ret = ael2005_get_module_type(phy, 300); if (ret < 0) return ret; @@ -1176,10 +1240,16 @@ static struct cphy_ops ael2005_ops = { int t3_ael2005_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, const struct mdio_ops *mdio_ops) { + int err; cphy_init(phy, adapter, phy_addr, &ael2005_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE | SUPPORTED_IRQ, "10GBASE-R"); msleep(125); + + err = ael2005_get_module_type(phy, 0); + if (err >= 0) + phy->modtype = err; + return t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, AEL_OPT_SETTINGS, 0, 1 << 5); } Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Dec 18 14:21:06 2008 (r186281) +++ head/sys/dev/cxgb/cxgb_main.c Thu Dec 18 14:21:35 2008 (r186282) @@ -90,6 +90,7 @@ static void cxgb_stop_locked(struct port static void cxgb_set_rxmode(struct port_info *); static int cxgb_ioctl(struct ifnet *, unsigned long, caddr_t); static int cxgb_media_change(struct ifnet *); +static int cxgb_ifm_type(int); static void cxgb_media_status(struct ifnet *, struct ifmediareq *); static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); @@ -976,7 +977,7 @@ cxgb_port_attach(device_t dev) } else if (!strcmp(p->phy.desc, "10GBASE-SR")) { media_flags = IFM_ETHER | IFM_10G_SR | IFM_FDX; } else if (!strcmp(p->phy.desc, "10GBASE-R")) { - media_flags = IFM_ETHER | IFM_10G_LR | IFM_FDX; + media_flags = cxgb_ifm_type(p->phy.modtype); } else if (!strcmp(p->phy.desc, "10/100/1000BASE-T")) { ifmedia_add(&p->media, IFM_ETHER | IFM_10_T, 0, NULL); ifmedia_add(&p->media, IFM_ETHER | IFM_10_T | IFM_FDX, @@ -992,6 +993,9 @@ cxgb_port_attach(device_t dev) /* * XXX: This is not very accurate. Fix when common code * returns more specific value - eg 1000BASE-SX, LX, etc. + * + * XXX: In the meantime, don't lie. Consider setting IFM_AUTO + * instead of SX. */ media_flags = IFM_ETHER | IFM_1000_SX | IFM_FDX; } else { @@ -999,7 +1003,13 @@ cxgb_port_attach(device_t dev) return (ENXIO); } if (media_flags) { - ifmedia_add(&p->media, media_flags, 0, NULL); + /* + * Note the modtype on which we based our flags. If modtype + * changes, we'll redo the ifmedia for this ifp. modtype may + * change when transceivers are plugged in/out, and in other + * situations. + */ + ifmedia_add(&p->media, media_flags, p->phy.modtype, NULL); ifmedia_set(&p->media, media_flags); } else { ifmedia_add(&p->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -1827,7 +1837,7 @@ cxgb_init_locked(struct port_info *p) cxgb_link_start(p); t3_link_changed(sc, p->port_id); #endif - ifp->if_baudrate = p->link_config.speed * 1000000; + ifp->if_baudrate = IF_Mbps(p->link_config.speed); device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id); t3_port_intr_enable(sc, p->port_id); @@ -1990,7 +2000,9 @@ cxgb_ioctl(struct ifnet *ifp, unsigned l break; case SIOCSIFMEDIA: case SIOCGIFMEDIA: + PORT_LOCK(p); error = ifmedia_ioctl(ifp, ifr, &p->media, command); + PORT_UNLOCK(p); break; case SIOCSIFCAP: PORT_LOCK(p); @@ -2066,10 +2078,64 @@ cxgb_media_change(struct ifnet *ifp) return (ENXIO); } +/* + * Translates from phy->modtype to IFM_TYPE. + */ +static int +cxgb_ifm_type(int phymod) +{ + int rc = IFM_ETHER | IFM_FDX; + + switch (phymod) { + case phy_modtype_sr: + rc |= IFM_10G_SR; + break; + case phy_modtype_lr: + rc |= IFM_10G_LR; + break; + case phy_modtype_lrm: +#ifdef IFM_10G_LRM + rc |= IFM_10G_LRM; +#endif + break; + case phy_modtype_twinax: +#ifdef IFM_10G_TWINAX + rc |= IFM_10G_TWINAX; +#endif + break; + case phy_modtype_twinax_long: +#ifdef IFM_10G_TWINAX_LONG + rc |= IFM_10G_TWINAX_LONG; +#endif + break; + case phy_modtype_none: + rc = IFM_ETHER | IFM_NONE; + break; + case phy_modtype_unknown: + break; + } + + return (rc); +} + static void cxgb_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) { struct port_info *p = ifp->if_softc; + struct ifmedia_entry *cur = p->media.ifm_cur; + int m; + + if (cur->ifm_data != p->phy.modtype) { + /* p->media about to be rebuilt, must hold lock */ + PORT_LOCK_ASSERT_OWNED(p); + + m = cxgb_ifm_type(p->phy.modtype); + ifmedia_removeall(&p->media); + ifmedia_add(&p->media, m, p->phy.modtype, NULL); + ifmedia_set(&p->media, m); + cur = p->media.ifm_cur; /* ifmedia_set modified ifm_cur */ + ifmr->ifm_current = m; + } ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -2089,6 +2155,9 @@ cxgb_media_status(struct ifnet *ifp, str case 1000: ifmr->ifm_active |= IFM_1000_T; break; + case 10000: + ifmr->ifm_active |= IFM_SUBTYPE(cur->ifm_media); + break; } if (p->link_config.duplex) @@ -2140,7 +2209,7 @@ check_link_status(adapter_t *sc) if (!(p->phy.caps & SUPPORTED_IRQ)) t3_link_changed(sc, i); - p->ifp->if_baudrate = p->link_config.speed * 1000000; + p->ifp->if_baudrate = IF_Mbps(p->link_config.speed); } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 14:23:26 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E7941065674; Thu, 18 Dec 2008 14:23:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56ECF8FC4B; Thu, 18 Dec 2008 14:23:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIENQnb043675; Thu, 18 Dec 2008 14:23:26 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIENQad043674; Thu, 18 Dec 2008 14:23:26 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200812181423.mBIENQad043674@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 18 Dec 2008 14:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186283 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 14:23:26 -0000 Author: nyan Date: Thu Dec 18 14:23:25 2008 New Revision: 186283 URL: http://svn.freebsd.org/changeset/base/186283 Log: done. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Thu Dec 18 14:21:35 2008 (r186282) +++ svnadmin/conf/sizelimit.conf Thu Dec 18 14:23:25 2008 (r186283) @@ -18,4 +18,3 @@ #grog #kan des -nyan From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 15:12:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAFEB1065673; Thu, 18 Dec 2008 15:12:04 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9068FC13; Thu, 18 Dec 2008 15:12:04 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIFC49m044659; Thu, 18 Dec 2008 15:12:04 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIFC4B6044657; Thu, 18 Dec 2008 15:12:04 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200812181512.mBIFC4B6044657@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 18 Dec 2008 15:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186284 - head/tools/tools/tionxcl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 15:12:05 -0000 Author: bms Date: Thu Dec 18 15:12:04 2008 New Revision: 186284 URL: http://svn.freebsd.org/changeset/base/186284 Log: Add new tool tionxcl to bring ttys out of exclusive mode when left by e.g. legacy uucp or tip. Added: head/tools/tools/tionxcl/ head/tools/tools/tionxcl/Makefile (contents, props changed) head/tools/tools/tionxcl/tionxcl.c (contents, props changed) Added: head/tools/tools/tionxcl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tionxcl/Makefile Thu Dec 18 15:12:04 2008 (r186284) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= tionxcl +NO_MAN= defined + +.include Added: head/tools/tools/tionxcl/tionxcl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/tionxcl/tionxcl.c Thu Dec 18 15:12:04 2008 (r186284) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2008 Bruce Simpson. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DEVPATHNAME "/dev" + +int +main(int argc, char *argv[]) +{ + char *progname; + char *ttyname; + int fd; + int dofree; + + dofree = 0; + + progname = basename(argv[0]); + if (argc != 2) + errx(EX_USAGE, "usage: %s \n", progname); + if (geteuid() != 0) + errx(EX_NOPERM, "Sorry\n"); + + if (argv[1][0] == '/') { + ttyname = argv[1]; + } else { + size_t len, maxpath, result; + + len = strlen(argv[1]) + sizeof(DEVPATHNAME) + 1; + + maxpath = pathconf(DEVPATHNAME, _PC_PATH_MAX); + if (len > maxpath) { + warnc(ENAMETOOLONG, ttyname); + exit(EX_DATAERR); + } + + ttyname = malloc(len); + if (ttyname == NULL) { + warnc(ENOMEM, "malloc"); + exit(EX_OSERR); + } + dofree = 1; + + result = snprintf(ttyname, len, "%s/%s", DEVPATHNAME, argv[1]); + if (result >= len) + warnc(ENOMEM, "snprintf"); + } + + fd = open(ttyname, O_RDWR); + if (fd == -1) { + warnc(errno, "open %s", ttyname); + if (dofree) + free(ttyname); + exit(EX_OSERR); + } + + if (0 != ioctl(fd, TIOCNXCL, 0)) + warnc(errno, "ioctl TIOCNXCL %s", ttyname); + + if (dofree) + free(ttyname); + exit(0); +} From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 15:25:34 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 129021065673; Thu, 18 Dec 2008 15:25:34 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0376E8FC12; Thu, 18 Dec 2008 15:25:34 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIFPXNN044934; Thu, 18 Dec 2008 15:25:33 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIFPXkN044933; Thu, 18 Dec 2008 15:25:33 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200812181525.mBIFPXkN044933@svn.freebsd.org> From: Ivan Voras Date: Thu, 18 Dec 2008 15:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186285 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 15:25:34 -0000 Author: ivoras Date: Thu Dec 18 15:25:33 2008 New Revision: 186285 URL: http://svn.freebsd.org/changeset/base/186285 Log: Remove spaces in wait object names to make top (1) output prettier and unbreak scripts that examine ps (1) output. Reviewed by: ed Approved by: gnn (mentor) Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Thu Dec 18 15:12:04 2008 (r186284) +++ head/sys/kern/tty.c Thu Dec 18 15:25:33 2008 (r186285) @@ -871,10 +871,10 @@ tty_alloc(struct ttydevsw *tsw, void *sc tty_init_termios(tp); - cv_init(&tp->t_inwait, "tty input"); - cv_init(&tp->t_outwait, "tty output"); - cv_init(&tp->t_bgwait, "tty background"); - cv_init(&tp->t_dcdwait, "tty dcd"); + cv_init(&tp->t_inwait, "ttyinput"); + cv_init(&tp->t_outwait, "ttyoutput"); + cv_init(&tp->t_bgwait, "ttybackground"); + cv_init(&tp->t_dcdwait, "ttydcd"); ttyinq_init(&tp->t_inq); ttyoutq_init(&tp->t_outq); @@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc tp->t_mtx = mutex; } else { tp->t_mtx = &tp->t_mtxobj; - mtx_init(&tp->t_mtxobj, "tty lock", NULL, MTX_DEF); + mtx_init(&tp->t_mtxobj, "ttylock", NULL, MTX_DEF); } knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 15:34:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 282001065675; Thu, 18 Dec 2008 15:34:39 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18FBC8FC24; Thu, 18 Dec 2008 15:34:39 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIFYdpf045129; Thu, 18 Dec 2008 15:34:39 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIFYdGC045128; Thu, 18 Dec 2008 15:34:39 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200812181534.mBIFYdGC045128@svn.freebsd.org> From: Ivan Voras Date: Thu, 18 Dec 2008 15:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186286 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 15:34:39 -0000 Author: ivoras Date: Thu Dec 18 15:34:38 2008 New Revision: 186286 URL: http://svn.freebsd.org/changeset/base/186286 Log: By popular request, stringify kern.vm_guest sysctl. Now it returns a short, self-documenting string describing the detected virtual environment. Approved by: gnn (mentor) (earlier version) Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Thu Dec 18 15:25:33 2008 (r186285) +++ head/sys/kern/subr_param.c Thu Dec 18 15:34:38 2008 (r186286) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$"); enum VM_GUEST { VM_GUEST_NO, VM_GUEST_VM, VM_GUEST_XEN }; +static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS); + int hz; int tick; int maxusers; /* base tunable */ @@ -88,7 +90,7 @@ int nswbuf; int maxswzone; /* max swmeta KVA storage */ int maxbcache; /* max buffer cache KVA storage */ int maxpipekva; /* Limit on pipe KVA */ -int vm_guest; /* Running as virtual machine guest? */ +int vm_guest; /* Running as virtual machine guest? */ u_long maxtsiz; /* max text size */ u_long dfldsiz; /* initial data size limit */ u_long maxdsiz; /* max data size */ @@ -113,8 +115,9 @@ SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, C "max stack size"); SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, &sgrowsiz, 0, "amount to grow stack"); -SYSCTL_INT(_kern, OID_AUTO, vm_guest, CTLFLAG_RD, &vm_guest, 0, - "Running under a virtual machine?"); +SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, + NULL, 0, sysctl_kern_vm_guest, "A", + "Virtual machine detected? (none|generic|xen)"); /* * These have to be allocated somewhere; allocating @@ -138,6 +141,17 @@ static const char *const vm_pnames[] = { NULL }; +static const char *const vm_guest_sysctl_names[] = { + "none", + "generic", + "xen", + NULL +}; + + +/* + * Detect known Virtual Machine hosts by inspecting the emulated BIOS. + */ static enum VM_GUEST detect_virtual(void) { @@ -266,3 +280,13 @@ init_param3(long kmempages) maxpipekva = 512 * 1024; TUNABLE_INT_FETCH("kern.ipc.maxpipekva", &maxpipekva); } + +/* + * Sysctl stringiying handler for kern.vm_guest. + */ +static int +sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) +{ + return (SYSCTL_OUT(req, vm_guest_sysctl_names[vm_guest], + strlen(vm_guest_sysctl_names[vm_guest]))); +} From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 15:56:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91ADD1065678; Thu, 18 Dec 2008 15:56:12 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C978FC0C; Thu, 18 Dec 2008 15:56:12 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIFuCqF045557; Thu, 18 Dec 2008 15:56:12 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIFuCZr045556; Thu, 18 Dec 2008 15:56:12 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200812181556.mBIFuCZr045556@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 18 Dec 2008 15:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186287 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 15:56:12 -0000 Author: ru Date: Thu Dec 18 15:56:12 2008 New Revision: 186287 URL: http://svn.freebsd.org/changeset/base/186287 Log: Removed a comment made obsolete by revisions 157927 and 174292. Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Dec 18 15:34:38 2008 (r186286) +++ head/sys/kern/kern_mbuf.c Thu Dec 18 15:56:12 2008 (r186287) @@ -120,7 +120,6 @@ tunable_mbinit(void *dummy) } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); -/* XXX: These should be tuneables. Can't change UMA limits on the fly. */ static int sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:27:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1931065670; Thu, 18 Dec 2008 18:27:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F3738FC19; Thu, 18 Dec 2008 18:27:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIIRDLA048466; Thu, 18 Dec 2008 18:27:13 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIIRDt5048461; Thu, 18 Dec 2008 18:27:13 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200812181827.mBIIRDt5048461@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 18 Dec 2008 18:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186288 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 18:27:13 -0000 Author: raj Date: Thu Dec 18 18:27:12 2008 New Revision: 186288 URL: http://svn.freebsd.org/changeset/base/186288 Log: Extend and improve MPC85XX Local Bus management. - Make LBC resources management self-contained: introduce explicit LBC resources definition (much like the OCP), provide dedicated rman for LB mem space. - Full configuration of an LB chip select device: program LAW and BR/OR, map into KVA, handle all LB attributes (bus width, machine select, ecc, write protect etc). - Factor out LAW manipulation routines into shared code, adjust OCP area accordingly. - Other LBC fixes and clean-ups. Obtained from: Semihalf Modified: head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/mpc85xx/lbc.h head/sys/powerpc/mpc85xx/mpc85xx.c head/sys/powerpc/mpc85xx/mpc85xx.h head/sys/powerpc/mpc85xx/ocpbus.c Modified: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.c Thu Dec 18 15:56:12 2008 (r186287) +++ head/sys/powerpc/mpc85xx/lbc.c Thu Dec 18 18:27:12 2008 (r186288) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2006-2008, Juniper Networks, Inc. + * Copyright (c) 2008 Semihalf, Rafal Czubak * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include struct lbc_softc { device_t sc_dev; @@ -54,16 +57,41 @@ struct lbc_softc { int sc_rid; struct rman sc_rman; - uintptr_t sc_kva; + vm_offset_t sc_kva[LBC_DEV_MAX]; }; struct lbc_devinfo { int lbc_devtype; - int lbc_memtype; - /* Also the BAR number */ + /* LBC child unit. It also represents resource table entry number */ int lbc_unit; }; +/* Resources for MPC8555CDS system */ +const struct lbc_resource mpc85xx_lbc_resources[] = { + /* Boot flash bank */ + { + LBC_DEVTYPE_CFI, 0, 0xff800000, 0x00800000, 16, + LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED, + LBCRES_ATOM_DISABLED, 0 + }, + + /* Second flash bank */ + { + LBC_DEVTYPE_CFI, 1, 0xff000000, 0x00800000, 16, + LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED, + LBCRES_ATOM_DISABLED, 0 + }, + + /* DS1553 RTC/NVRAM */ + { + LBC_DEVTYPE_RTC, 2, 0xf8000000, 0x8000, 8, + LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED, + LBCRES_ATOM_DISABLED, 0 + }, + + {0} +}; + static int lbc_probe(device_t); static int lbc_attach(device_t); static int lbc_shutdown(device_t); @@ -108,26 +136,170 @@ static driver_t lbc_driver = { devclass_t lbc_devclass; DRIVER_MODULE(lbc, ocpbus, lbc_driver, lbc_devclass, 0, 0); +static __inline void +lbc_write_reg(struct lbc_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); +} + +static __inline uint32_t +lbc_read_reg(struct lbc_softc *sc, bus_size_t off) +{ + + return (bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); +} + +/* + * Calculate address mask used by OR(n) registers. Use memory region size to + * determine mask value. The size must be a power of two and within the range + * of 32KB - 4GB. Otherwise error code is returned. Value representing + * 4GB size can be passed as 0xffffffff. + */ +static uint32_t +lbc_address_mask(uint32_t size) +{ + int n = 15; + + if (size == ~0UL) + return (0); + + while (n < 32) { + if (size == (1UL << n)) + break; + n++; + } + + if (n == 32) + return (EINVAL); + + return (0xffff8000 << (n - 15)); +} + static device_t -lbc_mk_child(device_t dev, int type, int mtype, int unit) +lbc_mk_child(device_t dev, const struct lbc_resource *lbcres) { struct lbc_devinfo *dinfo; device_t child; + if (lbcres->lbr_unit > LBC_DEV_MAX - 1) + return (NULL); + child = device_add_child(dev, NULL, -1); if (child == NULL) { - device_printf(dev, "could not add child device\n"); + device_printf(dev, "could not add LBC child device\n"); return (NULL); } dinfo = malloc(sizeof(struct lbc_devinfo), M_DEVBUF, M_WAITOK | M_ZERO); - dinfo->lbc_devtype = type; - dinfo->lbc_memtype = mtype; - dinfo->lbc_unit = unit; + dinfo->lbc_devtype = lbcres->lbr_devtype; + dinfo->lbc_unit = lbcres->lbr_unit; device_set_ivars(child, dinfo); return (child); } static int +lbc_init_child(device_t dev, device_t child) +{ + struct lbc_softc *sc; + struct lbc_devinfo *dinfo; + const struct lbc_resource *res; + u_long start, size; + uint32_t regbuff; + int error, unit; + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + res = mpc85xx_lbc_resources; + + regbuff = 0; + unit = -1; + for (; res->lbr_devtype; res++) { + if (res->lbr_unit != dinfo->lbc_unit) + continue; + + start = res->lbr_base_addr; + size = res->lbr_size; + unit = res->lbr_unit; + + /* + * Configure LAW for this LBC device and map its physical + * memory region into KVA + */ + error = law_enable(OCP85XX_TGTIF_LBC, start, size); + if (error) + return (error); + + sc->sc_kva[unit] = (vm_offset_t)pmap_mapdev(start, size); + if (sc->sc_kva[unit] == 0) { + law_disable(OCP85XX_TGTIF_LBC, start, size); + return (ENOSPC); + } + + /* + * Compute and program BR value + */ + regbuff |= start; + + switch (res->lbr_port_size) { + case 8: + regbuff |= (1 << 11); + break; + case 16: + regbuff |= (2 << 11); + break; + case 32: + regbuff |= (3 << 11); + break; + default: + error = EINVAL; + goto fail; + } + regbuff |= (res->lbr_decc << 9); + regbuff |= (res->lbr_wp << 8); + regbuff |= (res->lbr_msel << 5); + regbuff |= (res->lbr_atom << 2); + regbuff |= 1; + + lbc_write_reg(sc, LBC85XX_BR(unit), regbuff); + + /* + * Compute and program OR value + */ + regbuff = 0; + regbuff |= lbc_address_mask(size); + + switch (res->lbr_msel) { + case LBCRES_MSEL_GPCM: + /* TODO Add flag support for option registers */ + regbuff |= 0x00000ff7; + break; + case LBCRES_MSEL_FCM: + printf("FCM mode not supported yet!"); + error = ENOSYS; + goto fail; + case LBCRES_MSEL_UPMA: + case LBCRES_MSEL_UPMB: + case LBCRES_MSEL_UPMC: + printf("UPM mode not supported yet!"); + error = ENOSYS; + goto fail; + } + + lbc_write_reg(sc, LBC85XX_OR(unit), regbuff); + + return (0); + } +fail: + if (unit != -1) { + law_disable(OCP85XX_TGTIF_LBC, start, size); + pmap_unmapdev(sc->sc_kva[unit], size); + return (error); + } else + return (ENOENT); +} + +static int lbc_probe(device_t dev) { device_t parent; @@ -150,7 +322,7 @@ lbc_attach(device_t dev) { struct lbc_softc *sc; struct rman *rm; - u_long start, size; + const struct lbc_resource *lbcres; int error; sc = device_get_softc(dev); @@ -165,15 +337,11 @@ lbc_attach(device_t dev) sc->sc_bst = rman_get_bustag(sc->sc_res); sc->sc_bsh = rman_get_bushandle(sc->sc_res); - error = bus_get_resource(dev, SYS_RES_MEMORY, 1, &start, &size); - if (error) - goto fail; - rm = &sc->sc_rman; rm->rm_type = RMAN_ARRAY; rm->rm_descr = "MPC85XX Local Bus Space"; - rm->rm_start = start; - rm->rm_end = start + size - 1; + rm->rm_start = 0UL; + rm->rm_end = ~0UL; error = rman_init(rm); if (error) goto fail; @@ -184,13 +352,35 @@ lbc_attach(device_t dev) goto fail; } - sc->sc_kva = (uintptr_t)pmap_mapdev(start, size); - - lbc_mk_child(dev, LBC_DEVTYPE_CFI, 0, 0); + /* + * Initialize configuration register: + * - enable Local Bus + * - set data buffer control signal function + * - disable parity byte select + * - set ECC parity type + * - set bus monitor timing and timer prescale + */ + lbc_write_reg(sc, LBC85XX_LBCR, 0x00000000); + + /* + * Initialize clock ratio register: + * - disable PLL bypass mode + * - configure LCLK delay cycles for the assertion of LALE + * - set system clock divider + */ + lbc_write_reg(sc, LBC85XX_LCRR, 0x00030008); + + lbcres = mpc85xx_lbc_resources; + + for (; lbcres->lbr_devtype; lbcres++) + if (!lbc_mk_child(dev, lbcres)) { + error = ENXIO; + goto fail; + } return (bus_generic_attach(dev)); - fail: +fail: bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); return (error); } @@ -208,11 +398,13 @@ lbc_alloc_resource(device_t dev, device_ u_long start, u_long end, u_long count, u_int flags) { struct lbc_softc *sc; + struct lbc_devinfo *dinfo; struct resource *rv; struct rman *rm; int error; sc = device_get_softc(dev); + dinfo = device_get_ivars(child); if (type != SYS_RES_MEMORY && type != SYS_RES_IRQ) return (NULL); @@ -225,6 +417,12 @@ lbc_alloc_resource(device_t dev, device_ return (bus_alloc_resource(dev, type, rid, start, end, count, flags)); + if (!sc->sc_kva[dinfo->lbc_unit]) { + error = lbc_init_child(dev, child); + if (error) + return (NULL); + } + error = lbc_get_resource(dev, child, type, *rid, &start, &count); if (error) return (NULL); @@ -234,8 +432,7 @@ lbc_alloc_resource(device_t dev, device_ rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv != NULL) { rman_set_bustag(rv, &bs_be_tag); - rman_set_bushandle(rv, sc->sc_kva + rman_get_start(rv) - - rm->rm_start); + rman_set_bushandle(rv, rman_get_start(rv)); } return (rv); } @@ -279,12 +476,6 @@ lbc_read_ivar(device_t dev, device_t chi case LBC_IVAR_DEVTYPE: *result = dinfo->lbc_devtype; return (0); - case LBC_IVAR_CLOCK: - *result = 1843200; - return (0); - case LBC_IVAR_REGSHIFT: - *result = 0; - return (0); default: break; } @@ -305,24 +496,35 @@ lbc_get_resource(device_t dev, device_t { struct lbc_softc *sc; struct lbc_devinfo *dinfo; + const struct lbc_resource *lbcres; if (type != SYS_RES_MEMORY) return (ENOENT); - /* Currently all devices have a single RID per type. */ + /* Currently all LBC devices have a single RID per type. */ if (rid != 0) return (ENOENT); sc = device_get_softc(dev); dinfo = device_get_ivars(child); + if ((dinfo->lbc_unit < 0) || (dinfo->lbc_unit > (LBC_DEV_MAX - 1))) + return (EINVAL); + + lbcres = mpc85xx_lbc_resources; + switch (dinfo->lbc_devtype) { case LBC_DEVTYPE_CFI: - *startp = sc->sc_rman.rm_start; - *countp = sc->sc_rman.rm_end - sc->sc_rman.rm_start + 1; - break; + case LBC_DEVTYPE_RTC: + for (; lbcres->lbr_devtype; lbcres++) { + if (dinfo->lbc_unit == lbcres->lbr_unit) { + *startp = sc->sc_kva[lbcres->lbr_unit]; + *countp = lbcres->lbr_size; + return (0); + } + } default: - return(EDOOFUS); + return (EDOOFUS); } - return(0); + return (0); } Modified: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- head/sys/powerpc/mpc85xx/lbc.h Thu Dec 18 15:56:12 2008 (r186287) +++ head/sys/powerpc/mpc85xx/lbc.h Thu Dec 18 18:27:12 2008 (r186288) @@ -30,11 +30,49 @@ #define _MACHINE_LBC_H_ #define LBC_IVAR_DEVTYPE 1 -#define LBC_IVAR_CLOCK 2 -#define LBC_IVAR_REGSHIFT 3 + +/* Maximum number of devices on Local Bus */ +#define LBC_DEV_MAX 8 /* Device types. */ #define LBC_DEVTYPE_CFI 1 -#define LBC_DEVTYPE_UART 2 +#define LBC_DEVTYPE_RTC 2 + +/* Local access registers */ +#define LBC85XX_BR(n) (OCP85XX_LBC_OFF + (8 * n)) +#define LBC85XX_OR(n) (OCP85XX_LBC_OFF + 4 + (8 * n)) +#define LBC85XX_LBCR (OCP85XX_LBC_OFF + 0xd0) +#define LBC85XX_LCRR (OCP85XX_LBC_OFF + 0xd4) + +/* LBC machine select */ +#define LBCRES_MSEL_GPCM 0 +#define LBCRES_MSEL_FCM 1 +#define LBCRES_MSEL_UPMA 8 +#define LBCRES_MSEL_UPMB 9 +#define LBCRES_MSEL_UPMC 10 + +/* LBC data error checking modes */ +#define LBCRES_DECC_DISABLED 0 +#define LBCRES_DECC_NORMAL 1 +#define LBCRES_DECC_RMW 2 + +/* LBC atomic operation modes */ +#define LBCRES_ATOM_DISABLED 0 +#define LBCRES_ATOM_RAWA 1 +#define LBCRES_ATOM_WARA 2 + +struct lbc_resource { + int lbr_devtype; /* LBC device type */ + int lbr_unit; /* Resource table entry number */ + vm_paddr_t lbr_base_addr; /* Device mem region base address */ + size_t lbr_size; /* Device mem region size */ + int lbr_port_size; /* Data bus width */ + uint8_t lbr_msel; /* LBC machine select */ + uint8_t lbr_decc; /* Data error checking mode */ + uint8_t lbr_atom; /* Atomic operation mode */ + uint8_t lbr_wp; /* Write protect */ +}; + +extern const struct lbc_resource mpc85xx_lbc_resources[]; #endif /* _MACHINE_LBC_H_ */ Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Thu Dec 18 15:56:12 2008 (r186287) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Thu Dec 18 18:27:12 2008 (r186288) @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -64,6 +61,72 @@ ccsr_write4(uintptr_t addr, uint32_t val __asm __volatile("eieio; sync"); } +static __inline int +law_getmax(void) +{ + uint32_t ver; + + ver = SVR_VER(mfspr(SPR_SVR)); + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + return (12); + else + return (8); +} + +#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | (ffsl(size) - 2)) +#define _LAW_BAR(addr) (addr >> 12) + +int +law_enable(int trgt, u_long addr, u_long size) +{ + uint32_t bar, sr; + int i, law_max; + + law_max = law_getmax(); + bar = _LAW_BAR(addr); + sr = _LAW_SR(trgt, size); + + /* Bail if already programmed. */ + for (i = 0; i < law_max; i++) + if (sr == ccsr_read4(OCP85XX_LAWSR(i)) && + bar == ccsr_read4(OCP85XX_LAWBAR(i))) + return (0); + + /* Find an unused access window. */ + for (i = 0; i < law_max; i++) + if ((ccsr_read4(OCP85XX_LAWSR(i)) & 0x80000000) == 0) + break; + + if (i == law_max) + return (ENOSPC); + + ccsr_write4(OCP85XX_LAWBAR(i), bar); + ccsr_write4(OCP85XX_LAWSR(i), sr); + return (0); +} + +int +law_disable(int trgt, u_long addr, u_long size) +{ + uint32_t bar, sr; + int i, law_max; + + law_max = law_getmax(); + bar = _LAW_BAR(addr); + sr = _LAW_SR(trgt, size); + + /* Find and disable requested LAW. */ + for (i = 0; i < law_max; i++) + if (sr == ccsr_read4(OCP85XX_LAWSR(i)) && + bar == ccsr_read4(OCP85XX_LAWBAR(i))) { + ccsr_write4(OCP85XX_LAWBAR(i), 0); + ccsr_write4(OCP85XX_LAWSR(i), 0); + return (0); + } + + return (ENOENT); +} + void cpu_reset(void) { Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Thu Dec 18 15:56:12 2008 (r186287) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Thu Dec 18 18:27:12 2008 (r186288) @@ -31,5 +31,7 @@ uint32_t ccsr_read4(uintptr_t addr); void ccsr_write4(uintptr_t addr, uint32_t val); +int law_enable(int trgt, u_long addr, u_long size); +int law_disable(int trgt, u_long addr, u_long size); #endif /* _MPC85XX_H_ */ Modified: head/sys/powerpc/mpc85xx/ocpbus.c ============================================================================== --- head/sys/powerpc/mpc85xx/ocpbus.c Thu Dec 18 15:56:12 2008 (r186287) +++ head/sys/powerpc/mpc85xx/ocpbus.c Thu Dec 18 18:27:12 2008 (r186288) @@ -138,8 +138,6 @@ static int ocpbus_write_law(int trgt, int type, u_long *startp, u_long *countp) { u_long addr, size; - int i; - uint32_t bar, sr; switch (type) { case SYS_RES_MEMORY: @@ -156,10 +154,6 @@ ocpbus_write_law(int trgt, int type, u_l addr = 0xA0000000; size = 0x10000000; break; - case OCP85XX_TGTIF_LBC: - addr = 0xff800000; - size = 0x00800000; - break; default: return (EINVAL); } @@ -189,28 +183,7 @@ ocpbus_write_law(int trgt, int type, u_l *startp = addr; *countp = size; - /* Program the LAWs for this memory range. */ - bar = addr >> 12; - sr = 0x80000000 | (trgt << 20) | (ffsl(size) - 2); - - /* Check if already programmed. */ - for (i = 0; i < law_max; i++) { - if (sr == ccsr_read4(OCP85XX_LAWSR(i)) && - bar == ccsr_read4(OCP85XX_LAWBAR(i))) - return (0); - } - - /* Find an unused access window .*/ - for (i = 0; i < law_max; i++) { - if ((ccsr_read4(OCP85XX_LAWSR(i)) & 0x80000000) == 0) - break; - } - if (i == law_max) - return (ENOSPC); - - ccsr_write4(OCP85XX_LAWBAR(i), bar); - ccsr_write4(OCP85XX_LAWSR(i), sr); - return (0); + return (law_enable(trgt, *startp, *countp)); } static int @@ -232,7 +205,7 @@ ocpbus_probe(device_t dev) } static int -ocpbus_attach (device_t dev) +ocpbus_attach(device_t dev) { struct ocpbus_softc *sc; int error, i, tgt; @@ -377,7 +350,6 @@ const struct ocp_resource mpc8555_resour {OCPBUS_DEVTYPE_LBC, 0, SYS_RES_MEMORY, 0, OCP85XX_LBC_OFF, OCP85XX_LBC_SIZE}, - {OCPBUS_DEVTYPE_LBC, 0, SYS_RES_MEMORY, 1, 0, OCP85XX_TGTIF_LBC}, {OCPBUS_DEVTYPE_I2C, 0, SYS_RES_MEMORY, 0, OCP85XX_I2C0_OFF, OCP85XX_I2C_SIZE}, From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:28:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19026106564A; Thu, 18 Dec 2008 18:28:04 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0F28FC14; Thu, 18 Dec 2008 18:28:03 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIIS3i8048518; Thu, 18 Dec 2008 18:28:03 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIIS3ae048517; Thu, 18 Dec 2008 18:28:03 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200812181828.mBIIS3ae048517@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 18 Dec 2008 18:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186289 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 18:28:04 -0000 Author: raj Date: Thu Dec 18 18:28:03 2008 New Revision: 186289 URL: http://svn.freebsd.org/changeset/base/186289 Log: Minor spelling fix in E500 locore. Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Thu Dec 18 18:27:12 2008 (r186288) +++ head/sys/powerpc/booke/locore.S Thu Dec 18 18:28:03 2008 (r186289) @@ -200,7 +200,7 @@ __start: addi %r1, %r1, (TMPSTACKSZ - 8) /* - * Intialise exception vector offsets + * Initialise exception vector offsets */ bl ivor_setup From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:29:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 103BC1065670; Thu, 18 Dec 2008 18:29:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057C08FC08; Thu, 18 Dec 2008 18:29:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIITFkW048586; Thu, 18 Dec 2008 18:29:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIITF1L048585; Thu, 18 Dec 2008 18:29:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200812181829.mBIITF1L048585@svn.freebsd.org> From: Marius Strobl Date: Thu, 18 Dec 2008 18:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186290 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 18:29:16 -0000 Author: marius Date: Thu Dec 18 18:29:15 2008 New Revision: 186290 URL: http://svn.freebsd.org/changeset/base/186290 Log: - Failing to register as interrupt controller during attach shouldn't be fatal so just inform about this instead of panicing. - Ensure we use the right softc in case the interrupt of a child is is routed to the companion PBM instead. This hasn't been seen in the wild so far but given that it's the case for the Schizo interrupts, handling this situation also for child interrupts as a precaution seemed a good idea. - Deal with broken firmware versions which miss child entries in the ino-bitmap as seen on V880 by belatedly registering as interrupt controller in schizo_setup_intr(). [1] - Add missing '\n' when printing the warning regarding Schizo Errata I-13. Reported and tested by: Beat Gaetzi [1] Modified: head/sys/sparc64/pci/schizo.c Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Thu Dec 18 18:28:03 2008 (r186289) +++ head/sys/sparc64/pci/schizo.c Thu Dec 18 18:29:15 2008 (r186290) @@ -394,9 +394,10 @@ schizo_attach(device_t dev) /* * Hunt through all the interrupt mapping regs and register - * the interrupt controller for our interrupt vectors. This - * is complicated by the fact that a pair of Schizo PBMs - * share one IGN. + * the interrupt controller for our interrupt vectors. We do + * this early in order to be able to catch stray interrupts. + * This is complicated by the fact that a pair of Schizo PBMs + * shares one IGN. */ n = OF_getprop(node, "ino-bitmap", (void *)prop_array, sizeof(prop_array)); @@ -411,8 +412,8 @@ schizo_attach(device_t dev) continue; i = schizo_intr_register(sc, n); if (i != 0) - panic("%s: could not register interrupt controller " - "for INO %d (%d)", __func__, n, i); + device_printf(dev, "could not register interrupt " + "controller for INO %d (%d)\n", n, i); } /* @@ -1127,16 +1128,40 @@ schizo_setup_intr(device_t dev, device_t sc = device_get_softc(dev); /* - * Make sure the vector is fully specified and we registered - * our interrupt controller for it. + * Make sure the vector is fully specified. */ vec = rman_get_start(ires); - if (INTIGN(vec) != sc->sc_ign || - intr_vectors[vec].iv_ic != &schizo_ic) { + if (INTIGN(vec) != sc->sc_ign) { device_printf(dev, "invalid interrupt vector 0x%lx\n", vec); return (EINVAL); } + if (intr_vectors[vec].iv_ic == &schizo_ic) { + /* + * Ensure we use the right softc in case the interrupt + * is routed to our companion PBM for some odd reason. + */ + sc = ((struct schizo_icarg *)intr_vectors[vec].iv_icarg)-> + sica_sc; + } else if (intr_vectors[vec].iv_ic == NULL) { + /* + * Work around broken firmware which misses entries in + * the ino-bitmap. + */ + error = schizo_intr_register(sc, INTINO(vec)); + if (error != 0) { + device_printf(dev, "could not register interrupt " + "controller for vector 0x%lx (%d)\n", vec, error); + return (error); + } + device_printf(dev, "belatedly registered as interrupt " + "controller for vector 0x%lx\n", vec); + } else { + device_printf(dev, + "invalid interrupt controller for vector 0x%lx\n", vec); + return (EINVAL); + } + /* * Install a a wrapper for CDMA flushing/syncing for devices * behind PCI-PCI bridges if possible. @@ -1205,7 +1230,7 @@ schizo_setup_intr(device_t dev, device_t return (error); } else if (found != 0) device_printf(dev, "WARNING: using devices behind PCI-PCI " - "bridges may cause data corruption"); + "bridges may cause data corruption\n"); return (bus_generic_setup_intr(dev, child, ires, flags, filt, intr, arg, cookiep)); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 18:44:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 631001065670; Thu, 18 Dec 2008 18:44:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C458FC0C; Thu, 18 Dec 2008 18:44:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIIilZo049457; Thu, 18 Dec 2008 18:44:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIIikVF049455; Thu, 18 Dec 2008 18:44:46 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200812181844.mBIIikVF049455@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 18 Dec 2008 18:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186291 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 18:44:47 -0000 Author: obrien Date: Thu Dec 18 18:44:46 2008 New Revision: 186291 URL: http://svn.freebsd.org/changeset/base/186291 Log: Be a little bit more pestimistic in argument handling - check if we've overflown our internal buffer (though after the fact), and s/strncpy/strlcpy/ Reviewed by: rodrigc Obtained from: Juniper Networks Modified: head/sbin/mount/mount.c head/sbin/mount/mount_fs.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Thu Dec 18 18:29:15 2008 (r186290) +++ head/sbin/mount/mount.c Thu Dec 18 18:44:46 2008 (r186291) @@ -68,6 +68,8 @@ static const char rcsid[] = #define MOUNT_META_OPTION_FSTAB "fstab" #define MOUNT_META_OPTION_CURRENT "current" +#define MAX_ARGS 100 + int debug, fstab_style, verbose; char *catopt(char *, const char *); @@ -501,7 +503,7 @@ int mountfs(const char *vfstype, const char *spec, const char *name, int flags, const char *options, const char *mntopts) { - char *argv[100]; + char *argv[MAX_ARGS]; struct statfs sf; int argc, i, ret; char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; @@ -546,6 +548,10 @@ mountfs(const char *vfstype, const char argv[argc++] = strdup(name); argv[argc] = NULL; + if (MAX_ARGS <= argc ) + errx(1, "Cannot process more than %d mount arguments", + MAX_ARGS); + if (debug) { if (use_mountprog(vfstype)) printf("exec: mount_%s", vfstype); Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Thu Dec 18 18:29:15 2008 (r186290) +++ head/sbin/mount/mount_fs.c Thu Dec 18 18:44:46 2008 (r186291) @@ -88,7 +88,7 @@ mount_fs(const char *vfstype, int argc, char *p, *val; int ret; - strncpy(fstype, vfstype, sizeof(fstype)); + strlcpy(fstype, vfstype, sizeof(fstype)); memset(errmsg, 0, sizeof(errmsg)); getmnt_silent = 1; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 19:08:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9001065676; Thu, 18 Dec 2008 19:08:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70BF38FC0C; Thu, 18 Dec 2008 19:08:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIJ8JFm050014; Thu, 18 Dec 2008 19:08:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIJ8J6l050013; Thu, 18 Dec 2008 19:08:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812181908.mBIJ8J6l050013@svn.freebsd.org> From: Andrew Thompson Date: Thu, 18 Dec 2008 19:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186292 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 19:08:19 -0000 Author: thompsa Date: Thu Dec 18 19:08:19 2008 New Revision: 186292 URL: http://svn.freebsd.org/changeset/base/186292 Log: Attempt to handoff the entire buffer with ttydisc_rint_bypass() before banging each char separately. Modified: head/sys/dev/usb/ucom.c Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Thu Dec 18 18:44:46 2008 (r186291) +++ head/sys/dev/usb/ucom.c Thu Dec 18 19:08:19 2008 (r186292) @@ -706,17 +706,20 @@ ucomrxchars(struct ucom_softc *sc, u_cha struct tty *tp = sc->sc_tty; /* Give characters to tty layer. */ - while (cc > 0) { - DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); - if (ttydisc_rint(tp, *cp, 0) == -1) { - /* XXX what should we do? */ - printf("%s: lost %d chars\n", - device_get_nameunit(sc->sc_dev), cc); - break; + if (ttydisc_can_bypass(tp)) { + DPRINTFN(7, ("ucomreadcb: buf = %*D\n", cc, cp, "")); + cc = ttydisc_rint_bypass(tp, cp, cc); + } else { + while (cc > 0) { + DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); + if (ttydisc_rint(tp, *cp, 0) == -1) + break; + cc--; + cp++; } - cc--; - cp++; } + if (cc > 0) + device_printf(sc->sc_dev, "lost %d chars\n", cc); ttydisc_rint_done(tp); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 19:09:14 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E84181065673; Thu, 18 Dec 2008 19:09:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1CB8FC25; Thu, 18 Dec 2008 19:09:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIJ9Eig050067; Thu, 18 Dec 2008 19:09:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIJ9Eef050066; Thu, 18 Dec 2008 19:09:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200812181909.mBIJ9Eef050066@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 18 Dec 2008 19:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186293 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 19:09:15 -0000 Author: bz Date: Thu Dec 18 19:09:14 2008 New Revision: 186293 URL: http://svn.freebsd.org/changeset/base/186293 Log: Only unlock the llentry if it is actually valid. Reported by: ed Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Thu Dec 18 19:08:19 2008 (r186292) +++ head/sys/netinet6/ip6_input.c Thu Dec 18 19:09:14 2008 (r186293) @@ -567,7 +567,8 @@ passin: LLE_RUNLOCK(lle); goto hbhcheck; } - LLE_RUNLOCK(lle); + if (lle != NULL) + LLE_RUNLOCK(lle); if (V_ip6_forward_rt.ro_rt != NULL && (V_ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 19:15:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92751065673; Thu, 18 Dec 2008 19:15:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF4158FC1B; Thu, 18 Dec 2008 19:15:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIJFPcE050229; Thu, 18 Dec 2008 19:15:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIJFP1H050228; Thu, 18 Dec 2008 19:15:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812181915.mBIJFP1H050228@svn.freebsd.org> From: Andrew Thompson Date: Thu, 18 Dec 2008 19:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186294 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 19:15:25 -0000 Author: thompsa Date: Thu Dec 18 19:15:25 2008 New Revision: 186294 URL: http://svn.freebsd.org/changeset/base/186294 Log: Fix last commit, ttydisc_rint_bypass returns the total, not remainder. Modified: head/sys/dev/usb/ucom.c Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Thu Dec 18 19:09:14 2008 (r186293) +++ head/sys/dev/usb/ucom.c Thu Dec 18 19:15:25 2008 (r186294) @@ -708,7 +708,7 @@ ucomrxchars(struct ucom_softc *sc, u_cha /* Give characters to tty layer. */ if (ttydisc_can_bypass(tp)) { DPRINTFN(7, ("ucomreadcb: buf = %*D\n", cc, cp, "")); - cc = ttydisc_rint_bypass(tp, cp, cc); + cc -= ttydisc_rint_bypass(tp, cp, cc); } else { while (cc > 0) { DPRINTFN(7, ("ucomreadcb: char = 0x%02x\n", *cp)); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 20:16:13 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8424106567F; Thu, 18 Dec 2008 20:16:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4381A8FC27; Thu, 18 Dec 2008 20:16:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mBIKDRIn005746; Thu, 18 Dec 2008 13:13:27 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 18 Dec 2008 13:13:30 -0700 (MST) Message-Id: <20081218.131330.63052780.imp@bsdimp.com> To: obrien@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200812181844.mBIIikVF049455@svn.freebsd.org> References: <200812181844.mBIIikVF049455@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186291 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 20:16:13 -0000 In message: <200812181844.mBIIikVF049455@svn.freebsd.org> "David E. O'Brien" writes: : Author: obrien : Date: Thu Dec 18 18:44:46 2008 : New Revision: 186291 : URL: http://svn.freebsd.org/changeset/base/186291 : : Log: : Be a little bit more pestimistic in argument handling - check if we've : overflown our internal buffer (though after the fact), and s/strncpy/strlcpy/ : : Reviewed by: rodrigc : Obtained from: Juniper Networks : : Modified: : head/sbin/mount/mount.c : head/sbin/mount/mount_fs.c : : Modified: head/sbin/mount/mount.c : ============================================================================== : --- head/sbin/mount/mount.c Thu Dec 18 18:29:15 2008 (r186290) : +++ head/sbin/mount/mount.c Thu Dec 18 18:44:46 2008 (r186291) : @@ -68,6 +68,8 @@ static const char rcsid[] = : #define MOUNT_META_OPTION_FSTAB "fstab" : #define MOUNT_META_OPTION_CURRENT "current" : : +#define MAX_ARGS 100 : + : int debug, fstab_style, verbose; : : char *catopt(char *, const char *); : @@ -501,7 +503,7 @@ int : mountfs(const char *vfstype, const char *spec, const char *name, int flags, : const char *options, const char *mntopts) : { : - char *argv[100]; : + char *argv[MAX_ARGS]; : struct statfs sf; : int argc, i, ret; : char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; : @@ -546,6 +548,10 @@ mountfs(const char *vfstype, const char : argv[argc++] = strdup(name); : argv[argc] = NULL; : : + if (MAX_ARGS <= argc ) : + errx(1, "Cannot process more than %d mount arguments", : + MAX_ARGS); : + This is useless. Once you've overflowed the buffer, your stack is potentially shot, and all kinds of fun can happen downstream from there. In particular, there's no guarantee that argc isn't corrupted as well... Also, the style of the check is inconsistent with other parts of the system: : + if (argc > MAX_ARGS) would be more consistent, and not suffer from the space before the paren problem as well :) Warner : if (debug) { : if (use_mountprog(vfstype)) : printf("exec: mount_%s", vfstype); : : Modified: head/sbin/mount/mount_fs.c : ============================================================================== : --- head/sbin/mount/mount_fs.c Thu Dec 18 18:29:15 2008 (r186290) : +++ head/sbin/mount/mount_fs.c Thu Dec 18 18:44:46 2008 (r186291) : @@ -88,7 +88,7 @@ mount_fs(const char *vfstype, int argc, : char *p, *val; : int ret; : : - strncpy(fstype, vfstype, sizeof(fstype)); : + strlcpy(fstype, vfstype, sizeof(fstype)); : memset(errmsg, 0, sizeof(errmsg)); : : getmnt_silent = 1; : From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:04:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C71106564A; Thu, 18 Dec 2008 21:04:50 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9F18FC21; Thu, 18 Dec 2008 21:04:50 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIL4oOd052247; Thu, 18 Dec 2008 21:04:50 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIL4o4L052245; Thu, 18 Dec 2008 21:04:50 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200812182104.mBIL4o4L052245@svn.freebsd.org> From: Robert Noland Date: Thu, 18 Dec 2008 21:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186295 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:04:50 -0000 Author: rnoland Date: Thu Dec 18 21:04:50 2008 New Revision: 186295 URL: http://svn.freebsd.org/changeset/base/186295 Log: rework drm_scatter.c which allocates scatter / gather pages for use by ati pci gart to use bus_dma to handle the allocations. This fixes a garbled screen issue on at least some radeons (X1400 tested). It is also likely that this is the correct fix for PR# 119324, though that is not confirmed yet. Reviewed by: jhb@ (mentor, prior version) Approved by: kib@ MFC after: 2 weeks Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_scatter.c Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Thu Dec 18 19:15:25 2008 (r186294) +++ head/sys/dev/drm/drmP.h Thu Dec 18 21:04:50 2008 (r186295) @@ -473,11 +473,13 @@ typedef struct drm_agp_head { } drm_agp_head_t; typedef struct drm_sg_mem { - unsigned long handle; - void *virtual; - int pages; - dma_addr_t *busaddr; - drm_dma_handle_t *dmah; /* Handle to PCI memory for ATI PCIGART table */ + unsigned long handle; + void *virtual; + int pages; + dma_addr_t *busaddr; + struct drm_dma_handle *sg_dmah; /* Handle for sg_pages */ + struct drm_dma_handle *dmah; /* Handle to PCI memory */ + /* for ATI PCIGART table */ } drm_sg_mem_t; typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t; Modified: head/sys/dev/drm/drm_scatter.c ============================================================================== --- head/sys/dev/drm/drm_scatter.c Thu Dec 18 19:15:25 2008 (r186294) +++ head/sys/dev/drm/drm_scatter.c Thu Dec 18 21:04:50 2008 (r186295) @@ -39,20 +39,16 @@ __FBSDID("$FreeBSD$"); #include "dev/drm/drmP.h" -#define DEBUG_SCATTER 0 +static void drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs, + int nsegs, int error); -void drm_sg_cleanup(drm_sg_mem_t *entry) +int +drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request) { - free((void *)entry->handle, DRM_MEM_PAGES); - free(entry->busaddr, DRM_MEM_PAGES); - free(entry, DRM_MEM_SGLISTS); -} - -int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) -{ - drm_sg_mem_t *entry; + struct drm_sg_mem *entry; + struct drm_dma_handle *dmah; unsigned long pages; - int i; + int ret; if (dev->sg) return EINVAL; @@ -69,21 +65,56 @@ int drm_sg_alloc(struct drm_device * dev entry->busaddr = malloc(pages * sizeof(*entry->busaddr), DRM_MEM_PAGES, M_WAITOK | M_ZERO); if (!entry->busaddr) { - drm_sg_cleanup(entry); + free(entry, DRM_MEM_SGLISTS); return ENOMEM; } - entry->handle = (long)malloc(pages << PAGE_SHIFT, DRM_MEM_PAGES, - M_WAITOK | M_ZERO); - if (entry->handle == 0) { - drm_sg_cleanup(entry); + dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA, + M_ZERO | M_NOWAIT); + if (dmah == NULL) { + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); + return ENOMEM; + } + + ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */ + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ + NULL, NULL, /* filtfunc, filtfuncargs */ + request->size, pages, /* maxsize, nsegs */ + PAGE_SIZE, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockfuncargs */ + &dmah->tag); + if (ret != 0) { + free(dmah, DRM_MEM_DMA); + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); return ENOMEM; } - for (i = 0; i < pages; i++) { - entry->busaddr[i] = vtophys(entry->handle + i * PAGE_SIZE); + ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); + if (ret != 0) { + bus_dma_tag_destroy(dmah->tag); + free(dmah, DRM_MEM_DMA); + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); + return ENOMEM; } + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, + request->size, drm_sg_alloc_cb, entry, 0); + if (ret != 0) { + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + bus_dma_tag_destroy(dmah->tag); + free(dmah, DRM_MEM_DMA); + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); + return ENOMEM; + } + + entry->sg_dmah = dmah; + entry->handle = (unsigned long)dmah->vaddr; + DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); entry->virtual = (void *)entry->handle; @@ -101,22 +132,49 @@ int drm_sg_alloc(struct drm_device * dev return 0; } -int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv) +static void +drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct drm_sg_mem *entry = arg; + int i; + + if (error != 0) + return; + + for(i = 0 ; i < nsegs ; i++) { + entry->busaddr[i] = segs[i].ds_addr; + } +} + +int +drm_sg_alloc_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv) { struct drm_scatter_gather *request = data; - int ret; - DRM_DEBUG("%s\n", __FUNCTION__); + DRM_DEBUG("\n"); + + return drm_sg_alloc(dev, request); +} - ret = drm_sg_alloc(dev, request); - return ret; +void +drm_sg_cleanup(struct drm_sg_mem *entry) +{ + struct drm_dma_handle *dmah = entry->sg_dmah; + + bus_dmamap_unload(dmah->tag, dmah->map); + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + bus_dma_tag_destroy(dmah->tag); + free(dmah, DRM_MEM_DMA); + free(entry->busaddr, DRM_MEM_PAGES); + free(entry, DRM_MEM_SGLISTS); } -int drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) +int +drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_scatter_gather *request = data; - drm_sg_mem_t *entry; + struct drm_sg_mem *entry; DRM_LOCK(); entry = dev->sg; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:13:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EBDB1065674; Thu, 18 Dec 2008 21:13:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 755AF8FC12; Thu, 18 Dec 2008 21:13:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBILDkLG052443; Thu, 18 Dec 2008 21:13:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBILDkwt052441; Thu, 18 Dec 2008 21:13:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812182113.mBILDkwt052441@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Dec 2008 21:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:13:46 -0000 Author: mav Date: Thu Dec 18 21:13:46 2008 New Revision: 186296 URL: http://svn.freebsd.org/changeset/base/186296 Log: Before modularization commit, atapci driver was attaching only to devices of storage class. This check was lost. It is not important for the most cases, but as it was reported on current@, it does important for sis driver and surely inportant for AHCI driver. So restore it there. Submitted by: Toshikazu ICHINOSEKI, Andrey V. Elsukov Discussed on: current@ Modified: head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-sis.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Thu Dec 18 21:04:50 2008 (r186295) +++ head/sys/dev/ata/chipsets/ata-ahci.c Thu Dec 18 21:13:46 2008 (r186296) @@ -73,8 +73,9 @@ ata_ahci_probe(device_t dev) char buffer[64]; /* is this a possible AHCI candidate ? */ - if (pci_get_subclass(dev) != PCIS_STORAGE_SATA) - return ENXIO; + if (pci_get_class(dev) != PCIC_STORAGE || + pci_get_subclass(dev) != PCIS_STORAGE_SATA) + return (ENXIO); /* is this PCI device flagged as an AHCI compliant chip ? */ if (pci_read_config(dev, PCIR_PROGIF, 1) != PCIP_STORAGE_SATA_AHCI_1_0) Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 2008 (r186295) +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 2008 (r186296) @@ -105,6 +105,9 @@ ata_sis_probe(device_t dev) char buffer[64]; int found = 0; + if (pci_get_class(dev) != PCIC_STORAGE) + return (ENXIO); + if (pci_get_vendor(dev) != ATA_SIS_ID) return ENXIO; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:37:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFA81065673; Thu, 18 Dec 2008 21:37:31 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8423E8FC13; Thu, 18 Dec 2008 21:37:31 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBILbV7b052888; Thu, 18 Dec 2008 21:37:31 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBILbVOt052886; Thu, 18 Dec 2008 21:37:31 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200812182137.mBILbVOt052886@svn.freebsd.org> From: Paolo Pisati Date: Thu, 18 Dec 2008 21:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186297 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:37:31 -0000 Author: piso Date: Thu Dec 18 21:37:31 2008 New Revision: 186297 URL: http://svn.freebsd.org/changeset/base/186297 Log: Honor the quiet (-q) option while adding a nat rule. Submitted by: Andrey V. Elsukov MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Dec 18 21:13:46 2008 (r186296) +++ head/sbin/ipfw/ipfw2.c Thu Dec 18 21:37:31 2008 (r186297) @@ -4067,10 +4067,12 @@ config_nat(int ac, char **av) if (i) err(1, "setsockopt(%s)", "IP_FW_NAT_CFG"); - /* After every modification, we show the resultant rule. */ - int _ac = 3; - char *_av[] = {"show", "config", id}; - show_nat(_ac, _av); + if (!do_quiet) { + /* After every modification, we show the resultant rule. */ + int _ac = 3; + char *_av[] = {"show", "config", id}; + show_nat(_ac, _av); + } } static void From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:45:35 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01112106567A; Thu, 18 Dec 2008 21:45:35 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mx6.bahnhof.se (mx6.bahnhof.se [213.80.101.16]) by mx1.freebsd.org (Postfix) with ESMTP id A65758FC16; Thu, 18 Dec 2008 21:45:34 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mx6.local [127.0.0.1]) by mx6-reinject (Postfix) with ESMTP id 5301821109A; Thu, 18 Dec 2008 22:45:33 +0100 (CET) Received: from mx6.bahnhof.se ([127.0.0.1]) by localhost (mx6.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19682-01; Thu, 18 Dec 2008 22:45:29 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mx6.bahnhof.se (Postfix) with ESMTP id D6FD021102D; Thu, 18 Dec 2008 22:45:29 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.176 [270.9.19/1855]); Thu, 18 Dec 2008 22:45:25 +0100 Message-ID: <494AC475.20808@gmail.com> Date: Thu, 18 Dec 2008 22:45:25 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Alexander Motin References: <200812182113.mBILDkwt052441@svn.freebsd.org> In-Reply-To: <200812182113.mBILDkwt052441@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MX6) X-Spam-Status: No, score=1.708 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708] X-Spam-Score: 1.708 X-Spam-Level: * Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:45:35 -0000 Alexander Motin wrote: > Author: mav > Date: Thu Dec 18 21:13:46 2008 > New Revision: 186296 > URL: http://svn.freebsd.org/changeset/base/186296 > > Log: > Before modularization commit, atapci driver was attaching only to devices of > storage class. This check was lost. It is not important for the most cases, > but as it was reported on current@, it does important for sis driver and > surely inportant for AHCI driver. So restore it there. > > Submitted by: Toshikazu ICHINOSEKI, Andrey V. Elsukov > Discussed on: current@ > > Modified: > head/sys/dev/ata/chipsets/ata-ahci.c > head/sys/dev/ata/chipsets/ata-sis.c > > Modified: head/sys/dev/ata/chipsets/ata-ahci.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-ahci.c Thu Dec 18 21:04:50 2008 (r186295) > +++ head/sys/dev/ata/chipsets/ata-ahci.c Thu Dec 18 21:13:46 2008 (r186296) > @@ -73,8 +73,9 @@ ata_ahci_probe(device_t dev) > char buffer[64]; > > /* is this a possible AHCI candidate ? */ > - if (pci_get_subclass(dev) != PCIS_STORAGE_SATA) > - return ENXIO; > + if (pci_get_class(dev) != PCIC_STORAGE || > + pci_get_subclass(dev) != PCIS_STORAGE_SATA) > + return (ENXIO); > > /* is this PCI device flagged as an AHCI compliant chip ? */ > if (pci_read_config(dev, PCIR_PROGIF, 1) != PCIP_STORAGE_SATA_AHCI_1_0) > > Modified: head/sys/dev/ata/chipsets/ata-sis.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 2008 (r186295) > +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 2008 (r186296) > @@ -105,6 +105,9 @@ ata_sis_probe(device_t dev) > char buffer[64]; > int found = 0; > > + if (pci_get_class(dev) != PCIC_STORAGE) > + return (ENXIO); > + > if (pci_get_vendor(dev) != ATA_SIS_ID) > return ENXIO; > With this change, am I able to boot from a harddrive located on a SiS-controller again? Or is that more likely a different issue? I have't investigated my issue properly due to lack of time, so I don't know exactly what's wrong, only that it can't find the hard drive properly. Regards! //Niclas From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:46:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 352261065676; Thu, 18 Dec 2008 21:46:19 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B4B08FC17; Thu, 18 Dec 2008 21:46:19 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBILkJHe053082; Thu, 18 Dec 2008 21:46:19 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBILkJnT053081; Thu, 18 Dec 2008 21:46:19 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200812182146.mBILkJnT053081@svn.freebsd.org> From: Paolo Pisati Date: Thu, 18 Dec 2008 21:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186298 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:46:19 -0000 Author: piso Date: Thu Dec 18 21:46:18 2008 New Revision: 186298 URL: http://svn.freebsd.org/changeset/base/186298 Log: Update the ipfw man page to reflect last change (-q option with nat option). MFC after: 3 days Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Dec 18 21:37:31 2008 (r186297) +++ head/sbin/ipfw/ipfw.8 Thu Dec 18 21:46:18 2008 (r186298) @@ -69,6 +69,7 @@ .Op Ar number ... .Pp .Nm +.Op Fl q .Cm nat .Ar number .Cm config @@ -235,6 +236,7 @@ Try to resolve addresses and service nam .It Fl q While .Cm add Ns ing , +.Cm nat Ns ing , .Cm zero Ns ing , .Cm resetlog Ns ging or From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:58:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EEEF106564A; Thu, 18 Dec 2008 21:58:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4F6EA8FC12; Thu, 18 Dec 2008 21:58:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 230126621; Thu, 18 Dec 2008 23:58:21 +0200 Message-ID: <494AC77A.5010609@FreeBSD.org> Date: Thu, 18 Dec 2008 23:58:18 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Niclas Zeising References: <200812182113.mBILDkwt052441@svn.freebsd.org> <494AC475.20808@gmail.com> In-Reply-To: <494AC475.20808@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:58:23 -0000 Niclas Zeising wrote: > Alexander Motin wrote: >> Author: mav >> Date: Thu Dec 18 21:13:46 2008 >> New Revision: 186296 >> URL: http://svn.freebsd.org/changeset/base/186296 >> >> Log: >> Before modularization commit, atapci driver was attaching only to >> devices of >> storage class. This check was lost. It is not important for the most >> cases, >> but as it was reported on current@, it does important for sis driver >> and >> surely inportant for AHCI driver. So restore it there. >> Submitted by: Toshikazu ICHINOSEKI, Andrey V. Elsukov >> Discussed on: current@ >> >> --- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 2008 >> (r186295) >> +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 2008 >> (r186296) >> @@ -105,6 +105,9 @@ ata_sis_probe(device_t dev) >> char buffer[64]; >> int found = 0; >> >> + if (pci_get_class(dev) != PCIC_STORAGE) >> + return (ENXIO); >> + >> if (pci_get_vendor(dev) != ATA_SIS_ID) >> return ENXIO; > > With this change, am I able to boot from a harddrive located on a > SiS-controller again? Or is that more likely a different issue? > I have't investigated my issue properly due to lack of time, so I don't > know exactly what's wrong, only that it can't find the hard drive properly. I have no idea what your problem is, I am just a man. :) But if your problem appeared on 8-CURRENT about two months ago, then it may be it and so may be solved. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 21:58:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6CD1065677; Thu, 18 Dec 2008 21:58:57 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C095D8FC0C; Thu, 18 Dec 2008 21:58:57 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBILwvrv053337; Thu, 18 Dec 2008 21:58:57 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBILwvX9053335; Thu, 18 Dec 2008 21:58:57 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200812182158.mBILwvX9053335@svn.freebsd.org> From: Robert Noland Date: Thu, 18 Dec 2008 21:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186299 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 21:58:57 -0000 Author: rnoland Date: Thu Dec 18 21:58:57 2008 New Revision: 186299 URL: http://svn.freebsd.org/changeset/base/186299 Log: We only want drm to ever attach to the primary pci device. Intel 855 chips present the same pci id for both heads. This prevents us from attaching to the dummy second head. All other chips that I am aware of either only present a single pci id, or different ids for each head so that we only match on the correct head. Approved by: kib@ MFC after: 2 weeks Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_drv.c Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Thu Dec 18 21:46:18 2008 (r186298) +++ head/sys/dev/drm/drmP.h Thu Dec 18 21:58:57 2008 (r186299) @@ -87,6 +87,7 @@ struct drm_file; #include #include #include +#include #include #include Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Thu Dec 18 21:46:18 2008 (r186298) +++ head/sys/dev/drm/drm_drv.c Thu Dec 18 21:58:57 2008 (r186299) @@ -152,6 +152,10 @@ int drm_probe(device_t dev, drm_pci_id_l device = pci_get_device(dev); #endif + if (pci_get_class(dev) != PCIC_DISPLAY + || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) + return ENXIO; + id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { device_set_desc(dev, id_entry->name); From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 22:00:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6005D1065701; Thu, 18 Dec 2008 22:00:36 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf1.bahnhof.se (mxf1.bahnhof.se [213.80.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id B52E68FC1D; Thu, 18 Dec 2008 22:00:35 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mxf1.local [127.0.0.1]) by mxf1-reinject (Postfix) with ESMTP id 4B4C55C3B; Thu, 18 Dec 2008 23:00:33 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF1) X-Spam-Score: 2.777 X-Spam-Level: ** X-Spam-Status: No, score=2.777 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708, SPF_NEUTRAL=1.069] Received: from mxf1.bahnhof.se ([127.0.0.1]) by localhost (mxf1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XX6Fv2JN+pXA; Thu, 18 Dec 2008 23:00:31 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mxf1.bahnhof.se (Postfix) with ESMTP id 22A305DDF; Thu, 18 Dec 2008 23:00:31 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.176 [270.9.19/1855]); Thu, 18 Dec 2008 23:00:28 +0100 Message-ID: <494AC7FC.8000805@gmail.com> Date: Thu, 18 Dec 2008 23:00:28 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Alexander Motin References: <200812182113.mBILDkwt052441@svn.freebsd.org> <494AC475.20808@gmail.com> <494AC77A.5010609@FreeBSD.org> In-Reply-To: <494AC77A.5010609@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 22:00:36 -0000 Alexander Motin wrote: > Niclas Zeising wrote: >> Alexander Motin wrote: >>> Author: mav >>> Date: Thu Dec 18 21:13:46 2008 >>> New Revision: 186296 >>> URL: http://svn.freebsd.org/changeset/base/186296 >>> >>> Log: >>> Before modularization commit, atapci driver was attaching only to >>> devices of >>> storage class. This check was lost. It is not important for the >>> most cases, >>> but as it was reported on current@, it does important for sis >>> driver and >>> surely inportant for AHCI driver. So restore it there. >>> Submitted by: Toshikazu ICHINOSEKI, Andrey V. Elsukov >>> Discussed on: current@ >>> >>> --- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 >>> 2008 (r186295) >>> +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 >>> 2008 (r186296) >>> @@ -105,6 +105,9 @@ ata_sis_probe(device_t dev) >>> char buffer[64]; >>> int found = 0; >>> >>> + if (pci_get_class(dev) != PCIC_STORAGE) >>> + return (ENXIO); >>> + >>> if (pci_get_vendor(dev) != ATA_SIS_ID) >>> return ENXIO; >> >> With this change, am I able to boot from a harddrive located on a >> SiS-controller again? Or is that more likely a different issue? >> I have't investigated my issue properly due to lack of time, so I >> don't know exactly what's wrong, only that it can't find the hard >> drive properly. > > I have no idea what your problem is, I am just a man. :) But if your > problem appeared on 8-CURRENT about two months ago, then it may be it > and so may be solved. > The dates seems approximately correct... I'm about to do a little magic (i.e. shuffeling harddrives around and whatnot) to compile a new kernel with the change, hopefully it works :) //Niclas From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 22:01:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DD8C10656B0; Thu, 18 Dec 2008 22:01:46 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832A48FC1F; Thu, 18 Dec 2008 22:01:46 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIM1kYn053450; Thu, 18 Dec 2008 22:01:46 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIM1kjS053449; Thu, 18 Dec 2008 22:01:46 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200812182201.mBIM1kjS053449@svn.freebsd.org> From: Robert Noland Date: Thu, 18 Dec 2008 22:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186300 - head/sys/dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 22:01:46 -0000 Author: rnoland Date: Thu Dec 18 22:01:46 2008 New Revision: 186300 URL: http://svn.freebsd.org/changeset/base/186300 Log: Garbage collect entries from pcireg.h since we now include it. Approved by: kib@ MFC after: 2 weeks Modified: head/sys/dev/drm/drmP.h Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Thu Dec 18 21:58:57 2008 (r186299) +++ head/sys/dev/drm/drmP.h Thu Dec 18 22:01:46 2008 (r186300) @@ -212,15 +212,6 @@ enum { #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks -/* Capabilities taken from src/sys/dev/pci/pcireg.h. */ -#ifndef PCIY_AGP -#define PCIY_AGP 0x02 -#endif - -#ifndef PCIY_EXPRESS -#define PCIY_EXPRESS 0x10 -#endif - typedef unsigned long dma_addr_t; typedef u_int64_t u64; typedef u_int32_t u32; From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 22:04:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D649F106564A; Thu, 18 Dec 2008 22:04:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9828FC12; Thu, 18 Dec 2008 22:04:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIM4Dqb053532; Thu, 18 Dec 2008 22:04:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIM4DrR053530; Thu, 18 Dec 2008 22:04:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200812182204.mBIM4DrR053530@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Dec 2008 22:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186301 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 22:04:14 -0000 Author: mav Date: Thu Dec 18 22:04:13 2008 New Revision: 186301 URL: http://svn.freebsd.org/changeset/base/186301 Log: Add ULI M5461 chipset and vendor ID. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Dec 18 22:01:46 2008 (r186300) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Dec 18 22:04:13 2008 (r186301) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081123_0118" +#define HDA_DRV_TEST_REV "20081219_0119" SND_DECLARE_FILE("$FreeBSD$"); @@ -180,6 +180,11 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_SIS_966 HDA_MODEL_CONSTRUCT(SIS, 0x7502) #define HDA_SIS_ALL HDA_MODEL_CONSTRUCT(SIS, 0xffff) +/* ULI */ +#define ULI_VENDORID 0x10b9 +#define HDA_ULI_M5461 HDA_MODEL_CONSTRUCT(ULI, 0x5461) +#define HDA_ULI_ALL HDA_MODEL_CONSTRUCT(ULI, 0xffff) + /* OEM/subvendors */ /* Intel */ @@ -467,12 +472,14 @@ static const struct { { HDA_ATI_SB600, "ATI SB600" }, { HDA_VIA_VT82XX, "VIA VT8251/8237A" }, { HDA_SIS_966, "SiS 966" }, + { HDA_ULI_M5461, "ULI M5461" }, /* Unknown */ { HDA_INTEL_ALL, "Intel (Unknown)" }, { HDA_NVIDIA_ALL, "NVidia (Unknown)" }, { HDA_ATI_ALL, "ATI (Unknown)" }, { HDA_VIA_ALL, "VIA (Unknown)" }, { HDA_SIS_ALL, "SiS (Unknown)" }, + { HDA_ULI_ALL, "ULI (Unknown)" }, }; #define HDAC_DEVICES_LEN (sizeof(hdac_devices) / sizeof(hdac_devices[0])) From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:00:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEAB21065748; Thu, 18 Dec 2008 23:00:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A449F8FC16; Thu, 18 Dec 2008 23:00:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBIN0Ae8054653; Thu, 18 Dec 2008 23:00:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBIN09We054639; Thu, 18 Dec 2008 23:00:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812182300.mBIN09We054639@svn.freebsd.org> From: Sam Leffler Date: Thu, 18 Dec 2008 23:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186302 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 23:00:11 -0000 Author: sam Date: Thu Dec 18 23:00:09 2008 New Revision: 186302 URL: http://svn.freebsd.org/changeset/base/186302 Log: convert MALLOC/FREE to malloc/free Modified: head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_crypto_ccmp.c head/sys/net80211/ieee80211_crypto_tkip.c head/sys/net80211/ieee80211_crypto_wep.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_acl.c ============================================================================== --- head/sys/net80211/ieee80211_acl.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_acl.c Thu Dec 18 23:00:09 2008 (r186302) @@ -99,7 +99,7 @@ acl_attach(struct ieee80211vap *vap) { struct aclstate *as; - MALLOC(as, struct aclstate *, sizeof(struct aclstate), + as = (struct aclstate *) malloc(sizeof(struct aclstate), M_80211_ACL, M_NOWAIT | M_ZERO); if (as == NULL) return 0; @@ -123,7 +123,7 @@ acl_detach(struct ieee80211vap *vap) acl_free_all(vap); vap->iv_as = NULL; ACL_LOCK_DESTROY(as); - FREE(as, M_80211_ACL); + free(as, M_80211_ACL); } static __inline struct acl * @@ -147,7 +147,7 @@ _acl_free(struct aclstate *as, struct ac TAILQ_REMOVE(&as->as_list, acl, acl_list); LIST_REMOVE(acl, acl_hash); - FREE(acl, M_80211_ACL); + free(acl, M_80211_ACL); as->as_nacls--; } @@ -175,7 +175,7 @@ acl_add(struct ieee80211vap *vap, const struct acl *acl, *new; int hash; - MALLOC(new, struct acl *, sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO); + new = (struct acl *) malloc(sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO); if (new == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL, "ACL: add %s failed, no memory\n", ether_sprintf(mac)); @@ -188,7 +188,7 @@ acl_add(struct ieee80211vap *vap, const LIST_FOREACH(acl, &as->as_hash[hash], acl_hash) { if (IEEE80211_ADDR_EQ(acl->acl_macaddr, mac)) { ACL_UNLOCK(as); - FREE(new, M_80211_ACL); + free(new, M_80211_ACL); IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL, "ACL: add %s failed, already present\n", ether_sprintf(mac)); @@ -301,7 +301,7 @@ acl_getioctl(struct ieee80211vap *vap, s ireq->i_len = space; /* return required space */ return 0; /* NB: must not error */ } - MALLOC(ap, struct ieee80211req_maclist *, space, + ap = (struct ieee80211req_maclist *) malloc(space, M_TEMP, M_NOWAIT); if (ap == NULL) return ENOMEM; @@ -317,7 +317,7 @@ acl_getioctl(struct ieee80211vap *vap, s ireq->i_len = space; } else error = copyout(ap, ireq->i_data, ireq->i_len); - FREE(ap, M_TEMP); + free(ap, M_TEMP); return error; } return EINVAL; Modified: head/sys/net80211/ieee80211_crypto_ccmp.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_ccmp.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_crypto_ccmp.c Thu Dec 18 23:00:09 2008 (r186302) @@ -96,7 +96,7 @@ ccmp_attach(struct ieee80211vap *vap, st { struct ccmp_ctx *ctx; - MALLOC(ctx, struct ccmp_ctx *, sizeof(struct ccmp_ctx), + ctx = (struct ccmp_ctx *) malloc(sizeof(struct ccmp_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -113,7 +113,7 @@ ccmp_detach(struct ieee80211_key *k) { struct ccmp_ctx *ctx = k->wk_private; - FREE(ctx, M_80211_CRYPTO); + free(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_crypto_tkip.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_tkip.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_crypto_tkip.c Thu Dec 18 23:00:09 2008 (r186302) @@ -109,7 +109,7 @@ tkip_attach(struct ieee80211vap *vap, st { struct tkip_ctx *ctx; - MALLOC(ctx, struct tkip_ctx *, sizeof(struct tkip_ctx), + ctx = (struct tkip_ctx *) malloc(sizeof(struct tkip_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -126,7 +126,7 @@ tkip_detach(struct ieee80211_key *k) { struct tkip_ctx *ctx = k->wk_private; - FREE(ctx, M_80211_CRYPTO); + free(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_crypto_wep.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_wep.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_crypto_wep.c Thu Dec 18 23:00:09 2008 (r186302) @@ -87,7 +87,7 @@ wep_attach(struct ieee80211vap *vap, str { struct wep_ctx *ctx; - MALLOC(ctx, struct wep_ctx *, sizeof(struct wep_ctx), + ctx = (struct wep_ctx *) malloc(sizeof(struct wep_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -106,7 +106,7 @@ wep_detach(struct ieee80211_key *k) { struct wep_ctx *ctx = k->wk_private; - FREE(ctx, M_80211_CRYPTO); + free(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_freebsd.c Thu Dec 18 23:00:09 2008 (r186302) @@ -234,7 +234,7 @@ ieee80211_sysctl_vattach(struct ieee8021 struct sysctl_oid *oid; char num[14]; /* sufficient for 32 bits */ - MALLOC(ctx, struct sysctl_ctx_list *, sizeof(struct sysctl_ctx_list), + ctx = (struct sysctl_ctx_list *) malloc(sizeof(struct sysctl_ctx_list), M_DEVBUF, M_NOWAIT | M_ZERO); if (ctx == NULL) { if_printf(ifp, "%s: cannot allocate sysctl context!\n", @@ -310,7 +310,7 @@ ieee80211_sysctl_vdetach(struct ieee8021 if (vap->iv_sysctl != NULL) { sysctl_ctx_free(vap->iv_sysctl); - FREE(vap->iv_sysctl, M_DEVBUF); + free(vap->iv_sysctl, M_DEVBUF); vap->iv_sysctl = NULL; } } Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_hostap.c Thu Dec 18 23:00:09 2008 (r186302) @@ -902,7 +902,7 @@ hostap_auth_open(struct ieee80211_node * * open auth is attempted. */ if (ni->ni_challenge != NULL) { - FREE(ni->ni_challenge, M_80211_NODE); + free(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* XXX hack to workaround calling convention */ @@ -1996,7 +1996,7 @@ hostap_recv_mgmt(struct ieee80211_node * return; /* discard challenge after association */ if (ni->ni_challenge != NULL) { - FREE(ni->ni_challenge, M_80211_NODE); + free(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* NB: 802.11 spec says to ignore station's privacy bit */ Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_input.c Thu Dec 18 23:00:09 2008 (r186302) @@ -499,7 +499,7 @@ int ieee80211_alloc_challenge(struct ieee80211_node *ni) { if (ni->ni_challenge == NULL) - MALLOC(ni->ni_challenge, uint32_t*, IEEE80211_CHALLENGE_LEN, + ni->ni_challenge = (uint32_t *) malloc(IEEE80211_CHALLENGE_LEN, M_80211_NODE, M_NOWAIT); if (ni->ni_challenge == NULL) { IEEE80211_NOTE(ni->ni_vap, Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_ioctl.c Thu Dec 18 23:00:09 2008 (r186302) @@ -320,14 +320,14 @@ ieee80211_ioctl_getscanresults(struct ie space = req.space; /* XXX M_WAITOK after driver lock released */ - MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO); + p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO); if (p == NULL) return ENOMEM; req.sr = p; ieee80211_scan_iterate(vap, get_scan_result, &req); ireq->i_len = space - req.space; error = copyout(p, ireq->i_data, ireq->i_len); - FREE(p, M_TEMP); + free(p, M_TEMP); } else ireq->i_len = 0; @@ -467,7 +467,7 @@ getstainfo_common(struct ieee80211vap *v if (req.space > 0) { space = req.space; /* XXX M_WAITOK after driver lock released */ - MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO); + p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO); if (p == NULL) { error = ENOMEM; goto bad; @@ -479,7 +479,7 @@ getstainfo_common(struct ieee80211vap *v get_sta_info(&req, ni); ireq->i_len = space - req.space; error = copyout(p, (uint8_t *) ireq->i_data+off, ireq->i_len); - FREE(p, M_TEMP); + free(p, M_TEMP); } else ireq->i_len = 0; bad: @@ -696,7 +696,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80 if (ireq->i_len != sizeof(struct ieee80211_devcaps_req)) return EINVAL; - MALLOC(dc, struct ieee80211_devcaps_req *, + dc = (struct ieee80211_devcaps_req *) malloc( sizeof(struct ieee80211_devcaps_req), M_TEMP, M_NOWAIT | M_ZERO); if (dc == NULL) return ENOMEM; @@ -707,7 +707,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80 ic->ic_getradiocaps(ic, &ci->ic_nchans, ci->ic_chans); ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans); error = copyout(dc, ireq->i_data, sizeof(*dc)); - FREE(dc, M_TEMP); + free(dc, M_TEMP); return error; } @@ -1985,14 +1985,14 @@ ieee80211_ioctl_setregdomain(struct ieee if (ireq->i_len != sizeof(struct ieee80211_regdomain_req)) return EINVAL; - MALLOC(reg, struct ieee80211_regdomain_req *, + reg = (struct ieee80211_regdomain_req *) malloc( sizeof(struct ieee80211_regdomain_req), M_TEMP, M_NOWAIT); if (reg == NULL) return ENOMEM; error = copyin(ireq->i_data, reg, sizeof(*reg)); if (error == 0) error = ieee80211_setregdomain(vap, reg); - FREE(reg, M_TEMP); + free(reg, M_TEMP); return (error == 0 ? ENETRESET : error); } @@ -2131,7 +2131,7 @@ setappie(struct ieee80211_appie **aie, c if (ireq->i_len == 0) { /* delete any existing ie */ if (app != NULL) { *aie = NULL; /* XXX racey */ - FREE(app, M_80211_NODE_IE); + free(app, M_80211_NODE_IE); } return 0; } @@ -2145,20 +2145,20 @@ setappie(struct ieee80211_appie **aie, c * * XXX bad bad bad */ - MALLOC(napp, struct ieee80211_appie *, + napp = (struct ieee80211_appie *) malloc( sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT); if (napp == NULL) return ENOMEM; /* XXX holding ic lock */ error = copyin(ireq->i_data, napp->ie_data, ireq->i_len); if (error) { - FREE(napp, M_80211_NODE_IE); + free(napp, M_80211_NODE_IE); return error; } napp->ie_len = ireq->i_len; *aie = napp; if (app != NULL) - FREE(app, M_80211_NODE_IE); + free(app, M_80211_NODE_IE); return 0; } Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_node.c Thu Dec 18 23:00:09 2008 (r186302) @@ -153,7 +153,7 @@ ieee80211_node_latevattach(struct ieee80 "WARNING: max aid too small, changed to %d\n", vap->iv_max_aid); } - MALLOC(vap->iv_aid_bitmap, uint32_t *, + vap->iv_aid_bitmap = (uint32_t *) malloc( howmany(vap->iv_max_aid, 32) * sizeof(uint32_t), M_80211_NODE, M_NOWAIT | M_ZERO); if (vap->iv_aid_bitmap == NULL) { @@ -180,7 +180,7 @@ ieee80211_node_vdetach(struct ieee80211v vap->iv_bss = NULL; } if (vap->iv_aid_bitmap != NULL) { - FREE(vap->iv_aid_bitmap, M_80211_NODE); + free(vap->iv_aid_bitmap, M_80211_NODE); vap->iv_aid_bitmap = NULL; } } @@ -789,7 +789,7 @@ node_alloc(struct ieee80211vap *vap, con { struct ieee80211_node *ni; - MALLOC(ni, struct ieee80211_node *, sizeof(struct ieee80211_node), + ni = (struct ieee80211_node *) malloc(sizeof(struct ieee80211_node), M_80211_NODE, M_NOWAIT | M_ZERO); return ni; } @@ -807,11 +807,11 @@ ieee80211_ies_init(struct ieee80211_ies memset(ies, 0, offsetof(struct ieee80211_ies, data)); if (ies->data != NULL && ies->len != len) { /* data size changed */ - FREE(ies->data, M_80211_NODE_IE); + free(ies->data, M_80211_NODE_IE); ies->data = NULL; } if (ies->data == NULL) { - MALLOC(ies->data, uint8_t *, len, M_80211_NODE_IE, M_NOWAIT); + ies->data = (uint8_t *) malloc(len, M_80211_NODE_IE, M_NOWAIT); if (ies->data == NULL) { ies->len = 0; /* NB: pointers have already been zero'd above */ @@ -830,7 +830,7 @@ void ieee80211_ies_cleanup(struct ieee80211_ies *ies) { if (ies->data != NULL) - FREE(ies->data, M_80211_NODE_IE); + free(ies->data, M_80211_NODE_IE); } /* @@ -912,7 +912,7 @@ node_cleanup(struct ieee80211_node *ni) ni->ni_associd = 0; if (ni->ni_challenge != NULL) { - FREE(ni->ni_challenge, M_80211_NODE); + free(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* @@ -948,7 +948,7 @@ node_free(struct ieee80211_node *ni) ieee80211_ies_cleanup(&ni->ni_ies); ieee80211_psq_cleanup(&ni->ni_psq); IEEE80211_NODE_WDSQ_DESTROY(ni); - FREE(ni, M_80211_NODE); + free(ni, M_80211_NODE); } static void @@ -1791,7 +1791,7 @@ ieee80211_node_table_init(struct ieee802 nt->nt_inact_init = inact; nt->nt_keyixmax = keyixmax; if (nt->nt_keyixmax > 0) { - MALLOC(nt->nt_keyixmap, struct ieee80211_node **, + nt->nt_keyixmap = (struct ieee80211_node **) malloc( keyixmax * sizeof(struct ieee80211_node *), M_80211_NODE, M_NOWAIT | M_ZERO); if (nt->nt_keyixmap == NULL) @@ -1852,7 +1852,7 @@ ieee80211_node_table_cleanup(struct ieee printf("%s: %s[%u] still active\n", __func__, nt->nt_name, i); #endif - FREE(nt->nt_keyixmap, M_80211_NODE); + free(nt->nt_keyixmap, M_80211_NODE); nt->nt_keyixmap = NULL; } IEEE80211_NODE_ITERATE_LOCK_DESTROY(nt); Modified: head/sys/net80211/ieee80211_power.c ============================================================================== --- head/sys/net80211/ieee80211_power.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_power.c Thu Dec 18 23:00:09 2008 (r186302) @@ -80,7 +80,7 @@ ieee80211_power_latevattach(struct ieee8 */ if (vap->iv_opmode == IEEE80211_M_HOSTAP) { vap->iv_tim_len = howmany(vap->iv_max_aid,8) * sizeof(uint8_t); - MALLOC(vap->iv_tim_bitmap, uint8_t *, vap->iv_tim_len, + vap->iv_tim_bitmap = (uint8_t *) malloc(vap->iv_tim_len, M_80211_POWER, M_NOWAIT | M_ZERO); if (vap->iv_tim_bitmap == NULL) { printf("%s: no memory for TIM bitmap!\n", __func__); @@ -94,7 +94,7 @@ void ieee80211_power_vdetach(struct ieee80211vap *vap) { if (vap->iv_tim_bitmap != NULL) { - FREE(vap->iv_tim_bitmap, M_80211_POWER); + free(vap->iv_tim_bitmap, M_80211_POWER); vap->iv_tim_bitmap = NULL; } } Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_proto.c Thu Dec 18 23:00:09 2008 (r186302) @@ -214,7 +214,7 @@ ieee80211_proto_vdetach(struct ieee80211 { #define FREEAPPIE(ie) do { \ if (ie != NULL) \ - FREE(ie, M_80211_NODE_IE); \ + free(ie, M_80211_NODE_IE); \ } while (0) /* * Detach operating mode module. Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_scan.c Thu Dec 18 23:00:09 2008 (r186302) @@ -96,7 +96,7 @@ ieee80211_scan_attach(struct ieee80211co { struct scan_state *ss; - MALLOC(ss, struct scan_state *, sizeof(struct scan_state), + ss = (struct scan_state *) malloc(sizeof(struct scan_state), M_80211_SCAN, M_NOWAIT | M_ZERO); if (ss == NULL) { ic->ic_scan = NULL; @@ -122,7 +122,7 @@ ieee80211_scan_detach(struct ieee80211co } ic->ic_flags &= ~IEEE80211_F_SCAN; ic->ic_scan = NULL; - FREE(SCAN_PRIVATE(ss), M_80211_SCAN); + free(SCAN_PRIVATE(ss), M_80211_SCAN); } } Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_scan_sta.c Thu Dec 18 23:00:09 2008 (r186302) @@ -140,7 +140,7 @@ sta_attach(struct ieee80211_scan_state * { struct sta_table *st; - MALLOC(st, struct sta_table *, sizeof(struct sta_table), + st = (struct sta_table *) malloc(sizeof(struct sta_table), M_80211_SCAN, M_NOWAIT | M_ZERO); if (st == NULL) return 0; @@ -164,7 +164,7 @@ sta_detach(struct ieee80211_scan_state * sta_flush_table(st); mtx_destroy(&st->st_lock); mtx_destroy(&st->st_scanlock); - FREE(st, M_80211_SCAN); + free(st, M_80211_SCAN); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } @@ -198,7 +198,7 @@ sta_flush_table(struct sta_table *st) TAILQ_REMOVE(&st->st_entry, se, se_list); LIST_REMOVE(se, se_hash); ieee80211_ies_cleanup(&se->base.se_ies); - FREE(se, M_80211_SCAN); + free(se, M_80211_SCAN); } memset(st->st_maxrssi, 0, sizeof(st->st_maxrssi)); } @@ -231,7 +231,7 @@ sta_add(struct ieee80211_scan_state *ss, LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) goto found; - MALLOC(se, struct sta_entry *, sizeof(struct sta_entry), + se = (struct sta_entry *) malloc(sizeof(struct sta_entry), M_80211_SCAN, M_NOWAIT | M_ZERO); if (se == NULL) { mtx_unlock(&st->st_lock); @@ -1509,7 +1509,7 @@ adhoc_age(struct ieee80211_scan_state *s TAILQ_REMOVE(&st->st_entry, se, se_list); LIST_REMOVE(se, se_hash); ieee80211_ies_cleanup(&se->base.se_ies); - FREE(se, M_80211_SCAN); + free(se, M_80211_SCAN); } } mtx_unlock(&st->st_lock); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Dec 18 22:04:13 2008 (r186301) +++ head/sys/net80211/ieee80211_sta.c Thu Dec 18 23:00:09 2008 (r186302) @@ -1018,7 +1018,7 @@ sta_auth_shared(struct ieee80211_node *n switch (seq) { case IEEE80211_AUTH_SHARED_PASS: if (ni->ni_challenge != NULL) { - FREE(ni->ni_challenge, M_80211_NODE); + free(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } if (status != 0) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:02:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6060E106567A; Thu, 18 Dec 2008 23:02:00 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf2.bahnhof.se (mxf2.bahnhof.se [213.80.101.26]) by mx1.freebsd.org (Postfix) with ESMTP id D34A98FC13; Thu, 18 Dec 2008 23:01:59 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mxf2.local [127.0.0.1]) by mxf2-reinject (Postfix) with ESMTP id 853AB6BD1DF; Fri, 19 Dec 2008 00:01:58 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 2.777 X-Spam-Level: ** X-Spam-Status: No, score=2.777 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708, SPF_NEUTRAL=1.069] Received: from mxf2.bahnhof.se ([127.0.0.1]) by localhost (mxf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZHbGIaBb-HuU; Fri, 19 Dec 2008 00:01:57 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mxf2.bahnhof.se (Postfix) with ESMTP id 55FA36BD089; Fri, 19 Dec 2008 00:01:57 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.176 [270.9.19/1855]); Fri, 19 Dec 2008 00:01:53 +0100 Message-ID: <494AD661.9080001@gmail.com> Date: Fri, 19 Dec 2008 00:01:53 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Jens Schweikhardt References: <200812182113.mBILDkwt052441@svn.freebsd.org> <494AC475.20808@gmail.com> <20081218224402.GB6014@schweikhardt.net> In-Reply-To: <20081218224402.GB6014@schweikhardt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 23:02:00 -0000 Jens Schweikhardt wrote: > On Thu, Dec 18, 2008 at 10:45:25PM +0100, Niclas Zeising wrote: > ... > # With this change, am I able to boot from a harddrive located on a > # SiS-controller again? Or is that more likely a different issue? > # I have't investigated my issue properly due to lack of time, so I don't > # know exactly what's wrong, only that it can't find the hard drive properly. > # Regards! > # //Niclas > > Is your error message by chance something like this: > > "Can't work out which disk we are booting from. Guessed BIOS device > 0xffffffff not found by probes, defaulting to disk0"? > > This is what I get since about December 5th on 8-CURRENT. I'm in > the process of nailing it down to a single commit. > > Regards, > > Jens Nope, That's not it. I get errors when trying to mount root, after booting kernel. It can't find the harddrive... //Niclas From owner-svn-src-all@FreeBSD.ORG Thu Dec 18 23:09:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A780A1065673; Thu, 18 Dec 2008 23:09:06 +0000 (UTC) (envelope-from schweikh@schweikhardt.net) Received: from rs2.shuttle.de (rs2.shuttle.de [194.95.249.4]) by mx1.freebsd.org (Postfix) with ESMTP id 659678FC08; Thu, 18 Dec 2008 23:09:06 +0000 (UTC) (envelope-from schweikh@schweikhardt.net) Received: by rs2.shuttle.de (Postfix, from userid 10) id 6DD5558004; Thu, 18 Dec 2008 23:45:26 +0100 (CET) Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) by hal9000.schweikhardt.net (8.14.3/8.14.3) with ESMTP id mBIMi3BH006197; Thu, 18 Dec 2008 23:44:03 +0100 (CET) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.14.3/8.14.3/Submit) id mBIMi3AL006196; Thu, 18 Dec 2008 23:44:03 +0100 (CET) (envelope-from schweikh) Date: Thu, 18 Dec 2008 23:44:02 +0100 From: Jens Schweikhardt To: Niclas Zeising Message-ID: <20081218224402.GB6014@schweikhardt.net> References: <200812182113.mBILDkwt052441@svn.freebsd.org> <494AC475.20808@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <494AC475.20808@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 23:09:06 -0000 On Thu, Dec 18, 2008 at 10:45:25PM +0100, Niclas Zeising wrote: ... # With this change, am I able to boot from a harddrive located on a # SiS-controller again? Or is that more likely a different issue? # I have't investigated my issue properly due to lack of time, so I don't # know exactly what's wrong, only that it can't find the hard drive properly. # Regards! # //Niclas Is your error message by chance something like this: "Can't work out which disk we are booting from. Guessed BIOS device 0xffffffff not found by probes, defaulting to disk0"? This is what I get since about December 5th on 8-CURRENT. I'm in the process of nailing it down to a single commit. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 00:14:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8CB61065675; Fri, 19 Dec 2008 00:14:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA1C58FC13; Fri, 19 Dec 2008 00:14:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ0EjKd056010; Fri, 19 Dec 2008 00:14:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ0EjGU056009; Fri, 19 Dec 2008 00:14:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812190014.mBJ0EjGU056009@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 00:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186303 - in stable/7/sys: . contrib/pf dev/bce dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 00:14:45 -0000 Author: delphij Date: Fri Dec 19 00:14:45 2008 New Revision: 186303 URL: http://svn.freebsd.org/changeset/base/186303 Log: MFC r186168: Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL before doing bus_dmamap_sync() since it operates on the former, not the latter. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Thu Dec 18 23:00:09 2008 (r186302) +++ stable/7/sys/dev/bce/if_bce.c Fri Dec 19 00:14:45 2008 (r186303) @@ -5114,7 +5114,7 @@ bce_free_tx_chain(struct bce_softc *sc) /* Unmap, unload, and free any mbufs still in the TX mbuf chain. */ for (i = 0; i < TOTAL_TX_BD; i++) { if (sc->tx_mbuf_ptr[i] != NULL) { - if (sc->tx_mbuf_map != NULL) + if (sc->tx_mbuf_map[i] != NULL) bus_dmamap_sync(sc->tx_mbuf_tag, sc->tx_mbuf_map[i], BUS_DMASYNC_POSTWRITE); m_freem(sc->tx_mbuf_ptr[i]); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 00:17:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9208B106564A; Fri, 19 Dec 2008 00:17:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D718FC0C; Fri, 19 Dec 2008 00:17:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ0H9Mv056111; Fri, 19 Dec 2008 00:17:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ0H9j1056110; Fri, 19 Dec 2008 00:17:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812190017.mBJ0H9j1056110@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 00:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186304 - in stable/7/sys: . contrib/pf dev/bce dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 00:17:09 -0000 Author: delphij Date: Fri Dec 19 00:17:09 2008 New Revision: 186304 URL: http://svn.freebsd.org/changeset/base/186304 Log: MFC r186169: Don't count InFramesL2FilterDiscards into Ierr. This value does not represent a real packet error but simply indicate that an unexpected unicast or multicast error was received by the NIC, which was not counted in the past as well. Reported by: many (on -stable@) Reviewed by: davidch Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Fri Dec 19 00:14:45 2008 (r186303) +++ stable/7/sys/dev/bce/if_bce.c Fri Dec 19 00:17:09 2008 (r186304) @@ -7408,7 +7408,6 @@ bce_stats_update(struct bce_softc *sc) (u_long) sc->stat_IfInMBUFDiscards + (u_long) sc->stat_Dot3StatsAlignmentErrors + (u_long) sc->stat_Dot3StatsFCSErrors + - (u_long) sc->stat_IfInFramesL2FilterDiscards + (u_long) sc->stat_IfInRuleCheckerDiscards + (u_long) sc->stat_IfInFTQDiscards + (u_long) sc->com_no_buffers; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 00:19:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6C2106564A; Fri, 19 Dec 2008 00:19:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EBB98FC12; Fri, 19 Dec 2008 00:19:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ0Jldk056222; Fri, 19 Dec 2008 00:19:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ0JlFR056221; Fri, 19 Dec 2008 00:19:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812190019.mBJ0JlFR056221@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 00:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186305 - in releng/7.1/sys: . contrib/pf dev/bce dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 00:19:47 -0000 Author: delphij Date: Fri Dec 19 00:19:46 2008 New Revision: 186305 URL: http://svn.freebsd.org/changeset/base/186305 Log: MFC r186168: Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL before doing bus_dmamap_sync() since it operates on the former, not the latter. Reviewed by: davidch Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/bce/if_bce.c releng/7.1/sys/dev/cxgb/ (props changed) Modified: releng/7.1/sys/dev/bce/if_bce.c ============================================================================== --- releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:17:09 2008 (r186304) +++ releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:19:46 2008 (r186305) @@ -5114,7 +5114,7 @@ bce_free_tx_chain(struct bce_softc *sc) /* Unmap, unload, and free any mbufs still in the TX mbuf chain. */ for (i = 0; i < TOTAL_TX_BD; i++) { if (sc->tx_mbuf_ptr[i] != NULL) { - if (sc->tx_mbuf_map != NULL) + if (sc->tx_mbuf_map[i] != NULL) bus_dmamap_sync(sc->tx_mbuf_tag, sc->tx_mbuf_map[i], BUS_DMASYNC_POSTWRITE); m_freem(sc->tx_mbuf_ptr[i]); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 00:20:48 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910D11065678; Fri, 19 Dec 2008 00:20:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82E858FC12; Fri, 19 Dec 2008 00:20:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ0KmgG056292; Fri, 19 Dec 2008 00:20:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ0KmdH056291; Fri, 19 Dec 2008 00:20:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812190020.mBJ0KmdH056291@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 00:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186306 - in releng/7.1/sys: . contrib/pf dev/bce dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 00:20:48 -0000 Author: delphij Date: Fri Dec 19 00:20:48 2008 New Revision: 186306 URL: http://svn.freebsd.org/changeset/base/186306 Log: MFC r186169: Don't count InFramesL2FilterDiscards into Ierr. This value does not represent a real packet error but simply indicate that an unexpected unicast or multicast error was received by the NIC, which was not counted in the past as well. Reported by: many (on -stable@) Reviewed by: davidch Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/bce/if_bce.c releng/7.1/sys/dev/cxgb/ (props changed) Modified: releng/7.1/sys/dev/bce/if_bce.c ============================================================================== --- releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:19:46 2008 (r186305) +++ releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:20:48 2008 (r186306) @@ -7408,7 +7408,6 @@ bce_stats_update(struct bce_softc *sc) (u_long) sc->stat_IfInMBUFDiscards + (u_long) sc->stat_Dot3StatsAlignmentErrors + (u_long) sc->stat_Dot3StatsFCSErrors + - (u_long) sc->stat_IfInFramesL2FilterDiscards + (u_long) sc->stat_IfInRuleCheckerDiscards + (u_long) sc->stat_IfInFTQDiscards + (u_long) sc->com_no_buffers; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 01:37:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1EB1065674; Fri, 19 Dec 2008 01:37:21 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F157A8FC18; Fri, 19 Dec 2008 01:37:20 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ1bKqu057756; Fri, 19 Dec 2008 01:37:20 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ1bKlg057755; Fri, 19 Dec 2008 01:37:20 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812190137.mBJ1bKlg057755@svn.freebsd.org> From: Qing Li Date: Fri, 19 Dec 2008 01:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186308 - head/usr.sbin/ppp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 01:37:21 -0000 Author: qingli Date: Fri Dec 19 01:37:20 2008 New Revision: 186308 URL: http://svn.freebsd.org/changeset/base/186308 Log: The ppp application relies on the if_tun interface to properly install a p2p host route between the end points. The ppp module upates this router based on user configuration later on. The rt_Update() seems to always set the RTF_GATEWAY flag, which is broken. Modified: head/usr.sbin/ppp/route.c Modified: head/usr.sbin/ppp/route.c ============================================================================== --- head/usr.sbin/ppp/route.c Fri Dec 19 00:56:47 2008 (r186307) +++ head/usr.sbin/ppp/route.c Fri Dec 19 01:37:20 2008 (r186308) @@ -910,8 +910,10 @@ rt_Update(struct bundle *bundle, const s p += memcpy_roundup(p, dst, dst->sa_len); } - rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; + if (gw != NULL && (gw->sa_family != AF_LINK)) + rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; p += memcpy_roundup(p, gw, gw->sa_len); + if (mask) { rtmes.m_rtm.rtm_addrs |= RTA_NETMASK; p += memcpy_roundup(p, mask, mask->sa_len); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 03:59:22 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522591065670; Fri, 19 Dec 2008 03:59:21 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406288FC1C; Fri, 19 Dec 2008 03:59:21 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ3xLMj060882; Fri, 19 Dec 2008 03:59:21 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ3xLov060881; Fri, 19 Dec 2008 03:59:21 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200812190359.mBJ3xLov060881@svn.freebsd.org> From: Ken Smith Date: Fri, 19 Dec 2008 03:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186309 - in stable/7/sys: . contrib/pf dev/cxgb nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 03:59:22 -0000 Author: kensmith Date: Fri Dec 19 03:59:20 2008 New Revision: 186309 URL: http://svn.freebsd.org/changeset/base/186309 Log: MFC r186165: > Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition > to failing with that error. > > PR: 125149 > Submitted by: Jaakko Heinonen (jh saunalahti fi) > Reviewed by: mohans, kan Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/nfsserver/nfs_serv.c Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Fri Dec 19 01:37:20 2008 (r186308) +++ stable/7/sys/nfsserver/nfs_serv.c Fri Dec 19 03:59:20 2008 (r186309) @@ -3600,9 +3600,12 @@ again: * Probe one of the directory entries to see if the filesystem * supports VGET. */ - if (VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, &nvp) == - EOPNOTSUPP) { - error = NFSERR_NOTSUPP; + error = VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, &nvp); + if (error) { + if (error == EOPNOTSUPP) + error = NFSERR_NOTSUPP; + else + error = NFSERR_SERVERFAULT; vrele(vp); vp = NULL; free((caddr_t)cookies, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 04:02:17 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 077FE1065670; Fri, 19 Dec 2008 04:02:17 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB47D8FC19; Fri, 19 Dec 2008 04:02:16 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ42GlF060998; Fri, 19 Dec 2008 04:02:16 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ42GF4060997; Fri, 19 Dec 2008 04:02:16 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200812190402.mBJ42GF4060997@svn.freebsd.org> From: Ken Smith Date: Fri, 19 Dec 2008 04:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186310 - releng/7.1/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 04:02:17 -0000 Author: kensmith Date: Fri Dec 19 04:02:16 2008 New Revision: 186310 URL: http://svn.freebsd.org/changeset/base/186310 Log: MFC r186165: > Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition > to failing with that error. > > PR: 125149 > Submitted by: Jaakko Heinonen (jh saunalahti fi) > Reviewed by: mohans, kan Approved by: re (kib) Modified: releng/7.1/sys/nfsserver/nfs_serv.c Modified: releng/7.1/sys/nfsserver/nfs_serv.c ============================================================================== --- releng/7.1/sys/nfsserver/nfs_serv.c Fri Dec 19 03:59:20 2008 (r186309) +++ releng/7.1/sys/nfsserver/nfs_serv.c Fri Dec 19 04:02:16 2008 (r186310) @@ -3600,9 +3600,12 @@ again: * Probe one of the directory entries to see if the filesystem * supports VGET. */ - if (VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, &nvp) == - EOPNOTSUPP) { - error = NFSERR_NOTSUPP; + error = VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, &nvp); + if (error) { + if (error == EOPNOTSUPP) + error = NFSERR_NOTSUPP; + else + error = NFSERR_SERVERFAULT; vrele(vp); vp = NULL; free((caddr_t)cookies, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 05:05:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E1C91065674; Fri, 19 Dec 2008 05:05:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD4E8FC16; Fri, 19 Dec 2008 05:05:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ55a7T062259; Fri, 19 Dec 2008 05:05:36 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ55ZSh062251; Fri, 19 Dec 2008 05:05:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812190505.mBJ55ZSh062251@svn.freebsd.org> From: Kip Macy Date: Fri, 19 Dec 2008 05:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186311 - in releng/7.1/sys/dev/cxgb: . common ulp/tom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 05:05:36 -0000 Author: kmacy Date: Fri Dec 19 05:05:35 2008 New Revision: 186311 URL: http://svn.freebsd.org/changeset/base/186311 Log: Log: MFC 183967, 184861, 185157 183967: Track number of packets transmitted and number of packets received PR: 125806 184861: Update firmware version check make ddp a tunable Obtained from: Chelsio Inc. 185157: Several small additions to the Chelsio 10G driver. 1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the device from ever coming back up once it had been set to down. 2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible to give the device more than IFQ_MAXLEN entries in its send queue. The default remains 50. 3) Add code to place the card'd identification and serial number into its description (%desc) so that users can tell which card they have installed. Approved by: re Modified: releng/7.1/sys/dev/cxgb/common/cxgb_common.h releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c releng/7.1/sys/dev/cxgb/cxgb_main.c releng/7.1/sys/dev/cxgb/cxgb_sge.c releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom.c releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Modified: releng/7.1/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- releng/7.1/sys/dev/cxgb/common/cxgb_common.h Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/common/cxgb_common.h Fri Dec 19 05:05:35 2008 (r186311) @@ -41,6 +41,7 @@ enum { MAX_FRAME_SIZE = 10240, /* max MAC frame size, includes header + FCS */ EEPROMSIZE = 8192, /* Serial EEPROM size */ SERNUM_LEN = 16, /* Serial # length */ + ECNUM_LEN = 16, /* EC # length */ RSS_TABLE_SIZE = 64, /* size of RSS lookup and mapping tables */ TCB_SIZE = 128, /* TCB size */ NMTUS = 16, /* size of MTU table */ @@ -342,6 +343,7 @@ struct vpd_params { unsigned int mdc; unsigned int mem_timing; u8 sn[SERNUM_LEN + 1]; + u8 ec[ECNUM_LEN + 1]; u8 eth_base[6]; u8 port_type[MAX_NPORTS]; unsigned short xauicfg[2]; Modified: releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h ============================================================================== --- releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h Fri Dec 19 05:05:35 2008 (r186311) @@ -85,7 +85,7 @@ struct ddp_params { struct adap_ports { unsigned int nports; /* number of ports on this adapter */ - struct net_device *lldevs[2]; + struct net_device *lldevs[MAX_NPORTS]; }; /* Modified: releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Dec 19 05:05:35 2008 (r186311) @@ -560,7 +560,7 @@ struct t3_vpd { u8 vpdr_tag; u8 vpdr_len[2]; VPD_ENTRY(pn, 16); /* part number */ - VPD_ENTRY(ec, 16); /* EC level */ + VPD_ENTRY(ec, ECNUM_LEN); /* EC level */ VPD_ENTRY(sn, SERNUM_LEN); /* serial number */ VPD_ENTRY(na, 12); /* MAC address base */ VPD_ENTRY(cclk, 6); /* core clock */ @@ -705,6 +705,7 @@ static int get_vpd_params(adapter_t *ada p->mdc = simple_strtoul(vpd.mdc_data, NULL, 10); p->mem_timing = simple_strtoul(vpd.mt_data, NULL, 10); memcpy(p->sn, vpd.sn_data, SERNUM_LEN); + memcpy(p->ec, vpd.ec_data, ECNUM_LEN); /* Old eeproms didn't have port information */ if (adapter->params.rev == 0 && !vpd.port0_data[0]) { @@ -749,7 +750,8 @@ enum { SF_ERASE_SECTOR = 0xd8, /* erase sector */ FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */ - FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */ + OLD_FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */ + FW_VERS_ADDR = 0x7fffc, /* flash address holding FW version */ FW_MIN_SIZE = 8, /* at least version and csum */ FW_MAX_SIZE = FW_VERS_ADDR - FW_FLASH_BOOT_ADDR, @@ -1036,7 +1038,12 @@ enum fw_version_type { */ int t3_get_fw_version(adapter_t *adapter, u32 *vers) { - return t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0); + int ret = t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0); + + if (!ret && *vers != 0xffffffff) + return 0; + else + return t3_read_flash(adapter, OLD_FW_VERS_ADDR, 1, vers, 0); } /** Modified: releng/7.1/sys/dev/cxgb/cxgb_main.c ============================================================================== --- releng/7.1/sys/dev/cxgb/cxgb_main.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/cxgb_main.c Fri Dec 19 05:05:35 2008 (r186311) @@ -232,6 +232,15 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); +/* + * Tune the size of the output queue. + */ +int cxgb_snd_queue_len = IFQ_MAXLEN; +TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); +SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, + &cxgb_snd_queue_len, 0, "send queue size "); + + enum { MAX_TXQ_ENTRIES = 16384, MAX_CTRL_TXQ_ENTRIES = 1024, @@ -376,7 +385,8 @@ cxgb_controller_probe(device_t dev) const struct adapter_info *ai; char *ports, buf[80]; int nports; - + struct adapter *sc = device_get_softc(dev); + ai = cxgb_get_adapter_info(dev); if (ai == NULL) return (ENXIO); @@ -387,7 +397,9 @@ cxgb_controller_probe(device_t dev) else ports = "ports"; - snprintf(buf, sizeof(buf), "%s RNIC, %d %s", ai->desc, nports, ports); + snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s", + ai->desc, is_offload(sc) ? "R" : "", + sc->params.rev, nports, ports); device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -433,6 +445,8 @@ cxgb_controller_attach(device_t dev) int msi_needed, reg; #endif int must_load = 0; + char buf[80]; + sc = device_get_softc(dev); sc->dev = dev; sc->msi_count = 0; @@ -647,6 +661,11 @@ cxgb_controller_attach(device_t dev) G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), G_FW_VERSION_MICRO(vers)); + snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s", + ai->desc, + sc->params.vpd.ec, sc->params.vpd.sn); + device_set_desc_copy(dev, buf); + device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); t3_add_attach_sysctls(sc); @@ -957,7 +976,7 @@ cxgb_port_attach(device_t dev) ifp->if_timer = 0; /* Disable ifnet watchdog */ ifp->if_watchdog = NULL; - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); Modified: releng/7.1/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- releng/7.1/sys/dev/cxgb/cxgb_sge.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/cxgb_sge.c Fri Dec 19 05:05:35 2008 (r186311) @@ -1889,7 +1889,11 @@ t3_free_tx_desc(struct sge_txq *q, int r m_freem_iovec(&txsd->mi); buf_ring_scan(&q->txq_mr, txsd->mi.mi_base, __FILE__, __LINE__); txsd->mi.mi_base = NULL; - + /* + * XXX check for cache hit rate here + * + */ + q->port->ifp->if_opackets++; #if defined(DIAGNOSTIC) && 0 if (m_get_priority(txsd->m[0]) != cidx) printf("pri=%d cidx=%d\n", @@ -2511,6 +2515,7 @@ t3_rx_eth(struct adapter *adap, struct s m->m_pkthdr.rcvif = ifp; m->m_pkthdr.header = mtod(m, uint8_t *) + sizeof(*cpl) + ethpad; + ifp->if_ipackets++; #ifndef DISABLE_MBUF_IOVEC m_explode(m); #endif Modified: releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Fri Dec 19 05:05:35 2008 (r186311) @@ -3448,9 +3448,7 @@ process_pass_accept_req(struct socket *s V_TF_DDP_OFF(1) | TP_DDP_TIMER_WORKAROUND_VAL, 1); } else - printf("not offloading\n"); - - + DPRINTF("no DDP\n"); return; reject: Modified: releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom.c ============================================================================== --- releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom.c Fri Dec 19 05:05:35 2008 (r186311) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -90,17 +89,6 @@ __FBSDID("$FreeBSD$"); #include #include - - - - -static int activated = 1; -TUNABLE_INT("hw.t3toe.activated", &activated); -SYSCTL_NODE(_hw, OID_AUTO, t3toe, CTLFLAG_RD, 0, "T3 toe driver parameters"); -SYSCTL_UINT(_hw_t3toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0, - "enable TOE at init time"); - - TAILQ_HEAD(, adapter) adapter_list; static struct rwlock adapter_list_lock; @@ -913,7 +901,7 @@ do_act_establish(struct t3cdev *dev, str } else { log(LOG_ERR, "%s: received clientless CPL command 0x%x\n", - dev->name, CPL_PASS_ACCEPT_REQ); + dev->name, CPL_ACT_ESTABLISH); return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG; } } @@ -1335,8 +1323,6 @@ t3_toe_attach(struct toedev *dev, const t3_init_tunables(t); mtx_init(&t->listen_lock, "tom data listeners", NULL, MTX_DEF); CTR2(KTR_TOM, "t3_toe_attach dev=%p entry=%p", dev, entry); - /* Adjust TOE activation for this module */ - t->conf.activated = activated; dev->tod_can_offload = can_offload; dev->tod_connect = t3_connect; Modified: releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c ============================================================================== --- releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Fri Dec 19 04:02:16 2008 (r186310) +++ releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Fri Dec 19 05:05:35 2008 (r186311) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* Avoid clutter in the hw.* space, keep all toe tunables within hw.cxgb */ +SYSCTL_DECL(_hw_cxgb); +SYSCTL_NODE(_hw_cxgb, OID_AUTO, toe, CTLFLAG_RD, 0, "TOE parameters"); + static struct tom_tunables default_tunable_vals = { .max_host_sndbuf = 32 * 1024, .tx_hold_thres = 0, @@ -100,11 +104,24 @@ static struct tom_tunables default_tunab .activated = 1, }; +static int activated = 1; +TUNABLE_INT("hw.cxgb.toe.activated", &activated); +SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0, + "enable TOE at init time"); + +static int ddp = 1; +TUNABLE_INT("hw.cxgb.toe.ddp", &ddp); +SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, ddp, CTLFLAG_RDTUN, &ddp, 0, "enable DDP"); + void t3_init_tunables(struct tom_data *t) { t->conf = default_tunable_vals; + /* Adjust tunables */ + t->conf.activated = activated; + t->conf.ddp = ddp; + /* Now apply device specific fixups. */ t->conf.mss = T3C_DATA(t->cdev)->tx_max_chunk; t->conf.max_wrs = T3C_DATA(t->cdev)->max_wrs; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 05:58:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25B0F106564A; Fri, 19 Dec 2008 05:58:21 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mx6.bahnhof.se (mx6.bahnhof.se [213.80.101.16]) by mx1.freebsd.org (Postfix) with ESMTP id C72788FC08; Fri, 19 Dec 2008 05:58:20 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mx6.local [127.0.0.1]) by mx6-reinject (Postfix) with ESMTP id 8B381211097; Fri, 19 Dec 2008 06:58:19 +0100 (CET) Received: from mx6.bahnhof.se ([127.0.0.1]) by localhost (mx6.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30499-08; Fri, 19 Dec 2008 06:58:16 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mx6.bahnhof.se (Postfix) with ESMTP id 1F4EA21108B; Fri, 19 Dec 2008 06:58:15 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.176 [270.9.19/1855]); Fri, 19 Dec 2008 06:58:12 +0100 Message-ID: <494B37F4.9060302@gmail.com> Date: Fri, 19 Dec 2008 06:58:12 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Alexander Motin References: <200812182113.mBILDkwt052441@svn.freebsd.org> <494AC475.20808@gmail.com> <494AC77A.5010609@FreeBSD.org> In-Reply-To: <494AC77A.5010609@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MX6) X-Spam-Status: No, score=1.708 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708] X-Spam-Score: 1.708 X-Spam-Level: * Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186296 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 05:58:21 -0000 Alexander Motin wrote: > Niclas Zeising wrote: >> Alexander Motin wrote: >>> Author: mav >>> Date: Thu Dec 18 21:13:46 2008 >>> New Revision: 186296 >>> URL: http://svn.freebsd.org/changeset/base/186296 >>> >>> Log: >>> Before modularization commit, atapci driver was attaching only to >>> devices of >>> storage class. This check was lost. It is not important for the >>> most cases, >>> but as it was reported on current@, it does important for sis >>> driver and >>> surely inportant for AHCI driver. So restore it there. >>> Submitted by: Toshikazu ICHINOSEKI, Andrey V. Elsukov >>> Discussed on: current@ >>> >>> --- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 >>> 2008 (r186295) >>> +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 >>> 2008 (r186296) >>> @@ -105,6 +105,9 @@ ata_sis_probe(device_t dev) >>> char buffer[64]; >>> int found = 0; >>> >>> + if (pci_get_class(dev) != PCIC_STORAGE) >>> + return (ENXIO); >>> + >>> if (pci_get_vendor(dev) != ATA_SIS_ID) >>> return ENXIO; >> >> With this change, am I able to boot from a harddrive located on a >> SiS-controller again? Or is that more likely a different issue? >> I have't investigated my issue properly due to lack of time, so I >> don't know exactly what's wrong, only that it can't find the hard >> drive properly. > > I have no idea what your problem is, I am just a man. :) But if your > problem appeared on 8-CURRENT about two months ago, then it may be it > and so may be solved. > Apparently you're more than a man :). I just wanted you to know that the fix worked, my harddrives located on the SiS controller are detected again, thanks a lot for the catch! Regards! //Niclas From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:33:18 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8293D1065674; Fri, 19 Dec 2008 06:33:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70EB08FC19; Fri, 19 Dec 2008 06:33:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ6XICM063915; Fri, 19 Dec 2008 06:33:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ6XIqq063914; Fri, 19 Dec 2008 06:33:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812190633.mBJ6XIqq063914@svn.freebsd.org> From: Kip Macy Date: Fri, 19 Dec 2008 06:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186312 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 06:33:18 -0000 Author: kmacy Date: Fri Dec 19 06:33:18 2008 New Revision: 186312 URL: http://svn.freebsd.org/changeset/base/186312 Log: MFC 185970 fix support and capabilities Approved by: re Modified: stable/7/share/man/man4/cxgb.4 Modified: stable/7/share/man/man4/cxgb.4 ============================================================================== --- stable/7/share/man/man4/cxgb.4 Fri Dec 19 05:05:35 2008 (r186311) +++ stable/7/share/man/man4/cxgb.4 Fri Dec 19 06:33:18 2008 (r186312) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007, Chelsio Inc +.\" Copyright (c) 2007-2008, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -56,7 +56,8 @@ if_cxgb_load="YES" The .Nm driver supports Transmit/Receive checksum offload, -Jumbo Frames as well as TCP segmentation offload (TSO). +Jumbo Frames, TCP segmentation offload (TSO), Large Receive Offload (LRO), +VLAN hardware insertion / extraction, and VLAN checksum offload. For further hardware information, see .Pa http://www.chelsio.com/ . .Pp @@ -76,7 +77,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports 10 Gigabit Ethernet adapters based on the T3 and T3B chipset: +driver supports 10 Gigabit and 1 Gigabit Ethernet adapters based on the T3 and T3B chipset: .Pp .Bl -bullet -compact .It @@ -111,7 +112,7 @@ go to the Chelsio support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq help@chelsio.com . +.Aq support@chelsio.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:34:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F2FC1065673; Fri, 19 Dec 2008 06:34:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E9858FC12; Fri, 19 Dec 2008 06:34:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ6Yvgt063994; Fri, 19 Dec 2008 06:34:57 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ6Yvxf063993; Fri, 19 Dec 2008 06:34:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812190634.mBJ6Yvxf063993@svn.freebsd.org> From: Kip Macy Date: Fri, 19 Dec 2008 06:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186313 - releng/7.1/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 06:34:58 -0000 Author: kmacy Date: Fri Dec 19 06:34:57 2008 New Revision: 186313 URL: http://svn.freebsd.org/changeset/base/186313 Log: MFC 185970 fix support and capabilities Approved by: re Modified: releng/7.1/share/man/man4/cxgb.4 Modified: releng/7.1/share/man/man4/cxgb.4 ============================================================================== --- releng/7.1/share/man/man4/cxgb.4 Fri Dec 19 06:33:18 2008 (r186312) +++ releng/7.1/share/man/man4/cxgb.4 Fri Dec 19 06:34:57 2008 (r186313) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007, Chelsio Inc +.\" Copyright (c) 2007-2008, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -56,7 +56,8 @@ if_cxgb_load="YES" The .Nm driver supports Transmit/Receive checksum offload, -Jumbo Frames as well as TCP segmentation offload (TSO). +Jumbo Frames, TCP segmentation offload (TSO), Large Receive Offload (LRO), +VLAN hardware insertion / extraction, and VLAN checksum offload. For further hardware information, see .Pa http://www.chelsio.com/ . .Pp @@ -76,7 +77,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports 10 Gigabit Ethernet adapters based on the T3 and T3B chipset: +driver supports 10 Gigabit and 1 Gigabit Ethernet adapters based on the T3 and T3B chipset: .Pp .Bl -bullet -compact .It @@ -111,7 +112,7 @@ go to the Chelsio support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq help@chelsio.com . +.Aq support@chelsio.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:48:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B28F1065673; Fri, 19 Dec 2008 06:48:00 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A1878FC12; Fri, 19 Dec 2008 06:48:00 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ6m0Uq064264; Fri, 19 Dec 2008 06:48:00 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ6lxh0064262; Fri, 19 Dec 2008 06:47:59 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812190647.mBJ6lxh0064262@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 06:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186314 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 06:48:00 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 06:47:59 2008 New Revision: 186314 URL: http://svn.freebsd.org/changeset/base/186314 Log: Initialize the cntp pointer to 0 prior to doing any work so that callers don't try to iterate through garbage or NULL memory. Additionally, return NULL instead of 0 on error. Reviewed by: peter Approved by: peter Modified: head/lib/libutil/kinfo_getfile.c head/lib/libutil/kinfo_getvmmap.c Modified: head/lib/libutil/kinfo_getfile.c ============================================================================== --- head/lib/libutil/kinfo_getfile.c Fri Dec 19 06:34:57 2008 (r186313) +++ head/lib/libutil/kinfo_getfile.c Fri Dec 19 06:47:59 2008 (r186314) @@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_file *kif, *kp, *kf; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp) kif = calloc(cnt, sizeof(*kif)); if (kif == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; Modified: head/lib/libutil/kinfo_getvmmap.c ============================================================================== --- head/lib/libutil/kinfo_getvmmap.c Fri Dec 19 06:34:57 2008 (r186313) +++ head/lib/libutil/kinfo_getvmmap.c Fri Dec 19 06:47:59 2008 (r186314) @@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_vmentry *kiv, *kp, *kv; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) kiv = calloc(cnt, sizeof(*kiv)); if (kiv == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 06:50:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 162381065670; Fri, 19 Dec 2008 06:50:16 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0561E8FC1B; Fri, 19 Dec 2008 06:50:16 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ6oFnt064351; Fri, 19 Dec 2008 06:50:15 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ6oFxl064349; Fri, 19 Dec 2008 06:50:15 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812190650.mBJ6oFxl064349@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 06:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186315 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 06:50:16 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 06:50:15 2008 New Revision: 186315 URL: http://svn.freebsd.org/changeset/base/186315 Log: Do not segfault when procstat -f or procstat -v is called on a process not owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return NULL, simply exit, and do not try and derefernce the memory. Reviewed by: peter Approved by: peter Modified: head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Fri Dec 19 06:47:59 2008 (r186314) +++ head/usr.bin/procstat/procstat_files.c Fri Dec 19 06:50:15 2008 (r186315) @@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_p "PRO", "NAME"); freep = kinfo_getfile(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kif = &freep[i]; Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:47:59 2008 (r186314) +++ head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:50:15 2008 (r186315) @@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc "PRES", "REF", "SHD", "FL", "TP", "PATH"); freep = kinfo_getvmmap(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kve = &freep[i]; printf("%5d ", pid); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 09:32:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F86A1065678; Fri, 19 Dec 2008 09:32:32 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C11C8FC08; Fri, 19 Dec 2008 09:32:32 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJ9WWZA067338; Fri, 19 Dec 2008 09:32:32 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJ9WVhf067337; Fri, 19 Dec 2008 09:32:31 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <200812190932.mBJ9WVhf067337@svn.freebsd.org> From: Kai Wang Date: Fri, 19 Dec 2008 09:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186316 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 09:32:32 -0000 Author: kaiw Date: Fri Dec 19 09:32:31 2008 New Revision: 186316 URL: http://svn.freebsd.org/changeset/base/186316 Log: Update elf_common.h with new EM_ types found in the latest ELF gABI. This commit is slightly different from the original patch in the PR: 1. EM_ALPHA keeps the old value for compatibility reason. 2. Non-standard SHT_NUM is not added. 3. Style. PR: kern/118540 Submitted by: "Pedro F. Giffuni" Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Dec 19 06:50:15 2008 (r186315) +++ head/sys/sys/elf_common.h Fri Dec 19 09:32:31 2008 (r186316) @@ -101,6 +101,7 @@ typedef struct { #define ELFOSABI_OPENBSD 12 /* OpenBSD */ #define ELFOSABI_OPENVMS 13 /* Open VMS */ #define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ +#define ELFOSABI_AROS 15 /* Amiga Research OS */ #define ELFOSABI_ARM 97 /* ARM */ #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ @@ -169,6 +170,61 @@ typedef struct { #define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ #define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ #define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */ +#define EM_PDSP 63 /* Sony DSP Processor. */ +#define EM_FX66 66 /* Siemens FX66 microcontroller. */ +#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 + microcontroller. */ +#define EM_ST7 68 /* STmicroelectronics ST7 8-bit + microcontroller. */ +#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller. */ +#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller. */ +#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller. */ +#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller. */ +#define EM_SVX 73 /* Silicon Graphics SVx. */ +#define EM_ST19 74 /* STMicroelectronics ST19 8-bit mc. */ +#define EM_VAX 75 /* Digital VAX. */ +#define EM_CRIS 76 /* Axis Communications 32-bit embedded + processor. */ +#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded + processor. */ +#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor. */ +#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor. */ +#define EM_MMIX 80 /* Donald Knuth's educational 64-bit proc. */ +#define EM_HUANY 81 /* Harvard University machine-independent + object files. */ +#define EM_PRISM 82 /* SiTera Prism. */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller. */ +#define EM_FR30 84 /* Fujitsu FR30. */ +#define EM_D10V 85 /* Mitsubishi D10V. */ +#define EM_D30V 86 /* Mitsubishi D30V. */ +#define EM_V850 87 /* NEC v850. */ +#define EM_M32R 88 /* Mitsubishi M32R. */ +#define EM_MN10300 89 /* Matsushita MN10300. */ +#define EM_MN10200 90 /* Matsushita MN10200. */ +#define EM_PJ 91 /* picoJava. */ +#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor. */ +#define EM_ARC_A5 93 /* ARC Cores Tangent-A5. */ +#define EM_XTENSA 94 /* Tensilica Xtensa Architecture. */ +#define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor. */ +#define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose + Processor. */ +#define EM_NS32K 97 /* National Semiconductor 32000 series. */ +#define EM_TPC 98 /* Tenor Network TPC processor. */ +#define EM_SNP1K 99 /* Trebia SNP 1000 processor. */ +#define EM_ST200 100 /* STMicroelectronics ST200 microcontroller. */ +#define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family. */ +#define EM_MAX 102 /* MAX Processor. */ +#define EM_CR 103 /* National Semiconductor CompactRISC + microprocessor. */ +#define EM_F2MC16 104 /* Fujitsu F2MC16. */ +#define EM_MSP430 105 /* Texas Instruments embedded microcontroller + msp430. */ +#define EM_BLACKFIN 106 /* Analog Devices Blackfin (DSP) processor. */ +#define EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors. */ +#define EM_SEP 108 /* Sharp embedded microprocessor. */ +#define EM_ARCA 109 /* Arca RISC Microprocessor. */ +#define EM_UNICORE 110 /* Microprocessor series from PKU-Unity Ltd. + and MPRC of Peking University */ /* Non-standard or deprecated. */ #define EM_486 6 /* Intel i486. */ @@ -195,12 +251,12 @@ typedef struct { #define SHT_STRTAB 3 /* string table section */ #define SHT_RELA 4 /* relocation section with addends */ #define SHT_HASH 5 /* symbol hash table section */ -#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_DYNAMIC 6 /* dynamic section */ #define SHT_NOTE 7 /* note section */ #define SHT_NOBITS 8 /* no space section */ #define SHT_REL 9 /* relocation section - no addends */ #define SHT_SHLIB 10 /* reserved - purpose unknown */ -#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ #define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ #define SHT_FINI_ARRAY 15 /* Termination function pointers. */ #define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 11:07:35 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 121771065673; Fri, 19 Dec 2008 11:07:35 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA44F8FC19; Fri, 19 Dec 2008 11:07:34 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJB7YY3070445; Fri, 19 Dec 2008 11:07:34 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJB7YnT070444; Fri, 19 Dec 2008 11:07:34 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200812191107.mBJB7YnT070444@svn.freebsd.org> From: Qing Li Date: Fri, 19 Dec 2008 11:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186317 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 11:07:35 -0000 Author: qingli Date: Fri Dec 19 11:07:34 2008 New Revision: 186317 URL: http://svn.freebsd.org/changeset/base/186317 Log: The proxy-arp code was broken and responds to ARP requests for addresses that are not proxied locally. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Dec 19 09:32:31 2008 (r186316) +++ head/sys/netinet/if_ether.c Fri Dec 19 11:07:34 2008 (r186317) @@ -660,69 +660,64 @@ reply: (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); } else { - if (la == NULL) { - if (!V_arp_proxyall) - goto drop; - - sin.sin_addr = itaddr; - /* XXX MRT use table 0 for arp reply */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - /* - * Don't send proxies for nodes on the same interface - * as this one came out of, or we'll get into a fight - * over who claims what Ether address. - */ - if (rt->rt_ifp == ifp) { - RTFREE_LOCKED(rt); - goto drop; - } - (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); - (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); + struct llentry *lle = NULL; + + if (!V_arp_proxyall) + goto drop; + + sin.sin_addr = itaddr; + /* XXX MRT use table 0 for arp reply */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + + /* + * Don't send proxies for nodes on the same interface + * as this one came out of, or we'll get into a fight + * over who claims what Ether address. + */ + if (!rt->rt_ifp || rt->rt_ifp == ifp) { RTFREE_LOCKED(rt); + goto drop; + } + IF_AFDATA_LOCK(rt->rt_ifp); + lle = lla_lookup(LLTABLE(rt->rt_ifp), 0, (struct sockaddr *)&sin); + IF_AFDATA_UNLOCK(rt->rt_ifp); + RTFREE_LOCKED(rt); - /* - * Also check that the node which sent the ARP packet - * is on the the interface we expect it to be on. This - * avoids ARP chaos if an interface is connected to the - * wrong network. - */ - sin.sin_addr = isaddr; - - /* XXX MRT use table 0 for arp checks */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) - goto drop; - if (rt->rt_ifp != ifp) { - log(LOG_INFO, "arp_proxy: ignoring request" - " from %s via %s, expecting %s\n", - inet_ntoa(isaddr), ifp->if_xname, - rt->rt_ifp->if_xname); - RTFREE_LOCKED(rt); - goto drop; - } + if (lle != NULL) { + (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); + (void)memcpy(ar_sha(ah), &lle->ll_addr, ah->ar_hln); + LLE_RUNLOCK(lle); + } else + goto drop; + + /* + * Also check that the node which sent the ARP packet + * is on the the interface we expect it to be on. This + * avoids ARP chaos if an interface is connected to the + * wrong network. + */ + sin.sin_addr = isaddr; + + /* XXX MRT use table 0 for arp checks */ + rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); + if (!rt) + goto drop; + if (rt->rt_ifp != ifp) { + log(LOG_INFO, "arp_proxy: ignoring request" + " from %s via %s, expecting %s\n", + inet_ntoa(isaddr), ifp->if_xname, + rt->rt_ifp->if_xname); RTFREE_LOCKED(rt); + goto drop; + } + RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY - printf("arp: proxying for %s\n", - inet_ntoa(itaddr)); + printf("arp: proxying for %s\n", + inet_ntoa(itaddr)); #endif - } else { - /* - * Return proxied ARP replies only on the interface - * or bridge cluster where this network resides. - * Otherwise we may conflict with the host we are - * proxying for. - */ - if (la->lle_tbl->llt_ifp != ifp && - (la->lle_tbl->llt_ifp->if_bridge != ifp->if_bridge || - ifp->if_bridge == NULL)) { - goto drop; - } - (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); - (void)memcpy(ar_sha(ah), &la->ll_addr, ah->ar_hln); - } } if (la != NULL) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 11:11:19 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8971106568D; Fri, 19 Dec 2008 11:11:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 744AF8FC20; Fri, 19 Dec 2008 11:11:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-157-49.carlnfd1.nsw.optusnet.com.au (c122-106-157-49.carlnfd1.nsw.optusnet.com.au [122.106.157.49]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id mBJBBFpD018206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Dec 2008 22:11:17 +1100 Date: Fri, 19 Dec 2008 22:11:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ivan Voras In-Reply-To: <200812181525.mBIFPXkN044933@svn.freebsd.org> Message-ID: <20081219211850.X99600@delplex.bde.org> References: <200812181525.mBIFPXkN044933@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186285 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 11:11:20 -0000 On Thu, 18 Dec 2008, Ivan Voras wrote: > Log: > Remove spaces in wait object names to make top (1) output prettier and > unbreak scripts that examine ps (1) output. Thanks, but these are still broken. Both ps and top use %6.6s format, so wait messages must be limited to 6 characters or at least contain only secondary info after the 6th character, with the first 6 characters carefully chosen to be unambigous and to be a good abbreviation when truncated too. I once fixed many sleep messages including all of the ones in the tty driver to satisfy the first (stricter) requirement. > Modified: head/sys/kern/tty.c > ============================================================================== > --- head/sys/kern/tty.c Thu Dec 18 15:12:04 2008 (r186284) > +++ head/sys/kern/tty.c Thu Dec 18 15:25:33 2008 (r186285) > @@ -871,10 +871,10 @@ tty_alloc(struct ttydevsw *tsw, void *sc > > tty_init_termios(tp); > > - cv_init(&tp->t_inwait, "tty input"); > - cv_init(&tp->t_outwait, "tty output"); > - cv_init(&tp->t_bgwait, "tty background"); > - cv_init(&tp->t_dcdwait, "tty dcd"); > + cv_init(&tp->t_inwait, "ttyinput"); When truncated, this has regressed from "ttyin" to "ttyinp". Not too bad. The kernel struct member name still uses the better abbreviation "in" for "input". > + cv_init(&tp->t_outwait, "ttyoutput"); This gets truncated reasonably. > + cv_init(&tp->t_bgwait, "ttybackground"); When truncated, this has regressed from "ttybg[1-4]" to "ttybac". The kernel struct member name still uses the better abbreviation "bg". "bg[1-4]" also encodes more detailed info about the reason for the wait. Most locking interfaces encourage this regression by putting the message in a data structure so that it is hard to make it context-dependent. > + cv_init(&tp->t_dcdwait, "ttydcd"); The commit fixes this. > > ttyinq_init(&tp->t_inq); > ttyoutq_init(&tp->t_outq); > @@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc > tp->t_mtx = mutex; > } else { > tp->t_mtx = &tp->t_mtxobj; > - mtx_init(&tp->t_mtxobj, "tty lock", NULL, MTX_DEF); > + mtx_init(&tp->t_mtxobj, "ttylock", NULL, MTX_DEF); This gets truncated to "ttyloc". "ttylk" or "ttlock" would be better. The abbreviation "mtx" in the kernel struct member name is not so good as elsewhere for printing in userland. > } > > knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); Bruce From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 14:27:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC93106567A; Fri, 19 Dec 2008 14:27:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB0178FC1C; Fri, 19 Dec 2008 14:27:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJERA7Z074115; Fri, 19 Dec 2008 14:27:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJERA1k074114; Fri, 19 Dec 2008 14:27:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200812191427.mBJERA1k074114@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 19 Dec 2008 14:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186318 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 14:27:10 -0000 Author: trasz Date: Fri Dec 19 14:27:10 2008 New Revision: 186318 URL: http://svn.freebsd.org/changeset/base/186318 Log: Move mtx_assert lower, when we can be sure that the pointer to the mutex is valid. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Dec 19 11:07:34 2008 (r186317) +++ head/sys/cam/cam_periph.c Fri Dec 19 14:27:10 2008 (r186318) @@ -311,8 +311,6 @@ cam_periph_hold(struct cam_periph *perip struct mtx *mtx; int error; - mtx_assert(periph->sim->mtx, MA_OWNED); - /* * Increment the reference count on the peripheral * while we wait for our lock attempt to succeed @@ -324,6 +322,7 @@ cam_periph_hold(struct cam_periph *perip return (ENXIO); mtx = periph->sim->mtx; + mtx_assert(mtx, MA_OWNED); if (mtx == &Giant) mtx = NULL; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 14:31:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280881065670; Fri, 19 Dec 2008 14:31:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17F4E8FC22; Fri, 19 Dec 2008 14:31:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJEVexb074243; Fri, 19 Dec 2008 14:31:40 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJEVeJ6074239; Fri, 19 Dec 2008 14:31:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200812191431.mBJEVeJ6074239@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 19 Dec 2008 14:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186319 - in head/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 14:31:41 -0000 Author: trasz Date: Fri Dec 19 14:31:40 2008 New Revision: 186319 URL: http://svn.freebsd.org/changeset/base/186319 Log: Periph driver fixes, second try. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Dec 19 14:27:10 2008 (r186318) +++ head/sys/cam/cam_periph.c Fri Dec 19 14:31:40 2008 (r186319) @@ -290,7 +290,7 @@ cam_periph_acquire(struct cam_periph *pe } void -cam_periph_release(struct cam_periph *periph) +cam_periph_release_locked(struct cam_periph *periph) { if (periph == NULL) @@ -302,7 +302,21 @@ cam_periph_release(struct cam_periph *pe camperiphfree(periph); } xpt_unlock_buses(); +} + +void +cam_periph_release(struct cam_periph *periph) +{ + struct cam_sim *sim; + if (periph == NULL) + return; + + sim = periph->sim; + mtx_assert(sim->mtx, MA_NOTOWNED); + mtx_lock(sim->mtx); + cam_periph_release_locked(periph); + mtx_unlock(sim->mtx); } int @@ -329,7 +343,7 @@ cam_periph_hold(struct cam_periph *perip while ((periph->flags & CAM_PERIPH_LOCKED) != 0) { periph->flags |= CAM_PERIPH_LOCK_WANTED; if ((error = msleep(periph, mtx, priority, "caplck", 0)) != 0) { - cam_periph_release(periph); + cam_periph_release_locked(periph); return (error); } } @@ -350,7 +364,7 @@ cam_periph_unhold(struct cam_periph *per wakeup(periph); } - cam_periph_release(periph); + cam_periph_release_locked(periph); } /* Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Fri Dec 19 14:27:10 2008 (r186318) +++ head/sys/cam/cam_periph.h Fri Dec 19 14:31:40 2008 (r186319) @@ -141,6 +141,7 @@ cam_status cam_periph_alloc(periph_ctor_ struct cam_periph *cam_periph_find(struct cam_path *path, char *name); cam_status cam_periph_acquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); +void cam_periph_release_locked(struct cam_periph *periph); int cam_periph_hold(struct cam_periph *periph, int priority); void cam_periph_unhold(struct cam_periph *periph); void cam_periph_invalidate(struct cam_periph *periph); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Dec 19 14:27:10 2008 (r186318) +++ head/sys/cam/cam_xpt.c Fri Dec 19 14:31:40 2008 (r186319) @@ -6314,7 +6314,7 @@ probedone(struct cam_periph *periph, uni xpt_done(done_ccb); if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { cam_periph_invalidate(periph); - cam_periph_release(periph); + cam_periph_release_locked(periph); } else { probeschedule(periph); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Dec 19 14:27:10 2008 (r186318) +++ head/sys/cam/scsi/scsi_da.c Fri Dec 19 14:31:40 2008 (r186319) @@ -772,8 +772,8 @@ daclose(struct disk *dp) softc->flags &= ~DA_FLAG_OPEN; cam_periph_unhold(periph); - cam_periph_release(periph); cam_periph_unlock(periph); + cam_periph_release(periph); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 14:33:30 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B187106564A; Fri, 19 Dec 2008 14:33:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BC588FC12; Fri, 19 Dec 2008 14:33:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJEXTZi074329; Fri, 19 Dec 2008 14:33:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJEXTbF074328; Fri, 19 Dec 2008 14:33:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200812191433.mBJEXTbF074328@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 19 Dec 2008 14:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186320 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 14:33:30 -0000 Author: trasz Date: Fri Dec 19 14:33:29 2008 New Revision: 186320 URL: http://svn.freebsd.org/changeset/base/186320 Log: Fix cam_sim_free() wakeup condition and add mtx_asserts. Submitted by: Christoph Mallon Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/cam/cam_sim.c Modified: head/sys/cam/cam_sim.c ============================================================================== --- head/sys/cam/cam_sim.c Fri Dec 19 14:31:40 2008 (r186319) +++ head/sys/cam/cam_sim.c Fri Dec 19 14:33:29 2008 (r186320) @@ -123,9 +123,10 @@ void cam_sim_release(struct cam_sim *sim) { KASSERT(sim->refcount >= 1, ("sim->refcount >= 1")); + mtx_assert(sim->mtx, MA_OWNED); sim->refcount--; - if (sim->refcount <= 1) + if (sim->refcount == 0) wakeup(sim); } @@ -133,6 +134,7 @@ void cam_sim_hold(struct cam_sim *sim) { KASSERT(sim->refcount >= 1, ("sim->refcount >= 1")); + mtx_assert(sim->mtx, MA_OWNED); sim->refcount++; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 14:47:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B3BD106564A; Fri, 19 Dec 2008 14:47:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2A78FC0C; Fri, 19 Dec 2008 14:47:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJElcc9074632; Fri, 19 Dec 2008 14:47:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJElcEI074631; Fri, 19 Dec 2008 14:47:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191447.mBJElcEI074631@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 14:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186321 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 14:47:39 -0000 Author: kib Date: Fri Dec 19 14:47:38 2008 New Revision: 186321 URL: http://svn.freebsd.org/changeset/base/186321 Log: MFC r185764: Do drop vm map lock earlier in the sysctl_kern_proc_vmmap(), to avoid locking a vnode while having vm map locked. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_proc.c Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Fri Dec 19 14:33:29 2008 (r186320) +++ stable/7/sys/kern/kern_proc.c Fri Dec 19 14:47:38 2008 (r186321) @@ -1413,13 +1413,32 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A lobj = tobj; } + kve->kve_start = (void*)entry->start; + kve->kve_end = (void*)entry->end; + kve->kve_offset = (off_t)entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1470,28 +1489,10 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_shadow_count = 0; } - kve->kve_start = (void*)entry->start; - kve->kve_end = (void*)entry->end; - kve->kve_offset = (off_t)entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); error = SYSCTL_OUT(req, kve, sizeof(*kve)); vm_map_lock_read(map); if (error) @@ -1578,13 +1579,32 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR lobj = tobj; } + kve->kve_start = entry->start; + kve->kve_end = entry->end; + kve->kve_offset = entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1635,28 +1655,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_shadow_count = 0; } - kve->kve_start = entry->start; - kve->kve_end = entry->end; - kve->kve_offset = entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); /* Pack record size down */ kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) + strlen(kve->kve_path) + 1; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 14:49:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F0D01065678; Fri, 19 Dec 2008 14:49:15 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FACA8FC19; Fri, 19 Dec 2008 14:49:15 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJEnFbp074700; Fri, 19 Dec 2008 14:49:15 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJEnFOb074699; Fri, 19 Dec 2008 14:49:15 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200812191449.mBJEnFOb074699@svn.freebsd.org> From: Ivan Voras Date: Fri, 19 Dec 2008 14:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186322 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 14:49:15 -0000 Author: ivoras Date: Fri Dec 19 14:49:14 2008 New Revision: 186322 URL: http://svn.freebsd.org/changeset/base/186322 Log: Further beautify the lock strings to be more pleasing to the eye and self documenting within 6 characters. Reviewed by: ed (older version) Approved by: gnn (older version) Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Dec 19 14:47:38 2008 (r186321) +++ head/sys/kern/tty.c Fri Dec 19 14:49:14 2008 (r186322) @@ -871,9 +871,9 @@ tty_alloc(struct ttydevsw *tsw, void *sc tty_init_termios(tp); - cv_init(&tp->t_inwait, "ttyinput"); - cv_init(&tp->t_outwait, "ttyoutput"); - cv_init(&tp->t_bgwait, "ttybackground"); + cv_init(&tp->t_inwait, "ttyinp"); + cv_init(&tp->t_outwait, "ttyout"); + cv_init(&tp->t_bgwait, "ttybgw"); cv_init(&tp->t_dcdwait, "ttydcd"); ttyinq_init(&tp->t_inq); @@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc tp->t_mtx = mutex; } else { tp->t_mtx = &tp->t_mtxobj; - mtx_init(&tp->t_mtxobj, "ttylock", NULL, MTX_DEF); + mtx_init(&tp->t_mtxobj, "ttylck", NULL, MTX_DEF); } knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 15:04:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A9C71065679; Fri, 19 Dec 2008 15:04:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 593F98FC13; Fri, 19 Dec 2008 15:04:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJF4R0N075064; Fri, 19 Dec 2008 15:04:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJF4Rje075062; Fri, 19 Dec 2008 15:04:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191504.mBJF4Rje075062@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 15:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186323 - in stable/7/sys: . compat/linprocfs contrib/pf dev/cxgb fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 15:04:27 -0000 Author: kib Date: Fri Dec 19 15:04:26 2008 New Revision: 186323 URL: http://svn.freebsd.org/changeset/base/186323 Log: MFC r185765, r185766: Make two style changes to create new commit and document proper commit message for r185765. Commit message for r185765 should be: In procfs map handler, and in linprocfs maps handler, do not call vn_fullpath() while having vm map locked. This is done in anticipation of the vop_vptocnp commit, that would make vn_fullpath sometime acquire vnode lock. Also, in linprocfs, maps handler already acquires vnode lock. MFC r185864: Relock user map earlier, to have the lock held when break leaves the loop earlier due to sbuf error. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/procfs/procfs_map.c Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Fri Dec 19 14:49:14 2008 (r186322) +++ stable/7/sys/compat/linprocfs/linprocfs.c Fri Dec 19 15:04:26 2008 (r186323) @@ -269,8 +269,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) /* XXX per-cpu vendor / class / model / id? */ } - sbuf_cat(sb, - "flags\t\t:"); + sbuf_cat(sb, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { flags[16] = "fcmov"; @@ -870,10 +869,12 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; - vm_offset_t saved_end; + vm_offset_t e_start, e_end; vm_ooffset_t off = 0; + vm_prot_t e_prot; + unsigned int last_timestamp; char *name = "", *freename = NULL; ino_t ino; int ref_count, shadow_count, flags; @@ -899,7 +900,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - saved_end = entry->end; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { VM_OBJECT_LOCK(tobj); @@ -907,6 +910,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); @@ -944,10 +949,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", - (u_long)entry->start, (u_long)entry->end, - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (u_long)e_start, (u_long)e_end, + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", "p", (u_long)off, 0, @@ -958,10 +963,20 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ); if (freename) free(freename, M_TEMP); + vm_map_lock_read(map); if (error == -1) { error = 0; break; } + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Fri Dec 19 14:49:14 2008 (r186322) +++ stable/7/sys/fs/procfs/procfs_map.c Fri Dec 19 15:04:26 2008 (r186323) @@ -82,11 +82,12 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - int error, vfslocked; vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; + int error, vfslocked; + unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; #endif @@ -113,13 +114,19 @@ procfs_doprocmap(PFS_FILL_ARGS) entry = entry->next) { vm_object_t obj, tobj, lobj; int ref_count, shadow_count, flags; - vm_offset_t addr; + vm_offset_t e_start, e_end, addr; int resident, privateresident; char *type; + vm_eflags_t e_eflags; + vm_prot_t e_prot; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; + e_eflags = entry->eflags; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; privateresident = 0; obj = entry->object.vm_object; if (obj != NULL) { @@ -143,11 +150,13 @@ procfs_doprocmap(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); freepath = NULL; fullpath = "-"; if (lobj) { - switch(lobj->type) { + switch (lobj->type) { default: case OBJT_DEFAULT: type = "default"; @@ -194,28 +203,37 @@ procfs_doprocmap(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", - (u_long)entry->start, (u_long)entry->end, + (u_long)e_start, (u_long)e_end, resident, privateresident, #ifdef COMPAT_IA32 wrap32 ? NULL : obj, /* Hide 64 bit value */ #else obj, #endif - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", ref_count, shadow_count, flags, - (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", - (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", + (e_eflags & MAP_ENTRY_COW)?"COW":"NCOW", + (e_eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", type, fullpath); if (freepath != NULL) free(freepath, M_TEMP); - + vm_map_lock_read(map); if (error == -1) { error = 0; break; } + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 15:24:18 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC531065677; Fri, 19 Dec 2008 15:24:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0A48FC1E; Fri, 19 Dec 2008 15:24:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJFOIxP075548; Fri, 19 Dec 2008 15:24:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJFOIMj075547; Fri, 19 Dec 2008 15:24:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191524.mBJFOIMj075547@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 15:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186324 - in stable/7/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 15:24:19 -0000 Author: kib Date: Fri Dec 19 15:24:18 2008 New Revision: 186324 URL: http://svn.freebsd.org/changeset/base/186324 Log: MFC r185983: The userland_sysctl() function retries sysctl_root() until returned error is not EAGAIN. Several sysctls that inspect another process use p_candebug() for checking access right for the curproc. p_candebug() returns EAGAIN for some reasons, in particular, for the process doing exec() now. If execing process tries to lock Giant, we get a livelock, because sysctl handlers are covered by Giant, and often do not sleep. Break the livelock by dropping Giant and allowing other threads to execute in the EAGAIN loop. This commit does not merge the following change, as was discussed with jhb: [Also, do not return EAGAIN from p_candebug() when process is executing, use more appropriate EBUSY error.] MFC r185987: Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this around the call. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_sysctl.c Modified: stable/7/sys/kern/kern_sysctl.c ============================================================================== --- stable/7/sys/kern/kern_sysctl.c Fri Dec 19 15:04:26 2008 (r186323) +++ stable/7/sys/kern/kern_sysctl.c Fri Dec 19 15:24:18 2008 (r186324) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1395,11 +1396,14 @@ userland_sysctl(struct thread *td, int * SYSCTL_LOCK(); - do { + for (;;) { req.oldidx = 0; req.newidx = 0; error = sysctl_root(0, name, namelen, &req); - } while (error == EAGAIN); + if (error != EAGAIN) + break; + uio_yield(); + } if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 15:32:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E82B41065670; Fri, 19 Dec 2008 15:32:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D73A68FC17; Fri, 19 Dec 2008 15:32:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJFWmjT075738; Fri, 19 Dec 2008 15:32:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJFWmFr075735; Fri, 19 Dec 2008 15:32:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191532.mBJFWmFr075735@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 15:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186325 - in stable/7/sys: . compat/linprocfs contrib/pf dev/cxgb fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 15:32:49 -0000 Author: kib Date: Fri Dec 19 15:32:48 2008 New Revision: 186325 URL: http://svn.freebsd.org/changeset/base/186325 Log: MFC r185984: Reference the vmspace of the process being inspected by procfs, linprocfs and sysctl kern_proc_vmmap handlers. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/procfs/procfs_map.c stable/7/sys/kern/kern_proc.c Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Fri Dec 19 15:24:18 2008 (r186324) +++ stable/7/sys/compat/linprocfs/linprocfs.c Fri Dec 19 15:32:48 2008 (r186325) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -868,7 +869,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; @@ -893,6 +895,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) return (EOPNOTSUPP); error = 0; + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -979,6 +985,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Fri Dec 19 15:24:18 2008 (r186324) +++ stable/7/sys/fs/procfs/procfs_map.c Fri Dec 19 15:32:48 2008 (r186325) @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,8 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; @@ -109,6 +111,10 @@ procfs_doprocmap(PFS_FILL_ARGS) } #endif + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -236,5 +242,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Fri Dec 19 15:24:18 2008 (r186324) +++ stable/7/sys/kern/kern_proc.c Fri Dec 19 15:32:48 2008 (r186325) @@ -1358,6 +1358,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A struct vnode *vp; struct proc *p; vm_map_t map; + struct vmspace *vm; name = (int *)arg1; if ((p = pfind((pid_t)name[0])) == NULL) @@ -1372,7 +1373,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ @@ -1503,6 +1508,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); @@ -1524,6 +1530,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR int error, *name; struct vnode *vp; struct proc *p; + struct vmspace *vm; vm_map_t map; name = (int *)arg1; @@ -1539,10 +1546,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; /* XXXRW: More locking required? */ vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -1674,6 +1685,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 15:47:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 786D41065674; Fri, 19 Dec 2008 15:47:50 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 17B238FC1D; Fri, 19 Dec 2008 15:47:49 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id A41A81CC28; Fri, 19 Dec 2008 16:47:48 +0100 (CET) Date: Fri, 19 Dec 2008 16:47:48 +0100 From: Ed Schouten To: Ivan Voras Message-ID: <20081219154748.GC1176@hoeg.nl> References: <200812191449.mBJEnFOb074699@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qN286NIOm1dtEdh0" Content-Disposition: inline In-Reply-To: <200812191449.mBJEnFOb074699@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186322 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 15:47:50 -0000 --qN286NIOm1dtEdh0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ivan, * Ivan Voras wrote: > Reviewed by: ed (older version) As you mentioned, I didn't review this version. Like I said, I don't have strong opinions on the subject, but: > Modified: head/sys/kern/tty.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/tty.c Fri Dec 19 14:47:38 2008 (r186321) > +++ head/sys/kern/tty.c Fri Dec 19 14:49:14 2008 (r186322) > @@ -871,9 +871,9 @@ tty_alloc(struct ttydevsw *tsw, void *sc > =20 > tty_init_termios(tp); > =20 > - cv_init(&tp->t_inwait, "ttyinput"); > - cv_init(&tp->t_outwait, "ttyoutput"); > - cv_init(&tp->t_bgwait, "ttybackground"); > + cv_init(&tp->t_inwait, "ttyinp"); > + cv_init(&tp->t_outwait, "ttyout"); > + cv_init(&tp->t_bgwait, "ttybgw"); > cv_init(&tp->t_dcdwait, "ttydcd"); If we're renaming them to <=3D6-character strings, maybe it's better to use "ttyin" and "ttybg"? The old TTY code used these strings as well. I've also got a small preference of "ttymtx" over "ttylck". "ttymtx" makes it more clear it is blocked on the mutex, while "lck" could be literally any form of locking (file locking?). --=20 Ed Schouten WWW: http://80386.nl/ --qN286NIOm1dtEdh0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklLwiQACgkQ52SDGA2eCwVwJQCeMLrpFA7R1l4BUP50ALjcE8na jpcAn2jX4g3gnWpiZQ9n4AGHyWl6cgPh =6IDB -----END PGP SIGNATURE----- --qN286NIOm1dtEdh0-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 15:58:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4F31065673; Fri, 19 Dec 2008 15:58:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451A78FC14; Fri, 19 Dec 2008 15:58:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJFw53t076263; Fri, 19 Dec 2008 15:58:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJFw5c4076262; Fri, 19 Dec 2008 15:58:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191558.mBJFw5c4076262@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 15:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186326 - in releng/7.1/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 15:58:05 -0000 Author: kib Date: Fri Dec 19 15:58:04 2008 New Revision: 186326 URL: http://svn.freebsd.org/changeset/base/186326 Log: MFC r185764: Do drop vm map lock earlier in the sysctl_kern_proc_vmmap(), to avoid locking a vnode while having vm map locked. Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/kern/kern_proc.c Modified: releng/7.1/sys/kern/kern_proc.c ============================================================================== --- releng/7.1/sys/kern/kern_proc.c Fri Dec 19 15:32:48 2008 (r186325) +++ releng/7.1/sys/kern/kern_proc.c Fri Dec 19 15:58:04 2008 (r186326) @@ -1413,13 +1413,32 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A lobj = tobj; } + kve->kve_start = (void*)entry->start; + kve->kve_end = (void*)entry->end; + kve->kve_offset = (off_t)entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1470,28 +1489,10 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_shadow_count = 0; } - kve->kve_start = (void*)entry->start; - kve->kve_end = (void*)entry->end; - kve->kve_offset = (off_t)entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); error = SYSCTL_OUT(req, kve, sizeof(*kve)); vm_map_lock_read(map); if (error) @@ -1578,13 +1579,32 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR lobj = tobj; } + kve->kve_start = entry->start; + kve->kve_end = entry->end; + kve->kve_offset = entry->offset; + + if (entry->protection & VM_PROT_READ) + kve->kve_protection |= KVME_PROT_READ; + if (entry->protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_PROT_WRITE; + if (entry->protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_PROT_EXEC; + + if (entry->eflags & MAP_ENTRY_COW) + kve->kve_flags |= KVME_FLAG_COW; + if (entry->eflags & MAP_ENTRY_NEEDS_COPY) + kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + + last_timestamp = map->timestamp; + vm_map_unlock_read(map); + kve->kve_fileid = 0; kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { vp = NULL; - switch(lobj->type) { + switch (lobj->type) { case OBJT_DEFAULT: kve->kve_type = KVME_TYPE_DEFAULT; break; @@ -1635,28 +1655,10 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_shadow_count = 0; } - kve->kve_start = entry->start; - kve->kve_end = entry->end; - kve->kve_offset = entry->offset; - - if (entry->protection & VM_PROT_READ) - kve->kve_protection |= KVME_PROT_READ; - if (entry->protection & VM_PROT_WRITE) - kve->kve_protection |= KVME_PROT_WRITE; - if (entry->protection & VM_PROT_EXECUTE) - kve->kve_protection |= KVME_PROT_EXEC; - - if (entry->eflags & MAP_ENTRY_COW) - kve->kve_flags |= KVME_FLAG_COW; - if (entry->eflags & MAP_ENTRY_NEEDS_COPY) - kve->kve_flags |= KVME_FLAG_NEEDS_COPY; - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); if (freepath != NULL) free(freepath, M_TEMP); - last_timestamp = map->timestamp; - vm_map_unlock_read(map); /* Pack record size down */ kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) + strlen(kve->kve_path) + 1; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 16:03:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2F11065673; Fri, 19 Dec 2008 16:03:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69C838FC1C; Fri, 19 Dec 2008 16:03:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJG3KrM076448; Fri, 19 Dec 2008 16:03:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJG3KKd076446; Fri, 19 Dec 2008 16:03:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191603.mBJG3KKd076446@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 16:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186327 - in releng/7.1/sys: . compat/linprocfs contrib/pf dev/cxgb fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 16:03:20 -0000 Author: kib Date: Fri Dec 19 16:03:20 2008 New Revision: 186327 URL: http://svn.freebsd.org/changeset/base/186327 Log: MFC r185765, r185766: Make two style changes to create new commit and document proper commit message for r185765. Commit message for r185765 should be: In procfs map handler, and in linprocfs maps handler, do not call vn_fullpath() while having vm map locked. This is done in anticipation of the vop_vptocnp commit, that would make vn_fullpath sometime acquire vnode lock. Also, in linprocfs, maps handler already acquires vnode lock. MFC r185864: Relock user map earlier, to have the lock held when break leaves the loop earlier due to sbuf error. Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/compat/linprocfs/linprocfs.c releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/fs/procfs/procfs_map.c Modified: releng/7.1/sys/compat/linprocfs/linprocfs.c ============================================================================== --- releng/7.1/sys/compat/linprocfs/linprocfs.c Fri Dec 19 15:58:04 2008 (r186326) +++ releng/7.1/sys/compat/linprocfs/linprocfs.c Fri Dec 19 16:03:20 2008 (r186327) @@ -269,8 +269,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) /* XXX per-cpu vendor / class / model / id? */ } - sbuf_cat(sb, - "flags\t\t:"); + sbuf_cat(sb, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { flags[16] = "fcmov"; @@ -870,10 +869,12 @@ static int linprocfs_doprocmaps(PFS_FILL_ARGS) { vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; - vm_offset_t saved_end; + vm_offset_t e_start, e_end; vm_ooffset_t off = 0; + vm_prot_t e_prot; + unsigned int last_timestamp; char *name = "", *freename = NULL; ino_t ino; int ref_count, shadow_count, flags; @@ -899,7 +900,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) freename = NULL; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; - saved_end = entry->end; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; obj = entry->object.vm_object; for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) { VM_OBJECT_LOCK(tobj); @@ -907,6 +910,8 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); ino = 0; if (lobj) { off = IDX_TO_OFF(lobj->size); @@ -944,10 +949,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", - (u_long)entry->start, (u_long)entry->end, - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (u_long)e_start, (u_long)e_end, + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", "p", (u_long)off, 0, @@ -958,10 +963,20 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ); if (freename) free(freename, M_TEMP); + vm_map_lock_read(map); if (error == -1) { error = 0; break; } + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); Modified: releng/7.1/sys/fs/procfs/procfs_map.c ============================================================================== --- releng/7.1/sys/fs/procfs/procfs_map.c Fri Dec 19 15:58:04 2008 (r186326) +++ releng/7.1/sys/fs/procfs/procfs_map.c Fri Dec 19 16:03:20 2008 (r186327) @@ -82,11 +82,12 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - int error, vfslocked; vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry; + vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; + int error, vfslocked; + unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; #endif @@ -113,13 +114,19 @@ procfs_doprocmap(PFS_FILL_ARGS) entry = entry->next) { vm_object_t obj, tobj, lobj; int ref_count, shadow_count, flags; - vm_offset_t addr; + vm_offset_t e_start, e_end, addr; int resident, privateresident; char *type; + vm_eflags_t e_eflags; + vm_prot_t e_prot; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; + e_eflags = entry->eflags; + e_prot = entry->protection; + e_start = entry->start; + e_end = entry->end; privateresident = 0; obj = entry->object.vm_object; if (obj != NULL) { @@ -143,11 +150,13 @@ procfs_doprocmap(PFS_FILL_ARGS) VM_OBJECT_UNLOCK(lobj); lobj = tobj; } + last_timestamp = map->timestamp; + vm_map_unlock_read(map); freepath = NULL; fullpath = "-"; if (lobj) { - switch(lobj->type) { + switch (lobj->type) { default: case OBJT_DEFAULT: type = "default"; @@ -194,28 +203,37 @@ procfs_doprocmap(PFS_FILL_ARGS) */ error = sbuf_printf(sb, "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", - (u_long)entry->start, (u_long)entry->end, + (u_long)e_start, (u_long)e_end, resident, privateresident, #ifdef COMPAT_IA32 wrap32 ? NULL : obj, /* Hide 64 bit value */ #else obj, #endif - (entry->protection & VM_PROT_READ)?"r":"-", - (entry->protection & VM_PROT_WRITE)?"w":"-", - (entry->protection & VM_PROT_EXECUTE)?"x":"-", + (e_prot & VM_PROT_READ)?"r":"-", + (e_prot & VM_PROT_WRITE)?"w":"-", + (e_prot & VM_PROT_EXECUTE)?"x":"-", ref_count, shadow_count, flags, - (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", - (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", + (e_eflags & MAP_ENTRY_COW)?"COW":"NCOW", + (e_eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", type, fullpath); if (freepath != NULL) free(freepath, M_TEMP); - + vm_map_lock_read(map); if (error == -1) { error = 0; break; } + if (last_timestamp + 1 != map->timestamp) { + /* + * Look again for the entry because the map was + * modified while it was unlocked. Specifically, + * the entry may have been clipped, merged, or deleted. + */ + vm_map_lookup_entry(map, e_end - 1, &tmp_entry); + entry = tmp_entry; + } } vm_map_unlock_read(map); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 16:08:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A1A1065673; Fri, 19 Dec 2008 16:08:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28E968FC1B; Fri, 19 Dec 2008 16:08:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJG8f6A076592; Fri, 19 Dec 2008 16:08:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJG8f4l076591; Fri, 19 Dec 2008 16:08:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191608.mBJG8f4l076591@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 16:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186328 - in releng/7.1/sys: . contrib/pf dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 16:08:41 -0000 Author: kib Date: Fri Dec 19 16:08:40 2008 New Revision: 186328 URL: http://svn.freebsd.org/changeset/base/186328 Log: MFC r185983: The userland_sysctl() function retries sysctl_root() until returned error is not EAGAIN. Several sysctls that inspect another process use p_candebug() for checking access right for the curproc. p_candebug() returns EAGAIN for some reasons, in particular, for the process doing exec() now. If execing process tries to lock Giant, we get a livelock, because sysctl handlers are covered by Giant, and often do not sleep. Break the livelock by dropping Giant and allowing other threads to execute in the EAGAIN loop. This commit does not merge the following change, as was discussed with jhb: [Also, do not return EAGAIN from p_candebug() when process is executing, use more appropriate EBUSY error.] MFC r185987: Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this around the call. Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/kern/kern_sysctl.c Modified: releng/7.1/sys/kern/kern_sysctl.c ============================================================================== --- releng/7.1/sys/kern/kern_sysctl.c Fri Dec 19 16:03:20 2008 (r186327) +++ releng/7.1/sys/kern/kern_sysctl.c Fri Dec 19 16:08:40 2008 (r186328) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1395,11 +1396,14 @@ userland_sysctl(struct thread *td, int * SYSCTL_LOCK(); - do { + for (;;) { req.oldidx = 0; req.newidx = 0; error = sysctl_root(0, name, namelen, &req); - } while (error == EAGAIN); + if (error != EAGAIN) + break; + uio_yield(); + } if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 16:11:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DEB21065673; Fri, 19 Dec 2008 16:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1CBC8FC08; Fri, 19 Dec 2008 16:11:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJGB4gO076707; Fri, 19 Dec 2008 16:11:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJGB46l076704; Fri, 19 Dec 2008 16:11:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200812191611.mBJGB46l076704@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Dec 2008 16:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186329 - in releng/7.1/sys: . compat/linprocfs contrib/pf dev/cxgb fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 16:11:05 -0000 Author: kib Date: Fri Dec 19 16:11:04 2008 New Revision: 186329 URL: http://svn.freebsd.org/changeset/base/186329 Log: MFC r185984: Reference the vmspace of the process being inspected by procfs, linprocfs and sysctl kern_proc_vmmap handlers. Approved by: re (kensmith) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/compat/linprocfs/linprocfs.c releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/fs/procfs/procfs_map.c releng/7.1/sys/kern/kern_proc.c Modified: releng/7.1/sys/compat/linprocfs/linprocfs.c ============================================================================== --- releng/7.1/sys/compat/linprocfs/linprocfs.c Fri Dec 19 16:08:40 2008 (r186328) +++ releng/7.1/sys/compat/linprocfs/linprocfs.c Fri Dec 19 16:11:04 2008 (r186329) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -868,7 +869,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; vm_object_t obj, tobj, lobj; vm_offset_t e_start, e_end; @@ -893,6 +895,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) return (EOPNOTSUPP); error = 0; + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -979,6 +985,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: releng/7.1/sys/fs/procfs/procfs_map.c ============================================================================== --- releng/7.1/sys/fs/procfs/procfs_map.c Fri Dec 19 16:08:40 2008 (r186328) +++ releng/7.1/sys/fs/procfs/procfs_map.c Fri Dec 19 16:11:04 2008 (r186329) @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,8 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - vm_map_t map = &p->p_vmspace->vm_map; + struct vmspace *vm; + vm_map_t map; vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; @@ -109,6 +111,10 @@ procfs_doprocmap(PFS_FILL_ARGS) } #endif + vm = vmspace_acquire_ref(p); + if (vm == NULL) + return (ESRCH); + map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -236,5 +242,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } } vm_map_unlock_read(map); + vmspace_free(vm); return (error); } Modified: releng/7.1/sys/kern/kern_proc.c ============================================================================== --- releng/7.1/sys/kern/kern_proc.c Fri Dec 19 16:08:40 2008 (r186328) +++ releng/7.1/sys/kern/kern_proc.c Fri Dec 19 16:11:04 2008 (r186329) @@ -1358,6 +1358,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A struct vnode *vp; struct proc *p; vm_map_t map; + struct vmspace *vm; name = (int *)arg1; if ((p = pfind((pid_t)name[0])) == NULL) @@ -1372,7 +1373,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ @@ -1503,6 +1508,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); @@ -1524,6 +1530,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR int error, *name; struct vnode *vp; struct proc *p; + struct vmspace *vm; vm_map_t map; name = (int *)arg1; @@ -1539,10 +1546,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } _PHOLD(p); PROC_UNLOCK(p); - + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + PRELE(p); + return (ESRCH); + } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); - map = &p->p_vmspace->vm_map; /* XXXRW: More locking required? */ + map = &vm->vm_map; /* XXXRW: More locking required? */ vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; entry = entry->next) { @@ -1674,6 +1685,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } } vm_map_unlock_read(map); + vmspace_free(vm); PRELE(p); free(kve, M_TEMP); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 16:56:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92456106564A; Fri, 19 Dec 2008 16:56:49 +0000 (UTC) (envelope-from wxs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8370C8FC19; Fri, 19 Dec 2008 16:56:49 +0000 (UTC) (envelope-from wxs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJGunJM077635; Fri, 19 Dec 2008 16:56:49 GMT (envelope-from wxs@svn.freebsd.org) Received: (from wxs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJGunAT077634; Fri, 19 Dec 2008 16:56:49 GMT (envelope-from wxs@svn.freebsd.org) Message-Id: <200812191656.mBJGunAT077634@svn.freebsd.org> From: Wesley Shields Date: Fri, 19 Dec 2008 16:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186330 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 16:56:49 -0000 Author: wxs (ports committer) Date: Fri Dec 19 16:56:49 2008 New Revision: 186330 URL: http://svn.freebsd.org/changeset/base/186330 Log: Fix a typo. Approved by: rwatson Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Fri Dec 19 16:11:04 2008 (r186329) +++ head/usr.bin/procstat/procstat.1 Fri Dec 19 16:56:49 2008 (r186330) @@ -203,7 +203,7 @@ Display kernel thread stacks for a proce of thread wait channels. If the .Fl k -flag is reeated, function offsets, not just function names, are printed. +flag is repeated, function offsets, not just function names, are printed. .Pp This feature requires .Cd "options STACK" From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 18:27:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EBEF1065674; Fri, 19 Dec 2008 18:27:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0998FC0C; Fri, 19 Dec 2008 18:27:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJIRpCf079331; Fri, 19 Dec 2008 18:27:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJIRp8b079330; Fri, 19 Dec 2008 18:27:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812191827.mBJIRp8b079330@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 18:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186331 - head/usr.sbin/syslogd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 18:27:51 -0000 Author: delphij Date: Fri Dec 19 18:27:51 2008 New Revision: 186331 URL: http://svn.freebsd.org/changeset/base/186331 Log: Constify 'name' field in struct funix. This commit makes syslogd(8) WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?= level as-is for now. Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Dec 19 16:56:49 2008 (r186330) +++ head/usr.sbin/syslogd/syslogd.c Fri Dec 19 18:27:51 2008 (r186331) @@ -128,7 +128,7 @@ const char ctty[] = _PATH_CONSOLE; */ struct funix { int s; - char *name; + const char *name; mode_t mode; STAILQ_ENTRY(funix) next; }; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 18:33:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2E31065678; Fri, 19 Dec 2008 18:33:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6538FC17; Fri, 19 Dec 2008 18:33:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJIXrpE079576; Fri, 19 Dec 2008 18:33:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJIXr80079575; Fri, 19 Dec 2008 18:33:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812191833.mBJIXr80079575@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 18:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186332 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 18:33:53 -0000 Author: sam Date: Fri Dec 19 18:33:53 2008 New Revision: 186332 URL: http://svn.freebsd.org/changeset/base/186332 Log: Correct 5212 ani support so that max noise immunity, spur immunity, and step levels are used. Noticed by: Jiri Fojtasek Reviewed by: rpaulo Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Dec 19 18:27:51 2008 (r186331) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Dec 19 18:33:53 2008 (r186332) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_ani.c,v 1.7 2008/11/21 00:16:21 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -267,7 +267,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_NOISE_IMMUNITY_LEVEL: { u_int level = param; - if (level >= params->maxNoiseImmunityLevel) { + if (level > params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxNoiseImmunityLevel); @@ -342,7 +342,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_FIRSTEP_LEVEL: { u_int level = param; - if (level >= params->maxFirstepLevel) { + if (level > params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxFirstepLevel); @@ -360,7 +360,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_SPUR_IMMUNITY_LEVEL: { u_int level = param; - if (level >= params->maxSpurImmunityLevel) { + if (level > params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxSpurImmunityLevel); @@ -433,7 +433,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * aniState = ahp->ah_curani; params = aniState->params; /* First, raise noise immunity level, up to max */ - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if (aniState->noiseImmunityLevel+1 <= params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise NI to %u\n", __func__, aniState->noiseImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, @@ -441,7 +441,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * return; } /* then, raise spur immunity level, up to max */ - if (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel) { + if (aniState->spurImmunityLevel+1 <= params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise SI to %u\n", __func__, aniState->spurImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, @@ -470,7 +470,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * * If weak sig detect is already off, as last resort, * raise firstep level */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1); @@ -490,7 +490,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_TRUE); } - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1); @@ -544,7 +544,7 @@ ar5212AniCckErrTrigger(struct ath_hal *a /* first, raise noise immunity level, up to max */ aniState = ahp->ah_curani; params = aniState->params; - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if (aniState->noiseImmunityLevel+1 <= params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise NI to %u\n", __func__, aniState->noiseImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, @@ -559,7 +559,7 @@ ar5212AniCckErrTrigger(struct ath_hal *a * Beacon signal in mid and high range, * raise firstep level. */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 18:34:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C50A81065674; Fri, 19 Dec 2008 18:34:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B429F8FC1F; Fri, 19 Dec 2008 18:34:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJIYex9079632; Fri, 19 Dec 2008 18:34:40 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJIYeMi079631; Fri, 19 Dec 2008 18:34:40 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812191834.mBJIYeMi079631@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 18:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186333 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 18:34:40 -0000 Author: sam Date: Fri Dec 19 18:34:40 2008 New Revision: 186333 URL: http://svn.freebsd.org/changeset/base/186333 Log: add FreeBSD property Modified: head/sys/dev/ath/ath_hal/ah.h (props changed) head/sys/dev/ath/ath_hal/ah_debug.h (props changed) head/sys/dev/ath/ath_hal/ah_decode.h (props changed) head/sys/dev/ath/ath_hal/ah_desc.h (props changed) head/sys/dev/ath/ath_hal/ah_devid.h (props changed) head/sys/dev/ath/ath_hal/ah_eeprom.h (props changed) head/sys/dev/ath/ath_hal/ah_eeprom_v1.c (props changed) head/sys/dev/ath/ath_hal/ah_eeprom_v1.h (props changed) head/sys/dev/ath/ath_hal/ah_eeprom_v14.h (props changed) head/sys/dev/ath/ath_hal/ah_eeprom_v3.h (props changed) head/sys/dev/ath/ath_hal/ah_regdomain.c (props changed) head/sys/dev/ath/ath_hal/ah_soc.h (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210.h (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_interrupts.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_keycache.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210desc.h (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210phy.h (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5210reg.h (props changed) head/sys/dev/ath/ath_hal/ar5210/ar5k_0007.ini (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211.h (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_interrupts.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211desc.h (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211phy.h (props changed) head/sys/dev/ath/ath_hal/ar5211/ar5211reg.h (props changed) head/sys/dev/ath/ath_hal/ar5211/boss.ini (props changed) head/sys/dev/ath/ath_hal/ar5212/ar2316.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar2317.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar2413.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar2425.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5112.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212.h (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212.ini (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_eeprom.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_gpio.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212desc.h (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212phy.h (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5212reg.h (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5311reg.h (props changed) head/sys/dev/ath/ath_hal/ar5212/ar5413.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_misc.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_power.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312phy.h (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5312reg.h (props changed) head/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar2133.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416.h (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416.ini (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_eeprom.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_keycache.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_phy.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h (props changed) head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h (props changed) head/sys/dev/ath/ath_hal/ar5416/ar9160.ini (props changed) head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 18:47:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C6A1065677; Fri, 19 Dec 2008 18:47:46 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCA0C8FC19; Fri, 19 Dec 2008 18:47:46 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJIlkbv080001; Fri, 19 Dec 2008 18:47:46 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJIlkAn080000; Fri, 19 Dec 2008 18:47:46 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812191847.mBJIlkAn080000@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 18:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186335 - head/usr.sbin/makefs projects/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 18:47:47 -0000 Author: sam Date: Fri Dec 19 18:47:46 2008 New Revision: 186335 URL: http://svn.freebsd.org/changeset/base/186335 Log: import netbsd makefs tool Added: head/usr.sbin/makefs/ - copied from r186334, projects/makefs/ Changes in other areas also in this revision: Deleted: projects/makefs/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:19:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79336106564A; Fri, 19 Dec 2008 20:19:59 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 671798FC1D; Fri, 19 Dec 2008 20:19:59 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJKJxe1081744; Fri, 19 Dec 2008 20:19:59 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJKJx5I081742; Fri, 19 Dec 2008 20:19:59 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812192019.mBJKJx5I081742@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 20:19:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186336 - stable/7/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 20:19:59 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 20:19:59 2008 New Revision: 186336 URL: http://svn.freebsd.org/changeset/base/186336 Log: MFC r186314: Initialize the cntp pointer to 0 prior to doing any work so that callers don't try to iterate through garbage or NULL memory. Additionally, return NULL instead of 0 on error. Approved by: re (kib) Modified: stable/7/lib/libutil/kinfo_getfile.c stable/7/lib/libutil/kinfo_getvmmap.c Modified: stable/7/lib/libutil/kinfo_getfile.c ============================================================================== --- stable/7/lib/libutil/kinfo_getfile.c Fri Dec 19 18:47:46 2008 (r186335) +++ stable/7/lib/libutil/kinfo_getfile.c Fri Dec 19 20:19:59 2008 (r186336) @@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_file *kif, *kp, *kf; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp) kif = calloc(cnt, sizeof(*kif)); if (kif == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; Modified: stable/7/lib/libutil/kinfo_getvmmap.c ============================================================================== --- stable/7/lib/libutil/kinfo_getvmmap.c Fri Dec 19 18:47:46 2008 (r186335) +++ stable/7/lib/libutil/kinfo_getvmmap.c Fri Dec 19 20:19:59 2008 (r186336) @@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_vmentry *kiv, *kp, *kv; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) kiv = calloc(cnt, sizeof(*kiv)); if (kiv == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:20:14 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A164E106567C; Fri, 19 Dec 2008 20:20:14 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE958FC13; Fri, 19 Dec 2008 20:20:14 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJKKEpZ081794; Fri, 19 Dec 2008 20:20:14 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJKKEIo081792; Fri, 19 Dec 2008 20:20:14 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200812192020.mBJKKEIo081792@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 19 Dec 2008 20:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186337 - head/usr.sbin/burncd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 20:20:14 -0000 Author: obrien Date: Fri Dec 19 20:20:14 2008 New Revision: 186337 URL: http://svn.freebsd.org/changeset/base/186337 Log: burncd(8) doesn't handle signals and interrupting burncd during operation. For example, ^C (SIGINT) may leave the drive spinning and locked. This may also happen if you try to write a too-large image to a disc and burncd(8) exits with an I/O error. Add signal handling by doing a CDRIOCFLUSH ioctl to attempt to leave burner in a sane state when burning is interrupted with SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write. Note, that blanking will still continue after interrupt but it seems to finish correctly even after burncd(8) has quit. Also, while I'm here bump WARNS to "6". PR: 48730 Submitted by: Jaakko Heinonen Modified: head/usr.sbin/burncd/Makefile head/usr.sbin/burncd/burncd.c Modified: head/usr.sbin/burncd/Makefile ============================================================================== --- head/usr.sbin/burncd/Makefile Fri Dec 19 20:19:59 2008 (r186336) +++ head/usr.sbin/burncd/Makefile Fri Dec 19 20:20:14 2008 (r186337) @@ -3,6 +3,6 @@ PROG= burncd MAN= burncd.8 -WARNS?= 5 +WARNS?= 6 .include Modified: head/usr.sbin/burncd/burncd.c ============================================================================== --- head/usr.sbin/burncd/burncd.c Fri Dec 19 20:19:59 2008 (r186336) +++ head/usr.sbin/burncd/burncd.c Fri Dec 19 20:20:14 2008 (r186337) @@ -29,6 +29,7 @@ */ #include +#include #include #include #include @@ -67,6 +68,8 @@ int write_file(int fd, struct track_info int roundup_blocks(struct track_info *); void cue_ent(struct cdr_cue_entry *, int, int, int, int, int, int, int); void cleanup(int); +void cleanup_flush(void); +void cleanup_signal(int); void usage(void); int @@ -157,6 +160,9 @@ main(int argc, char **argv) global_fd_for_cleanup = fd; err_set_exit(cleanup); + signal(SIGHUP, cleanup_signal); + signal(SIGINT, cleanup_signal); + signal(SIGTERM, cleanup_signal); for (arg = 0; arg < argc; arg++) { if (!strcasecmp(argv[arg], "fixate")) { @@ -319,6 +325,10 @@ main(int argc, char **argv) if (eject) if (ioctl(fd, CDIOCEJECT) < 0) err(EX_IOERR, "ioctl(CDIOCEJECT)"); + + signal(SIGHUP, SIG_DFL); + signal(SIGINT, SIG_DFL); + signal(SIGTERM, SIG_DFL); close(fd); exit(EX_OK); } @@ -469,8 +479,10 @@ do_DAO(int fd, int test_write, int multi err(EX_IOERR, "ioctl(CDRIOCSENDCUE)"); for (i = 0; i < notracks; i++) { - if (write_file(fd, &tracks[i])) + if (write_file(fd, &tracks[i])) { + cleanup_flush(); err(EX_IOERR, "write_file"); + } } ioctl(fd, CDRIOCFLUSH); @@ -499,8 +511,10 @@ do_TAO(int fd, int test_write, int preem if (!quiet) fprintf(stderr, "next writeable LBA %d\n", tracks[i].addr); - if (write_file(fd, &tracks[i])) + if (write_file(fd, &tracks[i])) { + cleanup_flush(); err(EX_IOERR, "write_file"); + } if (ioctl(fd, CDRIOCFLUSH) < 0) err(EX_IOERR, "ioctl(CDRIOCFLUSH)"); } @@ -630,9 +644,11 @@ write_file(int fd, struct track_info *tr track_info->block_size; } if ((res = write(fd, buf, count)) != count) { - if (res == -1) - fprintf(stderr, "\n%s\n", strerror(errno)); - else + if (res == -1) { + fprintf(stderr, "\n"); + close(track_info->file); + return errno; + } else fprintf(stderr, "\nonly wrote %d of %jd" " bytes\n", res, (intmax_t)count); break; @@ -693,6 +709,21 @@ cleanup(int dummy __unused) } void +cleanup_flush(void) +{ + if (ioctl(global_fd_for_cleanup, CDRIOCFLUSH) < 0) + err(EX_IOERR, "ioctl(CDRIOCFLUSH)"); +} + +void +cleanup_signal(int sig __unused) +{ + cleanup_flush(); + fprintf(stderr, "\n"); + errx(EXIT_FAILURE, "Aborted"); +} + +void usage(void) { fprintf(stderr, From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:20:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D5A31065674; Fri, 19 Dec 2008 20:20:50 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDC68FC20; Fri, 19 Dec 2008 20:20:50 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJKKo0g081839; Fri, 19 Dec 2008 20:20:50 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJKKo6P081837; Fri, 19 Dec 2008 20:20:50 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812192020.mBJKKo6P081837@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 20:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186338 - stable/7/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 20:20:50 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 20:20:50 2008 New Revision: 186338 URL: http://svn.freebsd.org/changeset/base/186338 Log: MFC r186315: Do not segfault when procstat -f or procstat -v is called on a process not owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return NULL, simply exit, and do not try and derefernce the memory. Approved by: re (kib) Modified: stable/7/usr.bin/procstat/procstat_files.c stable/7/usr.bin/procstat/procstat_vm.c Modified: stable/7/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/7/usr.bin/procstat/procstat_files.c Fri Dec 19 20:20:14 2008 (r186337) +++ stable/7/usr.bin/procstat/procstat_files.c Fri Dec 19 20:20:50 2008 (r186338) @@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_p "PRO", "NAME"); freep = kinfo_getfile(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kif = &freep[i]; Modified: stable/7/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/7/usr.bin/procstat/procstat_vm.c Fri Dec 19 20:20:14 2008 (r186337) +++ stable/7/usr.bin/procstat/procstat_vm.c Fri Dec 19 20:20:50 2008 (r186338) @@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc "PRES", "REF", "SHD", "FL", "TP", "PATH"); freep = kinfo_getvmmap(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kve = &freep[i]; printf("%5d ", pid); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:22:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47D5F106564A; Fri, 19 Dec 2008 20:22:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 368D08FC1F; Fri, 19 Dec 2008 20:22:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJKMuD8081960; Fri, 19 Dec 2008 20:22:56 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJKMuKc081958; Fri, 19 Dec 2008 20:22:56 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812192022.mBJKMuKc081958@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 20:22:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186339 - releng/7.1/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 20:22:56 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 20:22:55 2008 New Revision: 186339 URL: http://svn.freebsd.org/changeset/base/186339 Log: MFC r186314: Initialize the cntp pointer to 0 prior to doing any work so that callers don't try to iterate through garbage or NULL memory. Additionally, return NULL instead of 0 on error. Approved by: re (kib) Modified: releng/7.1/lib/libutil/kinfo_getfile.c releng/7.1/lib/libutil/kinfo_getvmmap.c Modified: releng/7.1/lib/libutil/kinfo_getfile.c ============================================================================== --- releng/7.1/lib/libutil/kinfo_getfile.c Fri Dec 19 20:20:50 2008 (r186338) +++ releng/7.1/lib/libutil/kinfo_getfile.c Fri Dec 19 20:22:55 2008 (r186339) @@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_file *kif, *kp, *kf; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp) kif = calloc(cnt, sizeof(*kif)); if (kif == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; Modified: releng/7.1/lib/libutil/kinfo_getvmmap.c ============================================================================== --- releng/7.1/lib/libutil/kinfo_getvmmap.c Fri Dec 19 20:20:50 2008 (r186338) +++ releng/7.1/lib/libutil/kinfo_getvmmap.c Fri Dec 19 20:22:55 2008 (r186339) @@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) char *buf, *bp, *eb; struct kinfo_vmentry *kiv, *kp, *kv; + *cntp = 0; len = 0; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp) error = sysctl(mib, 4, NULL, &len, NULL, 0); if (error) - return (0); + return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) - return (0); + return (NULL); error = sysctl(mib, 4, buf, &len, NULL, 0); if (error) { free(buf); - return (0); + return (NULL); } /* Pass 1: count items */ cnt = 0; @@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp) kiv = calloc(cnt, sizeof(*kiv)); if (kiv == NULL) { free(buf); - return (0); + return (NULL); } bp = buf; eb = buf + len; From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 20:23:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 325321065677; Fri, 19 Dec 2008 20:23:41 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 214478FC22; Fri, 19 Dec 2008 20:23:41 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJKNfiu082014; Fri, 19 Dec 2008 20:23:41 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJKNfcM082012; Fri, 19 Dec 2008 20:23:41 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200812192023.mBJKNfcM082012@svn.freebsd.org> From: Joe Marcus Clarke Date: Fri, 19 Dec 2008 20:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186340 - releng/7.1/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 20:23:41 -0000 Author: marcus (doc,ports committer) Date: Fri Dec 19 20:23:38 2008 New Revision: 186340 URL: http://svn.freebsd.org/changeset/base/186340 Log: MFC r186315: Do not segfault when procstat -f or procstat -v is called on a process not owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return NULL, simply exit, and do not try and derefernce the memory. Approved by: re (kib) Modified: releng/7.1/usr.bin/procstat/procstat_files.c releng/7.1/usr.bin/procstat/procstat_vm.c Modified: releng/7.1/usr.bin/procstat/procstat_files.c ============================================================================== --- releng/7.1/usr.bin/procstat/procstat_files.c Fri Dec 19 20:22:55 2008 (r186339) +++ releng/7.1/usr.bin/procstat/procstat_files.c Fri Dec 19 20:23:38 2008 (r186340) @@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_p "PRO", "NAME"); freep = kinfo_getfile(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kif = &freep[i]; Modified: releng/7.1/usr.bin/procstat/procstat_vm.c ============================================================================== --- releng/7.1/usr.bin/procstat/procstat_vm.c Fri Dec 19 20:22:55 2008 (r186339) +++ releng/7.1/usr.bin/procstat/procstat_vm.c Fri Dec 19 20:23:38 2008 (r186340) @@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc "PRES", "REF", "SHD", "FL", "TP", "PATH"); freep = kinfo_getvmmap(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kve = &freep[i]; printf("%5d ", pid); From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 21:20:19 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30B0B106568B; Fri, 19 Dec 2008 21:20:19 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id ED7348FC2D; Fri, 19 Dec 2008 21:20:18 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id mBJKqTEJ044823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Dec 2008 12:52:30 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <494C097C.1020604@FreeBSD.org> Date: Fri, 19 Dec 2008 12:52:12 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: "David E. O'Brien" References: <200812192020.mBJKKEIo081792@svn.freebsd.org> In-Reply-To: <200812192020.mBJKKEIo081792@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn: head/usr.sbin/burncd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 21:20:19 -0000 Should not it be better to implement this on the kernel side when the device is closed abruptly? David E. O'Brien wrote: > Author: obrien > Date: Fri Dec 19 20:20:14 2008 > New Revision: 186337 > URL: http://svn.freebsd.org/changeset/base/186337 > > Log: > burncd(8) doesn't handle signals and interrupting burncd during operation. > For example, ^C (SIGINT) may leave the drive spinning and locked. > This may also happen if you try to write a too-large image to a disc > and burncd(8) exits with an I/O error. > > Add signal handling by doing a CDRIOCFLUSH ioctl to attempt to leave > burner in a sane state when burning is interrupted with SIGHUP, SIGINT, > SIGTERM, or in case an I/O error occurs during write. > Note, that blanking will still continue after interrupt but it seems to > finish correctly even after burncd(8) has quit. -Maxim From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 22:49:47 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74F121065670; Fri, 19 Dec 2008 22:49:47 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8738FC0C; Fri, 19 Dec 2008 22:49:47 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id mBJMnk7b013171; Fri, 19 Dec 2008 14:49:46 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id mBJMnkFj013170; Fri, 19 Dec 2008 14:49:46 -0800 (PST) (envelope-from obrien) Date: Fri, 19 Dec 2008 14:49:46 -0800 From: "David O'Brien" To: Maxim Sobolev Message-ID: <20081219224946.GB13076@dragon.NUXI.org> References: <200812192020.mBJKKEIo081792@svn.freebsd.org> <494C097C.1020604@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <494C097C.1020604@FreeBSD.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn: head/usr.sbin/burncd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 22:49:47 -0000 On Fri, Dec 19, 2008 at 12:52:12PM -0800, Maxim Sobolev wrote: > Should not it be better to implement this on the kernel side when the > device is closed abruptly? Maybe. I've hit this issue before and there was a patch to fix it and I wanted to see it fixed. If you have a patch to fix it as you suggest please commit it, or post it. -- David From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 22:58:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71AC71065674; Fri, 19 Dec 2008 22:58:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EB8D8FC1A; Fri, 19 Dec 2008 22:58:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJMwdwu084796; Fri, 19 Dec 2008 22:58:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJMwdSq084795; Fri, 19 Dec 2008 22:58:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812192258.mBJMwdSq084795@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 22:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186341 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 22:58:39 -0000 Author: sam Date: Fri Dec 19 22:58:39 2008 New Revision: 186341 URL: http://svn.freebsd.org/changeset/base/186341 Log: fix 64-bit build Modified: head/usr.sbin/makefs/ffs.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Fri Dec 19 20:23:38 2008 (r186340) +++ head/usr.sbin/makefs/ffs.c Fri Dec 19 22:58:39 2008 (r186341) @@ -371,7 +371,7 @@ ffs_validate(const char *dir, fsnode *ro "maxsize of %lld; rounding down to %lld.", __func__, dir, (long long)size, (long long)fsopts->maxsize, - rounddown(fsopts->size, fsopts->bsize)); + (long long) rounddown(fsopts->size, fsopts->bsize)); } size = rounddown(fsopts->size, fsopts->bsize); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 22:59:05 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842BE106578B; Fri, 19 Dec 2008 22:59:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713D38FC27; Fri, 19 Dec 2008 22:59:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJMx5u3084845; Fri, 19 Dec 2008 22:59:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJMx5PI084844; Fri, 19 Dec 2008 22:59:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812192259.mBJMx5PI084844@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 22:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186342 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 22:59:05 -0000 Author: sam Date: Fri Dec 19 22:59:05 2008 New Revision: 186342 URL: http://svn.freebsd.org/changeset/base/186342 Log: fix pathnames to work w/ buildworld Modified: head/usr.sbin/makefs/Makefile Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Fri Dec 19 22:58:39 2008 (r186341) +++ head/usr.sbin/makefs/Makefile Fri Dec 19 22:59:05 2008 (r186342) @@ -5,21 +5,21 @@ MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I. +CFLAGS+=-I${.CURDIR} SRCS= ffs.c getid.c makefs.c walk.c .PATH: ${.CURDIR}/ffs -CFLAGS+=-Iffs +CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c .PATH: ${.CURDIR}/compat -CFLAGS+=-Icompat +CFLAGS+=-I${.CURDIR}/compat SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree -CFLAGS+=-I../mtree +CFLAGS+=-I${.CURDIR}/../mtree SRCS+= misc.c spec.c .PATH: ${.CURDIR}/../../sys/ufs/ffs From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:00:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A72F6106564A; Fri, 19 Dec 2008 23:00:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92DF98FC13; Fri, 19 Dec 2008 23:00:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJN0N1e084932; Fri, 19 Dec 2008 23:00:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJN0NDq084929; Fri, 19 Dec 2008 23:00:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200812192300.mBJN0NDq084929@svn.freebsd.org> From: Xin LI Date: Fri, 19 Dec 2008 23:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186343 - head/contrib/netcat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 23:00:23 -0000 Author: delphij Date: Fri Dec 19 23:00:23 2008 New Revision: 186343 URL: http://svn.freebsd.org/changeset/base/186343 Log: Merge nc(1) from OpenBSD 4.4. While there, rename our '-O' (no tcp options) to '--no-tcpopt' in order to resolve a comflicit with OpenBSD's -O semantics. Modified: head/contrib/netcat/ (props changed) head/contrib/netcat/FREEBSD-vendor head/contrib/netcat/atomicio.c (props changed) head/contrib/netcat/atomicio.h (props changed) head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c head/contrib/netcat/socks.c (props changed) Modified: head/contrib/netcat/FREEBSD-vendor ============================================================================== --- head/contrib/netcat/FREEBSD-vendor Fri Dec 19 22:59:05 2008 (r186342) +++ head/contrib/netcat/FREEBSD-vendor Fri Dec 19 23:00:23 2008 (r186343) @@ -1,7 +1,7 @@ # $FreeBSD$ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ -Version: 4.3 +Version: 4.4 VendorTag: OPENBSD -VersionTag: OPENBSD_4_3 +VersionTag: OPENBSD_4_4 License: BSD Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Fri Dec 19 22:59:05 2008 (r186342) +++ head/contrib/netcat/nc.1 Fri Dec 19 23:00:23 2008 (r186343) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.45 2007/05/31 19:20:13 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.47 2008/05/06 16:21:03 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd $Mdocdate$ +.Dd $Mdocdate: May 6 2008 $ .Dt NC 1 .Os .Sh NAME @@ -36,9 +36,12 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklnOorStUuvz +.Op Fl 46DdEhklnorStUuvz .Op Fl e Ar IPsec_policy +.Op Fl I Ar length .Op Fl i Ar interval +.Op Fl -no-tcpopt +.Op Fl O Ar length .Op Fl P Ar proxy_username .Op Fl p Ar source_port .Op Fl s Ar source_ip_address @@ -118,6 +121,8 @@ each direction is needed. Prints out .Nm help. +.It Fl I Ar length +Specifies the size of the TCP receive buffer. .It Fl i Ar interval Specifies a delay time interval between lines of text sent and received. Also causes a delay time between connections to multiple ports. @@ -146,10 +151,13 @@ option are ignored. .It Fl n Do not do any DNS or service lookups on any specified addresses, hostnames or ports. -.It Fl O +.It Fl -no-tcpopt Disables the use of TCP options on the socket, by setting the boolean TCP_NOOPT socket option. +.It Fl O Ar length +Specifies the size of the TCP send buffer. +When .It Fl o .Dq Once-only mode . By default, Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Fri Dec 19 22:59:05 2008 (r186342) +++ head/contrib/netcat/netcat.c Fri Dec 19 23:00:23 2008 (r186343) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.89 2007/02/20 14:11:17 jmc Exp $ */ +/* $OpenBSD: netcat.c,v 1.91 2008/05/09 09:00:11 markus Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -78,7 +79,7 @@ int kflag; /* More than one connect int lflag; /* Bind to local port */ int nflag; /* Don't do name look up */ int oflag; /* Once only: stop on EOF */ -int Oflag; /* Do not use TCP options */ +int FreeBSD_Oflag; /* Do not use TCP options */ char *Pflag; /* Proxy username */ char *pflag; /* Localport flag */ int rflag; /* Random ports flag */ @@ -89,6 +90,8 @@ int vflag; /* Verbosity */ int xflag; /* Socks proxy */ int zflag; /* Port Scan Flag */ int Dflag; /* sodebug */ +int Iflag; /* TCP receive buffer size */ +int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ @@ -129,6 +132,10 @@ main(int argc, char *argv[]) char *proxy; const char *errstr, *proxyhost = "", *proxyport = NULL; struct addrinfo proxyhints; + struct option longopts[] = { + { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, + { NULL, 0, NULL, 0 } + }; ret = 1; ipsec_count = 0; @@ -138,8 +145,9 @@ main(int argc, char *argv[]) uport = NULL; sv = NULL; - while ((ch = getopt(argc, argv, - "46e:DEdhi:jklnoOP:p:rSs:tT:Uuvw:X:x:z")) != -1) { + while ((ch = getopt_long(argc, argv, + "46e:DEdhi:jklnoI:O:P:p:rSs:tT:Uuvw:X:x:z", + longopts, NULL)) != -1) { switch (ch) { case '4': family = AF_INET; @@ -203,9 +211,6 @@ main(int argc, char *argv[]) case 'o': oflag = 1; break; - case 'O': - Oflag = 1; - break; case 'P': Pflag = optarg; break; @@ -244,12 +249,28 @@ main(int argc, char *argv[]) case 'D': Dflag = 1; break; + case 'I': + Iflag = strtonum(optarg, 1, 65536 << 14, &errstr); + if (errstr != NULL) + errx(1, "TCP receive window %s: %s", + errstr, optarg); + break; + case 'O': + Oflag = strtonum(optarg, 1, 65536 << 14, &errstr); + if (errstr != NULL) { + if (strcmp(errstr, "invalid") != 0) + errx(1, "TCP send window %s: %s", + errstr, optarg); + } + break; case 'S': Sflag = 1; break; case 'T': Tflag = parse_iptos(optarg); break; + case 0: + break; default: usage(1); } @@ -512,7 +533,7 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, error; + int s, error, on = 1; if ((error = getaddrinfo(host, port, &hints, &res))) errx(1, "getaddrinfo: %s", gai_strerror(error)); @@ -533,6 +554,10 @@ remote_connect(const char *host, const c if (sflag || pflag) { struct addrinfo ahints, *ares; +#ifdef SO_BINDANY + /* try SO_BINDANY, but don't insist */ + setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); +#endif memset(&ahints, 0, sizeof(struct addrinfo)); ahints.ai_family = res0->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; @@ -604,9 +629,9 @@ local_listen(char *host, char *port, str if (ipsec_policy[1] != NULL) add_ipsec_policy(s, ipsec_policy[1]); #endif - if (Oflag) { + if (FreeBSD_Oflag) { if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT, - &Oflag, sizeof(Oflag)) == -1) + &FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1) err(1, "disable TCP options"); } @@ -838,9 +863,19 @@ set_common_sockopts(int s) &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); } + if (Iflag) { + if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, + &Iflag, sizeof(Iflag)) == -1) + err(1, "set TCP receive buffer size"); + } if (Oflag) { - if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT, + if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &Oflag, sizeof(Oflag)) == -1) + err(1, "set TCP send buffer size"); + } + if (FreeBSD_Oflag) { + if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT, + &FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1) err(1, "disable TCP options"); } } @@ -878,11 +913,13 @@ help(void) #endif fprintf(stderr, "\ \t-h This help text\n\ + \t-I length TCP receive buffer length\n\ \t-i secs\t Delay interval for lines sent, ports scanned\n\ \t-k Keep inbound sockets open for multiple connects\n\ \t-l Listen mode, for inbound connects\n\ \t-n Suppress name/port resolutions\n\ - \t-O Disable TCP options\n\ + \t--no-tcpopt Disable TCP options\n\ + \t-O length TCP send buffer length\n\ \t-o Terminate on EOF on input\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ @@ -931,10 +968,11 @@ void usage(int ret) { #ifdef IPSEC - fprintf(stderr, "usage: nc [-46DdEhklnOorStUuvz] [-e policy] [-i interval] [-P proxy_username] [-p source_port]\n"); + fprintf(stderr, "usage: nc [-46DdEhklnorStUuvz] [-e policy] [-I receive_buffer_len] [-i interval]\n"); #else - fprintf(stderr, "usage: nc [-46DdhklnOorStUuvz] [-i interval] [-P proxy_username] [-p source_port]\n"); + fprintf(stderr, "usage: nc [-46DdhklnorStUuvz] [-I receive_buffer_len] [-i interval]\n"); #endif + fprintf(stderr, "\t [-O send_buffer_len] [-P proxy_username] [-p source_port]\n"); fprintf(stderr, "\t [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]\n"); fprintf(stderr, "\t [-x proxy_address[:port]] [hostname] [port[s]]\n"); if (ret) From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:10:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 275F01065673; Fri, 19 Dec 2008 23:10:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140658FC1E; Fri, 19 Dec 2008 23:10:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJNAuYi085180; Fri, 19 Dec 2008 23:10:56 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJNAt4r085177; Fri, 19 Dec 2008 23:10:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812192310.mBJNAt4r085177@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 23:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186344 - in head: . sys/sys usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 23:10:56 -0000 Author: sam Date: Fri Dec 19 23:10:55 2008 New Revision: 186344 URL: http://svn.freebsd.org/changeset/base/186344 Log: add makefs to the base system; FreeBSD_version bumped just in case Reviewed by: imp Modified: head/UPDATING head/sys/sys/param.h head/usr.sbin/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 19 23:00:23 2008 (r186343) +++ head/UPDATING Fri Dec 19 23:10:55 2008 (r186344) @@ -21,6 +21,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. developers choose to disable these features on build machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) + +20081219: + With __FreeBSD_version 800060 incorporates the makefs tool is + part of the base system (it was a port). + 20081216: The afdata and ifnet locks have been changed from mutexes to rwlocks, network modules will need to be re-compiled. Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Dec 19 23:00:23 2008 (r186343) +++ head/sys/sys/param.h Fri Dec 19 23:10:55 2008 (r186344) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800059 /* Master, propagated to newvers */ +#define __FreeBSD_version 800060 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Dec 19 23:00:23 2008 (r186343) +++ head/usr.sbin/Makefile Fri Dec 19 23:10:55 2008 (r186344) @@ -86,6 +86,7 @@ SUBDIR= ${_ac} \ ${_lptcontrol} \ ${_mailstats} \ mailwrapper \ + makefs \ ${_makemap} \ manctl \ memcontrol \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 19 23:12:14 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF1931065673; Fri, 19 Dec 2008 23:12:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC3E48FC12; Fri, 19 Dec 2008 23:12:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJNCEH6085249; Fri, 19 Dec 2008 23:12:14 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJNCEvm085248; Fri, 19 Dec 2008 23:12:14 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812192312.mBJNCEvm085248@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 23:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186345 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 23:12:15 -0000 Author: sam Date: Fri Dec 19 23:12:14 2008 New Revision: 186345 URL: http://svn.freebsd.org/changeset/base/186345 Log: correct wording Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Dec 19 23:10:55 2008 (r186344) +++ head/UPDATING Fri Dec 19 23:12:14 2008 (r186345) @@ -23,8 +23,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. ln -s aj /etc/malloc.conf.) 20081219: - With __FreeBSD_version 800060 incorporates the makefs tool is - part of the base system (it was a port). + With __FreeBSD_version 800060 the makefs tool is part of + the base system (it was a port). 20081216: The afdata and ifnet locks have been changed from mutexes to From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:04:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBA901065673; Sat, 20 Dec 2008 00:04:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C82108FC08; Sat, 20 Dec 2008 00:04:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK044dZ086191; Sat, 20 Dec 2008 00:04:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK044WK086190; Sat, 20 Dec 2008 00:04:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200812200004.mBK044WK086190@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 20 Dec 2008 00:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186346 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 00:04:05 -0000 Author: yongari Date: Sat Dec 20 00:04:04 2008 New Revision: 186346 URL: http://svn.freebsd.org/changeset/base/186346 Log: Fix a typo. Submitted by: clemens fischer via Shigeaki Tagashira Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri Dec 19 23:12:14 2008 (r186345) +++ head/sys/dev/nfe/if_nfe.c Sat Dec 20 00:04:04 2008 (r186346) @@ -3080,7 +3080,7 @@ nfe_sysctl_node(struct nfe_softc *sc) &stats->rx_unicast, "Unicast Frames"); NFE_SYSCTL_STAT_ADD32(ctx, child, "multicast", &stats->rx_multicast, "Multicast Frames"); - NFE_SYSCTL_STAT_ADD32(ctx, child, "brocadcast", + NFE_SYSCTL_STAT_ADD32(ctx, child, "broadcast", &stats->rx_broadcast, "Broadcast Frames"); if ((sc->nfe_flags & NFE_MIB_V2) != 0) { NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:33:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937781065670; Sat, 20 Dec 2008 00:33:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9608FC14; Sat, 20 Dec 2008 00:33:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK0XA8l086792; Sat, 20 Dec 2008 00:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK0XAwm086785; Sat, 20 Dec 2008 00:33:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812200033.mBK0XAwm086785@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Dec 2008 00:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186347 - in head/sys: conf dev/ofw kern powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 00:33:10 -0000 Author: nwhitehorn Date: Sat Dec 20 00:33:10 2008 New Revision: 186347 URL: http://svn.freebsd.org/changeset/base/186347 Log: Modularize the Open Firmware client interface to allow run-time switching of OFW access semantics, in order to allow future support for real-mode OF access and flattened device frees. OF client interface modules are implemented using KOBJ, in a similar way to the PPC PMAP modules. Because we need Open Firmware to be available before mutexes can be used on sparc64, changes are also included to allow KOBJ to be used very early in the boot process by only using the mutex once we know it has been initialized. Reviewed by: marius, grehan Added: head/sys/dev/ofw/ofw_if.m (contents, props changed) head/sys/dev/ofw/ofw_standard.c - copied, changed from r186188, head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/ofwvar.h (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/conf/files.sun4v head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/dev/ofw/openfirmio.c head/sys/dev/ofw/openpromio.c head/sys/kern/subr_kobj.c head/sys/powerpc/aim/locore.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/ofw_machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/ofw_machdep.h head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/include/ofw_machdep.h head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/support.S head/sys/sparc64/sparc64/trap.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sun4v/sun4v/machdep.c head/sys/sun4v/sun4v/mp_machdep.c head/sys/sun4v/sun4v/support.S head/sys/sun4v/sun4v/trap.c head/sys/sys/kobj.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Dec 20 00:04:04 2008 (r186346) +++ head/sys/conf/files.powerpc Sat Dec 20 00:33:10 2008 (r186347) @@ -30,9 +30,11 @@ dev/kbd/kbd.c optional sc dev/ofw/openfirm.c optional aim dev/ofw/openfirmio.c optional aim dev/ofw/ofw_bus_if.m optional aim +dev/ofw/ofw_if.m optional aim dev/ofw/ofw_bus_subr.c optional aim dev/ofw/ofw_console.c optional aim dev/ofw/ofw_disk.c optional ofwd aim +dev/ofw/ofw_standard.c optional aim dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_ocp.c optional quicc mpc85xx dev/scc/scc_bfe_macio.c optional scc powermac Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Sat Dec 20 00:04:04 2008 (r186346) +++ head/sys/conf/files.sparc64 Sat Dec 20 00:33:10 2008 (r186347) @@ -42,8 +42,10 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus +dev/ofw/ofw_if.m standard dev/ofw/ofw_bus_if.m standard dev/ofw/ofw_bus_subr.c standard +dev/ofw/ofw_standard.c standard dev/ofw/ofw_console.c optional ofw_console dev/ofw/openfirm.c standard dev/ofw/openfirmio.c standard Modified: head/sys/conf/files.sun4v ============================================================================== --- head/sys/conf/files.sun4v Sat Dec 20 00:04:04 2008 (r186346) +++ head/sys/conf/files.sun4v Sat Dec 20 00:33:10 2008 (r186347) @@ -21,8 +21,10 @@ ukbdmap.h optional ukbd_dflt_keymap \ crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/ofw/ofw_bus_if.m standard +dev/ofw/ofw_if.m standard dev/ofw/ofw_bus_subr.c standard dev/ofw/ofw_console.c optional ofw_console +dev/ofw/ofw_standard.c standard dev/ofw/openfirm.c standard dev/ofw/openfirmio.c standard dev/ofw/openpromio.c standard Added: head/sys/dev/ofw/ofw_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_if.m Sat Dec 20 00:33:10 2008 (r186347) @@ -0,0 +1,357 @@ +#- +# Copyright (c) 2008 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include + +/** + * @defgroup OFW ofw - KObj methods for Open Firmware RTAS implementations + * @brief A set of methods to implement the Open Firmware client side interface. + *@{ + */ + +INTERFACE ofw; + +/** + * @brief Initialize OFW client interface + * + * @param _cookie A handle to the client interface, generally the OF + * callback routine. + */ +METHOD void init { + ofw_t _ofw; + void *_cookie; +}; + +/** + * @brief Return next sibling of node + * + * @param _node Selected node + */ +METHOD phandle_t peer { + ofw_t _ofw; + phandle_t _node; +}; + +/** + * @brief Return parent of node + * + * @param _node Selected node + */ +METHOD phandle_t parent { + ofw_t _ofw; + phandle_t _node; +}; + +/** + * @brief Return first child of node + * + * @param _node Selected node + */ +METHOD phandle_t child { + ofw_t _ofw; + phandle_t _node; +}; + +/** + * @brief Return package corresponding to instance + * + * @param _handle Selected instance + */ +METHOD phandle_t instance_to_package { + ofw_t _ofw; + ihandle_t _handle; +}; + +/** + * @brief Return length of node property + * + * @param _node Selected node + * @param _prop Property name + */ +METHOD ssize_t getproplen { + ofw_t _ofw; + phandle_t _node; + const char *_prop; +}; + +/** + * @brief Read node property + * + * @param _node Selected node + * @param _prop Property name + * @param _buf Pointer to buffer + * @param _size Size of buffer + */ +METHOD ssize_t getprop { + ofw_t _ofw; + phandle_t _node; + const char *_prop; + void *_buf; + size_t _size; +}; + +/** + * @brief Get next property name + * + * @param _node Selected node + * @param _prop Current property name + * @param _buf Buffer for next property name + * @param _size Size of buffer + */ +METHOD int nextprop { + ofw_t _ofw; + phandle_t _node; + const char *_prop; + char *_buf; + size_t _size; +}; + +/** + * @brief Set property + * + * @param _node Selected node + * @param _prop Property name + * @param _buf Value to set + * @param _size Size of buffer + */ +METHOD int setprop { + ofw_t _ofw; + phandle_t _node; + const char *_prop; + const void *_buf; + size_t _size; +}; + +/** + * @brief Canonicalize path + * + * @param _path Path to canonicalize + * @param _buf Buffer for canonicalized path + * @param _size Size of buffer + */ +METHOD ssize_t canon { + ofw_t _ofw; + const char *_path; + char *_buf; + size_t _size; +}; + +/** + * @brief Return phandle for named device + * + * @param _path Device path + */ +METHOD phandle_t finddevice { + ofw_t _ofw; + const char *_path; +}; + +/** + * @brief Return path for node instance + * + * @param _handle Instance handle + * @param _path Buffer for path + * @param _size Size of buffer + */ +METHOD ssize_t instance_to_path { + ofw_t _ofw; + ihandle_t _handle; + char *_path; + size_t _size; +}; + +/** + * @brief Return path for node + * + * @param _node Package node + * @param _path Buffer for path + * @param _size Size of buffer + */ +METHOD ssize_t package_to_path { + ofw_t _ofw; + phandle_t _node; + char *_path; + size_t _size; +}; + + +# Methods for OF method calls (optional) + +/** + * @brief Test to see if a service exists. + * + * @param _name name of the service + */ +METHOD int test { + ofw_t _ofw; + const char *_name; +}; + +/** + * @brief Call method belonging to an instance handle + * + * @param _instance Instance handle + * @param _method Method name + * @param _nargs Number of arguments + * @param _nreturns Number of return values + * @param _args_and_returns Values for arguments, followed by returns + */ + +METHOD int call_method { + ofw_t _ofw; + ihandle_t _instance; + const char *_method; + int _nargs; + int _nreturns; + + unsigned long *_args_and_returns; +}; + +/** + * @brief Interpret a forth command + * + * @param _cmd Command + * @param _nreturns Number of return values + * @param _returns Values for returns + */ + +METHOD int interpret { + ofw_t _ofw; + const char *_cmd; + int _nreturns; + unsigned long *_returns; +}; + +# Device I/O Functions (optional) + +/** + * @brief Open node, returning instance handle + * + * @param _path Path to node + */ +METHOD ihandle_t open { + ofw_t _ofw; + const char *_path; +} + +/** + * @brief Close node instance + * + * @param _instance Instance to close + */ +METHOD void close { + ofw_t _ofw; + ihandle_t _instance; +} + +/** + * @brief Read from device + * + * @param _instance Device instance + * @param _buf Buffer to read to + * @param _size Size of buffer + */ +METHOD ssize_t read { + ofw_t _ofw; + ihandle_t _instance; + void *_buf; + size_t size; +} + +/** + * @brief Write to device + * + * @param _instance Device instance + * @param _buf Buffer to write from + * @param _size Size of buffer + */ +METHOD ssize_t write { + ofw_t _ofw; + ihandle_t _instance; + const void *_buf; + size_t size; +} + +/** + * @brief Seek device + * + * @param _instance Device instance + * @param _off Offset to which to seek + */ +METHOD int seek { + ofw_t _ofw; + ihandle_t _instance; + uint64_t _off; +} + +# Open Firmware memory management + +/** + * @brief Claim virtual memory + * + * @param _addr Requested memory location (NULL for first available) + * @param _size Requested size in bytes + * @param _align Requested alignment + */ +METHOD caddr_t claim { + ofw_t _ofw; + void *_addr; + size_t _size; + u_int _align; +} + +/** + * @brief Release virtual memory + * + * @param _addr Memory location + * @param _size Size in bytes + */ +METHOD void release { + ofw_t _ofw; + void *_addr; + size_t _size; +}; + +# Commands for returning control to the firmware + +/** + * @brief Temporarily return control to firmware + */ +METHOD void enter { + ofw_t _ofw; +}; + +/** + * @brief Halt and return control to firmware + */ +METHOD void exit { + ofw_t _ofw; +}; + + Copied and modified: head/sys/dev/ofw/ofw_standard.c (from r186188, head/sys/dev/ofw/openfirm.c) ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Dec 16 17:04:52 2008 (r186188, copy source) +++ head/sys/dev/ofw/ofw_standard.c Sat Dec 20 00:33:10 2008 (r186347) @@ -66,35 +66,93 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include "ofw_if.h" -MALLOC_DEFINE(M_OFWPROP, "openfirm", "Open Firmware properties"); +static void ofw_std_init(ofw_t ofw, void *openfirm); +static int ofw_std_test(ofw_t ofw, const char *name); +static int ofw_std_interpret(ofw_t ofw, const char *cmd, int nreturns, + unsigned long *returns); +static phandle_t ofw_std_peer(ofw_t ofw, phandle_t node); +static phandle_t ofw_std_child(ofw_t ofw, phandle_t node); +static phandle_t ofw_std_parent(ofw_t ofw, phandle_t node); +static phandle_t ofw_std_instance_to_package(ofw_t ofw, ihandle_t instance); +static ssize_t ofw_std_getproplen(ofw_t ofw, phandle_t package, + const char *propname); +static ssize_t ofw_std_getprop(ofw_t ofw, phandle_t package, + const char *propname, void *buf, size_t buflen); +static int ofw_std_nextprop(ofw_t ofw, phandle_t package, const char *previous, + char *buf, size_t); +static int ofw_std_setprop(ofw_t ofw, phandle_t package, char *propname, + void *buf, size_t len); +static ssize_t ofw_std_canon(ofw_t ofw, const char *device, char *buf, + size_t len); +static phandle_t ofw_std_finddevice(ofw_t ofw, const char *device); +static ssize_t ofw_std_instance_to_path(ofw_t ofw, ihandle_t instance, + char *buf, size_t len); +static ssize_t ofw_std_package_to_path(ofw_t ofw, phandle_t package, char *buf, + size_t len); +static int ofw_std_call_method(ofw_t ofw, ihandle_t instance, + const char *method, int nargs, int nreturns, + unsigned long *args_and_returns); +static ihandle_t ofw_std_open(ofw_t ofw, const char *device); +static void ofw_std_close(ofw_t ofw, ihandle_t instance); +static ssize_t ofw_std_read(ofw_t ofw, ihandle_t instance, void *addr, + size_t len); +static ssize_t ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, + size_t len); +static int ofw_std_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos); +static caddr_t ofw_std_claim(ofw_t ofw, void *virt, size_t size, u_int align); +static void ofw_std_release(ofw_t ofw, void *virt, size_t size); +static void ofw_std_enter(ofw_t ofw); +static void ofw_std_exit(ofw_t ofw); + +static ofw_method_t ofw_std_methods[] = { + OFWMETHOD(ofw_init, ofw_std_init), + OFWMETHOD(ofw_peer, ofw_std_peer), + OFWMETHOD(ofw_child, ofw_std_child), + OFWMETHOD(ofw_parent, ofw_std_parent), + OFWMETHOD(ofw_instance_to_package, ofw_std_instance_to_package), + OFWMETHOD(ofw_getproplen, ofw_std_getproplen), + OFWMETHOD(ofw_getprop, ofw_std_getprop), + OFWMETHOD(ofw_nextprop, ofw_std_nextprop), + OFWMETHOD(ofw_setprop, ofw_std_setprop), + OFWMETHOD(ofw_canon, ofw_std_canon), + OFWMETHOD(ofw_finddevice, ofw_std_finddevice), + OFWMETHOD(ofw_instance_to_path, ofw_std_instance_to_path), + OFWMETHOD(ofw_package_to_path, ofw_std_package_to_path), + + OFWMETHOD(ofw_test, ofw_std_test), + OFWMETHOD(ofw_call_method, ofw_std_call_method), + OFWMETHOD(ofw_interpret, ofw_std_interpret), + OFWMETHOD(ofw_open, ofw_std_open), + OFWMETHOD(ofw_close, ofw_std_close), + OFWMETHOD(ofw_read, ofw_std_read), + OFWMETHOD(ofw_write, ofw_std_write), + OFWMETHOD(ofw_seek, ofw_std_seek), + OFWMETHOD(ofw_claim, ofw_std_claim), + OFWMETHOD(ofw_release, ofw_std_release), + OFWMETHOD(ofw_enter, ofw_std_enter), + OFWMETHOD(ofw_exit, ofw_std_exit), + + { 0, 0 } +}; + +static ofw_def_t ofw_std = { + OFW_STD_DIRECT, + ofw_std_methods, + 0 +}; +OFW_DEF(ofw_std); -static ihandle_t stdout; +static int (*openfirmware)(void *); /* Initialiser */ -void -OF_init(int (*openfirm)(void *)) +static void +ofw_std_init(ofw_t ofw, void *openfirm) { - phandle_t chosen; - - set_openfirm_callback(openfirm); - if ((chosen = OF_finddevice("/chosen")) == -1) - OF_exit(); - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) - OF_exit(); -} - -void -OF_printf(const char *fmt, ...) -{ - va_list va; - char buf[1024]; - - va_start(va, fmt); - vsprintf(buf, fmt, va); - OF_write(stdout, buf, strlen(buf)); - va_end(va); + openfirmware = (int (*)(void *))openfirm; } /* @@ -102,8 +160,8 @@ OF_printf(const char *fmt, ...) */ /* Test to see if a service exists. */ -int -OF_test(char *name) +static int +ofw_std_test(ofw_t ofw, const char *name) { static struct { cell_t name; @@ -123,10 +181,10 @@ OF_test(char *name) return (args.missing); } -int -OF_interpret(char *cmd, int nreturns, ...) +static int +ofw_std_interpret(ofw_t ofw, const char *cmd, int nreturns, + unsigned long *returns) { - va_list ap; static struct { cell_t name; cell_t nargs; @@ -137,50 +195,26 @@ OF_interpret(char *cmd, int nreturns, .. 1, }; cell_t status; - int i = 0; + int i = 0, j = 0; - va_start(ap, nreturns); args.nreturns = ++nreturns; args.slot[i++] = (cell_t)cmd; - while (i < 1) - args.slot[i++] = va_arg(ap, cell_t); if (openfirmware(&args) == -1) { - va_end(ap); return (-1); } status = args.slot[i++]; while (i < 1 + nreturns) - *va_arg(ap, cell_t *) = args.slot[i++]; - va_end(ap); + returns[j] = args.slot[i++]; return (status); } -/* Return firmware millisecond count. */ -int -OF_milliseconds() -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t ms; - } args = { - (cell_t)"milliseconds", - 0, - 1, - }; - - openfirmware(&args); - return (args.ms); -} - /* * Device tree functions */ /* Return the next sibling of this node or 0. */ -phandle_t -OF_peer(phandle_t node) +static phandle_t +ofw_std_peer(ofw_t ofw, phandle_t node) { static struct { cell_t name; @@ -201,8 +235,8 @@ OF_peer(phandle_t node) } /* Return the first child of this node or 0. */ -phandle_t -OF_child(phandle_t node) +static phandle_t +ofw_std_child(ofw_t ofw, phandle_t node) { static struct { cell_t name; @@ -223,8 +257,8 @@ OF_child(phandle_t node) } /* Return the parent of this node or 0. */ -phandle_t -OF_parent(phandle_t node) +static phandle_t +ofw_std_parent(ofw_t ofw, phandle_t node) { static struct { cell_t name; @@ -245,8 +279,8 @@ OF_parent(phandle_t node) } /* Return the package handle that corresponds to an instance handle. */ -phandle_t -OF_instance_to_package(ihandle_t instance) +static phandle_t +ofw_std_instance_to_package(ofw_t ofw, ihandle_t instance) { static struct { cell_t name; @@ -267,8 +301,8 @@ OF_instance_to_package(ihandle_t instanc } /* Get the length of a property of a package. */ -int -OF_getproplen(phandle_t package, char *propname) +static ssize_t +ofw_std_getproplen(ofw_t ofw, phandle_t package, const char *propname) { static struct { cell_t name; @@ -291,8 +325,9 @@ OF_getproplen(phandle_t package, char *p } /* Get the value of a property of a package. */ -int -OF_getprop(phandle_t package, char *propname, void *buf, int buflen) +static ssize_t +ofw_std_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, + size_t buflen) { static struct { cell_t name; @@ -318,33 +353,10 @@ OF_getprop(phandle_t package, char *prop return (args.size); } -/* - * Store the value of a property of a package into newly allocated memory - * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a - * single element, the number of elements is return in number. - */ -int -OF_getprop_alloc(phandle_t package, char *propname, int elsz, void **buf) -{ - int len; - - *buf = NULL; - if ((len = OF_getproplen(package, propname)) == -1 || - len % elsz != 0) - return (-1); - - *buf = malloc(len, M_OFWPROP, M_WAITOK); - if (OF_getprop(package, propname, *buf, len) == -1) { - free(*buf, M_OFWPROP); - *buf = NULL; - return (-1); - } - return (len / elsz); -} - /* Get the next property of a package. */ -int -OF_nextprop(phandle_t package, char *previous, char *buf) +static int +ofw_std_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, + size_t size) { static struct { cell_t name; @@ -370,8 +382,9 @@ OF_nextprop(phandle_t package, char *pre /* Set the value of a property of a package. */ /* XXX Has a bug on FirePower */ -int -OF_setprop(phandle_t package, char *propname, void *buf, int len) +static int +ofw_std_setprop(ofw_t ofw, phandle_t package, char *propname, void *buf, + size_t len) { static struct { cell_t name; @@ -398,8 +411,8 @@ OF_setprop(phandle_t package, char *prop } /* Convert a device specifier to a fully qualified pathname. */ -int -OF_canon(const char *device, char *buf, int len) +static ssize_t +ofw_std_canon(ofw_t ofw, const char *device, char *buf, size_t len) { static struct { cell_t name; @@ -424,8 +437,8 @@ OF_canon(const char *device, char *buf, } /* Return a package handle for the specified device. */ -phandle_t -OF_finddevice(const char *device) +static phandle_t +ofw_std_finddevice(ofw_t ofw, const char *device) { static struct { cell_t name; @@ -446,8 +459,8 @@ OF_finddevice(const char *device) } /* Return the fully qualified pathname corresponding to an instance. */ -int -OF_instance_to_path(ihandle_t instance, char *buf, int len) +static ssize_t +ofw_std_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len) { static struct { cell_t name; @@ -472,8 +485,8 @@ OF_instance_to_path(ihandle_t instance, } /* Return the fully qualified pathname corresponding to a package. */ -int -OF_package_to_path(phandle_t package, char *buf, int len) +static ssize_t +ofw_std_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) { static struct { cell_t name; @@ -498,10 +511,10 @@ OF_package_to_path(phandle_t package, ch } /* Call the method in the scope of a given instance. */ -int -OF_call_method(char *method, ihandle_t instance, int nargs, int nreturns, ...) +static int +ofw_std_call_method(ofw_t ofw, ihandle_t instance, const char *method, + int nargs, int nreturns, unsigned long *args_and_returns) { - va_list ap; static struct { cell_t name; cell_t nargs; @@ -515,6 +528,7 @@ OF_call_method(char *method, ihandle_t i 1, }; cell_t *cp; + unsigned long *ap; int n; if (nargs > 6) @@ -523,16 +537,16 @@ OF_call_method(char *method, ihandle_t i args.nreturns = nreturns + 1; args.method = (cell_t)method; args.instance = instance; - va_start(ap, nreturns); + + ap = args_and_returns; for (cp = args.args_n_results + (n = nargs); --n >= 0;) - *--cp = va_arg(ap, cell_t); + *--cp = *(ap++); if (openfirmware(&args) == -1) return (-1); if (args.args_n_results[nargs]) return (args.args_n_results[nargs]); for (cp = args.args_n_results + nargs + (n = args.nreturns); --n > 0;) - *va_arg(ap, cell_t *) = *--cp; - va_end(ap); + *(ap++) = *--cp; return (0); } @@ -541,8 +555,8 @@ OF_call_method(char *method, ihandle_t i */ /* Open an instance for a device. */ -ihandle_t -OF_open(char *device) +static ihandle_t +ofw_std_open(ofw_t ofw, const char *device) { static struct { cell_t name; @@ -564,8 +578,8 @@ OF_open(char *device) } /* Close an instance. */ -void -OF_close(ihandle_t instance) +static void +ofw_std_close(ofw_t ofw, ihandle_t instance) { static struct { cell_t name; @@ -582,8 +596,8 @@ OF_close(ihandle_t instance) } /* Read from an instance. */ -int -OF_read(ihandle_t instance, void *addr, int len) +static ssize_t +ofw_std_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len) { static struct { cell_t name; @@ -609,8 +623,8 @@ OF_read(ihandle_t instance, void *addr, } /* Write to an instance. */ -int -OF_write(ihandle_t instance, void *addr, int len) +static ssize_t +ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len) { static struct { cell_t name; @@ -635,8 +649,8 @@ OF_write(ihandle_t instance, void *addr, } /* Seek to a position. */ -int -OF_seek(ihandle_t instance, u_int64_t pos) +static int +ofw_std_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos) { static struct { cell_t name; @@ -665,8 +679,8 @@ OF_seek(ihandle_t instance, u_int64_t po */ /* Claim an area of memory. */ -void * -OF_claim(void *virt, u_int size, u_int align) +static caddr_t +ofw_std_claim(ofw_t ofw, void *virt, size_t size, u_int align) { static struct { cell_t name; @@ -691,8 +705,8 @@ OF_claim(void *virt, u_int size, u_int a } /* Release an area of memory. */ -void -OF_release(void *virt, u_int size) +static void +ofw_std_release(ofw_t ofw, void *virt, size_t size) { static struct { cell_t name; @@ -714,29 +728,9 @@ OF_release(void *virt, u_int size) * Control transfer functions */ -/* Reset the system and call "boot ". */ -void -OF_boot(char *bootspec) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t bootspec; - } args = { - (cell_t)"boot", - 1, - }; - - args.bootspec = (cell_t)bootspec; - openfirmware(&args); - for (;;) /* just in case */ - ; -} - /* Suspend and drop back to the Open Firmware interface. */ -void -OF_enter() +static void +ofw_std_enter(ofw_t ofw) { static struct { cell_t name; @@ -751,8 +745,8 @@ OF_enter() } /* Shut down and drop back to the Open Firmware interface. */ -void -OF_exit() +static void +ofw_std_exit(ofw_t ofw) { static struct { cell_t name; @@ -767,44 +761,3 @@ OF_exit() ; } -/* Free bytes starting at , then call with . */ -#if 0 -void -OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len) -{ - static struct { - cell_t name; - cell_t nargs; - cell_t nreturns; - cell_t virt; - cell_t size; - cell_t entry; - cell_t arg; - cell_t len; - } args = { - (cell_t)"chain", - 5, - }; - - args.virt = (cell_t)virt; - args.size = size; - args.entry = (cell_t)entry; - args.arg = (cell_t)arg; - args.len = len; - openfirmware(&args); -} -#else -void -OF_chain(void *virt, u_int size, - void (*entry)(void *, u_int, void *, void *, u_int), void *arg, u_int len) -{ - /* - * This is a REALLY dirty hack till the firmware gets this going - */ -#if 0 - if (size > 0) - OF_release(virt, size); -#endif - entry(0, 0, openfirmware, arg, len); -} -#endif Added: head/sys/dev/ofw/ofwvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofwvar.h Sat Dec 20 00:33:10 2008 (r186347) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2005 Peter Grehan + * Copyright (c) 2008 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OFW_OFWVAR_H_ +#define _OFW_OFWVAR_H_ + +/* + * An Open Firmware client implementation is declared with a kernel object and + * an associated method table, similar to a device driver. + * + * e.g. + * + * static ofw_method_t fdt_methods[] = { + * OFWMETHOD(ofw_init, fdt_init), + * OFWMETHOD(ofw_finddevice, fdt_finddevice), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:37:03 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9B991065670; Sat, 20 Dec 2008 00:37:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF6D8FC16; Sat, 20 Dec 2008 00:37:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id BA08E5823C; Fri, 19 Dec 2008 18:37:02 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 1oQmPXhMifEb; Fri, 19 Dec 2008 18:37:02 -0600 (CST) Received: from wanderer.tachypleus.net (c-71-234-177-38.hsd1.ct.comcast.net [71.234.177.38]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 5CB905823A; Fri, 19 Dec 2008 18:37:02 -0600 (CST) Message-ID: <494C3E1B.90408@freebsd.org> Date: Fri, 19 Dec 2008 18:36:43 -0600 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.18 (X11/20081126) MIME-Version: 1.0 To: Nathan Whitehorn References: <200812200033.mBK0XAwm086785@svn.freebsd.org> In-Reply-To: <200812200033.mBK0XAwm086785@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186347 - in head/sys: conf dev/ofw kern powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/include sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 00:37:03 -0000 Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Dec 20 00:33:10 2008 > New Revision: 186347 > URL: http://svn.freebsd.org/changeset/base/186347 > > Log: > Modularize the Open Firmware client interface to allow run-time switching > of OFW access semantics, in order to allow future support for real-mode > OF access and flattened device frees. OF client interface modules are > implemented using KOBJ, in a similar way to the PPC PMAP modules. > > s/frees/trees, of course. I must have been looking at my screen from too far away. -Nathan From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:42:00 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 116651065673; Sat, 20 Dec 2008 00:42:00 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id E54C78FC1D; Sat, 20 Dec 2008 00:41:59 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id mBK0fxhd015393; Fri, 19 Dec 2008 16:41:59 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id mBK0fxCd015392; Fri, 19 Dec 2008 16:41:59 -0800 (PST) (envelope-from obrien) Date: Fri, 19 Dec 2008 16:41:59 -0800 From: "David O'Brien" To: Sam Leffler Message-ID: <20081220004159.GA15252@dragon.NUXI.org> References: <200812191847.mBJIlkAn080000@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812191847.mBJIlkAn080000@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186335 - head/usr.sbin/makefs projects/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 00:42:00 -0000 On Fri, Dec 19, 2008 at 06:47:46PM +0000, Sam Leffler wrote: > Author: sam > Date: Fri Dec 19 18:47:46 2008 > New Revision: 186335 > URL: http://svn.freebsd.org/changeset/base/186335 > > Log: > import netbsd makefs tool Sam, When something is merged from a project branch, it would be nice to give a more complete description for those that aren't NetBSD users. ("import" also means something with FreeBSD - imported into a vendor tree, since that didn't happen here, it would be nice to not use this term in this context.) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 00:45:52 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99AE51065670; Sat, 20 Dec 2008 00:45:52 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 60BA08FC13; Sat, 20 Dec 2008 00:45:52 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.2/8.14.2) with ESMTP id mBK0jquR015579; Fri, 19 Dec 2008 16:45:52 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.2/8.14.2/Submit) id mBK0jqt2015578; Fri, 19 Dec 2008 16:45:52 -0800 (PST) (envelope-from obrien) Date: Fri, 19 Dec 2008 16:45:51 -0800 From: "David O'Brien" To: Sam Leffler Message-ID: <20081220004551.GA15523@dragon.NUXI.org> References: <200812191847.mBJIlkAn080000@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812191847.mBJIlkAn080000@svn.freebsd.org> X-Operating-System: FreeBSD 8.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186335 - head/usr.sbin/makefs projects/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 00:45:52 -0000 On Fri, Dec 19, 2008 at 06:47:46PM +0000, Sam Leffler wrote: > Author: sam > Date: Fri Dec 19 18:47:46 2008 > New Revision: 186335 > URL: http://svn.freebsd.org/changeset/base/186335 > Log: > import netbsd makefs tool Sam, Do you have plans to MFC this? If not, are there any gotchas if I MFC it to RELENG_7 after the 7.1 release? -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 01:05:29 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E89D01065670; Sat, 20 Dec 2008 01:05:29 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id BA4658FC13; Sat, 20 Dec 2008 01:05:29 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id mBK15Sao041529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Dec 2008 17:05:29 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <494C44D8.5080507@freebsd.org> Date: Fri, 19 Dec 2008 17:05:28 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: obrien@freebsd.org References: <200812191847.mBJIlkAn080000@svn.freebsd.org> <20081220004159.GA15252@dragon.NUXI.org> In-Reply-To: <20081220004159.GA15252@dragon.NUXI.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186335 - head/usr.sbin/makefs projects/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 01:05:30 -0000 David O'Brien wrote: > On Fri, Dec 19, 2008 at 06:47:46PM +0000, Sam Leffler wrote: > >> Author: sam >> Date: Fri Dec 19 18:47:46 2008 >> New Revision: 186335 >> URL: http://svn.freebsd.org/changeset/base/186335 >> >> Log: >> import netbsd makefs tool >> > > Sam, > When something is merged from a project branch, it would be nice to give > a more complete description for those that aren't NetBSD users. > > ("import" also means something with FreeBSD - imported into a vendor > tree, since that didn't happen here, it would be nice to not use this term > in this context.) > > There's always man makefs but next time I will. > Do you have plans to MFC this? If not, are there any gotchas if I MFC it > to RELENG_7 after the 7.1 release? > I will MFC it once RELENG_7 opens and the code has had some testing. Sam From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 03:02:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A105B106564A; Sat, 20 Dec 2008 03:02:32 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BFAB8FC08; Sat, 20 Dec 2008 03:02:32 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK32W2o090073; Sat, 20 Dec 2008 03:02:32 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK32WAm090069; Sat, 20 Dec 2008 03:02:32 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812200302.mBK32WAm090069@svn.freebsd.org> From: Sam Leffler Date: Sat, 20 Dec 2008 03:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186351 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 03:02:32 -0000 Author: sam Date: Sat Dec 20 03:02:32 2008 New Revision: 186351 URL: http://svn.freebsd.org/changeset/base/186351 Log: Merge usb changes for Gateworks Cambria boards: o add support to byte swap EHCI descriptor contents; the IXP435 has dual-EHCI controllers integral but descriptor contents are in big-endian format; this support is configured with the USB_EHCI_BIG_ENDIAN_DESC option and enabled with EHCI_SCFLG_BIGEDESC o clean up EHCI USBMODE register setup during init; add #defines for bit values o split debug support out into a new file and enable use through ddb o while here remove a bunch of lingering netbsd-isms Reviewed by: imp Added: head/sys/dev/usb/ehci_ddb.c - copied unchanged from r186349, projects/cambria/sys/dev/usb/ehci_ddb.c Modified: head/sys/conf/files head/sys/conf/options head/sys/dev/usb/ehci.c head/sys/dev/usb/ehci_pci.c head/sys/dev/usb/ehcireg.h head/sys/dev/usb/ehcivar.h head/sys/dev/usb/usbdi.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 20 02:45:42 2008 (r186350) +++ head/sys/conf/files Sat Dec 20 03:02:32 2008 (r186351) @@ -1476,6 +1476,7 @@ dev/ubsec/ubsec.c optional ubsec # # USB support dev/usb/ehci.c optional ehci +dev/usb/ehci_ddb.c optional ehci dev/usb/ehci_pci.c optional ehci pci dev/usb/hid.c optional usb dev/usb/if_aue.c optional aue Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Dec 20 02:45:42 2008 (r186350) +++ head/sys/conf/options Sat Dec 20 03:02:32 2008 (r186351) @@ -627,6 +627,7 @@ BUS_DEBUG opt_bus.h # options for USB support USB_DEBUG opt_usb.h USBVERBOSE opt_usb.h +USB_EHCI_BIG_ENDIAN_DESC opt_usb.h U3G_DEBUG opt_u3g.h UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h Modified: head/sys/dev/usb/ehci.c ============================================================================== --- head/sys/dev/usb/ehci.c Sat Dec 20 02:45:42 2008 (r186350) +++ head/sys/dev/usb/ehci.c Sat Dec 20 03:02:32 2008 (r186351) @@ -99,7 +99,6 @@ int ehcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, &ehcidebug, 0, "ehci debug level"); -#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f)) #else #define DPRINTF(x) #define DPRINTFN(n,x) @@ -221,34 +220,20 @@ static usbd_status ehci_device_request(u static usbd_status ehci_device_setintr(ehci_softc_t *, ehci_soft_qh_t *, int ival); -static void ehci_add_qh(ehci_soft_qh_t *, ehci_soft_qh_t *); +static void ehci_add_qh(ehci_softc_t *, ehci_soft_qh_t *, + ehci_soft_qh_t *); static void ehci_rem_qh(ehci_softc_t *, ehci_soft_qh_t *, ehci_soft_qh_t *); -static void ehci_activate_qh(ehci_soft_qh_t *, ehci_soft_qtd_t *); +static void ehci_activate_qh(ehci_softc_t *sc, ehci_soft_qh_t *, + ehci_soft_qtd_t *); static void ehci_sync_hc(ehci_softc_t *); static void ehci_close_pipe(usbd_pipe_handle, ehci_soft_qh_t *); static void ehci_abort_xfer(usbd_xfer_handle, usbd_status); -#ifdef EHCI_DEBUG -static void ehci_dump_regs(ehci_softc_t *); -void ehci_dump(void); -static ehci_softc_t *theehci; -static void ehci_dump_link(ehci_link_t, int); -static void ehci_dump_sqtds(ehci_soft_qtd_t *); -static void ehci_dump_sqtd(ehci_soft_qtd_t *); -static void ehci_dump_qtd(ehci_qtd_t *); -static void ehci_dump_sqh(ehci_soft_qh_t *); -#ifdef notyet -static void ehci_dump_sitd(struct ehci_soft_itd *); -static void ehci_dump_itd(struct ehci_soft_itd *); -#endif -#ifdef DIAGNOSTIC -static void ehci_dump_exfer(struct ehci_xfer *); -#endif -#endif +ehci_softc_t *theehci; -#define EHCI_NULL htole32(EHCI_LINK_TERMINATE) +#define EHCI_NULL(sc) htohc32(sc, EHCI_LINK_TERMINATE) #define EHCI_INTR_ENDPT 1 @@ -344,17 +329,26 @@ ehci_hcreset(ehci_softc_t *sc) * Table 2-9 in the EHCI spec says this will result * in undefined behavior. */ - printf("%s: stop timeout\n", - device_get_nameunit(sc->sc_bus.bdev)); + device_printf(sc->sc_bus.bdev, "stop timeout\n"); EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); for (i = 0; i < 100; i++) { usb_delay_ms(&sc->sc_bus, 1); hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET; if (!hcr) { - if (sc->sc_flags & EHCI_SCFLG_SETMODE) - EOWRITE4(sc, 0x68, 0x3); - + if (sc->sc_flags & EHCI_SCFLG_SETMODE) { + /* + * Force USBMODE as requested. Controllers + * may have multiple operating modes. + */ + uint32_t usbmode = EOREAD4(sc, EHCI_USBMODE); + if (sc->sc_flags & EHCI_SCFLG_SETMODE) { + usbmode = (usbmode &~ EHCI_UM_CM) | EHCI_UM_CM_HOST; + device_printf(sc->sc_bus.bdev, + "set host controller mode\n"); + } + EOWRITE4(sc, EHCI_USBMODE, usbmode); + } return (USBD_NORMAL_COMPLETION); } } @@ -377,10 +371,12 @@ ehci_init(ehci_softc_t *sc) theehci = sc; #endif + /* NB: must handle byte-order manually before ehci_hcreset */ + sc->sc_offs = EREAD1(sc, EHCI_CAPLENGTH); version = EREAD2(sc, EHCI_HCIVERSION); - printf("%s: EHCI version %x.%x\n", device_get_nameunit(sc->sc_bus.bdev), + device_printf(sc->sc_bus.bdev, "EHCI version %x.%x\n", version >> 8, version & 0xff); sparams = EREAD4(sc, EHCI_HCSPARAMS); @@ -435,7 +431,7 @@ ehci_init(ehci_softc_t *sc) sc->sc_flist = KERNADDR(&sc->sc_fldma, 0); for (i = 0; i < sc->sc_flsize; i++) { - sc->sc_flist[i] = EHCI_NULL; + sc->sc_flist[i] = EHCI_NULL(sc); } EOWRITE4(sc, EHCI_PERIODICLISTBASE, DMAADDR(&sc->sc_fldma, 0)); @@ -450,11 +446,6 @@ ehci_init(ehci_softc_t *sc) sc->sc_bus.methods = &ehci_bus_methods; sc->sc_bus.pipe_size = sizeof(struct ehci_pipe); -#if defined(__NetBSD__) || defined(__OpenBSD__) - sc->sc_powerhook = powerhook_establish(ehci_power, sc); - sc->sc_shutdownhook = shutdownhook_establish(ehci_shutdown, sc); -#endif - sc->sc_eintrs = EHCI_NORMAL_INTRS; /* @@ -476,27 +467,26 @@ ehci_init(ehci_softc_t *sc) sqh = sc->sc_islots[i].sqh; if (i == 0) { /* The last (1ms) QH terminates. */ - sqh->qh.qh_link = EHCI_NULL; + sqh->qh.qh_link = EHCI_NULL(sc); sqh->next = NULL; } else { /* Otherwise the next QH has half the poll interval */ sqh->next = sc->sc_islots[EHCI_IQHIDX(lev - 1, i + 1)].sqh; - sqh->qh.qh_link = htole32(sqh->next->physaddr | + sqh->qh.qh_link = htohc32(sc, sqh->next->physaddr | EHCI_LINK_QH); } - sqh->qh.qh_endp = htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH)); - sqh->qh.qh_endphub = htole32(EHCI_QH_SET_MULT(1)); - sqh->qh.qh_curqtd = EHCI_NULL; - sqh->qh.qh_qtd.qtd_next = EHCI_NULL; - sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; - sqh->qh.qh_qtd.qtd_status = htole32(EHCI_QTD_HALTED); + sqh->qh.qh_endp = htohc32(sc, EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH)); + sqh->qh.qh_endphub = htohc32(sc, EHCI_QH_SET_MULT(1)); + sqh->qh.qh_curqtd = EHCI_NULL(sc); + sqh->qh.qh_qtd.qtd_next = EHCI_NULL(sc); + sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL(sc); + sqh->qh.qh_qtd.qtd_status = htohc32(sc, EHCI_QTD_HALTED); } /* Point the frame list at the last level (128ms). */ for (i = 0; i < sc->sc_flsize; i++) { - sc->sc_flist[i] = htole32(EHCI_LINK_QH | - sc->sc_islots[EHCI_IQHIDX(EHCI_IPOLLRATES - 1, - i)].sqh->physaddr); + sc->sc_flist[i] = htohc32(sc, EHCI_LINK_QH | + sc->sc_islots[EHCI_IQHIDX(EHCI_IPOLLRATES - 1, i)].sqh->physaddr); } /* Allocate dummy QH that starts the async list. */ @@ -507,19 +497,19 @@ ehci_init(ehci_softc_t *sc) } /* Fill the QH */ sqh->qh.qh_endp = - htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | EHCI_QH_HRECL); + htohc32(sc, EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH) | EHCI_QH_HRECL); sqh->qh.qh_link = - htole32(sqh->physaddr | EHCI_LINK_QH); - sqh->qh.qh_curqtd = EHCI_NULL; + htohc32(sc, sqh->physaddr | EHCI_LINK_QH); + sqh->qh.qh_curqtd = EHCI_NULL(sc); sqh->prev = sqh; /*It's a circular list.. */ sqh->next = sqh; /* Fill the overlay qTD */ - sqh->qh.qh_qtd.qtd_next = EHCI_NULL; - sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; - sqh->qh.qh_qtd.qtd_status = htole32(0); + sqh->qh.qh_qtd.qtd_next = EHCI_NULL(sc); + sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL(sc); + sqh->qh.qh_qtd.qtd_status = htohc32(sc, 0); #ifdef EHCI_DEBUG if (ehcidebug) { - ehci_dump_sqh(sqh); + ehci_dump_sqh(sc, sqh); } #endif @@ -777,10 +767,10 @@ ehci_check_qh_intr(ehci_softc_t *sc, str * is a an error somewhere in the middle, or whether there was a * short packet (SPD and not ACTIVE). */ - if (le32toh(lsqtd->qtd.qtd_status) & EHCI_QTD_ACTIVE) { + if (hc32toh(sc, lsqtd->qtd.qtd_status) & EHCI_QTD_ACTIVE) { DPRINTFN(12, ("ehci_check_intr: active ex=%p\n", ex)); for (sqtd = ex->sqtdstart; sqtd != lsqtd; sqtd=sqtd->nextqtd) { - status = le32toh(sqtd->qtd.qtd_status); + status = hc32toh(sc, sqtd->qtd.qtd_status); /* If there's an active QTD the xfer isn't done. */ if (status & EHCI_QTD_ACTIVE) break; @@ -825,7 +815,7 @@ ehci_check_itd_intr(ehci_softc_t *sc, st * Step 1, check no active transfers in last itd, meaning we're finished */ for (i = 0; i < 8; i++) { - if (le32toh(itd->itd.itd_ctl[i]) & EHCI_ITD_ACTIVE) + if (hc32toh(sc, itd->itd.itd_ctl[i]) & EHCI_ITD_ACTIVE) break; } @@ -841,7 +831,7 @@ ehci_check_itd_intr(ehci_softc_t *sc, st for (itd = ex->itdstart; itd != ex->itdend; itd = itd->xfer_next) { for (i = 0; i < 8; i++) { - if (le32toh(itd->itd.itd_ctl[i]) & (EHCI_ITD_BUF_ERR | + if (hc32toh(sc, itd->itd.itd_ctl[i]) & (EHCI_ITD_BUF_ERR | EHCI_ITD_BABBLE | EHCI_ITD_ERROR)) break; } @@ -865,6 +855,7 @@ ehci_idone(struct ehci_xfer *ex) { usbd_xfer_handle xfer = &ex->xfer; struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe; + ehci_softc_t *sc = (ehci_softc_t *)epipe->pipe.device->bus; ehci_soft_qtd_t *sqtd, *lsqtd; u_int32_t status = 0, nstatus = 0; ehci_physaddr_t nextphys, altnextphys; @@ -878,7 +869,7 @@ ehci_idone(struct ehci_xfer *ex) splx(s); #ifdef EHCI_DEBUG printf("ehci_idone: ex is done!\n "); - ehci_dump_exfer(ex); + ehci_dump_exfer(sc, ex); #else printf("ehci_idone: ex=%p is done!\n", ex); #endif @@ -898,7 +889,7 @@ ehci_idone(struct ehci_xfer *ex) #ifdef EHCI_DEBUG DPRINTFN(/*10*/2, ("ehci_idone: xfer=%p, pipe=%p ready\n", xfer, epipe)); if (ehcidebug > 10) - ehci_dump_sqtds(ex->sqtdstart); + ehci_dump_sqtds(sc, ex->sqtdstart); #endif /* @@ -906,14 +897,14 @@ ehci_idone(struct ehci_xfer *ex) * of the qTDs we are about to free. This is probably only * necessary if the transfer is marked as HALTED. */ - nextphys = EHCI_LINK_ADDR(le32toh(epipe->sqh->qh.qh_qtd.qtd_next)); + nextphys = EHCI_LINK_ADDR(hc32toh(sc, epipe->sqh->qh.qh_qtd.qtd_next)); altnextphys = - EHCI_LINK_ADDR(le32toh(epipe->sqh->qh.qh_qtd.qtd_altnext)); + EHCI_LINK_ADDR(hc32toh(sc, epipe->sqh->qh.qh_qtd.qtd_altnext)); for (sqtd = ex->sqtdstart; sqtd != ex->sqtdend->nextqtd; sqtd = sqtd->nextqtd) { if (sqtd->physaddr == nextphys) { epipe->sqh->qh.qh_qtd.qtd_next = - htole32(ex->sqtdend->nextqtd->physaddr); + htohc32(sc, ex->sqtdend->nextqtd->physaddr); DPRINTFN(4, ("ehci_idone: updated overlay next ptr\n")); } @@ -921,7 +912,7 @@ ehci_idone(struct ehci_xfer *ex) DPRINTFN(4, ("ehci_idone: updated overlay altnext ptr\n")); epipe->sqh->qh.qh_qtd.qtd_altnext = - htole32(ex->sqtdend->nextqtd->physaddr); + htohc32(sc, ex->sqtdend->nextqtd->physaddr); } } @@ -964,7 +955,7 @@ ehci_idone(struct ehci_xfer *ex) if (nframes >= xfer->nframes) break; - status = le32toh(itd->itd.itd_ctl[i]); + status = hc32toh(sc, itd->itd.itd_ctl[i]); len = EHCI_ITD_GET_LEN(status); xfer->frlengths[nframes++] = len; actlen += len; @@ -984,7 +975,7 @@ ehci_idone(struct ehci_xfer *ex) actlen = 0; for (sqtd = ex->sqtdstart; sqtd != lsqtd->nextqtd; sqtd =sqtd->nextqtd) { - nstatus = le32toh(sqtd->qtd.qtd_status); + nstatus = hc32toh(sc, sqtd->qtd.qtd_status); if (nstatus & EHCI_QTD_ACTIVE) break; @@ -1001,24 +992,11 @@ ehci_idone(struct ehci_xfer *ex) "status=0x%x\n", xfer->length, actlen, cerr, status)); xfer->actlen = actlen; if ((status & EHCI_QTD_HALTED) != 0) { -#ifdef EHCI_DEBUG - char sbuf[128]; - - bitmask_snprintf((u_int32_t)status, - "\20\7HALTED\6BUFERR\5BABBLE\4XACTERR" - "\3MISSED\2SPLIT\1PING", sbuf, sizeof(sbuf)); - DPRINTFN(2, - ("ehci_idone: error, addr=%d, endpt=0x%02x, " - "status 0x%s\n", + ("ehci_idone: error, addr=%d, endpt=0x%02x, status %b\n", xfer->pipe->device->address, xfer->pipe->endpoint->edesc->bEndpointAddress, - sbuf)); - if (ehcidebug > 2) { - ehci_dump_sqh(epipe->sqh); - ehci_dump_sqtds(ex->sqtdstart); - } -#endif + status, EHCI_QTD_STATUS_BITS)); if ((status & EHCI_QTD_BABBLE) == 0 && cerr > 0) xfer->status = USBD_STALLED; else @@ -1026,6 +1004,12 @@ ehci_idone(struct ehci_xfer *ex) } else { xfer->status = USBD_NORMAL_COMPLETION; } +#ifdef EHCI_DEBUG + if (ehcidebug > 2) { + ehci_dump_sqh(sc, epipe->sqh); + ehci_dump_sqtds(sc, ex->sqtdstart); + } +#endif end: /* XXX transfer_complete memcpys out transfer data (for in endpoints) * during this call, before methods->done is called: dma sync required @@ -1102,12 +1086,6 @@ ehci_detach(struct ehci_softc *sc, int f (void) ehci_hcreset(sc); callout_stop(&sc->sc_tmo_intrlist); -#if defined(__NetBSD__) || defined(__OpenBSD__) - if (sc->sc_powerhook != NULL) - powerhook_disestablish(sc->sc_powerhook); - if (sc->sc_shutdownhook != NULL) - shutdownhook_disestablish(sc->sc_shutdownhook); -#endif usb_delay_ms(&sc->sc_bus, 300); /* XXX let stray task complete */ usb_freemem(&sc->sc_bus, &sc->sc_fldma); @@ -1337,6 +1315,7 @@ static void ehci_device_clear_toggle(usbd_pipe_handle pipe) { struct ehci_pipe *epipe = (struct ehci_pipe *)pipe; + ehci_softc_t *sc = (ehci_softc_t *)epipe->pipe.device->bus; DPRINTF(("ehci_device_clear_toggle: epipe=%p status=0x%x\n", epipe, epipe->sqh->qh.qh_qtd.qtd_status)); @@ -1345,9 +1324,9 @@ ehci_device_clear_toggle(usbd_pipe_handl usbd_dump_pipe(pipe); #endif KASSERT((epipe->sqh->qh.qh_qtd.qtd_status & - htole32(EHCI_QTD_ACTIVE)) == 0, + htohc32(sc, EHCI_QTD_ACTIVE)) == 0, ("ehci_device_clear_toggle: queue active")); - epipe->sqh->qh.qh_qtd.qtd_status &= htole32(~EHCI_QTD_TOGGLE_MASK); + epipe->sqh->qh.qh_qtd.qtd_status &= htohc32(sc, ~EHCI_QTD_TOGGLE_MASK); } static void @@ -1355,178 +1334,6 @@ ehci_noop(usbd_pipe_handle pipe) { } -#ifdef EHCI_DEBUG -void -ehci_dump_regs(ehci_softc_t *sc) -{ - int i; - printf("cmd=0x%08x, sts=0x%08x, ien=0x%08x\n", - EOREAD4(sc, EHCI_USBCMD), - EOREAD4(sc, EHCI_USBSTS), - EOREAD4(sc, EHCI_USBINTR)); - printf("frindex=0x%08x ctrdsegm=0x%08x periodic=0x%08x async=0x%08x\n", - EOREAD4(sc, EHCI_FRINDEX), - EOREAD4(sc, EHCI_CTRLDSSEGMENT), - EOREAD4(sc, EHCI_PERIODICLISTBASE), - EOREAD4(sc, EHCI_ASYNCLISTADDR)); - for (i = 1; i <= sc->sc_noport; i++) - printf("port %d status=0x%08x\n", i, - EOREAD4(sc, EHCI_PORTSC(i))); -} - -/* - * Unused function - this is meant to be called from a kernel - * debugger. - */ -void -ehci_dump() -{ - ehci_dump_regs(theehci); -} - -void -ehci_dump_link(ehci_link_t link, int type) -{ - link = le32toh(link); - printf("0x%08x", link); - if (link & EHCI_LINK_TERMINATE) - printf(""); - else { - printf("<"); - if (type) { - switch (EHCI_LINK_TYPE(link)) { - case EHCI_LINK_ITD: printf("ITD"); break; - case EHCI_LINK_QH: printf("QH"); break; - case EHCI_LINK_SITD: printf("SITD"); break; - case EHCI_LINK_FSTN: printf("FSTN"); break; - } - } - printf(">"); - } -} - -void -ehci_dump_sqtds(ehci_soft_qtd_t *sqtd) -{ - int i; - u_int32_t stop; - - stop = 0; - for (i = 0; sqtd && i < 20 && !stop; sqtd = sqtd->nextqtd, i++) { - ehci_dump_sqtd(sqtd); - stop = sqtd->qtd.qtd_next & htole32(EHCI_LINK_TERMINATE); - } - if (sqtd) - printf("dump aborted, too many TDs\n"); -} - -void -ehci_dump_sqtd(ehci_soft_qtd_t *sqtd) -{ - printf("QTD(%p) at 0x%08x:\n", sqtd, sqtd->physaddr); - ehci_dump_qtd(&sqtd->qtd); -} - -void -ehci_dump_qtd(ehci_qtd_t *qtd) -{ - u_int32_t s; - char sbuf[128]; - - printf(" next="); ehci_dump_link(qtd->qtd_next, 0); - printf(" altnext="); ehci_dump_link(qtd->qtd_altnext, 0); - printf("\n"); - s = le32toh(qtd->qtd_status); - bitmask_snprintf(EHCI_QTD_GET_STATUS(s), - "\20\10ACTIVE\7HALTED\6BUFERR\5BABBLE\4XACTERR" - "\3MISSED\2SPLIT\1PING", sbuf, sizeof(sbuf)); - printf(" status=0x%08x: toggle=%d bytes=0x%x ioc=%d c_page=0x%x\n", - s, EHCI_QTD_GET_TOGGLE(s), EHCI_QTD_GET_BYTES(s), - EHCI_QTD_GET_IOC(s), EHCI_QTD_GET_C_PAGE(s)); - printf(" cerr=%d pid=%d stat=0x%s\n", EHCI_QTD_GET_CERR(s), - EHCI_QTD_GET_PID(s), sbuf); - for (s = 0; s < 5; s++) - printf(" buffer[%d]=0x%08x\n", s, le32toh(qtd->qtd_buffer[s])); -} - -void -ehci_dump_sqh(ehci_soft_qh_t *sqh) -{ - ehci_qh_t *qh = &sqh->qh; - u_int32_t endp, endphub; - - printf("QH(%p) at 0x%08x:\n", sqh, sqh->physaddr); - printf(" sqtd=%p inactivesqtd=%p\n", sqh->sqtd, sqh->inactivesqtd); - printf(" link="); ehci_dump_link(qh->qh_link, 1); printf("\n"); - endp = le32toh(qh->qh_endp); - printf(" endp=0x%08x\n", endp); - printf(" addr=0x%02x inact=%d endpt=%d eps=%d dtc=%d hrecl=%d\n", - EHCI_QH_GET_ADDR(endp), EHCI_QH_GET_INACT(endp), - EHCI_QH_GET_ENDPT(endp), EHCI_QH_GET_EPS(endp), - EHCI_QH_GET_DTC(endp), EHCI_QH_GET_HRECL(endp)); - printf(" mpl=0x%x ctl=%d nrl=%d\n", - EHCI_QH_GET_MPL(endp), EHCI_QH_GET_CTL(endp), - EHCI_QH_GET_NRL(endp)); - endphub = le32toh(qh->qh_endphub); - printf(" endphub=0x%08x\n", endphub); - printf(" smask=0x%02x cmask=0x%02x huba=0x%02x port=%d mult=%d\n", - EHCI_QH_GET_SMASK(endphub), EHCI_QH_GET_CMASK(endphub), - EHCI_QH_GET_HUBA(endphub), EHCI_QH_GET_PORT(endphub), - EHCI_QH_GET_MULT(endphub)); - printf(" curqtd="); ehci_dump_link(qh->qh_curqtd, 0); printf("\n"); - printf("Overlay qTD:\n"); - ehci_dump_qtd(&qh->qh_qtd); -} - -#ifdef notyet -void -ehci_dump_itd(struct ehci_soft_itd *itd) -{ - ehci_isoc_trans_t t; - ehci_isoc_bufr_ptr_t b, b2, b3; - int i; - - printf("ITD: next phys=%X\n", itd->itd.itd_next); - - for (i = 0; i < 8;i++) { - t = le32toh(itd->itd.itd_ctl[i]); - printf("ITDctl %d: stat=%X len=%X ioc=%X pg=%X offs=%X\n", i, - EHCI_ITD_GET_STATUS(t), EHCI_ITD_GET_LEN(t), - EHCI_ITD_GET_IOC(t), EHCI_ITD_GET_PG(t), - EHCI_ITD_GET_OFFS(t)); - } - printf("ITDbufr: "); - for (i = 0; i < 7; i++) - printf("%X,", EHCI_ITD_GET_BPTR(le32toh(itd->itd.itd_bufr[i]))); - - b = le32toh(itd->itd.itd_bufr[0]); - b2 = le32toh(itd->itd.itd_bufr[1]); - b3 = le32toh(itd->itd.itd_bufr[2]); - printf("\nep=%X daddr=%X dir=%d maxpkt=%X multi=%X\n", - EHCI_ITD_GET_EP(b), EHCI_ITD_GET_DADDR(b), EHCI_ITD_GET_DIR(b2), - EHCI_ITD_GET_MAXPKT(b2), EHCI_ITD_GET_MULTI(b3)); -} - -void -ehci_dump_sitd(struct ehci_soft_itd *itd) -{ - printf("SITD %p next=%p prev=%p xfernext=%p physaddr=%X slot=%d\n", - itd, itd->u.frame_list.next, itd->u.frame_list.prev, - itd->xfer_next, itd->physaddr, itd->slot); -} -#endif - -#ifdef DIAGNOSTIC -void -ehci_dump_exfer(struct ehci_xfer *ex) -{ - printf("ehci_dump_exfer: ex=%p sqtdstart=%p end=%p itdstart=%p " - "end=%p isdone=%d\n", ex, ex->sqtdstart, ex->sqtdend, ex->itdstart, - ex->itdend, ex->isdone); -} -#endif -#endif - usbd_status ehci_open(usbd_pipe_handle pipe) { @@ -1542,8 +1349,8 @@ ehci_open(usbd_pipe_handle pipe) int ival, speed, naks; int hshubaddr, hshubport; - DPRINTFN(1, ("ehci_open: pipe=%p, addr=%d, endpt=%d (%d)\n", - pipe, addr, ed->bEndpointAddress, sc->sc_addr)); + DPRINTFN(1, ("ehci_open: pipe=%p, xfertype=%d, addr=%d, endpt=%d (%d)\n", + pipe, addr, ed->bEndpointAddress, sc->sc_addr, xfertype)); if (dev->myhsport) { hshubaddr = dev->myhsport->parent->address; @@ -1595,7 +1402,7 @@ ehci_open(usbd_pipe_handle pipe) if (sqh == NULL) goto bad0; /* qh_link filled when the QH is added */ - sqh->qh.qh_endp = htole32( + sqh->qh.qh_endp = htohc32(sc, EHCI_QH_SET_ADDR(addr) | EHCI_QH_SET_ENDPT(UE_GET_ADDR(ed->bEndpointAddress)) | EHCI_QH_SET_EPS(speed) | @@ -1605,17 +1412,17 @@ ehci_open(usbd_pipe_handle pipe) EHCI_QH_CTL : 0) | EHCI_QH_SET_NRL(naks) ); - sqh->qh.qh_endphub = htole32( + sqh->qh.qh_endphub = htohc32(sc, EHCI_QH_SET_MULT(1) | EHCI_QH_SET_HUBA(hshubaddr) | EHCI_QH_SET_PORT(hshubport) | EHCI_QH_SET_CMASK(0x1c) | EHCI_QH_SET_SMASK(xfertype == UE_INTERRUPT ? 0x01 : 0) ); - sqh->qh.qh_curqtd = EHCI_NULL; + sqh->qh.qh_curqtd = EHCI_NULL(sc); /* The overlay qTD was already set up by ehci_alloc_sqh(). */ sqh->qh.qh_qtd.qtd_status = - htole32(EHCI_QTD_SET_TOGGLE(pipe->endpoint->savedtoggle)); + htohc32(sc, EHCI_QTD_SET_TOGGLE(pipe->endpoint->savedtoggle)); epipe->sqh = sqh; } else { sqh = NULL; @@ -1633,13 +1440,13 @@ ehci_open(usbd_pipe_handle pipe) goto bad1; pipe->methods = &ehci_device_ctrl_methods; s = splusb(); - ehci_add_qh(sqh, sc->sc_async_head); + ehci_add_qh(sc, sqh, sc->sc_async_head); splx(s); break; case UE_BULK: pipe->methods = &ehci_device_bulk_methods; s = splusb(); - ehci_add_qh(sqh, sc->sc_async_head); + ehci_add_qh(sc, sqh, sc->sc_async_head); splx(s); break; case UE_INTERRUPT: @@ -1683,7 +1490,7 @@ ehci_open(usbd_pipe_handle pipe) * If in the intr schedule it may not. */ void -ehci_add_qh(ehci_soft_qh_t *sqh, ehci_soft_qh_t *head) +ehci_add_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qh_t *head) { SPLUSBCHECK; @@ -1693,12 +1500,12 @@ ehci_add_qh(ehci_soft_qh_t *sqh, ehci_so head->next = sqh; if (sqh->next) sqh->next->prev = sqh; - head->qh.qh_link = htole32(sqh->physaddr | EHCI_LINK_QH); + head->qh.qh_link = htohc32(sc, sqh->physaddr | EHCI_LINK_QH); #ifdef EHCI_DEBUG if (ehcidebug > 5) { printf("ehci_add_qh:\n"); - ehci_dump_sqh(sqh); + ehci_dump_sqh(sc, sqh); } #endif } @@ -1721,9 +1528,9 @@ ehci_rem_qh(ehci_softc_t *sc, ehci_soft_ /* Restart a QH following the addition of a qTD. */ void -ehci_activate_qh(ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd) +ehci_activate_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qtd_t *sqtd) { - KASSERT((sqtd->qtd.qtd_status & htole32(EHCI_QTD_ACTIVE)) == 0, + KASSERT((sqtd->qtd.qtd_status & htohc32(sc, EHCI_QTD_ACTIVE)) == 0, ("ehci_activate_qh: already active")); /* @@ -1734,23 +1541,23 @@ ehci_activate_qh(ehci_soft_qh_t *sqh, eh */ if (sqtd == sqh->sqtd) { /* Check that the hardware is in the state we expect. */ - if (EHCI_LINK_ADDR(le32toh(sqh->qh.qh_qtd.qtd_next)) != + if (EHCI_LINK_ADDR(hc32toh(sc, sqh->qh.qh_qtd.qtd_next)) != sqtd->physaddr) { #ifdef EHCI_DEBUG printf("ehci_activate_qh: unexpected next ptr\n"); - ehci_dump_sqh(sqh); - ehci_dump_sqtds(sqh->sqtd); + ehci_dump_sqh(sc, sqh); + ehci_dump_sqtds(sc, sqh->sqtd); #endif - sqh->qh.qh_qtd.qtd_next = htole32(sqtd->physaddr); - sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; + sqh->qh.qh_qtd.qtd_next = htohc32(sc, sqtd->physaddr); + sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL(sc); } /* Ensure the flags are correct. */ - sqh->qh.qh_qtd.qtd_status &= htole32(EHCI_QTD_PINGSTATE | + sqh->qh.qh_qtd.qtd_status &= htohc32(sc, EHCI_QTD_PINGSTATE | EHCI_QTD_TOGGLE_MASK); } /* Now activate the qTD. */ - sqtd->qtd.qtd_status |= htole32(EHCI_QTD_ACTIVE); + sqtd->qtd.qtd_status |= htohc32(sc, EHCI_QTD_ACTIVE); } /* @@ -2471,16 +2278,16 @@ ehci_alloc_sqh(ehci_softc_t *sc) sqtd = ehci_alloc_sqtd(sc); if (sqtd == NULL) return (NULL); - sqtd->qtd.qtd_status = htole32(0); - sqtd->qtd.qtd_next = EHCI_NULL; - sqtd->qtd.qtd_altnext = EHCI_NULL; + sqtd->qtd.qtd_status = htohc32(sc, 0); + sqtd->qtd.qtd_next = EHCI_NULL(sc); + sqtd->qtd.qtd_altnext = EHCI_NULL(sc); sqh = sc->sc_freeqhs; sc->sc_freeqhs = sqh->next; /* The overlay QTD should begin zeroed. */ - sqh->qh.qh_qtd.qtd_next = htole32(sqtd->physaddr); - sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; + sqh->qh.qh_qtd.qtd_next = htohc32(sc, sqtd->physaddr); + sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL(sc); sqh->qh.qh_qtd.qtd_status = 0; for (i = 0; i < EHCI_QTD_NBUFFERS; i++) { sqh->qh.qh_qtd.qtd_buffer[i] = 0; @@ -2534,8 +2341,8 @@ ehci_alloc_sqtd(ehci_softc_t *sc) s = splusb(); sqtd = sc->sc_freeqtds; sc->sc_freeqtds = sqtd->nextqtd; - sqtd->qtd.qtd_next = EHCI_NULL; - sqtd->qtd.qtd_altnext = EHCI_NULL; + sqtd->qtd.qtd_next = EHCI_NULL(sc); + sqtd->qtd.qtd_altnext = EHCI_NULL(sc); sqtd->qtd.qtd_status = 0; for (i = 0; i < EHCI_QTD_NBUFFERS; i++) { sqtd->qtd.qtd_buffer[i] = 0; @@ -2632,7 +2439,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe * segoff = 0; } - cur->qtd.qtd_buffer[i] = htole32(dataphys); + cur->qtd.qtd_buffer[i] = htohc32(sc, dataphys); cur->qtd.qtd_buffer_hi[i] = 0; curlen += pagelen; @@ -2667,18 +2474,18 @@ ehci_alloc_sqtd_chain(struct ehci_pipe * next = ehci_alloc_sqtd(sc); if (next == NULL) goto nomem; - nextphys = htole32(next->physaddr); + nextphys = htohc32(sc, next->physaddr); } else { next = NULL; - nextphys = EHCI_NULL; + nextphys = EHCI_NULL(sc); } cur->nextqtd = next; cur->qtd.qtd_next = nextphys; /* Make sure to stop after a short transfer. */ - cur->qtd.qtd_altnext = htole32(newinactive->physaddr); + cur->qtd.qtd_altnext = htohc32(sc, newinactive->physaddr); cur->qtd.qtd_status = - htole32(qtdstatus | EHCI_QTD_SET_BYTES(curlen)); + htohc32(sc, qtdstatus | EHCI_QTD_SET_BYTES(curlen)); cur->xfer = xfer; cur->len = curlen; DPRINTFN(10,("ehci_alloc_sqtd_chain: curlen=%d\n", curlen)); @@ -2700,7 +2507,7 @@ ehci_alloc_sqtd_chain(struct ehci_pipe * offset += curlen; cur = next; } - cur->qtd.qtd_status |= htole32(EHCI_QTD_IOC); + cur->qtd.qtd_status |= htohc32(sc, EHCI_QTD_IOC); *ep = cur; DPRINTFN(10,("ehci_alloc_sqtd_chain: return sqtd=%p sqtdend=%p\n", @@ -2829,7 +2636,7 @@ ehci_close_pipe(usbd_pipe_handle pipe, e ehci_rem_qh(sc, sqh, head); splx(s); pipe->endpoint->savedtoggle = - EHCI_QTD_GET_TOGGLE(le32toh(sqh->qh.qh_qtd.qtd_status)); + EHCI_QTD_GET_TOGGLE(hc32toh(sc, sqh->qh.qh_qtd.qtd_status)); ehci_free_sqh(sc, epipe->sqh); } @@ -2938,7 +2745,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u * the aborting xfer. (If there is something past us). * Hardware and software. */ - cur = EHCI_LINK_ADDR(le32toh(sqh->qh.qh_curqtd)); + cur = EHCI_LINK_ADDR(hc32toh(sc, sqh->qh.qh_curqtd)); hit = 0; /* If they initially point here. */ @@ -2946,7 +2753,7 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u /* We will change them to point here */ snext = exfer->sqtdend->nextqtd; - next = htole32(snext->physaddr); + next = htohc32(sc, snext->physaddr); /* * Now loop through any qTDs before us and keep track of the pointer @@ -2955,9 +2762,9 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u sqtd = sqh->sqtd; while (sqtd && sqtd != exfer->sqtdstart) { hit |= (cur == sqtd->physaddr); - if (EHCI_LINK_ADDR(le32toh(sqtd->qtd.qtd_next)) == us) + if (EHCI_LINK_ADDR(hc32toh(sc, sqtd->qtd.qtd_next)) == us) sqtd->qtd.qtd_next = next; - if (EHCI_LINK_ADDR(le32toh(sqtd->qtd.qtd_altnext)) == us) + if (EHCI_LINK_ADDR(hc32toh(sc, sqtd->qtd.qtd_altnext)) == us) sqtd->qtd.qtd_altnext = next; sqtd = sqtd->nextqtd; } @@ -2986,17 +2793,17 @@ ehci_abort_xfer(usbd_xfer_handle xfer, u * that we are removing. */ if (hit) { - sqh->qh.qh_qtd.qtd_next = htole32(snext->physaddr); - sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL; + sqh->qh.qh_qtd.qtd_next = htohc32(sc, snext->physaddr); + sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL(sc); sqh->qh.qh_qtd.qtd_status &= - htole32(EHCI_QTD_TOGGLE_MASK); + htohc32(sc, EHCI_QTD_TOGGLE_MASK); for (i = 0; i < EHCI_QTD_NBUFFERS; i++) { sqh->qh.qh_qtd.qtd_buffer[i] = 0; sqh->qh.qh_qtd.qtd_buffer_hi[i] = 0; } } } - ehci_add_qh(sqh, psqh); + ehci_add_qh(sc, sqh, psqh); /* * Step 5: Execute callback. */ @@ -3090,9 +2897,9 @@ ehci_abort_isoc_xfer(usbd_xfer_handle xf for (itd = exfer->itdstart; itd != NULL; itd = itd->xfer_next) { for (i = 0; i < 8; i++) { - trans_status = le32toh(itd->itd.itd_ctl[i]); + trans_status = hc32toh(sc, itd->itd.itd_ctl[i]); trans_status &= ~EHCI_ITD_ACTIVE; - itd->itd.itd_ctl[i] = htole32(trans_status); + itd->itd.itd_ctl[i] = htohc32(sc, trans_status); } } @@ -3269,9 +3076,10 @@ ehci_device_request(usbd_xfer_handle xfe err = USBD_NOMEM; goto bad1; } - newinactive->qtd.qtd_status = htole32(0); - newinactive->qtd.qtd_next = EHCI_NULL; - newinactive->qtd.qtd_altnext = EHCI_NULL; + newinactive->qtd.qtd_status = htohc32(sc, 0); + newinactive->qtd.qtd_next = EHCI_NULL(sc); + newinactive->qtd.qtd_altnext = EHCI_NULL(sc); + stat = ehci_alloc_sqtd(sc); if (stat == NULL) { err = USBD_NOMEM; @@ -3291,10 +3099,10 @@ ehci_device_request(usbd_xfer_handle xfe NULL, newinactive, &next, &end); if (err) goto bad3; - end->qtd.qtd_status &= htole32(~EHCI_QTD_IOC); + end->qtd.qtd_status &= htohc32(sc, ~EHCI_QTD_IOC); end->nextqtd = stat; - end->qtd.qtd_next = htole32(stat->physaddr); - end->qtd.qtd_altnext = htole32(newinactive->physaddr); + end->qtd.qtd_next = htohc32(sc, stat->physaddr); + end->qtd.qtd_altnext = htohc32(sc, newinactive->physaddr); } else { next = stat; } @@ -3302,21 +3110,21 @@ ehci_device_request(usbd_xfer_handle xfe memcpy(KERNADDR(&epipe->u.ctl.reqdma, 0), req, sizeof *req); /* Clear toggle, and do not activate until complete */ - setup->qtd.qtd_status = htole32( + setup->qtd.qtd_status = htohc32(sc, EHCI_QTD_SET_PID(EHCI_QTD_PID_SETUP) | EHCI_QTD_SET_CERR(3) | EHCI_QTD_SET_TOGGLE(0) | EHCI_QTD_SET_BYTES(sizeof *req) ); - setup->qtd.qtd_buffer[0] = htole32(DMAADDR(&epipe->u.ctl.reqdma, 0)); + setup->qtd.qtd_buffer[0] = htohc32(sc, DMAADDR(&epipe->u.ctl.reqdma, 0)); setup->qtd.qtd_buffer_hi[0] = 0; setup->nextqtd = next; - setup->qtd.qtd_next = htole32(next->physaddr); - setup->qtd.qtd_altnext = htole32(newinactive->physaddr); + setup->qtd.qtd_next = htohc32(sc, next->physaddr); + setup->qtd.qtd_altnext = htohc32(sc, newinactive->physaddr); setup->xfer = xfer; setup->len = sizeof *req; - stat->qtd.qtd_status = htole32( + stat->qtd.qtd_status = htohc32(sc, EHCI_QTD_ACTIVE | EHCI_QTD_SET_PID(isread ? EHCI_QTD_PID_OUT : EHCI_QTD_PID_IN) | EHCI_QTD_SET_CERR(3) | @@ -3326,16 +3134,16 @@ ehci_device_request(usbd_xfer_handle xfe stat->qtd.qtd_buffer[0] = 0; /* XXX not needed? */ stat->qtd.qtd_buffer_hi[0] = 0; /* XXX not needed? */ stat->nextqtd = newinactive; - stat->qtd.qtd_next = htole32(newinactive->physaddr); - stat->qtd.qtd_altnext = htole32(newinactive->physaddr); + stat->qtd.qtd_next = htohc32(sc, newinactive->physaddr); + stat->qtd.qtd_altnext = htohc32(sc, newinactive->physaddr); stat->xfer = xfer; stat->len = 0; #ifdef EHCI_DEBUG if (ehcidebug > 5) { DPRINTF(("ehci_device_request:\n")); - ehci_dump_sqh(sqh); - ehci_dump_sqtds(setup); + ehci_dump_sqh(sc, sqh); + ehci_dump_sqtds(sc, setup); } #endif @@ -3350,7 +3158,7 @@ ehci_device_request(usbd_xfer_handle xfe /* Activate the new qTD in the QH list. */ s = splusb(); - ehci_activate_qh(sqh, setup); + ehci_activate_qh(sc, sqh, setup); if (xfer->timeout && !sc->sc_bus.use_polling) { callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout), ehci_timeout, xfer); @@ -3365,9 +3173,9 @@ ehci_device_request(usbd_xfer_handle xfe EOREAD4(sc, EHCI_USBSTS))); delay(10000); ehci_dump_regs(sc); - ehci_dump_sqh(sc->sc_async_head); - ehci_dump_sqh(sqh); - ehci_dump_sqtds(setup); + ehci_dump_sqh(sc, sc->sc_async_head); + ehci_dump_sqh(sc, sqh); + ehci_dump_sqtds(sc, setup); } #endif @@ -3441,9 +3249,9 @@ ehci_device_bulk_start(usbd_xfer_handle usb_transfer_complete(xfer); return (err); } - newinactive->qtd.qtd_status = htole32(0); - newinactive->qtd.qtd_next = EHCI_NULL; - newinactive->qtd.qtd_altnext = EHCI_NULL; + newinactive->qtd.qtd_status = htohc32(sc, 0); + newinactive->qtd.qtd_next = EHCI_NULL(sc); + newinactive->qtd.qtd_altnext = EHCI_NULL(sc); err = ehci_alloc_sqtd_chain(epipe, sc, len, isread, xfer, sqh->inactivesqtd, newinactive, &data, &dataend); if (err) { @@ -3454,15 +3262,15 @@ ehci_device_bulk_start(usbd_xfer_handle return (err); } dataend->nextqtd = newinactive; - dataend->qtd.qtd_next = htole32(newinactive->physaddr); - dataend->qtd.qtd_altnext = htole32(newinactive->physaddr); + dataend->qtd.qtd_next = htohc32(sc, newinactive->physaddr); + dataend->qtd.qtd_altnext = htohc32(sc, newinactive->physaddr); sqh->inactivesqtd = newinactive; #ifdef EHCI_DEBUG if (ehcidebug > 5) { DPRINTF(("ehci_device_bulk_start: data(1)\n")); - ehci_dump_sqh(sqh); - ehci_dump_sqtds(data); + ehci_dump_sqh(sc, sqh); + ehci_dump_sqtds(sc, data); } #endif @@ -3477,7 +3285,7 @@ ehci_device_bulk_start(usbd_xfer_handle #endif s = splusb(); - ehci_activate_qh(sqh, data); + ehci_activate_qh(sc, sqh, data); if (xfer->timeout && !sc->sc_bus.use_polling) { callout_reset(&xfer->timeout_handle, MS_TO_TICKS(xfer->timeout), ehci_timeout, xfer); @@ -3497,8 +3305,8 @@ ehci_device_bulk_start(usbd_xfer_handle ehci_dump_sqh(sc->sc_async_head); #endif printf("sqh:\n"); - ehci_dump_sqh(sqh); - ehci_dump_sqtds(data); + ehci_dump_sqh(sc, sqh); + ehci_dump_sqtds(sc, data); } #endif @@ -3566,7 +3374,7 @@ ehci_device_setintr(ehci_softc_t *sc, eh sqh->islot = islot; isp = &sc->sc_islots[islot]; - ehci_add_qh(sqh, isp->sqh); + ehci_add_qh(sc, sqh, isp->sqh); return (USBD_NORMAL_COMPLETION); } @@ -3627,9 +3435,9 @@ ehci_device_intr_start(usbd_xfer_handle usb_transfer_complete(xfer); return (err); } - newinactive->qtd.qtd_status = htole32(0); - newinactive->qtd.qtd_next = EHCI_NULL; - newinactive->qtd.qtd_altnext = EHCI_NULL; + newinactive->qtd.qtd_status = htohc32(sc, 0); + newinactive->qtd.qtd_next = EHCI_NULL(sc); + newinactive->qtd.qtd_altnext = EHCI_NULL(sc); err = ehci_alloc_sqtd_chain(epipe, sc, len, isread, xfer, sqh->inactivesqtd, newinactive, &data, &dataend); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 03:26:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523FB106564A; Sat, 20 Dec 2008 03:26:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8AA8FC13; Sat, 20 Dec 2008 03:26:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK3QAm8090693; Sat, 20 Dec 2008 03:26:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK3Q9sv090681; Sat, 20 Dec 2008 03:26:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812200326.mBK3Q9sv090681@svn.freebsd.org> From: Sam Leffler Date: Sat, 20 Dec 2008 03:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186352 - in head/sys: . arm/arm arm/conf arm/include arm/xscale/ixp425 boot/arm/ixp425/boot2 conf contrib/dev/npe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 03:26:10 -0000 Author: sam Date: Sat Dec 20 03:26:09 2008 New Revision: 186352 URL: http://svn.freebsd.org/changeset/base/186352 Log: Merge support for Gateworks Cambria boards: o add support for IXP435 cpu's (e.g. 64 irq's) o add support for Cambria-specific devices: npe, led's (front panel and octal latch), ehci, mcu, ide cf o redo memory mapping for xscale/ixp4xx boards: previously memory was assumed aliased to 0x10000000 but this appears to be true only for ixp425 systems and breaks operation on others; rework so memory is assumed to start at 0 o rework NPE configuration support to use NPE id's instead of port #'s; these changes also rename the associated MAC's to follow the NPE's they are attached to o update npe firmware to latest rev (same license) and update default fw imageid's to match; in particular this adds NPE-A and crypto support o re-style NPE fw handling code and add a console msg identifying the attributes of the loaded fw o fix numerous problems with handling failures during npe setup o fix npe rx q setup; need to spin waiting for mailbox responses during early boot stages as qmgr interrupts are not delivered; this fixes the problem where all 8 traffic classifications were not tied to the rx q (and eliminates the console msg "remember to fix rx q setup") o add DELAY to npe MII wait logic for IXP435 o strip down builtin phys->virt address translation table in resource handling to just those resources that require it and add a console msg to alert people when this (kludge) table needs to be extended o purge a bunch of dead netbsd-ism's o cleanup avila led driver o add Cambria support to boot2 and rework code for better multi-board support Notes: 1. NPE-A doesn't work and causes NPE-C to stop working; it is disabled in the hints 2. USB isn't working yet; controller communicates ok but device discovery fails 3. Cambria support must be configured separately from IXP425 boards; multi-board support is TBD Sponsored by: Hobnob, Gateworks (board donation) Reviewed by: imp Added: head/sys/arm/conf/CAMBRIA (contents, props changed) - copied, changed from r186349, projects/cambria/sys/arm/conf/CAMBRIA head/sys/arm/conf/CAMBRIA.hints (props changed) - copied unchanged from r186349, projects/cambria/sys/arm/conf/CAMBRIA.hints head/sys/arm/xscale/ixp425/cambria_fled.c - copied unchanged from r186349, projects/cambria/sys/arm/xscale/ixp425/cambria_fled.c head/sys/arm/xscale/ixp425/cambria_led.c - copied unchanged from r186349, projects/cambria/sys/arm/xscale/ixp425/cambria_led.c head/sys/arm/xscale/ixp425/ixp435_ehci.c - copied unchanged from r186349, projects/cambria/sys/arm/xscale/ixp425/ixp435_ehci.c head/sys/arm/xscale/ixp425/std.ixp435 - copied unchanged from r186349, projects/cambria/sys/arm/xscale/ixp425/std.ixp435 Modified: head/sys/ (props changed) head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu.c head/sys/arm/conf/AVILA head/sys/arm/conf/AVILA.hints head/sys/arm/include/armreg.h head/sys/arm/include/intr.h head/sys/arm/xscale/ixp425/avila_ata.c head/sys/arm/xscale/ixp425/avila_led.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/ixp425/files.avila head/sys/arm/xscale/ixp425/files.ixp425 head/sys/arm/xscale/ixp425/if_npe.c head/sys/arm/xscale/ixp425/if_npereg.h head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425_iic.c head/sys/arm/xscale/ixp425/ixp425_intr.h head/sys/arm/xscale/ixp425/ixp425_mem.c head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/arm/xscale/ixp425/ixp425_npevar.h head/sys/arm/xscale/ixp425/ixp425_pci.c head/sys/arm/xscale/ixp425/ixp425_qmgr.c head/sys/arm/xscale/ixp425/ixp425_timer.c head/sys/arm/xscale/ixp425/ixp425_wdog.c head/sys/arm/xscale/ixp425/ixp425reg.h head/sys/arm/xscale/ixp425/ixp425var.h head/sys/arm/xscale/ixp425/std.avila head/sys/boot/arm/ixp425/boot2/arm_init.S head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/boot/arm/ixp425/boot2/lib.h head/sys/conf/options.arm head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/arm/cpufunc.c Sat Dec 20 03:26:09 2008 (r186352) @@ -1211,7 +1211,7 @@ set_cpufuncs() #endif /* CPU_XSCALE_PXA2X0 */ #ifdef CPU_XSCALE_IXP425 if (cputype == CPU_ID_IXP425_533 || cputype == CPU_ID_IXP425_400 || - cputype == CPU_ID_IXP425_266) { + cputype == CPU_ID_IXP425_266 || cputype == CPU_ID_IXP435) { cpufuncs = xscale_cpufuncs; #if defined(PERFCTRS) Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/arm/identcpu.c Sat Dec 20 03:26:09 2008 (r186352) @@ -300,6 +300,10 @@ const struct cpuidtab cpuids[] = { { CPU_ID_IXP425_266, CPU_CLASS_XSCALE, "IXP425 266MHz", ixp425_steppings }, + /* XXX ixp435 steppings? */ + { CPU_ID_IXP435, CPU_CLASS_XSCALE, "IXP435", + ixp425_steppings }, + { CPU_ID_ARM1136JS, CPU_CLASS_ARM11J, "ARM1136J-S", generic_steppings }, { CPU_ID_ARM1136JSR1, CPU_CLASS_ARM11J, "ARM1136J-S R1", Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/conf/AVILA Sat Dec 20 03:26:09 2008 (r186352) @@ -20,20 +20,18 @@ ident AVILA -options PHYSADDR=0x10000000 -options KERNPHYSADDR=0x10200000 -options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm -options FLASHADDR=0x50000000 -options LOADERRAMADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x10000000 - +include "../xscale/ixp425/std.ixp425" +# NB: memory mapping is defined in std.avila include "../xscale/ixp425/std.avila" +options XSCALE_CACHE_READ_WRITE_ALLOCATE +#options ARM_USE_SMALL_ALLOC #To statically compile in device wiring instead of /boot/device.hints hints "AVILA.hints" #Default places to look for devices. makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale +makeoptions MODULES_OVERRIDE="" #options HZ=1000 options HZ=100 options DEVICE_POLLING @@ -42,34 +40,18 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options DIAGNOSTIC options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server -options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCLIENT -#options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -#options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 @@ -106,7 +88,6 @@ device npe_fw device firmware device qmgr # Q Manager (required by npe) device miibus # NB: required by npe -device rl # RealTek 8129/8139 device ether device bpf @@ -114,37 +95,48 @@ device pty device loop device if_bridge -options XSCALE_CACHE_READ_WRITE_ALLOCATE device md device random # Entropy device -#options ARM_USE_SMALL_ALLOC - # Wireless NIC cards device wlan # 802.11 support +options IEEE80211_DEBUG device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth + device ath # Atheros pci/cardbus NIC's -device ath_hal # Atheros HAL (Hardware Access Layer) -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -device ath_rate_sample # SampleRate tx rate control for ath options ATH_DEBUG +options ATH_DIAGAPI +#options ATH_TX99_DIAG +device ath_rate_sample # SampleRate tx rate control for ath -#device crypto -#device cryptodev -#device hifn # NB: Soekris minipci card known to work +#options AH_DEBUG +#options AH_ASSERT +#device ath_ar5210 +#device ath_ar5211 +device ath_ar5212 +device ath_rf2413 +device ath_rf2417 +device ath_rf2425 +device ath_rf5111 +device ath_rf5112 +device ath_rf5413 +# +device ath_ar5416 +options AH_SUPPORT_AR5416 +device ath_ar9160 device usb -options USB_DEBUG +#options USB_DEBUG device ohci device ehci device ugen -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) - -device ural -device zyd -device wlan_amrr +#device umass +#device scbus # SCSI bus (required for SCSI) +#device da # Direct Access (disks) + +#device ural +#device zyd +#device wlan_amrr Modified: head/sys/arm/conf/AVILA.hints ============================================================================== --- head/sys/arm/conf/AVILA.hints Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/conf/AVILA.hints Sat Dec 20 03:26:09 2008 (r186352) @@ -17,21 +17,22 @@ hint.uart.1.irq=13 # NPE Hardware Queue Manager hint.ixpqmgr.0.at="ixp0" -# NPE wireless NIC's, requires ixpqmgr +# NPE wired NIC's, requires ixpqmgr hint.npe.0.at="ixp0" -hint.npe.0.mac="A" -hint.npe.0.mii="A" +hint.npe.0.npeid="B" +hint.npe.0.mac="B" +hint.npe.0.mii="B" hint.npe.0.phy=0 hint.npe.1.at="ixp0" -hint.npe.1.mac="B" -# NB: on 2348 boards all PHY's are addressed through MAC A -hint.npe.1.mii="A" +hint.npe.1.npeid="C" +hint.npe.1.mac="C" +hint.npe.1.mii="B" hint.npe.1.phy=1 # CF IDE controller hint.ata_avila.0.at="ixp0" -# LED connected to gpio +# Front Panel LED hint.led_avila.0.at="ixp0" # Analog Devices AD7418 temperature sensor Copied and modified: head/sys/arm/conf/CAMBRIA (from r186349, projects/cambria/sys/arm/conf/CAMBRIA) ============================================================================== --- projects/cambria/sys/arm/conf/CAMBRIA Sat Dec 20 01:29:19 2008 (r186349, copy source) +++ head/sys/arm/conf/CAMBRIA Sat Dec 20 03:26:09 2008 (r186352) @@ -101,8 +101,8 @@ device random # Entrop # NB: 2 USB 2.0 ports standard device usb -options USB_DEBUG -device ohci +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +#options USB_DEBUG device ehci device ugen device umass Copied: head/sys/arm/conf/CAMBRIA.hints (from r186349, projects/cambria/sys/arm/conf/CAMBRIA.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CAMBRIA.hints Sat Dec 20 03:26:09 2008 (r186352, copy of r186349, projects/cambria/sys/arm/conf/CAMBRIA.hints) @@ -0,0 +1,54 @@ +# $FreeBSD$ + +# +# Device wiring for the Gateworks Cambria 2358. +# + +# DBGU is unit 0 +hint.uart.0.at="ixp0" +hint.uart.0.addr=0xc8000000 +hint.uart.0.irq=15 +hint.uart.0.flags=0x10 + +# NB: no UART1 on ixp436 + +# NPE Hardware Queue Manager +hint.ixpqmgr.0.at="ixp0" + +# NPE wired NIC's, requires ixpqmgr +hint.npe.0.at="ixp0" +hint.npe.0.npeid="C" +hint.npe.0.mac="C" +hint.npe.0.mii="C" +hint.npe.0.phy=1 +#hint.npe.1.at="ixp0" +#hint.npe.1.npeid="A" +#hint.npe.1.mac="A" +#hint.npe.1.mii="C" +#hint.npe.1.phy=2 + +# CF IDE controller +hint.ata_avila.0.at="ixp0" + +# Front Panel LED +hint.fled.0.at="iicbus0" +hint.fled.0.addr=0x5a + +# Octal LED Latch +hint.led_cambria.0.at="ixp0" + +# Analog Devices AD7418 temperature sensor +hint.ad7418.0.at="iicbus0" +hint.ad7418.0.addr=0x50 + +# Dallas Semiconductor DS1672 RTC +hint.ds1672.0.at="iicbus0" +hint.ds1672.0.addr=0xd0 + +# USB is part of the chip +hint.ehci.0.at="ixp0" +hint.ehci.0.addr=0xcd000000 +hint.ehci.0.irq=32 +hint.ehci.1.at="ixp0" +hint.ehci.1.addr=0xce000000 +hint.ehci.1.irq=33 Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/include/armreg.h Sat Dec 20 03:26:09 2008 (r186352) @@ -174,6 +174,7 @@ #define CPU_ID_IXP425_533 0x690541c0 #define CPU_ID_IXP425_400 0x690541d0 #define CPU_ID_IXP425_266 0x690541f0 +#define CPU_ID_IXP435 0x69054040 /* ARM3-specific coprocessor 15 registers */ #define ARM3_CP15_FLUSH 1 Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/include/intr.h Sat Dec 20 03:26:09 2008 (r186352) @@ -39,6 +39,7 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ +/* XXX move to std.* files? */ #ifdef CPU_XSCALE_81342 #define NIRQ 128 #elif defined(CPU_XSCALE_PXA2X0) @@ -46,7 +47,8 @@ #define NIRQ IRQ_GPIO_MAX #elif defined(SOC_MV_DISCOVERY) #define NIRQ 96 -#elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) +#elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) || \ + defined(CPU_XSCALE_IXP435) #define NIRQ 64 #else #define NIRQ 32 Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/xscale/ixp425/avila_ata.c Sat Dec 20 03:26:09 2008 (r186352) @@ -67,13 +67,64 @@ __FBSDID("$FreeBSD$"); #include #include -#define AVILA_IDE_GPIN 12 /* GPIO pin # */ -#define AVILA_IDE_IRQ IXP425_INT_GPIO_12 -#define AVILA_IDE_CTRL 0x06 /* control register */ - -#define PRONGHORN_IDE_GPIN 0 /* GPIO pin # */ -#define PRONGHORN_IDE_IRQ IXP425_INT_GPIO_0 -#define PRONGHORN_IDE_CNTRL 0x06 /* control register */ +#define AVILA_IDE_CTRL 0x06 + +struct ata_config { + const char *desc; /* description for probe */ + uint8_t gpin; /* GPIO pin */ + uint8_t irq; /* IRQ */ + uint32_t base16; /* CS base addr for 16-bit */ + uint32_t size16; /* CS size for 16-bit */ + uint32_t off16; /* CS offset for 16-bit */ + uint32_t basealt; /* CS base addr for alt */ + uint32_t sizealt; /* CS size for alt */ + uint32_t offalt; /* CS offset for alt */ +}; + +static const struct ata_config * +ata_getconfig(struct ixp425_softc *sa) +{ + static const struct ata_config configs[] = { + { .desc = "Gateworks Avila IDE/CF Controller", + .gpin = 12, + .irq = IXP425_INT_GPIO_12, + .base16 = IXP425_EXP_BUS_CS1_HWBASE, + .size16 = IXP425_EXP_BUS_CS1_SIZE, + .off16 = EXP_TIMING_CS1_OFFSET, + .basealt = IXP425_EXP_BUS_CS2_HWBASE, + .sizealt = IXP425_EXP_BUS_CS2_SIZE, + .offalt = EXP_TIMING_CS2_OFFSET, + }, + { .desc = "Gateworks Cambria IDE/CF Controller", + .gpin = 12, + .irq = IXP425_INT_GPIO_12, + .base16 = CAMBRIA_CFSEL0_HWBASE, + .size16 = CAMBRIA_CFSEL0_SIZE, + .off16 = EXP_TIMING_CS3_OFFSET, + .basealt = CAMBRIA_CFSEL1_HWBASE, + .sizealt = CAMBRIA_CFSEL1_SIZE, + .offalt = EXP_TIMING_CS4_OFFSET, + }, + { .desc = "ADI Pronghorn Metro IDE/CF Controller", + .gpin = 0, + .irq = IXP425_INT_GPIO_0, + .base16 = IXP425_EXP_BUS_CS3_HWBASE, + .size16 = IXP425_EXP_BUS_CS3_SIZE, + .off16 = EXP_TIMING_CS3_OFFSET, + .basealt = IXP425_EXP_BUS_CS4_HWBASE, + .sizealt = IXP425_EXP_BUS_CS4_SIZE, + .offalt = EXP_TIMING_CS4_OFFSET, + }, + }; + + /* XXX honor hint? (but then no multi-board support) */ + /* XXX total hack */ + if ((cpu_id() & CPU_ID_CPU_MASK) == CPU_ID_IXP435) + return &configs[1]; /* Cambria */ + if (EXP_BUS_READ_4(sa, EXP_TIMING_CS2_OFFSET) != 0) + return &configs[0]; /* Avila */ + return &configs[2]; /* Pronghorn */ +} struct ata_avila_softc { device_t sc_dev; @@ -105,14 +156,14 @@ static int ata_avila_probe(device_t dev) { struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); + const struct ata_config *config; - /* XXX any way to check? */ - if (EXP_BUS_READ_4(sa, EXP_TIMING_CS2_OFFSET) != 0) - device_set_desc_copy(dev, "Gateworks Avila IDE/CF Controller"); - else - device_set_desc_copy(dev, - "ADI Pronghorn Metro IDE/CF Controller"); - return 0; + config = ata_getconfig(sa); + if (config != NULL) { + device_set_desc_copy(dev, config->desc); + return 0; + } + return ENXIO; } static int @@ -120,41 +171,25 @@ ata_avila_attach(device_t dev) { struct ata_avila_softc *sc = device_get_softc(dev); struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); - u_int32_t alt_t_off, ide_gpin, ide_irq; + const struct ata_config *config; + + config = ata_getconfig(sa); + KASSERT(config != NULL, ("no board config")); sc->sc_dev = dev; /* NB: borrow from parent */ sc->sc_iot = sa->sc_iot; sc->sc_exp_ioh = sa->sc_exp_ioh; - if (EXP_BUS_READ_4(sc, EXP_TIMING_CS2_OFFSET) != 0) { - /* Avila board */ - if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS1_HWBASE, - IXP425_EXP_BUS_CS1_SIZE, 0, &sc->sc_ioh)) - panic("%s: unable to map Expansion Bus CS1 window", - __func__); - if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS2_HWBASE, - IXP425_EXP_BUS_CS2_SIZE, 0, &sc->sc_alt_ioh)) - panic("%s: unable to map Expansion Bus CS2 window", - __func__); - ide_gpin = AVILA_IDE_GPIN; - ide_irq = AVILA_IDE_IRQ; - sc->sc_16bit_off = EXP_TIMING_CS1_OFFSET; - alt_t_off = EXP_TIMING_CS2_OFFSET; - } else { - /* Pronghorn */ - if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS3_HWBASE, - IXP425_EXP_BUS_CS3_SIZE, 0, &sc->sc_ioh)) - panic("%s: unable to map Expansion Bus CS3 window", - __func__); - if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS4_HWBASE, - IXP425_EXP_BUS_CS4_SIZE, 0, &sc->sc_alt_ioh)) - panic("%s: unable to map Expansion Bus CS4 window", - __func__); - ide_gpin = PRONGHORN_IDE_GPIN; - ide_irq = PRONGHORN_IDE_IRQ; - sc->sc_16bit_off = EXP_TIMING_CS3_OFFSET; - alt_t_off = EXP_TIMING_CS4_OFFSET; - } + + if (bus_space_map(sc->sc_iot, config->base16, config->size16, + 0, &sc->sc_ioh)) + panic("%s: cannot map 16-bit window (0x%x/0x%x)", + __func__, config->base16, config->size16); + if (bus_space_map(sc->sc_iot, config->basealt, config->sizealt, + 0, &sc->sc_alt_ioh)) + panic("%s: cannot map alt window (0x%x/0x%x)", + __func__, config->basealt, config->sizealt); + sc->sc_16bit_off = config->off16; /* * Craft special resource for ATA bus space ops @@ -184,30 +219,30 @@ ata_avila_attach(device_t dev) rman_set_bushandle(&sc->sc_alt_ata, sc->sc_alt_ioh); GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPOER, - GPIO_CONF_READ_4(sa, IXP425_GPIO_GPOER) | (1<gpin)); /* set interrupt type */ - GPIO_CONF_WRITE_4(sa, GPIO_TYPE_REG(ide_gpin), - (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(ide_gpin)) &~ - GPIO_TYPE(ide_gpin, GPIO_TYPE_MASK)) | - GPIO_TYPE(ide_gpin, GPIO_TYPE_EDG_RISING)); + GPIO_CONF_WRITE_4(sa, GPIO_TYPE_REG(config->gpin), + (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(config->gpin)) &~ + GPIO_TYPE(config->gpin, GPIO_TYPE_MASK)) | + GPIO_TYPE(config->gpin, GPIO_TYPE_EDG_RISING)); /* clear ISR */ - GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPISR, (1<gpin)); /* configure CS1/3 window, leaving timing unchanged */ EXP_BUS_WRITE_4(sc, sc->sc_16bit_off, EXP_BUS_READ_4(sc, sc->sc_16bit_off) | EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN); /* configure CS2/4 window, leaving timing unchanged */ - EXP_BUS_WRITE_4(sc, alt_t_off, - EXP_BUS_READ_4(sc, alt_t_off) | + EXP_BUS_WRITE_4(sc, config->offalt, + EXP_BUS_READ_4(sc, config->offalt) | EXP_BYTE_EN | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN); /* setup interrupt */ sc->sc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->sc_rid, - ide_irq, ide_irq, 1, RF_ACTIVE); + config->irq, config->irq, 1, RF_ACTIVE); if (!sc->sc_irq) - panic("Unable to allocate irq %u.\n", ide_irq); + panic("Unable to allocate irq %u.\n", config->irq); bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, NULL, ata_avila_intr, sc, &sc->sc_ih); @@ -230,9 +265,9 @@ ata_avila_detach(device_t dev) /* detach & delete all children */ if (device_get_children(dev, &children, &nc) == 0) { - if (nc > 0) - device_delete_child(dev, children[0]); - free(children, M_TEMP); + if (nc > 0) + device_delete_child(dev, children[0]); + free(children, M_TEMP); } bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); @@ -308,7 +343,7 @@ ata_avila_teardown_intr(device_t dev, de /* * Enable/disable 16-bit ops on the expansion bus. */ -static void __inline +static __inline void enable_16(struct ata_avila_softc *sc) { EXP_BUS_WRITE_4(sc, sc->sc_16bit_off, @@ -316,7 +351,7 @@ enable_16(struct ata_avila_softc *sc) DELAY(100); /* XXX? */ } -static void __inline +static __inline void disable_16(struct ata_avila_softc *sc) { DELAY(100); /* XXX? */ Modified: head/sys/arm/xscale/ixp425/avila_led.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_led.c Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/xscale/ixp425/avila_led.c Sat Dec 20 03:26:09 2008 (r186352) @@ -37,22 +37,19 @@ __FBSDID("$FreeBSD$"); #include #define GPIO_LED_STATUS 3 -#define GPIO_LED_STATUS_BIT (1U << GPIO_LED_STATUS) - -static struct cdev *gpioled; +#define GPIO_LED_STATUS_BIT (1U << GPIO_LED_STATUS) struct led_avila_softc { device_t sc_dev; bus_space_tag_t sc_iot; bus_space_handle_t sc_gpio_ioh; + struct cdev *sc_led; }; -static struct led_avila_softc *led_avila_sc = NULL; - static void -led_func(void *unused, int onoff) +led_func(void *arg, int onoff) { - struct led_avila_softc *sc = led_avila_sc; + struct led_avila_softc *sc = arg; uint32_t reg; reg = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPOUTR); @@ -66,7 +63,7 @@ led_func(void *unused, int onoff) static int led_avila_probe(device_t dev) { - device_set_desc(dev, "Gateworks Avila GPIO connected LED"); + device_set_desc(dev, "Gateworks Avila Front Panel LED"); return (0); } @@ -75,31 +72,35 @@ led_avila_attach(device_t dev) { struct led_avila_softc *sc = device_get_softc(dev); struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); - void *led = NULL; - uint32_t reg; - - led_avila_sc = sc; sc->sc_dev = dev; sc->sc_iot = sa->sc_iot; sc->sc_gpio_ioh = sa->sc_gpio_ioh; /* Configure LED GPIO pin as output */ - reg = GPIO_CONF_READ_4(sc, IXP425_GPIO_GPOER); - reg &= ~GPIO_LED_STATUS_BIT; - GPIO_CONF_WRITE_4(sc, IXP425_GPIO_GPOER, reg); + GPIO_CONF_WRITE_4(sc, IXP425_GPIO_GPOER, + GPIO_CONF_READ_4(sc, IXP425_GPIO_GPOER) &~ GPIO_LED_STATUS_BIT); - gpioled = led_create(led_func, led, "gpioled"); + sc->sc_led = led_create(led_func, sc, "gpioled"); - /* Turn on LED */ - led_func(led, 1); + led_func(sc, 1); /* Turn on LED */ return (0); } +static void +led_avila_detach(device_t dev) +{ + struct led_avila_softc *sc = device_get_softc(dev); + + if (sc->sc_led != NULL) + led_destroy(sc->sc_led); +} + static device_method_t led_avila_methods[] = { DEVMETHOD(device_probe, led_avila_probe), DEVMETHOD(device_attach, led_avila_attach), + DEVMETHOD(device_detach, led_avila_detach), {0, 0}, }; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 20 03:02:32 2008 (r186351) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 20 03:26:09 2008 (r186352) @@ -95,6 +95,11 @@ __FBSDID("$FreeBSD$"); #include #include +/* kernel text starts where we were loaded at boot */ +#define KERNEL_TEXT_OFF (KERNPHYSADDR - PHYSADDR) +#define KERNEL_TEXT_BASE (KERNBASE + KERNEL_TEXT_OFF) +#define KERNEL_TEXT_PHYS (PHYSADDR + KERNEL_TEXT_OFF) + #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_IO 1 #define KERNEL_PT_IO_NUM 3 @@ -142,114 +147,109 @@ static struct trapframe proc0_tf; /* Static device mappings. */ static const struct pmap_devmap ixp425_devmap[] = { /* Physical/Virtual address for I/O space */ - { - IXP425_IO_VBASE, - IXP425_IO_HWBASE, - IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* Expansion Bus */ - { - IXP425_EXP_VBASE, - IXP425_EXP_HWBASE, - IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* IXP425 PCI Configuration */ - { - IXP425_PCI_VBASE, - IXP425_PCI_HWBASE, - IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* SDRAM Controller */ - { - IXP425_MCU_VBASE, - IXP425_MCU_HWBASE, - IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_MCU_VBASE, IXP425_MCU_HWBASE, IXP425_MCU_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* PCI Memory Space */ - { - IXP425_PCI_MEM_VBASE, - IXP425_PCI_MEM_HWBASE, - IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* Q-Mgr Memory Space */ + { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* NPE-A Memory Space */ - { - IXP425_NPE_A_VBASE, - IXP425_NPE_A_HWBASE, - IXP425_NPE_A_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_NPE_A_VBASE, IXP425_NPE_A_HWBASE, IXP425_NPE_A_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* NPE-B Memory Space */ - { - IXP425_NPE_B_VBASE, - IXP425_NPE_B_HWBASE, - IXP425_NPE_B_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_NPE_B_VBASE, IXP425_NPE_B_HWBASE, IXP425_NPE_B_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, /* NPE-C Memory Space */ - { - IXP425_NPE_C_VBASE, - IXP425_NPE_C_HWBASE, - IXP425_NPE_C_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, - /* MAC-A Memory Space */ - { - IXP425_MAC_A_VBASE, - IXP425_MAC_A_HWBASE, - IXP425_MAC_A_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, + { IXP425_NPE_C_VBASE, IXP425_NPE_C_HWBASE, IXP425_NPE_C_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* MAC-B Memory Space */ - { - IXP425_MAC_B_VBASE, - IXP425_MAC_B_HWBASE, - IXP425_MAC_B_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, - /* Q-Mgr Memory Space */ - { - IXP425_QMGR_VBASE, - IXP425_QMGR_HWBASE, - IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, - }, - - { - 0, - 0, - 0, - 0, - 0, - } + { IXP425_MAC_B_VBASE, IXP425_MAC_B_HWBASE, IXP425_MAC_B_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* MAC-C Memory Space */ + { IXP425_MAC_C_VBASE, IXP425_MAC_C_HWBASE, IXP425_MAC_C_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + { 0 }, }; -#define SDRAM_START 0x10000000 +/* Static device mappings. */ +static const struct pmap_devmap ixp435_devmap[] = { + /* Physical/Virtual address for I/O space */ + { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* Expansion Bus */ + { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* IXP425 PCI Configuration */ + { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* DDRII Controller NB: mapped same place as IXP425 */ + { IXP425_MCU_VBASE, IXP435_MCU_HWBASE, IXP425_MCU_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* PCI Memory Space */ + { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* Q-Mgr Memory Space */ + { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* NPE-A Memory Space */ + { IXP425_NPE_A_VBASE, IXP425_NPE_A_HWBASE, IXP425_NPE_A_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* NPE-C Memory Space */ + { IXP425_NPE_C_VBASE, IXP425_NPE_C_HWBASE, IXP425_NPE_C_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* MAC-C Memory Space */ + { IXP425_MAC_C_VBASE, IXP425_MAC_C_HWBASE, IXP425_MAC_C_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* MAC-B Memory Space */ + { IXP425_MAC_B_VBASE, IXP425_MAC_B_HWBASE, IXP425_MAC_B_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* MAC-A Memory Space */ + { IXP435_MAC_A_VBASE, IXP435_MAC_A_HWBASE, IXP435_MAC_A_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + /* USB1 Memory Space */ + { IXP435_USB1_VBASE, IXP435_USB1_HWBASE, IXP435_USB1_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* USB2 Memory Space */ + { IXP435_USB2_VBASE, IXP435_USB2_HWBASE, IXP435_USB2_SIZE, + VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + + { 0 } +}; extern vm_offset_t xscale_cache_clean_addr; void * initarm(void *arg, void *arg2) { +#define next_chunk2(a,b) (((a) + (b)) &~ ((b)-1)) +#define next_page(a) next_chunk2(a,PAGE_SIZE) struct pv_addr kernel_l1pt; int loop, i; u_int l1pagetable; @@ -260,25 +260,40 @@ initarm(void *arg, void *arg2) vm_offset_t lastaddr; uint32_t memsize; - set_cpufuncs(); + set_cpufuncs(); /* NB: sets cputype */ lastaddr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); - freemempos = 0x10200000; - /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_pa, (np)); \ - (var).pv_va = (var).pv_pa + 0xb0000000; - -#define alloc_pages(var, np) \ - freemempos -= (np * PAGE_SIZE); \ - (var) = freemempos; \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); + /* + * We allocate memory downwards from where we were loaded + * by RedBoot; first the L1 page table, then NUM_KERNEL_PTS + * entries in the L2 page table. Past that we re-align the + * allocation boundary so later data structures (stacks, etc) + * can be mapped with different attributes (write-back vs + * write-through). Note this leaves a gap for expansion + * (or might be repurposed). + */ + freemempos = KERNPHYSADDR; + + /* macros to simplify initial memory allocation */ +#define alloc_pages(var, np) do { \ + freemempos -= (np * PAGE_SIZE); \ + (var) = freemempos; \ + /* NB: this works because locore maps PA=VA */ \ + memset((char *)(var), 0, ((np) * PAGE_SIZE)); \ +} while (0) +#define valloc_pages(var, np) do { \ + alloc_pages((var).pv_pa, (np)); \ + (var).pv_va = (var).pv_pa + (KERNVIRTADDR - KERNPHYSADDR); \ +} while (0) + /* force L1 page table alignment */ while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) freemempos -= PAGE_SIZE; + /* allocate contiguous L1 page table */ valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); + /* now allocate L2 page tables; they are linked to L1 below */ for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { if (!(loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { valloc_pages(kernel_pt_table[loop], @@ -288,11 +303,18 @@ initarm(void *arg, void *arg2) (loop % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) * L2_TABLE_SIZE_REAL; kernel_pt_table[loop].pv_va = - kernel_pt_table[loop].pv_pa + 0xb0000000; + kernel_pt_table[loop].pv_pa + + (KERNVIRTADDR - KERNPHYSADDR); } } - freemem_pt = freemempos; - freemempos = 0x10100000; + freemem_pt = freemempos; /* base of allocated pt's */ + + /* + * Re-align allocation boundary so we can map the area + * write-back instead of write-through for the stacks and + * related structures allocated below. + */ + freemempos = PHYSADDR + 0x100000; /* * Allocate a page for the system page mapped to V0x00000000 * This page will just contain the system vectors and can be @@ -308,30 +330,25 @@ initarm(void *arg, void *arg2) alloc_pages(minidataclean.pv_pa, 1); valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC +#error "I am broken" /* XXX save people grief */ freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); freemem_after = freemempos - ((freemem_pt - 0x10100000) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0xb0000000) + arm_add_smallalloc_pages((void *)(freemem_after + (KERNVIRTADDR - KERNPHYSADDR) , (void *)0xc0100000, freemem_pt - 0x10100000, 1); freemem_after -= ((freemem_after - 0x10001000) / PAGE_SIZE) * sizeof(struct arm_small_page); - arm_add_smallalloc_pages((void *)(freemem_after + 0xb0000000) + arm_add_smallalloc_pages((void *)(freemem_after + (KEYVIRTADDR - KERNPHYSADDR)) , (void *)0xc0001000, trunc_page(freemem_after) - 0x10001000, 0); freemempos = trunc_page(freemem_after); freemempos -= PAGE_SIZE; #endif - /* - * Allocate memory for the l1 and l2 page tables. The scheme to avoid - * wasting memory by allocating the l1pt on the first 16k memory was - * taken from NetBSD rpc_machdep.c. NKPT should be greater than 12 for - * this to work (which is supposed to be the case). - */ /* - * Now we start construction of the L1 page table - * We start by mapping the L2 page tables into the L1. - * This means that we can replace L1 mappings later on if necessary + * Now construct the L1 page table. First map the L2 + * page tables into the L1 so we can replace L1 mappings + * later on if necessary */ l1pagetable = kernel_l1pt.pv_va; @@ -339,30 +356,28 @@ initarm(void *arg, void *arg2) pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH & ~(0x00100000 - 1), &kernel_pt_table[KERNEL_PT_SYS]); pmap_link_l2pt(l1pagetable, IXP425_IO_VBASE, - &kernel_pt_table[KERNEL_PT_IO]); + &kernel_pt_table[KERNEL_PT_IO]); pmap_link_l2pt(l1pagetable, IXP425_MCU_VBASE, - &kernel_pt_table[KERNEL_PT_IO + 1]); + &kernel_pt_table[KERNEL_PT_IO + 1]); pmap_link_l2pt(l1pagetable, IXP425_PCI_MEM_VBASE, - &kernel_pt_table[KERNEL_PT_IO + 2]); + &kernel_pt_table[KERNEL_PT_IO + 2]); pmap_link_l2pt(l1pagetable, KERNBASE, &kernel_pt_table[KERNEL_PT_BEFOREKERN]); - pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, 0x100000, + pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, SDRAM_START + 0x100000, + pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, PHYSADDR + 0x100000, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); - pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000, - (((uint32_t)(lastaddr) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1), + pmap_map_chunk(l1pagetable, KERNEL_TEXT_BASE, KERNEL_TEXT_PHYS, + next_chunk2(((uint32_t)lastaddr) - KERNEL_TEXT_BASE, L1_S_SIZE), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - freemem_after = ((int)lastaddr + PAGE_SIZE) & ~(PAGE_SIZE - 1); - afterkern = round_page(((vm_offset_t)lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - - 1)); + freemem_after = next_page((int)lastaddr); + afterkern = round_page(next_chunk2((vm_offset_t)lastaddr, L1_S_SIZE)); for (i = 0; i < KERNEL_PT_AFKERNEL_NUM; i++) { pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); } pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - #ifdef ARM_USE_SMALL_ALLOC if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { @@ -380,7 +395,10 @@ initarm(void *arg, void *arg2) /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_devmap_bootstrap(l1pagetable, ixp425_devmap); + if (cpu_is_ixp43x()) + pmap_devmap_bootstrap(l1pagetable, ixp435_devmap); + else + pmap_devmap_bootstrap(l1pagetable, ixp425_devmap); /* * Give the XScale global cache clean code an appropriately * sized chunk of unmapped VA space starting at 0xff000000 @@ -392,6 +410,7 @@ initarm(void *arg, void *arg2) setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); + /* * Pages were allocated during the secondary bootstrap for the * stacks for different CPU modes. @@ -400,16 +419,9 @@ initarm(void *arg, void *arg2) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 05:56:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 694E3106564A; Sat, 20 Dec 2008 05:56:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573888FC13; Sat, 20 Dec 2008 05:56:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK5u9KY093402; Sat, 20 Dec 2008 05:56:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK5u9DO093401; Sat, 20 Dec 2008 05:56:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812200556.mBK5u9DO093401@svn.freebsd.org> From: Sam Leffler Date: Sat, 20 Dec 2008 05:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186353 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 05:56:09 -0000 Author: sam Date: Sat Dec 20 05:56:08 2008 New Revision: 186353 URL: http://svn.freebsd.org/changeset/base/186353 Log: fix build w/ EHCI_DEBUG Modified: head/sys/dev/usb/ehci.c Modified: head/sys/dev/usb/ehci.c ============================================================================== --- head/sys/dev/usb/ehci.c Sat Dec 20 03:26:09 2008 (r186352) +++ head/sys/dev/usb/ehci.c Sat Dec 20 05:56:08 2008 (r186353) @@ -869,7 +869,7 @@ ehci_idone(struct ehci_xfer *ex) splx(s); #ifdef EHCI_DEBUG printf("ehci_idone: ex is done!\n "); - ehci_dump_exfer(sc, ex); + ehci_dump_exfer(ex); #else printf("ehci_idone: ex=%p is done!\n", ex); #endif From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 08:25:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4846E1065676; Sat, 20 Dec 2008 08:25:41 +0000 (UTC) Date: Sat, 20 Dec 2008 08:25:41 +0000 From: Alexey Dokuchaev To: Ed Schouten Message-ID: <20081220082541.GB93072@FreeBSD.org> References: <200812191449.mBJEnFOb074699@svn.freebsd.org> <20081219154748.GC1176@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20081219154748.GC1176@hoeg.nl> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r186322 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 08:25:41 -0000 On Fri, Dec 19, 2008 at 04:47:48PM +0100, Ed Schouten wrote: > If we're renaming them to <=6-character strings, maybe it's better to > use "ttyin" and "ttybg"? The old TTY code used these strings as well. > > I've also got a small preference of "ttymtx" over "ttylck". "ttymtx" > makes it more clear it is blocked on the mutex, while "lck" could be > literally any form of locking (file locking?). Seconded. ./danfe From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 09:36:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F6681065670; Sat, 20 Dec 2008 09:36:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E20D8FC13; Sat, 20 Dec 2008 09:36:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBK9afRM097346; Sat, 20 Dec 2008 09:36:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBK9afrK097345; Sat, 20 Dec 2008 09:36:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200812200936.mBK9afrK097345@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Dec 2008 09:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186354 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 09:36:41 -0000 Author: ed Date: Sat Dec 20 09:36:40 2008 New Revision: 186354 URL: http://svn.freebsd.org/changeset/base/186354 Log: Let wchan names more closely match pre-MPSAFE TTY behaviour. Right now the wchan strings "ttyinp" and "ttybgw" only differ one character from the strings we used prior to MPSAFE TTY. Just rename them back to their pre-MPSAFE TTY counterparts. Also rename "ttylck" to "ttymtx", which should make it more clear that a process is blocked on the TTY mutex, not some other form of locking. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Dec 20 05:56:08 2008 (r186353) +++ head/sys/kern/tty.c Sat Dec 20 09:36:40 2008 (r186354) @@ -871,9 +871,9 @@ tty_alloc(struct ttydevsw *tsw, void *sc tty_init_termios(tp); - cv_init(&tp->t_inwait, "ttyinp"); + cv_init(&tp->t_inwait, "ttyin"); cv_init(&tp->t_outwait, "ttyout"); - cv_init(&tp->t_bgwait, "ttybgw"); + cv_init(&tp->t_bgwait, "ttybg"); cv_init(&tp->t_dcdwait, "ttydcd"); ttyinq_init(&tp->t_inq); @@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc tp->t_mtx = mutex; } else { tp->t_mtx = &tp->t_mtxobj; - mtx_init(&tp->t_mtxobj, "ttylck", NULL, MTX_DEF); + mtx_init(&tp->t_mtxobj, "ttymtx", NULL, MTX_DEF); } knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 11:55:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96070106564A; Sat, 20 Dec 2008 11:55:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 385388FC08; Sat, 20 Dec 2008 11:55:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LE0QQ-000Owm-3A; Sat, 20 Dec 2008 13:55:18 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mBKBt6gl020658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Dec 2008 13:55:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mBKBt5h1052910; Sat, 20 Dec 2008 13:55:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mBKBt5Ag052909; Sat, 20 Dec 2008 13:55:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 20 Dec 2008 13:55:05 +0200 From: Kostik Belousov To: Maxim Sobolev Message-ID: <20081220115505.GZ2038@deviant.kiev.zoral.com.ua> References: <200812192020.mBJKKEIo081792@svn.freebsd.org> <494C097C.1020604@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OM3frZe47dgZ1O53" Content-Disposition: inline In-Reply-To: <494C097C.1020604@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LE0QQ-000Owm-3A 64e6314b02f53f1f1aba14566fcfda6b X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn: head/usr.sbin/burncd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 11:55:19 -0000 --OM3frZe47dgZ1O53 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 19, 2008 at 12:52:12PM -0800, Maxim Sobolev wrote: > Should not it be better to implement this on the kernel side when the=20 > device is closed abruptly? The state that is kept is not accumulated on any particular filedescriptor, it is associated with the physical state of the device. Therefore, I think that kernel shall not be charged with cleanup, and userspace calls should deal with resetting device back to the pristine state. >=20 > David E. O'Brien wrote: > >Author: obrien > >Date: Fri Dec 19 20:20:14 2008 > >New Revision: 186337 > >URL: http://svn.freebsd.org/changeset/base/186337 > > > >Log: > > burncd(8) doesn't handle signals and interrupting burncd during=20 > > operation. > > For example, ^C (SIGINT) may leave the drive spinning and locked. > > This may also happen if you try to write a too-large image to a disc > > and burncd(8) exits with an I/O error. > > =20 > > Add signal handling by doing a CDRIOCFLUSH ioctl to attempt to leave > > burner in a sane state when burning is interrupted with SIGHUP, SIGINT, > > SIGTERM, or in case an I/O error occurs during write. > > Note, that blanking will still continue after interrupt but it seems to > > finish correctly even after burncd(8) has quit. >=20 > -Maxim --OM3frZe47dgZ1O53 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAklM3RkACgkQC3+MBN1Mb4gP9QCdEf4Cx27uFgNZr1+2D4YFj3H0 FSMAn1dbiKVrEcCuBUAkmjmFJhygizAa =hwah -----END PGP SIGNATURE----- --OM3frZe47dgZ1O53-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 15:11:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDCEE106564A; Sat, 20 Dec 2008 15:11:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3E68FC14; Sat, 20 Dec 2008 15:11:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKFB02x007022; Sat, 20 Dec 2008 15:11:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKFB02t007021; Sat, 20 Dec 2008 15:11:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200812201511.mBKFB02t007021@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Dec 2008 15:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186355 - head/sys/sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 15:11:01 -0000 Author: nwhitehorn Date: Sat Dec 20 15:11:00 2008 New Revision: 186355 URL: http://svn.freebsd.org/changeset/base/186355 Log: Missed the sun4v update to ofw_machdep.h in the OFW modularization commit. Modified: head/sys/sun4v/include/ofw_machdep.h Modified: head/sys/sun4v/include/ofw_machdep.h ============================================================================== --- head/sys/sun4v/include/ofw_machdep.h Sat Dec 20 09:36:40 2008 (r186354) +++ head/sys/sun4v/include/ofw_machdep.h Sat Dec 20 15:11:00 2008 (r186355) @@ -29,10 +29,15 @@ #define _MACHINE_OFW_MACHDEP_H_ #include +#include +#include + +typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); void cpu_shutdown(void *); -void openfirmware_exit(void *); +int ofw_entry(void *); +void ofw_exit(void *); #endif /* _MACHINE_OFW_MACHDEP_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:43:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD431065674; Sat, 20 Dec 2008 16:43:56 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55CF58FC1D; Sat, 20 Dec 2008 16:43:56 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKGhukj008832; Sat, 20 Dec 2008 16:43:56 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKGhutE008831; Sat, 20 Dec 2008 16:43:56 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201643.mBKGhutE008831@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 16:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186356 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 16:43:56 -0000 Author: harti Date: Sat Dec 20 16:43:54 2008 New Revision: 186356 URL: http://svn.freebsd.org/changeset/base/186356 Log: Open vendor/bsnmp for commits. Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Sat Dec 20 15:11:00 2008 (r186355) +++ svnadmin/conf/paths Sat Dec 20 16:43:54 2008 (r186356) @@ -46,6 +46,7 @@ ^vendor/cpio ^vendor/bind9 +^vendor/bsnmp ^vendor/gdtoa ^vendor/ncurses ^vendor/netcat From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 16:44:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D3D1065673; Sat, 20 Dec 2008 16:44:44 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD6F28FC1E; Sat, 20 Dec 2008 16:44:44 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKGiir8008908; Sat, 20 Dec 2008 16:44:44 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKGiiMO008896; Sat, 20 Dec 2008 16:44:44 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201644.mBKGiiMO008896@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 16:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186357 - in vendor/bsnmp: 1.10 1.10/contrib 1.10/gensnmpdef 1.10/gensnmptree 1.10/lib 1.10/snmp_mibII 1.10/snmp_ntp 1.10/snmpd 1.11 1.11/config 1.11/contrib 1.11/gensnmpdef 1.11/gensnm... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 16:44:44 -0000 Author: harti Date: Sat Dec 20 16:44:43 2008 New Revision: 186357 URL: http://svn.freebsd.org/changeset/base/186357 Log: Flatten bsnmp vendor area. Added: vendor/bsnmp/1.10/NEWS - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS vendor/bsnmp/1.10/README - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/README vendor/bsnmp/1.10/TODO - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO vendor/bsnmp/1.10/VERSION - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION vendor/bsnmp/1.10/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.10/gensnmptree/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.10/lib/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/lib/ vendor/bsnmp/1.10/oid-list - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list vendor/bsnmp/1.10/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.10/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.10/snmpd/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmpd/ vendor/bsnmp/1.11/Makefile.in - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in vendor/bsnmp/1.11/NEWS - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS vendor/bsnmp/1.11/README - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/README vendor/bsnmp/1.11/TODO - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO vendor/bsnmp/1.11/VERSION - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION vendor/bsnmp/1.11/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4 vendor/bsnmp/1.11/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/aclocal.m4 vendor/bsnmp/1.11/config/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/config/ vendor/bsnmp/1.11/configure - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/configure vendor/bsnmp/1.11/configure.ac - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/configure.ac vendor/bsnmp/1.11/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.11/gensnmptree/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.11/lib/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/lib/ vendor/bsnmp/1.11/oid-list - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/oid-list vendor/bsnmp/1.11/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.11/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.11/snmpd/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmpd/ vendor/bsnmp/1.12/NEWS - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/NEWS vendor/bsnmp/1.12/README - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/README vendor/bsnmp/1.12/TODO - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/TODO vendor/bsnmp/1.12/VERSION - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/VERSION vendor/bsnmp/1.12/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.12/gensnmptree/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.12/lib/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/lib/ vendor/bsnmp/1.12/oid-list - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/oid-list vendor/bsnmp/1.12/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.12/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.12/snmpd/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmpd/ vendor/bsnmp/1.4/NEWS - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/NEWS vendor/bsnmp/1.4/README - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/README vendor/bsnmp/1.4/TODO - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/TODO vendor/bsnmp/1.4/VERSION - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/VERSION vendor/bsnmp/1.4/gensnmptree/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.4/lib/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/lib/ vendor/bsnmp/1.4/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.4/snmpd/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/snmpd/ vendor/bsnmp/1.5a/FREEBSD-upgrade - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/FREEBSD-upgrade vendor/bsnmp/1.5a/NEWS - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/NEWS vendor/bsnmp/1.5a/README - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/README vendor/bsnmp/1.5a/TODO - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/TODO vendor/bsnmp/1.5a/VERSION - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/VERSION vendor/bsnmp/1.5a/gensnmptree/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.5a/lib/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/lib/ vendor/bsnmp/1.5a/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.5a/snmpd/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/snmpd/ vendor/bsnmp/1.6/NEWS - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/NEWS vendor/bsnmp/1.6/README - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/README vendor/bsnmp/1.6/TODO - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/TODO vendor/bsnmp/1.6/VERSION - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/VERSION vendor/bsnmp/1.6/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.6/gensnmptree/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.6/lib/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/lib/ vendor/bsnmp/1.6/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.6/snmpd/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/snmpd/ vendor/bsnmp/1.7/NEWS - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/NEWS vendor/bsnmp/1.7/README - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/README vendor/bsnmp/1.7/TODO - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/TODO vendor/bsnmp/1.7/VERSION - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/VERSION vendor/bsnmp/1.7/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.7/gensnmptree/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.7/lib/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/lib/ vendor/bsnmp/1.7/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.7/snmpd/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/snmpd/ vendor/bsnmp/1.8/NEWS - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/NEWS vendor/bsnmp/1.8/README - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/README vendor/bsnmp/1.8/TODO - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/TODO vendor/bsnmp/1.8/VERSION - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/VERSION vendor/bsnmp/1.8/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.8/gensnmptree/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.8/lib/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/lib/ vendor/bsnmp/1.8/oid-list - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/oid-list vendor/bsnmp/1.8/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.8/snmpd/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/snmpd/ vendor/bsnmp/1.9/NEWS - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/NEWS vendor/bsnmp/1.9/README - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/README vendor/bsnmp/1.9/TODO - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/TODO vendor/bsnmp/1.9/VERSION - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/VERSION vendor/bsnmp/1.9/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.9/gensnmptree/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.9/lib/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/lib/ vendor/bsnmp/1.9/oid-list - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/oid-list vendor/bsnmp/1.9/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.9/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.9/snmpd/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmpd/ vendor/bsnmp/dist/Makefile.in - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/Makefile.in vendor/bsnmp/dist/NEWS - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/NEWS vendor/bsnmp/dist/README - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/README vendor/bsnmp/dist/TODO - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/TODO vendor/bsnmp/dist/VERSION - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/VERSION vendor/bsnmp/dist/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/acinclude.m4 vendor/bsnmp/dist/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/aclocal.m4 vendor/bsnmp/dist/config/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/config/ vendor/bsnmp/dist/configure - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/configure vendor/bsnmp/dist/configure.ac - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/configure.ac vendor/bsnmp/dist/gensnmpdef/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/dist/gensnmptree/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/gensnmptree/ vendor/bsnmp/dist/lib/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/lib/ vendor/bsnmp/dist/oid-list - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/oid-list vendor/bsnmp/dist/snmp_mibII/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/dist/snmp_ntp/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/dist/snmpd/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmpd/ vendor/bsnmp/syrinx_20080307_bugfix/Makefile.in - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/Makefile.in vendor/bsnmp/syrinx_20080307_bugfix/NEWS - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/NEWS vendor/bsnmp/syrinx_20080307_bugfix/README - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/README vendor/bsnmp/syrinx_20080307_bugfix/TODO - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/TODO vendor/bsnmp/syrinx_20080307_bugfix/VERSION - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/VERSION vendor/bsnmp/syrinx_20080307_bugfix/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/acinclude.m4 vendor/bsnmp/syrinx_20080307_bugfix/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/aclocal.m4 vendor/bsnmp/syrinx_20080307_bugfix/config/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/config/ vendor/bsnmp/syrinx_20080307_bugfix/configure - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/configure vendor/bsnmp/syrinx_20080307_bugfix/configure.ac - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/configure.ac vendor/bsnmp/syrinx_20080307_bugfix/gensnmpdef/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/syrinx_20080307_bugfix/gensnmptree/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/gensnmptree/ vendor/bsnmp/syrinx_20080307_bugfix/lib/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/lib/ vendor/bsnmp/syrinx_20080307_bugfix/oid-list - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/oid-list vendor/bsnmp/syrinx_20080307_bugfix/snmp_mibII/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/syrinx_20080307_bugfix/snmp_ntp/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/syrinx_20080307_bugfix/snmpd/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmpd/ Deleted: vendor/bsnmp/1.10/contrib/ vendor/bsnmp/1.11/contrib/ vendor/bsnmp/1.12/contrib/ vendor/bsnmp/1.4/contrib/ vendor/bsnmp/1.5a/contrib/ vendor/bsnmp/1.6/contrib/ vendor/bsnmp/1.7/contrib/ vendor/bsnmp/1.8/contrib/ vendor/bsnmp/1.9/contrib/ vendor/bsnmp/dist/contrib/ vendor/bsnmp/syrinx_20080307_bugfix/contrib/ Copied: vendor/bsnmp/1.10/NEWS (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/NEWS Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS) @@ -0,0 +1,142 @@ +1.10 + Change all the tick handling in the daemon from 32-bit to 64-bit. + Bump the modules' major version number to 3. + + snmp_dialog: make the syntax of the variable bindings in the outgoing + message SNMP_SYNTAX_NULL regardless of the syntax given by the user. + + Fix an error in timer handling in the LIBBEGEMOT case. + + snmpd/main.c: Fix a 64-bit warning. + + lib/snmpclient: Add snmp_parse_server(). + +1.9 + tcpwrapper support from glebius@freebsd.org. + + crude interface to NTP: snmp_ntp + +1.8 + many man page fixes from ru@freebsd.org and tobez@freebsd.org + + snmpd/main.c: fix a problem which resulted in the daemon exiting + when a local socket was closed. + + snmpd/trans_lsock.c: include stdio.h to get a prototype for remove. + + gensnmptree/gensnmptree.c: fix a compile error + + snmp_mibII: add new field spec_oid to ifmib. This allows ifType + specific modules to insert the value to be returned for ifSpecific. + +1.7a + fix core dump when config file cannot be opened (submitted by + Maxim Konovalov) + +1.7 + snmpd: Move event library initialisation before reading of + config file (thanks to phk). + + gensnmptree: can now read more than one tree and merge them. + + some support for compilation on older systems + + use standard C fixed width integer types [u]intNN_t + +1.6 + New gensnmpdef tool. Needs libsmi. + + Make build infrastructure more intelligent. + + Fix a typo in the mibII counter retrival code. + + Add a new field to struct snmp_node for snmp agents: tree_data. + This field can be used by the application. + + Fix a syntax error in the example configuration file (thanks to + David J Duchscher). + + Fix a long standing problem with the module loading code + and a memory leak. When a module could not be loaded usually + a core dump was generated. This was caused by wrong handling + of malloced memory in the module table dependency. While + fixing this problem it became obvious that dynamic allocated + data which was held in a dependency could be lost, because + there was no guarantee that the dependency handler ever was + call (in case of an error in a SET handler or an earlier + dependency in the same PDU) thus causing this memory to leak. + To fix this a third dependency operation is introduced + SNMP_DEPOP_FINISH which is invoked just before a dependency + is freed at the very end of the SET PDU handling. This + means also that finalizers (set_atfinish) can be converted + to DEPOP_FINISH handler in almost all cases. The only case + where this is not so easy is when a finializer was registered + for a simple SET operation. In this case an artifical dependency + would be needed. Because this seems to occure very seldom the + snmp_set_atfinish() call is removed. Thanks to Paul-Henning Kamp + for an initial fix for the core dump. + +09-Dec-2003 + First step on factoring out the transport mapping stuff into + loadable modules. + + Local stream sockets that check the clients privileges. + +03-Dec-2003 + Bump version to 1.5 but leave library version intact. + +03-Dec-2003 + Now works with libbegemot polling stuff instead of libisc. + Use --with-libbegemot[=path] to configure. + +03-Dec-2003 + Fix parsing of non-minimal ASN.1 integers. They are now disallowed. + Non-minimal lengths are allowed. + + Remove copyright clause 3 everywhere. + + Make an autoconf build infrastructure. + +08-Nov-2003 + WARNS=6 fixed. + +28-Jan-2003 + WARNS=5 fixes. + +09-Jan-2003 + snmpd: remove local socket in case of an error to fully initialize it. + Use chmod instead of fchmod. The latter seems not really to change + the mode of the socket. + + lib: at program exit remove the local socket in the library. + +11-Dec-2002 + Implement listening on unix domain sockets. The client must bind + its socket, or the server cannot send back its response. These + sockets are considered to be more secure, because it is much + harder for an intruder to listen on them. + + This requires changes in snmpmod.h and snmpclient.h. + +04-Dec-2002 + Sparc fixes. + +15-Aug-2002 + Use inttypes.h instead of limits.h to get integer limits. This + seems to be the Posix way. + + First drafts of an snmpd, gensnmptree, asn1, bsnmplib, + bsnmpclient, bsnmpagent, snmpmod, snmp_mibII, snmp_netgraph man pages. + + snmpd/main.c: reorder getopt options according to style(9). Implement + a -h option to print a short help. + +25-Jun-2002 + Makefiles rewritten to not use bsnmpmod.mk. The BSD makefiles are + really hard to use, because a) they are not documented and b) they + change much too often. + + Make the patch a context diff instead of a unified one. + +28-Feb-2002 + Library code for SNMP clients. Copied: vendor/bsnmp/1.10/README (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/README Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/README) @@ -0,0 +1,65 @@ +Fri Dec 5 15:01:16 CET 2003 + +This is a mini-SNMP daemon. The basic daemon implements the system group +and a number of private extensions to manage the UDP transport mapping, +communities, trap destinations and loadable modules. In this form it can +be used to provide remote access to arbitrary data that can be described in +the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c. + +One basic loadable module is provided together with the daemon: + +- snmp_mibII provides the information groups for ip, tcp, and udp. + +Installation +------------ + +As usual by doing: + + configure [--with-libbegemot[=path]] + make + make install + +This does not install a configuration file. The standard location for the +configuration is /etc/snmpd.config, but can be overwritten on the command +line. An example configuration file is provided. Use --with-libbegemot +to use libbegemot instead of libisc. + +Running +------- + + snmpd [-m name[=value]] [-p pid-file] [-c config-file] [-d] [-l prefix] + [-D debug-flags] [-I path] + + -m defines a configuration macro. If no value is given it + is set to the empty string. + + -p specify the file where to store the PID. Default is + /var/run/{prefix}.pid. + + -c specify the configuration file. Default is /etc/{prefix}.config. + + -d don't go into daemon mode. + + -l specify the prefix. This is used for the default config and + pid file names and for the syslog. Default is "snmpd". + + -D specify debug flags: + + d dump all PDUs. + + e debug event library. + + -I specify the include path for system configuration files. + Default is /etc:/usr/etc:/usr/local/etc. + +The directory snmpd contains a snmpd.sh script, which can be copied to +/usr/local/etc/rc.d to automatically start and stop the daemon. snmpd.config +is an example config script. + +Bug reports: +----------- + +Please report bugs to harti@freebsd.org. + +Happy hacking, +harti Copied: vendor/bsnmp/1.10/TODO (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/TODO Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO) @@ -0,0 +1,17 @@ +snmpd_mibII: + - handle HC counters by periodically polling the kernel counters. + +snmpd: + - rethink transports a little bit: make them loadable and make + a private subtree for transports: + OK. Table not writeable yet. + + There should be a transport table that is indexed by the transport name. + This table can be used to load/unload transports at run time. + OK. Table not writeable yet. + + Then there can be a port table that is indexed by transport name and + port name. Plus a transport-specific table indexed by port name only. + + The transport table could contain a column of type OID that points + to the transport-specific table. Copied: vendor/bsnmp/1.10/VERSION (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/VERSION Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION) @@ -0,0 +1 @@ +1.10 Copied: vendor/bsnmp/1.10/oid-list (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/oid-list Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list) @@ -0,0 +1,23 @@ +$Begemot: bsnmp/oid-list,v 1.3 2005/05/23 09:03:22 brandt_h Exp $ + +This file documents the OID assignments under BSNMP's private OID. + +While I was at Fraunhofer Fokus (www.fokus.fraunhofer.de) I registered +an official OID for Fokus: enterprises 12325 and assigned the sub-OID 1 +to the software I develop. Under this OID there are: + +enterprises + 12325 FOKUS + 1 BEGEMOT + 1 BEGEMOT-SNMPD + 2 BEGEMOT-NETGRAPH snmpd netgraph module + 100 BEGEMOT-ILMID snmpd ILMID module + 101 BEGEMOT-ATM snmpd ATM module + 200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org) + 201 BEGEMOT-NTP snmpd NTP module + 300 BEGEMOT-ACM DLR ACM project + +If you need an OID and don't know where to stuck it in, I can assign you one - +just drop me a mail. + +harti Copied: vendor/bsnmp/1.11/Makefile.in (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/Makefile.in Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in) @@ -0,0 +1,38 @@ +# Copyright (c) 2001-2003 +# Fraunhofer Institute for Open Communication Systems (FhG Fokus). +# All rights reserved. +# +# Author: Harti Brandt +# +# $Begemot: bsnmp/Makefile.in,v 1.4 2005/10/04 11:21:22 brandt_h Exp $ +# + +SUBDIR= lib gensnmptree snmpd snmp_mibII snmp_ntp + +ifeq "$(HAVE_LIBSMI)" "yes" +SUBDIR += gensnmpdef +endif + +all: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f all ; then \ + break ; \ + fi ; \ + done + +install: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f install ; then \ + break ; \ + fi ; \ + done + +clean: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f clean ; then \ + break ; \ + fi ; \ + done Copied: vendor/bsnmp/1.11/NEWS (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/NEWS Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS) @@ -0,0 +1,164 @@ +1.11 Make the Mib2 routing table use red-black tree. This vastly + reduces loading and access time. Load the table only every 10 + minutes. In the meantime process message from the routing socket + to update the table. + + Lot of man-page fixes from ru@freebsd.org. + + Fixes to command line macros and macro redefinition. + + Trap variables for ntp (still need trap definition and code). + + Periodic timers from Victor Cruceru. + + Man-page fixes from Christian Brueffer. + + Lots of spelling fixes from Giorgios Keramidas. + + A number of changes to facilitate building on FreeBSD-4 from + Andrey Elsukov. + + Add repeatable timers. + +1.10 + Change all the tick handling in the daemon from 32-bit to 64-bit. + Bump the modules' major version number to 3. + + snmp_dialog: make the syntax of the variable bindings in the outgoing + message SNMP_SYNTAX_NULL regardless of the syntax given by the user. + + Fix an error in timer handling in the LIBBEGEMOT case. + + snmpd/main.c: Fix a 64-bit warning. + + lib/snmpclient: Add snmp_parse_server(). + +1.9 + tcpwrapper support from glebius@freebsd.org. + + crude interface to NTP: snmp_ntp + +1.8 + many man page fixes from ru@freebsd.org and tobez@freebsd.org + + snmpd/main.c: fix a problem which resulted in the daemon exiting + when a local socket was closed. + + snmpd/trans_lsock.c: include stdio.h to get a prototype for remove. + + gensnmptree/gensnmptree.c: fix a compile error + + snmp_mibII: add new field spec_oid to ifmib. This allows ifType + specific modules to insert the value to be returned for ifSpecific. + +1.7a + fix core dump when config file cannot be opened (submitted by + Maxim Konovalov) + +1.7 + snmpd: Move event library initialization before reading of + config file (thanks to phk). + + gensnmptree: can now read more than one tree and merge them. + + some support for compilation on older systems + + use standard C fixed width integer types [u]intNN_t + +1.6 + New gensnmpdef tool. Needs libsmi. + + Make build infrastructure more intelligent. + + Fix a typo in the mibII counter retrival code. + + Add a new field to struct snmp_node for snmp agents: tree_data. + This field can be used by the application. + + Fix a syntax error in the example configuration file (thanks to + David J Duchscher). + + Fix a long standing problem with the module loading code + and a memory leak. When a module could not be loaded usually + a core dump was generated. This was caused by wrong handling + of malloced memory in the module table dependency. While + fixing this problem it became obvious that dynamic allocated + data which was held in a dependency could be lost, because + there was no guarantee that the dependency handler ever was + call (in case of an error in a SET handler or an earlier + dependency in the same PDU) thus causing this memory to leak. + To fix this a third dependency operation is introduced + SNMP_DEPOP_FINISH which is invoked just before a dependency + is freed at the very end of the SET PDU handling. This + means also that finalizers (set_atfinish) can be converted + to DEPOP_FINISH handler in almost all cases. The only case + where this is not so easy is when a finializer was registered + for a simple SET operation. In this case an artifical dependency + would be needed. Because this seems to occure very seldom the + snmp_set_atfinish() call is removed. Thanks to Paul-Henning Kamp + for an initial fix for the core dump. + +09-Dec-2003 + First step on factoring out the transport mapping stuff into + loadable modules. + + Local stream sockets that check the clients privileges. + +03-Dec-2003 + Bump version to 1.5 but leave library version intact. + +03-Dec-2003 + Now works with libbegemot polling stuff instead of libisc. + Use --with-libbegemot[=path] to configure. + +03-Dec-2003 + Fix parsing of non-minimal ASN.1 integers. They are now disallowed. + Non-minimal lengths are allowed. + + Remove copyright clause 3 everywhere. + + Make an autoconf build infrastructure. + +08-Nov-2003 + WARNS=6 fixed. + +28-Jan-2003 + WARNS=5 fixes. + +09-Jan-2003 + snmpd: remove local socket in case of an error to fully initialize it. + Use chmod instead of fchmod. The latter seems not really to change + the mode of the socket. + + lib: at program exit remove the local socket in the library. + +11-Dec-2002 + Implement listening on unix domain sockets. The client must bind + its socket, or the server cannot send back its response. These + sockets are considered to be more secure, because it is much + harder for an intruder to listen on them. + + This requires changes in snmpmod.h and snmpclient.h. + +04-Dec-2002 + Sparc fixes. + +15-Aug-2002 + Use inttypes.h instead of limits.h to get integer limits. This + seems to be the Posix way. + + First drafts of an snmpd, gensnmptree, asn1, bsnmplib, + bsnmpclient, bsnmpagent, snmpmod, snmp_mibII, snmp_netgraph man pages. + + snmpd/main.c: reorder getopt options according to style(9). Implement + a -h option to print a short help. + +25-Jun-2002 + Makefiles rewritten to not use bsnmpmod.mk. The BSD makefiles are + really hard to use, because a) they are not documented and b) they + change much too often. + + Make the patch a context diff instead of a unified one. + +28-Feb-2002 + Library code for SNMP clients. Copied: vendor/bsnmp/1.11/README (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/README Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/README) @@ -0,0 +1,65 @@ +Fri Dec 5 15:01:16 CET 2003 + +This is a mini-SNMP daemon. The basic daemon implements the system group +and a number of private extensions to manage the UDP transport mapping, +communities, trap destinations and loadable modules. In this form it can +be used to provide remote access to arbitrary data that can be described in +the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c. + +One basic loadable module is provided together with the daemon: + +- snmp_mibII provides the information groups for ip, tcp, and udp. + +Installation +------------ + +As usual by doing: + + configure [--with-libbegemot[=path]] + make + make install + +This does not install a configuration file. The standard location for the +configuration is /etc/snmpd.config, but can be overwritten on the command +line. An example configuration file is provided. Use --with-libbegemot +to use libbegemot instead of libisc. + +Running +------- + + snmpd [-m name[=value]] [-p pid-file] [-c config-file] [-d] [-l prefix] + [-D debug-flags] [-I path] + + -m defines a configuration macro. If no value is given it + is set to the empty string. + + -p specify the file where to store the PID. Default is + /var/run/{prefix}.pid. + + -c specify the configuration file. Default is /etc/{prefix}.config. + + -d don't go into daemon mode. + + -l specify the prefix. This is used for the default config and + pid file names and for the syslog. Default is "snmpd". + + -D specify debug flags: + + d dump all PDUs. + + e debug event library. + + -I specify the include path for system configuration files. + Default is /etc:/usr/etc:/usr/local/etc. + +The directory snmpd contains a snmpd.sh script, which can be copied to +/usr/local/etc/rc.d to automatically start and stop the daemon. snmpd.config +is an example config script. + +Bug reports: +----------- + +Please report bugs to harti@freebsd.org. + +Happy hacking, +harti Copied: vendor/bsnmp/1.11/TODO (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/TODO Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO) @@ -0,0 +1,17 @@ +snmpd_mibII: + - handle HC counters by periodically polling the kernel counters. + +snmpd: + - rethink transports a little bit: make them loadable and make + a private subtree for transports: + OK. Table not writeable yet. + + There should be a transport table that is indexed by the transport name. + This table can be used to load/unload transports at run time. + OK. Table not writeable yet. + + Then there can be a port table that is indexed by transport name and + port name. Plus a transport-specific table indexed by port name only. + + The transport table could contain a column of type OID that points + to the transport-specific table. Copied: vendor/bsnmp/1.11/VERSION (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/VERSION Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION) @@ -0,0 +1 @@ +1.11 Copied: vendor/bsnmp/1.11/acinclude.m4 (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/acinclude.m4 Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4) @@ -0,0 +1,5867 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:07:19 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D89431065677; Sat, 20 Dec 2008 17:07:19 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD728FC14; Sat, 20 Dec 2008 17:07:19 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id mBKH7HGJ006511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Dec 2008 09:07:18 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <494D2603.9000001@FreeBSD.org> Date: Sat, 20 Dec 2008 09:06:11 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Kostik Belousov References: <200812192020.mBJKKEIo081792@svn.freebsd.org> <494C097C.1020604@FreeBSD.org> <20081220115505.GZ2038@deviant.kiev.zoral.com.ua> In-Reply-To: <20081220115505.GZ2038@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" Subject: Re: svn: head/usr.sbin/burncd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:07:20 -0000 Kostik Belousov wrote: > On Fri, Dec 19, 2008 at 12:52:12PM -0800, Maxim Sobolev wrote: >> Should not it be better to implement this on the kernel side when the >> device is closed abruptly? > The state that is kept is not accumulated on any particular filedescriptor, > it is associated with the physical state of the device. > > Therefore, I think that kernel shall not be charged with cleanup, and > userspace calls should deal with resetting device back to the pristine > state. It may not be associated with any particular descriptor, still you can count number of opens for write compared to count of closes in the kernel. And it should be trivial to track when this number goes down to 0 and clean up any leftover mess. Check dev/md/md.c for example, function g_md_access(). -Maxim From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:15:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C562106564A; Sat, 20 Dec 2008 17:15:57 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490CE8FC0C; Sat, 20 Dec 2008 17:15:57 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHFue5009489; Sat, 20 Dec 2008 17:15:56 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHFucC009488; Sat, 20 Dec 2008 17:15:56 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201715.mBKHFucC009488@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186358 - in vendor/bsnmp/dist: . config gensnmpdef gensnmptree lib snmp_mibII snmp_ntp snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:15:57 -0000 Author: harti Date: Sat Dec 20 17:15:56 2008 New Revision: 186358 URL: http://svn.freebsd.org/changeset/base/186358 Log: Remove the svn:keywords property. Modified: vendor/bsnmp/dist/Makefile.in (props changed) vendor/bsnmp/dist/NEWS (props changed) vendor/bsnmp/dist/README (props changed) vendor/bsnmp/dist/TODO (props changed) vendor/bsnmp/dist/VERSION (props changed) vendor/bsnmp/dist/acinclude.m4 (props changed) vendor/bsnmp/dist/aclocal.m4 (props changed) vendor/bsnmp/dist/config/Makefile.build (props changed) vendor/bsnmp/dist/config/Makefile.post (props changed) vendor/bsnmp/dist/config/Makefile.pre (props changed) vendor/bsnmp/dist/config/config.guess (props changed) vendor/bsnmp/dist/config/config.sub (props changed) vendor/bsnmp/dist/config/install.sh (props changed) vendor/bsnmp/dist/config/ltmain.sh (props changed) vendor/bsnmp/dist/config/mkinstalldirs (props changed) vendor/bsnmp/dist/configure (props changed) vendor/bsnmp/dist/configure.ac (props changed) vendor/bsnmp/dist/gensnmpdef/Makefile.in (props changed) vendor/bsnmp/dist/gensnmpdef/gensnmpdef.1 (props changed) vendor/bsnmp/dist/gensnmpdef/gensnmpdef.c (props changed) vendor/bsnmp/dist/gensnmptree/Makefile.in (props changed) vendor/bsnmp/dist/gensnmptree/gensnmptree.1 (props changed) vendor/bsnmp/dist/gensnmptree/gensnmptree.c (props changed) vendor/bsnmp/dist/lib/Makefile.in (props changed) vendor/bsnmp/dist/lib/asn1.3 (props changed) vendor/bsnmp/dist/lib/asn1.c (props changed) vendor/bsnmp/dist/lib/asn1.h (props changed) vendor/bsnmp/dist/lib/bsnmpagent.3 (props changed) vendor/bsnmp/dist/lib/bsnmpclient.3 (props changed) vendor/bsnmp/dist/lib/bsnmplib.3 (props changed) vendor/bsnmp/dist/lib/snmp.c (props changed) vendor/bsnmp/dist/lib/snmp.h (props changed) vendor/bsnmp/dist/lib/snmpagent.c (props changed) vendor/bsnmp/dist/lib/snmpagent.h (props changed) vendor/bsnmp/dist/lib/snmpclient.c (props changed) vendor/bsnmp/dist/lib/snmpclient.h (props changed) vendor/bsnmp/dist/lib/snmppriv.h (props changed) vendor/bsnmp/dist/lib/support.c (props changed) vendor/bsnmp/dist/lib/support.h (props changed) vendor/bsnmp/dist/oid-list (props changed) vendor/bsnmp/dist/snmp_mibII/BEGEMOT-IP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_mibII/BEGEMOT-MIB2-MIB.txt (props changed) vendor/bsnmp/dist/snmp_mibII/mibII.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII.h (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_begemot.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ifmib.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ifstack.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_interfaces.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ip.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ipaddr.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_nettomedia.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_rcvaddr.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_route.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_tcp.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_tree.def (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_udp.c (props changed) vendor/bsnmp/dist/snmp_mibII/snmp_mibII.3 (props changed) vendor/bsnmp/dist/snmp_mibII/snmp_mibII.h (props changed) vendor/bsnmp/dist/snmp_ntp/BEGEMOT-NTP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/Makefile.in (props changed) vendor/bsnmp/dist/snmp_ntp/NTP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/NTP-PROXY-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/ntp_tree.def (props changed) vendor/bsnmp/dist/snmp_ntp/snmp_ntp.c (props changed) vendor/bsnmp/dist/snmpd/.gdbinit (props changed) vendor/bsnmp/dist/snmpd/BEGEMOT-MIB.txt (props changed) vendor/bsnmp/dist/snmpd/BEGEMOT-SNMPD.txt (props changed) vendor/bsnmp/dist/snmpd/FOKUS-MIB.txt (props changed) vendor/bsnmp/dist/snmpd/Makefile.in (props changed) vendor/bsnmp/dist/snmpd/action.c (props changed) vendor/bsnmp/dist/snmpd/bsnmpd.1 (props changed) vendor/bsnmp/dist/snmpd/config.c (props changed) vendor/bsnmp/dist/snmpd/export.c (props changed) vendor/bsnmp/dist/snmpd/main.c (props changed) vendor/bsnmp/dist/snmpd/snmpd.config (props changed) vendor/bsnmp/dist/snmpd/snmpd.h (props changed) vendor/bsnmp/dist/snmpd/snmpd.sh (props changed) vendor/bsnmp/dist/snmpd/snmpmod.3 (props changed) vendor/bsnmp/dist/snmpd/snmpmod.h (props changed) vendor/bsnmp/dist/snmpd/trans_lsock.c (props changed) vendor/bsnmp/dist/snmpd/trans_lsock.h (props changed) vendor/bsnmp/dist/snmpd/trans_udp.c (props changed) vendor/bsnmp/dist/snmpd/trans_udp.h (props changed) vendor/bsnmp/dist/snmpd/trap.c (props changed) vendor/bsnmp/dist/snmpd/tree.def (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:30:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8EFA106564A; Sat, 20 Dec 2008 17:30:04 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE598FC12; Sat, 20 Dec 2008 17:30:04 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHU4Vk009779; Sat, 20 Dec 2008 17:30:04 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHU4pD009778; Sat, 20 Dec 2008 17:30:04 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201730.mBKHU4pD009778@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186359 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:30:04 -0000 Author: harti Date: Sat Dec 20 17:30:03 2008 New Revision: 186359 URL: http://svn.freebsd.org/changeset/base/186359 Log: Open the libbegemot vendor area for commits. Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Sat Dec 20 17:15:56 2008 (r186358) +++ svnadmin/conf/paths Sat Dec 20 17:30:03 2008 (r186359) @@ -48,6 +48,7 @@ ^vendor/bind9 ^vendor/bsnmp ^vendor/gdtoa +^vendor/libbegemot ^vendor/ncurses ^vendor/netcat ^vendor/ntp From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:30:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 635461065674; Sat, 20 Dec 2008 17:30:32 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8EF8FC2A; Sat, 20 Dec 2008 17:30:32 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHUWXw009826; Sat, 20 Dec 2008 17:30:32 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHUWM5009821; Sat, 20 Dec 2008 17:30:32 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201730.mBKHUWM5009821@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186360 - in vendor/libbegemot: 1.1.1 1.1.1/contrib dist dist/contrib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:30:32 -0000 Author: harti Date: Sat Dec 20 17:30:32 2008 New Revision: 186360 URL: http://svn.freebsd.org/changeset/base/186360 Log: Flatten the libbegemot vendor area. Added: vendor/libbegemot/1.1.1/rpoll.c - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c vendor/libbegemot/1.1.1/rpoll.h - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h vendor/libbegemot/1.1.1/rpoll.man - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man vendor/libbegemot/dist/rpoll.c - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c vendor/libbegemot/dist/rpoll.h - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.h vendor/libbegemot/dist/rpoll.man - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.man Deleted: vendor/libbegemot/1.1.1/contrib/ vendor/libbegemot/dist/contrib/ Copied: vendor/libbegemot/1.1.1/rpoll.c (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.c Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c) @@ -0,0 +1,714 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation 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 or documentation 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * These functions try to hide the poll/select/setitimer interface from the + * user. You associate callback functions with file descriptors and timers. + * + * $Begemot: libbegemot/rpoll.c,v 1.14 2004/09/21 15:59:00 brandt Exp $ + */ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* + * There happens to be linuxes which read siginfo.h when including + * signal.h, which, for no appearent reason, defines these symbols. + */ +# ifdef POLL_IN +# undef POLL_IN +# endif +# ifdef POLL_OUT +# undef POLL_OUT +# endif + +# include "rpoll.h" + +/* +# define DEBUG +*/ + +# ifdef USE_POLL +# ifdef NEED_POLL_XOPEN_TWIDDLE +# define __USE_XOPEN +# endif +# include +# ifdef NEED_POLL_XOPEN_TWIDDLE +# undef __USE_XOPEN +# endif +# include +# endif + +/* + * the second define is for Linux, which sometimes fails to + * declare INFTIM. + */ +# if defined(USE_SELECT) || !defined(INFTIM) +# define INFTIM (-1) +# endif + +# if defined(SIGPOLL) +# define SIGNAL SIGPOLL +# else +# if defined(SIGIO) +# define SIGNAL SIGIO +# endif +# endif + +# ifdef USE_POLL +# define poll_in (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI) +# define poll_out (POLLOUT | POLLWRNORM | POLLWRBAND) +# define poll_except (POLLERR | POLLHUP) +# endif + +# ifdef BROKEN_SELECT_PROTO +# define SELECT_CAST(P) (int *)P +# else +# define SELECT_CAST(P) P +# endif + + +typedef signed long long tval_t; + +static inline tval_t GETMSECS(void); + +static inline tval_t +GETMSECS(void) { + struct timeval tval; + + (void)gettimeofday(&tval, NULL); + return (tval_t)tval.tv_sec*1000+tval.tv_usec/1000; +} + +/* + * Simple fatal exit. + */ +static void +_panic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "panic: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + + exit(1); +} + +static void * +_xrealloc(void *p, size_t s) +{ + void *ptr; + + if(p == NULL) { + if((ptr=malloc(s)) == NULL && (s!=0 || (ptr=malloc(1)) == NULL)) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } else if(s == 0) { + free(p); + if((ptr=malloc(s)) == NULL && (ptr=malloc(1)) == NULL) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } else { + if((ptr = realloc(p, s)) == NULL) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } + + return ptr; +} + +/* + * This structure holds one registration record for files + */ +typedef struct { + int fd; /* file descriptor (-1 if struct unused) */ + int mask; /* event flags */ + void * arg; /* client arg */ + poll_f func; /* handler */ +# ifdef USE_POLL + struct pollfd *pfd; /* pointer to corresponding poll() structure */ +# endif +} PollReg_t; + +/* + * Now for timers + */ +typedef struct { + u_int msecs; /* millisecond value of the timer */ + int repeat; /* one shot or repeat? */ + void *arg; /* client arg */ + timer_f func; /* handler, 0 means disfunct */ + tval_t when; /* next time to trigger in msecs! */ +} PollTim_t; + +/* how many records should our table grow at once? */ +# define POLL_REG_GROW 100 + +# ifdef USE_POLL +static struct pollfd * pfd; /* fd list for poll() */ +# endif + +# ifdef USE_SELECT +static fd_set rset, wset, xset; /* file descriptor sets for select() */ +static int maxfd; /* maximum fd number */ +# endif + +static int in_dispatch; + +static PollReg_t * regs; /* registration records */ +static u_int regs_alloc; /* how many are allocated */ +static u_int regs_used; /* upper used limit */ +static sigset_t bset; /* blocked signals */ +static int rebuild; /* rebuild table on next dispatch() */ + +static int * tfd; /* sorted entries */ +static u_int tfd_alloc; /* number of entries allocated */ +static u_int tfd_used; /* number of entries used */ +static PollTim_t * tims; /* timer registration records */ +static u_int tims_alloc; /* how many are allocated */ +static u_int tims_used; /* how many are used */ +static int resort; /* resort on next dispatch */ + +int rpoll_trace; +int rpoll_policy; /* if 0 start sched callbacks from 0 else try round robin */ + +static void poll_build(void); +static void poll_blocksig(void); +static void poll_unblocksig(void); +static void sort_timers(void); + + +/* + * Private function to block SIGPOLL or SIGIO for a short time. + * Don't forget to call poll_unblock before return from the calling function. + * Don't change the mask between this calls (your changes will be lost). + */ +static void +poll_blocksig(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGNAL); + + if(sigprocmask(SIG_BLOCK, &set, &bset)) + _panic("sigprocmask(SIG_BLOCK): %s", strerror(errno)); +} + +/* + * unblock the previously blocked signal + */ +static void +poll_unblocksig(void) +{ + if(sigprocmask(SIG_SETMASK, &bset, NULL)) + _panic("sigprocmask(SIG_SETMASK): %s", strerror(errno)); +} + +/* + * Register the file descriptor fd. If the event corresponding to + * mask arrives func is called with arg. + * If fd is already registered with that func and arg, only the mask + * is changed. + * We block the IO-signal, so the dispatch function can be called from + * within the signal handler. + */ +int +poll_register(int fd, poll_f func, void *arg, int mask) +{ + PollReg_t * p; + + poll_blocksig(); + + /* already registered? */ + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd == fd && p->func == func && p->arg == arg) { + p->mask = mask; + break; + } + + if(p == ®s[regs_alloc]) { + /* no - register */ + + /* find a free slot */ + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd == -1) + break; + + if(p == ®s[regs_alloc]) { + size_t newsize = regs_alloc + POLL_REG_GROW; + regs = _xrealloc(regs, sizeof(regs[0]) * newsize); + for(p = ®s[regs_alloc]; p < ®s[newsize]; p++) { + p->fd = -1; +# ifdef USE_POLL + p->pfd = NULL; +# endif + } + p = ®s[regs_alloc]; + regs_alloc = newsize; + } + + p->fd = fd; + p->arg = arg; + p->mask = mask; + p->func = func; + + regs_used++; + rebuild = 1; + } + + poll_unblocksig(); + + if(rpoll_trace) + fprintf(stderr, "poll_register(%d, %#lx, %#lx, %#x)->%d", + fd, (u_long)func, (u_long)arg, mask, p - regs); + return p - regs; +} + +/* + * remove registration + */ +void +poll_unregister(int handle) +{ + if(rpoll_trace) + fprintf(stderr, "poll_unregister(%d)", handle); + + poll_blocksig(); + + regs[handle].fd = -1; +# ifdef USE_POLL + regs[handle].pfd = NULL; +# endif + rebuild = 1; + regs_used--; + + poll_unblocksig(); +} + +/* + * Build the structures used by poll() or select() + */ +static void +poll_build(void) +{ + PollReg_t * p; + +# ifdef USE_POLL + struct pollfd * f; + + f = pfd = _xrealloc(pfd, sizeof(pfd[0]) * regs_used); + + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd >= 0) { + f->fd = p->fd; + f->events = 0; + if(p->mask & POLL_IN) + f->events |= poll_in; + if(p->mask & POLL_OUT) + f->events |= poll_out; + if(p->mask & POLL_EXCEPT) + f->events |= poll_except; + f->revents = 0; + p->pfd = f++; + } + assert(f == &pfd[regs_used]); +# endif + +# ifdef USE_SELECT + FD_ZERO(&rset); + FD_ZERO(&wset); + FD_ZERO(&xset); + maxfd = -1; + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd >= 0) { + if(p->fd > maxfd) + maxfd = p->fd; + if(p->mask & POLL_IN) + FD_SET(p->fd, &rset); + if(p->mask & POLL_OUT) + FD_SET(p->fd, &wset); + if(p->mask & POLL_EXCEPT) + FD_SET(p->fd, &xset); + } +# endif +} + +int +poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg) +{ + PollTim_t *p; + + /* find unused entry */ + for(p = tims; p < &tims[tims_alloc]; p++) + if(p->func == NULL) + break; + + if(p == &tims[tims_alloc]) { + if(tims_alloc == tims_used) { + size_t newsize = tims_alloc + POLL_REG_GROW; + tims = _xrealloc(tims, sizeof(tims[0]) * newsize); + for(p = &tims[tims_alloc]; p < &tims[newsize]; p++) + p->func = NULL; + p = &tims[tims_alloc]; + tims_alloc = newsize; + } + } + + /* create entry */ + p->msecs = msecs; + p->repeat = repeat; + p->arg = arg; + p->func = func; + p->when = GETMSECS() + msecs; + + tims_used++; + + resort = 1; + + if(rpoll_trace) + fprintf(stderr, "poll_start_timer(%u, %d, %#lx, %#lx)->%u", + msecs, repeat, (u_long)func, (u_long)arg, p - tims); + + return p - tims; +} + +/* + * Here we have to look into the sorted table, whether any entry there points + * into the registration table for the deleted entry. This is needed, + * because a unregistration can occure while we are scanning through the + * table in dispatch(). Do this only, if we are really there - resorting + * will sort out things if we are called from outside the loop. + */ +void +poll_stop_timer(int handle) +{ + u_int i; + + if(rpoll_trace) + fprintf(stderr, "poll_stop_timer(%d)", handle); + + tims[handle].func = NULL; + tims_used--; + + resort = 1; + + if(!in_dispatch) + return; + + for(i = 0; i < tfd_used; i++) + if(tfd[i] == handle) { + tfd[i] = -1; + break; + } +} + +/* + * Squeeze and sort timer table. + * Should perhaps use a custom sort. + */ +static int +tim_cmp(const void *p1, const void *p2) +{ + int t1 = *(const int *)p1; + int t2 = *(const int *)p2; + + return tims[t1].when < tims[t2].when ? -1 + : tims[t1].when > tims[t2].when ? +1 + : 0; +} + +/* + * Reconstruct the tfd-array. This will be an sorted array of indexes + * to the used entries in tims. The next timer to expire will be infront + * of the array. tfd_used is the number of used entries. The array is + * re-allocated if needed. + */ +static void +sort_timers(void) +{ + int *pp; + u_int i; + + if(tims_used > tfd_alloc) { + tfd_alloc = tims_used; + tfd = _xrealloc(tfd, sizeof(int *) * tfd_alloc); + } + + pp = tfd; + + for(i = 0; i < tims_alloc; i++) + if(tims[i].func) + *pp++ = i; + assert(pp - tfd == (ptrdiff_t)tims_used); + + tfd_used = tims_used; + if(tfd_used > 1) + qsort(tfd, tfd_used, sizeof(int), tim_cmp); +} + +/* + * Poll the file descriptors and dispatch to the right function + * If wait is true the poll blocks until somewhat happens. + * Don't use a pointer here, because the called function may cause + * a reallocation! The check for pfd != NULL is required, because + * a sequence of unregister/register could make the wrong callback + * to be called. So we clear pfd in unregister and check here. + */ +void +poll_dispatch(int wait) +{ + u_int i, idx; + int ret; + tval_t now; + int tout; + static u_int last_index; + +# ifdef USE_SELECT + fd_set nrset, nwset, nxset; + struct timeval tv; +# endif + + in_dispatch = 1; + + if(rebuild) { + rebuild = 0; + poll_build(); + } + if(resort) { + resort = 0; + sort_timers(); + } + + /* in wait mode - compute the timeout */ + if(wait) { + if(tfd_used) { + now = GETMSECS(); +# ifdef DEBUG + { + fprintf(stderr, "now=%"QUADFMT"u", now); + for(i = 0; i < tims_used; i++) + fprintf(stderr, "timers[%2d] = %"QUADFMT"d", i, tfd[i]->when - now); + } +# endif + if((tout = tims[tfd[0]].when - now) < 0) + tout = 0; + } else + tout = INFTIM; + } else + tout = 0; + +# ifdef DEBUG + fprintf(stderr, "rpoll -- selecting with tout=%u", tout); +# endif + +# ifdef USE_POLL + ret = poll(pfd, regs_used, tout); +# endif + +# ifdef USE_SELECT + nrset = rset; + nwset = wset; + nxset = xset; + if(tout != INFTIM) { + tv.tv_sec = tout / 1000; + tv.tv_usec = (tout % 1000) * 1000; + } + ret = select(maxfd+1, + SELECT_CAST(&nrset), + SELECT_CAST(&nwset), + SELECT_CAST(&nxset), (tout==INFTIM) ? 0 : &tv); +# endif + + if(ret == -1) { + if(errno == EINTR) + return; + _panic("poll/select: %s", strerror(errno)); + } + + /* dispatch files */ + if(ret > 0) { + for(i = 0; i < regs_alloc; i++) { + idx = rpoll_policy ? ((last_index+i) % regs_alloc) : i; + + assert(idx < regs_alloc); + + if(regs[idx].fd >= 0) { + int mask = 0; + +# ifdef USE_POLL + if(regs[idx].pfd) { + if(regs[idx].pfd->revents & poll_in) + mask |= POLL_IN; + if(regs[idx].pfd->revents & poll_out) + mask |= POLL_OUT; + if(regs[idx].pfd->revents & poll_except) + mask |= POLL_EXCEPT; + } +# endif +# ifdef USE_SELECT + if(FD_ISSET(regs[idx].fd, &nrset)) + mask |= POLL_IN; + if(FD_ISSET(regs[idx].fd, &nwset)) + mask |= POLL_OUT; + if(FD_ISSET(regs[idx].fd, &nxset)) + mask |= POLL_EXCEPT; +# endif + assert(idx < regs_alloc); + + if(mask) { + if(rpoll_trace) + fprintf(stderr, "poll_dispatch() -- " + "file %d/%d", + regs[idx].fd, idx); + (*regs[idx].func)(regs[idx].fd, mask, regs[idx].arg); + } + } + + } + last_index++; + } + + /* dispatch timeouts */ + if(tfd_used) { + now = GETMSECS(); + for(i = 0; i < tfd_used; i++) { + if(tfd[i] < 0) + continue; + if(tims[tfd[i]].when > now) + break; + if(rpoll_trace) + fprintf(stderr, "rpoll_dispatch() -- timeout %d",tfd[i]); + (*tims[tfd[i]].func)(tfd[i], tims[tfd[i]].arg); + if(tfd[i] < 0) + continue; + if(tims[tfd[i]].repeat) + tims[tfd[i]].when = now + tims[tfd[i]].msecs; + else { + tims[tfd[i]].func = NULL; + tims_used--; + tfd[i] = -1; + } + resort = 1; + } + } + in_dispatch = 0; +} + + +# ifdef TESTME +struct timeval start, now; +int t0, t1; + +double elaps(void); +void infunc(int fd, int mask, void *arg); + +double +elaps(void) +{ + gettimeofday(&now, NULL); + + return (double)(10 * now.tv_sec + now.tv_usec / 100000 - 10 * start.tv_sec - start.tv_usec / 100000) + / 10; +} + +void +infunc(int fd, int mask, void *arg) +{ + char buf[1024]; + int ret; + + mask = mask; + arg = arg; + if((ret = read(fd, buf, sizeof(buf))) < 0) + _panic("read: %s", strerror(errno)); + write(1, "stdin:", 6); + write(1, buf, ret); +} + +void tfunc0(int tid, void *arg); +void tfunc1(int tid, void *arg); + +void +tfunc0(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); +} +void +tfunc1(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); +} + +void first(int tid, void *arg); +void second(int tid, void *arg); + +void +second(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); + poll_start_timer(5500, 0, first, "first"); + poll_stop_timer(t1); + t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); +} +void +first(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); + poll_start_timer(3700, 0, second, "second"); + poll_stop_timer(t0); + t1 = poll_start_timer(250, 1, tfunc1, "1/4 second"); +} + +int +main(int argc, char *argv[]) +{ + argc = argc; + argv = argv; + gettimeofday(&start, NULL); + poll_register(0, infunc, NULL, POLL_IN); + t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); + poll_start_timer(2500, 0, first, "first"); + + while(1) + poll_dispatch(1); + + return 0; +} +# endif Copied: vendor/libbegemot/1.1.1/rpoll.h (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.h Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h) @@ -0,0 +1,66 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation 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 or documentation 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * $Begemot: libbegemot/rpoll.h,v 1.5 2004/09/21 15:49:26 brandt Exp $ + */ +# ifndef rpoll_h_ +# define rpoll_h_ + +# ifdef __cplusplus +extern "C" { +# endif + +typedef void (*poll_f)(int fd, int mask, void *arg); +typedef void (*timer_f)(int, void *); + +int poll_register(int fd, poll_f func, void *arg, int mask); +void poll_unregister(int); +void poll_dispatch(int wait); +int poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg); +void poll_stop_timer(int); + +# if defined(POLL_IN) +# undef POLL_IN +# endif +# if defined(POLL_OUT) +# undef POLL_OUT +# endif + +# define POLL_IN 1 +# define POLL_OUT 2 +# define POLL_EXCEPT 4 + +extern int rpoll_policy; +extern int rpoll_trace; + +# ifdef __cplusplus +} +# endif + +# endif Copied: vendor/libbegemot/1.1.1/rpoll.man (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.man Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man) @@ -0,0 +1,188 @@ +'\" +'\" Copyright (c)1996-2002 by Hartmut Brandt +'\" All rights reserved. +'\" +'\" Author: Hartmut Brandt +'\" +'\" Redistribution of this software and documentation 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 or documentation 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR +'\" AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +'\" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +'\" THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +'\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +'\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +'\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +'\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +'\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +'\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +'\" +'\" $Begemot: libbegemot/rpoll.man,v 1.4 2004/09/21 15:59:00 brandt Exp $ +'\" +.TH rpoll l "21 Oct 1996" "BEGEMOT" "BEGEMOT Library" +.SH NAME +rpoll - callback functions for file descriptors and timers +.SH SYNOPSIS +.LP +.B "# include " +.LP +.BR "typedef void (*poll_f)(int " "fd" ", int " "mask" ", void *" "arg);" +.br +.BR "typedef void (*timer_f)(int " "tid" ", void *" "arg);" +.LP +.BR "int poll_register(int " "fd" ", poll_f " +.RB "func" ", void *" "arg" ", int " "mask" ");" +.LP +.BR "void poll_unregister(int " "handle" ");" +.LP +.BR "int poll_start_timer(u_int " "msecs" ", int " "repeat" ", timer_f " "func," +.if n .ti +.5i +.BR "void *" "arg);" +.LP +.BR "void poll_stop_timer(int " "handle" ");" +.LP +.BR "void poll_dispatch(int " "wait" ");" +.SH DESCRIPTION +Many programs need to read from several file descriptors at the same time. +Typically in these programs one of +.BR select (3c) +or +.BR poll (2) +is used. +These calls are however clumsy to use and the usage of one of these calls is +probably not portable to other systems - not all systems support both calls. +.LP +The +.BR rpoll (l) +family of functions is designed to overcome these restrictions. +They support the well known and understood technique of event driven +programing and, in addition to +.BR select (3c) +and +.BR poll (2) +also support timers. +.LP +Each event on a file descriptor or each timer event is translated into a call to a user +defined callback function. These functions need to be registered. +A file descriptor is registered with +.BR poll_register . +.I fd +is the file descriptor to watch, +.I mask +is an event mask. +It may be any combination of +.B POLL_IN +to get informed, when input on the file descriptor is possible, +.B POLL_OUT +to get informed, when output is possible or +.B POLL_EXCEPT +to get informed, when an exceptional condition occures. +An example of an exceptional condition is the arrival of urgent data. +(Note, that an end of file condition is signaled via POLL_IN). +.I func +is the user function to be called and +.I arg +is a user supplied argument for this function. +The callback functions is called with the file descriptor, a mask +describing the actual events (from the set supplied in the registration) and +the user argument. +.B poll_register +returns a handle, which may be used later to de-register the file descriptor. +A file descriptor may be registered more than once, if the function, the user arguments +or both differ in the call to +.BR poll_register . +If +.I func +and +.I arg +are the same, then no new registration is done, instead the event mask of the registration +is changed to reflect the new mask. +.LP +A registered file descriptor may be de-registered by calling +.B poll_unregister +with the handle returned by +.BR poll_register . +.LP +A timer is created with +.BR poll_start_timer . +.I msecs +is the number of milliseconds, after which the timer event will be generated. +.I repeat +selects one-short behavior (if 0) or a repeatable timer (if not 0). A one-short timer +will automatically unregistered after expiry. +.I func +is the user function which will be called with a timer id and the user supplied +.IR arg . +.B poll_start_timer +returnes a timer id, which may be used to cancel the timer with +.BR poll_stop_timer . +A one-short timer should be canceled only if it has not yet fired. +.LP +.B poll_dispatch +must be called to actually dispatch events. +.I wait +is a flag, which should be 0, if only a poll should be done. In this case, the function returns, +after polling the registered file descriptors and timers. If +.I wait +is not 0, +.B poll_dispatch +waits until an event occures. All events are dispatch (i.e. callback functions called) and +.B poll_dispatch returns. +.LP +Typical use is: +.LP +.RS +.nf +.ft 3 +while(1) + poll_dispatch(1); +.ft 1 +.fi +.RE +.SH "SEE ALSO" +.BR poll (2), select (3C) +.SH "RETURN VALUES" +.B poll_register +and +.B poll_start_timer +return a handle which may be used to unregister the file descriptor or cancel the timer. +.LP +Both functions and +.B poll_dispatch +call +.BR xrealloc (l) +and can end in +.BR panic (l). +.SH "ERRORS" +System call or memory allocation errors are fatal and are handle by calling +.BR panic (l). +The one exception is a return of EINTR from +.BR select (3c) +or +.BR poll (2) +in +.BR poll_dispatch . +In this case +.B poll_dispatch +simply returns. +.SH "BUGS" +Obscure sequences of +.B poll_start_timer +and +.B poll_stop_timer +in callback functions may probably break the code. +.LP +The semantics of +.B POLL_EXCEPT +are not clear. +.SH AUTHORS +Hartmut Brandt, harti@freebsd.org Copied: vendor/libbegemot/dist/rpoll.c (from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/dist/rpoll.c Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c) @@ -0,0 +1,740 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation 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 or documentation 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:31:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552051065674; Sat, 20 Dec 2008 17:31:58 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A59E8FC29; Sat, 20 Dec 2008 17:31:58 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHVw1U009889; Sat, 20 Dec 2008 17:31:58 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHVwLK009888; Sat, 20 Dec 2008 17:31:58 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201731.mBKHVwLK009888@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186361 - vendor/libbegemot/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:31:58 -0000 Author: harti Date: Sat Dec 20 17:31:57 2008 New Revision: 186361 URL: http://svn.freebsd.org/changeset/base/186361 Log: Remove the svn:keywords property from the vendor files. Modified: vendor/libbegemot/dist/rpoll.c (props changed) vendor/libbegemot/dist/rpoll.h (props changed) vendor/libbegemot/dist/rpoll.man (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 17:55:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5CC1065675; Sat, 20 Dec 2008 17:55:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D80F8FC1B; Sat, 20 Dec 2008 17:55:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHtb9h010372; Sat, 20 Dec 2008 17:55:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHtbQF010371; Sat, 20 Dec 2008 17:55:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812201755.mBKHtbQF010371@svn.freebsd.org> From: Sam Leffler Date: Sat, 20 Dec 2008 17:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186362 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:55:37 -0000 Author: sam Date: Sat Dec 20 17:55:37 2008 New Revision: 186362 URL: http://svn.freebsd.org/changeset/base/186362 Log: o add sys/endian.h now required by ehcivar.h o reorder a couple of include's to make this consistent with pci code Modified: head/sys/dev/usb/ehci_mbus.c Modified: head/sys/dev/usb/ehci_mbus.c ============================================================================== --- head/sys/dev/usb/ehci_mbus.c Sat Dec 20 17:31:57 2008 (r186361) +++ head/sys/dev/usb/ehci_mbus.c Sat Dec 20 17:55:37 2008 (r186362) @@ -47,8 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include + +#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 19:39:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E72E106564A; Sat, 20 Dec 2008 19:39:10 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9FB8FC08; Sat, 20 Dec 2008 19:39:10 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKJdAxp012458; Sat, 20 Dec 2008 19:39:10 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKJdA8F012457; Sat, 20 Dec 2008 19:39:10 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200812201939.mBKJdA8F012457@svn.freebsd.org> From: "Christian S.J. Peron" Date: Sat, 20 Dec 2008 19:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186363 - in stable/7/sys: . contrib/pf dev/cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 19:39:10 -0000 Author: csjp Date: Sat Dec 20 19:39:09 2008 New Revision: 186363 URL: http://svn.freebsd.org/changeset/base/186363 Log: MFC revision 185713 from head. Make sure we are maintaining the reference count on the route eliminating another: rtfree: 0xc841ee88 has 1 refs Reviewed by: bz Approved by: re@ (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/if_ether.c Modified: stable/7/sys/netinet/if_ether.c ============================================================================== --- stable/7/sys/netinet/if_ether.c Sat Dec 20 17:55:37 2008 (r186362) +++ stable/7/sys/netinet/if_ether.c Sat Dec 20 19:39:09 2008 (r186363) @@ -909,12 +909,12 @@ reply: * over who claims what Ether address. */ if (rt->rt_ifp == ifp) { - rtfree(rt); + RTFREE_LOCKED(rt); goto drop; } (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); - rtfree(rt); + RTFREE_LOCKED(rt); /* * Also check that the node which sent the ARP packet @@ -933,10 +933,10 @@ reply: " from %s via %s, expecting %s\n", inet_ntoa(isaddr), ifp->if_xname, rt->rt_ifp->if_xname); - rtfree(rt); + RTFREE_LOCKED(rt); goto drop; } - rtfree(rt); + RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 19:45:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5871065673; Sat, 20 Dec 2008 19:45:23 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A0218FC1C; Sat, 20 Dec 2008 19:45:23 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKJjMr5012632; Sat, 20 Dec 2008 19:45:22 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKJjMk4012631; Sat, 20 Dec 2008 19:45:22 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200812201945.mBKJjMk4012631@svn.freebsd.org> From: "Christian S.J. Peron" Date: Sat, 20 Dec 2008 19:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186364 - in releng/7.1/sys: . contrib/pf dev/cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 19:45:23 -0000 Author: csjp Date: Sat Dec 20 19:45:22 2008 New Revision: 186364 URL: http://svn.freebsd.org/changeset/base/186364 Log: MFC revision 185713 from head. Make sure we are maintaining the reference count on the route eliminating another: rtfree: 0xc841ee88 has 1 refs Reviewed by: bz Approved by: re@ (gnn) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/netinet/if_ether.c Modified: releng/7.1/sys/netinet/if_ether.c ============================================================================== --- releng/7.1/sys/netinet/if_ether.c Sat Dec 20 19:39:09 2008 (r186363) +++ releng/7.1/sys/netinet/if_ether.c Sat Dec 20 19:45:22 2008 (r186364) @@ -909,12 +909,12 @@ reply: * over who claims what Ether address. */ if (rt->rt_ifp == ifp) { - rtfree(rt); + RTFREE_LOCKED(rt); goto drop; } (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); - rtfree(rt); + RTFREE_LOCKED(rt); /* * Also check that the node which sent the ARP packet @@ -933,10 +933,10 @@ reply: " from %s via %s, expecting %s\n", inet_ntoa(isaddr), ifp->if_xname, rt->rt_ifp->if_xname); - rtfree(rt); + RTFREE_LOCKED(rt); goto drop; } - rtfree(rt); + RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", From owner-svn-src-all@FreeBSD.ORG Sat Dec 20 22:11:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54F0106564A; Sat, 20 Dec 2008 22:11:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C22908FC14; Sat, 20 Dec 2008 22:11:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKMBVuI015520; Sat, 20 Dec 2008 22:11:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKMBVYW015519; Sat, 20 Dec 2008 22:11:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200812202211.mBKMBVYW015519@svn.freebsd.org> From: Andrew Thompson Date: Sat, 20 Dec 2008 22:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186365 - in stable/6/sys: . net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 22:11:32 -0000 Author: thompsa Date: Sat Dec 20 22:11:31 2008 New Revision: 186365 URL: http://svn.freebsd.org/changeset/base/186365 Log: MFC r172824 Use ETHER_BPF_MTAP so that the vlan tags are visible to bpf(4) when bridging a vlan trunk. Modified: stable/6/sys/ (props changed) stable/6/sys/net/if_bridge.c Modified: stable/6/sys/net/if_bridge.c ============================================================================== --- stable/6/sys/net/if_bridge.c Sat Dec 20 19:45:22 2008 (r186364) +++ stable/6/sys/net/if_bridge.c Sat Dec 20 22:11:31 2008 (r186365) @@ -1867,7 +1867,7 @@ bridge_start(struct ifnet *ifp) IFQ_DEQUEUE(&ifp->if_snd, m); if (m == 0) break; - BPF_MTAP(ifp, m); + ETHER_BPF_MTAP(ifp, m); eh = mtod(m, struct ether_header *); dst_if = NULL; @@ -1977,7 +1977,7 @@ bridge_forward(struct bridge_softc *sc, * firewall issues on the bridge. */ if (dst_if != NULL || (m->m_flags & (M_BCAST | M_MCAST)) == 0) - BPF_MTAP(ifp, m); + ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ if (inet_pfil_hook.ph_busy_count >= 0 @@ -2067,7 +2067,7 @@ bridge_input(struct ifnet *ifp, struct m */ if ((bifp->if_flags & IFF_MONITOR) != 0) { m->m_pkthdr.rcvif = bifp; - BPF_MTAP(bifp, m); + ETHER_BPF_MTAP(bifp, m); bifp->if_ipackets++; bifp->if_ibytes += m->m_pkthdr.len; m_freem(m); @@ -2177,7 +2177,7 @@ bridge_input(struct ifnet *ifp, struct m OR_CARP_CHECK_WE_ARE_DST((iface)) \ ) { \ if ((iface)->if_type == IFT_BRIDGE) { \ - BPF_MTAP(iface, m); \ + ETHER_BPF_MTAP(iface, m); \ iface->if_ipackets++; \ /* Filter on the physical interface. */ \ if (pfil_local_phys && \