From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 00:24:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2BAD106566B; Sun, 5 Apr 2009 00:24:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D230B8FC0A; Sun, 5 Apr 2009 00:24:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n350OnsR087192; Sun, 5 Apr 2009 00:24:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n350OnlC087191; Sun, 5 Apr 2009 00:24:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904050024.n350OnlC087191@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Apr 2009 00:24: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: r190706 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 00:24:52 -0000 Author: imp Date: Sun Apr 5 00:24:49 2009 New Revision: 190706 URL: http://svn.freebsd.org/changeset/base/190706 Log: Revert c190007 at the request of Ruslan. It was not correct because ar had been moved from cross tools to bootstrap tools when bsd ar was introduced. Submitted by: ru@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Apr 4 23:12:14 2009 (r190705) +++ head/Makefile.inc1 Sun Apr 5 00:24:49 2009 (r190706) @@ -1017,7 +1017,6 @@ cross-tools: .for _tool in \ gnu/usr.bin/binutils \ gnu/usr.bin/cc \ - usr.bin/ar \ usr.bin/sed \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 00:43:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97D6F106564A; Sun, 5 Apr 2009 00:43:54 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4078FC0A; Sun, 5 Apr 2009 00:43:54 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from [10.100.124.124] (port=60150 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LqGSm-000G9W-QD; Sun, 05 Apr 2009 04:43:52 +0400 Date: Sun, 5 Apr 2009 04:43:33 +0400 From: Ruslan Ermilov To: Warner Losh Message-ID: <20090405004333.GA38720@edoofus.dev.vega.ru> References: <200904050024.n350OnlC087191@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904050024.n350OnlC087191@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190706 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 00:43:55 -0000 On Sun, Apr 05, 2009 at 12:24:49AM +0000, Warner Losh wrote: > Author: imp > Date: Sun Apr 5 00:24:49 2009 > New Revision: 190706 > URL: http://svn.freebsd.org/changeset/base/190706 > > Log: > Revert c190007 at the request of Ruslan. It was not correct because > ar had been moved from cross tools to bootstrap tools when bsd ar was > introduced. > > Submitted by: ru@ > > Modified: > head/Makefile.inc1 > Thanks! -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 09:00:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8286106564A; Sun, 5 Apr 2009 09:00:05 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id 7068D8FC14; Sun, 5 Apr 2009 09:00:05 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id n358mV5g020964; Sun, 5 Apr 2009 02:48:32 -0600 Message-Id: <41033BDC-25ED-41F7-864F-D1F8E9DDD813@semihalf.com> From: Rafal Jaworowski To: Marcel Moolenaar In-Reply-To: <200904042201.n34M1hHW082133@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sun, 5 Apr 2009 10:48:30 +0200 References: <200904042201.n34M1hHW082133@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190701 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 09:00:06 -0000 On 2009-04-05, at 00:01, Marcel Moolenaar wrote: > Author: marcel > Date: Sat Apr 4 22:01:43 2009 > New Revision: 190701 > URL: http://svn.freebsd.org/changeset/base/190701 > > Log: > Implement kernel core dump support for Book-E processors. > Both raw physical memory dumps and virtual minidumps are > supported. The default being minidumps. > > Obtained from: Juniper Networks Thanks, Marcel! Great to see this coming. Rafal From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 09:04:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641771065674; Sun, 5 Apr 2009 09:04:00 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id 2B07C8FC47; Sun, 5 Apr 2009 09:03:59 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id n3593wIe028210; Sun, 5 Apr 2009 03:03:58 -0600 Message-Id: <7F1FC303-3EFC-4182-9260-FE35C4BD9909@semihalf.com> From: Rafal Jaworowski To: Marcel Moolenaar In-Reply-To: <200904042223.n34MN3RG082677@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sun, 5 Apr 2009 11:03:55 +0200 References: <200904042223.n34MN3RG082677@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190704 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 09:04:00 -0000 On 2009-04-05, at 00:23, Marcel Moolenaar wrote: > Author: marcel > Date: Sat Apr 4 22:23:03 2009 > New Revision: 190704 > URL: http://svn.freebsd.org/changeset/base/190704 > > Log: > Perform a dummy stwcx. when we switch contexts. The context > being switched out may hold a reservation. The stwcx. will > clear the reservation. This is architecturally recommended. > > The scenario this addresses is as follows: > 1. Thread 1 performs a lwarx and as such holds a reservation. > 2. Thread 1 gets switched out (before doing the matching > stwcx.) and thread 2 is switched in. > 3. Thread 2 performs a stwcx. to the same reservation granule. > This will succeed because the processor has the reservation > even though thread 2 didn't do the lwarx. > > Note that on some processors the address given the stwcx. is > not checked. On these processors the mere condition of having > a reservation would cause the stwcx. to succeed, irrespective > of whether the addresses are the same. The dummy stwcx. is > especially important for those processors. Have you seen this false stwcx. actually succeed in some real scenarios on AIM? Were there any tangible [corruption?] effects observed without this fix? We're seeing some hang with the dual E500 under very heavy loads, but only with ULE (or we could only correlate this with ULE so far), but didn't get to really close investigation of this issue yet. I'm wondering if it's something of this sort too. Rafal From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 09:27:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13081065672; Sun, 5 Apr 2009 09:27:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC1E58FC22; Sun, 5 Apr 2009 09:27:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n359RKd3012313; Sun, 5 Apr 2009 09:27:20 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n359RK4o012300; Sun, 5 Apr 2009 09:27:20 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200904050927.n359RK4o012300@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 5 Apr 2009 09:27: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: r190708 - in head/sys: amd64/amd64 amd64/linux32 arm/arm compat/ia32 i386/i386 i386/linux ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 09:27:21 -0000 Author: dchagin Date: Sun Apr 5 09:27:19 2009 New Revision: 190708 URL: http://svn.freebsd.org/changeset/base/190708 Log: Fix KBI breakage by r190520 which affects older linux.ko binaries: 1) Move the new field (brand_note) to the end of the Brandinfo structure. 2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer is valid. 3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old modules won't have the flag set, so the new field brand_note would be ignored. Suggested by: jhb Reviewed by: jhb Approved by: kib (mentor) MFC after: 6 days Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/compat/ia32/ia32_sysvec.c head/sys/i386/i386/elf_machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/ia64/ia64/elf_machdep.c head/sys/kern/imgact_elf.c head/sys/mips/mips/elf64_machdep.c head/sys/mips/mips/elf_machdep.c head/sys/powerpc/powerpc/elf_machdep.c head/sys/sparc64/sparc64/elf_machdep.c head/sys/sys/imgact_elf.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/amd64/amd64/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -85,7 +85,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -101,7 +101,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Apr 5 09:27:19 2009 (r190708) @@ -1072,7 +1072,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1084,7 +1084,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/arm/arm/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -85,7 +85,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -101,7 +101,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/compat/ia32/ia32_sysvec.c Sun Apr 5 09:27:19 2009 (r190708) @@ -149,7 +149,7 @@ static Elf32_Brandinfo ia32_brand_info = .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -165,7 +165,7 @@ static Elf32_Brandinfo ia32_brand_oinfo .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/i386/i386/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -85,7 +85,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -101,7 +101,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/i386/linux/linux_sysvec.c Sun Apr 5 09:27:19 2009 (r190708) @@ -1038,7 +1038,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1050,7 +1050,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: head/sys/ia64/ia64/elf_machdep.c ============================================================================== --- head/sys/ia64/ia64/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/ia64/ia64/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -93,7 +93,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); @@ -107,7 +107,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/kern/imgact_elf.c Sun Apr 5 09:27:19 2009 (r190708) @@ -189,7 +189,7 @@ __elfN(get_brandinfo)(struct image_param for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; if (bi != NULL && hdr->e_machine == bi->machine && - bi->brand_note != NULL) { + (bi->flags & BI_BRAND_NOTE) != 0) { ret = __elfN(check_note)(imgp, bi->brand_note, osrel); if (ret) return (bi); Modified: head/sys/mips/mips/elf64_machdep.c ============================================================================== --- head/sys/mips/mips/elf64_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/mips/mips/elf64_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -89,7 +89,7 @@ static Elf64_Brandinfo freebsd_brand_gnu .sysvec = &elf64_freebsd_sysvec, .interp_path = "/libexec/ld-elf.so.1", .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(gnu_mips_elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -105,7 +105,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = 0 + .flags = BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/mips/mips/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -87,7 +87,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = 0 + .flags = BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/powerpc/powerpc/elf_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/powerpc/powerpc/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -88,7 +88,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -104,7 +104,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/elf_machdep.c Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/sparc64/sparc64/elf_machdep.c Sun Apr 5 09:27:19 2009 (r190708) @@ -100,7 +100,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -116,7 +116,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Sun Apr 5 00:51:59 2009 (r190707) +++ head/sys/sys/imgact_elf.h Sun Apr 5 09:27:19 2009 (r190708) @@ -69,9 +69,10 @@ typedef struct { const char *interp_path; struct sysentvec *sysvec; const char *interp_newpath; - Elf_Brandnote *brand_note; int flags; + Elf_Brandnote *brand_note; #define BI_CAN_EXEC_DYN 0x0001 +#define BI_BRAND_NOTE 0x0002 } __ElfN(Brandinfo); __ElfType(Auxargs); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 12:41:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDD6F10656FC; Sun, 5 Apr 2009 12:41:59 +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 AC1168FC12; Sun, 5 Apr 2009 12:41:59 +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 n35CfxVD018305; Sun, 5 Apr 2009 12:41:59 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35CfxsA018304; Sun, 5 Apr 2009 12:41:59 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051241.n35CfxsA018304@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 12:41: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: r190709 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 12:42:00 -0000 Author: phk Date: Sun Apr 5 12:41:59 2009 New Revision: 190709 URL: http://svn.freebsd.org/changeset/base/190709 Log: Send multicast on p2p interfaces if they can and are not prohibited from doing so with no_rip_mcast in /etc/gateways. This allows routed(8) to work with the way ports/security/openvpn employs the tun(4) interface. Modified: head/sbin/routed/output.c Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Apr 5 09:27:19 2009 (r190708) +++ head/sbin/routed/output.c Sun Apr 5 12:41:59 2009 (r190709) @@ -139,7 +139,8 @@ output(enum output_type type, flags = MSG_DONTROUTE; break; case OUT_MULTICAST: - if (ifp->int_if_flags & IFF_POINTOPOINT) { + if (ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST) == + IFF_POINTOPOINT) { msg = "Send pt-to-pt"; } else if (ifp->int_state & IS_DUP) { trace_act("abort multicast output via %s" @@ -859,7 +860,13 @@ rip_bcast(int flash) } else if (ifp->int_if_flags & IFF_POINTOPOINT) { /* point-to-point hardware interface */ dst.sin_addr.s_addr = ifp->int_dstaddr; - type = OUT_UNICAST; + if (vers == RIPv2 && + ifp->int_if_flags & IFF_MULTICAST && + !(ifp->int_state & IS_NO_RIP_MCAST)) { + type = OUT_MULTICAST; + } else { + type = OUT_UNICAST; + } } else if (ifp->int_state & IS_REMOTE) { /* remote interface */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 13:48:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA02D1065673; Sun, 5 Apr 2009 13:48:06 +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 D88338FC0A; Sun, 5 Apr 2009 13:48:06 +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 n35Dm6f1019596; Sun, 5 Apr 2009 13:48:06 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35Dm6O6019595; Sun, 5 Apr 2009 13:48:06 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051348.n35Dm6O6019595@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 13:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190710 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 13:48:07 -0000 Author: phk Date: Sun Apr 5 13:48:06 2009 New Revision: 190710 URL: http://svn.freebsd.org/changeset/base/190710 Log: Remove newlines from string argument of __COPYRIGHT(), it results in assembler warning messages. Modified: head/sbin/routed/main.c Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Apr 5 12:41:59 2009 (r190709) +++ head/sbin/routed/main.c Sun Apr 5 13:48:06 2009 (r190710) @@ -38,9 +38,9 @@ #include #include -__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n" +__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993 " "The Regents of the University of California." - " All rights reserved.\n"); + " All rights reserved."); #ifdef __NetBSD__ __RCSID("$NetBSD$"); #include From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 14:01:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D2B5106566C; Sun, 5 Apr 2009 14:01:40 +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 EE9098FC0A; Sun, 5 Apr 2009 14:01: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 n35E1dJd019923; Sun, 5 Apr 2009 14:01:39 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35E1dBC019916; Sun, 5 Apr 2009 14:01:39 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051401.n35E1dBC019916@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 14:01: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: r190711 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 14:01:40 -0000 Author: phk Date: Sun Apr 5 14:01:39 2009 New Revision: 190711 URL: http://svn.freebsd.org/changeset/base/190711 Log: Use to manage the interface list. Modified: head/sbin/routed/defs.h head/sbin/routed/if.c head/sbin/routed/main.c head/sbin/routed/output.c head/sbin/routed/parms.c head/sbin/routed/rdisc.c head/sbin/routed/table.c head/sbin/routed/trace.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/defs.h Sun Apr 5 14:01:39 2009 (r190711) @@ -80,6 +80,7 @@ #include #include #include +#include #ifdef sgi #define _USER_ROUTE_TREE #include @@ -262,7 +263,7 @@ struct rt_entry { * handles "logical" or "IS_REMOTE" interfaces (remote gateways). */ struct interface { - struct interface *int_next, **int_prev; + LIST_ENTRY(interface) int_list; struct interface *int_ahash, **int_ahash_prev; struct interface *int_bhash, **int_bhash_prev; struct interface *int_rlink, **int_rlink_prev; @@ -353,6 +354,7 @@ struct interface { #define iff_up(f) ((f) & IFF_UP) +LIST_HEAD(ifhead, interface); /* Information for aggregating routes */ #define NUM_AG_SLOTS 32 @@ -483,7 +485,7 @@ extern struct timeval ifinit_timer; /* t extern naddr loopaddr; /* our address on loopback */ extern int tot_interfaces; /* # of remote and local interfaces */ extern int rip_interfaces; /* # of interfaces doing RIP */ -extern struct interface *ifnet; /* all interfaces */ +extern struct ifhead ifnet; /* all interfaces */ extern struct interface *remote_if; /* remote interfaces */ extern int have_ripv1_out; /* have a RIPv1 interface */ extern int have_ripv1_in; Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/if.c Sun Apr 5 14:01:39 2009 (r190711) @@ -41,7 +41,7 @@ __RCSID("$Revision: 2.27 $"); #ident "$Revision: 2.27 $" #endif -struct interface *ifnet; /* all interfaces */ +struct ifhead ifnet = LIST_HEAD_INITIALIZER(ifnet); /* all interfaces */ /* hash table for all interfaces, big enough to tolerate ridiculous * numbers of IP aliases. Crazy numbers of aliases such as 7000 @@ -101,11 +101,7 @@ if_link(struct interface *ifp) { struct interface **hifp; - ifp->int_prev = &ifnet; - ifp->int_next = ifnet; - if (ifnet != 0) - ifnet->int_prev = &ifp->int_next; - ifnet = ifp; + LIST_INSERT_HEAD(&ifnet, ifp, int_list); hifp = AHASH(ifp->int_addr); ifp->int_ahash_prev = hifp; @@ -217,7 +213,7 @@ ifwithindex(u_short ifindex, struct interface *ifp; for (;;) { - for (ifp = ifnet; 0 != ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_index == ifindex) return ifp; } @@ -245,7 +241,7 @@ iflookup(naddr addr) maybe = 0; for (;;) { - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_if_flags & IFF_POINTOPOINT) { /* finished with a match */ if (ifp->int_dstaddr == addr) @@ -322,7 +318,7 @@ ripv1_mask_net(naddr addr, /* in networ * such interface, prefer the interface with the longest * match. */ - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (on_net(addr, ifp->int_std_net, ifp->int_std_mask) && ifp->int_ripv1_mask > mask && ifp->int_ripv1_mask != HOST_MASK) @@ -394,7 +390,7 @@ check_dup(naddr addr, /* IP address, s { struct interface *ifp; - for (ifp = ifnet; 0 != ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_mask != mask) continue; @@ -459,11 +455,7 @@ ifdel(struct interface *ifp) ifp->int_state |= IS_BROKE; - /* unlink the interface - */ - *ifp->int_prev = ifp->int_next; - if (ifp->int_next != 0) - ifp->int_next->int_prev = ifp->int_prev; + LIST_REMOVE(ifp, int_list); *ifp->int_ahash_prev = ifp->int_ahash; if (ifp->int_ahash != 0) ifp->int_ahash->int_ahash_prev = ifp->int_ahash_prev; @@ -484,7 +476,7 @@ ifdel(struct interface *ifp) if (!(ifp->int_state & IS_ALIAS)) { /* delete aliases when the main interface dies */ - for (ifp1 = ifnet; 0 != ifp1; ifp1 = ifp1->int_next) { + LIST_FOREACH(ifp1, &ifnet, int_list) { if (ifp1 != ifp && !strcmp(ifp->int_name, ifp1->int_name)) ifdel(ifp1); @@ -570,7 +562,7 @@ if_bad(struct interface *ifp) trace_if("Chg", ifp); if (!(ifp->int_state & IS_ALIAS)) { - for (ifp1 = ifnet; 0 != ifp1; ifp1 = ifp1->int_next) { + LIST_FOREACH(ifp1, &ifnet, int_list) { if (ifp1 != ifp && !strcmp(ifp->int_name, ifp1->int_name)) if_bad(ifp1); @@ -606,7 +598,7 @@ if_ok(struct interface *ifp, ifp->int_data.ts = 0; if (!(ifp->int_state & IS_ALIAS)) { - for (ifp1 = ifnet; 0 != ifp1; ifp1 = ifp1->int_next) { + LIST_FOREACH(ifp1, &ifnet, int_list) { if (ifp1 != ifp && !strcmp(ifp->int_name, ifp1->int_name)) if_ok(ifp1, type); @@ -687,7 +679,7 @@ ifinit(void) : CHECK_QUIET_INTERVAL); /* mark all interfaces so we can get rid of those that disappear */ - for (ifp = ifnet; 0 != ifp; ifp = ifp->int_next) + LIST_FOREACH(ifp, &ifnet, int_list) ifp->int_state &= ~(IS_CHECKED | IS_DUP); /* Fetch the interface list, without too many system calls @@ -1111,7 +1103,7 @@ ifinit(void) if (!(prev_complaints & COMP_NETMASK) && !(ifp->int_if_flags & IFF_POINTOPOINT) && ifp->int_addr != RIP_DEFAULT) { - for (ifp1 = ifnet; 0 != ifp1; ifp1 = ifp1->int_next) { + LIST_FOREACH(ifp1, &ifnet, int_list) { if (ifp1->int_mask == ifp->int_mask) continue; if (ifp1->int_if_flags & IFF_POINTOPOINT) @@ -1188,9 +1180,7 @@ ifinit(void) } } - for (ifp = ifnet; ifp != 0; ifp = ifp1) { - ifp1 = ifp->int_next; /* because we may delete it */ - + LIST_FOREACH_SAFE(ifp, &ifnet, int_list, ifp1) { /* Forget any interfaces that have disappeared. */ if (!(ifp->int_state & (IS_CHECKED | IS_REMOTE))) { @@ -1213,7 +1203,7 @@ ifinit(void) have_ripv1_in = 1; } - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { /* Ensure there is always a network route for interfaces, * after any dead interfaces have been deleted, which * might affect routes for point-to-point links. Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/main.c Sun Apr 5 14:01:39 2009 (r190711) @@ -529,7 +529,9 @@ usage: n--; } - for (ifp = ifnet; n > 0 && 0 != ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { + if (n <= 0) + break; if (ifp->int_rip_sock >= 0 && FD_ISSET(ifp->int_rip_sock, &ibits)) { read_rip(ifp->int_rip_sock, ifp); @@ -578,7 +580,7 @@ fix_select(void) if (sock_max <= rip_sock) sock_max = rip_sock+1; } - for (ifp = ifnet; 0 != ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_rip_sock >= 0) { FD_SET(ifp->int_rip_sock, &fdbits); if (sock_max <= ifp->int_rip_sock) @@ -690,7 +692,7 @@ rip_off(void) /* get non-broadcast sockets to listen to queries. */ - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_state & IS_REMOTE) continue; if (ifp->int_rip_sock < 0) { @@ -761,7 +763,7 @@ rip_on(struct interface *ifp) * since that would let two daemons bind to the broadcast * socket. */ - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_rip_sock >= 0) { (void)close(ifp->int_rip_sock); ifp->int_rip_sock = -1; @@ -776,7 +778,7 @@ rip_on(struct interface *ifp) if (next_bcast.tv_sec < now.tv_sec+MIN_WAITTIME) next_bcast.tv_sec = now.tv_sec+MIN_WAITTIME; - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { ifp->int_query_time = NEVER; rip_mcast_on(ifp); } Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/output.c Sun Apr 5 14:01:39 2009 (r190711) @@ -833,7 +833,7 @@ rip_bcast(int flash) flash ? "dynamic update" : "all routes", rtime.tv_sec + ((float)rtime.tv_usec)/1000000.0); - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { /* Skip interfaces not doing RIP. * Do try broken interfaces to see if they have healed. */ @@ -907,7 +907,7 @@ rip_query(void) memset(&buf, 0, sizeof(buf)); - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { /* Skip interfaces those already queried. * Do not ask via interfaces through which we don't * accept input. Do not ask via interfaces that cannot Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/parms.c Sun Apr 5 14:01:39 2009 (r190711) @@ -350,7 +350,7 @@ gwkludge(void) /* After all of the parameter lines have been read, * apply them to any remote interfaces. */ - for (ifp = ifnet; 0 != ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { get_parms(ifp); tot_interfaces++; Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/rdisc.c Sun Apr 5 14:01:39 2009 (r190711) @@ -278,7 +278,7 @@ set_supplier(void) /* Switch router discovery multicast groups from soliciting * to advertising. */ - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (ifp->int_state & IS_BROKE) continue; ifp->int_rdisc_cnt = 0; @@ -817,7 +817,7 @@ rdisc_adv(void) rdisc_timer.tv_sec = now.tv_sec + NEVER; - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (0 != (ifp->int_state & (IS_NO_ADV_OUT | IS_BROKE))) continue; @@ -859,7 +859,7 @@ rdisc_sol(void) rdisc_timer.tv_sec = now.tv_sec + NEVER; - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (0 != (ifp->int_state & (IS_NO_SOL_OUT | IS_BROKE)) || ifp->int_rdisc_cnt >= MAX_SOLICITATIONS) continue; Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/table.c Sun Apr 5 14:01:39 2009 (r190711) @@ -1918,7 +1918,7 @@ rtbad_sub(struct rt_entry *rt) * If so, see if it is used by any other interfaces, such * as a point-to-point interface with the same local address. */ - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { /* Retain it if another interface needs it. */ if (ifp->int_addr == rt->rt_ifp->int_addr) { @@ -1935,7 +1935,7 @@ rtbad_sub(struct rt_entry *rt) * interface that justifies it. */ if (rt->rt_state & RS_NET_SYN) { - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if ((ifp->int_state & IS_NEED_NET_SYN) && rt->rt_mask == ifp->int_std_mask && rt->rt_dst == ifp->int_std_addr) { @@ -2105,7 +2105,7 @@ age(naddr bad_gate) /* Check for dead IS_REMOTE interfaces by timing their * transmissions. */ - for (ifp = ifnet; ifp; ifp = ifp->int_next) { + LIST_FOREACH(ifp, &ifnet, int_list) { if (!(ifp->int_state & IS_REMOTE)) continue; Modified: head/sbin/routed/trace.c ============================================================================== --- head/sbin/routed/trace.c Sun Apr 5 13:48:06 2009 (r190710) +++ head/sbin/routed/trace.c Sun Apr 5 14:01:39 2009 (r190711) @@ -870,7 +870,7 @@ trace_dump(void) lastlog(); (void)fputs("current daemon state:\n", ftrace); - for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) + LIST_FOREACH(ifp, &ifnet, int_list) trace_if("", ifp); (void)rn_walktree(rhead, walk_trace, 0); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 14:15:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7C4106566C; Sun, 5 Apr 2009 14:15:05 +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 DC6268FC13; Sun, 5 Apr 2009 14:15:05 +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 n35EF51m020201; Sun, 5 Apr 2009 14:15:05 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35EF5tq020195; Sun, 5 Apr 2009 14:15:05 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051415.n35EF5tq020195@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 14:15: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: r190712 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 14:15:07 -0000 Author: phk Date: Sun Apr 5 14:15:05 2009 New Revision: 190712 URL: http://svn.freebsd.org/changeset/base/190712 Log: Kick WARNS level up to 6 by fixing various trivial warnings. Modified: head/sbin/routed/Makefile head/sbin/routed/if.c head/sbin/routed/output.c head/sbin/routed/radix.c head/sbin/routed/radix.h head/sbin/routed/table.c Modified: head/sbin/routed/Makefile ============================================================================== --- head/sbin/routed/Makefile Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/Makefile Sun Apr 5 14:15:05 2009 (r190712) @@ -7,6 +7,6 @@ MAN= routed.8 SUBDIR= rtquery LDADD= -lmd DPADD= ${LIBMD} -WARNS?= 0 +WARNS?= 6 .include Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/if.c Sun Apr 5 14:15:05 2009 (r190712) @@ -955,7 +955,8 @@ ifinit(void) trace_act("interface %s has been off" " %ld seconds; forget it", ifp->int_name, - now.tv_sec-ifp->int_data.ts); + (long)now.tv_sec- + ifp->int_data.ts); ifdel(ifp); } continue; Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/output.c Sun Apr 5 14:15:05 2009 (r190712) @@ -139,7 +139,7 @@ output(enum output_type type, flags = MSG_DONTROUTE; break; case OUT_MULTICAST: - if (ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST) == + if ((ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST)) == IFF_POINTOPOINT) { msg = "Send pt-to-pt"; } else if (ifp->int_state & IS_DUP) { Modified: head/sbin/routed/radix.c ============================================================================== --- head/sbin/routed/radix.c Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/radix.c Sun Apr 5 14:15:05 2009 (r190712) @@ -846,7 +846,7 @@ rn_walktree(struct radix_node_head *h, } int -rn_inithead(void **head, int off) +rn_inithead(struct radix_node_head **head, int off) { struct radix_node_head *rnh; struct radix_node *t, *tt, *ttt; @@ -887,7 +887,7 @@ rn_init(void) addmask_key = cplim = rn_ones + max_keylen; while (cp < cplim) *cp++ = -1; - if (rn_inithead((void **)&mask_rnhead, 0) == 0) + if (rn_inithead(&mask_rnhead, 0) == 0) panic("rn_init 2"); } Modified: head/sbin/routed/radix.h ============================================================================== --- head/sbin/routed/radix.h Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/radix.h Sun Apr 5 14:15:05 2009 (r190712) @@ -138,7 +138,7 @@ struct radix_node_head { #define Free(p) free((void *)p); void rn_init(void); -int rn_inithead(void **, int); +int rn_inithead(struct radix_node_head **head, int off); int rn_refines(void *, void *); int rn_walktree(struct radix_node_head *, int (*)(struct radix_node *, struct walkarg *), Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun Apr 5 14:01:39 2009 (r190711) +++ head/sbin/routed/table.c Sun Apr 5 14:15:05 2009 (r190712) @@ -1631,7 +1631,7 @@ rtinit(void) /* Initialize the radix trees */ max_keylen = sizeof(struct sockaddr_in); rn_init(); - rn_inithead((void**)&rhead, 32); + rn_inithead(&rhead, 32); /* mark all of the slots in the table free */ ag_avail = ag_slots; @@ -2124,8 +2124,8 @@ age(naddr bad_gate) " %ld:%ld", ifp->int_name, naddr_ntoa(ifp->int_dstaddr), - (now.tv_sec - ifp->int_act_time)/60, - (now.tv_sec - ifp->int_act_time)%60); + (long)(now.tv_sec - ifp->int_act_time)/60, + (long)(now.tv_sec - ifp->int_act_time)%60); if_sick(ifp); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 15:06:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5F1106564A; Sun, 5 Apr 2009 15:06:02 +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 6A85F8FC12; Sun, 5 Apr 2009 15:06:02 +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 n35F62gU021185; Sun, 5 Apr 2009 15:06:02 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35F62bM021182; Sun, 5 Apr 2009 15:06:02 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051506.n35F62bM021182@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 15:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190713 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 15:06:02 -0000 Author: phk Date: Sun Apr 5 15:06:02 2009 New Revision: 190713 URL: http://svn.freebsd.org/changeset/base/190713 Log: Convert list of remote interfaces to LIST_* macros Modified: head/sbin/routed/defs.h head/sbin/routed/if.c head/sbin/routed/input.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 14:15:05 2009 (r190712) +++ head/sbin/routed/defs.h Sun Apr 5 15:06:02 2009 (r190713) @@ -264,9 +264,9 @@ struct rt_entry { */ struct interface { LIST_ENTRY(interface) int_list; + LIST_ENTRY(interface) remote_list; struct interface *int_ahash, **int_ahash_prev; struct interface *int_bhash, **int_bhash_prev; - struct interface *int_rlink, **int_rlink_prev; struct interface *int_nhash, **int_nhash_prev; char int_name[IF_NAME_LEN+1]; u_short int_index; @@ -486,7 +486,7 @@ extern naddr loopaddr; /* our address o extern int tot_interfaces; /* # of remote and local interfaces */ extern int rip_interfaces; /* # of interfaces doing RIP */ extern struct ifhead ifnet; /* all interfaces */ -extern struct interface *remote_if; /* remote interfaces */ +extern struct ifhead remote_if; /* remote interfaces */ extern int have_ripv1_out; /* have a RIPv1 interface */ extern int have_ripv1_in; extern int need_flash; /* flash update needed */ Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sun Apr 5 14:15:05 2009 (r190712) +++ head/sbin/routed/if.c Sun Apr 5 15:06:02 2009 (r190713) @@ -42,6 +42,7 @@ __RCSID("$Revision: 2.27 $"); #endif struct ifhead ifnet = LIST_HEAD_INITIALIZER(ifnet); /* all interfaces */ +struct ifhead remote_if = LIST_HEAD_INITIALIZER(ifnet); /* remote interfaces */ /* hash table for all interfaces, big enough to tolerate ridiculous * numbers of IP aliases. Crazy numbers of aliases such as 7000 @@ -56,7 +57,6 @@ struct interface *ahash_tbl[AHASH_LEN]; #define BHASH(a) &bhash_tbl[(a)%BHASH_LEN] struct interface *bhash_tbl[BHASH_LEN]; -struct interface *remote_if; /* remote interfaces */ /* hash for physical interface names. * Assume there are never more 100 or 200 real interfaces, and that @@ -117,13 +117,8 @@ if_link(struct interface *ifp) *hifp = ifp; } - if (ifp->int_state & IS_REMOTE) { - ifp->int_rlink_prev = &remote_if; - ifp->int_rlink = remote_if; - if (remote_if != 0) - remote_if->int_rlink_prev = &ifp->int_rlink; - remote_if = ifp; - } + if (ifp->int_state & IS_REMOTE) + LIST_INSERT_HEAD(&remote_if, ifp, remote_list); hifp = nhash(ifp->int_name); if (ifp->int_state & IS_ALIAS) { @@ -467,11 +462,8 @@ ifdel(struct interface *ifp) if (ifp->int_bhash != 0) ifp->int_bhash->int_bhash_prev = ifp->int_bhash_prev; } - if (ifp->int_state & IS_REMOTE) { - *ifp->int_rlink_prev = ifp->int_rlink; - if (ifp->int_rlink != 0) - ifp->int_rlink->int_rlink_prev = ifp->int_rlink_prev; - } + if (ifp->int_state & IS_REMOTE) + LIST_REMOVE(ifp, remote_list); if (!(ifp->int_state & IS_ALIAS)) { /* delete aliases when the main interface dies Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Sun Apr 5 14:15:05 2009 (r190712) +++ head/sbin/routed/input.c Sun Apr 5 15:06:02 2009 (r190713) @@ -96,7 +96,7 @@ read_rip(int sock, cc+sizeof(inbuf.ifname)); /* check the remote interfaces first */ - for (aifp = remote_if; aifp; aifp = aifp->int_rlink) { + LIST_FOREACH(aifp, &remote_if, remote_list) { if (aifp->int_addr == from.sin_addr.s_addr) break; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 15:24:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FAD21065673; Sun, 5 Apr 2009 15:24:28 +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 EF0F48FC18; Sun, 5 Apr 2009 15:24:27 +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 n35FORxc021540; Sun, 5 Apr 2009 15:24:27 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35FORM8021539; Sun, 5 Apr 2009 15:24:27 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904051524.n35FORM8021539@svn.freebsd.org> From: Paolo Pisati Date: Sun, 5 Apr 2009 15:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190714 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 15:24:28 -0000 Author: piso Date: Sun Apr 5 15:24:27 2009 New Revision: 190714 URL: http://svn.freebsd.org/changeset/base/190714 Log: Improve a bit reass documentation: -document fragment handling sysctls -mention some caveats about fragments handling (and to deal with it) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sun Apr 5 15:06:02 2009 (r190713) +++ head/sbin/ipfw/ipfw.8 Sun Apr 5 15:24:27 2009 (r190714) @@ -873,6 +873,31 @@ If the packet is the last logical fragme .Va net.inet.ip.fw.one_pass is set to 0, processing continues with the next rule, else packet is allowed to pass and search terminates. If the packet is a fragment in the middle, it is consumed and processing stops immediately. +.Pp +Fragments handling can be tuned via +.Va net.inet.ip.maxfragpackets +and +.Va net.inet.ip.maxfragsperpacket +which limit, respectively, the maximum number of processable fragments (default: 800) and +the maximum number of fragments per packet (default: 16). +.Pp +NOTA BENE: since fragments don't contain port numbers, beware not to use them whe issuing a +.Nm reass +rule. Alternatively, direction-based (like +.Nm in +/ +.Nm out +) and source-based (like +.Nm via +) match patterns can be used to select fragments. +.Pp +Usually a simple rule like: +.Bd -literal -offset indent +# reassemble incoming fragments +ipfw add reass all from any to any in +.Ed +.Pp +is all you need at the beginning of your ruleset. .El .Ss RULE BODY The body of a rule contains zero or more patterns (such as From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 15:55:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DB54106566B; Sun, 5 Apr 2009 15:55:10 +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 5AA368FC0A; Sun, 5 Apr 2009 15:55:10 +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 n35FtAOk022497; Sun, 5 Apr 2009 15:55:10 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35Ft9aJ022487; Sun, 5 Apr 2009 15:55:09 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051555.n35Ft9aJ022487@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 15:55: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: r190715 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 15:55:11 -0000 Author: phk Date: Sun Apr 5 15:55:09 2009 New Revision: 190715 URL: http://svn.freebsd.org/changeset/base/190715 Log: Modernize prototypes (ie: no extern) Make lots of stuff static. Modified: head/sbin/routed/defs.h head/sbin/routed/if.c head/sbin/routed/main.c head/sbin/routed/output.c head/sbin/routed/parms.c head/sbin/routed/radix.c head/sbin/routed/radix.h head/sbin/routed/rdisc.c head/sbin/routed/table.c head/sbin/routed/trace.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/defs.h Sun Apr 5 15:55:09 2009 (r190715) @@ -150,12 +150,10 @@ #define MaxMaxAdvertiseInterval 1800 #define MinMaxAdvertiseInterval 4 #define DefMaxAdvertiseInterval 600 -#define DEF_PreferenceLevel 0 #define MIN_PreferenceLevel 0x80000000 #define MAX_INITIAL_ADVERT_INTERVAL 16 #define MAX_INITIAL_ADVERTS 3 -#define MAX_RESPONSE_DELAY 2 #define MAX_SOLICITATION_DELAY 1 #define SOLICITATION_INTERVAL 3 @@ -392,7 +390,7 @@ struct ag_info { /* parameters for interfaces */ -extern struct parm { +struct parm { struct parm *parm_next; char parm_name[IF_NAME_LEN+1]; naddr parm_net; @@ -405,7 +403,7 @@ extern struct parm { int parm_rdisc_pref; /* signed IRDP preference */ int parm_rdisc_int; /* IRDP advertising interval */ struct auth parm_auth[MAX_AUTH_KEYS]; -} *parms; +}; /* authority for internal networks */ extern struct intnet { @@ -444,24 +442,21 @@ extern struct ws_buf { struct netinfo *base; struct netinfo *lim; enum output_type type; -} v12buf, v2buf; +} v12buf; extern pid_t mypid; extern naddr myaddr; /* main address of this system */ extern int stopint; /* !=0 to stop */ -extern int sock_max; extern int rip_sock; /* RIP socket */ extern struct interface *rip_sock_mcast; /* current multicast interface */ extern int rt_sock; /* routing socket */ extern int rt_sock_seqno; extern int rdisc_sock; /* router-discovery raw socket */ -extern int seqno; /* sequence number for messages */ extern int supplier; /* process should supply updates */ extern int supplier_set; /* -s or -q requested */ -extern int lookforinterfaces; /* 1=probe for new up interfaces */ extern int ridhosts; /* 1=reduce host routes */ extern int mhome; /* 1=want multi-homed host route */ extern int advertise_mhome; /* 1=must continue advertising it */ @@ -474,7 +469,6 @@ extern time_t now_stale; extern time_t now_expire; extern time_t now_garbage; -extern struct timeval next_bcast; /* next general broadcast */ extern struct timeval age_timer; /* next check of old routes */ extern struct timeval no_flash; /* inhibit flash update until then */ extern struct timeval rdisc_timer; /* next advert. or solicitation */ @@ -488,7 +482,6 @@ extern int rip_interfaces; /* # of inte extern struct ifhead ifnet; /* all interfaces */ extern struct ifhead remote_if; /* remote interfaces */ extern int have_ripv1_out; /* have a RIPv1 interface */ -extern int have_ripv1_in; extern int need_flash; /* flash update needed */ extern struct timeval need_kern; /* need to update kernel table */ extern u_int update_seqno; /* a route has changed */ @@ -510,21 +503,21 @@ extern struct radix_node_head *rhead; #define dup2(x,y) BSDdup2(x,y) #endif /* sgi */ -extern void fix_sock(int, const char *); -extern void fix_select(void); -extern void rip_off(void); -extern void rip_on(struct interface *); +void fix_sock(int, const char *); +void fix_select(void); +void rip_off(void); +void rip_on(struct interface *); -extern void bufinit(void); -extern int output(enum output_type, struct sockaddr_in *, +void bufinit(void); +int output(enum output_type, struct sockaddr_in *, struct interface *, struct rip *, int); -extern void clr_ws_buf(struct ws_buf *, struct auth *); -extern void rip_query(void); -extern void rip_bcast(int); -extern void supply(struct sockaddr_in *, struct interface *, +void clr_ws_buf(struct ws_buf *, struct auth *); +void rip_query(void); +void rip_bcast(int); +void supply(struct sockaddr_in *, struct interface *, enum output_type, int, int, int); -extern void msglog(const char *, ...) PATTRIB(1,2); +void msglog(const char *, ...) PATTRIB(1,2); struct msg_limit { time_t reuse; struct msg_sub { @@ -533,118 +526,110 @@ struct msg_limit { # define MSG_SUBJECT_N 8 } subs[MSG_SUBJECT_N]; }; -extern void msglim(struct msg_limit *, naddr, +void msglim(struct msg_limit *, naddr, const char *, ...) PATTRIB(3,4); #define LOGERR(msg) msglog(msg ": %s", strerror(errno)) -extern void logbad(int, const char *, ...) PATTRIB(2,3); +void logbad(int, const char *, ...) PATTRIB(2,3); #define BADERR(dump,msg) logbad(dump,msg ": %s", strerror(errno)) #ifdef DEBUG #define DBGERR(dump,msg) BADERR(dump,msg) #else #define DBGERR(dump,msg) LOGERR(msg) #endif -extern char *naddr_ntoa(naddr); -extern const char *saddr_ntoa(struct sockaddr *); +char *naddr_ntoa(naddr); +const char *saddr_ntoa(struct sockaddr *); -extern void *rtmalloc(size_t, const char *); -extern void timevaladd(struct timeval *, struct timeval *); -extern void intvl_random(struct timeval *, u_long, u_long); -extern int getnet(char *, naddr *, naddr *); -extern int gethost(char *, naddr *); -extern void gwkludge(void); -extern const char *parse_parms(char *, int); -extern const char *check_parms(struct parm *); -extern void get_parms(struct interface *); - -extern void lastlog(void); -extern void trace_close(int); -extern void set_tracefile(const char *, const char *, int); -extern void tracelevel_msg(const char *, int); -extern void trace_off(const char*, ...) PATTRIB(1,2); -extern void set_tracelevel(void); -extern void trace_flush(void); -extern void trace_misc(const char *, ...) PATTRIB(1,2); -extern void trace_act(const char *, ...) PATTRIB(1,2); -extern void trace_pkt(const char *, ...) PATTRIB(1,2); -extern void trace_add_del(const char *, struct rt_entry *); -extern void trace_change(struct rt_entry *, u_int, struct rt_spare *, +void *rtmalloc(size_t, const char *); +void timevaladd(struct timeval *, struct timeval *); +void intvl_random(struct timeval *, u_long, u_long); +int getnet(char *, naddr *, naddr *); +int gethost(char *, naddr *); +void gwkludge(void); +const char *parse_parms(char *, int); +const char *check_parms(struct parm *); +void get_parms(struct interface *); + +void lastlog(void); +void trace_close(int); +void set_tracefile(const char *, const char *, int); +void tracelevel_msg(const char *, int); +void trace_off(const char*, ...) PATTRIB(1,2); +void set_tracelevel(void); +void trace_flush(void); +void trace_misc(const char *, ...) PATTRIB(1,2); +void trace_act(const char *, ...) PATTRIB(1,2); +void trace_pkt(const char *, ...) PATTRIB(1,2); +void trace_add_del(const char *, struct rt_entry *); +void trace_change(struct rt_entry *, u_int, struct rt_spare *, const char *); -extern void trace_if(const char *, struct interface *); -extern void trace_upslot(struct rt_entry *, struct rt_spare *, +void trace_if(const char *, struct interface *); +void trace_upslot(struct rt_entry *, struct rt_spare *, struct rt_spare *); -extern void trace_rip(const char*, const char*, struct sockaddr_in *, +void trace_rip(const char*, const char*, struct sockaddr_in *, struct interface *, struct rip *, int); -extern char *addrname(naddr, naddr, int); -extern char *rtname(naddr, naddr, naddr); +char *addrname(naddr, naddr, int); +char *rtname(naddr, naddr, naddr); -extern void rdisc_age(naddr); -extern void set_rdisc_mg(struct interface *, int); -extern void set_supplier(void); -extern void if_bad_rdisc(struct interface *); -extern void if_ok_rdisc(struct interface *); -extern void read_rip(int, struct interface *); -extern void read_rt(void); -extern void read_d(void); -extern void rdisc_adv(void); -extern void rdisc_sol(void); - -extern void sigalrm(int); -extern void sigterm(int); +void rdisc_age(naddr); +void set_rdisc_mg(struct interface *, int); +void set_supplier(void); +void if_bad_rdisc(struct interface *); +void if_ok_rdisc(struct interface *); +void read_rip(int, struct interface *); +void read_rt(void); +void read_d(void); +void rdisc_adv(void); +void rdisc_sol(void); -extern void sigtrace_on(int); -extern void sigtrace_off(int); +void sigtrace_on(int); +void sigtrace_off(int); -extern void flush_kern(void); -extern void age(naddr); +void flush_kern(void); +void age(naddr); -extern void ag_flush(naddr, naddr, void (*)(struct ag_info *)); -extern void ag_check(naddr, naddr, naddr, naddr, char, char, u_int, +void ag_flush(naddr, naddr, void (*)(struct ag_info *)); +void ag_check(naddr, naddr, naddr, naddr, char, char, u_int, u_short, u_short, void (*)(struct ag_info *)); -extern void del_static(naddr, naddr, naddr, int); -extern void del_redirects(naddr, time_t); -extern struct rt_entry *rtget(naddr, naddr); -extern struct rt_entry *rtfind(naddr); -extern void rtinit(void); -extern void rtadd(naddr, naddr, u_int, struct rt_spare *); -extern void rtchange(struct rt_entry *, u_int, struct rt_spare *, char *); -extern void rtdelete(struct rt_entry *); -extern void rts_delete(struct rt_entry *, struct rt_spare *); -extern void rtbad_sub(struct rt_entry *); -extern void rtswitch(struct rt_entry *, struct rt_spare *); -extern void rtbad(struct rt_entry *); +void del_static(naddr, naddr, naddr, int); +void del_redirects(naddr, time_t); +struct rt_entry *rtget(naddr, naddr); +struct rt_entry *rtfind(naddr); +void rtinit(void); +void rtadd(naddr, naddr, u_int, struct rt_spare *); +void rtchange(struct rt_entry *, u_int, struct rt_spare *, char *); +void rtdelete(struct rt_entry *); +void rts_delete(struct rt_entry *, struct rt_spare *); +void rtbad_sub(struct rt_entry *); +void rtswitch(struct rt_entry *, struct rt_spare *); #define S_ADDR(x) (((struct sockaddr_in *)(x))->sin_addr.s_addr) #define INFO_DST(I) ((I)->rti_info[RTAX_DST]) #define INFO_GATE(I) ((I)->rti_info[RTAX_GATEWAY]) #define INFO_MASK(I) ((I)->rti_info[RTAX_NETMASK]) #define INFO_IFA(I) ((I)->rti_info[RTAX_IFA]) -#define INFO_IFP(I) ((I)->rti_info[RTAX_IFP]) #define INFO_AUTHOR(I) ((I)->rti_info[RTAX_AUTHOR]) #define INFO_BRD(I) ((I)->rti_info[RTAX_BRD]) void rt_xaddrs(struct rt_addrinfo *, struct sockaddr *, struct sockaddr *, int); -extern naddr std_mask(naddr); -extern naddr ripv1_mask_net(naddr, struct interface *); -extern naddr ripv1_mask_host(naddr,struct interface *); +naddr std_mask(naddr); +naddr ripv1_mask_net(naddr, struct interface *); +naddr ripv1_mask_host(naddr,struct interface *); #define on_net(a,net,mask) (((ntohl(a) ^ (net)) & (mask)) == 0) -extern int check_dst(naddr); -extern struct interface *check_dup(naddr, naddr, naddr, int); -extern int check_remote(struct interface *); -extern int addrouteforif(struct interface *); -extern void ifinit(void); -extern int walk_bad(struct radix_node *, struct walkarg *); -extern int if_ok(struct interface *, const char *); -extern void if_sick(struct interface *); -extern void if_bad(struct interface *); -extern void if_link(struct interface *); -extern struct interface *ifwithaddr(naddr, int, int); -extern struct interface *ifwithname(char *, naddr); -extern struct interface *ifwithindex(u_short, int); -extern struct interface *iflookup(naddr); +int check_dst(naddr); +struct interface *check_dup(naddr, naddr, naddr, int); +int check_remote(struct interface *); +void ifinit(void); +int walk_bad(struct radix_node *, struct walkarg *); +int if_ok(struct interface *, const char *); +void if_sick(struct interface *); +void if_link(struct interface *); +struct interface *ifwithaddr(naddr addr, int bcast, int remote); +struct interface *ifwithindex(u_short, int); +struct interface *iflookup(naddr); -extern struct auth *find_auth(struct interface *); -extern void end_md5_auth(struct ws_buf *, struct auth *); +struct auth *find_auth(struct interface *); +void end_md5_auth(struct ws_buf *, struct auth *); #if defined(__FreeBSD__) || defined(__NetBSD__) #include @@ -655,7 +640,7 @@ typedef struct { u_int32_t count[2]; /* # of bits, modulo 2^64 (LSB 1st) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; -extern void MD5Init(MD5_CTX*); -extern void MD5Update(MD5_CTX*, u_char*, u_int); -extern void MD5Final(u_char[MD5_DIGEST_LEN], MD5_CTX*); +void MD5Init(MD5_CTX*); +void MD5Update(MD5_CTX*, u_char*, u_int); +void MD5Final(u_char[MD5_DIGEST_LEN], MD5_CTX*); #endif Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/if.c Sun Apr 5 15:55:09 2009 (r190715) @@ -51,11 +51,11 @@ struct ifhead remote_if = LIST_HEAD_INIT */ #define AHASH_LEN 211 /* must be prime */ #define AHASH(a) &ahash_tbl[(a)%AHASH_LEN] -struct interface *ahash_tbl[AHASH_LEN]; +static struct interface *ahash_tbl[AHASH_LEN]; #define BHASH_LEN 211 /* must be prime */ #define BHASH(a) &bhash_tbl[(a)%BHASH_LEN] -struct interface *bhash_tbl[BHASH_LEN]; +static struct interface *bhash_tbl[BHASH_LEN]; /* hash for physical interface names. @@ -63,13 +63,13 @@ struct interface *bhash_tbl[BHASH_LEN]; * aliases are put on the end of the hash chains. */ #define NHASH_LEN 97 -struct interface *nhash_tbl[NHASH_LEN]; +static struct interface *nhash_tbl[NHASH_LEN]; int tot_interfaces; /* # of remote and local interfaces */ int rip_interfaces; /* # of interfaces doing RIP */ -int foundloopback; /* valid flag for loopaddr */ +static int foundloopback; /* valid flag for loopaddr */ naddr loopaddr; /* our address on loopback */ -struct rt_spare loop_rts; +static struct rt_spare loop_rts; struct timeval ifinit_timer; static struct timeval last_ifinit; @@ -78,9 +78,12 @@ static struct timeval last_ifinit; && timercmp(&ifinit_timer, &now, >)) int have_ripv1_out; /* have a RIPv1 interface */ -int have_ripv1_in; +static int have_ripv1_in; +static void if_bad(struct interface *); +static int addrouteforif(struct interface *); + static struct interface** nhash(char *p) { @@ -173,7 +176,7 @@ ifwithaddr(naddr addr, /* find the interface with a name */ -struct interface * +static struct interface * ifwithname(char *name, /* "ec0" or whatever */ naddr addr) /* 0 or network address */ { @@ -535,7 +538,7 @@ if_sick(struct interface *ifp) /* Mark an interface dead. */ -void +static void if_bad(struct interface *ifp) { struct interface *ifp1; @@ -1309,7 +1312,7 @@ check_net_syn(struct interface *ifp) * Create route to other end if a point-to-point link, * otherwise a route to this (sub)network. */ -int /* 0=bad interface */ +static int /* 0=bad interface */ addrouteforif(struct interface *ifp) { struct rt_entry *rt; Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/main.c Sun Apr 5 15:55:09 2009 (r190715) @@ -54,38 +54,39 @@ __RCSID("$Revision: 2.31 $"); pid_t mypid; naddr myaddr; /* system address */ -char myname[MAXHOSTNAMELEN+1]; +static char myname[MAXHOSTNAMELEN+1]; -int verbose; +static int verbose; int supplier; /* supply or broadcast updates */ int supplier_set; -int ipforwarding = 1; /* kernel forwarding on */ +static int ipforwarding = 1; /* kernel forwarding on */ -int default_gateway; /* 1=advertise default */ -int background = 1; +static int default_gateway; /* 1=advertise default */ +static int background = 1; int ridhosts; /* 1=reduce host routes */ int mhome; /* 1=want multi-homed host route */ int advertise_mhome; /* 1=must continue advertising it */ int auth_ok = 1; /* 1=ignore auth if we do not care */ struct timeval epoch; /* when started */ -struct timeval clk, prev_clk; +struct timeval clk; +static struct timeval prev_clk; static int usec_fudge; struct timeval now; /* current idea of time */ time_t now_stale; time_t now_expire; time_t now_garbage; -struct timeval next_bcast; /* next general broadcast */ +static struct timeval next_bcast; /* next general broadcast */ struct timeval no_flash = { /* inhibit flash update */ EPOCH+SUPPLY_INTERVAL, 0 }; -struct timeval flush_kern_timer; +static struct timeval flush_kern_timer; -fd_set fdbits; -int sock_max; +static fd_set fdbits; +static int sock_max; int rip_sock = -1; /* RIP socket */ struct interface *rip_sock_mcast; /* current multicast interface */ int rt_sock; /* routing socket */ @@ -94,6 +95,8 @@ int rt_sock_seqno; static int get_rip_sock(naddr, int); static void timevalsub(struct timeval *, struct timeval *, struct timeval *); +static void sigalrm(int s UNUSED); +static void sigterm(int sig); int main(int argc, @@ -543,7 +546,7 @@ usage: /* ARGSUSED */ -void +static void sigalrm(int s UNUSED) { /* Historically, SIGALRM would cause the daemon to check for @@ -555,7 +558,7 @@ sigalrm(int s UNUSED) /* watch for fatal signals */ -void +static void sigterm(int sig) { stopint = sig; Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/output.c Sun Apr 5 15:55:09 2009 (r190715) @@ -46,7 +46,7 @@ u_int update_seqno; /* walk the tree of routes with this for output */ -struct { +static struct { struct sockaddr_in to; naddr to_mask; naddr to_net; @@ -69,11 +69,11 @@ struct { /* A buffer for what can be heard by both RIPv1 and RIPv2 listeners */ struct ws_buf v12buf; -union pkt_buf ripv12_buf; +static union pkt_buf ripv12_buf; /* Another for only RIPv2 listeners */ -struct ws_buf v2buf; -union pkt_buf rip_v2_buf; +static struct ws_buf v2buf; +static union pkt_buf rip_v2_buf; Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/parms.c Sun Apr 5 15:55:09 2009 (r190715) @@ -43,7 +43,7 @@ __RCSID("$Revision: 2.26 $"); #endif -struct parm *parms; +static struct parm *parms; struct intnet *intnets; struct r1net *r1nets; struct tgate *tgates; Modified: head/sbin/routed/radix.c ============================================================================== --- head/sbin/routed/radix.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/radix.c Sun Apr 5 15:55:09 2009 (r190715) @@ -51,10 +51,11 @@ __RCSID("$Revision: 2.23 $"); #define min(a,b) (((a)<(b))?(a):(b)) int max_keylen; -struct radix_mask *rn_mkfreelist; -struct radix_node_head *mask_rnhead; +static struct radix_mask *rn_mkfreelist; +static struct radix_node_head *mask_rnhead; static char *addmask_key; -static char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1}; +static uint8_t normal_chars[] = + { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; static char *rn_zeros, *rn_ones; #define rn_masktop (mask_rnhead->rnh_treetop) @@ -63,6 +64,10 @@ static char *rn_zeros, *rn_ones; : memcmp((caddr_t)(a), (caddr_t)(b), (size_t)l)) static int rn_satisfies_leaf(char *, struct radix_node *, int); +static struct radix_node *rn_addmask(void *n_arg, int search, int skip); +static struct radix_node *rn_addroute(void *v_arg, void *n_arg, + struct radix_node_head *head, struct radix_node treenodes[2]); +static struct radix_node *rn_match(void *v_arg, struct radix_node_head *head); /* * The data structure for the keys is a radix tree with one way @@ -98,7 +103,7 @@ static int rn_satisfies_leaf(char *, str * that governs a subtree. */ -struct radix_node * +static struct radix_node * rn_search(void *v_arg, struct radix_node *head) { @@ -114,7 +119,7 @@ rn_search(void *v_arg, return (x); } -struct radix_node * +static struct radix_node * rn_search_m(void *v_arg, struct radix_node *head, void *m_arg) @@ -132,7 +137,7 @@ rn_search_m(void *v_arg, return x; } -int +static int rn_refines(void* m_arg, void *n_arg) { caddr_t m = m_arg, n = n_arg; @@ -158,7 +163,7 @@ rn_refines(void* m_arg, void *n_arg) return (!masks_are_equal); } -struct radix_node * +static struct radix_node * rn_lookup(void *v_arg, void *m_arg, struct radix_node_head *head) { struct radix_node *x; @@ -197,7 +202,7 @@ rn_satisfies_leaf(char *trial, return 1; } -struct radix_node * +static struct radix_node * rn_match(void *v_arg, struct radix_node_head *head) { @@ -321,7 +326,7 @@ int rn_saveinfo; int rn_debug = 1; #endif -struct radix_node * +static struct radix_node * rn_newpair(void *v, int b, struct radix_node nodes[2]) { struct radix_node *tt = nodes, *t = tt + 1; @@ -336,7 +341,7 @@ rn_newpair(void *v, int b, struct radix_ return t; } -struct radix_node * +static struct radix_node * rn_insert(void* v_arg, struct radix_node_head *head, int *dupentry, @@ -404,7 +409,7 @@ on1: return (tt); } -struct radix_node * +static struct radix_node * rn_addmask(void *n_arg, int search, int skip) { caddr_t netmask = (caddr_t)n_arg; @@ -512,7 +517,7 @@ rn_new_radix_mask(struct radix_node *tt, return m; } -struct radix_node * +static struct radix_node * rn_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, @@ -655,7 +660,7 @@ on2: return tt; } -struct radix_node * +static struct radix_node * rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head) Modified: head/sbin/routed/radix.h ============================================================================== --- head/sbin/routed/radix.h Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/radix.h Sun Apr 5 15:55:09 2009 (r190715) @@ -80,7 +80,7 @@ struct radix_node { * Annotations to tree concerning potential routes applying to subtrees. */ -extern struct radix_mask { +struct radix_mask { short rm_b; /* bit offset; -1-index(netmask) */ char rm_unused; /* cf. rn_bmask */ u_char rm_flags; /* cf. rn_flags */ @@ -90,7 +90,7 @@ extern struct radix_mask { struct radix_node *rmu_leaf; /* for normal routes */ } rm_rmu; int rm_refs; /* # of references to this struct */ -} *rn_mkfreelist; +}; #define rm_mask rm_rmu.rmu_mask #define rm_leaf rm_rmu.rmu_leaf /* extra field would make 32 bytes */ @@ -139,23 +139,8 @@ struct radix_node_head { void rn_init(void); int rn_inithead(struct radix_node_head **head, int off); -int rn_refines(void *, void *); int rn_walktree(struct radix_node_head *, int (*)(struct radix_node *, struct walkarg *), struct walkarg *); -struct radix_node - *rn_addmask(void *, int, int), - *rn_addroute(void *, void *, struct radix_node_head *, - struct radix_node [2]), - *rn_delete(void *, void *, struct radix_node_head *), - *rn_insert(void *, struct radix_node_head *, int *, - struct radix_node [2]), - *rn_match(void *, struct radix_node_head *), - *rn_newpair(void *, int, struct radix_node[2]), - *rn_search(void *, struct radix_node *), - *rn_search_m(void *, struct radix_node *, void *); - -struct radix_node *rn_lookup(void *, void *, struct radix_node_head *); - #endif /* __RADIX_H_ */ Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/rdisc.c Sun Apr 5 15:55:09 2009 (r190715) @@ -73,14 +73,14 @@ union ad_u { int rdisc_sock = -1; /* router-discovery raw socket */ -struct interface *rdisc_sock_mcast; /* current multicast interface */ +static struct interface *rdisc_sock_mcast; /* current multicast interface */ struct timeval rdisc_timer; int rdisc_ok; /* using solicited route */ #define MAX_ADS 16 /* at least one per interface */ -struct dr { /* accumulated advertisements */ +static struct dr { /* accumulated advertisements */ struct interface *dr_ifp; naddr dr_gate; /* gateway */ time_t dr_ts; /* when received */ Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/table.c Sun Apr 5 15:55:09 2009 (r190715) @@ -48,6 +48,7 @@ static void masktrim(struct sockaddr_in #else static void masktrim(struct sockaddr_in_new *ap); #endif +static void rtbad(struct rt_entry *); struct radix_node_head *rhead; /* root of the radix tree */ @@ -66,7 +67,7 @@ int stopint; int total_routes; /* zap any old routes through this gateway */ -naddr age_bad_gate; +static naddr age_bad_gate; /* It is desirable to "aggregate" routes, to combine differing routes of @@ -93,7 +94,7 @@ naddr age_bad_gate; * sorted first by address, with the smallest address first. */ -struct ag_info ag_slots[NUM_AG_SLOTS], *ag_avail, *ag_corsest, *ag_finest; +static struct ag_info ag_slots[NUM_AG_SLOTS], *ag_avail, *ag_corsest, *ag_finest; /* #define DEBUG_AG */ #ifdef DEBUG_AG @@ -611,7 +612,7 @@ ag_check(naddr dst, static const char * rtm_type_name(u_char type) { - static const char *rtm_types[] = { + static const char * const rtm_types[] = { "RTM_ADD", "RTM_DELETE", "RTM_CHANGE", @@ -1886,7 +1887,7 @@ rts_delete(struct rt_entry *rt, /* Get rid of a bad route, and try to switch to a replacement. */ -void +static void rtbad(struct rt_entry *rt) { struct rt_spare new; Modified: head/sbin/routed/trace.c ============================================================================== --- head/sbin/routed/trace.c Sun Apr 5 15:24:27 2009 (r190714) +++ head/sbin/routed/trace.c Sun Apr 5 15:55:09 2009 (r190715) @@ -58,7 +58,7 @@ FILE *ftrace; /* output trace file */ static const char *sigtrace_pat = "%s"; static char savetracename[PATH_MAX]; char inittracename[PATH_MAX]; -int file_trace; /* 1=tracing to file, not stdout */ +static int file_trace; /* 1=tracing to file, not stdout */ static void trace_dump(void); static void tmsg(const char *, ...) PATTRIB(1,2); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 16:01:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F3F4106564A; Sun, 5 Apr 2009 16:01:56 +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 6341F8FC0C; Sun, 5 Apr 2009 16:01:56 +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 n35G1uO3023002; Sun, 5 Apr 2009 16:01:56 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35G1uME022999; Sun, 5 Apr 2009 16:01:56 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051601.n35G1uME022999@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 16:01: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: r190716 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 16:01:57 -0000 Author: phk Date: Sun Apr 5 16:01:56 2009 New Revision: 190716 URL: http://svn.freebsd.org/changeset/base/190716 Log: Some constifications Modified: head/sbin/routed/defs.h head/sbin/routed/main.c head/sbin/routed/rdisc.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/defs.h Sun Apr 5 16:01:56 2009 (r190716) @@ -450,7 +450,7 @@ extern naddr myaddr; /* main address o extern int stopint; /* !=0 to stop */ extern int rip_sock; /* RIP socket */ -extern struct interface *rip_sock_mcast; /* current multicast interface */ +extern const struct interface *rip_sock_mcast; /* current multicast interface */ extern int rt_sock; /* routing socket */ extern int rt_sock_seqno; extern int rdisc_sock; /* router-discovery raw socket */ Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/main.c Sun Apr 5 16:01:56 2009 (r190716) @@ -88,7 +88,7 @@ static struct timeval flush_kern_timer; static fd_set fdbits; static int sock_max; int rip_sock = -1; /* RIP socket */ -struct interface *rip_sock_mcast; /* current multicast interface */ +const struct interface *rip_sock_mcast; /* current multicast interface */ int rt_sock; /* routing socket */ int rt_sock_seqno; Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun Apr 5 15:55:09 2009 (r190715) +++ head/sbin/routed/rdisc.c Sun Apr 5 16:01:56 2009 (r190716) @@ -73,21 +73,23 @@ union ad_u { int rdisc_sock = -1; /* router-discovery raw socket */ -static struct interface *rdisc_sock_mcast; /* current multicast interface */ +static const struct interface *rdisc_sock_mcast; /* current multicast interface */ struct timeval rdisc_timer; int rdisc_ok; /* using solicited route */ #define MAX_ADS 16 /* at least one per interface */ -static struct dr { /* accumulated advertisements */ +struct dr { /* accumulated advertisements */ struct interface *dr_ifp; naddr dr_gate; /* gateway */ time_t dr_ts; /* when received */ time_t dr_life; /* lifetime in host byte order */ n_long dr_recv_pref; /* received but biased preference */ n_long dr_pref; /* preference adjusted by metric */ -} *cur_drp, drs[MAX_ADS]; +}; +static const struct dr *cur_drp; +static struct dr drs[MAX_ADS]; /* convert between signed, balanced around zero, * and unsigned zero-based preferences */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 17:12:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 163011065670; Sun, 5 Apr 2009 17:12:14 +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 04FD98FC0C; Sun, 5 Apr 2009 17:12:14 +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 n35HCDHb025928; Sun, 5 Apr 2009 17:12:13 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35HCD44025927; Sun, 5 Apr 2009 17:12:13 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051712.n35HCD44025927@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 17:12: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: r190717 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 17:12:14 -0000 Author: phk Date: Sun Apr 5 17:12:13 2009 New Revision: 190717 URL: http://svn.freebsd.org/changeset/base/190717 Log: Fix casts which are not by definition safe, but which malloc(3) makes safe for us. Modified: head/sbin/routed/if.c Modified: head/sbin/routed/if.c ============================================================================== --- head/sbin/routed/if.c Sun Apr 5 16:01:56 2009 (r190716) +++ head/sbin/routed/if.c Sun Apr 5 17:12:13 2009 (r190717) @@ -640,7 +640,7 @@ rt_xaddrs(struct rt_addrinfo *info, void ifinit(void) { - static char *sysctl_buf; + static struct ifa_msghdr *sysctl_buf; static size_t sysctl_buf_size = 0; uint complaints = 0; static u_int prev_complaints = 0; @@ -659,7 +659,8 @@ ifinit(void) size_t needed; int mib[6]; struct if_msghdr *ifm; - struct ifa_msghdr *ifam, *ifam_lim, *ifam2; + void *ifam_lim; + struct ifa_msghdr *ifam, *ifam2; int in, ierr, out, oerr; struct intnet *intnetp; struct rt_addrinfo info; @@ -702,10 +703,9 @@ ifinit(void) "ifinit sysctl"); } - ifam_lim = (struct ifa_msghdr *)(sysctl_buf + needed); - for (ifam = (struct ifa_msghdr *)sysctl_buf; - ifam < ifam_lim; - ifam = ifam2) { + /* XXX: thanks to malloc(3), alignment can be presumed OK */ + ifam_lim = (char *)sysctl_buf + needed; + for (ifam = sysctl_buf; (void *)ifam < ifam_lim; ifam = ifam2) { ifam2 = (struct ifa_msghdr*)((char*)ifam + ifam->ifam_msglen); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 17:33:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6DBE1065670; Sun, 5 Apr 2009 17:33:08 +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 A51A58FC0C; Sun, 5 Apr 2009 17:33:08 +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 n35HX8mk026341; Sun, 5 Apr 2009 17:33:08 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35HX7bE026332; Sun, 5 Apr 2009 17:33:07 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051733.n35HX7bE026332@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 17:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190718 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 17:33:09 -0000 Author: phk Date: Sun Apr 5 17:33:07 2009 New Revision: 190718 URL: http://svn.freebsd.org/changeset/base/190718 Log: Add some consts, remove some unused stuff and other attempts to calm FlexeLint down. Modified: head/sbin/routed/defs.h head/sbin/routed/input.c head/sbin/routed/output.c head/sbin/routed/parms.c head/sbin/routed/radix.c head/sbin/routed/radix.h head/sbin/routed/rdisc.c head/sbin/routed/table.c head/sbin/routed/trace.c Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/defs.h Sun Apr 5 17:33:07 2009 (r190718) @@ -60,6 +60,7 @@ * years have been simplified and integrated. */ +#include #include #include #include Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/input.c Sun Apr 5 17:33:07 2009 (r190718) @@ -931,7 +931,7 @@ ck_passwd(struct interface *aifp, u_char hash[RIP_AUTH_PW_LEN]; int i, len; - + assert(aifp != NULL); if ((void *)NA >= lim || NA->a_family != RIP_AF_AUTH) { msglim(use_authp, from, "missing password from %s", naddr_ntoa(from)); Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/output.c Sun Apr 5 17:33:07 2009 (r190718) @@ -107,6 +107,7 @@ output(enum output_type type, int soc; int serrno; + assert(ifp != NULL); osin = *dst; if (osin.sin_port == 0) osin.sin_port = htons(RIP_PORT); @@ -672,6 +673,7 @@ supply(struct sockaddr_in *dst, struct rt_entry *rt; int def_metric; + assert(ifp != NULL); ws.state = 0; ws.gen_limit = 1024; Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/parms.c Sun Apr 5 17:33:07 2009 (r190718) @@ -437,9 +437,7 @@ parse_ts(time_t *tp, u_int bufsize) { struct tm tm; -#if defined(sgi) || defined(__NetBSD__) char *ptr; -#endif if (0 > parse_quote(valp, "| ,\n\r", delimp, buf,bufsize) @@ -450,25 +448,11 @@ parse_ts(time_t *tp, } strcat(buf,"\n"); memset(&tm, 0, sizeof(tm)); -#if defined(sgi) || defined(__NetBSD__) ptr = strptime(buf, "%y/%m/%d@%H:%M\n", &tm); if (ptr == NULL || *ptr != '\0') { sprintf(buf,"bad timestamp %.25s", val0); return buf; } -#else - if (5 != sscanf(buf, "%u/%u/%u@%u:%u\n", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, - &tm.tm_hour, &tm.tm_min) - || tm.tm_mon < 1 || tm.tm_mon > 12 - || tm.tm_mday < 1 || tm.tm_mday > 31) { - sprintf(buf,"bad timestamp %.25s", val0); - return buf; - } - tm.tm_mon--; - if (tm.tm_year <= 37) /* assume small years are in the */ - tm.tm_year += 100; /* 3rd millenium */ -#endif if ((*tp = mktime(&tm)) == -1) { sprintf(buf,"bad timestamp %.25s", val0); @@ -495,7 +479,7 @@ get_passwd(char *tgt, int i; u_long l; - + assert(val != NULL); if (!safe) return "ignore unsafe password"; @@ -658,6 +642,8 @@ parse_parms(char *line, if (0 > parse_quote(&line, " #,\n\r",&delim, buf,sizeof(buf))) return bad_str(tgt); + } else { + val0 = NULL; } if (delim != '\0') { for (;;) { Modified: head/sbin/routed/radix.c ============================================================================== --- head/sbin/routed/radix.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/radix.c Sun Apr 5 17:33:07 2009 (r190718) @@ -54,12 +54,11 @@ int max_keylen; static struct radix_mask *rn_mkfreelist; static struct radix_node_head *mask_rnhead; static char *addmask_key; -static uint8_t normal_chars[] = +static const uint8_t normal_chars[] = { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; static char *rn_zeros, *rn_ones; #define rn_masktop (mask_rnhead->rnh_treetop) -#undef Bcmp #define Bcmp(a, b, l) (l == 0 ? 0 \ : memcmp((caddr_t)(a), (caddr_t)(b), (size_t)l)) Modified: head/sbin/routed/radix.h ============================================================================== --- head/sbin/routed/radix.h Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/radix.h Sun Apr 5 17:33:07 2009 (r190718) @@ -132,7 +132,6 @@ struct radix_node_head { }; -#define Bcmp(a, b, n) memcmp(((void *)(a)), ((void *)(b)), (n)) #define Bcopy(a, b, n) memmove(((void *)(b)), ((void *)(a)), (size_t)(n)) #define Bzero(p, n) memset((void *)(p), 0, (size_t)(n)); #define Free(p) free((void *)p); Modified: head/sbin/routed/rdisc.c ============================================================================== --- head/sbin/routed/rdisc.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/rdisc.c Sun Apr 5 17:33:07 2009 (r190718) @@ -173,6 +173,8 @@ set_rdisc_mg(struct interface *ifp, struct group_req gr; struct sockaddr_in *sin; + assert(ifp != NULL); + if (rdisc_sock < 0) { /* Create the raw socket so that we can hear at least * broadcast router discovery packets. @@ -944,7 +946,6 @@ read_d(void) #endif union { struct ip ip; - u_short s[512/2]; u_char b[512]; } pkt; } buf; Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/table.c Sun Apr 5 17:33:07 2009 (r190718) @@ -607,8 +607,6 @@ ag_check(naddr dst, CHECK_AG(); } - -#define NAME0_LEN 14 static const char * rtm_type_name(u_char type) { Modified: head/sbin/routed/trace.c ============================================================================== --- head/sbin/routed/trace.c Sun Apr 5 17:12:13 2009 (r190717) +++ head/sbin/routed/trace.c Sun Apr 5 17:33:07 2009 (r190718) @@ -51,8 +51,6 @@ __RCSID("$Revision: 2.27 $"); #define stat stat64 #endif -#define NRECORDS 50 /* size of circular trace buffer */ - int tracelevel, new_tracelevel; FILE *ftrace; /* output trace file */ static const char *sigtrace_pat = "%s"; @@ -255,13 +253,13 @@ void tracelevel_msg(const char *pat, int dump) /* -1=no dump, 0=default, 1=force */ { - static const char *off_msgs[MAX_TRACELEVEL] = { + static const char * const off_msgs[MAX_TRACELEVEL] = { "Tracing actions stopped", "Tracing packets stopped", "Tracing packet contents stopped", "Tracing kernel changes stopped", }; - static const char *on_msgs[MAX_TRACELEVEL] = { + static const char * const on_msgs[MAX_TRACELEVEL] = { "Tracing actions started", "Tracing packets started", "Tracing packet contents started", @@ -473,13 +471,13 @@ struct bits { const char *bits_name; }; -static struct bits if_bits[] = { +static const struct bits if_bits[] = { { IFF_LOOPBACK, 0, "LOOPBACK" }, { IFF_POINTOPOINT, 0, "PT-TO-PT" }, { 0, 0, 0} }; -static struct bits is_bits[] = { +static const struct bits is_bits[] = { { IS_ALIAS, 0, "ALIAS" }, { IS_SUBNET, 0, "" }, { IS_REMOTE, (IS_NO_RDISC @@ -523,7 +521,7 @@ static struct bits is_bits[] = { { 0, 0, "%#x"} }; -static struct bits rs_bits[] = { +static const struct bits rs_bits[] = { { RS_IF, 0, "IF" }, { RS_NET_INT, RS_NET_SYN, "NET_INT" }, { RS_NET_SYN, 0, "NET_SYN" }, From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDADD10656F7; Sun, 5 Apr 2009 18:18:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAECE8FC1B; Sun, 5 Apr 2009 18:18:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35II140027262; Sun, 5 Apr 2009 18:18:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35II1wL027261; Sun, 5 Apr 2009 18:18:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35II1wL027261@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190719 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:02 -0000 Author: thompsa Date: Sun Apr 5 18:18:01 2009 New Revision: 190719 URL: http://svn.freebsd.org/changeset/base/190719 Log: MFp4 //depot/projects/usb@159562 Reapply r190173 with compilation fixed on 64bit arches. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/ustorage_fs.c Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Sun Apr 5 17:33:07 2009 (r190718) +++ head/sys/dev/usb/storage/ustorage_fs.c Sun Apr 5 18:18:01 2009 (r190719) @@ -60,12 +60,10 @@ SYSCTL_INT(_hw_usb2_ustorage_fs, OID_AUT /* Define some limits */ #ifndef USTORAGE_FS_BULK_SIZE -#define USTORAGE_FS_BULK_SIZE (1 << 17) /* bytes */ +#define USTORAGE_FS_BULK_SIZE (1UL << 17) /* bytes */ #endif #define USTORAGE_FS_MAX_LUN 8 /* units */ -#define USTORAGE_FS_RELEASE 0x0101 -#define USTORAGE_FS_RAM_SECT (1 << 13) /* * The SCSI ID string must be exactly 28 characters long @@ -976,8 +974,6 @@ static uint8_t ustorage_fs_inquiry(struct ustorage_fs_softc *sc) { uint8_t *buf = sc->sc_transfer.data_ptr; - static const char vendor_id[] = "FreeBSD "; - static const char product_id[] = "File-Stor Gadget"; struct ustorage_fs_lun *currlun = sc->sc_transfer.currlun; @@ -999,12 +995,9 @@ ustorage_fs_inquiry(struct ustorage_fs_s buf[4] = 31; /* Additional length */ /* No special options */ - /* - * NOTE: We are writing an extra zero here, that is not - * transferred to the peer: - */ - snprintf(buf + 8, 28 + 1, "%-8s%-16s%04x", vendor_id, product_id, - USTORAGE_FS_RELEASE); + /* Copy in ID string */ + memcpy(buf + 8, USTORAGE_FS_ID_STRING, 28); + return (ustorage_fs_min_len(sc, 36, 0 - 1)); } @@ -1353,7 +1346,7 @@ ustorage_fs_read(struct ustorage_fs_soft * too big */ if (sc->sc_transfer.cmd_data[0] == SC_READ_6) { - lba = (sc->sc_transfer.cmd_data[1] << 16) | + lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) | get_be16(&sc->sc_transfer.cmd_data[2]); } else { lba = get_be32(&sc->sc_transfer.cmd_data[2]); @@ -1411,7 +1404,7 @@ ustorage_fs_write(struct ustorage_fs_sof * too big. */ if (sc->sc_transfer.cmd_data[0] == SC_WRITE_6) - lba = (sc->sc_transfer.cmd_data[1] << 16) | + lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) | get_be16(&sc->sc_transfer.cmd_data[2]); else { lba = get_be32(&sc->sc_transfer.cmd_data[2]); @@ -1558,7 +1551,7 @@ ustorage_fs_check_cmd(struct ustorage_fs * non-zero. */ for (i = 0; i != min_cmd_size; i++) { - if (sc->sc_transfer.cmd_data[i] && !(mask & (1 << i))) { + if (sc->sc_transfer.cmd_data[i] && !(mask & (1UL << i))) { if (currlun) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; } @@ -1589,6 +1582,8 @@ ustorage_fs_do_cmd(struct ustorage_fs_so { uint8_t error = 1; uint8_t i; + uint32_t temp; + const uint32_t mask9 = (0xFFFFFFFFUL >> 9) << 9; /* set default data transfer pointer */ sc->sc_transfer.data_ptr = sc->sc_qdata; @@ -1604,7 +1599,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 4) | 1, 0); + (1UL << 4) | 1, 0); if (error) { break; } @@ -1619,7 +1614,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 1) | (1 << 4) | 1, 0); + (1UL << 1) | (1UL << 4) | 1, 0); if (error) { break; } @@ -1635,7 +1630,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 10, - (1 << 1) | (3 << 7) | 1, 0); + (1UL << 1) | (3UL << 7) | 1, 0); if (error) { break; } @@ -1650,7 +1645,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 1) | (1 << 2) | (1 << 4) | 1, 0); + (1UL << 1) | (1UL << 2) | (1UL << 4) | 1, 0); if (error) { break; } @@ -1666,7 +1661,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 10, - (1 << 1) | (1 << 2) | (3 << 7) | 1, 0); + (1UL << 1) | (1UL << 2) | (3UL << 7) | 1, 0); if (error) { break; } @@ -1680,7 +1675,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 4) | 1, 0); + (1UL << 4) | 1, 0); if (error) { break; } @@ -1691,13 +1686,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_6: i = sc->sc_transfer.cmd_data[4]; sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, - ((i == 0) ? 256 : i) << 9, 0 - (1 << 9)); + temp = ((i == 0) ? 256UL : i); + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 6, - (7 << 1) | (1 << 4) | 1, 1); + (7UL << 1) | (1UL << 4) | 1, 1); if (error) { break; } @@ -1707,13 +1702,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_10: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9)); + temp = get_be16(&sc->sc_transfer.cmd_data[7]); + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 10, - (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1); + (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1); if (error) { break; } @@ -1723,13 +1718,19 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_12: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, - get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9)); + temp = get_be32(&sc->sc_transfer.cmd_data[6]); + if (temp >= (1UL << (32 - 9))) { + /* numerical overflow */ + sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; + error = 1; + break; + } + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 12, - (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1); + (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1); if (error) { break; } @@ -1740,7 +1741,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_CAPACITY: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_check_cmd(sc, 10, - (0xf << 2) | (1 << 8) | 1, 1); + (0xfUL << 2) | (1UL << 8) | 1, 1); if (error) { break; } @@ -1756,7 +1757,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 10, - (3 << 7) | 1, 1); + (3UL << 7) | 1, 1); if (error) { break; } @@ -1771,7 +1772,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 4) | 1, 0); + (1UL << 4) | 1, 0); if (error) { break; } @@ -1785,7 +1786,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 6, - (1 << 1) | (1 << 4) | 1, 0); + (1UL << 1) | (1UL << 4) | 1, 0); if (error) { break; } @@ -1799,7 +1800,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 10, - (0xf << 2) | (3 << 7) | 1, 1); + (0xfUL << 2) | (3UL << 7) | 1, 1); if (error) { break; } @@ -1826,7 +1827,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; } error = ustorage_fs_check_cmd(sc, 10, - (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1); + (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1); if (error) { break; } @@ -1837,13 +1838,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_6: i = sc->sc_transfer.cmd_data[4]; sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, - ((i == 0) ? 256 : i) << 9, 0 - (1 << 9)); + temp = ((i == 0) ? 256UL : i); + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 6, - (7 << 1) | (1 << 4) | 1, 1); + (7UL << 1) | (1UL << 4) | 1, 1); if (error) { break; } @@ -1853,13 +1854,13 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_10: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_transfer.cmd_data[7]) << 9, 0 - (1 << 9)); + temp = get_be16(&sc->sc_transfer.cmd_data[7]); + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 10, - (1 << 1) | (0xf << 2) | (3 << 7) | 1, 1); + (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1); if (error) { break; } @@ -1869,13 +1870,19 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_12: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, - get_be32(&sc->sc_transfer.cmd_data[6]) << 9, 0 - (1 << 9)); + temp = get_be32(&sc->sc_transfer.cmd_data[6]); + if (temp > (mask9 >> 9)) { + /* numerical overflow */ + sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; + error = 1; + break; + } + error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; } error = ustorage_fs_check_cmd(sc, 12, - (1 << 1) | (0xf << 2) | (0xf << 6) | 1, 1); + (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1); if (error) { break; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9FAB106575E; Sun, 5 Apr 2009 18:18:07 +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 9C5B78FC20; Sun, 5 Apr 2009 18:18:07 +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 n35II7nm027303; Sun, 5 Apr 2009 18:18:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35II77S027302; Sun, 5 Apr 2009 18:18:07 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35II77S027302@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190720 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:11 -0000 Author: thompsa Date: Sun Apr 5 18:18:07 2009 New Revision: 190720 URL: http://svn.freebsd.org/changeset/base/190720 Log: MFp4 //depot/projects/usb@159671 Fix interrupt register setting on the atmegadci controller. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:01 2009 (r190719) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:07 2009 (r190720) @@ -649,7 +649,7 @@ atmegadci_interrupt(struct atmegadci_sof status = ATMEGA_READ_1(sc, ATMEGA_UDINT); /* clear all set interrupts */ - ATMEGA_WRITE_1(sc, ATMEGA_UDINT, ~status); + ATMEGA_WRITE_1(sc, ATMEGA_UDINT, (~status) & 0x7D); DPRINTFN(14, "UDINT=0x%02x\n", status); @@ -719,7 +719,7 @@ atmegadci_interrupt(struct atmegadci_sof status = ATMEGA_READ_1(sc, ATMEGA_USBINT); /* clear all set interrupts */ - ATMEGA_WRITE_1(sc, ATMEGA_USBINT, ~status); + ATMEGA_WRITE_1(sc, ATMEGA_USBINT, (~status) & 0x03); if (status & ATMEGA_USBINT_VBUSTI) { uint8_t temp; @@ -731,10 +731,7 @@ atmegadci_interrupt(struct atmegadci_sof } /* check for any endpoint interrupts */ status = ATMEGA_READ_1(sc, ATMEGA_UEINT); - - /* clear all set interrupts */ - ATMEGA_WRITE_1(sc, ATMEGA_UEINT, ~status); - + /* the hardware will clear the UEINT bits automatically */ if (status) { DPRINTFN(5, "real endpoint interrupt UEINT=0x%02x\n", status); @@ -1249,6 +1246,12 @@ atmegadci_init(struct atmegadci_softc *s ATMEGA_WRITE_1(sc, ATMEGA_UHWCON, ATMEGA_UHWCON_UVREGE | ATMEGA_UHWCON_UIMOD); #endif + /* make sure USB is enabled */ + ATMEGA_WRITE_1(sc, ATMEGA_USBCON, + ATMEGA_USBCON_USBE | + ATMEGA_USBCON_OTGPADE | + ATMEGA_USBCON_VBUSTE); + /* turn on clocks */ (sc->sc_clocks_on) (&sc->sc_bus); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9511065697; Sun, 5 Apr 2009 18:18:16 +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 C304F8FC25; Sun, 5 Apr 2009 18:18:16 +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 n35IIGpE027345; Sun, 5 Apr 2009 18:18:16 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IIGik027341; Sun, 5 Apr 2009 18:18:16 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35IIGik027341@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190721 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:22 -0000 Author: thompsa Date: Sun Apr 5 18:18:16 2009 New Revision: 190721 URL: http://svn.freebsd.org/changeset/base/190721 Log: MFp4 //depot/projects/usb@159673 Fix a corner case around stalling SETUP packets in device side mode. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:18:07 2009 (r190720) +++ head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:18:16 2009 (r190721) @@ -305,14 +305,11 @@ at91dci_setup_rx(struct at91dci_td *td) AT91_UDP_CSR_TXCOMP); if (!(csr & AT91_UDP_CSR_RXSETUP)) { - /* abort any ongoing transfer */ - if (!td->did_stall) { - DPRINTFN(5, "stalling\n"); - temp |= AT91_UDP_CSR_FORCESTALL; - td->did_stall = 1; - } goto not_complete; } + /* clear did stall */ + td->did_stall = 0; + /* get the packet byte count */ count = (csr & AT91_UDP_CSR_RXBYTECNT) >> 16; @@ -362,6 +359,13 @@ at91dci_setup_rx(struct at91dci_td *td) return (0); /* complete */ not_complete: + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(5, "stalling\n"); + temp |= AT91_UDP_CSR_FORCESTALL; + td->did_stall = 1; + } + /* clear interrupts, if any */ if (temp) { DPRINTFN(5, "clearing 0x%08x\n", temp); Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:07 2009 (r190720) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:16 2009 (r190721) @@ -250,16 +250,10 @@ atmegadci_setup_rx(struct atmegadci_td * DPRINTFN(5, "UEINTX=0x%02x\n", temp); if (!(temp & ATMEGA_UEINTX_RXSTPI)) { - /* abort any ongoing transfer */ - if (!td->did_stall) { - DPRINTFN(5, "stalling\n"); - ATMEGA_WRITE_1(sc, ATMEGA_UECONX, - ATMEGA_UECONX_EPEN | - ATMEGA_UECONX_STALLRQ); - td->did_stall = 1; - } goto not_complete; } + /* clear did stall */ + td->did_stall = 0; /* get the packet byte count */ count = (ATMEGA_READ_1(sc, ATMEGA_UEBCHX) << 8) | @@ -304,6 +298,15 @@ atmegadci_setup_rx(struct atmegadci_td * return (0); /* complete */ not_complete: + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(5, "stalling\n"); + ATMEGA_WRITE_1(sc, ATMEGA_UECONX, + ATMEGA_UECONX_EPEN | + ATMEGA_UECONX_STALLRQ); + td->did_stall = 1; + } + /* we only want to know if there is a SETUP packet */ ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, ATMEGA_UEIENX_RXSTPE); return (1); /* not complete */ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:18:07 2009 (r190720) +++ head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:18:16 2009 (r190721) @@ -255,6 +255,8 @@ musbotg_setup_rx(struct musbotg_td *td) * callback, hence the status stage is not complete. */ if (csr & MUSB2_MASK_CSR0L_DATAEND) { + /* do not stall at this point */ + td->did_stall = 1; /* wait for interrupt */ goto not_complete; } @@ -276,18 +278,13 @@ musbotg_setup_rx(struct musbotg_td *td) sc->sc_ep0_busy = 0; } if (sc->sc_ep0_busy) { - /* abort any ongoing transfer */ - if (!td->did_stall) { - DPRINTFN(4, "stalling\n"); - MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, - MUSB2_MASK_CSR0L_SENDSTALL); - td->did_stall = 1; - } goto not_complete; } if (!(csr & MUSB2_MASK_CSR0L_RXPKTRDY)) { goto not_complete; } + /* clear did stall flag */ + td->did_stall = 0; /* get the packet byte count */ count = MUSB2_READ_2(sc, MUSB2_REG_RXCOUNT); @@ -328,6 +325,13 @@ musbotg_setup_rx(struct musbotg_td *td) return (0); /* complete */ not_complete: + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(4, "stalling\n"); + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_SENDSTALL); + td->did_stall = 1; + } return (1); /* not complete */ } Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:18:07 2009 (r190720) +++ head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:18:16 2009 (r190721) @@ -248,19 +248,11 @@ uss820dci_setup_rx(struct uss820dci_td * DPRINTFN(5, "rx_stat=0x%02x rem=%u\n", rx_stat, td->remainder); if (!(rx_stat & USS820_RXSTAT_RXSETUP)) { - /* abort any ongoing transfer */ - if (!td->did_stall) { - DPRINTFN(5, "stalling\n"); - - /* set stall */ - - uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, - (USS820_EPCON_TXSTL | USS820_EPCON_RXSTL)); - - td->did_stall = 1; - } goto not_complete; } + /* clear did stall */ + td->did_stall = 0; + /* clear stall and all I/O */ uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF ^ (USS820_EPCON_TXSTL | @@ -332,6 +324,18 @@ uss820dci_setup_rx(struct uss820dci_td * return (0); /* complete */ not_complete: + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(5, "stalling\n"); + + /* set stall */ + + uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, + (USS820_EPCON_TXSTL | USS820_EPCON_RXSTL)); + + td->did_stall = 1; + } + /* clear end overwrite flag, if any */ if (rx_stat & USS820_RXSTAT_RXSETUP) { uss820dci_update_shared_1(sc, USS820_RXSTAT, From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1001065762; Sun, 5 Apr 2009 18:18:28 +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 3F33A8FC0C; Sun, 5 Apr 2009 18:18:26 +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 n35IIQbl027386; Sun, 5 Apr 2009 18:18:26 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IIQgo027383; Sun, 5 Apr 2009 18:18:26 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35IIQgo027383@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18: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: r190722 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:31 -0000 Author: thompsa Date: Sun Apr 5 18:18:25 2009 New Revision: 190722 URL: http://svn.freebsd.org/changeset/base/190722 Log: MFp4 //depot/projects/usb@159674 Fix more corner cases around reception of SETUP packets. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:16 2009 (r190721) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:18:25 2009 (r190722) @@ -306,7 +306,10 @@ not_complete: ATMEGA_UECONX_STALLRQ); td->did_stall = 1; } - + if (temp & ATMEGA_UEINTX_RXSTPI) { + /* clear SETUP packet interrupt */ + ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, ~ATMEGA_UEINTX_RXSTPI); + } /* we only want to know if there is a SETUP packet */ ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, ATMEGA_UEIENX_RXSTPE); return (1); /* not complete */ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:18:16 2009 (r190721) +++ head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:18:25 2009 (r190722) @@ -292,11 +292,15 @@ musbotg_setup_rx(struct musbotg_td *td) if (count != td->remainder) { DPRINTFN(0, "Invalid SETUP packet " "length, %d bytes\n", count); + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_RXPKTRDY_CLR); goto not_complete; } if (count != sizeof(req)) { DPRINTFN(0, "Unsupported SETUP packet " "length, %d bytes\n", count); + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_RXPKTRDY_CLR); goto not_complete; } /* receive data */ Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:18:16 2009 (r190721) +++ head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:18:25 2009 (r190722) @@ -275,12 +275,12 @@ uss820dci_setup_rx(struct uss820dci_td * if (count != td->remainder) { DPRINTFN(0, "Invalid SETUP packet " "length, %d bytes\n", count); - goto not_complete; + goto setup_not_complete; } if (count != sizeof(req)) { DPRINTFN(0, "Unsupported SETUP packet " "length, %d bytes\n", count); - goto not_complete; + goto setup_not_complete; } /* receive data */ bus_space_read_multi_1(td->io_tag, td->io_hdl, @@ -323,13 +323,22 @@ uss820dci_setup_rx(struct uss820dci_td * } return (0); /* complete */ +setup_not_complete: + + /* set RXFFRC bit */ + temp = bus_space_read_1(td->io_tag, td->io_hdl, + td->rx_cntl_reg); + temp |= USS820_RXCON_RXFFRC; + bus_space_write_1(td->io_tag, td->io_hdl, + td->rx_cntl_reg, temp); + + /* FALLTHROUGH */ + not_complete: /* abort any ongoing transfer */ if (!td->did_stall) { DPRINTFN(5, "stalling\n"); - /* set stall */ - uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, (USS820_EPCON_TXSTL | USS820_EPCON_RXSTL)); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406AB10657A8; Sun, 5 Apr 2009 18:18:40 +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 3581C8FC2C; Sun, 5 Apr 2009 18:18:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IIbjg027425; Sun, 5 Apr 2009 18:18:37 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IIbQj027424; Sun, 5 Apr 2009 18:18:37 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35IIbQj027424@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18: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: r190723 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:45 -0000 Author: thompsa Date: Sun Apr 5 18:18:36 2009 New Revision: 190723 URL: http://svn.freebsd.org/changeset/base/190723 Log: MFp4 //depot/projects/usb@159677 Remove redundant locking. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:18:25 2009 (r190722) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:18:36 2009 (r190723) @@ -1647,9 +1647,7 @@ repeat_set_config: DPRINTF("setting config %u\n", config_index); /* get the USB device configured */ - sx_xlock(udev->default_sx + 1); err = usb2_set_config_index(udev, config_index); - sx_unlock(udev->default_sx + 1); if (err) { if (udev->ddesc.bNumConfigurations != 0) { if (!set_config_failed) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:18:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 113C010657C5; Sun, 5 Apr 2009 18:18:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 863508FC27; Sun, 5 Apr 2009 18:18:47 +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 n35IIlSx027464; Sun, 5 Apr 2009 18:18:47 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IIlS7027463; Sun, 5 Apr 2009 18:18:47 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051818.n35IIlS7027463@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:18: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: r190724 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:18:54 -0000 Author: thompsa Date: Sun Apr 5 18:18:47 2009 New Revision: 190724 URL: http://svn.freebsd.org/changeset/base/190724 Log: MFp4 //depot/projects/usb@159700 Get rid of the last CALLOUT_RETURNUNLOCKED reference. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:18:36 2009 (r190723) +++ head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:18:47 2009 (r190724) @@ -277,7 +277,7 @@ usb2_power_wdog(void *arg) usb2_bus_power_update(bus); - return; + USB_BUS_LOCK(bus); } /*------------------------------------------------------------------------* @@ -356,11 +356,8 @@ usb2_bus_attach(struct usb2_proc_msg *pm /* set softc - we are ready */ device_set_softc(dev, bus); - /* start watchdog - this function will unlock the BUS lock ! */ + /* start watchdog */ usb2_power_wdog(bus); - - /* need to return locked */ - USB_BUS_LOCK(bus); } /*------------------------------------------------------------------------* @@ -534,7 +531,7 @@ usb2_bus_mem_alloc_all(struct usb2_bus * NULL, MTX_DEF | MTX_RECURSE); usb2_callout_init_mtx(&bus->power_wdog, - &bus->bus_mtx, CALLOUT_RETURNUNLOCKED); + &bus->bus_mtx, 0); TAILQ_INIT(&bus->intr_q.head); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 102BD10657A6; Sun, 5 Apr 2009 18:19:02 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF3A8FC19; Sun, 5 Apr 2009 18:19:00 +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 n35IJ0Sa027503; Sun, 5 Apr 2009 18:19:00 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJ0lW027502; Sun, 5 Apr 2009 18:19:00 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJ0lW027502@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19: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: r190725 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:19:05 -0000 Author: thompsa Date: Sun Apr 5 18:19:00 2009 New Revision: 190725 URL: http://svn.freebsd.org/changeset/base/190725 Log: MFp4 //depot/projects/usb@159797 Remove unused field in "struct usb2_pipe". Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.h Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Sun Apr 5 18:18:47 2009 (r190724) +++ head/sys/dev/usb/usb_device.h Sun Apr 5 18:19:00 2009 (r190725) @@ -44,7 +44,6 @@ struct usb2_clear_stall_msg { struct usb2_pipe { struct usb2_xfer_queue pipe_q; /* queue of USB transfers */ - struct usb2_xfer *xfer_block; /* blocking USB transfer */ struct usb2_endpoint_descriptor *edesc; struct usb2_pipe_methods *methods; /* set by HC driver */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693541065732; Sun, 5 Apr 2009 18:19:11 +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 6FD688FC0A; Sun, 5 Apr 2009 18:19:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IJAOQ027546; Sun, 5 Apr 2009 18:19:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJAgL027545; Sun, 5 Apr 2009 18:19:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJAgL027545@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19: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: r190726 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:19:13 -0000 Author: thompsa Date: Sun Apr 5 18:19:10 2009 New Revision: 190726 URL: http://svn.freebsd.org/changeset/base/190726 Log: MFp4 //depot/projects/usb@159806 Properly name usb2_uref_location() so that it is not confused with usb2_unref_location() . Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Apr 5 18:19:00 2009 (r190725) +++ head/sys/dev/usb/usb_dev.c Sun Apr 5 18:19:10 2009 (r190726) @@ -89,7 +89,7 @@ static void usb2_loc_fill(struct usb2_fs struct usb2_cdev_privdata *); static void usb2_close(void *); static usb2_error_t usb2_ref_device(struct usb2_cdev_privdata *, int); -static usb2_error_t usb2_uref_location(struct usb2_cdev_privdata *); +static usb2_error_t usb2_usb_ref_location(struct usb2_cdev_privdata *); static void usb2_unref_device(struct usb2_cdev_privdata *); static d_open_t usb2_open; @@ -264,7 +264,7 @@ error: } /*------------------------------------------------------------------------* - * usb2_uref_location + * usb2_usb_ref_location * * This function is used to upgrade an USB reference to include the * USB device reference on a USB location. @@ -274,7 +274,7 @@ error: * Else: Failure. *------------------------------------------------------------------------*/ static usb2_error_t -usb2_uref_location(struct usb2_cdev_privdata *cpd) +usb2_usb_ref_location(struct usb2_cdev_privdata *cpd) { /* * Check if we already got an USB reference on this location: @@ -1038,7 +1038,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = (f->methods->f_ioctl) (f, cmd, addr, fflags); DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); if (err == ENOIOCTL) { - if (usb2_uref_location(cpd)) { + if (usb2_usb_ref_location(cpd)) { err = ENXIO; goto done; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A13E11065861; Sun, 5 Apr 2009 18:19:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5518FC0A; Sun, 5 Apr 2009 18:19:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IJKJH027592; Sun, 5 Apr 2009 18:19:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJKWS027589; Sun, 5 Apr 2009 18:19:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJKWS027589@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19: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: r190727 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:19:22 -0000 Author: thompsa Date: Sun Apr 5 18:19:19 2009 New Revision: 190727 URL: http://svn.freebsd.org/changeset/base/190727 Log: MFp4 //depot/projects/usb@159811 First patch in a series of memory save patches. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:19:10 2009 (r190726) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:19:19 2009 (r190727) @@ -504,8 +504,9 @@ usb2_free_iface_data(struct usb2_device } /* free "cdesc" after "ifaces", if any */ - if (udev->cdesc) { - free(udev->cdesc, M_USB); + if (udev->cdesc != NULL) { + if (udev->flags.usb2_mode != USB_MODE_DEVICE) + free(udev->cdesc, M_USB); udev->cdesc = NULL; } /* set unconfigured state */ @@ -569,8 +570,14 @@ usb2_set_config_index(struct usb2_device goto done; } /* get the full config descriptor */ - err = usb2_req_get_config_desc_full(udev, - NULL, &cdp, M_USB, index); + if (udev->flags.usb2_mode == USB_MODE_DEVICE) { + /* save some memory */ + err = usb2_req_get_config_desc_ptr(udev, &cdp, index); + } else { + /* normal request */ + err = usb2_req_get_config_desc_full(udev, + NULL, &cdp, M_USB, index); + } if (err) { goto done; } @@ -1713,10 +1720,9 @@ repeat_set_config: udev->ugen_symlink = usb2_alloc_symlink(udev->ugen_name); /* Announce device */ -#if USB_HAVE_STRINGS printf("%s: <%s> at %s\n", udev->ugen_name, udev->manufacturer, device_get_nameunit(udev->bus->bdev)); -#endif + usb2_notify_addq("+", udev); #endif done: @@ -1851,10 +1857,8 @@ usb2_free_device(struct usb2_device *ude #if USB_HAVE_UGEN usb2_notify_addq("-", udev); -#if USB_HAVE_STRINGS printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, udev->manufacturer, device_get_nameunit(bus->bdev)); -#endif /* Destroy UGEN symlink, if any */ if (udev->ugen_symlink) { Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Sun Apr 5 18:19:10 2009 (r190726) +++ head/sys/dev/usb/usb_request.c Sun Apr 5 18:19:19 2009 (r190727) @@ -833,6 +833,40 @@ usb2_req_get_string_desc(struct usb2_dev } /*------------------------------------------------------------------------* + * usb2_req_get_config_desc_ptr + * + * This function is used in device side mode to retrieve the pointer + * to the generated config descriptor. This saves allocating space for + * an additional config descriptor when setting the configuration. + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb2_error_t +usb2_req_get_config_desc_ptr(struct usb2_device *udev, + struct usb2_config_descriptor **ppcd, uint8_t config_index) +{ + uint16_t len; + + struct usb2_device_request req; + + if (udev->flags.usb2_mode != USB_MODE_DEVICE) + return (USB_ERR_INVAL); + + req.bmRequestType = UT_READ_CLASS_DEVICE; + req.bRequest = UR_GET_DESCRIPTOR; + USETW2(req.wValue, UDESC_CONFIG, config_index); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + (usb2_temp_get_desc_p) (udev, &req, + __DECONST(const void **, ppcd), &len); + + return (*ppcd ? USB_ERR_NORMAL_COMPLETION : USB_ERR_INVAL); +} + +/*------------------------------------------------------------------------* * usb2_req_get_config_desc * * Returns: Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Sun Apr 5 18:19:10 2009 (r190726) +++ head/sys/dev/usb/usb_request.h Sun Apr 5 18:19:19 2009 (r190727) @@ -44,6 +44,8 @@ usb2_error_t usb2_req_get_alt_interface_ uint8_t iface_index); usb2_error_t usb2_req_get_config(struct usb2_device *udev, struct mtx *mtx, uint8_t *pconf); +usb2_error_t usb2_req_get_config_desc_ptr(struct usb2_device *udev, + struct usb2_config_descriptor **ppcd, uint8_t config_index); usb2_error_t usb2_req_get_config_desc(struct usb2_device *udev, struct mtx *mtx, struct usb2_config_descriptor *d, uint8_t conf_index); usb2_error_t usb2_req_get_config_desc_full(struct usb2_device *udev, From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 713901065950; Sun, 5 Apr 2009 18:19:32 +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 EC7038FC16; Sun, 5 Apr 2009 18:19:30 +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 n35IJUYS027638; Sun, 5 Apr 2009 18:19:30 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJU43027637; Sun, 5 Apr 2009 18:19:30 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJU43027637@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190728 - head/sys/dev/usb/bluetooth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:19:36 -0000 Author: thompsa Date: Sun Apr 5 18:19:30 2009 New Revision: 190728 URL: http://svn.freebsd.org/changeset/base/190728 Log: MFp4 //depot/projects/usb@159863 Speed up the endpoint descriptor search Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/bluetooth/ng_ubt.c Modified: head/sys/dev/usb/bluetooth/ng_ubt.c ============================================================================== --- head/sys/dev/usb/bluetooth/ng_ubt.c Sun Apr 5 18:19:19 2009 (r190727) +++ head/sys/dev/usb/bluetooth/ng_ubt.c Sun Apr 5 18:19:30 2009 (r190728) @@ -426,6 +426,7 @@ ubt_attach(device_t dev) struct usb2_attach_arg *uaa = device_get_ivars(dev); struct ubt_softc *sc = device_get_softc(dev); struct usb2_endpoint_descriptor *ed; + struct usb2_interface_descriptor *id; uint16_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -496,31 +497,34 @@ ubt_attach(device_t dev) alt_index = 0; i = 0; j = 0; + ed = NULL; - /* Search through all the descriptors looking for bidir mode */ - while (1) { - uint16_t temp; - - ed = usb2_find_edesc(usb2_get_config_descriptor(uaa->device), - 1, i, j); - if (ed == NULL) { - if (j != 0) { - /* next interface */ - j = 0; - i ++; - continue; + /* + * Search through all the descriptors looking for the largest + * packet size: + */ + while ((ed = (struct usb2_endpoint_descriptor *)usb2_desc_foreach( + usb2_get_config_descriptor(uaa->device), + (struct usb2_descriptor *)ed))) { + + if ((ed->bDescriptorType == UDESC_INTERFACE) && + (ed->bLength >= sizeof(*id))) { + id = (struct usb2_interface_descriptor *)ed; + i = id->bInterfaceNumber; + j = id->bAlternateSetting; + } + + if ((ed->bDescriptorType == UDESC_ENDPOINT) && + (ed->bLength >= sizeof(*ed)) && + (i == 1)) { + uint16_t temp; + + temp = UGETW(ed->wMaxPacketSize); + if (temp > wMaxPacketSize) { + wMaxPacketSize = temp; + alt_index = j; } - - break; /* end of interfaces */ } - - temp = UGETW(ed->wMaxPacketSize); - if (temp > wMaxPacketSize) { - wMaxPacketSize = temp; - alt_index = i; - } - - j ++; } /* Set alt configuration on interface #1 only if we found it */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA42106596B; Sun, 5 Apr 2009 18:19:44 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEE58FC0A; Sun, 5 Apr 2009 18:19:42 +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 n35IJg1q027684; Sun, 5 Apr 2009 18:19:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJg9r027683; Sun, 5 Apr 2009 18:19:42 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJg9r027683@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190729 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:19:50 -0000 Author: thompsa Date: Sun Apr 5 18:19:42 2009 New Revision: 190729 URL: http://svn.freebsd.org/changeset/base/190729 Log: MFp4 //depot/projects/usb@159864 Fix possible deadlock with UGEN at detach. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Apr 5 18:19:30 2009 (r190728) +++ head/sys/dev/usb/usb_dev.c Sun Apr 5 18:19:42 2009 (r190729) @@ -89,7 +89,7 @@ static void usb2_loc_fill(struct usb2_fs struct usb2_cdev_privdata *); static void usb2_close(void *); static usb2_error_t usb2_ref_device(struct usb2_cdev_privdata *, int); -static usb2_error_t usb2_usb_ref_location(struct usb2_cdev_privdata *); +static usb2_error_t usb2_usb_ref_device(struct usb2_cdev_privdata *); static void usb2_unref_device(struct usb2_cdev_privdata *); static d_open_t usb2_open; @@ -180,6 +180,22 @@ usb2_ref_device(struct usb2_cdev_privdat DPRINTFN(2, "no dev ref\n"); goto error; } + if (need_uref) { + DPRINTFN(2, "ref udev - needed\n"); + cpd->udev->refcount++; + cpd->is_uref = 1; + + mtx_unlock(&usb2_ref_lock); + + /* + * We need to grab the sx-lock before grabbing the + * FIFO refs to avoid deadlock at detach! + */ + sx_xlock(cpd->udev->default_sx + 1); + + mtx_lock(&usb2_ref_lock); + } + /* check if we are doing an open */ if (cpd->fflags == 0) { /* set defaults */ @@ -240,31 +256,28 @@ usb2_ref_device(struct usb2_cdev_privdat DPRINTFN(2, "ref read\n"); cpd->rxfifo->refcount++; } - if (need_uref) { - DPRINTFN(2, "ref udev - needed\n"); - cpd->udev->refcount++; - cpd->is_uref = 1; - } mtx_unlock(&usb2_ref_lock); if (cpd->is_uref) { - /* - * We are about to alter the bus-state. Apply the - * required locks. - */ - sx_xlock(cpd->udev->default_sx + 1); mtx_lock(&Giant); /* XXX */ } return (0); error: + if (cpd->is_uref) { + sx_unlock(cpd->udev->default_sx + 1); + if (--(cpd->udev->refcount) == 0) { + usb2_cv_signal(cpd->udev->default_cv + 1); + } + cpd->is_uref = 0; + } mtx_unlock(&usb2_ref_lock); DPRINTFN(2, "fail\n"); return (USB_ERR_INVAL); } /*------------------------------------------------------------------------* - * usb2_usb_ref_location + * usb2_usb_ref_device * * This function is used to upgrade an USB reference to include the * USB device reference on a USB location. @@ -274,46 +287,21 @@ error: * Else: Failure. *------------------------------------------------------------------------*/ static usb2_error_t -usb2_usb_ref_location(struct usb2_cdev_privdata *cpd) +usb2_usb_ref_device(struct usb2_cdev_privdata *cpd) { /* * Check if we already got an USB reference on this location: */ - if (cpd->is_uref) { + if (cpd->is_uref) return (0); /* success */ - } - mtx_lock(&usb2_ref_lock); - if (cpd->bus != devclass_get_softc(usb2_devclass_ptr, cpd->bus_index)) { - DPRINTFN(2, "bus changed at %u\n", cpd->bus_index); - goto error; - } - if (cpd->udev != cpd->bus->devices[cpd->dev_index]) { - DPRINTFN(2, "device changed at %u\n", cpd->dev_index); - goto error; - } - if (cpd->udev->refcount == USB_DEV_REF_MAX) { - DPRINTFN(2, "no dev ref\n"); - goto error; - } - DPRINTFN(2, "ref udev\n"); - cpd->udev->refcount++; - mtx_unlock(&usb2_ref_lock); - - /* set "uref" */ - cpd->is_uref = 1; /* - * We are about to alter the bus-state. Apply the - * required locks. + * To avoid deadlock at detach we need to drop the FIFO ref + * and re-acquire a new ref! */ - sx_xlock(cpd->udev->default_sx + 1); - mtx_lock(&Giant); /* XXX */ - return (0); + usb2_unref_device(cpd); -error: - mtx_unlock(&usb2_ref_lock); - DPRINTFN(2, "fail\n"); - return (USB_ERR_INVAL); + return (usb2_ref_device(cpd, 1 /* need uref */)); } /*------------------------------------------------------------------------* @@ -1038,7 +1026,7 @@ usb2_ioctl(struct cdev *dev, u_long cmd, err = (f->methods->f_ioctl) (f, cmd, addr, fflags); DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err); if (err == ENOIOCTL) { - if (usb2_usb_ref_location(cpd)) { + if (usb2_usb_ref_device(cpd)) { err = ENXIO; goto done; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:19:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6902710657AE; Sun, 5 Apr 2009 18:19:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8999A8FC14; Sun, 5 Apr 2009 18:19:52 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IJqX4027730; Sun, 5 Apr 2009 18:19:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IJqZu027724; Sun, 5 Apr 2009 18:19:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051819.n35IJqZu027724@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190730 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:03 -0000 Author: thompsa Date: Sun Apr 5 18:19:52 2009 New Revision: 190730 URL: http://svn.freebsd.org/changeset/base/190730 Log: MFp4 //depot/projects/usb@159866 - memory usage reduction by only allocating the required USB pipes and USB interfaces. - cleanup some USB parsing functions to be more flexible. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_parse.h Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:19:42 2009 (r190729) +++ head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:19:52 2009 (r190730) @@ -254,8 +254,8 @@ usb2_bus_detach(struct usb2_proc_msg *pm * Free USB Root device, but not any sub-devices, hence they * are freed by the caller of this function: */ - usb2_detach_device(udev, USB_IFACE_INDEX_ANY, 0); - usb2_free_device(udev); + usb2_free_device(udev, + USB_UNCFG_FLAG_FREE_EP0); mtx_unlock(&Giant); USB_BUS_LOCK(bus); Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:19:42 2009 (r190729) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:19:52 2009 (r190730) @@ -57,10 +57,10 @@ /* function prototypes */ -static void usb2_fill_pipe_data(struct usb2_device *, uint8_t, +static void usb2_init_pipe(struct usb2_device *, uint8_t, struct usb2_endpoint_descriptor *, struct usb2_pipe *); -static void usb2_free_pipe_data(struct usb2_device *, uint8_t, uint8_t); -static void usb2_free_iface_data(struct usb2_device *); +static void usb2_unconfigure(struct usb2_device *, uint8_t); +static void usb2_detach_device(struct usb2_device *, uint8_t, uint8_t); static void usb2_detach_device_sub(struct usb2_device *, device_t *, uint8_t); static uint8_t usb2_probe_and_attach_sub(struct usb2_device *, @@ -70,11 +70,10 @@ static void usb2_init_attach_arg(struct static void usb2_suspend_resume_sub(struct usb2_device *, device_t, uint8_t); static void usb2_clear_stall_proc(struct usb2_proc_msg *_pm); +usb2_error_t usb2_config_parse(struct usb2_device *, uint8_t, uint8_t); #if USB_HAVE_STRINGS static void usb2_check_strings(struct usb2_device *); #endif -static usb2_error_t usb2_fill_iface_data(struct usb2_device *, uint8_t, - uint8_t); #if USB_HAVE_UGEN static void usb2_notify_addq(const char *type, struct usb2_device *); static void usb2_fifo_free_wrap(struct usb2_device *, uint8_t, uint8_t); @@ -268,30 +267,32 @@ usb2_interface_count(struct usb2_device *count = 0; return (USB_ERR_NOT_CONFIGURED); } - *count = udev->cdesc->bNumInterface; + *count = udev->ifaces_max; return (USB_ERR_NORMAL_COMPLETION); } /*------------------------------------------------------------------------* - * usb2_fill_pipe_data + * usb2_init_pipe * * This function will initialise the USB pipe structure pointed to by - * the "pipe" argument. + * the "pipe" argument. The structure pointed to by "pipe" must be + * zeroed before calling this function. *------------------------------------------------------------------------*/ static void -usb2_fill_pipe_data(struct usb2_device *udev, uint8_t iface_index, +usb2_init_pipe(struct usb2_device *udev, uint8_t iface_index, struct usb2_endpoint_descriptor *edesc, struct usb2_pipe *pipe) { + struct usb2_bus_methods *methods; - bzero(pipe, sizeof(*pipe)); + methods = udev->bus->methods; - (udev->bus->methods->pipe_init) (udev, edesc, pipe); + (methods->pipe_init) (udev, edesc, pipe); - if (pipe->methods == NULL) { - /* the pipe is invalid: just return */ + /* check for invalid pipe */ + if (pipe->methods == NULL) return; - } + /* initialise USB pipe structure */ pipe->edesc = edesc; pipe->iface_index = iface_index; @@ -299,40 +300,14 @@ usb2_fill_pipe_data(struct usb2_device * pipe->pipe_q.command = &usb2_pipe_start; /* clear stall, if any */ - if (udev->bus->methods->clear_stall) { + if (methods->clear_stall != NULL) { USB_BUS_LOCK(udev->bus); - (udev->bus->methods->clear_stall) (udev, pipe); + (methods->clear_stall) (udev, pipe); USB_BUS_UNLOCK(udev->bus); } } -/*------------------------------------------------------------------------* - * usb2_free_pipe_data - * - * This function will free USB pipe data for the given interface - * index. Hence we do not have any dynamic allocations we simply clear - * "pipe->edesc" to indicate that the USB pipe structure can be - * reused. The pipes belonging to the given interface should not be in - * use when this function is called and no check is performed to - * prevent this. - *------------------------------------------------------------------------*/ -static void -usb2_free_pipe_data(struct usb2_device *udev, - uint8_t iface_index, uint8_t iface_mask) -{ - struct usb2_pipe *pipe = udev->pipes; - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; - - while (pipe != pipe_end) { - if ((pipe->iface_index & iface_mask) == iface_index) { - /* free pipe */ - pipe->edesc = NULL; - } - pipe++; - } -} - -/*------------------------------------------------------------------------* +/*-----------------------------------------------------------------------* * usb2_pipe_foreach * * This function will iterate all the USB endpoints except the control @@ -367,123 +342,38 @@ usb2_pipe_foreach(struct usb2_device *ud } /*------------------------------------------------------------------------* - * usb2_fill_iface_data + * usb2_unconfigure + * + * This function will free all USB interfaces and USB pipes belonging + * to an USB device. * - * This function will fill in interface data and allocate USB pipes - * for all the endpoints that belong to the given interface. This - * function is typically called when setting the configuration or when - * setting an alternate interface. + * Flag values, see "USB_UNCFG_FLAG_XXX". *------------------------------------------------------------------------*/ -static usb2_error_t -usb2_fill_iface_data(struct usb2_device *udev, - uint8_t iface_index, uint8_t alt_index) +static void +usb2_unconfigure(struct usb2_device *udev, uint8_t flag) { - struct usb2_interface *iface = usb2_get_iface(udev, iface_index); - struct usb2_pipe *pipe; - struct usb2_pipe *pipe_end; - struct usb2_interface_descriptor *id; - struct usb2_endpoint_descriptor *ed = NULL; - struct usb2_descriptor *desc; - uint8_t nendpt; + uint8_t do_unlock; - if (iface == NULL) { - return (USB_ERR_INVAL); + /* automatic locking */ + if (sx_xlocked(udev->default_sx + 1)) { + do_unlock = 0; + } else { + do_unlock = 1; + sx_xlock(udev->default_sx + 1); } - DPRINTFN(5, "iface_index=%d alt_index=%d\n", - iface_index, alt_index); - - sx_assert(udev->default_sx + 1, SA_LOCKED); - - pipe = udev->pipes; - pipe_end = udev->pipes + USB_EP_MAX; - /* - * Check if any USB pipes on the given USB interface are in - * use: - */ - while (pipe != pipe_end) { - if ((pipe->edesc != NULL) && - (pipe->iface_index == iface_index) && - (pipe->refcount != 0)) { - return (USB_ERR_IN_USE); - } - pipe++; - } + /* detach all interface drivers */ + usb2_detach_device(udev, USB_IFACE_INDEX_ANY, flag); - pipe = &udev->pipes[0]; +#if USB_HAVE_UGEN + /* free all FIFOs except control endpoint FIFOs */ + usb2_fifo_free_wrap(udev, USB_IFACE_INDEX_ANY, flag); - id = usb2_find_idesc(udev->cdesc, iface_index, alt_index); - if (id == NULL) { - return (USB_ERR_INVAL); - } /* - * Free old pipes after we know that an interface descriptor exists, - * if any. + * Free all cdev's, if any. */ - usb2_free_pipe_data(udev, iface_index, 0 - 1); - - /* Setup USB interface structure */ - iface->idesc = id; - iface->alt_index = alt_index; - iface->parent_iface_index = USB_IFACE_INDEX_ANY; - - nendpt = id->bNumEndpoints; - DPRINTFN(5, "found idesc nendpt=%d\n", nendpt); - - desc = (void *)id; - - while (nendpt--) { - DPRINTFN(11, "endpt=%d\n", nendpt); - - while ((desc = usb2_desc_foreach(udev->cdesc, desc))) { - if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= sizeof(*ed))) { - goto found; - } - if (desc->bDescriptorType == UDESC_INTERFACE) { - break; - } - } - goto error; - -found: - ed = (void *)desc; - - /* find a free pipe */ - while (pipe != pipe_end) { - if (pipe->edesc == NULL) { - /* pipe is free */ - usb2_fill_pipe_data(udev, iface_index, ed, pipe); - break; - } - pipe++; - } - } - return (USB_ERR_NORMAL_COMPLETION); - -error: - /* passed end, or bad desc */ - DPRINTFN(0, "%s: bad descriptor(s), addr=%d!\n", - __FUNCTION__, udev->address); - - /* free old pipes if any */ - usb2_free_pipe_data(udev, iface_index, 0 - 1); - return (USB_ERR_INVAL); -} - -/*------------------------------------------------------------------------* - * usb2_free_iface_data - * - * This function will free all USB interfaces and USB pipes belonging - * to an USB device. - *------------------------------------------------------------------------*/ -static void -usb2_free_iface_data(struct usb2_device *udev) -{ - struct usb2_interface *iface = udev->ifaces; - struct usb2_interface *iface_end = udev->ifaces + USB_IFACE_MAX; - - /* mtx_assert() */ + usb2_cdev_free(udev); +#endif #if USB_HAVE_COMPAT_LINUX /* free Linux compat device, if any */ @@ -492,18 +382,10 @@ usb2_free_iface_data(struct usb2_device udev->linux_dev = NULL; } #endif - /* free all pipes, if any */ - usb2_free_pipe_data(udev, 0, 0); - /* free all interfaces, if any */ - while (iface != iface_end) { - iface->idesc = NULL; - iface->alt_index = 0; - iface->parent_iface_index = USB_IFACE_INDEX_ANY; - iface++; - } + usb2_config_parse(udev, USB_IFACE_INDEX_ANY, USB_CFG_FREE); - /* free "cdesc" after "ifaces", if any */ + /* free "cdesc" after "ifaces" and "pipes", if any */ if (udev->cdesc != NULL) { if (udev->flags.usb2_mode != USB_MODE_DEVICE) free(udev->cdesc, M_USB); @@ -512,6 +394,10 @@ usb2_free_iface_data(struct usb2_device /* set unconfigured state */ udev->curr_config_no = USB_UNCONFIG_NO; udev->curr_config_index = USB_UNCONFIG_INDEX; + + if (do_unlock) { + sx_unlock(udev->default_sx + 1); + } } /*------------------------------------------------------------------------* @@ -533,7 +419,6 @@ usb2_set_config_index(struct usb2_device struct usb2_config_descriptor *cdp; uint16_t power; uint16_t max_power; - uint8_t nifc; uint8_t selfpowered; uint8_t do_unlock; usb2_error_t err; @@ -548,22 +433,12 @@ usb2_set_config_index(struct usb2_device sx_xlock(udev->default_sx + 1); } - /* detach all interface drivers */ - usb2_detach_device(udev, USB_IFACE_INDEX_ANY, 1); - -#if USB_HAVE_UGEN - /* free all FIFOs except control endpoint FIFOs */ - usb2_fifo_free_wrap(udev, USB_IFACE_INDEX_ANY, 0); - - /* free all configuration data structures */ - usb2_cdev_free(udev); -#endif - usb2_free_iface_data(udev); + usb2_unconfigure(udev, USB_UNCFG_FLAG_FREE_SUBDEV); if (index == USB_UNCONFIG_INDEX) { /* * Leave unallocated when unconfiguring the - * device. "usb2_free_iface_data()" will also reset + * device. "usb2_unconfigure()" will also reset * the current config number and index. */ err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); @@ -585,10 +460,6 @@ usb2_set_config_index(struct usb2_device udev->cdesc = cdp; - if (cdp->bNumInterface > USB_IFACE_MAX) { - DPRINTFN(0, "too many interfaces: %d\n", cdp->bNumInterface); - cdp->bNumInterface = USB_IFACE_MAX; - } /* Figure out if the device is self or bus powered. */ selfpowered = 0; if ((!udev->flags.uq_bus_powered) && @@ -665,14 +536,17 @@ usb2_set_config_index(struct usb2_device if (err) { goto done; } - /* Allocate and fill interface data. */ - nifc = cdp->bNumInterface; - while (nifc--) { - err = usb2_fill_iface_data(udev, nifc, 0); - if (err) { - goto done; - } + + err = usb2_config_parse(udev, USB_IFACE_INDEX_ANY, USB_CFG_ALLOC); + if (err) { + goto done; + } + + err = usb2_config_parse(udev, USB_IFACE_INDEX_ANY, USB_CFG_INIT); + if (err) { + goto done; } + #if USB_HAVE_UGEN /* create device nodes for each endpoint */ usb2_cdev_create(udev); @@ -681,10 +555,7 @@ usb2_set_config_index(struct usb2_device done: DPRINTF("error=%s\n", usb2_errstr(err)); if (err) { -#if USB_HAVE_UGEN - usb2_cdev_free(udev); -#endif - usb2_free_iface_data(udev); + usb2_unconfigure(udev, USB_UNCFG_FLAG_FREE_SUBDEV); } if (do_unlock) { sx_unlock(udev->default_sx + 1); @@ -693,6 +564,205 @@ done: } /*------------------------------------------------------------------------* + * usb2_config_parse + * + * This function will allocate and free USB interfaces and USB pipes, + * parse the USB configuration structure and initialise the USB pipes + * and interfaces. If "iface_index" is not equal to + * "USB_IFACE_INDEX_ANY" then the "cmd" parameter is the + * alternate_setting to be selected for the given interface. Else the + * "cmd" parameter is defined by "USB_CFG_XXX". "iface_index" can be + * "USB_IFACE_INDEX_ANY" or a valid USB interface index. This function + * is typically called when setting the configuration or when setting + * an alternate interface. + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb2_error_t +usb2_config_parse(struct usb2_device *udev, uint8_t iface_index, uint8_t cmd) +{ + struct usb2_idesc_parse_state ips; + struct usb2_interface_descriptor *id; + struct usb2_endpoint_descriptor *ed; + struct usb2_interface *iface; + struct usb2_pipe *pipe; + usb2_error_t err; + uint8_t ep_curr; + uint8_t ep_max; + uint8_t temp; + uint8_t do_init; + uint8_t alt_index; + + if (iface_index != USB_IFACE_INDEX_ANY) { + /* parameter overload */ + alt_index = cmd; + cmd = USB_CFG_INIT; + } else { + /* not used */ + alt_index = 0; + } + + err = 0; + + DPRINTFN(5, "iface_index=%d cmd=%d\n", + iface_index, cmd); + + if (cmd == USB_CFG_FREE) + goto cleanup; + + if (cmd == USB_CFG_INIT) { + sx_assert(udev->default_sx + 1, SA_LOCKED); + + /* check for in-use pipes */ + + pipe = udev->pipes; + ep_max = udev->pipes_max; + while (ep_max--) { + /* look for matching pipes */ + if ((iface_index == USB_IFACE_INDEX_ANY) || + (iface_index == pipe->iface_index)) { + if (pipe->refcount != 0) { + /* + * This typically indicates a + * more serious error. + */ + err = USB_ERR_IN_USE; + } else { + /* reset pipe */ + memset(pipe, 0, sizeof(*pipe)); + /* make sure we don't zero the pipe again */ + pipe->iface_index = USB_IFACE_INDEX_ANY; + } + } + pipe++; + } + + if (err) + return (err); + } + + memset(&ips, 0, sizeof(ips)); + + ep_curr = 0; + ep_max = 0; + + while ((id = usb2_idesc_foreach(udev->cdesc, &ips))) { + + /* check for interface overflow */ + if (ips.iface_index == USB_IFACE_MAX) + break; /* crazy */ + + iface = udev->ifaces + ips.iface_index; + + /* check for specific interface match */ + + if (cmd == USB_CFG_INIT) { + if ((iface_index != USB_IFACE_INDEX_ANY) && + (iface_index != ips.iface_index)) { + /* wrong interface */ + do_init = 0; + } else if (alt_index != ips.iface_index_alt) { + /* wrong alternate setting */ + do_init = 0; + } else { + /* initialise interface */ + do_init = 1; + } + } else + do_init = 0; + + /* check for new interface */ + if (ips.iface_index_alt == 0) { + /* update current number of endpoints */ + ep_curr = ep_max; + } + /* check for init */ + if (do_init) { + /* setup the USB interface structure */ + iface->idesc = id; + /* default setting */ + iface->parent_iface_index = USB_IFACE_INDEX_ANY; + /* set alternate index */ + iface->alt_index = alt_index; + } + + DPRINTFN(5, "found idesc nendpt=%d\n", id->bNumEndpoints); + + ed = (struct usb2_endpoint_descriptor *)id; + + temp = ep_curr; + + /* iterate all the endpoint descriptors */ + while ((ed = usb2_edesc_foreach(udev->cdesc, ed))) { + + if (temp == USB_EP_MAX) + break; /* crazy */ + + pipe = udev->pipes + temp; + + if (do_init) { + usb2_init_pipe(udev, + ips.iface_index, ed, pipe); + } + + temp ++; + + /* find maximum number of endpoints */ + if (ep_max < temp) + ep_max = temp; + + /* optimalisation */ + id = (struct usb2_interface_descriptor *)ed; + } + } + + /* NOTE: It is valid to have no interfaces and no endpoints! */ + + if (cmd == USB_CFG_ALLOC) { + udev->ifaces_max = ips.iface_index; + udev->ifaces = NULL; + if (udev->ifaces_max != 0) { + udev->ifaces = malloc(sizeof(*iface) * udev->ifaces_max, + M_USB, M_WAITOK | M_ZERO); + if (udev->ifaces == NULL) { + err = USB_ERR_NOMEM; + goto done; + } + } + udev->pipes_max = ep_max; + udev->pipes = NULL; + if (udev->pipes_max != 0) { + udev->pipes = malloc(sizeof(*pipe) * udev->pipes_max, + M_USB, M_WAITOK | M_ZERO); + if (udev->pipes == NULL) { + err = USB_ERR_NOMEM; + goto done; + } + } + } + +done: + if (err) { + if (cmd == USB_CFG_ALLOC) { +cleanup: + /* cleanup */ + if (udev->ifaces != NULL) + free(udev->ifaces, M_USB); + if (udev->pipes != NULL) + free(udev->pipes, M_USB); + + udev->ifaces = NULL; + udev->pipes = NULL; + udev->ifaces_max = 0; + udev->pipes_max = 0; + } + } + return (err); +} + +/*------------------------------------------------------------------------* * usb2_set_alt_interface_index * * This function will select an alternate interface index for the @@ -726,7 +796,8 @@ usb2_set_alt_interface_index(struct usb2 goto done; } if (udev->flags.usb2_mode == USB_MODE_DEVICE) { - usb2_detach_device(udev, iface_index, 1); + usb2_detach_device(udev, iface_index, + USB_UNCFG_FLAG_FREE_SUBDEV); } else { if (iface->alt_index == alt_index) { /* @@ -744,7 +815,8 @@ usb2_set_alt_interface_index(struct usb2 */ usb2_fifo_free_wrap(udev, iface_index, 0); #endif - err = usb2_fill_iface_data(udev, iface_index, alt_index); + + err = usb2_config_parse(udev, iface_index, alt_index); if (err) { goto done; } @@ -874,15 +946,17 @@ usb2_reset_iface_endpoints(struct usb2_d * * This function will try to detach an USB device. If it fails a panic * will result. + * + * Flag values, see "USB_UNCFG_FLAG_XXX". *------------------------------------------------------------------------*/ static void usb2_detach_device_sub(struct usb2_device *udev, device_t *ppdev, - uint8_t free_subdev) + uint8_t flag) { device_t dev; int err; - if (!free_subdev) { + if (!(flag & USB_UNCFG_FLAG_FREE_SUBDEV)) { *ppdev = NULL; @@ -928,14 +1002,15 @@ error: * * The following function will detach the matching interfaces. * This function is NULL safe. + * + * Flag values, see "USB_UNCFG_FLAG_XXX". *------------------------------------------------------------------------*/ void usb2_detach_device(struct usb2_device *udev, uint8_t iface_index, - uint8_t free_subdev) + uint8_t flag) { struct usb2_interface *iface; uint8_t i; - uint8_t do_unlock; if (udev == NULL) { /* nothing to do */ @@ -943,13 +1018,7 @@ usb2_detach_device(struct usb2_device *u } DPRINTFN(4, "udev=%p\n", udev); - /* automatic locking */ - if (sx_xlocked(udev->default_sx + 1)) { - do_unlock = 0; - } else { - do_unlock = 1; - sx_xlock(udev->default_sx + 1); - } + sx_assert(udev->default_sx + 1, SA_LOCKED); /* * First detach the child to give the child's detach routine a @@ -974,11 +1043,7 @@ usb2_detach_device(struct usb2_device *u /* looks like the end of the USB interfaces */ break; } - usb2_detach_device_sub(udev, &iface->subdev, free_subdev); - } - - if (do_unlock) { - sx_unlock(udev->default_sx + 1); + usb2_detach_device_sub(udev, &iface->subdev, flag); } } @@ -1445,7 +1510,7 @@ usb2_alloc_device(device_t parent_dev, s } /* init the default pipe */ - usb2_fill_pipe_data(udev, 0, + usb2_init_pipe(udev, 0, &udev->default_ep_desc, &udev->default_pipe); @@ -1682,7 +1747,8 @@ repeat_set_config: } else if ((config_index + 1) < udev->ddesc.bNumConfigurations) { if ((udev->cdesc->bNumInterface < 2) && - (usb2_get_no_endpoints(udev->cdesc) == 0)) { + (usb2_get_no_descriptors(udev->cdesc, + UDESC_ENDPOINT) == 0)) { DPRINTFN(0, "Found no endpoints " "(trying next config)!\n"); config_index++; @@ -1728,7 +1794,9 @@ repeat_set_config: done: if (err) { /* free device */ - usb2_free_device(udev); + usb2_free_device(udev, + USB_UNCFG_FLAG_FREE_SUBDEV | + USB_UNCFG_FLAG_FREE_EP0); udev = NULL; } return (udev); @@ -1846,14 +1914,21 @@ usb2_cdev_cleanup(void* arg) * usb2_free_device * * This function is NULL safe and will free an USB device. + * + * Flag values, see "USB_UNCFG_FLAG_XXX". *------------------------------------------------------------------------*/ void -usb2_free_device(struct usb2_device *udev) +usb2_free_device(struct usb2_device *udev, uint8_t flag) { - struct usb2_bus *bus = udev->bus;; + struct usb2_bus *bus; + + if (udev == NULL) + return; /* already freed */ DPRINTFN(4, "udev=%p port=%d\n", udev, udev->port_no); + bus = udev->bus;; + #if USB_HAVE_UGEN usb2_notify_addq("-", udev); @@ -1882,26 +1957,18 @@ usb2_free_device(struct usb2_device *ude usb2_cv_wait(udev->default_cv + 1, &usb2_ref_lock); } mtx_unlock(&usb2_ref_lock); + + destroy_dev_sched_cb(udev->default_dev, usb2_cdev_cleanup, + udev->default_dev->si_drv1); #endif if (udev->flags.usb2_mode == USB_MODE_DEVICE) { /* stop receiving any control transfers (Device Side Mode) */ usb2_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); } -#if USB_HAVE_UGEN - /* free all FIFOs */ - usb2_fifo_free_wrap(udev, USB_IFACE_INDEX_ANY, 1); - /* - * Free all interface related data and FIFOs, if any. - */ - usb2_cdev_free(udev); -#endif - usb2_free_iface_data(udev); -#if USB_HAVE_UGEN - destroy_dev_sched_cb(udev->default_dev, usb2_cdev_cleanup, - udev->default_dev->si_drv1); -#endif + /* the following will get the device unconfigured in software */ + usb2_unconfigure(udev, flag); /* unsetup any leftover default USB transfers */ usb2_transfer_unsetup(udev->default_xfer, USB_DEFAULT_XFER_MAX); @@ -1948,12 +2015,8 @@ usb2_get_iface(struct usb2_device *udev, { struct usb2_interface *iface = udev->ifaces + iface_index; - if ((iface < udev->ifaces) || - (iface_index >= USB_IFACE_MAX) || - (udev->cdesc == NULL) || - (iface_index >= udev->cdesc->bNumInterface)) { + if (iface_index >= udev->ifaces_max) return (NULL); - } return (iface); } @@ -2303,12 +2366,12 @@ usb2_notify_addq(const char *type, struc * * This function will free the FIFOs. * - * Flag values, if "iface_index" is equal to "USB_IFACE_INDEX_ANY". - * 0: Free all FIFOs except generic control endpoints. - * 1: Free all FIFOs. - * - * Flag values, if "iface_index" is not equal to "USB_IFACE_INDEX_ANY". - * Not used. + * Description of "flag" argument: If the USB_UNCFG_FLAG_FREE_EP0 flag + * is set and "iface_index" is set to "USB_IFACE_INDEX_ANY", we free + * all FIFOs. If the USB_UNCFG_FLAG_FREE_EP0 flag is not set and + * "iface_index" is set to "USB_IFACE_INDEX_ANY", we free all non + * control endpoint FIFOs. If "iface_index" is not set to + * "USB_IFACE_INDEX_ANY" the flag has no effect. *------------------------------------------------------------------------*/ static void usb2_fifo_free_wrap(struct usb2_device *udev, @@ -2341,7 +2404,8 @@ usb2_fifo_free_wrap(struct usb2_device * } } else if (iface_index == USB_IFACE_INDEX_ANY) { if ((f->methods == &usb2_ugen_methods) && - (f->dev_ep_index == 0) && (flag == 0) && + (f->dev_ep_index == 0) && + (!(flag & USB_UNCFG_FLAG_FREE_EP0)) && (f->fs_xfer == NULL)) { /* no need to free this FIFO */ continue; Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Sun Apr 5 18:19:42 2009 (r190729) +++ head/sys/dev/usb/usb_device.h Sun Apr 5 18:19:52 2009 (r190730) @@ -32,6 +32,18 @@ struct usb_device; /* linux compat */ #define USB_DEFAULT_XFER_MAX 2 +/* "usb2_parse_config()" commands */ + +#define USB_CFG_ALLOC 0 +#define USB_CFG_FREE 1 +#define USB_CFG_INIT 2 + +/* "usb2_unconfigure()" flags */ + +#define USB_UNCFG_FLAG_NONE 0x00 +#define USB_UNCFG_FLAG_FREE_SUBDEV 0x01 /* subdevices are freed */ +#define USB_UNCFG_FLAG_FREE_EP0 0x02 /* endpoint zero is freed */ + struct usb2_clear_stall_msg { struct usb2_proc_msg hdr; struct usb2_device *udev; @@ -103,10 +115,9 @@ struct usb2_device { struct sx default_sx[2]; struct mtx default_mtx[1]; struct cv default_cv[2]; - struct usb2_interface ifaces[USB_IFACE_MAX]; + struct usb2_interface *ifaces; struct usb2_pipe default_pipe; /* Control Endpoint 0 */ - struct cdev *default_dev; /* Control Endpoint 0 device node */ - struct usb2_pipe pipes[USB_EP_MAX]; + struct usb2_pipe *pipes; struct usb2_power_save pwr_save;/* power save data */ struct usb2_bus *bus; /* our USB BUS */ @@ -123,6 +134,7 @@ struct usb2_device { #if USB_HAVE_UGEN struct usb2_fifo *fifo[USB_FIFO_MAX]; struct usb2_symlink *ugen_symlink; /* our generic symlink */ + struct cdev *default_dev; /* Control Endpoint 0 device node */ LIST_HEAD(,usb2_fs_privdata) pd_list; char ugen_name[20]; /* name of ugenX.X device */ #endif @@ -146,6 +158,8 @@ struct usb2_device { uint8_t hs_port_no; /* high-speed HUB port number */ uint8_t driver_added_refcount; /* our driver added generation count */ uint8_t power_mode; /* see USB_POWER_XXX */ + uint8_t ifaces_max; /* number of interfaces present */ + uint8_t pipes_max; /* number of pipes present */ /* the "flags" field is write-protected by "bus->mtx" */ @@ -184,10 +198,8 @@ usb2_error_t usb2_set_endpoint_stall(str struct usb2_pipe *pipe, uint8_t do_stall); usb2_error_t usb2_suspend_resume(struct usb2_device *udev, uint8_t do_suspend); -void usb2_detach_device(struct usb2_device *udev, uint8_t iface_index, - uint8_t free_subdev); void usb2_devinfo(struct usb2_device *udev, char *dst_ptr, uint16_t dst_len); -void usb2_free_device(struct usb2_device *udev); +void usb2_free_device(struct usb2_device *, uint8_t); void *usb2_find_descriptor(struct usb2_device *udev, void *id, uint8_t iface_index, uint8_t type, uint8_t type_mask, uint8_t subtype, uint8_t subtype_mask); Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Apr 5 18:19:42 2009 (r190729) +++ head/sys/dev/usb/usb_hub.c Sun Apr 5 18:19:52 2009 (r190730) @@ -297,8 +297,9 @@ repeat: /* detach any existing devices */ if (child) { - usb2_detach_device(child, USB_IFACE_INDEX_ANY, 1); - usb2_free_device(child); + usb2_free_device(child, + USB_UNCFG_FLAG_FREE_SUBDEV | + USB_UNCFG_FLAG_FREE_EP0); child = NULL; } /* get fresh status */ @@ -417,8 +418,9 @@ repeat: error: if (child) { - usb2_detach_device(child, USB_IFACE_INDEX_ANY, 1); - usb2_free_device(child); + usb2_free_device(child, + USB_UNCFG_FLAG_FREE_SUBDEV | + USB_UNCFG_FLAG_FREE_EP0); child = NULL; } if (err == 0) { @@ -852,9 +854,8 @@ uhub_detach(device_t dev) * Subdevices are not freed, because the caller of * uhub_detach() will do that. */ - usb2_detach_device(child, USB_IFACE_INDEX_ANY, 0); - usb2_free_device(child); - child = NULL; + usb2_free_device(child, + USB_UNCFG_FLAG_FREE_EP0); } usb2_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); Modified: head/sys/dev/usb/usb_parse.c ============================================================================== --- head/sys/dev/usb/usb_parse.c Sun Apr 5 18:19:42 2009 (r190729) +++ head/sys/dev/usb/usb_parse.c Sun Apr 5 18:19:52 2009 (r190730) @@ -84,113 +84,109 @@ usb2_desc_foreach(struct usb2_config_des } /*------------------------------------------------------------------------* - * usb2_find_idesc + * usb2_idesc_foreach * - * This function will return the interface descriptor, if any, that - * has index "iface_index" and alternate index "alt_index". + * This function will iterate the interface descriptors in the config + * descriptor. The parse state structure should be zeroed before + * calling this function the first time. * * Return values: * NULL: End of descriptors * Else: A valid interface descriptor *------------------------------------------------------------------------*/ struct usb2_interface_descriptor * -usb2_find_idesc(struct usb2_config_descriptor *cd, - uint8_t iface_index, uint8_t alt_index) +usb2_idesc_foreach(struct usb2_config_descriptor *cd, + struct usb2_idesc_parse_state *ps) { - struct usb2_descriptor *desc = NULL; struct usb2_interface_descriptor *id; - uint8_t curidx = 0; - uint8_t lastidx = 0; - uint8_t curaidx = 0; - uint8_t first = 1; - - while ((desc = usb2_desc_foreach(cd, desc))) { - if ((desc->bDescriptorType == UDESC_INTERFACE) && - (desc->bLength >= sizeof(*id))) { - id = (void *)desc; - - if (first) { - first = 0; - lastidx = id->bInterfaceNumber; - - } else if (id->bInterfaceNumber != lastidx) { + uint8_t new_iface; - lastidx = id->bInterfaceNumber; - curidx++; - curaidx = 0; - - } else { - curaidx++; - } - - if ((iface_index == curidx) && (alt_index == curaidx)) { - return (id); - } + /* retrieve current descriptor */ + id = (struct usb2_interface_descriptor *)ps->desc; + /* default is to start a new interface */ + new_iface = 1; + + while (1) { + id = (struct usb2_interface_descriptor *) + usb2_desc_foreach(cd, (struct usb2_descriptor *)id); + if (id == NULL) + break; + if ((id->bDescriptorType == UDESC_INTERFACE) && + (id->bLength >= sizeof(*id))) { + if (ps->iface_no_last == id->bInterfaceNumber) + new_iface = 0; + ps->iface_no_last = id->bInterfaceNumber; + break; } } - return (NULL); + + if (ps->desc == NULL) { + /* first time */ + } else if (new_iface) { + /* new interface */ + ps->iface_index ++; + ps->iface_index_alt = 0; + } else { + /* new alternate interface */ + ps->iface_index_alt ++; + } + + /* store and return current descriptor */ + ps->desc = (struct usb2_descriptor *)id; + return (id); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:20:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A48106584C; Sun, 5 Apr 2009 18:20:04 +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 127F78FC18; Sun, 5 Apr 2009 18:20:04 +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 n35IK3j7027778; Sun, 5 Apr 2009 18:20:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IK3Yr027776; Sun, 5 Apr 2009 18:20:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IK3Yr027776@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20: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: r190731 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:11 -0000 Author: thompsa Date: Sun Apr 5 18:20:03 2009 New Revision: 190731 URL: http://svn.freebsd.org/changeset/base/190731 Log: MFp4 //depot/projects/usb@159871 - bugfixes after the memory usage reduction patch - Use "udev->pipes_max" instead of USB_EP_MAX - Use correct "bmRequestType" for getting the config descriptor. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:19:52 2009 (r190730) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:20:03 2009 (r190731) @@ -105,7 +105,7 @@ struct usb2_pipe * usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val) { struct usb2_pipe *pipe = udev->pipes; - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; enum { EA_MASK = (UE_DIR_IN | UE_DIR_OUT | UE_ADDR), }; @@ -160,7 +160,7 @@ usb2_get_pipe(struct usb2_device *udev, const struct usb2_config *setup) { struct usb2_pipe *pipe = udev->pipes; - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; uint8_t index = setup->ep_index; uint8_t ea_mask; uint8_t ea_val; @@ -320,7 +320,7 @@ usb2_init_pipe(struct usb2_device *udev, struct usb2_pipe * usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe) { - struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max; /* be NULL safe */ if (udev == NULL) @@ -924,7 +924,7 @@ usb2_reset_iface_endpoints(struct usb2_d usb2_error_t err; pipe = udev->pipes; - pipe_end = udev->pipes + USB_EP_MAX; + pipe_end = udev->pipes + udev->pipes_max; for (; pipe != pipe_end; pipe++) { Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Sun Apr 5 18:19:52 2009 (r190730) +++ head/sys/dev/usb/usb_request.c Sun Apr 5 18:20:03 2009 (r190731) @@ -97,7 +97,7 @@ usb2_do_clear_stall_callback(struct usb2 struct usb2_pipe *pipe; struct usb2_pipe *pipe_end; struct usb2_pipe *pipe_first; - uint8_t to = USB_EP_MAX; + uint8_t to; udev = xfer->xroot->udev; @@ -106,8 +106,9 @@ usb2_do_clear_stall_callback(struct usb2 /* round robin pipe clear stall */ pipe = udev->pipe_curr; - pipe_end = udev->pipes + USB_EP_MAX; + pipe_end = udev->pipes + udev->pipes_max; pipe_first = udev->pipes; + to = udev->pipes_max; if (pipe == NULL) { pipe = pipe_first; } @@ -854,7 +855,7 @@ usb2_req_get_config_desc_ptr(struct usb2 if (udev->flags.usb2_mode != USB_MODE_DEVICE) return (USB_ERR_INVAL); - req.bmRequestType = UT_READ_CLASS_DEVICE; + req.bmRequestType = UT_READ_DEVICE; req.bRequest = UR_GET_DESCRIPTOR; USETW2(req.wValue, UDESC_CONFIG, config_index); USETW(req.wIndex, 0); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:20:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76C710658E6; Sun, 5 Apr 2009 18:20:13 +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 908598FC22; Sun, 5 Apr 2009 18:20:13 +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 n35IKD5g027822; Sun, 5 Apr 2009 18:20:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKDDL027820; Sun, 5 Apr 2009 18:20:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKDDL027820@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190732 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:19 -0000 Author: thompsa Date: Sun Apr 5 18:20:13 2009 New Revision: 190732 URL: http://svn.freebsd.org/changeset/base/190732 Log: MFp4 //depot/projects/usb@159897 Add new endpoint direction values for use with usb2_config Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb.h head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Sun Apr 5 18:20:03 2009 (r190731) +++ head/sys/dev/usb/usb.h Sun Apr 5 18:20:13 2009 (r190732) @@ -461,8 +461,10 @@ struct usb2_endpoint_descriptor { uByte bEndpointAddress; #define UE_GET_DIR(a) ((a) & 0x80) #define UE_SET_DIR(a,d) ((a) | (((d)&1) << 7)) -#define UE_DIR_IN 0x80 -#define UE_DIR_OUT 0x00 +#define UE_DIR_IN 0x80 /* IN-token endpoint, fixed */ +#define UE_DIR_OUT 0x00 /* OUT-token endpoint, fixed */ +#define UE_DIR_RX 0xfd /* for internal use only! */ +#define UE_DIR_TX 0xfe /* for internal use only! */ #define UE_DIR_ANY 0xff /* for internal use only! */ #define UE_ADDR 0x0f #define UE_ADDR_ANY 0xff /* for internal use only! */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:20:03 2009 (r190731) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:20:13 2009 (r190732) @@ -174,7 +174,15 @@ usb2_get_pipe(struct usb2_device *udev, /* setup expected endpoint direction mask and value */ - if (setup->direction == UE_DIR_ANY) { + if (setup->direction == UE_DIR_RX) { + ea_mask = (UE_DIR_IN | UE_DIR_OUT); + ea_val = (udev->flags.usb2_mode == USB_MODE_DEVICE) ? + UE_DIR_OUT : UE_DIR_IN; + } else if (setup->direction == UE_DIR_TX) { + ea_mask = (UE_DIR_IN | UE_DIR_OUT); + ea_val = (udev->flags.usb2_mode == USB_MODE_DEVICE) ? + UE_DIR_IN : UE_DIR_OUT; + } else if (setup->direction == UE_DIR_ANY) { /* match any endpoint direction */ ea_mask = 0; ea_val = 0; From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:20:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B76E710658FA; Sun, 5 Apr 2009 18:20:26 +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 C77EE8FC26; Sun, 5 Apr 2009 18:20:24 +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 n35IKO86027869; Sun, 5 Apr 2009 18:20:24 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKOje027868; Sun, 5 Apr 2009 18:20:24 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKOje027868@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20: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: r190733 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:33 -0000 Author: thompsa Date: Sun Apr 5 18:20:24 2009 New Revision: 190733 URL: http://svn.freebsd.org/changeset/base/190733 Log: MFp4 //depot/projects/usb@159908 Reduce the amount of memory used by better sizing buffer arrays. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/storage/ustorage_fs.c Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Sun Apr 5 18:20:13 2009 (r190732) +++ head/sys/dev/usb/storage/ustorage_fs.c Sun Apr 5 18:20:24 2009 (r190733) @@ -63,7 +63,15 @@ SYSCTL_INT(_hw_usb2_ustorage_fs, OID_AUT #define USTORAGE_FS_BULK_SIZE (1UL << 17) /* bytes */ #endif -#define USTORAGE_FS_MAX_LUN 8 /* units */ +#ifndef USTORAGE_FS_MAX_LUN +#define USTORAGE_FS_MAX_LUN 8 /* units */ +#endif + +#ifndef USTORAGE_QDATA_MAX +#define USTORAGE_QDATA_MAX 40 /* bytes */ +#endif + +#define sc_cmd_data sc_cbw.CBWCDB /* * The SCSI ID string must be exactly 28 characters long @@ -172,7 +180,6 @@ struct ustorage_fs_softc { uint8_t cbw_dir; uint8_t cmd_dir; uint8_t lun; - uint8_t cmd_data[CBWCDBLENGTH]; uint8_t cmd_len; uint8_t data_short:1; uint8_t data_error:1; @@ -182,13 +189,10 @@ struct ustorage_fs_softc { struct usb2_device *sc_udev; struct usb2_xfer *sc_xfer[USTORAGE_FS_T_BBB_MAX]; - uint32_t sc_unit; - - uint8_t sc_name[16]; uint8_t sc_iface_no; /* interface number */ uint8_t sc_last_lun; uint8_t sc_last_xfer_index; - uint8_t sc_qdata[1024]; + uint8_t sc_qdata[USTORAGE_QDATA_MAX]; }; /* prototypes */ @@ -258,45 +262,50 @@ struct usb2_config ustorage_fs_bbb_confi .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .md.bufsize = sizeof(ustorage_fs_bbb_cbw_t), - .md.flags = {.ext_buffer = 1,}, - .md.callback = &ustorage_fs_t_bbb_command_callback, + .bufsize = sizeof(ustorage_fs_bbb_cbw_t), + .flags = {.ext_buffer = 1,}, + .callback = &ustorage_fs_t_bbb_command_callback, + .usb_mode = USB_MODE_DEVICE, }, [USTORAGE_FS_T_BBB_DATA_DUMP] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .md.bufsize = 0, /* use wMaxPacketSize */ - .md.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, - .md.callback = &ustorage_fs_t_bbb_data_dump_callback, + .bufsize = 0, /* use wMaxPacketSize */ + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .callback = &ustorage_fs_t_bbb_data_dump_callback, + .usb_mode = USB_MODE_DEVICE, }, [USTORAGE_FS_T_BBB_DATA_READ] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .md.bufsize = USTORAGE_FS_BULK_SIZE, - .md.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, - .md.callback = &ustorage_fs_t_bbb_data_read_callback, + .bufsize = USTORAGE_FS_BULK_SIZE, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, + .callback = &ustorage_fs_t_bbb_data_read_callback, + .usb_mode = USB_MODE_DEVICE, }, [USTORAGE_FS_T_BBB_DATA_WRITE] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .md.bufsize = USTORAGE_FS_BULK_SIZE, - .md.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, - .md.callback = &ustorage_fs_t_bbb_data_write_callback, + .bufsize = USTORAGE_FS_BULK_SIZE, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,.ext_buffer = 1}, + .callback = &ustorage_fs_t_bbb_data_write_callback, + .usb_mode = USB_MODE_DEVICE, }, [USTORAGE_FS_T_BBB_STATUS] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .md.bufsize = sizeof(ustorage_fs_bbb_csw_t), - .md.flags = {.short_xfer_ok = 1,.ext_buffer = 1,}, - .md.callback = &ustorage_fs_t_bbb_status_callback, + .bufsize = sizeof(ustorage_fs_bbb_csw_t), + .flags = {.short_xfer_ok = 1,.ext_buffer = 1,}, + .callback = &ustorage_fs_t_bbb_status_callback, + .usb_mode = USB_MODE_DEVICE, }, }; @@ -335,6 +344,7 @@ ustorage_fs_attach(device_t dev) struct usb2_attach_arg *uaa = device_get_ivars(dev); struct usb2_interface_descriptor *id; int err; + int unit; /* * NOTE: the softc struct is bzero-ed in device_set_driver. @@ -344,9 +354,9 @@ ustorage_fs_attach(device_t dev) sc->sc_dev = dev; sc->sc_udev = uaa->device; - sc->sc_unit = device_get_unit(dev); + unit = device_get_unit(dev); - if (sc->sc_unit == 0) { + if (unit == 0) { if (ustorage_fs_ramdisk == NULL) { /* * allocate a memory image for our ramdisk until @@ -362,8 +372,6 @@ ustorage_fs_attach(device_t dev) sc->sc_lun[0].num_sectors = USTORAGE_FS_RAM_SECT; sc->sc_lun[0].removable = 1; } - snprintf(sc->sc_name, sizeof(sc->sc_name), - "%s", device_get_nameunit(dev)); device_set_usb2_desc(dev); @@ -544,11 +552,6 @@ ustorage_fs_t_bbb_command_callback(struc sc->sc_transfer.cmd_len); break; } - bcopy(sc->sc_cbw.CBWCDB, sc->sc_transfer.cmd_data, - sc->sc_transfer.cmd_len); - - bzero(sc->sc_cbw.CBWCDB + sc->sc_transfer.cmd_len, - sizeof(sc->sc_cbw.CBWCDB) - sc->sc_transfer.cmd_len); error = ustorage_fs_do_cmd(sc); if (error) { @@ -927,17 +930,17 @@ ustorage_fs_verify(struct ustorage_fs_so /* * Get the starting Logical Block Address */ - lba = get_be32(&sc->sc_transfer.cmd_data[2]); + lba = get_be32(&sc->sc_cmd_data[2]); /* * We allow DPO (Disable Page Out = don't save data in the cache) * but we don't implement it. */ - if ((sc->sc_transfer.cmd_data[1] & ~0x10) != 0) { + if ((sc->sc_cmd_data[1] & ~0x10) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - vlen = get_be16(&sc->sc_transfer.cmd_data[7]); + vlen = get_be16(&sc->sc_cmd_data[7]); if (vlen == 0) { goto done; } @@ -998,6 +1001,9 @@ ustorage_fs_inquiry(struct ustorage_fs_s /* Copy in ID string */ memcpy(buf + 8, USTORAGE_FS_ID_STRING, 28); +#if (USTORAGE_QDATA_MAX < 36) +#error "(USTORAGE_QDATA_MAX < 36)" +#endif return (ustorage_fs_min_len(sc, 36, 0 - 1)); } @@ -1063,10 +1069,13 @@ ustorage_fs_request_sense(struct ustorag /* Additional sense length */ buf[12] = ASC(sd); buf[13] = ASCQ(sd); + +#if (USTORAGE_QDATA_MAX < 18) +#error "(USTORAGE_QDATA_MAX < 18)" +#endif return (ustorage_fs_min_len(sc, 18, 0 - 1)); } - /*------------------------------------------------------------------------* * ustorage_fs_read_capacity * @@ -1079,22 +1088,25 @@ ustorage_fs_read_capacity(struct ustorag { uint8_t *buf = sc->sc_transfer.data_ptr; struct ustorage_fs_lun *currlun = sc->sc_transfer.currlun; - uint32_t lba = get_be32(&sc->sc_transfer.cmd_data[2]); - uint8_t pmi = sc->sc_transfer.cmd_data[8]; + uint32_t lba = get_be32(&sc->sc_cmd_data[2]); + uint8_t pmi = sc->sc_cmd_data[8]; /* Check the PMI and LBA fields */ if ((pmi > 1) || ((pmi == 0) && (lba != 0))) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - put_be32(&buf[0], currlun->num_sectors - 1); /* Max logical block */ - put_be32(&buf[4], 512); + put_be32(&buf[0], currlun->num_sectors - 1); /* Block length */ + put_be32(&buf[4], 512); + +#if (USTORAGE_QDATA_MAX < 8) +#error "(USTORAGE_QDATA_MAX < 8)" +#endif return (ustorage_fs_min_len(sc, 8, 0 - 1)); } - /*------------------------------------------------------------------------* * ustorage_fs_mode_sense * @@ -1110,7 +1122,7 @@ ustorage_fs_mode_sense(struct ustorage_f uint8_t *buf0; uint16_t len; uint16_t limit; - uint8_t mscmnd = sc->sc_transfer.cmd_data[0]; + uint8_t mscmnd = sc->sc_cmd_data[0]; uint8_t pc; uint8_t page_code; uint8_t changeable_values; @@ -1118,13 +1130,13 @@ ustorage_fs_mode_sense(struct ustorage_f buf0 = buf; - if ((sc->sc_transfer.cmd_data[1] & ~0x08) != 0) { + if ((sc->sc_cmd_data[1] & ~0x08) != 0) { /* Mask away DBD */ currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - pc = sc->sc_transfer.cmd_data[2] >> 6; - page_code = sc->sc_transfer.cmd_data[2] & 0x3f; + pc = sc->sc_cmd_data[2] >> 6; + page_code = sc->sc_cmd_data[2] & 0x3f; if (pc == 3) { currlun->sense_data = SS_SAVING_PARAMETERS_NOT_SUPPORTED; return (1); @@ -1195,6 +1207,10 @@ ustorage_fs_mode_sense(struct ustorage_f buf0[0] = len - 1; else put_be16(buf0, len - 2); + +#if (USTORAGE_QDATA_MAX < 24) +#error "(USTORAGE_QDATA_MAX < 24)" +#endif return (ustorage_fs_min_len(sc, len, 0 - 1)); } @@ -1217,9 +1233,9 @@ ustorage_fs_start_stop(struct ustorage_f currlun->sense_data = SS_INVALID_COMMAND; return (1); } - immed = sc->sc_transfer.cmd_data[1] & 0x01; - loej = sc->sc_transfer.cmd_data[4] & 0x02; - start = sc->sc_transfer.cmd_data[4] & 0x01; + immed = sc->sc_cmd_data[1] & 0x01; + loej = sc->sc_cmd_data[4] & 0x02; + start = sc->sc_cmd_data[4] & 0x01; if (immed || loej || start) { /* compile fix */ @@ -1244,8 +1260,8 @@ ustorage_fs_prevent_allow(struct ustorag currlun->sense_data = SS_INVALID_COMMAND; return (1); } - prevent = sc->sc_transfer.cmd_data[4] & 0x01; - if ((sc->sc_transfer.cmd_data[4] & ~0x01) != 0) { + prevent = sc->sc_cmd_data[4] & 0x01; + if ((sc->sc_cmd_data[4] & ~0x01) != 0) { /* Mask away Prevent */ currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); @@ -1275,12 +1291,16 @@ ustorage_fs_read_format_capacities(struc /* Only the Current / Maximum Capacity Descriptor */ buf += 4; - put_be32(&buf[0], currlun->num_sectors); /* Number of blocks */ - put_be32(&buf[4], 512); + put_be32(&buf[0], currlun->num_sectors); /* Block length */ - buf[4] = 0x02; + put_be32(&buf[4], 512); /* Current capacity */ + buf[4] = 0x02; + +#if (USTORAGE_QDATA_MAX < 12) +#error "(USTORAGE_QDATA_MAX < 12)" +#endif return (ustorage_fs_min_len(sc, 12, 0 - 1)); } @@ -1345,18 +1365,18 @@ ustorage_fs_read(struct ustorage_fs_soft * Get the starting Logical Block Address and check that it's not * too big */ - if (sc->sc_transfer.cmd_data[0] == SC_READ_6) { - lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) | - get_be16(&sc->sc_transfer.cmd_data[2]); + if (sc->sc_cmd_data[0] == SC_READ_6) { + lba = (((uint32_t)sc->sc_cmd_data[1]) << 16) | + get_be16(&sc->sc_cmd_data[2]); } else { - lba = get_be32(&sc->sc_transfer.cmd_data[2]); + lba = get_be32(&sc->sc_cmd_data[2]); /* * We allow DPO (Disable Page Out = don't save data in the * cache) and FUA (Force Unit Access = don't read from the * cache), but we don't implement them. */ - if ((sc->sc_transfer.cmd_data[1] & ~0x18) != 0) { + if ((sc->sc_cmd_data[1] & ~0x18) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } @@ -1403,11 +1423,11 @@ ustorage_fs_write(struct ustorage_fs_sof * Get the starting Logical Block Address and check that it's not * too big. */ - if (sc->sc_transfer.cmd_data[0] == SC_WRITE_6) - lba = (((uint32_t)sc->sc_transfer.cmd_data[1]) << 16) | - get_be16(&sc->sc_transfer.cmd_data[2]); + if (sc->sc_cmd_data[0] == SC_WRITE_6) + lba = (((uint32_t)sc->sc_cmd_data[1]) << 16) | + get_be16(&sc->sc_cmd_data[2]); else { - lba = get_be32(&sc->sc_transfer.cmd_data[2]); + lba = get_be32(&sc->sc_cmd_data[2]); /* * We allow DPO (Disable Page Out = don't save data in the @@ -1415,11 +1435,11 @@ ustorage_fs_write(struct ustorage_fs_sof * medium). We don't implement DPO; we implement FUA by * performing synchronous output. */ - if ((sc->sc_transfer.cmd_data[1] & ~0x18) != 0) { + if ((sc->sc_cmd_data[1] & ~0x18) != 0) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; return (1); } - if (sc->sc_transfer.cmd_data[1] & 0x08) { + if (sc->sc_cmd_data[1] & 0x08) { /* FUA */ /* XXX set SYNC flag here */ } @@ -1495,7 +1515,7 @@ ustorage_fs_check_cmd(struct ustorage_fs uint16_t mask, uint8_t needs_medium) { struct ustorage_fs_lun *currlun; - uint8_t lun = (sc->sc_transfer.cmd_data[1] >> 5); + uint8_t lun = (sc->sc_cmd_data[1] >> 5); uint8_t i; /* Verify the length of the command itself */ @@ -1506,7 +1526,7 @@ ustorage_fs_check_cmd(struct ustorage_fs return (1); } /* Mask away the LUN */ - sc->sc_transfer.cmd_data[1] &= 0x1f; + sc->sc_cmd_data[1] &= 0x1f; /* Check if LUN is correct */ if (lun != sc->sc_transfer.lun) { @@ -1516,7 +1536,7 @@ ustorage_fs_check_cmd(struct ustorage_fs if (sc->sc_transfer.lun <= sc->sc_last_lun) { sc->sc_transfer.currlun = currlun = sc->sc_lun + sc->sc_transfer.lun; - if (sc->sc_transfer.cmd_data[0] != SC_REQUEST_SENSE) { + if (sc->sc_cmd_data[0] != SC_REQUEST_SENSE) { currlun->sense_data = SS_NO_SENSE; currlun->sense_data_info = 0; currlun->info_valid = 0; @@ -1527,8 +1547,8 @@ ustorage_fs_check_cmd(struct ustorage_fs * else must fail! */ if ((currlun->unit_attention_data != SS_NO_SENSE) && - (sc->sc_transfer.cmd_data[0] != SC_INQUIRY) && - (sc->sc_transfer.cmd_data[0] != SC_REQUEST_SENSE)) { + (sc->sc_cmd_data[0] != SC_INQUIRY) && + (sc->sc_cmd_data[0] != SC_REQUEST_SENSE)) { currlun->sense_data = currlun->unit_attention_data; currlun->unit_attention_data = SS_NO_SENSE; return (1); @@ -1540,8 +1560,8 @@ ustorage_fs_check_cmd(struct ustorage_fs * INQUIRY and REQUEST SENSE commands are explicitly allowed * to use unsupported LUNs; all others may not. */ - if ((sc->sc_transfer.cmd_data[0] != SC_INQUIRY) && - (sc->sc_transfer.cmd_data[0] != SC_REQUEST_SENSE)) { + if ((sc->sc_cmd_data[0] != SC_INQUIRY) && + (sc->sc_cmd_data[0] != SC_REQUEST_SENSE)) { return (1); } } @@ -1551,7 +1571,7 @@ ustorage_fs_check_cmd(struct ustorage_fs * non-zero. */ for (i = 0; i != min_cmd_size; i++) { - if (sc->sc_transfer.cmd_data[i] && !(mask & (1UL << i))) { + if (sc->sc_cmd_data[i] && !(mask & (1UL << i))) { if (currlun) { currlun->sense_data = SS_INVALID_FIELD_IN_CDB; } @@ -1589,12 +1609,12 @@ ustorage_fs_do_cmd(struct ustorage_fs_so sc->sc_transfer.data_ptr = sc->sc_qdata; DPRINTF("cmd_data[0]=0x%02x, data_rem=0x%08x\n", - sc->sc_transfer.cmd_data[0], sc->sc_transfer.data_rem); + sc->sc_cmd_data[0], sc->sc_transfer.data_rem); - switch (sc->sc_transfer.cmd_data[0]) { + switch (sc->sc_cmd_data[0]) { case SC_INQUIRY: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_transfer.cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); if (error) { break; } @@ -1609,7 +1629,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_6: sc->sc_transfer.cmd_dir = DIR_READ; - error = ustorage_fs_min_len(sc, sc->sc_transfer.cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); if (error) { break; } @@ -1625,7 +1645,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SELECT_10: sc->sc_transfer.cmd_dir = DIR_READ; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_transfer.cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), 0 - 1); if (error) { break; } @@ -1640,7 +1660,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SENSE_6: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_transfer.cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); if (error) { break; } @@ -1656,7 +1676,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_MODE_SENSE_10: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_transfer.cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), 0 - 1); if (error) { break; } @@ -1684,7 +1704,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; case SC_READ_6: - i = sc->sc_transfer.cmd_data[4]; + i = sc->sc_cmd_data[4]; sc->sc_transfer.cmd_dir = DIR_WRITE; temp = ((i == 0) ? 256UL : i); error = ustorage_fs_min_len(sc, temp << 9, mask9); @@ -1702,7 +1722,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_10: sc->sc_transfer.cmd_dir = DIR_WRITE; - temp = get_be16(&sc->sc_transfer.cmd_data[7]); + temp = get_be16(&sc->sc_cmd_data[7]); error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; @@ -1718,7 +1738,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_12: sc->sc_transfer.cmd_dir = DIR_WRITE; - temp = get_be32(&sc->sc_transfer.cmd_data[6]); + temp = get_be32(&sc->sc_cmd_data[6]); if (temp >= (1UL << (32 - 9))) { /* numerical overflow */ sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; @@ -1752,7 +1772,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_READ_FORMAT_CAPACITIES: sc->sc_transfer.cmd_dir = DIR_WRITE; error = ustorage_fs_min_len(sc, - get_be16(&sc->sc_transfer.cmd_data[7]), 0 - 1); + get_be16(&sc->sc_cmd_data[7]), 0 - 1); if (error) { break; } @@ -1767,7 +1787,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_REQUEST_SENSE: sc->sc_transfer.cmd_dir = DIR_WRITE; - error = ustorage_fs_min_len(sc, sc->sc_transfer.cmd_data[4], 0 - 1); + error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1); if (error) { break; } @@ -1836,7 +1856,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so break; case SC_WRITE_6: - i = sc->sc_transfer.cmd_data[4]; + i = sc->sc_cmd_data[4]; sc->sc_transfer.cmd_dir = DIR_READ; temp = ((i == 0) ? 256UL : i); error = ustorage_fs_min_len(sc, temp << 9, mask9); @@ -1854,7 +1874,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_10: sc->sc_transfer.cmd_dir = DIR_READ; - temp = get_be16(&sc->sc_transfer.cmd_data[7]); + temp = get_be16(&sc->sc_cmd_data[7]); error = ustorage_fs_min_len(sc, temp << 9, mask9); if (error) { break; @@ -1870,7 +1890,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so case SC_WRITE_12: sc->sc_transfer.cmd_dir = DIR_READ; - temp = get_be32(&sc->sc_transfer.cmd_data[6]); + temp = get_be32(&sc->sc_cmd_data[6]); if (temp > (mask9 >> 9)) { /* numerical overflow */ sc->sc_csw.bCSWStatus = CSWSTATUS_FAILED; From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:20:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240E910659D2; Sun, 5 Apr 2009 18:20:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC178FC18; Sun, 5 Apr 2009 18:20:39 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IKdPQ027938; Sun, 5 Apr 2009 18:20:39 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKcje027916; Sun, 5 Apr 2009 18:20:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKcje027916@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20: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: r190734 - in head/sys: compat/ndis dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:44 -0000 Author: thompsa Date: Sun Apr 5 18:20:38 2009 New Revision: 190734 URL: http://svn.freebsd.org/changeset/base/190734 Log: MFp4 //depot/projects/usb@159909 - make usb2_power_mask_t 16-bit - remove "usb2_config_sub" structure from "usb2_config". To compensate for this "usb2_config" has a new field called "usb_mode" which select for which mode the current xfer entry is active. Options are: a) Device mode only b) Host mode only (default-by-zero) c) Both modes. This change was scripted using the following sed script: "s/\.mh\././g". - the standard packet size table in "usb_transfer.c" is now a function, hence the code for the function uses less memory than the table itself. Submitted by: Hans Petter Selasky Modified: head/sys/compat/ndis/subr_usbd.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/bluetooth/ng_ubt.c head/sys/dev/usb/bluetooth/ubtbcmfw.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cdcereg.h head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_transfer.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/compat/ndis/subr_usbd.c Sun Apr 5 18:20:38 2009 (r190734) @@ -93,20 +93,20 @@ static struct usb2_config usbd_default_e .endpoint = 0x00, /* control pipe */ .direction = UE_DIR_ANY, .if_index = 0, - .mh.bufsize = USBD_CTRL_READ_BUFFER_SIZE, - .mh.flags = { .short_xfer_ok = 1, }, - .mh.callback = &usbd_ctrl_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = USBD_CTRL_READ_BUFFER_SIZE, + .flags = { .short_xfer_ok = 1, }, + .callback = &usbd_ctrl_callback, + .timeout = 5000, /* 5 seconds */ }, [USBD_CTRL_WRITE_PIPE] = { .type = UE_CONTROL, .endpoint = 0x00, /* control pipe */ .direction = UE_DIR_ANY, .if_index = 0, - .mh.bufsize = USBD_CTRL_WRITE_BUFFER_SIZE, - .mh.flags = { .proxy_buffer = 1, }, - .mh.callback = &usbd_ctrl_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = USBD_CTRL_WRITE_BUFFER_SIZE, + .flags = { .proxy_buffer = 1, }, + .callback = &usbd_ctrl_callback, + .timeout = 5000, /* 5 seconds */ } }; @@ -674,11 +674,11 @@ usbd_setup_endpoint(ip, ifidx, ep) cfg.type = UE_GET_XFERTYPE(ep->bmAttributes); cfg.endpoint = UE_GET_ADDR(ep->bEndpointAddress); cfg.direction = UE_GET_DIR(ep->bEndpointAddress); - cfg.mh.callback = &usbd_non_isoc_callback; - cfg.mh.bufsize = UGETW(ep->wMaxPacketSize); - cfg.mh.flags.proxy_buffer = 1; + cfg.callback = &usbd_non_isoc_callback; + cfg.bufsize = UGETW(ep->wMaxPacketSize); + cfg.flags.proxy_buffer = 1; if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_IN) - cfg.mh.flags.short_xfer_ok = 1; + cfg.flags.short_xfer_ok = 1; status = usb2_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, &cfg, 1, sc, &sc->ndisusb_mtx); Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/sound/usb/uaudio.c Sun Apr 5 18:20:38 2009 (r190734) @@ -400,20 +400,20 @@ static const struct usb2_config .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UAUDIO_MINFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &uaudio_chan_record_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UAUDIO_MINFRAMES, + .flags = {.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_callback, }, [1] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UAUDIO_MINFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &uaudio_chan_record_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UAUDIO_MINFRAMES, + .flags = {.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_callback, }, }; @@ -423,20 +423,20 @@ static const struct usb2_config .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UAUDIO_MINFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &uaudio_chan_play_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UAUDIO_MINFRAMES, + .flags = {.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_callback, }, [1] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UAUDIO_MINFRAMES, - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &uaudio_chan_play_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UAUDIO_MINFRAMES, + .flags = {.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_callback, }, }; @@ -446,9 +446,9 @@ static const struct usb2_config .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = (sizeof(struct usb2_device_request) + 4), - .mh.callback = &uaudio_mixer_write_cfg_callback, - .mh.timeout = 1000, /* 1 second */ + .bufsize = (sizeof(struct usb2_device_request) + 4), + .callback = &uaudio_mixer_write_cfg_callback, + .timeout = 1000, /* 1 second */ }, }; @@ -478,40 +478,40 @@ static const struct usb2_config .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = UMIDI_BULK_SIZE, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &umidi_bulk_write_callback, + .bufsize = UMIDI_BULK_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &umidi_bulk_write_callback, }, [1] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = UMIDI_BULK_SIZE, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &umidi_bulk_read_callback, + .bufsize = UMIDI_BULK_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &umidi_bulk_read_callback, }, [2] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &umidi_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .bufsize = sizeof(struct usb2_device_request), + .flags = {}, + .callback = &umidi_write_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ }, [3] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.flags = {}, - .mh.callback = &umidi_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .bufsize = sizeof(struct usb2_device_request), + .flags = {}, + .callback = &umidi_read_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ }, }; Modified: head/sys/dev/usb/bluetooth/ng_ubt.c ============================================================================== --- head/sys/dev/usb/bluetooth/ng_ubt.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/bluetooth/ng_ubt.c Sun Apr 5 18:20:38 2009 (r190734) @@ -276,9 +276,9 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .if_index = 0, - .mh.bufsize = UBT_BULK_WRITE_BUFFER_SIZE, - .mh.flags = { .pipe_bof = 1, .force_short_xfer = 1, }, - .mh.callback = &ubt_bulk_write_callback, + .bufsize = UBT_BULK_WRITE_BUFFER_SIZE, + .flags = { .pipe_bof = 1, .force_short_xfer = 1, }, + .callback = &ubt_bulk_write_callback, }, /* Incoming bulk transfer - ACL packets */ [UBT_IF_0_BULK_DT_RD] = { @@ -286,9 +286,9 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .if_index = 0, - .mh.bufsize = UBT_BULK_READ_BUFFER_SIZE, - .mh.flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, - .mh.callback = &ubt_bulk_read_callback, + .bufsize = UBT_BULK_READ_BUFFER_SIZE, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, + .callback = &ubt_bulk_read_callback, }, /* Incoming interrupt transfer - HCI events */ [UBT_IF_0_INTR_DT_RD] = { @@ -296,9 +296,9 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .if_index = 0, - .mh.flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, - .mh.bufsize = UBT_INTR_BUFFER_SIZE, - .mh.callback = &ubt_intr_read_callback, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1, }, + .bufsize = UBT_INTR_BUFFER_SIZE, + .callback = &ubt_intr_read_callback, }, /* Outgoing control transfer - HCI commands */ [UBT_IF_0_CTRL_DT_WR] = { @@ -306,9 +306,9 @@ static const struct usb2_config ubt_con .endpoint = 0x00, /* control pipe */ .direction = UE_DIR_ANY, .if_index = 0, - .mh.bufsize = UBT_CTRL_BUFFER_SIZE, - .mh.callback = &ubt_ctrl_write_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = UBT_CTRL_BUFFER_SIZE, + .callback = &ubt_ctrl_write_callback, + .timeout = 5000, /* 5 seconds */ }, /* @@ -321,10 +321,10 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .if_index = 1, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = { .short_xfer_ok = 1, }, - .mh.callback = &ubt_isoc_read_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UBT_ISOC_NFRAMES, + .flags = { .short_xfer_ok = 1, }, + .callback = &ubt_isoc_read_callback, }, /* Incoming isochronous transfer #2 - SCO packets */ [UBT_IF_1_ISOC_DT_RD2] = { @@ -332,10 +332,10 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .if_index = 1, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = { .short_xfer_ok = 1, }, - .mh.callback = &ubt_isoc_read_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UBT_ISOC_NFRAMES, + .flags = { .short_xfer_ok = 1, }, + .callback = &ubt_isoc_read_callback, }, /* Outgoing isochronous transfer #1 - SCO packets */ [UBT_IF_1_ISOC_DT_WR1] = { @@ -343,10 +343,10 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .if_index = 1, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = { .short_xfer_ok = 1, }, - .mh.callback = &ubt_isoc_write_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UBT_ISOC_NFRAMES, + .flags = { .short_xfer_ok = 1, }, + .callback = &ubt_isoc_write_callback, }, /* Outgoing isochronous transfer #2 - SCO packets */ [UBT_IF_1_ISOC_DT_WR2] = { @@ -354,10 +354,10 @@ static const struct usb2_config ubt_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .if_index = 1, - .mh.bufsize = 0, /* use "wMaxPacketSize * frames" */ - .mh.frames = UBT_ISOC_NFRAMES, - .mh.flags = { .short_xfer_ok = 1, }, - .mh.callback = &ubt_isoc_write_callback, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = UBT_ISOC_NFRAMES, + .flags = { .short_xfer_ok = 1, }, + .callback = &ubt_isoc_write_callback, }, }; Modified: head/sys/dev/usb/bluetooth/ubtbcmfw.c ============================================================================== --- head/sys/dev/usb/bluetooth/ubtbcmfw.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/bluetooth/ubtbcmfw.c Sun Apr 5 18:20:38 2009 (r190734) @@ -118,10 +118,10 @@ static const struct usb2_config ubtbcmfw .endpoint = 0x02, /* fixed */ .direction = UE_DIR_OUT, .if_index = UBTBCMFW_IFACE_IDX, - .mh.bufsize = UBTBCMFW_BSIZE, - .mh.flags = { .pipe_bof = 1, .force_short_xfer = 1, + .bufsize = UBTBCMFW_BSIZE, + .flags = { .pipe_bof = 1, .force_short_xfer = 1, .proxy_buffer = 1, }, - .mh.callback = &ubtbcmfw_write_callback, + .callback = &ubtbcmfw_write_callback, }, [UBTBCMFW_INTR_DT_RD] = { @@ -129,10 +129,10 @@ static const struct usb2_config ubtbcmfw .endpoint = 0x01, /* fixed */ .direction = UE_DIR_IN, .if_index = UBTBCMFW_IFACE_IDX, - .mh.bufsize = UBTBCMFW_BSIZE, - .mh.flags = { .pipe_bof = 1, .short_xfer_ok = 1, + .bufsize = UBTBCMFW_BSIZE, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1, .proxy_buffer = 1, }, - .mh.callback = &ubtbcmfw_read_callback, + .callback = &ubtbcmfw_read_callback, }, }; Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 18:20:38 2009 (r190734) @@ -209,7 +209,6 @@ usb2_bus_explore(struct usb2_proc_msg *p * First update the USB power state! */ usb2_bus_powerd(bus); - /* * Explore the Root USB HUB. This call can sleep, * exiting Giant, which is actually Giant. @@ -328,6 +327,20 @@ usb2_bus_attach(struct usb2_proc_msg *pm USB_BUS_UNLOCK(bus); mtx_lock(&Giant); /* XXX not required by USB */ + /* default power_mask value */ + bus->hw_power_state = + USB_HW_POWER_CONTROL | + USB_HW_POWER_BULK | + USB_HW_POWER_INTERRUPT | + USB_HW_POWER_ISOC | + USB_HW_POWER_NON_ROOT_HUB; + + /* make sure power is set at least once */ + + if (bus->methods->set_hw_power != NULL) { + (bus->methods->set_hw_power) (bus); + } + /* Allocate the Root USB device */ child = usb2_alloc_device(bus->bdev, bus, NULL, 0, 0, 1, Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/input/uhid.c Sun Apr 5 18:20:38 2009 (r190734) @@ -316,27 +316,27 @@ static const struct usb2_config uhid_con .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = UHID_BSIZE, - .mh.callback = &uhid_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = UHID_BSIZE, + .callback = &uhid_intr_callback, }, [UHID_CTRL_DT_WR] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE, - .mh.callback = &uhid_write_callback, - .mh.timeout = 1000, /* 1 second */ + .bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE, + .callback = &uhid_write_callback, + .timeout = 1000, /* 1 second */ }, [UHID_CTRL_DT_RD] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE, - .mh.callback = &uhid_read_callback, - .mh.timeout = 1000, /* 1 second */ + .bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE, + .callback = &uhid_read_callback, + .timeout = 1000, /* 1 second */ }, }; Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/input/ukbd.c Sun Apr 5 18:20:38 2009 (r190734) @@ -562,28 +562,28 @@ static const struct usb2_config ukbd_con .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = &ukbd_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &ukbd_intr_callback, }, [UKBD_INTR_CS] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ukbd_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .bufsize = sizeof(struct usb2_device_request), + .callback = &ukbd_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ }, [UKBD_CTRL_LED] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request) + 1, - .mh.callback = &ukbd_set_leds_callback, - .mh.timeout = 1000, /* 1 second */ + .bufsize = sizeof(struct usb2_device_request) + 1, + .callback = &ukbd_set_leds_callback, + .timeout = 1000, /* 1 second */ }, }; Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/input/ums.c Sun Apr 5 18:20:38 2009 (r190734) @@ -312,9 +312,9 @@ static const struct usb2_config ums_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = &ums_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &ums_intr_callback, }, }; Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/misc/udbp.c Sun Apr 5 18:20:38 2009 (r190734) @@ -192,39 +192,39 @@ static const struct usb2_config udbp_con .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = UDBP_BUFFERSIZE, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &udbp_bulk_write_callback, - .mh.timeout = UDBP_TIMEOUT, + .bufsize = UDBP_BUFFERSIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &udbp_bulk_write_callback, + .timeout = UDBP_TIMEOUT, }, [UDBP_T_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = UDBP_BUFFERSIZE, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &udbp_bulk_read_callback, + .bufsize = UDBP_BUFFERSIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &udbp_bulk_read_callback, }, [UDBP_T_WR_CS] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &udbp_bulk_write_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .bufsize = sizeof(struct usb2_device_request), + .callback = &udbp_bulk_write_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ }, [UDBP_T_RD_CS] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &udbp_bulk_read_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ + .bufsize = sizeof(struct usb2_device_request), + .callback = &udbp_bulk_read_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ }, }; Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_aue.c Sun Apr 5 18:20:38 2009 (r190734) @@ -209,28 +209,28 @@ static const struct usb2_config aue_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = (MCLBYTES + 2), - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = aue_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = aue_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [AUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = (MCLBYTES + 4 + ETHER_CRC_LEN), - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = aue_bulk_read_callback, + .bufsize = (MCLBYTES + 4 + ETHER_CRC_LEN), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = aue_bulk_read_callback, }, [AUE_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = aue_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = aue_intr_callback, }, }; Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_axe.c Sun Apr 5 18:20:38 2009 (r190734) @@ -182,10 +182,10 @@ static const struct usb2_config axe_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = AXE_BULK_BUF_SIZE, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = axe_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = AXE_BULK_BUF_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axe_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [AXE_BULK_DT_RD] = { @@ -195,19 +195,19 @@ static const struct usb2_config axe_conf #if (MCLBYTES < 2048) #error "(MCLBYTES < 2048)" #endif - .mh.bufsize = MCLBYTES, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = axe_bulk_read_callback, - .mh.timeout = 0, /* no timeout */ + .bufsize = MCLBYTES, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axe_bulk_read_callback, + .timeout = 0, /* no timeout */ }, [AXE_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = axe_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = axe_intr_callback, }, }; Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_cdce.c Sun Apr 5 18:20:38 2009 (r190734) @@ -96,59 +96,54 @@ SYSCTL_INT(_hw_usb2_cdce, OID_AUTO, debu static const struct usb2_config cdce_config[CDCE_N_TRANSFER] = { - [CDCE_BULK_A] = { + [CDCE_BULK_RX] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, + .direction = UE_DIR_RX, .if_index = 0, - /* Host Mode */ - .mh.frames = CDCE_FRAMES_MAX, - .mh.bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, - .mh.callback = cdce_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ - /* Device Mode */ - .md.frames = CDCE_FRAMES_MAX, - .md.bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .md.flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,}, - .md.callback = cdce_bulk_read_callback, - .md.timeout = 0, /* no timeout */ + .frames = CDCE_FRAMES_MAX, + .bufsize = (CDCE_FRAMES_MAX * MCLBYTES), + .flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,}, + .callback = cdce_bulk_read_callback, + .timeout = 0, /* no timeout */ + .usb_mode = USB_MODE_MAX, /* both modes */ }, - [CDCE_BULK_B] = { + [CDCE_BULK_TX] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, + .direction = UE_DIR_TX, .if_index = 0, - /* Host Mode */ - .mh.frames = CDCE_FRAMES_MAX, - .mh.bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .mh.flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,}, - .mh.callback = cdce_bulk_read_callback, - .mh.timeout = 0, /* no timeout */ - /* Device Mode */ - .md.frames = CDCE_FRAMES_MAX, - .md.bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .md.flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, - .md.callback = cdce_bulk_write_callback, - .md.timeout = 10000, /* 10 seconds */ + .frames = CDCE_FRAMES_MAX, + .bufsize = (CDCE_FRAMES_MAX * MCLBYTES), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, + .callback = cdce_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_MAX, /* both modes */ }, - [CDCE_INTR] = { + [CDCE_INTR_RX] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, + .direction = UE_DIR_RX, .if_index = 1, - /* Host Mode */ - .mh.bufsize = CDCE_IND_SIZE_MAX, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, - .mh.callback = cdce_intr_read_callback, - .mh.timeout = 0, - /* Device Mode */ - .md.bufsize = CDCE_IND_SIZE_MAX, - .md.flags = {.pipe_bof = 1,.force_short_xfer = 1,.no_pipe_ok = 1,}, - .md.callback = cdce_intr_write_callback, - .md.timeout = 10000, /* 10 seconds */ + .bufsize = CDCE_IND_SIZE_MAX, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .callback = cdce_intr_read_callback, + .timeout = 0, + .usb_mode = USB_MODE_HOST, + }, + + [CDCE_INTR_TX] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .if_index = 1, + .bufsize = CDCE_IND_SIZE_MAX, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,.no_pipe_ok = 1,}, + .callback = cdce_intr_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_DEVICE, }, }; @@ -416,8 +411,8 @@ cdce_start(struct usb2_ether *ue) /* * Start the USB transfers, if not already started: */ - usb2_transfer_start(sc->sc_xfer[CDCE_BULK_B]); - usb2_transfer_start(sc->sc_xfer[CDCE_BULK_A]); + usb2_transfer_start(sc->sc_xfer[CDCE_BULK_TX]); + usb2_transfer_start(sc->sc_xfer[CDCE_BULK_RX]); } static void @@ -557,13 +552,11 @@ cdce_init(struct usb2_ether *ue) ifp->if_drv_flags |= IFF_DRV_RUNNING; /* start interrupt transfer */ - usb2_transfer_start(sc->sc_xfer[CDCE_INTR]); + usb2_transfer_start(sc->sc_xfer[CDCE_INTR_RX]); + usb2_transfer_start(sc->sc_xfer[CDCE_INTR_TX]); /* stall data write direction, which depends on USB mode */ - if (usb2_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) - usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_A]); - else - usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_B]); + usb2_transfer_set_stall(sc->sc_xfer[CDCE_BULK_TX]); /* start data transfers */ cdce_start(ue); @@ -582,9 +575,10 @@ cdce_stop(struct usb2_ether *ue) /* * stop all the transfers, if not already stopped: */ - usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_A]); - usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_B]); - usb2_transfer_stop(sc->sc_xfer[CDCE_INTR]); + usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_RX]); + usb2_transfer_stop(sc->sc_xfer[CDCE_BULK_TX]); + usb2_transfer_stop(sc->sc_xfer[CDCE_INTR_RX]); + usb2_transfer_stop(sc->sc_xfer[CDCE_INTR_TX]); } static void Modified: head/sys/dev/usb/net/if_cdcereg.h ============================================================================== --- head/sys/dev/usb/net/if_cdcereg.h Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_cdcereg.h Sun Apr 5 18:20:38 2009 (r190734) @@ -39,9 +39,10 @@ #define CDCE_IND_SIZE_MAX 32 /* bytes */ enum { - CDCE_BULK_A, - CDCE_BULK_B, - CDCE_INTR, + CDCE_BULK_RX, + CDCE_BULK_TX, + CDCE_INTR_RX, + CDCE_INTR_TX, CDCE_N_TRANSFER, }; Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_cue.c Sun Apr 5 18:20:38 2009 (r190734) @@ -121,19 +121,19 @@ static const struct usb2_config cue_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = (MCLBYTES + 2), - .mh.flags = {.pipe_bof = 1,}, - .mh.callback = cue_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,}, + .callback = cue_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [CUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = (MCLBYTES + 2), - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = cue_bulk_read_callback, + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = cue_bulk_read_callback, }, }; Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_kue.c Sun Apr 5 18:20:38 2009 (r190734) @@ -163,20 +163,20 @@ static const struct usb2_config kue_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = (MCLBYTES + 2 + 64), - .mh.flags = {.pipe_bof = 1,}, - .mh.callback = kue_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = (MCLBYTES + 2 + 64), + .flags = {.pipe_bof = 1,}, + .callback = kue_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [KUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = (MCLBYTES + 2), - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = kue_bulk_read_callback, - .mh.timeout = 0, /* no timeout */ + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = kue_bulk_read_callback, + .timeout = 0, /* no timeout */ }, }; Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_rue.c Sun Apr 5 18:20:38 2009 (r190734) @@ -141,29 +141,29 @@ static const struct usb2_config rue_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = MCLBYTES, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = rue_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = MCLBYTES, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = rue_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [RUE_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = (MCLBYTES + 4), - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = rue_bulk_read_callback, - .mh.timeout = 0, /* no timeout */ + .bufsize = (MCLBYTES + 4), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = rue_bulk_read_callback, + .timeout = 0, /* no timeout */ }, [RUE_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = rue_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = rue_intr_callback, }, }; Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/net/if_udav.c Sun Apr 5 18:20:38 2009 (r190734) @@ -101,29 +101,29 @@ static const struct usb2_config udav_con .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = (MCLBYTES + 2), - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = udav_bulk_write_callback, - .mh.timeout = 10000, /* 10 seconds */ + .bufsize = (MCLBYTES + 2), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = udav_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ }, [UDAV_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = (MCLBYTES + 3), - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = udav_bulk_read_callback, - .mh.timeout = 0, /* no timeout */ + .bufsize = (MCLBYTES + 3), + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = udav_bulk_read_callback, + .timeout = 0, /* no timeout */ }, [UDAV_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = udav_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = udav_intr_callback, }, }; Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/serial/u3g.c Sun Apr 5 18:20:38 2009 (r190734) @@ -116,18 +116,18 @@ static const struct usb2_config u3g_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = U3G_BSIZE,/* bytes */ - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &u3g_write_callback, + .bufsize = U3G_BSIZE,/* bytes */ + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &u3g_write_callback, }, [U3G_BULK_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = U3G_BSIZE,/* bytes */ - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &u3g_read_callback, + .bufsize = U3G_BSIZE,/* bytes */ + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &u3g_read_callback, }, }; Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/serial/uark.c Sun Apr 5 18:20:38 2009 (r190734) @@ -106,18 +106,18 @@ static const struct usb2_config .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = UARK_BUF_SIZE, - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &uark_bulk_write_callback, + .bufsize = UARK_BUF_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &uark_bulk_write_callback, }, [UARK_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = UARK_BUF_SIZE, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &uark_bulk_read_callback, + .bufsize = UARK_BUF_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &uark_bulk_read_callback, }, }; Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/serial/ubsa.c Sun Apr 5 18:20:38 2009 (r190734) @@ -188,27 +188,27 @@ static const struct usb2_config ubsa_con .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = UBSA_BSIZE, /* bytes */ - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &ubsa_write_callback, + .bufsize = UBSA_BSIZE, /* bytes */ + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &ubsa_write_callback, }, [UBSA_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = UBSA_BSIZE, /* bytes */ - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.callback = &ubsa_read_callback, + .bufsize = UBSA_BSIZE, /* bytes */ + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = &ubsa_read_callback, }, [UBSA_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.callback = &ubsa_intr_callback, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 0, /* use wMaxPacketSize */ + .callback = &ubsa_intr_callback, }, }; Modified: head/sys/dev/usb/serial/ubser.c ============================================================================== --- head/sys/dev/usb/serial/ubser.c Sun Apr 5 18:20:24 2009 (r190733) +++ head/sys/dev/usb/serial/ubser.c Sun Apr 5 18:20:38 2009 (r190734) @@ -156,18 +156,18 @@ static const struct usb2_config ubser_co .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = 0, /* use wMaxPacketSize */ - .mh.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .mh.callback = &ubser_write_callback, + .bufsize = 0, /* use wMaxPacketSize */ + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = &ubser_write_callback, }, [UBSER_BULK_DT_RD] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:20:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9CB10656F2; Sun, 5 Apr 2009 18:20:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AD388FC12; Sun, 5 Apr 2009 18:20:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IKocc027983; Sun, 5 Apr 2009 18:20:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKn23027975; Sun, 5 Apr 2009 18:20:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKn23027975@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20: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: r190735 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:54 -0000 Author: thompsa Date: Sun Apr 5 18:20:49 2009 New Revision: 190735 URL: http://svn.freebsd.org/changeset/base/190735 Log: MFp4 //depot/projects/usb@159922 Refactor how we interface with the root HUB. This cuts around 1200 lines of code totally and saves one thread per USB bus. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/at91dci.h head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci.h head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg.h head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/ohci.h head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uhci.h head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/uss820dci.h head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_sw_transfer.c head/sys/dev/usb/usb_sw_transfer.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:20:49 2009 (r190735) @@ -88,8 +88,6 @@ struct usb2_pipe_methods at91dci_device_ struct usb2_pipe_methods at91dci_device_ctrl_methods; struct usb2_pipe_methods at91dci_device_intr_methods; struct usb2_pipe_methods at91dci_device_isoc_fs_methods; -struct usb2_pipe_methods at91dci_root_ctrl_methods; -struct usb2_pipe_methods at91dci_root_intr_methods; static at91dci_cmd_t at91dci_setup_rx; static at91dci_cmd_t at91dci_data_rx; @@ -97,11 +95,8 @@ static at91dci_cmd_t at91dci_data_tx; static at91dci_cmd_t at91dci_data_tx_sync; static void at91dci_device_done(struct usb2_xfer *, usb2_error_t); static void at91dci_do_poll(struct usb2_bus *); -static void at91dci_root_ctrl_poll(struct at91dci_softc *); static void at91dci_standard_done(struct usb2_xfer *); - -static usb2_sw_transfer_func_t at91dci_root_intr_done; -static usb2_sw_transfer_func_t at91dci_root_ctrl_done; +static void at91dci_root_intr(struct at91dci_softc *sc); /* * NOTE: Some of the bits in the CSR register have inverse meaning so @@ -256,10 +251,8 @@ at91dci_pull_down(struct at91dci_softc * } static void -at91dci_wakeup_peer(struct usb2_xfer *xfer) +at91dci_wakeup_peer(struct at91dci_softc *sc) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - if (!(sc->sc_flags.status_suspend)) { return; } @@ -736,9 +729,7 @@ at91dci_vbus_interrupt(struct at91dci_so sc->sc_flags.status_vbus = 1; /* complete root HUB interrupt endpoint */ - - usb2_sw_transfer(&sc->sc_root_intr, - &at91dci_root_intr_done); + at91dci_root_intr(sc); } } else { if (sc->sc_flags.status_vbus) { @@ -749,9 +740,7 @@ at91dci_vbus_interrupt(struct at91dci_so sc->sc_flags.change_connect = 1; /* complete root HUB interrupt endpoint */ - - usb2_sw_transfer(&sc->sc_root_intr, - &at91dci_root_intr_done); + at91dci_root_intr(sc); } } USB_BUS_UNLOCK(&sc->sc_bus); @@ -828,9 +817,7 @@ at91dci_interrupt(struct at91dci_softc * } } /* complete root HUB interrupt endpoint */ - - usb2_sw_transfer(&sc->sc_root_intr, - &at91dci_root_intr_done); + at91dci_root_intr(sc); } /* check for any endpoint interrupts */ @@ -1070,31 +1057,17 @@ at91dci_start_standard_chain(struct usb2 } static void -at91dci_root_intr_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) +at91dci_root_intr(struct at91dci_softc *sc) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - DPRINTFN(9, "\n"); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_PRE_DATA) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - at91dci_device_done(xfer, std->err); - } - goto done; - } - /* setup buffer */ - std->ptr = sc->sc_hub_idata; - std->len = sizeof(sc->sc_hub_idata); - /* set port bit */ sc->sc_hub_idata[0] = 0x02; /* we only have one port */ -done: - return; + uhub_root_intr(&sc->sc_bus, sc->sc_hub_idata, + sizeof(sc->sc_hub_idata)); } static usb2_error_t @@ -1488,7 +1461,6 @@ at91dci_do_poll(struct usb2_bus *bus) USB_BUS_LOCK(&sc->sc_bus); at91dci_interrupt_poll(sc); - at91dci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1696,31 +1668,9 @@ struct usb2_pipe_methods at91dci_device_ /*------------------------------------------------------------------------* * at91dci root control support *------------------------------------------------------------------------* - * simulate a hardware HUB by handling - * all the necessary requests + * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ -static void -at91dci_root_ctrl_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -at91dci_root_ctrl_close(struct usb2_xfer *xfer) -{ - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_ctrl.xfer == xfer) { - sc->sc_root_ctrl.xfer = NULL; - } - at91dci_device_done(xfer, USB_ERR_CANCELLED); -} - -/* - * USB descriptors for the virtual Root HUB: - */ - static const struct usb2_device_descriptor at91dci_devd = { .bLength = sizeof(struct usb2_device_descriptor), .bDescriptorType = UDESC_DEVICE, @@ -1765,7 +1715,6 @@ static const struct at91dci_config_desc .bInterfaceSubClass = UISUBCLASS_HUB, .bInterfaceProtocol = UIPROTO_HSHUBSTT, }, - .endpd = { .bLength = sizeof(struct usb2_endpoint_descriptor), .bDescriptorType = UDESC_ENDPOINT, @@ -1805,44 +1754,15 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, at91 USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product); static void -at91dci_root_ctrl_enter(struct usb2_xfer *xfer) +at91dci_roothub_exec(struct usb2_bus *bus) { - return; -} - -static void -at91dci_root_ctrl_start(struct usb2_xfer *xfer) -{ - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - - sc->sc_root_ctrl.xfer = xfer; - - usb2_bus_roothub_exec(xfer->xroot->bus); -} - -static void -at91dci_root_ctrl_task(struct usb2_bus *bus) -{ - at91dci_root_ctrl_poll(AT9100_DCI_BUS2SC(bus)); -} - -static void -at91dci_root_ctrl_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) -{ - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); + struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus); + struct usb2_sw_transfer *std = &sc->sc_bus.roothub_req; uint16_t value; uint16_t index; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_SETUP) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - at91dci_device_done(xfer, std->err); - } - goto done; - } /* buffer reset */ std->ptr = USB_ADD_BYTES(&sc->sc_hub_temp, 0); std->len = 0; @@ -2101,7 +2021,7 @@ tr_handle_clear_port_feature: switch (value) { case UHF_PORT_SUSPEND: - at91dci_wakeup_peer(xfer); + at91dci_wakeup_peer(sc); break; case UHF_PORT_ENABLE: @@ -2225,67 +2145,6 @@ done: } static void -at91dci_root_ctrl_poll(struct at91dci_softc *sc) -{ - usb2_sw_transfer(&sc->sc_root_ctrl, - &at91dci_root_ctrl_done); -} - -struct usb2_pipe_methods at91dci_root_ctrl_methods = -{ - .open = at91dci_root_ctrl_open, - .close = at91dci_root_ctrl_close, - .enter = at91dci_root_ctrl_enter, - .start = at91dci_root_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 0, -}; - -/*------------------------------------------------------------------------* - * at91dci root interrupt support - *------------------------------------------------------------------------*/ -static void -at91dci_root_intr_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -at91dci_root_intr_close(struct usb2_xfer *xfer) -{ - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_intr.xfer == xfer) { - sc->sc_root_intr.xfer = NULL; - } - at91dci_device_done(xfer, USB_ERR_CANCELLED); -} - -static void -at91dci_root_intr_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -at91dci_root_intr_start(struct usb2_xfer *xfer) -{ - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - - sc->sc_root_intr.xfer = xfer; -} - -struct usb2_pipe_methods at91dci_root_intr_methods = -{ - .open = at91dci_root_intr_open, - .close = at91dci_root_intr_close, - .enter = at91dci_root_intr_enter, - .start = at91dci_root_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, -}; - -static void at91dci_xfer_setup(struct usb2_setup_params *parm) { const struct usb2_hw_ep_profile *pf; @@ -2411,24 +2270,7 @@ at91dci_pipe_init(struct usb2_device *ud edesc->bEndpointAddress, udev->flags.usb2_mode, sc->sc_rt_addr); - if (udev->device_index == sc->sc_rt_addr) { - - if (udev->flags.usb2_mode != USB_MODE_HOST) { - /* not supported */ - return; - } - switch (edesc->bEndpointAddress) { - case USB_CONTROL_ENDPOINT: - pipe->methods = &at91dci_root_ctrl_methods; - break; - case UE_DIR_IN | AT9100_DCI_INTR_ENDPT: - pipe->methods = &at91dci_root_intr_methods; - break; - default: - /* do nothing */ - break; - } - } else { + if (udev->device_index != sc->sc_rt_addr) { if (udev->flags.usb2_mode != USB_MODE_DEVICE) { /* not supported */ @@ -2466,5 +2308,5 @@ struct usb2_bus_methods at91dci_bus_meth .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, - .roothub_exec = &at91dci_root_ctrl_task, + .roothub_exec = &at91dci_roothub_exec, }; Modified: head/sys/dev/usb/controller/at91dci.h ============================================================================== --- head/sys/dev/usb/controller/at91dci.h Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/at91dci.h Sun Apr 5 18:20:49 2009 (r190735) @@ -204,8 +204,6 @@ struct at91dci_softc { struct usb2_bus sc_bus; union at91dci_hub_temp sc_hub_temp; LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; - struct usb2_sw_transfer sc_root_ctrl; - struct usb2_sw_transfer sc_root_intr; struct usb2_device *sc_devices[AT91_MAX_DEVICES]; struct resource *sc_io_res; Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:20:49 2009 (r190735) @@ -81,8 +81,6 @@ struct usb2_pipe_methods atmegadci_devic struct usb2_pipe_methods atmegadci_device_ctrl_methods; struct usb2_pipe_methods atmegadci_device_intr_methods; struct usb2_pipe_methods atmegadci_device_isoc_fs_methods; -struct usb2_pipe_methods atmegadci_root_ctrl_methods; -struct usb2_pipe_methods atmegadci_root_intr_methods; static atmegadci_cmd_t atmegadci_setup_rx; static atmegadci_cmd_t atmegadci_data_rx; @@ -90,11 +88,8 @@ static atmegadci_cmd_t atmegadci_data_tx static atmegadci_cmd_t atmegadci_data_tx_sync; static void atmegadci_device_done(struct usb2_xfer *, usb2_error_t); static void atmegadci_do_poll(struct usb2_bus *); -static void atmegadci_root_ctrl_poll(struct atmegadci_softc *); static void atmegadci_standard_done(struct usb2_xfer *); - -static usb2_sw_transfer_func_t atmegadci_root_intr_done; -static usb2_sw_transfer_func_t atmegadci_root_ctrl_done; +static void atmegadci_root_intr(struct atmegadci_softc *sc); /* * Here is a list of what the chip supports: @@ -201,9 +196,8 @@ atmegadci_pull_down(struct atmegadci_sof } static void -atmegadci_wakeup_peer(struct usb2_xfer *xfer) +atmegadci_wakeup_peer(struct atmegadci_softc *sc) { - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); uint8_t temp; if (!sc->sc_flags.status_suspend) { @@ -625,8 +619,7 @@ atmegadci_vbus_interrupt(struct atmegadc /* complete root HUB interrupt endpoint */ - usb2_sw_transfer(&sc->sc_root_intr, - &atmegadci_root_intr_done); + atmegadci_root_intr(sc); } } else { if (sc->sc_flags.status_vbus) { @@ -638,8 +631,7 @@ atmegadci_vbus_interrupt(struct atmegadc /* complete root HUB interrupt endpoint */ - usb2_sw_transfer(&sc->sc_root_intr, - &atmegadci_root_intr_done); + atmegadci_root_intr(sc); } } } @@ -676,8 +668,7 @@ atmegadci_interrupt(struct atmegadci_sof ATMEGA_UDINT_EORSTE); /* complete root HUB interrupt endpoint */ - usb2_sw_transfer(&sc->sc_root_intr, - &atmegadci_root_intr_done); + atmegadci_root_intr(sc); } /* * If resume and suspend is set at the same time we interpret @@ -699,8 +690,7 @@ atmegadci_interrupt(struct atmegadci_sof ATMEGA_UDINT_EORSTE); /* complete root HUB interrupt endpoint */ - usb2_sw_transfer(&sc->sc_root_intr, - &atmegadci_root_intr_done); + atmegadci_root_intr(sc); } } else if (status & ATMEGA_UDINT_SUSPI) { @@ -717,8 +707,7 @@ atmegadci_interrupt(struct atmegadci_sof ATMEGA_UDINT_EORSTE); /* complete root HUB interrupt endpoint */ - usb2_sw_transfer(&sc->sc_root_intr, - &atmegadci_root_intr_done); + atmegadci_root_intr(sc); } } /* check VBUS */ @@ -953,32 +942,18 @@ atmegadci_start_standard_chain(struct us } static void -atmegadci_root_intr_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) +atmegadci_root_intr(struct atmegadci_softc *sc) { - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - DPRINTFN(9, "\n"); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_PRE_DATA) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - atmegadci_device_done(xfer, std->err); - } - goto done; - } - /* setup buffer */ - std->ptr = sc->sc_hub_idata; - std->len = sizeof(sc->sc_hub_idata); - /* set port bit */ sc->sc_hub_idata[0] = 0x02; /* we only have one port */ -done: - return; -} + uhub_root_intr(&sc->sc_bus, sc->sc_hub_idata, + sizeof(sc->sc_hub_idata)); + } static usb2_error_t atmegadci_standard_done_sub(struct usb2_xfer *xfer) @@ -1363,7 +1338,6 @@ atmegadci_do_poll(struct usb2_bus *bus) USB_BUS_LOCK(&sc->sc_bus); atmegadci_interrupt_poll(sc); - atmegadci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1575,27 +1549,9 @@ struct usb2_pipe_methods atmegadci_devic /*------------------------------------------------------------------------* * at91dci root control support *------------------------------------------------------------------------* - * simulate a hardware HUB by handling - * all the necessary requests + * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ -static void -atmegadci_root_ctrl_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_root_ctrl_close(struct usb2_xfer *xfer) -{ - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_ctrl.xfer == xfer) { - sc->sc_root_ctrl.xfer = NULL; - } - atmegadci_device_done(xfer, USB_ERR_CANCELLED); -} - /* * USB descriptors for the virtual Root HUB: */ @@ -1644,7 +1600,6 @@ static const struct atmegadci_config_des .bInterfaceSubClass = UISUBCLASS_HUB, .bInterfaceProtocol = UIPROTO_HSHUBSTT, }, - .endpd = { .bLength = sizeof(struct usb2_endpoint_descriptor), .bDescriptorType = UDESC_ENDPOINT, @@ -1684,45 +1639,16 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, atme USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product); static void -atmegadci_root_ctrl_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_root_ctrl_start(struct usb2_xfer *xfer) -{ - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - - sc->sc_root_ctrl.xfer = xfer; - - usb2_bus_roothub_exec(xfer->xroot->bus); -} - -static void -atmegadci_root_ctrl_task(struct usb2_bus *bus) -{ - atmegadci_root_ctrl_poll(ATMEGA_BUS2SC(bus)); -} - -static void -atmegadci_root_ctrl_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) +atmegadci_roothub_exec(struct usb2_bus *bus) { - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); + struct atmegadci_softc *sc = ATMEGA_BUS2SC(bus); + struct usb2_sw_transfer *std = &sc->sc_bus.roothub_req; uint16_t value; uint16_t index; uint8_t temp; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_SETUP) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - atmegadci_device_done(xfer, std->err); - } - goto done; - } /* buffer reset */ std->ptr = USB_ADD_BYTES(&sc->sc_hub_temp, 0); std->len = 0; @@ -1981,7 +1907,7 @@ tr_handle_clear_port_feature: switch (value) { case UHF_PORT_SUSPEND: - atmegadci_wakeup_peer(xfer); + atmegadci_wakeup_peer(sc); break; case UHF_PORT_ENABLE: @@ -2130,67 +2056,6 @@ done: } static void -atmegadci_root_ctrl_poll(struct atmegadci_softc *sc) -{ - usb2_sw_transfer(&sc->sc_root_ctrl, - &atmegadci_root_ctrl_done); -} - -struct usb2_pipe_methods atmegadci_root_ctrl_methods = -{ - .open = atmegadci_root_ctrl_open, - .close = atmegadci_root_ctrl_close, - .enter = atmegadci_root_ctrl_enter, - .start = atmegadci_root_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 0, -}; - -/*------------------------------------------------------------------------* - * at91dci root interrupt support - *------------------------------------------------------------------------*/ -static void -atmegadci_root_intr_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_root_intr_close(struct usb2_xfer *xfer) -{ - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_intr.xfer == xfer) { - sc->sc_root_intr.xfer = NULL; - } - atmegadci_device_done(xfer, USB_ERR_CANCELLED); -} - -static void -atmegadci_root_intr_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_root_intr_start(struct usb2_xfer *xfer) -{ - struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - - sc->sc_root_intr.xfer = xfer; -} - -struct usb2_pipe_methods atmegadci_root_intr_methods = -{ - .open = atmegadci_root_intr_open, - .close = atmegadci_root_intr_close, - .enter = atmegadci_root_intr_enter, - .start = atmegadci_root_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, -}; - -static void atmegadci_xfer_setup(struct usb2_setup_params *parm) { const struct usb2_hw_ep_profile *pf; @@ -2313,24 +2178,7 @@ atmegadci_pipe_init(struct usb2_device * edesc->bEndpointAddress, udev->flags.usb2_mode, sc->sc_rt_addr, udev->device_index); - if (udev->device_index == sc->sc_rt_addr) { - - if (udev->flags.usb2_mode != USB_MODE_HOST) { - /* not supported */ - return; - } - switch (edesc->bEndpointAddress) { - case USB_CONTROL_ENDPOINT: - pipe->methods = &atmegadci_root_ctrl_methods; - break; - case UE_DIR_IN | ATMEGA_INTR_ENDPT: - pipe->methods = &atmegadci_root_intr_methods; - break; - default: - /* do nothing */ - break; - } - } else { + if (udev->device_index != sc->sc_rt_addr) { if (udev->flags.usb2_mode != USB_MODE_DEVICE) { /* not supported */ @@ -2368,5 +2216,5 @@ struct usb2_bus_methods atmegadci_bus_me .get_hw_ep_profile = &atmegadci_get_hw_ep_profile, .set_stall = &atmegadci_set_stall, .clear_stall = &atmegadci_clear_stall, - .roothub_exec = &atmegadci_root_ctrl_task, + .roothub_exec = &atmegadci_roothub_exec, }; Modified: head/sys/dev/usb/controller/atmegadci.h ============================================================================== --- head/sys/dev/usb/controller/atmegadci.h Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/atmegadci.h Sun Apr 5 18:20:49 2009 (r190735) @@ -34,10 +34,6 @@ #define ATMEGA_MAX_DEVICES (USB_MIN_DEVICES + 1) -#ifndef ATMEGA_HAVE_BUS_SPACE -#define ATMEGA_HAVE_BUS_SPACE 1 -#endif - #define ATMEGA_UEINT 0xF4 #define ATMEGA_UEINT_MASK(n) (1 << (n)) /* endpoint interrupt mask */ @@ -241,8 +237,6 @@ struct atmegadci_softc { struct usb2_bus sc_bus; union atmegadci_hub_temp sc_hub_temp; LIST_HEAD(, usb2_xfer) sc_interrupt_list_head; - struct usb2_sw_transfer sc_root_ctrl; - struct usb2_sw_transfer sc_root_intr; /* must be set by by the bus interface layer */ atmegadci_clocks_t *sc_clocks_on; @@ -251,11 +245,10 @@ struct atmegadci_softc { struct usb2_device *sc_devices[ATMEGA_MAX_DEVICES]; struct resource *sc_irq_res; void *sc_intr_hdl; -#if (ATMEGA_HAVE_BUS_SPACE != 0) struct resource *sc_io_res; bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; -#endif + uint8_t sc_rt_addr; /* root hub address */ uint8_t sc_dv_addr; /* device address */ uint8_t sc_conf; /* root hub config */ Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/ehci.c Sun Apr 5 18:20:49 2009 (r190735) @@ -93,17 +93,12 @@ extern struct usb2_pipe_methods ehci_dev extern struct usb2_pipe_methods ehci_device_intr_methods; extern struct usb2_pipe_methods ehci_device_isoc_fs_methods; extern struct usb2_pipe_methods ehci_device_isoc_hs_methods; -extern struct usb2_pipe_methods ehci_root_ctrl_methods; -extern struct usb2_pipe_methods ehci_root_intr_methods; static void ehci_do_poll(struct usb2_bus *bus); -static void ehci_root_ctrl_poll(ehci_softc_t *sc); static void ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error); static uint8_t ehci_check_transfer(struct usb2_xfer *xfer); static void ehci_timeout(void *arg); - -static usb2_sw_transfer_func_t ehci_root_intr_done; -static usb2_sw_transfer_func_t ehci_root_ctrl_done; +static void ehci_root_intr(ehci_softc_t *sc); struct ehci_std_temp { ehci_softc_t *sc; @@ -1415,8 +1410,7 @@ ehci_pcd_enable(ehci_softc_t *sc) /* acknowledge any PCD interrupt */ EOWRITE4(sc, EHCI_USBSTS, EHCI_STS_PCD); - usb2_sw_transfer(&sc->sc_root_intr, - &ehci_root_intr_done); + ehci_root_intr(sc); } static void @@ -1486,8 +1480,7 @@ ehci_interrupt(ehci_softc_t *sc) sc->sc_eintrs &= ~EHCI_STS_PCD; EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); - usb2_sw_transfer(&sc->sc_root_intr, - &ehci_root_intr_done); + ehci_root_intr(sc); /* do not allow RHSC interrupts > 1 per second */ usb2_callout_reset(&sc->sc_tmo_pcd, hz, @@ -1531,7 +1524,6 @@ ehci_do_poll(struct usb2_bus *bus) USB_BUS_LOCK(&sc->sc_bus); ehci_interrupt_poll(sc); - ehci_root_ctrl_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1979,28 +1971,15 @@ ehci_setup_standard_chain(struct usb2_xf } static void -ehci_root_intr_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) +ehci_root_intr(ehci_softc_t *sc) { - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint16_t i; uint16_t m; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_PRE_DATA) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - ehci_device_done(xfer, std->err); - } - goto done; - } - /* setup buffer */ - std->ptr = sc->sc_hub_idata; - std->len = sizeof(sc->sc_hub_idata); - /* clear any old interrupt data */ - bzero(sc->sc_hub_idata, sizeof(sc->sc_hub_idata)); + memset(sc->sc_hub_idata, 0, sizeof(sc->sc_hub_idata)); /* set bits */ m = (sc->sc_noport + 1); @@ -2014,8 +1993,8 @@ ehci_root_intr_done(struct usb2_xfer *xf DPRINTF("port %d changed\n", i); } } -done: - return; + uhub_root_intr(&sc->sc_bus, sc->sc_hub_idata, + sizeof(sc->sc_hub_idata)); } static void @@ -2932,31 +2911,9 @@ struct usb2_pipe_methods ehci_device_iso /*------------------------------------------------------------------------* * ehci root control support *------------------------------------------------------------------------* - * simulate a hardware hub by handling - * all the necessary requests + * Simulate a hardware hub by handling all the necessary requests. *------------------------------------------------------------------------*/ -static void -ehci_root_ctrl_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -ehci_root_ctrl_close(struct usb2_xfer *xfer) -{ - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_ctrl.xfer == xfer) { - sc->sc_root_ctrl.xfer = NULL; - } - ehci_device_done(xfer, USB_ERR_CANCELLED); -} - -/* data structures and routines - * to emulate the root hub: - */ - static const struct usb2_device_descriptor ehci_devd = { @@ -2997,7 +2954,6 @@ static const struct ehci_config_desc ehc .bmAttributes = UC_SELF_POWERED, .bMaxPower = 0 /* max power */ }, - .ifcd = { .bLength = sizeof(struct usb2_interface_descriptor), .bDescriptorType = UDESC_INTERFACE, @@ -3007,7 +2963,6 @@ static const struct ehci_config_desc ehc .bInterfaceProtocol = UIPROTO_HSHUBSTT, 0 }, - .endpd = { .bLength = sizeof(struct usb2_endpoint_descriptor), .bDescriptorType = UDESC_ENDPOINT, @@ -3044,34 +2999,10 @@ ehci_disown(ehci_softc_t *sc, uint16_t i } static void -ehci_root_ctrl_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -ehci_root_ctrl_start(struct usb2_xfer *xfer) -{ - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - - DPRINTF("\n"); - - sc->sc_root_ctrl.xfer = xfer; - - usb2_bus_roothub_exec(xfer->xroot->bus); -} - -static void -ehci_root_ctrl_task(struct usb2_bus *bus) -{ - ehci_root_ctrl_poll(EHCI_BUS2SC(bus)); -} - -static void -ehci_root_ctrl_done(struct usb2_xfer *xfer, - struct usb2_sw_transfer *std) +ehci_roothub_exec(struct usb2_bus *bus) { - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); + ehci_softc_t *sc = EHCI_BUS2SC(bus); + struct usb2_sw_transfer *std = &sc->sc_bus.roothub_req; char *ptr; uint32_t port; uint32_t v; @@ -3082,13 +3013,6 @@ ehci_root_ctrl_done(struct usb2_xfer *xf USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); - if (std->state != USB_SW_TR_SETUP) { - if (std->state == USB_SW_TR_PRE_CALLBACK) { - /* transfer transferred */ - ehci_device_done(xfer, std->err); - } - goto done; - } /* buffer reset */ std->ptr = sc->sc_hub_desc.temp; std->len = 0; @@ -3462,67 +3386,6 @@ done: } static void -ehci_root_ctrl_poll(ehci_softc_t *sc) -{ - usb2_sw_transfer(&sc->sc_root_ctrl, - &ehci_root_ctrl_done); -} - -struct usb2_pipe_methods ehci_root_ctrl_methods = -{ - .open = ehci_root_ctrl_open, - .close = ehci_root_ctrl_close, - .enter = ehci_root_ctrl_enter, - .start = ehci_root_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 0, -}; - -/*------------------------------------------------------------------------* - * ehci root interrupt support - *------------------------------------------------------------------------*/ -static void -ehci_root_intr_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -ehci_root_intr_close(struct usb2_xfer *xfer) -{ - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - - if (sc->sc_root_intr.xfer == xfer) { - sc->sc_root_intr.xfer = NULL; - } - ehci_device_done(xfer, USB_ERR_CANCELLED); -} - -static void -ehci_root_intr_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -ehci_root_intr_start(struct usb2_xfer *xfer) -{ - ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - - sc->sc_root_intr.xfer = xfer; -} - -struct usb2_pipe_methods ehci_root_intr_methods = -{ - .open = ehci_root_intr_open, - .close = ehci_root_intr_close, - .enter = ehci_root_intr_enter, - .start = ehci_root_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, -}; - -static void ehci_xfer_setup(struct usb2_setup_params *parm) { struct usb2_page_search page_info; @@ -3794,19 +3657,8 @@ ehci_pipe_init(struct usb2_device *udev, /* not supported */ return; } - if (udev->device_index == sc->sc_addr) { - switch (edesc->bEndpointAddress) { - case USB_CONTROL_ENDPOINT: - pipe->methods = &ehci_root_ctrl_methods; - break; - case UE_DIR_IN | EHCI_INTR_ENDPT: - pipe->methods = &ehci_root_intr_methods; - break; - default: - /* do nothing */ - break; - } - } else { + if (udev->device_index != sc->sc_addr) { + if ((udev->speed != USB_SPEED_HIGH) && ((udev->hs_hub_addr == 0) || (udev->hs_port_no == 0) || @@ -3964,5 +3816,5 @@ struct usb2_bus_methods ehci_bus_methods .device_resume = ehci_device_resume, .device_suspend = ehci_device_suspend, .set_hw_power = ehci_set_hw_power, - .roothub_exec = ehci_root_ctrl_task, + .roothub_exec = ehci_roothub_exec, }; Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/ehci.h Sun Apr 5 18:20:49 2009 (r190735) @@ -457,8 +457,6 @@ typedef struct ehci_softc { struct usb2_bus sc_bus; /* base device */ struct usb2_callout sc_tmo_pcd; union ehci_hub_desc sc_hub_desc; - struct usb2_sw_transfer sc_root_ctrl; - struct usb2_sw_transfer sc_root_intr; struct usb2_device *sc_devices[EHCI_MAX_DEVICES]; struct resource *sc_io_res; Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:20:38 2009 (r190734) +++ head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:20:49 2009 (r190735) @@ -80,8 +80,6 @@ struct usb2_pipe_methods musbotg_device_ struct usb2_pipe_methods musbotg_device_ctrl_methods; struct usb2_pipe_methods musbotg_device_intr_methods; struct usb2_pipe_methods musbotg_device_isoc_methods; -struct usb2_pipe_methods musbotg_root_ctrl_methods; -struct usb2_pipe_methods musbotg_root_intr_methods; static musbotg_cmd_t musbotg_setup_rx; static musbotg_cmd_t musbotg_setup_data_rx; @@ -91,12 +89,9 @@ static musbotg_cmd_t musbotg_data_rx; static musbotg_cmd_t musbotg_data_tx; static void musbotg_device_done(struct usb2_xfer *, usb2_error_t); static void musbotg_do_poll(struct usb2_bus *); -static void musbotg_root_ctrl_poll(struct musbotg_softc *); static void musbotg_standard_done(struct usb2_xfer *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A29A810659A2; Sun, 5 Apr 2009 18:21:00 +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 BED3D8FC1F; Sun, 5 Apr 2009 18:20:58 +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 n35IKweV028023; Sun, 5 Apr 2009 18:20:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKw12028022; Sun, 5 Apr 2009 18:20:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKw12028022@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190736 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:02 -0000 Author: thompsa Date: Sun Apr 5 18:20:58 2009 New Revision: 190736 URL: http://svn.freebsd.org/changeset/base/190736 Log: MFp4 //depot/projects/usb@159925 Cast variables properly for non-32-bit platforms. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_endian.h Modified: head/sys/dev/usb/usb_endian.h ============================================================================== --- head/sys/dev/usb/usb_endian.h Sun Apr 5 18:20:49 2009 (r190735) +++ head/sys/dev/usb/usb_endian.h Sun Apr 5 18:20:58 2009 (r190736) @@ -48,19 +48,19 @@ typedef uint8_t uQWord[8]; #define UGETW(w) \ ((w)[0] | \ - ((w)[1] << 8)) + (((uint16_t)((w)[1])) << 8)) #define UGETDW(w) \ ((w)[0] | \ - ((w)[1] << 8) | \ - ((w)[2] << 16) | \ - ((w)[3] << 24)) + (((uint16_t)((w)[1])) << 8) | \ + (((uint32_t)((w)[2])) << 16) | \ + (((uint32_t)((w)[3])) << 24)) #define UGETQW(w) \ ((w)[0] | \ - ((w)[1] << 8) | \ - ((w)[2] << 16) | \ - ((w)[3] << 24) | \ + (((uint16_t)((w)[1])) << 8) | \ + (((uint32_t)((w)[2])) << 16) | \ + (((uint32_t)((w)[3])) << 24) | \ (((uint64_t)((w)[4])) << 32) | \ (((uint64_t)((w)[5])) << 40) | \ (((uint64_t)((w)[6])) << 48) | \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A2011065AF6; Sun, 5 Apr 2009 18:21:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 080728FC34; Sun, 5 Apr 2009 18:21:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IL8AI028066; Sun, 5 Apr 2009 18:21:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IL8UP028065; Sun, 5 Apr 2009 18:21:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051821.n35IL8UP028065@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190737 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:12 -0000 Author: thompsa Date: Sun Apr 5 18:21:08 2009 New Revision: 190737 URL: http://svn.freebsd.org/changeset/base/190737 Log: MFp4 //depot/projects/usb@159926 Minor code factorisation in atmegadci.c Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/atmegadci.c Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:20:58 2009 (r190736) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:21:08 2009 (r190737) @@ -77,9 +77,7 @@ SYSCTL_INT(_hw_usb2_atmegadci, OID_AUTO, /* prototypes */ struct usb2_bus_methods atmegadci_bus_methods; -struct usb2_pipe_methods atmegadci_device_bulk_methods; -struct usb2_pipe_methods atmegadci_device_ctrl_methods; -struct usb2_pipe_methods atmegadci_device_intr_methods; +struct usb2_pipe_methods atmegadci_device_non_isoc_methods; struct usb2_pipe_methods atmegadci_device_isoc_fs_methods; static atmegadci_cmd_t atmegadci_setup_rx; @@ -1343,117 +1341,41 @@ atmegadci_do_poll(struct usb2_bus *bus) /*------------------------------------------------------------------------* * at91dci bulk support - *------------------------------------------------------------------------*/ -static void -atmegadci_device_bulk_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_device_bulk_close(struct usb2_xfer *xfer) -{ - atmegadci_device_done(xfer, USB_ERR_CANCELLED); -} - -static void -atmegadci_device_bulk_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_device_bulk_start(struct usb2_xfer *xfer) -{ - /* setup TDs */ - atmegadci_setup_standard_chain(xfer); - atmegadci_start_standard_chain(xfer); -} - -struct usb2_pipe_methods atmegadci_device_bulk_methods = -{ - .open = atmegadci_device_bulk_open, - .close = atmegadci_device_bulk_close, - .enter = atmegadci_device_bulk_enter, - .start = atmegadci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, -}; - -/*------------------------------------------------------------------------* * at91dci control support - *------------------------------------------------------------------------*/ -static void -atmegadci_device_ctrl_open(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_device_ctrl_close(struct usb2_xfer *xfer) -{ - atmegadci_device_done(xfer, USB_ERR_CANCELLED); -} - -static void -atmegadci_device_ctrl_enter(struct usb2_xfer *xfer) -{ - return; -} - -static void -atmegadci_device_ctrl_start(struct usb2_xfer *xfer) -{ - /* setup TDs */ - atmegadci_setup_standard_chain(xfer); - atmegadci_start_standard_chain(xfer); -} - -struct usb2_pipe_methods atmegadci_device_ctrl_methods = -{ - .open = atmegadci_device_ctrl_open, - .close = atmegadci_device_ctrl_close, - .enter = atmegadci_device_ctrl_enter, - .start = atmegadci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, -}; - -/*------------------------------------------------------------------------* * at91dci interrupt support *------------------------------------------------------------------------*/ static void -atmegadci_device_intr_open(struct usb2_xfer *xfer) +atmegadci_device_non_isoc_open(struct usb2_xfer *xfer) { return; } static void -atmegadci_device_intr_close(struct usb2_xfer *xfer) +atmegadci_device_non_isoc_close(struct usb2_xfer *xfer) { atmegadci_device_done(xfer, USB_ERR_CANCELLED); } static void -atmegadci_device_intr_enter(struct usb2_xfer *xfer) +atmegadci_device_non_isoc_enter(struct usb2_xfer *xfer) { return; } static void -atmegadci_device_intr_start(struct usb2_xfer *xfer) +atmegadci_device_non_isoc_start(struct usb2_xfer *xfer) { /* setup TDs */ atmegadci_setup_standard_chain(xfer); atmegadci_start_standard_chain(xfer); } -struct usb2_pipe_methods atmegadci_device_intr_methods = +struct usb2_pipe_methods atmegadci_device_non_isoc_methods = { - .open = atmegadci_device_intr_open, - .close = atmegadci_device_intr_close, - .enter = atmegadci_device_intr_enter, - .start = atmegadci_device_intr_start, + .open = atmegadci_device_non_isoc_open, + .close = atmegadci_device_non_isoc_close, + .enter = atmegadci_device_non_isoc_enter, + .start = atmegadci_device_non_isoc_start, .enter_is_cancelable = 1, .start_is_cancelable = 1, }; @@ -1552,10 +1474,6 @@ struct usb2_pipe_methods atmegadci_devic * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ -/* - * USB descriptors for the virtual Root HUB: - */ - static const struct usb2_device_descriptor atmegadci_devd = { .bLength = sizeof(struct usb2_device_descriptor), .bDescriptorType = UDESC_DEVICE, @@ -2083,34 +2001,21 @@ atmegadci_xfer_setup(struct usb2_setup_p /* * compute maximum number of TDs */ - if (parm->methods == &atmegadci_device_ctrl_methods) { + if ((xfer->pipe->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { - ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; - - } else if (parm->methods == &atmegadci_device_bulk_methods) { - - ntd = xfer->nframes + 1 /* SYNC */ ; - - } else if (parm->methods == &atmegadci_device_intr_methods) { - - ntd = xfer->nframes + 1 /* SYNC */ ; - - } else if (parm->methods == &atmegadci_device_isoc_fs_methods) { - - ntd = xfer->nframes + 1 /* SYNC */ ; - } else { - ntd = 0; + ntd = xfer->nframes + 1 /* SYNC */ ; } /* * check if "usb2_transfer_setup_sub" set an error */ - if (parm->err) { + if (parm->err) return; - } + /* * allocate transfer descriptors */ @@ -2119,19 +2024,13 @@ atmegadci_xfer_setup(struct usb2_setup_p /* * get profile stuff */ - if (ntd) { + ep_no = xfer->endpoint & UE_ADDR; + atmegadci_get_hw_ep_profile(parm->udev, &pf, ep_no); - ep_no = xfer->endpoint & UE_ADDR; - atmegadci_get_hw_ep_profile(parm->udev, &pf, ep_no); - - if (pf == NULL) { - /* should not happen */ - parm->err = USB_ERR_INVAL; - return; - } - } else { - ep_no = 0; - pf = NULL; + if (pf == NULL) { + /* should not happen */ + parm->err = USB_ERR_INVAL; + return; } /* align data */ @@ -2188,23 +2087,10 @@ atmegadci_pipe_init(struct usb2_device * /* not supported */ return; } - switch (edesc->bmAttributes & UE_XFERTYPE) { - case UE_CONTROL: - pipe->methods = &atmegadci_device_ctrl_methods; - break; - case UE_INTERRUPT: - pipe->methods = &atmegadci_device_intr_methods; - break; - case UE_ISOCHRONOUS: + if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) pipe->methods = &atmegadci_device_isoc_fs_methods; - break; - case UE_BULK: - pipe->methods = &atmegadci_device_bulk_methods; - break; - default: - /* do nothing */ - break; - } + else + pipe->methods = &atmegadci_device_non_isoc_methods; } } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 384531065A3E; Sun, 5 Apr 2009 18:21:22 +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 23A278FC2B; Sun, 5 Apr 2009 18:21:22 +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 n35ILM3X028117; Sun, 5 Apr 2009 18:21:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35ILLK3028108; Sun, 5 Apr 2009 18:21:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051821.n35ILLK3028108@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190738 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:24 -0000 Author: thompsa Date: Sun Apr 5 18:21:21 2009 New Revision: 190738 URL: http://svn.freebsd.org/changeset/base/190738 Log: MFp4 //depot/projects/usb@159946 Some cancelable flags are always true. Substitute these away. These cancelable flags were mostly useful with the root HUB which is now handled differently. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/at91dci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1499,8 +1499,6 @@ struct usb2_pipe_methods at91dci_device_ .close = at91dci_device_bulk_close, .enter = at91dci_device_bulk_enter, .start = at91dci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1538,8 +1536,6 @@ struct usb2_pipe_methods at91dci_device_ .close = at91dci_device_ctrl_close, .enter = at91dci_device_ctrl_enter, .start = at91dci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1577,8 +1573,6 @@ struct usb2_pipe_methods at91dci_device_ .close = at91dci_device_intr_close, .enter = at91dci_device_intr_enter, .start = at91dci_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1661,8 +1655,6 @@ struct usb2_pipe_methods at91dci_device_ .close = at91dci_device_isoc_fs_close, .enter = at91dci_device_isoc_fs_enter, .start = at91dci_device_isoc_fs_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1376,8 +1376,6 @@ struct usb2_pipe_methods atmegadci_devic .close = atmegadci_device_non_isoc_close, .enter = atmegadci_device_non_isoc_enter, .start = atmegadci_device_non_isoc_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1464,8 +1462,6 @@ struct usb2_pipe_methods atmegadci_devic .close = atmegadci_device_isoc_fs_close, .enter = atmegadci_device_isoc_fs_enter, .start = atmegadci_device_isoc_fs_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/ehci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -2210,8 +2210,6 @@ struct usb2_pipe_methods ehci_device_bul .close = ehci_device_bulk_close, .enter = ehci_device_bulk_enter, .start = ehci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2253,8 +2251,6 @@ struct usb2_pipe_methods ehci_device_ctr .close = ehci_device_ctrl_close, .enter = ehci_device_ctrl_enter, .start = ehci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2351,8 +2347,6 @@ struct usb2_pipe_methods ehci_device_int .close = ehci_device_intr_close, .enter = ehci_device_intr_enter, .start = ehci_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2636,8 +2630,6 @@ struct usb2_pipe_methods ehci_device_iso .close = ehci_device_isoc_fs_close, .enter = ehci_device_isoc_fs_enter, .start = ehci_device_isoc_fs_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2904,8 +2896,6 @@ struct usb2_pipe_methods ehci_device_iso .close = ehci_device_isoc_hs_close, .enter = ehci_device_isoc_hs_enter, .start = ehci_device_isoc_hs_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1899,8 +1899,6 @@ struct usb2_pipe_methods musbotg_device_ .close = musbotg_device_bulk_close, .enter = musbotg_device_bulk_enter, .start = musbotg_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1938,8 +1936,6 @@ struct usb2_pipe_methods musbotg_device_ .close = musbotg_device_ctrl_close, .enter = musbotg_device_ctrl_enter, .start = musbotg_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1977,8 +1973,6 @@ struct usb2_pipe_methods musbotg_device_ .close = musbotg_device_intr_close, .enter = musbotg_device_intr_enter, .start = musbotg_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2068,8 +2062,6 @@ struct usb2_pipe_methods musbotg_device_ .close = musbotg_device_isoc_close, .enter = musbotg_device_isoc_enter, .start = musbotg_device_isoc_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/ohci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1720,8 +1720,6 @@ struct usb2_pipe_methods ohci_device_bul .close = ohci_device_bulk_close, .enter = ohci_device_bulk_enter, .start = ohci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1763,8 +1761,6 @@ struct usb2_pipe_methods ohci_device_ctr .close = ohci_device_ctrl_close, .enter = ohci_device_ctrl_enter, .start = ohci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1837,8 +1833,6 @@ struct usb2_pipe_methods ohci_device_int .close = ohci_device_intr_close, .enter = ohci_device_intr_enter, .start = ohci_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2047,8 +2041,6 @@ struct usb2_pipe_methods ohci_device_iso .close = ohci_device_isoc_close, .enter = ohci_device_isoc_enter, .start = ohci_device_isoc_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/uhci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1940,8 +1940,6 @@ struct usb2_pipe_methods uhci_device_bul .close = uhci_device_bulk_close, .enter = uhci_device_bulk_enter, .start = uhci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2004,8 +2002,6 @@ struct usb2_pipe_methods uhci_device_ctr .close = uhci_device_ctrl_close, .enter = uhci_device_ctrl_enter, .start = uhci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2095,8 +2091,6 @@ struct usb2_pipe_methods uhci_device_int .close = uhci_device_intr_close, .enter = uhci_device_intr_enter, .start = uhci_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -2305,8 +2299,6 @@ struct usb2_pipe_methods uhci_device_iso .close = uhci_device_isoc_close, .enter = uhci_device_isoc_enter, .start = uhci_device_isoc_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1542,8 +1542,6 @@ struct usb2_pipe_methods uss820dci_devic .close = uss820dci_device_bulk_close, .enter = uss820dci_device_bulk_enter, .start = uss820dci_device_bulk_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1581,8 +1579,6 @@ struct usb2_pipe_methods uss820dci_devic .close = uss820dci_device_ctrl_close, .enter = uss820dci_device_ctrl_enter, .start = uss820dci_device_ctrl_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1620,8 +1616,6 @@ struct usb2_pipe_methods uss820dci_devic .close = uss820dci_device_intr_close, .enter = uss820dci_device_intr_enter, .start = uss820dci_device_intr_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* @@ -1704,8 +1698,6 @@ struct usb2_pipe_methods uss820dci_devic .close = uss820dci_device_isoc_fs_close, .enter = uss820dci_device_isoc_fs_enter, .start = uss820dci_device_isoc_fs_start, - .enter_is_cancelable = 1, - .start_is_cancelable = 1, }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/usb_controller.h Sun Apr 5 18:21:21 2009 (r190738) @@ -108,20 +108,15 @@ struct usb2_pipe_methods { /* Mandatory USB Device and Host mode callbacks: */ - void (*open) (struct usb2_xfer *xfer); - void (*close) (struct usb2_xfer *xfer); + usb2_callback_t *open; + usb2_callback_t *close; - void (*enter) (struct usb2_xfer *xfer); - void (*start) (struct usb2_xfer *xfer); + usb2_callback_t *enter; + usb2_callback_t *start; /* Optional */ void *info; - - /* Flags */ - - uint8_t enter_is_cancelable:1; - uint8_t start_is_cancelable:1; }; /* Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sun Apr 5 18:21:08 2009 (r190737) +++ head/sys/dev/usb/usb_transfer.c Sun Apr 5 18:21:21 2009 (r190738) @@ -1541,18 +1541,14 @@ usb2_pipe_enter(struct usb2_xfer *xfer) /* enter the transfer */ (pipe->methods->enter) (xfer); - /* check cancelability */ - if (pipe->methods->enter_is_cancelable) { - xfer->flags_int.can_cancel_immed = 1; - /* check for transfer error */ - if (xfer->error) { - /* some error has happened */ - usb2_transfer_done(xfer, 0); - USB_BUS_UNLOCK(xfer->xroot->bus); - return; - } - } else { - xfer->flags_int.can_cancel_immed = 0; + xfer->flags_int.can_cancel_immed = 1; + + /* check for transfer error */ + if (xfer->error) { + /* some error has happened */ + usb2_transfer_done(xfer, 0); + USB_BUS_UNLOCK(xfer->xroot->bus); + return; } /* start the transfer */ @@ -1866,8 +1862,8 @@ usb2_callback_wrapper(struct usb2_xfer_q struct usb2_xfer *xfer = pq->curr; struct usb2_xfer_root *info = xfer->xroot; - USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); - if (!mtx_owned(xfer->xroot->xfer_mtx)) { + USB_BUS_LOCK_ASSERT(info->bus, MA_OWNED); + if (!mtx_owned(info->xfer_mtx)) { /* * Cases that end up here: * @@ -1898,22 +1894,22 @@ usb2_callback_wrapper(struct usb2_xfer_q /* get next USB transfer in the queue */ info->done_q.curr = NULL; - USB_BUS_UNLOCK(xfer->xroot->bus); - USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_NOTOWNED); + USB_BUS_UNLOCK(info->bus); + USB_BUS_LOCK_ASSERT(info->bus, MA_NOTOWNED); /* set correct USB state for callback */ if (!xfer->flags_int.transferring) { xfer->usb2_state = USB_ST_SETUP; if (!xfer->flags_int.started) { /* we got stopped before we even got started */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(info->bus); goto done; } } else { if (usb2_callback_wrapper_sub(xfer)) { /* the callback has been deferred */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(info->bus); goto done; } #if USB_HAVE_POWERD @@ -1941,7 +1937,7 @@ usb2_callback_wrapper(struct usb2_xfer_q (xfer->callback) (xfer); /* pickup the USB mutex again */ - USB_BUS_LOCK(xfer->xroot->bus); + USB_BUS_LOCK(info->bus); /* * Check if we got started after that we got cancelled, but @@ -1963,7 +1959,7 @@ done: (!xfer->flags_int.transferring)) { /* "usb2_transfer_drain()" is waiting for end of transfer */ xfer->flags_int.draining = 0; - usb2_cv_broadcast(&xfer->xroot->cv_drain); + usb2_cv_broadcast(&info->cv_drain); } /* do the next callback, if any */ @@ -2122,15 +2118,12 @@ usb2_transfer_start_cb(void *arg) /* start the transfer */ (pipe->methods->start) (xfer); - /* check cancelability */ - if (pipe->methods->start_is_cancelable) { - xfer->flags_int.can_cancel_immed = 1; - if (xfer->error) { - /* some error has happened */ - usb2_transfer_done(xfer, 0); - } - } else { - xfer->flags_int.can_cancel_immed = 0; + xfer->flags_int.can_cancel_immed = 1; + + /* check for error */ + if (xfer->error) { + /* some error has happened */ + usb2_transfer_done(xfer, 0); } } @@ -2276,15 +2269,12 @@ usb2_pipe_start(struct usb2_xfer_queue * /* start USB transfer */ (pipe->methods->start) (xfer); - /* check cancelability */ - if (pipe->methods->start_is_cancelable) { - xfer->flags_int.can_cancel_immed = 1; - if (xfer->error) { - /* some error has happened */ - usb2_transfer_done(xfer, 0); - } - } else { - xfer->flags_int.can_cancel_immed = 0; + xfer->flags_int.can_cancel_immed = 1; + + /* check for error */ + if (xfer->error) { + /* some error has happened */ + usb2_transfer_done(xfer, 0); } } From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80DDF1065A78; Sun, 5 Apr 2009 18:21: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 62E938FC25; Sun, 5 Apr 2009 18:21: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 n35ILVgZ028159; Sun, 5 Apr 2009 18:21:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35ILVDp028157; Sun, 5 Apr 2009 18:21:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051821.n35ILVDp028157@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:21: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: r190739 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:33 -0000 Author: thompsa Date: Sun Apr 5 18:21:31 2009 New Revision: 190739 URL: http://svn.freebsd.org/changeset/base/190739 Log: MFp4 //depot/projects/usb@159948 Add more debugging output on enumeration failures. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:21:21 2009 (r190738) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:21:31 2009 (r190739) @@ -1505,10 +1505,6 @@ usb2_alloc_device(device_t parent_dev, s udev->speed = speed; udev->flags.usb2_mode = usb2_mode; - /* speed combination should be checked by the parent HUB */ - - hub = udev->parent_hub; - /* search for our High Speed USB HUB, if any */ adev = udev; @@ -1564,7 +1560,8 @@ usb2_alloc_device(device_t parent_dev, s */ if (err) { DPRINTFN(0, "set address %d failed " - "(ignored)\n", udev->address); + "(%s, ignored)\n", udev->address, + usb2_errstr(err)); } /* allow device time to set new address */ usb2_pause_mtx(NULL, @@ -1600,7 +1597,8 @@ usb2_alloc_device(device_t parent_dev, s USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " - "at addr %d failed!\n", udev->address); + "at addr %d failed, %s!\n", udev->address, + usb2_errstr(err)); /* XXX try to re-enumerate the device */ err = usb2_req_re_enumerate(udev, NULL); if (err) { Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Sun Apr 5 18:21:21 2009 (r190738) +++ head/sys/dev/usb/usb_request.c Sun Apr 5 18:21:31 2009 (r190739) @@ -1487,7 +1487,8 @@ usb2_req_re_enumerate(struct usb2_device retry: err = usb2_req_reset_port(parent_hub, mtx, udev->port_no); if (err) { - DPRINTFN(0, "addr=%d, port reset failed\n", old_addr); + DPRINTFN(0, "addr=%d, port reset failed, %s\n", + old_addr, usb2_errstr(err)); goto done; } /* @@ -1505,8 +1506,8 @@ retry: err = usb2_req_set_address(udev, mtx, old_addr); if (err) { /* XXX ignore any errors! */ - DPRINTFN(0, "addr=%d, set address failed! (ignored)\n", - old_addr); + DPRINTFN(0, "addr=%d, set address failed! (%s, ignored)\n", + old_addr, usb2_errstr(err)); } /* restore device address */ udev->address = old_addr; @@ -1519,14 +1520,16 @@ retry: USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " - "at addr %d failed!\n", udev->address); + "at addr %d failed, %s!\n", udev->address, + usb2_errstr(err)); goto done; } /* get the full device descriptor */ err = usb2_req_get_device_desc(udev, mtx, &udev->ddesc); if (err) { DPRINTFN(0, "addr=%d, getting device " - "descriptor failed!\n", old_addr); + "descriptor failed, %s!\n", old_addr, + usb2_errstr(err)); goto done; } done: From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD441065B53; Sun, 5 Apr 2009 18:21:40 +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 D3BDA8FC2B; Sun, 5 Apr 2009 18:21:40 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35ILeRO028198; Sun, 5 Apr 2009 18:21:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35ILeig028197; Sun, 5 Apr 2009 18:21:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051821.n35ILeig028197@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190740 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:41 -0000 Author: thompsa Date: Sun Apr 5 18:21:40 2009 New Revision: 190740 URL: http://svn.freebsd.org/changeset/base/190740 Log: MFp4 //depot/projects/usb@159992 at91_udp.c does not exist anymore, it is now replaced by at91dci in src/sys/dev/usb/controller. Also remove the ohci_atmelarm.c because it is also included in src/sys/conf/files Submitted by: Sylvestre Gallon Modified: head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Sun Apr 5 18:21:31 2009 (r190739) +++ head/sys/arm/at91/files.at91 Sun Apr 5 18:21:40 2009 (r190740) @@ -13,12 +13,10 @@ arm/at91/at91_spi.c optional at91_spi dependency "spibus_if.h" arm/at91/at91_tc.c optional at91_tc arm/at91/at91_twi.c optional at91_twi -arm/at91/at91_udp.c optional at91_udp arm/at91/if_ate.c optional ate arm/at91/uart_bus_at91usart.c optional uart arm/at91/uart_cpu_at91rm9200usart.c optional uart arm/at91/uart_dev_at91usart.c optional uart -dev/usb/controller/ohci_atmelarm.c optional ohci # # All the boards we support # From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:21:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7981310657FF; Sun, 5 Apr 2009 18:21:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63C7F8FC12; Sun, 5 Apr 2009 18:21:51 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35ILpiY028240; Sun, 5 Apr 2009 18:21:51 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35ILpOj028237; Sun, 5 Apr 2009 18:21:51 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051821.n35ILpOj028237@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:21: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: r190741 - in head/sys/dev/usb: . input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:21:53 -0000 Author: thompsa Date: Sun Apr 5 18:21:51 2009 New Revision: 190741 URL: http://svn.freebsd.org/changeset/base/190741 Log: MFp4 //depot/projects/usb@159995 - add support for more complicated HID descriptors which can have multiple definitions of the same field. - remove old modulo patch in ums, which I think is due to bad HID parsing, which should be fixed now. Reported by: netchild Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/input/ums.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hid.h Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Sun Apr 5 18:21:40 2009 (r190740) +++ head/sys/dev/usb/input/ums.c Sun Apr 5 18:21:51 2009 (r190741) @@ -84,27 +84,20 @@ SYSCTL_INT(_hw_usb2_ums, OID_AUTO, debug #define UMS_IFQ_MAXLEN 50 /* units */ #define UMS_BUTTON_MAX 31 /* exclusive, must be less than 32 */ #define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i)) +#define UMS_INFO_MAX 2 /* maximum number of HID sets */ enum { UMS_INTR_DT, UMS_N_TRANSFER, }; -struct ums_softc { - struct usb2_fifo_sc sc_fifo; - struct mtx sc_mtx; - struct usb2_callout sc_callout; +struct ums_info { struct hid_location sc_loc_w; struct hid_location sc_loc_x; struct hid_location sc_loc_y; struct hid_location sc_loc_z; struct hid_location sc_loc_t; struct hid_location sc_loc_btn[UMS_BUTTON_MAX]; - mousehw_t sc_hw; - mousemode_t sc_mode; - mousestatus_t sc_status; - - struct usb2_xfer *sc_xfer[UMS_N_TRANSFER]; uint32_t sc_flags; #define UMS_FLAG_X_AXIS 0x0001 @@ -115,14 +108,29 @@ struct ums_softc { #define UMS_FLAG_REVZ 0x0020 /* Z-axis is reversed */ #define UMS_FLAG_W_AXIS 0x0040 - uint8_t sc_buttons; - uint8_t sc_iid; uint8_t sc_iid_w; uint8_t sc_iid_x; uint8_t sc_iid_y; uint8_t sc_iid_z; uint8_t sc_iid_t; uint8_t sc_iid_btn[UMS_BUTTON_MAX]; + uint8_t sc_buttons; +}; + +struct ums_softc { + struct usb2_fifo_sc sc_fifo; + struct mtx sc_mtx; + struct usb2_callout sc_callout; + struct ums_info sc_info[UMS_INFO_MAX]; + + mousehw_t sc_hw; + mousemode_t sc_mode; + mousestatus_t sc_status; + + struct usb2_xfer *sc_xfer[UMS_N_TRANSFER]; + + uint8_t sc_buttons; + uint8_t sc_iid; uint8_t sc_temp[64]; }; @@ -165,14 +173,15 @@ static void ums_intr_callback(struct usb2_xfer *xfer) { struct ums_softc *sc = xfer->priv_sc; + struct ums_info *info = &sc->sc_info[0]; uint8_t *buf = sc->sc_temp; uint16_t len = xfer->actlen; int32_t buttons = 0; - int32_t dw; - int32_t dx; - int32_t dy; - int32_t dz; - int32_t dt; + int32_t dw = 0; + int32_t dx = 0; + int32_t dy = 0; + int32_t dz = 0; + int32_t dt = 0; uint8_t i; uint8_t id; @@ -205,49 +214,50 @@ ums_intr_callback(struct usb2_xfer *xfer } else { id = 0; - if (sc->sc_flags & UMS_FLAG_SBU) { + if (sc->sc_info[0].sc_flags & UMS_FLAG_SBU) { if ((*buf == 0x14) || (*buf == 0x15)) { goto tr_setup; } } } - if ((sc->sc_flags & UMS_FLAG_W_AXIS) && (id == sc->sc_iid_w)) - dw = hid_get_data(buf, len, &sc->sc_loc_w); - else - dw = 0; - - if ((sc->sc_flags & UMS_FLAG_X_AXIS) && (id == sc->sc_iid_x)) - dx = hid_get_data(buf, len, &sc->sc_loc_x); - else - dx = 0; - - if ((sc->sc_flags & UMS_FLAG_Y_AXIS) && (id == sc->sc_iid_y)) - dy = -hid_get_data(buf, len, &sc->sc_loc_y); - else - dy = 0; - - if ((sc->sc_flags & UMS_FLAG_Z_AXIS) && (id == sc->sc_iid_z)) - dz = -hid_get_data(buf, len, &sc->sc_loc_z); - else - dz = 0; - - if (sc->sc_flags & UMS_FLAG_REVZ) - dz = -dz; - - if ((sc->sc_flags & UMS_FLAG_T_AXIS) && (id == sc->sc_iid_t)) - dt = -hid_get_data(buf, len, &sc->sc_loc_t); - else - dt = 0; + repeat: + if ((info->sc_flags & UMS_FLAG_W_AXIS) && + (id == info->sc_iid_w)) + dw += hid_get_data(buf, len, &info->sc_loc_w); + + if ((info->sc_flags & UMS_FLAG_X_AXIS) && + (id == info->sc_iid_x)) + dx += hid_get_data(buf, len, &info->sc_loc_x); + + if ((info->sc_flags & UMS_FLAG_Y_AXIS) && + (id == info->sc_iid_y)) + dy = -hid_get_data(buf, len, &info->sc_loc_y); + + if ((info->sc_flags & UMS_FLAG_Z_AXIS) && + (id == info->sc_iid_z)) { + int32_t temp; + temp = hid_get_data(buf, len, &info->sc_loc_z); + if (info->sc_flags & UMS_FLAG_REVZ) + temp = -temp; + dz -= temp; + } + + if ((info->sc_flags & UMS_FLAG_T_AXIS) && + (id == info->sc_iid_t)) + dt -= hid_get_data(buf, len, &info->sc_loc_t); - for (i = 0; i < sc->sc_buttons; i++) { - if (id != sc->sc_iid_btn[i]) + for (i = 0; i < info->sc_buttons; i++) { + if (id != info->sc_iid_btn[i]) continue; - if (hid_get_data(buf, len, &sc->sc_loc_btn[i])) { + if (hid_get_data(buf, len, &info->sc_loc_btn[i])) { buttons |= (1 << UMS_BUT(i)); } } + if (++info != &sc->sc_info[UMS_INFO_MAX]) + goto repeat; + if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) { @@ -273,7 +283,7 @@ ums_intr_callback(struct usb2_xfer *xfer * to the queue. In any other case we delete * the timeout event. */ - if ((sc->sc_flags & UMS_FLAG_SBU) && + if ((sc->sc_info[0].sc_flags & UMS_FLAG_SBU) && (dx == 0) && (dy == 0) && (dz == 0) && (dt == 0) && (dw == 0) && (buttons == 0)) { @@ -357,89 +367,56 @@ ums_probe(device_t dev) return (error); } -static int -ums_attach(device_t dev) +static void +ums_hid_parse(struct ums_softc *sc, device_t dev, const uint8_t *buf, + uint16_t len, uint8_t index) { - struct usb2_attach_arg *uaa = device_get_ivars(dev); - struct ums_softc *sc = device_get_softc(dev); - void *d_ptr = NULL; - int unit = device_get_unit(dev); - int isize; - int isizebits; - int err; + struct ums_info *info = &sc->sc_info[index]; uint32_t flags; - uint16_t d_len; uint8_t i; - DPRINTFN(11, "sc=%p\n", sc); - - device_set_usb2_desc(dev); - - mtx_init(&sc->sc_mtx, "ums lock", NULL, MTX_DEF | MTX_RECURSE); - - usb2_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); - - /* - * Force the report (non-boot) protocol. - * - * Mice without boot protocol support may choose not to implement - * Set_Protocol at all; Ignore any error. - */ - err = usb2_req_set_protocol(uaa->device, NULL, uaa->info.bIfaceIndex, 1); - - err = usb2_transfer_setup(uaa->device, - &uaa->info.bIfaceIndex, sc->sc_xfer, ums_config, - UMS_N_TRANSFER, sc, &sc->sc_mtx); - - if (err) { - DPRINTF("error=%s\n", usb2_errstr(err)); - goto detach; - } - err = usb2_req_get_hid_desc(uaa->device, NULL, &d_ptr, - &d_len, M_TEMP, uaa->info.bIfaceIndex); - - if (err) { - device_printf(dev, "error reading report description\n"); - goto detach; - } - if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - hid_input, &sc->sc_loc_x, &flags, &sc->sc_iid_x)) { + if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), + hid_input, index, &info->sc_loc_x, &flags, &info->sc_iid_x)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_X_AXIS; + info->sc_flags |= UMS_FLAG_X_AXIS; } } - if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - hid_input, &sc->sc_loc_y, &flags, &sc->sc_iid_y)) { + if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), + hid_input, index, &info->sc_loc_y, &flags, &info->sc_iid_y)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_Y_AXIS; + info->sc_flags |= UMS_FLAG_Y_AXIS; } } /* Try the wheel first as the Z activator since it's tradition. */ - if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid_z) || - hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_TWHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid_z)) { + if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, + HUG_WHEEL), hid_input, index, &info->sc_loc_z, &flags, + &info->sc_iid_z) || + hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, + HUG_TWHEEL), hid_input, index, &info->sc_loc_z, &flags, + &info->sc_iid_z)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_Z_AXIS; + info->sc_flags |= UMS_FLAG_Z_AXIS; } /* * We might have both a wheel and Z direction, if so put * put the Z on the W coordinate. */ - if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_w, &flags, &sc->sc_iid_w)) { + if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, + HUG_Z), hid_input, index, &info->sc_loc_w, &flags, + &info->sc_iid_w)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_W_AXIS; + info->sc_flags |= UMS_FLAG_W_AXIS; } } - } else if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid_z)) { + } else if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, + HUG_Z), hid_input, index, &info->sc_loc_z, &flags, + &info->sc_iid_z)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_Z_AXIS; + info->sc_flags |= UMS_FLAG_Z_AXIS; } } /* @@ -449,25 +426,89 @@ ums_attach(device_t dev) * There are no other HID axis descriptors other than X,Y and * TWHEEL */ - if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_TWHEEL), - hid_input, &sc->sc_loc_t, &flags, &sc->sc_iid_t)) { + if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, + HUG_TWHEEL), hid_input, index, &info->sc_loc_t, + &flags, &info->sc_iid_t)) { - sc->sc_loc_t.pos += 8; + info->sc_loc_t.pos += 8; if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { - sc->sc_flags |= UMS_FLAG_T_AXIS; + info->sc_flags |= UMS_FLAG_T_AXIS; } } /* figure out the number of buttons */ for (i = 0; i < UMS_BUTTON_MAX; i++) { - if (!hid_locate(d_ptr, d_len, HID_USAGE2(HUP_BUTTON, (i + 1)), - hid_input, &sc->sc_loc_btn[i], NULL, &sc->sc_iid_btn[i])) { + if (!hid_locate(buf, len, HID_USAGE2(HUP_BUTTON, (i + 1)), + hid_input, index, &info->sc_loc_btn[i], NULL, + &info->sc_iid_btn[i])) { break; } } + info->sc_buttons = i; + + if (i > sc->sc_buttons) + sc->sc_buttons = i; + + if (info->sc_flags == 0) + return; + + /* announce information about the mouse */ + device_printf(dev, "%d buttons and [%s%s%s%s%s] coordinates ID=%u\n", + (info->sc_buttons), + (info->sc_flags & UMS_FLAG_X_AXIS) ? "X" : "", + (info->sc_flags & UMS_FLAG_Y_AXIS) ? "Y" : "", + (info->sc_flags & UMS_FLAG_Z_AXIS) ? "Z" : "", + (info->sc_flags & UMS_FLAG_T_AXIS) ? "T" : "", + (info->sc_flags & UMS_FLAG_W_AXIS) ? "W" : "", + info->sc_iid_x); +} + +static int +ums_attach(device_t dev) +{ + struct usb2_attach_arg *uaa = device_get_ivars(dev); + struct ums_softc *sc = device_get_softc(dev); + struct ums_info *info; + void *d_ptr = NULL; + int isize; + int err; + uint16_t d_len; + uint8_t i; + uint8_t j; + + DPRINTFN(11, "sc=%p\n", sc); + + device_set_usb2_desc(dev); + + mtx_init(&sc->sc_mtx, "ums lock", NULL, MTX_DEF | MTX_RECURSE); + + usb2_callout_init_mtx(&sc->sc_callout, &sc->sc_mtx, 0); + + /* + * Force the report (non-boot) protocol. + * + * Mice without boot protocol support may choose not to implement + * Set_Protocol at all; Ignore any error. + */ + err = usb2_req_set_protocol(uaa->device, NULL, + uaa->info.bIfaceIndex, 1); + + err = usb2_transfer_setup(uaa->device, + &uaa->info.bIfaceIndex, sc->sc_xfer, ums_config, + UMS_N_TRANSFER, sc, &sc->sc_mtx); + + if (err) { + DPRINTF("error=%s\n", usb2_errstr(err)); + goto detach; + } + err = usb2_req_get_hid_desc(uaa->device, NULL, &d_ptr, + &d_len, M_TEMP, uaa->info.bIfaceIndex); - sc->sc_buttons = i; + if (err) { + device_printf(dev, "error reading report description\n"); + goto detach; + } isize = hid_report_size(d_ptr, d_len, hid_input, &sc->sc_iid); @@ -478,83 +519,66 @@ ums_attach(device_t dev) * it has two addional buttons and a tilt wheel. */ if (usb2_test_quirk(uaa, UQ_MS_BAD_CLASS)) { - sc->sc_flags = (UMS_FLAG_X_AXIS | + info = &sc->sc_info[0]; + info->sc_flags = (UMS_FLAG_X_AXIS | UMS_FLAG_Y_AXIS | UMS_FLAG_Z_AXIS | UMS_FLAG_SBU); - sc->sc_buttons = 3; + info->sc_buttons = 3; isize = 5; - sc->sc_iid = 0; - sc->sc_iid_x = 0; - sc->sc_iid_y = 0; - sc->sc_iid_z = 0; - sc->sc_iid_btn[0] = 0; - sc->sc_iid_btn[1] = 0; - sc->sc_iid_btn[2] = 0; /* 1st byte of descriptor report contains garbage */ - sc->sc_loc_x.pos = 16; - sc->sc_loc_y.pos = 24; - sc->sc_loc_z.pos = 32; - sc->sc_loc_btn[0].pos = 8; - sc->sc_loc_btn[1].pos = 9; - sc->sc_loc_btn[2].pos = 10; - } + info->sc_loc_x.pos = 16; + info->sc_loc_y.pos = 24; + info->sc_loc_z.pos = 32; + info->sc_loc_btn[0].pos = 8; + info->sc_loc_btn[1].pos = 9; + info->sc_loc_btn[2].pos = 10; + + /* Announce device */ + device_printf(dev, "3 buttons and [XYZ] " + "coordinates ID=0\n"); - /* - * Some Microsoft devices have incorrectly high location - * positions. Correct this: - */ - isizebits = isize * 8; - if ((sc->sc_iid != 0) && (isizebits > 8)) { - isizebits -= 8; /* remove size of report ID */ - sc->sc_loc_w.pos %= isizebits; - sc->sc_loc_x.pos %= isizebits; - sc->sc_loc_y.pos %= isizebits; - sc->sc_loc_z.pos %= isizebits; - sc->sc_loc_t.pos %= isizebits; - for (i = 0; i != UMS_BUTTON_MAX; i++) - sc->sc_loc_btn[i].pos %= isizebits; + } else { + /* Search the HID descriptor and announce device */ + for (i = 0; i < UMS_INFO_MAX; i++) { + ums_hid_parse(sc, dev, d_ptr, d_len, i); + } } if (usb2_test_quirk(uaa, UQ_MS_REVZ)) { + info = &sc->sc_info[0]; /* Some wheels need the Z axis reversed. */ - sc->sc_flags |= UMS_FLAG_REVZ; + info->sc_flags |= UMS_FLAG_REVZ; } if (isize > sc->sc_xfer[UMS_INTR_DT]->max_frame_size) { DPRINTF("WARNING: report size, %d bytes, is larger " "than interrupt size, %d bytes!\n", isize, sc->sc_xfer[UMS_INTR_DT]->max_frame_size); } - /* announce information about the mouse */ - - device_printf(dev, "%d buttons and [%s%s%s%s%s] coordinates\n", - (sc->sc_buttons), - (sc->sc_flags & UMS_FLAG_X_AXIS) ? "X" : "", - (sc->sc_flags & UMS_FLAG_Y_AXIS) ? "Y" : "", - (sc->sc_flags & UMS_FLAG_Z_AXIS) ? "Z" : "", - (sc->sc_flags & UMS_FLAG_T_AXIS) ? "T" : "", - (sc->sc_flags & UMS_FLAG_W_AXIS) ? "W" : ""); - free(d_ptr, M_TEMP); d_ptr = NULL; #if USB_DEBUG - DPRINTF("sc=%p\n", sc); - DPRINTF("X\t%d/%d id=%d\n", sc->sc_loc_x.pos, - sc->sc_loc_x.size, sc->sc_iid_x); - DPRINTF("Y\t%d/%d id=%d\n", sc->sc_loc_y.pos, - sc->sc_loc_y.size, sc->sc_iid_y); - DPRINTF("Z\t%d/%d id=%d\n", sc->sc_loc_z.pos, - sc->sc_loc_z.size, sc->sc_iid_z); - DPRINTF("T\t%d/%d id=%d\n", sc->sc_loc_t.pos, - sc->sc_loc_t.size, sc->sc_iid_t); - DPRINTF("W\t%d/%d id=%d\n", sc->sc_loc_w.pos, - sc->sc_loc_w.size, sc->sc_iid_w); - - for (i = 0; i < sc->sc_buttons; i++) { - DPRINTF("B%d\t%d/%d id=%d\n", - i + 1, sc->sc_loc_btn[i].pos, - sc->sc_loc_btn[i].size, sc->sc_iid_btn[i]); + for (j = 0; j < UMS_INFO_MAX; j++) { + info = &sc->sc_info[j]; + + DPRINTF("sc=%p, index=%d\n", sc, j); + DPRINTF("X\t%d/%d id=%d\n", info->sc_loc_x.pos, + info->sc_loc_x.size, info->sc_iid_x); + DPRINTF("Y\t%d/%d id=%d\n", info->sc_loc_y.pos, + info->sc_loc_y.size, info->sc_iid_y); + DPRINTF("Z\t%d/%d id=%d\n", info->sc_loc_z.pos, + info->sc_loc_z.size, info->sc_iid_z); + DPRINTF("T\t%d/%d id=%d\n", info->sc_loc_t.pos, + info->sc_loc_t.size, info->sc_iid_t); + DPRINTF("W\t%d/%d id=%d\n", info->sc_loc_w.pos, + info->sc_loc_w.size, info->sc_iid_w); + + for (i = 0; i < info->sc_buttons; i++) { + DPRINTF("B%d\t%d/%d id=%d\n", + i + 1, info->sc_loc_btn[i].pos, + info->sc_loc_btn[i].size, info->sc_iid_btn[i]); + } } DPRINTF("size=%d, id=%d\n", isize, sc->sc_iid); #endif @@ -578,16 +602,9 @@ ums_attach(device_t dev) sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; - sc->sc_status.flags = 0; - sc->sc_status.button = 0; - sc->sc_status.obutton = 0; - sc->sc_status.dx = 0; - sc->sc_status.dy = 0; - sc->sc_status.dz = 0; - err = usb2_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ums_fifo_methods, &sc->sc_fifo, - unit, 0 - 1, uaa->info.bIfaceIndex, + device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); if (err) { goto detach; Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Sun Apr 5 18:21:40 2009 (r190740) +++ head/sys/dev/usb/usb_hid.c Sun Apr 5 18:21:51 2009 (r190741) @@ -544,13 +544,15 @@ hid_report_size(const void *buf, usb2_si *------------------------------------------------------------------------*/ int hid_locate(const void *desc, usb2_size_t size, uint32_t u, enum hid_kind k, - struct hid_location *loc, uint32_t *flags, uint8_t *id) + uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id) { struct hid_data *d; struct hid_item h; for (d = hid_start_parse(desc, size, 1 << k); hid_get_item(d, &h);) { if (h.kind == k && !(h.flags & HIO_CONST) && h.usage == u) { + if (index--) + continue; if (loc != NULL) *loc = h.loc; if (flags != NULL) Modified: head/sys/dev/usb/usb_hid.h ============================================================================== --- head/sys/dev/usb/usb_hid.h Sun Apr 5 18:21:40 2009 (r190740) +++ head/sys/dev/usb/usb_hid.h Sun Apr 5 18:21:51 2009 (r190741) @@ -80,7 +80,7 @@ int hid_get_item(struct hid_data *s, str int hid_report_size(const void *buf, usb2_size_t len, enum hid_kind k, uint8_t *id); int hid_locate(const void *desc, usb2_size_t size, uint32_t usage, - enum hid_kind kind, struct hid_location *loc, + enum hid_kind kind, uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id); uint32_t hid_get_data(const uint8_t *buf, usb2_size_t len, struct hid_location *loc); From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:22:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7532D1065BC6; Sun, 5 Apr 2009 18:22:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63B168FC1E; Sun, 5 Apr 2009 18:22:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IM3m6028295; Sun, 5 Apr 2009 18:22:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IM3ti028293; Sun, 5 Apr 2009 18:22:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051822.n35IM3ti028293@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:22: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: r190742 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:22:04 -0000 Author: thompsa Date: Sun Apr 5 18:22:03 2009 New Revision: 190742 URL: http://svn.freebsd.org/changeset/base/190742 Log: MFp4 //depot/projects/usb@160052 Wait until line configuration is complete before starting data transfers. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Sun Apr 5 18:21:51 2009 (r190741) +++ head/sys/dev/usb/serial/usb_serial.c Sun Apr 5 18:22:03 2009 (r190742) @@ -412,6 +412,12 @@ usb2_com_queue_command(struct usb2_com_s if (fn == usb2_com_cfg_close) usb2_proc_mwait(&ssc->sc_tq, t0, t1); + /* + * In case of multiple configure requests, + * keep track of the last one! + */ + if (fn == usb2_com_cfg_start_transfers) + sc->sc_last_start_xfer = &task->hdr; } static void @@ -458,7 +464,9 @@ usb2_com_cfg_start_transfers(struct usb2 /* TTY device closed */ return; } - sc->sc_flag |= UCOM_FLAG_GP_DATA; + + if (_task == sc->sc_last_start_xfer) + sc->sc_flag |= UCOM_FLAG_GP_DATA; if (sc->sc_callback->usb2_com_start_read) { (sc->sc_callback->usb2_com_start_read) (sc); Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Sun Apr 5 18:21:51 2009 (r190741) +++ head/sys/dev/usb/serial/usb_serial.h Sun Apr 5 18:22:03 2009 (r190742) @@ -152,6 +152,8 @@ struct usb2_com_softc { struct usb2_com_cfg_task sc_status_task[2]; struct usb2_com_param_task sc_param_task[2]; struct cv sc_cv; + /* Used to set "UCOM_FLAG_GP_DATA" flag: */ + struct usb2_proc_msg *sc_last_start_xfer; const struct usb2_com_callback *sc_callback; struct usb2_com_super_softc *sc_super; struct tty *sc_tty; From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:22:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA99106576F; Sun, 5 Apr 2009 18:22:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2644D8FC17; Sun, 5 Apr 2009 18:22:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IMETC028337; Sun, 5 Apr 2009 18:22:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IMDwc028335; Sun, 5 Apr 2009 18:22:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051822.n35IMDwc028335@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:22: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: r190743 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:22:17 -0000 Author: thompsa Date: Sun Apr 5 18:22:13 2009 New Revision: 190743 URL: http://svn.freebsd.org/changeset/base/190743 Log: MFp4 //depot/projects/usb@160056 Remove code for unused and unlikely quirk, "uq_power_claim" Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:22:03 2009 (r190742) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:22:13 2009 (r190743) @@ -431,7 +431,6 @@ usb2_error_t usb2_set_config_index(struct usb2_device *udev, uint8_t index) { struct usb2_status ds; - struct usb2_hub_descriptor hd; struct usb2_config_descriptor *cdp; uint16_t power; uint16_t max_power; @@ -484,38 +483,16 @@ usb2_set_config_index(struct usb2_device /* May be self powered. */ if (cdp->bmAttributes & UC_BUS_POWERED) { /* Must ask device. */ - if (udev->flags.uq_power_claim) { - /* - * HUB claims to be self powered, but isn't. - * It seems that the power status can be - * determined by the HUB characteristics. - */ - err = usb2_req_get_hub_descriptor - (udev, NULL, &hd, 1); - if (err) { - DPRINTFN(0, "could not read " - "HUB descriptor: %s\n", - usb2_errstr(err)); - - } else if (UGETW(hd.wHubCharacteristics) & - UHD_PWR_INDIVIDUAL) { - selfpowered = 1; - } - DPRINTF("characteristics=0x%04x\n", - UGETW(hd.wHubCharacteristics)); - } else { - err = usb2_req_get_device_status - (udev, NULL, &ds); - if (err) { - DPRINTFN(0, "could not read " - "device status: %s\n", - usb2_errstr(err)); - } else if (UGETW(ds.wStatus) & UDS_SELF_POWERED) { - selfpowered = 1; - } - DPRINTF("status=0x%04x \n", - UGETW(ds.wStatus)); + err = usb2_req_get_device_status(udev, NULL, &ds); + if (err) { + DPRINTFN(0, "could not read " + "device status: %s\n", + usb2_errstr(err)); + } else if (UGETW(ds.wStatus) & UDS_SELF_POWERED) { + selfpowered = 1; } + DPRINTF("status=0x%04x \n", + UGETW(ds.wStatus)); } else selfpowered = 1; } @@ -1631,9 +1608,6 @@ usb2_alloc_device(device_t parent_dev, s if (usb2_test_quirk(&uaa, UQ_BUS_POWERED)) { udev->flags.uq_bus_powered = 1; } - if (usb2_test_quirk(&uaa, UQ_POWER_CLAIM)) { - udev->flags.uq_power_claim = 1; - } if (usb2_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Sun Apr 5 18:22:03 2009 (r190742) +++ head/sys/dev/usb/usb_device.h Sun Apr 5 18:22:13 2009 (r190743) @@ -90,7 +90,6 @@ struct usb2_device_flags { * strings */ uint8_t remote_wakeup:1; /* set if remote wakeup is enabled */ uint8_t uq_bus_powered:1; /* set if BUS powered quirk is present */ - uint8_t uq_power_claim:1; /* set if power claim quirk is present */ }; /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:26:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5380106567D; Sun, 5 Apr 2009 18:26: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 D36BD8FC13; Sun, 5 Apr 2009 18:26: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 n35IQJR4028465; Sun, 5 Apr 2009 18:26:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IQJ8n028464; Sun, 5 Apr 2009 18:26:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051826.n35IQJ8n028464@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:26: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: r190744 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:26:21 -0000 Author: thompsa Date: Sun Apr 5 18:26:19 2009 New Revision: 190744 URL: http://svn.freebsd.org/changeset/base/190744 Log: Catch up with usb2_config struct layout changes. Modified: head/sys/dev/usb/wlan/if_uath.c Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Sun Apr 5 18:22:13 2009 (r190743) +++ head/sys/dev/usb/wlan/if_uath.c Sun Apr 5 18:26:19 2009 (r190744) @@ -208,50 +208,50 @@ static const struct usb2_config uath_usb .type = UE_BULK, .endpoint = 0x1, .direction = UE_DIR_IN, - .mh.bufsize = UATH_MAX_CMDSZ, - .mh.flags = { + .bufsize = UATH_MAX_CMDSZ, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, - .mh.callback = uath_intr_rx_callback + .callback = uath_intr_rx_callback }, [UATH_INTR_TX] = { .type = UE_BULK, .endpoint = 0x1, .direction = UE_DIR_OUT, - .mh.bufsize = UATH_MAX_CMDSZ, - .mh.flags = { + .bufsize = UATH_MAX_CMDSZ, + .flags = { .ext_buffer = 1, .force_short_xfer = 1, .pipe_bof = 1, }, - .mh.callback = uath_intr_tx_callback, - .mh.timeout = UATH_CMD_TIMEOUT + .callback = uath_intr_tx_callback, + .timeout = UATH_CMD_TIMEOUT }, [UATH_BULK_RX] = { .type = UE_BULK, .endpoint = 0x2, .direction = UE_DIR_IN, - .mh.bufsize = MCLBYTES, - .mh.flags = { + .bufsize = MCLBYTES, + .flags = { .ext_buffer = 1, .pipe_bof = 1, .short_xfer_ok = 1 }, - .mh.callback = uath_bulk_rx_callback + .callback = uath_bulk_rx_callback }, [UATH_BULK_TX] = { .type = UE_BULK, .endpoint = 0x2, .direction = UE_DIR_OUT, - .mh.bufsize = UATH_MAX_TXBUFSZ, - .mh.flags = { + .bufsize = UATH_MAX_TXBUFSZ, + .flags = { .ext_buffer = 1, .force_short_xfer = 1, .pipe_bof = 1 }, - .mh.callback = uath_bulk_tx_callback, - .mh.timeout = UATH_DATA_TIMEOUT + .callback = uath_bulk_tx_callback, + .timeout = UATH_DATA_TIMEOUT } }; From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:28:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCEA610656F3; Sun, 5 Apr 2009 18:28:42 +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 BBC318FC17; Sun, 5 Apr 2009 18:28:42 +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 n35ISgli028599; Sun, 5 Apr 2009 18:28:42 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35ISgOY028598; Sun, 5 Apr 2009 18:28:42 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904051828.n35ISgOY028598@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 18:28: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: r190745 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:28:43 -0000 Author: phk Date: Sun Apr 5 18:28:42 2009 New Revision: 190745 URL: http://svn.freebsd.org/changeset/base/190745 Log: Silence a printf warning Modified: head/sbin/routed/input.c Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Sun Apr 5 18:26:19 2009 (r190744) +++ head/sbin/routed/input.c Sun Apr 5 18:28:42 2009 (r190745) @@ -980,7 +980,7 @@ ck_passwd(struct interface *aifp, "unknown MD5 RIPv2 auth len %#x" " instead of %#x from %s", NA->au.a_md5.md5_auth_len, - RIP_AUTH_MD5_HASH_LEN, + (unsigned)RIP_AUTH_MD5_HASH_LEN, naddr_ntoa(from)); if (na2->a_family != RIP_AF_AUTH) msglim(use_authp, from, From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:30:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 940E2106598A; Sun, 5 Apr 2009 18:30:24 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8083E8FC1C; Sun, 5 Apr 2009 18:30:24 +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 n35IUOdo028682; Sun, 5 Apr 2009 18:30:24 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IUOLZ028681; Sun, 5 Apr 2009 18:30:24 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051830.n35IUOLZ028681@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:30: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: r190746 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:30:25 -0000 Author: thompsa Date: Sun Apr 5 18:30:24 2009 New Revision: 190746 URL: http://svn.freebsd.org/changeset/base/190746 Log: MFp4 //depot/projects/usb@159934 Update libusb function descriptions. Submitted by: Chuck Robey Modified: head/lib/libusb/libusb.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Sun Apr 5 18:28:42 2009 (r190745) +++ head/lib/libusb/libusb.3 Sun Apr 5 18:30:24 2009 (r190746) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feb 14, 2009 +.Dd April 5, 2009 .Dt LIBUSB 3 .Os .Sh NAME @@ -43,9 +43,165 @@ USB access library (libusb -lusb) . . .Sh SYNOPSIS -. -. .In libusb20.h +.Ft int +.Fn libusb20_tr_close "struct libusb20_transfer *xfer" +.Ft int +.Fn libusb20_tr_open "struct libusb20_transfer *xfer" "uint32_t max_buf_size" "uint32_t max_frame_count" "uint8_t ep_no" +.Ft struct libusb20_transfer* +.Fn libusb20_tr_get_pointer "struct libusb20_device *pdev" "uint16_t tr_index" +.Ft uint16_t +.Fn libusb20_tr_get_time_complete "struct libusb20_transfer *xfer" +.Ft uint32_t +.Fn libusb20_tr_get_actual_frames "struct libusb20_transfer *xfer" +.Ft uint32_t +.Fn libusb20_tr_get_actual_length "struct libusb20_transfer *xfer" +.Ft uint32_t +.Fn libusb20_tr_get_max_frames "struct libusb20_transfer *xfer" +.Ft uint32_t +.Fn libusb20_tr_get_max_packet_length "struct libusb20_transfer *xfer" +.Ft uint32_t +.Fn libusb20_tr_get_max_total_length "struct libusb20_transfer *xfer" +.Ft uint8_t +.Fn libusb20_tr_get_status "struct libusb20_transfer *xfer" +.Ft uint8_t +.Fn libusb20_tr_pending "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_callback_wrapper "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_clear_stall_sync "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_drain "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_set_buffer "struct libusb20_transfer *xfer" "void *buffer" "uint16_t fr_index" +.Ft void +.Fn libusb20_tr_set_callback "struct libusb20_transfer *xfer" "libusb20_tr_callback_t *cb" +.Ft void +.Fn libusb20_tr_set_flags "struct libusb20_transfer *xfer" "uint8_t flags" +.Ft void +.Fn libusb20_tr_set_length "struct libusb20_transfer *xfer" "uint32_t length" "uint16_t fr_index" +.Ft void +.Fn libusb20_tr_set_priv_sc0 "struct libusb20_transfer *xfer" "void *sc0" +.Ft void +.Fn libusb20_tr_set_priv_sc1 "struct libusb20_transfer *xfer" "void *sc1" +.Ft void +.Fn libusb20_tr_set_timeout "struct libusb20_transfer *xfer" "uint32_t timeout" +.Ft void +.Fn libusb20_tr_set_total_frames "struct libusb20_transfer *xfer" "uint32_t nframes" +.Ft void +.Fn libusb20_tr_setup_bulk "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t timeout" +.Ft void +.Fn libusb20_tr_setup_control "struct libusb20_transfer *xfer" "void *psetup" "void *pbuf" "uint32_t timeout" +.Ft void +.Fn libusb20_tr_setup_intr "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t timeout" +.Ft void +.Fn libusb20_tr_setup_isoc "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint61_t fr_index" +.Ft void +.Fn libusb20_tr_start "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_stop "struct libusb20_transfer *xfer" +.Ft void +.Fn libusb20_tr_submit "struct libusb20_transfer *xfer" +.Ft void * +.Fn libusb20_tr_get_priv_sc0 "struct libusb20_transfer *xfer" +.Ft void * +.Fn libusb20_tr_get_priv_sc1 "struct libusb20_transfer *xfer" +.Ft const char * +.Fn libusb20_dev_get_backend_name "struct libusb20_device *" +.Ft int +.Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb2_device_info *pinfo" +.Ft int +.Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" +.Ft const char * +.Fn libusb20_dev_get_desc "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_claim_interface "struct libusb20_device *pdev" "uint8_t iface_index" +.Ft int +.Fn libusb20_dev_close "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_detach_kernel_driver "struct libusb20_device *pdev" "uint8_t iface_index" +.Ft int +.Fn libusb20_dev_set_config_index "struct libusb20_device *pdev" "uint8_t configIndex" +.Ft int +.Fn libusb20_dev_get_debug "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_get_fd "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_kernel_driver_active "struct libusb20_device *pdev" "uint8_t iface_index" +.Ft int +.Fn libusb20_dev_open "struct libusb20_device *pdev" "uint16_t transfer_max" +.Ft int +.Fn libusb20_dev_process "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_release_interface "struct libusb20_device *pdev" "uint8_t iface_index" +.Ft int +.Fn libusb20_dev_request_sync "struct libusb20_device *pdev" "struct LIBUSB20_CONTROL_SETUP_DECODED *setup" "void *data" "uint16_t *pactlen" "uint32_t timeout" "uint8_t flags" +.Ft int +.Fn libusb20_dev_req_string_sync "struct libusb20_device *pdev" "uint8_t index" "uint16_t langid" "void *ptr" "uint16_t len" +.Ft int +.Fn libusb20_dev_req_string_simple_sync "struct libusb20_device *pdev" "uint8_t index" "void *ptr" "uint16_t len" +.Ft int +.Fn libusb20_dev_reset "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_set_power_mode "struct libusb20_device *pdev" "uint8_t power_mode" +.Ft uint8_t +.Fn libusb20_dev_get_power_mode "struct libusb20_device *pdev" +.Ft int +.Fn libusb20_dev_set_alt_index "struct libusb20_device *pdev" "uint8_t iface_index" "uint8_t alt_index" +.Ft int +.Fn libusb20_dev_get_device_desc "struct libusb20_device *pdev" "uint8_t iface_indexr", "char *buf" "uint8_t len" +.Ft struct libusb20_config * +.Fn libusb20_dev_alloc_config "struct libusb20_device *pdev" "uint8_t config_index" +.Ft struct libusb20_device * +.Fn libusb20_dev_alloc "void" +.Ft uint8_t +.Fn libusb20_dev_get_address "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_bus_number "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_mode "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_speed "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_config_index "struct libusb20_device *pdev" +.Ft void +.Fn libusb20_dev_free "struct libusb20_device *pdev" +.Ft void +.Fn libusb20_dev_set_debug "struct libusb20_device *pdev" "int debug" +.Ft void +.Fn libusb20_dev_wait_process "struct libusb20_device *pdev" "int timeout" +.Ft int +.Fn libusb20_be_get_template "struct libusb20_backend *pbe" "int *ptemp" +.Ft int +.Fn libusb20_be_set_template "struct libusb20_backend *pbe" "int temp" +.Ft int +.Fn libusb20_be_get_dev_quirk "struct libusb20_backend *pber", "uint16_t index" "struct libusb20_quirk *pq" +.Ft int +.Fn libusb20_be_get_quirk_name "struct libusb20_backend *pbe" "uint16_t index" "struct libusb20_quirk *pq" +.Ft int +.Fn libusb20_be_add_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" +.Ft int +.Fn libusb20_be_remove_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" +.Ft struct libusb20_backend * +.Fn libusb20_be_alloc_linux "void" +.Ft struct libusb20_device * +.Fn libusb20_be_device_foreach "struct libusb20_backend *pbe" "struct libusb20_device *pdev" +.Ft void +.Fn libusb20_be_dequeue_device "struct libusb20_backend *pbe" "struct libusb20_device *pdev" +.Ft void +.Fn libusb20_be_enqueue_device "struct libusb20_backend *pbe" "struct libusb20_device *pdev" +.Ft void +.Fn libusb20_be_free "struct libusb20_backend *pbe" +.Ft uint8_t +.Fn libusb20_me_get_1 "const struct libusb20_me_struct *me" "uint16_t off" +.Ft uint16_t +.Fn libusb20_me_get_2 "const struct libusb20_me_struct *me" "uint16_t off" +.Ft uint16_t +.Fn libusb20_me_encode "void *pdata" "uint16_t len" "const void *pdecoded" +.Ft uint16_t +.Fn libusb20_me_decode "const void *pdata" "uint16_t len" "void *pdecoded" +.Ft "const uint8_t *" +.Fn libusb20_desc_foreach "const struct libusb20_me_struct *me" "const uint8_t *pdesc" . . .Sh DESCRIPTION @@ -60,9 +216,9 @@ USB through the USB file system interfac . .Pp . -.Fn libusb20_tr_close pxfer -This function will release all kernel resources associated with an USB -.Fa pxfer . +.Fn libusb20_tr_close +will release all kernel resources associated with an USB +.Fa xfer . . This function returns zero upon success. . @@ -70,8 +226,8 @@ Non-zero return values indicate a LIBUSB . .Pp . -.Fn libusb20_tr_open pxfer max_buf_size max_frame_count ep_no -This function will allocate kernel resources like +.Fn libusb20_tr_open +will allocate kernel resources like .Fa max_buf_size and .Fa max_frame_count @@ -86,8 +242,8 @@ Non-zero return values indicate a LIBUSB . .Pp . -.Fn libusb20_tr_get_pointer pdev tr_index -This function will return a pointer to the allocated USB transfer according to the +.Fn libusb20_tr_get_pointer +will return a pointer to the allocated USB transfer according to the .Fa pdev and .Fa tr_index @@ -97,33 +253,33 @@ This function returns NULL in case of fa . .Pp . -.Fn libusb20_tr_get_time_complete pxfer -This function will return the completion time of an USB transfer in +.Fn libusb20_tr_get_time_complete +will return the completion time of an USB transfer in millisecond units. This function is most useful for isochronous USB transfers when doing echo cancelling. . .Pp . -.Fn libusb20_tr_get_actual_frames pxfer -This function will return the actual number of USB frames after an USB +.Fn libusb20_tr_get_actual_frames +will return the actual number of USB frames after an USB transfer completed. A value of zero means that no data was transferred. . .Pp . -.Fn libusb20_tr_get_actual_length pxfer -This function will return the sum of the actual length for all +.Fn libusb20_tr_get_actual_length +will return the sum of the actual length for all transferred USB frames for the given USB transfer. . .Pp . -.Fn libusb20_tr_get_max_frames pxfer -This function will return the maximum number of USB frames that were +.Fn libusb20_tr_get_max_frames +will return the maximum number of USB frames that were allocated when an USB transfer was setup for the given USB transfer. . .Pp . -.Fn libusb20_tr_get_max_packet_length pxfer -This function will return the maximum packet length in bytes +.Fn libusb20_tr_get_max_packet_length +will return the maximum packet length in bytes associated with the given USB transfer. . The packet length can be used round up buffer sizes so that short USB @@ -132,33 +288,33 @@ packets are avoided for proxy buffers. . .Pp . -.Fn libusb20_tr_get_max_total_length pxfer -This function will return the maximum value for the length sum of all +.Fn libusb20_tr_get_max_total_length +function will return the maximum value for the length sum of all USB frames associated with an USB transfer. . .Pp . -.Fn libusb20_tr_get_status pxfer -This function will return the status of an USB transfer. +.Fn libusb20_tr_get_status +will return the status of an USB transfer. . Status values are defined by a set of LIBUSB20_TRANSFER_XXX enums. . .Pp . -.Fn libusb20_tr_pending pxfer -This function will return non-zero if the given USB transfer is +.Fn libusb20_tr_pending +will return non-zero if the given USB transfer is pending for completion. . Else this function returns zero. . .Pp . -.Fn libusb20_tr_callback_wrapper pxfer +.Fn libusb20_tr_callback_wrapper This is an internal function used to wrap asynchronous USB callbacks. . .Pp . -.Fn libusb20_tr_clear_stall_sync pxfer +.Fn libusb20_tr_clear_stall_sync This is an internal function used to synchronously clear the stall on the given USB transfer. . @@ -171,14 +327,14 @@ been called. . .Pp . -.Fn libusb20_tr_drain pxfer -This function will stop the given USB transfer and will not return +.Fn libusb20_tr_drain +will stop the given USB transfer and will not return until the USB transfer has been stopped in hardware. . .Pp . -.Fn libusb20_tr_set_buffer pxfer pbuf fr_index -This function is used to set the +.Fn libusb20_tr_set_buffer +is used to set the .Fa buffer pointer for the given USB transfer and .Fa fr_index . @@ -188,16 +344,16 @@ Typically the frame index is zero. . .Pp . -.Fn libusb20_tr_set_callback pxfer pcallback -This function is used to set the USB callback for asynchronous USB +.Fn libusb20_tr_set_callback +is used to set the USB callback for asynchronous USB transfers. . The callback type is defined by libusb20_tr_callback_t. . .Pp . -.Fn libusb20_tr_set_flags pxfer flags -This function is used to set various USB flags for the given USB transfer. +.Fn libusb20_tr_set_flags +is used to set various USB flags for the given USB transfer. .Bl -tag .It LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK Report a short frame as error. @@ -211,23 +367,23 @@ Will do a clear-stall before starting th . .Pp . -.Fn libusb20_tr_set_length pxfer length fr_index -This function sets the length of a given USB transfer and frame index. +.Fn libusb20_tr_set_length +sets the length of a given USB transfer and frame index. . .Pp . -.Fn libusb20_tr_set_priv_sc0 pxfer psc0 -This function sets private driver pointer number zero. +.Fn libusb20_tr_set_priv_sc0 +sets private driver pointer number zero. . .Pp . -.Fn libusb20_tr_set_priv_sc1 pxfer psc1 -This function sets private driver pointer number one. +.Fn libusb20_tr_set_priv_sc1 +sets private driver pointer number one. . .Pp . -.Fn libusb20_tr_set_timeout pxfer timeout -This function sets the timeout for the given USB transfer. +.Fn libusb20_tr_set_timeout +sets the timeout for the given USB transfer. . A timeout value of zero means no timeout. . @@ -235,36 +391,36 @@ The timeout is given in milliseconds. . .Pp . -.Fn libusb20_tr_set_total_frames pxfer nframes -This function sets the total number of frames that should be executed when the USB transfer is submitted. +.Fn libusb20_tr_set_total_frames +sets the total number of frames that should be executed when the USB transfer is submitted. . The total number of USB frames must be less than the maximum number of USB frames associated with the given USB transfer. . .Pp . -.Fn libusb20_tr_setup_bulk pxfer pbuf length timeout -This function is a helper function for setting up a single frame USB BULK transfer. +.Fn libusb20_tr_setup_bulk +is a helper function for setting up a single frame USB BULK transfer. . .Pp . -.Fn libusb20_tr_setup_control pxfer psetup pbuf timeout -This function is a helper function for setting up a single or dual +.Fn libusb20_tr_setup_control +is a helper function for setting up a single or dual frame USB CONTROL transfer depending on the control transfer length. . .Pp . -.Fn libusb20_tr_setup_intr pxfer pbuf length timeout -This function is a helper function for setting up a single frame USB INTERRUPT transfer. +.Fn libusb20_tr_setup_intr +is a helper function for setting up a single frame USB INTERRUPT transfer. . .Pp . -.Fn libusb20_tr_setup_isoc pxfer pbuf length fr_index -This function is a helper function for setting up a multi frame USB ISOCHRONOUS transfer. +.Fn libusb20_tr_setup_isoc +is a helper function for setting up a multi frame USB ISOCHRONOUS transfer. . .Pp . -.Fn libusb20_tr_start pxfer -This function will get the USB transfer started, if not already +.Fn libusb20_tr_start +will get the USB transfer started, if not already started. . This function will not get the transfer queued in hardware. @@ -273,29 +429,29 @@ This function is non-blocking. . .Pp . -.Fn libusb20_tr_stop pxfer -This function will get the USB transfer stopped, if not already stopped. +.Fn libusb20_tr_stop +will get the USB transfer stopped, if not already stopped. . This function is non-blocking, which means that the actual stop can happen after the return of this function. . .Pp . -.Fn libusb20_tr_submit pxfer -This function will get the USB transfer queued in hardware. +.Fn libusb20_tr_submit +will get the USB transfer queued in hardware. . . .Pp . -.Fn libusb20_tr_get_priv_sc0 pxfer -This function returns private driver pointer number zero associated +.Fn libusb20_tr_get_priv_sc0 +returns private driver pointer number zero associated with an USB transfer. . . .Pp . -.Fn libusb20_tr_get_priv_sc1 pxfer -This function returns private driver pointer number one associated +.Fn libusb20_tr_get_priv_sc1 +returns private driver pointer number one associated with an USB transfer. . . @@ -303,13 +459,13 @@ with an USB transfer. . .Pp . -.Fn libusb20_dev_get_backend_name pdev -This function returns a zero terminated string describing the backend used. +.Fn libusb20_dev_get_backend_name +returns a zero terminated string describing the backend used. . .Pp . -.Fn libusb20_dev_get_info pdev pinfo -This function retrives the BSD specific usb2_device_info structure into the memory location given by +.Fn libusb20_dev_get_info +retrives the BSD specific usb2_device_info structure into the memory location given by .Fa pinfo . The USB device given by .Fa pdev @@ -318,8 +474,8 @@ This function returns zero on success el . .Pp . -.Fn libusb20_dev_get_iface_desc pdev iface_index pbuf len -This function retrieves the kernel interface description for the given USB +.Fn libusb20_dev_get_iface_desc +retrieves the kernel interface description for the given USB .Fa iface_index . The format of the USB interface description is: "drivername: " The description string is always zero terminated. @@ -331,13 +487,13 @@ This function returns zero on success el . .Pp . -.Fn libusb20_dev_get_desc pdev -This function returns a zero terminated string describing the given USB device. +.Fn libusb20_dev_get_desc +returns a zero terminated string describing the given USB device. The format of the string is: "drivername: " . .Pp . -.Fn libusb20_dev_claim_interface pdev iface_index +.Fn libusb20_dev_claim_interface This function will try to claim the given USB interface given by .Fa iface_index . This function returns zero on success else a LIBUSB20_ERROR value is @@ -345,16 +501,16 @@ returned. . .Pp . -.Fn libusb20_dev_close pdev -This function will close the given USB device. +.Fn libusb20_dev_close +will close the given USB device. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . -.Fn libusb20_dev_detach_kernel_driver pdev iface_index -This function will try to detach the kernel driver for the USB interface given by +.Fn libusb20_dev_detach_kernel_driver +will try to detach the kernel driver for the USB interface given by .Fa iface_index . . This function returns zero on success else a LIBUSB20_ERROR value is @@ -362,8 +518,8 @@ returned. . .Pp . -.Fn libusb20_dev_set_config_index pdev config_index -This function will try to set the configuration index on an USB +.Fn libusb20_dev_set_config_index +will try to set the configuration index on an USB device. . The first configuration index is zero. @@ -374,13 +530,13 @@ This function returns zero on success el . .Pp . -.Fn libusb20_dev_get_debug pdev -This function returns the debug level of an USB device. +.Fn libusb20_dev_get_debug +returns the debug level of an USB device. . .Pp . -.Fn libusb20_dev_get_fd pdev -This function returns the file descriptor of the given USB device. +.Fn libusb20_dev_get_fd +returns the file descriptor of the given USB device. . A negative value is returned when no file descriptor is present. . @@ -388,16 +544,16 @@ The file descriptor can be used for poll . .Pp . -.Fn libusb20_dev_kernel_driver_active pdev iface_index -This function returns a non-zero value if a kernel driver is active on +.Fn libusb20_dev_kernel_driver_active +returns a non-zero value if a kernel driver is active on the given USB interface. . Else zero is returned. . .Pp . -.Fn libusb20_dev_open pdev transfer_max -This function opens an USB device so that setting up USB transfers +.Fn libusb20_dev_open +opens an USB device so that setting up USB transfers becomes possible. . The number of USB transfers can be zero which means only control @@ -411,8 +567,8 @@ opened. . .Pp . -.Fn libusb20_dev_process pdev -This function is called to sync kernel USB transfers with userland USB +.Fn libusb20_dev_process +is called to sync kernel USB transfers with userland USB transfers. . This function returns zero on success else a LIBUSB20_ERROR value is @@ -421,16 +577,16 @@ detached. . .Pp . -.Fn libusb20_dev_release_interface pdev iface_index -This function will try to release a claimed USB interface for the specified USB device. +.Fn libusb20_dev_release_interface +will try to release a claimed USB interface for the specified USB device. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . -.Fn libusb20_dev_request_sync pdev psetup pdata pactlen timeout flags -This function will perform a synchronous control request on the given +.Fn libusb20_dev_request_sync +will perform a synchronous control request on the given USB device. . Before this call will succeed the USB device must be opened. @@ -452,8 +608,8 @@ returned. . .Pp . -.Fn libusb20_dev_req_string_sync pdev index lang_id pbuf len -This function will synchronously request an USB string by language ID +.Fn libusb20_dev_req_string_sync +will synchronously request an USB string by language ID and string index into the given buffer limited by a maximum length. . This function returns zero on success else a LIBUSB20_ERROR value is @@ -461,8 +617,8 @@ returned. . .Pp . -.Fn libusb20_dev_req_string_simple_sync pdev index pbuf len -This function will synchronously request an USB string using the +.Fn libusb20_dev_req_string_simple_sync +will synchronously request an USB string using the default language ID and convert the string into ASCII before storing the string into the given buffer limited by a maximum length which includes the terminating zero. @@ -473,8 +629,8 @@ returned. . .Pp . -.Fn libusb20_dev_reset pdev -This function will try to BUS reset the given USB device and restore +.Fn libusb20_dev_reset +will try to BUS reset the given USB device and restore the last set USB configuration. . This function returns zero on success else a LIBUSB20_ERROR value is @@ -482,8 +638,8 @@ returned. . .Pp . -.Fn libusb20_dev_set_power_mode pdev power_mode -This function sets the power mode of the USB device. +.Fn libusb20_dev_set_power_mode +sets the power mode of the USB device. . Valid power modes: .Bl -tag @@ -499,14 +655,14 @@ returned. . .Pp . -.Fn libusb20_dev_get_power_mode pdev -This function returns the currently selected power mode for the given +.Fn libusb20_dev_get_power_mode +returns the currently selected power mode for the given USB device. . .Pp . -.Fn libusb20_dev_set_alt_index pdev iface_index alt_index -This function will try to set the given alternate index for the given +.Fn libusb20_dev_set_alt_index +will try to set the given alternate index for the given USB interface index. . This function returns zero on success else a LIBUSB20_ERROR value is @@ -514,41 +670,41 @@ returned. . .Pp . -.Fn libusb20_dev_get_device_desc pdev -This function returns a pointer to the decoded and host endian version +.Fn libusb20_dev_get_device_desc +returns a pointer to the decoded and host endian version of the device descriptor. . The USB device need not be opened when calling this function. . .Pp . -.Fn libusb20_dev_alloc_config pdev config_index -This function will read out and decode the USB config descriptor for +.Fn libusb20_dev_alloc_config +will read out and decode the USB config descriptor for the given USB device and config index. This function returns a pointer to the decoded configuration which must eventually be passed to free(). NULL is returned in case of failure. . .Pp . -.Fn libusb20_dev_alloc void -This is an internal function to allocate a new USB device. +.Fn libusb20_dev_alloc +is an internal function to allocate a new USB device. . .Pp . -.Fn libusb20_dev_get_address pdev -This function returns the internal and not necessarily the real +.Fn libusb20_dev_get_address +returns the internal and not necessarily the real hardware address of the given USB device. . .Pp . -.Fn libusb20_dev_get_bus_number pdev -This function return the internal bus number which the given USB +.Fn libusb20_dev_get_bus_number +returns the internal bus number which the given USB device belongs to. . .Pp . -.Fn libusb20_dev_get_mode pdev -This function returns the current operation mode of the USB entity. +.Fn libusb20_dev_get_mode +returns the current operation mode of the USB entity. . Valid return values are: .Bl -tag @@ -558,8 +714,8 @@ Valid return values are: . .Pp . -.Fn libusb20_dev_get_speed pdev -This function returns the current speed of the given USB device. +.Fn libusb20_dev_get_speed +returns the current speed of the given USB device. . .Bl -tag .It LIBUSB20_SPEED_UNKNOWN @@ -572,25 +728,25 @@ This function returns the current speed . .Pp . -.Fn libusb20_dev_get_config_index pdev +.Fn libusb20_dev_get_config_index This function returns the currently select config index for the given USB device. . .Pp . -.Fn libusb20_dev_free pdev -This function will free the given USB device and all associated USB +.Fn libusb20_dev_free +will free the given USB device and all associated USB transfers. . .Pp . -.Fn libusb20_dev_set_debug pdev debug_level -This function will set the debug level for the given USB device. +.Fn libusb20_dev_set_debug +will set the debug level for the given USB device. . .Pp . -.Fn libusb20_dev_wait_process pdev timeout -This function will wait until a pending USB transfer has completed on +.Fn libusb20_dev_wait_process +function will wait until a pending USB transfer has completed on the given USB device. . A timeout value can be specified which is passed on to the @@ -599,8 +755,8 @@ function. . .Sh USB BACKEND OPERATIONS . -.Fn libusb20_be_get_template pbackend ptemp -This function will return the currently selected global USB device +.Fn libusb20_be_get_template +will return the currently selected global USB device side mode template into the integer pointer .Fa ptemp . This function returns zero on success else a LIBUSB20_ERROR value is @@ -608,8 +764,8 @@ returned. . .Pp . -.Fn libusb20_be_set_template pbackend temp -This function will set the global USB device side mode template to +.Fn libusb20_be_set_template +will set the global USB device side mode template to .Fa temp . The new template is not activated until after the next USB enumeration. @@ -623,7 +779,7 @@ returned. . .Pp . -.Fn libusb20_be_get_dev_quirk pbackend index pquirk +.Fn libusb20_be_get_dev_quirk This function will return the device quirk according to .Fa index into the libusb20_quirk structure pointed to by @@ -636,8 +792,8 @@ returned. . .Pp . -.Fn libusb20_be_get_quirk_name pbackend index pquirk -This function will return the quirk name according to +.Fn libusb20_be_get_quirk_name +will return the quirk name according to .Fa index into the libusb20_quirk structure pointed to by .Fa pq . @@ -649,8 +805,8 @@ returned. . .Pp . -.Fn libusb20_be_add_dev_quirk pbackend pquirk -This function will add the libusb20_quirk structure pointed to by the +.Fn libusb20_be_add_dev_quirk +will add the libusb20_quirk structure pointed to by the .Fa pq argument into the device quirk list. . @@ -662,8 +818,8 @@ returned. . .Pp . -.Fn libusb20_be_remove_dev_quirk pbackend pquirk -This function will remove the quirk matching the libusb20_quirk structure pointed to by the +.Fn libusb20_be_remove_dev_quirk +will remove the quirk matching the libusb20_quirk structure pointed to by the .Fa pq argument from the device quirk list. . @@ -673,15 +829,15 @@ returned. If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . -.Fn libusb20_be_alloc_linux void +.Fn libusb20_be_alloc_linux These functions are used to allocate a specific USB backend or the operating system default USB backend. Allocating a backend is a way to scan for currently present USB devices. . .Pp . -.Fn libusb20_be_device_foreach pbackend pdev -This function is used to iterate USB devices present in a USB backend. +.Fn libusb20_be_device_foreach +is used to iterate USB devices present in a USB backend. . The starting value of .Fa pdev @@ -693,23 +849,23 @@ If NULL is returned the end of the USB d . .Pp . -.Fn libusb20_be_dequeue_device pbackend pdev -This function will dequeue the given USB device pointer from the +.Fn libusb20_be_dequeue_device +will dequeue the given USB device pointer from the backend USB device list. . Dequeued USB devices will not be freed when the backend is freed. . .Pp . -.Fn libusb20_be_enqueue_device pbackend pdev +.Fn libusb20_be_enqueue_device This function will enqueue the given USB device pointer in the backend USB device list. . Enqueued USB devices will get freed when the backend is freed. . .Pp . -.Fn libusb20_be_free pbackend -This function will free the given backend and all USB devices in its device list. +.Fn libusb20_be_free +will free the given backend and all USB devices in its device list. . . .Sh USB DESCRIPTOR PARSING From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 18:40:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3CA31065675; Sun, 5 Apr 2009 18:40:15 +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 A09938FC17; Sun, 5 Apr 2009 18:40:15 +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 n35IeFb0028894; Sun, 5 Apr 2009 18:40:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IeFBl028892; Sun, 5 Apr 2009 18:40:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904051840.n35IeFBl028892@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Apr 2009 18:40: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: r190747 - in head/sys: conf powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:40:16 -0000 Author: nwhitehorn Date: Sun Apr 5 18:40:15 2009 New Revision: 190747 URL: http://svn.freebsd.org/changeset/base/190747 Log: Add an Open Firmware access module for real-mode OF accesses to the PowerPC build. This is required for the IBM Mambo simulator, as well as a variety of non-Apple PowerPC hardware. Added: head/sys/powerpc/ofw/ofw_real.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Apr 5 18:30:24 2009 (r190746) +++ head/sys/conf/files.powerpc Sun Apr 5 18:40:15 2009 (r190747) @@ -111,6 +111,7 @@ powerpc/mpc85xx/opic.c optional mpc85xx powerpc/mpc85xx/pci_ocp.c optional pci mpc85xx powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim +powerpc/ofw/ofw_real.c optional aim powerpc/ofw/ofw_syscons.c optional sc aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio Added: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ofw/ofw_real.c Sun Apr 5 18:40:15 2009 (r190747) @@ -0,0 +1,922 @@ +/* $NetBSD: Locore.c,v 1.7 2000/08/20 07:04:59 tsubai Exp $ */ + +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ +/*- + * Copyright (C) 2000 Benno Rice. + * 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 Benno Rice ``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 TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include "ofw_if.h" + +static void ofw_real_init(ofw_t, void *openfirm); +static int ofw_real_test(ofw_t, const char *name); +static phandle_t ofw_real_peer(ofw_t, phandle_t node); +static phandle_t ofw_real_child(ofw_t, phandle_t node); +static phandle_t ofw_real_parent(ofw_t, phandle_t node); +static phandle_t ofw_real_instance_to_package(ofw_t, ihandle_t instance); +static ssize_t ofw_real_getproplen(ofw_t, phandle_t package, + const char *propname); +static ssize_t ofw_real_getprop(ofw_t, phandle_t package, const char *propname, + void *buf, size_t buflen); +static int ofw_real_nextprop(ofw_t, phandle_t package, const char *previous, + char *buf, size_t); +static int ofw_real_setprop(ofw_t, phandle_t package, char *propname, + void *buf, size_t len); +static ssize_t ofw_real_canon(ofw_t, const char *device, char *buf, size_t len); +static phandle_t ofw_real_finddevice(ofw_t, const char *device); +static ssize_t ofw_real_instance_to_path(ofw_t, ihandle_t instance, char *buf, + size_t len); +static ssize_t ofw_real_package_to_path(ofw_t, phandle_t package, char *buf, + size_t len); +static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method, + int nargs, int nreturns, unsigned long *args_and_returns); +static ihandle_t ofw_real_open(ofw_t, const char *device); +static void ofw_real_close(ofw_t, ihandle_t instance); +static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len); +static ssize_t ofw_real_write(ofw_t, ihandle_t instance, const void *addr, + size_t len); +static int ofw_real_seek(ofw_t, ihandle_t instance, u_int64_t pos); +static caddr_t ofw_real_claim(ofw_t, void *virt, size_t size, u_int align); +static void ofw_real_release(ofw_t, void *virt, size_t size); +static void ofw_real_enter(ofw_t); +static void ofw_real_exit(ofw_t); + +static ofw_method_t ofw_real_methods[] = { + OFWMETHOD(ofw_init, ofw_real_init), + OFWMETHOD(ofw_peer, ofw_real_peer), + OFWMETHOD(ofw_child, ofw_real_child), + OFWMETHOD(ofw_parent, ofw_real_parent), + OFWMETHOD(ofw_instance_to_package, ofw_real_instance_to_package), + OFWMETHOD(ofw_getproplen, ofw_real_getproplen), + OFWMETHOD(ofw_getprop, ofw_real_getprop), + OFWMETHOD(ofw_nextprop, ofw_real_nextprop), + OFWMETHOD(ofw_setprop, ofw_real_setprop), + OFWMETHOD(ofw_canon, ofw_real_canon), + OFWMETHOD(ofw_finddevice, ofw_real_finddevice), + OFWMETHOD(ofw_instance_to_path, ofw_real_instance_to_path), + OFWMETHOD(ofw_package_to_path, ofw_real_package_to_path), + + OFWMETHOD(ofw_test, ofw_real_test), + OFWMETHOD(ofw_call_method, ofw_real_call_method), + OFWMETHOD(ofw_open, ofw_real_open), + OFWMETHOD(ofw_close, ofw_real_close), + OFWMETHOD(ofw_read, ofw_real_read), + OFWMETHOD(ofw_write, ofw_real_write), + OFWMETHOD(ofw_seek, ofw_real_seek), + OFWMETHOD(ofw_claim, ofw_real_claim), + OFWMETHOD(ofw_release, ofw_real_release), + OFWMETHOD(ofw_enter, ofw_real_enter), + OFWMETHOD(ofw_exit, ofw_real_exit), + + { 0, 0 } +}; + +static ofw_def_t ofw_real = { + OFW_STD_REAL, + ofw_real_methods, + 0 +}; +OFW_DEF(ofw_real); + +MALLOC_DEFINE(M_OFWREAL, "ofwreal", "Open Firmware Real Mode Bounce Page"); + +static int (*openfirmware)(void *); + +static vm_offset_t of_bounce_phys; +static caddr_t of_bounce_virt; +static off_t of_bounce_offset; +static size_t of_bounce_size; +static struct mtx of_bounce_mtx; + +/* + * After the VM is up, allocate a wired, low memory bounce page. + */ + +static void ofw_real_bounce_alloc(void *); + +SYSINIT(ofw_real_bounce_alloc, SI_SUB_VM, SI_ORDER_ANY, + ofw_real_bounce_alloc, NULL); + +static void +ofw_real_start(void) +{ + mtx_lock(&of_bounce_mtx); + of_bounce_offset = 0; +} + +static void +ofw_real_stop(void) +{ + mtx_unlock(&of_bounce_mtx); +} + +static void +ofw_real_bounce_alloc(void *junk) +{ + /* + * Check that ofw_real is actually in use before allocating wads + * of memory. Do this by checking if our mutex has been set up. + */ + if (!mtx_initialized(&of_bounce_mtx)) + return; + + /* + * Allocate a page of contiguous, wired physical memory that can + * fit into a 32-bit address space. + */ + + mtx_lock(&of_bounce_mtx); + + of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, + 0, BUS_SPACE_MAXADDR_32BIT, PAGE_SIZE, PAGE_SIZE); + of_bounce_phys = vtophys(of_bounce_virt); + of_bounce_size = PAGE_SIZE; + + mtx_unlock(&of_bounce_mtx); +} + +static cell_t +ofw_real_map(const void *buf, size_t len) +{ + cell_t phys; + + mtx_assert(&of_bounce_mtx, MA_OWNED); + + if (of_bounce_virt == NULL) { + if (!pmap_bootstrapped) + return (cell_t)buf; + + /* + * XXX: It is possible for us to get called before the VM has + * come online, but after the MMU is up. We don't have the + * bounce buffer yet, but can no longer presume a 1:1 mapping. + * Grab the physical address of the buffer, and hope it is + * in range if this happens. + */ + return (cell_t)vtophys(buf); + } + + /* + * Make sure the bounce page offset satisfies any reasonable + * alignment constraint. + */ + of_bounce_offset += of_bounce_offset % sizeof(register_t); + + if (of_bounce_offset + len > of_bounce_size) { + panic("Oversize Open Firmware call!"); + return 0; + } + + memcpy(of_bounce_virt + of_bounce_offset, buf, len); + phys = of_bounce_phys + of_bounce_offset; + + of_bounce_offset += len; + + return phys; +} + +static void +ofw_real_unmap(cell_t physaddr, void *buf, size_t len) +{ + mtx_assert(&of_bounce_mtx, MA_OWNED); + + if (of_bounce_virt == NULL) + return; + + memcpy(buf,of_bounce_virt + (physaddr - of_bounce_phys),len); +} + +/* Initialiser */ + +static void +ofw_real_init(ofw_t ofw, void *openfirm) +{ + openfirmware = (int (*)(void *))openfirm; + + mtx_init(&of_bounce_mtx, "OF Bounce Page", MTX_DEF, 0); + of_bounce_virt = NULL; +} + +/* + * Generic functions + */ + +/* Test to see if a service exists. */ +static int +ofw_real_test(ofw_t ofw, const char *name) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t service; + cell_t missing; + } args = { + (cell_t)"test", + 1, + 1, + }; + + ofw_real_start(); + + args.service = ofw_real_map(name, strlen(name) + 1); + if (args.service == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.missing); +} + +/* + * Device tree functions + */ + +/* Return the next sibling of this node or 0. */ +static phandle_t +ofw_real_peer(ofw_t ofw, phandle_t node) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t node; + cell_t next; + } args = { + (cell_t)"peer", + 1, + 1, + }; + + args.node = node; + if (openfirmware(&args) == -1) + return (-1); + return (args.next); +} + +/* Return the first child of this node or 0. */ +static phandle_t +ofw_real_child(ofw_t ofw, phandle_t node) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t node; + cell_t child; + } args = { + (cell_t)"child", + 1, + 1, + }; + + args.node = node; + if (openfirmware(&args) == -1) + return (-1); + return (args.child); +} + +/* Return the parent of this node or 0. */ +static phandle_t +ofw_real_parent(ofw_t ofw, phandle_t node) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t node; + cell_t parent; + } args = { + (cell_t)"parent", + 1, + 1, + }; + + args.node = node; + if (openfirmware(&args) == -1) + return (-1); + return (args.parent); +} + +/* Return the package handle that corresponds to an instance handle. */ +static phandle_t +ofw_real_instance_to_package(ofw_t ofw, ihandle_t instance) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t package; + } args = { + (cell_t)"instance-to-package", + 1, + 1, + }; + + args.instance = instance; + if (openfirmware(&args) == -1) + return (-1); + return (args.package); +} + +/* Get the length of a property of a package. */ +static ssize_t +ofw_real_getproplen(ofw_t ofw, phandle_t package, const char *propname) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t package; + cell_t propname; + cell_t proplen; + } args = { + (cell_t)"getproplen", + 2, + 1, + }; + + ofw_real_start(); + + args.package = package; + args.propname = ofw_real_map(propname, strlen(propname) + 1); + if (args.propname == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.proplen); +} + +/* Get the value of a property of a package. */ +static ssize_t +ofw_real_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, + size_t buflen) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t package; + cell_t propname; + cell_t buf; + cell_t buflen; + cell_t size; + } args = { + (cell_t)"getprop", + 4, + 1, + }; + + ofw_real_start(); + + args.package = package; + args.propname = ofw_real_map(propname, strlen(propname) + 1); + args.buf = ofw_real_map(buf, buflen); + args.buflen = buflen; + if (args.propname == 0 || args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.buf, buf, buflen); + + ofw_real_stop(); + return (args.size); +} + +/* Get the next property of a package. */ +static int +ofw_real_nextprop(ofw_t ofw, phandle_t package, const char *previous, + char *buf, size_t size) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t package; + cell_t previous; + cell_t buf; + cell_t flag; + } args = { + (cell_t)"nextprop", + 3, + 1, + }; + + ofw_real_start(); + + args.package = package; + args.previous = ofw_real_map(previous, strlen(previous) + 1); + args.buf = ofw_real_map(buf, size); + if (args.previous == 0 || args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.buf, buf, size); + + ofw_real_stop(); + return (args.flag); +} + +/* Set the value of a property of a package. */ +/* XXX Has a bug on FirePower */ +static int +ofw_real_setprop(ofw_t ofw, phandle_t package, char *propname, void *buf, + size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t package; + cell_t propname; + cell_t buf; + cell_t len; + cell_t size; + } args = { + (cell_t)"setprop", + 4, + 1, + }; + + ofw_real_start(); + + args.package = package; + args.propname = ofw_real_map(propname, strlen(propname) + 1); + args.buf = ofw_real_map(buf, len); + args.len = len; + if (args.propname == 0 || args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.size); +} + +/* Convert a device specifier to a fully qualified pathname. */ +static ssize_t +ofw_real_canon(ofw_t ofw, const char *device, char *buf, size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t device; + cell_t buf; + cell_t len; + cell_t size; + } args = { + (cell_t)"canon", + 3, + 1, + }; + + ofw_real_start(); + + args.device = ofw_real_map(device, strlen(device) + 1); + args.buf = ofw_real_map(buf, len); + args.len = len; + if (args.device == 0 || args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.buf, buf, len); + + ofw_real_stop(); + return (args.size); +} + +/* Return a package handle for the specified device. */ +static phandle_t +ofw_real_finddevice(ofw_t ofw, const char *device) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t device; + cell_t package; + } args = { + (cell_t)"finddevice", + 1, + 1, + }; + + ofw_real_start(); + + args.device = ofw_real_map(device, strlen(device) + 1); + if (args.device == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.package); +} + +/* Return the fully qualified pathname corresponding to an instance. */ +static ssize_t +ofw_real_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t buf; + cell_t len; + cell_t size; + } args = { + (cell_t)"instance-to-path", + 3, + 1, + }; + + ofw_real_start(); + + args.instance = instance; + args.buf = ofw_real_map(buf, len); + args.len = len; + if (args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.buf, buf, len); + + ofw_real_stop(); + return (args.size); +} + +/* Return the fully qualified pathname corresponding to a package. */ +static ssize_t +ofw_real_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t package; + cell_t buf; + cell_t len; + cell_t size; + } args = { + (cell_t)"package-to-path", + 3, + 1, + }; + + ofw_real_start(); + + args.package = package; + args.buf = ofw_real_map(buf, len); + args.len = len; + if (args.buf == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.buf, buf, len); + + ofw_real_stop(); + return (args.size); +} + +/* Call the method in the scope of a given instance. */ +static int +ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, + int nargs, int nreturns, unsigned long *args_and_returns) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t method; + cell_t instance; + cell_t args_n_results[12]; + } args = { + (cell_t)"call-method", + 2, + 1, + }; + cell_t *cp; + unsigned long *ap; + int n; + + if (nargs > 6) + return (-1); + + ofw_real_start(); + args.nargs = nargs + 2; + args.nreturns = nreturns + 1; + args.method = ofw_real_map(method, strlen(method) + 1); + args.instance = instance; + + ap = args_and_returns; + for (cp = args.args_n_results + (n = nargs); --n >= 0;) + *--cp = *(ap++); + if (args.method == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + if (args.args_n_results[nargs]) + return (args.args_n_results[nargs]); + for (cp = args.args_n_results + nargs + (n = args.nreturns); --n > 0;) + *(ap++) = *--cp; + return (0); +} + +/* + * Device I/O functions + */ + +/* Open an instance for a device. */ +static ihandle_t +ofw_real_open(ofw_t ofw, const char *device) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t device; + cell_t instance; + } args = { + (cell_t)"open", + 1, + 1, + }; + + ofw_real_start(); + + args.device = ofw_real_map(device, strlen(device) + 1); + if (args.device == 0 || openfirmware(&args) == -1 + || args.instance == 0) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.instance); +} + +/* Close an instance. */ +static void +ofw_real_close(ofw_t ofw, ihandle_t instance) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + } args = { + (cell_t)"close", + 1, + }; + + args.instance = instance; + openfirmware(&args); +} + +/* Read from an instance. */ +static ssize_t +ofw_real_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t addr; + cell_t len; + cell_t actual; + } args = { + (cell_t)"read", + 3, + 1, + }; + + ofw_real_start(); + + args.instance = instance; + args.addr = ofw_real_map(addr, len); + args.len = len; + if (args.addr == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(args.addr, addr, len); + + ofw_real_stop(); + return (args.actual); +} + +/* Write to an instance. */ +static ssize_t +ofw_real_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t addr; + cell_t len; + cell_t actual; + } args = { + (cell_t)"write", + 3, + 1, + }; + + ofw_real_start(); + + args.instance = instance; + args.addr = ofw_real_map(addr, len); + args.len = len; + if (args.addr == 0 || openfirmware(&args) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_stop(); + return (args.actual); +} + +/* Seek to a position. */ +static int +ofw_real_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t instance; + cell_t poshi; + cell_t poslo; + cell_t status; + } args = { + (cell_t)"seek", + 3, + 1, + }; + + args.instance = instance; + args.poshi = pos >> 32; + args.poslo = pos; + if (openfirmware(&args) == -1) + return (-1); + return (args.status); +} + +/* + * Memory functions + */ + +/* Claim an area of memory. */ +static caddr_t +ofw_real_claim(ofw_t ofw, void *virt, size_t size, u_int align) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t virt; + cell_t size; + cell_t align; + cell_t baseaddr; + } args = { + (cell_t)"claim", + 3, + 1, + }; + + args.virt = (cell_t)virt; + args.size = size; + args.align = align; + if (openfirmware(&args) == -1) + return ((void *)-1); + return ((void *)args.baseaddr); +} + +/* Release an area of memory. */ +static void +ofw_real_release(ofw_t ofw, void *virt, size_t size) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t virt; + cell_t size; + } args = { + (cell_t)"release", + 2, + }; + + args.virt = (cell_t)virt; + args.size = size; + openfirmware(&args); +} + +/* + * Control transfer functions + */ + +/* Suspend and drop back to the Open Firmware interface. */ +static void +ofw_real_enter(ofw_t ofw) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + } args = { + (cell_t)"enter", + }; + + openfirmware(&args); + /* We may come back. */ +} + +/* Shut down and drop back to the Open Firmware interface. */ +static void +ofw_real_exit(ofw_t ofw) +{ + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + } args = { + (cell_t)"exit", + }; + + openfirmware(&args); + for (;;) /* just in case */ + ; +} + From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 19:09:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 647BF1065676; Sun, 5 Apr 2009 19:09:03 +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 3B9B48FC14; Sun, 5 Apr 2009 19:09:02 +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 n35J92FD029609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 5 Apr 2009 12:09:02 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <49D901CE.8030209@freebsd.org> Date: Sun, 05 Apr 2009 12:09:02 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Andrew Thompson References: <200904051820.n35IKn23027975@svn.freebsd.org> In-Reply-To: <200904051820.n35IKn23027975@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190735 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 19:09:03 -0000 Andrew Thompson wrote: > Author: thompsa > Date: Sun Apr 5 18:20:49 2009 > New Revision: 190735 > URL: http://svn.freebsd.org/changeset/base/190735 > > Log: > MFp4 //depot/projects/usb@159922 > > Refactor how we interface with the root HUB. This cuts around 1200 lines of > code totally and saves one thread per USB bus. > > Submitted by: Hans Petter Selasky > > > This comment does not describe the new scheme for interfacing with the root HUB. Please include an explanation. Sam From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 19:53:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7052010656E5; Sun, 5 Apr 2009 19:53:05 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by mx1.freebsd.org (Postfix) with ESMTP id 5935D8FC22; Sun, 5 Apr 2009 19:53:05 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from MacBook-Pro.lan.xcllnt.net (mail.xcllnt.net [75.101.29.67]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KHN008FQ8JX3N10@asmtp012.mac.com>; Sun, 05 Apr 2009 12:52:46 -0700 (PDT) Message-id: From: Marcel Moolenaar To: Rafal Jaworowski In-reply-to: <7F1FC303-3EFC-4182-9260-FE35C4BD9909@semihalf.com> Date: Sun, 05 Apr 2009 12:52:45 -0700 References: <200904042223.n34MN3RG082677@svn.freebsd.org> <7F1FC303-3EFC-4182-9260-FE35C4BD9909@semihalf.com> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190704 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 19:53:06 -0000 On Apr 5, 2009, at 2:03 AM, Rafal Jaworowski wrote: >> Log: >> Perform a dummy stwcx. when we switch contexts. The context >> being switched out may hold a reservation. The stwcx. will >> clear the reservation. This is architecturally recommended. >> >> The scenario this addresses is as follows: >> 1. Thread 1 performs a lwarx and as such holds a reservation. >> 2. Thread 1 gets switched out (before doing the matching >> stwcx.) and thread 2 is switched in. >> 3. Thread 2 performs a stwcx. to the same reservation granule. >> This will succeed because the processor has the reservation >> even though thread 2 didn't do the lwarx. >> >> Note that on some processors the address given the stwcx. is >> not checked. On these processors the mere condition of having >> a reservation would cause the stwcx. to succeed, irrespective >> of whether the addresses are the same. The dummy stwcx. is >> especially important for those processors. > > Have you seen this false stwcx. actually succeed in some real > scenarios on AIM? Were there any tangible [corruption?] effects > observed without this fix? I think so, but I may be mistaken easily. I've been running with this for a while on my SMP machine and it "felt" more stable. make release for example would always end with sh(1) dumping core. I don't see that anymore. > We're seeing some hang with the dual E500 under very heavy loads, > but only with ULE (or we could only correlate this with ULE so far), > but didn't get to really close investigation of this issue yet. I'm > wondering if it's something of this sort too. It's not impossible. I can only say: try it :-) -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 20:59:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF28106564A; Sun, 5 Apr 2009 20:59:27 +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 F0B748FC1E; Sun, 5 Apr 2009 20:59:26 +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 n35KxQpD033678; Sun, 5 Apr 2009 20:59:26 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35KxQD5033677; Sun, 5 Apr 2009 20:59:26 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904052059.n35KxQD5033677@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 5 Apr 2009 20:59: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: r190748 - head/tools/tools/sysbuild X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 20:59:27 -0000 Author: phk Date: Sun Apr 5 20:59:26 2009 New Revision: 190748 URL: http://svn.freebsd.org/changeset/base/190748 Log: Remember to clear the ports list before generation for prefetch Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sun Apr 5 18:40:15 2009 (r190747) +++ head/tools/tools/sysbuild/sysbuild.sh Sun Apr 5 20:59:26 2009 (r190748) @@ -214,6 +214,7 @@ ports_build() ( ports_prefetch() ( ( set +x + true > /tmp/_.plist ports_recurse $PORTS_WE_WANT # Now checksump/fetch them From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 21:24:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F7E91065674; Sun, 5 Apr 2009 21:24:16 +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 09A908FC13; Sun, 5 Apr 2009 21:24:16 +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 n35LOFET034435; Sun, 5 Apr 2009 21:24:15 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35LOF7S034434; Sun, 5 Apr 2009 21:24:15 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904052124.n35LOF7S034434@svn.freebsd.org> From: Paolo Pisati Date: Sun, 5 Apr 2009 21:24: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: r190749 - in head/sys: dev/ata dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/quirk dev/usb/serial dev/usb/storage dev/usb/tem... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 21:24:16 -0000 Author: piso Date: Sun Apr 5 21:24:15 2009 New Revision: 190749 URL: http://svn.freebsd.org/changeset/base/190749 Log: Remove pointeless mergeinfo that crept in from r190633. Modified: head/sys/dev/ata/ata-usb.c (props changed) head/sys/dev/sound/usb/uaudio.c (props changed) head/sys/dev/sound/usb/uaudio.h (props changed) head/sys/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/dev/sound/usb/uaudioreg.h (props changed) head/sys/dev/usb/README.TXT (props changed) head/sys/dev/usb/bluetooth/TODO.TXT (props changed) head/sys/dev/usb/bluetooth/ng_ubt.c (props changed) head/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) head/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) head/sys/dev/usb/controller/at91dci.c (props changed) head/sys/dev/usb/controller/at91dci.h (props changed) head/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) head/sys/dev/usb/controller/atmegadci.c (props changed) head/sys/dev/usb/controller/atmegadci.h (props changed) head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) head/sys/dev/usb/controller/ehci.c (props changed) head/sys/dev/usb/controller/ehci.h (props changed) head/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) head/sys/dev/usb/controller/ehci_mbus.c (props changed) head/sys/dev/usb/controller/ehci_pci.c (props changed) head/sys/dev/usb/controller/musb_otg.c (props changed) head/sys/dev/usb/controller/musb_otg.h (props changed) head/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci.c (props changed) head/sys/dev/usb/controller/ohci.h (props changed) head/sys/dev/usb/controller/ohci_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci_pci.c (props changed) head/sys/dev/usb/controller/uhci.c (props changed) head/sys/dev/usb/controller/uhci.h (props changed) head/sys/dev/usb/controller/uhci_pci.c (props changed) head/sys/dev/usb/controller/usb_controller.c (props changed) head/sys/dev/usb/controller/uss820dci.c (props changed) head/sys/dev/usb/controller/uss820dci.h (props changed) head/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) head/sys/dev/usb/input/uhid.c (props changed) head/sys/dev/usb/input/ukbd.c (props changed) head/sys/dev/usb/input/ums.c (props changed) head/sys/dev/usb/input/usb_rdesc.h (props changed) head/sys/dev/usb/misc/udbp.c (props changed) head/sys/dev/usb/misc/udbp.h (props changed) head/sys/dev/usb/misc/ufm.c (props changed) head/sys/dev/usb/net/if_aue.c (props changed) head/sys/dev/usb/net/if_auereg.h (props changed) head/sys/dev/usb/net/if_axe.c (props changed) head/sys/dev/usb/net/if_axereg.h (props changed) head/sys/dev/usb/net/if_cdce.c (props changed) head/sys/dev/usb/net/if_cdcereg.h (props changed) head/sys/dev/usb/net/if_cue.c (props changed) head/sys/dev/usb/net/if_cuereg.h (props changed) head/sys/dev/usb/net/if_kue.c (props changed) head/sys/dev/usb/net/if_kuefw.h (props changed) head/sys/dev/usb/net/if_kuereg.h (props changed) head/sys/dev/usb/net/if_rue.c (props changed) head/sys/dev/usb/net/if_ruereg.h (props changed) head/sys/dev/usb/net/if_udav.c (props changed) head/sys/dev/usb/net/if_udavreg.h (props changed) head/sys/dev/usb/net/usb_ethernet.c (props changed) head/sys/dev/usb/net/usb_ethernet.h (props changed) head/sys/dev/usb/quirk/usb_quirk.c (props changed) head/sys/dev/usb/quirk/usb_quirk.h (props changed) head/sys/dev/usb/serial/u3g.c (props changed) head/sys/dev/usb/serial/uark.c (props changed) head/sys/dev/usb/serial/ubsa.c (props changed) head/sys/dev/usb/serial/ubser.c (props changed) head/sys/dev/usb/serial/uchcom.c (props changed) head/sys/dev/usb/serial/ucycom.c (props changed) head/sys/dev/usb/serial/ufoma.c (props changed) head/sys/dev/usb/serial/uftdi.c (props changed) head/sys/dev/usb/serial/uftdi_reg.h (props changed) head/sys/dev/usb/serial/ugensa.c (props changed) head/sys/dev/usb/serial/uipaq.c (props changed) head/sys/dev/usb/serial/ulpt.c (props changed) head/sys/dev/usb/serial/umct.c (props changed) head/sys/dev/usb/serial/umodem.c (props changed) head/sys/dev/usb/serial/umoscom.c (props changed) head/sys/dev/usb/serial/uplcom.c (props changed) head/sys/dev/usb/serial/usb_serial.c (props changed) head/sys/dev/usb/serial/usb_serial.h (props changed) head/sys/dev/usb/serial/uslcom.c (props changed) head/sys/dev/usb/serial/uvisor.c (props changed) head/sys/dev/usb/serial/uvscom.c (props changed) head/sys/dev/usb/storage/rio500_usb.h (props changed) head/sys/dev/usb/storage/umass.c (props changed) head/sys/dev/usb/storage/urio.c (props changed) head/sys/dev/usb/storage/ustorage_fs.c (props changed) head/sys/dev/usb/template/usb_template.c (props changed) head/sys/dev/usb/template/usb_template.h (props changed) head/sys/dev/usb/template/usb_template_cdce.c (props changed) head/sys/dev/usb/template/usb_template_msc.c (props changed) head/sys/dev/usb/template/usb_template_mtp.c (props changed) head/sys/dev/usb/ufm_ioctl.h (props changed) head/sys/dev/usb/usb.h (props changed) head/sys/dev/usb/usb_bus.h (props changed) head/sys/dev/usb/usb_busdma.c (props changed) head/sys/dev/usb/usb_busdma.h (props changed) head/sys/dev/usb/usb_cdc.h (props changed) head/sys/dev/usb/usb_compat_linux.c (props changed) head/sys/dev/usb/usb_compat_linux.h (props changed) head/sys/dev/usb/usb_controller.h (props changed) head/sys/dev/usb/usb_core.c (props changed) head/sys/dev/usb/usb_core.h (props changed) head/sys/dev/usb/usb_debug.c (props changed) head/sys/dev/usb/usb_debug.h (props changed) head/sys/dev/usb/usb_defs.h (props changed) head/sys/dev/usb/usb_dev.c (props changed) head/sys/dev/usb/usb_dev.h (props changed) head/sys/dev/usb/usb_device.c (props changed) head/sys/dev/usb/usb_device.h (props changed) head/sys/dev/usb/usb_dynamic.c (props changed) head/sys/dev/usb/usb_dynamic.h (props changed) head/sys/dev/usb/usb_endian.h (props changed) head/sys/dev/usb/usb_error.c (props changed) head/sys/dev/usb/usb_error.h (props changed) head/sys/dev/usb/usb_generic.c (props changed) head/sys/dev/usb/usb_generic.h (props changed) head/sys/dev/usb/usb_handle_request.c (props changed) head/sys/dev/usb/usb_handle_request.h (props changed) head/sys/dev/usb/usb_hid.c (props changed) head/sys/dev/usb/usb_hid.h (props changed) head/sys/dev/usb/usb_hub.c (props changed) head/sys/dev/usb/usb_hub.h (props changed) head/sys/dev/usb/usb_if.m (props changed) head/sys/dev/usb/usb_ioctl.h (props changed) head/sys/dev/usb/usb_lookup.c (props changed) head/sys/dev/usb/usb_lookup.h (props changed) head/sys/dev/usb/usb_mbuf.c (props changed) head/sys/dev/usb/usb_mbuf.h (props changed) head/sys/dev/usb/usb_mfunc.h (props changed) head/sys/dev/usb/usb_msctest.c (props changed) head/sys/dev/usb/usb_msctest.h (props changed) head/sys/dev/usb/usb_parse.c (props changed) head/sys/dev/usb/usb_parse.h (props changed) head/sys/dev/usb/usb_pci.h (props changed) head/sys/dev/usb/usb_process.c (props changed) head/sys/dev/usb/usb_process.h (props changed) head/sys/dev/usb/usb_request.c (props changed) head/sys/dev/usb/usb_request.h (props changed) head/sys/dev/usb/usb_revision.h (props changed) head/sys/dev/usb/usb_sw_transfer.c (props changed) head/sys/dev/usb/usb_sw_transfer.h (props changed) head/sys/dev/usb/usb_transfer.c (props changed) head/sys/dev/usb/usb_transfer.h (props changed) head/sys/dev/usb/usb_util.c (props changed) head/sys/dev/usb/usb_util.h (props changed) head/sys/dev/usb/usbdevs (props changed) head/sys/dev/usb/usbhid.h (props changed) head/sys/dev/usb/wlan/if_rum.c (props changed) head/sys/dev/usb/wlan/if_rumfw.h (props changed) head/sys/dev/usb/wlan/if_rumreg.h (props changed) head/sys/dev/usb/wlan/if_rumvar.h (props changed) head/sys/dev/usb/wlan/if_ural.c (props changed) head/sys/dev/usb/wlan/if_uralreg.h (props changed) head/sys/dev/usb/wlan/if_uralvar.h (props changed) head/sys/dev/usb/wlan/if_zyd.c (props changed) head/sys/dev/usb/wlan/if_zydfw.h (props changed) head/sys/dev/usb/wlan/if_zydreg.h (props changed) head/sys/dev/usb/wlan/usb_wlan.h (props changed) head/sys/legacy/dev/ata/ata-usb.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.h (props changed) head/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) head/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) head/sys/xen/evtchn.h (props changed) head/sys/xen/hypervisor.h (props changed) head/sys/xen/xen_intr.h (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 21:52:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39913106564A; Sun, 5 Apr 2009 21:52:14 +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 275418FC15; Sun, 5 Apr 2009 21:52:14 +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 n35LqEf0035020; Sun, 5 Apr 2009 21:52:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35LqEx7035019; Sun, 5 Apr 2009 21:52:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904052152.n35LqEx7035019@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Apr 2009 21:52: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: r190750 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 21:52:14 -0000 Author: nwhitehorn Date: Sun Apr 5 21:52:13 2009 New Revision: 190750 URL: http://svn.freebsd.org/changeset/base/190750 Log: Fix the build when KDB is disabled. The second instance of rfi in trap_subr.S that is patched at runtime to rfid on 64-bit systems is inside KDB-specific code, so don't patch it without KDB. Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sun Apr 5 21:24:15 2009 (r190749) +++ head/sys/powerpc/aim/machdep.c Sun Apr 5 21:52:13 2009 (r190750) @@ -383,7 +383,10 @@ powerpc_init(u_int startkernel, u_int en if (ppc64) { /* Patch the two instances of rfi -> rfid */ bcopy(&rfid_patch,&rfi_patch1,4); + #ifdef KDB + /* rfi_patch2 is at the end of dbleave */ bcopy(&rfid_patch,&rfi_patch2,4); + #endif /* * Copy a code snippet to restore 32-bit bridge mode From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 22:08:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB316106566B; Sun, 5 Apr 2009 22:08:18 +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 A692E8FC14; Sun, 5 Apr 2009 22:08:18 +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 n35M8If2035418; Sun, 5 Apr 2009 22:08:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35M8IjT035411; Sun, 5 Apr 2009 22:08:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904052208.n35M8IjT035411@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Apr 2009 22:08: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: r190751 - in head: . rescue/rescue sbin sbin/slattach sbin/startslip share/man/man4 share/mk sys/net tools/build/options usr.sbin usr.sbin/pppd usr.sbin/pppstats usr.sbin/sliplogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 22:08:19 -0000 Author: ed Date: Sun Apr 5 22:08:18 2009 New Revision: 190751 URL: http://svn.freebsd.org/changeset/base/190751 Log: Remove if_ppp(4) and if_sl(4). Not only did these two drivers depend on IFF_NEEDSGIANT, they were broken 7 months ago during the MPSAFE TTY import. if_ppp(4) has been replaced by ppp(8). There is no replacement for if_sl(4). If we see regressions in for example the ports tree, we should just use __FreeBSD_version 800045 to check whether if_ppp(4) and if_sl(4) are present. Version 800045 is used to denote the import of MPSAFE TTY. Discussed with: rwatson, but also rwatson's IFF_NEEDSGIANT emails on the lists. Deleted: head/sbin/slattach/ head/sbin/startslip/ head/share/man/man4/ppp.4 head/share/man/man4/sl.4 head/sys/net/bsd_comp.c head/sys/net/if_ppp.c head/sys/net/if_ppp.h head/sys/net/if_pppvar.h head/sys/net/if_sl.c head/sys/net/if_slvar.h head/sys/net/ppp_comp.h head/sys/net/ppp_deflate.c head/sys/net/ppp_tty.c head/sys/net/slip.h head/tools/build/options/WITHOUT_SLIP head/usr.sbin/pppd/ head/usr.sbin/pppstats/ head/usr.sbin/sliplogin/ Modified: head/ObsoleteFiles.inc head/rescue/rescue/Makefile head/sbin/Makefile head/share/man/man4/Makefile head/share/mk/bsd.own.mk head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Apr 5 21:52:13 2009 (r190750) +++ head/ObsoleteFiles.inc Sun Apr 5 22:08:18 2009 (r190751) @@ -14,6 +14,26 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090405: removal of if_ppp(4) and if_sl(4) +OLD_FILES+=sbin/slattach +OLD_FILES+=sbin/startslip +OLD_FILES+=usr/include/net/if_ppp.h +OLD_FILES+=usr/include/net/if_pppvar.h +OLD_FILES+=usr/include/net/if_slvar.h +OLD_FILES+=usr/include/net/ppp_comp.h +OLD_FILES+=usr/include/net/slip.h +OLD_FILES+=usr/sbin/sliplogin +OLD_FILES+=usr/sbin/pppd +OLD_FILES+=usr/sbin/pppstats +OLD_FILES+=usr/share/man/man1/startslip.1.gz +OLD_FILES+=usr/share/man/man4/if_ppp.4.gz +OLD_FILES+=usr/share/man/man4/if_sl.4.gz +OLD_FILES+=usr/share/man/man4/ppp.4.gz +OLD_FILES+=usr/share/man/man4/sl.4.gz +OLD_FILES+=usr/share/man/man8/pppd.8.gz +OLD_FILES+=usr/share/man/man8/pppstats.8.gz +OLD_FILES+=usr/share/man/man8/slattach.8.gz +OLD_FILES+=usr/share/man/man8/sliplogin.8.gz # 20090319: uscanner(4) has been removed OLD_FILES+=usr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sun Apr 5 21:52:13 2009 (r190750) +++ head/rescue/rescue/Makefile Sun Apr 5 22:08:18 2009 (r190751) @@ -118,7 +118,7 @@ CRUNCH_PROGS_sbin= atacontrol badsect mount_udf mount_unionfs newfs \ newfs_msdos nos-tun ping reboot \ restore rcorder route routed rtquery rtsol savecore \ - slattach spppcontrol startslip swapon sysctl tunefs umount + spppcontrol swapon sysctl tunefs umount .if ${MK_ATM} != "no" CRUNCH_PROGS_sbin+= atmconfig Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Sun Apr 5 21:52:13 2009 (r190750) +++ head/sbin/Makefile Sun Apr 5 22:08:18 2009 (r190751) @@ -82,9 +82,7 @@ SUBDIR= adjkerntz \ ${_sconfig} \ setkey \ shutdown \ - slattach \ spppcontrol \ - ${_startslip} \ ${_sunlabel} \ swapon \ sysctl \ @@ -130,10 +128,6 @@ _quotacheck= quotacheck _routed= routed .endif -.if ${MK_SLIP} != "no" -_startslip= startslip -.endif - .if ${MACHINE_ARCH} == "i386" .if ${MACHINE} == "i386" _fdisk= fdisk Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Apr 5 21:52:13 2009 (r190750) +++ head/share/man/man4/Makefile Sun Apr 5 22:08:18 2009 (r190751) @@ -289,7 +289,6 @@ MAN= aac.4 \ ppbus.4 \ ppc.4 \ ppi.4 \ - ppp.4 \ psm.4 \ pst.4 \ pt.4 \ @@ -324,7 +323,6 @@ MAN= aac.4 \ sio.4 \ sis.4 \ sk.4 \ - sl.4 \ smb.4 \ smbus.4 \ smp.4 \ @@ -531,7 +529,6 @@ MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ pcm.4 sound.4 MLINKS+=pcn.4 if_pcn.4 -MLINKS+=ppp.4 if_ppp.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 @@ -544,7 +541,6 @@ MLINKS+=scsi.4 CAM.4 \ MLINKS+=sf.4 if_sf.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 -MLINKS+=sl.4 if_sl.4 MLINKS+=smp.4 SMP.4 MLINKS+=sn.4 if_sn.4 MLINKS+=snd_envy24.4 snd_ak452x.4 Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Apr 5 21:52:13 2009 (r190750) +++ head/share/mk/bsd.own.mk Sun Apr 5 22:08:18 2009 (r190751) @@ -372,7 +372,6 @@ WITH_IDEA= SENDMAIL \ SETUID_LOGIN \ SHAREDOCS \ - SLIP \ SSP \ SYSINSTALL \ SYMVER \ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Apr 5 21:52:13 2009 (r190750) +++ head/usr.sbin/Makefile Sun Apr 5 22:08:18 2009 (r190751) @@ -129,8 +129,6 @@ SUBDIR= ${_ac} \ powerd \ ${_ppp} \ ${_pppctl} \ - ${_pppd} \ - ${_pppstats} \ ${_praliases} \ ${_praudit} \ procctl \ @@ -166,7 +164,6 @@ SUBDIR= ${_ac} \ setfmac \ setpmac \ ${_sicontrol} \ - ${_sliplogin} \ ${_slstat} \ smbmsg \ snapinfo \ @@ -363,8 +360,6 @@ _portsnap= portsnap .if ${MK_PPP} != "no" _ppp= ppp #_pppctl handled below -_pppd= pppd -_pppstats= pppstats .endif .if ${MK_QUOTAS} != "no" @@ -385,11 +380,6 @@ _praliases= praliases _sendmail= sendmail .endif -.if ${MK_SLIP} != "no" -_sliplogin= sliplogin -_slstat= slstat -.endif - .if ${MK_SYSINSTALL} != "no" .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ ${MACHINE_ARCH} == "sparc64" From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 22:15:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE377106566B; Sun, 5 Apr 2009 22:15:35 +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 DC2B28FC17; Sun, 5 Apr 2009 22:15:35 +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 n35MFZ5h035651; Sun, 5 Apr 2009 22:15:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35MFZlX035650; Sun, 5 Apr 2009 22:15:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904052215.n35MFZlX035650@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Apr 2009 22:15: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: r190752 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 22:15:36 -0000 Author: ed Date: Sun Apr 5 22:15:35 2009 New Revision: 190752 URL: http://svn.freebsd.org/changeset/base/190752 Log: Regenerate src.conf.5. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Apr 5 22:08:18 2009 (r190751) +++ head/share/man/man5/src.conf.5 Sun Apr 5 22:15:35 2009 (r190752) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 174548 2007-12-12 16:39:32Z ru +.\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd September 23, 2008 +.Dd April 5, 2009 .Dt SRC.CONF 5 .Os .Sh NAME @@ -462,7 +462,7 @@ On amd64, set to not build 32-bit librar .Nm ld-elf32.so.1 runtime linker. .It Va WITHOUT_LIBPTHREAD -.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 172498 2007-10-09 17:53:33Z obrien +.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the .Nm libpthread providing library, @@ -721,11 +721,6 @@ as a set-user-ID root program. Set to not build the .Bx 4.4 legacy docs. -.It Va WITHOUT_SLIP -.\" from FreeBSD: head/tools/build/options/WITHOUT_SLIP 183242 2008-09-21 22:02:26Z sam -Set to not build -.Xr sliplogin 8 -and related programs. .It Va WITHOUT_SSP .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 23:25:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F12A9106564A; Sun, 5 Apr 2009 23:25:06 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF4DB8FC08; Sun, 5 Apr 2009 23:25:06 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35NP64d036906; Sun, 5 Apr 2009 23:25:06 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35NP6bo036905; Sun, 5 Apr 2009 23:25:06 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904052325.n35NP6bo036905@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 5 Apr 2009 23:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190753 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 23:25:07 -0000 Author: kan Date: Sun Apr 5 23:25:06 2009 New Revision: 190753 URL: http://svn.freebsd.org/changeset/base/190753 Log: If KTR_SUBSYS is compiled in, it does not necessarily mean that user is interested in being spammed by mcast-related printfs. Use proper check against ktr_mask instead KTR_COMPILE. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sun Apr 5 22:15:35 2009 (r190752) +++ head/sys/netinet/in_mcast.c Sun Apr 5 23:25:06 2009 (r190753) @@ -2838,7 +2838,7 @@ inm_print(const struct in_multi *inm) { int t; - if ((KTR_COMPILE & KTR_IGMPV3) == 0) + if ((ktr_mask & KTR_IGMPV3) == 0) return; printf("%s: --- begin inm %p ---\n", __func__, inm); From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 00:22:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C63110657C0; Mon, 6 Apr 2009 00:22:35 +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 C3D0F8FC0C; Mon, 6 Apr 2009 00:22:34 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 7C3ECFF29; Mon, 6 Apr 2009 12:22:33 +1200 (NZST) 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 HYfwPsO5TePE; Mon, 6 Apr 2009 12:22:29 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 6 Apr 2009 12:22:29 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 4C1B11142F; Mon, 6 Apr 2009 12:22:29 +1200 (NZST) Date: Sun, 5 Apr 2009 17:22:29 -0700 From: Andrew Thompson To: Paolo Pisati Message-ID: <20090406002229.GD52408@citylink.fud.org.nz> References: <200904052124.n35LOF7S034434@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904052124.n35LOF7S034434@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: r190749 - in head/sys: dev/ata dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/quirk dev/usb/serial dev/usb/storage dev/usb/tem... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 00:22:35 -0000 On Sun, Apr 05, 2009 at 09:24:15PM +0000, Paolo Pisati wrote: > Author: piso > Date: Sun Apr 5 21:24:15 2009 > New Revision: 190749 > URL: http://svn.freebsd.org/changeset/base/190749 > > Log: > Remove pointeless mergeinfo that crept in from r190633. Thanks! I was told this is a result of using 'svn mv' locally, can we get instructions out about how to do this properly. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 00:22:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B8F310657C0; Mon, 6 Apr 2009 00:22:50 +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 4747D8FC15; Mon, 6 Apr 2009 00:22:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n360MoCa039511; Mon, 6 Apr 2009 00:22:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n360MnJr039488; Mon, 6 Apr 2009 00:22:49 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904060022.n360MnJr039488@svn.freebsd.org> From: Andrew Thompson Date: Mon, 6 Apr 2009 00:22: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: r190754 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 00:22:50 -0000 Author: thompsa Date: Mon Apr 6 00:22:49 2009 New Revision: 190754 URL: http://svn.freebsd.org/changeset/base/190754 Log: Provide a better commit log for r190735, forced by making a whitespace change. Refactor how we interface with the root HUB. This is achieved by making a direct call from usb2_do_request to the host controller for root hub requests, this call will perform the controller specific register read/writes and return the error code. This cuts out a lot of code in the host controller files and saves one thread per USB bus. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/at91dci.h head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci.h head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg.h head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/ohci.h head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uhci.h head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/at91dci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); /* * NOTE: The "fifo_bank" is not reset in hardware when the endpoint is - * reset ! + * reset. * * NOTE: When the chip detects BUS-reset it will also reset the * endpoints, Function-address and more. Modified: head/sys/dev/usb/controller/at91dci.h ============================================================================== --- head/sys/dev/usb/controller/at91dci.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/at91dci.h Mon Apr 6 00:22:49 2009 (r190754) @@ -27,8 +27,8 @@ */ /* - * USB Device Port (UDP) register definition, based on - * "AT91RM9200.h" provided by ATMEL. + * USB Device Port (UDP) register definition, based on "AT91RM9200.h" provided + * by ATMEL. */ #ifndef _AT9100_DCI_H_ Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/atmegadci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -27,9 +27,8 @@ __FBSDID("$FreeBSD$"); */ /* - * This file contains the driver for the ATMEGA series USB OTG - * Controller. This driver currently only supports the DCI mode of the - * USB hardware. + * This file contains the driver for the ATMEGA series USB OTG Controller. This + * driver currently only supports the DCI mode of the USB hardware. */ /* Modified: head/sys/dev/usb/controller/atmegadci.h ============================================================================== --- head/sys/dev/usb/controller/atmegadci.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/atmegadci.h Mon Apr 6 00:22:49 2009 (r190754) @@ -25,8 +25,8 @@ */ /* - * USB Device Port register definitions, copied from ATMEGA - * documentation provided by ATMEL. + * USB Device Port register definitions, copied from ATMEGA documentation + * provided by ATMEL. */ #ifndef _ATMEGADCI_H_ Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/ehci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -39,7 +39,7 @@ */ /* - * TODO: + * TODO: * 1) command failures are not recovered correctly */ Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/ehci.h Mon Apr 6 00:22:49 2009 (r190754) @@ -40,7 +40,7 @@ #define EHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) -/* PCI config registers */ +/* PCI config registers */ #define PCI_CBMEM 0x10 /* configuration base MEM */ #define PCI_INTERFACE_EHCI 0x20 #define PCI_USBREV 0x60 /* RO USB protocol revision */ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/musb_otg.c Mon Apr 6 00:22:49 2009 (r190754) @@ -25,8 +25,8 @@ */ /* - * Thanks to Mentor Graphics for providing a reference driver for this - * USB chip at their homepage. + * Thanks to Mentor Graphics for providing a reference driver for this USB chip + * at their homepage. */ /* Modified: head/sys/dev/usb/controller/musb_otg.h ============================================================================== --- head/sys/dev/usb/controller/musb_otg.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/musb_otg.h Mon Apr 6 00:22:49 2009 (r190754) @@ -25,8 +25,8 @@ */ /* - * This header file defines the registers of the Mentor Graphics - * USB OnTheGo Inventra chip. + * This header file defines the registers of the Mentor Graphics USB OnTheGo + * Inventra chip. */ #ifndef _MUSB2_OTG_H_ Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/ohci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); * USB Open Host Controller driver. * * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html - * USB spec: http://www.usb.org/developers/docs/usbspec.zip + * USB spec: http://www.usb.org/developers/docs/usbspec.zip */ #include Modified: head/sys/dev/usb/controller/ohci.h ============================================================================== --- head/sys/dev/usb/controller/ohci.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/ohci.h Mon Apr 6 00:22:49 2009 (r190754) @@ -41,7 +41,7 @@ #define OHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) -/* PCI config registers */ +/* PCI config registers */ #define PCI_CBMEM 0x10 /* configuration base memory */ #define PCI_INTERFACE_OHCI 0x10 Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/uhci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); * Handles e.g. PIIX3 and PIIX4. * * UHCI spec: http://developer.intel.com/design/USB/UHCI11D.htm - * USB spec: http://www.usb.org/developers/docs/usbspec.zip + * USB spec: http://www.usb.org/developers/docs/usbspec.zip * PIIXn spec: ftp://download.intel.com/design/intarch/datashts/29055002.pdf * ftp://download.intel.com/design/intarch/datashts/29056201.pdf */ Modified: head/sys/dev/usb/controller/uhci.h ============================================================================== --- head/sys/dev/usb/controller/uhci.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/uhci.h Mon Apr 6 00:22:49 2009 (r190754) @@ -41,7 +41,7 @@ #define UHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) -/* PCI config registers */ +/* PCI config registers */ #define PCI_USBREV 0x60 /* USB protocol revision */ #define PCI_USB_REV_MASK 0xff #define PCI_USB_REV_PRE_1_0 0x00 Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/usb_controller.c Mon Apr 6 00:22:49 2009 (r190754) @@ -41,7 +41,7 @@ #include #include -/* function prototypes */ +/* function prototypes */ static device_probe_t usb2_probe; static device_attach_t usb2_attach; Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/controller/uss820dci.c Mon Apr 6 00:22:49 2009 (r190754) @@ -29,7 +29,7 @@ * This file contains the driver for the USS820 series USB Device * Controller * - * NOTE: The datasheet does not document everything! + * NOTE: The datasheet does not document everything. */ #include Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_bus.h Mon Apr 6 00:22:49 2009 (r190754) @@ -28,8 +28,8 @@ #define _USB2_BUS_H_ /* - * The following structure defines the USB explore message sent to the - * USB explore process. + * The following structure defines the USB explore message sent to the USB + * explore process. */ struct usb2_bus_msg { Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_controller.h Mon Apr 6 00:22:49 2009 (r190754) @@ -31,7 +31,7 @@ #define USB_BUS_DMA_TAG_MAX 8 -/* structure prototypes */ +/* structure prototypes */ struct usb2_bus; struct usb2_page; Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_core.h Mon Apr 6 00:22:49 2009 (r190754) @@ -25,8 +25,7 @@ */ /* - * Including this file is mandatory for all USB related c-files in the - * kernel. + * Including this file is mandatory for all USB related c-files in the kernel. */ #ifndef _USB2_CORE_H_ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_device.c Mon Apr 6 00:22:49 2009 (r190754) @@ -55,7 +55,7 @@ #include #include -/* function prototypes */ +/* function prototypes */ static void usb2_init_pipe(struct usb2_device *, uint8_t, struct usb2_endpoint_descriptor *, struct usb2_pipe *); Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_hub.c Mon Apr 6 00:22:49 2009 (r190754) @@ -27,7 +27,7 @@ */ /* - * USB spec: http://www.usb.org/developers/docs/usbspec.zip + * USB spec: http://www.usb.org/developers/docs/usbspec.zip */ #include Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_hub.h Mon Apr 6 00:22:49 2009 (r190754) @@ -28,7 +28,7 @@ #define _USB2_HUB_H_ /* - * The following structure defines an USB port. + * The following structure defines an USB port. */ struct usb2_port { uint8_t restartcnt; Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_request.c Mon Apr 6 00:22:49 2009 (r190754) @@ -24,7 +24,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ #include #include Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sun Apr 5 23:25:06 2009 (r190753) +++ head/sys/dev/usb/usb_transfer.c Mon Apr 6 00:22:49 2009 (r190754) @@ -22,7 +22,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ #include #include From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 00:25:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D41C0106566C; Mon, 6 Apr 2009 00:25:16 +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 936AA8FC15; Mon, 6 Apr 2009 00:25:16 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id EF7ACFF2D; Mon, 6 Apr 2009 12:25:15 +1200 (NZST) 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 Ewza-HWVPtQS; Mon, 6 Apr 2009 12:25:12 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 6 Apr 2009 12:25:12 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id A72571142F; Mon, 6 Apr 2009 12:25:12 +1200 (NZST) Date: Sun, 5 Apr 2009 17:25:12 -0700 From: Andrew Thompson To: Sam Leffler Message-ID: <20090406002512.GE52408@citylink.fud.org.nz> References: <200904051820.n35IKn23027975@svn.freebsd.org> <49D901CE.8030209@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49D901CE.8030209@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: r190735 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 00:25:17 -0000 On Sun, Apr 05, 2009 at 12:09:02PM -0700, Sam Leffler wrote: > Andrew Thompson wrote: >> Author: thompsa >> Date: Sun Apr 5 18:20:49 2009 >> New Revision: 190735 >> URL: http://svn.freebsd.org/changeset/base/190735 >> >> Log: >> MFp4 //depot/projects/usb@159922 >> Refactor how we interface with the root HUB. This cuts around 1200 >> lines of >> code totally and saves one thread per USB bus. >> Submitted by: Hans Petter Selasky >> >> >> > This comment does not describe the new scheme for interfacing with the root > HUB. Please include an explanation. My bad, this got caught up in the sync. I have forced a new commit log. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 00:32:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69066106566B; Mon, 6 Apr 2009 00:32:58 +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 5427C8FC18; Mon, 6 Apr 2009 00:32:58 +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 n360WuKY040049; Mon, 6 Apr 2009 00:32:56 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n360WtUJ040033; Mon, 6 Apr 2009 00:32:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904060032.n360WtUJ040033@svn.freebsd.org> From: Andrew Thompson Date: Mon, 6 Apr 2009 00:32: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: r190755 - in head/sys: conf dev/usb dev/usb/controller modules/usb/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 00:32:59 -0000 Author: thompsa Date: Mon Apr 6 00:32:54 2009 New Revision: 190755 URL: http://svn.freebsd.org/changeset/base/190755 Log: Remove usb_sw_transfer.[ch] which are now empty after r190735. Deleted: head/sys/dev/usb/usb_sw_transfer.c head/sys/dev/usb/usb_sw_transfer.h Modified: head/sys/conf/files head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mbus.c head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg_atmelarm.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/uss820dci_atmelarm.c head/sys/modules/usb/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/conf/files Mon Apr 6 00:32:54 2009 (r190755) @@ -1585,7 +1585,6 @@ dev/usb/usb_msctest.c optional usb dev/usb/usb_parse.c optional usb dev/usb/usb_process.c optional usb dev/usb/usb_request.c optional usb -dev/usb/usb_sw_transfer.c optional usb dev/usb/usb_transfer.c optional usb dev/usb/usb_util.c optional usb # Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/at91dci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Mon Apr 6 00:32:54 2009 (r190755) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/atmegadci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/atmegadci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci_atmelarm.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/atmegadci_atmelarm.c Mon Apr 6 00:32:54 2009 (r190755) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ehci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_ixp4xx.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ehci_ixp4xx.c Mon Apr 6 00:32:54 2009 (r190755) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/ehci_mbus.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mbus.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ehci_mbus.c Mon Apr 6 00:32:54 2009 (r190755) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ehci_pci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/musb_otg.c Mon Apr 6 00:32:54 2009 (r190755) @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/musb_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_atmelarm.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/musb_otg_atmelarm.c Mon Apr 6 00:32:54 2009 (r190755) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ohci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Mon Apr 6 00:32:54 2009 (r190755) @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/ohci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ohci_pci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/ohci_pci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/uhci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/uhci_pci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/uss820dci.c Mon Apr 6 00:32:54 2009 (r190755) @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/controller/uss820dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci_atmelarm.c Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/dev/usb/controller/uss820dci_atmelarm.c Mon Apr 6 00:32:54 2009 (r190755) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/modules/usb/usb/Makefile ============================================================================== --- head/sys/modules/usb/usb/Makefile Mon Apr 6 00:22:49 2009 (r190754) +++ head/sys/modules/usb/usb/Makefile Mon Apr 6 00:32:54 2009 (r190755) @@ -36,7 +36,7 @@ SRCS= bus_if.h device_if.h usb_if.h usb_ usb_busdma.c usb_controller.c usb_compat_linux.c usb_core.c usb_debug.c \ usb_dev.c usb_device.c usb_dynamic.c usb_error.c usb_generic.c \ usb_handle_request.c usb_hid.c usb_hub.c usb_lookup.c usb_mbuf.c \ - usb_msctest.c usb_parse.c usb_process.c usb_request.c usb_sw_transfer.c \ + usb_msctest.c usb_parse.c usb_process.c usb_request.c \ usb_transfer.c usb_util.c .include From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 02:29:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9909B106564A; Mon, 6 Apr 2009 02:29:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87D048FC14; Mon, 6 Apr 2009 02:29:28 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n362TSXF046055; Mon, 6 Apr 2009 02:29:28 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n362TS9v046054; Mon, 6 Apr 2009 02:29:28 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904060229.n362TS9v046054@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 6 Apr 2009 02:29: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: r190756 - head/sys/dev/dcons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 02:29:29 -0000 Author: kan Date: Mon Apr 6 02:29:28 2009 New Revision: 190756 URL: http://svn.freebsd.org/changeset/base/190756 Log: Fix logic in MOD_LOAD handler to call dcons_attach after all successful dcons_drv_init invocations. Testing return value for 0 does not work for cases where dcons_drv_init was called already as part of low level console initialization. Modified: head/sys/dev/dcons/dcons_os.c Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Mon Apr 6 00:32:54 2009 (r190755) +++ head/sys/dev/dcons/dcons_os.c Mon Apr 6 02:29:28 2009 (r190756) @@ -403,8 +403,9 @@ dcons_modevent(module_t mode, int type, switch (type) { case MOD_LOAD: ret = dcons_drv_init(1); - if (ret == 0) { + if (ret != -1) dcons_attach(); + if (ret == 0) { dcons_cnprobe(&dcons_consdev); dcons_cninit(&dcons_consdev); cnadd(&dcons_consdev); From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 07:13:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B5EC1065675; Mon, 6 Apr 2009 07:13:27 +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 39D388FC2C; Mon, 6 Apr 2009 07:13:27 +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 n367DR7i059898; Mon, 6 Apr 2009 07:13:27 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n367DRUO059897; Mon, 6 Apr 2009 07:13:27 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200904060713.n367DRUO059897@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 6 Apr 2009 07:13: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: r190757 - head/sbin/routed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 07:13:28 -0000 Author: phk Date: Mon Apr 6 07:13:26 2009 New Revision: 190757 URL: http://svn.freebsd.org/changeset/base/190757 Log: Only raise WARNS to 6 on i386 and amd64, strict alignment platforms still barf at some of the gratuitous pointer gymnastics, and I do not see a simple solution. Modified: head/sbin/routed/Makefile Modified: head/sbin/routed/Makefile ============================================================================== --- head/sbin/routed/Makefile Mon Apr 6 02:29:28 2009 (r190756) +++ head/sbin/routed/Makefile Mon Apr 6 07:13:26 2009 (r190757) @@ -7,6 +7,10 @@ MAN= routed.8 SUBDIR= rtquery LDADD= -lmd DPADD= ${LIBMD} +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" WARNS?= 6 +.else +WARNS?= 0 +.endif .include From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 10:09:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3680106566C; Mon, 6 Apr 2009 10:09:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87E948FC20; Mon, 6 Apr 2009 10:09:20 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36A9KOk063518; Mon, 6 Apr 2009 10:09:20 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36A9K6l063517; Mon, 6 Apr 2009 10:09:20 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904061009.n36A9K6l063517@svn.freebsd.org> From: Randall Stewart Date: Mon, 6 Apr 2009 10:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 10:09:21 -0000 Author: rrs Date: Mon Apr 6 10:09:20 2009 New Revision: 190758 URL: http://svn.freebsd.org/changeset/base/190758 Log: Class based addressing went out in the early 90's. Basically if a entry is not route add -net xxx/bits then we should use the addr (xxx) to establish the number of bits by looking at the first non-zero bit. So if we enter route add -net 10.1.1.0 10.1.3.5 this is the same as doing route add -net 10.1.1.0/24 Since the 8th bit (zero counting) is set to 1 we set bits to 32-8. Users can of course still use the /x to change this behavior or in cases where the network is in the trailing part of the address, a "netmask" argument can be supplied to override what is established from the interpretation of the address itself. e.g: route add -net 10.1.1.8 -netmask 0xff00ffff should overide and place the proper CIDR mask in place. PR: 131365 MFC after: 1 week Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Mon Apr 6 07:13:26 2009 (r190757) +++ head/sbin/route/route.c Mon Apr 6 10:09:20 2009 (r190758) @@ -713,7 +713,7 @@ newroute(argc, argv) #ifdef INET6 if (af == AF_INET6) { rtm_addrs &= ~RTA_NETMASK; - memset((void *)&so_mask, 0, sizeof(so_mask)); + memset((void *)&so_mask, 0, sizeof(so_mask)); } #endif } @@ -803,21 +803,22 @@ inet_makenetandmask(net, sin, bits) addr = net << IN_CLASSC_NSHIFT; else addr = net; - - if (bits != 0) - mask = 0xffffffff << (32 - bits); - else if (net == 0) - mask = 0; - else if (IN_CLASSA(addr)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(addr)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(addr)) - mask = IN_CLASSC_NET; - else if (IN_MULTICAST(addr)) - mask = IN_CLASSD_NET; - else - mask = 0xffffffff; + /* + * If no /xx was specified we must cacluate the + * CIDR address. + */ + if ((bits == 0) && (addr != 0)) { + int i, j; + for(i=0,j=1; i<32; i++) { + if (addr & j) { + break; + } + j <<= 1; + } + /* i holds the first non zero bit */ + bits = 32 - i; + } + mask = 0xffffffff << (32 - bits); sin->sin_addr.s_addr = htonl(addr); sin = &so_mask.sin; From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 10:32:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 787351065679; Mon, 6 Apr 2009 10:32:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE998FC08; Mon, 6 Apr 2009 10:32:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36AWeCt064065; Mon, 6 Apr 2009 10:32:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36AWeEr064064; Mon, 6 Apr 2009 10:32:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904061032.n36AWeEr064064@svn.freebsd.org> From: Robert Watson Date: Mon, 6 Apr 2009 10:32: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: r190759 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 10:32:41 -0000 Author: rwatson Date: Mon Apr 6 10:32:40 2009 New Revision: 190759 URL: http://svn.freebsd.org/changeset/base/190759 Log: Add SDT DTrace probes for namei(): vfs:namei:lookup:entry takes parent directory vnode pointer, path to look up, and lookup flags. vfs:namei:lookup:return takes an error value, and if successful, the returned vnode pointer. MFC after: 1 month Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Mon Apr 6 10:09:20 2009 (r190758) +++ head/sys/kern/vfs_lookup.c Mon Apr 6 10:32:40 2009 (r190759) @@ -37,6 +37,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include "opt_mac.h" @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -65,6 +67,11 @@ __FBSDID("$FreeBSD$"); #define NAMEI_DIAGNOSTIC 1 #undef NAMEI_DIAGNOSTIC +SDT_PROVIDER_DECLARE(vfs); +SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", + "unsigned long"); +SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); + /* * Allocation zone for namei */ @@ -181,7 +188,6 @@ namei(struct nameidata *ndp) ktrnamei(cnp->cn_pnbuf); } #endif - /* * Get starting point for the translation. */ @@ -224,6 +230,8 @@ namei(struct nameidata *ndp) VFS_UNLOCK_GIANT(vfslocked); } } + SDT_PROBE(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, + cnp->cn_flags, 0, 0); vfslocked = VFS_LOCK_GIANT(dp->v_mount); for (;;) { /* @@ -252,6 +260,8 @@ namei(struct nameidata *ndp) cnp->cn_pnbuf = NULL; cnp->cn_nameptr = NULL; #endif + SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, + 0, 0); return (error); } vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; @@ -273,6 +283,8 @@ namei(struct nameidata *ndp) VFS_UNLOCK_GIANT(vfslocked); } else if (vfslocked) ndp->ni_cnd.cn_flags |= GIANTHELD; + SDT_PROBE(vfs, namei, lookup, return, 0, ndp->ni_vp, + 0, 0, 0); return (0); } if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { @@ -338,6 +350,7 @@ namei(struct nameidata *ndp) ndp->ni_vp = NULL; vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(vfslocked); + SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, 0, 0); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 10:39:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B01E10656D4; Mon, 6 Apr 2009 10:39:44 +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 64F048FC1C; Mon, 6 Apr 2009 10:39:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 239444378; Mon, 06 Apr 2009 13:39:42 +0300 Message-ID: <49D9DBED.6050805@FreeBSD.org> Date: Mon, 06 Apr 2009 13:39:41 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Randall Stewart References: <200904061009.n36A9K6l063517@svn.freebsd.org> In-Reply-To: <200904061009.n36A9K6l063517@svn.freebsd.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 10:39:44 -0000 Randall Stewart wrote: > Author: rrs > Date: Mon Apr 6 10:09:20 2009 > New Revision: 190758 > URL: http://svn.freebsd.org/changeset/base/190758 > > Log: > Class based addressing went out in the early 90's. Basically > if a entry is not route add -net xxx/bits then we should use > the addr (xxx) to establish the number of bits by looking at > the first non-zero bit. So if we enter > route add -net 10.1.1.0 10.1.3.5 > this is the same as doing > route add -net 10.1.1.0/24 > Since the 8th bit (zero counting) is set to 1 we set bits > to 32-8. > > Users can of course still use the /x to change this behavior > or in cases where the network is in the trailing part > of the address, a "netmask" argument can be supplied to > override what is established from the interpretation of the > address itself. e.g: > > route add -net 10.1.1.8 -netmask 0xff00ffff > > should overide and place the proper CIDR mask in place. > > PR: 131365 > MFC after: 1 week Are you sure that this is a good idea? Is this behavior described/recommended somewhere? IMHO specifying network without explicitly defined netmask is at least dangerous, if not wrong, in present classless addressing time. Changing existing behavior breaks POLA for some set of users, while benefits are not so obvious to me. With previous code networks 10.0.0.0 and 11.0.0.0 were treated as /8, but with this change it became /7 and /8 respectively. Author of the PR referred here expects network 192.168 to be treated as /16, but with your algorithm it will probably become /13. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 10:39:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B261065674; Mon, 6 Apr 2009 10:39:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 641AF8FC21; Mon, 6 Apr 2009 10:39:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2026646BA0; Mon, 6 Apr 2009 06:39:47 -0400 (EDT) Date: Mon, 6 Apr 2009 11:39:47 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <200904061009.n36A9K6l063517@svn.freebsd.org> Message-ID: References: <200904061009.n36A9K6l063517@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 10:39:48 -0000 On Mon, 6 Apr 2009, Randall Stewart wrote: > Author: rrs > Date: Mon Apr 6 10:09:20 2009 > New Revision: 190758 > URL: http://svn.freebsd.org/changeset/base/190758 > > Log: > Class based addressing went out in the early 90's. Basically > if a entry is not route add -net xxx/bits then we should use > the addr (xxx) to establish the number of bits by looking at > the first non-zero bit. So if we enter > route add -net 10.1.1.0 10.1.3.5 > this is the same as doing > route add -net 10.1.1.0/24 > Since the 8th bit (zero counting) is set to 1 we set bits > to 32-8. > > Users can of course still use the /x to change this behavior > or in cases where the network is in the trailing part > of the address, a "netmask" argument can be supplied to > override what is established from the interpretation of the > address itself. e.g: > > route add -net 10.1.1.8 -netmask 0xff00ffff > > should overide and place the proper CIDR mask in place. Does this maintain compatibility for people who may still mysteriously be specifying class-based IPs and netmasks in configuration files? If not, this should not be MFC'd... Robert N M Watson Computer Laboratory University of Cambridge > > PR: 131365 > MFC after: 1 week > > Modified: > head/sbin/route/route.c > > Modified: head/sbin/route/route.c > ============================================================================== > --- head/sbin/route/route.c Mon Apr 6 07:13:26 2009 (r190757) > +++ head/sbin/route/route.c Mon Apr 6 10:09:20 2009 (r190758) > @@ -713,7 +713,7 @@ newroute(argc, argv) > #ifdef INET6 > if (af == AF_INET6) { > rtm_addrs &= ~RTA_NETMASK; > - memset((void *)&so_mask, 0, sizeof(so_mask)); > + memset((void *)&so_mask, 0, sizeof(so_mask)); > } > #endif > } > @@ -803,21 +803,22 @@ inet_makenetandmask(net, sin, bits) > addr = net << IN_CLASSC_NSHIFT; > else > addr = net; > - > - if (bits != 0) > - mask = 0xffffffff << (32 - bits); > - else if (net == 0) > - mask = 0; > - else if (IN_CLASSA(addr)) > - mask = IN_CLASSA_NET; > - else if (IN_CLASSB(addr)) > - mask = IN_CLASSB_NET; > - else if (IN_CLASSC(addr)) > - mask = IN_CLASSC_NET; > - else if (IN_MULTICAST(addr)) > - mask = IN_CLASSD_NET; > - else > - mask = 0xffffffff; > + /* > + * If no /xx was specified we must cacluate the > + * CIDR address. > + */ > + if ((bits == 0) && (addr != 0)) { > + int i, j; > + for(i=0,j=1; i<32; i++) { > + if (addr & j) { > + break; > + } > + j <<= 1; > + } > + /* i holds the first non zero bit */ > + bits = 32 - i; > + } > + mask = 0xffffffff << (32 - bits); > > sin->sin_addr.s_addr = htonl(addr); > sin = &so_mask.sin; > From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 11:08:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DFDF1065750; Mon, 6 Apr 2009 11:08:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58F2B8FC18; Mon, 6 Apr 2009 11:08:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36B8XUS069365; Mon, 6 Apr 2009 11:08:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36B8X2g069364; Mon, 6 Apr 2009 11:08:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200904061108.n36B8X2g069364@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 6 Apr 2009 11:08: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: r190760 - head/release/picobsd/bridge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 11:08:39 -0000 Author: luigi Date: Mon Apr 6 11:08:33 2009 New Revision: 190760 URL: http://svn.freebsd.org/changeset/base/190760 Log: add some popular device and comment some potentially useful options Modified: head/release/picobsd/bridge/PICOBSD Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Mon Apr 6 10:32:40 2009 (r190759) +++ head/release/picobsd/bridge/PICOBSD Mon Apr 6 11:08:33 2009 (r190760) @@ -89,7 +89,10 @@ device uart # device miibus device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device nfe # nVidia nForce MCP on-board Ethernet +#device xl # 3Com device rl # RealTek 8129/8139 +device re # RealTek 8139C+/8169/8169S/8110S device sis # National/SiS device dc # DEC/Intel 21143 and various workalikes device ed @@ -104,6 +107,8 @@ device md # Memory "disks" #device faith 1 # IPv6-to-IPv4 relaying (translation) device tap +#options DEVICE_POLLING + # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! device bpf # Berkeley packet filter From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 11:14:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30E31065958; Mon, 6 Apr 2009 11:14:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9AE8FC1A; Mon, 6 Apr 2009 11:14:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36BEU6r069518; Mon, 6 Apr 2009 11:14:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36BEUB7069517; Mon, 6 Apr 2009 11:14:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200904061114.n36BEUB7069517@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 6 Apr 2009 11:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190761 - head/release/picobsd/mfs_tree/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 11:15:04 -0000 Author: luigi Date: Mon Apr 6 11:14:30 2009 New Revision: 190761 URL: http://svn.freebsd.org/changeset/base/190761 Log: provide the absolute path for /etc/rc1 Modified: head/release/picobsd/mfs_tree/etc/rc Modified: head/release/picobsd/mfs_tree/etc/rc ============================================================================== --- head/release/picobsd/mfs_tree/etc/rc Mon Apr 6 11:08:33 2009 (r190760) +++ head/release/picobsd/mfs_tree/etc/rc Mon Apr 6 11:14:30 2009 (r190761) @@ -23,5 +23,5 @@ for i in *; do [ -f $i.gz ] && rm $i done gzip -d *.gz -. rc1 +. /etc/rc1 exit 0 From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 12:43:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23700106568D; Mon, 6 Apr 2009 12:43:41 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 124188FC1F; Mon, 6 Apr 2009 12:43:41 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36ChevE071588; Mon, 6 Apr 2009 12:43:40 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36CheC4071587; Mon, 6 Apr 2009 12:43:40 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904061243.n36CheC4071587@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 6 Apr 2009 12:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190769 - head/sys/modules/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 12:43:41 -0000 Author: weongyo Date: Mon Apr 6 12:43:40 2009 New Revision: 190769 URL: http://svn.freebsd.org/changeset/base/190769 Log: connect uath(4) to the build. uath(4) should work on all architectures. Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Apr 6 12:00:51 2009 (r190768) +++ head/sys/modules/usb/Makefile Mon Apr 6 12:43:40 2009 (r190769) @@ -28,7 +28,7 @@ SUBDIR = usb #SUBDIR += ubt bluetooth_ng ubtfw SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} -SUBDIR += rum ural zyd +SUBDIR += rum uath ural zyd SUBDIR += uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 12:47:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6EE31065689; Mon, 6 Apr 2009 12:47:09 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C42528FC22; Mon, 6 Apr 2009 12:47:09 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36Cl9np071721; Mon, 6 Apr 2009 12:47:09 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36Cl9iI071720; Mon, 6 Apr 2009 12:47:09 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904061247.n36Cl9iI071720@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 6 Apr 2009 12:47: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: r190770 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 12:47:11 -0000 Author: weongyo Date: Mon Apr 6 12:47:09 2009 New Revision: 190770 URL: http://svn.freebsd.org/changeset/base/190770 Log: connect uath.4 to the build. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 6 12:43:40 2009 (r190769) +++ head/share/man/man4/Makefile Mon Apr 6 12:47:09 2009 (r190770) @@ -388,6 +388,7 @@ MAN= aac.4 \ u3g.4 \ uark.4 \ uart.4 \ + uath.4 \ ubsa.4 \ ubsec.4 \ ubser.4 \ @@ -561,6 +562,7 @@ MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 MLINKS+=u3g.4 u3gstub.4 +MLINKS+=uath.4 if_uath.4 MLINKS+=udav.4 if_udav.4 MLINKS+=upgt.4 if_upgt.4 MLINKS+=ural.4 if_ural.4 From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 13:09:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F36DA1065706; Mon, 6 Apr 2009 13:09:02 +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 E27288FC1B; Mon, 6 Apr 2009 13:09:02 +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 n36D92Se072239; Mon, 6 Apr 2009 13:09:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36D92so072238; Mon, 6 Apr 2009 13:09:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904061309.n36D92so072238@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Apr 2009 13:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190771 - head/sys/dev/dcons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:09:03 -0000 Author: ed Date: Mon Apr 6 13:09:02 2009 New Revision: 190771 URL: http://svn.freebsd.org/changeset/base/190771 Log: Reduce the dcons polling frequency to 25 Hz. It makes little sense to use 100 Hz polling in dcons. We cannot live without polling, because that's just how dcons works. It polls the buffer filled by the firewire hardware. 25 Hz is probably enough for most use cases. Discussed with: rwatson Tested by: kan Modified: head/sys/dev/dcons/dcons_os.c Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Mon Apr 6 12:47:09 2009 (r190770) +++ head/sys/dev/dcons/dcons_os.c Mon Apr 6 13:09:02 2009 (r190771) @@ -72,7 +72,7 @@ #ifndef DCONS_POLL_HZ -#define DCONS_POLL_HZ 100 +#define DCONS_POLL_HZ 25 #endif #ifndef DCONS_BUF_SIZE From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 13:14:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50FEC1065686; Mon, 6 Apr 2009 13:14:35 +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 401FB8FC12; Mon, 6 Apr 2009 13:14:35 +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 n36DEZAA072392; Mon, 6 Apr 2009 13:14:35 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36DEZuA072390; Mon, 6 Apr 2009 13:14:35 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200904061314.n36DEZuA072390@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 6 Apr 2009 13:14: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: r190772 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:14:35 -0000 Author: ru Date: Mon Apr 6 13:14:34 2009 New Revision: 190772 URL: http://svn.freebsd.org/changeset/base/190772 Log: - Added libpcap.so.5 to OLD_LIBS. - Added 32-bit versions of libusb20* to OLD_{LIBS,FILES}. - Added 32-bit version of libmp.so.6 to OLD_LIBS. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Apr 6 13:09:02 2009 (r190771) +++ head/ObsoleteFiles.inc Mon Apr 6 13:14:34 2009 (r190772) @@ -34,6 +34,11 @@ OLD_FILES+=usr/share/man/man8/pppd.8.gz OLD_FILES+=usr/share/man/man8/pppstats.8.gz OLD_FILES+=usr/share/man/man8/slattach.8.gz OLD_FILES+=usr/share/man/man8/sliplogin.8.gz +# 20090321: libpcap upgraded to 1.0.0 +OLD_LIBS+=lib/libpcap.so.5 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libpcap.so.5 +.endif # 20090319: uscanner(4) has been removed OLD_FILES+=usr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) @@ -44,8 +49,17 @@ OLD_FILES+=usr/lib/libusb20.a OLD_FILES+=usr/lib/libusb20.so OLD_FILES+=usr/lib/libusb20_p.a OLD_FILES+=usr/include/libusb20_compat01.h +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libusb20.so.1 +OLD_FILES+=usr/lib32/libusb20.a +OLD_FILES+=usr/lib32/libusb20.so +OLD_FILES+=usr/lib32/libusb20_p.a +.endif # 20090226: libmp(3) functions renamed OLD_LIBS+=usr/lib/libmp.so.6 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libmp.so.6 +.endif # 20090223: changeover of USB stacks OLD_FILES+=usr/include/dev/usb2/include/ufm2_ioctl.h OLD_FILES+=usr/include/dev/usb2/include/urio2_ioctl.h From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 13:33:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8859110656BA; Mon, 6 Apr 2009 13:33:35 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id 238078FC15; Mon, 6 Apr 2009 13:33:35 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n36DXXTT039597 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 6 Apr 2009 09:33:33 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1239024814; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=xJIOP95+Av/Pg1tSKBdROt0NaLiDR3M2kBN1qGYnQkAGUzSR60BJOtO O8ovVlJNBNZ2s89jX3TEqdBKIalTnwA== Message-Id: From: Randall Stewart To: Robert Watson In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 6 Apr 2009 09:33:33 -0400 References: <200904061009.n36A9K6l063517@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, Randall Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:33:36 -0000 Sure it should.. If you do route add -net 10.0.0.0 it will work.. Hmmm I wonder if more is not needed though.. let me think on this. What strange about the whole thing is that the behavior I put in used to work in previous releases... its rather strange actually.. I reviewed several of the past commits and I can't see what broke it. R On Apr 6, 2009, at 6:39 AM, Robert Watson wrote: > > On Mon, 6 Apr 2009, Randall Stewart wrote: > >> Author: rrs >> Date: Mon Apr 6 10:09:20 2009 >> New Revision: 190758 >> URL: http://svn.freebsd.org/changeset/base/190758 >> >> Log: >> Class based addressing went out in the early 90's. Basically >> if a entry is not route add -net xxx/bits then we should use >> the addr (xxx) to establish the number of bits by looking at >> the first non-zero bit. So if we enter >> route add -net 10.1.1.0 10.1.3.5 >> this is the same as doing >> route add -net 10.1.1.0/24 >> Since the 8th bit (zero counting) is set to 1 we set bits >> to 32-8. >> >> Users can of course still use the /x to change this behavior >> or in cases where the network is in the trailing part >> of the address, a "netmask" argument can be supplied to >> override what is established from the interpretation of the >> address itself. e.g: >> >> route add -net 10.1.1.8 -netmask 0xff00ffff >> >> should overide and place the proper CIDR mask in place. > > Does this maintain compatibility for people who may still > mysteriously be specifying class-based IPs and netmasks in > configuration files? If not, this should not be MFC'd... > > Robert N M Watson > Computer Laboratory > University of Cambridge > >> >> PR: 131365 >> MFC after: 1 week >> >> Modified: >> head/sbin/route/route.c >> >> Modified: head/sbin/route/route.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sbin/route/route.c Mon Apr 6 07:13:26 2009 (r190757) >> +++ head/sbin/route/route.c Mon Apr 6 10:09:20 2009 (r190758) >> @@ -713,7 +713,7 @@ newroute(argc, argv) >> #ifdef INET6 >> if (af == AF_INET6) { >> rtm_addrs &= ~RTA_NETMASK; >> - memset((void *)&so_mask, 0, sizeof(so_mask)); >> + memset((void *)&so_mask, 0, sizeof(so_mask)); >> } >> #endif >> } >> @@ -803,21 +803,22 @@ inet_makenetandmask(net, sin, bits) >> addr = net << IN_CLASSC_NSHIFT; >> else >> addr = net; >> - >> - if (bits != 0) >> - mask = 0xffffffff << (32 - bits); >> - else if (net == 0) >> - mask = 0; >> - else if (IN_CLASSA(addr)) >> - mask = IN_CLASSA_NET; >> - else if (IN_CLASSB(addr)) >> - mask = IN_CLASSB_NET; >> - else if (IN_CLASSC(addr)) >> - mask = IN_CLASSC_NET; >> - else if (IN_MULTICAST(addr)) >> - mask = IN_CLASSD_NET; >> - else >> - mask = 0xffffffff; >> + /* >> + * If no /xx was specified we must cacluate the >> + * CIDR address. >> + */ >> + if ((bits == 0) && (addr != 0)) { >> + int i, j; >> + for(i=0,j=1; i<32; i++) { >> + if (addr & j) { >> + break; >> + } >> + j <<= 1; >> + } >> + /* i holds the first non zero bit */ >> + bits = 32 - i; >> + } >> + mask = 0xffffffff << (32 - bits); >> >> sin->sin_addr.s_addr = htonl(addr); >> sin = &so_mask.sin; >> > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 13:35:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F3E10656D6; Mon, 6 Apr 2009 13:35:05 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id 3D9408FC17; Mon, 6 Apr 2009 13:35:05 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n36DZ3Tv039681 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 6 Apr 2009 09:35:04 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1239024904; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=jub88AaxtNrZXzITqGo8lVsRBOMpdJITO2SDom/cNCWOlDXbNEsuEzE VdiJl4jgSza0AKejJGQgww5JDR58eVg== Message-Id: <8ACFDA96-746E-49C9-B562-65DF82CD361B@lakerest.net> From: Randall Stewart To: Alexander Motin In-Reply-To: <49D9DBED.6050805@FreeBSD.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 6 Apr 2009 09:35:03 -0400 References: <200904061009.n36A9K6l063517@svn.freebsd.org> <49D9DBED.6050805@FreeBSD.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, Randall Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:35:06 -0000 Hmm. On Apr 6, 2009, at 6:39 AM, Alexander Motin wrote: > Randall Stewart wrote: >> Author: rrs >> Date: Mon Apr 6 10:09:20 2009 >> New Revision: 190758 >> URL: http://svn.freebsd.org/changeset/base/190758 >> >> Log: >> Class based addressing went out in the early 90's. Basically >> if a entry is not route add -net xxx/bits then we should use >> the addr (xxx) to establish the number of bits by looking at >> the first non-zero bit. So if we enter >> route add -net 10.1.1.0 10.1.3.5 >> this is the same as doing >> route add -net 10.1.1.0/24 >> Since the 8th bit (zero counting) is set to 1 we set bits >> to 32-8. >> >> Users can of course still use the /x to change this behavior >> or in cases where the network is in the trailing part >> of the address, a "netmask" argument can be supplied to >> override what is established from the interpretation of the >> address itself. e.g: >> >> route add -net 10.1.1.8 -netmask 0xff00ffff >> >> should overide and place the proper CIDR mask in place. >> >> PR: 131365 >> MFC after: 1 week > > Are you sure that this is a good idea? Is this behavior > described/recommended somewhere? IMHO specifying network without > explicitly defined netmask is at least dangerous, if not wrong, in > present classless addressing time. Changing existing behavior breaks > POLA for some set of users, while benefits are not so obvious to me. > With previous code networks 10.0.0.0 and 11.0.0.0 were treated as /8, > but with this change it became /7 and /8 respectively. Well it is how CIDR works.. and cidr's been around since before 1997. I can go dig up the RFC's that specifu this if you woudl like > > > Author of the PR referred here expects network 192.168 to be treated > as > /16, but with your algorithm it will probably become /13. Drat... your right.. hmm. I need to go back and see how the old 6.0 stuff used to work properly.. R > > > -- > Alexander Motin > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 13:50:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F81D106567D; Mon, 6 Apr 2009 13:50:05 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42A558FC15; Mon, 6 Apr 2009 13:50:05 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36Do5NR073150; Mon, 6 Apr 2009 13:50:05 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36Do57l073147; Mon, 6 Apr 2009 13:50:05 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200904061350.n36Do57l073147@svn.freebsd.org> From: David Schultz Date: Mon, 6 Apr 2009 13:50: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: r190773 - in head: lib/libc/stdio tools/regression/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 13:50:06 -0000 Author: das Date: Mon Apr 6 13:50:04 2009 New Revision: 190773 URL: http://svn.freebsd.org/changeset/base/190773 Log: Return -1 instead of 0 upon reaching EOF. This is somewhat ill-advised because it means getdelim() returns -1 for both error and EOF, and never returns 0. However, this is what the original GNU implementation does, and POSIX inherited the bug. Reported by: marcus@ Modified: head/lib/libc/stdio/getdelim.c head/lib/libc/stdio/getline.3 head/tools/regression/lib/libc/stdio/test-getdelim.c Modified: head/lib/libc/stdio/getdelim.c ============================================================================== --- head/lib/libc/stdio/getdelim.c Mon Apr 6 13:14:34 2009 (r190772) +++ head/lib/libc/stdio/getdelim.c Mon Apr 6 13:50:04 2009 (r190773) @@ -120,7 +120,6 @@ getdelim(char ** __restrict linep, size_ goto error; } - linelen = 0; if (*linecapp == 0) *linep = NULL; @@ -128,9 +127,12 @@ getdelim(char ** __restrict linep, size_ /* If fp is at EOF already, we just need space for the NUL. */ if (__sferror(fp) || expandtofit(linep, 1, linecapp)) goto error; - goto done; + FUNLOCKFILE(fp); + (*linep)[0] = '\0'; + return (-1); } + linelen = 0; while ((endp = memchr(fp->_p, delim, fp->_r)) == NULL) { if (sappend(linep, &linelen, linecapp, fp->_p, fp->_r)) goto error; Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Mon Apr 6 13:14:34 2009 (r190772) +++ head/lib/libc/stdio/getline.3 Mon Apr 6 13:50:04 2009 (r190773) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2009 +.Dd March 29, 2009 .Dt GETLINE 3 .Os .Sh NAME @@ -79,7 +79,7 @@ and functions return the number of characters written, excluding the terminating .Dv NUL . -The value \-1 is returned if an error occurs. +The value \-1 is returned if an error occurs, or if end-of-file is reached. .Sh EXAMPLES The following code fragment reads lines from a file and writes them to standard output. Modified: head/tools/regression/lib/libc/stdio/test-getdelim.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-getdelim.c Mon Apr 6 13:14:34 2009 (r190772) +++ head/tools/regression/lib/libc/stdio/test-getdelim.c Mon Apr 6 13:50:04 2009 (r190773) @@ -100,7 +100,7 @@ main(int argc, char *argv[]) assert(line[0] == '\0' && line[1] == '\0'); /* Third line: EOF */ line[0] = 'X'; - assert(getline(&line, &linecap, fp) == 0); + assert(getline(&line, &linecap, fp) == -1); assert(line[0] == '\0'); free(line); assert(feof(fp)); @@ -139,7 +139,7 @@ main(int argc, char *argv[]) free(line); line = NULL; linecap = 0; - assert(getline(&line, &linecap, fp) == 0); + assert(getline(&line, &linecap, fp) == -1); assert(line[0] == '\0'); assert(linecap > 0); assert(errno == 0); From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 14:12:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FC7A10656FB; Mon, 6 Apr 2009 14:12:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E21D8FC1F; Mon, 6 Apr 2009 14:12:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36ECMsM073687; Mon, 6 Apr 2009 14:12:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36ECMJb073686; Mon, 6 Apr 2009 14:12:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200904061412.n36ECMJb073686@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 6 Apr 2009 14:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190774 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 14:12:23 -0000 Author: des Date: Mon Apr 6 14:12:22 2009 New Revision: 190774 URL: http://svn.freebsd.org/changeset/base/190774 Log: Fix ISO8859-15 links for nb_NO / no_NO. Submitted by: ru MFC after: 1 week Modified: head/share/timedef/Makefile Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Mon Apr 6 13:50:04 2009 (r190773) +++ head/share/timedef/Makefile Mon Apr 6 14:12:22 2009 (r190774) @@ -126,10 +126,9 @@ GB2312_GBK= zh_CN ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ ${NL_LINKS} ${NO_LINKS} en_US:af_ZA ISO8859-1_ISO8859-15= ca_ES da_DK de_AT de_DE en_GB en_US es_ES eu_ES \ - fi_FI fr_FR is_IS it_IT la_LN nl_NL nn_NO no_NO pt_PT \ + fi_FI fr_FR is_IS it_IT la_LN nb_NO nl_NL nn_NO no_NO pt_PT \ sv_SE \ - ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} \ - ${NO_LINKS} + ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} ISO8859-1_US-ASCII= ${GB_LINKS} en_GB en_US la_LN ISO8859-1_ISO8859-2= la_LN ISO8859-1_ISO8859-4= la_LN From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 14:27:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343CC10656BE; Mon, 6 Apr 2009 14:27:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 211508FC12; Mon, 6 Apr 2009 14:27:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36ERTX2074016; Mon, 6 Apr 2009 14:27:29 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36ERTVF074015; Mon, 6 Apr 2009 14:27:29 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904061427.n36ERTVF074015@svn.freebsd.org> From: Randall Stewart Date: Mon, 6 Apr 2009 14:27: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: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 14:27:29 -0000 Author: rrs Date: Mon Apr 6 14:27:28 2009 New Revision: 190775 URL: http://svn.freebsd.org/changeset/base/190775 Log: Ok, looking at the solution a bit closer, the level calculation was too agressive. Instead we should only look at each nibble. This makes it so we make 10.2.0.0 become 10.2/16 NOT 10.2/17. Need to explore the non-cidr address issue. The two may not be seperable.. MFC after: 1 week Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Mon Apr 6 14:12:22 2009 (r190774) +++ head/sbin/route/route.c Mon Apr 6 14:27:28 2009 (r190775) @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits) * CIDR address. */ if ((bits == 0) && (addr != 0)) { - int i, j; - for(i=0,j=1; i<32; i++) { + u_long i, j; + for(i=0,j=0xff; i<4; i++) { if (addr & j) { break; } - j <<= 1; + j <<= 8; } /* i holds the first non zero bit */ - bits = 32 - i; + bits = 32 - (i*8); } mask = 0xffffffff << (32 - bits); From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 15:09:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267B11065769 for ; Mon, 6 Apr 2009 15:09:24 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from mail-out2.fuse.net (mail-out2.fuse.net [216.68.8.171]) by mx1.freebsd.org (Postfix) with ESMTP id D9AF38FC22 for ; Mon, 6 Apr 2009 15:09:23 +0000 (UTC) (envelope-from cokane@FreeBSD.org) X-CNFS-Analysis: v=1.0 c=1 a=yWHZTcLBkW0A:10 a=JrIlpGgeJDMA:10 a=6I5d2MoRAAAA:8 a=t2WoRTrMK5oZo7IxT4EA:9 a=_pUQ5zzRPM-F0prS8s8A:7 a=PyLuERE6lk2IZQIH2caW8wILcSQA:4 a=LY0hPdMaydYA:10 a=-Ntob9ACUMHZU6Pd:21 a=kvL1sugTb9cZYlzz:21 a=1fHtYjTDPEesxH8vWskA:9 a=cQ7BgO7rXyB3LoBiE7m5dvrayhsA:4 a=rPt6xJ-oxjAA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: gwout2 smtp.mail=cokane@FreeBSD.org; spf=softfail Received-SPF: softfail (gwout2: transitional domain FreeBSD.org does not designate 74.215.227.9 as permitted sender) Received: from [74.215.227.9] ([74.215.227.9:50955] helo=mail.cokane.org) by gwout2 (envelope-from ) (ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP id FE/B0-25989-22B1AD94; Mon, 06 Apr 2009 11:09:22 -0400 Received: from [10.128.128.2] (unknown [10.128.128.2]) by mail.cokane.org (Postfix) with ESMTPSA id 29C4B1143C; Mon, 6 Apr 2009 12:14:19 -0400 (EDT) From: Coleman Kane To: Randall Stewart In-Reply-To: <200904061427.n36ERTVF074015@svn.freebsd.org> References: <200904061427.n36ERTVF074015@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-ppb+PrdMf9zgXtHOMppw" Organization: FreeBSD Project Date: Mon, 06 Apr 2009 11:07:39 -0400 Message-Id: <1239030459.1946.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 15:09:24 -0000 --=-ppb+PrdMf9zgXtHOMppw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2009-04-06 at 14:27 +0000, Randall Stewart wrote: > Author: rrs > Date: Mon Apr 6 14:27:28 2009 > New Revision: 190775 > URL: http://svn.freebsd.org/changeset/base/190775 >=20 > Log: > Ok, looking at the solution a bit closer, the level > calculation was too agressive. Instead we should only > look at each nibble. This makes it so we make > 10.2.0.0 become 10.2/16 NOT 10.2/17. I presume you meant "NOT 10.2/15" here? Correct me if I'm wrong, but that's what I gathered by the discussion of "the bug" in the previous thread. > =20 > Need to explore the non-cidr address issue. The two > may not be seperable.. > =20 > MFC after: 1 week >=20 > Modified: > head/sbin/route/route.c >=20 > Modified: head/sbin/route/route.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/route/route.c Mon Apr 6 14:12:22 2009 (r190774) > +++ head/sbin/route/route.c Mon Apr 6 14:27:28 2009 (r190775) > @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits) > * CIDR address. > */ > if ((bits =3D=3D 0) && (addr !=3D 0)) { > - int i, j; > - for(i=3D0,j=3D1; i<32; i++) { > + u_long i, j; > + for(i=3D0,j=3D0xff; i<4; i++) { > if (addr & j) { > break; > } > - j <<=3D 1; > + j <<=3D 8; > } > /* i holds the first non zero bit */ > - bits =3D 32 - i;=09 > + bits =3D 32 - (i*8);=09 > } > mask =3D 0xffffffff << (32 - bits); > =20 --=20 Coleman Kane --=-ppb+PrdMf9zgXtHOMppw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAknaGrgACgkQcMSxQcXat5ciAwCfeyrBjKtTQBb9zKghtVf4kmQ0 ALEAnifpZqjeplB5uCE3Akq1bzBB20pe =kPs7 -----END PGP SIGNATURE----- --=-ppb+PrdMf9zgXtHOMppw-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 16:21:32 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6098F1065726; Mon, 6 Apr 2009 16:21:32 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id D55B78FC18; Mon, 6 Apr 2009 16:21:31 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n36GLUmo048556 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 6 Apr 2009 12:21:30 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1239034890; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=zbRWAexh1Ddu34VFd96WVNto3zaw7QS4sXQQbM/7/T1De3L3xTVcqB2 wblQFhHy2eiXEIhy01SLoMb/0nnMBpg== Message-Id: <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> From: Randall Stewart To: Coleman Kane In-Reply-To: <1239030459.1946.4.camel@localhost> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 6 Apr 2009 12:21:30 -0400 References: <200904061427.n36ERTVF074015@svn.freebsd.org> <1239030459.1946.4.camel@localhost> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, Randall Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 16:21:33 -0000 On Apr 6, 2009, at 11:07 AM, Coleman Kane wrote: > On Mon, 2009-04-06 at 14:27 +0000, Randall Stewart wrote: >> Author: rrs >> Date: Mon Apr 6 14:27:28 2009 >> New Revision: 190775 >> URL: http://svn.freebsd.org/changeset/base/190775 >> >> Log: >> Ok, looking at the solution a bit closer, the level >> calculation was too agressive. Instead we should only >> look at each nibble. This makes it so we make >> 10.2.0.0 become 10.2/16 NOT 10.2/17. > > I presume you meant "NOT 10.2/15" here? Correct me if I'm wrong, but > that's what I gathered by the discussion of "the bug" in the previous > thread. > It would have actually done any number of ones... basically looking at the bottom number of 0 bits and that would be the / value. So depending on what number you put with 10.x (for x) you could get a variety of results.. 10.2 would == 10.2/17 10.4 would == 10.2/18 etc. This is not the correct behavior.. even though it might be technically right with regard to CIDR. Now as far as the old class based routings go.. this is a problem since the two schemes are at odds. We have for a long time had doing route add -net 10.2.0.0 be equal to adding 10.2/16 But if you follow the old Class based routing then the upper 4 bits of the address needs to be examined to determine if its a /8, /16 etc. That is incorrect in a CIDR world.. but I don't see a way to make the two schemes work together. And since previous to 7.1 the above worked.. I think this last fix is the right approach.. R >> >> Need to explore the non-cidr address issue. The two >> may not be seperable.. >> >> MFC after: 1 week >> >> Modified: >> head/sbin/route/route.c >> >> Modified: head/sbin/route/route.c >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sbin/route/route.c Mon Apr 6 14:12:22 2009 (r190774) >> +++ head/sbin/route/route.c Mon Apr 6 14:27:28 2009 (r190775) >> @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits) >> * CIDR address. >> */ >> if ((bits == 0) && (addr != 0)) { >> - int i, j; >> - for(i=0,j=1; i<32; i++) { >> + u_long i, j; >> + for(i=0,j=0xff; i<4; i++) { >> if (addr & j) { >> break; >> } >> - j <<= 1; >> + j <<= 8; >> } >> /* i holds the first non zero bit */ >> - bits = 32 - i; >> + bits = 32 - (i*8); >> } >> mask = 0xffffffff << (32 - bits); >> > > -- > Coleman Kane ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 16:28:44 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21D8A10656E5 for ; Mon, 6 Apr 2009 16:28:44 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175]) by mx1.freebsd.org (Postfix) with ESMTP id D0E1D8FC32 for ; Mon, 6 Apr 2009 16:28:43 +0000 (UTC) (envelope-from cokane@FreeBSD.org) X-CNFS-Analysis: v=1.0 c=1 a=yWHZTcLBkW0A:10 a=JrIlpGgeJDMA:10 a=6I5d2MoRAAAA:8 a=TEk0-XqTdsO1Vyy7xtwA:9 a=BV4U9yr8NeWk2-snvAUA:7 a=oIE-KR9vigrTBo-54b4_5H56snQA:4 a=LY0hPdMaydYA:10 a=DdoR2F1noGMA:10 a=-OVAfgye9ggA:10 a=p1dl59qkDAKad3d7:21 a=_icPO50CJ_6JW_lO:21 a=w_sEYLCNI7S7TjixogIA:9 a=nqx8j09HCemYT5h60A_Tvkg0DgMA:4 a=rPt6xJ-oxjAA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: gwout1 smtp.mail=cokane@FreeBSD.org; spf=softfail Received-SPF: softfail (gwout1: transitional domain FreeBSD.org does not designate 74.215.227.9 as permitted sender) Received: from [74.215.227.9] ([74.215.227.9:50053] helo=mail.cokane.org) by gwout1 (envelope-from ) (ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP id 5E/51-27669-ABD2AD94; Mon, 06 Apr 2009 12:28:42 -0400 Received: from [10.128.128.2] (unknown [10.128.128.2]) by mail.cokane.org (Postfix) with ESMTPSA id E6F441143D; Mon, 6 Apr 2009 13:33:38 -0400 (EDT) From: Coleman Kane To: Randall Stewart In-Reply-To: <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> References: <200904061427.n36ERTVF074015@svn.freebsd.org> <1239030459.1946.4.camel@localhost> <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-FcsJJQgGjUhUn7DyIR5w" Organization: FreeBSD Project Date: Mon, 06 Apr 2009 12:26:58 -0400 Message-Id: <1239035218.1946.12.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, Randall Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 16:28:46 -0000 --=-FcsJJQgGjUhUn7DyIR5w Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2009-04-06 at 12:21 -0400, Randall Stewart wrote: > On Apr 6, 2009, at 11:07 AM, Coleman Kane wrote: >=20 > > On Mon, 2009-04-06 at 14:27 +0000, Randall Stewart wrote: > >> Author: rrs > >> Date: Mon Apr 6 14:27:28 2009 > >> New Revision: 190775 > >> URL: http://svn.freebsd.org/changeset/base/190775 > >> > >> Log: > >> Ok, looking at the solution a bit closer, the level > >> calculation was too agressive. Instead we should only > >> look at each nibble. This makes it so we make > >> 10.2.0.0 become 10.2/16 NOT 10.2/17. > > > > I presume you meant "NOT 10.2/15" here? Correct me if I'm wrong, but > > that's what I gathered by the discussion of "the bug" in the previous > > thread. > > >=20 > It would have actually done any number of ones... basically looking > at the bottom number of 0 bits and that would be the / value. >=20 > So depending on what number you put with > 10.x (for x) you could get a variety of results.. >=20 > 10.2 would =3D=3D 10.2/17 > 10.4 would =3D=3D 10.2/18 I was under the impression that the above would sort out to something akin to the following binary sequences: 00001010 00000010 (10.2) produces a 15-bit-long mask (11111111 11111110) 00001010 00000100 (10.4) produces a 14-bit-long mask (11111111 11111100) I would expect 10.2.128 to produce a 17-bit mask, and 10.2.129 to produce an 18-bit mask, according to CIDR. >=20 > etc. >=20 > This is not the correct behavior.. even though it might be > technically right with regard to CIDR. >=20 > Now as far as the old class based routings go.. this is a problem > since the two schemes are at odds. >=20 > We have for a long time had doing >=20 > route add -net 10.2.0.0 be equal to adding 10.2/16 >=20 > But if you follow the old Class based routing then > the upper 4 bits of the address needs to be examined to > determine if its a /8, /16 etc. >=20 > That is incorrect in a CIDR world.. but I don't see a way > to make the two schemes work together. And since previous to 7.1 > the above worked.. I think this last fix is the right approach.. >=20 > R >=20 > >> > >> Need to explore the non-cidr address issue. The two > >> may not be seperable.. > >> > >> MFC after: 1 week > >> > >> Modified: > >> head/sbin/route/route.c > >> > >> Modified: head/sbin/route/route.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/route/route.c Mon Apr 6 14:12:22 2009 (r190774) > >> +++ head/sbin/route/route.c Mon Apr 6 14:27:28 2009 (r190775) > >> @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits) > >> * CIDR address. > >> */ > >> if ((bits =3D=3D 0) && (addr !=3D 0)) { > >> - int i, j; > >> - for(i=3D0,j=3D1; i<32; i++) { > >> + u_long i, j; > >> + for(i=3D0,j=3D0xff; i<4; i++) { > >> if (addr & j) { > >> break; > >> } > >> - j <<=3D 1; > >> + j <<=3D 8; > >> } > >> /* i holds the first non zero bit */ > >> - bits =3D 32 - i;=09 > >> + bits =3D 32 - (i*8);=09 > >> } > >> mask =3D 0xffffffff << (32 - bits); > >> > > > > --=20 > > Coleman Kane >=20 > ------------------------------ > Randall Stewart > 803-317-4952 (cell) > 803-345-0391(direct) >=20 --=20 Coleman Kane --=-FcsJJQgGjUhUn7DyIR5w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAknaLVIACgkQcMSxQcXat5ehGQCfT/po4jUM2JmR5Ygdvd7+2KWD p/kAoIErC7/mssSvQn4ZTxIeb22cTSEt =PE/H -----END PGP SIGNATURE----- --=-FcsJJQgGjUhUn7DyIR5w-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 16:48:55 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBEF61065766; Mon, 6 Apr 2009 16:48:55 +0000 (UTC) (envelope-from scode@hyperion.scode.org) Received: from hyperion.scode.org (cl-1361.ams-04.nl.sixxs.net [IPv6:2001:960:2:550::2]) by mx1.freebsd.org (Postfix) with ESMTP id A382E8FC14; Mon, 6 Apr 2009 16:48:55 +0000 (UTC) (envelope-from scode@hyperion.scode.org) Received: by hyperion.scode.org (Postfix, from userid 1001) id E0C2C23C471; Mon, 6 Apr 2009 18:48:53 +0200 (CEST) Date: Mon, 6 Apr 2009 18:48:53 +0200 From: Peter Schuller To: Vasil Dimov Message-ID: <20090406164853.GA75904@hyperion.scode.org> References: <200903142010.n2EKAESF006945@svn.freebsd.org> <20090320140015.GA17645@hub.freebsd.org> <20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org> <1237567495.1993.2.camel@localhost> <20090327063251.GA95057@polejan.hw.v5d.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <20090327063251.GA95057@polejan.hw.v5d.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sam Leffler , Coleman Kane , src-committers@FreeBSD.org Subject: Re: svn commit: r189828 - in head: include sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 16:48:56 -0000 --OwLcNYc0lM97+oe1 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [ pthread_kill() in signal.h conflicting with devel/pth's attempts to hide = native pthread] > 3. /usr/include/signal.h defines pthread_kill() only if __POSIX_VISIBLE > or __XSI_VISIBLE is defined. Can someone try to inject > #undef __POSIX_VISIBLE or #undef __XSI_VISIBLE into pth's pthread.h.in > to see if this fixes the problem and does not cause other problems? The attached patch dropped into the port makes devel/pth and security/gnupg build for me. I'll re-build my full set of ports with the patch and see, but I'm not really set up to do a global build of all ports. More importantly I guess is that it doesn't break things on older releases. I'll re-build my ports on a 7.x system too. I'm not the most knowledgable about the various POSIX/XSI compatibility defines and their expected results, but it seems pretty dangerous to me to flat-out #undef it. Who knows what else depends on those being set properly in any given application. How about only doing it for a new enough OS release to at least avoid breaking older releases, and then communicate the problem upstream and hope for a better fix? --=20 / Peter Schuller PGP userID: 0xE9758B7D or 'Peter Schuller ' Key retrieval: Send an E-Mail to getpgpkey@scode.org E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-pth_p.h.in" Content-Transfer-Encoding: quoted-printable --- pth_p.h.in.orig 2009-04-06 18:33:15.490908975 +0200 +++ pth_p.h.in 2009-04-06 18:33:32.490533854 +0200 @@ -26,6 +26,9 @@ #ifndef _PTH_P_H_ #define _PTH_P_H_ =20 +#undef __POSIX_VISIBLE +#undef __XSI_VISIBLE + /* mandatory system headers */ #include #include --5vNYLRcllDrimb99-- --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknaMnUACgkQDNor2+l1i31izACgoCSUiwmvnRToGrweeRc5DZHk vykAnjTccJ36d2iDo45jiIyMs9MU7A+O =Fush -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 17:45:30 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A21106571C; Mon, 6 Apr 2009 17:45:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2511B8FC17; Mon, 6 Apr 2009 17:45:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CB7E746B03; Mon, 6 Apr 2009 13:45:29 -0400 (EDT) Date: Mon, 6 Apr 2009 18:45:29 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> Message-ID: References: <200904061427.n36ERTVF074015@svn.freebsd.org> <1239030459.1946.4.camel@localhost> <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Randall Stewart , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Coleman Kane Subject: Re: svn commit: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 17:45:30 -0000 On Mon, 6 Apr 2009, Randall Stewart wrote: >> I presume you meant "NOT 10.2/15" here? Correct me if I'm wrong, but that's >> what I gathered by the discussion of "the bug" in the previous thread. > > It would have actually done any number of ones... basically looking at the > bottom number of 0 bits and that would be the / value. > > So depending on what number you put with 10.x (for x) you could get a > variety of results.. > > 10.2 would == 10.2/17 > 10.4 would == 10.2/18 > > etc. > > This is not the correct behavior.. even though it might be technically right > with regard to CIDR. > > Now as far as the old class based routings go.. this is a problem since the > two schemes are at odds. Perhaps I'm sort of old-fashioned, but I would generally expect: (1) No netmask specified -- use class to determine netmask (2) netmask specified using -net 192.168/20 -- use /20 (3) netmask specified using -netmask -- use the -netmask argument. I guess I just don't administer routers very much anymore, but is using the last set bit a commonly used way to name networks these days, as opposed to explicitly setting the netmask with /whatever? Robert N M Watson Computer Laboratory University of Cambridge > > We have for a long time had doing > > route add -net 10.2.0.0 be equal to adding 10.2/16 > > But if you follow the old Class based routing then > the upper 4 bits of the address needs to be examined to > determine if its a /8, /16 etc. > > That is incorrect in a CIDR world.. but I don't see a way > to make the two schemes work together. And since previous to 7.1 > the above worked.. I think this last fix is the right approach.. > > R > >>> >>> Need to explore the non-cidr address issue. The two >>> may not be seperable.. >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/sbin/route/route.c >>> >>> Modified: head/sbin/route/route.c >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ===================================================================== >>> --- head/sbin/route/route.c Mon Apr 6 14:12:22 2009 (r190774) >>> +++ head/sbin/route/route.c Mon Apr 6 14:27:28 2009 (r190775) >>> @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits) >>> * CIDR address. >>> */ >>> if ((bits == 0) && (addr != 0)) { >>> - int i, j; >>> - for(i=0,j=1; i<32; i++) { >>> + u_long i, j; >>> + for(i=0,j=0xff; i<4; i++) { >>> if (addr & j) { >>> break; >>> } >>> - j <<= 1; >>> + j <<= 8; >>> } >>> /* i holds the first non zero bit */ >>> - bits = 32 - i; >>> + bits = 32 - (i*8); >>> } >>> mask = 0xffffffff << (32 - bits); >>> >> >> -- >> Coleman Kane > > ------------------------------ > Randall Stewart > 803-317-4952 (cell) > 803-345-0391(direct) > > From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 18:24:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B2591065747; Mon, 6 Apr 2009 18:24:05 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 22CF98FC17; Mon, 6 Apr 2009 18:24:05 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n36IOJBe063063; Mon, 6 Apr 2009 14:24:19 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n36IOJ1l063062; Mon, 6 Apr 2009 14:24:19 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 6 Apr 2009 14:24:19 -0400 From: David Schultz To: Peter Schuller Message-ID: <20090406182419.GA62997@zim.MIT.EDU> Mail-Followup-To: Peter Schuller , Vasil Dimov , Coleman Kane , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Sam Leffler , src-committers@FreeBSD.ORG References: <200903142010.n2EKAESF006945@svn.freebsd.org> <20090320140015.GA17645@hub.freebsd.org> <20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org> <1237567495.1993.2.camel@localhost> <20090327063251.GA95057@polejan.hw.v5d.org> <20090406164853.GA75904@hyperion.scode.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090406164853.GA75904@hyperion.scode.org> Cc: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Vasil Dimov , Sam Leffler , svn-src-head@FreeBSD.ORG, Coleman Kane Subject: Re: svn commit: r189828 - in head: include sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 18:24:06 -0000 On Mon, Apr 06, 2009, Peter Schuller wrote: > [ pthread_kill() in signal.h conflicting with devel/pth's attempts to hide native pthread] > > > 3. /usr/include/signal.h defines pthread_kill() only if __POSIX_VISIBLE > > or __XSI_VISIBLE is defined. Can someone try to inject > > #undef __POSIX_VISIBLE or #undef __XSI_VISIBLE into pth's pthread.h.in > > to see if this fixes the problem and does not cause other problems? > > The attached patch dropped into the port makes devel/pth and > security/gnupg build for me. > > I'll re-build my full set of ports with the patch and see, but I'm not > really set up to do a global build of all ports. More importantly I > guess is that it doesn't break things on older releases. I'll re-build > my ports on a 7.x system too. > > I'm not the most knowledgable about the various POSIX/XSI > compatibility defines and their expected results, but it seems pretty > dangerous to me to flat-out #undef it. Who knows what else depends on > those being set properly in any given application. > > How about only doing it for a new enough OS release to at least avoid > breaking older releases, and then communicate the problem upstream and > hope for a better fix? As I mentioned in an email to vd@ two weeks ago, the problem is that GNU pth *already* has a bunch of insidious kludges to try to prevent systems headers on various operating systems from declaring symbols it wants to clobber. In particular, it defines _PTHREAD_H, which hides pthread_kill() when pthread_kill() is defined in pthread.h, but not when it is defined in signal.h. The options are to either add yet another insidious kludge to GNU pth such as the one you suggest, or to add a kludge to FreeBSD specifically to support GNU pth in all its brokenness. I agreed to try the latter if the former proved to be impractical. From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 19:11:44 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85B541065702; Mon, 6 Apr 2009 19:11:44 +0000 (UTC) (envelope-from scode@hyperion.scode.org) Received: from hyperion.scode.org (cl-1361.ams-04.nl.sixxs.net [IPv6:2001:960:2:550::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED838FC12; Mon, 6 Apr 2009 19:11:44 +0000 (UTC) (envelope-from scode@hyperion.scode.org) Received: by hyperion.scode.org (Postfix, from userid 1001) id 49F8B23C40F; Mon, 6 Apr 2009 21:11:43 +0200 (CEST) Date: Mon, 6 Apr 2009 21:11:43 +0200 From: Peter Schuller To: Vasil Dimov , Coleman Kane , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Sam Leffler , src-committers@FreeBSD.ORG Message-ID: <20090406191142.GA79888@hyperion.scode.org> References: <200903142010.n2EKAESF006945@svn.freebsd.org> <20090320140015.GA17645@hub.freebsd.org> <20090320153405.GA62675@zim.MIT.EDU> <49C3BCD4.4030605@freebsd.org> <1237567495.1993.2.camel@localhost> <20090327063251.GA95057@polejan.hw.v5d.org> <20090406164853.GA75904@hyperion.scode.org> <20090406182419.GA62997@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20090406182419.GA62997@zim.MIT.EDU> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Re: svn commit: r189828 - in head: include sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 19:11:45 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > I'm not the most knowledgable about the various POSIX/XSI > > compatibility defines and their expected results, but it seems pretty > > dangerous to me to flat-out #undef it. Who knows what else depends on > > those being set properly in any given application. > >=20 > > How about only doing it for a new enough OS release to at least avoid > > breaking older releases, and then communicate the problem upstream and > > hope for a better fix? >=20 > As I mentioned in an email to vd@ two weeks ago, the problem is > that GNU pth *already* has a bunch of insidious kludges to try to > prevent systems headers on various operating systems from > declaring symbols it wants to clobber. In particular, it defines > _PTHREAD_H, which hides pthread_kill() when pthread_kill() is > defined in pthread.h, but not when it is defined in signal.h. >=20 > The options are to either add yet another insidious kludge to GNU > pth such as the one you suggest, or to add a kludge to FreeBSD > specifically to support GNU pth in all its brokenness. I agreed to > try the latter if the former proved to be impractical. To be clear I'm not suggesting the kludge, but tested what vd@ asked for and suggested limiting the potential negative impact by limiting it to >=3D 8. I understand that it's an ugly solution either way, but I can't suggest one that isn't... Would it make sense to invent a kludge that is at least somewhat general in nature (__PTHREADS_INVISIBLE or something) which could possibly be adopted by other OS:es and decrease OS-specific hacks in pth? --=20 / Peter Schuller PGP userID: 0xE9758B7D or 'Peter Schuller ' Key retrieval: Send an E-Mail to getpgpkey@scode.org E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknaU+4ACgkQDNor2+l1i333lgCfQNyHDa47VRmirK3IuoAKZg+i B48AoKVx3lGi6H15ceTqf0VCNxdGQiBH =FcTB -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 19:12:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9BD510658E8; Mon, 6 Apr 2009 19:12:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F108FC1C; Mon, 6 Apr 2009 19:12:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36JClL0080364; Mon, 6 Apr 2009 19:12:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36JClwv080363; Mon, 6 Apr 2009 19:12:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200904061912.n36JClwv080363@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Apr 2009 19:12: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: r190783 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 19:12:49 -0000 Author: jhb Date: Mon Apr 6 19:12:47 2009 New Revision: 190783 URL: http://svn.freebsd.org/changeset/base/190783 Log: Change the default timeout for caching attributes of a directory in the NFS client from 30 seconds to 3 seconds. After the recent changes to add caching of negative name cache lookups, a negative name cache hit will persist until the client notices the parent directory has changed. The higher the attribute cache timeout on directories, the longer that can take, so lower the default timeout for directories to match that of regular files. Suggested by: bde, mohans MFC after: 1 month Modified: head/sys/nfsclient/nfs.h Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Mon Apr 6 17:33:35 2009 (r190782) +++ head/sys/nfsclient/nfs.h Mon Apr 6 19:12:47 2009 (r190783) @@ -63,7 +63,7 @@ #define NFS_MAXATTRTIMO 60 #endif #ifndef NFS_MINDIRATTRTIMO -#define NFS_MINDIRATTRTIMO 30 /* VDIR attrib cache timeout in sec */ +#define NFS_MINDIRATTRTIMO 3 /* VDIR attrib cache timeout in sec */ #endif #ifndef NFS_MAXDIRATTRTIMO #define NFS_MAXDIRATTRTIMO 60 From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 20:17:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED871065992; Mon, 6 Apr 2009 20:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A83D8FC19; Mon, 6 Apr 2009 20:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36KHSbn081645; Mon, 6 Apr 2009 20:17:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36KHSEo081644; Mon, 6 Apr 2009 20:17:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200904062017.n36KHSEo081644@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Apr 2009 20:17: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: r190784 - head/sys/modules/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 20:17:32 -0000 Author: jhb Date: Mon Apr 6 20:17:28 2009 New Revision: 190784 URL: http://svn.freebsd.org/changeset/base/190784 Log: Add opt_kdtrace.h to fix standalone module build. Modified: head/sys/modules/nfsclient/Makefile Modified: head/sys/modules/nfsclient/Makefile ============================================================================== --- head/sys/modules/nfsclient/Makefile Mon Apr 6 19:12:47 2009 (r190783) +++ head/sys/modules/nfsclient/Makefile Mon Apr 6 20:17:28 2009 (r190784) @@ -10,7 +10,7 @@ SRCS= vnode_if.h \ opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h SRCS+= nfs4_dev.c nfs4_idmap.c nfs4_socket.c nfs4_subs.c \ nfs4_vfs_subs.c nfs4_vfsops.c nfs4_vn_subs.c nfs4_vnops.c -SRCS+= opt_inet6.h opt_kgssapi.h opt_route.h +SRCS+= opt_inet6.h opt_kdtrace.h opt_kgssapi.h opt_route.h # USE THE RPCCLNT: CFLAGS+= -DRPCCLNT_DEBUG From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 21:11:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F9CA1065717; Mon, 6 Apr 2009 21:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F09AE8FC13; Mon, 6 Apr 2009 21:11:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36LB82w083548; Mon, 6 Apr 2009 21:11:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36LB8Eh083543; Mon, 6 Apr 2009 21:11:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200904062111.n36LB8Eh083543@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Apr 2009 21:11: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: r190785 - in head/sys: nfs4client nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 21:11:10 -0000 Author: jhb Date: Mon Apr 6 21:11:08 2009 New Revision: 190785 URL: http://svn.freebsd.org/changeset/base/190785 Log: When a stale file handle is encountered, purge all cached information about an NFS node including the access and attribute caches. Previously the NFS client only purged any name cache entries associated with the file. PR: kern/123755 Submitted by: Jaakko Heinonen jh of saunalahti fi Reported by: Timo Sirainen tss of iki fi Reviewed by: rwatson, rmacklem MFC after: 1 month Modified: head/sys/nfs4client/nfs4_socket.c head/sys/nfsclient/nfs.h head/sys/nfsclient/nfs_krpc.c head/sys/nfsclient/nfs_socket.c head/sys/nfsclient/nfs_subs.c Modified: head/sys/nfs4client/nfs4_socket.c ============================================================================== --- head/sys/nfs4client/nfs4_socket.c Mon Apr 6 20:17:28 2009 (r190784) +++ head/sys/nfs4client/nfs4_socket.c Mon Apr 6 21:11:08 2009 (r190785) @@ -259,7 +259,7 @@ nfs4_request(struct vnode *vp, struct mb ** lookup cache, just in case. **/ if (error == ESTALE) - cache_purge(vp); + nfs_purgecache(vp); return (error); } Modified: head/sys/nfsclient/nfs.h ============================================================================== --- head/sys/nfsclient/nfs.h Mon Apr 6 20:17:28 2009 (r190784) +++ head/sys/nfsclient/nfs.h Mon Apr 6 21:11:08 2009 (r190785) @@ -322,6 +322,7 @@ void nfs_down(struct nfsreq *, struct nf #endif /* ! NFS4_USE_RPCCLNT */ #endif +void nfs_purgecache(struct vnode *); int nfs_vinvalbuf(struct vnode *, int, struct thread *, int); int nfs_readrpc(struct vnode *, struct uio *, struct ucred *); int nfs_writerpc(struct vnode *, struct uio *, struct ucred *, int *, Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Mon Apr 6 20:17:28 2009 (r190784) +++ head/sys/nfsclient/nfs_krpc.c Mon Apr 6 21:11:08 2009 (r190785) @@ -557,7 +557,7 @@ tryagain: * cache, just in case. */ if (error == ESTALE) - cache_purge(vp); + nfs_purgecache(vp); /* * Skip wcc data on NFS errors for now. NetApp filers * return corrupt postop attrs in the wcc data for NFS Modified: head/sys/nfsclient/nfs_socket.c ============================================================================== --- head/sys/nfsclient/nfs_socket.c Mon Apr 6 20:17:28 2009 (r190784) +++ head/sys/nfsclient/nfs_socket.c Mon Apr 6 21:11:08 2009 (r190785) @@ -1364,7 +1364,7 @@ wait_for_pinned_req: * lookup cache, just in case. */ if (error == ESTALE) - cache_purge(vp); + nfs_purgecache(vp); /* * Skip wcc data on NFS errors for now. NetApp filers return corrupt * postop attrs in the wcc data for NFS err EROFS. Not sure if they Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Mon Apr 6 20:17:28 2009 (r190784) +++ head/sys/nfsclient/nfs_subs.c Mon Apr 6 21:11:08 2009 (r190785) @@ -865,6 +865,29 @@ nfs_getattrcache(struct vnode *vp, struc return (0); } +/* + * Purge all cached information about an NFS vnode including name + * cache entries, the attribute cache, and the access cache. This is + * called when an NFS request for a node fails with a stale + * filehandle. + */ +void +nfs_purgecache(struct vnode *vp) +{ + struct nfsnode *np; + int i; + + np = VTONFS(vp); + cache_purge(vp); + mtx_lock(&np->n_mtx); + np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + for (i = 0; i < NFS_ACCESSCACHESIZE; i++) + np->n_accesscache[i].stamp = 0; + KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); + mtx_unlock(&np->n_mtx); +} + static nfsuint64 nfs_nullcookie = { { 0, 0 } }; /* * This function finds the directory cookie that corresponds to the From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 21:49:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310AD106578F; Mon, 6 Apr 2009 21:49:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 06B468FC23; Mon, 6 Apr 2009 21:49:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B5B5746B09; Mon, 6 Apr 2009 17:49:46 -0400 (EDT) Date: Mon, 6 Apr 2009 22:49:46 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200904062017.n36KHSEo081644@svn.freebsd.org> Message-ID: References: <200904062017.n36KHSEo081644@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190784 - head/sys/modules/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 21:49:48 -0000 On Mon, 6 Apr 2009, John Baldwin wrote: > Author: jhb > Date: Mon Apr 6 20:17:28 2009 > New Revision: 190784 > URL: http://svn.freebsd.org/changeset/base/190784 > > Log: > Add opt_kdtrace.h to fix standalone module build. Thanks! Robert N M Watson Computer Laboratory University of Cambridge > > Modified: > head/sys/modules/nfsclient/Makefile > > Modified: head/sys/modules/nfsclient/Makefile > ============================================================================== > --- head/sys/modules/nfsclient/Makefile Mon Apr 6 19:12:47 2009 (r190783) > +++ head/sys/modules/nfsclient/Makefile Mon Apr 6 20:17:28 2009 (r190784) > @@ -10,7 +10,7 @@ SRCS= vnode_if.h \ > opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h > SRCS+= nfs4_dev.c nfs4_idmap.c nfs4_socket.c nfs4_subs.c \ > nfs4_vfs_subs.c nfs4_vfsops.c nfs4_vn_subs.c nfs4_vnops.c > -SRCS+= opt_inet6.h opt_kgssapi.h opt_route.h > +SRCS+= opt_inet6.h opt_kdtrace.h opt_kgssapi.h opt_route.h > > # USE THE RPCCLNT: > CFLAGS+= -DRPCCLNT_DEBUG > From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 21:52:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD821065781; Mon, 6 Apr 2009 21:52:11 +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 0B4EE8FC12; Mon, 6 Apr 2009 21:52:11 +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 n36LqA0p084361; Mon, 6 Apr 2009 21:52:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36LqArv084360; Mon, 6 Apr 2009 21:52:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904062152.n36LqArv084360@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 6 Apr 2009 21:52: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: r190786 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 21:52:11 -0000 Author: marcel Date: Mon Apr 6 21:52:10 2009 New Revision: 190786 URL: http://svn.freebsd.org/changeset/base/190786 Log: Add support for PowerPC kernel core files. This commit only adds support for virtual core files (aka minidumps). physical core files are not supported. The implementation is cross-tool ready and can be used in a non- powerpc hosted debugger to analyze PowerPC core files. It also accepts core files that still have the dump header, as can be the case within Juniper where TFTP-based kernel core files are supported and savecore is not used to "extract" the core file from some dump device. Obtained from: Juniper Networks, Inc. Modified: head/lib/libkvm/kvm_powerpc.c Modified: head/lib/libkvm/kvm_powerpc.c ============================================================================== --- head/lib/libkvm/kvm_powerpc.c Mon Apr 6 21:11:08 2009 (r190785) +++ head/lib/libkvm/kvm_powerpc.c Mon Apr 6 21:52:10 2009 (r190786) @@ -1,8 +1,5 @@ -/* $NetBSD: kvm_powerpc.c,v 1.4 1998/02/03 06:50:07 mycroft Exp $ */ - /*- - * Copyright (C) 1996 Wolfgang Solfrank. - * Copyright (C) 1996 TooLs GmbH. + * Copyright (c) 2008, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,91 +10,209 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH 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. - */ - -/* - * PowerPC machine dependent routines for kvm. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include #include +#include #include #include #include #include "kvm_private.h" -void -_kvm_freevtop(kd) - kvm_t *kd; +struct vmstate { + void *map; + size_t mapsz; + size_t dmphdrsz; + Elf32_Ehdr *eh; + Elf32_Phdr *ph; +}; + +static int +valid_elf_header(Elf32_Ehdr *eh) { - if (kd->vmst != 0) - free(kd->vmst); + + if (!IS_ELF(*eh)) + return (0); + if (eh->e_ident[EI_CLASS] != ELFCLASS32) + return (0); + if (eh->e_ident[EI_DATA] != ELFDATA2MSB) + return (0); + if (eh->e_ident[EI_VERSION] != EV_CURRENT) + return (0); + if (eh->e_ident[EI_OSABI] != ELFOSABI_STANDALONE) + return (0); + if (be16toh(eh->e_type) != ET_CORE) + return (0); + if (be16toh(eh->e_machine) != EM_PPC) + return (0); + /* Can't think of anything else to check... */ + return (1); } -int -_kvm_initvtop(kd) - kvm_t *kd; +static size_t +dump_header_size(struct kerneldumpheader *dh) { - return 0; + + if (strcmp(dh->magic, KERNELDUMPMAGIC) != 0) + return (0); + if (strcmp(dh->architecture, "powerpc") != 0) + return (0); + /* That should do it... */ + return (sizeof(*dh)); } -int -_kvm_kvatop(kd, va, pa) - kvm_t *kd; - u_long va; - off_t *pa; -{ - _kvm_err(kd, 0, "vatop not yet implemented!"); - return 0; -} - -off_t -_kvm_pa2off(kd, pa) - kvm_t *kd; - u_long pa; +/* + * Map the ELF headers into the process' address space. We do this in two + * steps: first the ELF header itself and using that information the whole + * set of headers. + */ +static int +powerpc_maphdrs(kvm_t *kd) { - _kvm_err(kd, 0, "pa2off not yet implemented!"); - return 0; + struct vmstate *vm; + size_t mapsz; + + vm = kd->vmst; + + vm->mapsz = PAGE_SIZE; + vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->map == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot map corefile"); + return (-1); + } + vm->dmphdrsz = 0; + vm->eh = vm->map; + if (!valid_elf_header(vm->eh)) { + /* + * Hmmm, no ELF header. Maybe we still have a dump header. + * This is normal when the core file wasn't created by + * savecore(8), but instead was dumped over TFTP. We can + * easily skip the dump header... + */ + vm->dmphdrsz = dump_header_size(vm->map); + if (vm->dmphdrsz == 0) + goto inval; + vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz); + if (!valid_elf_header(vm->eh)) + goto inval; + } + mapsz = be16toh(vm->eh->e_phentsize) * be16toh(vm->eh->e_phnum) + + be32toh(vm->eh->e_phoff); + munmap(vm->map, vm->mapsz); + + /* Map all headers. */ + vm->mapsz = vm->dmphdrsz + mapsz; + vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->map == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot map corefle headers"); + return (-1); + } + vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz); + vm->ph = (void *)((uintptr_t)vm->eh + be32toh(vm->eh->e_phoff)); + return (0); + + inval: + munmap(vm->map, vm->mapsz); + vm->map = MAP_FAILED; + _kvm_err(kd, kd->program, "invalid corefile"); + return (-1); } /* - * Machine-dependent initialization for ALL open kvm descriptors, - * not just those for a kernel crash dump. Some architectures - * have to deal with these NOT being constants! (i.e. m68k) + * Determine the offset within the corefile corresponding the virtual + * address. Return the number of contiguous bytes in the corefile or + * 0 when the virtual address is invalid. */ +static size_t +powerpc_va2off(kvm_t *kd, u_long va, off_t *ofs) +{ + struct vmstate *vm = kd->vmst; + Elf32_Phdr *ph; + int nph; + + ph = vm->ph; + nph = be16toh(vm->eh->e_phnum); + while (nph && (va < be32toh(ph->p_vaddr) || + va >= be32toh(ph->p_vaddr) + be32toh(ph->p_memsz))) { + nph--; + ph = (void *)((uintptr_t)ph + be16toh(vm->eh->e_phentsize)); + } + if (nph == 0) + return (0); + + /* Segment found. Return file offset and range. */ + *ofs = vm->dmphdrsz + be32toh(ph->p_offset) + + (va - be32toh(ph->p_vaddr)); + return (be32toh(ph->p_memsz) - (va - be32toh(ph->p_vaddr))); +} + +void +_kvm_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + if (vm == NULL) + return; + + if (vm->eh != MAP_FAILED) { + munmap(vm->eh, vm->mapsz); + vm->eh = MAP_FAILED; + } + free(vm); + kd->vmst = NULL; +} + +int +_kvm_initvtop(kvm_t *kd) +{ + + kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); + if (kd->vmst == NULL) { + _kvm_err(kd, kd->program, "out of virtual memory"); + return (-1); + } + if (powerpc_maphdrs(kd) == -1) { + free(kd->vmst); + kd->vmst = NULL; + return (-1); + } + return (0); +} + int -_kvm_mdopen(kd) - kvm_t *kd; +_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs) { + struct vmstate *vm; -#ifdef FBSD_NOT_YET - kd->usrstack = USRSTACK; - kd->min_uva = VM_MIN_ADDRESS; - kd->max_uva = VM_MAXUSER_ADDRESS; -#endif + vm = kd->vmst; + if (vm->ph->p_paddr == ~0U) + return ((int)powerpc_va2off(kd, va, ofs)); + _kvm_err(kd, kd->program, "Raw corefile not supported"); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 6 22:29:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6096E10657CD; Mon, 6 Apr 2009 22:29:42 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC9F8FC18; Mon, 6 Apr 2009 22:29:42 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n36MTgVP085089; Mon, 6 Apr 2009 22:29:42 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n36MTfrT085067; Mon, 6 Apr 2009 22:29:41 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200904062229.n36MTfrT085067@svn.freebsd.org> From: Marko Zec Date: Mon, 6 Apr 2009 22:29: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: r190787 - in head/sys: net netinet netinet6 netipsec sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 22:29:43 -0000 Author: zec Date: Mon Apr 6 22:29:41 2009 New Revision: 190787 URL: http://svn.freebsd.org/changeset/base/190787 Log: First pass at separating per-vnet initializer functions from existing functions for initializing global state. At this stage, the new per-vnet initializer functions are directly called from the existing global initialization code, which should in most cases result in compiler inlining those new functions, hence yielding a near-zero functional change. Modify the existing initializer functions which are invoked via protosw, like ip_init() et. al., to allow them to be invoked multiple times, i.e. per each vnet. Global state, if any, is initialized only if such functions are called within the context of vnet0, which will be determined via the IS_DEFAULT_VNET(curvnet) check (currently always true). While here, V_irtualize a few remaining global UMA zones used by net/netinet/netipsec networking code. While it is not yet clear to me or anybody else whether this is the right thing to do, at this stage this makes the code more readable, and makes it easier to track uncollected UMA-zone-backed objects on vnet removal. In the long run, it's quite possible that some form of shared use of UMA zone pools among multiple vnets should be considered. Bump __FreeBSD_version due to changes in layout of structs vnet_ipfw, vnet_inet and vnet_net. Approved by: julian (mentor) Modified: head/sys/net/if.c head/sys/net/if_gif.c head/sys/net/if_loop.c head/sys/net/route.c head/sys/net/vnet.h head/sys/netinet/if_ether.c head/sys/netinet/ip_fw.h head/sys/netinet/ip_input.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timewait.c head/sys/netinet/vinet.h head/sys/netinet6/frag6.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_input.c head/sys/netinet6/scope6.c head/sys/netipsec/ipsec.c head/sys/netipsec/key.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/sys/param.h head/sys/sys/vimage.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/net/if.c Mon Apr 6 22:29:41 2009 (r190787) @@ -150,6 +150,8 @@ static int if_getgroupmembers(struct ifg extern void nd6_setmtu(struct ifnet *); #endif +static int vnet_net_iattach(const void *); + #ifdef VIMAGE_GLOBALS struct ifnethead ifnet; /* depend on static init XXX */ struct ifgrouphead ifg_head; @@ -391,24 +393,33 @@ filt_netdev(struct knote *kn, long hint) static void if_init(void *dummy __unused) { - INIT_VNET_NET(curvnet); #ifndef VIMAGE_GLOBALS vnet_mod_register(&vnet_net_modinfo); #endif + vnet_net_iattach(NULL); + + IFNET_LOCK_INIT(); + ifdev_setbyindex(0, make_dev(&net_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "network")); + if_clone_init(); +} + +static int +vnet_net_iattach(const void *unused __unused) +{ + INIT_VNET_NET(curvnet); V_if_index = 0; V_ifindex_table = NULL; V_if_indexlim = 8; - IFNET_LOCK_INIT(); TAILQ_INIT(&V_ifnet); TAILQ_INIT(&V_ifg_head); knlist_init(&V_ifklist, NULL, NULL, NULL, NULL); if_grow(); /* create initial table */ - ifdev_setbyindex(0, make_dev(&net_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0600, "network")); - if_clone_init(); + + return (0); } static void Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/net/if_gif.c Mon Apr 6 22:29:41 2009 (r190787) @@ -121,6 +121,7 @@ void (*ng_gif_detach_p)(struct ifnet *if static void gif_start(struct ifnet *); static int gif_clone_create(struct if_clone *, int, caddr_t); static void gif_clone_destroy(struct ifnet *); +static int vnet_gif_iattach(const void *); IFC_SIMPLE_DECLARE(gif, 0); @@ -251,6 +252,26 @@ gif_clone_destroy(ifp) } static int +vnet_gif_iattach(const void *unused __unused) +{ + INIT_VNET_GIF(curvnet); + + LIST_INIT(&V_gif_softc_list); + V_max_gif_nesting = MAX_GIF_NEST; +#ifdef XBONEHACK + V_parallel_tunnels = 1; +#else + V_parallel_tunnels = 0; +#endif + V_ip_gif_ttl = GIF_TTL; +#ifdef INET6 + V_ip6_gif_hlim = GIF_HLIM; +#endif + + return (0); +} + +static int gifmodevent(mod, type, data) module_t mod; int type; @@ -261,19 +282,7 @@ gifmodevent(mod, type, data) case MOD_LOAD: mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); - LIST_INIT(&V_gif_softc_list); - V_max_gif_nesting = MAX_GIF_NEST; -#ifdef XBONEHACK - V_parallel_tunnels = 1; -#else - V_parallel_tunnels = 0; -#endif -#ifdef INET - V_ip_gif_ttl = GIF_TTL; -#endif -#ifdef INET6 - V_ip6_gif_hlim = GIF_HLIM; -#endif + vnet_gif_iattach(NULL); if_clone_attach(&gif_cloner); break; @@ -281,7 +290,7 @@ gifmodevent(mod, type, data) if_clone_detach(&gif_cloner); mtx_destroy(&gif_mtx); #ifdef INET6 - V_ip6_gif_hlim = 0; + V_ip6_gif_hlim = 0; /* XXX -> vnet_gif_idetach() */ #endif break; default: Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/net/if_loop.c Mon Apr 6 22:29:41 2009 (r190787) @@ -105,6 +105,7 @@ int looutput(struct ifnet *ifp, struct struct sockaddr *dst, struct rtentry *rt); static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); +static int vnet_loif_iattach(const void *); #ifdef VIMAGE_GLOBALS struct ifnet *loif; /* Used externally */ @@ -153,6 +154,15 @@ lo_clone_create(struct if_clone *ifc, in return (0); } +static int vnet_loif_iattach(const void *unused __unused) +{ + INIT_VNET_NET(curvnet); + + V_loif = NULL; + if_clone_attach(&lo_cloner); + return (0); +} + static int loop_modevent(module_t mod, int type, void *data) { @@ -160,8 +170,7 @@ loop_modevent(module_t mod, int type, vo switch (type) { case MOD_LOAD: - V_loif = NULL; - if_clone_attach(&lo_cloner); + vnet_loif_iattach(NULL); break; case MOD_UNLOAD: Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/net/route.c Mon Apr 6 22:29:41 2009 (r190787) @@ -106,6 +106,7 @@ static int rttrash; /* routes not in ta static void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); +static int vnet_route_iattach(const void *); /* compare two sockaddr structures */ #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) @@ -122,7 +123,9 @@ static void rt_maskedcopy(struct sockadd */ #define RNTORT(p) ((struct rtentry *)(p)) +#ifdef VIMAGE_GLOBALS static uma_zone_t rtzone; /* Routing table UMA zone. */ +#endif #if 0 /* default fib for tunnels to use */ @@ -150,20 +153,26 @@ SYSCTL_PROC(_net, OID_AUTO, my_fibnum, C static void route_init(void) { - INIT_VNET_INET(curvnet); - int table; - struct domain *dom; - int fam; /* whack the tunable ints into line. */ if (rt_numfibs > RT_MAXFIBS) rt_numfibs = RT_MAXFIBS; if (rt_numfibs == 0) rt_numfibs = 1; - rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); rn_init(); /* initialize all zeroes, all ones, mask table */ + vnet_route_iattach(NULL); +} + +static int vnet_route_iattach(const void *unused __unused) +{ + INIT_VNET_INET(curvnet); + int table; + struct domain *dom; + int fam; + + V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, + NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach) { for (table = 0; table < rt_numfibs; table++) { @@ -186,6 +195,8 @@ route_init(void) } } } + + return (0); } #ifndef _SYS_SYSPROTO_H_ @@ -402,7 +413,7 @@ rtfree(struct rtentry *rt) * and the rtentry itself of course */ RT_LOCK_DESTROY(rt); - uma_zfree(rtzone, rt); + uma_zfree(V_rtzone, rt); return; } done: @@ -958,7 +969,7 @@ deldone: if (info->rti_ifa == NULL && (error = rt_getifa_fib(info, fibnum))) senderr(error); ifa = info->rti_ifa; - rt = uma_zalloc(rtzone, M_NOWAIT | M_ZERO); + rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); if (rt == NULL) senderr(ENOBUFS); RT_LOCK_INIT(rt); @@ -971,7 +982,7 @@ deldone: RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { RT_LOCK_DESTROY(rt); - uma_zfree(rtzone, rt); + uma_zfree(V_rtzone, rt); senderr(error); } @@ -1006,7 +1017,7 @@ deldone: } Free(rt_key(rt)); RT_LOCK_DESTROY(rt); - uma_zfree(rtzone, rt); + uma_zfree(V_rtzone, rt); senderr(EEXIST); } #endif @@ -1022,7 +1033,7 @@ deldone: IFAFREE(rt->rt_ifa); Free(rt_key(rt)); RT_LOCK_DESTROY(rt); - uma_zfree(rtzone, rt); + uma_zfree(V_rtzone, rt); senderr(EEXIST); } Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/net/vnet.h Mon Apr 6 22:29:41 2009 (r190787) @@ -47,6 +47,7 @@ struct vnet_net { struct rtstat _rtstat; struct radix_node_head *_rt_tables[RT_MAXFIBS][AF_MAX+1]; int _rttrash; + uma_zone_t _rtzone; struct ifnet *_loif; LIST_HEAD(, lo_softc) _lo_list; @@ -86,5 +87,6 @@ extern struct vnet_net vnet_net_0; #define V_rt_tables VNET_NET(rt_tables) #define V_rtstat VNET_NET(rtstat) #define V_rttrash VNET_NET(rttrash) +#define V_rtzone VNET_NET(rtzone) #endif /* !_NET_VNET_H_ */ Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/if_ether.c Mon Apr 6 22:29:41 2009 (r190787) @@ -111,6 +111,7 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_link "Enable proxy ARP for all suitable requests"); static void arp_init(void); +static int arp_iattach(const void *); void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, u_char *); static void arpintr(struct mbuf *); @@ -790,8 +791,8 @@ arp_ifinit2(struct ifnet *ifp, struct if ifa->ifa_rtrequest = NULL; } -static void -arp_init(void) +static int +arp_iattach(const void *unused __unused) { INIT_VNET_INET(curvnet); @@ -800,6 +801,15 @@ arp_init(void) V_useloopback = 1; /* use loopback interface for local traffic */ V_arp_proxyall = 0; + return (0); +} + +static void +arp_init(void) +{ + + arp_iattach(NULL); + arpintrq.ifq_maxlen = 50; mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); netisr_register(NETISR_ARP, arpintr, &arpintrq, 0); Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/ip_fw.h Mon Apr 6 22:29:41 2009 (r190787) @@ -698,6 +698,7 @@ struct vnet_ipfw { int _fw_debug; /* actually unused */ int _autoinc_step; ipfw_dyn_rule **_ipfw_dyn_v; + uma_zone_t _ipfw_dyn_rule_zone; struct ip_fw_chain _layer3_chain; u_int32_t _dyn_buckets; u_int32_t _curr_dyn_buckets; @@ -742,6 +743,7 @@ extern struct vnet_ipfw vnet_ipfw_0; #define V_fw_debug VNET_IPFW(fw_debug) #define V_autoinc_step VNET_IPFW(autoinc_step) #define V_ipfw_dyn_v VNET_IPFW(ipfw_dyn_v) +#define V_ipfw_dyn_rule_zone VNET_IPFW(ipfw_dyn_rule_zone) #define V_layer3_chain VNET_IPFW(layer3_chain) #define V_dyn_buckets VNET_IPFW(dyn_buckets) #define V_curr_dyn_buckets VNET_IPFW(curr_dyn_buckets) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/ip_input.c Mon Apr 6 22:29:41 2009 (r190787) @@ -242,6 +242,7 @@ ip_init(void) V_rsvp_on = 0; V_ip_defttl = IPDEFTTL; V_ip_do_randomid = 0; + V_ip_id = time_second & 0xffff; V_ipforwarding = 0; V_ipstealth = 0; V_nipq = 0; /* Total # of reass queues */ @@ -270,6 +271,20 @@ ip_init(void) TAILQ_INIT(&V_in_ifaddrhead); V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask); + + /* Initialize IP reassembly queue. */ + for (i = 0; i < IPREASS_NHASH; i++) + TAILQ_INIT(&V_ipq[i]); + V_maxnipq = nmbclusters / 32; + V_maxfragsperpacket = 16; + V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); + maxnipq_update(); + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == NULL) panic("ip_init: PF_INET not found"); @@ -297,16 +312,6 @@ ip_init(void) printf("%s: WARNING: unable to register pfil hook, " "error %d\n", __func__, i); - /* Initialize IP reassembly queue. */ - IPQ_LOCK_INIT(); - for (i = 0; i < IPREASS_NHASH; i++) - TAILQ_INIT(&V_ipq[i]); - V_maxnipq = nmbclusters / 32; - V_maxfragsperpacket = 16; - V_ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, - NULL, UMA_ALIGN_PTR, 0); - maxnipq_update(); - /* Start ipport_tick. */ callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); ipport_tick(NULL); @@ -316,7 +321,7 @@ ip_init(void) NULL, EVENTHANDLER_PRI_ANY); /* Initialize various other remaining things. */ - V_ip_id = time_second & 0xffff; + IPQ_LOCK_INIT(); ipintrq.ifq_maxlen = ipqmaxlen; mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF); netisr_register(NETISR_IP, ip_input, &ipintrq, 0); Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/tcp_reass.c Mon Apr 6 22:29:41 2009 (r190787) @@ -108,10 +108,12 @@ tcp_reass_zone_change(void *tag) INIT_VNET_INET(curvnet); V_tcp_reass_maxseg = nmbclusters / 16; - uma_zone_set_max(tcp_reass_zone, V_tcp_reass_maxseg); + uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); } +#ifdef VIMAGE_GLOBALS uma_zone_t tcp_reass_zone; +#endif void tcp_reass_init(void) @@ -126,9 +128,9 @@ tcp_reass_init(void) V_tcp_reass_maxseg = nmbclusters / 16; TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", &V_tcp_reass_maxseg); - tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), + V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(tcp_reass_zone, V_tcp_reass_maxseg); + uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -180,7 +182,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd * Allocate a new queue entry. If we can't, or hit the zone limit * just drop the pkt. */ - te = uma_zalloc(tcp_reass_zone, M_NOWAIT); + te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { V_tcpstat.tcps_rcvmemdrop++; m_freem(m); @@ -213,7 +215,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd V_tcpstat.tcps_rcvduppack++; V_tcpstat.tcps_rcvdupbyte += *tlenp; m_freem(m); - uma_zfree(tcp_reass_zone, te); + uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; V_tcp_reass_qsize--; /* @@ -250,7 +252,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd nq = LIST_NEXT(q, tqe_q); LIST_REMOVE(q, tqe_q); m_freem(q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; q = nq; @@ -287,7 +289,7 @@ present: m_freem(q->tqe_m); else sbappendstream_locked(&so->so_rcv, q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; q = nq; Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/tcp_sack.c Mon Apr 6 22:29:41 2009 (r190787) @@ -123,9 +123,8 @@ __FBSDID("$FreeBSD$"); #include -extern struct uma_zone *sack_hole_zone; - #ifdef VIMAGE_GLOBALS +extern struct uma_zone *sack_hole_zone; int tcp_do_sack; int tcp_sack_maxholes; int tcp_sack_globalmaxholes; @@ -265,7 +264,7 @@ tcp_sackhole_alloc(struct tcpcb *tp, tcp return NULL; } - hole = (struct sackhole *)uma_zalloc(sack_hole_zone, M_NOWAIT); + hole = (struct sackhole *)uma_zalloc(V_sack_hole_zone, M_NOWAIT); if (hole == NULL) return NULL; @@ -287,7 +286,7 @@ tcp_sackhole_free(struct tcpcb *tp, stru { INIT_VNET_INET(tp->t_vnet); - uma_zfree(sack_hole_zone, hole); + uma_zfree(V_sack_hole_zone, hole); tp->snd_numholes--; V_tcp_sack_globalholes--; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/tcp_subr.c Mon Apr 6 22:29:41 2009 (r190787) @@ -243,7 +243,9 @@ SYSCTL_V_INT(V_NET, vnet_inet, _net_inet CTLFLAG_RW, tcp_inflight_stab, 0, "Inflight Algorithm Stabilization 20 = 2 packets"); +#ifdef VIMAGE_GLOBALS uma_zone_t sack_hole_zone; +#endif static struct inpcb *tcp_notify(struct inpcb *, int); static void tcp_isn_tick(void *); @@ -269,7 +271,9 @@ struct tcpcb_mem { struct tcp_timer tt; }; +#ifdef VIMAGE_GLOBALS static uma_zone_t tcpcb_zone; +#endif MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); struct callout isn_callout; static struct mtx isn_mtx; @@ -286,7 +290,7 @@ tcp_zone_change(void *tag) { uma_zone_set_max(V_tcbinfo.ipi_zone, maxsockets); - uma_zone_set_max(tcpcb_zone, maxsockets); + uma_zone_set_max(V_tcpcb_zone, maxsockets); tcp_tw_zone_change(); } @@ -348,18 +352,7 @@ tcp_init(void) V_tcp_sack_globalmaxholes = 65536; V_tcp_sack_globalholes = 0; - tcp_delacktime = TCPTV_DELACK; - tcp_keepinit = TCPTV_KEEP_INIT; - tcp_keepidle = TCPTV_KEEP_IDLE; - tcp_keepintvl = TCPTV_KEEPINTVL; - tcp_maxpersistidle = TCPTV_KEEP_IDLE; - tcp_msl = TCPTV_MSL; - tcp_rexmit_min = TCPTV_MIN; - if (tcp_rexmit_min < 1) - tcp_rexmit_min = 1; - tcp_rexmit_slop = TCPTV_CPU_VAR; V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH; - tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", &V_tcp_do_sack); @@ -372,7 +365,6 @@ tcp_init(void) printf("WARNING: TCB hash size not a power of 2\n"); hashsize = 512; /* safe default */ } - tcp_tcbhashsize = hashsize; V_tcbinfo.ipi_hashbase = hashinit(hashsize, M_PCB, &V_tcbinfo.ipi_hashmask); V_tcbinfo.ipi_porthashbase = hashinit(hashsize, M_PCB, @@ -380,6 +372,37 @@ tcp_init(void) V_tcbinfo.ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb), NULL, NULL, tcp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(V_tcbinfo.ipi_zone, maxsockets); + /* + * These have to be type stable for the benefit of the timers. + */ + V_tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + uma_zone_set_max(V_tcpcb_zone, maxsockets); + tcp_tw_init(); + syncache_init(); + tcp_hc_init(); + tcp_reass_init(); + V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + + /* XXX virtualize those bellow? */ + tcp_delacktime = TCPTV_DELACK; + tcp_keepinit = TCPTV_KEEP_INIT; + tcp_keepidle = TCPTV_KEEP_IDLE; + tcp_keepintvl = TCPTV_KEEPINTVL; + tcp_maxpersistidle = TCPTV_KEEP_IDLE; + tcp_msl = TCPTV_MSL; + tcp_rexmit_min = TCPTV_MIN; + if (tcp_rexmit_min < 1) + tcp_rexmit_min = 1; + tcp_rexmit_slop = TCPTV_CPU_VAR; + tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; + tcp_tcbhashsize = hashsize; + #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) #else /* INET6 */ @@ -390,23 +413,12 @@ tcp_init(void) if (max_linkhdr + TCP_MINPROTOHDR > MHLEN) panic("tcp_init"); #undef TCP_MINPROTOHDR - /* - * These have to be type stable for the benefit of the timers. - */ - tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(tcpcb_zone, maxsockets); - tcp_tw_init(); - syncache_init(); - tcp_hc_init(); - tcp_reass_init(); + ISN_LOCK_INIT(); callout_init(&isn_callout, CALLOUT_MPSAFE); - tcp_isn_tick(NULL); + callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL); EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, SHUTDOWN_PRI_DEFAULT); - sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -686,7 +698,7 @@ tcp_newtcpcb(struct inpcb *inp) int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ - tm = uma_zalloc(tcpcb_zone, M_NOWAIT | M_ZERO); + tm = uma_zalloc(V_tcpcb_zone, M_NOWAIT | M_ZERO); if (tm == NULL) return (NULL); tp = &tm->tcb; @@ -846,7 +858,7 @@ tcp_discardcb(struct tcpcb *tp) while ((q = LIST_FIRST(&tp->t_segq)) != NULL) { LIST_REMOVE(q, tqe_q); m_freem(q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; } @@ -856,7 +868,7 @@ tcp_discardcb(struct tcpcb *tp) tcp_free_sackholes(tp); inp->inp_ppcb = NULL; tp->t_inpcb = NULL; - uma_zfree(tcpcb_zone, tp); + uma_zfree(V_tcpcb_zone, tp); } /* @@ -929,7 +941,7 @@ tcp_drain(void) != NULL) { LIST_REMOVE(te, tqe_q); m_freem(te->tqe_m); - uma_zfree(tcp_reass_zone, te); + uma_zfree(V_tcp_reass_zone, te); tcpb->t_segqlen--; V_tcp_reass_qsize--; } @@ -1546,8 +1558,8 @@ tcp_isn_tick(void *xtp) VNET_ITERATOR_DECL(vnet_iter); u_int32_t projected_offset; - ISN_LOCK(); VNET_LIST_RLOCK(); + ISN_LOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS */ INIT_VNET_INET(curvnet); @@ -1560,9 +1572,9 @@ tcp_isn_tick(void *xtp) V_isn_offset_old = V_isn_offset; CURVNET_RESTORE(); } + ISN_UNLOCK(); VNET_LIST_RUNLOCK(); callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL); - ISN_UNLOCK(); } /* Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/tcp_timewait.c Mon Apr 6 22:29:41 2009 (r190787) @@ -94,7 +94,6 @@ __FBSDID("$FreeBSD$"); #include -static uma_zone_t tcptw_zone; static int maxtcptw; /* @@ -104,6 +103,7 @@ static int maxtcptw; * tcbinfo lock, which must be held over queue iteration and modification. */ #ifdef VIMAGE_GLOBALS +static uma_zone_t tcptw_zone; static TAILQ_HEAD(, tcptw) twq_2msl; int nolocaltimewait; #endif @@ -142,7 +142,7 @@ sysctl_maxtcptw(SYSCTL_HANDLER_ARGS) if (error == 0 && req->newptr) if (new >= 32) { maxtcptw = new; - uma_zone_set_max(tcptw_zone, maxtcptw); + uma_zone_set_max(V_tcptw_zone, maxtcptw); } return (error); } @@ -160,7 +160,7 @@ tcp_tw_zone_change(void) { if (maxtcptw == 0) - uma_zone_set_max(tcptw_zone, tcptw_auto_size()); + uma_zone_set_max(V_tcptw_zone, tcptw_auto_size()); } void @@ -168,13 +168,13 @@ tcp_tw_init(void) { INIT_VNET_INET(curvnet); - tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw), + V_tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("net.inet.tcp.maxtcptw", &maxtcptw); if (maxtcptw == 0) - uma_zone_set_max(tcptw_zone, tcptw_auto_size()); + uma_zone_set_max(V_tcptw_zone, tcptw_auto_size()); else - uma_zone_set_max(tcptw_zone, maxtcptw); + uma_zone_set_max(V_tcptw_zone, maxtcptw); TAILQ_INIT(&V_twq_2msl); } @@ -204,7 +204,7 @@ tcp_twstart(struct tcpcb *tp) return; } - tw = uma_zalloc(tcptw_zone, M_NOWAIT); + tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { tw = tcp_tw_2msl_scan(1); if (tw == NULL) { @@ -477,7 +477,7 @@ tcp_twclose(struct tcptw *tw, int reuse) tw->tw_cred = NULL; if (reuse) return; - uma_zfree(tcptw_zone, tw); + uma_zfree(V_tcptw_zone, tw); } int Modified: head/sys/netinet/vinet.h ============================================================================== --- head/sys/netinet/vinet.h Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet/vinet.h Mon Apr 6 22:29:41 2009 (r190787) @@ -86,6 +86,11 @@ struct vnet_inet { struct tcp_hostcache _tcp_hostcache; struct callout _tcp_hc_callout; + uma_zone_t _tcp_reass_zone; + uma_zone_t _tcpcb_zone; + uma_zone_t _tcptw_zone; + uma_zone_t _sack_hole_zone; + struct tcp_syncache _tcp_syncache; int _tcp_syncookies; int _tcp_syncookiesonly; @@ -315,12 +320,15 @@ extern struct vnet_inet vnet_inet_0; #define V_rtq_timeout VNET_INET(rtq_timeout) #define V_rtq_timer VNET_INET(rtq_timer) #define V_rtq_toomany VNET_INET(rtq_toomany) +#define V_sack_hole_zone VNET_INET(sack_hole_zone) #define V_sameprefixcarponly VNET_INET(sameprefixcarponly) #define V_ss_fltsz VNET_INET(ss_fltsz) #define V_ss_fltsz_local VNET_INET(ss_fltsz_local) #define V_subnetsarelocal VNET_INET(subnetsarelocal) #define V_tcb VNET_INET(tcb) #define V_tcbinfo VNET_INET(tcbinfo) +#define V_tcpcb_zone VNET_INET(tcpcb_zone) +#define V_tcptw_zone VNET_INET(tcptw_zone) #define V_tcp_abc_l_var VNET_INET(tcp_abc_l_var) #define V_tcp_autorcvbuf_inc VNET_INET(tcp_autorcvbuf_inc) #define V_tcp_autorcvbuf_max VNET_INET(tcp_autorcvbuf_max) @@ -353,6 +361,7 @@ extern struct vnet_inet vnet_inet_0; #define V_tcp_reass_maxseg VNET_INET(tcp_reass_maxseg) #define V_tcp_reass_overflows VNET_INET(tcp_reass_overflows) #define V_tcp_reass_qsize VNET_INET(tcp_reass_qsize) +#define V_tcp_reass_zone VNET_INET(tcp_reass_zone) #define V_tcp_sack_globalholes VNET_INET(tcp_sack_globalholes) #define V_tcp_sack_globalmaxholes VNET_INET(tcp_sack_globalmaxholes) #define V_tcp_sack_maxholes VNET_INET(tcp_sack_maxholes) Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet6/frag6.c Mon Apr 6 22:29:41 2009 (r190787) @@ -109,14 +109,16 @@ frag6_init(void) { INIT_VNET_INET6(curvnet); + V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; V_ip6_maxfragpackets = nmbclusters / 4; V_ip6_maxfrags = nmbclusters / 4; - EVENTHANDLER_REGISTER(nmbclusters_change, - frag6_change, NULL, EVENTHANDLER_PRI_ANY); - IP6Q_LOCK_INIT(); + if (!IS_DEFAULT_VNET(curvnet)) + return; - V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; + IP6Q_LOCK_INIT(); + EVENTHANDLER_REGISTER(nmbclusters_change, + frag6_change, NULL, EVENTHANDLER_PRI_ANY); } /* Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet6/in6_src.c Mon Apr 6 22:29:41 2009 (r190787) @@ -920,8 +920,6 @@ in6_pcbsetport(struct in6_addr *laddr, s void addrsel_policy_init(void) { - ADDRSEL_LOCK_INIT(); - ADDRSEL_SXLOCK_INIT(); INIT_VNET_INET6(curvnet); V_ip6_prefer_tempaddr = 0; @@ -931,6 +929,12 @@ addrsel_policy_init(void) /* initialize the "last resort" policy */ bzero(&V_defaultaddrpolicy, sizeof(V_defaultaddrpolicy)); V_defaultaddrpolicy.label = ADDR_LABEL_NOTAPP; + + if (!IS_DEFAULT_VNET(curvnet)) + return; + + ADDRSEL_LOCK_INIT(); + ADDRSEL_SXLOCK_INIT(); } static struct in6_addrpolicy * Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet6/ip6_input.c Mon Apr 6 22:29:41 2009 (r190787) @@ -234,6 +234,17 @@ ip6_init(void) /* 40 1K datagrams */ V_dad_init = 0; + scope6_init(); + addrsel_policy_init(); + nd6_init(); + frag6_init(); + + V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; + + /* Skip global initialization stuff for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + #ifdef DIAGNOSTIC if (sizeof(struct protosw) != sizeof(struct ip6protosw)) panic("sizeof(protosw) != sizeof(ip6protosw)"); @@ -265,18 +276,13 @@ ip6_init(void) printf("%s: WARNING: unable to register pfil hook, " "error %d\n", __func__, i); - ip6intrq.ifq_maxlen = V_ip6qmaxlen; + ip6intrq.ifq_maxlen = V_ip6qmaxlen; /* XXX */ mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF); netisr_register(NETISR_IPV6, ip6_input, &ip6intrq, 0); - scope6_init(); - addrsel_policy_init(); - nd6_init(); - frag6_init(); - V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; } -static void -ip6_init2(void *dummy) +static int +ip6_init2_vnet(const void *unused __unused) { INIT_VNET_INET6(curvnet); @@ -290,6 +296,15 @@ ip6_init2(void *dummy) (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL); + + return (0); +} + +static void +ip6_init2(void *dummy) +{ + + ip6_init2_vnet(NULL); } /* cheat */ Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netinet6/scope6.c Mon Apr 6 22:29:41 2009 (r190787) @@ -83,8 +83,12 @@ scope6_init(void) #else V_ip6_use_defzone = 0; #endif - SCOPE6_LOCK_INIT(); bzero(&V_sid_default, sizeof(V_sid_default)); + + if (!IS_DEFAULT_VNET(curvnet)) + return; + + SCOPE6_LOCK_INIT(); } struct scope6_id * Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netipsec/ipsec.c Mon Apr 6 22:29:41 2009 (r190787) @@ -103,6 +103,8 @@ struct vnet_ipsec vnet_ipsec_0; #endif #endif +static int ipsec_iattach(const void *); + #ifdef VIMAGE_GLOBALS /* NB: name changed so netstat doesn't use it. */ struct ipsecstat ipsec4stat; @@ -1758,8 +1760,18 @@ static void ipsec_attach(void) { + ipsec_iattach(NULL); +} + +static int +ipsec_iattach(const void *unused __unused) +{ + INIT_VNET_IPSEC(curvnet); + SECPOLICY_LOCK_INIT(&V_ip4_def_policy); V_ip4_def_policy.refcnt = 1; /* NB: disallow free. */ + + return (0); } SYSINIT(ipsec, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, ipsec_attach, NULL); Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netipsec/key.c Mon Apr 6 22:29:41 2009 (r190787) @@ -7171,12 +7171,6 @@ key_init(void) V_ipsec_esp_auth = 0; V_ipsec_ah_keymin = 128; - SPTREE_LOCK_INIT(); - REGTREE_LOCK_INIT(); - SAHTREE_LOCK_INIT(); - ACQ_LOCK_INIT(); - SPACQ_LOCK_INIT(); - for (i = 0; i < IPSEC_DIR_MAX; i++) LIST_INIT(&V_sptree[i]); @@ -7192,6 +7186,15 @@ key_init(void) V_ip4_def_policy.policy = IPSEC_POLICY_NONE; V_ip4_def_policy.refcnt++; /*never reclaim this*/ + if (!IS_DEFAULT_VNET(curvnet)) + return; + + SPTREE_LOCK_INIT(); + REGTREE_LOCK_INIT(); + SAHTREE_LOCK_INIT(); + ACQ_LOCK_INIT(); + SPACQ_LOCK_INIT(); + #ifndef IPSEC_DEBUG2 timeout((void *)key_timehandler, (void *)0, hz); #endif /*IPSEC_DEBUG2*/ Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netipsec/xform_ah.c Mon Apr 6 22:29:41 2009 (r190787) @@ -73,6 +73,8 @@ #include +static int ah_iattach(const void *); + /* * Return header size in bytes. The old protocol did not support * the replay counter; the new protocol always includes the counter. @@ -1220,9 +1222,18 @@ static void ah_attach(void) { + xform_register(&ah_xformsw); + ah_iattach(NULL); +} + +static int +ah_iattach(const void *unused __unused) +{ + INIT_VNET_IPSEC(curvnet); + V_ah_enable = 1; /* control flow of packets with AH */ V_ah_cleartos = 1; /* clear ip_tos when doing AH calc */ - xform_register(&ah_xformsw); + return (0); } SYSINIT(ah_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ah_attach, NULL); Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Mon Apr 6 21:52:10 2009 (r190786) +++ head/sys/netipsec/xform_esp.c Mon Apr 6 22:29:41 2009 (r190787) @@ -90,6 +90,7 @@ SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_ static int esp_input_cb(struct cryptop *op); static int esp_output_cb(struct cryptop *crp); +static int esp_iattach(const void *); /* * NB: this is public for use by the PF_KEY support. @@ -990,9 +991,19 @@ static struct xformsw esp_xformsw = { static void esp_attach(void) { + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 01:37:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 660131065750; Tue, 7 Apr 2009 01:37:50 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 541C18FC20; Tue, 7 Apr 2009 01:37:50 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n371boxd088871; Tue, 7 Apr 2009 01:37:50 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n371boau088870; Tue, 7 Apr 2009 01:37:50 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904070137.n371boau088870@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Apr 2009 01:37: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: r190789 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 01:37:51 -0000 Author: weongyo Date: Tue Apr 7 01:37:50 2009 New Revision: 190789 URL: http://svn.freebsd.org/changeset/base/190789 Log: Add an entry for the uath(4) module. Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Apr 7 01:13:44 2009 (r190788) +++ head/sys/boot/forth/loader.conf Tue Apr 7 01:37:50 2009 (r190789) @@ -275,6 +275,7 @@ if_tl_load="NO" # Texas Instruments TN if_tx_load="NO" # SMC 83c17x Fast Ethernet if_txp_load="NO" # 3Com 3XP Typhoon/Sidewinder (3CR990) if_vge_load="NO" # VIA VT6122 PCI Gigabit Ethernet +if_uath_load="NO" # Atheros USB wireless for AR5005UG & AR5005UX if_udav_load="NO" # Davicom DM9601 USB Ethernet if_upgt_load="NO" # Conexant/Intersil PrismGT USB wireless if_ural_load="NO" # Ralink Technology USB wireless From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 01:41:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931C4106570A; Tue, 7 Apr 2009 01:41:17 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FCAD8FC14; Tue, 7 Apr 2009 01:41:17 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n371fHA8089127; Tue, 7 Apr 2009 01:41:17 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n371fHO9089126; Tue, 7 Apr 2009 01:41:17 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904070141.n371fHO9089126@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Apr 2009 01:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190790 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 01:41:18 -0000 Author: weongyo Date: Tue Apr 7 01:41:17 2009 New Revision: 190790 URL: http://svn.freebsd.org/changeset/base/190790 Log: Add uath(4) to the list of supported network interface. Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Tue Apr 7 01:37:50 2009 (r190789) +++ head/usr.sbin/sysinstall/devices.c Tue Apr 7 01:41:17 2009 (r190790) @@ -154,6 +154,7 @@ static struct _devname { NETWORK("txp", "3Com 3cR990 Ethernet card"), NETWORK("ti", "Alteon Networks PCI Gigabit Ethernet card"), NETWORK("tl", "Texas Instruments ThunderLAN PCI Ethernet card"), + NETWORK("uath", "Atheros AR5005UG and AR5005UX USB wireless adapter"), NETWORK("upgt", "Conexant/Intersil PrismGT USB wireless adapter"), NETWORK("ural", "Ralink Technology RT2500USB 802.11 wireless adapter"), NETWORK("urtw", "Realtek 8187L USB wireless adapter"), From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 01:58:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16F9B10657AA; Tue, 7 Apr 2009 01:58:30 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03CC08FC1C; Tue, 7 Apr 2009 01:58:30 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n371wTwD089507; Tue, 7 Apr 2009 01:58:29 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n371wTrG089506; Tue, 7 Apr 2009 01:58:29 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904070158.n371wTrG089506@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Apr 2009 01:58: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: r190791 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 01:58:31 -0000 Author: weongyo Date: Tue Apr 7 01:58:29 2009 New Revision: 190791 URL: http://svn.freebsd.org/changeset/base/190791 Log: Hook uathload up to the build. It's used for loading the firmware for uath(4). Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Apr 7 01:41:17 2009 (r190790) +++ head/usr.sbin/Makefile Tue Apr 7 01:58:29 2009 (r190791) @@ -180,6 +180,7 @@ SUBDIR= ${_ac} \ ${_traceroute6} \ trpt \ tzsetup \ + ${_uathload} \ ugidfw \ ${_usbdevs} \ ${_usbconfig} \ @@ -396,6 +397,7 @@ _crunch= crunch .endif .if ${MK_USB} != "no" +_uathload= uathload #_usbdevs= usbdevs _usbconfig= usbconfig .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 02:33:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B13C10656D8; Tue, 7 Apr 2009 02:33:47 +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 6862C8FC08; Tue, 7 Apr 2009 02:33:47 +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 n372Xl6W090409; Tue, 7 Apr 2009 02:33:47 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n372XlC9090407; Tue, 7 Apr 2009 02:33:47 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200904070233.n372XlC9090407@svn.freebsd.org> From: Sean Bruno Date: Tue, 7 Apr 2009 02:33: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: r190792 - head/sys/dev/firewire X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 02:33:48 -0000 Author: sbruno Date: Tue Apr 7 02:33:46 2009 New Revision: 190792 URL: http://svn.freebsd.org/changeset/base/190792 Log: Minor updates as a precursor to fixing sbp_targ firewire.c -- expand a comment and repair a typo sbp.h -- define Logical Unit Reset so it can be used in sbp_targ Reviewed by: scottl@freebsd.org Modified: head/sys/dev/firewire/firewire.c head/sys/dev/firewire/sbp.h Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Tue Apr 7 01:58:29 2009 (r190791) +++ head/sys/dev/firewire/firewire.c Tue Apr 7 02:33:46 2009 (r190792) @@ -1641,7 +1641,11 @@ fw_explore_node(struct fw_device *dfwdev break; } - /* inesrt into sorted fwdev list */ + + /* + * If the fwdev is not found in the + * fc->devices TAILQ, then we will add it. + */ pfwdev = NULL; STAILQ_FOREACH(tfwdev, &fc->devices, link) { if (tfwdev->eui.hi > fwdev->eui.hi || Modified: head/sys/dev/firewire/sbp.h ============================================================================== --- head/sys/dev/firewire/sbp.h Tue Apr 7 01:58:29 2009 (r190791) +++ head/sys/dev/firewire/sbp.h Tue Apr 7 02:33:46 2009 (r190792) @@ -121,7 +121,7 @@ struct sbp_status{ /* 3: Page size not supported */ /* 4: Access denied */ #define STATUS_ACCESS_DENY 4 -/* 5: Logical unit not supported */ +#define STATUS_LUR 5 /* 6: Maximum payload too small */ /* 7: Reserved for future standardization */ /* 8: Resource unavailabe */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 04:12:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7361D10657BE; Tue, 7 Apr 2009 04:12:35 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 470508FC15; Tue, 7 Apr 2009 04:12:35 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n374CYdn093419; Tue, 7 Apr 2009 04:12:34 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n374CYgI093418; Tue, 7 Apr 2009 04:12:34 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904070412.n374CYgI093418@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 7 Apr 2009 04:12: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: r190793 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 04:12:35 -0000 Author: weongyo Date: Tue Apr 7 04:12:34 2009 New Revision: 190793 URL: http://svn.freebsd.org/changeset/base/190793 Log: do not cause a line break in the AUTHORS section. Pointed by: yongari Modified: head/share/man/man4/uath.4 Modified: head/share/man/man4/uath.4 ============================================================================== --- head/share/man/man4/uath.4 Tue Apr 7 02:33:46 2009 (r190792) +++ head/share/man/man4/uath.4 Tue Apr 7 04:12:34 2009 (r190793) @@ -171,6 +171,7 @@ The driver first appeared in .Ox 4.0 . .Sh AUTHORS +.An -nosplit The .Nm driver was written by From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 05:41:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 660C81065797; Tue, 7 Apr 2009 05:41:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 536D48FC08; Tue, 7 Apr 2009 05:41:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n375fdkL095854; Tue, 7 Apr 2009 05:41:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n375fd7b095849; Tue, 7 Apr 2009 05:41:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904070541.n375fd7b095849@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 05:41: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: r190794 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 05:41:40 -0000 Author: imp Date: Tue Apr 7 05:41:38 2009 New Revision: 190794 URL: http://svn.freebsd.org/changeset/base/190794 Log: Provide a generic ifmedia set of routines as a fallback. The DP8390-based cards have no generic way of reporting status of the link or setting the media type. Some specific versions of these cards do, however, allow for this, and we already support some of them. Make the 'ed' experience more uniform by providing "autoselect" as the meida and status "active" always. This won't affect the chips that provide more specific details. Modified: head/sys/dev/ed/if_ed.c head/sys/dev/ed/if_ed_cbus.c head/sys/dev/ed/if_ed_isa.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/ed/if_edvar.h Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Tue Apr 7 04:12:34 2009 (r190793) +++ head/sys/dev/ed/if_ed.c Tue Apr 7 05:41:38 2009 (r190794) @@ -1739,3 +1739,38 @@ ed_shmem_write_mbufs(struct ed_softc *sc } return (len); } + +/* + * Generic ifmedia support. By default, the DP8390-based cards don't know + * what their network attachment really is, or even if it is valid (except + * upon successful transmission of a packet). To play nicer with dhclient, as + * well as to fit in with a framework where some cards can provde more + * detailed information, make sure that we use this as a fallback. + */ +static int +ed_gen_ifmedia_ioctl(struct ed_softc *sc, struct ifreq *ifr, u_long command) +{ + return (ifmedia_ioctl(sc->ifp, ifr, &sc->ifmedia, command)); +} + +static int +ed_gen_ifmedia_upd(struct ifnet *ifp) +{ + return 0; +} + +static void +ed_gen_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + ifmr->ifm_active = IFM_ETHER | IFM_AUTO; + ifmr->ifm_status = IFM_AVALID | IFM_ACTIVE; +} + +void +ed_gen_ifmedia_init(struct ed_softc *sc) +{ + sc->sc_media_ioctl = &ed_gen_ifmedia_ioctl; + ifmedia_init(&sc->ifmedia, 0, ed_gen_ifmedia_upd, ed_gen_ifmedia_sts); + ifmedia_add(&sc->ifmedia, IFM_ETHER | IFM_AUTO, 0, 0); + ifmedia_set(&sc->ifmedia, IFM_ETHER | IFM_AUTO); +} Modified: head/sys/dev/ed/if_ed_cbus.c ============================================================================== --- head/sys/dev/ed/if_ed_cbus.c Tue Apr 7 04:12:34 2009 (r190793) +++ head/sys/dev/ed/if_ed_cbus.c Tue Apr 7 05:41:38 2009 (r190794) @@ -248,7 +248,8 @@ ed_cbus_attach(dev) ed_release_resources(dev); return (error); } - + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); return ed_attach(dev); } Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Tue Apr 7 04:12:34 2009 (r190793) +++ head/sys/dev/ed/if_ed_isa.c Tue Apr 7 05:41:38 2009 (r190794) @@ -175,7 +175,8 @@ ed_isa_attach(device_t dev) ed_release_resources(dev); return (error); } - + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); return ed_attach(dev); } Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Tue Apr 7 04:12:34 2009 (r190793) +++ head/sys/dev/ed/if_ed_pci.c Tue Apr 7 05:41:38 2009 (r190794) @@ -91,11 +91,9 @@ ed_pci_attach(device_t dev) int error = ENXIO; /* - * If this card claims to be a RTL8029, probe it as such. - * However, allow that probe to fail. Some versions of qemu - * claim to be a 8029 in the PCI register, but it doesn't - * implement the 8029 specific registers. In that case, fall - * back to a normal NE2000. + * Probe RTL8029 cards, but allow failure and try as a generic + * ne-2000. QEMU 0.9 and earlier use the RTL8029 PCI ID, but + * are areally just generic ne-2000 cards. */ if (pci_get_devid(dev) == ED_RTL8029_PCI_ID) error = ed_probe_RTL80x9(dev, PCIR_BAR(0), flags); @@ -118,7 +116,8 @@ ed_pci_attach(device_t dev) ed_release_resources(dev); return (error); } - + if (sc->sc_media_ioctl == NULL) + ed_gen_ifmedia_init(sc); error = ed_attach(dev); if (error) ed_release_resources(dev); Modified: head/sys/dev/ed/if_edvar.h ============================================================================== --- head/sys/dev/ed/if_edvar.h Tue Apr 7 04:12:34 2009 (r190793) +++ head/sys/dev/ed/if_edvar.h Tue Apr 7 05:41:38 2009 (r190794) @@ -226,6 +226,8 @@ u_short ed_pio_write_mbufs(struct ed_sof void ed_disable_16bit_access(struct ed_softc *); void ed_enable_16bit_access(struct ed_softc *); +void ed_gen_ifmedia_init(struct ed_softc *); + driver_intr_t edintr; extern devclass_t ed_devclass; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 05:57:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90FD1065749; Tue, 7 Apr 2009 05:57:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A745E8FC08; Tue, 7 Apr 2009 05:57:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n375vuph096304; Tue, 7 Apr 2009 05:57:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n375vuDi096303; Tue, 7 Apr 2009 05:57:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904070557.n375vuDi096303@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 05:57: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: r190795 - head/sys/dev/pccard X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 05:57:57 -0000 Author: imp Date: Tue Apr 7 05:57:56 2009 New Revision: 190795 URL: http://svn.freebsd.org/changeset/base/190795 Log: Another GlobalVillage card. Modified: head/sys/dev/pccard/pccarddevs Modified: head/sys/dev/pccard/pccarddevs ============================================================================== --- head/sys/dev/pccard/pccarddevs Tue Apr 7 05:41:38 2009 (r190794) +++ head/sys/dev/pccard/pccarddevs Tue Apr 7 05:57:56 2009 (r190795) @@ -344,6 +344,7 @@ product FUJITSU WL110 0x2003 PEGA-WL110 product GEMPLUS GPR400 0x3004 GPR400 Smartcard Reader /* GlobalVillage */ +product GLOBALVILLAGE POWERPORT 0x0103 GlobalVillage PowerPort PlatinumPro product GLOBALVILLAGE LANMODEM 0x0105 GlobalVillage Ethernet + Modem /* Grey Cell Systems, Ltd */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 07:38:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 246A7106587F; Tue, 7 Apr 2009 07:38:29 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id A1A858FC0C; Tue, 7 Apr 2009 07:38:28 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-216-167.belrs3.nsw.optusnet.com.au [122.106.216.167]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n377cO8s005102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Apr 2009 17:38:25 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n377cNjP013608; Tue, 7 Apr 2009 17:38:23 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n377cNjd013607; Tue, 7 Apr 2009 17:38:23 +1000 (EST) (envelope-from peter) Date: Tue, 7 Apr 2009 17:38:23 +1000 From: Peter Jeremy To: Robert Watson Message-ID: <20090407073823.GA13564@server.vk2pj.dyndns.org> References: <200904061427.n36ERTVF074015@svn.freebsd.org> <1239030459.1946.4.camel@localhost> <5EEC0668-D1C4-45E8-AFC1-959AE3E8715E@lakerest.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.19 (2009-01-05) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Randall Stewart , Randall Stewart , svn-src-head@freebsd.org, Coleman Kane Subject: Re: svn commit: r190775 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 07:38:30 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2009-Apr-06 18:45:29 +0100, Robert Watson wrote: > Perhaps I'm sort of old-fashioned, but I would generally expect: > > (1) No netmask specified -- use class to determine netmask > (2) netmask specified using -net 192.168/20 -- use /20 > (3) netmask specified using -netmask -- use the -netmask argument. Likewise. I also feel that the newly committed behaviour breaks POLA and doesn't match the behaviour of Linux,=20 A possible mechanism to handle CIDR routing is to have /etc/netmasks ala Solaris which specifies netmask sizes for different subnets. --=20 Peter Jeremy --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAknbAu8ACgkQ/opHv/APuIf1DQCfR3zjj0XA8v79sL5DkwKt89K9 UvwAn3RgFhXzrIctk1i0TIcmzNjAWl/f =n/np -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 13:42:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 541991065725; Tue, 7 Apr 2009 13:42:54 +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 3FD718FC17; Tue, 7 Apr 2009 13:42:54 +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 n37DgsVP010053; Tue, 7 Apr 2009 13:42:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37DgrPg010037; Tue, 7 Apr 2009 13:42:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200904071342.n37DgrPg010037@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 7 Apr 2009 13:42: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: r190798 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 13:42:55 -0000 Author: trasz Date: Tue Apr 7 13:42:53 2009 New Revision: 190798 URL: http://svn.freebsd.org/changeset/base/190798 Log: Add wide character variants of string manipulations routines to 'SEE ALSO'. Approved by: rwatson (mentor) Modified: head/lib/libc/string/memchr.3 head/lib/libc/string/memcmp.3 head/lib/libc/string/memcpy.3 head/lib/libc/string/memmove.3 head/lib/libc/string/memset.3 head/lib/libc/string/strcasecmp.3 head/lib/libc/string/strcat.3 head/lib/libc/string/strchr.3 head/lib/libc/string/strcmp.3 head/lib/libc/string/strcpy.3 head/lib/libc/string/strdup.3 head/lib/libc/string/strlcpy.3 head/lib/libc/string/strlen.3 head/lib/libc/string/strpbrk.3 head/lib/libc/string/strspn.3 head/lib/libc/string/strstr.3 Modified: head/lib/libc/string/memchr.3 ============================================================================== --- head/lib/libc/string/memchr.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/memchr.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -83,7 +83,8 @@ bytes. .Xr strsep 3 , .Xr strspn 3 , .Xr strstr 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr wmemchr 3 .Sh STANDARDS The .Fn memchr Modified: head/lib/libc/string/memcmp.3 ============================================================================== --- head/lib/libc/string/memcmp.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/memcmp.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -72,7 +72,8 @@ Zero-length strings are always identical .Xr strcasecmp 3 , .Xr strcmp 3 , .Xr strcoll 3 , -.Xr strxfrm 3 +.Xr strxfrm 3 , +.Xr wmemcmp 3 .Sh STANDARDS The .Fn memcmp Modified: head/lib/libc/string/memcpy.3 ============================================================================== --- head/lib/libc/string/memcpy.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/memcpy.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -64,7 +64,8 @@ returns the original value of .Xr bcopy 3 , .Xr memccpy 3 , .Xr memmove 3 , -.Xr strcpy 3 +.Xr strcpy 3 , +.Xr wmemcpy 3 .Sh STANDARDS The .Fn memcpy Modified: head/lib/libc/string/memmove.3 ============================================================================== --- head/lib/libc/string/memmove.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/memmove.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -65,7 +65,8 @@ function returns the original value of .Xr bcopy 3 , .Xr memccpy 3 , .Xr memcpy 3 , -.Xr strcpy 3 +.Xr strcpy 3 , +.Xr wmemmove 3 .Sh STANDARDS The .Fn memmove Modified: head/lib/libc/string/memset.3 ============================================================================== --- head/lib/libc/string/memset.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/memset.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -60,7 +60,8 @@ The function returns its first argument. .Sh SEE ALSO .Xr bzero 3 , -.Xr swab 3 +.Xr swab 3 , +.Xr wmemset 3 .Sh STANDARDS The .Fn memset Modified: head/lib/libc/string/strcasecmp.3 ============================================================================== --- head/lib/libc/string/strcasecmp.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strcasecmp.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -83,7 +83,8 @@ is greater than .Xr strcmp 3 , .Xr strcoll 3 , .Xr strxfrm 3 , -.Xr tolower 3 +.Xr tolower 3 , +.Xr wcscasecmp 3 .Sh HISTORY The .Fn strcasecmp Modified: head/lib/libc/string/strcat.3 ============================================================================== --- head/lib/libc/string/strcat.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strcat.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -144,7 +144,8 @@ foo(const char *arbitrary_string) .Xr memmove 3 , .Xr strcpy 3 , .Xr strlcat 3 , -.Xr strlcpy 3 +.Xr strlcpy 3 , +.Xr wcscat 3 .Sh STANDARDS The .Fn strcat Modified: head/lib/libc/string/strchr.3 ============================================================================== --- head/lib/libc/string/strchr.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strchr.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -85,7 +85,8 @@ if the character does not appear in the .Xr strsep 3 , .Xr strspn 3 , .Xr strstr 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr wcschr 3 .Sh STANDARDS The functions .Fn strchr Modified: head/lib/libc/string/strcmp.3 ============================================================================== --- head/lib/libc/string/strcmp.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strcmp.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -89,7 +89,8 @@ is greater than .Xr memcmp 3 , .Xr strcasecmp 3 , .Xr strcoll 3 , -.Xr strxfrm 3 +.Xr strxfrm 3 , +.Xr wcscmp 3 .Sh STANDARDS The .Fn strcmp Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strcpy.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -189,7 +189,8 @@ and .Xr memccpy 3 , .Xr memcpy 3 , .Xr memmove 3 , -.Xr strlcpy 3 +.Xr strlcpy 3 , +.Xr wcscpy 3 .Sh STANDARDS The .Fn strcpy Modified: head/lib/libc/string/strdup.3 ============================================================================== --- head/lib/libc/string/strdup.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strdup.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -71,7 +71,8 @@ always terminating the copied string. .Sh SEE ALSO .Xr free 3 , -.Xr malloc 3 +.Xr malloc 3 , +.Xr wcsdup 3 .Sh HISTORY The .Fn strdup Modified: head/lib/libc/string/strlcpy.3 ============================================================================== --- head/lib/libc/string/strlcpy.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strlcpy.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -192,7 +192,8 @@ As a matter of fact, the first version o .Sh SEE ALSO .Xr snprintf 3 , .Xr strncat 3 , -.Xr strncpy 3 +.Xr strncpy 3 , +.Xr wcslcpy 3 .Sh HISTORY The .Fn strlcpy Modified: head/lib/libc/string/strlen.3 ============================================================================== --- head/lib/libc/string/strlen.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strlen.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -77,7 +77,9 @@ or .Fa maxlen , whichever is smaller. .Sh SEE ALSO -.Xr string 3 +.Xr string 3 , +.Xr wcslen 3 , +.Xr wcswidth 3 .Sh STANDARDS The .Fn strlen Modified: head/lib/libc/string/strpbrk.3 ============================================================================== --- head/lib/libc/string/strpbrk.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strpbrk.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -67,7 +67,8 @@ returns NULL. .Xr strsep 3 , .Xr strspn 3 , .Xr strstr 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr wcspbrk 3 .Sh STANDARDS The .Fn strpbrk Modified: head/lib/libc/string/strspn.3 ============================================================================== --- head/lib/libc/string/strspn.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strspn.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -74,7 +74,8 @@ returns the number of characters spanned .Xr strrchr 3 , .Xr strsep 3 , .Xr strstr 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr wcsspn 3 .Sh STANDARDS The .Fn strspn Modified: head/lib/libc/string/strstr.3 ============================================================================== --- head/lib/libc/string/strstr.3 Tue Apr 7 12:49:50 2009 (r190797) +++ head/lib/libc/string/strstr.3 Tue Apr 7 13:42:53 2009 (r190798) @@ -135,7 +135,8 @@ ptr = strnstr(largestring, smallstring, .Xr strrchr 3 , .Xr strsep 3 , .Xr strspn 3 , -.Xr strtok 3 +.Xr strtok 3 , +.Xr wcsstr 3 .Sh STANDARDS The .Fn strstr From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 13:51:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DD7A10656E7; Tue, 7 Apr 2009 13:51:42 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39BA58FC0C; Tue, 7 Apr 2009 13:51:42 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37DpfET010296; Tue, 7 Apr 2009 13:51:41 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37DpfRl010295; Tue, 7 Apr 2009 13:51:41 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904071351.n37DpfRl010295@svn.freebsd.org> From: Tom Rhodes Date: Tue, 7 Apr 2009 13:51: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: r190799 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 13:51:44 -0000 Author: trhodes Date: Tue Apr 7 13:51:41 2009 New Revision: 190799 URL: http://svn.freebsd.org/changeset/base/190799 Log: Remove contractions, reword a sentence to avoid a double negative, and bump document date for previous change. OKed by: piso Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Apr 7 13:42:53 2009 (r190798) +++ head/sbin/ipfw/ipfw.8 Tue Apr 7 13:51:41 2009 (r190799) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2009 +.Dd April 5, 2009 .Dt IPFW 8 .Os .Sh NAME @@ -881,9 +881,10 @@ and which limit, respectively, the maximum number of processable fragments (default: 800) and the maximum number of fragments per packet (default: 16). .Pp -NOTA BENE: since fragments don't contain port numbers, beware not to use them whe issuing a +NOTA BENE: since fragments do not contain port numbers, they should be avoided with the .Nm reass -rule. Alternatively, direction-based (like +rule. +Alternatively, direction-based (like .Nm in / .Nm out From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 14:33:55 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CDAF10656C9 for ; Tue, 7 Apr 2009 14:33:55 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from andxor.it (relay.andxor.it [195.223.2.3]) by mx1.freebsd.org (Postfix) with SMTP id 61A658FC0C for ; Tue, 7 Apr 2009 14:33:54 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: (qmail 25510 invoked from network); 7 Apr 2009 14:07:13 -0000 Received: from unknown (HELO ale.andxor.it) (192.168.2.5) by andxor.it with SMTP; 7 Apr 2009 14:07:13 -0000 Message-ID: <49DB5E10.9000209@FreeBSD.org> Date: Tue, 07 Apr 2009 16:07:12 +0200 From: Alex Dupre User-Agent: Thunderbird 2.0.0.21 (X11/20090328) MIME-Version: 1.0 To: Randall Stewart References: <200904061009.n36A9K6l063517@svn.freebsd.org> <49D9DBED.6050805@FreeBSD.org> <8ACFDA96-746E-49C9-B562-65DF82CD361B@lakerest.net> In-Reply-To: <8ACFDA96-746E-49C9-B562-65DF82CD361B@lakerest.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: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 14:33:56 -0000 Randall Stewart ha scritto: >> Are you sure that this is a good idea? Is this behavior >> described/recommended somewhere? IMHO specifying network without >> explicitly defined netmask is at least dangerous, if not wrong, in >> present classless addressing time. Changing existing behavior breaks >> POLA for some set of users, while benefits are not so obvious to me. >> With previous code networks 10.0.0.0 and 11.0.0.0 were treated as /8, >> but with this change it became /7 and /8 respectively. > > Well it is how CIDR works.. and cidr's been around since before > 1997. I can go dig up the RFC's that specifu this if you woudl like I cannot see any references to CIDR notation without prefix length in RFC 4632. -- Alex Dupre From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 14:42:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC5B01065670; Tue, 7 Apr 2009 14:42:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A899E8FC3B; Tue, 7 Apr 2009 14:42:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37Egeix011568; Tue, 7 Apr 2009 14:42:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37EgehW011567; Tue, 7 Apr 2009 14:42:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200904071442.n37EgehW011567@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 7 Apr 2009 14:42: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: r190800 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 14:42:42 -0000 Author: bz Date: Tue Apr 7 14:42:40 2009 New Revision: 190800 URL: http://svn.freebsd.org/changeset/base/190800 Log: With the right comparison we get a proper wscale value and thus more adequate TCP performance with IPv6. Changes for IPv4, r166403 and r172795, both ignored the IPv6 counterpart and left it in the state of art of year 2000. The same logic in syncache already shares code between v4 and v6 so things do not need to be adapted there. Reported by: Steinar Haug (sthaug nethelp.no) Tested by: Steinar Haug (sthaug nethelp.no) MFC after: 3 days Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Apr 7 13:51:41 2009 (r190799) +++ head/sys/netinet/tcp_usrreq.c Tue Apr 7 14:42:40 2009 (r190800) @@ -1173,7 +1173,7 @@ tcp6_connect(struct tcpcb *tp, struct so /* Compute window scaling to request. */ while (tp->request_r_scale < TCP_MAX_WINSHIFT && - (TCP_MAXWIN << tp->request_r_scale) < so->so_rcv.sb_hiwat) + (TCP_MAXWIN << tp->request_r_scale) < sb_max) tp->request_r_scale++; soisconnecting(so); From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 15:34:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E28106566B; Tue, 7 Apr 2009 15:34:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 771BE8FC14; Tue, 7 Apr 2009 15:34:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37FYQsq012748; Tue, 7 Apr 2009 15:34:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37FYQlg012747; Tue, 7 Apr 2009 15:34:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071534.n37FYQlg012747@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:34: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: r190801 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:34:27 -0000 Author: imp Date: Tue Apr 7 15:34:26 2009 New Revision: 190801 URL: http://svn.freebsd.org/changeset/base/190801 Log: Minor fixes to comments about media autoselect. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 14:42:40 2009 (r190800) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:34:26 2009 (r190801) @@ -45,6 +45,7 @@ * 2 loopback * 1 gdlink (tpi mode only) 1 tp good, 0 tp bad * 0 0-no mam, 1 mam connected + * * NS83926 appears to be a NS pcmcia glue chip used on the IBM Ethernet II * and the NEC PC9801N-J12 ccr base 0x2000! * @@ -64,8 +65,6 @@ * 0-1 PHY01 00 auto, 01 res, 10 10B5, 11 TPI * 2 GDLINK 1 disable checking of link * 6 LINK 0 bad link, 1 good link - * TMI tc5299 10/100 chip, has a different MII interaction than - * dl100xx and ax88x90. * * EN5017A, EN5020 no data, but very popular * Other chips? @@ -114,9 +113,12 @@ * memory somewhere that isn't in the CIS. Some new chipsets have it * in special registers in the ASIC part of the chip. * - * For those cards that have the MAC adress stored in attribute memory, - * nearly all of them have it at a fixed offset (0xff0). We use that - * offset as a source of last resource if other offsets have failed. + * For those cards that have the MAC adress stored in attribute memory + * outside of a FUNCE entry in the CIS, nearly all of them have it at + * a fixed offset (0xff0). We use that offset as a source of last + * resource if other offsets have failed. This is the address of the + * National Semiconductor DP83903A, which is the only chip's datasheet + * I've found. */ #define ED_DEFAULT_MAC_OFFSET 0xff0 From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 15:36:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03005106564A; Tue, 7 Apr 2009 15:36:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5C938FC0A; Tue, 7 Apr 2009 15:36:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37Fa28q012824; Tue, 7 Apr 2009 15:36:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37Fa2tt012823; Tue, 7 Apr 2009 15:36:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071536.n37Fa2tt012823@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190802 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:36:03 -0000 Author: imp Date: Tue Apr 7 15:36:02 2009 New Revision: 190802 URL: http://svn.freebsd.org/changeset/base/190802 Log: Apply generic media stuff to pccard case too, when we aren't using miibus for this. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:34:26 2009 (r190801) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:36:02 2009 (r190802) @@ -607,6 +607,9 @@ ed_pccard_attach(device_t dev) sc->sc_mediachg = ed_pccard_mediachg; sc->sc_media_ioctl = ed_pccard_media_ioctl; ed_pccard_kick_phy(sc); + } else { + printf("Generic ifmedia\n"); + ed_gen_ifmedia_init(sc); } if (sc->modem_rid != -1) ed_pccard_add_modem(dev); From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 15:40:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 978F91065689; Tue, 7 Apr 2009 15:40:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA708FC18; Tue, 7 Apr 2009 15:40:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37Fec3s012958; Tue, 7 Apr 2009 15:40:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37FecLb012957; Tue, 7 Apr 2009 15:40:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071540.n37FecLb012957@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:40: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: r190803 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:40:39 -0000 Author: imp Date: Tue Apr 7 15:40:38 2009 New Revision: 190803 URL: http://svn.freebsd.org/changeset/base/190803 Log: The DL100xx cards have 24k of packet memory, not 16k. Use it for them and update comments about original patches doing this and it not working. It works for both the DL10019 and DL10022 based cards that I have. It really helps the DL10019 cards, since they were using 8k instead of the normal 16k that regular NE-2000 cards help. # Note to self: need to provide a common routine to setup memory # parameters. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:36:02 2009 (r190802) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:40:38 2009 (r190803) @@ -622,10 +622,6 @@ bad: /* * Probe the Ethernet MAC addrees for PCMCIA Linksys EtherFast 10/100 * and compatible cards (DL10019C Ethernet controller). - * - * Note: The PAO patches try to use more memory for the card, but that - * seems to fail for my card. A future optimization would add this back - * conditionally. */ static int ed_pccard_dl100xx(device_t dev, const struct ed_product *pp) @@ -633,6 +629,7 @@ ed_pccard_dl100xx(device_t dev, const st struct ed_softc *sc = device_get_softc(dev); u_char sum; uint8_t id; + u_int memsize; int i, error; if (!(pp->flags & NE2000DVF_DL100XX)) @@ -666,8 +663,26 @@ ed_pccard_dl100xx(device_t dev, const st ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); id = ed_asic_inb(sc, 0xf); sc->isa16bit = 1; - sc->vendor = ED_VENDOR_NOVELL; + /* + * Hard code values based on the datasheet. We're NE-2000 compatible + * NIC with 24kb of packet memory starting at 24k offset. These + * cards also work with 16k at 16k, but don't work with 24k at 16k + * or 32k at 16k. + */ sc->type = ED_TYPE_NE2000; + sc->mem_start = 24 * 1024; + memsize = sc->mem_size = 24 * 1024; + sc->mem_end = sc->mem_start + memsize; + sc->tx_page_start = memsize / ED_PAGE_SIZE; + sc->txb_cnt = 3; + sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE; + sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE; + + sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; + + ed_nic_outb(sc, ED_P0_PSTART, sc->mem_start / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, sc->mem_end / ED_PAGE_SIZE); + sc->vendor = ED_VENDOR_NOVELL; sc->chip_type = (id & 0x90) == 0x90 ? ED_CHIP_TYPE_DL10022 : ED_CHIP_TYPE_DL10019; sc->type_str = ((id & 0x90) == 0x90) ? "DL10022" : "DL10019"; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 15:43:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F5E1065677; Tue, 7 Apr 2009 15:43:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2DA8FC08; Tue, 7 Apr 2009 15:43:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37FhZtP013058; Tue, 7 Apr 2009 15:43:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37FhZFr013057; Tue, 7 Apr 2009 15:43:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071543.n37FhZFr013057@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:43: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: r190804 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:43:36 -0000 Author: imp Date: Tue Apr 7 15:43:34 2009 New Revision: 190804 URL: http://svn.freebsd.org/changeset/base/190804 Log: Move tick to end of file for better code references. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:40:38 2009 (r190803) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:43:34 2009 (r190804) @@ -239,6 +239,7 @@ static const struct ed_product { */ static int ed_pccard_probe(device_t); static int ed_pccard_attach(device_t); +static void ed_pccard_tick(void *); static int ed_pccard_dl100xx(device_t dev, const struct ed_product *); static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc); @@ -426,30 +427,6 @@ ed_pccard_mediachg(struct ed_softc *sc) mii_mediachg(mii); } -static void -ed_pccard_tick(void *arg) -{ - struct ed_softc *sc = arg; - struct mii_data *mii; - int media = 0; - - ED_ASSERT_LOCKED(sc); - if (sc->miibus != NULL) { - mii = device_get_softc(sc->miibus); - media = mii->mii_media_status; - mii_tick(mii); - if (mii->mii_media_status & IFM_ACTIVE && - media != mii->mii_media_status && 0 && - sc->chip_type == ED_CHIP_TYPE_DL10022) { - ed_asic_outb(sc, ED_DL10022_DIAG, - (mii->mii_media_active & IFM_FDX) ? - ED_DL10022_COLLISON_DIS : 0); - } - - } - callout_reset(&sc->tick_ch, hz, ed_pccard_tick, sc); -} - static int ed_pccard_attach(device_t dev) { @@ -1204,6 +1181,36 @@ ed_child_detached(device_t dev, device_t sc->miibus = NULL; } +static void +ed_pccard_tick(void *arg) +{ + struct ed_softc *sc = arg; + struct mii_data *mii; + int media = 0; + + ED_ASSERT_LOCKED(sc); + if (sc->miibus != NULL) { + mii = device_get_softc(sc->miibus); + media = mii->mii_media_status; + mii_tick(mii); + if (mii->mii_media_status & IFM_ACTIVE && + media != mii->mii_media_status) { + if (sc->chip_type == ED_CHIP_TYPE_DL10022) { + printf("Enabling 10022 workaround\n"); + ed_asic_outb(sc, ED_DL10022_DIAG, + (mii->mii_media_active & IFM_FDX) ? + ED_DL10022_COLLISON_DIS : 0); + } else if (sc->chip_type == ED_CHIP_TYPE_DL10019) { + write_asic(sc, ED_DL10019_MAGIC, + (mii->mii_media_active & IFM_FDX) ? + DL19FDUPLX : 0); + } + } + + } + callout_reset(&sc->tick_ch, hz, ed_pccard_tick, sc); +} + static device_method_t ed_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ed_pccard_probe), From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 15:44:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8111065758; Tue, 7 Apr 2009 15:44:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC9C38FC1C; Tue, 7 Apr 2009 15:44:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37FioHh013139; Tue, 7 Apr 2009 15:44:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37FiogZ013138; Tue, 7 Apr 2009 15:44:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071544.n37FiogZ013138@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:44: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: r190805 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:44:51 -0000 Author: imp Date: Tue Apr 7 15:44:50 2009 New Revision: 190805 URL: http://svn.freebsd.org/changeset/base/190805 Log: Remove DL10019 workaround, since the code it calls isn't quite ready. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:43:34 2009 (r190804) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:44:50 2009 (r190805) @@ -1196,14 +1196,15 @@ ed_pccard_tick(void *arg) if (mii->mii_media_status & IFM_ACTIVE && media != mii->mii_media_status) { if (sc->chip_type == ED_CHIP_TYPE_DL10022) { - printf("Enabling 10022 workaround\n"); ed_asic_outb(sc, ED_DL10022_DIAG, (mii->mii_media_active & IFM_FDX) ? ED_DL10022_COLLISON_DIS : 0); +#ifdef notyet } else if (sc->chip_type == ED_CHIP_TYPE_DL10019) { write_asic(sc, ED_DL10019_MAGIC, (mii->mii_media_active & IFM_FDX) ? DL19FDUPLX : 0); +#endif } } From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:13:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B47610656D5; Tue, 7 Apr 2009 16:13:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED3F8FC1D; Tue, 7 Apr 2009 16:13:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37GDAHu013830; Tue, 7 Apr 2009 16:13:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37GDA4t013829; Tue, 7 Apr 2009 16:13:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200904071613.n37GDA4t013829@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 7 Apr 2009 16:13: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: r190806 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:13:11 -0000 Author: des Date: Tue Apr 7 16:13:10 2009 New Revision: 190806 URL: http://svn.freebsd.org/changeset/base/190806 Log: Fix an inverted KASSERT. Add similar assertions in other similar places. Reported by: Andrew Brampton MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue Apr 7 15:44:50 2009 (r190805) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue Apr 7 16:13:10 2009 (r190806) @@ -52,6 +52,20 @@ __FBSDID("$FreeBSD$"); #include #include +#define KASSERT_PN_IS_DIR(pn) \ + KASSERT((pn)->pn_type == pfstype_root || \ + (pn)->pn_type == pfstype_dir || \ + (pn)->pn_type == pfstype_procdir, \ + ("%s(): VDIR vnode refers to non-directory pfs_node", __func__)) + +#define KASSERT_PN_IS_FILE(pn) \ + KASSERT((pn)->pn_type == pfstype_file, \ + ("%s(): VREG vnode refers to non-file pfs_node", __func__)) + +#define KASSERT_PN_IS_LINK(pn) \ + KASSERT((pn)->pn_type == pfstype_symlink, \ + ("%s(): VLNK vnode refers to non-link pfs_node", __func__)) + /* * Returns the fileno, adjusted for target pid */ @@ -257,6 +271,7 @@ pfs_ioctl(struct vop_ioctl_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); + KASSERT_PN_IS_FILE(pn); if (pn->pn_ioctl == NULL) PFS_RETURN (ENOTTY); @@ -411,6 +426,7 @@ pfs_lookup(struct vop_cachedlookup_args if (vn->v_type != VDIR) PFS_RETURN (ENOTDIR); + KASSERT_PN_IS_DIR(pd); error = VOP_ACCESS(vn, VEXEC, cnp->cn_cred, cnp->cn_thread); if (error) @@ -565,6 +581,7 @@ pfs_read(struct vop_read_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); + KASSERT_PN_IS_FILE(pn); if (!(pn->pn_flags & PFS_RD)) PFS_RETURN (EBADF); @@ -707,6 +724,7 @@ pfs_readdir(struct vop_readdir_args *va) if (vn->v_type != VDIR) PFS_RETURN (ENOTDIR); + KASSERT_PN_IS_DIR(pd); uio = va->a_uio; /* only allow reading entire entries */ @@ -815,6 +833,7 @@ pfs_readlink(struct vop_readlink_args *v if (vn->v_type != VLNK) PFS_RETURN (EINVAL); + KASSERT_PN_IS_LINK(pn); if (pn->pn_fill == NULL) PFS_RETURN (EIO); @@ -900,8 +919,7 @@ pfs_write(struct vop_write_args *va) if (vn->v_type != VREG) PFS_RETURN (EINVAL); - KASSERT(pn->pn_type != pfstype_file, - ("%s(): VREG vnode refers to non-file pfs_node", __func__)); + KASSERT_PN_IS_FILE(pn); if (!(pn->pn_flags & PFS_WR)) PFS_RETURN (EBADF); From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:15:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84A5C1065674; Tue, 7 Apr 2009 16:15:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 729F28FC0C; Tue, 7 Apr 2009 16:15:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37GFxMq013993; Tue, 7 Apr 2009 16:15:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37GFxgW013992; Tue, 7 Apr 2009 16:15:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071615.n37GFxgW013992@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 16:15: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: r190807 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:16:00 -0000 Author: imp Date: Tue Apr 7 16:15:59 2009 New Revision: 190807 URL: http://svn.freebsd.org/changeset/base/190807 Log: Fix a comment to match the code. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 16:13:10 2009 (r190806) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 16:15:59 2009 (r190807) @@ -508,8 +508,7 @@ ed_pccard_attach(device_t dev) * data from the standard NE-2000 data roms. If that fails, * check to see if the card has a hint about where to look in * its CIS. If that fails, maybe we should look at some - * default value. In all fails, we should fail the attach, - * but don't right now. + * default value. In all fails, we fail the attach. */ for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) sum |= sc->enaddr[i]; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:26:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5200106564A; Tue, 7 Apr 2009 16:26:15 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 707B58FC1B; Tue, 7 Apr 2009 16:26:15 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 864BB6D450; Tue, 7 Apr 2009 16:26:14 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6032F844C2; Tue, 7 Apr 2009 18:26:14 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Robert Watson References: <200904061009.n36A9K6l063517@svn.freebsd.org> Date: Tue, 07 Apr 2009 18:26:14 +0200 In-Reply-To: (Robert Watson's message of "Mon, 6 Apr 2009 11:39:47 +0100 (BST)") Message-ID: <86prfoqvkp.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:26:16 -0000 Robert Watson writes: > Does this maintain compatibility for people who may still mysteriously > be specifying class-based IPs and netmasks in configuration files? If > not, this should not be MFC'd... Here's the really ugly part... % ping 10 PING 10 (0.0.0.10): 56 data bytes % ping 10.1 PING 10.1 (10.0.0.1): 56 data bytes % ping 10.1.1=20=20 PING 10.1.1 (10.1.0.1): 56 data bytes This makes no sense at all today, but we can't fix it, because it's the documented and standard-mandated behavior of inet_pton(3) and, if I'm not mistaken, getaddrinfo(3). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:35:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0FF91065672; Tue, 7 Apr 2009 16:35:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 768998FC17; Tue, 7 Apr 2009 16:35:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 02BB446BC5; Tue, 7 Apr 2009 12:35:29 -0400 (EDT) Date: Tue, 7 Apr 2009 17:35:28 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= In-Reply-To: <86prfoqvkp.fsf@ds4.des.no> Message-ID: References: <200904061009.n36A9K6l063517@svn.freebsd.org> <86prfoqvkp.fsf@ds4.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-2117236345-1239122129=:45341" Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190758 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:35:30 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --621616949-2117236345-1239122129=:45341 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 7 Apr 2009, Dag-Erling Smørgrav wrote: > Robert Watson writes: >> Does this maintain compatibility for people who may still mysteriously >> be specifying class-based IPs and netmasks in configuration files? If >> not, this should not be MFC'd... > > Here's the really ugly part... > > % ping 10 > PING 10 (0.0.0.10): 56 data bytes > % ping 10.1 > PING 10.1 (10.0.0.1): 56 data bytes > % ping 10.1.1 > PING 10.1.1 (10.1.0.1): 56 data bytes > > This makes no sense at all today, but we can't fix it, because it's the > documented and standard-mandated behavior of inet_pton(3) and, if I'm not > mistaken, getaddrinfo(3). Sadly, I'm familiar with this already :-(. However, for the time being, I'm less concerned about ugliness, and more concerned about breaking existing scripts and tools. Robert N M Watson Computer Laboratory University of Cambridge --621616949-2117236345-1239122129=:45341-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:38:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3043106564A; Tue, 7 Apr 2009 16:38:25 +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 AF7138FC16; Tue, 7 Apr 2009 16:38:25 +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 n37GcP8M014611; Tue, 7 Apr 2009 16:38:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37GcPij014608; Tue, 7 Apr 2009 16:38:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904071638.n37GcPij014608@svn.freebsd.org> From: Xin LI Date: Tue, 7 Apr 2009 16:38: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: r190809 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:38:26 -0000 Author: delphij Date: Tue Apr 7 16:38:25 2009 New Revision: 190809 URL: http://svn.freebsd.org/changeset/base/190809 Log: Update driver to vendor's version 1.16 plus some local changes: - override_kernel_driver() has been removed since this is an in-tree version of driver. - __DATE__ and __TIME__ removed from version string to make binary update builders happy. - Utilize pause(9) for __FreeBSDversion >= 700033 (redo 167086). - Utilize kproc_suspend_check() for __FreeBSDversion >= 800002. (redo 172836). - Don't read past end of pVDevice (redo 143787). - Make sure that controller and channel are initialized (redo 169823). - Don't include cam/cam_xpt_periph.h (redo 158177). MFC After: 3 days Modified: head/sys/dev/hptmv/access601.h head/sys/dev/hptmv/amd64-elf.raid.o.uu head/sys/dev/hptmv/array.h head/sys/dev/hptmv/command.h head/sys/dev/hptmv/entry.c head/sys/dev/hptmv/global.h head/sys/dev/hptmv/gui_lib.c head/sys/dev/hptmv/hptintf.h head/sys/dev/hptmv/hptproc.c head/sys/dev/hptmv/i386-elf.raid.o.uu head/sys/dev/hptmv/ioctl.c head/sys/dev/hptmv/mvOs.h head/sys/dev/hptmv/mvSata.h head/sys/dev/hptmv/mvStorageDev.h head/sys/dev/hptmv/osbsd.h head/sys/dev/hptmv/raid5n.h head/sys/dev/hptmv/readme.txt head/sys/dev/hptmv/vdevice.h Modified: head/sys/dev/hptmv/access601.h ============================================================================== --- head/sys/dev/hptmv/access601.h Tue Apr 7 16:29:50 2009 (r190808) +++ head/sys/dev/hptmv/access601.h Tue Apr 7 16:38:25 2009 (r190809) @@ -28,6 +28,8 @@ #ifndef _ACCESS601_H_ #define _ACCESS601_H_ +#ifndef FOR_DEMO + void HPTLIBAPI BeepOn(MV_BUS_ADDR_T BaseAddr); void HPTLIBAPI BeepOff(MV_BUS_ADDR_T BaseAddr); UCHAR HPTLIBAPI check_protect_circuit(MV_BUS_ADDR_T BaseAddr); @@ -40,4 +42,21 @@ void HPTLIBAPI set_fail_leds(MV_SATA_ADA #define set_fail_leds(pAdapter, mask) #endif +int HPTLIBAPI sx508x_ioctl(MV_SATA_ADAPTER *pSataAdapter, UCHAR *indata, ULONG inlen, + UCHAR *outdata, ULONG maxoutlen, ULONG *poutlen); + +MV_BOOLEAN HPTLIBAPI sx508x_flash_access(MV_SATA_ADAPTER *pSataAdapter, + MV_U32 offset, void *value, int size, int reading); +#else + +#define BeepOn(addr) +#define BeepOff(addr) +#define check_protect_circuit(addr) 1 +#define set_fail_led(pAdapter, channel, state) +#define set_fail_leds(pAdapter, mask) +#define sx508x_ioctl(pSataAdapter, indata, inlen, outdata, maxoutlen, poutlen) 0 +#define sx508x_flash_access(pSataAdapter, offset, value, size, reading) 0 + +#endif + #endif Modified: head/sys/dev/hptmv/amd64-elf.raid.o.uu ============================================================================== --- head/sys/dev/hptmv/amd64-elf.raid.o.uu Tue Apr 7 16:29:50 2009 (r190808) +++ head/sys/dev/hptmv/amd64-elf.raid.o.uu Tue Apr 7 16:38:25 2009 (r190809) @@ -26,1881 +26,1909 @@ * $FreeBSD$ */ begin 644 hptmvraid.o -M?T5,1@(!`0D```````````$`/@`!`````````````````````````"#=```` -M`````````$```````$``#@`+`$B)7"302(EL)-A,B60DX$R);"3H3(ET)/!, -MB7PD^$B![$@"``!(B?M,BV\02(UOD$R-9"00N`(```"`?P$`=0N`?P(!&<"# -MX`+_P(A%`$C'10@`````@$T!!$B+0Q!(B440BU,8B5482`^V10!(BP3%```` -M`$B)16"`?0`#=2:-0O:)11B+&Z(````$B)W^@`````08$\)/,6 -M>%IT&D@/MD4`2(L$Q0````!(B45H@$T!!.FE!```OI````!,B>?H`````(3` -M==5!]D0D"0)T'<9#"`%!#[9$)`J(0PLZ0PES"P^V\$B)W^@`````O@`"``!, -MB>?H`````(3`=!=)C;PDD````+IP`0``O@````#H`````$$/MI0DDP```+X! -M````(=8/MD,$@^#\B=�()\`G(O@0````AUH/@\XG1@^$("?`)R+X0```` -M(=:#X,^)T8/A(`GP""`>!`(#X>Z_O__2`^V0!!(@SS&``^$JO[____".=%_UD&+1"08B40D -M#+H`````2&/"2&G`,`$``$J-G"BH1```2(-["`!U#HM#=$$[1"0$#X04`0`` -M_\*#^@]^TDF+G:!$``!(A=MT(4B+0Q!)B86@1```NC`!``"^`````$B)W^@` -M````3(EK$$&+1"0$B4-T#[93?H/*`8A3?F9!#[9$)!2#X`$!P(/B_0G"B%-^ -M00^W1"069HF#@````(M4)`R)DX0```!!#[9$)!"(`T$/MD0D$XA#<@^VR+@! -M````T^!FB4-\2,=#"`````!!BT0D#(E#&$$/MD0D$8A#<$@/M@-(BP3%```` -M`$B)0V!)C70D+$B-N\@```"Z$````.@`````28UT)#Q(C;O8````N@0```#H -M`````$F-M"2`````2(V['`$``+H0````Z`````!)C70D0$B-N]P```"Z0``` -M`.@`````BT0D##F#A````'8&B8.$````0?9$)`D!=`2`2P$!10^V?"0208!\ -M)`L!#X:V`0``1(GZ#[;"3(NTPX@```!!BT0D*(E$)`Q-A?8/A3D!``!-B[6@ -M1```387V="%)BT8028F%H$0``+HP`0``O@````!,B??H`````$V);A!!BT0D -M!$&)1G1!#[96?H/*`4&(5GYF00^V1"0D@^`!`<"#XOT)PD&(5GY!#[=$)"9F -M08F&@````(M4)`Q!B9:$````00^V1"0A08A&<$$/MD0D($&(!DF)7@A!BT0D -M'$&)1AA!#[9$)"-!B$9R#[;(N`$```#3X&9!B49\20^V!DB+!,4`````28E& -M8$@/M@-(BP3%`````$F)1FA%B'X#1(GZ#[;"3(FTPX@```#^0W%)C70D+$F- -MOL@```"Z$````.@`````28UT)#Q)C;[8````N@0```#H`````$F-M"2````` -M28V^'`$``+H0````Z`````!)C70D0$F-OMP```"Z0````.@`````0?9$)`D! -M=`5!@$X!`4D/MD0D(DF#O,:(`````'5S28FLQH@```!!#[9$)"*(10-!_D9Q -M3(EU"$D/M@9(BP3%`````$B)16B+1"0,03F&A````'8]08F&A````.LT1(GZ -M#[;"2(.\PX@`````=2-(B:S#B````$B)70C^0W%$B'T#2`^V`TB+!,4````` -M2(E%:$B+G"08`@``2(NL)"`"``!,BZ0D*`(``$R+K"0P`@``3(NT)#@"``!, -MB[PD0`(``$B!Q$@"``##9F9FD%532(/L"$B)\[T`````#[9&<(G"@_@`#X[( -M````9F:02&/%2(.\PX@`````=`O_Q3GJ?^SIK````+@!````B>G3X&8)@X`` -M``!(B=[H`````$B)PDB%P`^$B````,8``T"(:`-(B5@(@#L(#Y3`P>`##[9* -M`8/A]PG!B$H!2(L%`````$B)0F!(#[8#2(L$Q0````!(B4)H]D,!$'01BUT((!] -M``-V&DB)[DR)[^@`````]D5^!'0)@$M^!&9FD&:00?_$#[9#<$0YX'_$Z0\! -M``"`3@$$@'YQ`G4*@&9^_I#I^P```(!F?OU(@[Z(`````'4=2(N&D````,9` -M`P!(B8:(````2,>&D`````````!(BX.(````@#@#=0M(B=Y,B>_H`````(!+ -M?@3'@X0`````````Z:8```!F9I!F9I`/MD9Q.D9P=2"`3@$$#[9&?H/@_HA& -M?F:#OH``````=&^#R`*(1G[K9P^V1G'_P`^V5G`YT'599H.^@`````!T++D` -M````#[>&@````(G"J`%U"O_!B=#3^*@!=/9(8\%(@[S#B`````!U&^L&]D9^ -M`G43@$L!!(!+?@1(B=Y,B>_H`````,>#A``````````/MT-\]]@A@X0```!F -M9F:02(-["`!U&?9#?@1T$^@`````B4-T2(G?Z`````!F9I!(BUPD"$B+;"00 -M3(MD)!A,BVPD($B#Q"C#9F9FD&9FD$%455-)B?R]`````&9F9I!(8\5(:<`P -M`0``2HV<(*A$``"#>W0`="!(@WL(`'492(G>3(GGZ`````#V0P$$=`A(QT-H -M`````/_%@_T/?L%;74%P(`@`` -M28G]2(GU08G628GG2(GWZ`````"`?0`(=0M(B>Y,B>_H`````$&\`````(!] -M<``/AL<```!)8\1(@[S%B``````/A*@```!(B[3%B````(`^`W8100^VUDR) -M[^@`````Z8H```!)8\1(BYS%B````,9#`P!(QT,(`````,>#C`````````"` -M8P'^2,=#:`````!%A/9U#8!]``9U!TB#?0@`="JZ``(``+X`````3(G_Z``` -M``!(C7MP3(GYNC````"^`````.@`````ZQ,/ME4!@^(!#[9#`8/@_@G0B$,! -M2(G?Z`````!F9I!F9I!!_\1$.&5P#X9U$6:)4PAFQT,*``!,B0-(@\,0*=>)T$D!P"G1=1O_QD$/ -MMD5P.<:X``````]$\$$/MT5\B<'!X0F%_W6Y9H%]"@"`=`9(@\40ZY=FQT/Z -M`("X`0```$B!Q``"``!;74%<05U!7L-F9F:09F9FD&9F9I!,BT\(1(M&0`^V -M3P,/MWY,.$Y$=0L/MT9*00'`ZP]FD#A.1'8(00^W07Q!`<`X3D1U!&8#?D@X -M3D5U!68#?D:0@'Y0`'0..$Y$@Q$B4((PV9F9I!F9F:09F9FD&9FD%-)B?E)B?"+?@A$#[=6#$&[ -M`````$$/MDERB?[3[F9!QT!,``!!QD!0`4$/ME%PB?")T;H`````]_%!#[9) -MY`````$&`>%``=`M!QD!0`.L49F9FD$$/MT!, -M9D$#07QF08E`3)!F13E1?',)9D4K47SKNF:0N`$```#3X&9!"4!.08A(169% -MB5!&00^WPUO#9F:09I!54TB#[`A(B?U(BUXX2(L&#[9(`[C^____T\!F(4-. -M@'X9`70'#[9&&8A#&4B)[^@`````9H-[3@!U&8![&0!U!,9#&0%(BW,P2(G: -M2(GOZ`````!(@\0(6UW#9F:09I!(B5PDT$B);"383(ED).!,B6PDZ$R)="3P -M3(E\)/A(@^PX28G_2(GU3(LV0?9&`01U%<9&&0)(BW8P2(GJZ`````#IR@`` -M`$R)]^A1_O__9H-]3@!U&L9%&0)(BW4P2(GJ3(G_Z`````#IHP```&:00;T` -M````08!^<``/A)`````/MT5.1(GIT_BH`71R3(G_Z`````!(B<-)8\5-BZ3& -MB````$R)(TB):S@/ME48@^("#[9#&(/@_0G0B$,8#[95&(/B!(/@^PG0B$,8 -M#[9%#HA##DB)VDB)[DR)Y^@^_?__2,=#,`````!(QT,H`````$B)WDR)_T'_ -M5"1@9F:00?_%00^V1G!$.>@/CW#___](BUPD"$B+;"003(MD)!A,BVPD($R+ -M="0H3(M\)#!(@\0XPV9F9I!F9F:09F9FD$B#[`A(BTX(#[91`8!F`?N`80'[ -M_DEQ@$E^`4B#>6@`#Y7`]L($#Y7"#[;`A<)T!DB)SO]1:$B#Q`C#9F:09I!( -M@^P(3(M&.$F+<"!(A?9T#69!#[9`&(/@`3G(=2))@W@H`'003(G&0?]0*+H! -M````A>"Z`0```(G02(/$",-F9F:055-(B?L/M@>#Z`2#^`%W4+T`````@']P -M`'0W9F:09I!(8\5(@[S#B`````!T$4B+O,.(````Z,7___^%P'4'N`````#K -M)/_%#[9#<#GH9I!_SK@!````ZQ%F9F:09F:0#[9'`<#H`H/@`5M=PV9FD$B) -M7"382(EL).!,B60DZ$R);"3P3(ET)/A(@^PH28G^2(GU2(M>.$R+(TR++H!^ -M&0$/A-D```#V0Q@"#X1_````@'L:``^%Q0```$'V1"1^`@^%N0```,9#&@%! -M@'T#`4@9P(/@"$Z+K""(````387M=$),B>_H%?___X7`=#9(C7U`ND@```"^ -M`````.@`````00^V30.X`0```-/@9HE#3DR);0!(B>Y,B?=!_U5@Z<````!, -MBVT`ZU5F9I!FD/9#&`1T2DR)[^C"_O__AY,B?=!_U5@Z8$```"`>QD!=!T/MU-.00^V30.X`0```-/@.<)U"6:0 -M#[9%&8A#&4B)[DR)]^@`````00^V30.X_O___]/`9B%#3F:#>TX`=3R`>QD` -M=03&0QD!2(MS,$B)VDR)]^@`````9D'_3"0B9D&#?"0B`'4428M$)#!(A3(GGZ`````!F -M@WU.`'55@'T9`'4?QD49`4B+30"+D80````[4PAU#`^W0PP!T(F!A````$B+ -M=3!(B>I,B>?H`````$B+10!FQT`@``!(BU4`2(/"*$C'Q@````!,B>?H```` -M`$B+'"1(BVPD"$R+9"002(/$&,-F9F:09F:09F:02(E<).A(B6PD\$R)9"3X -M2(/L&$F)_$B)\TB+;CB`?AD!=`T/MD89B$49ZW1F9F:0@'X.('5*QD89`$B+ -M10!(BX"0````2(D&2(U^0+I(````O@````#H`````,9#&@#&0PXP#[9#&(/@ -M_8/(!(A#&$B+`TB)WDR)Y_]08.M=9I#&11D!2(M-`(N1A````#M6"'4-#[=& -M#`'0B8&$````D$B)WDR)Y^@`````2(MU,$B)ZDR)Y^@`````2(M%`&;'0"`` -M`$B+50!(@\(H2,?&`````$R)Y^@`````2(L<)$B+;"0(3(MD)!!(@\08PV:0 -M05154TF)]$B)U4B+1CB%R71&2(M0$$B)50`/MT8,P>`)9HE%"&;'10H`@$B+ -M!H!X`P`/A`T!``!(C8(```$`9H-]"`!T"4@/MT4(2(T$`DB)10#I[0````^W -M7@S!XPE(@W@@`'0L]D`8`70F2(M(($B+`4B)`DB+00A(B4((2(/"$$B-00I( -M@\$09H,X`'G@ZS2Z`````$B#>"@`#X2H````2(GJ2(G&_U`HN@````"%P`^$ -MD@```.L,9HE9"&;'00H`@.M&2(GI9F9FD&9FD+H```$`9H-Y"`!T!`^W40A) -MBP0D@'@#`'06.=IV%HG82`$!B=!F*=AFB4$(ZPYFD#G:<[9(@\$0*=-UQ$F+ -M!"2`>`,`#Y7`2#G-#Y7"#[;`A<)T(4B+`4B)10!(BT$(2(E%"$B#Q1!(C4$* -M2(/!$&:#.`!YW[H!````B=!;74%F!````D$B+!H!X -M`P!U-\9&&0!(BT4`2(N`D````$B)!DB-?D"Z2````+X`````Z`````#&0QH` -M2(L#2(G>3(GG_U!@ZWL/MU8,P>()B=9(BWT02`'^Z`````"%P'0'QD49#.LA -MD,9%&0%(BTT`BY&$````.U,(=0T/MT,,`=")@80```"02(G>3(GGZ`````!( -MBW4P2(GJ3(GGZ`````!(BT4`9L=`(```2(M5`$B#PBA(Q\8`````3(GGZ``` -M``!(BQPD2(ML)`A,BV0D$$B#Q!C#9I!(B5PDX$B);"3H3(ED)/!,B6PD^$B# -M["A)B?Q(B?-(BRY(QT4P`````/9%?@$/A54!```/MD8.@_@"#X3V````@_@" -M?Q"#^`$/A)8```!FD.DS`0``@_@##X4J`0``BT8(B44<#[=&#&:)12`/MU8, -MP>()2(M^$+X`````Z`````!FQT-.`P!!O0````!,B>?H`````$B)QL9`#C"+ -M0PB)1@@/MT,,9HE&#(!.&`1(B5XX2,=&,`````!(QT8H`````$ECQ4B+A,6( -M````2(D&3(GG_U!@0?_%08/]`7ZNZ;<```"+1@B)11P/MT8,9HE%(.@````` -M2(G&QD`.((M#"(E&"`^W0PQFB48,@$X8`DB)7CA(QT8P`````$C'1B@````` -M2(N%B````$B)!DR)Y_]08.MEBT8(B44<#[=&#&:)12#H`````$B)QL9`#B"+ -M0PB)1@@/MT,,9HE&#(!.&`)(B5XX2,=&,`````!(QT8H`````$B+A8@```!( -MB09,B>?_4&#K$\9#&09(BW,P2(G:3(GGZ`````!(C54H2,?&`````$R)Y^@` -M````2(M<)`A(BVPD$$R+9"083(ML)"!(@\0HPV9FD&9FD&9FD$B)7"302(EL -M)-A,B60DX$R);"3H3(ET)/!,B7PD^$B#[#A)B?])B?1(BR[V10$$=17&1AD" -M2(MV,$R)XN@`````Z=H!``#V1A@@="1(QT4P`````$B)=3AF@WTB``^%O0$` -M`.C(_?__Z;,!``!F9I!(@WTP`'4I9H-](`!F9F:0=#X/MT4@`T4<.T8(=C(/ -MMT8,`T8(.44<#_@4/EL`(1"0'ZR2`O8(`````#Y1$)`TJ+A.V(```` -M]D`!!'1M00^V5"08P.H"1#AT)`P@`=?6+0W2)0WCH```` -M`(E#=$B)W^@`````2(/$"%M=PY!(B5PDV$B);"3@3(ED).A,B6PD\$R)="3X -M2('L*`(``$F)U$R+-DB+;CA(BUT@0;T1````2(GB2(7;=`QF#[9%&(/@`3G( -M=2A(B=-(@WTH`'0.2(GN_U4HAP@`=`0/MU,(.=%V.T$/MD8#.D5$=11( -MBP-)B00D2(M#"$F)1"0(28/$$"G12(/#$+H```$`9H-["`!T!`^W4PA!_\TY -MT7?%00^V1@,Z141U'$B+`TF)!"1F08E,)`AF0<=$)`H`@+@!````ZUDYT7,W -MBI(P>($2(G>3(GGZ`````"X`0```$B+G"0` -M`@``2(NL)`@"``!,BZ0D$`(``$R+K"08`@``3(NT)"`"``!(@<0H`@``PY`/ -MMD<#.D9$=0\/MT9(9HE"#(M&0(E"",,/MT9&9HE"#,=""`````##9F9FD&9F -M9I!$BT8(1`^W3@Q!NP````"Y`````(!_<``/A((```!%#[?1B_H`````$B#Q`A;7<-F -M9I!FD$B)7"302(EL)-A,B60DX$R);"3H3(ET)/!,B7PD^$B#[#A)B?](B?5, -MBS9!]D8!!'45QD89`DB+=C!(B>KH`````.G*````3(GWZ*'^__]F@WU.`'4: -MQD49`DB+=3!(B>I,B?_H`````.FC````9I!!O0````!!@'YP``^$D`````^W -M14Y$B>G3^*@!='),B?_H`````$B)PTECQ4V+I,:(````3(DC2(EK.`^V51B# -MX@(/MD,8@^#]"="(0Q@/ME48@^($@^#["="(0Q@/MD4.B$,.2(G:2(GN3(GG -MZ-[]__](QT,P`````$C'0R@`````2(G>3(G_0?]4)&!F9I!!_\5!#[9&<$0Y -MZ`^/A(`<-!_\1$B>BZ`````/?U1#G@#X=W -M____0?_.08/^_P^%//___XM$)`1(@\0(6UU!7$%=05Y!7\-F9F:09F:055-( -MB?V)\[@`````.;2&/#2(M\Q0BZ`!```+X````` -MZ`````#_RX/[_W7B2(/$"%M=PV9FD&9FD&9FD(L/_\F#^?]T+DACP4B+1,<( -MN@````!(@S@`=`:X`````,/_PDB#P`B!^O\!``!VYO_)@_G_==*X`0```,-F -M9I!(@^P(NA````"^`````.@`````2(/$",-F9F:09F9FD$B#?A``=`Q(BU80 -M2(M&"$B)0@A(BU8(2(M&$$B)`DC'1@@`````N@````#HL/S___/#9F9FD&9F -M9I!F9I!F9I!(C4]82(M'6$B)1A!(A6^```` -M`.C[^___2(G#1(D@B6@$2(G&3(GOZ&?___](B=A(BQPD2(ML)`A,BV0D$$R+ -M;"082(/$(,-F9F:09F9FD&9F9I`/MD=)#[;02(T4DDB-5-=0_\"(1TE(B3K& -M0@D`QD(*`,9""P!(B=##9F9FD&9F9I!!5%5328G\2(GSO0`````/ME9&C4+] -MT?@!PH/Z`'XED$ACQ4B+M,.@"@``3(GGZ*W]____Q0^V4T:-0OW1^`'".>I_ -MW+H'````2(G>3(GGZ%S[__];74%-_Y$B)Z.DF -M`0``2(GN3(GOZ*'^__]!BX4X6```P>`#1#G@#X(T____O@<```!,B>_H$?K_ -M_TB)Q;@`````2(7M#X3J````ZPZX`````.G>````9F9FD$B);0!(B6T(BT0D -M!(E%0&9$B75$B%U&2,=%,`````!!O``````/MM.-0OW1^`'"@_H`#XZ?```` -M18GW9D'![P,/MM.-0OW1^$2--`)F9F:026/<00^W]TR)[^AQ^___2(F$W:`* -M``!(A2Z -M!P```$B)[DR)[^AO^?__N`````#K,DECQ$C!X`1(C1PH2(V[\`H``.A1_/__ -M2(V[<`L``.A%_/__0?_$13GF#X]Y____2(GH2(/$"%M=05Q!74%>05_#9F9F -MD&9FD$%455-(B?6)TXG.#[9-4@D`,```/MX2!0@P` -M`&:)1"00B=!FP>@##[?`B40D"$&)UD&#Y@=!#[?&B<;!Y@FX"````&9$*?!! -MB<9F1#MT)!"+7"001`]'\T$/M\:)Q<'E"4@/MD0D+TB+5"0@2(N,PJ`*``"+ -M5"0(B?!)B<1,`V31"$0[;"0,=21)@\<0QT0D#````0!F08-_"`!T"4$/MT\( -MB4PD#$&]`````)"+7"0,1"GK.>L/1]V#?"0T`'021(GN20,WB=I,B>?H```` -M`.L01(GO20,_B=I,B>;H`````$$!W2G==`>)V$D!Q.N29D0I="00=!3_1"0( -MO@````!!O@@```#I/O____Y$)"\/MEPD+TB+1"0@.)AA#```#X/-_O___T0D -M,$B+5"1`#[9">#M$)#`/CXO^__^Z`````$B+="1`2(M\)$C_5"0X2('$:`$` -M`%M=05Q!74%>05_#9F9FD&9F9I!F9I!54TB#[`A(B?V%TG0$QD89"T&[```` -M`(!^>``/A,$```!(C9W`5P``2(V]L%<``)!)8\-,BT3&4$G'@#`,```````` -M38G"N0````!!@'A&`'9(#[;!2,'@!$P!T$B-D/`*``!!N0````"#N/`*```` -M=1*#>@0`=0R#>@@`=0:#>@P`=`9!N0$```!%AXN``` -M``"%P'0=2(M#"$R)0PA)B1A)B4`(3(D`ZQNX`0```.OA9I!(BT<(3(E'"$F) -M.$F)0`A,B0!!_\,/MD9X1#G8#X].____2(GOZ`8X``!(@\0(6UW#9F9FD&9F -M9I!F9F:09F:02(E<)-!(B6PDV$R)9"3@3(EL).A,B70D\$R)?"3X2(/L2$F) -M_4B)\TB+KC`,``#_CSQ8``!(C4802(M("$B+5A!(B4H(2(D12(E&$$B)0`A( -MA>T/A(<"``#V11@@#X0=`0``3(ME``^W1D1!B<9$`W9`1`^W?D1(QX8P#``` -M`````$B-A[!7``!(BU`(2(EP"$B)!DB)5@A(B3*`OF(,```!=56`?0X"=49( -M#[9&1TB+O,:@"@``Z!3W__^%P'4PQH-B#```#$&`3"1^"D$/MT0D?/?8(T-` -M03F$)(0```!V#D&)A"2$````9F:09F:0@+MB#````70:#[:#8@P``(A%&4B) -M[DR)[^CB-@``Z6T#``!!#[=$)'R+50C_P@^OPD0Y\'8M00^WST2)\DR)YDR) -M[^BX^O__2(FH,`P``$B)15!(B<9,B>_H`A```.DM`P``00^W1"1\00.$)(0` -M``!$.?!U"$6)M"2$````2(GN3(GOZ'?_`B$5Y.D5X -M#X6.`@``]D48!`^$T@```$&^`````(!]>``/AK(```!(C8>P5P``2(E$)!!( -MC9?`5P``2(E4)`A$B?(/ML)(BUS%4$C'@S`,````````@+MB#````75-28G? -M0;P`````@'M&`'8@1(G@#[;X2,'G!$J-O#_P"@``Z`?V__]!_\1%.&=&=^!( -MBU0D$$B+0@A(B5H(2(D32(E#"$B)&.LF9F:09I`/MH-B#```B$492(M4)`A( -MBT((2(E:"$B)$TB)0PA(B1A!_\9$.'5X#X=F____2(GN3(GOZ(`!V+69FD&9FD$2)\@^VPDB+7,50@+MB#````70*#[:#8@P` -M`(A%&4'_QD0X=7AWV8!]&0!U%TC'P@````!(B>Y,B>_H`?K__^E<`0``N@`` -M``!(B>Y,B>_H+/S__^E'`0``9F9FD&9FD("^8@P```$/A8,```!)B?2]```` -M`(!^1@!V)&9FD&:0B>@/MOA(P><$2HV\)_`*``#H^O3____%03AL)$9WX4B# -MNS@,````="E(BX,X#```2(F#,`P``$C'@S@,````````2(G>3(GOZ`,.``#I -MS@```$F-A;!7``!(BU`(2(E8"$B)`TB)4PA(B1KK6F9FD$B-A\!7``!(BU`( -M2(EP"$B)!DB)5@A(B3)(@[XX#````'0T2(N&.`P```^VEF(,``"(4!E(BY8X -M#```2,?&`````.@`````2,>#.`P```````#IN0```$B+_H7?3__TC' -M0S``````2(M#.$B#>"@`=!5(C5`H2,?&`````$R)[^@`````ZR5)@[U(6``` -M`'0;28V52%@``$C'Q@````!,B>_H`````&9FD&:008.]0%@```!T5H"[8@P` -M``%U34B+>SA(@W]``'0PZ-TQ``"%P'4G2(M#.$B+4$A(BW!`3(GOZ`````!( -MBT,X2,=`0`````!!_XU`6```08.]0%@```!T"$R)[^@`````2(M<)!A(BVPD -M($R+9"0H3(ML)#!,BW0D.$R+?"1`2(/$2,-F9F:09F:09F:09F:02(/L"$B+ -M%H!Z2@!T$\9"2@!(Q\8`````Z`````!F9I!(@\0(PV9F9I!F9F:09F:005=! -M5D%505154TB#[`A)B=1!B<](BT8X2(L02`^V0!%,B[3"H`H``(M&""M"0,'@ -M"0^W;@S!Y0F)P8'A_P\``$&)Q4'![0R[`!```"G+.>L/1]U%A?]T#$ECU8G( -M20-$U@CK#TECQ8G/20-\Q@CH`````$F)!"1F08E<)`@YZW089D''1"0*``!) -M@\000?_%*=VY`````.NN9D''1"0*`("X`0```$B#Q`A;74%<05U!7D%?PV9F -M9I!F9F:09F:0#[9'$@)'$XA'$DB-5Q2^`0```.L/@'\2`'D&N`````##_D<2 -M#[9/$H/Y'W<3B?#3X(5'%`^5P`^VP.M49F9FD(/Y/W<2@^D@B?#3X(5"!`^5 -MP`^VP.LY@_E?=Q2#Z4")\-/@A4((#Y7`#[;`ZR)FD+@`````@_E_=Q:#Z6") -M\-/@A4(,#Y7`#[;`9F:09F:0APH!=7%(B=_HJ?[__X7`=!7&0PH` -M2(G>2(GOZ,8```#K8V9F9I"`>P@!=4H/MD,003A$)$>0=#XX0Q%U.0^V\$B) -M\$C!X`1*C;0@<`L``$B-2Q2+!@M#%(D&BT8$"T$$B48$BT8("T$(B48(BT8, -M"T$,B48,D,9#"0)(B=Y(B>_H0?W__TB+'"1(BVPD"$R+9"002(/$&,-F9F:0 -M9F9FD&9FD&9FD$B)7"3P3(ED)/A(@^P828G\2(GSQD83`,9&$@!(B??H[/W_ -M_TB)WDR)Y^@1````2(M<)`A,BV0D$$B#Q!C#9I!(B5PDX$B);"3H3(ED)/!, -MB6PD^$B#["A)B?U(B?-(BRY(BU4X2`^V1A!,BZ3"B````.@`````2(G&3(D@ -M@'L(`74-@$@8`L9`#B#K"V9FD(!(&`3&0`XP#[9#$@-%0(E&"&8/MD,39HE& -M#$C'1B@`````2(E>.$C'1C``````3(GO0?]4)&!(BUPD"$B+;"003(MD)!A, -MBVPD($B#Q"C#05154T&Y`````$&[`````$B)_4&\`0```.L808/[?W8/1(G( -MZ5X!``!F9F:09F:00?_#1(G:08/['W<21(G@1(G9T^"%!P^5P`^VP.M208/[ -M/W<3C4K@1(GCT^.%700/E<`/ML#K.4&#^U]W$XU*P$2)X-/@A44(#Y7`#[;` -MZR"X`````$&#^W]W%8U*H$2)X]/CA5T,#Y7`#[;`9F9FD(7`#X1S____0;@! -M````2(GZ0;H!````ZPIF9F:09F:00?_`0XT,`X/Y'W<41(G0T^"%`@^5P`^V -MP.M59F:09I"#^3]W$X/I($2)T-/@A4($#Y7`#[;`ZSB#^5]W$X/I0$2)T]/C -MA5H(#Y7`#[;`ZR"X`````(/Y?W<6@^E@1(G0T^"%0@P/E<`/ML!F9I!FD(7` -M=8Q$B=E%`<-!N@@```!$BQD`#X3C````2(-[$`!U"TB)$)#[9$ -ME")!B`)1`^V3)0@1(G(#[;0BY(BWPD".A^`@``2(N<)"@!``!(BZPD -M,`$``$R+I"0X`0``3(NL)$`!``!,B[0D2`$``$R+O"10`0``2('$6`$``,-F -M9I!F9I!(B5PDT$B);"383(ED).!,B6PDZ$R)="3P3(E\)/A(@>Q(`0``28G_ -M2(GU2(L>2(UT)!!(C7T0Z$3\__]!B<1(#[9%($R+M,.@"@``2`^V12%,BZS# -MH`H``+L`````1#GC?3U(8\,/MG2$$<'F"0^V5(02P>()2`^V1(00B?9(B?=) -M`WS&"$B)/"1)`W3%"$B)="0(Z`````#_PT0YXWS#N@````!(B>Y,B?_HD`$` -M`$B+G"08`0``2(NL)"`!``!,BZ0D*`$``$R+K"0P`0``3(NT)#@!``!,B[PD -M0`$``$B!Q$@!``##9F9FD&9F9I!!5T%6055!5%532('LB`$``$F)_TB)]4R+ -M)DB+7A!(C;0D@````$B)W^AB^___08G&2`^V0QA-BZS$H`H``+L`````@'T@ -M`'8C#[9-(&9FD`^VPT@/ME0H&$F+E-2@"@``2(E4Q$#_PSC9=^1!O`````!% -M.?0/C:T```!F9I!FD$ECQ`^VE(2!````08G20<'B"0^VE(2"````08G30<'C -M"0^VC(2`````NP````"`?2``=BA$#[;)18G0#[9U()`/ML-(BU3$0$J+?,H( -M28T4.$B)%,3_PT`XWG?D#[;11(G02(G'20-\U0A(.3PD=1!(BW0D"$2)VN@` -M````ZQV02(M4)`A(BS0D#[;!1(G720-\Q0A$B=GH`````$'_Q$4Y]`^,6/__ -M_[H`````2(GN3(G_Z!@```!(@<2(`0``6UU!7$%=05Y!7\-F9I!F9I!(B5PD -MZ$B);"3P3(ED)/A(@^P828G\2(GSB=7&1@D"@_H!&<"#X/6#P`R(1@KH3O;_ -M_X!["`-U+TB+0Q!(BW`02(7V=")(QT`0`````,9&"0*#_0$9P(/@]8/`#(A& -M"DR)Y^@9]O__2(L<)$B+;"0(3(MD)!!(@\08PV9FD&9FD`^V5@N%TG1&B=!( -M#[:$1[`)``!(C02`2(U$QU"`>`D"=`:X`````,.`>`H!=!+&1@D"#[9`"HA& -M"K@`````PY")T`^VE$>Q"0``A=)UNK@!````PV9F9I!F9F:09F9FD$%7059! -M54%455-(@^P(28G^2(GUQD9*`("^8PP````/A(L```!!O`````!(C5U0@'U) -M`'1.@'L)`74X@'L(`W4I2(M#$(!X&0!T'TB#>!``=!A(QT`0`````,9#"0(/ -MMH5B#```B$,*ZPG&14H!Z;PD`=7I(B=Y(B>_HO_[__X7`=%O& -M0PD!3(GW2(G>#[9#"(/X!G=(B<#_),4`````Z'KW___K.&9F9I!F9F:0Z-OY -M___K*>C$^___9F9FD.L>Z*G\___K%\9%2P'&1@D"QD8*`>AF]/__9F:09F:0 -M@'L)`G400?_'9F9FD&9FD(!["0)T"T&]`````.F/````@'L*`0^$A0```(!] -M2P"0#X0=____2(M%.$@/ME,02(N$T(@```#V0`$$=%]!O0````#&0PD!QD,* -M`$R)]TB)W@^V0PB#^`9W1HG`_R3%`````.C(]O__ZS9F9I!F9I#H*_G__^LI -MZ!3[__]F9F:0ZQ[H^?O__^L7QD5+`<9&"0+&1@H!Z+;S___K!,9#"@%!_\1( -M@\,H#[9%240YX`^/S/[__T6%_P^%H_[__T6%[704QH5B#````4B)[DR)]^C, -M[O__ZP3&14H!2(/$"%M=05Q!74%>05_#9F9FD&9FD$%7059!54%455-(@>QX -M`0``2(E\)$A(B?5(BUXX3(NF,`P``$&]`````$V%Y'4E#[=.1(M60`'12(G> -MZ!#G__](B44PN/____](@WTP``^$L2(``$B+1"1(_X`\6```2(U%$$B+5"1( -M2('"T%<``$B+2@A(B4((2(E5$$B)2`A(B0%F@[N``````'1$]D-^`74+BX.$ -M````.T5`=R=!O@`````/MX.`````B<*H`74.0?_&B=!$B?'3^*@!=/)$B'5( -MZS#&14@(ZRIF9I!F9I#V0WX"=!J+@X0````[14!W#P^V14>(14CK"F9FD&9F -MD,9%2`C&14D`QH6P"0```,9%2P#&A6(,````QH5C#````$C'A3@,```````` -M387D#X1@#P``0?9$)!@@#X2/!P``00^V1"0.@_@"#X1N!```@_@"?Q"#^`$/ -MA`4!``!FD.F>(0``@_@##X65(0``2(U<)&!(B=_H5>7__TF)VK\`````#[=U -M1+L`````0;D@````0;L!````@_\?=S\/ML-)C12"1(G)*?DY\0]'SH/Y('4( -MQP+_____ZPU$B=C3X/_(B?G3X`D"1(G(*?@Y\',5C70^X+\`````ZP.#[R#_ -MPX#[`W:R2(N]H`H``.A>Y/__0;\`````@'U&``^&`2$``$2)^P^VPTC!X`1( -MC1PH2(V[\`H``.BTY/__2(V[<`L``.BHY/__2(GOZ,#E___&0`@"1(AX$,9` -M$0!(BU0D8$B)4!1(BU0D:$B)4!Q!_\=$.'U&=ZOIIR```+@!````ZU5(B>^Y -M`````(!]1@"0=D$/ML%(P>`$2`'X2(V0\`H``+X`````@[CP"@```'42@WH$ -M`'4,@WH(`'4&@WH,`'0%O@$```"%]G6P_\$X3T9WO[@`````A%``P```````!(B>_H7.3__\9`"`*(6!"(6!%(BU0D -M8$B)4!1(BU0D:$B)4!Q)B<2`?48"#X<``0``2(V=\`L``$B)[^@DY/__QD`( -M!4B)6!#&0"``28G%28L,)/Z!L`D```^VL;`)``")]T@IR$B#Z%!(P?@#2+K- -MS,S,S,S,S$@/K\*(A'FP"0``00^V1"0+B(1YL0D``$&(="0+0;\`````@'U& -M``^&TQX``$B)TT0X?4AT!!$B'@12(M4)&!(B5`4 -M2(M4)&A(B5`<00^V52`/MLI&B'PI&/_"08A5($F+50#^@K`)```/MK*P"0`` -MB?%(*=!(@^A02,'X`T@/K\.(A$JP"0``00^V10N(A$JQ"0``08AU"T'_QT0X -M?48/AWO____I1AX``$&_`````(!]1@`/AC8>``!(C9WP"P``2;[-S,S,S,S, -MS$0X?4@/A+T```!(B>_H`./__\9`"`%$B'@01(AX$4B+5"1@2(E0%$B+5"1H -M2(E0'$B)1"1`2(GOZ-7B___&0`@#2(E8$$2(>!A)B<5(BQ#^@K`)```/MK*P -M"0``B?%(BT0D0$@IT$B#Z%!(P?@#20^OQHB$2K`)``!!#[9%"XB$2K$)``!! -MB'4+28L4)/Z"L`D```^VLK`)``")\4R)Z$@IT$B#Z%!(P?@#20^OQHB$2K`) -M``!!#[9$)`N(A$JQ"0``08AT)`M!_\=$.'U&#X^N`````"% -MP'073(FE.`P``$C'A3`,````````Z6,*``!(C5PD8$B)W^B1X/__28G:OP`` -M```/MW5$NP````!!N2````!!NP$```!F9F:0@_\?=S\/ML-)C12"1(G)*?DY -M\0]'SH/Y('4(QP+_____ZPU$B=C3X/_(B?G3X`D"1(G(*?@Y\',5C70^X+\` -M````ZP.#[R#_PX#[`W:R#[9%1XB%"`P``,:%"0P```!(BT0D8$B)A?`+``!( -MBT0D:$B)A?@+``!(QX4`#````````(!]1@(/A[@```!(C9WP"P``2(GOZ/7@ -M___&0`@%2(E8$,9`(`!)B<5!OP````"`?48`#X;I&P``2+O-S,S,S,S,S$B) -M[^C$X/__QD`(`42(>!!$B'@12(M4)&!(B5`42(M4)&A(B5`<00^V52`/MLI& -MB'PI&/_"08A5($F+50#^@K`)```/MK*P"0``B?%(*=!(@^A02,'X`T@/K\.( -MA$JP"0``00^V10N(A$JQ"0``08AU"T'_QT0X?49WA>E?&P``#[9=1TB)[^A` -MX/__QD`(`8A8$(A8$4B+5"1@2(E0%$B+5"1H2(E0'$B)1"0X0;\`````@'U& -M``^&(AL``$B-G?`+``!)O,W,S,S,S,S,1#A]1P^$O0```$B)[^CLW___QD`( -M`42(>!!$B'@12(M4)&!(B5`42(M4)&A(B5`<2(E$)$!(B>_HP=___\9`"`-( -MB5@01(AX&$F)Q4B+$/Z"L`D```^VLK`)``")\4B+1"1`2"G02(/H4$C!^`-) -M#Z_$B(1*L`D``$$/MD4+B(1*L0D``$&(=0M)BU4`_H*P"0``#[:RL`D``(GQ -M2(M$)#A(*=!(@^A02,'X`TD/K\2(A$JP"0``00^V10N(A$JQ"0``08AU"T'_ -MQT0X?48/ARS____I.!H``&9FD&:0387D#X2\!P``0?9$)!@"D`^$KP<``$0/ -MMKU@#```1#B]80P```^"50$``&9FD&:01#A]1P^$-@$``$2)^`^VV$B)V$C! -MX`1,C:0$\````$R)Y^BIW?__#[>4G4`,```/M[R=0@P``+L`````0;D@```` -M0;H!````@_H?=T0/ML-)C32$1(G)*=$Y^0]'SX/Y('4-QP;_____ZQ)F9I!F -MD$2)T-/@_\B)T=/@"09$B<@IT#GX<$2(T$+TB-D'`+``"+B'`+``#WT8E,)&"+0@3WT(E$)&2+ -M0@CWT(E$)&B+0@SWT(E$)&Q(C70\<$B-E#SP````(PJ)#HM"!"-$)&2)1@2+ -M0@@C1"1HB48(BT(,(T0D;(E&#$0X?4AU,;H`````@SX`=1*#?@0`=0R#?@@` -M=0:#?@P`=`6Z`0```(72N`$```!$#T7H9F:09I!!_\=$.+UA#```#X.P_O__ -M183M#X2:!0``2(U\)&#H;=S__T&_`````(!]1@!V69!$.'U(=$E$.'U'=$-$ -MB?@/MM!(P>($2`'J2(V*\`H``(M$)&`+@O`*``")1"1@BT0D9`M!!(E$)&2+ -M1"1H"T$(B40D:(M$)&P+00R)1"1L0?_'1#A]1G>H3`^V14A)P>`$2HUT!'"+ -M?"1@(SZ)?"10BTPD9"-.!(E,)%2+5"1H(U8(B50D6(M$)&PC1@R)1"1<]]>) -M?"1@]]&)3"1D]]*)5"1H]]")1"1L(SZ)?"1@(TX$B4PD9"-6"(E4)&@C1@R) -M1"1L2(GOZ+3<___&0`@`2(E$)"BX`````(-\)&``=16#?"1D`'4.@WPD:`!U -M!X-\)&P`=`6X`0```(7`#X2F`0``#[9%2(B%"`P``$B+1"1@2(F%\`L``$B+ -M1"1H2(F%^`L``,:%"0P```%(QX4`#````````$&_`````(!]1@`/A@,"``!, -MC:7P"P``1#A]2`^$/P$``$0XO6`,``!W#T0XO6$,``!R!D0X?4=U+4B)[^@( -MW/__QD`(`42(>!!$B'@12(M4)&!(B5`42(M4)&A(B5`<2(E$)$#K4D2)^@^V -MPDC!X`1(C5P$<(M$)&`)`XM$)&0)0P2+1"1H"4,(BT0D;`E##$B)[^BQV___ -MQD`(`42(>!!$B'@12(L32(E0%$B+4PA(B5`<2(E$)$!(B>_HB=O__\9`"`-, -MB6`01(AX&$F)Q4B+$/Z"L`D```^VLK`)``")\4B+1"1`2"G02(/H4$C!^`-( -MO\W,S,S,S,S,2`^OQXB$2K`)``!!#[9%"XB$2K$)``!!B'4+1#A]1W5$2(M, -M)"A(BQ'^@K`)```/MK*P"0``B?%,B>A(*=!(@^A02,'X`T@/K\>(A$JP"0`` -M2(M<)"@/MD,+B(1*L0D``$"(J_O__Z:$```!!OP````"` -M?48`#X:1````1#B]8`P``'=[1#B]80P``')R1#A]1W1L1#A]2'1F1(GZ#[;" -M2,'@!$B-1`1PN@````"#.`!U$H-X!`!U#(-X"`!U!H-X#`!T!;H!````A=)T -M,D2)^0^VP4C!X`1(C5P$<$B)[^A>VO__QD`(`42(>!!$B'@12(L32(E0%$B+ -M4PA(B5`<0?_'1#A]1@^';____[@`````@WPD4`!U%8-\)%0`=0Z#?"18`'4' -M@WPD7`!T!;@!````A<`/A!L5``!$#[9E2$2(I2@,``!(BT0D4$B)A1`,``!( -MBT0D6$B)A1@,``#&A2D,````2,>%(`P````````/MEU'2(GOZ,;9___&0`@! -MB%@01(A@$4B+5"102(E0%$B+5"182(E0'$B)1"0X2,=$)#``````0;\````` -M@'U&``^&GA0``$R-I1`,``!)OLW,S,S,S,S,1#A]2`^$80$``$0X?4`$2(U_HD-?__\9`"`%$B'@01(AX$4B+$TB)4!1(BU,( -M2(E0'&9FD&:00?_'1#B]80P```^#>/___^EN$@``@'U(!P^&TPD``$B-?"1@ -MZ"?6___&1"0G`$&_`````(!]1@`/AJ$```!FD$0X?4`$2`'H2(V0\`H``+D`````@[CP"@```'46@WH$`'40@WH(`'4*@WH,`&9F -M9I!T!;D!````AI(C8KP"@``BT0D8`N"\`H``(E$ -M)&"+1"1D"T$$B40D9(M$)&@+00B)1"1HBT0D;`M!#(E$)&S^1"0G0?_'1#A] -M1@^'8?___P^V5"0G#[9%1H/H`]'X.<(/CE0%```/MEU'B)T(#```2(M$)&!( -MB87P"P``2(M$)&A(B87X"P``QH4)#````4C'A0`,````````2(GOZ#_6___& -M0`@"B%@0B%@12(M4)&!(B5`42(M4)&A(B5`<28G$2(GOZ!C6___&0`@&2(E$ -M)"A)BQ0D_H*P"0``#[:RL`D``(GQ2(M$)"A(*=!(@^A02,'X`TF^S!!$B'@12(L3 -M2(E0%$B+4PA(B5`<28M5`/Z"L`D```^VLK`)``")\4@IT$B#Z%!(P?@#20^O -MQHB$2K`)``!!#[9%"XB$2K$)``!!B'4+1(GY#[;!2,'@!$B-A"CP"@``N@`` -M``"#.`!U$H-X!`!U#(-X"`!U!H-X#`!T!;H!````A=)FD'1Z1(GX#[;82(G8 -M2,'@!$B-G"CP"@``2(GOZ.'3___&0`@"1(AX$$2(>!%(BQ-(B5`42(M3"$B) -M4!Q)B<1(BQ#^@K`)```/MK*P"0``B?%(BT0D*$@IT$B#Z%!(P?@#20^OQHB$ -M2K`)``!!#[9$)`N(A$JQ"0``08AT)`M!_\=$.'U&#X8$2(T$+DB-B'`+``"+D'`+``#WTHE4)%"+003WT(E$)%2+00CW -MT(E$)%B+00SWT(E$)%Q(C5PT<"-4)&")$XM$)&0C1"14B4,$BT0D:"-$)%B) -M0PB+1"1L(T0D7(E##$B)[^C2TO__QD`(`TB+?"082(EX$$2(>!A)B<5(BT0D -M*$B+$/Z"L`D```^VLK`)``")\4R)Z$@IT$B#Z%!(P?@#20^OQHB$2K`)``!( -MBWPD*`^V1PN(A$JQ"0``0(AW"[@`````@SL`=1*#>P0`=0R#>P@`=0:#>PP` -M=`6X`0```(7`=&M$B?H/ML)(P>`$2(U_H/M+__\9`"`%$B'@01(AX -M$4B+$TB)4!1(BU,(2(E0'$F+50#^@K`)```/MK*P"0``B?%(*=!(@^A02,'X -M`TD/K\:(A$JP"0``00^V10N(A$JQ"0``08AU"T2)^0^VP4C!X`1(C80H\`H` -M`+H`````@S@`=1*#>`0`=0R#>`@`=0:#>`P`=`6Z`0```(72='I$B?@/MMA( -MB=A(P>`$2(V<*/`*``!(B>_HEM'__\9`"`)$B'@01(AX$4B+$TB)4!1(BU,( -M2(E0'$F)Q$B+$/Z"L`D```^VLK`)``")\4B+1"0H2"G02(/H4$C!^`-)#Z_& -MB(1*L`D``$$/MD0D"XB$2K$)``!!B'0D"T'_QT0X?48/A^#]___I.@P```^V -M74=(B>_H&]'__\9`"`&(6!"(6!%(BU0D8$B)4!1(BU0D:$B)4!Q(B40D.`^V -M74=(B>_H[M#__\9`"`*(6!"(6!%(BU0D8$B)4!1(BU0D:$B)4!Q)B<1(B>_H -MQ]#__\9`"`9(B40D*$F+#"3^@;`)```/MKFP"0``B?Y(BT0D*$@IR$B#Z%!( -MP?@#2+K-S,S,S,S,S$@/K\*(A'&P"0``00^V1"0+B(1QL0D``$&(?"0+0;\` -M````@'U&``^&=PL``&9F9I!$.'U'#X3&`@``1(GZ#[;"2,'@!$@!Z$B-D/`* -M``"Y`````(.X\`H```!U%H-Z!`!U$(-Z"`!U"H-Z#`!F9F:0=`6Y`0```(7) -M#X2!`@``_DPD)P^V3"0G`DU&08G.1(G[1`^VXTG!Y`1)`>Q)C;PD\`H``$B) -M?"002(GOZ-_/___&0`@!1(AX$$2((A$JP"0``00^V10N(A$JQ"0``08AU"TF+50#^ -M@K`)```/MK*P"0``B?%(BT0D0$@IT$B#Z%!(P?@#2`^OQXB$2K`)``!!#[9% -M"XB$2K$)``!!B'4+2(M$)"A(BQ#^@K`)```/MK*P"0``B?%,B>A(*=!(@^A0 -M2,'X`T@/K\>(A$JP"0``2(M<)"@/MD,+B(1*L0D``$"(!!$B'@128N4)/`*``!(B5`42(M,)!!(BU$(2(E0'$F)Q$B+ -M$/Z"L`D```^VLK`)``")\4B+1"0H2"G02(/H4$C!^`-(#Z_#B(1*L`D``$$/ -MMD0D"XB$2K$)``!!B'0D"Y!!_\=$.'U&#X`$2`'H2(V0\`H` -M`+D`````@[CP"@```'48@WH$`'42@WH(`'4,@WH,`'0+9F:09F:0N0$```"% -MR70\1(GX#[;82,'C!$@!ZTR-H_`*``!(B>_H^\S__\9`"`)$B'@01(AX$4B+ -MD_`*``!(B5`428M4)`A(B5`<0?_'1#A]1@^';O___^G`$2`'H2(V0\`H``+D`````@[CP"@```'44@WH$`'4.@WH(`'4( -M@WH,`&:0=`6Y`0```(7)#X3!````1(GY#[;!2,'@!$R-)"A)C9PD\`H``(M$ -M)&!!"X0D\`H``(E$)&"+1"1D"T,$B40D9(M$)&@+0PB)1"1HBT0D;`M##(E$ -M)&Q$.'U(='1(B>_H_,O__\9`"`)$B'@01(AX$4F+E"3P"@``2(E0%$B+4PA( -MB5`<28G$2(L(_H&P"0``#[:YL`D``(G^2(M$)"A(*#?"1L`'0%N`$```"%P)`/A`\"```/MD5'B(4(#```2(M$)&!( -MB87P"P``2(M$)&A(B87X"P``QH4)#````4C'A0`,````````0;\`````@'U& -M``^&RP$``$R-M?`+``!)O,W,S,S,S,S,9F:09I!$.'U(=5I(B>_H\LG__\9` -M"`-,B7`01(AX&$B+7"0H2(L3_H*P"0``#[:RL`D``(GQ2"G02(/H4$C!^`-) -M#Z_$B(1*L`D```^V0PN(A$JQ"0``0(AS"^E-`0``9F:09I!$.'U'#X0^`0`` -M1(GZ#[;"2,'@!$B-7`1P2`'H2(VX<`L``(NP<`L``/?6B3.+3P3WT8E+!(M7 -M"/?2B5,(BT<,]]")0PPC="1@B3,C3"1DB4L$(U0D:(E3""-$)&R)0PQ(B>_H -M.,G__\9`"`-,B7`01(AX&$F)Q4B+3"0H2(L1_H*P"0``#[:RL`D``(GQ2"G0 -M2(/H4$C!^`-)#Z_$B(1*L`D``$B+?"0H#[9'"XB$2K$)``!`B'<+N`````"# +M?T5,1@(!`0D```````````$`/@`!`````````````````````````"CA```` +M`````````$```````$``#@`+`$B![$@"``!(B9PD&`(``$B)K"0@`@``3(FD +M)"@"``!,B:PD,`(``$R)M"0X`@``3(F\)$`"``!(B?M,BV\02(UOB$R-9"00 +MN`(```"`?P$`=0N`?P(!&<"#X`+_P(A%`$C'10@`````@$T!!$B+0Q!(B440 +MBU,82(E5&$@/MD4`2(L$Q0````!(B45H@'T``W4N2(U"]DB)11B+&Z(````$B)W^@`````08$\)/,6>%IT(&9FD&9FD$@/MD4`2(L$Q0````!( +MB45P@$T!!.E:!0``OI````!,B>?H`````(3`==5!]D0D"0)T'<9#"`%!#[9$ +M)`J(0PLZ0PES"P^V\$B)W^@`````O@`"``!,B>?H`````(3`=!=)C;PDD``` +M`+IP`0``O@````#H`````$$/MI0DDP```+X!````(=8/MD,$@^#\B=�() +M\`G(O@0````AUH/@\XG1@^$("?`)R+X0````(=:#X,^)T8/A(`GP""`>!`( +M#X=7_O__2`^V0!!(@SS&``^$1_[____".=%_UD6+?"0808N$))@```!(P>`@ +M20G'N@````!(8\)(:`@2`G028E&&$$/MD0D(T&(1GH/MLBX`0```-/@ +M9D&)AI````!)#[8&2(L$Q0````!)B49H2`^V`TB+!,4`````28E&<`^V1"0/ +M08A&`T@/MD0D#TR)M,.@````_D-Y28UT)"Q)C;[@````NA````#H`````$F- +M="0\28V^\````+H$````Z`````!)C;0D@````$F-OC0!``"Z$````.@````` +M28UT)$!)C;[T````ND````#H`````$'V1"0)`70%08!.`0%)#[9$)"))@[S& +MH`````!U4R)=0A)#[8&2(L$Q0````!( +MB45P33F^F````'9!38F^F````.LX2`^V1"0/2(.\PZ``````=2=(B:S#H``` +M`$B)70C^0WD/MD0D#XA%`T@/M@-(BP3%`````$B)17!(BYPD&`(``$B+K"0@ +M`@``3(ND)"@"``!,BZPD,`(``$R+M"0X`@``3(N\)$`"``!(@<1(`@``PV9F +M9I!54TB#[`A(B?.]``````^V1GB)PH/X``^.TP```&9FD$ACQ4B#O,.@```` +M`'0+_\4YZG_LZ;<```"X`0```(GIT^!F"8.4````2(G>Z`````!(B<)(A<`/ +MA),```#&``-`B&@#2(E8"(`["`^4P,'@`P^V2@&#X?<)P8A*`4B+!0````!( +MB4)H2`^V`TB+!,4`````2(E"UT(8!] +M``-V&TB)[DR)[^@`````]H62````!'0'@(N2````!$'_Q`^V0WA$.>!_P^DO +M`0``@$X!!(!^>0)U$X"FD@```/[I&0$``&9F9I!F9I"`II(```#]2(.^H``` +M``!U'4B+AJ@```#&0`,`2(F&H````$C'AJ@`````````2(N#H````(`X`W4+ +M2(G>3(GOZ`````"`BY(````$2,>#F`````````#IM@```&9F9I`/MD9Y.D9X +M=2F`3@$$#[:&D@```(/@_HB&D@```&:#OI0`````='F#R`*(AI(```#K;@^V +M1GG_P`^V5G@YT'5@9H.^E`````!T++D`````#[>&E````(G"J`%U"O_!B=#3 +M^*@!=/9(8\%(@[S#H`````!U(>L)]H:2`````G46@$L!!("+D@````1(B=Y, +MB>_H`````$C'@Y@`````````2`^W@Y````!(]]A((8.8````2(-["`!U&?:# +MD@````1T$.@`````B4-\2(G?Z`````!(BUPD"$B+;"003(MD)!A,BVPD($B# +MQ"C#9F:09I!!5%5328G\O0````!F9F:02&/%2&G`2`$``$J-G"#(1```@WM\ +M`'0@2(-["`!U&4B)WDR)Y^@`````]D,!!'0(2,=#<`````#_Q8/]#W[!6UU! +M7,-F9F:09F9FD&9F9I!!5T%6055!5%532('L"`(``$F)_4B)]4&)UDF)YTB) +M]^@`````@'T`"'4+2(GN3(GOZ`````!!O`````"`?7@`#X;'````26/$2(.\ +MQ:``````#X2H````2(NTQ:````"`/@-V$4$/MM9,B>_H`````.F*````26/$ +M2(N$R)^;HP```` +MO@````#H`````.L3#[95`8/B`0^V0P&#X/X)T(A#`4B)W^@`````9F:09F:0 +M0?_$1#AE>`^'.?___[I(`0``O@````!(B>_H`````$F+A$) +M00^V=E!F9F:09F:03(M%`+\```$`9H-]"`!T!`^W?0@Y^8GZ#T;11#GF=1%F +MB5,(9L=#"@``3(D#2(/#$"G7B=!)`<`IT74>_\9!#[9%>#G&N``````/1/!! +M#[>%D````(G!P>$)A?]UMF:!?0H`@'0&2(/%$.N49L=#^@"`N`$```!(@<0` +M`@``6UU!7$%=05[#9F:09F:09F:03(M/"$R+1D@/MD\##[=^6#A.4'4+2`^W +M1E9)`<#K$9`X3E!V"TD/MX&0````20'`.$Y0=0MF`WY49F9FD&9FD#A.474+ +M9@-^4F9F9I!F9I"`?EP`=`XX3E!S)3A.46:0=Q3K'#A.4',(9D$#N9`````X +M3E%V"F9!`[F0````9I!FB7H03(E"",-F9F:09F:04TF)^4F)\$B+?@A$#[=6 +M$$&[`````$$/MDEZ2(G^2-/N9D''0%@``$'&0%P!20^V47A(B?!(B=&Z```` +M`$CW\4$/MDEZ2-/@28E`2$D/ME%X2(GP2(G1N@````!(]_%!B%!0B=%!#[>! +MD````/_((?AF08E`5D$/MY&0````9BG"9D0YTG(-9D6)4%1!N@````#K8F9! +MB5!49D$ITD&[`0```+H!````B=#3X&9!"4!:_\%!.$EX=2FY`````$&`>%P` +M=`M!QD!<`.L69F9FD$$/MT!89D$#@9````!F08E`6&9%.9&0````0$B+!@^V2`.X_O___]/`9B%#6H!^(0%T!P^V1B&( +M0R%(B>_H`````&:#>UH`=1F`>R$`=03&0R$!2(MS.$B)VDB)[^@`````2(/$ +M"%M=PV9FD&:02(/L.$B)7"0(2(EL)!!,B60D&$R);"0@3(ET)"A,B7PD,$F) +M_TB)]4R+-D'V1@$$=17&1B$"2(MV.$B)ZN@`````ZY,B>?H#OW__TC'0S@`````2,=#,`````!(B=Y,B?]!_U0D:&9FD$'_Q4$/ +MMD9X1#GH#X]P____2(M<)`A(BVPD$$R+9"083(ML)"!,BW0D*$R+?"0P2(/$ +M.,-F9F:09F9FD&9F9I!(@^P(2(M."`^V40&`9@'[@&$!^_Y)>8")D@````%( +M@WEP``^5P/;"!`^5P@^VP(7"=`U(B<[_47!F9F:09F:02(/$",-F9F:09F9F +MD&9FD$B#[`A,BT9`28MP*$B%]G0-9D$/MD`@@^`!.#``=!!,B<9! +M_U`PN@$```"%P'4PN@````#K*69F9I!(BP9(B0)(BT8(2(E""$B#PA!(C48* +M2(/&$&:#.`!YX+H!````B=!(@\0(PV9F9I!54TB)^P^V!X/H!(/X`7=0O0`` +M``"`?W@`=#=F9I!FD$ACQ4B#O,.@`````'012(N\PZ````#HQ?___X7`=0>X +M`````.LD_\4/MD-X.>AFD'_.N`$```#K$69F9I!F9I`/MD"@`=#/V0"`!="U(BT@H2(L!2(D"2(M!"$B)0@A(@\(02(U! +M"DB#P1!F@S@`>>#K'F9F9I!F9I"^`````$B#>#``=!!(B<:0_U`PB<;K!;X! +M````B?!(@\0(PV9F9I!F9I!F9I!F9I!(@^P82(D<)$B);"0(3(ED)!!)B?Q( +MB?-(BVY`2(L&#[9(`[C^____T\!F(45:@'XA`70'#[9&(8A%(4B)WDR)Y^@` +M````9H-]6@!U6H!](0!U),9%(0%(BTT`2(N1F````$@[4PAU#T@/MT,02`'0 +M2(F!F````$B+=3A(B>I,B>?H`````$B+10!FQT`H``!(BU4`2(/",$C'Q@`` +M``!,B>?H`````$B+'"1(BVPD"$R+9"002(/$&,-F9I!F9I!(@^P82(D<)$B) +M;"0(3(ED)!!)B?Q(B?-(BVY`@'XA`70.#[9&(8A%(>MY9F:09I"`?A(@=4K& +M1B$`2(M%`$B+@*@```!(B09(C7Y(NE@```"^`````.@`````QD,B`,9#$C`/ +MMD,@@^#]@\@$B$,@2(L#2(G>3(GG_U!HZV%FD,9%(0%(BTT`2(N1F````$@[ +M5@AU#T@/MT802`'02(F!F````$B)WDR)Y^@`````2(MU.$B)ZDR)Y^@````` +M2(M%`&;'0"@``$B+50!(@\(P2,?&`````$R)Y^@`````2(L<)$B+;"0(3(MD +M)!!(@\08PV9F9I!F9F:09F:09F:005154TF)]$B)U4B+1D"%R71&2(M0&$B) +M50`/MT80P>`)9HE%"&;'10H`@$B+!H!X`P`/A`T!``!(C8(```$`9H-]"`!T +M"4@/MT4(2(T$`DB)10#I[0````^W7A#!XPE(@W@H`'0L]D`@`70F2(M(*$B+ +M`4B)`DB+00A(B4((2(/"$$B-00I(@\$09H,X`'G@ZS2Z`````$B#>#``#X2H +M````2(GJ2(G&_U`PN@````"%P`^$D@```.L,9HE9"&;'00H`@.M&2(GI9F9F +MD&9FD+H```$`9H-Y"`!T!`^W40A)BP0D@'@#`'06.=IV%HG82`$!B=!F*=AF +MB4$(ZPYFD#G:<[9(@\$0*=-UQ$F+!"2`>`,`#Y7`2#G-#Y7"#[;`A<)T(4B+ +M`4B)10!(BT$(2(E%"$B#Q1!(C4$*2(/!$&:#.`!YW[H!````B=!;74%3(GG_U!HZW\/MU80P>()B=9( +MBWT82`'^Z`````"%P'0'QD4A#.LED,9%(0%(BTT`2(N1F````$@[4PAU#T@/ +MMT,02`'02(F!F````$B)WDR)Y^@`````2(MU.$B)ZDR)Y^@`````2(M%`&;' +M0"@``$B+50!(@\(P2,?&`````$R)Y^@`````2(L<)$B+;"0(3(MD)!!(@\08 +MPV9F9I!F9F:09F:09F:02(/L*$B)7"0(2(EL)!!,B60D&$R);"0@28G\2(GS +M2(LN2,=%.`````#VA9(````!#X5J`0``#[9&$H/X`@^$`P$``(/X`G\.@_@! +M#X2?````Z4H!``"#^`-F9F:09F:0#X4Z`0``2(M&"$B)12`/MT809HE%*`^W +M5A#!X@E(BWX8O@````#H`````&;'0UH#`$&]`````$R)Y^@`````2(G&QD`2 +M,$B+0PA(B48(#[=#$&:)1A"`3B`$2(E>0$C'1C@`````2,=&,`````!)8\5( +MBX3%H````$B)!DR)Y_]0:$'_Q4&#_0%^K.G#````2(M&"$B)12`/MT809HE% +M*.@`````2(G&QD`2($B+0PA(B48(#[=#$&:)1A"`3B`"2(E>0$C'1C@````` +M2,=&,`````!(BX6@````2(D&3(GG_U!HZVU(BT8(2(E%(`^W1A!FB44HZ``` +M``!(B<;&0!(@2(M#"$B)1@@/MT,09HE&$(!.(`)(B5Y`2,=&.`````!(QT8P +M`````$B+A:````!(B09,B>?_4&CK%V9F9I#&0R$&2(MS.$B)VDR)Y^@````` +M2(U5,$C'Q@````!,B>?H`````$B+7"0(2(ML)!!,BV0D&$R+;"0@2(/$*,.0 +M2(/L.$B)7"0(2(EL)!!,B60D&$R);"0@3(ET)"A,B7PD,$F)_TF)]$B++O9% +M`01U%<9&(0)(BW8X3(GBZ`````#IV@$``/9&("!T)$C'13@`````2(EU0&:# +M?2H`#X6]`0``Z+C]___ILP$``&9FD$B#?3@`=2EF@WTH`&9F9I!T/D@/MT4H +M2`-%($@[1@AV+T@/MT802`-&"$@Y12!S($G'1"10`````$B-?3!,B>;H```` +M`.EF`0``9F:09F:09O]%*O:%D@````,/A9\```!!]D0D(`(/A),```!(BY6@ +M````2(NUJ````(`Z`W5D@#X#=5])BT0D"(G!*XJ8````08G`1"N&F````(NZ +MG````(NVG````(G(F3'1*=%$B<"903'002G01#G!?1.%]@^41"0'@_\%#Y?` +M($0D!^LTA?\/E40D!X/^!0^6P`A$)`?K(8"]E@`````/E$0D!P^V3"0'B(V6 +M````ZPAF9I#&1"0'`&9!QT0D6@``0;X`````1(GP1`^VZ$J#O.V@`````'1[ +M2HN$[:````#V0`$$=&U!#[94)"#`Z@)$.'0D!P^4P`G0J`%T5DR)_^@````` +M2(G#ND@```!,B>9(B3(G__U!H9F:00?_&08#^`0^&9O__ +M_V9FD$B+7"0(2(ML)!!,BV0D&$R+;"0@3(MT)"A,BWPD,$B#Q#C#9F9FD&9F +MD&9FD&9FD%532(/L"$B)]4B+7@@/ME8#@&8!^X"+D@````%(QX.8```````` +M`/Y+>8![>0!U!H!C`?OK'`^V@Y(```"H`G01@^#7B(.2````A=)U!(!C`?OV +M0P$$=1U(@WMP``^$+`$``$B)WO]3<&9F9I!F9I#I&@$``(72=21(BY.@```` +MQD(#`4B+@Z@```#&0`,`2(F#H````$B)DZ@```!(@WL(`'0.2(M#"/9``00/ +MA(,```!(BX.@````@#@#=7=(B=[H`````$B)PDB%P'1GQ@`#QD`#`4B)6`A( +MBP4`````2(E":$B+!0````!(B4)P]D,!$'0.@$H!$(N"D````$B)0AA(QT4( +M`````$B)DZ@````/MH.2````@^#^@\@*B(.2````_D-Y2(G6OP<```#H```` +M`$B#>P@`=`]F9F:02(M;"$B#>P@`=?6+@X@```")@XP```"+@X0```")@X@` +M``"+@X````")@X0```"+0WR)@X````#H`````(E#?,:#EP````%(B=_H```` +M`$B#Q`A;7<-F9F:09F:09F:02('L*`(``$B)G"0``@``2(FL)`@"``!,B:0D +M$`(``$R)K"08`@``3(FT)"`"``!)B=1,BS9(BVY`2(M=*$&]$0```$B)XDB% +MVW0,9@^V12"#X`$YR'4I2(G32(-],`!T#TB)[O]5,(7`=15F9I!FD+@````` +MZ>4```!F9I!F9I"`?5'_#X2^````#[=-5,'A";H```$`9H-["`!T!`^W4P@Y +MT78[00^V1@,Z15!U%$B+`TF)!"1(BT,(28E$)`A)@\00*=%(@\,0N@```0!F +M@WL(`'0$#[=3"$'_S3G1=\5!#[9&`SI%4'4<2(L#28D$)&9!B4PD"&9!QT0D +M"@"`N`$```#K63G1)R$@#`TF)!"2)T&8IR&9!B40D"&:!>PH`@'4/9D'' +M1"0*`("X`0```.LJ9D''1"0*``!)@\002(/#$$'_S42)ZDC!X@1(B=Y,B>?H +M`````+@!````2(N<)``"``!(BZPD"`(``$R+I"00`@``3(NL)!@"``!,B[0D +M(`(``$B!Q"@"``##D`^V1P,Z1E!U%P^W1E1FB4(02(M&2$B)0@C#9F:09F:0 +M#[=&4F:)0A!(QT((`````,-F9F:09F9FD&9F9I!F9I!,BT8(1`^W3A!!NP`` +M``"Y`````(!_>``/A(,```!%#[?1B_H`````$B#Q`A;7<-F9I!FD$B#[#A(B5PD"$B) +M;"003(ED)!A,B6PD($R)="0H3(E\)#!)B?](B?5,BS9!]D8!!'45QD8A`DB+ +M=CA(B>KH`````.G*````3(GWZ*'^__]F@WU:`'4:QD4A`DB+=3A(B>I,B?_H +M`````.FC````9I!!O0````!!@'YX``^$D`````^W15I$B>G3^*@!='),B?_H +M`````$B)PTECQ4V+I,:@````3(DC2(EK0`^V52"#X@(/MD,@@^#]"="(0R`/ +MME4@@^($@^#["="(0R`/MD42B$,22(G:2(GN3(GGZ,[]__](QT,X`````$C' +M0S``````2(G>3(G_0?]4)&AF9I!!_\5!#[9&>$0YZ`^/8"(D@````%(@WAP`'0&2(G&_U!P2(/$",-F9F:02&/. +M2(N4SX!9``!(A=)T"TB+`DB)A,^`60``2(G0PY!(8])(BX37@%D``$B)!DB) +MM->`60``PV9FD&9FD&9FD$%7059!54%455-(@^P(28G_O0"```"!_@!```!W +M:&:]`$"!_@`@``!W7&:]`""!_@`0``!W4&:]`!"!_@`(``!W1&:]``B!_@`$ +M``!W.&:]``2!_@`"``!W+&:]``*!_@`!``!W(&:]``&!_H````!W%&:]@`"# +M_D!W"X/^(1GM@^7@@\5`B=`/K\5$C;#_#P``0<'N#,=$)`0`````N`````"! +M_0`0```/A]L```!!_\Y!@_[_#X3*````0;T`$```3(G_Z`````!(BA(`<-!_\1$B>BZ`````/?U1#G@#X=W____0?_.08/^_P^%//__ +M_XM$)`1(@\0(6UU!7$%=05Y!7\-F9F:09F:055-(B?V)\[@`````.;?860`` +M2&/#2(M\Q0BZ`!```+X`````Z`````#_RX/[_W7B2(/$ +M"%M=PV9FD&9FD&9FD(L/_\F#^?]T+DACP4B+1,<(N@````!(@S@`=`:X```` +M`,/_PDB#P`B!^O\!``!VYO_)@_G_==*X`0```,-F9I!(@^P(NA````"^```` +M`.@`````2(/$",-F9F:09F9FD$B#?A@`=`Q(BU882(M&$$B)0A!(BU802(M& +M&$B)`DC'1A``````N@````#HL/S___/#9F9FD&9F9I!F9I!F9I!(C4]@2(M' +M8$B)1AA(A6^`````.C[^___2(G#3(D@2(EH +M"$B)QDR)[^AF____2(G82(L<)$B+;"0(3(MD)!!,BVPD&$B#Q"##9F9FD&9F +M9I!F9I`/MD=-#[;02(T4DDB-5-=0_\"(1TU(B3K&0@D`QD(*`,9""P!(B=## +M9F9FD&9F9I!!5%5328G\2(GSO0`````/ME9*C4+]T?@!PH/Z`'XED$ACQ4B+ +MM,.@"@``3(GGZ*W]____Q0^V4TJ-0OW1^`'".>I_W+H'````2(G>3(GGZ%S[ +M__];74%2Z!P```$B)[DR)[^AO^?__ +MN`````#K,DECQ$C!X`1(C1PH2(V[\`H``.A1_/__2(V[<`L``.A%_/__0?_$ +M13GF#X]Y____2(GH2(/$&%M=05Q!74%>05_#9F9FD&9FD$%455-(B?5(B=.) +MS@^V37J)T-/H)?\!``!(BU583(TDPDV+!"1-A$B)VNAH +M_?__28G`2(7`=%!(B6@X28L$)$F)0"A(A$&(<$H/MDUZ2(G82-/H2`^V57A(B=&Z`````$CW\4`HUO_.08AP +M2TR)P%M=05S#9F9FD&9F9I!!5T%6055!5%532('L:`$``$B)?"1(2(ET)$!( +MB50D.`^V5B")T-#H@_`!B<�&)3"0T2(-^*`!T!?;"`70<3(U\)%"Y`0`` +M`$R)^DB+="1`2(M\)$C_5C#K"4B+7"1`3(M[*,=$)`P```$`9D&#?P@`=`E! +M#[='"(E$)`Q!O0````#'1"0P`````$B+5"1`@+J```````^$=P$``$AC1"0P +M2(M,)$!(BT3!6$B)1"0@#[:88`P``(A<)"\XF&$,```/@C(!```/MD0D+TB+ +M5"0@.$)+#X0%`0``#[;`2(G1#[>4@D`,```/MX2!0@P``&:)1"00B=!FP>@# +M#[?`B40D"$&)UD&#Y@=!#[?&B<;!Y@FX"````&9$*?!!B<9F1#MT)!"+7"00 +M1`]'\T$/M\:)Q<'E"4@/MD0D+TB+5"0@2(N,PJ`*``"+5"0(B?!)B<1,`V31 +M"$0[;"0,=2-)@\<0QT0D#````0!F08-_"`!T"4$/MT\(B4PD#$&]`````(M< +M)`Q$*>LYZP]'W8-\)#0`=!)$B>Y)`S>)VDR)Y^@`````ZQ!$B>])`S^)VDR) +MYN@`````00'=*=UT!XG820'$ZY-F1"ET)!!T%/]$)`B^`````$&^"````.D_ +M_____D0D+P^V7"0O2(M$)"`XF&$,```/@\[^____1"0P2(M4)$`/MH*````` +M.T0D,`^/B?[__[H`````2(MT)$!(BWPD2/]4)#A(@<1H`0``6UU!7$%=05Y! +M7\-F9I!F9I!54TB#[`A(B?V%TG0$QD8A"T&[`````("^@``````/A,$```!( +MC9U@60``2(V]4%D``$ECPTR+1,982<>`,`P```````!-B<*Y`````$&`>$H` +M=D8/ML%(P>`$3`'02(V0\`H``$&Y`````(.X\`H```!U$H-Z!`!U#(-Z"`!U +M!H-Z#`!T!D&Y`0```$6%R9!U)?_!03A*2G>ZN`````"%P'0=2(M#"$R)0PA) +MB1A)B4`(3(D`ZQNX`0```.OA9I!(BT<(3(E'"$F).$F)0`A,B0!!_\,/MH:` +M````1#G8#X]-____2(GOZ%,X``!(@\0(6UW#9F9FD&9F9I!F9F:02(/L2$B) +M7"082(EL)"!,B60D*$R);"0P3(ET)#A,B7PD0$F)_4B)\TB+KC`,``#_C]Q9 +M``!(C4802(M("$B+5A!(B4H(2(D12(E&$$B)0`A(A>T/A*<"``#V12`@#X0M +M`0``3(ME`$@/MT9(28G&3`-V0$0/MWY(2,>&,`P```````!(C8=060``2(M0 +M"$B)<`A(B09(B58(2(DR@+YB#````758@'T2`G5)2`^V1DM(B[S&H`H``.@3 +M]___A$))````#WV$B82"-#0$DYA"28 +M````=@A)B80DF````("[8@P```%T&@^V@V(,``"(12%(B>Y,B>_H+C<``.F) +M`P``20^WA"20````2(M5"$C_PD@/K\),.?!V+4$/M\],B?),B>9,B>_HKOK_ +M_TB)J#`,``!(B4582(G&3(GOZ$@0``#I0P,``$D/MX0DD````$D#A"28```` +M3#GP=0A-B;0DF````$B)[DR)[^BZ-@``Z14#``!F9I!FD`^VA8$```#_P(B% +M@0```#J%@`````^%E0(``/9%(`0/A-P```!!O@````"`O8``````#X:Y```` +M2(V'4%D``$B)1"002(V78%D``$B)5"0(1(GR#[;"2(MY,B>_HM#4``.FO`0``0;X`````@+V``````'8J1(GR#[;"2(M< +MQ5B`NV(,```!=`H/MH-B#```B$4A0?_&1#BU@````'?6@'TA`'472,?"```` +M`$B)[DR)[^C>^?__Z5D!``"Z`````$B)[DR)[^@)_/__Z40!``!F9F:0@+YB +M#````0^%@P```$F)]+T`````@'Y*`'8D9F:09I")Z`^V^$C!YP1*C;PG\`H` +M`.C:]/___\5!.&PD2G?A2(.[.`P```!T*4B+@S@,``!(B8,P#```2,>#.`P` +M``````!(B=Y,B>_H,PX``.G.````28V%4%D``$B+4`A(B5@(2(D#2(E3"$B) +M&NM:9F:02(V'8%D``$B+4`A(B7`(2(D&2(E6"$B),DB#OC@,````=#1(BX8X +M#```#[:68@P``(A0(4B+EC@,``!(Q\8`````Z`````!(QX,X#````````.FY +M````2(MS,$R)[^@]]/__2,=#,`````!(BT,X2(-X,`!T%4B-4#!(Q\8````` +M3(GOZ`````#K)4F#O>A9````=!M)C97H60``2,?&`````$R)[^@`````9F:0 +M9I!!@[W@60```'16@+MB#````75-2(M[.$B#?T@`=##H#3(``(7`=2=(BT,X +M2(M04$B+<$A,B>_H`````$B+0SA(QT!(`````$'_C>!9``!!@[W@60```'0( +M3(GOZ`````!(BUPD&$B+;"0@3(MD)"A,BVPD,$R+="0X3(M\)$!(@\1(PV9F +M9I!F9I!F9I!F9I!(@^P(2(L6@'I.`'03QD).`$C'Q@````#H`````&9FD$B# +MQ`C#9F9FD&9F9I!F9I!!5T%6055!5%532(/L"$F)U$&)STB+1D!(BQ!(#[9` +M$4R+M,*@"@``BT8(*T)`P>`)#[=N$,'E"8G!@>'_#P``08G%0<'M#+L`$``` +M*05_#9F9FD&9F9I!F9I`/MD<2`D<3B$<22(U7%+X!```` +MZP^`?Q(`>0:X`````,/^1Q(/MD\2@_D?=Q.)\-/@A4<4#Y7`#[;`ZU1F9F:0 +M@_D_=Q*#Z2")\-/@A4($#Y7`#[;`ZSF#^5]W%(/I0(GPT^"%0@@/E<`/ML#K +M(F:0N`````"#^7]W%H/I8(GPT^"%0@P/E<`/ML!F9I!F9I"%P'2!QD<3`4R- +M1Q0/ME<2O@$```#K`_Y'$P^V1Q.-#`*#^1]W#XGPT^"%1Q0/E<`/ML#K3H/Y +M/W<6@^D@B?#3X$&%0`0/E<`/ML#K-F9FD(/Y7W<3@^E`B?#3X$&%0`@/E<`/ +MML#K&[@`````@_E_=Q&#Z6")\-/@085`#`^5P`^VP(7`=9"P`<-F9I!F9I!( +M@^P82(D<)$B);"0(3(ED)!!(B?U(BUY`3(LC#[9&(8A#"N@`````@'L*`75R +M2(G?Z*K^__^%P'06QD,*`$B)WDB)[^C'````ZV1F9I!FD(!["`%U2@^V0Q!! +M.$0D2Y!T/CA#$74Y#[;P2(GP2,'@!$J-M"!P"P``2(U+%(L&"T,4B0:+1@0+ +M002)1@2+1@@+00B)1@B+1@P+00R)1@R0QD,)`DB)WDB)[^A!_?__2(L<)$B+ +M;"0(3(MD)!!(@\08PV9F9I!F9F:09F:09F:02(/L&$B)7"0(3(ED)!!)B?Q( +MB?/&1A,`QD82`$B)]^CL_?__2(G>3(GGZ!$```!(BUPD"$R+9"002(/$&,-F +MD$B#["A(B5PD"$B);"003(ED)!A,B6PD($F)_4B)\TB++DB+53A(#[9&$$R+ +MI,*@````Z`````!(B<9,B2"`>P@!=0V`2"`"QD`2(.L+9F:0@$@@!,9`$C!( +M#[9#$D@#14!(B48(9@^V0Q-FB4802,=&,`````!(B5Y`2,=&.`````!,B>]! +M_U0D:$B+7"0(2(ML)!!,BV0D&$R+;"0@2(/$*,-F9F:09F:09F:09F:00515 +M4T&Y`````$&[`````$B)_4&\`0```.L808/[?W8/1(G(Z5X!``!F9F:09F:0 +M0?_#1(G:08/['W<21(G@1(G9T^"%!P^5P`^VP.M208/[/W<3C4K@1(GCT^.% +M700/E<`/ML#K.4&#^U]W$XU*P$2)X-/@A44(#Y7`#[;`ZR"X`````$&#^W]W +M%8U*H$2)X]/CA5T,#Y7`#[;`9F9FD(7`#X1S____0;@!````2(GZ0;H!```` +MZPIF9F:09F:00?_`0XT,`X/Y'W<41(G0T^"%`@^5P`^VP.M59F:09I"#^3]W +M$X/I($2)T-/@A4($#Y7`#[;`ZSB#^5]W$X/I0$2)T]/CA5H(#Y7`#[;`ZR"X +M`````(/Y?W<6@^E@1(G0T^"%0@P/E<`/ML!F9I!FD(7`=8Q$B=E%`<-!N@@` +M``!$BQD`#X3A````2(-[$`!U"4B)@`````_\-$.?-\A.E_````2(UT)"!(B=_H,OW__T&)QD@/ +MMD,83(NDQ:`*``!)#[9%&$R+O,6@"@``NP````!$.?-]2TACTP^V1)0AB<'! +MX0D/MD24(D&)P$'!X`E(#[9$E"")SDB)]TD#?,0(2(E\)!!)`W3'"$B)="08 +M1(G"Z`````#_PT0Y\WRY9F9FD+H`````3(GN2(M\)`CHC@(``$B+G"0H`0`` +M2(NL)#`!``!,BZ0D.`$``$R+K"1``0``3(NT)$@!``!,B[PD4`$``$B!Q%@! +M``##9F:09F:02('L2`$``$B)G"08`0``2(FL)"`!``!,B:0D*`$``$R)K"0P +M`0``3(FT)#@!``!,B;PD0`$``$F)_TB)]4B+'DB-="002(U]$.@B_/__08G$ +M2`^V12!,B[3#H`H``$@/MD4A3(NLPZ`*``"[`````$0YXWT]2&/##[9TA!'! +MY@D/ME2$$L'B"4@/MD2$$(GV2(GW20-\Q@A(B3PD20-TQ0A(B70D".@````` +M_\-$.>-\P[H`````2(GN3(G_Z(X!``!(BYPD&`$``$B+K"0@`0``3(ND)"@! +M``!,BZPD,`$``$R+M"0X`0``3(N\)$`!``!(@<1(`0``PV9FD&9FD$%7059! +M54%455-(@>R(`0``28G_2(GU3(LF2(M>$$B-M"2`````2(G?Z$+[__]!B<9( +M#[9#&$V+K,2@"@``NP````"`?2``=B,/MDT@9F:0#[;#2`^V5"@828N4U*`* +M``!(B53$0/_#.-EWY$&\`````$4Y]`^-K0```&9FD&:026/$#[:4A($```!! +MB=)!P>()#[:4A((```!!B=-!P>,)#[:,A(````"[`````(!](`!V*$0/MLE% +MB=`/MG4@D`^VPTB+5,1`2HM\R@A)C10X2(D4Q/_#0#C>=^0/MM%$B=!(B<=) +M`WS5"$@Y/"1U$$B+="0(1(G:Z`````#K'9!(BU0D"$B+-"0/ML%$B==)`WS% +M"$2)V>@`````0?_$13GT#XQ8____N@````!(B>Y,B?_H&````$B!Q(@!``!; +M74%<05U!7D%?PV9FD&9FD$B#[!A(B1PD2(EL)`A,B60D$$F)_$B)\XG5QD8) +M`H/Z`1G`@^#U@\`,B$8*Z!_V__^`>P@#=2](BT,02(MP$$B%]G0B2,=`$``` +M``#&1@D"@_T!&<"#X/6#P`R(1@I,B>?HZO7__TB+'"1(BVPD"$R+9"002(/$ +M&,-F9F:09F:0#[96"X72=$:)T$@/MH1'L`D``$B-!(!(C43'4(!X"0)T!K@` +M````PX!X"@%T$L9&"0(/MD`*B$8*N`````##D(G0#[:41[$)``"%TG6ZN`$` +M``##9F9FD&9F9I!F9F:005=!5D%505154TB#[`A)B?Y(B?7&1DX`@+YC#``` +M``^$BP```$&\`````$B-75"`?4T`=$Z`>PD!=3B`>P@#=2E(BT,0@'@9`'0? +M2(-X$`!T&$C'0!``````QD,)`@^VA6(,``"(0PKK"<9%3@'IMP$``$'_Q$B# +MPR@/MD5-1#G@?[)(B>Y,B??H$O#__^F7`0``#[9#"HB%8@P``,:%8PP```'I +M?/___V9F9I!F9I!!OP````!!O0$```!!O`````!(C5U0@'U-``^$-`$``(![ +M"0!U>DB)WDB)[^B__O__APD"=1!!_\=F9F:09F:0@'L)`G0+0;T` +M````Z8\```"`>PH!#X2%````@'U/`)`/A!W___](BT4X2`^V4Q!(BX30H``` +M`/9``01T7T&]`````,9#"0'&0PH`3(GW2(G>#[9#"(/X!G=&B<#_),4````` +MZ)CV___K-F9FD&9FD.@+^?__ZRGH!/O__V9F9I#K'NCY^___ZQ?&14\!QD8) +M`L9&"@'HAO/__^L$QD,*`4'_Q$B#PR@/MD5-1#G@#X_,_O__187_#X6C_O__ +M187M=!3&A6(,```!2(GN3(GWZ'SN___K!,9%3@%(@\0(6UU!7$%=05Y!7\-F +M9F:09F:005=!5D%505154TB!['@!``!(B7PD2$B)]4B+7CA,BZ8P#```0;T` +M````387D=2A(#[=.2$B+5D!(`=%(B=[HO>;__TB)13"X_____TB#?3``#X2N +M(@``2(M$)$C_@-Q9``!(C4402(M4)$A(@<)P60``2(M*"$B)0@A(B5402(E( +M"$B)`6:#NY0`````=$/V@Y(````!=0U(BU5`2#F3F````'# +ME````(G"J`%U#D'_QHG01(GQT_BH`73R1(AU3.LIQD5,".LC]H.2`````G06 +M2(M]0$@YNY@```!W"0^V14N(14SK!,9%3`C&14T`QH6P"0```,9%3P#&A6(, +M````QH5C#````$C'A3@,````````387D#X1?#P``0?9$)"`@#X2.!P``00^V +M1"02@_@"#X1M!```@_@"?P^#^`$/A`0!``"0Z9XA``"#^`,/A94A``!(C5PD +M8$B)W^@%Y?__28G:OP`````/MW5(NP````!!N2````!!NP$```"#_Q]W/P^V +MPTF-%()$B_H<.7__\9`"`)$B'@0QD`1`$B+5"1@2(E0%$B+5"1H2(E0'$'_QT0X +M?4IWJ^FG(```N`$```#K54B)[[D`````@'U*`)!V00^VP4C!X`1(`?A(C9#P +M"@``O@````"#N/`*````=1*#>@0`=0R#>@@`=0:#>@P`=`6^`0```(7V=;#_ +MP3A/2G>_N`````"%P'073(FE.`P``$C'A3`,````````Z<(-``!(C5PD8$B) +MW^B@X___28G:OP`````/MW5(NP````!!N2````!!NP$```"#_Q]W/P^VPTF- +M%()$B;`)``!!#[9$)`N( +MA'FQ"0``08AT)`M!OP````"`?4H`#X;3'@``2(G31#A]3'1R2(GOZ%_C___& +M0`@!1(AX$$2(>!%(BU0D8$B)4!1(BU0D:$B)4!Q!#[95(`^VRD:(?"D8_\)! +MB%4@28M5`/Z"L`D```^VLK`)``")\4@IT$B#Z%!(P?@#2`^OPXB$2K`)``!! +M#[9%"XB$2K$)``!!B'4+0?_'1#A]2@^'>____^E&'@``0;\`````@'U*``^& +M-AX``$B-G?`+``!)OLW,S,S,S,S,1#A]3`^$O0```$B)[^BPXO__QD`(`42( +M>!!$B'@12(M4)&!(B5`42(M4)&A(B5`<2(E$)$!(B>_HA>+__\9`"`-(B5@0 +M1(AX&$F)Q4B+$/Z"L`D```^VLK`)``")\4B+1"1`2"G02(/H4$C!^`-)#Z_& +MB(1*L`D``$$/MD4+B(1*L0D``$&(=0M)BQ0D_H*P"0``#[:RL`D``(GQ3(GH +M2"G02(/H4$C!^`-)#Z_&B(1*L`D``$$/MD0D"XB$2K$)``!!B'0D"T'_QT0X +M?4H/ARS____I3!T``+@!````ZUE(B>^Y`````(!]2@!V1F9F9I`/ML%(P>`$ +M2`'X2(V0\`H``+X`````@[CP"@```'43@WH$`'4-@WH(`'4'@WH,`)!T!;X! +M````A?9UK/_!.$]*=[ZX`````(7`=!=,B:4X#```2,>%,`P```````#I8PH` +M`$B-7"1@2(G?Z$'@__])B=J_``````^W=4B[`````$&Y(````$&[`0```&9F +M9I"#_Q]W/P^VPTF-%()$B_HI>#__\9`"`5(B5@0QD`@`$F)Q4&_`````(!] +M2@`/AND;``!(N\W,S,S,S,S,2(GOZ'3@___&0`@!1(AX$$2(>!%(BU0D8$B) +M4!1(BU0D:$B)4!Q!#[95(`^VRD:(?"D8_\)!B%4@28M5`/Z"L`D```^VLK`) +M``")\4@IT$B#Z%!(P?@#2`^OPXB$2K`)``!!#[9%"XB$2K$)``!!B'4+0?_' +M1#A]2G>%Z5\;```/MEU+2(GOZ/#?___&0`@!B%@0B%@12(M4)&!(B5`42(M4 +M)&A(B5`<2(E$)#A!OP````"`?4H`#X8B&P``2(V=\`L``$F\S!%(BU0D8$B)4!1(BU0D:$B) +M4!Q(B40D0$B)[^AQW___QD`(`TB)6!!$B'@828G%2(L0_H*P"0``#[:RL`D` +M`(GQ2(M$)$!(*=!(@^A02,'X`TD/K\2(A$JP"0``00^V10N(A$JQ"0``08AU +M"TF+50#^@K`)```/MK*P"0``B?%(BT0D.$@IT$B#Z%!(P?@#20^OQ(B$2K`) +M``!!#[9%"XB$2K$)``!!B'4+0?_'1#A]2@^'+/___^DX&@``9F:09I!-A>0/ +MA+P'``!!]D0D(`*0#X2O!P``1`^VO6`,``!$.+UA#```#X)5`0``9F:09I!$ +M.'U+#X0V`0``1(GX#[;82(G82,'@!$R-I`3P````3(GGZ%G=__\/MY2=0`P` +M``^WO)U"#```NP````!!N2````!!N@$```"#^A]W1`^VPTF--(1$BAF +M9I!FD$'_QT0XO6$,```/@[#^__]%A.T/A)H%``!(C7PD8.@=W/__0;\````` +M@'U*`'99D$0X?4QT240X?4MT0T2)^`^VT$C!X@1(`>I(C8KP"@``BT0D8`N" +M\`H``(E$)&"+1"1D"T$$B40D9(M$)&@+00B)1"1HBT0D;`M!#(E$)&Q!_\=$ +M.'U*=ZA,#[9%3$G!X`1*C70$<(M\)&`C/HE\)%"+3"1D(TX$B4PD5(M4)&@C +M5@B)5"18BT0D;"-&#(E$)%SWUXE\)&#WT8E,)&3WTHE4)&CWT(E$)&PC/HE\ +M)&`C3@2)3"1D(U8(B50D:"-&#(E$)&Q(B>_H9-S__\9`"`!(B40D*+@````` +M@WPD8`!U%8-\)&0`=0Z#?"1H`'4'@WPD;`!T!;@!````A<`/A*8!```/MD5, +MB(4(#```2(M$)&!(B87P"P``2(M$)&A(B87X"P``QH4)#````4C'A0`,```` +M````0;\`````@'U*``^&`P(``$R-I?`+``!$.'U,#X0_`0``1#B]8`P``'!%(BU0D8$B)4!1( +MBU0D:$B)4!Q(B40D0.M21(GZ#[;"2,'@!$B-7`1PBT0D8`D#BT0D9`E#!(M$ +M)&@)0PB+1"1L"4,,2(GOZ&';___&0`@!1(AX$$2(>!%(BQ-(B5`42(M3"$B) +M4!Q(B40D0$B)[^@YV___QD`(`TR)8!!$B'@828G%2(L0_H*P"0``#[:RL`D` +M`(GQ2(M$)$!(*=!(@^A02,'X`TB_S`$2(U$!'"Z`````(,X`'42@W@$`'4, +M@W@(`'4&@W@,`'0%N@$```"%TG0R1(GY#[;!2,'@!$B-7`1P2(GOZ`[:___& +M0`@!1(AX$$2(>!%(BQ-(B5`42(M3"$B)4!Q!_\=$.'U*#X=O____N`````"# +M?"10`'45@WPD5`!U#H-\)%@`=0>#?"1<`'0%N`$```"%P`^$&Q4``$0/MF5, +M1(BE*`P``$B+1"102(F%$`P``$B+1"182(F%&`P``,:%*0P```!(QX4@#``` +M``````^V74M(B>_H=MG__\9`"`&(6!!$B&`12(M4)%!(B5`42(M4)%A(B5`< +M2(E$)#A(QT0D,`````!!OP````"`?4H`#X:>%```3(VE$`P``$F^S_H"MG__\9`"`%$B'@0B%@1 +M2(M4)%!(B5`42(M4)%A(B5`<2(E$)$!(BQ#^@K`)```/MK*P"0``B?%(BT0D +M*$@IT$B#Z%!(P?@#2+_-S,S,S,S,S$@/K\>(A$JP"0``2(M<)$`/MD,+B(1* +ML0D``$"(_H3=C__\9` +M"`-,B6`0B%@828G%2(E$)#!(BQ#^@K`)```/MK*P"0``B?%(BT0D0$@IT$B# +MZ%!(P?@#20^OQHB$2K`)``!!#[9%"XB$2K$)``!!B'4+28M5`/Z"L`D```^V *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 16:40:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80961065696; Tue, 7 Apr 2009 16:40:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5DD78FC38; Tue, 7 Apr 2009 16:40:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37GeW2u014707; Tue, 7 Apr 2009 16:40:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37GeWGb014706; Tue, 7 Apr 2009 16:40:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904071640.n37GeWGb014706@svn.freebsd.org> From: Xin LI Date: Tue, 7 Apr 2009 16:40: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: r190810 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:40:34 -0000 Author: delphij Date: Tue Apr 7 16:40:31 2009 New Revision: 190810 URL: http://svn.freebsd.org/changeset/base/190810 Log: When multiple cards are present, register a shutdown handler for each card instead of just register one for the first adapter. Without doing this there would be some data loss upon shutdown because data could be ignored when flushing to disk. MFC after: 3 days Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Tue Apr 7 16:38:25 2009 (r190809) +++ head/sys/dev/hptmv/entry.c Tue Apr 7 16:40:31 2009 (r190810) @@ -2138,14 +2138,15 @@ hpt_attach(device_t dev) xpt_action((union ccb *)ccb); free(ccb, M_DEVBUF); - /* Register shutdown handler, and start the work thread. */ - if (device_get_unit(dev) == 0) { - pAdapter->eh = EVENTHANDLER_REGISTER(shutdown_final, - hpt_shutdown, dev, SHUTDOWN_PRI_DEFAULT); - if (pAdapter->eh) - launch_worker_thread(); - else - hpt_printk(("shutdown event registration failed\n")); + /* Register a shutdown handler to flush data for the current adapter */ + pAdapter->eh = EVENTHANDLER_REGISTER(shutdown_final, + hpt_shutdown, dev, SHUTDOWN_PRI_DEFAULT); + if (pAdapter->eh == NULL) { + device_printf(pAdapter->hpt_dev, + "shutdown event registration failed\n"); + } else if (device_get_unit(dev) == 0) { + /* Start the work thread. XXX */ + launch_worker_thread(); } return 0; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:06:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7D19106566B; Tue, 7 Apr 2009 17:06:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D558A8FC12; Tue, 7 Apr 2009 17:06:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37H66P2015435; Tue, 7 Apr 2009 17:06:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37H66J4015434; Tue, 7 Apr 2009 17:06:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071706.n37H66J4015434@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 17:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190811 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:06:07 -0000 Author: imp Date: Tue Apr 7 17:06:06 2009 New Revision: 190811 URL: http://svn.freebsd.org/changeset/base/190811 Log: More chip types, and fix a comment. Modified: head/sys/dev/ed/if_edreg.h Modified: head/sys/dev/ed/if_edreg.h ============================================================================== --- head/sys/dev/ed/if_edreg.h Tue Apr 7 16:40:31 2009 (r190810) +++ head/sys/dev/ed/if_edreg.h Tue Apr 7 17:06:06 2009 (r190811) @@ -1066,20 +1066,23 @@ struct ed_ring { /* * Chip types. */ - -#define ED_CHIP_TYPE_DP8390 0 -#define ED_CHIP_TYPE_WD790 1 -#define ED_CHIP_TYPE_AX88190 2 -#define ED_CHIP_TYPE_DL10019 3 -#define ED_CHIP_TYPE_DL10022 4 -#define ED_CHIP_TYPE_TC5299J 5 -#define ED_CHIP_TYPE_RTL8019 6 -#define ED_CHIP_TYPE_RTL8029 7 -#define ED_CHIP_TYPE_AX88790 8 +#define ED_CHIP_TYPE_AX88190 0 +#define ED_CHIP_TYPE_AX88790 1 +#define ED_CHIP_TYPE_DL10019 2 +#define ED_CHIP_TYPE_DL10022 3 +#define ED_CHIP_TYPE_DP8390 4 +#define ED_CHIP_TYPE_NS83903 5 +#define ED_CHIP_TYPE_NS83926 6 +#define ED_CHIP_TYPE_RTL8019 7 +#define ED_CHIP_TYPE_RTL8029 8 +#define ED_CHIP_TYPE_TC3299 9 +#define ED_CHIP_TYPE_TC5299J 10 +#define ED_CHIP_TYPE_W89C926 11 +#define ED_CHIP_TYPE_WD790 12 /* * MII bus definitions. These are common to both DL100xx and AX88x90 - * MII definitions, most likely because they are standards based. + * MII definitions, because they are standards based. */ #define ED_MII_STARTDELIM 0x01 #define ED_MII_WRITEOP 0x01 From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:08:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 278C21065678; Tue, 7 Apr 2009 17:08:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ECCFA8FC0A; Tue, 7 Apr 2009 17:08:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8AC0E46BC0; Tue, 7 Apr 2009 13:08:01 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 95DED8A03E; Tue, 7 Apr 2009 13:08:00 -0400 (EDT) From: John Baldwin To: Xin LI Date: Tue, 7 Apr 2009 13:07:29 -0400 User-Agent: KMail/1.9.7 References: <200904071640.n37GeWGb014706@svn.freebsd.org> In-Reply-To: <200904071640.n37GeWGb014706@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200904071307.29778.jhb@freebsd.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 07 Apr 2009 13:08:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190810 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:08:02 -0000 On Tuesday 07 April 2009 12:40:32 pm Xin LI wrote: > Author: delphij > Date: Tue Apr 7 16:40:31 2009 > New Revision: 190810 > URL: http://svn.freebsd.org/changeset/base/190810 > > Log: > When multiple cards are present, register a shutdown handler for each card > instead of just register one for the first adapter. Without doing this > there would be some data loss upon shutdown because data could be ignored > when flushing to disk. Have you considered just using a device_shutdown routine? It is invoked at shutdown_final as well but is easier to use (no need to keep track of eventhandler tags, etc.). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:13:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3EA1065673; Tue, 7 Apr 2009 17:13:18 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id E3BD68FC1C; Tue, 7 Apr 2009 17:13:17 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 19BFE28448; Wed, 8 Apr 2009 01:13:17 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id D535DEDD1FE; Wed, 8 Apr 2009 01:13:16 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 51irCMx-DFSM; Wed, 8 Apr 2009 01:13:12 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 7DEDAEDD1FD; Wed, 8 Apr 2009 01:13:09 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=tCAqfxK4yDQlddrl3iYgdfky2Gyv9ptV3DyUDLRPuZD1mB6y5069/4C+/WUDVk1Pp sce2+CZtBjJvIQBvgTSVw== Message-ID: <49DB89A4.4080507@delphij.net> Date: Tue, 07 Apr 2009 10:13:08 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090324) MIME-Version: 1.0 To: John Baldwin References: <200904071640.n37GeWGb014706@svn.freebsd.org> <200904071307.29778.jhb@freebsd.org> In-Reply-To: <200904071307.29778.jhb@freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r190810 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:13:19 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Baldwin wrote: > On Tuesday 07 April 2009 12:40:32 pm Xin LI wrote: >> Author: delphij >> Date: Tue Apr 7 16:40:31 2009 >> New Revision: 190810 >> URL: http://svn.freebsd.org/changeset/base/190810 >> >> Log: >> When multiple cards are present, register a shutdown handler for each card >> instead of just register one for the first adapter. Without doing this >> there would be some data loss upon shutdown because data could be ignored >> when flushing to disk. > > Have you considered just using a device_shutdown routine? It is invoked at > shutdown_final as well but is easier to use (no need to keep track of > eventhandler tags, etc.). Yes for sure. What I really wanted to do is to keep the change as few as possible at this point, as the requester for update has tested his patch (slightly different) and we are approaching 7.2-RELEASE... Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknbiaMACgkQi+vbBBjt66C+bACgvECvXYtfJRrgsl+5wDSXe3ty EOEAn3iL1o7OegT4A2P/T3o9fJ/5UvLT =bvSu -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:16:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99E2106566C; Tue, 7 Apr 2009 17:16:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1628FC08; Tue, 7 Apr 2009 17:16:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37HG9kB015857; Tue, 7 Apr 2009 17:16:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37HG9fL015856; Tue, 7 Apr 2009 17:16:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200904071716.n37HG9fL015856@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Apr 2009 17:16: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: r190812 - head/contrib/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:16:10 -0000 Author: emaste Date: Tue Apr 7 17:16:09 2009 New Revision: 190812 URL: http://svn.freebsd.org/changeset/base/190812 Log: Bootstrap merge history for gdb. Modified: head/contrib/gdb/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:24:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8F391065730; Tue, 7 Apr 2009 17:24:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8975C8FC0C; Tue, 7 Apr 2009 17:24:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37HOP5s016349; Tue, 7 Apr 2009 17:24:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37HOPgk016348; Tue, 7 Apr 2009 17:24:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904071724.n37HOPgk016348@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Apr 2009 17:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190813 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:24:52 -0000 Author: jkim Date: Tue Apr 7 17:24:25 2009 New Revision: 190813 URL: http://svn.freebsd.org/changeset/base/190813 Log: Increase sprintf(3) buffer size, which I forgot from the previous commit. Modified: head/sys/boot/i386/libi386/smbios.c Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Tue Apr 7 17:16:09 2009 (r190812) +++ head/sys/boot/i386/libi386/smbios.c Tue Apr 7 17:24:25 2009 (r190813) @@ -77,7 +77,7 @@ smbios_detect(void) uint8_t *smbios, *dmi, *addr; uint16_t i, length, count; uint32_t paddr; - char buf[4]; + char buf[16]; /* locate and validate the SMBIOS */ smbios = smbios_sigsearch(PTOV(SMBIOS_START), SMBIOS_LENGTH); From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 17:58:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361851065670; Tue, 7 Apr 2009 17:58:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2175C8FC17; Tue, 7 Apr 2009 17:58:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37HwFPs018158; Tue, 7 Apr 2009 17:58:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37HwFJH018156; Tue, 7 Apr 2009 17:58:15 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904071758.n37HwFJH018156@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Apr 2009 17:58: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: r190814 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 17:58:16 -0000 Author: jkim Date: Tue Apr 7 17:58:15 2009 New Revision: 190814 URL: http://svn.freebsd.org/changeset/base/190814 Log: Rewrite SMBIOS for loader: - First three fields of system UUID may be little-endian as described in SMBIOS Specification v2.6. For now, we keep the network byte order for backward compatibility (and consistency with popular dmidecode tool) if SMBIOS table revision is less than 2.6. However, little-endian format can be forced by defining BOOT_LITTLE_ENDIAN_UUID from make.conf(5) if it is necessary. - Replace overly ambitious optimizations with more readable code. - Update comments to SMBIOS Specification v2.6 and clean up style(9) bugs. Modified: head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/smbios.c Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Apr 7 17:24:25 2009 (r190813) +++ head/sys/boot/i386/libi386/Makefile Tue Apr 7 17:58:15 2009 (r190814) @@ -31,6 +31,10 @@ CFLAGS+= -DDISK_DEBUG .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+= -DSMBIOS_SERIAL_NUMBERS +.if defined(BOOT_LITTLE_ENDIAN_UUID) +# Use little-endian UUID format as defined in SMBIOS 2.6. +CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.endif .endif .if !defined(LOADER_NO_GPT_SUPPORT) Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Tue Apr 7 17:24:25 2009 (r190813) +++ head/sys/boot/i386/libi386/smbios.c Tue Apr 7 17:58:15 2009 (r190814) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "btxv86.h" #include "libi386.h" @@ -37,17 +38,18 @@ __FBSDID("$FreeBSD$"); * Detect SMBIOS and export information about the SMBIOS into the * environment. * - * System Management BIOS Reference Specification, v2.4 Final - * http://www.dmtf.org/standards/published_documents/DSP0134.pdf + * System Management BIOS Reference Specification, v2.6 Final + * http://www.dmtf.org/standards/published_documents/DSP0134_2.6.0.pdf */ /* - * Spec. 2.1.1 SMBIOS Structure Table Entry Point + * 2.1.1 SMBIOS Structure Table Entry Point * - * 'The SMBIOS Entry Point structure, described below, can be located by - * application software by searching for the anchor-string on paragraph - * (16-byte) boundaries within the physical memory address range - * 000F0000h to 000FFFFFh.' + * "On non-EFI systems, the SMBIOS Entry Point structure, described below, can + * be located by application software by searching for the anchor-string on + * paragraph (16-byte) boundaries within the physical memory address range + * 000F0000h to 000FFFFFh. This entry point encapsulates an intermediate anchor + * string that is used by some existing DMI browsers." */ #define SMBIOS_START 0xf0000 #define SMBIOS_LENGTH 0x10000 @@ -55,100 +57,174 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_SIG "_SM_" #define SMBIOS_DMI_SIG "_DMI_" +#define SMBIOS_GET8(base, off) (*(uint8_t *)((base) + (off))) +#define SMBIOS_GET16(base, off) (*(uint16_t *)((base) + (off))) +#define SMBIOS_GET32(base, off) (*(uint32_t *)((base) + (off))) + +#define SMBIOS_GETLEN(base) SMBIOS_GET8(base, 0x01) +#define SMBIOS_GETSTR(base) ((base) + SMBIOS_GETLEN(base)) + static uint32_t smbios_enabled_memory = 0; static uint32_t smbios_old_enabled_memory = 0; static uint8_t smbios_enabled_sockets = 0; static uint8_t smbios_populated_sockets = 0; -static uint8_t *smbios_parse_table(const uint8_t *dmi); -static void smbios_setenv(const char *name, const uint8_t *dmi, - const int offset); -static uint8_t smbios_checksum(const caddr_t addr, const uint8_t len); -static uint8_t *smbios_sigsearch(const caddr_t addr, const uint32_t len); +static uint8_t +smbios_checksum(const caddr_t addr, const uint8_t len) +{ + uint8_t sum; + int i; -#ifdef SMBIOS_SERIAL_NUMBERS -static void smbios_setuuid(const char *name, const uint8_t *dmi, - const int offset); -#endif + for (sum = 0, i = 0; i < len; i++) + sum += SMBIOS_GET8(addr, i); + return (sum); +} -void -smbios_detect(void) +static caddr_t +smbios_sigsearch(const caddr_t addr, const uint32_t len) { - uint8_t *smbios, *dmi, *addr; - uint16_t i, length, count; - uint32_t paddr; - char buf[16]; + caddr_t cp; - /* locate and validate the SMBIOS */ - smbios = smbios_sigsearch(PTOV(SMBIOS_START), SMBIOS_LENGTH); - if (smbios == NULL) - return; + /* Search on 16-byte boundaries. */ + for (cp = addr; cp < addr + len; cp += SMBIOS_STEP) + if (strncmp(cp, SMBIOS_SIG, 4) == 0 && + smbios_checksum(cp, SMBIOS_GET8(cp, 0x05)) == 0 && + strncmp(cp + 0x10, SMBIOS_DMI_SIG, 5) == 0 && + smbios_checksum(cp + 0x10, 0x0f) == 0) + return (cp); + return (NULL); +} - length = *(uint16_t *)(smbios + 0x16); /* Structure Table Length */ - paddr = *(uint32_t *)(smbios + 0x18); /* Structure Table Address */ - count = *(uint16_t *)(smbios + 0x1c); /* No of SMBIOS Structures */ - - for (dmi = addr = PTOV(paddr), i = 0; - dmi - addr < length && i < count; i++) - dmi = smbios_parse_table(dmi); - if (smbios_enabled_memory > 0 || smbios_old_enabled_memory > 0) { - sprintf(buf, "%u", smbios_enabled_memory > 0 ? - smbios_enabled_memory : smbios_old_enabled_memory); - setenv("smbios.memory.enabled", buf, 1); +static void +smbios_setenv(const char *name, caddr_t addr, const int offset) +{ + caddr_t cp; + int i, idx; + + idx = SMBIOS_GET8(addr, offset); + if (idx != 0) { + cp = SMBIOS_GETSTR(addr); + for (i = 1; i < idx; i++) + cp += strlen(cp) + 1; + setenv(name, cp, 1); } - if (smbios_enabled_sockets > 0) { - sprintf(buf, "%u", smbios_enabled_sockets); - setenv("smbios.socket.enabled", buf, 1); +} + +#ifdef SMBIOS_SERIAL_NUMBERS + +#define UUID_SIZE 16 +#define UUID_TYPE uint32_t +#define UUID_STEP sizeof(UUID_TYPE) +#define UUID_ALL_BITS (UUID_SIZE / UUID_STEP) +#define UUID_GET(base, off) (*(UUID_TYPE *)((base) + (off))) + +static void +smbios_setuuid(const char *name, const caddr_t addr, const int ver) +{ + char uuid[37]; + int i, ones, zeros; + UUID_TYPE n; + uint32_t f1; + uint16_t f2, f3; + + for (i = 0, ones = 0, zeros = 0; i < UUID_SIZE; i += UUID_STEP) { + n = UUID_GET(addr, i) + 1; + if (zeros == 0 && n == 0) + ones++; + else if (ones == 0 && n == 1) + zeros++; + else + break; } - if (smbios_populated_sockets > 0) { - sprintf(buf, "%u", smbios_populated_sockets); - setenv("smbios.socket.populated", buf, 1); + + if (ones != UUID_ALL_BITS && zeros != UUID_ALL_BITS) { + /* + * 3.3.2.1 System UUID + * + * "Although RFC 4122 recommends network byte order for all + * fields, the PC industry (including the ACPI, UEFI, and + * Microsoft specifications) has consistently used + * little-endian byte encoding for the first three fields: + * time_low, time_mid, time_hi_and_version. The same encoding, + * also known as wire format, should also be used for the + * SMBIOS representation of the UUID." + * + * Note: We use network byte order for backward compatibility + * unless SMBIOS version is 2.6+ or little-endian is forced. + */ +#ifndef SMBIOS_LITTLE_ENDIAN_UUID + if (ver < 0x0206) { + f1 = ntohl(SMBIOS_GET32(addr, 0)); + f2 = ntohs(SMBIOS_GET16(addr, 4)); + f3 = ntohs(SMBIOS_GET16(addr, 6)); + } else +#endif + { + f1 = le32toh(SMBIOS_GET32(addr, 0)); + f2 = le16toh(SMBIOS_GET16(addr, 4)); + f3 = le16toh(SMBIOS_GET16(addr, 6)); + } + sprintf(uuid, + "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + f1, f2, f3, SMBIOS_GET8(addr, 8), SMBIOS_GET8(addr, 9), + SMBIOS_GET8(addr, 10), SMBIOS_GET8(addr, 11), + SMBIOS_GET8(addr, 12), SMBIOS_GET8(addr, 13), + SMBIOS_GET8(addr, 14), SMBIOS_GET8(addr, 15)); + setenv(name, uuid, 1); } } -static uint8_t * -smbios_parse_table(const uint8_t *dmi) +#undef UUID_SIZE +#undef UUID_TYPE +#undef UUID_STEP +#undef UUID_ALL_BITS +#undef UUID_GET + +#endif + +static caddr_t +smbios_parse_table(const caddr_t addr, const int ver) { - uint8_t *dp; - uint16_t size; - uint8_t osize; - - switch(dmi[0]) { - case 0: /* Type 0: BIOS */ - smbios_setenv("smbios.bios.vendor", dmi, 0x04); - smbios_setenv("smbios.bios.version", dmi, 0x05); - smbios_setenv("smbios.bios.reldate", dmi, 0x08); + caddr_t cp; + int proc, size, osize, type; + + type = SMBIOS_GET8(addr, 0); /* 3.1.2 Structure Header Format */ + switch(type) { + case 0: /* 3.3.1 BIOS Information (Type 0) */ + smbios_setenv("smbios.bios.vendor", addr, 0x04); + smbios_setenv("smbios.bios.version", addr, 0x05); + smbios_setenv("smbios.bios.reldate", addr, 0x08); break; - case 1: /* Type 1: System */ - smbios_setenv("smbios.system.maker", dmi, 0x04); - smbios_setenv("smbios.system.product", dmi, 0x05); - smbios_setenv("smbios.system.version", dmi, 0x06); + case 1: /* 3.3.2 System Information (Type 1) */ + smbios_setenv("smbios.system.maker", addr, 0x04); + smbios_setenv("smbios.system.product", addr, 0x05); + smbios_setenv("smbios.system.version", addr, 0x06); #ifdef SMBIOS_SERIAL_NUMBERS - smbios_setenv("smbios.system.serial", dmi, 0x07); - smbios_setuuid("smbios.system.uuid", dmi, 0x08); + smbios_setenv("smbios.system.serial", addr, 0x07); + smbios_setuuid("smbios.system.uuid", addr + 0x08, ver); #endif break; - case 2: /* Type 2: Base Board (or Module) */ - smbios_setenv("smbios.planar.maker", dmi, 0x04); - smbios_setenv("smbios.planar.product", dmi, 0x05); - smbios_setenv("smbios.planar.version", dmi, 0x06); + case 2: /* 3.3.3 Base Board (or Module) Information (Type 2) */ + smbios_setenv("smbios.planar.maker", addr, 0x04); + smbios_setenv("smbios.planar.product", addr, 0x05); + smbios_setenv("smbios.planar.version", addr, 0x06); #ifdef SMBIOS_SERIAL_NUMBERS - smbios_setenv("smbios.planar.serial", dmi, 0x07); + smbios_setenv("smbios.planar.serial", addr, 0x07); #endif break; - case 3: /* Type 3: System Enclosure or Chassis */ - smbios_setenv("smbios.chassis.maker", dmi, 0x04); - smbios_setenv("smbios.chassis.version", dmi, 0x06); + case 3: /* 3.3.4 System Enclosure or Chassis (Type 3) */ + smbios_setenv("smbios.chassis.maker", addr, 0x04); + smbios_setenv("smbios.chassis.version", addr, 0x06); #ifdef SMBIOS_SERIAL_NUMBERS - smbios_setenv("smbios.chassis.serial", dmi, 0x07); - smbios_setenv("smbios.chassis.tag", dmi, 0x08); + smbios_setenv("smbios.chassis.serial", addr, 0x07); + smbios_setenv("smbios.chassis.tag", addr, 0x08); #endif break; - case 4: /* Type 4: Processor Information */ + case 4: /* 3.3.5 Processor Information (Type 4) */ /* * Offset 18h: Processor Status * @@ -166,13 +242,14 @@ smbios_parse_table(const uint8_t *dmi) * 5-6h - Reserved * 7h - Other */ - if ((dmi[0x18] & 0x07) == 1) + proc = SMBIOS_GET8(addr, 0x18); + if ((proc & 0x07) == 1) smbios_enabled_sockets++; - if (dmi[0x18] & 0x40) + if ((proc & 0x40) != 0) smbios_populated_sockets++; break; - case 6: /* Type 6: Memory Module Information (Obsolete) */ + case 6: /* 3.3.7 Memory Module Information (Type 6, Obsolete) */ /* * Offset 0Ah: Enabled Size * @@ -185,12 +262,12 @@ smbios_parse_table(const uint8_t *dmi) * has been enabled * 7Fh - Not installed */ - osize = dmi[0x0a] & 0x7f; + osize = SMBIOS_GET8(addr, 0x0a) & 0x7f; if (osize > 0 && osize < 22) - smbios_old_enabled_memory += (1U << (osize + 10)); + smbios_old_enabled_memory += 1 << (osize + 10); break; - case 17: /* Type 17: Memory Device */ + case 17: /* 3.3.18 Memory Device (Type 17) */ /* * Offset 0Ch: Size * @@ -199,99 +276,72 @@ smbios_parse_table(const uint8_t *dmi) * 0 - Value is in megabytes units * Bit 14:0 Size */ - size = *(uint16_t *)(dmi + 0x0c); + size = SMBIOS_GET16(addr, 0x0c); if (size != 0 && size != 0xffff) smbios_enabled_memory += (size & 0x8000) != 0 ? - (size & 0x7fff) : ((uint32_t)size << 10); + (size & 0x7fff) : (size << 10); break; - default: /* skip other types */ + default: /* skip other types */ break; } - /* find structure terminator */ - dp = __DECONST(uint8_t *, dmi + dmi[1]); - while (dp[0] != 0 || dp[1] != 0) - dp++; + /* Find structure terminator. */ + cp = SMBIOS_GETSTR(addr); + while (SMBIOS_GET16(cp, 0) != 0) + cp++; - return(dp + 2); + return (cp + 2); } -static void -smbios_setenv(const char *name, const uint8_t *dmi, const int offset) +void +smbios_detect(void) { - char *cp = __DECONST(char *, dmi + dmi[1]); - int i; + char buf[16]; + caddr_t addr, dmi, smbios; + size_t count, length; + uint32_t paddr; + int i, major, minor, ver; - /* skip undefined string */ - if (dmi[offset] == 0) + /* Search signatures and validate checksums. */ + smbios = smbios_sigsearch(PTOV(SMBIOS_START), SMBIOS_LENGTH); + if (smbios == NULL) return; - for (i = 0; i < dmi[offset] - 1; i++) - cp += strlen(cp) + 1; - setenv(name, cp, 1); -} - -static uint8_t -smbios_checksum(const caddr_t addr, const uint8_t len) -{ - const uint8_t *cp = addr; - uint8_t sum; - int i; - - for (sum = 0, i = 0; i < len; i++) - sum += cp[i]; - - return(sum); -} - -static uint8_t * -smbios_sigsearch(const caddr_t addr, const uint32_t len) -{ - caddr_t cp; - - /* search on 16-byte boundaries */ - for (cp = addr; cp < addr + len; cp += SMBIOS_STEP) { - /* compare signature, validate checksum */ - if (!strncmp(cp, SMBIOS_SIG, 4)) { - if (smbios_checksum(cp, *(uint8_t *)(cp + 0x05))) - continue; - if (strncmp(cp + 0x10, SMBIOS_DMI_SIG, 5)) - continue; - if (smbios_checksum(cp + 0x10, 0x0f)) - continue; - - return(cp); - } + length = SMBIOS_GET16(smbios, 0x16); /* Structure Table Length */ + paddr = SMBIOS_GET32(smbios, 0x18); /* Structure Table Address */ + count = SMBIOS_GET16(smbios, 0x1c); /* No of SMBIOS Structures */ + ver = SMBIOS_GET8(smbios, 0x1e); /* SMBIOS BCD Revision */ + + if (ver != 0) { + major = ver >> 4; + minor = ver & 0x0f; + if (major > 9 || minor > 9) + ver = 0; } + if (ver == 0) { + major = SMBIOS_GET8(smbios, 0x06); /* SMBIOS Major Version */ + minor = SMBIOS_GET8(smbios, 0x07); /* SMBIOS Minor Version */ + } + ver = (major << 8) | minor; - return(NULL); -} + addr = PTOV(paddr); + for (dmi = addr, i = 0; dmi < addr + length && i < count; i++) + dmi = smbios_parse_table(dmi, ver); -#ifdef SMBIOS_SERIAL_NUMBERS -static void -smbios_setuuid(const char *name, const uint8_t *dmi, const int offset) -{ - const uint8_t *idp = dmi + offset; - int i, f = 0, z = 0; - char uuid[37]; - - for (i = 0; i < 16; i++) { - if (idp[i] == 0xff) - f++; - else if (idp[i] == 0x00) - z++; - else - break; + sprintf(buf, "%d.%d", major, minor); + setenv("smbios.version", buf, 1); + if (smbios_enabled_memory > 0 || smbios_old_enabled_memory > 0) { + sprintf(buf, "%u", smbios_enabled_memory > 0 ? + smbios_enabled_memory : smbios_old_enabled_memory); + setenv("smbios.memory.enabled", buf, 1); } - if (f != 16 && z != 16) { - sprintf(uuid, "%02x%02x%02x%02x-" - "%02x%02x-%02x%02x-%02x%02x-" - "%02x%02x%02x%02x%02x%02x", - idp[0], idp[1], idp[2], idp[3], - idp[4], idp[5], idp[6], idp[7], idp[8], idp[9], - idp[10], idp[11], idp[12], idp[13], idp[14], idp[15]); - setenv(name, uuid, 1); + if (smbios_enabled_sockets > 0) { + sprintf(buf, "%u", smbios_enabled_sockets); + setenv("smbios.socket.enabled", buf, 1); + } + if (smbios_populated_sockets > 0) { + sprintf(buf, "%u", smbios_populated_sockets); + setenv("smbios.socket.populated", buf, 1); } } -#endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:06:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81EC210656FA; Tue, 7 Apr 2009 19:06:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2C98FC13; Tue, 7 Apr 2009 19:06:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37J6qHa021915; Tue, 7 Apr 2009 19:06:52 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37J6qcE021913; Tue, 7 Apr 2009 19:06:52 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200904071906.n37J6qcE021913@svn.freebsd.org> From: Rick Macklem Date: Tue, 7 Apr 2009 19:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190815 - head/sys/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:06:53 -0000 Author: rmacklem Date: Tue Apr 7 19:06:51 2009 New Revision: 190815 URL: http://svn.freebsd.org/changeset/base/190815 Log: Adding sys/nfs/nfssvc.h and sys/nfs/nfs_nfssvc.c in preparation for sharing of the nfssvc() system call between nfsserver and the nfsv4 server. Building of nfs_nfssvc.c will be committed later, at the time the .c files in sys/nfsserver are updated. To do so now would result in nfssvc() multiply defined. Submitted by: rmacklem Reviewed by: dfr Approved by: kib (mentor) Added: head/sys/nfs/nfs_nfssvc.c (contents, props changed) head/sys/nfs/nfssvc.h (contents, props changed) Added: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/nfs/nfs_nfssvc.c Tue Apr 7 19:06:51 2009 (r190815) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_nfs.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +static int nfssvc_offset = SYS_nfssvc; +static struct sysent nfssvc_prev_sysent; +MAKE_SYSENT(nfssvc); + +/* + * This tiny module simply handles the nfssvc() system call. The other + * nfs modules that use the system call register themselves by setting + * the nfsd_call_xxx function pointers non-NULL. + */ + +int (*nfsd_call_nfsserver)(struct thread *, struct nfssvc_args *) = NULL; +int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *) = NULL; +int (*nfsd_call_nfscl)(struct thread *, struct nfssvc_args *) = NULL; +int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *) = NULL; + +/* + * Nfs server psuedo system call for the nfsd's + */ +int +nfssvc(struct thread *td, struct nfssvc_args *uap) +{ + int error; + + KASSERT(!mtx_owned(&Giant), ("nfssvc(): called with Giant")); + + AUDIT_ARG(cmd, uap->flag); + + error = priv_check(td, PRIV_NFS_DAEMON); + if (error) + return (error); + error = EINVAL; + if ((uap->flag & (NFSSVC_ADDSOCK | NFSSVC_OLDNFSD | NFSSVC_NFSD)) && + nfsd_call_nfsserver != NULL) + error = (*nfsd_call_nfsserver)(td, uap); + else if ((uap->flag & (NFSSVC_CBADDSOCK | NFSSVC_NFSCBD)) && + nfsd_call_nfscl != NULL) + error = (*nfsd_call_nfscl)(td, uap); + else if ((uap->flag & (NFSSVC_IDNAME | NFSSVC_GETSTATS | + NFSSVC_GSSDADDPORT | NFSSVC_GSSDADDFIRST | NFSSVC_GSSDDELETEALL | + NFSSVC_NFSUSERDPORT | NFSSVC_NFSUSERDDELPORT)) && + nfsd_call_nfscommon != NULL) + error = (*nfsd_call_nfscommon)(td, uap); + else if ((uap->flag & (NFSSVC_NFSDNFSD | NFSSVC_NFSDADDSOCK | + NFSSVC_PUBLICFH | NFSSVC_V4ROOTEXPORT | NFSSVC_NOPUBLICFH | + NFSSVC_STABLERESTART | NFSSVC_ADMINREVOKE | + NFSSVC_DUMPCLIENTS | NFSSVC_DUMPLOCKS)) && + nfsd_call_nfsd != NULL) + error = (*nfsd_call_nfsd)(td, uap); + if (error == EINTR || error == ERESTART) + error = 0; + return (error); +} + +/* + * Called once to initialize data structures... + */ +static int +nfssvc_modevent(module_t mod, int type, void *data) +{ + static int registered; + int error = 0; + + switch (type) { + case MOD_LOAD: + error = syscall_register(&nfssvc_offset, &nfssvc_sysent, + &nfssvc_prev_sysent); + if (error) + break; + registered = 1; + break; + + case MOD_UNLOAD: + if (nfsd_call_nfsserver != NULL || nfsd_call_nfscommon != NULL + || nfsd_call_nfscl != NULL || nfsd_call_nfsd != NULL) { + error = EBUSY; + break; + } + if (registered) + syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); + registered = 0; + break; + default: + error = EOPNOTSUPP; + break; + } + return error; +} +static moduledata_t nfssvc_mod = { + "nfssvc", + nfssvc_modevent, + NULL, +}; +DECLARE_MODULE(nfssvc, nfssvc_mod, SI_SUB_VFS, SI_ORDER_ANY); + +/* So that loader and kldload(2) can find us, wherever we are.. */ +MODULE_VERSION(nfssvc, 1); + Added: head/sys/nfs/nfssvc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/nfs/nfssvc.h Tue Apr 7 19:06:51 2009 (r190815) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1989, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NFS_NFSSVC_H_ +#define _NFS_NFSSVC_H_ + +/* + * Flags for nfssvc() system call. + */ +#define NFSSVC_OLDNFSD 0x004 +#define NFSSVC_ADDSOCK 0x008 +#define NFSSVC_NFSD 0x010 + +/* + * and ones for nfsv4. + */ +#define NFSSVC_NOPUBLICFH 0x00000020 +#define NFSSVC_STABLERESTART 0x00000040 +#define NFSSVC_NFSDNFSD 0x00000080 +#define NFSSVC_NFSDADDSOCK 0x00000100 +#define NFSSVC_IDNAME 0x00000200 +#define NFSSVC_GSSDDELETEALL 0x00000400 +#define NFSSVC_GSSDADDPORT 0x00000800 +#define NFSSVC_NFSUSERDPORT 0x00001000 +#define NFSSVC_NFSUSERDDELPORT 0x00002000 +#define NFSSVC_V4ROOTEXPORT 0x00004000 +#define NFSSVC_ADMINREVOKE 0x00008000 +#define NFSSVC_DUMPCLIENTS 0x00010000 +#define NFSSVC_DUMPLOCKS 0x00020000 +#define NFSSVC_GSSDADDFIRST 0x00040000 +#define NFSSVC_PUBLICFH 0x00080000 +#define NFSSVC_NFSCBD 0x00100000 +#define NFSSVC_CBADDSOCK 0x00200000 +#define NFSSVC_GETSTATS 0x00400000 + +#endif /* _NFS_NFSSVC_H */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:31:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E60C1065707; Tue, 7 Apr 2009 19:31:37 +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 E4B2A8FC08; Tue, 7 Apr 2009 19:31:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37JVaBP023275; Tue, 7 Apr 2009 19:31:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37JVai9023274; Tue, 7 Apr 2009 19:31:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904071931.n37JVai9023274@svn.freebsd.org> From: Ed Schouten Date: Tue, 7 Apr 2009 19:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190817 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:32:04 -0000 Author: ed Date: Tue Apr 7 19:31:36 2009 New Revision: 190817 URL: http://svn.freebsd.org/changeset/base/190817 Log: Don't explicitly force ecx to be used for MSR_FSBASE/MSR_GSBASE. Because the "c" input constaint is used, the compiler will already place the MSR_FSBASE/MSR_GSBASE constants in ecx. Using __asm("ecx") makes LLVM crash. Even though this is also an LLVM bug, we'd better remove the unnecessary GCCism as well. Submitted by: Christoph Mallon Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Apr 7 19:18:02 2009 (r190816) +++ head/sys/amd64/include/cpufunc.h Tue Apr 7 19:31:36 2009 (r190817) @@ -535,12 +535,9 @@ cpu_mwait(int extensions, int hints) static __inline void load_fs(u_int sel) { - register u_int32_t fsbase __asm("ecx"); - /* Preserve the fsbase value across the selector load */ - fsbase = MSR_FSBASE; - __asm __volatile("rdmsr; mov %0,%%fs; wrmsr" - : : "rm" (sel), "c" (fsbase) : "eax", "edx"); + __asm __volatile("rdmsr; mov %0,%%fs; wrmsr" + : : "rm" (sel), "c" (MSR_FSBASE) : "eax", "edx"); } #ifndef MSR_GSBASE @@ -549,16 +546,13 @@ load_fs(u_int sel) static __inline void load_gs(u_int sel) { - register u_int32_t gsbase __asm("ecx"); - /* * Preserve the gsbase value across the selector load. * Note that we have to disable interrupts because the gsbase * being trashed happens to be the kernel gsbase at the time. */ - gsbase = MSR_GSBASE; - __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" - : : "rm" (sel), "c" (gsbase) : "eax", "edx"); + __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" + : : "rm" (sel), "c" (MSR_GSBASE) : "eax", "edx"); } #else /* Usable by userland */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:35:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46770106568E; Tue, 7 Apr 2009 19:35:21 +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 34D118FC17; Tue, 7 Apr 2009 19:35:21 +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 n37JZLDa023550; Tue, 7 Apr 2009 19:35:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37JZL3x023549; Tue, 7 Apr 2009 19:35:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904071935.n37JZL3x023549@svn.freebsd.org> From: Ed Schouten Date: Tue, 7 Apr 2009 19:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190818 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:35:22 -0000 Author: ed Date: Tue Apr 7 19:35:20 2009 New Revision: 190818 URL: http://svn.freebsd.org/changeset/base/190818 Log: Add parentheses to under-parenthesized macro. Submitted by: Christoph Mallon Modified: head/sys/net/if_spppsubr.c Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Tue Apr 7 19:31:36 2009 (r190817) +++ head/sys/net/if_spppsubr.c Tue Apr 7 19:35:20 2009 (r190818) @@ -239,7 +239,7 @@ struct cp { #define SPPP_LOCK(sp) mtx_lock (&(sp)->mtx) #define SPPP_UNLOCK(sp) mtx_unlock (&(sp)->mtx) #define SPPP_LOCK_ASSERT(sp) mtx_assert (&(sp)->mtx, MA_OWNED) -#define SPPP_LOCK_OWNED(sp) mtx_owned (&sp->mtx) +#define SPPP_LOCK_OWNED(sp) mtx_owned (&(sp)->mtx) #ifdef INET /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:44:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7821065670; Tue, 7 Apr 2009 19:44:07 +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 2B8798FC14; Tue, 7 Apr 2009 19:44:07 +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 n37Ji7Hv024128; Tue, 7 Apr 2009 19:44:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37Ji70Q024127; Tue, 7 Apr 2009 19:44:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904071944.n37Ji70Q024127@svn.freebsd.org> From: Ed Schouten Date: Tue, 7 Apr 2009 19:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190820 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:44:07 -0000 Author: ed Date: Tue Apr 7 19:44:06 2009 New Revision: 190820 URL: http://svn.freebsd.org/changeset/base/190820 Log: Improve clarity: if (a && (b ? b : c)) -> if (a && (b || c)) Submitted by: Christoph Mallon Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Tue Apr 7 19:35:41 2009 (r190819) +++ head/sys/dev/ata/ata-queue.c Tue Apr 7 19:44:06 2009 (r190820) @@ -444,8 +444,7 @@ ata_completed(void *context, int dummy) } if (!request->result && - (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? - request->u.atapi.sense.key & ATA_SENSE_KEY_MASK : + (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK || request->error)) request->result = EIO; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:49:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9741B1065673; Tue, 7 Apr 2009 19:49:38 +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 84B3E8FC19; Tue, 7 Apr 2009 19:49:38 +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 n37Jncxb024496; Tue, 7 Apr 2009 19:49:38 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37Jnc9g024492; Tue, 7 Apr 2009 19:49:38 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <200904071949.n37Jnc9g024492@svn.freebsd.org> From: Max Khon Date: Tue, 7 Apr 2009 19:49: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: r190821 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:49:39 -0000 Author: fjoe Date: Tue Apr 7 19:49:38 2009 New Revision: 190821 URL: http://svn.freebsd.org/changeset/base/190821 Log: Avoid infinite loops when remaking makefiles not only for Makefile targets but also for targets they depend on. Modified: head/usr.bin/make/globals.h head/usr.bin/make/main.c head/usr.bin/make/make.1 head/usr.bin/make/make.c Modified: head/usr.bin/make/globals.h ============================================================================== --- head/usr.bin/make/globals.h Tue Apr 7 19:44:06 2009 (r190820) +++ head/usr.bin/make/globals.h Tue Apr 7 19:49:38 2009 (r190821) @@ -81,6 +81,7 @@ extern Boolean noExecute; /* True if sho extern Boolean allPrecious; /* True if every target is precious */ extern Boolean is_posix; /* .POSIX target seen */ extern Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */ +extern Boolean remakingMakefiles; /* True if remaking makefiles is in progress */ /* True if should continue on unaffected portions of the graph * when have an error in one portion */ Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Tue Apr 7 19:44:06 2009 (r190820) +++ head/usr.bin/make/main.c Tue Apr 7 19:49:38 2009 (r190821) @@ -124,6 +124,7 @@ Lst create = Lst_Initializer(create); Boolean allPrecious; /* .PRECIOUS given on line by itself */ Boolean is_posix; /* .POSIX target seen */ Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */ +Boolean remakingMakefiles; /* True if remaking makefiles is in progress */ Boolean beSilent; /* -s flag */ Boolean beVerbose; /* -v flag */ Boolean beQuiet; /* -Q flag */ @@ -732,41 +733,6 @@ Remake_Makefiles(void) Suff_FindDeps(gn); /* - * ! dependencies as well as - * dependencies with .FORCE, .EXEC and .PHONY attributes - * are skipped to prevent infinite loops - */ - if (gn->type & (OP_FORCE | OP_EXEC | OP_PHONY)) { - DEBUGF(MAKE, ("skipping (force, exec or phony).\n", - gn->name)); - continue; - } - - /* - * Skip :: targets that have commands and no children - * because such targets are always out-of-date - */ - if ((gn->type & OP_DOUBLEDEP) && - !Lst_IsEmpty(&gn->commands) && - Lst_IsEmpty(&gn->children)) { - DEBUGF(MAKE, ("skipping (doubledep, no sources " - "and has commands).\n")); - continue; - } - - /* - * Skip targets without sources and without commands - */ - if (Lst_IsEmpty(&gn->commands) && - Lst_IsEmpty(&gn->children)) { - DEBUGF(MAKE, - ("skipping (no sources and no commands).\n")); - continue; - } - - DEBUGF(MAKE, ("\n")); - - /* * -t, -q and -n has no effect unless the makefile is * specified as one of the targets explicitly in the * command line @@ -787,7 +753,9 @@ Remake_Makefiles(void) * Check and remake the makefile */ mtime = Dir_MTime(gn); + remakingMakefiles = TRUE; Compat_Make(gn, gn); + remakingMakefiles = FALSE; /* * Restore -t, -q and -n behaviour Modified: head/usr.bin/make/make.1 ============================================================================== --- head/usr.bin/make/make.1 Tue Apr 7 19:44:06 2009 (r190820) +++ head/usr.bin/make/make.1 Tue Apr 7 19:49:38 2009 (r190821) @@ -1629,7 +1629,7 @@ To prevent infinite loops the following .Bl -bullet .It .Ic :: -targets that have no prerequisites but have commands +targets that have no prerequisites .It .Ic ! targets Modified: head/usr.bin/make/make.c ============================================================================== --- head/usr.bin/make/make.c Tue Apr 7 19:44:06 2009 (r190820) +++ head/usr.bin/make/make.c Tue Apr 7 19:49:38 2009 (r190821) @@ -211,11 +211,15 @@ Make_OODate(GNode *gn) } else { DEBUGF(MAKE, (".EXEC node...")); } - oodate = TRUE; - } else if ((gn->mtime < gn->cmtime) || - ((gn->cmtime == 0) && - ((gn->mtime==0) || (gn->type & OP_DOUBLEDEP)))) { + if (remakingMakefiles) { + DEBUGF(MAKE, ("skipping (remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } + } else if (gn->mtime < gn->cmtime || + (gn->cmtime == 0 && (gn->mtime == 0 || (gn->type & OP_DOUBLEDEP)))) { /* * A node whose modification time is less than that of its * youngest child or that has no children (cmtime == 0) and @@ -226,12 +230,24 @@ Make_OODate(GNode *gn) if (gn->mtime < gn->cmtime) { DEBUGF(MAKE, ("modified before source (%s)...", gn->cmtime_gn ? gn->cmtime_gn->path : "???")); + oodate = TRUE; } else if (gn->mtime == 0) { DEBUGF(MAKE, ("non-existent and no sources...")); + if (remakingMakefiles && Lst_IsEmpty(&gn->commands)) { + DEBUGF(MAKE, ("skipping (no commands and remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } } else { DEBUGF(MAKE, (":: operator and no sources...")); + if (remakingMakefiles) { + DEBUGF(MAKE, ("skipping (remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } } - oodate = TRUE; } else oodate = FALSE; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 19:53:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B5E91065686; Tue, 7 Apr 2009 19:53:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 395D18FC26; Tue, 7 Apr 2009 19:53:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37JrbAt024785; Tue, 7 Apr 2009 19:53:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37JrbmQ024784; Tue, 7 Apr 2009 19:53:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200904071953.n37JrbmQ024784@svn.freebsd.org> From: Christian Brueffer Date: Tue, 7 Apr 2009 19: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: r190822 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 19:53:38 -0000 Author: brueffer Date: Tue Apr 7 19:53:36 2009 New Revision: 190822 URL: http://svn.freebsd.org/changeset/base/190822 Log: Move an "end list" macro to the right place. Found by: man2hwnotes.pl MFC after: 3 days Modified: head/share/man/man4/wpi.4 Modified: head/share/man/man4/wpi.4 ============================================================================== --- head/share/man/man4/wpi.4 Tue Apr 7 19:49:38 2009 (r190821) +++ head/share/man/man4/wpi.4 Tue Apr 7 19:53:36 2009 (r190822) @@ -116,11 +116,11 @@ unload/reload the driver to continue. .It "wpi%d: Radio transmitter is switched off" The hardware switch controlling the radio is currently turned off. Data transmission is not possible in this state. +.El .Sh BUGS Not all the error messages are documented here. .Pp Background scanning is not currently supported. -.El .Sh SEE ALSO .Xr wpifw 4 , .Xr pci 4 , From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:00:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BEE10656BA; Tue, 7 Apr 2009 20:00:21 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0680F8FC2F; Tue, 7 Apr 2009 20:00:21 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37K0Kvl025325; Tue, 7 Apr 2009 20:00:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37K0Ke3025324; Tue, 7 Apr 2009 20:00:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200904072000.n37K0Ke3025324@svn.freebsd.org> From: Christian Brueffer Date: Tue, 7 Apr 2009 20:00: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: r190823 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:00:22 -0000 Author: brueffer Date: Tue Apr 7 20:00:20 2009 New Revision: 190823 URL: http://svn.freebsd.org/changeset/base/190823 Log: Mdoc cleanup. Prompted by: man2hwnotes.pl MFC after: 3 days Modified: head/share/man/man4/man4.powerpc/pmu.4 Modified: head/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/pmu.4 Tue Apr 7 19:53:36 2009 (r190822) +++ head/share/man/man4/man4.powerpc/pmu.4 Tue Apr 7 20:00:20 2009 (r190823) @@ -43,15 +43,14 @@ kernel configuration file: The .Nm driver provides support for the Power Management Unit (PMU) found in Apple -Core99 hardware. This includes late G3 laptops, all G4 machines, early G5 +Core99 hardware. +This includes late G3 laptops, all G4 machines, early G5 desktops and all G5 XServes. -.Ed .Pp The Apple PMU controller is a multi-purpose ASIC that provides power management and thermal control, as well as an ADB bus for the internal keyboard and mouse on laptops. .Sh HARDWARE -.Pp Chips supported by the .Nm driver include: @@ -62,13 +61,13 @@ Apple KeyLargo PMU .It Apple K2-KeyLargo PMU .El -.Pp .Sh SYSCTL VARIABLES The .Nm driver provides power management services in addition to an .Xr adb 4 -interface. The following sysctls can be used to control the +interface. +The following sysctls can be used to control the power management behavior and to examine current system power and thermal conditions. .Bl -tag -width indent @@ -84,7 +83,8 @@ The current battery charge, in milliamp .It Va dev.pmu.%d.batteries.%d.maxcharge The battery's self-reported maximum charge, in milliamp hours. .It Va dev.pmu.%d.batteries.%d.rate -The current into the battery, in milliamps. While the battery is discharging, +The current into the battery, in milliamps. +While the battery is discharging, this will be negative. .It Va dev.pmu.%d.batteries.%d.voltage Battery voltage, in millivolts. @@ -92,9 +92,10 @@ Battery voltage, in millivolts. Estimated time until full battery charge (or discharge), in minutes. .It Va dev.pmu.%d.batteries.%d.life Current fraction of the battery's maximum charge, in percent. +.El .Sh SEE ALSO -.Xr adb 4 , -.Xr acpi 4 +.Xr acpi 4 , +.Xr adb 4 .Sh HISTORY The .Nm @@ -111,4 +112,4 @@ driver was written by .Aq macallan@NetBSD.org and ported to FreeBSD by .An Nathan Whitehorn -.Aq nwhitehorn@freebsd.org . +.Aq nwhitehorn@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:11:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32BCF1065673; Tue, 7 Apr 2009 20:11:03 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 202278FC12; Tue, 7 Apr 2009 20:11:03 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37KB3Vp025839; Tue, 7 Apr 2009 20:11:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KB3mB025838; Tue, 7 Apr 2009 20:11:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200904072011.n37KB3mB025838@svn.freebsd.org> From: Christian Brueffer Date: Tue, 7 Apr 2009 20:11: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: r190824 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:11:04 -0000 Author: brueffer Date: Tue Apr 7 20:11:02 2009 New Revision: 190824 URL: http://svn.freebsd.org/changeset/base/190824 Log: Reword the HARDWARE section so uath(4) can actually be recognized in the hardware notes on the website. While here sort SEE ALSO. Modified: head/share/man/man4/uath.4 Modified: head/share/man/man4/uath.4 ============================================================================== --- head/share/man/man4/uath.4 Tue Apr 7 20:00:20 2009 (r190823) +++ head/share/man/man4/uath.4 Tue Apr 7 20:11:02 2009 (r190824) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2009 +.Dd April 7, 2009 .Dt UATH 4 .Os .Sh NAME @@ -80,7 +80,9 @@ when the device is inserted. includes the firmware in the binary program. This firmware is licensed for general use and is included in the base system. .Sh HARDWARE -The following adapters should work: +The +.Nm +driver should work with the following adapters: .Pp .Bl -column -compact "TRENDware International TEW-444UB" "AR5005UX" -offset 6n .It Em "Adapter Chipset" @@ -162,8 +164,8 @@ This should not happen. .Xr wlan_tkip 4 , .Xr wlan_wep 4 , .Xr devd 8 , -.Xr uathload 8 , .Xr ifconfig 8 , +.Xr uathload 8 , .Xr wpa_supplicant 8 . .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:12:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7F35106564A; Tue, 7 Apr 2009 20:12:15 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5DBA8FC16; Tue, 7 Apr 2009 20:12:15 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37KCFmU025933; Tue, 7 Apr 2009 20:12:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KCFce025932; Tue, 7 Apr 2009 20:12:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200904072012.n37KCFce025932@svn.freebsd.org> From: Christian Brueffer Date: Tue, 7 Apr 2009 20:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190825 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:12:16 -0000 Author: brueffer Date: Tue Apr 7 20:12:15 2009 New Revision: 190825 URL: http://svn.freebsd.org/changeset/base/190825 Log: Autogenerate hardware notes for the uath(4) driver. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Apr 7 20:11:02 2009 (r190824) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Apr 7 20:12:15 2009 (r190825) @@ -858,6 +858,8 @@ &hwlist.rum; + &hwlist.uath; + &hwlist.upgt; &hwlist.ural; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:13:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8991065672; Tue, 7 Apr 2009 20:13:49 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F318FC08; Tue, 7 Apr 2009 20:13:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37KDmdL026061; Tue, 7 Apr 2009 20:13:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KDmIp026060; Tue, 7 Apr 2009 20:13:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200904072013.n37KDmIp026060@svn.freebsd.org> From: Christian Brueffer Date: Tue, 7 Apr 2009 20:13: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: r190826 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:13:49 -0000 Author: brueffer Date: Tue Apr 7 20:13:48 2009 New Revision: 190826 URL: http://svn.freebsd.org/changeset/base/190826 Log: Remove superfluous dot. Modified: head/share/man/man4/uath.4 Modified: head/share/man/man4/uath.4 ============================================================================== --- head/share/man/man4/uath.4 Tue Apr 7 20:12:15 2009 (r190825) +++ head/share/man/man4/uath.4 Tue Apr 7 20:13:48 2009 (r190826) @@ -166,7 +166,7 @@ This should not happen. .Xr devd 8 , .Xr ifconfig 8 , .Xr uathload 8 , -.Xr wpa_supplicant 8 . +.Xr wpa_supplicant 8 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:15:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C4710656C6; Tue, 7 Apr 2009 20:15:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650E68FC08; Tue, 7 Apr 2009 20:15:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37KFpHe026170; Tue, 7 Apr 2009 20:15:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KFpYY026169; Tue, 7 Apr 2009 20:15:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200904072015.n37KFpYY026169@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Apr 2009 20:15: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: r190827 - head/contrib/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:15:52 -0000 Author: emaste Date: Tue Apr 7 20:15:51 2009 New Revision: 190827 URL: http://svn.freebsd.org/changeset/base/190827 Log: - Use gdb-* glob instead of gdb-6.1.1, to simplify future imports. - Add a few entries for additional files from later gdb releases that should also be ignored. Modified: head/contrib/gdb/FREEBSD-Xlist Modified: head/contrib/gdb/FREEBSD-Xlist ============================================================================== --- head/contrib/gdb/FREEBSD-Xlist Tue Apr 7 20:13:48 2009 (r190826) +++ head/contrib/gdb/FREEBSD-Xlist Tue Apr 7 20:15:51 2009 (r190827) @@ -1,60 +1,69 @@ $FreeBSD$ -gdb-6.1.1/bfd/* -gdb-6.1.1/config/* -gdb-6.1.1/etc/* -gdb-6.1.1/gdb/avr* -gdb-6.1.1/gdb/config/avr/* -gdb-6.1.1/gdb/config/cris/* -gdb-6.1.1/gdb/config/d10v/* -gdb-6.1.1/gdb/config/djgpp/* -gdb-6.1.1/gdb/config/frv/* -gdb-6.1.1/gdb/config/h8300/* -gdb-6.1.1/gdb/config/m32r/* -gdb-6.1.1/gdb/config/m68hc11/* -gdb-6.1.1/gdb/config/m68k/* -gdb-6.1.1/gdb/config/mcore/* -gdb-6.1.1/gdb/config/mn10300/* -gdb-6.1.1/gdb/config/ns32k/* -gdb-6.1.1/gdb/config/pa/* -gdb-6.1.1/gdb/config/sh/* -gdb-6.1.1/gdb/config/v850/* -gdb-6.1.1/gdb/config/vax/* -gdb-6.1.1/gdb/config/xstormy16/* -gdb-6.1.1/gdb/cris* -gdb-6.1.1/gdb/d10v* -gdb-6.1.1/gdb/frv* -gdb-6.1.1/gdb/h8300* -gdb-6.1.1/gdb/*m32r* -gdb-6.1.1/gdb/m68* -gdb-6.1.1/gdb/mcore* -gdb-6.1.1/gdb/mn10300* -gdb-6.1.1/gdb/nlm/* -gdb-6.1.1/gdb/ns32k* -gdb-6.1.1/gdb/osf-share/* -gdb-6.1.1/gdb/hppa* -gdb-6.1.1/gdb/rdi-share/* -gdb-6.1.1/gdb/sh* -gdb-6.1.1/gdb/testsuite/* -gdb-6.1.1/gdb/v850* -gdb-6.1.1/gdb/vax* -gdb-6.1.1/gdb/vx-share/* -gdb-6.1.1/gdb/xstormy16* -gdb-6.1.1/include/aout/* -gdb-6.1.1/include/coff/* -gdb-6.1.1/include/elf/* -gdb-6.1.1/include/mpw/* -gdb-6.1.1/include/nlm/* -gdb-6.1.1/include/opcode/* -gdb-6.1.1/intl/* -gdb-6.1.1/libiberty/* -gdb-6.1.1/mmalloc/* -gdb-6.1.1/opcodes/* -gdb-6.1.1/readline/* -gdb-6.1.1/sim/* -gdb-6.1.1/texinfo/* -gdb-6.1.1/utils/* +gdb-*/bfd/* +gdb-*/config/* +gdb-*/etc/* +gdb-*/gdb/avr* +gdb-*/gdb/config/avr/* +gdb-*/gdb/config/cris/* +gdb-*/gdb/config/d10v/* +gdb-*/gdb/config/djgpp/* +gdb-*/gdb/config/frv/* +gdb-*/gdb/config/h8300/* +gdb-*/gdb/config/m32r/* +gdb-*/gdb/config/m68hc11/* +gdb-*/gdb/config/m68k/* +gdb-*/gdb/config/mcore/* +gdb-*/gdb/config/mn10300/* +gdb-*/gdb/config/ns32k/* +gdb-*/gdb/config/pa/* +gdb-*/gdb/config/sh/* +gdb-*/gdb/config/v850/* +gdb-*/gdb/config/vax/* +gdb-*/gdb/config/xstormy16/* +gdb-*/gdb/cris* +gdb-*/gdb/d10v* +gdb-*/gdb/frv* +gdb-*/gdb/h8300* +gdb-*/gdb/iq2000* +gdb-*/gdb/i386nbsd* +gdb-*/gdb/m32c* +gdb-*/gdb/*m32r* +gdb-*/gdb/m68* +gdb-*/gdb/m88* +gdb-*/gdb/mcore* +gdb-*/gdb/mn10300* +gdb-*/gdb/mt-* +gdb-*/gdb/nlm/* +gdb-*/gdb/ns32k* +gdb-*/gdb/osf-share/* +gdb-*/gdb/ppcobsd* +gdb-*/gdb/hppa* +gdb-*/gdb/rdi-share/* +gdb-*/gdb/sh* +gdb-*/gdb/testsuite/* +gdb-*/gdb/v850* +gdb-*/gdb/vax* +gdb-*/gdb/vx-share/* +gdb-*/gdb/xstormy16* +gdb-*/gdb/xtensa* +gdb-*/include/aout/* +gdb-*/include/coff/* +gdb-*/include/elf/* +gdb-*/include/mpw/* +gdb-*/include/nlm/* +gdb-*/include/opcode/* +gdb-*/intl/* +gdb-*/libiberty/* +gdb-*/mmalloc/* +gdb-*/opcodes/* +gdb-*/readline/* +gdb-*/regformats/reg-cris* +gdb-*/sim/* +gdb-*/texinfo/* +gdb-*/utils/* *ChangeLog* *Makefile* +*TODO* *aix* *config.* *configure* @@ -63,4 +72,6 @@ gdb-6.1.1/utils/* *interix* *irix* *linux* +*mingw* *osf1* +*win32* From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:34:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C15106564A; Tue, 7 Apr 2009 20:34:35 +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 E95068FC15; Tue, 7 Apr 2009 20:34:34 +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 n37KYYNJ027076; Tue, 7 Apr 2009 20:34:34 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KYY6J027072; Tue, 7 Apr 2009 20:34:34 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200904072034.n37KYY6J027072@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 7 Apr 2009 20:34: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: r190828 - head/libexec/ftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:34:35 -0000 Author: obrien Date: Tue Apr 7 20:34:34 2009 New Revision: 190828 URL: http://svn.freebsd.org/changeset/base/190828 Log: Move variable externs into extern.h so they are checked against the definitions. Modified: head/libexec/ftpd/extern.h head/libexec/ftpd/ftpcmd.y head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/extern.h ============================================================================== --- head/libexec/ftpd/extern.h Tue Apr 7 20:15:51 2009 (r190827) +++ head/libexec/ftpd/extern.h Tue Apr 7 20:34:34 2009 (r190828) @@ -73,6 +73,35 @@ void yyerror(char *); int yyparse(void); int ls_main(int, char **); +extern int assumeutf8; +extern char cbuf[]; +extern union sockunion data_dest; +extern int epsvall; +extern int form; +extern int ftpdebug; +extern int guest; +extern union sockunion his_addr; +extern char *homedir; +extern int hostinfo; +extern char *hostname; +extern int maxtimeout; +extern int logged_in; +extern int logging; +extern int noepsv; +extern int noguestretr; +extern int noretr; +extern int paranoid; +extern struct passwd *pw; +extern int pdata; +extern char proctitle[]; +extern int readonly; +extern off_t restart_point; +extern int timeout; +extern char tmpline[]; +extern int type; +extern char *typenames[]; /* defined in included from ftpd.c */ +extern int usedefault; + struct sockaddr_in; struct sockaddr_in6; union sockunion { Modified: head/libexec/ftpd/ftpcmd.y ============================================================================== --- head/libexec/ftpd/ftpcmd.y Tue Apr 7 20:15:51 2009 (r190827) +++ head/libexec/ftpd/ftpcmd.y Tue Apr 7 20:34:34 2009 (r190828) @@ -76,31 +76,6 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -extern union sockunion data_dest, his_addr; -extern int hostinfo; -extern int logged_in; -extern struct passwd *pw; -extern int guest; -extern char *homedir; -extern int paranoid; -extern int logging; -extern int type; -extern int form; -extern int ftpdebug; -extern int timeout; -extern int maxtimeout; -extern int pdata; -extern char *hostname; -extern char proctitle[]; -extern int usedefault; -extern char tmpline[]; -extern int readonly; -extern int assumeutf8; -extern int noepsv; -extern int noretr; -extern int noguestretr; -extern char *typenames[]; /* defined in included from ftpd.c */ - off_t restart_point; static int cmd_type; @@ -110,8 +85,6 @@ static int state; char cbuf[512]; char *fromname = NULL; -extern int epsvall; - %} %union { Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Tue Apr 7 20:15:51 2009 (r190827) +++ head/libexec/ftpd/ftpd.c Tue Apr 7 20:34:34 2009 (r190828) @@ -105,9 +105,6 @@ __FBSDID("$FreeBSD$"); static char version[] = "Version 6.00LS"; #undef main -extern off_t restart_point; -extern char cbuf[]; - union sockunion ctrl_addr; union sockunion data_source; union sockunion data_dest; From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 20:58:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07461065675; Tue, 7 Apr 2009 20:58:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1598FC41; Tue, 7 Apr 2009 20:58:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37KwuAk028383; Tue, 7 Apr 2009 20:58:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37KwuPs028382; Tue, 7 Apr 2009 20:58:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904072058.n37KwuPs028382@svn.freebsd.org> From: Robert Watson Date: Tue, 7 Apr 2009 20:58: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: r190829 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 20:58:58 -0000 Author: rwatson Date: Tue Apr 7 20:58:56 2009 New Revision: 190829 URL: http://svn.freebsd.org/changeset/base/190829 Log: Nul-terminate strings in the VFS name cache, which negligibly change the size and cost of name cache entries, but make adding debugging and tracing easier. Add SDT DTrace probes for various namecache events: vfs:namecache:enter:done - new entry in the name cache, passed parent directory vnode pointer, name added to the cache, and child vnode pointer. vfs:namecache:enter_negative:done - new negative entry in the name cache, passed parent vnode pointer, name added to the cache. vfs:namecache:fullpath:enter - call to vn_fullpath1() is made, passed the vnode to resolve to a name. vfs:namecache:fullpath:hit - vn_fullpath1() successfully resolved a search for the parent of an object using the namecache, passed the discovered parent directory vnode pointer, name, and child vnode pointer. vfs:namecache:fullpath:miss - vn_fullpath1() failed to resolve a search for the parent of an object using the namecache, passed the child vnode pointer. vfs:namecache:fullpath:return - vn_fullpath1() has completed, passed the error number, and if that is zero, the vnode to resolve, and the returned path. vfs:namecache:lookup:hit - postive name cache entry hit, passed the parent directory vnode pointer, name, and child vnode pointer. vfs:namecache:lookup:hit_negative - negative name cache entry hit, passed the parent directory vnode pointer and name. vfs:namecache:lookup:miss - name cache miss, passed the parent directory pointer and the full remaining component name (not terminated after the cache miss component). vfs:namecache:purge:done - name cache purge for a vnode, passed the vnode pointer to purge. vfs:namecache:purge_negative:done - name cache purge of negative entries for children of a vnode, passed the vnode pointer to purge. vfs:namecache:purgevfs - name cache purge for a mountpoint, passed the mount pointer. Separate probes will also be invoked for each cache entry zapped. vfs:namecache:zap:done - name cache entry zapped, passed the parent directory vnode pointer, name, and child vnode pointer. vfs:namecache:zap_negative:done - negative name cache entry zapped, passed the parent directory vnode pointer and name. For any probes involving an extant name cache entry (enter, hit, zapp), we use the nul-terminated string for the name component. For misses, the remainder of the path, including later components, is provided as an argument instead since there is no handy nul-terminated version of the string around. This is arguably a bug. MFC after: 1 month Sponsored by: Google, Inc. Reviewed by: jhb, kan, kib (earlier version) Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Apr 7 20:34:34 2009 (r190828) +++ head/sys/kern/vfs_cache.c Tue Apr 7 20:58:56 2009 (r190829) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -58,6 +60,31 @@ __FBSDID("$FreeBSD$"); #include +SDT_PROVIDER_DECLARE(vfs); +SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", + "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", + "char *"); +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *", + "struct char *", "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int", "struct vnode *", + "struct char *"); +SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *", + "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, "struct vnode *", + "char *"); +SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *", + "char *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", + "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", + "char *"); + /* * This structure describes the elements in the cache of recent * names looked up by namei. @@ -71,7 +98,7 @@ struct namecache { struct vnode *nc_vp; /* vnode the name refers to */ u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ - char nc_name[0]; /* segment name */ + char nc_name[0]; /* segment name + nul */ }; /* @@ -133,9 +160,10 @@ RW_SYSINIT(vfscache, &cache_lock, "Name static uma_zone_t cache_zone_small; static uma_zone_t cache_zone_large; -#define CACHE_PATH_CUTOFF 32 -#define CACHE_ZONE_SMALL (sizeof(struct namecache) + CACHE_PATH_CUTOFF) -#define CACHE_ZONE_LARGE (sizeof(struct namecache) + NAME_MAX) +#define CACHE_PATH_CUTOFF 35 +#define CACHE_ZONE_SMALL (sizeof(struct namecache) + CACHE_PATH_CUTOFF \ + + 1) +#define CACHE_ZONE_LARGE (sizeof(struct namecache) + NAME_MAX + 1) #define cache_alloc(len) uma_zalloc(((len) <= CACHE_PATH_CUTOFF) ? \ cache_zone_small : cache_zone_large, M_WAITOK) @@ -291,6 +319,15 @@ cache_zap(ncp) rw_assert(&cache_lock, RA_WLOCKED); CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); +#ifdef KDTRACE_HOOKS + if (ncp->nc_vp != NULL) { + SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp, + ncp->nc_name, ncp->nc_vp, 0, 0); + } else { + SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp, + ncp->nc_name, 0, 0, 0); + } +#endif vp = NULL; LIST_REMOVE(ncp, nc_hash); if (ncp->nc_flag & NCF_ISDOTDOT) { @@ -361,12 +398,17 @@ retry_wlocked: CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .", dvp, cnp->cn_nameptr); dothits++; + SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".", + *vpp, 0, 0); goto success; } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { dotdothits++; - if (dvp->v_cache_dd == NULL) + if (dvp->v_cache_dd == NULL) { + SDT_PROBE(vfs, namecache, lookup, miss, dvp, + "..", NULL, 0, 0); goto unlock; + } if ((cnp->cn_flags & MAKEENTRY) == 0) { if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) cache_zap(dvp->v_cache_dd); @@ -379,6 +421,8 @@ retry_wlocked: *vpp = dvp->v_cache_dd->nc_dvp; CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); + SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", + *vpp, 0, 0); goto success; } } @@ -394,6 +438,8 @@ retry_wlocked: /* We failed to find an entry */ if (ncp == NULL) { + SDT_PROBE(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, + NULL, 0, 0); if ((cnp->cn_flags & MAKEENTRY) == 0) { nummisszap++; } else { @@ -421,6 +467,8 @@ retry_wlocked: *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", dvp, cnp->cn_nameptr, *vpp, ncp); + SDT_PROBE(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + *vpp, 0, 0); goto success; } @@ -449,6 +497,8 @@ retry_wlocked: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; + SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, ncp->nc_name, + 0, 0, 0); CACHE_WUNLOCK(); return (ENOENT); @@ -579,6 +629,8 @@ cache_enter(dvp, vp, cnp) } } dvp->v_cache_dd = NULL; + SDT_PROBE(vfs, namecache, enter, done, dvp, "..", vp, + 0, 0); CACHE_WUNLOCK(); flag = NCF_ISDOTDOT; } @@ -597,7 +649,7 @@ cache_enter(dvp, vp, cnp) ncp->nc_flag = flag; len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); - bcopy(cnp->cn_nameptr, ncp->nc_name, len); + strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); hash = fnv_32_buf(&dvp, sizeof(dvp), hash); CACHE_WLOCK(); @@ -667,8 +719,12 @@ cache_enter(dvp, vp, cnp) */ if (vp) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); + SDT_PROBE(vfs, namecache, enter, done, dvp, ncp->nc_name, vp, + 0, 0); } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); + SDT_PROBE(vfs, namecache, enter_negative, done, dvp, + ncp->nc_name, 0, 0, 0); } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); @@ -709,6 +765,7 @@ cache_purge(vp) { CTR1(KTR_VFS, "cache_purge(%p)", vp); + SDT_PROBE(vfs, namecache, purge, done, vp, 0, 0, 0, 0); CACHE_WLOCK(); while (!LIST_EMPTY(&vp->v_cache_src)) cache_zap(LIST_FIRST(&vp->v_cache_src)); @@ -733,6 +790,7 @@ cache_purge_negative(vp) struct namecache *cp, *ncp; CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); + SDT_PROBE(vfs, namecache, purge_negative, done, vp, 0, 0, 0, 0); CACHE_WLOCK(); LIST_FOREACH_SAFE(cp, &vp->v_cache_src, nc_src, ncp) { if (cp->nc_vp == NULL) @@ -752,6 +810,7 @@ cache_purgevfs(mp) struct namecache *ncp, *nnp; /* Scan hash tables for applicable entries */ + SDT_PROBE(vfs, namecache, purgevfs, done, mp, 0, 0, 0, 0); CACHE_WLOCK(); for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) { LIST_FOREACH_SAFE(ncp, ncpp, nc_hash, nnp) { @@ -998,6 +1057,9 @@ vn_fullpath1(struct thread *td, struct v char *bp; int error, i, slash_prefixed; struct namecache *ncp; +#ifdef KDTRACE_HOOKS + struct vnode *startvp = vp; +#endif buflen--; bp = buf + buflen; @@ -1005,6 +1067,7 @@ vn_fullpath1(struct thread *td, struct v error = 0; slash_prefixed = 0; + SDT_PROBE(vfs, namecache, fullpath, entry, vp, 0, 0, 0, 0); CACHE_RLOCK(); numfullpathcalls++; if (vp->v_type != VDIR) { @@ -1016,18 +1079,31 @@ vn_fullpath1(struct thread *td, struct v if (bp == buf) { numfullpathfail4++; CACHE_RUNLOCK(); - return (ENOMEM); + error = ENOMEM; + SDT_PROBE(vfs, namecache, fullpath, return, + error, startvp, NULL, 0, 0); + return (error); } + SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, + ncp->nc_name, vp, 0, 0); vp = ncp->nc_dvp; } else { + SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, + 0, 0); error = vn_vptocnp(&vp, &bp, buf, &buflen); - if (error) + if (error) { + SDT_PROBE(vfs, namecache, fullpath, return, + error, startvp, NULL, 0, 0); return (error); + } } if (buflen <= 0) { numfullpathfail4++; CACHE_RUNLOCK(); - return (ENOMEM); + error = ENOMEM; + SDT_PROBE(vfs, namecache, fullpath, return, error, + startvp, NULL, 0, 0); + return (error); } *--bp = '/'; buflen--; @@ -1062,8 +1138,12 @@ vn_fullpath1(struct thread *td, struct v error = ENOMEM; break; } + SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, + ncp->nc_name, vp, 0, 0); vp = ncp->nc_dvp; } else { + SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, + 0, 0); error = vn_vptocnp(&vp, &bp, buf, &buflen); if (error) break; @@ -1078,12 +1158,17 @@ vn_fullpath1(struct thread *td, struct v buflen--; slash_prefixed = 1; } - if (error) + if (error) { + SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, + NULL, 0, 0); return (error); + } if (!slash_prefixed) { if (bp == buf) { numfullpathfail4++; CACHE_RUNLOCK(); + SDT_PROBE(vfs, namecache, fullpath, return, 0, + startvp, bp, 0, 0); return (ENOMEM); } else *--bp = '/'; @@ -1091,6 +1176,7 @@ vn_fullpath1(struct thread *td, struct v numfullpathfound++; CACHE_RUNLOCK(); + SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, bp, 0, 0); *retbuf = bp; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 22:20:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9E4C106564A; Tue, 7 Apr 2009 22:20:58 +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 9DDB58FC12; Tue, 7 Apr 2009 22:20:58 +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 n37MKwsA032529; Tue, 7 Apr 2009 22:20:58 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37MKwuP032525; Tue, 7 Apr 2009 22:20:58 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904072220.n37MKwuP032525@svn.freebsd.org> From: Robert Noland Date: Tue, 7 Apr 2009 22:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190831 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 22:20:59 -0000 Author: rnoland Date: Tue Apr 7 22:20:58 2009 New Revision: 190831 URL: http://svn.freebsd.org/changeset/base/190831 Log: Add regs required for occlusion queries support Submitted by: Maciej Cencora MFC after: 3 days Modified: head/sys/dev/drm/r300_cmdbuf.c head/sys/dev/drm/r300_reg.h head/sys/dev/drm/radeon_cp.c head/sys/dev/drm/radeon_drv.h Modified: head/sys/dev/drm/r300_cmdbuf.c ============================================================================== --- head/sys/dev/drm/r300_cmdbuf.c Tue Apr 7 20:59:13 2009 (r190830) +++ head/sys/dev/drm/r300_cmdbuf.c Tue Apr 7 22:20:58 2009 (r190831) @@ -208,6 +208,10 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE(0x42C0, 2); ADD_RANGE(R300_RS_CNTL_0, 2); + ADD_RANGE(R300_SU_REG_DEST, 1); + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) + ADD_RANGE(RV530_FG_ZBREG_DEST, 1); + ADD_RANGE(R300_SC_HYPERZ, 2); ADD_RANGE(0x43E8, 1); @@ -233,6 +237,7 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE(R300_ZB_DEPTHPITCH, 1); ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); + ADD_RANGE(R300_ZB_ZPASS_DATA, 2); /* ZB_ZPASS_DATA, ZB_ZPASS_ADDR */ ADD_RANGE(R300_TX_FILTER_0, 16); ADD_RANGE(R300_TX_FILTER1_0, 16); Modified: head/sys/dev/drm/r300_reg.h ============================================================================== --- head/sys/dev/drm/r300_reg.h Tue Apr 7 20:59:13 2009 (r190830) +++ head/sys/dev/drm/r300_reg.h Tue Apr 7 22:20:58 2009 (r190831) @@ -1776,6 +1776,11 @@ __FBSDID("$FreeBSD$"); #define R500_RB3D_COLOR_CLEAR_VALUE_AR 0x46c0 #define R500_RB3D_CONSTANT_COLOR_AR 0x4ef8 +#define R300_SU_REG_DEST 0x42c8 +#define RV530_FG_ZBREG_DEST 0x4be8 +#define R300_ZB_ZPASS_DATA 0x4f58 +#define R300_ZB_ZPASS_ADDR 0x4f5c + #endif /* _R300_REG_H */ /* *INDENT-ON* */ Modified: head/sys/dev/drm/radeon_cp.c ============================================================================== --- head/sys/dev/drm/radeon_cp.c Tue Apr 7 20:59:13 2009 (r190830) +++ head/sys/dev/drm/radeon_cp.c Tue Apr 7 22:20:58 2009 (r190831) @@ -436,7 +436,7 @@ static void radeon_init_pipes(drm_radeon if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) { RADEON_WRITE_PLL(R500_DYN_SCLK_PWMEM_PIPE, (1 | ((gb_pipe_sel >> 8) & 0xf) << 4)); - RADEON_WRITE(R500_SU_REG_DEST, ((1 << dev_priv->num_gb_pipes) - 1)); + RADEON_WRITE(R300_SU_REG_DEST, ((1 << dev_priv->num_gb_pipes) - 1)); } RADEON_WRITE(R300_GB_TILE_CONFIG, gb_tile_config); radeon_do_wait_for_idle(dev_priv); Modified: head/sys/dev/drm/radeon_drv.h ============================================================================== --- head/sys/dev/drm/radeon_drv.h Tue Apr 7 20:59:13 2009 (r190830) +++ head/sys/dev/drm/radeon_drv.h Tue Apr 7 22:20:58 2009 (r190831) @@ -684,7 +684,6 @@ extern void r600_page_table_cleanup(stru /* pipe config regs */ #define R400_GB_PIPE_SELECT 0x402c #define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ -#define R500_SU_REG_DEST 0x42c8 #define R300_GB_TILE_CONFIG 0x4018 # define R300_ENABLE_TILING (1 << 0) # define R300_PIPE_COUNT_RV350 (0 << 1) From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 22:23:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D383E1065670; Tue, 7 Apr 2009 22:23: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 C27A28FC13; Tue, 7 Apr 2009 22:23: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 n37MNmpU032740; Tue, 7 Apr 2009 22:23:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37MNm0f032739; Tue, 7 Apr 2009 22:23:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904072223.n37MNm0f032739@svn.freebsd.org> From: Xin LI Date: Tue, 7 Apr 2009 22:23: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: r190832 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 22:23:49 -0000 Author: delphij Date: Tue Apr 7 22:23:48 2009 New Revision: 190832 URL: http://svn.freebsd.org/changeset/base/190832 Log: Add the following media types as supported by bce(4): - 1000BaseSX - 2500BaseSX While I'm there, correct 1000BaseTX as more standard 1000BaseT. MFC after: 3 days Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Tue Apr 7 22:20:58 2009 (r190831) +++ head/share/man/man4/bce.4 Tue Apr 7 22:23:48 2009 (r190832) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2009 +.Dd April 7, 2009 .Dt BCE 4 .Os .Sh NAME @@ -109,8 +109,18 @@ option can also be used to select either or .Cm half-duplex modes. -.It Cm 1000baseTX -Set 1000baseTX operation over twisted pair. +.It Cm 1000baseSX +Sets 1000Mbps operation. +Only +.Cm full-duplex +mode is supported at this speed. +.It Cm 1000baseT +Set 1000baseT operation over twisted pair. +Only +.Cm full-duplex +mode is supported. +.It Cm 2500BaseSX +Set 2500Mbps operation. Only .Cm full-duplex mode is supported. From owner-svn-src-head@FreeBSD.ORG Tue Apr 7 22:26:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24D211065673; Tue, 7 Apr 2009 22:26:54 +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 133D68FC1C; Tue, 7 Apr 2009 22:26:54 +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 n37MQrf2032921; Tue, 7 Apr 2009 22:26:53 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37MQrGB032920; Tue, 7 Apr 2009 22:26:53 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904072226.n37MQrGB032920@svn.freebsd.org> From: Robert Noland Date: Tue, 7 Apr 2009 22:26: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: r190833 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 22:26:54 -0000 Author: rnoland Date: Tue Apr 7 22:26:53 2009 New Revision: 190833 URL: http://svn.freebsd.org/changeset/base/190833 Log: check offsets for R300_ZB_ZPASS_ADDR Submitted by: Maciej Cencora MFC after: 3 days Modified: head/sys/dev/drm/r300_cmdbuf.c Modified: head/sys/dev/drm/r300_cmdbuf.c ============================================================================== --- head/sys/dev/drm/r300_cmdbuf.c Tue Apr 7 22:23:48 2009 (r190832) +++ head/sys/dev/drm/r300_cmdbuf.c Tue Apr 7 22:26:53 2009 (r190833) @@ -236,8 +236,11 @@ void r300_init_reg_flags(struct drm_devi ADD_RANGE_MARK(R300_ZB_DEPTHOFFSET, 1, MARK_CHECK_OFFSET); /* check offset */ ADD_RANGE(R300_ZB_DEPTHPITCH, 1); ADD_RANGE(R300_ZB_DEPTHCLEARVALUE, 1); - ADD_RANGE(R300_ZB_ZMASK_OFFSET, 13); - ADD_RANGE(R300_ZB_ZPASS_DATA, 2); /* ZB_ZPASS_DATA, ZB_ZPASS_ADDR */ + ADD_RANGE(R300_ZB_ZMASK_OFFSET, 5); + ADD_RANGE(R300_ZB_HIZ_OFFSET, 5); + ADD_RANGE(R300_ZB_ZPASS_DATA, 1); + ADD_RANGE_MARK(R300_ZB_ZPASS_ADDR, 1, MARK_CHECK_OFFSET); /* check offset */ + ADD_RANGE(R300_ZB_DEPTHXY_OFFSET, 1) ADD_RANGE(R300_TX_FILTER_0, 16); ADD_RANGE(R300_TX_FILTER1_0, 16); From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 00:14:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33962106564A; Wed, 8 Apr 2009 00:14:07 +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 2248E8FC16; Wed, 8 Apr 2009 00:14:07 +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 n380E6w4036713; Wed, 8 Apr 2009 00:14:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n380E6Fq036712; Wed, 8 Apr 2009 00:14:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904080014.n380E6Fq036712@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Apr 2009 00:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190834 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 00:14:07 -0000 Author: marcel Date: Wed Apr 8 00:14:06 2009 New Revision: 190834 URL: http://svn.freebsd.org/changeset/base/190834 Log: Fix hangs caused by hardware that signals receive errors (framing, parity, etc), but does not indicate characters being received. Since no chracters have been received, ignore the line errors. PR: 131006 MFC after: 3 days Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Tue Apr 7 22:26:53 2009 (r190833) +++ head/sys/dev/uart/uart_dev_ns8250.c Wed Apr 8 00:14:06 2009 (r190834) @@ -50,14 +50,16 @@ __FBSDID("$FreeBSD$"); static void ns8250_clrint(struct uart_bas *bas) { - uint8_t iir; + uint8_t iir, lsr; iir = uart_getreg(bas, REG_IIR); while ((iir & IIR_NOPEND) == 0) { iir &= IIR_IMASK; - if (iir == IIR_RLS) - (void)uart_getreg(bas, REG_LSR); - else if (iir == IIR_RXRDY || iir == IIR_RXTOUT) + if (iir == IIR_RLS) { + lsr = uart_getreg(bas, REG_LSR); + if (lsr & (LSR_BI|LSR_FE|LSR_PE)) + (void)uart_getreg(bas, REG_DATA); + } else if (iir == IIR_RXRDY || iir == IIR_RXTOUT) (void)uart_getreg(bas, REG_DATA); else if (iir == IIR_MLSC) (void)uart_getreg(bas, REG_MSR); @@ -587,7 +589,6 @@ ns8250_bus_ipend(struct uart_softc *sc) ipend = 0; if (iir & IIR_RXRDY) { lsr = uart_getreg(bas, REG_LSR); - uart_unlock(sc->sc_hwmtx); if (lsr & LSR_OE) ipend |= SER_INT_OVERRUN; if (lsr & LSR_BI) @@ -595,12 +596,14 @@ ns8250_bus_ipend(struct uart_softc *sc) if (lsr & LSR_RXRDY) ipend |= SER_INT_RXREADY; } else { - uart_unlock(sc->sc_hwmtx); if (iir & IIR_TXRDY) ipend |= SER_INT_TXIDLE; else ipend |= SER_INT_SIGCHG; } + if (ipend == 0) + ns8250_clrint(bas); + uart_unlock(sc->sc_hwmtx); return ((sc->sc_leaving) ? 0 : ipend); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 03:53:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10F271065708; Wed, 8 Apr 2009 03:53:21 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F37F98FC0A; Wed, 8 Apr 2009 03:53:20 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n383rK9m042536; Wed, 8 Apr 2009 03:53:20 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n383rKb1042535; Wed, 8 Apr 2009 03:53:20 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904080353.n383rKb1042535@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 8 Apr 2009 03:53: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: r190836 - head/usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 03:53:21 -0000 Author: weongyo Date: Wed Apr 8 03:53:20 2009 New Revision: 190836 URL: http://svn.freebsd.org/changeset/base/190836 Log: block build of uathload on ia64 temporarily because binutils expects machine-specific flags to match but ar5523.bin doesn't have. Pointed by: marcel Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Apr 8 02:04:07 2009 (r190835) +++ head/usr.sbin/Makefile Wed Apr 8 03:53:20 2009 (r190836) @@ -397,7 +397,9 @@ _crunch= crunch .endif .if ${MK_USB} != "no" +.if ${MACHINE_ARCH} != "ia64" _uathload= uathload +.endif #_usbdevs= usbdevs _usbconfig= usbconfig .endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 06:51:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40807106566B; Wed, 8 Apr 2009 06:51:59 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23ADB8FC0C; Wed, 8 Apr 2009 06:51:59 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n386pxAF047231; Wed, 8 Apr 2009 06:51:59 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n386pwCY047229; Wed, 8 Apr 2009 06:51:58 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904080651.n386pwCY047229@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 8 Apr 2009 06:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190838 - head/usr.sbin/uathload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 06:51:59 -0000 Author: weongyo Date: Wed Apr 8 06:51:58 2009 New Revision: 190838 URL: http://svn.freebsd.org/changeset/base/190838 Log: add uathload.8 Reviewed by: brueffer Added: head/usr.sbin/uathload/uathload.8 (contents, props changed) Modified: head/usr.sbin/uathload/Makefile Modified: head/usr.sbin/uathload/Makefile ============================================================================== --- head/usr.sbin/uathload/Makefile Wed Apr 8 04:30:16 2009 (r190837) +++ head/usr.sbin/uathload/Makefile Wed Apr 8 06:51:58 2009 (r190838) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= uathload -NO_MAN= +MAN= uathload.8 SRCS= uathload.c ar5523.bin Added: head/usr.sbin/uathload/uathload.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/uathload/uathload.8 Wed Apr 8 06:51:58 2009 (r190838) @@ -0,0 +1,69 @@ +.\" +.\" Copyright (c) 2009 Weongyo Jeong. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2009 +.Dt UATHLOAD 8 +.Os +.Sh NAME +.Nm uathload +.Nd "firmware loader for Atheros USB wireless driver" +.Sh SYNOPSIS +.Nm +.Op Fl v +.Op Fl d Ar ugen-device +.Op Ar firmware-file +.Sh DESCRIPTION +The +.Nm +utility provides a way to load the firmware for Atheros USB wireless +devices with AR5005UG and AR5005UX chipsets. +.Pp +The following options are accepted. +.Bl -tag -width ".Fl f Ar file" +.It Fl d Ar ugen-device +Use a specific +.Xr ugen 4 +device. +.It Fl v +Enable debugging messages. +.El +.Pp +If +.Ar firmware-file +is specified +.Nm +tries to load it instead of the built-in firmware image. +.Sh EXAMPLES +Load the built-in firmware image into a specific +.Xr ugen 4 +device: +.Pp +.Dl "uathload -d /dev/ugen0.2" +.Sh SEE ALSO +.Xr uath 4 +.Sh AUTHORS +.An Weongyo Jeong From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 09:02:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56CCB1065698; Wed, 8 Apr 2009 09:02:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 441738FC0A; Wed, 8 Apr 2009 09:02:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3892hwa050538; Wed, 8 Apr 2009 09:02:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3892huH050537; Wed, 8 Apr 2009 09:02:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200904080902.n3892huH050537@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 8 Apr 2009 09:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190839 - head/sys/fs/pseudofs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 09:02:44 -0000 Author: des Date: Wed Apr 8 09:02:42 2009 New Revision: 190839 URL: http://svn.freebsd.org/changeset/base/190839 Log: Remove spurious locking in pfs_write(). Reported by: Andrew Brampton MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Apr 8 06:51:58 2009 (r190838) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Apr 8 09:02:42 2009 (r190839) @@ -939,9 +939,7 @@ pfs_write(struct vop_write_args *va) } if (pn->pn_flags & PFS_RAWWR) { - pfs_lock(pn); error = pn_fill(curthread, proc, pn, NULL, uio); - pfs_unlock(pn); if (proc != NULL) PRELE(proc); PFS_RETURN (error); From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 11:35:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA2F106566B; Wed, 8 Apr 2009 11:35:47 +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 4DDD48FC17; Wed, 8 Apr 2009 11:35:47 +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 n38BZlgI057570; Wed, 8 Apr 2009 11:35:47 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38BZl1a057569; Wed, 8 Apr 2009 11:35:47 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200904081135.n38BZl1a057569@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 8 Apr 2009 11:35: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: r190840 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 11:35:48 -0000 Author: nyan Date: Wed Apr 8 11:35:47 2009 New Revision: 190840 URL: http://svn.freebsd.org/changeset/base/190840 Log: MFi386: revision 190617 Fill the fsbase and gsbase fields of the mcontext structure on i386. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Wed Apr 8 09:02:42 2009 (r190839) +++ head/sys/pc98/pc98/machdep.c Wed Apr 8 11:35:47 2009 (r190840) @@ -525,6 +525,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, struct sigacts *psp; char *sp; struct trapframe *regs; + struct segment_descriptor *sdp; int sig; int oonstack; @@ -561,6 +562,15 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); + /* + * Unconditionally fill the fsbase and gsbase into the mcontext. + */ + sdp = &td->td_pcb->pcb_gsd; + sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && @@ -2410,6 +2420,7 @@ int get_mcontext(struct thread *td, mcontext_t *mcp, int flags) { struct trapframe *tp; + struct segment_descriptor *sdp; tp = td->td_frame; @@ -2441,6 +2452,11 @@ get_mcontext(struct thread *td, mcontext mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); get_fpcontext(td, mcp); + sdp = &td->td_pcb->pcb_gsd; + mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 11:56:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260741065728; Wed, 8 Apr 2009 11:56:50 +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 128F98FC1D; Wed, 8 Apr 2009 11:56:50 +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 n38Bun4U058078; Wed, 8 Apr 2009 11:56:49 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38Bun91058068; Wed, 8 Apr 2009 11:56:49 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904081156.n38Bun91058068@svn.freebsd.org> From: Paolo Pisati Date: Wed, 8 Apr 2009 11: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: r190841 - in head/sys: . netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 11:56:51 -0000 Author: piso Date: Wed Apr 8 11:56:49 2009 New Revision: 190841 URL: http://svn.freebsd.org/changeset/base/190841 Log: -don't pass down, to module's fingerprint function, unused data like a pointer to the ip header. -style -spacing Modified: head/sys/ (props changed) head/sys/netinet/libalias/alias_cuseeme.c head/sys/netinet/libalias/alias_dummy.c head/sys/netinet/libalias/alias_ftp.c head/sys/netinet/libalias/alias_irc.c head/sys/netinet/libalias/alias_mod.c head/sys/netinet/libalias/alias_mod.h head/sys/netinet/libalias/alias_nbt.c head/sys/netinet/libalias/alias_pptp.c head/sys/netinet/libalias/alias_skinny.c head/sys/netinet/libalias/alias_smedia.c Modified: head/sys/netinet/libalias/alias_cuseeme.c ============================================================================== --- head/sys/netinet/libalias/alias_cuseeme.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_cuseeme.c Wed Apr 8 11:56:49 2009 (r190841) @@ -64,7 +64,7 @@ AliasHandleCUSeeMeIn(struct libalias *la struct in_addr original_addr); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->oaddr == NULL) Modified: head/sys/netinet/libalias/alias_dummy.c ============================================================================== --- head/sys/netinet/libalias/alias_dummy.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_dummy.c Wed Apr 8 11:56:49 2009 (r190841) @@ -60,7 +60,7 @@ static void AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { /* Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_ftp.c Wed Apr 8 11:56:49 2009 (r190841) @@ -104,7 +104,7 @@ AliasHandleFtpOut(struct libalias *, str int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || Modified: head/sys/netinet/libalias/alias_irc.c ============================================================================== --- head/sys/netinet/libalias/alias_irc.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_irc.c Wed Apr 8 11:56:49 2009 (r190841) @@ -93,7 +93,7 @@ AliasHandleIrcOut(struct libalias *, str int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_mod.c Wed Apr 8 11:56:49 2009 (r190841) @@ -133,9 +133,10 @@ handler_chain_destroy(void) static int _attach_handler(struct proto_handler *p) { - struct proto_handler *b = NULL; + struct proto_handler *b; - LIBALIAS_WLOCK_ASSERT(); + LIBALIAS_WLOCK_ASSERT(); + b = NULL; LIST_FOREACH(b, &handler_chain, entries) { if ((b->pri == p->pri) && (b->dir == p->dir) && @@ -172,10 +173,11 @@ _detach_handler(struct proto_handler *p) int LibAliasAttachHandlers(struct proto_handler *_p) { - int i, error = -1; + int i, error; LIBALIAS_WLOCK(); - for (i=0; 1; i++) { + error = -1; + for (i = 0; 1; i++) { if (*((int *)&_p[i]) == EOH) break; error = _attach_handler(&_p[i]); @@ -189,10 +191,11 @@ LibAliasAttachHandlers(struct proto_hand int LibAliasDetachHandlers(struct proto_handler *_p) { - int i, error = -1; + int i, error; LIBALIAS_WLOCK(); - for (i=0; 1; i++) { + error = -1; + for (i = 0; 1; i++) { if (*((int *)&_p[i]) == EOH) break; error = _detach_handler(&_p[i]); @@ -206,26 +209,27 @@ LibAliasDetachHandlers(struct proto_hand int detach_handler(struct proto_handler *_p) { - int error = -1; + int error; LIBALIAS_WLOCK(); + error = -1; error = _detach_handler(_p); LIBALIAS_WUNLOCK(); return (error); } int -find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, - struct alias_data *ad) +find_handler(int8_t dir, int8_t proto, struct libalias *la, __unused struct ip *pip, + struct alias_data *ad) { struct proto_handler *p; - int error = ENOENT; + int error; LIBALIAS_RLOCK(); - + error = ENOENT; LIST_FOREACH(p, &handler_chain, entries) { if ((p->dir & dir) && (p->proto & proto)) - if (p->fingerprint(la, pip, ad) == 0) { + if (p->fingerprint(la, ad) == 0) { error = p->protohandler(la, pip, ad); break; } @@ -259,9 +263,11 @@ attach_dll(struct dll *p) void * detach_dll(char *p) { - struct dll *b = NULL, *b_tmp; - void *error = NULL; + struct dll *b, *b_tmp; + void *error; + b = NULL; + error = NULL; SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp) if (!strncmp(b->name, p, DLL_LEN)) { SLIST_REMOVE(&dll_chain, b, dll, next); Modified: head/sys/netinet/libalias/alias_mod.h ============================================================================== --- head/sys/netinet/libalias/alias_mod.h Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_mod.h Wed Apr 8 11:56:49 2009 (r190841) @@ -80,10 +80,10 @@ struct proto_handler { u_int pri; /* Handler priority. */ int16_t dir; /* Flow direction. */ uint8_t proto; /* Working protocol. */ - int (*fingerprint)(struct libalias *la, /* Fingerprint * function. */ - struct ip *pip, struct alias_data *ah); - int (*protohandler)(struct libalias *la, /* Aliasing * function. */ - struct ip *pip, struct alias_data *ah); + int (*fingerprint)(struct libalias *, /* Fingerprint * function. */ + struct alias_data *); + int (*protohandler)(struct libalias *, /* Aliasing * function. */ + struct ip *, struct alias_data *); LIST_ENTRY(proto_handler) entries; }; Modified: head/sys/netinet/libalias/alias_nbt.c ============================================================================== --- head/sys/netinet/libalias/alias_nbt.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_nbt.c Wed Apr 8 11:56:49 2009 (r190841) @@ -77,7 +77,7 @@ static int AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *); static int -fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint1(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || @@ -98,7 +98,7 @@ protohandler1(struct libalias *la, struc } static int -fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint2(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || Modified: head/sys/netinet/libalias/alias_pptp.c ============================================================================== --- head/sys/netinet/libalias/alias_pptp.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_pptp.c Wed Apr 8 11:56:49 2009 (r190841) @@ -79,7 +79,7 @@ static int AliasHandlePptpGreIn(struct libalias *, struct ip *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) @@ -91,7 +91,7 @@ fingerprint(struct libalias *la, struct } static int -fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprintgre(struct libalias *la, struct alias_data *ah) { return (0); Modified: head/sys/netinet/libalias/alias_skinny.c ============================================================================== --- head/sys/netinet/libalias/alias_skinny.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_skinny.c Wed Apr 8 11:56:49 2009 (r190841) @@ -57,7 +57,7 @@ static void AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) Modified: head/sys/netinet/libalias/alias_smedia.c ============================================================================== --- head/sys/netinet/libalias/alias_smedia.c Wed Apr 8 11:35:47 2009 (r190840) +++ head/sys/netinet/libalias/alias_smedia.c Wed Apr 8 11:56:49 2009 (r190841) @@ -132,7 +132,7 @@ static void AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +fingerprint(struct libalias *la, struct alias_data *ah) { if (ah->dport != NULL && ah->aport != NULL && ah->sport != NULL && From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 12:49:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19933106566B; Wed, 8 Apr 2009 12:49:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1BB28FC0A; Wed, 8 Apr 2009 12:49:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38CnaPS059339; Wed, 8 Apr 2009 12:49:36 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38Cnaag059337; Wed, 8 Apr 2009 12:49:36 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904081249.n38Cnaag059337@svn.freebsd.org> From: Randall Stewart Date: Wed, 8 Apr 2009 12:49: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: r190842 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 12:49:37 -0000 Author: rrs Date: Wed Apr 8 12:49:36 2009 New Revision: 190842 URL: http://svn.freebsd.org/changeset/base/190842 Log: Add more padding and a new variable. This will help us be able to keep ABI compatibility between 8 and 9. MFC after: Never Modified: head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Wed Apr 8 11:56:49 2009 (r190841) +++ head/sys/netinet/sctp_sysctl.c Wed Apr 8 12:49:36 2009 (r190842) @@ -463,7 +463,7 @@ sctp_assoclist(SYSCTL_HANDLER_ARGS) xraddr.cwnd = net->cwnd; xraddr.flight_size = net->flight_size; xraddr.mtu = net->mtu; - /* xraddr.rtt = net->rtt; Not yet */ + xraddr.rtt = net->rtt; xraddr.start_time.tv_sec = (uint32_t) net->start_time.tv_sec; xraddr.start_time.tv_usec = (uint32_t) net->start_time.tv_usec; SCTP_INP_RUNLOCK(inp); Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Wed Apr 8 11:56:49 2009 (r190841) +++ head/sys/netinet/sctp_uio.h Wed Apr 8 12:49:36 2009 (r190842) @@ -986,7 +986,7 @@ struct xsctp_inpcb { uint16_t local_port; uint16_t qlen; uint16_t maxqlen; - uint32_t extra_padding[8]; /* future */ + uint32_t extra_padding[32]; /* future */ }; struct xsctp_tcb { @@ -1017,14 +1017,14 @@ struct xsctp_tcb { struct sctp_timeval discontinuity_time; /* sctpAssocEntry 17 */ uint32_t peers_rwnd; sctp_assoc_t assoc_id; /* sctpAssocEntry 1 */ - uint32_t extra_padding[8]; /* future */ + uint32_t extra_padding[32]; /* future */ }; struct xsctp_laddr { union sctp_sockstore address; /* sctpAssocLocalAddrEntry 1/2 */ uint32_t last; struct sctp_timeval start_time; /* sctpAssocLocalAddrEntry 3 */ - uint32_t extra_padding[8]; /* future */ + uint32_t extra_padding[32]; /* future */ }; struct xsctp_raddr { @@ -1041,8 +1041,8 @@ struct xsctp_raddr { uint8_t confirmed; /* */ uint8_t heartbeat_enabled; /* sctpAssocLocalRemEntry 4 */ struct sctp_timeval start_time; /* sctpAssocLocalRemEntry 8 */ - uint32_t extra_padding[8]; /* future */ - + uint32_t rtt; + uint32_t extra_padding[32]; /* future */ }; #define SCTP_MAX_LOGGING_SIZE 30000 From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 12:50:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3116910656D0 for ; Wed, 8 Apr 2009 12:50:23 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from contactlab34-bk-3.contactlab.it (contactlab34-bk-3.contactlab.it [93.94.34.3]) by mx1.freebsd.org (Postfix) with ESMTP id B1B0A8FC23 for ; Wed, 8 Apr 2009 12:50:22 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) DKIM-Signature: v=1; a=rsa-sha1; d=contactlab.it; s=s768; c=simple/simple; q=dns/txt; i=@contactlab.it; t=1239193712; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=dIU/hFccG1jBUVQtVkEPllwnrI4=; b=ZbeBJlC/vxUsPh6uXP5jXCvISopuRPd0/EYY7IlKImiKuprHtiZ/wP+KmqAGFA7j GiT3sHfKEOQoveqq9ROS0iuivlLLWN1YrHvcduHzXVKBWkAiDFmIb/AoYlrKQqkS; Received: from [213.92.0.53] ([213.92.0.53:53209] helo=mail0.tomato.it) by vmta3.contactlab.it (envelope-from ) (ecelerity 2.2.2.37 r(28822M)) with ESMTP id 1B/FC-11151-0789CD94; Wed, 08 Apr 2009 14:28:32 +0200 Received: from ferret.tomato.lan (fast.tomato.it [62.101.64.91]) by mail0.tomato.it (Postfix) with ESMTP id F18C72841D; Wed, 8 Apr 2009 14:29:05 +0200 (CEST) Message-ID: <49DC9865.7080303@oltrelinux.com> Date: Wed, 08 Apr 2009 14:28:21 +0200 From: Paolo Pisati User-Agent: Thunderbird 2.0.0.19 (X11/20090226) MIME-Version: 1.0 To: Andrew Thompson References: <200904052124.n35LOF7S034434@svn.freebsd.org> <20090406002229.GD52408@citylink.fud.org.nz> In-Reply-To: <20090406002229.GD52408@citylink.fud.org.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Paolo Pisati Subject: Re: svn commit: r190749 - in head/sys: dev/ata dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/quirk dev/usb/serial dev/usb/storage dev/usb/tem... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 12:50:23 -0000 Andrew Thompson wrote: > On Sun, Apr 05, 2009 at 09:24:15PM +0000, Paolo Pisati wrote: > >> Author: piso >> Date: Sun Apr 5 21:24:15 2009 >> New Revision: 190749 >> URL: http://svn.freebsd.org/changeset/base/190749 >> >> Log: >> Remove pointeless mergeinfo that crept in from r190633. >> > > Thanks! I was told this is a result of using 'svn mv' locally, can we > get instructions out about how to do this properly. > sorry, can't help you, but to revert the empty mergeinfo you have to: svn merge -c -$rev $file what i find annoying is the commit message left in the commit logs of the contaminated files, but i think it can't be fixed by normal users. -- bye, P. From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 12:52:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F241106566B; Wed, 8 Apr 2009 12:52:05 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636DF8FC25; Wed, 8 Apr 2009 12:52:05 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38Cq5xs059435; Wed, 8 Apr 2009 12:52:05 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38Cq5gd059433; Wed, 8 Apr 2009 12:52:05 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904081252.n38Cq5gd059433@svn.freebsd.org> From: Randall Stewart Date: Wed, 8 Apr 2009 12:52: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: r190843 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 12:52:06 -0000 Author: rrs Date: Wed Apr 8 12:52:05 2009 New Revision: 190843 URL: http://svn.freebsd.org/changeset/base/190843 Log: Fix a FR bug. When doing PR-SCTP with number rtx set to a low number. The check for skipping was in the incorrect place. Which meant we would FR chunks we should not. MFC after: 1 Month Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Apr 8 12:49:36 2009 (r190842) +++ head/sys/netinet/sctp_indata.c Wed Apr 8 12:52:05 2009 (r190843) @@ -3621,19 +3621,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t continue; } } - if ((PR_SCTP_RTX_ENABLED(tp1->flags)) && tp1->sent < SCTP_DATAGRAM_ACKED) { - /* Has it been retransmitted tv_sec times? */ - if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { - /* Yes, so drop it */ - if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), - SCTP_SO_NOT_LOCKED); - } - tp1 = TAILQ_NEXT(tp1, sctp_next); - continue; - } - } } if (compare_with_wrap(tp1->rec.data.TSN_seq, asoc->this_sack_highest_gap, MAX_TSN)) { @@ -3849,6 +3836,25 @@ sctp_strike_gap_ack_chunks(struct sctp_t /* Increment the count to resend */ struct sctp_nets *alt; + if ((stcb->asoc.peer_supports_prsctp) && + (PR_SCTP_RTX_ENABLED(tp1->flags))) { + /* + * Has it been retransmitted tv_sec times? - + * we store the retran count there. + */ + if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { + /* Yes, so drop it */ + if (tp1->data != NULL) { + (void)sctp_release_pr_sctp_chunk(stcb, tp1, + (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + SCTP_SO_NOT_LOCKED); + } + /* Make sure to flag we had a FR */ + tp1->whoTo->net_ack++; + tp1 = TAILQ_NEXT(tp1, sctp_next); + continue; + } + } /* printf("OK, we are now ready to FR this guy\n"); */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(tp1->rec.data.TSN_seq, tp1->snd_count, From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 12:54:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13B651065678; Wed, 8 Apr 2009 12:54:33 +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 0090C8FC0C; Wed, 8 Apr 2009 12:54:33 +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 n38CsWO1059522; Wed, 8 Apr 2009 12:54:32 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38CsWRx059521; Wed, 8 Apr 2009 12:54:32 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200904081254.n38CsWRx059521@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 8 Apr 2009 12:54: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: r190844 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 12:54:37 -0000 Author: raj Date: Wed Apr 8 12:54:32 2009 New Revision: 190844 URL: http://svn.freebsd.org/changeset/base/190844 Log: Properly handle KDB entry in fatal abort. This lets KDB_UNATTENDED work on ARM. Submitted by: Grzegorz Bernacki gjb ! semihalf dot com Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Wed Apr 8 12:52:05 2009 (r190843) +++ head/sys/arm/arm/trap.c Wed Apr 8 12:54:32 2009 (r190844) @@ -520,7 +520,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - kdb_trap(fsr, 0, tf); + if (debugger_on_panic || kdb_active) + kdb_trap(fsr, 0, tf); #endif panic("Fatal abort"); /*NOTREACHED*/ From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 13:01:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0160D1065677; Wed, 8 Apr 2009 13:01:19 +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 E48808FC19; Wed, 8 Apr 2009 13:01:18 +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 n38D1Iar059745; Wed, 8 Apr 2009 13:01:18 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38D1Isb059744; Wed, 8 Apr 2009 13:01:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200904081301.n38D1Isb059744@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 8 Apr 2009 13:01: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: r190845 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 13:01:19 -0000 Author: raj Date: Wed Apr 8 13:01:18 2009 New Revision: 190845 URL: http://svn.freebsd.org/changeset/base/190845 Log: Minor description fix. Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Wed Apr 8 12:54:32 2009 (r190844) +++ head/sys/arm/arm/trap.c Wed Apr 8 13:01:18 2009 (r190845) @@ -531,7 +531,7 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ * dab_align() handles the following data aborts: * * FAULT_ALIGN_0 - Alignment fault - * FAULT_ALIGN_0 - Alignment fault + * FAULT_ALIGN_1 - Alignment fault * * These faults are fatal if they happen in kernel mode. Otherwise, we * deliver a bus error to the process. From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 13:17:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E3B1065670; Wed, 8 Apr 2009 13:17:24 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 079038FC0C; Wed, 8 Apr 2009 13:17:23 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 6DDC773098; Wed, 8 Apr 2009 15:03:50 +0200 (CEST) Date: Wed, 8 Apr 2009 15:03:50 +0200 From: Luigi Rizzo To: Randall Stewart Message-ID: <20090408130350.GA9916@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 13:17:24 -0000 Randall, there is now a total of 36 sctp files under sys/netinet (22 headers, 12 source). Wouldn't it be the case to move them (except for the userland headers) under netinet/sctp/ ? cheers luigi From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 13:50:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B93D106566B; Wed, 8 Apr 2009 13:50:57 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com [209.85.218.164]) by mx1.freebsd.org (Postfix) with ESMTP id 716B48FC1E; Wed, 8 Apr 2009 13:50:56 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by bwz8 with SMTP id 8so135371bwz.43 for ; Wed, 08 Apr 2009 06:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=TnHezS1THmkZg3ztLx/bhnXH1cuPgF8q6A/NzXB1vB0=; b=UQ47v/aiprkWFe04Lj25w0848YK20NBOPHyITlrhpdVK4j/rbE2+2qKIGWksemdlAm F7omcK/BhjRilVjrJ7NwLhBSXr+HPkDDFrtE3e77TH2i6SiRq0KGSGN7LZLtrlLscnDr fkm2MXzcb3/rxTzPhoucA4HFnT0rH2aK4x+G4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=orL8x4BmC0HU0yrh/RweVQTCziGYvPp9/kCKWeX8nTxUXxZ1t8Hl1OjWZsuUuwqj4y 5EGNL7bg4In0ntRBFPi16c1DikElQWvNaRsUMAce3Zd36fsmRhhpDew967yQuV132xsZ a7qeOfHo5buaMLFAD38frLJlMQ5jMH3J9Fm3o= Received: by 10.204.117.17 with SMTP id o17mr1109081bkq.145.1239197239214; Wed, 08 Apr 2009 06:27:19 -0700 (PDT) Received: from epsilon.lan (bl11-194-107.dsl.telepac.pt [85.244.194.107]) by mx.google.com with ESMTPS id p17sm1749240fka.10.2009.04.08.06.27.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Apr 2009 06:27:18 -0700 (PDT) Message-Id: From: Rui Paulo To: Luigi Rizzo In-Reply-To: <20090408130350.GA9916@onelab2.iet.unipi.it> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-3-1044515838" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Wed, 8 Apr 2009 14:27:17 +0100 References: <20090408130350.GA9916@onelab2.iet.unipi.it> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 13:50:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-3-1044515838 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 8 Apr 2009, at 14:03, Luigi Rizzo wrote: > Randall, there is now a total of 36 sctp files under sys/netinet > (22 headers, 12 source). > Wouldn't it be the case to move them (except for the userland headers) > under netinet/sctp/ ? I would like to see this happening too, but I'm aware that the STCP code is shared a lot between projects, so I can't evaluate the technical requirements to keep it in a separate directory. -- Rui Paulo --Apple-Mail-3-1044515838 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkncpjUACgkQfD8M/ASTygLMkQCgvAZuU9nqmnK7bjpm5L9ylhNF A4IAoIMF43rri3dWofSmxoOKLCoLkcQu =XNhx -----END PGP SIGNATURE----- --Apple-Mail-3-1044515838-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 15:18:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D4AF1065676; Wed, 8 Apr 2009 15:18:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59BFB8FC12; Wed, 8 Apr 2009 15:18:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38FILxM062841; Wed, 8 Apr 2009 15:18:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38FIL8P062840; Wed, 8 Apr 2009 15:18:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200904081518.n38FIL8P062840@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 8 Apr 2009 15:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190846 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 15:18:23 -0000 Author: luigi Date: Wed Apr 8 15:18:21 2009 New Revision: 190846 URL: http://svn.freebsd.org/changeset/base/190846 Log: Various cleanup of text, moving a couple of paragraphs above to avoid referencing undefined terms (humans are not compilers but still care about these things). Change some .Sh to .Ss to better reflect the structure of the text. No new content. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Apr 8 13:01:18 2009 (r190845) +++ head/sbin/ipfw/ipfw.8 Wed Apr 8 15:18:21 2009 (r190846) @@ -136,12 +136,13 @@ If the ruleset includes one or more rule .Cm keep-state or .Cm limit -option, then +option, .Nm -assumes a +will have a .Em stateful behaviour, i.e., upon a match it will create dynamic rules matching -the exact parameters (addresses and ports) of the matching packet. +the exact parameters (source and destination addresses and ports) +of the matching packet. .Pp These dynamic rules, which have a limited lifetime, are checked at the first occurrence of a @@ -165,6 +166,21 @@ Counters can be displayed or reset with .Nm commands. .Pp +Each rule belongs to one of 32 different +.Em sets +, and there are +.Nm +commands to atomically manipulate sets, such as enable, +disable, swap sets, move all rules in a set to another +one, delete all rules in a set. +These can be useful to +install temporary configurations, or to test them. +See Section +.Sx SETS OF RULES +for more information on +.Em sets . +.Pp +.Pp Rules can be added with the .Cm add command; deleted individually or in groups with the @@ -183,48 +199,36 @@ and .Cm resetlog commands. .Pp -Also, each rule belongs to one of 32 different -.Em sets -, and there are -.Nm -commands to atomically manipulate sets, such as enable, -disable, swap sets, move all rules in a set to another -one, delete all rules in a set. -These can be useful to -install temporary configurations, or to test them. -See Section -.Sx SETS OF RULES -for more information on -.Em sets . -.Pp -The following options are available: +.Ss COMMAND OPTIONS +The following genral options are available when invoking +.Nm : .Bl -tag -width indent .It Fl a -While listing, show counter values. +Show counter values when listing rules. The .Cm show -command just implies this option. +command implies this option. .It Fl b Only show the action and the comment, not the body of a rule. Implies .Fl c . .It Fl c When entering or showing rules, print them in compact form, -i.e., without the optional "ip from any to any" string +i.e., omitting the "ip from any to any" string when this does not carry any additional information. .It Fl d -While listing, show dynamic rules in addition to static ones. +When listing, show dynamic rules in addition to static ones. .It Fl e -While listing, if the +When listing and .Fl d -option was specified, also show expired dynamic rules. +is specified, also show expired dynamic rules. .It Fl f Do not ask for confirmation for commands that can cause problems if misused, .No i.e. Cm flush . If there is no tty associated with the process, this is implied. .It Fl i -While listing a table (see the +When listing a table (see the .Sx LOOKUP TABLES section below for more information on lookup tables), format values as IP addresses. By default, values are shown as integers. @@ -234,47 +238,48 @@ them to the kernel. .It Fl N Try to resolve addresses and service names in output. .It Fl q -While -.Cm add Ns ing , -.Cm nat Ns ing , -.Cm zero Ns ing , -.Cm resetlog Ns ging +Be quiet when executing the +.Cm add , +.Cm nat , +.Cm zero , +.Cm resetlog or -.Cm flush Ns ing , -be quiet about actions +.Cm flush +commands; (implies .Fl f ) . -This is useful for adjusting rules by executing multiple +This is useful when updating rulesets by executing multiple .Nm commands in a script (e.g., .Ql sh\ /etc/rc.firewall ) , -or by processing a file of many +or by processing a file with many .Nm rules across a remote login session. It also stops a table add or delete from failing if the entry already exists or is not present. -If a -.Cm flush -is performed in normal (verbose) mode (with the default kernel -configuration), it prints a message. -Because all rules are flushed, the message might not be delivered -to the login session, causing the remote login session to be closed -and the remainder of the ruleset to not be processed. +.Pp +The reason why this option may be important is that +for some of these actions, +.Nm +may print a message; if the action results in blocking the +traffic to the remote client, +the remote login session will be closed +and the rest of the ruleset will not be processed. Access to the console would then be required to recover. .It Fl S -While listing rules, show the +When listing rules, show the .Em set each rule belongs to. If this flag is not specified, disabled rules will not be listed. .It Fl s Op Ar field -While listing pipes, sort according to one of the four +When listing pipes, sort according to one of the four counters (total or current packets or bytes). .It Fl t -While listing, show last match timestamp (converted with ctime()). +When listing, show last match timestamp converted with ctime(). .It Fl T -While listing, show last match timestamp (as seconds from the epoch). +When listing, show last match timestamp as seconds from the epoch. This form can be more convenient for postprocessing by scripts. .El .Pp @@ -1817,17 +1822,47 @@ for more examples on how to use dynamic .Nm is also the user interface for the .Nm dummynet -traffic shaper. +traffic shaper and network emulator, a subsystem that +can artificially queue, delay or drop packets +emulator the behaviour of certain network links +or queueing systems. .Pp .Nm dummynet -operates by first using the firewall to classify packets and divide them into -.Em flows , +operates by first using the firewall to select packets using any match pattern that can be used in .Nm rules. -Depending on local policies, a flow can contain packets for a single -TCP connection, or from/to a given host, or entire subnet, or a -protocol type, etc. +Matching packets are then passed to either of two +different objects, which implement the traffic regulation: +.Bl -hang -offset XXXX +.It Em pipe +A pipe emulates a link with given bandwidth, propagation delay, +queue size and packet loss rate. +Packets are queued in front of the pipe as they come out from the classifier, +and then transferred to the pipe according to the pipe's parameters. +.It Em queue +A queue +is an abstraction used to implement the WF2Q+ +(Worst-case Fair Weighted Fair Queueing) policy, which is +an efficient variant of the WFQ policy. +.Pp +The queue associates a +.Em weight +and a reference pipe to each flow (a flow is a set of packets +with the same addresses and ports after masking). +All backlogged flows (i.e., those +with packets queued) linked to the same pipe share the pipe's +bandwidth proportionally to their weights. +Note that weights are not priorities; a flow with a lower weight +is still guaranteed to get its fraction of the bandwidth even if a +flow with a higher weight is permanently backlogged. +.El +.Pp +In practice, +.Em pipes +can be used to set hard limits to the bandwidth that a flow can use, whereas +.Em queues +can be used to determine how different flows share the available bandwidth. .Pp There are two modes of .Nm dummynet @@ -1860,36 +1895,7 @@ mode can be enabled by setting the .Xr sysctl 8 variable to a non-zero value. .Pp -Packets belonging to the same flow are then passed to either of two -different objects, which implement the traffic regulation: -.Bl -hang -offset XXXX -.It Em pipe -A pipe emulates a link with given bandwidth, propagation delay, -queue size and packet loss rate. -Packets are queued in front of the pipe as they come out from the classifier, -and then transferred to the pipe according to the pipe's parameters. -.It Em queue -A queue -is an abstraction used to implement the WF2Q+ -(Worst-case Fair Weighted Fair Queueing) policy, which is -an efficient variant of the WFQ policy. -.Pp -The queue associates a -.Em weight -and a reference pipe to each flow, and then all backlogged (i.e., -with packets queued) flows linked to the same pipe share the pipe's -bandwidth proportionally to their weights. -Note that weights are not priorities; a flow with a lower weight -is still guaranteed to get its fraction of the bandwidth even if a -flow with a higher weight is permanently backlogged. -.El -.Pp -In practice, -.Em pipes -can be used to set hard limits to the bandwidth that a flow can use, whereas -.Em queues -can be used to determine how different flows share the available bandwidth. -.Pp +.Ss PIPE AND QUEUE CONFIGURATION The .Em pipe and @@ -2163,6 +2169,11 @@ If no socket is bound to the destination not loaded, or if the kernel was not compiled with divert socket support, the packets are dropped. .Sh NETWORK ADDRESS TRANSLATION (NAT) +.Pp +.Nm +support in-kernel NAT using the kernel version of +.Xr libalias 3 . +.Pp The nat configuration command is the following: .Bd -ragged -offset indent .Bk -words @@ -2206,13 +2217,13 @@ For more information about aliasing mode See Section .Sx EXAMPLES for some examples about nat usage. -.Sh REDIRECT AND LSNAT SUPPORT IN IPFW +.Ss REDIRECT AND LSNAT SUPPORT IN IPFW Redirect and LSNAT support follow closely the syntax used in .Xr natd 8 . See Section .Sx EXAMPLES for some examples on how to do redirect and lsnat. -.Sh SCTP NAT SUPPORT +.Ss SCTP NAT SUPPORT SCTP nat can be configured in a similar manner to TCP through the .Nm command line tool. @@ -2855,7 +2866,7 @@ Or a redirect rule with mixed modes coul .Dl " redirect_port tcp 192.168.0.1:80,192.168.0.10:22" .Dl " 500 # LSNAT" .Pp -or it could be splitted in: +or it could be split in: .Pp .Dl "ipfw nat 1 config redirect_addr 10.0.0.1 10.0.0.66" .Dl "ipfw nat 2 config redirect_port tcp 192.168.0.1:80 500" @@ -2906,15 +2917,15 @@ API based upon code written by .An Daniel Boulet for BSDI. .Pp +Some early work (1999-2000) on the +.Nm dummynet +traffic shaper supported by Akamba Corp. +.Pp .An -nosplit In-kernel NAT support written by .An Paolo Pisati Aq piso@FreeBSD.org as part of a Summer of Code 2005 project. .Pp -Work on -.Nm dummynet -traffic shaper supported by Akamba Corp. -.Pp SCTP .Nm nat support has been developed by From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 15:56:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2DD1065675; Wed, 8 Apr 2009 15:56:51 +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 7C42D8FC19; Wed, 8 Apr 2009 15:56:51 +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 n38Fupfi063808; Wed, 8 Apr 2009 15:56:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38FupRY063807; Wed, 8 Apr 2009 15:56:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904081556.n38FupRY063807@svn.freebsd.org> From: Ed Schouten Date: Wed, 8 Apr 2009 15:56: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: r190847 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 15:56:52 -0000 Author: ed Date: Wed Apr 8 15:56:50 2009 New Revision: 190847 URL: http://svn.freebsd.org/changeset/base/190847 Log: Fix tty_wait_background() to comply with standards. It turns out my handling of SIGTTOU and SIGTTIN didn't entirely comply to the standards. It is true that in the SIGTTOU case we should not return EIO when the signal is ignored/blocked, but in the SIGTTIN case we must. See also: POSIX issue 7 section 11.1.4 Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Wed Apr 8 15:18:21 2009 (r190846) +++ head/sys/kern/tty.c Wed Apr 8 15:56:50 2009 (r190847) @@ -371,23 +371,31 @@ tty_wait_background(struct tty *tp, stru * exit * - the signal to send to the process isn't masked */ - if (!tty_is_ctty(tp, p) || - p->p_pgrp == tp->t_pgrp || p->p_flag & P_PPWAIT || - SIGISMEMBER(p->p_sigacts->ps_sigignore, sig) || - SIGISMEMBER(td->td_sigmask, sig)) { + if (!tty_is_ctty(tp, p) || p->p_pgrp == tp->t_pgrp) { /* Allow the action to happen. */ PROC_UNLOCK(p); return (0); } + if (SIGISMEMBER(p->p_sigacts->ps_sigignore, sig) || + SIGISMEMBER(td->td_sigmask, sig)) { + /* Only allow them in write()/ioctl(). */ + PROC_UNLOCK(p); + return (sig == SIGTTOU ? 0 : EIO); + } + + pg = p->p_pgrp; + if (p->p_flag & P_PPWAIT || pg->pg_jobc == 0) { + /* Don't allow the action to happen. */ + PROC_UNLOCK(p); + return (EIO); + } + PROC_UNLOCK(p); + /* * Send the signal and sleep until we're the new * foreground process group. */ - pg = p->p_pgrp; - PROC_UNLOCK(p); - if (pg->pg_jobc == 0) - return (EIO); PGRP_LOCK(pg); pgsignal(pg, sig, 1); PGRP_UNLOCK(pg); From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 16:12:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DA4106566C; Wed, 8 Apr 2009 16:12:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70A558FC1D; Wed, 8 Apr 2009 16:12:28 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38GCSso064315; Wed, 8 Apr 2009 16:12:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38GCSPr064314; Wed, 8 Apr 2009 16:12:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904081612.n38GCSPr064314@svn.freebsd.org> From: Sam Leffler Date: Wed, 8 Apr 2009 16:12: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: r190848 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 16:12:29 -0000 Author: sam Date: Wed Apr 8 16:12:28 2009 New Revision: 190848 URL: http://svn.freebsd.org/changeset/base/190848 Log: remove unused struct member Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Apr 8 15:56:50 2009 (r190847) +++ head/sys/dev/ath/if_athvar.h Wed Apr 8 16:12:28 2009 (r190848) @@ -338,7 +338,6 @@ struct ath_softc { u_int32_t sc_tdmabintval; /* TDMA beacon interval (TU) */ u_int32_t sc_tdmaguard; /* TDMA guard time (usec) */ u_int sc_tdmaslotlen; /* TDMA slot length (usec) */ - u_int sc_tdmabintcnt; /* TDMA beacon intvl (slots) */ struct ath_rx_status *sc_tdmars; /* TDMA status of last rx */ u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 16:18:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3779F106564A; Wed, 8 Apr 2009 16:18:17 +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 25D5A8FC17; Wed, 8 Apr 2009 16:18:17 +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 n38GIHip064478; Wed, 8 Apr 2009 16:18:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38GIHG8064477; Wed, 8 Apr 2009 16:18:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904081618.n38GIHG8064477@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Apr 2009 16:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190849 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 16:18:17 -0000 Author: marcel Date: Wed Apr 8 16:18:16 2009 New Revision: 190849 URL: http://svn.freebsd.org/changeset/base/190849 Log: Don't use hexadecimal in the EBR partition names, because 'a'..'f' are more commonly known as BSD partition names. Discussed with: ivoras@ Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:12:28 2009 (r190848) +++ head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:18:16 2009 (r190849) @@ -344,7 +344,7 @@ g_part_ebr_name(struct g_part_table *tab char *buf, size_t bufsz) { - snprintf(buf, bufsz, "+%08x", entry->gpe_index); + snprintf(buf, bufsz, "+%08u", entry->gpe_index); return (buf); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 16:19:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F26F106567B; Wed, 8 Apr 2009 16:19:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA9E8FC12; Wed, 8 Apr 2009 16:19:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38GJocV064554; Wed, 8 Apr 2009 16:19:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38GJomC064551; Wed, 8 Apr 2009 16:19:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904081619.n38GJomC064551@svn.freebsd.org> From: Sam Leffler Date: Wed, 8 Apr 2009 16:19: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: r190850 - in head/sys: dev/if_ndis net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 16:19:51 -0000 Author: sam Date: Wed Apr 8 16:19:50 2009 New Revision: 190850 URL: http://svn.freebsd.org/changeset/base/190850 Log: o add a capability for drivers that require 802.3 encapsulation of frames passed down through the transmit path o mark ndis requiring 802.3 encap'd frames Reviewed by: "Paul B. Mahol" , thompsa Modified: head/sys/dev/if_ndis/if_ndis.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Wed Apr 8 16:18:16 2009 (r190849) +++ head/sys/dev/if_ndis/if_ndis.c Wed Apr 8 16:19:50 2009 (r190850) @@ -753,7 +753,8 @@ ndis_attach(dev) ic->ic_ifp = ifp; ic->ic_opmode = IEEE80211_M_STA; ic->ic_phytype = IEEE80211_T_DS; - ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_IBSS; + ic->ic_caps = IEEE80211_C_8023ENCAP | + IEEE80211_C_STA | IEEE80211_C_IBSS; setbit(ic->ic_modecaps, IEEE80211_MODE_AUTO); len = 0; r = ndis_get_info(sc, OID_802_11_NETWORK_TYPES_SUPPORTED, Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Apr 8 16:18:16 2009 (r190849) +++ head/sys/net80211/ieee80211_output.c Wed Apr 8 16:19:50 2009 (r190850) @@ -253,14 +253,16 @@ ieee80211_start(struct ifnet *ifp) } } #endif /* IEEE80211_SUPPORT_SUPERG */ - /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(vap, ni, m); - if (m == NULL) { - /* NB: stat+msg handled in ieee80211_encap */ - ieee80211_free_node(ni); - continue; + if (__predict_true((vap->iv_caps & IEEE80211_C_8023ENCAP) == 0)) { + /* + * Encapsulate the packet in prep for transmission. + */ + m = ieee80211_encap(vap, ni, m); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + ieee80211_free_node(ni); + continue; + } } /* Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Wed Apr 8 16:18:16 2009 (r190849) +++ head/sys/net80211/ieee80211_var.h Wed Apr 8 16:19:50 2009 (r190850) @@ -532,8 +532,9 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVEN_BITS "\20" /* ic_caps/iv_caps: device driver capabilities */ -/* 0x2f available */ +/* 0x2e available */ #define IEEE80211_C_STA 0x00000001 /* CAPABILITY: STA available */ +#define IEEE80211_C_8023ENCAP 0x00000002 /* CAPABILITY: 802.3 encap */ #define IEEE80211_C_FF 0x00000040 /* CAPABILITY: ATH FF avail */ #define IEEE80211_C_TURBOP 0x00000080 /* CAPABILITY: ATH Turbo avail*/ #define IEEE80211_C_IBSS 0x00000100 /* CAPABILITY: IBSS available */ @@ -565,7 +566,7 @@ MALLOC_DECLARE(M_80211_VAP); IEEE80211_C_TDMA) #define IEEE80211_C_BITS \ - "\20\1STA\7FF\10TURBOP\11IBSS\12PMGT" \ + "\20\1STA\002803ENCAP\7FF\10TURBOP\11IBSS\12PMGT" \ "\13HOSTAP\14AHDEMO\15SWRETRY\16TXPMGT\17SHSLOT\20SHPREAMBLE" \ "\21MONITOR\22DFS\30WPA1\31WPA2\32BURST\33WME\34WDS\36BGSCAN" \ "\37TXFRAG\40TDMA" From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 16:38:21 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 952B7106564A; Wed, 8 Apr 2009 16:38:21 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id 3C99B8FC12; Wed, 8 Apr 2009 16:38:21 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [10.1.1.54] ([10.1.1.54]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id n38GcJga067740 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 8 Apr 2009 12:38:19 -0400 (EDT) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1239208700; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=puVyiOona3NU7TCDwaKu49y8dR8SFu61OS6X1gsxdbyQHkh7fjzlOiR lQwciR7NSDbN1o0kbErYzW276ludfGQ== Message-Id: From: Randall Stewart To: Luigi Rizzo In-Reply-To: <20090408130350.GA9916@onelab2.iet.unipi.it> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Wed, 8 Apr 2009 12:38:18 -0400 References: <20090408130350.GA9916@onelab2.iet.unipi.it> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 16:38:22 -0000 I actually proposed that way back when we brought SCTP in the tree (there is not that big of difference now and then.. can't remember when the last time was we added a file .. before svn thats for sure). At that time I was advised it is best just to leave it like TCP and UDP. R On Apr 8, 2009, at 9:03 AM, Luigi Rizzo wrote: > Randall, there is now a total of 36 sctp files under sys/netinet > (22 headers, 12 source). > Wouldn't it be the case to move them (except for the userland headers) > under netinet/sctp/ ? > > cheers > luigi > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 16:46:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4834106564A; Wed, 8 Apr 2009 16:46:23 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 965E08FC15; Wed, 8 Apr 2009 16:46:23 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 43839730A1; Wed, 8 Apr 2009 18:51:29 +0200 (CEST) Date: Wed, 8 Apr 2009 18:51:29 +0200 From: Luigi Rizzo To: Randall Stewart Message-ID: <20090408165129.GA17444@onelab2.iet.unipi.it> References: <20090408130350.GA9916@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 16:46:24 -0000 On Wed, Apr 08, 2009 at 12:38:18PM -0400, Randall Stewart wrote: > I actually proposed that way back when > we brought SCTP in the tree (there is not that > big of difference now and then.. can't remember I know, it's not because of some recent addition, i just took your commit message as a reminder to ask the question again. I already asked this 1-2 months ago when i was planning to do similar work on ipfw/dummynet, and realised how large netinet/ has become. > when the last time was we added a file .. before > svn thats for sure). At that time I was advised it > is best just to leave it like TCP and UDP. I guess whoever responded at the time did not realized the number of files involved. Even tcp_* and ip_* account for a large number of files, but there is more legacy there (especially for the headers) so they are harder to move around. In the sctp case, though, legacy should not be an issue. cheers luigi > R > On Apr 8, 2009, at 9:03 AM, Luigi Rizzo wrote: > > >Randall, there is now a total of 36 sctp files under sys/netinet > >(22 headers, 12 source). > >Wouldn't it be the case to move them (except for the userland headers) > >under netinet/sctp/ ? > > > > cheers > > luigi > > > > ------------------------------ > Randall Stewart > 803-317-4952 (cell) > 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:12:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667451065679 for ; Wed, 8 Apr 2009 17:12:50 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id EC1E78FC16 for ; Wed, 8 Apr 2009 17:12:49 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-024-239.pools.arcor-ip.net [88.66.24.239]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis) id 0ML29c-1LrbKS49e3-0001e3; Wed, 08 Apr 2009 19:12:49 +0200 Received: (qmail 45859 invoked from network); 8 Apr 2009 17:12:48 -0000 Received: from fbsd8.laiers.local (192.168.4.200) by mx.laiers.local with SMTP; 8 Apr 2009 17:12:48 -0000 From: Max Laier Organization: FreeBSD To: Marcel Moolenaar Date: Wed, 8 Apr 2009 18:12:47 +0100 User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.1; i386; ; ) References: <200904081618.n38GIHG8064477@svn.freebsd.org> In-Reply-To: <200904081618.n38GIHG8064477@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904081912.48347.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19Y2D8RGFYuvO8qYBK+ksGQ/8mcaR1vFfle2iL 6GT2hX3ElgFKfgvSjEXlGM2FY8NIilgtem88AfB/IZowI7fHRD oSNjKImQXhdqZzYpnoR9A== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190849 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 17:12:51 -0000 On Wednesday 08 April 2009 18:18:17 Marcel Moolenaar wrote: > Author: marcel > Date: Wed Apr 8 16:18:16 2009 > New Revision: 190849 > URL: http://svn.freebsd.org/changeset/base/190849 > > Log: > Don't use hexadecimal in the EBR partition names, because 'a'..'f' > are more commonly known as BSD partition names. > > Discussed with: ivoras@ > > Modified: > head/sys/geom/part/g_part_ebr.c > > Modified: head/sys/geom/part/g_part_ebr.c > =========================================================================== >=== --- head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:12:28 2009 (r190848) > +++ head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:18:16 2009 (r190849) @@ > -344,7 +344,7 @@ g_part_ebr_name(struct g_part_table *tab > char *buf, size_t bufsz) > { > > - snprintf(buf, bufsz, "+%08x", entry->gpe_index); Not to bikeshed, but why not use "+%08X" instead? > + snprintf(buf, bufsz, "+%08u", entry->gpe_index); > return (buf); > } > > > > !DSPAM:49dcce6b450631134040011! -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:36:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A669106564A; Wed, 8 Apr 2009 17:36:00 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 421AA8FC12; Wed, 8 Apr 2009 17:36:00 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from vmittal-t60.jnpr.net ([66.129.224.36]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KHS007OEM7ZZK60@asmtp011.mac.com>; Wed, 08 Apr 2009 10:36:00 -0700 (PDT) Message-id: <55F7CC42-D280-46C2-9C02-C1FBC5EE760D@mac.com> From: Marcel Moolenaar To: Max Laier In-reply-to: <200904081912.48347.max@love2party.net> Date: Wed, 08 Apr 2009 10:34:38 -0700 References: <200904081618.n38GIHG8064477@svn.freebsd.org> <200904081912.48347.max@love2party.net> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r190849 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 17:36:00 -0000 On Apr 8, 2009, at 10:12 AM, Max Laier wrote: > On Wednesday 08 April 2009 18:18:17 Marcel Moolenaar wrote: >> Author: marcel >> Date: Wed Apr 8 16:18:16 2009 >> New Revision: 190849 >> URL: http://svn.freebsd.org/changeset/base/190849 >> >> Log: >> Don't use hexadecimal in the EBR partition names, because 'a'..'f' >> are more commonly known as BSD partition names. >> >> Discussed with: ivoras@ >> >> Modified: >> head/sys/geom/part/g_part_ebr.c >> >> Modified: head/sys/geom/part/g_part_ebr.c >> = >> = >> = >> = >> = >> = >> ===================================================================== >> === --- head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:12:28 2009 >> (r190848) >> +++ head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:18:16 2009 >> (r190849) @@ >> -344,7 +344,7 @@ g_part_ebr_name(struct g_part_table *tab >> char *buf, size_t bufsz) >> { >> >> - snprintf(buf, bufsz, "+%08x", entry->gpe_index); > > Not to bikeshed, but why not use "+%08X" instead? "gpart show" prints the index in decimal. By using decimal in the device name, you don't have to convert between dec and hex when you need to derive the device name from the index: fbsdvm% gpart show md0s1 => 0 262134 md0s1 EBR (128M) 0 131067 1 freebsd (64M) 131067 131067 14564 freebsd (64M) fbsdvm% ls /dev/md0s1* | cat /dev/md0s1 /dev/md0s1+00000001 /dev/md0s1+00014564 The leading zeroes are annoying in this respect. I think it's more readable to have: not-real% ls /dev/md0s1* | cat /dev/md0s1 /dev/md0s1+1 /dev/md0s1+14564 But this affects alphabetical ordering, as in: /dev/md0s1+100 /dev/md0s1+2 Ah well... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:43:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B238D106566B for ; Wed, 8 Apr 2009 17:43:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outN.internet-mail-service.net (outn.internet-mail-service.net [216.240.47.237]) by mx1.freebsd.org (Postfix) with ESMTP id 957878FC13 for ; Wed, 8 Apr 2009 17:43:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id D8D28B9884; Wed, 8 Apr 2009 10:43:20 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A5BC12D6043; Wed, 8 Apr 2009 10:43:12 -0700 (PDT) Message-ID: <49DCE250.6000004@elischer.org> Date: Wed, 08 Apr 2009 10:43:44 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Rui Paulo References: <20090408130350.GA9916@onelab2.iet.unipi.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Randall Stewart , svn-src-all@freebsd.org, src-committers@freebsd.org, Luigi Rizzo Subject: Re: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 17:43:21 -0000 Rui Paulo wrote: > > On 8 Apr 2009, at 14:03, Luigi Rizzo wrote: > >> Randall, there is now a total of 36 sctp files under sys/netinet >> (22 headers, 12 source). >> Wouldn't it be the case to move them (except for the userland headers) >> under netinet/sctp/ ? > > > I would like to see this happening too, but I'm aware that the STCP code > is shared a lot between projects, so I can't evaluate the technical > requirements to keep it in a separate directory. I think I said this before but I'd moive tcp as well. there are more and more tcp files. > > -- > Rui Paulo > From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:46:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A02801065673 for ; Wed, 8 Apr 2009 17:46:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outI.internet-mail-service.net (outi.internet-mail-service.net [216.240.47.232]) by mx1.freebsd.org (Postfix) with ESMTP id 82DF68FC0C for ; Wed, 8 Apr 2009 17:46:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 5E9F6B50FD; Wed, 8 Apr 2009 10:46:18 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 19FA62D60FF; Wed, 8 Apr 2009 10:46:14 -0700 (PDT) Message-ID: <49DCE307.5050004@elischer.org> Date: Wed, 08 Apr 2009 10:46:47 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Randall Stewart References: <20090408130350.GA9916@onelab2.iet.unipi.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo Subject: Re: sctp files location X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 17:46:19 -0000 Randall Stewart wrote: > I actually proposed that way back when > we brought SCTP in the tree (there is not that > big of difference now and then.. can't remember > when the last time was we added a file .. before > svn thats for sure). At that time I was advised it > is best just to leave it like TCP and UDP. "ok, we were wrong" > R > On Apr 8, 2009, at 9:03 AM, Luigi Rizzo wrote: > >> Randall, there is now a total of 36 sctp files under sys/netinet >> (22 headers, 12 source). >> Wouldn't it be the case to move them (except for the userland headers) >> under netinet/sctp/ ? >> >> cheers >> luigi >> > > ------------------------------ > Randall Stewart > 803-317-4952 (cell) > 803-345-0391(direct) From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 17:46:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EBEA1065679; Wed, 8 Apr 2009 17:46:46 +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 1C93A8FC20; Wed, 8 Apr 2009 17:46:46 +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 n38HkkcT067821; Wed, 8 Apr 2009 17:46:46 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38Hkjrt067820; Wed, 8 Apr 2009 17:46:45 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200904081746.n38Hkjrt067820@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 8 Apr 2009 17:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190851 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 17:46:47 -0000 Author: maxim Date: Wed Apr 8 17:46:45 2009 New Revision: 190851 URL: http://svn.freebsd.org/changeset/base/190851 Log: o Grammar. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Apr 8 16:19:50 2009 (r190850) +++ head/sbin/ipfw/ipfw.8 Wed Apr 8 17:46:45 2009 (r190851) @@ -200,7 +200,7 @@ and commands. .Pp .Ss COMMAND OPTIONS -The following genral options are available when invoking +The following general options are available when invoking .Nm : .Bl -tag -width indent .It Fl a @@ -594,7 +594,7 @@ The tag acts as an internal marker (it i the wire) that can be used to identify these packets later on. This can be used, for example, to provide trust between interfaces and to start doing policy-based filtering. -A packet can have mutiple tags at the same time. +A packet can have multiple tags at the same time. Tags are "sticky", meaning once a tag is applied to a packet by a matching rule it exists until explicit removal. Tags are kept with the packet everywhere within the kernel, but are @@ -1213,7 +1213,7 @@ the given FIB (routing table) number. Matches IPv6 packets containing any of the flow labels given in .Ar labels . .Ar labels -is a comma seperate list of numeric flow labels. +is a comma separated list of numeric flow labels. .It Cm frag Matches packets that are fragments and not the first fragment of an IP datagram. From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 18:30:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6270710656DB; Wed, 8 Apr 2009 18:30:42 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50D368FC13; Wed, 8 Apr 2009 18:30:42 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38IUgGg069851; Wed, 8 Apr 2009 18:30:42 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38IUgb9069850; Wed, 8 Apr 2009 18:30:42 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200904081830.n38IUgb9069850@svn.freebsd.org> From: Marko Zec Date: Wed, 8 Apr 2009 18:30: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: r190852 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 18:30:43 -0000 Author: zec Date: Wed Apr 8 18:30:42 2009 New Revision: 190852 URL: http://svn.freebsd.org/changeset/base/190852 Log: A belated note on layout change of certain V_ containers. Approved by: julian (mentor) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Apr 8 17:46:45 2009 (r190851) +++ head/UPDATING Wed Apr 8 18:30:42 2009 (r190852) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090407: + The size of structs vnet_net, vnet_inet and vnet_ipfw has changed; + kernel modules referencing any of the above need to be recompiled. + Bump __FreeBSD_version to 800075. + 20090320: GEOM_PART has become the default partition slicer for storage devices, replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 19:06:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C053106566C; Wed, 8 Apr 2009 19:06:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA278FC1E; Wed, 8 Apr 2009 19:06:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38J6lR1071507; Wed, 8 Apr 2009 19:06:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38J6ln1071504; Wed, 8 Apr 2009 19:06:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904081906.n38J6ln1071504@svn.freebsd.org> From: Ed Schouten Date: Wed, 8 Apr 2009 19:06: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: r190853 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 19:06:48 -0000 Author: ed Date: Wed Apr 8 19:06:47 2009 New Revision: 190853 URL: http://svn.freebsd.org/changeset/base/190853 Log: Implement __bswap16() without using inline assembly. Most compilers nowadays (including GCC) are smart enough to know what's going on and generate more efficient code anyway. Submitted by: Christoph Mallon Modified: head/sys/amd64/include/endian.h head/sys/i386/include/endian.h Modified: head/sys/amd64/include/endian.h ============================================================================== --- head/sys/amd64/include/endian.h Wed Apr 8 18:30:42 2009 (r190852) +++ head/sys/amd64/include/endian.h Wed Apr 8 19:06:47 2009 (r190853) @@ -135,26 +135,6 @@ __extension__ ({ register __uint64_t __X #endif /* __OPTIMIZE__ */ -#define __byte_swap_word_var(x) \ -__extension__ ({ register __uint16_t __X = (x); \ - __asm ("xchgb %h0, %b0" : "+Q" (__X)); \ - __X; }) - -#ifdef __OPTIMIZE__ - -#define __byte_swap_word_const(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __byte_swap_word(x) (__builtin_constant_p(x) ? \ - __byte_swap_word_const(x) : __byte_swap_word_var(x)) - -#else /* __OPTIMIZE__ */ - -#define __byte_swap_word(x) __byte_swap_word_var(x) - -#endif /* __OPTIMIZE__ */ - static __inline __uint64_t __bswap64(__uint64_t _x) { @@ -172,8 +152,7 @@ __bswap32(__uint32_t _x) static __inline __uint16_t __bswap16(__uint16_t _x) { - - return (__byte_swap_word(_x)); + return (_x << 8 | _x >> 8); } #define __htonl(x) __bswap32(x) Modified: head/sys/i386/include/endian.h ============================================================================== --- head/sys/i386/include/endian.h Wed Apr 8 18:30:42 2009 (r190852) +++ head/sys/i386/include/endian.h Wed Apr 8 19:06:47 2009 (r190853) @@ -109,26 +109,6 @@ __extension__ ({ register __uint32_t __X #endif /* __OPTIMIZE__ */ -#define __byte_swap_word_var(x) \ -__extension__ ({ register __uint16_t __X = (x); \ - __asm ("xchgb %h0, %b0" : "+q" (__X)); \ - __X; }) - -#ifdef __OPTIMIZE__ - -#define __byte_swap_word_const(x) \ - ((((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8)) - -#define __byte_swap_word(x) (__builtin_constant_p(x) ? \ - __byte_swap_word_const(x) : __byte_swap_word_var(x)) - -#else /* __OPTIMIZE__ */ - -#define __byte_swap_word(x) __byte_swap_word_var(x) - -#endif /* __OPTIMIZE__ */ - static __inline __uint64_t __bswap64(__uint64_t _x) { @@ -149,8 +129,7 @@ __bswap32(__uint32_t _x) static __inline __uint16_t __bswap16(__uint16_t _x) { - - return (__byte_swap_word(_x)); + return (_x << 8 | _x >> 8); } #define __htonl(x) __bswap32(x) From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 19:10:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 232FA106566B; Wed, 8 Apr 2009 19:10:21 +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 10D7E8FC08; Wed, 8 Apr 2009 19:10:21 +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 n38JAKHo071685; Wed, 8 Apr 2009 19:10:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38JAK47071682; Wed, 8 Apr 2009 19:10:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904081910.n38JAK47071682@svn.freebsd.org> From: Ed Schouten Date: Wed, 8 Apr 2009 19:10: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: r190854 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 19:10:21 -0000 Author: ed Date: Wed Apr 8 19:10:20 2009 New Revision: 190854 URL: http://svn.freebsd.org/changeset/base/190854 Log: Also remove the unused __word_swap_int*() macros. Submitted by: Christoph Mallon Modified: head/sys/amd64/include/endian.h head/sys/i386/include/endian.h Modified: head/sys/amd64/include/endian.h ============================================================================== --- head/sys/amd64/include/endian.h Wed Apr 8 19:06:47 2009 (r190853) +++ head/sys/amd64/include/endian.h Wed Apr 8 19:10:20 2009 (r190854) @@ -69,25 +69,6 @@ extern "C" { #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __word_swap_int_var(x) \ -__extension__ ({ register __uint32_t __X = (x); \ - __asm ("rorl $16, %0" : "+r" (__X)); \ - __X; }) - -#ifdef __OPTIMIZE__ - -#define __word_swap_int_const(x) \ - ((((x) & 0xffff0000) >> 16) | \ - (((x) & 0x0000ffff) << 16)) -#define __word_swap_int(x) (__builtin_constant_p(x) ? \ - __word_swap_int_const(x) : __word_swap_int_var(x)) - -#else /* __OPTIMIZE__ */ - -#define __word_swap_int(x) __word_swap_int_var(x) - -#endif /* __OPTIMIZE__ */ - #define __byte_swap_int_var(x) \ __extension__ ({ register __uint32_t __X = (x); \ __asm ("bswap %0" : "+r" (__X)); \ Modified: head/sys/i386/include/endian.h ============================================================================== --- head/sys/i386/include/endian.h Wed Apr 8 19:06:47 2009 (r190853) +++ head/sys/i386/include/endian.h Wed Apr 8 19:10:20 2009 (r190854) @@ -69,25 +69,6 @@ extern "C" { #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __word_swap_int_var(x) \ -__extension__ ({ register __uint32_t __X = (x); \ - __asm ("rorl $16, %0" : "+r" (__X)); \ - __X; }) - -#ifdef __OPTIMIZE__ - -#define __word_swap_int_const(x) \ - ((((x) & 0xffff0000) >> 16) | \ - (((x) & 0x0000ffff) << 16)) -#define __word_swap_int(x) (__builtin_constant_p(x) ? \ - __word_swap_int_const(x) : __word_swap_int_var(x)) - -#else /* __OPTIMIZE__ */ - -#define __word_swap_int(x) __word_swap_int_var(x) - -#endif /* __OPTIMIZE__ */ - #define __byte_swap_int_var(x) \ __extension__ ({ register __uint32_t __X = (x); \ __asm ("bswap %0" : "+r" (__X)); \ From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 20:20:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7904C106566C; Wed, 8 Apr 2009 20:20:20 +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 4C0468FC13; Wed, 8 Apr 2009 20:20:20 +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 n38KKKYN074349; Wed, 8 Apr 2009 20:20:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38KKKtc074346; Wed, 8 Apr 2009 20:20:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904082020.n38KKKtc074346@svn.freebsd.org> From: Ed Schouten Date: Wed, 8 Apr 2009 20:20: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: r190855 - in head/share: man/man7 misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 20:20:21 -0000 Author: ed Date: Wed Apr 8 20:20:19 2009 New Revision: 190855 URL: http://svn.freebsd.org/changeset/base/190855 Log: Add C++ operators to operator(7) manual page. Submitted by: Christoph Mallon Modified: head/share/man/man7/operator.7 head/share/misc/operator Modified: head/share/man/man7/operator.7 ============================================================================== --- head/share/man/man7/operator.7 Wed Apr 8 19:10:20 2009 (r190854) +++ head/share/man/man7/operator.7 Wed Apr 8 20:20:19 2009 (r190855) @@ -32,19 +32,20 @@ .\" @(#)operator.7 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd January 22, 2003 +.Dd April 8, 2009 .Dt OPERATOR 7 .Os .Sh NAME .Nm operator -.Nd C operator precedence and order of evaluation +.Nd C and C++ operator precedence and order of evaluation .Sh DESCRIPTION .Bd -ragged -offset indent -compact -.Bl -column "= += -= *= /= %= <<= >>= &= ^= |=" +.Bl -column "! ~ ++ -- - (type) * & sizeof new delete" .It Sy "Operator Associativity" .It "-------- -------------" .It "() [] -> . left to right" -.It "! ~ ++ -- - (type) * & sizeof right to left" +.It "! ~ ++ -- - (type) * & sizeof new delete right to left" +.It "->* .* left to right .It "* / % left to right" .It "+ - left to right" .It "<< >> left to right" @@ -56,7 +57,8 @@ .It "&& left to right" .It "|| left to right" .It "?: right to left" -.It "= += -= *= /= %= <<= >>= &= ^= |= right to left" +.It "= += -= *= /= %= <<= >>= &= ^= |= throw right to left" +.It "?: (C++, third operand) right to left" .It ", left to right" .El .Ed Modified: head/share/misc/operator ============================================================================== --- head/share/misc/operator Wed Apr 8 19:10:20 2009 (r190854) +++ head/share/misc/operator Wed Apr 8 20:20:19 2009 (r190855) @@ -1,19 +1,21 @@ -Operator Associativity ------------------------------------------------------ -() [] -> . left to right -! ~ ++ -- - (type) * & sizeof right to left -* / % left to right -+ - left to right -<< >> left to right -< <= > >= left to right -== != left to right -& left to right -^ left to right -| left to right -&& left to right -|| left to right -?: right to left -= += -= *= /= %= <<= >>= &= ^= |= right to left -, left to right +Operator Associativity +------------------------------------------------------------- +() [] -> . left to right +! ~ ++ -- - (type) * & sizeof new delete right to left +->* .* left to right +* / % left to right ++ - left to right +<< >> left to right +< <= > >= left to right +== != left to right +& left to right +^ left to right +| left to right +&& left to right +|| left to right +?: right to left += += -= *= /= %= <<= >>= &= ^= |= throw right to left +?: (C++, third operand) right to left +, left to right $FreeBSD$ From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 20:52:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC3D1065692; Wed, 8 Apr 2009 20:52:30 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0A78FC0A; Wed, 8 Apr 2009 20:52:30 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38KqUES075634; Wed, 8 Apr 2009 20:52:30 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38KqU9p075633; Wed, 8 Apr 2009 20:52:30 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904082052.n38KqU9p075633@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 8 Apr 2009 20:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190857 - head/sys/dev/kbdmux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 20:52:31 -0000 Author: emax Date: Wed Apr 8 20:52:30 2009 New Revision: 190857 URL: http://svn.freebsd.org/changeset/base/190857 Log: Undo SVN rev 183283 Do not use Giant for kbdmux(4) locking. This is wrong and apparently causing more problems than it solves. This will re-open the issue where interrupt handlers may race with kbdmux(4) in polling mode. Typical symptoms include (but not limited to) duplicated and/or missing characters when low level console functions (such as gets) are used while interrupts are enabled (for example geli password prompt, mountroot prompt etc.) MFC after: 3 days Modified: head/sys/dev/kbdmux/kbdmux.c Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Wed Apr 8 20:43:19 2009 (r190856) +++ head/sys/dev/kbdmux/kbdmux.c Wed Apr 8 20:52:30 2009 (r190857) @@ -104,10 +104,10 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, " #define KBDMUX_LOCK_DESTROY(s) -#define KBDMUX_LOCK(s) \ - mtx_lock(&Giant) -#define KBDMUX_UNLOCK(s) \ - mtx_unlock(&Giant) +#define KBDMUX_LOCK(s) + +#define KBDMUX_UNLOCK(s) + #define KBDMUX_LOCK_ASSERT(s, w) #define KBDMUX_SLEEP(s, f, d, t) \ From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 21:23:51 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE8031065672; Wed, 8 Apr 2009 21:23:51 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 3051F8FC12; Wed, 8 Apr 2009 21:23:49 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 15F649CB080; Wed, 8 Apr 2009 23:22:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pZr8C2oWSGvB; Wed, 8 Apr 2009 23:22:51 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C370C9CB109; Wed, 8 Apr 2009 23:22:51 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n38LMpv1028458; Wed, 8 Apr 2009 23:22:51 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 8 Apr 2009 23:22:51 +0200 From: Roman Divacky To: Ed Schouten Message-ID: <20090408212251.GA28110@freebsd.org> References: <200904081906.n38J6ln1071504@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904081906.n38J6ln1071504@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190853 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 21:23:52 -0000 On Wed, Apr 08, 2009 at 07:06:47PM +0000, Ed Schouten wrote: > Author: ed > Date: Wed Apr 8 19:06:47 2009 > New Revision: 190853 > URL: http://svn.freebsd.org/changeset/base/190853 > > Log: > Implement __bswap16() without using inline assembly. > > Most compilers nowadays (including GCC) are smart enough to know what's > going on and generate more efficient code anyway. my test kernel: (without the patch) text data bss dec hex filename 3695813 294882 496952 4487647 4479df kernel (with the patch) text data bss dec hex filename 3695605 294882 496952 4487439 44790f kernel so it shaves 208 bytes off the kernel in this case. From owner-svn-src-head@FreeBSD.ORG Wed Apr 8 22:19:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B951F106564A; Wed, 8 Apr 2009 22:19:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF3D8FC1B; Wed, 8 Apr 2009 22:19:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n38MJd5x079139; Wed, 8 Apr 2009 22:19:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n38MJdfX079138; Wed, 8 Apr 2009 22:19:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904082219.n38MJdfX079138@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Apr 2009 22:19: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: r190860 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 22:19:40 -0000 Author: marcel Date: Wed Apr 8 22:19:39 2009 New Revision: 190860 URL: http://svn.freebsd.org/changeset/base/190860 Log: Don't use pmap_kextact() when comparing bus handles for Book-E. We typically wire translation to devices with TLB1 entries and pmap_kextract() does not know about those and returns 0. This causes false positives (read: all serial ports suddenly become the console). Modified: head/sys/dev/uart/uart_cpu_powerpc.c Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Wed Apr 8 21:57:03 2009 (r190859) +++ head/sys/dev/uart/uart_cpu_powerpc.c Wed Apr 8 22:19:39 2009 (r190860) @@ -55,7 +55,11 @@ bus_space_tag_t uart_bus_space_mem = &bs int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { +#ifdef MPC85XX + return ((b1->bsh == b2->bsh) ? 1 : 0); +#else return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); +#endif } #ifdef MPC85XX From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 07:45:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43ED21065801; Thu, 9 Apr 2009 07:45:24 +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 2F71D8FC29; Thu, 9 Apr 2009 07:45:24 +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 n397jOUK094109; Thu, 9 Apr 2009 07:45:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n397jOSh094108; Thu, 9 Apr 2009 07:45:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904090745.n397jOSh094108@svn.freebsd.org> From: Xin LI Date: Thu, 9 Apr 2009 07:45: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: r190863 - head/sys/dev/hptmv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 07:45:29 -0000 Author: delphij Date: Thu Apr 9 07:45:23 2009 New Revision: 190863 URL: http://svn.freebsd.org/changeset/base/190863 Log: Use DEVICE_SHUTDOWN(9) mechanism for shutdown handler. Suggested by: jhb Modified: head/sys/dev/hptmv/entry.c Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Thu Apr 9 07:23:40 2009 (r190862) +++ head/sys/dev/hptmv/entry.c Thu Apr 9 07:45:23 2009 (r190863) @@ -93,7 +93,7 @@ static device_method_t driver_methods[] DEVMETHOD(device_attach, hpt_attach), DEVMETHOD(device_detach, hpt_detach), -/* DEVMETHOD(device_shutdown, hpt_shutdown), */ + DEVMETHOD(device_shutdown, hpt_shutdown), { 0, 0 } }; @@ -2138,13 +2138,7 @@ hpt_attach(device_t dev) xpt_action((union ccb *)ccb); free(ccb, M_DEVBUF); - /* Register a shutdown handler to flush data for the current adapter */ - pAdapter->eh = EVENTHANDLER_REGISTER(shutdown_final, - hpt_shutdown, dev, SHUTDOWN_PRI_DEFAULT); - if (pAdapter->eh == NULL) { - device_printf(pAdapter->hpt_dev, - "shutdown event registration failed\n"); - } else if (device_get_unit(dev) == 0) { + if (device_get_unit(dev) == 0) { /* Start the work thread. XXX */ launch_worker_thread(); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 12:20:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9E44106564A; Thu, 9 Apr 2009 12:20:37 +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 A5DB18FC1C; Thu, 9 Apr 2009 12:20:37 +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 n39CKbqa004031; Thu, 9 Apr 2009 12:20:37 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39CKbiA004028; Thu, 9 Apr 2009 12:20:37 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200904091220.n39CKbiA004028@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 9 Apr 2009 12:20: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: r190864 - in head: . usr.sbin usr.sbin/slstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 12:20:38 -0000 Author: ru Date: Thu Apr 9 12:20:37 2009 New Revision: 190864 URL: http://svn.freebsd.org/changeset/base/190864 Log: Removed more vestiges of if_sl(4). Deleted: head/usr.sbin/slstat/ Modified: head/ObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Apr 9 07:45:23 2009 (r190863) +++ head/ObsoleteFiles.inc Thu Apr 9 12:20:37 2009 (r190864) @@ -15,14 +15,15 @@ # # 20090405: removal of if_ppp(4) and if_sl(4) -OLD_FILES+=sbin/slattach -OLD_FILES+=sbin/startslip +OLD_FILES+=sbin/slattach rescue/slattach +OLD_FILES+=sbin/startslip rescue/startslip OLD_FILES+=usr/include/net/if_ppp.h OLD_FILES+=usr/include/net/if_pppvar.h OLD_FILES+=usr/include/net/if_slvar.h OLD_FILES+=usr/include/net/ppp_comp.h OLD_FILES+=usr/include/net/slip.h OLD_FILES+=usr/sbin/sliplogin +OLD_FILES+=usr/sbin/slstat OLD_FILES+=usr/sbin/pppd OLD_FILES+=usr/sbin/pppstats OLD_FILES+=usr/share/man/man1/startslip.1.gz @@ -33,7 +34,9 @@ OLD_FILES+=usr/share/man/man4/sl.4.gz OLD_FILES+=usr/share/man/man8/pppd.8.gz OLD_FILES+=usr/share/man/man8/pppstats.8.gz OLD_FILES+=usr/share/man/man8/slattach.8.gz +OLD_FILES+=usr/share/man/man8/slip.8.gz OLD_FILES+=usr/share/man/man8/sliplogin.8.gz +OLD_FILES+=usr/share/man/man8/slstat.8.gz # 20090321: libpcap upgraded to 1.0.0 OLD_LIBS+=lib/libpcap.so.5 .if ${TARGET_ARCH} == "amd64" Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Apr 9 07:45:23 2009 (r190863) +++ head/usr.sbin/Makefile Thu Apr 9 12:20:37 2009 (r190864) @@ -164,7 +164,6 @@ SUBDIR= ${_ac} \ setfmac \ setpmac \ ${_sicontrol} \ - ${_slstat} \ smbmsg \ snapinfo \ ${_spkrtest} \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 12:46:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6C81065702; Thu, 9 Apr 2009 12:46:01 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B83D8FC23; Thu, 9 Apr 2009 12:46:01 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39Ck1QR004633; Thu, 9 Apr 2009 12:46:01 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39Ck05i004627; Thu, 9 Apr 2009 12:46:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200904091246.n39Ck05i004627@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 9 Apr 2009 12:46: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: r190865 - in head: sbin/ipfw sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 12:46:02 -0000 Author: luigi Date: Thu Apr 9 12:46:00 2009 New Revision: 190865 URL: http://svn.freebsd.org/changeset/base/190865 Log: Add emulation of delay profiles, which lets you model various types of MAC overheads such as preambles, link level retransmissions and more. Note- this commit changes the userland/kernel ABI for pipes (but not for ordinary firewall rules) so you need to rebuild kernel and /sbin/ipfw to use dummynet features. Please check the manpage for details on the new feature. The MFC would be trivial but it breaks the ABI, so it will be postponed until after 7.2 is released. Interested users are welcome to apply the patch manually to their RELENG_7 tree. Work supported by the European Commission, Projects Onelab and Onelab2 (contract 224263). Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.h head/sys/netinet/ip_dummynet.c head/sys/netinet/ip_dummynet.h Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Thu Apr 9 12:20:37 2009 (r190864) +++ head/sbin/ipfw/dummynet.c Thu Apr 9 12:46:00 2009 (r190865) @@ -69,6 +69,7 @@ static struct _s_x dummynet_params[] = { { "dst-ip6", TOK_DSTIP6}, { "src-ipv6", TOK_SRCIP6}, { "src-ip6", TOK_SRCIP6}, + { "profile", TOK_PIPE_PROFILE}, { "dummynet-params", TOK_NULL }, { NULL, 0 } /* terminator */ }; @@ -248,6 +249,19 @@ print_flowset_parms(struct dn_flow_set * prefix, qs, plr, fs->rq_elements, fs->rq_size, red); } +static void +print_extra_delay_parms(struct dn_pipe *p, char *prefix) +{ + double loss; + if (p->samples_no <= 0) + return; + + loss = p->loss_level; + loss /= p->samples_no; + printf("%s profile: name \"%s\" loss %f samples %d\n", + prefix, p->name, loss, p->samples_no); +} + void ipfw_list_pipes(void *data, uint nbytes, int ac, char *av[]) { @@ -296,6 +310,9 @@ ipfw_list_pipes(void *data, uint nbytes, sprintf(prefix, "%05d: %s %4d ms ", p->pipe_nr, buf, p->delay); + + print_extra_delay_parms(p, prefix); + print_flowset_parms(&(p->fs), prefix); if (co.verbose) printf(" V %20llu\n", align_uint64(&p->V) >> MY_M); @@ -346,9 +363,284 @@ ipfw_delete_pipe(int pipe_or_queue, int return i; } +/* + * Code to parse delay profiles. + * + * Some link types introduce extra delays in the transmission + * of a packet, e.g. because of MAC level framing, contention on + * the use of the channel, MAC level retransmissions and so on. + * From our point of view, the channel is effectively unavailable + * for this extra time, which is constant or variable depending + * on the link type. Additionally, packets may be dropped after this + * time (e.g. on a wireless link after too many retransmissions). + * We can model the additional delay with an empirical curve + * that represents its distribution. + * + * cumulative probability + * 1.0 ^ + * | + * L +-- loss-level x + * | ****** + * | * + * | ***** + * | * + * | ** + * | * + * +-------*-------------------> + * delay + * + * The empirical curve may have both vertical and horizontal lines. + * Vertical lines represent constant delay for a range of + * probabilities; horizontal lines correspond to a discontinuty + * in the delay distribution: the pipe will use the largest delay + * for a given probability. + * + * To pass the curve to dummynet, we must store the parameters + * in a file as described below, and issue the command + * + * ipfw pipe config ... bw XXX profile ... + * + * The file format is the following, with whitespace acting as + * a separator and '#' indicating the beginning a comment: + * + * samples N + * the number of samples used in the internal + * representation (2..1024; default 100); + * + * loss-level L + * The probability above which packets are lost. + * (0.0 <= L <= 1.0, default 1.0 i.e. no loss); + * + * name identifier + * Optional a name (listed by "ipfw pipe show") + * to identify the distribution; + * + * "delay prob" | "prob delay" + * One of these two lines is mandatory and defines + * the format of the following lines with data points. + * + * XXX YYY + * 2 or more lines representing points in the curve, + * with either delay or probability first, according + * to the chosen format. + * The unit for delay is milliseconds. + * + * Data points does not need to be ordered or equal to the number + * specified in the "samples" line. ipfw will sort and interpolate + * the curve as needed. + * + * Example of a profile file: + + name bla_bla_bla + samples 100 + loss-level 0.86 + prob delay + 0 200 # minimum overhead is 200ms + 0.5 200 + 0.5 300 + 0.8 1000 + 0.9 1300 + 1 1300 + + * Internally, we will convert the curve to a fixed number of + * samples, and when it is time to transmit a packet we will + * model the extra delay as extra bits in the packet. + * + */ + +#define ED_MAX_LINE_LEN 256+ED_MAX_NAME_LEN +#define ED_TOK_SAMPLES "samples" +#define ED_TOK_LOSS "loss-level" +#define ED_TOK_NAME "name" +#define ED_TOK_DELAY "delay" +#define ED_TOK_PROB "prob" +#define ED_SEPARATORS " \t\n" +#define ED_MIN_SAMPLES_NO 2 + +/* + * returns 1 if s is a non-negative number, with at least one '.' + */ +static int +is_valid_number(const char *s) +{ + int i, dots_found = 0; + int len = strlen(s); + + for (i = 0; i 1)) + return 0; + return 1; +} + +struct point { + double prob; + double delay; +}; + +int +compare_points(const void *vp1, const void *vp2) +{ + const struct point *p1 = vp1; + const struct point *p2 = vp2; + double res = 0; + + res = p1->prob - p2->prob; + if (res == 0) + res = p1->delay - p2->delay; + if (res < 0) + return -1; + else if (res > 0) + return 1; + else + return 0; +} + +#define ED_EFMT(s) EX_DATAERR,"error in %s at line %d: "#s,filename,lineno + +static void +load_extra_delays(const char *filename, struct dn_pipe *p) +{ + char line[ED_MAX_LINE_LEN]; + FILE *f; + int lineno = 0; + int i; + + int samples = -1; + double loss = -1.0; + char profile_name[ED_MAX_NAME_LEN]; + int delay_first = -1; + int do_points = 0; + struct point points[ED_MAX_SAMPLES_NO]; + int points_no = 0; + + profile_name[0] = '\0'; + f = fopen(filename, "r"); + if (f == NULL) + err(EX_UNAVAILABLE, "fopen: %s", filename); + + while (fgets(line, ED_MAX_LINE_LEN, f)) { /* read commands */ + char *s, *cur = line, *name = NULL, *arg = NULL; + + ++lineno; + + /* parse the line */ + while (cur) { + s = strsep(&cur, ED_SEPARATORS); + if (s == NULL || *s == '#') + break; + if (*s == '\0') + continue; + if (arg) + errx(ED_EFMT("too many arguments")); + if (name == NULL) + name = s; + else + arg = s; + } + if (name == NULL) /* empty line */ + continue; + if (arg == NULL) + errx(ED_EFMT("missing arg for %s"), name); + + if (!strcasecmp(name, ED_TOK_SAMPLES)) { + if (samples > 0) + errx(ED_EFMT("duplicate ``samples'' line")); + if (atoi(arg) <=0) + errx(ED_EFMT("invalid number of samples")); + samples = atoi(arg); + if (samples>ED_MAX_SAMPLES_NO) + errx(ED_EFMT("too many samples, maximum is %d"), + ED_MAX_SAMPLES_NO); + do_points = 0; + } else if (!strcasecmp(name, ED_TOK_LOSS)) { + if (loss != -1.0) + errx(ED_EFMT("duplicated token: %s"), name); + if (!is_valid_number(arg)) + errx(ED_EFMT("invalid %s"), arg); + loss = atof(arg); + if (loss > 1) + errx(ED_EFMT("%s greater than 1.0"), name); + do_points = 0; + } else if (!strcasecmp(name, ED_TOK_NAME)) { + if (profile_name[0] != '\0') + errx(ED_EFMT("duplicated token: %s"), name); + strncpy(profile_name, arg, sizeof(profile_name) - 1); + profile_name[sizeof(profile_name)-1] = '\0'; + do_points = 0; + } else if (!strcasecmp(name, ED_TOK_DELAY)) { + if (do_points) + errx(ED_EFMT("duplicated token: %s"), name); + delay_first = 1; + do_points = 1; + } else if (!strcasecmp(name, ED_TOK_PROB)) { + if (do_points) + errx(ED_EFMT("duplicated token: %s"), name); + delay_first = 0; + do_points = 1; + } else if (do_points) { + if (!is_valid_number(name) || !is_valid_number(arg)) + errx(ED_EFMT("invalid point found")); + if (delay_first) { + points[points_no].delay = atof(name); + points[points_no].prob = atof(arg); + } else { + points[points_no].delay = atof(arg); + points[points_no].prob = atof(name); + } + if (points[points_no].prob > 1.0) + errx(ED_EFMT("probability greater than 1.0")); + ++points_no; + } else { + errx(ED_EFMT("unrecognised command '%s'"), name); + } + } + + if (samples == -1) { + warnx("'%s' not found, assuming 100", ED_TOK_SAMPLES); + samples = 100; + } + + if (loss == -1.0) { + warnx("'%s' not found, assuming no loss", ED_TOK_LOSS); + loss = 1; + } + + /* make sure that there are enough points. */ + if (points_no < ED_MIN_SAMPLES_NO) + errx(ED_EFMT("too few samples, need at least %d"), + ED_MIN_SAMPLES_NO); + + qsort(points, points_no, sizeof(struct point), compare_points); + + /* interpolation */ + for (i = 0; isamples[index] = x1; + } else { + double m = (y2-y1)/(x2-x1); + double c = y1 - m*x1; + for (; indexsamples[index] = (index - c)/m; + } + } + p->samples_no = samples; + p->loss_level = loss * samples; + strncpy(p->name, profile_name, sizeof(p->name)); +} + void ipfw_config_pipe(int ac, char **av) { + int samples[ED_MAX_SAMPLES_NO]; struct dn_pipe p; int i; char *end; @@ -611,6 +903,15 @@ end_mask: ac--; av++; break; + case TOK_PIPE_PROFILE: + if (co.do_pipe != 1) + errx(EX_DATAERR, "extra delay only valid for pipes"); + NEED1("extra delay needs the file name\n"); + p.samples = &samples[0]; + load_extra_delays(av[0], &p); + --ac; ++av; + break; + default: errx(EX_DATAERR, "unrecognised option ``%s''", av[-1]); } @@ -620,6 +921,9 @@ end_mask: errx(EX_DATAERR, "pipe_nr must be > 0"); if (p.delay > 10000) errx(EX_DATAERR, "delay must be < 10000"); + if (p.samples_no > 0 && p.bandwidth == 0) + errx(EX_DATAERR, + "profile requires a bandwidth limit"); } else { /* co.do_pipe == 2, queue */ if (p.fs.parent_nr == 0) errx(EX_DATAERR, "pipe must be > 0"); @@ -713,7 +1017,18 @@ end_mask: weight *= 1 - w_q; p.fs.lookup_weight = (int)(weight * (1 << SCALE_RED)); } - i = do_cmd(IP_DUMMYNET_CONFIGURE, &p, sizeof p); + if (p.samples_no <= 0) { + i = do_cmd(IP_DUMMYNET_CONFIGURE, &p, sizeof p); + } else { + struct dn_pipe_max pm; + int len = sizeof(pm); + + memcpy(&pm.pipe, &p, sizeof(pm.pipe)); + memcpy(&pm.samples, samples, sizeof(pm.samples)); + + i = do_cmd(IP_DUMMYNET_CONFIGURE, &pm, len); + } + if (i) err(1, "setsockopt(%s)", "IP_DUMMYNET_CONFIGURE"); } Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Apr 9 12:20:37 2009 (r190864) +++ head/sbin/ipfw/ipfw.8 Thu Apr 9 12:46:00 2009 (r190865) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 5, 2009 +.Dd April 9, 2009 .Dt IPFW 8 .Os .Sh NAME @@ -1942,6 +1942,80 @@ with to reduce the granularity to 1ms or less). Default value is 0, meaning no delay. +.Pp +.It Cm profile Ar filename +A file specifying the additional overhead incurred in the transmission +of a packet on the link. +.Pp +Some link types introduce extra delays in the transmission +of a packet, e.g. because of MAC level framing, contention on +the use of the channel, MAC level retransmissions and so on. +From our point of view, the channel is effectively unavailable +for this extra time, which is constant or variable depending +on the link type. Additionally, packets may be dropped after this +time (e.g. on a wireless link after too many retransmissions). +We can model the additional delay with an empirical curve +that represents its distribution. +.Bd -literal -offset indent + cumulative probability + 1.0 ^ + | + L +-- loss-level x + | ****** + | * + | ***** + | * + | ** + | * + +-------*-------------------> + delay +.Ed +The empirical curve may have both vertical and horizontal lines. +Vertical lines represent constant delay for a range of +probabilities. +Horizontal lines correspond to a discontinuty in the delay +distribution: the pipe will use the largest delay for a +given probability. +.Pp +The file format is the following, with whitespace acting as +a separator and '#' indicating the beginning a comment: +.Bl -tag -width indent +.It Cm samples Ar N +the number of samples used in the internal +representation (2..1024; default 100); +.It Cm loss-level Ar L +The probability above which packets are lost. +(0.0 <= L <= 1.0, default 1.0 i.e. no loss); +.It Cm name Ar identifier +Optional a name (listed by "ipfw pipe show") +to identify the distribution; +.It Cm "delay prob" | "prob delay" +One of these two lines is mandatory and defines +the format of the following lines with data points. +.It Ar XXX Ar YYY +2 or more lines representing points in the curve, +with either delay or probability first, according +to the chosen format. +The unit for delay is milliseconds. +Data points do not need to be ordered or equal to the number +specified in the "samples" line. ipfw will sort and interpolate +the curve as needed. +.El +.Pp +Example of a profile file: +.Bd -literal -offset indent +name bla_bla_bla +samples 100 +loss-level 0.86 +prob delay +0 200 # minimum overhead is 200ms +0.5 200 +0.5 300 +0.8 1000 +0.9 1300 +1 1300 +#configuration file end +.Ed .El .Pp The following parameters can be configured for a queue: @@ -2917,10 +2991,17 @@ API based upon code written by .An Daniel Boulet for BSDI. .Pp +Dummynet has been introduced by Luigi Rizzo in 1997-1998. +.Pp Some early work (1999-2000) on the .Nm dummynet traffic shaper supported by Akamba Corp. .Pp +The ipfw core (ipfw2) has been completely redesigned and +reimplemented by Luigi Rizzo in summer 2002. Further +actions and +options have been added by various developer over the years. +.Pp .An -nosplit In-kernel NAT support written by .An Paolo Pisati Aq piso@FreeBSD.org @@ -2933,6 +3014,10 @@ support has been developed by The primary developers and maintainers are David Hayes and Jason But. For further information visit: .Aq http://www.caia.swin.edu.au/urp/SONATA +.Pp +Delay profiles have been developed by Alessandro Cerri and +Luigi Rizzo, supported by the +European Commission within Projects Onelab and Onelab2. .Sh BUGS The syntax has grown over the years and sometimes it might be confusing. Unfortunately, backward compatibility prevents cleaning up mistakes Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Thu Apr 9 12:20:37 2009 (r190864) +++ head/sbin/ipfw/ipfw2.h Thu Apr 9 12:46:00 2009 (r190865) @@ -153,6 +153,7 @@ enum tokens { TOK_MASK, TOK_BW, TOK_DELAY, + TOK_PIPE_PROFILE, TOK_RED, TOK_GRED, TOK_DROPTAIL, Modified: head/sys/netinet/ip_dummynet.c ============================================================================== --- head/sys/netinet/ip_dummynet.c Thu Apr 9 12:20:37 2009 (r190864) +++ head/sys/netinet/ip_dummynet.c Thu Apr 9 12:46:00 2009 (r190865) @@ -519,14 +519,64 @@ transmit_event(struct dn_pipe *pipe, str } } +#define div64(a, b) ((int64_t)(a) / (int64_t)(b)) +#define DN_TO_DROP 0xffff /* - * the following macro computes how many ticks we have to wait - * before being able to transmit a packet. The credit is taken from - * either a pipe (WF2Q) or a flow_queue (per-flow queueing) - */ -#define SET_TICKS(_m, q, p) \ - ((_m)->m_pkthdr.len * 8 * hz - (q)->numbytes + p->bandwidth - 1) / \ - p->bandwidth; + * Compute how many ticks we have to wait before being able to send + * a packet. This is computed as the "wire time" for the packet + * (length + extra bits), minus the credit available, scaled to ticks. + * Check that the result is not be negative (it could be if we have + * too much leftover credit in q->numbytes). + */ +static inline dn_key +set_ticks(struct mbuf *m, struct dn_flow_queue *q, struct dn_pipe *p) +{ + int64_t ret; + + ret = div64( (m->m_pkthdr.len * 8 + q->extra_bits) * hz + - q->numbytes + p->bandwidth - 1 , p->bandwidth); +#if 0 + printf("%s %d extra_bits %d numb %d ret %d\n", + __FUNCTION__, __LINE__, + (int)(q->extra_bits & 0xffffffff), + (int)(q->numbytes & 0xffffffff), + (int)(ret & 0xffffffff)); +#endif + if (ret < 0) + ret = 0; + return ret; +} + +/* + * Convert the additional MAC overheads/delays into an equivalent + * number of bits for the given data rate. The samples are in milliseconds + * so we need to divide by 1000. + */ +static dn_key +compute_extra_bits(struct mbuf *pkt, struct dn_pipe *p) +{ + int index; + dn_key extra_bits; + + if (!p->samples || p->samples_no == 0) + return 0; + index = random() % p->samples_no; + extra_bits = ((dn_key)p->samples[index] * p->bandwidth) / 1000; + if (index >= p->loss_level) { + struct dn_pkt_tag *dt = dn_tag_get(pkt); + if (dt) + dt->dn_dir = DN_TO_DROP; + } + return extra_bits; +} + +static void +free_pipe(struct dn_pipe *p) +{ + if (p->samples) + free(p->samples, M_DUMMYNET); + free(p, M_DUMMYNET); +} /* * extract pkt from queue, compute output time (could be now) @@ -585,12 +635,16 @@ ready_event(struct dn_flow_queue *q, str q->numbytes += (curr_time - q->sched_time) * p->bandwidth; while ((pkt = q->head) != NULL) { int len = pkt->m_pkthdr.len; - int len_scaled = p->bandwidth ? len * 8 * hz : 0; + dn_key len_scaled = p->bandwidth ? len*8*hz + + q->extra_bits*hz + : 0; - if (len_scaled > q->numbytes) + if (DN_KEY_GT(len_scaled, q->numbytes)) break; q->numbytes -= len_scaled; move_pkt(pkt, q, p, len); + if (q->head) + q->extra_bits = compute_extra_bits(q->head, p); } /* * If we have more packets queued, schedule next ready event @@ -600,7 +654,7 @@ ready_event(struct dn_flow_queue *q, str * ticks to go for the finish time of the packet. */ if ((pkt = q->head) != NULL) { /* this implies bandwidth != 0 */ - dn_key t = SET_TICKS(pkt, q, p); /* ticks i have to wait */ + dn_key t = set_ticks(pkt, q, p); /* ticks i have to wait */ q->sched_time = curr_time; heap_insert(&ready_heap, curr_time + t, (void *)q); @@ -933,6 +987,12 @@ dummynet_send(struct mbuf *m) case DN_TO_ETH_OUT: ether_output_frame(pkt->ifp, m); break; + + case DN_TO_DROP: + /* drop the packet after some time */ + m_freem(m); + break; + default: printf("dummynet: bad switch %d!\n", pkt->dn_dir); m_freem(m); @@ -1367,8 +1427,10 @@ dummynet_io(struct mbuf **m0, int dir, s /* Fixed-rate queue: just insert into the ready_heap. */ dn_key t = 0; - if (pipe->bandwidth && m->m_pkthdr.len * 8 * hz > q->numbytes) - t = SET_TICKS(m, q, pipe); + if (pipe->bandwidth) { + q->extra_bits = compute_extra_bits(m, pipe); + t = set_ticks(m, q, pipe); + } q->sched_time = curr_time; if (t == 0) /* Must process it now. */ ready_event(q, &head, &tail); @@ -1555,7 +1617,7 @@ dummynet_flush(void) SLIST_FOREACH_SAFE(pipe, &pipehash[i], next, pipe1) { SLIST_REMOVE(&pipehash[i], pipe, dn_pipe, next); purge_pipe(pipe); - free(pipe, M_DUMMYNET); + free_pipe(pipe); } DUMMYNET_UNLOCK(); } @@ -1775,11 +1837,38 @@ config_pipe(struct dn_pipe *p) pipe->delay = p->delay; set_fs_parms(&(pipe->fs), pfs); + /* Handle changes in the delay profile. */ + if (p->samples_no > 0) { + if (pipe->samples_no != p->samples_no) { + if (pipe->samples != NULL) + free(pipe->samples, M_DUMMYNET); + pipe->samples = + malloc(p->samples_no*sizeof(dn_key), + M_DUMMYNET, M_NOWAIT | M_ZERO); + if (pipe->samples == NULL) { + DUMMYNET_UNLOCK(); + printf("dummynet: no memory " + "for new samples\n"); + return (ENOMEM); + } + pipe->samples_no = p->samples_no; + } + + strncpy(pipe->name,p->name,sizeof(pipe->name)); + pipe->loss_level = p->loss_level; + for (i = 0; isamples_no; ++i) + pipe->samples[i] = p->samples[i]; + } else if (pipe->samples != NULL) { + free(pipe->samples, M_DUMMYNET); + pipe->samples = NULL; + pipe->samples_no = 0; + } + if (pipe->fs.rq == NULL) { /* a new pipe */ error = alloc_hash(&(pipe->fs), pfs); if (error) { DUMMYNET_UNLOCK(); - free(pipe, M_DUMMYNET); + free_pipe(pipe); return (error); } SLIST_INSERT_HEAD(&pipehash[HASH(pipe->pipe_nr)], @@ -1957,7 +2046,7 @@ delete_pipe(struct dn_pipe *p) pipe_remove_from_heap(&wfq_ready_heap, pipe); DUMMYNET_UNLOCK(); - free(pipe, M_DUMMYNET); + free_pipe(pipe); } else { /* this is a WF2Q queue (dn_flow_set) */ struct dn_flow_set *fs; @@ -2095,6 +2184,7 @@ dummynet_get(struct sockopt *sopt) pipe_bp->fs.next.sle_next = NULL; pipe_bp->fs.pipe = NULL; pipe_bp->fs.rq = NULL; + pipe_bp->samples = NULL; bp += sizeof(*pipe) ; bp = dn_copy_set(&(pipe->fs), bp); @@ -2127,7 +2217,8 @@ static int ip_dn_ctl(struct sockopt *sopt) { int error = 0 ; - struct dn_pipe *p, tmp_pipe; + struct dn_pipe *p; + struct dn_pipe_max tmp_pipe; /* pipe + large buffer */ error = priv_check(sopt->sopt_td, PRIV_NETINET_DUMMYNET); if (error) @@ -2159,15 +2250,18 @@ ip_dn_ctl(struct sockopt *sopt) break ; case IP_DUMMYNET_CONFIGURE : - p = &tmp_pipe ; - error = sooptcopyin(sopt, p, sizeof *p, sizeof *p); + p = (struct dn_pipe *)&tmp_pipe ; + error = sooptcopyin(sopt, p, sizeof(tmp_pipe), sizeof *p); if (error) break ; + if (p->samples_no > 0) + p->samples = &tmp_pipe.samples[0]; + error = config_pipe(p); break ; case IP_DUMMYNET_DEL : /* remove a pipe or queue */ - p = &tmp_pipe ; + p = (struct dn_pipe *)&tmp_pipe ; error = sooptcopyin(sopt, p, sizeof *p, sizeof *p); if (error) break ; Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Thu Apr 9 12:20:37 2009 (r190864) +++ head/sys/netinet/ip_dummynet.h Thu Apr 9 12:46:00 2009 (r190865) @@ -204,7 +204,18 @@ struct dn_flow_queue { struct mbuf *head, *tail ; /* queue of packets */ u_int len ; u_int len_bytes ; - u_long numbytes ; /* credit for transmission (dynamic queues) */ + + /* + * When we emulate MAC overheads, or channel unavailability due + * to other traffic on a shared medium, we augment the packet at + * the head of the queue with an 'extra_bits' field representsing + * the additional delay the packet will be subject to: + * extra_bits = bw*unavailable_time. + * With large bandwidth and large delays, extra_bits (and also numbytes) + * can become very large, so better play safe and use 64 bit + */ + dn_key numbytes ; /* credit for transmission (dynamic queues) */ + dn_key extra_bits; /* extra bits simulating unavailable channel */ u_int64_t tot_pkts ; /* statistics counters */ u_int64_t tot_bytes ; @@ -252,6 +263,7 @@ struct dn_flow_set { #define DN_IS_GENTLE_RED 0x0004 #define DN_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */ #define DN_NOERROR 0x0010 /* do not report ENOBUFS on drops */ +#define DN_HAS_PROFILE 0x0020 /* the pipe has a delay profile. */ #define DN_IS_PIPE 0x4000 #define DN_IS_QUEUE 0x8000 @@ -324,7 +336,9 @@ struct dn_pipe { /* a pipe */ dn_key V ; /* virtual time */ int sum; /* sum of weights of all active sessions */ - int numbytes; /* bits I can transmit (more or less). */ + + /* Same as in dn_flow_queue, numbytes can become large */ + dn_key numbytes; /* bits I can transmit (more or less). */ dn_key sched_time ; /* time pipe was scheduled in ready_heap */ @@ -337,7 +351,25 @@ struct dn_pipe { /* a pipe */ int ready ; /* set if ifp != NULL and we got a signal from it */ struct dn_flow_set fs ; /* used with fixed-rate flows */ + + /* fields to simulate a delay profile */ + +#define ED_MAX_NAME_LEN 32 + char name[ED_MAX_NAME_LEN]; + int loss_level; + int samples_no; + int *samples; }; + +/* dn_pipe_max is used to pass pipe configuration from userland onto + * kernel space and back + */ +#define ED_MAX_SAMPLES_NO 1024 +struct dn_pipe_max { + struct dn_pipe pipe; + int samples[ED_MAX_SAMPLES_NO]; +}; + SLIST_HEAD(dn_pipe_head, dn_pipe); #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 13:02:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A06CC106566B; Thu, 9 Apr 2009 13:02:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7F88FC1F; Thu, 9 Apr 2009 13:02:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39D2tX4005106; Thu, 9 Apr 2009 13:02:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39D2t2C005105; Thu, 9 Apr 2009 13:02:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200904091302.n39D2t2C005105@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 9 Apr 2009 13:02: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: r190866 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 13:02:56 -0000 Author: luigi Date: Thu Apr 9 13:02:55 2009 New Revision: 190866 URL: http://svn.freebsd.org/changeset/base/190866 Log: Bump version after changes in the userland/kernel ABI for dummynet (plain ipfw rules unchanged) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Apr 9 12:46:00 2009 (r190865) +++ head/sys/sys/param.h Thu Apr 9 13:02:55 2009 (r190866) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800075 /* Master, propagated to newvers */ +#define __FreeBSD_version 800076 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 13:26:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35BDB10656C2; Thu, 9 Apr 2009 13:26:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C87208FC25; Thu, 9 Apr 2009 13:25:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 56E6946B09; Thu, 9 Apr 2009 09:25:59 -0400 (EDT) Date: Thu, 9 Apr 2009 14:25:59 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <200904091246.n39Ck05i004627@svn.freebsd.org> Message-ID: References: <200904091246.n39Ck05i004627@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190865 - in head: sbin/ipfw sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 13:26:01 -0000 On Thu, 9 Apr 2009, Luigi Rizzo wrote: > Note- this commit changes the userland/kernel ABI for pipes > (but not for ordinary firewall rules) so you need to rebuild > kernel and /sbin/ipfw to use dummynet features. > > Please check the manpage for details on the new feature. > > The MFC would be trivial but it breaks the ABI, so it will > be postponed until after 7.2 is released. Under our more strict but relatively undocumented -STABLE ABI rules, this sort of change is no longer permitted. Is there really no way to do this without breaking the ABI for the purposes of making it more gently MFCable? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 13:45:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C32AF1065672; Thu, 9 Apr 2009 13:45:53 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7BAC68FC1F; Thu, 9 Apr 2009 13:45:53 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Lru48-00051Z-SA; Thu, 09 Apr 2009 17:13:12 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 678727AEE; Thu, 9 Apr 2009 17:13:23 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 887F610883A; Thu, 9 Apr 2009 17:12:53 +0400 (MSD) Date: Thu, 9 Apr 2009 17:12:53 +0400 From: Dmitry Marakasov To: Dag-Erling Smorgrav Message-ID: <20090409131253.GB7795@hades.panopticon> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <200903191248.n2JCm0Rd061331@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 13:45:54 -0000 * Dag-Erling Smorgrav (des@FreeBSD.org) wrote: > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Thu Mar 19 12:39:13 2009 (r190030) > +++ head/etc/defaults/rc.conf Thu Mar 19 12:48:00 2009 (r190031) > @@ -101,7 +101,7 @@ nisdomainname="NO" # Set to NIS domain > dhclient_program="/sbin/dhclient" # Path to dhcp client program. > dhclient_flags="" # Extra flags to pass to dhcp client. > #dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only > -background_dhclient="YES" # Start dhcp client in the background. > +background_dhclient="NO" # Start dhcp client in the background. > #background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. > synchronous_dhclient="NO" # Start dhclient directly on configured > # interfaces during startup. Shouldn't synchronous_dhclient be ON by default then? The way it is, DHCP is not used at all, I ended up with unreachable box which didn't get any IP already. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 13:56:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D52A5106566B; Thu, 9 Apr 2009 13:56:23 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 904D98FC14; Thu, 9 Apr 2009 13:56:23 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 5511273098; Thu, 9 Apr 2009 16:01:29 +0200 (CEST) Date: Thu, 9 Apr 2009 16:01:29 +0200 From: Luigi Rizzo To: Robert Watson Message-ID: <20090409140129.GA58389@onelab2.iet.unipi.it> References: <200904091246.n39Ck05i004627@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r190865 - in head: sbin/ipfw sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 13:56:24 -0000 On Thu, Apr 09, 2009 at 02:25:59PM +0100, Robert Watson wrote: > On Thu, 9 Apr 2009, Luigi Rizzo wrote: > > > Note- this commit changes the userland/kernel ABI for pipes > > (but not for ordinary firewall rules) so you need to rebuild > > kernel and /sbin/ipfw to use dummynet features. > > > > Please check the manpage for details on the new feature. > > > > The MFC would be trivial but it breaks the ABI, so it will > > be postponed until after 7.2 is released. > > Under our more strict but relatively undocumented -STABLE ABI rules, this > sort of change is no longer permitted. Is there really no way to do this > without breaking the ABI for the purposes of making it more gently MFCable? There is always a way, and it is to provide, within the kernel, some translation glue so that requests issued in "ancient greek" (i.e. the old ABI) will still be accepted and answered properly. while at the same time provide a new ABI that supports the new functionalities. This is what will be done eventually. For now, it is not my intention to do the MFC of _this_ version of the code, it was more a comment for people who asked me this feature on RELENG_7. Unfortunately the "struct dn_pipe" and "struct dn_flow_queue" are not particularly well designed for extensibility (my fault, but it was 10 years ago). Also note that the version in RELENG_7 will definitely need an update because some numeric fields are 32-bit and in this age of Gbit/s links and GHz CPUs are in constant danger of overflow (with the code going to great lengths to minimize the problems). The planned course of action before the MFC is: + add a version/len field to the structure(s) to improve ABI compatibility, as it was done in 2002 for ipfw; + separate the kernel-only information from the one visible to userland, so the ABI problems will be less likely to appear again; Once this is done and stabilized, I will try to do an MFC that, among other things, will use a new sockopt for the new ABI, and include the translation glue for the old ABI. cheers luigi From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 15:39:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C37421065705; Thu, 9 Apr 2009 15:39:18 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0D98FC20; Thu, 9 Apr 2009 15:39:18 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n39Fc6Zl084533; Thu, 9 Apr 2009 10:38:06 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n39Fc6Lo084532; Thu, 9 Apr 2009 10:38:06 -0500 (CDT) (envelope-from brooks) Date: Thu, 9 Apr 2009 10:38:05 -0500 From: Brooks Davis To: Dmitry Marakasov Message-ID: <20090409153805.GB83847@lor.one-eyed-alien.net> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <20090409131253.GB7795@hades.panopticon> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 09 Apr 2009 10:38:06 -0500 (CDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dag-Erling Smorgrav Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 15:39:20 -0000 --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 09, 2009 at 05:12:53PM +0400, Dmitry Marakasov wrote: > * Dag-Erling Smorgrav (des@FreeBSD.org) wrote: >=20 > > Modified: head/etc/defaults/rc.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/etc/defaults/rc.conf Thu Mar 19 12:39:13 2009 (r190030) > > +++ head/etc/defaults/rc.conf Thu Mar 19 12:48:00 2009 (r190031) > > @@ -101,7 +101,7 @@ nisdomainname=3D"NO" # Set to NIS domain=20 > > dhclient_program=3D"/sbin/dhclient" # Path to dhcp client program. > > dhclient_flags=3D"" # Extra flags to pass to dhcp client. > > #dhclient_flags_fxp0=3D"" # Extra dhclient flags for fxp0 only > > -background_dhclient=3D"YES" # Start dhcp client in the background. > > +background_dhclient=3D"NO" # Start dhcp client in the background. > > #background_dhclient_fxp0=3D"YES" # Start dhcp client on fxp0 in the b= ackground. > > synchronous_dhclient=3D"NO" # Start dhclient directly on configured > > # interfaces during startup. >=20 > Shouldn't synchronous_dhclient be ON by default then? The way it > is, DHCP is not used at all, I ended up with unreachable box which > didn't get any IP already. Unless you have one of the few interfaces that does not generate link status events, dhclient will be started by devd. The only ones I know of are a subset set of ed(4) devices, though I think imp may have fixed those recently with a stub ifmedia interface. -- Brooks --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJ3hZdXY6L6fI4GtQRAon7AKDiSUZSLPl/+L1LP7YDY0PYmmt5DACgxVNw 4HPWIi7X7qQAGb/21W3/Zbc= =qmtm -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 15:43:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B098106564A; Thu, 9 Apr 2009 15:43:34 +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 087378FC14; Thu, 9 Apr 2009 15:43:33 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id EF5F21CD73; Thu, 9 Apr 2009 17:43:32 +0200 (CEST) Date: Thu, 9 Apr 2009 17:43:32 +0200 From: Ed Schouten To: Ruslan Ermilov Message-ID: <20090409154332.GL32098@hoeg.nl> References: <200904091220.n39CKbiA004028@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j3olVFx0FsM75XyV" Content-Disposition: inline In-Reply-To: <200904091220.n39CKbiA004028@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190864 - in head: . usr.sbin usr.sbin/slstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 15:43:35 -0000 --j3olVFx0FsM75XyV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ruslan Ermilov wrote: > Removed more vestiges of if_sl(4). Ah, thanks. It looks like I was a little sloppy. --=20 Ed Schouten WWW: http://80386.nl/ --j3olVFx0FsM75XyV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkneF6QACgkQ52SDGA2eCwWexACeOTdUvCp/9+7u4pM+K6WFzgGV 5MMAnAndn2/1ecB3pmmmAlXmNYTQlhQ2 =9T6z -----END PGP SIGNATURE----- --j3olVFx0FsM75XyV-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 15:51:58 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41006106566B; Thu, 9 Apr 2009 15:51:58 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id EBA6F8FC19; Thu, 9 Apr 2009 15:51:57 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LrwXm-00017i-CM; Thu, 09 Apr 2009 19:51:58 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id B13B37C9A; Thu, 9 Apr 2009 19:52:08 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id 56EAE10883A; Thu, 9 Apr 2009 19:51:38 +0400 (MSD) Date: Thu, 9 Apr 2009 19:51:38 +0400 From: Dmitry Marakasov To: Brooks Davis Message-ID: <20090409155138.GD7795@hades.panopticon> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20090409153805.GB83847@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dag-Erling Smorgrav Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 15:51:58 -0000 * Brooks Davis (brooks@FreeBSD.org) wrote: > > Shouldn't synchronous_dhclient be ON by default then? The way it > > is, DHCP is not used at all, I ended up with unreachable box which > > didn't get any IP already. > > Unless you have one of the few interfaces that does not generate > link status events, dhclient will be started by devd. The only ones I > know of are a subset set of ed(4) devices, though I think imp may have > fixed those recently with a stub ifmedia interface. I use ale(4). Will test some more. Couldn't the fact that the interface is renamed be the reason? Also, how is the issue of services not starting because of no default route/dns/network available solved when running dhclient from devd? -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 16:17:01 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 471F7106566B; Thu, 9 Apr 2009 16:17:01 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id EFD488FC17; Thu, 9 Apr 2009 16:17:00 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n39GFnW3084865; Thu, 9 Apr 2009 11:15:49 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n39GFnCL084864; Thu, 9 Apr 2009 11:15:49 -0500 (CDT) (envelope-from brooks) Date: Thu, 9 Apr 2009 11:15:49 -0500 From: Brooks Davis To: Dmitry Marakasov Message-ID: <20090409161549.GC83847@lor.one-eyed-alien.net> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> <20090409155138.GD7795@hades.panopticon> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NKoe5XOeduwbEQHU" Content-Disposition: inline In-Reply-To: <20090409155138.GD7795@hades.panopticon> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 09 Apr 2009 11:15:49 -0500 (CDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dag-Erling Smorgrav Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 16:17:01 -0000 --NKoe5XOeduwbEQHU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 09, 2009 at 07:51:38PM +0400, Dmitry Marakasov wrote: > * Brooks Davis (brooks@FreeBSD.org) wrote: >=20 > > > Shouldn't synchronous_dhclient be ON by default then? The way it > > > is, DHCP is not used at all, I ended up with unreachable box which > > > didn't get any IP already. > >=20 > > Unless you have one of the few interfaces that does not generate > > link status events, dhclient will be started by devd. The only ones I > > know of are a subset set of ed(4) devices, though I think imp may have > > fixed those recently with a stub ifmedia interface. >=20 > I use ale(4). Will test some more. Couldn't the fact that the interface > is renamed be the reason? Shouldn't be. I use renamed interfaces a fair bit. The ale(4) driver uses mii, but so lack of link events shouldn't be an issue unless the driver is buggy. > Also, how is the issue of services not starting because of no default > route/dns/network available solved when running dhclient from devd? The wait in /etc/rc.d/defaultroute. -- Brooks --NKoe5XOeduwbEQHU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJ3h80XY6L6fI4GtQRAiRlAJ9Sm9ZNyOdEXoq2crHB8vA8TALWfwCgzNxb vmgPdR0mnxLDDVY4RUXtggs= =+j6g -----END PGP SIGNATURE----- --NKoe5XOeduwbEQHU-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 16:54:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5BE106564A; Thu, 9 Apr 2009 16:54:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0BF8FC14; Thu, 9 Apr 2009 16:53:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39GrxqA010355; Thu, 9 Apr 2009 16:53:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39GrxWW010354; Thu, 9 Apr 2009 16:53:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904091653.n39GrxWW010354@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Apr 2009 16:53: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: r190867 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 16:54:00 -0000 Author: sam Date: Thu Apr 9 16:53:59 2009 New Revision: 190867 URL: http://svn.freebsd.org/changeset/base/190867 Log: check the method pointer before invoking ah_eepromDetach as it can be null if attach work fails before hooking up the eeprom support Obtained from: madwifi Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Apr 9 13:02:55 2009 (r190866) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Apr 9 16:53:59 2009 (r190867) @@ -333,8 +333,10 @@ struct ath_hal_private { #define ath_hal_disablePCIE(_ah) \ (_ah)->ah_disablePCIE(_ah) -#define ath_hal_eepromDetach(_ah) \ - AH_PRIVATE(_ah)->ah_eepromDetach(_ah) +#define ath_hal_eepromDetach(_ah) do { \ + if (AH_PRIVATE(_ah)->ah_eepromDetach != AH_NULL) \ + AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \ +} while (0) #define ath_hal_eepromGet(_ah, _param, _val) \ AH_PRIVATE(_ah)->ah_eepromGet(_ah, _param, _val) #define ath_hal_eepromSet(_ah, _param, _val) \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 18:22:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 081E010656BB; Thu, 9 Apr 2009 18:22:52 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA28E8FC15; Thu, 9 Apr 2009 18:22:51 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39IMp8j013185; Thu, 9 Apr 2009 18:22:51 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39IMp0x013184; Thu, 9 Apr 2009 18:22:51 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904091822.n39IMp0x013184@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 9 Apr 2009 18:22: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: r190868 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 18:22:52 -0000 Author: emax Date: Thu Apr 9 18:22:51 2009 New Revision: 190868 URL: http://svn.freebsd.org/changeset/base/190868 Log: Remove obsolete/bogus layering. Reviewed by: freebsd-current@, freebsd-hackers@ MFC after: 1 week Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Thu Apr 9 16:53:59 2009 (r190867) +++ head/sys/dev/syscons/syscons.c Thu Apr 9 18:22:51 2009 (r190868) @@ -173,7 +173,6 @@ static void scshutdown(void *arg, int ho static u_int scgetc(sc_softc_t *sc, u_int flags); #define SCGETC_CN 1 #define SCGETC_NONBLOCK 2 -static int sccngetch(int flags); static void sccnupdate(scr_stat *scp); static scr_stat *alloc_scp(sc_softc_t *sc, int vty); static void init_scp(sc_softc_t *sc, int vty, scr_stat *scp); @@ -1533,12 +1532,6 @@ sc_cnputc(struct consdev *cd, int c) static int sc_cngetc(struct consdev *cd) { - return sccngetch(SCGETC_NONBLOCK); -} - -static int -sccngetch(int flags) -{ static struct fkeytab fkey; static int fkeycp; scr_stat *scp; @@ -1579,7 +1572,7 @@ sccngetch(int flags) kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); kbdd_poll(scp->sc->kbd, TRUE); - c = scgetc(scp->sc, SCGETC_CN | flags); + c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK); kbdd_poll(scp->sc->kbd, FALSE); scp->kbd_mode = cur_mode; From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 18:31:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C50BB10656D9; Thu, 9 Apr 2009 18:31:33 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2C398FC08; Thu, 9 Apr 2009 18:31:33 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39IVXNQ013506; Thu, 9 Apr 2009 18:31:33 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39IVX0t013505; Thu, 9 Apr 2009 18:31:33 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904091831.n39IVX0t013505@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 9 Apr 2009 18:31: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: r190869 - head/sys/dev/kbd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 18:31:34 -0000 Author: emax Date: Thu Apr 9 18:31:33 2009 New Revision: 190869 URL: http://svn.freebsd.org/changeset/base/190869 Log: Introduce KB_POLLED flag to struct keyboard's kb_flags field. Reviewed by: freebsd-current@, freebsd-hackers@ MFC after: 1 week Modified: head/sys/dev/kbd/kbdreg.h Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Thu Apr 9 18:22:51 2009 (r190868) +++ head/sys/dev/kbd/kbdreg.h Thu Apr 9 18:31:33 2009 (r190869) @@ -60,6 +60,7 @@ struct keyboard { #define KB_INITIALIZED (1 << 19) /* device initialized */ #define KB_REGISTERED (1 << 20) /* device registered to kbdio */ #define KB_BUSY (1 << 21) /* device used by a client */ +#define KB_POLLED (1 << 22) /* device is polled */ int kb_active; /* 0: inactive */ void *kb_token; /* id of the current client */ keyboard_callback_t kb_callback;/* callback function */ @@ -107,6 +108,9 @@ struct keyboard { #define KBD_IS_BUSY(k) ((k)->kb_flags & KB_BUSY) #define KBD_BUSY(k) ((k)->kb_flags |= KB_BUSY) #define KBD_UNBUSY(k) ((k)->kb_flags &= ~KB_BUSY) +#define KBD_IS_POLLED(k) ((k)->kb_flags & KB_POLLED) +#define KBD_POLL(k) ((k)->kb_flags |= KB_POLLED) +#define KBD_UNPOLL(k) ((k)->kb_flags &= ~KB_POLLED) #define KBD_IS_ACTIVE(k) ((k)->kb_active) #define KBD_ACTIVATE(k) (++(k)->kb_active) #define KBD_DEACTIVATE(k) (--(k)->kb_active) From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 19:11:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0C51065673; Thu, 9 Apr 2009 19:11:09 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082D88FC1C; Thu, 9 Apr 2009 19:11:09 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39JB8Hc014866; Thu, 9 Apr 2009 19:11:08 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39JB8sU014865; Thu, 9 Apr 2009 19:11:08 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904091911.n39JB8sU014865@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 9 Apr 2009 19:11: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: r190870 - head/sys/dev/kbd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 19:11:09 -0000 Author: emax Date: Thu Apr 9 19:11:08 2009 New Revision: 190870 URL: http://svn.freebsd.org/changeset/base/190870 Log: Whitespace nitpicking MFC after: 1 week Modified: head/sys/dev/kbd/kbdreg.h Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Thu Apr 9 18:31:33 2009 (r190869) +++ head/sys/dev/kbd/kbdreg.h Thu Apr 9 19:11:08 2009 (r190870) @@ -174,7 +174,7 @@ typedef struct keyboard_switch { (*kbdsw[(kbd)->kb_index]->intr)((kbd), (arg)) #define kbdd_test_if(kbd) \ (*kbdsw[(kbd)->kb_index]->test_if)((kbd)) -#define kbdd_enable(kbd) \ +#define kbdd_enable(kbd) \ (*kbdsw[(kbd)->kb_index]->enable)((kbd)) #define kbdd_disable(kbd) \ (*kbdsw[(kbd)->kb_index]->disable)((kbd)) @@ -198,7 +198,7 @@ typedef struct keyboard_switch { (*kbdsw[(kbd)->kb_index]->get_state)((kbd), (buf), (len)) #define kbdd_set_state(kbd, buf, len) \ (*kbdsw[(kbd)->kb_index]->set_state)((kbd), (buf), (len)) -#define kbdd_get_fkeystr(kbd, fkey, len) \ +#define kbdd_get_fkeystr(kbd, fkey, len) \ (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len)) #define kbdd_poll(kbd, on) \ (*kbdsw[(kbd)->kb_index]->poll)((kbd), (on)) From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 20:57:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D0D106566C; Thu, 9 Apr 2009 20:57:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B185B8FC12; Thu, 9 Apr 2009 20:57:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39KvZsV018624; Thu, 9 Apr 2009 20:57:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39KvZei018623; Thu, 9 Apr 2009 20:57:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200904092057.n39KvZei018623@svn.freebsd.org> From: Ed Maste Date: Thu, 9 Apr 2009 20:57: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: r190871 - head/lib/libc/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 20:57:36 -0000 Author: emaste Date: Thu Apr 9 20:57:35 2009 New Revision: 190871 URL: http://svn.freebsd.org/changeset/base/190871 Log: Include a space between "send" and "broadcast". Modified: head/lib/libc/rpc/clnt_bcast.c Modified: head/lib/libc/rpc/clnt_bcast.c ============================================================================== --- head/lib/libc/rpc/clnt_bcast.c Thu Apr 9 19:11:08 2009 (r190870) +++ head/lib/libc/rpc/clnt_bcast.c Thu Apr 9 20:57:35 2009 (r190871) @@ -461,7 +461,7 @@ rpc_broadcast_exp(prog, vers, proc, xarg #ifdef RPC_DEBUG perror("sendto"); #endif - warnx("clnt_bcast: cannot send" + warnx("clnt_bcast: cannot send " "broadcast packet"); stat = RPC_CANTSEND; continue; From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 00:05:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D46E106564A; Fri, 10 Apr 2009 00:05:47 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A40C8FC13; Fri, 10 Apr 2009 00:05:47 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A05llR025181; Fri, 10 Apr 2009 00:05:47 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A05lIu025175; Fri, 10 Apr 2009 00:05:47 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100005.n3A05lIu025175@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 00:05: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: r190872 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 00:05:47 -0000 Author: jfv Date: Fri Apr 10 00:05:46 2009 New Revision: 190872 URL: http://svn.freebsd.org/changeset/base/190872 Log: This delta syncs the em and igb drivers with Intel, adds header split and SCTP support into the igb driver. Various small improvements and fixes. MFC after: 2 weeks Modified: head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Thu Apr 9 20:57:35 2009 (r190871) +++ head/sys/dev/e1000/e1000_80003es2lan.c Fri Apr 10 00:05:46 2009 (r190872) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -43,9 +43,7 @@ static s32 e1000_init_phy_params_80003e static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw); -static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw); static void e1000_release_phy_80003es2lan(struct e1000_hw *hw); -static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw); static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw); static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, @@ -276,6 +274,8 @@ static s32 e1000_init_mac_params_80003es mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_80003es2lan; + /* ID LED init */ + mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ mac->ops.blink_led = e1000_blink_led_generic; /* setup LED */ @@ -802,17 +802,16 @@ static s32 e1000_get_cable_length_80003e index = phy_data & GG82563_DSPD_CABLE_LENGTH; - if (index < GG82563_CABLE_LENGTH_TABLE_SIZE + 5) { - phy->min_cable_length = e1000_gg82563_cable_length_table[index]; - phy->max_cable_length = - e1000_gg82563_cable_length_table[index+5]; - - phy->cable_length = (phy->min_cable_length + - phy->max_cable_length) / 2; - } else { + if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE + 5) { ret_val = E1000_ERR_PHY; + goto out; } + phy->min_cable_length = e1000_gg82563_cable_length_table[index]; + phy->max_cable_length = e1000_gg82563_cable_length_table[index+5]; + + phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; + out: return ret_val; } @@ -892,7 +891,7 @@ static s32 e1000_reset_hw_80003es2lan(st E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); icr = E1000_READ_REG(hw, E1000_ICR); - e1000_check_alt_mac_addr_generic(hw); + ret_val = e1000_check_alt_mac_addr_generic(hw); out: return ret_val; @@ -916,7 +915,7 @@ static s32 e1000_init_hw_80003es2lan(str e1000_initialize_hw_bits_80003es2lan(hw); /* Initialize identification LED */ - ret_val = e1000_id_led_init_generic(hw); + ret_val = mac->ops.id_led_init(hw); if (ret_val) { DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ @@ -1104,9 +1103,9 @@ static s32 e1000_copper_link_setup_gg825 /* Bypass Rx and Tx FIFO's */ ret_val = e1000_write_kmrn_reg_80003es2lan(hw, - E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, - E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | - E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS); + E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL, + E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS | + E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS); if (ret_val) goto out; @@ -1147,22 +1146,19 @@ static s32 e1000_copper_link_setup_gg825 if (!(hw->mac.ops.check_mng_mode(hw))) { /* Enable Electrical Idle on the PHY */ data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; - ret_val = hw->phy.ops.write_reg(hw, - GG82563_PHY_PWR_MGMT_CTRL, + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, data); if (ret_val) goto out; - ret_val = hw->phy.ops.read_reg(hw, - GG82563_PHY_KMRN_MODE_CTRL, - &data); - if (ret_val) - goto out; + + ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, + &data); + if (ret_val) + goto out; data &= ~GG82563_KMCR_PASS_FALSE_CARRIER; - ret_val = hw->phy.ops.write_reg(hw, - GG82563_PHY_KMRN_MODE_CTRL, + ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, data); - if (ret_val) goto out; } @@ -1261,7 +1257,6 @@ static s32 e1000_cfg_on_link_up_80003es2 DEBUGFUNC("e1000_configure_on_link_up"); if (hw->phy.media_type == e1000_media_type_copper) { - ret_val = e1000_get_speed_and_duplex_copper_generic(hw, &speed, &duplex); @@ -1393,7 +1388,8 @@ out: * using the kumeran interface. The information retrieved is stored in data. * Release the semaphore before exiting. **/ -s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data) +static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, + u16 *data) { u32 kmrnctrlsta; s32 ret_val = E1000_SUCCESS; @@ -1429,7 +1425,8 @@ out: * at the offset using the kumeran interface. Release semaphore * before exiting. **/ -s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data) +static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, + u16 data) { u32 kmrnctrlsta; s32 ret_val = E1000_SUCCESS; @@ -1461,9 +1458,19 @@ static s32 e1000_read_mac_addr_80003es2l s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_read_mac_addr_80003es2lan"); - if (e1000_check_alt_mac_addr_generic(hw)) - ret_val = e1000_read_mac_addr_generic(hw); + /* + * If there's an alternate MAC address place it in RAR0 + * so that it will override the Si installed default perm + * address. + */ + ret_val = e1000_check_alt_mac_addr_generic(hw); + if (ret_val) + goto out; + + ret_val = e1000_read_mac_addr_generic(hw); + +out: return ret_val; } Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Thu Apr 9 20:57:35 2009 (r190871) +++ head/sys/dev/e1000/e1000_82540.c Fri Apr 10 00:05:46 2009 (r190872) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -229,6 +229,8 @@ static s32 e1000_init_mac_params_82540(s mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_generic; + /* ID LED init */ + mac->ops.id_led_init = e1000_id_led_init_generic; /* setup LED */ mac->ops.setup_led = e1000_setup_led_generic; /* cleanup LED */ @@ -332,7 +334,7 @@ static s32 e1000_init_hw_82540(struct e1 DEBUGFUNC("e1000_init_hw_82540"); /* Initialize identification LED */ - ret_val = e1000_id_led_init_generic(hw); + ret_val = mac->ops.id_led_init(hw); if (ret_val) { DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Thu Apr 9 20:57:35 2009 (r190871) +++ head/sys/dev/e1000/e1000_82541.c Fri Apr 10 00:05:46 2009 (r190872) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -261,6 +261,8 @@ static s32 e1000_init_mac_params_82541(s mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_generic; + /* ID LED init */ + mac->ops.id_led_init = e1000_id_led_init_generic; /* setup LED */ mac->ops.setup_led = e1000_setup_led_82541; /* cleanup LED */ @@ -381,7 +383,7 @@ static s32 e1000_init_hw_82541(struct e1 DEBUGFUNC("e1000_init_hw_82541"); /* Initialize identification LED */ - ret_val = e1000_id_led_init_generic(hw); + ret_val = mac->ops.id_led_init(hw); if (ret_val) { DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Thu Apr 9 20:57:35 2009 (r190871) +++ head/sys/dev/e1000/e1000_82571.c Fri Apr 10 00:05:46 2009 (r190872) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ * 82573E Gigabit Ethernet Controller (Copper) * 82573L Gigabit Ethernet Controller * 82574L Gigabit Network Connection + * 82574L Gigabit Network Connection */ #include "e1000_api.h" @@ -67,11 +68,9 @@ static s32 e1000_init_hw_82571(struct e static void e1000_clear_vfta_82571(struct e1000_hw *hw); static bool e1000_check_mng_mode_82574(struct e1000_hw *hw); static s32 e1000_led_on_82574(struct e1000_hw *hw); -static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw, - u8 *mc_addr_list, u32 mc_addr_count, - u32 rar_used_count, u32 rar_count); static s32 e1000_setup_link_82571(struct e1000_hw *hw); static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw); +static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw); static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw); static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data); static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw); @@ -330,7 +329,7 @@ static s32 e1000_init_mac_params_82571(s mac->ops.check_for_link = e1000_check_for_fiber_link_generic; break; case e1000_media_type_internal_serdes: - mac->ops.check_for_link = e1000_check_for_serdes_link_generic; + mac->ops.check_for_link = e1000_check_for_serdes_link_82571; break; default: ret_val = -E1000_ERR_CONFIG; @@ -347,7 +346,7 @@ static s32 e1000_init_mac_params_82571(s break; } /* multicast address update */ - mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_82571; + mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ @@ -356,6 +355,8 @@ static s32 e1000_init_mac_params_82571(s mac->ops.mta_set = e1000_mta_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82571; + /* ID LED init */ + mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ mac->ops.blink_led = e1000_blink_led_generic; /* setup LED */ @@ -528,8 +529,14 @@ static s32 e1000_acquire_nvm_82571(struc if (ret_val) goto out; - if (hw->mac.type != e1000_82573 && hw->mac.type != e1000_82574) + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: + break; + default: ret_val = e1000_acquire_nvm_generic(hw); + break; + } if (ret_val) e1000_put_hw_semaphore_82571(hw); @@ -876,7 +883,9 @@ static s32 e1000_reset_hw_82571(struct e * Must acquire the MDIO ownership before MAC reset. * Ownership defaults to firmware after a reset. */ - if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; @@ -892,6 +901,9 @@ static s32 e1000_reset_hw_82571(struct e msec_delay(2); i++; } while (i < MDIO_OWNERSHIP_TIMEOUT); + break; + default: + break; } ctrl = E1000_READ_REG(hw, E1000_CTRL); @@ -917,15 +929,30 @@ static s32 e1000_reset_hw_82571(struct e * Need to wait for Phy configuration completion before accessing * NVM and Phy. */ - if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) + + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: msec_delay(25); + break; + default: + break; + } /* Clear any pending interrupt events. */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); icr = E1000_READ_REG(hw, E1000_ICR); - if (!(e1000_check_alt_mac_addr_generic(hw))) - e1000_set_laa_state_82571(hw, TRUE); + /* Install any alternate MAC address into RAR0 */ + ret_val = e1000_check_alt_mac_addr_generic(hw); + if (ret_val) + goto out; + + e1000_set_laa_state_82571(hw, TRUE); + + /* Reinitialize the 82571 serdes link state machine */ + if (hw->phy.media_type == e1000_media_type_internal_serdes) + hw->mac.serdes_link_state = e1000_serdes_link_down; out: return ret_val; @@ -949,7 +976,7 @@ static s32 e1000_init_hw_82571(struct e1 e1000_initialize_hw_bits_82571(hw); /* Initialize identification LED */ - ret_val = e1000_id_led_init_generic(hw); + ret_val = mac->ops.id_led_init(hw); if (ret_val) { DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ @@ -985,17 +1012,21 @@ static s32 e1000_init_hw_82571(struct e1 E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data); /* ...for both queues. */ - if (mac->type != e1000_82573 && mac->type != e1000_82574) { - reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); - reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | - E1000_TXDCTL_COUNT_DESC; - E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); - } else { + switch (mac->type) { + case e1000_82574: + case e1000_82573: e1000_enable_tx_pkt_filtering_generic(hw); reg_data = E1000_READ_REG(hw, E1000_GCR); reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX; E1000_WRITE_REG(hw, E1000_GCR, reg_data); + break; + default: + reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); + reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | + E1000_TXDCTL_FULL_TX_DESC_WB | + E1000_TXDCTL_COUNT_DESC; + E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); + break; } /* @@ -1062,25 +1093,70 @@ static void e1000_initialize_hw_bits_825 } /* Device Control */ - if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { + + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: reg = E1000_READ_REG(hw, E1000_CTRL); reg &= ~(1 << 29); E1000_WRITE_REG(hw, E1000_CTRL, reg); + break; + default: + break; } /* Extended Device Control */ - if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: reg = E1000_READ_REG(hw, E1000_CTRL_EXT); reg &= ~(1 << 23); reg |= (1 << 22); E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); + break; + default: + break; } - /* PCI-Ex Control Register */ - if (hw->mac.type == e1000_82574) { + + if (hw->mac.type == e1000_82571) { + reg = E1000_READ_REG(hw, E1000_PBA_ECC); + reg |= E1000_PBA_ECC_CORR_EN; + E1000_WRITE_REG(hw, E1000_PBA_ECC, reg); + } + + /* + * Workaround for hardware errata. + * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 + */ + + if ((hw->mac.type == e1000_82571) || + (hw->mac.type == e1000_82572)) { + reg = E1000_READ_REG(hw, E1000_CTRL_EXT); + reg &= ~E1000_CTRL_EXT_DMA_DYN_CLK_EN; + E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg); + } + + /* PCI-Ex Control Registers */ + + switch (hw->mac.type) { + case e1000_82574: reg = E1000_READ_REG(hw, E1000_GCR); reg |= (1 << 22); E1000_WRITE_REG(hw, E1000_GCR, reg); + /* + * Workaround for hardware errata. + * apply workaround for hardware errata documented in errata + * docs Fixes issue where some error prone or unreliable PCIe + * completions are occurring, particularly with ASPM enabled. + * Without fix, issue can cause tx timeouts. + */ + reg = E1000_READ_REG(hw, E1000_GCR2); + reg |= 1; + E1000_WRITE_REG(hw, E1000_GCR2, reg); + break; + default: + break; } return; @@ -1102,31 +1178,38 @@ static void e1000_clear_vfta_82571(struc DEBUGFUNC("e1000_clear_vfta_82571"); - if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: if (hw->mng_cookie.vlan_id != 0) { /* - * The VFTA is a 4096b bit-field, each identifying - * a single VLAN ID. The following operations - * determine which 32b entry (i.e. offset) into the - * array we want to set the VLAN ID (i.e. bit) of - * the manageability unit. - */ + *The VFTA is a 4096b bit-field, each identifying + *a single VLAN ID. The following operations + *determine which 32b entry (i.e. offset) into the + *array we want to set the VLAN ID (i.e. bit) of + *the manageability unit. + */ vfta_offset = (hw->mng_cookie.vlan_id >> - E1000_VFTA_ENTRY_SHIFT) & - E1000_VFTA_ENTRY_MASK; + E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & - E1000_VFTA_ENTRY_BIT_SHIFT_MASK); + E1000_VFTA_ENTRY_BIT_SHIFT_MASK); } - } - for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { - /* - * If the offset we want to clear is the same offset of the - * manageability VLAN ID, then clear all bits except that of - * the manageability unit. - */ - vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0; - E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value); - E1000_WRITE_FLUSH(hw); + + for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { + /* + *If the offset we want to clear is the same offset of + *the manageability VLAN ID, then clear all bits except + *that of the manageability unit + */ + vfta_value = (offset == vfta_offset) ? + vfta_bit_in_reg : 0; + E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, + vfta_value); + E1000_WRITE_FLUSH(hw); + } + break; + default: + break; } } @@ -1176,31 +1259,6 @@ static s32 e1000_led_on_82574(struct e10 return E1000_SUCCESS; } -/** - * e1000_update_mc_addr_list_82571 - Update Multicast addresses - * @hw: pointer to the HW structure - * @mc_addr_list: array of multicast addresses to program - * @mc_addr_count: number of multicast addresses to program - * @rar_used_count: the first RAR register free to program - * @rar_count: total number of supported Receive Address Registers - * - * Updates the Receive Address Registers and Multicast Table Array. - * The caller must have a packed mc_addr_list of multicast addresses. - * The parameter rar_count will usually be hw->mac.rar_entry_count - * unless there are workarounds that change this. - **/ -static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw, - u8 *mc_addr_list, u32 mc_addr_count, - u32 rar_used_count, u32 rar_count) -{ - DEBUGFUNC("e1000_update_mc_addr_list_82571"); - - if (e1000_get_laa_state_82571(hw)) - rar_count--; - - e1000_update_mc_addr_list_generic(hw, mc_addr_list, mc_addr_count, - rar_used_count, rar_count); -} /** * e1000_setup_link_82571 - Setup flow control and link settings @@ -1221,10 +1279,15 @@ static s32 e1000_setup_link_82571(struct * the default flow control setting, so we explicitly * set it to full. */ - if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && - hw->fc.requested_mode == e1000_fc_default) - hw->fc.requested_mode = e1000_fc_full; - + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: + if (hw->fc.requested_mode == e1000_fc_default) + hw->fc.requested_mode = e1000_fc_full; + break; + default: + break; + } return e1000_setup_link_generic(hw); } @@ -1306,6 +1369,133 @@ static s32 e1000_setup_fiber_serdes_link } /** + * e1000_check_for_serdes_link_82571 - Check for link (Serdes) + * @hw: pointer to the HW structure + * + * Checks for link up on the hardware. If link is not up and we have + * a signal, then we need to force link up. + **/ +s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) +{ + struct e1000_mac_info *mac = &hw->mac; + u32 rxcw; + u32 ctrl; + u32 status; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_check_for_serdes_link_82571"); + + ctrl = E1000_READ_REG(hw, E1000_CTRL); + status = E1000_READ_REG(hw, E1000_STATUS); + rxcw = E1000_READ_REG(hw, E1000_RXCW); + + if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { + + /* Receiver is synchronized with no invalid bits. */ + switch (mac->serdes_link_state) { + case e1000_serdes_link_autoneg_complete: + if (!(status & E1000_STATUS_LU)) { + /* + * We have lost link, retry autoneg before + * reporting link failure + */ + mac->serdes_link_state = + e1000_serdes_link_autoneg_progress; + DEBUGOUT("AN_UP -> AN_PROG\n"); + } + break; + + case e1000_serdes_link_forced_up: + /* + * If we are receiving /C/ ordered sets, re-enable + * auto-negotiation in the TXCW register and disable + * forced link in the Device Control register in an + * attempt to auto-negotiate with our link partner. + */ + if (rxcw & E1000_RXCW_C) { + /* Enable autoneg, and unforce link up */ + E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); + E1000_WRITE_REG(hw, E1000_CTRL, + (ctrl & ~E1000_CTRL_SLU)); + mac->serdes_link_state = + e1000_serdes_link_autoneg_progress; + DEBUGOUT("FORCED_UP -> AN_PROG\n"); + } + break; + + case e1000_serdes_link_autoneg_progress: + /* + * If the LU bit is set in the STATUS register, + * autoneg has completed sucessfully. If not, + * try foring the link because the far end may be + * available but not capable of autonegotiation. + */ + if (status & E1000_STATUS_LU) { + mac->serdes_link_state = + e1000_serdes_link_autoneg_complete; + DEBUGOUT("AN_PROG -> AN_UP\n"); + } else { + /* + * Disable autoneg, force link up and + * full duplex, and change state to forced + */ + E1000_WRITE_REG(hw, E1000_TXCW, + (mac->txcw & ~E1000_TXCW_ANE)); + ctrl |= (E1000_CTRL_SLU | E1000_CTRL_FD); + E1000_WRITE_REG(hw, E1000_CTRL, ctrl); + + /* Configure Flow Control after link up. */ + ret_val = + e1000_config_fc_after_link_up_generic(hw); + if (ret_val) { + DEBUGOUT("Error config flow control\n"); + break; + } + mac->serdes_link_state = + e1000_serdes_link_forced_up; + DEBUGOUT("AN_PROG -> FORCED_UP\n"); + } + mac->serdes_has_link = TRUE; + break; + + case e1000_serdes_link_down: + default: + /* The link was down but the receiver has now gained + * valid sync, so lets see if we can bring the link + * up. */ + E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); + E1000_WRITE_REG(hw, E1000_CTRL, + (ctrl & ~E1000_CTRL_SLU)); + mac->serdes_link_state = + e1000_serdes_link_autoneg_progress; + DEBUGOUT("DOWN -> AN_PROG\n"); + break; + } + } else { + if (!(rxcw & E1000_RXCW_SYNCH)) { + mac->serdes_has_link = FALSE; + mac->serdes_link_state = e1000_serdes_link_down; + DEBUGOUT("ANYSTATE -> DOWN\n"); + } else { + /* + * We have sync, and can tolerate one + * invalid (IV) codeword before declaring + * link down, so reread to look again + */ + usec_delay(10); + rxcw = E1000_READ_REG(hw, E1000_RXCW); + if (rxcw & E1000_RXCW_IV) { + mac->serdes_link_state = e1000_serdes_link_down; + mac->serdes_has_link = FALSE; + DEBUGOUT("ANYSTATE -> DOWN\n"); + } + } + } + + return ret_val; +} + +/** * e1000_valid_led_default_82571 - Verify a valid default LED config * @hw: pointer to the HW structure * @data: pointer to the NVM (EEPROM) @@ -1325,11 +1515,19 @@ static s32 e1000_valid_led_default_82571 goto out; } - if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && - *data == ID_LED_RESERVED_F746) - *data = ID_LED_DEFAULT_82573; - else if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) - *data = ID_LED_DEFAULT; + switch (hw->mac.type) { + case e1000_82574: + case e1000_82573: + if(*data == ID_LED_RESERVED_F746) + *data = ID_LED_DEFAULT_82573; + break; + default: + if (*data == ID_LED_RESERVED_0000 || + *data == ID_LED_RESERVED_FFFF) + *data = ID_LED_DEFAULT; + break; + } + out: return ret_val; } @@ -1435,6 +1633,7 @@ out: return ret_val; } + /** * e1000_read_mac_addr_82571 - Read device MAC address * @hw: pointer to the HW structure @@ -1444,9 +1643,19 @@ static s32 e1000_read_mac_addr_82571(str s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_read_mac_addr_82571"); - if (e1000_check_alt_mac_addr_generic(hw)) - ret_val = e1000_read_mac_addr_generic(hw); + /* + * If there's an alternate MAC address place it in RAR0 + * so that it will override the Si installed default perm + * address. + */ + ret_val = e1000_check_alt_mac_addr_generic(hw); + if (ret_val) + goto out; + + ret_val = e1000_read_mac_addr_generic(hw); + +out: return ret_val; } Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Thu Apr 9 20:57:35 2009 (r190871) +++ head/sys/dev/e1000/e1000_82575.c Fri Apr 10 00:05:46 2009 (r190872) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,6 +36,7 @@ * 82575EB Gigabit Network Connection * 82575EB Gigabit Backplane Connection * 82575GB Gigabit Network Connection + * 82575GB Gigabit Network Connection * 82576 Gigabit Network Connection */ @@ -75,11 +76,6 @@ static bool e1000_sgmii_active_82575(str static s32 e1000_reset_init_script_82575(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw); static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw); - -static void e1000_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count); -static void e1000_update_mc_addr_list_82575(struct e1000_hw *hw, - u8 *mc_addr_list, u32 mc_addr_count, - u32 rar_used_count, u32 rar_count); void e1000_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw); /** @@ -281,13 +277,15 @@ static s32 e1000_init_mac_params_82575(s /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82575; /* multicast address update */ - mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_82575; + mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ mac->ops.write_vfta = e1000_write_vfta_generic; /* clearing VFTA */ mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_generic; + /* ID LED init */ + mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ mac->ops.blink_led = e1000_blink_led_generic; /* setup LED */ @@ -854,11 +852,18 @@ static s32 e1000_check_for_link_82575(st /* SGMII link check is done through the PCS register. */ if ((hw->phy.media_type != e1000_media_type_copper) || - (e1000_sgmii_active_82575(hw))) + (e1000_sgmii_active_82575(hw))) { ret_val = e1000_get_pcs_speed_and_duplex_82575(hw, &speed, &duplex); - else + /* + * Use this flag to determine if link needs to be checked or + * not. If we have link clear the flag so that we do not + * continue to check for link. + */ + hw->mac.get_link_status = !hw->mac.serdes_has_link; + } else { ret_val = e1000_check_for_copper_link_generic(hw); + } return ret_val; } @@ -921,101 +926,6 @@ static s32 e1000_get_pcs_speed_and_duple } /** - * e1000_init_rx_addrs_82575 - Initialize receive address's - * @hw: pointer to the HW structure - * @rar_count: receive address registers - * - * Setups the receive address registers by setting the base receive address - * register to the devices MAC address and clearing all the other receive - * address registers to 0. - **/ -static void e1000_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count) -{ - u32 i; - u8 addr[6] = {0,0,0,0,0,0}; - /* - * This function is essentially the same as that of - * e1000_init_rx_addrs_generic. However it also takes care - * of the special case where the register offset of the - * second set of RARs begins elsewhere. This is implicitly taken care by - * function e1000_rar_set_generic. - */ - - DEBUGFUNC("e1000_init_rx_addrs_82575"); - - /* Setup the receive address */ - DEBUGOUT("Programming MAC Address into RAR[0]\n"); - hw->mac.ops.rar_set(hw, hw->mac.addr, 0); - - /* Zero out the other (rar_entry_count - 1) receive addresses */ - DEBUGOUT1("Clearing RAR[1-%u]\n", rar_count-1); - for (i = 1; i < rar_count; i++) { - hw->mac.ops.rar_set(hw, addr, i); - } -} - -/** - * e1000_update_mc_addr_list_82575 - Update Multicast addresses - * @hw: pointer to the HW structure - * @mc_addr_list: array of multicast addresses to program - * @mc_addr_count: number of multicast addresses to program - * @rar_used_count: the first RAR register free to program - * @rar_count: total number of supported Receive Address Registers - * - * Updates the Receive Address Registers and Multicast Table Array. - * The caller must have a packed mc_addr_list of multicast addresses. - * The parameter rar_count will usually be hw->mac.rar_entry_count - * unless there are workarounds that change this. - **/ -static void e1000_update_mc_addr_list_82575(struct e1000_hw *hw, - u8 *mc_addr_list, u32 mc_addr_count, - u32 rar_used_count, u32 rar_count) -{ - u32 hash_value; - u32 i; - u8 addr[6] = {0,0,0,0,0,0}; - /* - * This function is essentially the same as that of - * e1000_update_mc_addr_list_generic. However it also takes care - * of the special case where the register offset of the - * second set of RARs begins elsewhere. This is implicitly taken care by - * function e1000_rar_set_generic. - */ - - DEBUGFUNC("e1000_update_mc_addr_list_82575"); - - /* - * Load the first set of multicast addresses into the exact - * filters (RAR). If there are not enough to fill the RAR - * array, clear the filters. - */ - for (i = rar_used_count; i < rar_count; i++) { - if (mc_addr_count) { - e1000_rar_set_generic(hw, mc_addr_list, i); - mc_addr_count--; - mc_addr_list += ETH_ADDR_LEN; - } else { - e1000_rar_set_generic(hw, addr, i); - } - } - - /* Clear the old settings from the MTA */ - DEBUGOUT("Clearing MTA\n"); - for (i = 0; i < hw->mac.mta_reg_count; i++) { - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); - E1000_WRITE_FLUSH(hw); - } - - /* Load any remaining multicast addresses into the hash table. */ - for (; mc_addr_count > 0; mc_addr_count--) { - hash_value = e1000_hash_mc_addr(hw, mc_addr_list); - DEBUGOUT1("Hash value = 0x%03X\n", hash_value); - hw->mac.ops.mta_set(hw, hash_value); - mc_addr_list += ETH_ADDR_LEN; - } -} - -/** * e1000_shutdown_fiber_serdes_link_82575 - Remove link during power down * @hw: pointer to the HW structure * @@ -1060,6 +970,253 @@ void e1000_shutdown_fiber_serdes_link_82 } /** + * e1000_vmdq_loopback_enable_pf- Enables VM to VM queue loopback replication + * @hw: pointer to the HW structure + **/ +void e1000_vmdq_loopback_enable_pf(struct e1000_hw *hw) +{ + u32 reg; + + reg = E1000_READ_REG(hw, E1000_DTXSWC); + reg |= E1000_DTXSWC_VMDQ_LOOPBACK_EN; + E1000_WRITE_REG(hw, E1000_DTXSWC, reg); +} + +/** + * e1000_vmdq_loopback_disable_pf - Disable VM to VM queue loopbk replication + * @hw: pointer to the HW structure + **/ +void e1000_vmdq_loopback_disable_pf(struct e1000_hw *hw) +{ + u32 reg; + + reg = E1000_READ_REG(hw, E1000_DTXSWC); + reg &= ~(E1000_DTXSWC_VMDQ_LOOPBACK_EN); + E1000_WRITE_REG(hw, E1000_DTXSWC, reg); +} + +/** + * e1000_vmdq_replication_enable_pf - Enable replication of brdcst & multicst + * @hw: pointer to the HW structure + * + * Enables replication of broadcast and multicast packets from the network + * to VM's which have their respective broadcast and multicast accept + * bits set in the VM Offload Register. This gives the PF driver per + * VM granularity control over which VM's get replicated broadcast traffic. + **/ +void e1000_vmdq_replication_enable_pf(struct e1000_hw *hw, u32 enables) +{ + u32 reg; + u32 i; + + for (i = 0; i < MAX_NUM_VFS; i++) { + if (enables & (1 << i)) { + reg = E1000_READ_REG(hw, E1000_VMOLR(i)); + reg |= (E1000_VMOLR_AUPE | + E1000_VMOLR_BAM | + E1000_VMOLR_MPME); + E1000_WRITE_REG(hw, E1000_VMOLR(i), reg); + } + } + + reg = E1000_READ_REG(hw, E1000_VT_CTL); + reg |= E1000_VT_CTL_VM_REPL_EN; + E1000_WRITE_REG(hw, E1000_VT_CTL, reg); +} + +/** + * e1000_vmdq_replication_disable_pf - Disable replication of brdcst & multicst + * @hw: pointer to the HW structure + * + * Disables replication of broadcast and multicast packets to the VM's. + **/ +void e1000_vmdq_replication_disable_pf(struct e1000_hw *hw) +{ + u32 reg; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 00:22:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F00E1065678; Fri, 10 Apr 2009 00:22:49 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEB08FC19; Fri, 10 Apr 2009 00:22:49 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A0MneN025830; Fri, 10 Apr 2009 00:22:49 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A0Mmnn025826; Fri, 10 Apr 2009 00:22:48 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100022.n3A0Mmnn025826@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 00:22: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: r190873 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 00:22:49 -0000 Author: jfv Date: Fri Apr 10 00:22:48 2009 New Revision: 190873 URL: http://svn.freebsd.org/changeset/base/190873 Log: Update the ixgbe driver to 1.7.4, this includes support for the new 82599 adapter family, adds header split, and many small fixes. The driver should now be added to the GENERIC kernel. MFC after: 2 weeks Modified: head/sys/dev/ixgbe/LICENSE head/sys/dev/ixgbe/README head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h Modified: head/sys/dev/ixgbe/LICENSE ============================================================================== --- head/sys/dev/ixgbe/LICENSE Fri Apr 10 00:05:46 2009 (r190872) +++ head/sys/dev/ixgbe/LICENSE Fri Apr 10 00:22:48 2009 (r190873) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixgbe/README ============================================================================== --- head/sys/dev/ixgbe/README Fri Apr 10 00:05:46 2009 (r190872) +++ head/sys/dev/ixgbe/README Fri Apr 10 00:22:48 2009 (r190873) @@ -1,6 +1,8 @@ FreeBSD Driver for 10 Gigabit PCI Express Server Adapters ============================================= -$FreeBSD$ +/*$FreeBSD$*/ + +May 14, 2008 Contents @@ -258,7 +260,7 @@ For general information and support, go 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 freebsdnic@mailbox.intel.com. +the issue to freebsd@intel.com. Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Apr 10 00:05:46 2009 (r190872) +++ head/sys/dev/ixgbe/ixgbe.c Fri Apr 10 00:22:48 2009 (r190873) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "1.6.2"; +char ixgbe_driver_version[] = "1.7.4"; /********************************************************************* * PCI Device ID Table @@ -71,6 +71,8 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -104,7 +106,9 @@ static int ixgbe_allocate_pci_resou static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_allocate_queues(struct adapter *); +#if __FreeBSD_version >= 602105 static int ixgbe_setup_msix(struct adapter *); +#endif static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_hardware_init(struct adapter *); @@ -124,6 +128,7 @@ static void ixgbe_initialize_receive static void ixgbe_free_receive_structures(struct adapter *); static void ixgbe_free_receive_buffers(struct rx_ring *); +static void ixgbe_init_moderation(struct adapter *); static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); @@ -146,7 +151,7 @@ static int ixgbe_dma_malloc(struct adapt static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static void ixgbe_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); -static boolean_t ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); +static int ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); static boolean_t ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *); static void ixgbe_set_ivar(struct adapter *, u16, u8, s8); static void ixgbe_configure_ivars(struct adapter *); @@ -157,6 +162,12 @@ static void ixgbe_register_vlan(void *, static void ixgbe_unregister_vlan(void *, struct ifnet *, u16); #endif +#ifdef IXGBE_TIMESYNC +/* Precision Time sync support */ +static int ixgbe_tsync_init(struct adapter *); +static void ixgbe_tsync_disable(struct adapter *); +#endif + static void ixgbe_update_aim(struct rx_ring *); /* Support for pluggable optic modules */ @@ -165,14 +176,19 @@ static bool ixgbe_sfp_probe(struct adapt /* Legacy (single vector interrupt handler */ static void ixgbe_legacy_irq(void *); +#if __FreeBSD_version >= 602105 /* The MSI/X Interrupt handlers */ static void ixgbe_msix_tx(void *); static void ixgbe_msix_rx(void *); static void ixgbe_msix_link(void *); +#endif -/* Legacy interrupts use deferred handlers */ -static void ixgbe_handle_tx(void *context, int pending); -static void ixgbe_handle_rx(void *context, int pending); +/* Deferred interrupt tasklets */ +static void ixgbe_handle_tx(void *, int); +static void ixgbe_handle_rx(void *, int); +static void ixgbe_handle_link(void *, int); +static void ixgbe_handle_msf(void *, int); +static void ixgbe_handle_mod(void *, int); /********************************************************************* @@ -213,8 +229,8 @@ static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); static int ixgbe_low_latency = IXGBE_LOW_LATENCY; TUNABLE_INT("hw.ixgbe.low_latency", &ixgbe_low_latency); -static int ixgbe_ave_latency = IXGBE_LOW_LATENCY; -TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_low_latency); +static int ixgbe_ave_latency = IXGBE_AVE_LATENCY; +TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_ave_latency); static int ixgbe_bulk_latency = IXGBE_BULK_LATENCY; TUNABLE_INT("hw.ixgbe.bulk_latency", &ixgbe_bulk_latency); @@ -222,8 +238,8 @@ TUNABLE_INT("hw.ixgbe.bulk_latency", &ix static int ixgbe_rx_process_limit = 100; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); -/* Flow control setting, default to full */ -static int ixgbe_flow_control = ixgbe_fc_none; +/* Flow control setting, default to off */ +static int ixgbe_flow_control = ixgbe_fc_full; TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); /* @@ -239,11 +255,16 @@ TUNABLE_INT("hw.ixgbe.enable_lro", &ixgb * MSIX should be the default for best performance, * but this allows it to be forced off for testing. */ +#if __FreeBSD_version >= 602105 static int ixgbe_enable_msix = 1; +#else +static int ixgbe_enable_msix = 0; +#endif TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix); /* * Enable RX Header Split + * WARNING: disable this if bridging or forwarding!! */ static int ixgbe_rx_hdr_split = 1; TUNABLE_INT("hw.ixgbe.rx_hdr_split", &ixgbe_rx_hdr_split); @@ -268,6 +289,13 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* Total number of Interfaces - need for config sanity check */ static int ixgbe_total_ports; +/* +** The number of scatter-gather segments +** differs for 82598 and 82599, default to +** the former. +*/ +static int ixgbe_num_segs = IXGBE_82598_SCATTER; + /********************************************************************* * Device identification routine * @@ -312,6 +340,7 @@ ixgbe_probe(device_t dev) ixgbe_strings[ent->index], ixgbe_driver_version); device_set_desc_copy(dev, adapter_name); + ++ixgbe_total_ports; return (0); } ent++; @@ -333,6 +362,7 @@ static int ixgbe_attach(device_t dev) { struct adapter *adapter; + struct ixgbe_hw *hw; int error = 0; u16 pci_device_id; u32 ctrl_ext; @@ -342,37 +372,34 @@ ixgbe_attach(device_t dev) /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; + hw = &adapter->hw; /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* Keep track of number of ports and optics */ + /* Keep track of optics */ pci_device_id = pci_get_device(dev); switch (pci_device_id) { case IXGBE_DEV_ID_82598_CX4_DUAL_PORT : + case IXGBE_DEV_ID_82598EB_CX4 : adapter->optics = IFM_10G_CX4; - ixgbe_total_ports += 2; break; case IXGBE_DEV_ID_82598AF_DUAL_PORT : - adapter->optics = IFM_10G_SR; - ixgbe_total_ports += 2; - break; + case IXGBE_DEV_ID_82598_DA_DUAL_PORT : case IXGBE_DEV_ID_82598AF_SINGLE_PORT : + case IXGBE_DEV_ID_82598AT : adapter->optics = IFM_10G_SR; - ixgbe_total_ports += 1; break; case IXGBE_DEV_ID_82598EB_XF_LR : adapter->optics = IFM_10G_LR; - ixgbe_total_ports += 1; break; - case IXGBE_DEV_ID_82598EB_CX4 : - adapter->optics = IFM_10G_CX4; - ixgbe_total_ports += 1; + case IXGBE_DEV_ID_82599_SFP : + adapter->optics = IFM_10G_SR; + ixgbe_num_segs = IXGBE_82599_SCATTER; break; - case IXGBE_DEV_ID_82598AT : - ixgbe_total_ports += 1; - case IXGBE_DEV_ID_82598_DA_DUAL_PORT : - ixgbe_total_ports += 2; + case IXGBE_DEV_ID_82599_KX4 : + adapter->optics = IFM_10G_CX4; + ixgbe_num_segs = IXGBE_82599_SCATTER; default: break; } @@ -474,7 +501,7 @@ ixgbe_attach(device_t dev) } /* Initialize the shared code */ - error = ixgbe_init_shared_code(&adapter->hw); + error = ixgbe_init_shared_code(hw); if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* ** No optics in this port, set up @@ -525,11 +552,11 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST); #endif - + /* let hardware know driver is loaded */ - ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); + ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, ctrl_ext); + IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); INIT_DEBUGOUT("ixgbe_attach: end"); return (0); @@ -590,6 +617,14 @@ ixgbe_detach(device_t dev) } } + /* Drain the Link queue */ + if (adapter->tq) { + taskqueue_drain(adapter->tq, &adapter->link_task); + taskqueue_drain(adapter->tq, &adapter->mod_task); + taskqueue_drain(adapter->tq, &adapter->msf_task); + taskqueue_free(adapter->tq); + } + /* let hardware know driver is unloading */ ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); ctrl_ext &= ~IXGBE_CTRL_EXT_DRV_LOAD; @@ -662,6 +697,19 @@ ixgbe_start_locked(struct tx_ring *txr, IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; + /* + * Force a cleanup if number of TX descriptors + * available is below the threshold. If it fails + * to get above, then abort transmit. + */ + if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) { + ixgbe_txeof(txr); + /* Make sure things have improved */ + if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) { + txr->no_tx_desc_avail++; + break; + } + } if (ixgbe_xmit(txr, &m_head)) { if (m_head == NULL) @@ -701,7 +749,8 @@ ixgbe_start(struct ifnet *ifp) txr = &adapter->tx_rings[queue]; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - IXGBE_TX_LOCK(txr); + if (IXGBE_TX_TRYLOCK(txr) == 0) + return; ixgbe_start_locked(txr, ifp); IXGBE_TX_UNLOCK(txr); } @@ -803,6 +852,67 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c #endif break; } +#ifdef IXGBE_TIMESYNC + /* + ** IOCTL support for Precision Time (IEEE 1588) Support + */ + case IXGBE_TIMESYNC_READTS: + { + u32 rx_ctl, tx_ctl; + struct ixgbe_tsync_read *tdata; + + tdata = (struct ixgbe_tsync_read *) ifr->ifr_data; + + if (tdata->read_current_time) { + getnanotime(&tdata->system_time); + tdata->network_time = IXGBE_READ_REG(&adapter->hw, + IXGBE_SYSTIML); + tdata->network_time |= + (u64)IXGBE_READ_REG(&adapter->hw, + IXGBE_SYSTIMH ) << 32; + } + + rx_ctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TSYNCRXCTL); + tx_ctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TSYNCTXCTL); + + if (rx_ctl & 0x1) { + u32 tmp; + unsigned char *tmp_cp; + + tdata->rx_valid = 1; + tdata->rx_stamp = IXGBE_READ_REG(&adapter->hw, + IXGBE_RXSTMPL); + tdata->rx_stamp |= (u64)IXGBE_READ_REG(&adapter->hw, + IXGBE_RXSTMPH) << 32; + + tmp = IXGBE_READ_REG(&adapter->hw, IXGBE_RXSATRL); + tmp_cp = (unsigned char *) &tmp; + tdata->srcid[0] = tmp_cp[0]; + tdata->srcid[1] = tmp_cp[1]; + tdata->srcid[2] = tmp_cp[2]; + tdata->srcid[3] = tmp_cp[3]; + tmp = IXGBE_READ_REG(&adapter->hw, IXGBE_RXSATRH); + tmp_cp = (unsigned char *) &tmp; + tdata->srcid[4] = tmp_cp[0]; + tdata->srcid[5] = tmp_cp[1]; + tdata->seqid = tmp >> 16; + tdata->seqid = htons(tdata->seqid); + } else + tdata->rx_valid = 0; + + if (tx_ctl & 0x1) { + tdata->tx_valid = 1; + tdata->tx_stamp = IXGBE_READ_REG(&adapter->hw, + IXGBE_TXSTMPL); + tdata->tx_stamp |= (u64) IXGBE_READ_REG(&adapter->hw, + IXGBE_TXSTMPH) << 32; + } else + tdata->tx_valid = 0; + + return (0); + } +#endif /* IXGBE_TIMESYNC */ + default: IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command); error = ether_ioctl(ifp, command, data); @@ -905,13 +1015,12 @@ ixgbe_watchdog(struct adapter *adapter) static void ixgbe_init_locked(struct adapter *adapter) { - struct rx_ring *rxr = adapter->rx_rings; - struct tx_ring *txr = adapter->tx_rings; struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct ixgbe_hw *hw; u32 k, txdctl, mhadd, gpie; u32 rxdctl, rxctrl; + int err; INIT_DEBUGOUT("ixgbe_init: begin"); @@ -951,13 +1060,6 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_initialize_transmit_units(adapter); - /* TX irq moderation rate is fixed */ - for (int i = 0; i < adapter->num_tx_queues; i++, txr++) { - IXGBE_WRITE_REG(&adapter->hw, - IXGBE_EITR(txr->msix), ixgbe_ave_latency); - txr->watchdog_timer = FALSE; - } - /* Setup Multicast table */ ixgbe_set_multi(adapter); @@ -980,23 +1082,21 @@ ixgbe_init_locked(struct adapter *adapte /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - /* RX moderation will be adapted over time, set default */ - for (int i = 0; i < adapter->num_rx_queues; i++, rxr++) { - IXGBE_WRITE_REG(&adapter->hw, - IXGBE_EITR(rxr->msix), ixgbe_low_latency); - } - - /* Set Link moderation */ - IXGBE_WRITE_REG(&adapter->hw, - IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR); + /* Configure Interrupt Moderation */ + ixgbe_init_moderation(adapter); gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); + if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + gpie |= IXGBE_SDP1_GPIEN; + gpie |= IXGBE_SDP2_GPIEN; + } + /* Enable Fan Failure Interrupt */ - if (adapter->hw.phy.media_type == ixgbe_media_type_copper) + if (hw->device_id == IXGBE_DEV_ID_82598AT) gpie |= IXGBE_SDP1_GPIEN; - if (adapter->msix) { + if (adapter->msix > 2) { /* Enable Enhanced MSIX mode */ gpie |= IXGBE_GPIE_MSIX_MODE; gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | @@ -1058,9 +1158,40 @@ ixgbe_init_locked(struct adapter *adapte /* Set up MSI/X routing */ if (ixgbe_enable_msix) ixgbe_configure_ivars(adapter); + else { /* Simple settings for Legacy/MSI */ + ixgbe_set_ivar(adapter, 0, 0, 0); + ixgbe_set_ivar(adapter, 0, 0, 1); + } ixgbe_enable_intr(adapter); + /* + ** Check on any SFP devices that + ** need to be kick-started + */ + err = hw->phy.ops.identify(hw); + if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { + device_printf(dev, + "Unsupported SFP+ module type was detected.\n"); + ixgbe_detach(dev); + return; + } + if (ixgbe_is_sfp(hw)) { + if (hw->phy.multispeed_fiber) { + hw->mac.ops.setup_sfp(hw); + taskqueue_enqueue(adapter->tq, &adapter->msf_task); + } else + taskqueue_enqueue(adapter->tq, &adapter->mod_task); + } else + taskqueue_enqueue(adapter->tq, &adapter->link_task); + + +#ifdef IXGBE_TIMESYNC + /* Initialize IEEE 1588 support */ + if (adapter->hw.mac.type == ixgbe_mac_82599EB) + ixgbe_tsync_init(adapter); +#endif + /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -1081,7 +1212,7 @@ ixgbe_init(void *arg) /* -** MSIX Interrupt Handlers +** MSIX Interrupt Tasklets */ static void @@ -1136,7 +1267,8 @@ ixgbe_legacy_irq(void *arg) struct ixgbe_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - u32 reg_eicr; + bool more; + u32 reg_eicr, loop = MAX_LOOP; reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); @@ -1148,7 +1280,15 @@ ixgbe_legacy_irq(void *arg) if (ixgbe_rxeof(rxr, adapter->rx_process_limit)) taskqueue_enqueue(rxr->tq, &rxr->rx_task); - if (ixgbe_txeof(txr)) + + IXGBE_TX_LOCK(txr); + ++txr->tx_irq; + do { + more = ixgbe_txeof(txr); + } while (loop-- && more); + IXGBE_TX_UNLOCK(txr); + + if (more) taskqueue_enqueue(txr->tq, &txr->tx_task); /* Check for fan failure */ @@ -1160,20 +1300,27 @@ ixgbe_legacy_irq(void *arg) } /* Link status change */ - if (reg_eicr & IXGBE_EICR_LSC) + if (reg_eicr & IXGBE_EICR_LSC) { + ixgbe_check_link(&adapter->hw, + &adapter->link_speed, &adapter->link_up, 0); ixgbe_update_link_status(adapter); + } + + /* Update interrupt rate */ + if (ixgbe_enable_aim == TRUE) + ixgbe_update_aim(rxr); ixgbe_enable_intr(adapter); return; } +#if __FreeBSD_version >= 602105 /********************************************************************* * * MSI TX Interrupt Service routine * **********************************************************************/ - void ixgbe_msix_tx(void *arg) { @@ -1181,6 +1328,8 @@ ixgbe_msix_tx(void *arg) struct adapter *adapter = txr->adapter; bool more; + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, txr->eims); + IXGBE_TX_LOCK(txr); ++txr->tx_irq; more = ixgbe_txeof(txr); @@ -1198,7 +1347,6 @@ ixgbe_msix_tx(void *arg) * MSIX RX Interrupt Service routine * **********************************************************************/ - static void ixgbe_msix_rx(void *arg) { @@ -1206,18 +1354,72 @@ ixgbe_msix_rx(void *arg) struct adapter *adapter = rxr->adapter; bool more; + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, rxr->eims); + ++rxr->rx_irq; - more = ixgbe_rxeof(rxr, -1); + more = ixgbe_rxeof(rxr, adapter->rx_process_limit); + + /* Update interrupt rate */ + if (ixgbe_enable_aim == TRUE) + ixgbe_update_aim(rxr); + if (more) taskqueue_enqueue(rxr->tq, &rxr->rx_task); else IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, rxr->eims); - /* Update interrupt rate */ - if (ixgbe_enable_aim == TRUE) - ixgbe_update_aim(rxr); return; } + +static void +ixgbe_msix_link(void *arg) +{ + struct adapter *adapter = arg; + struct ixgbe_hw *hw = &adapter->hw; + u32 reg_eicr; + + ++adapter->link_irq; + + /* First get the cause */ + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, IXGBE_EIMS_OTHER); + reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); + /* Clear with write */ + IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr); + + /* Link status change */ + if (reg_eicr & IXGBE_EICR_LSC) + taskqueue_enqueue(adapter->tq, &adapter->link_task); + + if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + if (reg_eicr & IXGBE_EICR_ECC) { + device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " + "Please Reboot!!\n"); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); + } + if (reg_eicr & IXGBE_EICR_GPI_SDP1) { + /* Clear the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); + taskqueue_enqueue(adapter->tq, &adapter->msf_task); + } else if (reg_eicr & IXGBE_EICR_GPI_SDP2) { + /* Clear the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP2); + taskqueue_enqueue(adapter->tq, &adapter->mod_task); + } + } + + /* Check for fan failure */ + if ((hw->device_id == IXGBE_DEV_ID_82598AT) && + (reg_eicr & IXGBE_EICR_GPI_SDP1)) { + device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " + "REPLACE IMMEDIATELY!!\n"); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); + } + + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); + return; +} +#endif /* FreeBSD_version >= 602105 */ + /* ** Routine to do adjust the RX EITR value based on traffic, ** its a simple three state model, but seems to help. @@ -1267,33 +1469,36 @@ ixgbe_update_aim(struct rx_ring *rxr) return; } - static void -ixgbe_msix_link(void *arg) +ixgbe_init_moderation(struct adapter *adapter) { - struct adapter *adapter = arg; - struct ixgbe_hw *hw = &adapter->hw; - u32 reg_eicr; - - ++adapter->link_irq; + struct rx_ring *rxr = adapter->rx_rings; + struct tx_ring *txr = adapter->tx_rings; - reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); + /* Single interrupt - MSI or Legacy? */ + if (adapter->msix < 2) { + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(0), 100); + return; + } - if (reg_eicr & IXGBE_EICR_LSC) - ixgbe_update_link_status(adapter); + /* TX irq moderation rate is fixed */ + for (int i = 0; i < adapter->num_tx_queues; i++, txr++) { + IXGBE_WRITE_REG(&adapter->hw, + IXGBE_EITR(txr->msix), ixgbe_ave_latency); + txr->watchdog_timer = FALSE; + } - /* Check for fan failure */ - if ((hw->phy.media_type == ixgbe_media_type_copper) && - (reg_eicr & IXGBE_EICR_GPI_SDP1)) { - device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " - "REPLACE IMMEDIATELY!!\n"); - IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1); + /* RX moderation will be adapted over time, set default */ + for (int i = 0; i < adapter->num_rx_queues; i++, rxr++) { + IXGBE_WRITE_REG(&adapter->hw, + IXGBE_EITR(rxr->msix), ixgbe_low_latency); } - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); - return; -} + /* Set Link moderation */ + IXGBE_WRITE_REG(&adapter->hw, + IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR); +} /********************************************************************* * @@ -1382,12 +1587,12 @@ static int ixgbe_xmit(struct tx_ring *txr, struct mbuf **m_headp) { struct adapter *adapter = txr->adapter; - u32 olinfo_status = 0, cmd_type_len = 0; + u32 olinfo_status = 0, cmd_type_len; u32 paylen = 0; int i, j, error, nsegs; - int first, last = 0; + int first, last = 0, offload = 0; struct mbuf *m_head; - bus_dma_segment_t segs[IXGBE_MAX_SCATTER]; + bus_dma_segment_t segs[ixgbe_num_segs]; bus_dmamap_t map; struct ixgbe_tx_buf *txbuf, *txbuf_mapped; union ixgbe_adv_tx_desc *txd = NULL; @@ -1395,26 +1600,12 @@ ixgbe_xmit(struct tx_ring *txr, struct m m_head = *m_headp; /* Basic descriptor defines */ - cmd_type_len |= IXGBE_ADVTXD_DTYP_DATA; - cmd_type_len |= IXGBE_ADVTXD_DCMD_IFCS | IXGBE_ADVTXD_DCMD_DEXT; + cmd_type_len = (IXGBE_ADVTXD_DTYP_DATA | + IXGBE_ADVTXD_DCMD_IFCS | IXGBE_ADVTXD_DCMD_DEXT); if (m_head->m_flags & M_VLANTAG) cmd_type_len |= IXGBE_ADVTXD_DCMD_VLE; - /* - * Force a cleanup if number of TX descriptors - * available is below the threshold. If it fails - * to get above, then abort transmit. - */ - if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) { - ixgbe_txeof(txr); - /* Make sure things have improved */ - if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) { - txr->no_tx_desc_avail++; - return (ENOBUFS); - } - } - /* * Important to capture the first descriptor * used because it will contain the index of @@ -1475,19 +1666,27 @@ ixgbe_xmit(struct tx_ring *txr, struct m m_head = *m_headp; /* - ** Set the appropriate offload context + ** Set up the appropriate offload context ** this becomes the first descriptor of ** a packet. */ - if (ixgbe_tso_setup(txr, m_head, &paylen)) { - cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; - ++adapter->tso_tx; - } else if (ixgbe_tx_ctx_setup(txr, m_head)) + if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { + if (ixgbe_tso_setup(txr, m_head, &paylen)) { + cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; + olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - + olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; + ++adapter->tso_tx; + } else + return (ENXIO); + } else /* Offloads other than TSO */ + offload = ixgbe_tx_ctx_setup(txr, m_head); + if (offload == TRUE) + olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; +#ifdef IXGBE_TIMESYNC + if (offload == IXGBE_TIMESTAMP) + cmd_type_len |= IXGBE_ADVTXD_TSTAMP; +#endif /* Record payload length */ if (paylen == 0) olinfo_status |= m_head->m_pkthdr.len << @@ -1513,6 +1712,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m i = 0; txbuf->m_head = NULL; + txbuf->eop_index = -1; } txd->read.cmd_type_len |= @@ -1526,6 +1726,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m /* Set the index of the descriptor that will be marked done */ txbuf = &txr->tx_buffers[first]; + txbuf->eop_index = last; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -1685,17 +1886,20 @@ out: callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); } +/* +** Note: this routine updates the OS on the link state +** the real check of the hardware only happens with +** a link interrupt. +*/ static void ixgbe_update_link_status(struct adapter *adapter) { - boolean_t link_up = FALSE; struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; device_t dev = adapter->dev; - ixgbe_check_link(&adapter->hw, &adapter->link_speed, &link_up, 0); - if (link_up){ + if (adapter->link_up){ if (adapter->link_active == FALSE) { if (bootverbose) device_printf(dev,"Link is up %d Gbps %s \n", @@ -1720,7 +1924,6 @@ ixgbe_update_link_status(struct adapter } - /********************************************************************* * * This routine disables all traffic on the adapter by issuing a @@ -1743,6 +1946,11 @@ ixgbe_stop(void *arg) /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#ifdef IXGBE_TIMESYNC + /* Disable IEEE 1588 support */ + if (adapter->hw.mac.type == ixgbe_mac_82599EB) + ixgbe_tsync_disable(adapter); +#endif ixgbe_reset_hw(&adapter->hw); adapter->hw.adapter_stopped = FALSE; ixgbe_stop_adapter(&adapter->hw); @@ -1817,8 +2025,13 @@ ixgbe_allocate_legacy(struct adapter *ad device_get_nameunit(adapter->dev)); taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq", device_get_nameunit(adapter->dev)); + if ((error = bus_setup_intr(dev, adapter->res[0], +#if __FreeBSD_version >= 700000 INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_legacy_irq, +#else + INTR_TYPE_NET | INTR_MPSAFE, ixgbe_legacy_irq, +#endif adapter, &adapter->tag[0])) != 0) { device_printf(dev, "Failed to register fast interrupt " "handler: %d\n", error); @@ -1833,6 +2046,7 @@ ixgbe_allocate_legacy(struct adapter *ad } +#if __FreeBSD_version >= 602105 /********************************************************************* * * Setup MSIX Interrupt resources and handlers @@ -1859,7 +2073,10 @@ ixgbe_allocate_msix(struct adapter *adap } /* Set the handler function */ error = bus_setup_intr(dev, adapter->res[vector], - INTR_TYPE_NET | INTR_MPSAFE, NULL, + INTR_TYPE_NET | INTR_MPSAFE, +#if __FreeBSD_version > 700000 + NULL, +#endif ixgbe_msix_tx, txr, &adapter->tag[vector]); if (error) { adapter->res[vector] = NULL; @@ -1867,7 +2084,7 @@ ixgbe_allocate_msix(struct adapter *adap return (error); } txr->msix = vector; - txr->eims = IXGBE_IVAR_TX_QUEUE(vector); + txr->eims = 1 << vector; TASK_INIT(&txr->tx_task, 0, ixgbe_handle_tx, txr); txr->tq = taskqueue_create_fast("ixgbe_txq", M_NOWAIT, taskqueue_thread_enqueue, &txr->tq); @@ -1888,15 +2105,18 @@ ixgbe_allocate_msix(struct adapter *adap } /* Set the handler function */ error = bus_setup_intr(dev, adapter->res[vector], - INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_msix_rx, - rxr, &adapter->tag[vector]); + INTR_TYPE_NET | INTR_MPSAFE, +#if __FreeBSD_version > 700000 + NULL, +#endif + ixgbe_msix_rx, rxr, &adapter->tag[vector]); if (error) { adapter->res[vector] = NULL; device_printf(dev, "Failed to register RX handler"); return (error); } rxr->msix = vector; - rxr->eims = IXGBE_IVAR_RX_QUEUE(vector); + rxr->eims = 1 << vector; /* used in local timer */ adapter->rx_mask |= rxr->eims; TASK_INIT(&rxr->rx_task, 0, ixgbe_handle_rx, rxr); @@ -1916,19 +2136,37 @@ ixgbe_allocate_msix(struct adapter *adap } /* Set the link handler function */ error = bus_setup_intr(dev, adapter->res[vector], - INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_msix_link, - adapter, &adapter->tag[vector]); + INTR_TYPE_NET | INTR_MPSAFE, +#if __FreeBSD_version > 700000 + NULL, +#endif + ixgbe_msix_link, adapter, &adapter->tag[vector]); if (error) { adapter->res[vector] = NULL; device_printf(dev, "Failed to register LINK handler"); return (error); } adapter->linkvec = vector; + /* Tasklets for Link, SFP and Multispeed Fiber */ + TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); + TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); + TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); + adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT, + taskqueue_thread_enqueue, &adapter->tq); + taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", + device_get_nameunit(adapter->dev)); return (0); } +#else /* Freebsd 6.1/2 */ +static int +ixgbe_allocate_msix(struct adapter *adapter) +{ + return (1); +} +#endif - +#if __FreeBSD_version >= 602105 /* * Setup Either MSI/X or MSI */ @@ -1996,6 +2234,7 @@ msi: device_printf(adapter->dev,"Using MSI interrupt\n"); return (msgs); } +#endif /* FreeBSD_version >= 602105 */ static int ixgbe_allocate_pci_resources(struct adapter *adapter) @@ -2031,9 +2270,10 @@ ixgbe_allocate_pci_resources(struct adap adapter->num_tx_queues = 1; adapter->num_rx_queues = 1; +#if __FreeBSD_version >= 602105 /* Now setup MSI or MSI/X */ adapter->msix = ixgbe_setup_msix(adapter); - +#endif adapter->hw.back = &adapter->osdep; return (0); } @@ -2051,7 +2291,10 @@ ixgbe_free_pci_resources(struct adapter if (adapter->msix == 0) adapter->msix = 1; - rid = PCIR_BAR(MSIX_82598_BAR); + if (adapter->hw.mac.type == ixgbe_mac_82598EB) + rid = PCIR_BAR(MSIX_82598_BAR); + else + rid = PCIR_BAR(MSIX_82599_BAR); /* * First release all the interrupt resources: @@ -2071,12 +2314,14 @@ ixgbe_free_pci_resources(struct adapter } } +#if __FreeBSD_version >= 602105 if (adapter->msix) pci_release_msi(dev); if (adapter->msix_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, rid, adapter->msix_mem); +#endif if (adapter->pci_mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, @@ -2215,7 +2460,7 @@ ixgbe_dma_malloc(struct adapter *adapter int r; r = bus_dma_tag_create(NULL, /* parent */ - PAGE_SIZE, 0, /* alignment, bounds */ + 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 00:31:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D751065672; Fri, 10 Apr 2009 00:31:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0056D8FC1C; Fri, 10 Apr 2009 00:31:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A0Vsrr026156; Fri, 10 Apr 2009 00:31:54 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A0VsiY026155; Fri, 10 Apr 2009 00:31:54 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100031.n3A0VsiY026155@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 00:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190874 - head/sys/modules/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 00:31:55 -0000 Author: jfv Date: Fri Apr 10 00:31:54 2009 New Revision: 190874 URL: http://svn.freebsd.org/changeset/base/190874 Log: Add support file for 82599 in Makefile MFC after: 2 weeks Modified: head/sys/modules/ixgbe/Makefile Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Fri Apr 10 00:22:48 2009 (r190873) +++ head/sys/modules/ixgbe/Makefile Fri Apr 10 00:31:54 2009 (r190874) @@ -4,7 +4,8 @@ KMOD = ixgbe SRCS = device_if.h bus_if.h pci_if.h SRCS += ixgbe.c # Shared source -SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_82598.c +SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c +SRCS += ixgbe_82599.c ixgbe_82598.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe clean: From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 00:34:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F24551065670; Fri, 10 Apr 2009 00:34:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12858FC1D; Fri, 10 Apr 2009 00:34:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A0YtF4026305; Fri, 10 Apr 2009 00:34:55 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A0Ytdx026303; Fri, 10 Apr 2009 00:34:55 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100034.n3A0Ytdx026303@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 00:34: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: r190875 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 00:34:56 -0000 Author: jfv Date: Fri Apr 10 00:34:55 2009 New Revision: 190875 URL: http://svn.freebsd.org/changeset/base/190875 Log: Add additional file to ixgbe files list, and uncomment NOTES entry MFC after: 2 weeks Modified: head/sys/conf/NOTES head/sys/conf/files Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Apr 10 00:31:54 2009 (r190874) +++ head/sys/conf/NOTES Fri Apr 10 00:34:55 2009 (r190875) @@ -1929,7 +1929,7 @@ device xl # 3Com 3c90x (``Boomerang'', device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet -#device ixgbe # Intel Pro/10Gbe PCIE Ethernet +device ixgbe # Intel Pro/10Gbe PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 10 00:31:54 2009 (r190874) +++ head/sys/conf/files Fri Apr 10 00:34:55 2009 (r190875) @@ -1073,6 +1073,8 @@ dev/ixgbe/ixgbe_common.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82598.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_82599.c optional ixgbe \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 00:40:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88F371065670; Fri, 10 Apr 2009 00:40:48 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7793F8FC13; Fri, 10 Apr 2009 00:40:48 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A0emL5026535; Fri, 10 Apr 2009 00:40:48 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A0emhf026534; Fri, 10 Apr 2009 00:40:48 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100040.n3A0emhf026534@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 00:40: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: r190876 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 00:40:49 -0000 Author: jfv Date: Fri Apr 10 00:40:48 2009 New Revision: 190876 URL: http://svn.freebsd.org/changeset/base/190876 Log: Add ixgbe to the GENERIC amd64 kernel in place of the older ixgb driver. I will add to other architectures after this one proves trouble free. MFC after: 2 weeks Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Apr 10 00:34:55 2009 (r190875) +++ head/sys/amd64/conf/GENERIC Fri Apr 10 00:40:48 2009 (r190876) @@ -200,7 +200,7 @@ device ppi # Parallel port interface d device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgb # Intel PRO/10GbE Ethernet Card +device ixgbe # Intel PRO/10GbE PCIE Ethernet Family device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 02:45:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1AFC1065672; Fri, 10 Apr 2009 02:45:00 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FDD28FC16; Fri, 10 Apr 2009 02:45:00 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A2j0cj029325; Fri, 10 Apr 2009 02:45:00 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A2j0Hx029324; Fri, 10 Apr 2009 02:45:00 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100245.n3A2j0Hx029324@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 02:45: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: r190877 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 02:45:01 -0000 Author: jfv Date: Fri Apr 10 02:45:00 2009 New Revision: 190877 URL: http://svn.freebsd.org/changeset/base/190877 Log: Add missing file, sorry bout that :) Added: head/sys/dev/ixgbe/ixgbe_82599.c (contents, props changed) Added: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ixgbe/ixgbe_82599.c Fri Apr 10 02:45:00 2009 (r190877) @@ -0,0 +1,2444 @@ +/****************************************************************************** + + Copyright (c) 2001-2009, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 "ixgbe_type.h" +#include "ixgbe_api.h" +#include "ixgbe_common.h" +#include "ixgbe_phy.h" + +u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw); +s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw); +s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, + ixgbe_link_speed *speed, + bool *autoneg); +enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw); +s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw); +s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete); +s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw); +s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, + ixgbe_link_speed *speed, + bool *link_up, bool link_up_wait_to_complete); +s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, + ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete); +static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw); +static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw, + ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete); +s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw); +void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw); +s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw); +s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq); +s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq); +s32 ixgbe_insert_mac_addr_82599(struct ixgbe_hw *hw, u8 *addr, u32 vmdq); +s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, + u32 vind, bool vlan_on); +s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw); +s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw); +s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); +s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); +s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw); +s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); +s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); +u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); +s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); +s32 ixgbe_get_san_mac_addr_offset_82599(struct ixgbe_hw *hw, + u16 *san_mac_offset); +s32 ixgbe_get_san_mac_addr_82599(struct ixgbe_hw *hw, u8 *san_mac_addr); +s32 ixgbe_set_san_mac_addr_82599(struct ixgbe_hw *hw, u8 *san_mac_addr); +s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); + +void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) +{ + struct ixgbe_mac_info *mac = &hw->mac; + + DEBUGFUNC("ixgbe_init_mac_link_ops_82599"); + + if (hw->phy.multispeed_fiber) { + /* Set up dual speed SFP+ support */ + mac->ops.setup_link = + &ixgbe_setup_mac_link_multispeed_fiber; + mac->ops.setup_link_speed = + &ixgbe_setup_mac_link_speed_multispeed_fiber; + } else { + mac->ops.setup_link = + &ixgbe_setup_mac_link_82599; + mac->ops.setup_link_speed = + &ixgbe_setup_mac_link_speed_82599; + } +} + +/** + * ixgbe_init_phy_ops_82599 - PHY/SFP specific init + * @hw: pointer to hardware structure + * + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. + * + **/ +s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) +{ + struct ixgbe_mac_info *mac = &hw->mac; + struct ixgbe_phy_info *phy = &hw->phy; + s32 ret_val = IXGBE_SUCCESS; + + DEBUGFUNC("ixgbe_init_phy_ops_82599"); + + /* Identify the PHY or SFP module */ + ret_val = phy->ops.identify(hw); + if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED) + goto init_phy_ops_out; + + /* Setup function pointers based on detected SFP module and speeds */ + ixgbe_init_mac_link_ops_82599(hw); + if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) + hw->phy.ops.reset = NULL; + + /* If copper media, overwrite with copper function pointers */ + if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { + mac->ops.setup_link = &ixgbe_setup_copper_link_82599; + mac->ops.setup_link_speed = + &ixgbe_setup_copper_link_speed_82599; + mac->ops.get_link_capabilities = + &ixgbe_get_copper_link_capabilities_generic; + } + + /* Set necessary function pointers based on phy type */ + switch (hw->phy.type) { + case ixgbe_phy_tn: + phy->ops.check_link = &ixgbe_check_phy_link_tnx; + phy->ops.get_firmware_version = + &ixgbe_get_phy_firmware_version_tnx; + break; + case ixgbe_phy_aq: + phy->ops.get_firmware_version = + &ixgbe_get_phy_firmware_version_aq; + break; + default: + break; + } +init_phy_ops_out: + return ret_val; +} + +s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) +{ + s32 ret_val = IXGBE_SUCCESS; + u16 list_offset, data_offset, data_value; + + DEBUGFUNC("ixgbe_setup_sfp_modules_82599"); + + if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) { + ixgbe_init_mac_link_ops_82599(hw); + + hw->phy.ops.reset = NULL; + + ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset, + &data_offset); + if (ret_val != IXGBE_SUCCESS) + goto setup_sfp_out; + + hw->eeprom.ops.read(hw, ++data_offset, &data_value); + while (data_value != 0xffff) { + IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value); + IXGBE_WRITE_FLUSH(hw); + hw->eeprom.ops.read(hw, ++data_offset, &data_value); + } + /* Now restart DSP */ + IXGBE_WRITE_REG(hw, IXGBE_CORECTL, 0x00000102); + IXGBE_WRITE_REG(hw, IXGBE_CORECTL, 0x00000b1d); + IXGBE_WRITE_FLUSH(hw); + } + +setup_sfp_out: + return ret_val; +} + +/** + * ixgbe_get_pcie_msix_count_82599 - Gets MSI-X vector count + * @hw: pointer to hardware structure + * + * Read PCIe configuration space, and get the MSI-X vector count from + * the capabilities table. + **/ +u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw) +{ + u32 msix_count = 64; + + if (hw->mac.msix_vectors_from_pcie) { + msix_count = IXGBE_READ_PCIE_WORD(hw, + IXGBE_PCIE_MSIX_82599_CAPS); + msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK; + + /* MSI-X count is zero-based in HW, so increment to give + * proper value */ + msix_count++; + } + + return msix_count; +} + +/** + * ixgbe_init_ops_82599 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure + * + * Initialize the function pointers and assign the MAC type for 82599. + * Does not touch the hardware. + **/ + +s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) +{ + struct ixgbe_mac_info *mac = &hw->mac; + struct ixgbe_phy_info *phy = &hw->phy; + s32 ret_val; + + ret_val = ixgbe_init_phy_ops_generic(hw); + ret_val = ixgbe_init_ops_generic(hw); + + /* PHY */ + phy->ops.identify = &ixgbe_identify_phy_82599; + phy->ops.init = &ixgbe_init_phy_ops_82599; + + /* MAC */ + mac->ops.reset_hw = &ixgbe_reset_hw_82599; + mac->ops.get_media_type = &ixgbe_get_media_type_82599; + mac->ops.get_supported_physical_layer = + &ixgbe_get_supported_physical_layer_82599; + mac->ops.enable_rx_dma = &ixgbe_enable_rx_dma_82599; + mac->ops.read_analog_reg8 = &ixgbe_read_analog_reg8_82599; + mac->ops.write_analog_reg8 = &ixgbe_write_analog_reg8_82599; + mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599; + mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_82599; + mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_82599; + mac->ops.get_device_caps = &ixgbe_get_device_caps_82599; + + /* RAR, Multicast, VLAN */ + mac->ops.set_vmdq = &ixgbe_set_vmdq_82599; + mac->ops.clear_vmdq = &ixgbe_clear_vmdq_82599; + mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_82599; + mac->rar_highwater = 1; + mac->ops.set_vfta = &ixgbe_set_vfta_82599; + mac->ops.clear_vfta = &ixgbe_clear_vfta_82599; + mac->ops.init_uta_tables = &ixgbe_init_uta_tables_82599; + mac->ops.setup_sfp = &ixgbe_setup_sfp_modules_82599; + + /* Link */ + mac->ops.get_link_capabilities = &ixgbe_get_link_capabilities_82599; + mac->ops.check_link = &ixgbe_check_mac_link_82599; + ixgbe_init_mac_link_ops_82599(hw); + + mac->mcft_size = 128; + mac->vft_size = 128; + mac->num_rar_entries = 128; + mac->max_tx_queues = 128; + mac->max_rx_queues = 128; + mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82599(hw); + + return ret_val; +} + +/** + * ixgbe_get_link_capabilities_82599 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @negotiation: TRUE when autoneg or autotry is enabled + * + * Determines the link capabilities by reading the AUTOC register. + **/ +s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, + ixgbe_link_speed *speed, + bool *negotiation) +{ + s32 status = IXGBE_SUCCESS; + u32 autoc = 0; + + /* + * Determine link capabilities based on the stored value of AUTOC, + * which represents EEPROM defaults. If AUTOC value has not + * been stored, use the current register values. + */ + if (hw->mac.orig_link_settings_stored) + autoc = hw->mac.orig_autoc; + else + autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + + switch (autoc & IXGBE_AUTOC_LMS_MASK) { + case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: + *speed = IXGBE_LINK_SPEED_1GB_FULL; + *negotiation = FALSE; + break; + + case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: + *speed = IXGBE_LINK_SPEED_10GB_FULL; + *negotiation = FALSE; + break; + + case IXGBE_AUTOC_LMS_1G_AN: + *speed = IXGBE_LINK_SPEED_1GB_FULL; + *negotiation = TRUE; + break; + + case IXGBE_AUTOC_LMS_10G_SERIAL: + *speed = IXGBE_LINK_SPEED_10GB_FULL; + *negotiation = FALSE; + break; + + case IXGBE_AUTOC_LMS_KX4_KX_KR: + case IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN: + *speed = IXGBE_LINK_SPEED_UNKNOWN; + if (autoc & IXGBE_AUTOC_KR_SUPP) + *speed |= IXGBE_LINK_SPEED_10GB_FULL; + if (autoc & IXGBE_AUTOC_KX4_SUPP) + *speed |= IXGBE_LINK_SPEED_10GB_FULL; + if (autoc & IXGBE_AUTOC_KX_SUPP) + *speed |= IXGBE_LINK_SPEED_1GB_FULL; + *negotiation = TRUE; + break; + + case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII: + *speed = IXGBE_LINK_SPEED_100_FULL; + if (autoc & IXGBE_AUTOC_KR_SUPP) + *speed |= IXGBE_LINK_SPEED_10GB_FULL; + if (autoc & IXGBE_AUTOC_KX4_SUPP) + *speed |= IXGBE_LINK_SPEED_10GB_FULL; + if (autoc & IXGBE_AUTOC_KX_SUPP) + *speed |= IXGBE_LINK_SPEED_1GB_FULL; + *negotiation = TRUE; + break; + + case IXGBE_AUTOC_LMS_SGMII_1G_100M: + *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL; + *negotiation = FALSE; + break; + + default: + status = IXGBE_ERR_LINK_SETUP; + goto out; + break; + } + + if (hw->phy.multispeed_fiber) { + *speed |= IXGBE_LINK_SPEED_10GB_FULL | + IXGBE_LINK_SPEED_1GB_FULL; + *negotiation = TRUE; + } + +out: + return status; +} + +/** + * ixgbe_get_media_type_82599 - Get media type + * @hw: pointer to hardware structure + * + * Returns the media type (fiber, copper, backplane) + **/ +enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) +{ + enum ixgbe_media_type media_type; + + /* Detect if there is a copper PHY attached. */ + if (hw->phy.type == ixgbe_phy_cu_unknown || + hw->phy.type == ixgbe_phy_tn || + hw->phy.type == ixgbe_phy_aq) { + media_type = ixgbe_media_type_copper; + goto out; + } + + switch (hw->device_id) { + case IXGBE_DEV_ID_82599_KX4: + /* Default device ID is mezzanine card KX/KX4 */ + media_type = ixgbe_media_type_backplane; + break; + case IXGBE_DEV_ID_82599_SFP: + media_type = ixgbe_media_type_fiber; + break; + case IXGBE_DEV_ID_82599_CX4: + media_type = ixgbe_media_type_fiber; + break; + default: + media_type = ixgbe_media_type_unknown; + break; + } +out: + return media_type; +} + +/** + * ixgbe_setup_mac_link_82599 - Setup MAC link settings + * @hw: pointer to hardware structure + * + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. + **/ +s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw) +{ + u32 autoc_reg; + u32 links_reg; + u32 i; + s32 status = IXGBE_SUCCESS; + + /* Restart link */ + autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); + autoc_reg |= IXGBE_AUTOC_AN_RESTART; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); + + /* Only poll for autoneg to complete if specified to do so */ + if (hw->phy.autoneg_wait_to_complete) { + if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) == + IXGBE_AUTOC_LMS_KX4_KX_KR || + (autoc_reg & IXGBE_AUTOC_LMS_MASK) == + IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN + || (autoc_reg & IXGBE_AUTOC_LMS_MASK) == + IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { + links_reg = 0; /* Just in case Autoneg time = 0 */ + for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) { + links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); + if (links_reg & IXGBE_LINKS_KX_AN_COMP) + break; + msec_delay(100); + } + if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) { + status = IXGBE_ERR_AUTONEG_NOT_COMPLETE; + DEBUGOUT("Autoneg did not complete.\n"); + } + } + } + + /* Add delay to filter out noises during initial link setup */ + msec_delay(50); + + return status; +} + +/** + * ixgbe_setup_mac_link_multispeed_fiber - Setup MAC link settings + * @hw: pointer to hardware structure + * + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link for multi-speed fiber at 1G speed, if link + * fails at 10G. + * Performs autonegotiation if needed. + **/ +s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw) +{ + s32 status = IXGBE_SUCCESS; + ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_82599_AUTONEG; + DEBUGFUNC("ixgbe_setup_mac_link_multispeed_fiber"); + + status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw, + link_speed, TRUE, true); + return status; +} + +/** + * ixgbe_setup_mac_link_speed_multispeed_fiber - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg: TRUE if autonegotiation enabled + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * + * Set the link speed in the AUTOC register and restarts link. + **/ +s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete) +{ + s32 status = IXGBE_SUCCESS; + ixgbe_link_speed link_speed; + ixgbe_link_speed highest_link_speed = IXGBE_LINK_SPEED_UNKNOWN; + u32 speedcnt = 0; + u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); + bool link_up = FALSE; + bool negotiation; + + /* Mask off requested but non-supported speeds */ + status = ixgbe_get_link_capabilities(hw, &link_speed, &negotiation); + if (status != IXGBE_SUCCESS) + goto out; + + speed &= link_speed; + + /* + * Try each speed one by one, highest priority first. We do this in + * software because 10gb fiber doesn't support speed autonegotiation. + */ + if (speed & IXGBE_LINK_SPEED_10GB_FULL) { + speedcnt++; + highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL; + + /* If we already have link at this speed, just jump out */ + status = ixgbe_check_link(hw, &link_speed, &link_up, FALSE); + if (status != IXGBE_SUCCESS) + goto out; + + if ((link_speed == IXGBE_LINK_SPEED_10GB_FULL) && link_up) + goto out; + + /* Set hardware SDP's */ + esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); + IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); + + /* Allow module to change analog characteristics (1G->10G) */ + msec_delay(40); + + status = ixgbe_setup_mac_link_speed_82599( + hw, IXGBE_LINK_SPEED_10GB_FULL, autoneg, + autoneg_wait_to_complete); + if (status != IXGBE_SUCCESS) + goto out; + + msec_delay(100); + + /* If we have link, just jump out */ + status = ixgbe_check_link(hw, &link_speed, &link_up, FALSE); + if (status != IXGBE_SUCCESS) + goto out; + + if (link_up) + goto out; + } + + if (speed & IXGBE_LINK_SPEED_1GB_FULL) { + speedcnt++; + if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN) + highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL; + + /* If we already have link at this speed, just jump out */ + status = ixgbe_check_link(hw, &link_speed, &link_up, FALSE); + if (status != IXGBE_SUCCESS) + goto out; + + if ((link_speed == IXGBE_LINK_SPEED_1GB_FULL) && link_up) + goto out; + + /* Set hardware SDP's */ + esdp_reg &= ~IXGBE_ESDP_SDP5; + esdp_reg |= IXGBE_ESDP_SDP5_DIR; + IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); + + /* Allow module to change analog characteristics (10G->1G) */ + msec_delay(40); + + status = ixgbe_setup_mac_link_speed_82599( + hw, IXGBE_LINK_SPEED_1GB_FULL, autoneg, + autoneg_wait_to_complete); + if (status != IXGBE_SUCCESS) + goto out; + + msec_delay(100); + + /* If we have link, just jump out */ + status = ixgbe_check_link(hw, &link_speed, &link_up, FALSE); + if (status != IXGBE_SUCCESS) + goto out; + + if (link_up) + goto out; + } + + /* + * We didn't get link. Configure back to the highest speed we tried, + * (if there was more than one). We call ourselves back with just the + * single highest speed that the user requested. + */ + if (speedcnt > 1) + status = ixgbe_setup_mac_link_speed_multispeed_fiber(hw, + highest_link_speed, autoneg, autoneg_wait_to_complete); + +out: + return status; +} + +/** + * ixgbe_check_mac_link_82599 - Determine link and speed status + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @link_up: TRUE when link is up + * @link_up_wait_to_complete: bool used to wait for link up or not + * + * Reads the links register to determine if link is up and the current speed + **/ +s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed, + bool *link_up, bool link_up_wait_to_complete) +{ + u32 links_reg; + u32 i; + + links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); + if (link_up_wait_to_complete) { + for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { + if (links_reg & IXGBE_LINKS_UP) { + *link_up = TRUE; + break; + } else { + *link_up = FALSE; + } + msec_delay(100); + links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); + } + } else { + if (links_reg & IXGBE_LINKS_UP) + *link_up = TRUE; + else + *link_up = FALSE; + } + + if ((links_reg & IXGBE_LINKS_SPEED_82599) == + IXGBE_LINKS_SPEED_10G_82599) + *speed = IXGBE_LINK_SPEED_10GB_FULL; + else if ((links_reg & IXGBE_LINKS_SPEED_82599) == + IXGBE_LINKS_SPEED_1G_82599) + *speed = IXGBE_LINK_SPEED_1GB_FULL; + else + *speed = IXGBE_LINK_SPEED_100_FULL; + + /* if link is down, zero out the current_mode */ + if (*link_up == FALSE) { + hw->fc.current_mode = ixgbe_fc_none; + hw->fc.fc_was_autonegged = FALSE; + } + + return IXGBE_SUCCESS; +} + +/** + * ixgbe_setup_mac_link_speed_82599 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg: TRUE if autonegotiation enabled + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * + * Set the link speed in the AUTOC register and restarts link. + **/ +s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw, + ixgbe_link_speed speed, bool autoneg, + bool autoneg_wait_to_complete) +{ + s32 status = IXGBE_SUCCESS; + u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); + u32 orig_autoc = 0; + u32 link_mode = autoc & IXGBE_AUTOC_LMS_MASK; + u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK; + u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK; + u32 links_reg; + u32 i; + ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN; + + /* Check to see if speed passed in is supported. */ + status = ixgbe_get_link_capabilities(hw, &link_capabilities, &autoneg); + if (status != IXGBE_SUCCESS) + goto out; + + speed &= link_capabilities; + + /* Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support*/ + if (hw->mac.orig_link_settings_stored) + orig_autoc = hw->mac.orig_autoc; + else + orig_autoc = autoc; + + + if (speed == IXGBE_LINK_SPEED_UNKNOWN) { + status = IXGBE_ERR_LINK_SETUP; + } else if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR || + link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN || + link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { + /* Set KX4/KX/KR support according to speed requested */ + autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP); + if (speed & IXGBE_LINK_SPEED_10GB_FULL) + if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) + autoc |= IXGBE_AUTOC_KX4_SUPP; + if (orig_autoc & IXGBE_AUTOC_KR_SUPP) + autoc |= IXGBE_AUTOC_KR_SUPP; + if (speed & IXGBE_LINK_SPEED_1GB_FULL) + autoc |= IXGBE_AUTOC_KX_SUPP; + } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) && + (link_mode == IXGBE_AUTOC_LMS_1G_LINK_NO_AN || + link_mode == IXGBE_AUTOC_LMS_1G_AN)) { + /* Switch from 1G SFI to 10G SFI if requested */ + if ((speed == IXGBE_LINK_SPEED_10GB_FULL) && + (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)) { + autoc &= ~IXGBE_AUTOC_LMS_MASK; + autoc |= IXGBE_AUTOC_LMS_10G_SERIAL; + } + } else if ((pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI) && + (link_mode == IXGBE_AUTOC_LMS_10G_SERIAL)) { + /* Switch from 10G SFI to 1G SFI if requested */ + if ((speed == IXGBE_LINK_SPEED_1GB_FULL) && + (pma_pmd_1g == IXGBE_AUTOC_1G_SFI)) { + autoc &= ~IXGBE_AUTOC_LMS_MASK; + if (autoneg) + autoc |= IXGBE_AUTOC_LMS_1G_AN; + else + autoc |= IXGBE_AUTOC_LMS_1G_LINK_NO_AN; + } + } + + if (status == IXGBE_SUCCESS) { + /* Restart link */ + autoc |= IXGBE_AUTOC_AN_RESTART; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); + + /* Only poll for autoneg to complete if specified to do so */ + if (autoneg_wait_to_complete) { + if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR || + link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN || + link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { + links_reg = 0; /*Just in case Autoneg time=0*/ + for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) { + links_reg = + IXGBE_READ_REG(hw, IXGBE_LINKS); + if (links_reg & IXGBE_LINKS_KX_AN_COMP) + break; + msec_delay(100); + } + if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) { + status = + IXGBE_ERR_AUTONEG_NOT_COMPLETE; + DEBUGOUT("Autoneg did not complete.\n"); + } + } + } + + /* Add delay to filter out noises during initial link setup */ + msec_delay(50); + } + +out: + return status; +} + +/** + * ixgbe_setup_copper_link_82599 - Setup copper link settings + * @hw: pointer to hardware structure + * + * Restarts the link on PHY and then MAC. Performs autonegotiation if needed. + **/ +static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw) +{ + s32 status; + + /* Restart autonegotiation on PHY */ + status = hw->phy.ops.setup_link(hw); + + /* Set up MAC */ + ixgbe_setup_mac_link_82599(hw); + + return status; +} + +/** + * ixgbe_setup_copper_link_speed_82599 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg: TRUE if autonegotiation enabled + * @autoneg_wait_to_complete: TRUE if waiting is needed to complete + * + * Restarts link on PHY and MAC based on settings passed in. + **/ +static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw, + ixgbe_link_speed speed, + bool autoneg, + bool autoneg_wait_to_complete) +{ + s32 status; + + /* Setup the PHY according to input speed */ + status = hw->phy.ops.setup_link_speed(hw, speed, autoneg, + autoneg_wait_to_complete); + /* Set up MAC */ + ixgbe_setup_mac_link_82599(hw); + + return status; +} +/** + * ixgbe_reset_hw_82599 - Perform hardware reset + * @hw: pointer to hardware structure + * + * Resets the hardware by resetting the transmit and receive units, masks + * and clears all interrupts, perform a PHY reset, and perform a link (MAC) + * reset. + **/ +s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) +{ + s32 status = IXGBE_SUCCESS; + u32 ctrl, ctrl_ext; + u32 i; + u32 autoc; + u32 autoc2; + + /* Call adapter stop to disable tx/rx and clear interrupts */ + hw->mac.ops.stop_adapter(hw); + + /* PHY ops must be identified and initialized prior to reset */ + + /* Identify PHY and related function pointers */ + status = hw->phy.ops.init(hw); + + if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) + goto reset_hw_out; + + + /* Setup SFP module if there is one present. */ + if (hw->phy.sfp_setup_needed) { + status = hw->mac.ops.setup_sfp(hw); + hw->phy.sfp_setup_needed = FALSE; + } + + if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) + goto reset_hw_out; + + /* Reset PHY */ + if (hw->phy.reset_disable == FALSE && hw->phy.ops.reset != NULL) + hw->phy.ops.reset(hw); + + /* + * Prevent the PCI-E bus from from hanging by disabling PCI-E master + * access and verify no pending requests before reset + */ + status = ixgbe_disable_pcie_master(hw); + if (status != IXGBE_SUCCESS) { + status = IXGBE_ERR_MASTER_REQUESTS_PENDING; + DEBUGOUT("PCI-E Master disable polling has failed.\n"); + } + + /* + * Issue global reset to the MAC. This needs to be a SW reset. + * If link reset is used, it might reset the MAC when mng is using it + */ + ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); + IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST)); + IXGBE_WRITE_FLUSH(hw); + + /* Poll for reset bit to self-clear indicating reset is complete */ + for (i = 0; i < 10; i++) { + usec_delay(1); + ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); + if (!(ctrl & IXGBE_CTRL_RST)) + break; + } + if (ctrl & IXGBE_CTRL_RST) { + status = IXGBE_ERR_RESET_FAILED; + DEBUGOUT("Reset polling failed to complete.\n"); + } + /* Clear PF Reset Done bit so PF/VF Mail Ops can work */ + ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); + ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD; + IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); + + msec_delay(50); + + + + /* + * Store the original AUTOC/AUTOC2 values if they have not been + * stored off yet. Otherwise restore the stored original + * values since the reset operation sets back to defaults. + */ + autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); + if (hw->mac.orig_link_settings_stored == FALSE) { + hw->mac.orig_autoc = autoc; + hw->mac.orig_autoc2 = autoc2; + hw->mac.orig_link_settings_stored = TRUE; + } else { + if (autoc != hw->mac.orig_autoc) + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (hw->mac.orig_autoc | + IXGBE_AUTOC_AN_RESTART)); + + if ((autoc2 & IXGBE_AUTOC2_UPPER_MASK) != + (hw->mac.orig_autoc2 & IXGBE_AUTOC2_UPPER_MASK)) { + autoc2 &= ~IXGBE_AUTOC2_UPPER_MASK; + autoc2 |= (hw->mac.orig_autoc2 & + IXGBE_AUTOC2_UPPER_MASK); + IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2); + } + } + + /* + * Store MAC address from RAR0, clear receive address registers, and + * clear the multicast table. Also reset num_rar_entries to 128, + * since we modify this value when programming the SAN MAC address. + */ + hw->mac.num_rar_entries = 128; + hw->mac.ops.init_rx_addrs(hw); + + /* Store the permanent mac address */ + hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); + + /* Store the permanent SAN mac address */ + hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); + + /* Add the SAN MAC address to the RAR only if it's a valid address */ + if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) { + hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1, + hw->mac.san_addr, 0, IXGBE_RAH_AV); + + /* Reserve the last RAR for the SAN MAC address */ + hw->mac.num_rar_entries--; + } + +reset_hw_out: + return status; +} + +/** + * ixgbe_insert_mac_addr_82599 - Find a RAR for this mac address + * @hw: pointer to hardware structure + * @addr: Address to put into receive address register + * @vmdq: VMDq pool to assign + * + * Puts an ethernet address into a receive address register, or + * finds the rar that it is aleady in; adds to the pool list + **/ +s32 ixgbe_insert_mac_addr_82599(struct ixgbe_hw *hw, u8 *addr, u32 vmdq) +{ + static const u32 NO_EMPTY_RAR_FOUND = 0xFFFFFFFF; + u32 first_empty_rar = NO_EMPTY_RAR_FOUND; + u32 rar; + u32 rar_low, rar_high; + u32 addr_low, addr_high; + + /* swap bytes for HW little endian */ + addr_low = addr[0] | (addr[1] << 8) + | (addr[2] << 16) + | (addr[3] << 24); + addr_high = addr[4] | (addr[5] << 8); + + /* + * Either find the mac_id in rar or find the first empty space. + * rar_highwater points to just after the highest currently used + * rar in order to shorten the search. It grows when we add a new + * rar to the top. + */ + for (rar = 0; rar < hw->mac.rar_highwater; rar++) { + rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar)); + + if (((IXGBE_RAH_AV & rar_high) == 0) + && first_empty_rar == NO_EMPTY_RAR_FOUND) { + first_empty_rar = rar; + } else if ((rar_high & 0xFFFF) == addr_high) { + rar_low = IXGBE_READ_REG(hw, IXGBE_RAL(rar)); + if (rar_low == addr_low) + break; /* found it already in the rars */ + } + } + + if (rar < hw->mac.rar_highwater) { + /* already there so just add to the pool bits */ + ixgbe_set_vmdq(hw, rar, vmdq); + } else if (first_empty_rar != NO_EMPTY_RAR_FOUND) { + /* stick it into first empty RAR slot we found */ + rar = first_empty_rar; + ixgbe_set_rar(hw, rar, addr, vmdq, IXGBE_RAH_AV); + } else if (rar == hw->mac.rar_highwater) { + /* add it to the top of the list and inc the highwater mark */ + ixgbe_set_rar(hw, rar, addr, vmdq, IXGBE_RAH_AV); + hw->mac.rar_highwater++; + } else if (rar >= hw->mac.num_rar_entries) { + return IXGBE_ERR_INVALID_MAC_ADDR; + } + + /* + * If we found rar[0], make sure the default pool bit (we use pool 0) + * remains cleared to be sure default pool packets will get delivered + */ + if (rar == 0) + ixgbe_clear_vmdq(hw, rar, 0); + + return rar; +} + +/** + * ixgbe_clear_vmdq_82599 - Disassociate a VMDq pool index from a rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to disassociate + * @vmdq: VMDq pool index to remove from the rar + **/ +s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 02:49:06 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B591065670; Fri, 10 Apr 2009 02:49:06 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5C98FC18; Fri, 10 Apr 2009 02:49:06 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n3A2m1gQ054487; Thu, 9 Apr 2009 20:48:01 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <49DEB361.3000109@samsco.org> Date: Thu, 09 Apr 2009 20:48:01 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Andrew Thompson References: <200904031949.n33JnXfP031500@svn.freebsd.org> In-Reply-To: <200904031949.n33JnXfP031500@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190677 - in head/sys: cam geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 02:49:07 -0000 I've never liked the root_mount_hold() thing, but I'll get into that below. This patch is absolutely wrong for CAM. I think it'll work on SIMs that set PIM_SEQSCAN, but it'll almost certainly cause root_mount_rel() to be called multiple times for drivers that don't set it, which is the vast majority of the drivers in the tree. It looks like it works for umass because umass only allows 1 target to be probed on the bus. But given the multiple reports to the mailing lists of failures caused by this revision, even if it works, it's only be accident. I've always felt that the right way to solve this was to use the existing infrastructure. The SI_SUB_INT_CONFIG_HOOKS sysinit was specifically created to allow drivers to hold up the root device discovery while they did actions that required threads, sleeping, and interrupts. Hook it directly, or use the config_intrhook API. Just about every RAID storage driver in the system uses this to solve precisely the problem that you are trying to solve. There is one legitimate problem here, though. CAM uses config_intrhook to drive its bus discovery scan, and there's no way to control the order in which these hooks are run. So you can have a situation where a driver like usb/umass gets put after CAM in the hook order, and thus doesn't get picked up before CAM is done with its scan. This is what needs to be fixed, and I think that the correct solution is to either create a new sysinit just for CAM, or have can hook the sysinit directly and ensure that it gets placed last in order. So please back this out, it's causing numerous reports of unbootable systems. I'm very happy to discuss the right way to get usb, umass, and CAM to configure themselves correctly into the boot sequence. I'll even go so far as to help get the rest of GEOM and the graid stuff working right so we can kill this root_mount_hold() hack entirely. Scott Andrew Thompson wrote: > Author: thompsa > Date: Fri Apr 3 19:49:33 2009 > New Revision: 190677 > URL: http://svn.freebsd.org/changeset/base/190677 > > Log: > Add interleaving root hold tokens from the CAM probe to disk_create and geom > provider tasting. This is needed for disk attachments that happen after threads > are running in the boot process. > > Tested by: rnoland > > Modified: > head/sys/cam/cam_xpt.c > head/sys/geom/geom.h > head/sys/geom/geom_disk.c > head/sys/geom/geom_disk.h > head/sys/geom/geom_subr.c > > Modified: head/sys/cam/cam_xpt.c > ============================================================================== > --- head/sys/cam/cam_xpt.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/cam/cam_xpt.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -5139,6 +5139,7 @@ xpt_find_device(struct cam_et *target, l > typedef struct { > union ccb *request_ccb; > struct ccb_pathinq *cpi; > + struct root_hold_token *roothold; > int counter; > } xpt_scan_bus_info; > > @@ -5201,6 +5202,7 @@ xpt_scan_bus(struct cam_periph *periph, > } > scan_info->request_ccb = request_ccb; > scan_info->cpi = &work_ccb->cpi; > + scan_info->roothold = root_mount_hold("CAM", M_NOWAIT); > > /* Cache on our stack so we can work asynchronously */ > max_target = scan_info->cpi->max_target; > @@ -5232,6 +5234,7 @@ xpt_scan_bus(struct cam_periph *periph, > printf("xpt_scan_bus: xpt_create_path failed" > " with status %#x, bus scan halted\n", > status); > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = status; > xpt_free_ccb(work_ccb); > @@ -5240,6 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, > } > work_ccb = xpt_alloc_ccb_nowait(); > if (work_ccb == NULL) { > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > xpt_free_path(path); > request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; > @@ -5353,6 +5357,7 @@ xpt_scan_bus(struct cam_periph *periph, > xpt_free_ccb(request_ccb); > xpt_free_ccb((union ccb *)scan_info->cpi); > request_ccb = scan_info->request_ccb; > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = CAM_REQ_CMP; > xpt_done(request_ccb); > @@ -5372,6 +5377,7 @@ xpt_scan_bus(struct cam_periph *periph, > xpt_free_ccb(request_ccb); > xpt_free_ccb((union ccb *)scan_info->cpi); > request_ccb = scan_info->request_ccb; > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = status; > xpt_done(request_ccb); > > Modified: head/sys/geom/geom.h > ============================================================================== > --- head/sys/geom/geom.h Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom.h Fri Apr 3 19:49:33 2009 (r190677) > @@ -193,6 +193,8 @@ struct g_provider { > /* Two fields for the implementing class to use */ > void *private; > u_int index; > + > + struct root_hold_token *roothold; > }; > > /* geom_dev.c */ > > Modified: head/sys/geom/geom_disk.c > ============================================================================== > --- head/sys/geom/geom_disk.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_disk.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -381,6 +381,7 @@ g_disk_create(void *arg, int flag) > printf("GEOM: new disk %s\n", gp->name); > dp->d_geom = gp; > g_error_provider(pp, 0); > + root_mount_rel(dp->d_roothold); > } > > static void > @@ -467,6 +468,7 @@ disk_create(struct disk *dp, int version > dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, > DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); > dp->d_geom = NULL; > + dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK); > g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); > g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); > } > > Modified: head/sys/geom/geom_disk.h > ============================================================================== > --- head/sys/geom/geom_disk.h Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_disk.h Fri Apr 3 19:49:33 2009 (r190677) > @@ -88,6 +88,8 @@ struct disk { > > /* Fields private to the driver */ > void *d_drv1; > + > + struct root_hold_token *d_roothold; > }; > > #define DISKFLAG_NEEDSGIANT 0x1 > > Modified: head/sys/geom/geom_subr.c > ============================================================================== > --- head/sys/geom/geom_subr.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_subr.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -545,6 +545,10 @@ g_new_provider_event(void *arg, int flag > mp->taste(mp, pp, 0); > g_topology_assert(); > } > + if (pp->roothold != NULL) { > + root_mount_rel(pp->roothold); > + pp->roothold = NULL; > + } > } > > > @@ -581,6 +585,7 @@ g_new_providerf(struct g_geom *gp, const > pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, > DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); > LIST_INSERT_HEAD(&gp->provider, pp, provider); > + pp->roothold = root_mount_hold(pp->name, M_WAITOK); > g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); > return (pp); > } From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 02:49:16 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2A141065759; Fri, 10 Apr 2009 02:49:15 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id D31C98FC08; Fri, 10 Apr 2009 02:49:14 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n3A2mtRG054502; Thu, 9 Apr 2009 20:48:55 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <49DEB397.8010201@samsco.org> Date: Thu, 09 Apr 2009 20:48:55 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Andrew Thompson References: <200904031949.n33JnXfP031500@svn.freebsd.org> In-Reply-To: <200904031949.n33JnXfP031500@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190677 - in head/sys: cam geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 02:49:18 -0000 I've never liked the root_mount_hold() thing, but I'll get into that below. This patch is absolutely wrong for CAM. I think it'll work on SIMs that set PIM_SEQSCAN, but it'll almost certainly cause root_mount_rel() to be called multiple times for drivers that don't set it, which is the vast majority of the drivers in the tree. It looks like it works for umass because umass only allows 1 target to be probed on the bus. But given the multiple reports to the mailing lists of failures caused by this revision, even if it works, it's only be accident. I've always felt that the right way to solve this was to use the existing infrastructure. The SI_SUB_INT_CONFIG_HOOKS sysinit was specifically created to allow drivers to hold up the root device discovery while they did actions that required threads, sleeping, and interrupts. Hook it directly, or use the config_intrhook API. Just about every RAID storage driver in the system uses this to solve precisely the problem that you are trying to solve. There is one legitimate problem here, though. CAM uses config_intrhook to drive its bus discovery scan, and there's no way to control the order in which these hooks are run. So you can have a situation where a driver like usb/umass gets put after CAM in the hook order, and thus doesn't get picked up before CAM is done with its scan. This is what needs to be fixed, and I think that the correct solution is to either create a new sysinit just for CAM, or have can hook the sysinit directly and ensure that it gets placed last in order. So please back this out, it's causing numerous reports of unbootable systems. I'm very happy to discuss the right way to get usb, umass, and CAM to configure themselves correctly into the boot sequence. I'll even go so far as to help get the rest of GEOM and the graid stuff working right so we can kill this root_mount_hold() hack entirely. Scott Andrew Thompson wrote: > Author: thompsa > Date: Fri Apr 3 19:49:33 2009 > New Revision: 190677 > URL: http://svn.freebsd.org/changeset/base/190677 > > Log: > Add interleaving root hold tokens from the CAM probe to disk_create and geom > provider tasting. This is needed for disk attachments that happen after threads > are running in the boot process. > > Tested by: rnoland > > Modified: > head/sys/cam/cam_xpt.c > head/sys/geom/geom.h > head/sys/geom/geom_disk.c > head/sys/geom/geom_disk.h > head/sys/geom/geom_subr.c > > Modified: head/sys/cam/cam_xpt.c > ============================================================================== > --- head/sys/cam/cam_xpt.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/cam/cam_xpt.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -5139,6 +5139,7 @@ xpt_find_device(struct cam_et *target, l > typedef struct { > union ccb *request_ccb; > struct ccb_pathinq *cpi; > + struct root_hold_token *roothold; > int counter; > } xpt_scan_bus_info; > > @@ -5201,6 +5202,7 @@ xpt_scan_bus(struct cam_periph *periph, > } > scan_info->request_ccb = request_ccb; > scan_info->cpi = &work_ccb->cpi; > + scan_info->roothold = root_mount_hold("CAM", M_NOWAIT); > > /* Cache on our stack so we can work asynchronously */ > max_target = scan_info->cpi->max_target; > @@ -5232,6 +5234,7 @@ xpt_scan_bus(struct cam_periph *periph, > printf("xpt_scan_bus: xpt_create_path failed" > " with status %#x, bus scan halted\n", > status); > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = status; > xpt_free_ccb(work_ccb); > @@ -5240,6 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, > } > work_ccb = xpt_alloc_ccb_nowait(); > if (work_ccb == NULL) { > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > xpt_free_path(path); > request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; > @@ -5353,6 +5357,7 @@ xpt_scan_bus(struct cam_periph *periph, > xpt_free_ccb(request_ccb); > xpt_free_ccb((union ccb *)scan_info->cpi); > request_ccb = scan_info->request_ccb; > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = CAM_REQ_CMP; > xpt_done(request_ccb); > @@ -5372,6 +5377,7 @@ xpt_scan_bus(struct cam_periph *periph, > xpt_free_ccb(request_ccb); > xpt_free_ccb((union ccb *)scan_info->cpi); > request_ccb = scan_info->request_ccb; > + root_mount_rel(scan_info->roothold); > free(scan_info, M_CAMXPT); > request_ccb->ccb_h.status = status; > xpt_done(request_ccb); > > Modified: head/sys/geom/geom.h > ============================================================================== > --- head/sys/geom/geom.h Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom.h Fri Apr 3 19:49:33 2009 (r190677) > @@ -193,6 +193,8 @@ struct g_provider { > /* Two fields for the implementing class to use */ > void *private; > u_int index; > + > + struct root_hold_token *roothold; > }; > > /* geom_dev.c */ > > Modified: head/sys/geom/geom_disk.c > ============================================================================== > --- head/sys/geom/geom_disk.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_disk.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -381,6 +381,7 @@ g_disk_create(void *arg, int flag) > printf("GEOM: new disk %s\n", gp->name); > dp->d_geom = gp; > g_error_provider(pp, 0); > + root_mount_rel(dp->d_roothold); > } > > static void > @@ -467,6 +468,7 @@ disk_create(struct disk *dp, int version > dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, > DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); > dp->d_geom = NULL; > + dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK); > g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); > g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); > } > > Modified: head/sys/geom/geom_disk.h > ============================================================================== > --- head/sys/geom/geom_disk.h Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_disk.h Fri Apr 3 19:49:33 2009 (r190677) > @@ -88,6 +88,8 @@ struct disk { > > /* Fields private to the driver */ > void *d_drv1; > + > + struct root_hold_token *d_roothold; > }; > > #define DISKFLAG_NEEDSGIANT 0x1 > > Modified: head/sys/geom/geom_subr.c > ============================================================================== > --- head/sys/geom/geom_subr.c Fri Apr 3 19:46:12 2009 (r190676) > +++ head/sys/geom/geom_subr.c Fri Apr 3 19:49:33 2009 (r190677) > @@ -545,6 +545,10 @@ g_new_provider_event(void *arg, int flag > mp->taste(mp, pp, 0); > g_topology_assert(); > } > + if (pp->roothold != NULL) { > + root_mount_rel(pp->roothold); > + pp->roothold = NULL; > + } > } > > > @@ -581,6 +585,7 @@ g_new_providerf(struct g_geom *gp, const > pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, > DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); > LIST_INSERT_HEAD(&gp->provider, pp, provider); > + pp->roothold = root_mount_hold(pp->name, M_WAITOK); > g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); > return (pp); > } From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 04:08:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080FC106566B; Fri, 10 Apr 2009 04:08:37 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87CE8FC17; Fri, 10 Apr 2009 04:08:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A48ZtR031297; Fri, 10 Apr 2009 04:08:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A48YZ9031283; Fri, 10 Apr 2009 04:08:34 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904100408.n3A48YZ9031283@svn.freebsd.org> From: Andrew Thompson Date: Fri, 10 Apr 2009 04:08: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: r190878 - in head/sys: cam cddl/contrib/opensolaris/uts/common/fs/zfs dev/pccbb dev/usb/controller geom geom/journal geom/mirror geom/part geom/raid3 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 04:08:37 -0000 Author: thompsa Date: Fri Apr 10 04:08:34 2009 New Revision: 190878 URL: http://svn.freebsd.org/changeset/base/190878 Log: Revert r190676,190677 The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl Modified: head/sys/cam/cam_xpt.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/usb/controller/usb_controller.c head/sys/geom/geom.h head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_subr.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/part/g_part.c head/sys/geom/raid3/g_raid3.c head/sys/kern/vfs_mount.c head/sys/sys/systm.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/cam/cam_xpt.c Fri Apr 10 04:08:34 2009 (r190878) @@ -5139,7 +5139,6 @@ xpt_find_device(struct cam_et *target, l typedef struct { union ccb *request_ccb; struct ccb_pathinq *cpi; - struct root_hold_token *roothold; int counter; } xpt_scan_bus_info; @@ -5202,7 +5201,6 @@ xpt_scan_bus(struct cam_periph *periph, } scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; - scan_info->roothold = root_mount_hold("CAM", M_NOWAIT); /* Cache on our stack so we can work asynchronously */ max_target = scan_info->cpi->max_target; @@ -5234,7 +5232,6 @@ xpt_scan_bus(struct cam_periph *periph, printf("xpt_scan_bus: xpt_create_path failed" " with status %#x, bus scan halted\n", status); - root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; xpt_free_ccb(work_ccb); @@ -5243,7 +5240,6 @@ xpt_scan_bus(struct cam_periph *periph, } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { - root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -5357,7 +5353,6 @@ xpt_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); @@ -5377,7 +5372,6 @@ xpt_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; - root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; xpt_done(request_ccb); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 10 04:08:34 2009 (r190878) @@ -3087,7 +3087,7 @@ zfs_modevent(module_t mod, int type, voi error = EOPNOTSUPP; switch (type) { case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS", M_WAITOK); + zfs_root_token = root_mount_hold("ZFS"); printf("WARNING: ZFS is considered to be an experimental " "feature in FreeBSD.\n"); TASK_INIT(&zfs_start_task, 0, zfs_start, NULL); Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/dev/pccbb/pccbb_pci.c Fri Apr 10 04:08:34 2009 (r190878) @@ -439,7 +439,7 @@ cbb_pci_attach(device_t brdev) device_printf(brdev, "unable to create event thread.\n"); panic("cbb_create_event_thread"); } - sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev), M_WAITOK); + sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev)); return (0); err: if (sc->irq_res) Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/dev/usb/controller/usb_controller.c Fri Apr 10 04:08:34 2009 (r190878) @@ -114,7 +114,7 @@ usb2_attach(device_t dev) } /* delay vfs_mountroot until the bus is explored */ - bus->bus_roothold = root_mount_hold(device_get_nameunit(dev), M_WAITOK); + bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); if (usb2_post_init_called) { mtx_lock(&Giant); Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/geom.h Fri Apr 10 04:08:34 2009 (r190878) @@ -193,8 +193,6 @@ struct g_provider { /* Two fields for the implementing class to use */ void *private; u_int index; - - struct root_hold_token *roothold; }; /* geom_dev.c */ Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/geom_disk.c Fri Apr 10 04:08:34 2009 (r190878) @@ -381,7 +381,6 @@ g_disk_create(void *arg, int flag) printf("GEOM: new disk %s\n", gp->name); dp->d_geom = gp; g_error_provider(pp, 0); - root_mount_rel(dp->d_roothold); } static void @@ -468,7 +467,6 @@ disk_create(struct disk *dp, int version dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; - dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK); g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); } Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/geom_disk.h Fri Apr 10 04:08:34 2009 (r190878) @@ -88,8 +88,6 @@ struct disk { /* Fields private to the driver */ void *d_drv1; - - struct root_hold_token *d_roothold; }; #define DISKFLAG_NEEDSGIANT 0x1 Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/geom_subr.c Fri Apr 10 04:08:34 2009 (r190878) @@ -545,10 +545,6 @@ g_new_provider_event(void *arg, int flag mp->taste(mp, pp, 0); g_topology_assert(); } - if (pp->roothold != NULL) { - root_mount_rel(pp->roothold); - pp->roothold = NULL; - } } @@ -585,7 +581,6 @@ g_new_providerf(struct g_geom *gp, const pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); LIST_INSERT_HEAD(&gp->provider, pp, provider); - pp->roothold = root_mount_hold(pp->name, M_WAITOK); g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); return (pp); } Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/journal/g_journal.c Fri Apr 10 04:08:34 2009 (r190878) @@ -2310,7 +2310,7 @@ g_journal_create(struct g_class *mp, str sc->sc_inactive.jj_queue = NULL; sc->sc_active.jj_queue = NULL; - sc->sc_rootmount = root_mount_hold("GJOURNAL", M_WAITOK); + sc->sc_rootmount = root_mount_hold("GJOURNAL"); GJ_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); callout_init(&sc->sc_callout, CALLOUT_MPSAFE); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 10 04:08:34 2009 (r190878) @@ -2907,7 +2907,7 @@ g_mirror_create(struct g_class *mp, cons G_MIRROR_DEBUG(1, "Device %s created (%u components, id=%u).", sc->sc_name, sc->sc_ndisks, sc->sc_id); - sc->sc_rootmount = root_mount_hold("GMIRROR", M_WAITOK); + sc->sc_rootmount = root_mount_hold("GMIRROR"); G_MIRROR_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); /* * Run timeout. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/part/g_part.c Fri Apr 10 04:08:34 2009 (r190878) @@ -1474,7 +1474,7 @@ g_part_taste(struct g_class *mp, struct return (NULL); } - rht = root_mount_hold(mp->name, M_WAITOK); + rht = root_mount_hold(mp->name); g_topology_unlock(); /* Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/geom/raid3/g_raid3.c Fri Apr 10 04:08:34 2009 (r190878) @@ -3193,7 +3193,7 @@ g_raid3_create(struct g_class *mp, const G_RAID3_DEBUG(1, "Device %s created (%u components, id=%u).", sc->sc_name, sc->sc_ndisks, sc->sc_id); - sc->sc_rootmount = root_mount_hold("GRAID3", M_WAITOK); + sc->sc_rootmount = root_mount_hold("GRAID3"); G_RAID3_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); /* Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/kern/vfs_mount.c Fri Apr 10 04:08:34 2009 (r190878) @@ -1353,18 +1353,14 @@ static int root_mount_complete; * Hold root mount. */ struct root_hold_token * -root_mount_hold(const char *identifier, int how) +root_mount_hold(const char *identifier) { struct root_hold_token *h; if (root_mounted()) return (NULL); - h = malloc(sizeof *h, M_DEVBUF, M_ZERO | how); - if (h == NULL) { - printf("Unable to alloc root hold token for %s\n", identifier); - return (NULL); - } + h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK); h->who = identifier; mtx_lock(&mountlist_mtx); LIST_INSERT_HEAD(&root_holds, h, list); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Apr 10 02:45:00 2009 (r190877) +++ head/sys/sys/systm.h Fri Apr 10 04:08:34 2009 (r190878) @@ -325,7 +325,7 @@ void DELAY(int usec); /* Root mount holdback API */ struct root_hold_token; -struct root_hold_token *root_mount_hold(const char *identifier, int how); +struct root_hold_token *root_mount_hold(const char *identifier); void root_mount_rel(struct root_hold_token *h); void root_mount_wait(void); int root_mounted(void); From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 04:10:34 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA73E106566B; Fri, 10 Apr 2009 04:10:32 +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 6AD138FC17; Fri, 10 Apr 2009 04:10:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 3F270FFAF; Fri, 10 Apr 2009 16:10:31 +1200 (NZST) 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 uedRJscA5IRZ; Fri, 10 Apr 2009 16:10:27 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Fri, 10 Apr 2009 16:10:27 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id AEF2911432; Fri, 10 Apr 2009 16:10:26 +1200 (NZST) Date: Thu, 9 Apr 2009 21:10:26 -0700 From: Andrew Thompson To: Scott Long Message-ID: <20090410041026.GE14561@citylink.fud.org.nz> References: <200904031949.n33JnXfP031500@svn.freebsd.org> <49DEB361.3000109@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49DEB361.3000109@samsco.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: r190677 - in head/sys: cam geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 04:10:35 -0000 On Thu, Apr 09, 2009 at 08:48:01PM -0600, Scott Long wrote: > I've never liked the root_mount_hold() thing, but I'll get into that > below. This patch is absolutely wrong for CAM. I think it'll work > on SIMs that set PIM_SEQSCAN, but it'll almost certainly cause > root_mount_rel() to be called multiple times for drivers that don't > set it, which is the vast majority of the drivers in the tree. It > looks like it works for umass because umass only allows 1 target to > be probed on the bus. But given the multiple reports to the mailing > lists of failures caused by this revision, even if it works, it's > only be accident. > > So please back this out, it's causing numerous reports of unbootable > systems. I'm very happy to discuss the right way to get usb, umass, > and CAM to configure themselves correctly into the boot sequence. I'll > even go so far as to help get the rest of GEOM and the graid stuff > working right so we can kill this root_mount_hold() hack entirely. Done. Thanks for the explanation, I am back from holiday next week and will catch up. Andrew > > Andrew Thompson wrote: >> Author: thompsa >> Date: Fri Apr 3 19:49:33 2009 >> New Revision: 190677 >> URL: http://svn.freebsd.org/changeset/base/190677 >> >> Log: >> Add interleaving root hold tokens from the CAM probe to disk_create and geom >> provider tasting. This is needed for disk attachments that happen after threads >> are running in the boot process. >> Tested by: rnoland >> >> Modified: >> head/sys/cam/cam_xpt.c >> head/sys/geom/geom.h >> head/sys/geom/geom_disk.c >> head/sys/geom/geom_disk.h >> head/sys/geom/geom_subr.c >> >> Modified: head/sys/cam/cam_xpt.c >> ============================================================================== >> --- head/sys/cam/cam_xpt.c Fri Apr 3 19:46:12 2009 (r190676) >> +++ head/sys/cam/cam_xpt.c Fri Apr 3 19:49:33 2009 (r190677) >> @@ -5139,6 +5139,7 @@ xpt_find_device(struct cam_et *target, l >> typedef struct { >> union ccb *request_ccb; >> struct ccb_pathinq *cpi; >> + struct root_hold_token *roothold; >> int counter; >> } xpt_scan_bus_info; >> @@ -5201,6 +5202,7 @@ xpt_scan_bus(struct cam_periph *periph, } >> scan_info->request_ccb = request_ccb; >> scan_info->cpi = &work_ccb->cpi; >> + scan_info->roothold = root_mount_hold("CAM", M_NOWAIT); >> /* Cache on our stack so we can work asynchronously */ >> max_target = scan_info->cpi->max_target; >> @@ -5232,6 +5234,7 @@ xpt_scan_bus(struct cam_periph *periph, >> printf("xpt_scan_bus: xpt_create_path failed" >> " with status %#x, bus scan halted\n", >> status); >> + root_mount_rel(scan_info->roothold); >> free(scan_info, M_CAMXPT); >> request_ccb->ccb_h.status = status; >> xpt_free_ccb(work_ccb); >> @@ -5240,6 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, } >> work_ccb = xpt_alloc_ccb_nowait(); >> if (work_ccb == NULL) { >> + root_mount_rel(scan_info->roothold); >> free(scan_info, M_CAMXPT); >> xpt_free_path(path); >> request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; >> @@ -5353,6 +5357,7 @@ xpt_scan_bus(struct cam_periph *periph, >> xpt_free_ccb(request_ccb); >> xpt_free_ccb((union ccb *)scan_info->cpi); >> request_ccb = scan_info->request_ccb; >> + root_mount_rel(scan_info->roothold); >> free(scan_info, M_CAMXPT); >> request_ccb->ccb_h.status = CAM_REQ_CMP; >> xpt_done(request_ccb); >> @@ -5372,6 +5377,7 @@ xpt_scan_bus(struct cam_periph *periph, >> xpt_free_ccb(request_ccb); >> xpt_free_ccb((union ccb *)scan_info->cpi); >> request_ccb = scan_info->request_ccb; >> + root_mount_rel(scan_info->roothold); >> free(scan_info, M_CAMXPT); >> request_ccb->ccb_h.status = status; >> xpt_done(request_ccb); >> >> Modified: head/sys/geom/geom.h >> ============================================================================== >> --- head/sys/geom/geom.h Fri Apr 3 19:46:12 2009 (r190676) >> +++ head/sys/geom/geom.h Fri Apr 3 19:49:33 2009 (r190677) >> @@ -193,6 +193,8 @@ struct g_provider { >> /* Two fields for the implementing class to use */ >> void *private; >> u_int index; >> + >> + struct root_hold_token *roothold; >> }; >> /* geom_dev.c */ >> >> Modified: head/sys/geom/geom_disk.c >> ============================================================================== >> --- head/sys/geom/geom_disk.c Fri Apr 3 19:46:12 2009 (r190676) >> +++ head/sys/geom/geom_disk.c Fri Apr 3 19:49:33 2009 (r190677) >> @@ -381,6 +381,7 @@ g_disk_create(void *arg, int flag) >> printf("GEOM: new disk %s\n", gp->name); >> dp->d_geom = gp; >> g_error_provider(pp, 0); >> + root_mount_rel(dp->d_roothold); >> } >> static void >> @@ -467,6 +468,7 @@ disk_create(struct disk *dp, int version >> dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, >> DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); >> dp->d_geom = NULL; >> + dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK); >> g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); >> g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); >> } >> >> Modified: head/sys/geom/geom_disk.h >> ============================================================================== >> --- head/sys/geom/geom_disk.h Fri Apr 3 19:46:12 2009 (r190676) >> +++ head/sys/geom/geom_disk.h Fri Apr 3 19:49:33 2009 (r190677) >> @@ -88,6 +88,8 @@ struct disk { >> /* Fields private to the driver */ >> void *d_drv1; >> + >> + struct root_hold_token *d_roothold; >> }; >> #define DISKFLAG_NEEDSGIANT 0x1 >> >> Modified: head/sys/geom/geom_subr.c >> ============================================================================== >> --- head/sys/geom/geom_subr.c Fri Apr 3 19:46:12 2009 (r190676) >> +++ head/sys/geom/geom_subr.c Fri Apr 3 19:49:33 2009 (r190677) >> @@ -545,6 +545,10 @@ g_new_provider_event(void *arg, int flag >> mp->taste(mp, pp, 0); >> g_topology_assert(); >> } >> + if (pp->roothold != NULL) { >> + root_mount_rel(pp->roothold); >> + pp->roothold = NULL; >> + } >> } >> @@ -581,6 +585,7 @@ g_new_providerf(struct g_geom *gp, const >> pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, >> DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); >> LIST_INSERT_HEAD(&gp->provider, pp, provider); >> + pp->roothold = root_mount_hold(pp->name, M_WAITOK); >> g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); >> return (pp); >> } > From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 05:26:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79B88106566B; Fri, 10 Apr 2009 05:26:14 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 690D68FC18; Fri, 10 Apr 2009 05:26:14 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A5QE6T032890; Fri, 10 Apr 2009 05:26:14 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A5QEtk032889; Fri, 10 Apr 2009 05:26:14 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200904100526.n3A5QEtk032889@svn.freebsd.org> From: Jack F Vogel Date: Fri, 10 Apr 2009 05:26: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: r190879 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 05:26:15 -0000 Author: jfv Date: Fri Apr 10 05:26:14 2009 New Revision: 190879 URL: http://svn.freebsd.org/changeset/base/190879 Log: Fix build problem with data format. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Apr 10 04:08:34 2009 (r190878) +++ head/sys/dev/e1000/if_igb.c Fri Apr 10 05:26:14 2009 (r190879) @@ -4605,8 +4605,8 @@ igb_print_debug_info(struct adapter *ada device_printf(dev, "Queue(%d) tdh = %d, tdt = %d\n", i, E1000_READ_REG(&adapter->hw, E1000_TDH(i)), E1000_READ_REG(&adapter->hw, E1000_TDT(i))); - device_printf(dev, "no descriptors avail event = %lu\n", - txr->no_desc_avail); + device_printf(dev, "no descriptors avail event = %lld\n", + (long long)txr->no_desc_avail); device_printf(dev, "TX(%d) MSIX IRQ Handled = %lld\n", txr->me, (long long)txr->tx_irq); device_printf(dev, "TX(%d) Packets sent = %lld\n", txr->me, From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 06:16:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 836AF1065698; Fri, 10 Apr 2009 06:16:15 +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 71E478FC08; Fri, 10 Apr 2009 06:16:15 +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 n3A6GF3H033911; Fri, 10 Apr 2009 06:16:15 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A6GFl6033906; Fri, 10 Apr 2009 06:16:15 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200904100616.n3A6GFl6033906@svn.freebsd.org> From: Kip Macy Date: Fri, 10 Apr 2009 06:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190880 - in head/sys: dev/cxgb netinet sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 06:16:16 -0000 Author: kmacy Date: Fri Apr 10 06:16:14 2009 New Revision: 190880 URL: http://svn.freebsd.org/changeset/base/190880 Log: Import "flowid" support for serializing flows across transmit queues Reviewed by: rwatson and jeli Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_input.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri Apr 10 05:26:14 2009 (r190879) +++ head/sys/dev/cxgb/cxgb_sge.c Fri Apr 10 06:16:14 2009 (r190880) @@ -2879,6 +2879,7 @@ process_responses(adapter_t *adap, struc eop = get_packet(adap, drop_thresh, qs, &rspq->rspq_mbuf, r); #endif #ifdef IFNET_MULTIQUEUE + rspq->rspq_mh.mh_head->m_flags |= M_FLOWID; rspq->rspq_mh.mh_head->m_pkthdr.flowid = rss_hash; #endif ethpad = 2; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Fri Apr 10 05:26:14 2009 (r190879) +++ head/sys/netinet/in_pcb.h Fri Apr 10 06:16:14 2009 (r190880) @@ -167,7 +167,7 @@ struct inpcb { u_char inp_ip_ttl; /* (i) time to live proto */ u_char inp_ip_p; /* (c) protocol proto */ u_char inp_ip_minttl; /* (i) minimum TTL or drop */ - uint32_t inp_ispare1; /* (x) connection id / queue id */ + uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ void *inp_pspare[2]; /* (x) rtentry / general use */ @@ -416,6 +416,8 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ #define INP_DROPPED 0x04000000 /* protocol drop flag */ #define INP_SOCKREF 0x08000000 /* strong socket reference */ +#define INP_SW_FLOWID 0x10000000 /* software generated flow id */ +#define INP_HW_FLOWID 0x20000000 /* hardware generated flow id */ #define IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ #define IN6P_MTU 0x80000000 /* receive path MTU */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Apr 10 05:26:14 2009 (r190879) +++ head/sys/netinet/ip_output.c Fri Apr 10 06:16:14 2009 (r190880) @@ -153,6 +153,10 @@ ip_output(struct mbuf *m, struct mbuf *o if (inp != NULL) { M_SETFIB(m, inp->inp_inc.inc_fibnum); INP_LOCK_ASSERT(inp); + if (inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID)) { + m->m_pkthdr.flowid = inp->inp_flowid; + m->m_flags |= M_FLOWID; + } } if (opt) { Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Apr 10 05:26:14 2009 (r190879) +++ head/sys/netinet/tcp_input.c Fri Apr 10 06:16:14 2009 (r190880) @@ -594,7 +594,14 @@ findpcb: goto dropwithreset; } INP_WLOCK(inp); - + if (!(inp->inp_flags & INP_HW_FLOWID) + && (m->m_flags & M_FLOWID) + && ((inp->inp_socket == NULL) + || !(inp->inp_socket->so_options & SO_ACCEPTCONN))) { + inp->inp_flags |= INP_HW_FLOWID; + inp->inp_flags &= ~INP_SW_FLOWID; + inp->inp_flowid = m->m_pkthdr.flowid; + } #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Apr 10 05:26:14 2009 (r190879) +++ head/sys/sys/mbuf.h Fri Apr 10 06:16:14 2009 (r190880) @@ -199,6 +199,7 @@ struct mbuf { #define M_PROTO6 0x00080000 /* protocol-specific */ #define M_PROTO7 0x00100000 /* protocol-specific */ #define M_PROTO8 0x00200000 /* protocol-specific */ +#define M_FLOWID 0x00400000 /* flowid is valid */ /* * For RELENG_{6,7} steal these flags for limited multiple routing table * support. In RELENG_8 and beyond, use just one flag and a tag. From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 08:50:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E241065670; Fri, 10 Apr 2009 08:50:14 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 743958FC1A; Fri, 10 Apr 2009 08:50:14 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A8oEFg036870; Fri, 10 Apr 2009 08:50:14 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A8oEiv036867; Fri, 10 Apr 2009 08:50:14 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200904100850.n3A8oEiv036867@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 10 Apr 2009 08:50: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: r190881 - in head: sbin/gvinum sys/geom/vinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 08:50:15 -0000 Author: lulf Date: Fri Apr 10 08:50:14 2009 New Revision: 190881 URL: http://svn.freebsd.org/changeset/base/190881 Log: - Move out allocation part of different gvinum objects into its own routine and make use of it in the gvinum userland code. Modified: head/sbin/gvinum/gvinum.c head/sys/geom/vinum/geom_vinum_share.c head/sys/geom/vinum/geom_vinum_share.h Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri Apr 10 06:16:14 2009 (r190880) +++ head/sbin/gvinum/gvinum.c Fri Apr 10 08:50:14 2009 (r190881) @@ -433,10 +433,9 @@ create_drive(char *device) req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); gctl_ro_param(req, "verb", -1, "create"); - d = malloc(sizeof(struct gv_drive)); + d = gv_alloc_drive(); if (d == NULL) err(1, "unable to allocate for gv_drive object"); - memset(d, 0, sizeof(struct gv_drive)); strlcpy(d->name, drivename, sizeof(d->name)); strlcpy(d->device, device, sizeof(d->device)); Modified: head/sys/geom/vinum/geom_vinum_share.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_share.c Fri Apr 10 06:16:14 2009 (r190880) +++ head/sys/geom/vinum/geom_vinum_share.c Fri Apr 10 08:50:14 2009 (r190881) @@ -367,16 +367,29 @@ gv_plexorg_short(int org) } } -/* Get a new drive object. */ -struct gv_drive * -gv_new_drive(int max, char *token[]) +struct gv_sd * +gv_alloc_sd(void) { - struct gv_drive *d; - int j, errors; - char *ptr; + struct gv_sd *s; - if (token[1] == NULL || *token[1] == '\0') +#ifdef _KERNEL + s = g_malloc(sizeof(struct gv_sd), M_NOWAIT); +#else + s = malloc(sizeof(struct gv_sd)); +#endif + if (s == NULL) return (NULL); + bzero(s, sizeof(struct gv_sd)); + s->plex_offset = -1; + s->size = -1; + s->drive_offset = -1; + return (s); +} + +struct gv_drive * +gv_alloc_drive(void) +{ + struct gv_drive *d; #ifdef _KERNEL d = g_malloc(sizeof(struct gv_drive), M_NOWAIT); @@ -386,7 +399,54 @@ gv_new_drive(int max, char *token[]) if (d == NULL) return (NULL); bzero(d, sizeof(struct gv_drive)); + return (d); +} + +struct gv_volume * +gv_alloc_volume(void) +{ + struct gv_volume *v; + +#ifdef _KERNEL + v = g_malloc(sizeof(struct gv_volume), M_NOWAIT); +#else + v = malloc(sizeof(struct gv_volume)); +#endif + if (v == NULL) + return (NULL); + bzero(v, sizeof(struct gv_volume)); + return (v); +} + +struct gv_plex * +gv_alloc_plex(void) +{ + struct gv_plex *p; +#ifdef _KERNEL + p = g_malloc(sizeof(struct gv_plex), M_NOWAIT); +#else + p = malloc(sizeof(struct gv_plex)); +#endif + if (p == NULL) + return (NULL); + bzero(p, sizeof(struct gv_plex)); + return (p); +} + +/* Get a new drive object. */ +struct gv_drive * +gv_new_drive(int max, char *token[]) +{ + struct gv_drive *d; + int j, errors; + char *ptr; + + if (token[1] == NULL || *token[1] == '\0') + return (NULL); + d = gv_alloc_drive(); + if (d == NULL) + return (NULL); errors = 0; for (j = 1; j < max; j++) { if (!strcmp(token[j], "state")) { @@ -434,14 +494,9 @@ gv_new_volume(int max, char *token[]) if (token[1] == NULL || *token[1] == '\0') return (NULL); -#ifdef _KERNEL - v = g_malloc(sizeof(struct gv_volume), M_NOWAIT); -#else - v = malloc(sizeof(struct gv_volume)); -#endif + v = gv_alloc_volume(); if (v == NULL) return (NULL); - bzero(v, sizeof(struct gv_volume)); errors = 0; for (j = 1; j < max; j++) { @@ -479,14 +534,9 @@ gv_new_plex(int max, char *token[]) if (token[1] == NULL || *token[1] == '\0') return (NULL); -#ifdef _KERNEL - p = g_malloc(sizeof(struct gv_plex), M_NOWAIT); -#else - p = malloc(sizeof(struct gv_plex)); -#endif + p = gv_alloc_plex(); if (p == NULL) return (NULL); - bzero(p, sizeof(struct gv_plex)); errors = 0; for (j = 1; j < max; j++) { @@ -546,6 +596,8 @@ gv_new_plex(int max, char *token[]) return (p); } + + /* Get a new subdisk object. */ struct gv_sd * gv_new_sd(int max, char *token[]) @@ -556,18 +608,10 @@ gv_new_sd(int max, char *token[]) if (token[1] == NULL || *token[1] == '\0') return (NULL); -#ifdef _KERNEL - s = g_malloc(sizeof(struct gv_sd), M_NOWAIT); -#else - s = malloc(sizeof(struct gv_sd)); -#endif + s = gv_alloc_sd(); if (s == NULL) return (NULL); - bzero(s, sizeof(struct gv_sd)); - s->plex_offset = -1; - s->size = -1; - s->drive_offset = -1; errors = 0; for (j = 1; j < max; j++) { if (!strcmp(token[j], "name")) { Modified: head/sys/geom/vinum/geom_vinum_share.h ============================================================================== --- head/sys/geom/vinum/geom_vinum_share.h Fri Apr 10 06:16:14 2009 (r190880) +++ head/sys/geom/vinum/geom_vinum_share.h Fri Apr 10 08:50:14 2009 (r190881) @@ -41,6 +41,10 @@ enum { off_t gv_sizespec(char *); int gv_tokenize(char *, char **, int); +struct gv_sd *gv_alloc_sd(void); +struct gv_volume *gv_alloc_volume(void); +struct gv_plex *gv_alloc_plex(void); +struct gv_drive *gv_alloc_drive(void); struct gv_drive *gv_new_drive(int, char **); struct gv_plex *gv_new_plex(int, char **); struct gv_sd *gv_new_sd(int, char **); From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 09:13:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6648C106564A; Fri, 10 Apr 2009 09:13:59 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54BB98FC0A; Fri, 10 Apr 2009 09:13:59 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3A9Dxgf037499; Fri, 10 Apr 2009 09:13:59 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A9Dx2j037498; Fri, 10 Apr 2009 09:13:59 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200904100913.n3A9Dx2j037498@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 10 Apr 2009 09:13: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: r190882 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 09:13:59 -0000 Author: lulf Date: Fri Apr 10 09:13:58 2009 New Revision: 190882 URL: http://svn.freebsd.org/changeset/base/190882 Log: - Move logic for finding a unique drive name into its own routine for future code reuse. Modified: head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri Apr 10 08:50:14 2009 (r190881) +++ head/sbin/gvinum/gvinum.c Fri Apr 10 09:13:58 2009 (r190882) @@ -82,6 +82,7 @@ void printconfig(FILE *, char *); char *create_drive(char *); void create_volume(int, char **, char *); char *find_name(const char *, int, int); +char *find_drive(const char *); char *find_pattern(char *, char *); int @@ -422,11 +423,7 @@ create_drive(char *device) drives = 1; dname = NULL; - /* Strip away eventual /dev/ in front. */ - if (strncmp(device, "/dev/", 5) == 0) - device += 5; - - drivename = find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME); + drivename = find_drive(device); if (drivename == NULL) return (NULL); @@ -628,6 +625,16 @@ find_name(const char *prefix, int type, return (NULL); } +char * +find_drive(const char *device) +{ + + /* Strip away eventual /dev/ in front. */ + if (strncmp(device, "/dev/", 5) == 0) + device += 5; + return (find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME)); +} + /* Detach a plex or subdisk from its parent. */ void gvinum_detach(int argc, char **argv) From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 09:52:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C0B21065676; Fri, 10 Apr 2009 09:52:43 +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 2A36B8FC1E; Fri, 10 Apr 2009 09:52:43 +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 n3A9qh3c038414; Fri, 10 Apr 2009 09:52:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3A9qhFg038413; Fri, 10 Apr 2009 09:52:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904100952.n3A9qhFg038413@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Apr 2009 09:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190883 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 09:52:44 -0000 Author: kib Date: Fri Apr 10 09:52:42 2009 New Revision: 190883 URL: http://svn.freebsd.org/changeset/base/190883 Log: Update comment to the reality, rtld supports any number of loadable segments. Fix spacing. Reviewed by: kan Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Fri Apr 10 09:13:58 2009 (r190882) +++ head/libexec/rtld-elf/map_object.c Fri Apr 10 09:52:42 2009 (r190883) @@ -91,8 +91,7 @@ map_object(int fd, const char *path, con /* * Scan the program header entries, and save key information. * - * We rely on there being exactly two load segments, text and data, - * in that order. + * We expect that the loadable segments are ordered by load address. */ phdr = (Elf_Phdr *) ((char *)hdr + hdr->e_phoff); phsize = hdr->e_phnum * sizeof (phdr[0]); @@ -167,7 +166,7 @@ map_object(int fd, const char *path, con return NULL; } - for (i = 0; i <= nsegs; i++) { + for (i = 0; i <= nsegs; i++) { /* Overlay the segment onto the proper region. */ data_offset = trunc_page(segs[i]->p_offset); data_vaddr = trunc_page(segs[i]->p_vaddr); From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 09:55:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 914D91065674 for ; Fri, 10 Apr 2009 09:55:30 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9A9D48FC16 for ; Fri, 10 Apr 2009 09:55:29 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 10 Apr 2009 09:55:28 -0000 Received: from p54A3ED4A.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.237.74] by mail.gmx.net (mp056) with SMTP; 10 Apr 2009 11:55:28 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19dpLZor5BdOCJ2UIIWGkld2gyp2+FtsX7cg8J/zl Nj6ltDDOB/cQqk Message-ID: <49DF178D.3000804@gmx.de> Date: Fri, 10 Apr 2009 11:55:25 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ulf Lilleengen References: <200904100913.n3A9Dx2j037498@svn.freebsd.org> In-Reply-To: <200904100913.n3A9Dx2j037498@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190882 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 09:55:31 -0000 Ulf Lilleengen schrieb: > Author: lulf > Date: Fri Apr 10 09:13:58 2009 > New Revision: 190882 > URL: http://svn.freebsd.org/changeset/base/190882 > > Log: > - Move logic for finding a unique drive name into its own routine for future > code reuse. > > Modified: > head/sbin/gvinum/gvinum.c [...] > + /* Strip away eventual /dev/ in front. */ "eventual" does not mean what the author of this comment thought it means. "possible" would be more fitting here. Also "away" is a bit redundant. "/* Strip possible /dev/ in front. */" sounds better imo. Christoph From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:12:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 471F31065672; Fri, 10 Apr 2009 10:12:10 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3A58FC0A; Fri, 10 Apr 2009 10:12:10 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AACAMF038867; Fri, 10 Apr 2009 10:12:10 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AACAuE038865; Fri, 10 Apr 2009 10:12:10 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200904101012.n3AACAuE038865@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 10 Apr 2009 10:12: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: r190884 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:12:10 -0000 Author: lulf Date: Fri Apr 10 10:12:09 2009 New Revision: 190884 URL: http://svn.freebsd.org/changeset/base/190884 Log: - Implement the grow command to make it easier for users to extend plexes without having to understand all gvinum internals. - Document the grow command in the manpage and update examples to use the command where possible. Modified: head/sbin/gvinum/gvinum.8 head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Fri Apr 10 09:52:42 2009 (r190883) +++ head/sbin/gvinum/gvinum.8 Fri Apr 10 10:12:09 2009 (r190884) @@ -79,6 +79,10 @@ flag is given. .It Ic detach Oo Fl f Oc Op Ar plex | subdisk Detach a plex or subdisk from the volume or plex to which it is attached. +.It Ic grow Ar plex device +Grow a plex by creating a gvinum drive and subdisk on device and attach it to +the plex. +If required by the plex organization, it will be put into the growable state. .It Ic help Provides a synopsis of .Nm @@ -333,16 +337,11 @@ Then, initiate the rebuild: The plex will go up form degraded mode after the rebuild is finished. The plex can still be used while the rebuild is in progress, although requests might be delayed. -For a more advanced usage and detailed explanation of gvinum, the -handbook is recommended. .Pp Given the configuration as in the previous example, growing a RAID-5 or STRIPED -array is accomplished by adding a new subdisk to the plex with a -.Ar description-file -similar to this: +array is accomplished by using the grow command: .Pp -.Dl "drive newdrive device /dev/ad4" -.Dl "sd drive newdrive plex myraid5vol.p0" +.Dl "gvinum grow myraid5vol.p0 /dev/ad4" .Pp If everything went ok, the plex state should now be set to growable. You can then start the growing with the @@ -355,6 +354,9 @@ As with rebuilding, you can watch the pr .Ic list command. .Pp +For a more advanced usage and detailed explanation of gvinum, the +handbook is recommended. +.Pp .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri Apr 10 09:52:42 2009 (r190883) +++ head/sbin/gvinum/gvinum.c Fri Apr 10 10:12:09 2009 (r190884) @@ -61,6 +61,7 @@ void gvinum_attach(int, char **); void gvinum_concat(int, char **); void gvinum_create(int, char **); void gvinum_detach(int, char **); +void gvinum_grow(int, char **); void gvinum_help(void); void gvinum_list(int, char **); void gvinum_move(int, char **); @@ -690,6 +691,8 @@ gvinum_help(void) "detach [-f] [plex | subdisk]\n" " Detach a plex or a subdisk from the volume or plex to\n" " which it is attached.\n" + "grow plex drive\n" + " Grow plex by creating a properly sized subdisk on drive\n" "l | list [-r] [-v] [-V] [volume | plex | subdisk]\n" " List information about specified objects.\n" "ld [-r] [-v] [-V] [volume]\n" @@ -1242,6 +1245,87 @@ gvinum_stripe(int argc, char **argv) create_volume(argc, argv, "stripe"); } +/* Grow a subdisk by adding disk backed by provider. */ +void +gvinum_grow(int argc, char **argv) +{ + struct gctl_req *req; + char *drive, *sdname; + char sdprefix[GV_MAXSDNAME]; + struct gv_drive *d; + struct gv_sd *s; + const char *errstr; + int drives, volumes, plexes, subdisks, flags; + + drives = volumes = plexes = subdisks = 0; + if (argc < 3) { + warnx("usage:\tgrow plex drive\n"); + return; + } + + s = gv_alloc_sd(); + if (s == NULL) { + warn("unable to create subdisk"); + return; + } + d = gv_alloc_drive(); + if (d == NULL) { + warn("unable to create drive"); + free(s); + return; + } + /* Lookup device and set an appropriate drive name. */ + drive = find_drive(argv[2]); + if (drive == NULL) { + warn("unable to find an appropriate drive name"); + free(s); + free(d); + return; + } + strlcpy(d->name, drive, sizeof(d->name)); + if (strncmp(argv[2], "/dev/", 5) == 0) + strlcpy(d->device, (argv[2] + 5), sizeof(d->device)); + else + strlcpy(d->device, argv[2], sizeof(d->device)); + drives = 1; + + /* We try to use the plex name as basis for the subdisk name. */ + snprintf(sdprefix, sizeof(sdprefix), "%s.s", argv[1]); + sdname = find_name(sdprefix, GV_TYPE_SD, GV_MAXSDNAME); + if (sdname == NULL) { + warn("unable to find an appropriate subdisk name"); + free(s); + free(d); + free(drive); + return; + } + strlcpy(s->name, sdname, sizeof(s->name)); + free(sdname); + strlcpy(s->plex, argv[1], sizeof(s->plex)); + strlcpy(s->drive, d->name, sizeof(s->drive)); + subdisks = 1; + + req = gctl_get_handle(); + gctl_ro_param(req, "class", -1, "VINUM"); + gctl_ro_param(req, "verb", -1, "create"); + gctl_ro_param(req, "flags", sizeof(int), &flags); + gctl_ro_param(req, "volumes", sizeof(int), &volumes); + gctl_ro_param(req, "plexes", sizeof(int), &plexes); + gctl_ro_param(req, "subdisks", sizeof(int), &subdisks); + gctl_ro_param(req, "drives", sizeof(int), &drives); + gctl_ro_param(req, "drive0", sizeof(*d), d); + gctl_ro_param(req, "sd0", sizeof(*s), s); + errstr = gctl_issue(req); + free(drive); + if (errstr != NULL) { + warnx("unable to grow plex: %s", errstr); + free(s); + free(d); + return; + } + gctl_free(req); +} + void parseline(int argc, char **argv) { @@ -1258,6 +1342,8 @@ parseline(int argc, char **argv) gvinum_detach(argc, argv); else if (!strcmp(argv[0], "concat")) gvinum_concat(argc, argv); + else if (!strcmp(argv[0], "grow")) + gvinum_grow(argc, argv); else if (!strcmp(argv[0], "help")) gvinum_help(); else if (!strcmp(argv[0], "list") || !strcmp(argv[0], "l")) From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:14:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F190106566B; Fri, 10 Apr 2009 10:14:04 +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 8D0D18FC25; Fri, 10 Apr 2009 10:14: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 n3AAE4D4038937; Fri, 10 Apr 2009 10:14:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AAE4Un038936; Fri, 10 Apr 2009 10:14:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904101014.n3AAE4Un038936@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Apr 2009 10:14: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: r190885 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:14:05 -0000 Author: kib Date: Fri Apr 10 10:14:04 2009 New Revision: 190885 URL: http://svn.freebsd.org/changeset/base/190885 Log: Currently, when mapping an object, rtld reserves the whole address space for the mapping by the object' file with the protection and mode of the first loadable segment over the whole region. Then, it maps other segments at the appropriate addresses inside the region. On amd64, due to default alignment of the segments being 1Gb, the subsequent segment mappings leave the holes in the region, that usually contain mapping of the object' file past eof. Such mappings prevent wiring of the address space, because the pages cannot be faulted in. Change the way the mapping of the ELF objects is constructed, by first mapping PROT_NONE anonymous memory over the whole range, and then mapping the segments of the object over it. Take advantage of this new order and allocate .bss by changing the protection of the range instead of remapping. Note that we cannot simply keep the holes between segments, because other mappings may be made there. Among other issues, when the dso is unloaded, rtld unmaps the whole region, deleting unrelated mappings. The kernel ELF image activator does put the holes between segments, but this is not critical for now because kernel loads only executable image and interpreter, both cannot be unloaded. This will be fixed later, if needed. Reported and tested by: Hans Ottevanger Suggested and reviewed by: kan, alc Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Fri Apr 10 10:12:09 2009 (r190884) +++ head/libexec/rtld-elf/map_object.c Fri Apr 10 10:14:04 2009 (r190885) @@ -152,8 +152,8 @@ map_object(int fd, const char *path, con mapsize = base_vlimit - base_vaddr; base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; - mapbase = mmap(base_addr, mapsize, convert_prot(segs[0]->p_flags), - convert_flags(segs[0]->p_flags), fd, base_offset); + mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | + MAP_NOCORE, -1, 0); if (mapbase == (caddr_t) -1) { _rtld_error("%s: mmap of entire address space failed: %s", path, strerror(errno)); @@ -174,8 +174,7 @@ map_object(int fd, const char *path, con data_addr = mapbase + (data_vaddr - base_vaddr); data_prot = convert_prot(segs[i]->p_flags); data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; - /* Do not call mmap on the first segment - this is redundant */ - if (i && mmap(data_addr, data_vlimit - data_vaddr, data_prot, + if (mmap(data_addr, data_vlimit - data_vaddr, data_prot, data_flags, fd, data_offset) == (caddr_t) -1) { _rtld_error("%s: mmap of data failed: %s", path, strerror(errno)); return NULL; @@ -206,9 +205,8 @@ map_object(int fd, const char *path, con bss_vlimit = round_page(segs[i]->p_vaddr + segs[i]->p_memsz); bss_addr = mapbase + (bss_vaddr - base_vaddr); if (bss_vlimit > bss_vaddr) { /* There is something to do */ - if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot, - MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) == (caddr_t) -1) { - _rtld_error("%s: mmap of bss failed: %s", path, + if (mprotect(bss_addr, bss_vlimit - bss_vaddr, data_prot) == -1) { + _rtld_error("%s: mprotect of bss failed: %s", path, strerror(errno)); return NULL; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:16:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2993106566B; Fri, 10 Apr 2009 10:16:03 +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 D76CC8FC12; Fri, 10 Apr 2009 10:16:03 +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 n3AAG3tT039020; Fri, 10 Apr 2009 10:16:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AAG3Ow039018; Fri, 10 Apr 2009 10:16:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904101016.n3AAG3Ow039018@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Apr 2009 10:16: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: r190886 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:16:04 -0000 Author: kib Date: Fri Apr 10 10:16:03 2009 New Revision: 190886 URL: http://svn.freebsd.org/changeset/base/190886 Log: When vm_map_wire(9) is allowed to skip holes in the wired region, skip the mappings without any of read and execution rights, in particular, the PROT_NONE entries. This makes mlockall(2) work for the process address space that has such mappings. Since protection mode of the entry may change between setting MAP_ENTRY_IN_TRANSITION and final pass over the region that records the wire status of the entries, allocate new map entry flag MAP_ENTRY_WIRE_SKIPPED to mark the skipped PROT_NONE entries. Reported and tested by: Hans Ottevanger Reviewed by: alc MFC after: 3 weeks Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Apr 10 10:14:04 2009 (r190885) +++ head/sys/vm/vm_map.c Fri Apr 10 10:16:03 2009 (r190886) @@ -2217,6 +2217,16 @@ vm_map_wire(vm_map_t map, vm_offset_t st * */ if (entry->wired_count == 0) { + if ((entry->protection & (VM_PROT_READ|VM_PROT_EXECUTE)) + == 0) { + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { + end = entry->end; + rv = KERN_INVALID_ADDRESS; + goto done; + } + entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; + goto next_entry; + } entry->wired_count++; saved_start = entry->start; saved_end = entry->end; @@ -2274,6 +2284,7 @@ vm_map_wire(vm_map_t map, vm_offset_t st * Check the map for holes in the specified region. * If VM_MAP_WIRE_HOLESOK was specified, skip this check. */ + next_entry: if (((flags & VM_MAP_WIRE_HOLESOK) == 0) && (entry->end < end && (entry->next == &map->header || entry->next->start > entry->end))) { @@ -2295,6 +2306,8 @@ done: } entry = first_entry; while (entry != &map->header && entry->start < end) { + if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0) + goto next_entry_done; if (rv == KERN_SUCCESS) { if (user_wire) entry->eflags |= MAP_ENTRY_USER_WIRED; @@ -2317,9 +2330,10 @@ done: entry->object.vm_object->type == OBJT_DEVICE); } } + next_entry_done: KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, ("vm_map_wire: in-transition flag missing")); - entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; + entry->eflags &= ~(MAP_ENTRY_IN_TRANSITION|MAP_ENTRY_WIRE_SKIPPED); if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) { entry->eflags &= ~MAP_ENTRY_NEEDS_WAKEUP; need_wakeup = TRUE; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Apr 10 10:14:04 2009 (r190885) +++ head/sys/vm/vm_map.h Fri Apr 10 10:16:03 2009 (r190886) @@ -137,6 +137,8 @@ struct vm_map_entry { #define MAP_ENTRY_GROWS_DOWN 0x1000 /* Top-down stacks */ #define MAP_ENTRY_GROWS_UP 0x2000 /* Bottom-up stacks */ +#define MAP_ENTRY_WIRE_SKIPPED 0x4000 + #ifdef _KERNEL static __inline u_char vm_map_entry_behavior(vm_map_entry_t entry) From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:22:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 635D91065674; Fri, 10 Apr 2009 10:22:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 514E98FC25; Fri, 10 Apr 2009 10:22:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AAMiRO045754; Fri, 10 Apr 2009 10:22:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AAMipM045752; Fri, 10 Apr 2009 10:22:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904101022.n3AAMipM045752@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Apr 2009 10:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190887 - in head/sys: kern nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:22:44 -0000 Author: kib Date: Fri Apr 10 10:22:44 2009 New Revision: 190887 URL: http://svn.freebsd.org/changeset/base/190887 Log: Cache_lookup() for DOTDOT drops dvp vnode lock, allowing dvp to be reclaimed. Check the condition and return ENOENT then. In nfs_lookup(), respect ENOENT return from cache_lookup() when it is caused by dvp reclaim. Reported and tested by: pho Modified: head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Apr 10 10:16:03 2009 (r190886) +++ head/sys/kern/vfs_cache.c Fri Apr 10 10:22:44 2009 (r190887) @@ -554,8 +554,15 @@ success: else CACHE_RUNLOCK(); error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread); - if (cnp->cn_flags & ISDOTDOT) + if (cnp->cn_flags & ISDOTDOT) { vn_lock(dvp, ltype | LK_RETRY); + if (dvp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(*vpp); + *vpp = NULL; + return (ENOENT); + } + } if (error) { *vpp = NULL; goto retry; Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri Apr 10 10:16:03 2009 (r190886) +++ head/sys/nfsclient/nfs_vnops.c Fri Apr 10 10:22:44 2009 (r190887) @@ -978,6 +978,8 @@ nfs_lookup(struct vop_lookup_args *ap) vrele(newvp); *vpp = NULLVP; } else if (error == ENOENT) { + if (dvp->v_iflag & VI_DOOMED) + return (ENOENT); /* * We only accept a negative hit in the cache if the * modification time of the parent directory matches From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:52:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D3A41065673; Fri, 10 Apr 2009 10:52:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3733A8FC14; Fri, 10 Apr 2009 10:52:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AAqKYG046369; Fri, 10 Apr 2009 10:52:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AAqJnv046347; Fri, 10 Apr 2009 10:52:19 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904101052.n3AAqJnv046347@svn.freebsd.org> From: Robert Watson Date: Fri, 10 Apr 2009 10:52: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: r190888 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs fs/devfs fs/fifofs fs/unionfs kern nfs4client nfsclient sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:52:21 -0000 Author: rwatson Date: Fri Apr 10 10:52:19 2009 New Revision: 190888 URL: http://svn.freebsd.org/changeset/base/190888 Log: Remove VOP_LEASE and supporting functions. This hasn't been used since the removal of NQNFS, but was left in in case it was required for NFSv4. Since our new NFSv4 client and server can't use it for their requirements, GC the old mechanism, as well as other unused lease- related code and interfaces. Due to its impact on kernel programming and binary interfaces, this change should not be MFC'd. Proposed by: jeff Reviewed by: jeff Discussed with: rmacklem, zach loafman @ isilon Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/fs/unionfs/union_vnops.c head/sys/kern/kern_acct.c head/sys/kern/kern_alq.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_sig.c head/sys/kern/kern_time.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_default.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/nfs4client/nfs4_vnops.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/vnode.h Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/cddl/compat/opensolaris/sys/vnode.h Fri Apr 10 10:52:19 2009 (r190888) @@ -217,7 +217,6 @@ zfs_vn_rdwr(enum uio_rw rw, vnode_t *vp, vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (rw == UIO_WRITE) { ioflag = IO_SYNC; - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); } else { ioflag = IO_DIRECT; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -4577,7 +4577,6 @@ vop_deleteextattr { ZFS_EXIT(zfsvfs); return (error); } - VOP_LEASE(nd.ni_dvp, td, ap->a_cred, LEASE_WRITE); error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); vput(nd.ni_dvp); @@ -4639,7 +4638,6 @@ vop_setextattr { return (error); } - VOP_LEASE(vp, td, ap->a_cred, LEASE_WRITE); VATTR_NULL(&va); va.va_size = 0; error = VOP_SETATTR(vp, &va, ap->a_cred); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/fs/devfs/devfs_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -1549,7 +1549,6 @@ static struct vop_vector devfs_specops = .vop_create = VOP_PANIC, .vop_fsync = devfs_fsync, .vop_getattr = devfs_getattr, - .vop_lease = VOP_NULL, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/fs/fifofs/fifo_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -118,7 +118,6 @@ struct vop_vector fifo_specops = { .vop_getattr = VOP_EBADF, .vop_ioctl = fifo_ioctl, .vop_kqfilter = fifo_kqfilter, - .vop_lease = VOP_NULL, .vop_link = VOP_PANIC, .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/fs/unionfs/union_subr.c Fri Apr 10 10:52:19 2009 (r190888) @@ -805,10 +805,6 @@ unionfs_mkshadowdir(struct unionfs_mount if ((error = vn_start_write(udvp, &mp, V_WAIT | PCATCH))) goto unionfs_mkshadowdir_free_out; - if ((error = VOP_LEASE(udvp, td, cn.cn_cred, LEASE_WRITE))) { - vn_finished_write(mp); - goto unionfs_mkshadowdir_free_out; - } unionfs_create_uppervattr_core(ump, &lva, &va, td); error = VOP_MKDIR(udvp, &uvp, &cn, &va); @@ -874,8 +870,7 @@ unionfs_mkwhiteout(struct vnode *dvp, st if ((error = vn_start_write(dvp, &mp, V_WAIT | PCATCH))) goto unionfs_mkwhiteout_free_out; - if (!(error = VOP_LEASE(dvp, td, td->td_ucred, LEASE_WRITE))) - error = VOP_WHITEOUT(dvp, &cn, CREATE); + error = VOP_WHITEOUT(dvp, &cn, CREATE); vn_finished_write(mp); @@ -949,9 +944,6 @@ unionfs_vn_create_on_upper(struct vnode goto unionfs_vn_create_on_upper_free_out1; } - if ((error = VOP_LEASE(udvp, td, cred, LEASE_WRITE)) != 0) - goto unionfs_vn_create_on_upper_free_out1; - if ((error = VOP_CREATE(udvp, &vp, &cn, uvap)) != 0) goto unionfs_vn_create_on_upper_free_out1; @@ -999,10 +991,6 @@ unionfs_copyfile_core(struct vnode *lvp, uio.uio_segflg = UIO_SYSSPACE; uio.uio_offset = 0; - if ((error = VOP_LEASE(lvp, td, cred, LEASE_READ)) != 0) - return (error); - if ((error = VOP_LEASE(uvp, td, cred, LEASE_WRITE)) != 0) - return (error); buf = malloc(MAXBSIZE, M_TEMP, M_WAITOK); while (error == 0) { Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/fs/unionfs/union_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -902,27 +902,6 @@ unionfs_write(struct vop_write_args *ap) } static int -unionfs_lease(struct vop_lease_args *ap) -{ - int error; - struct unionfs_node *unp; - struct vnode *vp; - - UNIONFS_INTERNAL_DEBUG("unionfs_lease: enter\n"); - - KASSERT_UNIONFS_VNODE(ap->a_vp); - - unp = VTOUNIONFS(ap->a_vp); - vp = (unp->un_uppervp != NULLVP ? unp->un_uppervp : unp->un_lowervp); - - error = VOP_LEASE(vp, ap->a_td, ap->a_cred, ap->a_flag); - - UNIONFS_INTERNAL_DEBUG("unionfs_lease: lease (%d)\n", error); - - return (error); -} - -static int unionfs_ioctl(struct vop_ioctl_args *ap) { int error; @@ -947,7 +926,7 @@ unionfs_ioctl(struct vop_ioctl_args *ap) error = VOP_IOCTL(ovp, ap->a_command, ap->a_data, ap->a_fflag, ap->a_cred, ap->a_td); - UNIONFS_INTERNAL_DEBUG("unionfs_ioctl: lease (%d)\n", error); + UNIONFS_INTERNAL_DEBUG("unionfs_ioctl: leave (%d)\n", error); return (error); } @@ -2461,7 +2440,6 @@ struct vop_vector unionfs_vnodeops = { .vop_getwritemount = unionfs_getwritemount, .vop_inactive = unionfs_inactive, .vop_ioctl = unionfs_ioctl, - .vop_lease = unionfs_lease, .vop_link = unionfs_link, .vop_listextattr = unionfs_listextattr, .vop_lock1 = unionfs_lock, Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/kern_acct.c Fri Apr 10 10:52:19 2009 (r190888) @@ -436,7 +436,6 @@ acct_process(struct thread *td) * Write the accounting information to the file. */ vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); - VOP_LEASE(acct_vp, td, acct_cred, LEASE_WRITE); ret = vn_rdwr(UIO_WRITE, acct_vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, (int *)0, td); Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/kern_alq.c Fri Apr 10 10:52:19 2009 (r190888) @@ -293,7 +293,6 @@ alq_doio(struct alq *alq) vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - VOP_LEASE(vp, td, alq->aq_cred, LEASE_WRITE); /* * XXX: VOP_WRITE error checks are ignored. */ Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/kern_ktrace.c Fri Apr 10 10:52:19 2009 (r190888) @@ -992,7 +992,6 @@ ktr_writerequest(struct thread *td, stru vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_start_write(vp, &mp, V_WAIT); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - (void)VOP_LEASE(vp, td, cred, LEASE_WRITE); #ifdef MAC error = mac_vnode_check_write(cred, NOCRED, vp); if (error == 0) Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/kern_sig.c Fri Apr 10 10:52:19 2009 (r190888) @@ -2984,7 +2984,6 @@ restart: if (set_core_nodump_flag) vattr.va_flags = UF_NODUMP; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - VOP_LEASE(vp, td, cred, LEASE_WRITE); VOP_SETATTR(vp, &vattr, cred); VOP_UNLOCK(vp, 0); vn_finished_write(mp); Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/kern_time.c Fri Apr 10 10:52:19 2009 (r190888) @@ -74,7 +74,6 @@ static uma_zone_t itimer_zone = NULL; static int settime(struct thread *, struct timeval *); static void timevalfix(struct timeval *); -static void no_lease_updatetime(int); static void itimer_start(void); static int itimer_init(void *, int, int); @@ -106,14 +105,6 @@ int itimespecfix(struct timespec *ts); SYSINIT(posix_timer, SI_SUB_P1003_1B, SI_ORDER_FIRST+4, itimer_start, NULL); -static void -no_lease_updatetime(deltat) - int deltat; -{ -} - -void (*lease_updatetime)(int) = no_lease_updatetime; - static int settime(struct thread *td, struct timeval *tv) { @@ -168,9 +159,6 @@ settime(struct thread *td, struct timeva ts.tv_nsec = tv->tv_usec * 1000; mtx_lock(&Giant); tc_setclock(&ts); - (void) splsoftclock(); - lease_updatetime(delta.tv_sec); - splx(s); resettodr(); mtx_unlock(&Giant); return (0); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/uipc_usrreq.c Fri Apr 10 10:52:19 2009 (r190888) @@ -457,10 +457,8 @@ restart: error = mac_vnode_check_create(td->td_ucred, nd.ni_dvp, &nd.ni_cnd, &vattr); #endif - if (error == 0) { - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); + if (error == 0) error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); - } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (error) { Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vfs_acl.c Fri Apr 10 10:52:19 2009 (r190888) @@ -91,7 +91,6 @@ vacl_set_acl(struct thread *td, struct v error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_vnode_check_setacl(td->td_ucred, vp, type, &inkernacl); @@ -117,7 +116,6 @@ vacl_get_acl(struct thread *td, struct v struct acl inkernelacl; int error; - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_vnode_check_getacl(td->td_ucred, vp, type); @@ -146,7 +144,6 @@ vacl_delete(struct thread *td, struct vn error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_vnode_check_deleteacl(td->td_ucred, vp, type); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vfs_default.c Fri Apr 10 10:52:19 2009 (r190888) @@ -98,7 +98,6 @@ struct vop_vector default_vnodeops = { .vop_ioctl = VOP_ENOTTY, .vop_kqfilter = vop_stdkqfilter, .vop_islocked = vop_stdislocked, - .vop_lease = VOP_NULL, .vop_lock1 = vop_stdlock, .vop_lookup = vop_nolookup, .vop_open = VOP_NULL, Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vfs_extattr.c Fri Apr 10 10:52:19 2009 (r190888) @@ -175,7 +175,6 @@ extattr_set_vp(struct vnode *vp, int att error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); aiov.iov_base = data; @@ -341,7 +340,6 @@ extattr_get_vp(struct vnode *vp, int att int error; VFS_ASSERT_GIANT(vp->v_mount); - VOP_LEASE(vp, td, td->td_ucred, LEASE_READ); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* @@ -522,7 +520,6 @@ extattr_delete_vp(struct vnode *vp, int error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC @@ -664,7 +661,6 @@ extattr_list_vp(struct vnode *vp, int at int error; VFS_ASSERT_GIANT(vp->v_mount); - VOP_LEASE(vp, td, td->td_ucred, LEASE_READ); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); auiop = NULL; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vfs_syscalls.c Fri Apr 10 10:52:19 2009 (r190888) @@ -1161,7 +1161,6 @@ kern_openat(struct thread *td, int fd, c if (flags & O_TRUNC) { if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto bad; - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); VATTR_NULL(&vat); vat.va_size = 0; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); @@ -1353,7 +1352,6 @@ restart: &nd.ni_cnd, &vattr); #endif if (!error) { - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); if (whiteout) error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, CREATE); else { @@ -1460,7 +1458,6 @@ restart: if (error) goto out; #endif - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); if (error == 0) vput(nd.ni_vp); @@ -1606,8 +1603,6 @@ kern_linkat(struct thread *td, int fd1, error = EEXIST; } else if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) == 0) { - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); error = can_hardlink(vp, td->td_ucred); if (error == 0) #ifdef MAC @@ -1727,7 +1722,6 @@ restart: if (error) goto out2; #endif - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath); if (error == 0) vput(nd.ni_vp); @@ -1787,7 +1781,6 @@ restart: return (error); goto restart; } - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE); NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); @@ -1893,7 +1886,6 @@ restart: if (error) goto out; #endif - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); #ifdef MAC out: @@ -2667,7 +2659,6 @@ setfflags(td, vp, flags) if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VATTR_NULL(&vattr); vattr.va_flags = flags; @@ -2795,7 +2786,6 @@ setfmode(td, vp, mode) if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VATTR_NULL(&vattr); vattr.va_mode = mode & ALLPERMS; @@ -2958,7 +2948,6 @@ setfown(td, vp, uid, gid) if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); VATTR_NULL(&vattr); vattr.va_uid = uid; @@ -3172,7 +3161,6 @@ setutimes(td, vp, ts, numtimes, nullflag if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); setbirthtime = 0; if (numtimes < 3 && !VOP_GETATTR(vp, &vattr, td->td_ucred) && @@ -3403,7 +3391,6 @@ kern_truncate(struct thread *td, char *p return (error); } NDFREE(&nd, NDF_ONLY_PNBUF); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type == VDIR) error = EISDIR; @@ -3647,13 +3634,6 @@ kern_renameat(struct thread *td, int old #endif out: if (!error) { - VOP_LEASE(tdvp, td, td->td_ucred, LEASE_WRITE); - if (fromnd.ni_dvp != tdvp) { - VOP_LEASE(fromnd.ni_dvp, td, td->td_ucred, LEASE_WRITE); - } - if (tvp) { - VOP_LEASE(tvp, td, td->td_ucred, LEASE_WRITE); - } error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd, tond.ni_dvp, tond.ni_vp, &tond.ni_cnd); NDFREE(&fromnd, NDF_ONLY_PNBUF); @@ -3779,7 +3759,6 @@ restart: if (error) goto out; #endif - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); error = VOP_MKDIR(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); #ifdef MAC out: @@ -3872,8 +3851,6 @@ restart: return (error); goto restart; } - VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); vn_finished_write(mp); out: @@ -4462,7 +4439,6 @@ fhopen(td, uap) vrele(vp); goto out; } - VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); /* XXX */ #ifdef MAC /* Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vfs_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -153,14 +153,10 @@ restart: #ifdef MAC error = mac_vnode_check_create(cred, ndp->ni_dvp, &ndp->ni_cnd, vap); - if (error == 0) { + if (error == 0) #endif - VOP_LEASE(ndp->ni_dvp, td, cred, LEASE_WRITE); error = VOP_CREATE(ndp->ni_dvp, &ndp->ni_vp, &ndp->ni_cnd, vap); -#ifdef MAC - } -#endif vput(ndp->ni_dvp); vn_finished_write(mp); if (error) { @@ -521,7 +517,6 @@ vn_read(fp, uio, active_cred, flags, td) if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - VOP_LEASE(vp, td, fp->f_cred, LEASE_READ); /* * According to McKusick the vn lock was protecting f_offset here. * It is now protected by the FOFFSET_LOCKED flag. @@ -598,7 +593,6 @@ vn_write(fp, uio, active_cred, flags, td if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - VOP_LEASE(vp, td, fp->f_cred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; @@ -642,7 +636,6 @@ vn_truncate(fp, length, active_cred, td) VFS_UNLOCK_GIANT(vfslocked); return (error); } - VOP_LEASE(vp, td, active_cred, LEASE_WRITE); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_type == VDIR) { error = EISDIR; Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/kern/vnode_if.src Fri Apr 10 10:52:19 2009 (r190888) @@ -199,16 +199,6 @@ vop_write { }; -%% lease vp = = = - -vop_lease { - IN struct vnode *vp; - IN struct thread *td; - IN struct ucred *cred; - IN int flag; -}; - - %% ioctl vp U U U vop_ioctl { Modified: head/sys/nfs4client/nfs4_vnops.c ============================================================================== --- head/sys/nfs4client/nfs4_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/nfs4client/nfs4_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -173,7 +173,6 @@ struct vop_vector nfs4_vnodeops = { .vop_getpages = nfs_getpages, .vop_putpages = nfs_putpages, .vop_inactive = nfs_inactive, - .vop_lease = VOP_NULL, .vop_link = nfs4_link, .vop_lookup = nfs4_lookup, .vop_mkdir = nfs4_mkdir, Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/nfsclient/nfs_vnops.c Fri Apr 10 10:52:19 2009 (r190888) @@ -168,7 +168,6 @@ struct vop_vector nfs_vnodeops = { .vop_getpages = nfs_getpages, .vop_putpages = nfs_putpages, .vop_inactive = nfs_inactive, - .vop_lease = VOP_NULL, .vop_link = nfs_link, .vop_lookup = nfs_lookup, .vop_mkdir = nfs_mkdir, Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/sys/vnode.h Fri Apr 10 10:52:19 2009 (r190888) @@ -412,14 +412,6 @@ extern struct uma_zone *namei_zone; extern int prtactive; /* nonzero to call vprint() */ extern struct vattr va_null; /* predefined null vattr structure */ -/* - * Macro/function to check for client cache inconsistency w.r.t. leasing. - */ -#define LEASE_READ 0x1 /* Check lease for readers */ -#define LEASE_WRITE 0x2 /* Check lease for modifiers */ - -extern void (*lease_updatetime)(int deltat); - #define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) #define VI_LOCK_FLAGS(vp, flags) mtx_lock_flags(&(vp)->v_interlock, (flags)) #define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) @@ -587,8 +579,6 @@ struct uio; struct vattr; struct vnode; -extern int (*lease_check_hook)(struct vop_lease_args *); - /* cache_* may belong in namei.h. */ void cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp); @@ -607,7 +597,6 @@ int insmntque1(struct vnode *vp, struct void (*dtr)(struct vnode *, void *), void *dtr_arg); int insmntque(struct vnode *vp, struct mount *mp); u_quad_t init_va_filerev(void); -int lease_check(struct vop_lease_args *ap); int speedup_syncer(void); #define textvp_fullpath(p, rb, rfb) \ vn_fullpath(FIRST_THREAD_IN_PROC(p), (p)->p_textvp, rb, rfb) Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Apr 10 10:22:44 2009 (r190887) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Apr 10 10:52:19 2009 (r190888) @@ -278,7 +278,6 @@ restart: return (error); goto restart; } - VOP_LEASE(nd.ni_dvp, td, KERNCRED, LEASE_WRITE); error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat); VOP_UNLOCK(nd.ni_dvp, 0); if (error) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 10:59:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68261106566C; Fri, 10 Apr 2009 10:59:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5620E8FC17; Fri, 10 Apr 2009 10:59:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AAxmxd046607; Fri, 10 Apr 2009 10:59:48 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AAxmTh046606; Fri, 10 Apr 2009 10:59:48 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904101059.n3AAxmTh046606@svn.freebsd.org> From: Robert Watson Date: Fri, 10 Apr 2009 10:59: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: r190889 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 10:59:48 -0000 Author: rwatson Date: Fri Apr 10 10:59:48 2009 New Revision: 190889 URL: http://svn.freebsd.org/changeset/base/190889 Log: Remove VOP_LEASE(9) man page, as we no longer have a VOP_LEASE() in the kernel. Deleted: head/share/man/man9/VOP_LEASE.9 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Apr 10 10:52:19 2009 (r190888) +++ head/share/man/man9/Makefile Fri Apr 10 10:59:48 2009 (r190889) @@ -331,7 +331,6 @@ MAN= accept_filter.9 \ VOP_GETVOBJECT.9 \ VOP_INACTIVE.9 \ VOP_IOCTL.9 \ - VOP_LEASE.9 \ VOP_LINK.9 \ VOP_LISTEXTATTR.9 \ VOP_LOCK.9 \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 11:15:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF8B106567B; Fri, 10 Apr 2009 11:15:35 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B68F8FC13; Fri, 10 Apr 2009 11:15:35 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3ABFZsZ047017; Fri, 10 Apr 2009 11:15:35 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3ABFYrb047016; Fri, 10 Apr 2009 11:15:34 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200904101115.n3ABFYrb047016@svn.freebsd.org> From: Ulf Lilleengen Date: Fri, 10 Apr 2009 11:15: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: r190891 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 11:15:35 -0000 Author: lulf Date: Fri Apr 10 11:15:34 2009 New Revision: 190891 URL: http://svn.freebsd.org/changeset/base/190891 Log: - Better wording in comment. Suggested by: Christoph Mallon Modified: head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri Apr 10 11:08:27 2009 (r190890) +++ head/sbin/gvinum/gvinum.c Fri Apr 10 11:15:34 2009 (r190891) @@ -630,7 +630,7 @@ char * find_drive(const char *device) { - /* Strip away eventual /dev/ in front. */ + /* Strip possible /dev/ in front. */ if (strncmp(device, "/dev/", 5) == 0) device += 5; return (find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 14:24:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFAA7106564A; Fri, 10 Apr 2009 14:24:12 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89D618FC1C; Fri, 10 Apr 2009 14:24:12 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AEOCRd050781; Fri, 10 Apr 2009 14:24:12 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AEOC7K050779; Fri, 10 Apr 2009 14:24:12 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200904101424.n3AEOC7K050779@svn.freebsd.org> From: Daniel Gerzo Date: Fri, 10 Apr 2009 14:24: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: r190894 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 14:24:13 -0000 Author: danger (doc committer) Date: Fri Apr 10 14:24:12 2009 New Revision: 190894 URL: http://svn.freebsd.org/changeset/base/190894 Log: - VOP_LEASE.9 has been removed Approved by: rwatson Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Apr 10 13:45:56 2009 (r190893) +++ head/ObsoleteFiles.inc Fri Apr 10 14:24:12 2009 (r190894) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090410: VOP_LEASE.9 removed +OLD_FILES+=usr/share/man/man9/VOP_LEASE.9 # 20090405: removal of if_ppp(4) and if_sl(4) OLD_FILES+=sbin/slattach rescue/slattach OLD_FILES+=sbin/startslip rescue/startslip From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 14:41:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66561106566B; Fri, 10 Apr 2009 14:41:51 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 561518FC12; Fri, 10 Apr 2009 14:41:51 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AEfpG9051137; Fri, 10 Apr 2009 14:41:51 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AEfpom051136; Fri, 10 Apr 2009 14:41:51 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200904101441.n3AEfpom051136@svn.freebsd.org> From: Max Laier Date: Fri, 10 Apr 2009 14:41: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: r190895 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 14:41:51 -0000 Author: mlaier Date: Fri Apr 10 14:41:51 2009 New Revision: 190895 URL: http://svn.freebsd.org/changeset/base/190895 Log: Remove interfaces from IFG_ALL on detach. This cures a couple of pf panics when using the "self" keyword in tables or as ()-style host address and fixes "ifconfig -g all" output. PR: kern/130977, kern/131310 Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 10 14:24:12 2009 (r190894) +++ head/sys/net/if.c Fri Apr 10 14:41:51 2009 (r190895) @@ -887,6 +887,7 @@ if_detach(struct ifnet *ifp) rt_ifannouncemsg(ifp, IFAN_DEPARTURE); EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); + if_delgroup(ifp, IFG_ALL); IF_AFDATA_LOCK(ifp); for (dp = domains; dp; dp = dp->dom_next) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 15:01:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813D0106566C; Fri, 10 Apr 2009 15:01:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6738D8FC22; Fri, 10 Apr 2009 15:01:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AF1mIn051786; Fri, 10 Apr 2009 15:01:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AF1mmH051785; Fri, 10 Apr 2009 15:01:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101501.n3AF1mmH051785@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 15:01: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: r190896 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 15:01:48 -0000 Author: imp Date: Fri Apr 10 15:01:48 2009 New Revision: 190896 URL: http://svn.freebsd.org/changeset/base/190896 Log: Updates based on my testing of the cards. Modified: head/share/man/man4/ed.4 Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Fri Apr 10 14:41:51 2009 (r190895) +++ head/share/man/man4/ed.4 Fri Apr 10 15:01:48 2009 (r190896) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2009 +.Dd April 9, 2009 .Dt ED 4 .Os .Sh NAME @@ -66,12 +66,6 @@ Tamarack's TC5299J chips all support int Realtek's PCI and ISA RTL80x9-based cards are also supported. For these chipsets, autonegotiation and status reporting are supported. .Pp -The -.Nm -driver uses a unique multi-buffering mechanism to achieve high transmit performance. -When using 16bit ISA cards, as high as 97% of the theoretical maximum performance of -the IEEE 802.3 CSMA Ethernet is possible. -.Pp In addition to the standard port and IRQ specifications, the .Nm driver also supports a number of @@ -183,7 +177,7 @@ Danpex EN-6200P2 .It D-Link DE-298, DE-298P (flags 0x500000) (PC-98) .It -D-Link DE-650/660 +D-Link DE-660, DE-660+ .It D-Link IC-CARD/IC-CARD+ Ethernet .It @@ -317,6 +311,8 @@ driver does not support the following Et .Bl -bullet -compact .It Mitsubishi LAN Adapter B8895 +.It +D-Link DE-650 .El .Sh DIAGNOSTICS .Bl -diag @@ -373,6 +369,8 @@ The device is using a different I/O port Attempts to get the MAC address failed. .It "ed%d: Missing mii!" Probing for an MII bus has failed. +This indicates a coding error in the PC Card attachment, because a PHY +is required for the chips that generate this error message. .El .Sh CAVEATS Early revision DS8390 chips have problems. @@ -393,18 +391,17 @@ on the 16bit cards. This can lead to ring-buffer overruns resulting in dropped packets during heavy network traffic. .Pp -16bit Compex cards identify themselves as being 8bit. -While these cards will -work in 8bit mode, much higher performance can be achieved by specifying -.Cd "flags 0x04" -(force 16bit mode) in your kernel config file. -In addition, you should also specify -.Cd "iosiz 16384" -to take advantage of the extra 8K of shared memory that 16bit mode provides. -.Pp The Mitsubishi B8895 PC Card uses a DP83902, but its ASIC part is undocumented. Neither the NE2000 nor the WD83x0 drivers work with this card. +.Pp +The D-LINK DE-650 has funky resources that differ from other cards and could +likely be made to work. +Its shared memory interface conflicts with other resources on many +laptops and cannot be moved. +The pccard(4) layer does not support activating a CFE that it fails to +allocate all the resources for. +.Pp .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -431,7 +428,9 @@ packets are received. As a result, it may throw out some good packets which have been received but not yet transferred from the card to main memory. .Pp -The -.Nm +The +.Nm +driver is slow by today's standards. +.Pp PC Card attachment supports the D-Link DMF650TX LAN/Modem card's Ethernet port only at this time. From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 15:18:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5CD1106566C; Fri, 10 Apr 2009 15:18:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9557B8FC16; Fri, 10 Apr 2009 15:18:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AFI3p6052297; Fri, 10 Apr 2009 15:18:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AFI3at052296; Fri, 10 Apr 2009 15:18:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101518.n3AFI3at052296@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 15:18: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: r190897 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 15:18:04 -0000 Author: imp Date: Fri Apr 10 15:18:03 2009 New Revision: 190897 URL: http://svn.freebsd.org/changeset/base/190897 Log: No need to check for chip type here. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:01:48 2009 (r190896) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:18:03 2009 (r190897) @@ -512,7 +512,7 @@ ed_pccard_attach(device_t dev) */ for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) sum |= sc->enaddr[i]; - if (sc->chip_type == ED_CHIP_TYPE_DP8390 && sum == 0) { + if (sum == 0) { pccard_get_ether(dev, enaddr); if (bootverbose) device_printf(dev, "CIS MAC %6D\n", enaddr, ":"); From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 15:30:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA2F106564A; Fri, 10 Apr 2009 15:30:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B1EA8FC1C; Fri, 10 Apr 2009 15:30:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AFUJXl052578; Fri, 10 Apr 2009 15:30:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AFUJeg052577; Fri, 10 Apr 2009 15:30:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101530.n3AFUJeg052577@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 15:30: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: r190898 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 15:30:20 -0000 Author: imp Date: Fri Apr 10 15:30:19 2009 New Revision: 190898 URL: http://svn.freebsd.org/changeset/base/190898 Log: Fix some comments. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:18:03 2009 (r190897) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:30:19 2009 (r190898) @@ -469,8 +469,10 @@ ed_pccard_attach(device_t dev) goto bad; /* - * Determine which chipset we are. All the PC Card chipsets have the - * ASIC and NIC offsets in the same place. + * Determine which chipset we are. Almost the PC Card chipsets have + * the ASIC and NIC offsets in the same place. There's a tiny + * minority (2?) that follow the WD80x3 conventions, which are handled + * as a special case. */ sc->asic_offset = ED_NOVELL_ASIC_OFFSET; sc->nic_offset = ED_NOVELL_NIC_OFFSET; @@ -502,13 +504,14 @@ ed_pccard_attach(device_t dev) } /* - * For the older cards, we have to get the MAC address from - * the card in some way. Let's try the standard PCMCIA way - * first. If that fails, then check to see if we have valid - * data from the standard NE-2000 data roms. If that fails, - * check to see if the card has a hint about where to look in - * its CIS. If that fails, maybe we should look at some - * default value. In all fails, we fail the attach. + * There are several ways to get the MAC address for the card. + * Some of the above probe routines can fill in the enaddr. If + * not, we run through a number of 'well known' locations: + * (1) From the PC Card FUNCE + * (2) From offset 0 in the shared memory + * (3) From a hinted offset in attribute memory + * (4) From 0xff0 in attribute memory + * If we can't get a non-zero MAC address from this list, we fail. */ for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) sum |= sc->enaddr[i]; From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 15:33:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5F9106566B; Fri, 10 Apr 2009 15:33:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D36F8FC22; Fri, 10 Apr 2009 15:33:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AFXlxD052682; Fri, 10 Apr 2009 15:33:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AFXlcg052681; Fri, 10 Apr 2009 15:33:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101533.n3AFXlcg052681@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 15:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190899 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 15:33:48 -0000 Author: imp Date: Fri Apr 10 15:33:47 2009 New Revision: 190899 URL: http://svn.freebsd.org/changeset/base/190899 Log: The D-Link DE-650 isn't tagged as a network card, so allow it to attach anyway. Add a comment about a 'common' mfg/prod pair that's used in a very large array of different cards. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:30:19 2009 (r190898) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:33:47 2009 (r190899) @@ -165,7 +165,7 @@ static const struct ed_product { { PCMCIA_CARD(COREGA, LAPCCTXD), 0}, { PCMCIA_CARD(DAYNA, COMMUNICARD_E_1), 0}, { PCMCIA_CARD(DAYNA, COMMUNICARD_E_2), 0}, - { PCMCIA_CARD(DLINK, DE650), 0 }, + { PCMCIA_CARD(DLINK, DE650), NE2000DVF_ANYFUNC }, { PCMCIA_CARD(DLINK, DE660), 0 }, { PCMCIA_CARD(DLINK, DE660PLUS), 0}, { PCMCIA_CARD(DYNALINK, L10C), 0}, @@ -182,6 +182,7 @@ static const struct ed_product { { PCMCIA_CARD(KINGSTON, CIO10T), 0}, { PCMCIA_CARD(KINGSTON, KNE2), 0}, { PCMCIA_CARD(LANTECH, FASTNETTX), NE2000DVF_AX88X90}, + /* Same ID for many different cards, including generic NE2000 */ { PCMCIA_CARD(LINKSYS, COMBO_ECARD), NE2000DVF_DL100XX | NE2000DVF_AX88X90}, { PCMCIA_CARD(LINKSYS, ECARD_1), 0}, From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 16:12:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9334B106566B; Fri, 10 Apr 2009 16:12:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F5CC8FC1C; Fri, 10 Apr 2009 16:12:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AGC1cX053521; Fri, 10 Apr 2009 16:12:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AGC1t4053520; Fri, 10 Apr 2009 16:12:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101612.n3AGC1t4053520@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 16:12: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: r190900 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 16:12:02 -0000 Author: imp Date: Fri Apr 10 16:12:00 2009 New Revision: 190900 URL: http://svn.freebsd.org/changeset/base/190900 Log: Improvements for TC5299J MII support. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 15:33:47 2009 (r190899) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 16:12:00 2009 (r190900) @@ -258,7 +258,6 @@ static int ed_ifmedia_upd(struct ifnet * static void ed_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int ed_pccard_tc5299j(device_t dev, const struct ed_product *); -static void ed_pccard_tc5299j_mii_reset(struct ed_softc *sc); static u_int ed_pccard_tc5299j_mii_readbits(struct ed_softc *sc, int nbits); static void ed_pccard_tc5299j_mii_writebits(struct ed_softc *sc, u_int val, int nbits); @@ -574,7 +573,6 @@ ed_pccard_attach(device_t dev) } } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { - ed_pccard_tc5299j_mii_reset(sc); if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts)) != 0) { device_printf(dev, "Missing mii!\n"); @@ -1009,36 +1007,24 @@ ed_pccard_tc5299j(device_t dev, const st return (0); } -/* MII bit-twiddling routines for cards using TC5299J chipset */ -#define TC5299J_MIISET(sc, x) ed_nic_outb(sc, ED_TC5299J_MIIBUS, \ - ed_nic_inb(sc, ED_TC5299J_MIIBUS) | (x)) -#define TC5299J_MIICLR(sc, x) ed_nic_outb(sc, ED_TC5299J_MIIBUS, \ - ed_nic_inb(sc, ED_TC5299J_MIIBUS) & ~(x)) - -static void -ed_pccard_tc5299j_mii_reset(struct ed_softc *sc) -{ - /* Do nothing! */ -} - static void ed_pccard_tc5299j_mii_writebits(struct ed_softc *sc, u_int val, int nbits) { int i; - uint8_t cr; + uint8_t cr, data; + /* Select page 3 */ cr = ed_nic_inb(sc, ED_P0_CR); ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); - TC5299J_MIICLR(sc, ED_TC5299J_MII_DIROUT); for (i = nbits - 1; i >= 0; i--) { - if ((val >> i) & 1) - TC5299J_MIISET(sc, ED_TC5299J_MII_DATAOUT); - else - TC5299J_MIICLR(sc, ED_TC5299J_MII_DATAOUT); - TC5299J_MIISET(sc, ED_TC5299J_MII_CLK); - TC5299J_MIICLR(sc, ED_TC5299J_MII_CLK); + data = (val >> i) & 1 ? ED_TC5299J_MII_DATAOUT : 0; + ed_nic_outb(sc, ED_TC5299J_MIIBUS, data); + ed_nic_outb(sc, ED_TC5299J_MIIBUS, data | ED_TC5299J_MII_CLK); } + ed_nic_outb(sc, ED_TC5299J_MIIBUS, 0); + + /* Restore prior page */ ed_nic_outb(sc, ED_P0_CR, cr); } @@ -1049,17 +1035,21 @@ ed_pccard_tc5299j_mii_readbits(struct ed u_int val = 0; uint8_t cr; + /* Select page 3 */ cr = ed_nic_inb(sc, ED_P0_CR); ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); - TC5299J_MIISET(sc, ED_TC5299J_MII_DIROUT); + ed_asic_outb(sc, ED_TC5299J_MIIBUS, ED_TC5299J_MII_DIROUT); for (i = nbits - 1; i >= 0; i--) { - TC5299J_MIISET(sc, ED_TC5299J_MII_CLK); + ed_nic_outb(sc, ED_TC5299J_MIIBUS, + ED_TC5299J_MII_CLK | ED_TC5299J_MII_DIROUT); val <<= 1; if (ed_nic_inb(sc, ED_TC5299J_MIIBUS) & ED_TC5299J_MII_DATAIN) val++; - TC5299J_MIICLR(sc, ED_TC5299J_MII_CLK); + ed_nic_outb(sc, ED_TC5299J_MIIBUS, ED_TC5299J_MII_DIROUT); } + + /* Restore prior page */ ed_nic_outb(sc, ED_P0_CR, cr); return val; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 17:34:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 968E41065670; Fri, 10 Apr 2009 17:34:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 864E68FC1B; Fri, 10 Apr 2009 17:34:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AHYU02055298; Fri, 10 Apr 2009 17:34:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AHYUYG055297; Fri, 10 Apr 2009 17:34:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101734.n3AHYUYG055297@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 17:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190901 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 17:34:31 -0000 Author: imp Date: Fri Apr 10 17:34:30 2009 New Revision: 190901 URL: http://svn.freebsd.org/changeset/base/190901 Log: Fix comment Submitted by: danfe@ Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 16:12:00 2009 (r190900) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 17:34:30 2009 (r190901) @@ -469,10 +469,9 @@ ed_pccard_attach(device_t dev) goto bad; /* - * Determine which chipset we are. Almost the PC Card chipsets have - * the ASIC and NIC offsets in the same place. There's a tiny - * minority (2?) that follow the WD80x3 conventions, which are handled - * as a special case. + * Determine which chipset we are. Almost all the PC Card chipsets + * have the Novel ASIC and NIC offsets. There's 2 known cards that + * follow the WD80x3 conventions, which are handled as a special case. */ sc->asic_offset = ED_NOVELL_ASIC_OFFSET; sc->nic_offset = ED_NOVELL_NIC_OFFSET; From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 18:35:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A79510656E2; Fri, 10 Apr 2009 18:35:34 +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 BA03F8FC1A; Fri, 10 Apr 2009 18:35:33 +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 n3AIXDuM047487; Fri, 10 Apr 2009 12:33:13 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Apr 2009 12:34:04 -0600 (MDT) Message-Id: <20090410.123404.-1398308997.imp@bsdimp.com> To: brooks@freebsd.org From: "M. Warner Losh" In-Reply-To: <20090409153805.GB83847@lor.one-eyed-alien.net> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> 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, amdmi3@amdmi3.ru, src-committers@freebsd.org, des@freebsd.org Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 18:35:34 -0000 In message: <20090409153805.GB83847@lor.one-eyed-alien.net> Brooks Davis writes: : Unless you have one of the few interfaces that does not generate : link status events, dhclient will be started by devd. The only ones I : know of are a subset set of ed(4) devices, though I think imp may have : fixed those recently with a stub ifmedia interface. I think ep(4) is the only "common" case left. For ed(4) we now do the right thing for the really old cards (those without a MII) as well as the merely old cards (those with a phy). For the really old cards, we generally default to "Link is up all the time" as our status, specifically to keep dhclient happy. Of course, the number of users of these cards is quite low these days... I've fixed a number of bugs that should have been bad enough for people to complain, but since nobody did, I'm guessing the install base is smaller than I'd thought... Warner From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 18:44:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691A81065675 for ; Fri, 10 Apr 2009 18:44:47 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 06D668FC14 for ; Fri, 10 Apr 2009 18:44:46 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n3AIhbct006802; Fri, 10 Apr 2009 13:43:37 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n3AIhbud006801; Fri, 10 Apr 2009 13:43:37 -0500 (CDT) (envelope-from brooks) Date: Fri, 10 Apr 2009 13:43:37 -0500 From: Brooks Davis To: "M. Warner Losh" Message-ID: <20090410184337.GA6661@lor.one-eyed-alien.net> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> <20090410.123404.-1398308997.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <20090410.123404.-1398308997.imp@bsdimp.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Fri, 10 Apr 2009 13:43:37 -0500 (CDT) Cc: brooks@freebsd.org, amdmi3@amdmi3.ru, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, des@freebsd.org Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 18:44:47 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 10, 2009 at 12:34:04PM -0600, M. Warner Losh wrote: > In message: <20090409153805.GB83847@lor.one-eyed-alien.net> > Brooks Davis writes: > : Unless you have one of the few interfaces that does not generate > : link status events, dhclient will be started by devd. The only ones I > : know of are a subset set of ed(4) devices, though I think imp may have > : fixed those recently with a stub ifmedia interface. >=20 > I think ep(4) is the only "common" case left. For ed(4) we now do the > right thing for the really old cards (those without a MII) as well as > the merely old cards (those with a phy). For the really old cards, we > generally default to "Link is up all the time" as our status, > specifically to keep dhclient happy. >=20 > Of course, the number of users of these cards is quite low these > days... I've fixed a number of bugs that should have been bad enough > for people to complain, but since nobody did, I'm guessing the install > base is smaller than I'd thought... Good to know. This will be pretty useful since some emulators seem to emulate very old ed devices. -- Brooks --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJ35NYXY6L6fI4GtQRAhLTAKC7Pf2t753s+XtNgqIkw7nApxA53wCfU3YR vWZHkawkPbwPkPuDJ4/3W3U= =oyk0 -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 18:46:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA4A10656CC; Fri, 10 Apr 2009 18:46:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E87E8FC0C; Fri, 10 Apr 2009 18:46:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AIkkr6057789; Fri, 10 Apr 2009 18:46:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AIkkMd057788; Fri, 10 Apr 2009 18:46:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904101846.n3AIkkMd057788@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Apr 2009 18:46: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: r190902 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 18:46:47 -0000 Author: imp Date: Fri Apr 10 18:46:46 2009 New Revision: 190902 URL: http://svn.freebsd.org/changeset/base/190902 Log: Don't specify a hint, since it isn't needed. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 17:34:30 2009 (r190901) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 10 18:46:46 2009 (r190902) @@ -170,14 +170,14 @@ static const struct ed_product { { PCMCIA_CARD(DLINK, DE660PLUS), 0}, { PCMCIA_CARD(DYNALINK, L10C), 0}, { PCMCIA_CARD(EDIMAX, EP4000A), 0}, - { PCMCIA_CARD(EPSON, EEN10B), NE2000DVF_ENADDR, 0xff0}, + { PCMCIA_CARD(EPSON, EEN10B), 0}, { PCMCIA_CARD(EXP, THINLANCOMBO), 0}, { PCMCIA_CARD(GLOBALVILLAGE, LANMODEM), 0}, { PCMCIA_CARD(GREY_CELL, TDK3000), 0}, { PCMCIA_CARD(GREY_CELL, DMF650TX), NE2000DVF_ANYFUNC | NE2000DVF_DL100XX | NE2000DVF_MODEM}, { PCMCIA_CARD(IBM, HOME_AND_AWAY), 0}, - { PCMCIA_CARD(IBM, INFOMOVER), NE2000DVF_ENADDR, 0xff0}, + { PCMCIA_CARD(IBM, INFOMOVER), 0}, { PCMCIA_CARD(IODATA3, PCLAT), 0}, { PCMCIA_CARD(KINGSTON, CIO10T), 0}, { PCMCIA_CARD(KINGSTON, KNE2), 0}, From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 18:53:16 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E093F10656C2; Fri, 10 Apr 2009 18:53:16 +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 9CF0F8FC13; Fri, 10 Apr 2009 18:53:16 +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 n3AIoDpW047760; Fri, 10 Apr 2009 12:50:13 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Apr 2009 12:51:04 -0600 (MDT) Message-Id: <20090410.125104.87768818.imp@bsdimp.com> To: brooks@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090410184337.GA6661@lor.one-eyed-alien.net> References: <20090409153805.GB83847@lor.one-eyed-alien.net> <20090410.123404.-1398308997.imp@bsdimp.com> <20090410184337.GA6661@lor.one-eyed-alien.net> 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, amdmi3@amdmi3.ru, des@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 18:53:17 -0000 In message: <20090410184337.GA6661@lor.one-eyed-alien.net> Brooks Davis writes: : On Fri, Apr 10, 2009 at 12:34:04PM -0600, M. Warner Losh wrote: : > In message: <20090409153805.GB83847@lor.one-eyed-alien.net> : > Brooks Davis writes: : > : Unless you have one of the few interfaces that does not generate : > : link status events, dhclient will be started by devd. The only ones I : > : know of are a subset set of ed(4) devices, though I think imp may have : > : fixed those recently with a stub ifmedia interface. : > : > I think ep(4) is the only "common" case left. For ed(4) we now do the : > right thing for the really old cards (those without a MII) as well as : > the merely old cards (those with a phy). For the really old cards, we : > generally default to "Link is up all the time" as our status, : > specifically to keep dhclient happy. : > : > Of course, the number of users of these cards is quite low these : > days... I've fixed a number of bugs that should have been bad enough : > for people to complain, but since nobody did, I'm guessing the install : > base is smaller than I'd thought... : : Good to know. This will be pretty useful since some emulators seem to : emulate very old ed devices. That's true. Although performance on the ed(4) devices are rather pathetic by today's standards, at least it would work. Good thing most of the emulators don't try to be cycle accurate. Warner From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 19:16:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED815106564A; Fri, 10 Apr 2009 19:16:14 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C271B8FC15; Fri, 10 Apr 2009 19:16:14 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AJGErb058793; Fri, 10 Apr 2009 19:16:14 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AJGEwm058792; Fri, 10 Apr 2009 19:16:14 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200904101916.n3AJGEwm058792@svn.freebsd.org> From: Max Laier Date: Fri, 10 Apr 2009 19:16: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: r190903 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 19:16:15 -0000 Author: mlaier Date: Fri Apr 10 19:16:14 2009 New Revision: 190903 URL: http://svn.freebsd.org/changeset/base/190903 Log: Follow up for r190895 It's not only the "all" group that is affected, but all groups on the given interface. PR: kern/130977, kern/131310 MFC after: 3 days (%vnet) Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Apr 10 18:46:46 2009 (r190902) +++ head/sys/net/if.c Fri Apr 10 19:16:14 2009 (r190903) @@ -141,6 +141,7 @@ static int if_delmulti_locked(struct ifn static void do_link_state_change(void *, int); static int if_getgroup(struct ifgroupreq *, struct ifnet *); static int if_getgroupmembers(struct ifgroupreq *); +static void if_delgroups(struct ifnet *); #ifdef INET6 /* @@ -887,7 +888,7 @@ if_detach(struct ifnet *ifp) rt_ifannouncemsg(ifp, IFAN_DEPARTURE); EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); - if_delgroup(ifp, IFG_ALL); + if_delgroups(ifp); IF_AFDATA_LOCK(ifp); for (dp = domains; dp; dp = dp->dom_next) { @@ -1025,6 +1026,54 @@ if_delgroup(struct ifnet *ifp, const cha } /* + * Remove an interface from all groups + */ +static void +if_delgroups(struct ifnet *ifp) +{ + INIT_VNET_NET(ifp->if_vnet); + struct ifg_list *ifgl; + struct ifg_member *ifgm; + char groupname[IFNAMSIZ]; + + IFNET_WLOCK(); + while (!TAILQ_EMPTY(&ifp->if_groups)) { + ifgl = TAILQ_FIRST(&ifp->if_groups); + + strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ); + + IF_ADDR_LOCK(ifp); + TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next); + IF_ADDR_UNLOCK(ifp); + + TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) + if (ifgm->ifgm_ifp == ifp) + break; + + if (ifgm != NULL) { + TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, + ifgm_next); + free(ifgm, M_TEMP); + } + + if (--ifgl->ifgl_group->ifg_refcnt == 0) { + TAILQ_REMOVE(&V_ifg_head, ifgl->ifgl_group, ifg_next); + EVENTHANDLER_INVOKE(group_detach_event, + ifgl->ifgl_group); + free(ifgl->ifgl_group, M_TEMP); + } + IFNET_WUNLOCK(); + + free(ifgl, M_TEMP); + + EVENTHANDLER_INVOKE(group_change_event, groupname); + + IFNET_WLOCK(); + } + IFNET_WUNLOCK(); +} + +/* * Stores all groups from an interface in memory pointed * to by data */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 21:24:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC5E51065670; Fri, 10 Apr 2009 21:24:18 +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 CA4DE8FC1E; Fri, 10 Apr 2009 21:24:18 +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 n3ALOIL7063023; Fri, 10 Apr 2009 21:24:18 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3ALOIoa063022; Fri, 10 Apr 2009 21:24:18 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <200904102124.n3ALOIoa063022@svn.freebsd.org> From: Kai Wang Date: Fri, 10 Apr 2009 21:24: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: r190904 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 21:24:19 -0000 Author: kaiw Date: Fri Apr 10 21:24:18 2009 New Revision: 190904 URL: http://svn.freebsd.org/changeset/base/190904 Log: Added DT_GNU_HASH entry for GNU-style hash table. Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Apr 10 19:16:14 2009 (r190903) +++ head/sys/sys/elf_common.h Fri Apr 10 21:24:18 2009 (r190904) @@ -427,6 +427,7 @@ typedef struct { * built, these entries will need to be adjusted. */ #define DT_ADDRRNGLO 0x6ffffe00 +#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */ #define DT_CONFIG 0x6ffffefa /* configuration information */ #define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */ #define DT_AUDIT 0x6ffffefc /* object auditing */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 10 22:15:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1E4106564A; Fri, 10 Apr 2009 22:15:01 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58BF18FC08; Fri, 10 Apr 2009 22:15:01 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AMF1Hh064738; Fri, 10 Apr 2009 22:15:01 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AMF198064736; Fri, 10 Apr 2009 22:15:01 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200904102215.n3AMF198064736@svn.freebsd.org> From: Daniel Gerzo Date: Fri, 10 Apr 2009 22:15: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: r190905 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 22:15:02 -0000 Author: danger (doc committer) Date: Fri Apr 10 22:15:01 2009 New Revision: 190905 URL: http://svn.freebsd.org/changeset/base/190905 Log: - fix my previous commit (added missing .gz) Submitted by: brueffer Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Apr 10 21:24:18 2009 (r190904) +++ head/ObsoleteFiles.inc Fri Apr 10 22:15:01 2009 (r190905) @@ -15,7 +15,7 @@ # # 20090410: VOP_LEASE.9 removed -OLD_FILES+=usr/share/man/man9/VOP_LEASE.9 +OLD_FILES+=usr/share/man/man9/VOP_LEASE.9.gz # 20090405: removal of if_ppp(4) and if_sl(4) OLD_FILES+=sbin/slattach rescue/slattach OLD_FILES+=sbin/startslip rescue/startslip From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 02:47:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E82106564A; Sat, 11 Apr 2009 02:47:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1728FC16; Sat, 11 Apr 2009 02:47:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B2l36Y071921; Sat, 11 Apr 2009 02:47:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B2l3Xk071919; Sat, 11 Apr 2009 02:47:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904110247.n3B2l3Xk071919@svn.freebsd.org> From: Warner Losh Date: Sat, 11 Apr 2009 02:47: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: r190907 - head/sys/dev/ep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 02:47:04 -0000 Author: imp Date: Sat Apr 11 02:47:03 2009 New Revision: 190907 URL: http://svn.freebsd.org/changeset/base/190907 Log: o Report ethernet status for at least 10BaseT media. Since I don't have other media to test against, I've left that media reporting unchanged. o Enable the TX_PLL when we enable TX. This is harmless on most cards, but required to get the 3c1 CF card working. Power savings could be had by managing this better, but for now it gets my card working. Modified: head/sys/dev/ep/if_ep.c head/sys/dev/ep/if_epreg.h Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Sat Apr 11 02:39:30 2009 (r190906) +++ head/sys/dev/ep/if_ep.c Sat Apr 11 02:47:03 2009 (r190907) @@ -435,6 +435,7 @@ epinit_locked(struct ep_softc *sc) if (!sc->epb.mii_trans) ep_ifmedia_upd(ifp); + CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE); CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); @@ -895,8 +896,24 @@ static void ep_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { struct ep_softc *sc = ifp->if_softc; + uint16_t ms; - ifmr->ifm_active = sc->ifmedia.ifm_media; + switch (IFM_SUBTYPE(sc->ifmedia.ifm_media)) { + case IFM_10_T: + GO_WINDOW(sc, 4); + ms = CSR_READ_2(sc, EP_W4_MEDIA_TYPE); + GO_WINDOW(sc, 0); + ifmr->ifm_status = IFM_AVALID; + if (ms & MT_LB) { + ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active = IFM_ETHER | IFM_10_T; + } else { + ifmr->ifm_active = IFM_ETHER | IFM_NONE; + } + default: + ifmr->ifm_active = sc->ifmedia.ifm_media; + break; + } } static int Modified: head/sys/dev/ep/if_epreg.h ============================================================================== --- head/sys/dev/ep/if_epreg.h Sat Apr 11 02:39:30 2009 (r190906) +++ head/sys/dev/ep/if_epreg.h Sat Apr 11 02:47:03 2009 (r190907) @@ -156,6 +156,7 @@ * Window 2 registers. Station Address Setup/Read */ /* Read/Write */ +#define EP_W2_PHY_MGMT 0x0c #define EP_W2_ALT_EEPROM 0x0a #define EP_W2_ADDR_5 0x05 #define EP_W2_ADDR_4 0x04 @@ -406,6 +407,17 @@ #define LINKBEAT_ENABLE 0x80 #define ENABLE_UTP (JABBER_GUARD_ENABLE | LINKBEAT_ENABLE) #define DISABLE_UTP 0x0 +#define MT_CSD 0x0004 /* CRC Strip disable */ +#define MT_SQE 0x0008 /* SQE Enable */ +#define MT_C0 0x0010 /* Collison */ +#define MT_CS 0x0020 /* Carrier Sense */ +#define MT_J 0x0200 /* Jabber detected */ +#define MT_PL 0x0400 /* Plarity Inverted */ +#define MT_LB 0x0800 /* Link Beat detected */ +#define MT_SQ 0x1000 /* SQE Present */ +#define MT_IN 0x2000 /* Reserved */ +#define MT_CE 0x4000 /* Coax */ +#define MT_TPE 0x8000 /* * Misc defines for various things. From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 02:58:49 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFBE1065673; Sat, 11 Apr 2009 02:58:49 +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 3D3818FC13; Sat, 11 Apr 2009 02:58:49 +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 n3B2vLVO053404; Fri, 10 Apr 2009 20:57:21 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Apr 2009 20:58:12 -0600 (MDT) Message-Id: <20090410.205812.1723217987.imp@bsdimp.com> To: brooks@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090410.123404.-1398308997.imp@bsdimp.com> References: <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> <20090410.123404.-1398308997.imp@bsdimp.com> 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, amdmi3@amdmi3.ru, des@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 02:58:50 -0000 In message: <20090410.123404.-1398308997.imp@bsdimp.com> "M. Warner Losh" writes: : In message: <20090409153805.GB83847@lor.one-eyed-alien.net> : Brooks Davis writes: : : Unless you have one of the few interfaces that does not generate : : link status events, dhclient will be started by devd. The only ones I : : know of are a subset set of ed(4) devices, though I think imp may have : : fixed those recently with a stub ifmedia interface. : : I think ep(4) is the only "common" case left. For ed(4) we now do the : right thing for the really old cards (those without a MII) as well as : the merely old cards (those with a phy). For the really old cards, we : generally default to "Link is up all the time" as our status, : specifically to keep dhclient happy. : : Of course, the number of users of these cards is quite low these : days... I've fixed a number of bugs that should have been bad enough : for people to complain, but since nobody did, I'm guessing the install : base is smaller than I'd thought... ep(4) now works for UTP aka 10BaseT. At least for the 3c589-based cards (the 3c574-based cards I haven't tested, but should be using the MII that's there to manage this stuff, but aren't: another rainy day project). As a side effect, I dusted off my 3C1 documentation and thought I'd give it one more try to get working, and I found the magic pixie dust to sprinkle in... This makes FreeBSD the only open source OS to support it, although now that the secret is out, I suspect others will follow since it is really rather simple... Warner From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 03:00:37 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E8C61065677; Sat, 11 Apr 2009 03:00:37 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from smtp.timeweb.ru (smtp.timeweb.ru [217.170.79.85]) by mx1.freebsd.org (Postfix) with ESMTP id D852F8FC20; Sat, 11 Apr 2009 03:00:36 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from [213.148.20.85] (helo=hive.panopticon) by smtp.timeweb.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LsTSP-0001N0-Ba; Sat, 11 Apr 2009 07:00:37 +0400 Received: from hades.panopticon (hades.panopticon [192.168.0.32]) by hive.panopticon (Postfix) with ESMTP id 2550BC6B7; Sat, 11 Apr 2009 07:00:52 +0400 (MSD) Received: by hades.panopticon (Postfix, from userid 1000) id E828B10883E; Sat, 11 Apr 2009 07:00:17 +0400 (MSD) Date: Sat, 11 Apr 2009 07:00:17 +0400 From: Dmitry Marakasov To: Brooks Davis Message-ID: <20090411030017.GA1713@hades.panopticon> References: <200903191248.n2JCm0Rd061331@svn.freebsd.org> <20090409131253.GB7795@hades.panopticon> <20090409153805.GB83847@lor.one-eyed-alien.net> <20090409155138.GD7795@hades.panopticon> <20090409161549.GC83847@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20090409161549.GC83847@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dag-Erling Smorgrav Subject: Re: svn commit: r190031 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 03:00:37 -0000 * Brooks Davis (brooks@FreeBSD.org) wrote: > > I use ale(4). Will test some more. Couldn't the fact that the interface > > is renamed be the reason? > > Shouldn't be. I use renamed interfaces a fair bit. The ale(4) driver > uses mii, but so lack of link events shouldn't be an issue unless the > driver is buggy. > > > Also, how is the issue of services not starting because of no default > > route/dns/network available solved when running dhclient from devd? > > The wait in /etc/rc.d/defaultroute. OK, an hour of reboots and I've nailed it. The cause is that by the time defaultroute is executed, there's no link on the interface -> wait for route is skipped (see defaultroute_start). Some lines from dmesg: ale0: port 0xdc00-0xdc7f mem 0xfe9c0000-0xfe9fffff irq 17 at device 0.0 on pci2 ale0: 960 Tx FIFO, 1024 Rx FIFO ale0: Using 1 MSI messages. miibus0: on ale0 atphy0: PHY 0 on miibus0 atphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, auto ale0: Ethernet address: 00:22:15:75:15:b2 ale0: [FILTER] ... (many other devices) ale0: changing name to 'panopticon' panopticon: link state changed to DOWN panopticon: no link .....panopticon: link state changed to UP got link DHCPREQUEST on panopticon to 255.255.255.255 port 67 DHCPREQUEST on panopticon to 255.255.255.255 port 67 DHCPACK from 192.168.0.2 bound to 192.168.0.32 -- renewal in 43200 seconds. Turning off name change won't help - it still linkdowns after detection like that. I think that check for live interface should be removed from defaultroute. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: jabber: amdmi3@jabber.ru http://www.amdmi3.ru From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 04:30:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B75D6106566B; Sat, 11 Apr 2009 04:30:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A60C38FC1A; Sat, 11 Apr 2009 04:30:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B4UcEj074332; Sat, 11 Apr 2009 04:30:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B4UcRO074329; Sat, 11 Apr 2009 04:30:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904110430.n3B4UcRO074329@svn.freebsd.org> From: Warner Losh Date: Sat, 11 Apr 2009 04:30: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: r190908 - head/sys/dev/ep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 04:30:39 -0000 Author: imp Date: Sat Apr 11 04:30:38 2009 New Revision: 190908 URL: http://svn.freebsd.org/changeset/base/190908 Log: Two refinements to the 3c1 support: 1) Flag it and only access that command on the 3c1 2) The TX PLL appears to power down when not in use, so we have to power it back up when we've been idle. Do this at the start of ifstart. Otherwise we fall off the net. Modified: head/sys/dev/ep/if_ep.c head/sys/dev/ep/if_ep_pccard.c head/sys/dev/ep/if_epvar.h Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Sat Apr 11 02:47:03 2009 (r190907) +++ head/sys/dev/ep/if_ep.c Sat Apr 11 04:30:38 2009 (r190908) @@ -435,7 +435,8 @@ epinit_locked(struct ep_softc *sc) if (!sc->epb.mii_trans) ep_ifmedia_upd(ifp); - CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); + if (sc->stat & F_HAS_TX_PLL) + CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE); CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); @@ -474,7 +475,7 @@ epstart_locked(struct ifnet *ifp) struct ep_softc *sc; u_int len; struct mbuf *m, *m0; - int pad; + int pad, started; sc = ifp->if_softc; if (sc->gone) @@ -483,11 +484,15 @@ epstart_locked(struct ifnet *ifp) EP_BUSY_WAIT(sc); if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; + started = 0; startagain: /* Sneak a peek at the next packet */ IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) return; + if (!started && (sc->stat & F_HAS_TX_PLL)) + CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE); + started++; for (len = 0, m = m0; m != NULL; m = m->m_next) len += m->m_len; Modified: head/sys/dev/ep/if_ep_pccard.c ============================================================================== --- head/sys/dev/ep/if_ep_pccard.c Sat Apr 11 02:47:03 2009 (r190907) +++ head/sys/dev/ep/if_ep_pccard.c Sat Apr 11 04:30:38 2009 (r190908) @@ -68,9 +68,10 @@ struct ep_pccard_product #define EP_CHIP_589 1 /* Classic 3c5x9 chipset */ #define EP_CHIP_574 2 /* Roadrunner */ +#define EP_CHIP_C1 3 /* 3c1 */ static const struct ep_pccard_product ep_pccard_products[] = { - { PCMCIA_CARD(3COM, 3C1), EP_CHIP_589 }, + { PCMCIA_CARD(3COM, 3C1), EP_CHIP_C1 }, { PCMCIA_CARD(3COM, 3C562), EP_CHIP_589 }, { PCMCIA_CARD(3COM, 3C589), EP_CHIP_589 }, { PCMCIA_CARD(3COM, 3CXEM556), EP_CHIP_589 }, @@ -144,19 +145,21 @@ ep_pccard_attach(device_t dev) if ((pp = ep_pccard_lookup(dev)) == NULL) panic("ep_pccard_attach: can't find product in attach."); - if (pp->chipset == EP_CHIP_589) { - sc->epb.mii_trans = 0; - sc->epb.cmd_off = 0; - } else { + if (pp->chipset == EP_CHIP_574) { sc->epb.mii_trans = 1; sc->epb.cmd_off = 2; + } else { + sc->epb.mii_trans = 0; + sc->epb.cmd_off = 0; } - if ((error = ep_alloc(dev))) { device_printf(dev, "ep_alloc() failed! (%d)\n", error); goto bad; } + if (pp->chipset == EP_CHIP_C1) + sc->stat |= F_HAS_TX_PLL; + /* ROM size = 0, ROM base = 0 */ /* For now, ignore AUTO SELECT feature of 3C589B and later. */ error = ep_get_e(sc, EEPROM_ADDR_CFG, &result); Modified: head/sys/dev/ep/if_epvar.h ============================================================================== --- head/sys/dev/ep/if_epvar.h Sat Apr 11 02:47:03 2009 (r190907) +++ head/sys/dev/ep/if_epvar.h Sat Apr 11 04:30:38 2009 (r190908) @@ -57,6 +57,7 @@ struct ep_softc { #define F_ENADDR_SKIP 0x002 #define F_PROMISC 0x008 #define F_ACCESS_32_BITS 0x100 +#define F_HAS_TX_PLL 0x200 int gone; /* adapter is not present (for PCCARD) */ struct ep_board epb; From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 05:58:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAD7106564A; Sat, 11 Apr 2009 05:58:59 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B97D88FC0C; Sat, 11 Apr 2009 05:58:59 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B5wxrx076038; Sat, 11 Apr 2009 05:58:59 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B5wwG6076022; Sat, 11 Apr 2009 05:58:58 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200904110558.n3B5wwG6076022@svn.freebsd.org> From: Marko Zec Date: Sat, 11 Apr 2009 05:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190909 - in head/sys: kern net netinet netinet6 netipsec sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 05:59:00 -0000 Author: zec Date: Sat Apr 11 05:58:58 2009 New Revision: 190909 URL: http://svn.freebsd.org/changeset/base/190909 Log: Introduce vnet module registration / initialization framework with dependency tracking and ordering enforcement. With this change, per-vnet initialization functions introduced with r190787 are no longer directly called from traditional initialization functions (which cc in most cases inlined to pre-r190787 code), but are instead registered via the vnet framework first, and are invoked only after all prerequisite modules have been initialized. In the long run, this framework should allow us to both initialize and dismantle multiple vnet instances in a correct order. The problem this change aims to solve is how to replay the initialization sequence of various network stack components, which have been traditionally triggered via different mechanisms (SYSINIT, protosw). Note that this initialization sequence was and still can be subtly different depending on whether certain pieces of code have been statically compiled into the kernel, loaded as modules by boot loader, or kldloaded at run time. The approach is simple - we record the initialization sequence established by the traditional mechanisms whenever vnet_mod_register() is called for a particular vnet module. The vnet_mod_register_multi() variant allows a single initializer function to be registered multiple times but with different arguments - currently this is only used in kern/uipc_domain.c by net_add_domain() with different struct domain * as arguments, which allows for protosw-registered initialization routines to be invoked in a correct order by the new vnet initialization framework. For the purpose of identifying vnet modules, each vnet module has to have a unique ID, which is statically assigned in sys/vimage.h. Dynamic assignment of vnet module IDs is not supported yet. A vnet module may specify a single prerequisite module at registration time by filling in the vmi_dependson field of its vnet_modinfo struct with the ID of the module it depends on. Unless specified otherwise, all vnet modules depend on VNET_MOD_NET (container for ifnet list head, rt_tables etc.), which thus has to and will always be initialized first. The framework will panic if it detects any unresolved dependencies before completing system initialization. Detection of unresolved dependencies for vnet modules registered after boot (kldloaded modules) is not provided. Note that the fact that each module can specify only a single prerequisite may become problematic in the long run. In particular, INET6 depends on INET being already instantiated, due to TCP / UDP structures residing in INET container. IPSEC also depends on INET, which will in turn additionally complicate making INET6-only kernel configs a reality. The entire registration framework can be compiled out by turning on the VIMAGE_GLOBALS kernel config option. Reviewed by: bz Approved by: julian (mentor) Modified: head/sys/kern/kern_vimage.c head/sys/kern/uipc_domain.c head/sys/net/if.c head/sys/net/if_gif.c head/sys/net/if_loop.c head/sys/net/route.c head/sys/netinet/if_ether.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/netipsec/ipsec.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/sys/kernel.h head/sys/sys/vimage.h Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/kern/kern_vimage.c Sat Apr 11 05:58:58 2009 (r190909) @@ -44,19 +44,136 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_VIMAGE, "vimage", "vimage resource container"); static TAILQ_HEAD(vnet_modlink_head, vnet_modlink) vnet_modlink_head; +static TAILQ_HEAD(vnet_modpending_head, vnet_modlink) vnet_modpending_head; +static void vnet_mod_complete_registration(struct vnet_modlink *); +static int vnet_mod_constructor(struct vnet_modlink *); void vnet_mod_register(const struct vnet_modinfo *vmi) { + + vnet_mod_register_multi(vmi, NULL, NULL); +} + +void +vnet_mod_register_multi(const struct vnet_modinfo *vmi, void *iarg, + char *iname) +{ struct vnet_modlink *vml, *vml_iter; - /* Do not register the same module instance more than once. */ + /* Do not register the same {module, iarg} pair more than once. */ TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le) - if (vml_iter->vml_modinfo == vmi) - panic("%s: %s", __func__, vmi->vmi_name); + if (vml_iter->vml_modinfo == vmi && vml_iter->vml_iarg == iarg) + break; + if (vml_iter != NULL) + panic("registering an already registered vnet module: %s", + vml_iter->vml_modinfo->vmi_name); vml = malloc(sizeof(struct vnet_modlink), M_VIMAGE, M_NOWAIT); + + /* + * XXX we support only statically assigned module IDs at the time. + * In principle modules should be able to get a dynamically + * assigned ID at registration time. + * + * If a module is registered in multiple instances, then each + * instance must have both iarg and iname set. + */ + if (vmi->vmi_id >= VNET_MOD_MAX) + panic("invalid vnet module ID: %d", vmi->vmi_id); + if (vmi->vmi_name == NULL) + panic("vnet module with no name: %d", vmi->vmi_id); + if ((iarg == NULL) ^ (iname == NULL)) + panic("invalid vnet module instance: %s", vmi->vmi_name); + vml->vml_modinfo = vmi; + vml->vml_iarg = iarg; + vml->vml_iname = iname; + + /* Check whether the module we depend on is already registered. */ + if (vmi->vmi_dependson != vmi->vmi_id) { + TAILQ_FOREACH(vml_iter, &vnet_modlink_head, vml_mod_le) + if (vml_iter->vml_modinfo->vmi_id == + vmi->vmi_dependson) + break; /* Depencency found, we are done. */ + if (vml_iter == NULL) { +#ifdef DEBUG_ORDERING + printf("dependency %d missing for vnet mod %s," + "postponing registration\n", + vmi->vmi_dependson, vmi->vmi_name); +#endif /* DEBUG_ORDERING */ + TAILQ_INSERT_TAIL(&vnet_modpending_head, vml, + vml_mod_le); + return; + } + } + + vnet_mod_complete_registration(vml); +} + +void +vnet_mod_complete_registration(struct vnet_modlink *vml) +{ + VNET_ITERATOR_DECL(vnet_iter); + struct vnet_modlink *vml_iter; + TAILQ_INSERT_TAIL(&vnet_modlink_head, vml, vml_mod_le); + + VNET_FOREACH(vnet_iter) { + CURVNET_SET_QUIET(vnet_iter); + vnet_mod_constructor(vml); + CURVNET_RESTORE(); + } + + /* Check for pending modules depending on us. */ + do { + TAILQ_FOREACH(vml_iter, &vnet_modpending_head, vml_mod_le) + if (vml_iter->vml_modinfo->vmi_dependson == + vml->vml_modinfo->vmi_id) + break; + if (vml_iter != NULL) { +#ifdef DEBUG_ORDERING + printf("vnet mod %s now registering," + "dependency %d loaded\n", + vml_iter->vml_modinfo->vmi_name, + vml->vml_modinfo->vmi_id); +#endif /* DEBUG_ORDERING */ + TAILQ_REMOVE(&vnet_modpending_head, vml_iter, + vml_mod_le); + vnet_mod_complete_registration(vml_iter); + } + } while (vml_iter != NULL); +} + +static int vnet_mod_constructor(struct vnet_modlink *vml) +{ + const struct vnet_modinfo *vmi = vml->vml_modinfo; + +#ifdef DEBUG_ORDERING + printf("instantiating vnet_%s", vmi->vmi_name); + if (vml->vml_iarg) + printf("/%s", vml->vml_iname); + printf(": "); + if (vmi->vmi_struct_size) + printf("malloc(%zu); ", vmi->vmi_struct_size); + if (vmi->vmi_iattach != NULL) + printf("iattach()"); + printf("\n"); +#endif + +#ifdef VIMAGE + if (vmi->vmi_struct_size) { + void *mem = malloc(vmi->vmi_struct_size, M_VNET, + M_NOWAIT | M_ZERO); + if (mem == NULL) /* XXX should return error, not panic. */ + panic("vi_alloc: malloc for %s\n", vmi->vmi_name); + curvnet->mod_data[vmi->vmi_id] = mem; + } +#endif + + if (vmi->vmi_iattach != NULL) + vmi->vmi_iattach(vml->vml_iarg); + + return (0); } /* @@ -75,7 +192,7 @@ vi_symlookup(struct kld_sym_lookup *look if (vml->vml_modinfo->vmi_symmap == NULL) continue; for (mapentry = vml->vml_modinfo->vmi_symmap; - mapentry->name != NULL; mapentry++) { + mapentry->name != NULL; mapentry++) { if (strcmp(symstr, mapentry->name) == 0) { lookup->symvalue = (u_long) mapentry->base; lookup->symsize = mapentry->size; @@ -91,8 +208,27 @@ vi_init(void *unused) { TAILQ_INIT(&vnet_modlink_head); + TAILQ_INIT(&vnet_modpending_head); +} + +static void +vi_init_done(void *unused) +{ + struct vnet_modlink *vml_iter; + + if (TAILQ_EMPTY(&vnet_modpending_head)) + return; + + printf("vnet modules with unresolved dependencies:\n"); + TAILQ_FOREACH(vml_iter, &vnet_modpending_head, vml_mod_le) + printf(" %d:%s depending on %d\n", + vml_iter->vml_modinfo->vmi_id, + vml_iter->vml_modinfo->vmi_name, + vml_iter->vml_modinfo->vmi_dependson); + panic("going nowhere without my vnet modules!"); } SYSINIT(vimage, SI_SUB_VIMAGE, SI_ORDER_FIRST, vi_init, NULL); +SYSINIT(vimage_done, SI_SUB_VIMAGE_DONE, SI_ORDER_FIRST, vi_init_done, NULL); #endif /* !VIMAGE_GLOBALS */ Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/kern/uipc_domain.c Sat Apr 11 05:58:58 2009 (r190909) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -64,6 +65,8 @@ static void domainfinalize(void *); SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, NULL); +static vnet_attach_fn net_init_domain; + static struct callout pffast_callout; static struct callout pfslow_callout; @@ -100,6 +103,14 @@ struct pr_usrreqs nousrreqs = { .pru_sopoll = pru_sopoll_notsupp, }; +#ifndef VIMAGE_GLOBALS +vnet_modinfo_t vnet_domain_modinfo = { + .vmi_id = VNET_MOD_DOMAIN, + .vmi_name = "domain", + .vmi_iattach = net_init_domain +}; +#endif + static void protosw_init(struct protosw *pr) { @@ -159,9 +170,10 @@ protosw_init(struct protosw *pr) * Note: you cant unload it again because a socket may be using it. * XXX can't fail at this time. */ -static void -net_init_domain(struct domain *dp) +static int +net_init_domain(const void *arg) { + const struct domain *dp = arg; struct protosw *pr; if (dp->dom_init) @@ -175,6 +187,7 @@ net_init_domain(struct domain *dp) max_datalen = MHLEN - max_hdr; if (max_datalen < 1) panic("%s: max_datalen < 1", __func__); + return (0); } /* @@ -210,7 +223,11 @@ net_add_domain(void *data) "domainfinalize()\n", dp->dom_name); #endif mtx_unlock(&dom_mtx); +#ifndef VIMAGE_GLOBALS + vnet_mod_register_multi(&vnet_domain_modinfo, dp, dp->dom_name); +#else net_init_domain(dp); +#endif } static void Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/net/if.c Sat Apr 11 05:58:58 2009 (r190909) @@ -183,9 +183,13 @@ static struct vnet_symmap vnet_net_symma VNET_SYMMAP_END }; -VNET_MOD_DECLARE(NET, net, vnet_net_iattach, vnet_net_idetach, - NONE, vnet_net_symmap) -#endif +static const vnet_modinfo_t vnet_net_modinfo = { + .vmi_id = VNET_MOD_NET, + .vmi_name = "net", + .vmi_symmap = vnet_net_symmap, + .vmi_iattach = vnet_net_iattach +}; +#endif /* !VIMAGE_GLOBALS */ /* * System initialization Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/net/if_gif.c Sat Apr 11 05:58:58 2009 (r190909) @@ -123,6 +123,15 @@ static int gif_clone_create(struct if_cl static void gif_clone_destroy(struct ifnet *); static int vnet_gif_iattach(const void *); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_gif_modinfo = { + .vmi_id = VNET_MOD_GIF, + .vmi_name = "gif", + .vmi_dependson = VNET_MOD_NET, + .vmi_iattach = vnet_gif_iattach +}; +#endif + IFC_SIMPLE_DECLARE(gif, 0); static int gifmodevent(module_t, int, void *); @@ -282,7 +291,11 @@ gifmodevent(mod, type, data) case MOD_LOAD: mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_gif_modinfo); +#else vnet_gif_iattach(NULL); +#endif if_clone_attach(&gif_cloner); break; Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/net/if_loop.c Sat Apr 11 05:58:58 2009 (r190909) @@ -111,6 +111,14 @@ static int vnet_loif_iattach(const void struct ifnet *loif; /* Used externally */ #endif +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_loif_modinfo = { + .vmi_id = VNET_MOD_LOIF, + .vmi_name = "loif", + .vmi_iattach = vnet_loif_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + IFC_SIMPLE_DECLARE(lo, 1); static void @@ -170,7 +178,11 @@ loop_modevent(module_t mod, int type, vo switch (type) { case MOD_LOAD: +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_loif_modinfo); +#else vnet_loif_iattach(NULL); +#endif break; case MOD_UNLOAD: Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/net/route.c Sat Apr 11 05:58:58 2009 (r190909) @@ -108,6 +108,14 @@ static void rt_maskedcopy(struct sockadd struct sockaddr *, struct sockaddr *); static int vnet_route_iattach(const void *); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_rtable_modinfo = { + .vmi_id = VNET_MOD_RTABLE, + .vmi_name = "rtable", + .vmi_iattach = vnet_route_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + /* compare two sockaddr structures */ #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) @@ -161,7 +169,11 @@ route_init(void) rt_numfibs = 1; rn_init(); /* initialize all zeroes, all ones, mask table */ +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_rtable_modinfo); +#else vnet_route_iattach(NULL); +#endif } static int vnet_route_iattach(const void *unused __unused) Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netinet/if_ether.c Sat Apr 11 05:58:58 2009 (r190909) @@ -120,6 +120,15 @@ static void arptimer(void *); static void in_arpinput(struct mbuf *); #endif +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_arp_modinfo = { + .vmi_id = VNET_MOD_ARP, + .vmi_name = "arp", + .vmi_dependson = VNET_MOD_INET, + .vmi_iattach = arp_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + #ifdef AF_INET void arp_ifscrub(struct ifnet *ifp, uint32_t addr); @@ -808,7 +817,11 @@ static void arp_init(void) { +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_arp_modinfo); +#else arp_iattach(NULL); +#endif arpintrq.ifq_maxlen = 50; mtx_init(&arpintrq.ifq_mtx, "arp_inq", NULL, MTX_DEF); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netinet/ip_input.c Sat Apr 11 05:58:58 2009 (r190909) @@ -224,6 +224,23 @@ int fw_one_pass; static void ip_freef(struct ipqhead *, struct ipq *); +#ifndef VIMAGE_GLOBALS +static void vnet_inet_register(void); + +static const vnet_modinfo_t vnet_inet_modinfo = { + .vmi_id = VNET_MOD_INET, + .vmi_name = "inet", +}; + +static void vnet_inet_register() +{ + + vnet_mod_register(&vnet_inet_modinfo); +} + +SYSINIT(inet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet_register, 0); +#endif + /* * IP initialization: fill in IP protocol switch table. * All protocols not implemented in kernel go to raw IP protocol handler. Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netinet6/ip6_input.c Sat Apr 11 05:58:58 2009 (r190909) @@ -155,6 +155,25 @@ static int ip6_hopopts_input(u_int32_t * static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); #endif +#ifndef VIMAGE_GLOBALS +static void vnet_inet6_register(void); + +static const vnet_modinfo_t vnet_inet6_modinfo = { + .vmi_id = VNET_MOD_INET6, + .vmi_name = "inet6", + .vmi_dependson = VNET_MOD_INET /* XXX revisit - TCP/UDP needs this? */ +}; + +static void +vnet_inet6_register(void) +{ + + vnet_mod_register(&vnet_inet6_modinfo); +} + +SYSINIT(inet6, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet6_register, 0); +#endif + /* * IP6 initialization: fill in IP6 protocol switch table. * All protocols not implemented in kernel go to raw IP6 protocol handler. Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netipsec/ipsec.c Sat Apr 11 05:58:58 2009 (r190909) @@ -244,6 +244,15 @@ static void vshiftl __P((unsigned char * MALLOC_DEFINE(M_IPSEC_INPCB, "inpcbpolicy", "inpcb-resident ipsec policy"); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_ipsec_modinfo = { + .vmi_id = VNET_MOD_IPSEC, + .vmi_name = "ipsec", + .vmi_dependson = VNET_MOD_INET, /* XXX revisit - INET6 ? */ + .vmi_iattach = ipsec_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + void ipsec_init(void) { @@ -1760,7 +1769,12 @@ static void ipsec_attach(void) { +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_ipsec_modinfo); +#else ipsec_iattach(NULL); +#endif + } static int Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netipsec/xform_ah.c Sat Apr 11 05:58:58 2009 (r190909) @@ -75,6 +75,15 @@ static int ah_iattach(const void *); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_ah_modinfo = { + .vmi_id = VNET_MOD_AH, + .vmi_name = "ipsec_ah", + .vmi_dependson = VNET_MOD_IPSEC, + .vmi_iattach = ah_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + /* * Return header size in bytes. The old protocol did not support * the replay counter; the new protocol always includes the counter. @@ -1223,7 +1232,11 @@ ah_attach(void) { xform_register(&ah_xformsw); +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_ah_modinfo); +#else ah_iattach(NULL); +#endif } static int Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netipsec/xform_esp.c Sat Apr 11 05:58:58 2009 (r190909) @@ -92,6 +92,15 @@ static int esp_input_cb(struct cryptop * static int esp_output_cb(struct cryptop *crp); static int esp_iattach(const void *); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_esp_modinfo = { + .vmi_id = VNET_MOD_ESP, + .vmi_name = "ipsec_esp", + .vmi_dependson = VNET_MOD_IPSEC, + .vmi_iattach = esp_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + /* * NB: this is public for use by the PF_KEY support. * NB: if you add support here; be sure to add code to esp_attach below! @@ -993,7 +1002,11 @@ esp_attach(void) { xform_register(&esp_xformsw); +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_esp_modinfo); +#else esp_iattach(NULL); +#endif } static int Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netipsec/xform_ipcomp.c Sat Apr 11 05:58:58 2009 (r190909) @@ -82,6 +82,15 @@ static int ipcomp_input_cb(struct crypto static int ipcomp_output_cb(struct cryptop *crp); static int ipcomp_iattach(const void *); +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_ipcomp_modinfo = { + .vmi_id = VNET_MOD_IPCOMP, + .vmi_name = "ipsec_ipcomp", + .vmi_dependson = VNET_MOD_IPSEC, + .vmi_iattach = ipcomp_iattach +}; +#endif /* !VIMAGE_GLOBALS */ + struct comp_algo * ipcomp_algorithm_lookup(int alg) { @@ -602,7 +611,11 @@ ipcomp_attach(void) { xform_register(&ipcomp_xformsw); +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_ipcomp_modinfo); +#else ipcomp_iattach(NULL); +#endif } static int Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/netipsec/xform_ipip.c Sat Apr 11 05:58:58 2009 (r190909) @@ -108,6 +108,16 @@ SYSCTL_V_STRUCT(V_NET, vnet_ipsec, _net_ #define M_IPSEC (M_AUTHIPHDR|M_AUTHIPDGM|M_DECRYPTED) static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp); +static int ipe4_iattach(const void *); + +#ifndef VIMAGE_GLOBALS +static const vnet_modinfo_t vnet_ipip_modinfo = { + .vmi_id = VNET_MOD_IPIP, + .vmi_name = "ipsec_ipip", + .vmi_dependson = VNET_MOD_IPSEC, + .vmi_iattach = ipe4_iattach +}; +#endif /* !VIMAGE_GLOBALS */ #ifdef INET6 /* @@ -719,7 +729,11 @@ ipe4_attach(void) (void) encap_attach_func(AF_INET6, -1, ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL); #endif +#ifndef VIMAGE_GLOBALS + vnet_mod_register(&vnet_ipip_modinfo); +#else ipe4_iattach(NULL); +#endif } SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL); #endif /* IPSEC */ Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/sys/kernel.h Sat Apr 11 05:58:58 2009 (r190909) @@ -163,6 +163,7 @@ enum sysinit_sub_id { SI_SUB_SWAP = 0xc000000, /* swap */ SI_SUB_INTRINSIC_POST = 0xd000000, /* proc 0 cleanup*/ SI_SUB_SYSCALLS = 0xd800000, /* register system calls */ + SI_SUB_VIMAGE_DONE = 0xdc00000, /* vnet registration complete */ SI_SUB_KTHREAD_INIT = 0xe000000, /* init process*/ SI_SUB_KTHREAD_PAGE = 0xe400000, /* pageout daemon*/ SI_SUB_KTHREAD_VM = 0xe800000, /* vm daemon*/ Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Sat Apr 11 04:30:38 2009 (r190908) +++ head/sys/sys/vimage.h Sat Apr 11 05:58:58 2009 (r190909) @@ -35,6 +35,15 @@ #include +#if defined(VIMAGE) && defined(VIMAGE_GLOBALS) +#error "You cannot have both option VIMAGE and option VIMAGE_GLOBALS!" +#endif + +typedef int vnet_attach_fn(const void *); +typedef int vnet_detach_fn(const void *); + +#ifndef VIMAGE_GLOBALS + struct kld_sym_lookup; struct vnet_symmap { @@ -42,27 +51,78 @@ struct vnet_symmap { void *base; size_t size; }; +typedef struct vnet_symmap vnet_symmap_t; struct vnet_modinfo { + u_int vmi_id; + u_int vmi_dependson; char *vmi_name; + vnet_attach_fn *vmi_iattach; + vnet_detach_fn *vmi_idetach; + size_t vmi_struct_size; struct vnet_symmap *vmi_symmap; }; +typedef struct vnet_modinfo vnet_modinfo_t; struct vnet_modlink { - TAILQ_ENTRY(vnet_modlink) vml_mod_le; + TAILQ_ENTRY(vnet_modlink) vml_mod_le; const struct vnet_modinfo *vml_modinfo; + const void *vml_iarg; + const char *vml_iname; }; -#define VNET_MOD_DECLARE(m_name_uc, m_name_lc, m_iattach, m_idetach, \ - m_dependson, m_symmap) \ - static const struct vnet_modinfo vnet_##m_name_lc##_modinfo = { \ - .vmi_name = #m_name_lc, \ - .vmi_symmap = m_symmap \ -}; +#define VNET_SYMMAP(mod, name) \ + { #name, &(vnet_ ## mod ## _0._ ## name), \ + sizeof(vnet_ ## mod ## _0._ ## name) } -#if defined(VIMAGE) && defined(VIMAGE_GLOBALS) -#error "You cannot have both option VIMAGE and option VIMAGE_GLOBALS!" -#endif +#define VNET_SYMMAP_END { NULL, 0 } + +/* stateful modules */ +#define VNET_MOD_NET 0 /* MUST be 0 - implicit dependency */ +#define VNET_MOD_NETGRAPH 1 +#define VNET_MOD_INET 2 +#define VNET_MOD_INET6 3 +#define VNET_MOD_IPSEC 4 +#define VNET_MOD_IPFW 5 +#define VNET_MOD_DUMMYNET 6 +#define VNET_MOD_PF 7 +#define VNET_MOD_ALTQ 8 +#define VNET_MOD_IPX 9 +#define VNET_MOD_ATALK 10 +#define VNET_MOD_ACCF_HTTP 11 +#define VNET_MOD_IGMP 12 + +/* stateless modules */ +#define VNET_MOD_NG_ETHER 20 +#define VNET_MOD_NG_IFACE 21 +#define VNET_MOD_NG_EIFACE 22 +#define VNET_MOD_ESP 23 +#define VNET_MOD_IPIP 24 +#define VNET_MOD_AH 25 +#define VNET_MOD_IPCOMP 26 +#define VNET_MOD_GIF 27 +#define VNET_MOD_ARP 28 +#define VNET_MOD_RTABLE 29 +#define VNET_MOD_LOIF 30 +#define VNET_MOD_DOMAIN 31 +#define VNET_MOD_DYNAMIC_START 32 +#define VNET_MOD_MAX 64 + +/* Sysctl virtualization macros need these name mappings bellow */ +#define V_MOD_vnet_net VNET_MOD_NET +#define V_MOD_vnet_netgraph VNET_MOD_NETGRAPH +#define V_MOD_vnet_inet VNET_MOD_INET +#define V_MOD_vnet_inet6 VNET_MOD_INET6 +#define V_MOD_vnet_ipfw VNET_MOD_IPFW +#define V_MOD_vnet_pf VNET_MOD_PF +#define V_MOD_vnet_gif VNET_MOD_GIF +#define V_MOD_vnet_ipsec VNET_MOD_IPSEC + +int vi_symlookup(struct kld_sym_lookup *, char *); +void vnet_mod_register(const struct vnet_modinfo *); +void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *); + +#endif /* !VIMAGE_GLOBALS */ #ifdef VIMAGE_GLOBALS #define VSYM(base, sym) (sym) @@ -74,12 +134,6 @@ struct vnet_modlink { #endif #endif -#define VNET_SYMMAP(mod, name) \ - { #name, &(vnet_ ## mod ## _0._ ## name), \ - sizeof(vnet_ ## mod ## _0._ ## name) } - -#define VNET_SYMMAP_END { NULL, 0 } - /* Non-VIMAGE null-macros */ #define IS_DEFAULT_VNET(arg) 1 #define CURVNET_SET(arg) @@ -110,9 +164,6 @@ struct vnet_modlink { #define G_hostname VPROCG(hostname) /* global hostname */ #define V_domainname VPROCG(domainname) -int vi_symlookup(struct kld_sym_lookup *, char *); -void vnet_mod_register(const struct vnet_modinfo *); - /* * Size-guards for the vimage structures. * If you need to update the values you MUST increment __FreeBSD_version. From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 08:49:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E7BC106566C; Sat, 11 Apr 2009 08:49:16 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234B58FC13; Sat, 11 Apr 2009 08:49:16 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B8nFxM079233; Sat, 11 Apr 2009 08:49:15 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B8nFp5079232; Sat, 11 Apr 2009 08:49:15 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904110849.n3B8nFp5079232@svn.freebsd.org> From: Tom Rhodes Date: Sat, 11 Apr 2009 08: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: r190910 - head/sbin/gvinum X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 08:49:16 -0000 Author: trhodes Date: Sat Apr 11 08:49:15 2009 New Revision: 190910 URL: http://svn.freebsd.org/changeset/base/190910 Log: Bump doc date for previous changes. Modified: head/sbin/gvinum/gvinum.8 Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Sat Apr 11 05:58:58 2009 (r190909) +++ head/sbin/gvinum/gvinum.8 Sat Apr 11 08:49:15 2009 (r190910) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2006 +.Dd April 10, 2009 .Dt GVINUM 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 08:52:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406131065675; Sat, 11 Apr 2009 08:52:03 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9B98FC25; Sat, 11 Apr 2009 08:52:03 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B8q3Mr079389; Sat, 11 Apr 2009 08:52:03 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B8q3gs079388; Sat, 11 Apr 2009 08:52:03 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904110852.n3B8q3gs079388@svn.freebsd.org> From: Tom Rhodes Date: Sat, 11 Apr 2009 08:52: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: r190911 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 08:52:04 -0000 Author: trhodes Date: Sat Apr 11 08:52:02 2009 New Revision: 190911 URL: http://svn.freebsd.org/changeset/base/190911 Log: Kill hard sentence break added in the previous revision. Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sat Apr 11 08:49:15 2009 (r190910) +++ head/sbin/ipfw/ipfw.8 Sat Apr 11 08:52:02 2009 (r190911) @@ -1998,7 +1998,10 @@ with either delay or probability first, to the chosen format. The unit for delay is milliseconds. Data points do not need to be ordered or equal to the number -specified in the "samples" line. ipfw will sort and interpolate +specified in the "samples" line. +The +.Nm +utility will sort and interpolate the curve as needed. .El .Pp From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 09:09:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F318106566C; Sat, 11 Apr 2009 09:09:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340618FC17; Sat, 11 Apr 2009 09:09:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B991qu079763; Sat, 11 Apr 2009 09:09:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3B991N8079762; Sat, 11 Apr 2009 09:09:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200904110909.n3B991N8079762@svn.freebsd.org> From: Alan Cox Date: Sat, 11 Apr 2009 09: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: r190912 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 09:09:02 -0000 Author: alc Date: Sat Apr 11 09:09:00 2009 New Revision: 190912 URL: http://svn.freebsd.org/changeset/base/190912 Log: Previously, when vm_page_free_toq() was performed on a page belonging to a reservation, unless all of the reservation's pages were free, the reservation was moved to the head of the partially-populated reservations queue, where it would be the next reservation to be broken in case the free page queues were emptied. Now, instead, I am moving it to the tail. Very likely this reservation is in the process of being freed in its entirety, so placing it at the tail of the queue makes it more likely that the underlying physical memory will be returned to the free page queues as one contiguous chunk. If a reservation must be broken, it will, instead, be the longest unchanged reservation, which is arguably the reservation that is least likely to ever achieve promotion or be freed in its entirety. MFC after: 6 weeks Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Apr 11 08:52:02 2009 (r190911) +++ head/sys/vm/vm_reserv.c Sat Apr 11 09:09:00 2009 (r190912) @@ -138,8 +138,8 @@ static vm_reserv_t vm_reserv_array; * The partially-populated reservation queue * * This queue enables the fast recovery of an unused cached or free small page - * from a partially-populated reservation. The head of this queue is either - * the least-recently-populated or most-recently-depopulated reservation. + * from a partially-populated reservation. The reservation at the head of + * this queue is the least-recently-changed, partially-populated reservation. * * Access to this queue is synchronized by the free page queue lock. */ @@ -209,7 +209,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER /* * Reduces the given reservation's population count. If the population count * becomes zero, the reservation is destroyed. Additionally, moves the - * reservation to the head of the partially-populated reservations queue if the + * reservation to the tail of the partially-populated reservations queue if the * population count is non-zero. * * The free page queue lock must be held. @@ -235,7 +235,7 @@ vm_reserv_depopulate(vm_reserv_t rv) vm_reserv_freed++; } else { rv->inpartpopq = TRUE; - TAILQ_INSERT_HEAD(&vm_rvq_partpop, rv, partpopq); + TAILQ_INSERT_TAIL(&vm_rvq_partpop, rv, partpopq); } } From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 10:08:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C4B01065672; Sat, 11 Apr 2009 10:08:27 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B20D8FC29; Sat, 11 Apr 2009 10:08:27 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BA8Qsp081076; Sat, 11 Apr 2009 10:08:26 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BA8Qu6081075; Sat, 11 Apr 2009 10:08:26 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904111008.n3BA8Qu6081075@svn.freebsd.org> From: Randall Stewart Date: Sat, 11 Apr 2009 10:08: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: r190913 - head/sbin/route X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 10:08:27 -0000 Author: rrs Date: Sat Apr 11 10:08:26 2009 New Revision: 190913 URL: http://svn.freebsd.org/changeset/base/190913 Log: Fix broken case where caused by last patch where a user uses 0.0.0.0/0 as an alias for default. Obtained from: Mykola Dzham (freebsd@levsha.org.ua) Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sat Apr 11 09:09:00 2009 (r190912) +++ head/sbin/route/route.c Sat Apr 11 10:08:26 2009 (r190913) @@ -818,7 +818,8 @@ inet_makenetandmask(net, sin, bits) /* i holds the first non zero bit */ bits = 32 - (i*8); } - mask = 0xffffffff << (32 - bits); + if (bits != 0) + mask = 0xffffffff << (32 - bits); sin->sin_addr.s_addr = htonl(addr); sin = &so_mask.sin; From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 10:10:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE021065672; Sat, 11 Apr 2009 10:10:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6F98FC22; Sat, 11 Apr 2009 10:10:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BAAj4R081157; Sat, 11 Apr 2009 10:10:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BAAjAT081156; Sat, 11 Apr 2009 10:10:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904111010.n3BAAjAT081156@svn.freebsd.org> From: Robert Watson Date: Sat, 11 Apr 2009 10:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190914 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 10:10:46 -0000 Author: rwatson Date: Sat Apr 11 10:10:45 2009 New Revision: 190914 URL: http://svn.freebsd.org/changeset/base/190914 Log: Bump __FreeBSD_version to 800077 for the removal of VOP_LEASE -- this changes the size of the vop_vector array and therefore requires file system modules to be rebuilt. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Apr 11 10:08:26 2009 (r190913) +++ head/sys/sys/param.h Sat Apr 11 10:10:45 2009 (r190914) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800076 /* Master, propagated to newvers */ +#define __FreeBSD_version 800077 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 10:37:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C71631065672; Sat, 11 Apr 2009 10:37:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AF278FC0C; Sat, 11 Apr 2009 10:37:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BAb4Ex083901; Sat, 11 Apr 2009 10:37:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BAb4Nf083900; Sat, 11 Apr 2009 10:37:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200904111037.n3BAb4Nf083900@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 11 Apr 2009 10:37: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: r190915 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 10:37:05 -0000 Author: trasz Date: Sat Apr 11 10:37:04 2009 New Revision: 190915 URL: http://svn.freebsd.org/changeset/base/190915 Log: Remove 'IMPLEMENTATION NOTES' section from acl(9); it was just a copy/paste from and it would get out-of-date pretty soon. Modified: head/share/man/man9/acl.9 Modified: head/share/man/man9/acl.9 ============================================================================== --- head/share/man/man9/acl.9 Sat Apr 11 10:10:45 2009 (r190914) +++ head/share/man/man9/acl.9 Sat Apr 11 10:37:04 2009 (r190915) @@ -135,66 +135,6 @@ The process has no read, write or execut to the associated file. .El .El -.Sh IMPLEMENTATION NOTES -.Bd -literal -typedef mode_t *acl_permset_t; - -/* internal ACL structure */ -struct acl { - int acl_cnt; - struct acl_entry acl_entry[ACL_MAX_ENTRIES]; -}; - -/* external ACL structure */ -struct acl_t_struct { - struct acl ats_acl; - int ats_cur_entry; -}; -typedef struct acl_t_struct *acl_t; - -/* - * Possible valid values for ae_tag field. - */ -#define ACL_UNDEFINED_TAG 0x00000000 -#define ACL_USER_OBJ 0x00000001 -#define ACL_USER 0x00000002 -#define ACL_GROUP_OBJ 0x00000004 -#define ACL_GROUP 0x00000008 -#define ACL_MASK 0x00000010 -#define ACL_OTHER 0x00000020 -#define ACL_OTHER_OBJ ACL_OTHER - -/* - * Possible valid values for acl_type_t arguments. - */ -#define ACL_TYPE_ACCESS 0x00000000 -#define ACL_TYPE_DEFAULT 0x00000001 -#define ACL_TYPE_AFS 0x00000002 -#define ACL_TYPE_CODA 0x00000003 -#define ACL_TYPE_NTFS 0x00000004 -#define ACL_TYPE_NWFS 0x00000005 - -/* - * Possible flags in ae_perm field. - */ -#define ACL_EXECUTE 0x0001 -#define ACL_WRITE 0x0002 -#define ACL_READ 0x0004 -#define ACL_PERM_NONE 0x0000 -#define ACL_PERM_BITS (ACL_EXECUTE | ACL_WRITE | ACL_READ) -#define ACL_POSIX1E_BITS (ACL_EXECUTE | ACL_WRITE | ACL_READ) - -/* - * Possible entry_id values for acl_get_entry() - */ -#define ACL_FIRST_ENTRY 0 -#define ACL_NEXT_ENTRY 1 - -/* - * Undefined value in ae_id field - */ -#define ACL_UNDEFINED_ID ((uid_t)-1) -.Ed .Sh SEE ALSO .Xr acl 3 , .Xr vaccess_acl_posix1e 9 , From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:01:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D83F11065672; Sat, 11 Apr 2009 14:01:01 +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 C4AE98FC1E; Sat, 11 Apr 2009 14:01:01 +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 n3BE11S5088013; Sat, 11 Apr 2009 14:01:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BE1108088009; Sat, 11 Apr 2009 14:01:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111401.n3BE1108088009@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:01: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: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:01:02 -0000 Author: ed Date: Sat Apr 11 14:01:01 2009 New Revision: 190919 URL: http://svn.freebsd.org/changeset/base/190919 Log: Simplify in/out functions (for i386 and AMD64). Remove a hack to generate more efficient code for port numbers below 0x100, which has been obsolete for at least ten years, because GCC has an asm constraint to specify that. Submitted by: Christoph Mallon Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/cpufunc.h head/sys/i386/i386/machdep.c head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Apr 11 13:15:38 2009 (r190918) +++ head/sys/amd64/amd64/machdep.c Sat Apr 11 14:01:01 2009 (r190919) @@ -2178,45 +2178,24 @@ user_dbreg_trap(void) #ifdef KDB /* - * Provide inb() and outb() as functions. They are normally only - * available as macros calling inlined functions, thus cannot be - * called from the debugger. - * - * The actual code is stolen from , and de-inlined. + * Provide inb() and outb() as functions. They are normally only available as + * inline functions, thus cannot be called from the debugger. */ -#undef inb -#undef outb - /* silence compiler warnings */ -u_char inb(u_int); -void outb(u_int, u_char); +u_char inb_(u_short); +void outb_(u_short, u_char); u_char -inb(u_int port) +inb_(u_short port) { - u_char data; - /* - * We use %%dx and not %1 here because i/o is done at %dx and not at - * %edx, while gcc generates inferior code (movw instead of movl) - * if we tell it to load (u_short) port. - */ - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - return (data); + return inb(port); } void -outb(u_int port, u_char data) +outb_(u_short port, u_char data) { - u_char al; - /* - * Use an unnecessary assignment to help gcc's register allocator. - * This make a large difference for gcc-1.40 and a tiny difference - * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for - * best results. gcc-2.6.0 can't handle this. - */ - al = data; - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); + outb(port, data); } #endif /* KDB */ Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Sat Apr 11 13:15:38 2009 (r190918) +++ head/sys/amd64/include/cpufunc.h Sat Apr 11 14:01:01 2009 (r190919) @@ -164,70 +164,12 @@ halt(void) __asm __volatile("hlt"); } -#if !defined(__GNUCLIKE_BUILTIN_CONSTANT_P) || __GNUCLIKE_ASM < 3 - -#define inb(port) inbv(port) -#define outb(port, data) outbv(port, data) - -#else /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3 */ - -/* - * The following complications are to get around gcc not having a - * constraint letter for the range 0..255. We still put "d" in the - * constraint because "i" isn't a valid constraint when the port - * isn't constant. This only matters for -O0 because otherwise - * the non-working version gets optimized away. - * - * Use an expression-statement instead of a conditional expression - * because gcc-2.6.0 would promote the operands of the conditional - * and produce poor code for "if ((inb(var) & const1) == const2)". - * - * The unnecessary test `(port) < 0x10000' is to generate a warning if - * the `port' has type u_short or smaller. Such types are pessimal. - * This actually only works for signed types. The range check is - * careful to avoid generating warnings. - */ -#define inb(port) __extension__ ({ \ - u_char _data; \ - if (__builtin_constant_p(port) && ((port) & 0xffff) < 0x100 \ - && (port) < 0x10000) \ - _data = inbc(port); \ - else \ - _data = inbv(port); \ - _data; }) - -#define outb(port, data) ( \ - __builtin_constant_p(port) && ((port) & 0xffff) < 0x100 \ - && (port) < 0x10000 \ - ? outbc(port, data) : outbv(port, data)) - static __inline u_char -inbc(u_int port) +inb(u_int port) { u_char data; - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - return (data); -} - -static __inline void -outbc(u_int port, u_char data) -{ - __asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port))); -} - -#endif /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3*/ - -static __inline u_char -inbv(u_int port) -{ - u_char data; - /* - * We use %%dx and not %1 here because i/o is done at %dx and not at - * %edx, while gcc generates inferior code (movw instead of movl) - * if we tell it to load (u_short) port. - */ - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inb %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } @@ -236,7 +178,7 @@ inl(u_int port) { u_int data; - __asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inl %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } @@ -278,33 +220,20 @@ inw(u_int port) { u_short data; - __asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inw %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } static __inline void -outbv(u_int port, u_char data) +outb(u_int port, u_char data) { - u_char al; - /* - * Use an unnecessary assignment to help gcc's register allocator. - * This make a large difference for gcc-1.40 and a tiny difference - * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for - * best results. gcc-2.6.0 can't handle this. - */ - al = data; - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); + __asm volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void outl(u_int port, u_int data) { - /* - * outl() and outw() aren't used much so we haven't looked at - * possible micro-optimizations such as the unnecessary - * assignment for them. - */ - __asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port)); + __asm volatile("outl %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void @@ -334,7 +263,7 @@ outsl(u_int port, const void *addr, size static __inline void outw(u_int port, u_short data) { - __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); + __asm volatile("outw %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Apr 11 13:15:38 2009 (r190918) +++ head/sys/i386/i386/machdep.c Sat Apr 11 14:01:01 2009 (r190919) @@ -3555,45 +3555,24 @@ lapic_set_lvt_triggermode(u_int apic_id, #ifdef KDB /* - * Provide inb() and outb() as functions. They are normally only - * available as macros calling inlined functions, thus cannot be - * called from the debugger. - * - * The actual code is stolen from , and de-inlined. + * Provide inb() and outb() as functions. They are normally only available as + * inline functions, thus cannot be called from the debugger. */ -#undef inb -#undef outb - /* silence compiler warnings */ -u_char inb(u_int); -void outb(u_int, u_char); +u_char inb_(u_short); +void outb_(u_short, u_char); u_char -inb(u_int port) +inb_(u_short port) { - u_char data; - /* - * We use %%dx and not %1 here because i/o is done at %dx and not at - * %edx, while gcc generates inferior code (movw instead of movl) - * if we tell it to load (u_short) port. - */ - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - return (data); + return inb(port); } void -outb(u_int port, u_char data) +outb_(u_short port, u_char data) { - u_char al; - /* - * Use an unnecessary assignment to help gcc's register allocator. - * This make a large difference for gcc-1.40 and a tiny difference - * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for - * best results. gcc-2.6.0 can't handle this. - */ - al = data; - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); + outb(port, data); } #endif /* KDB */ Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Sat Apr 11 13:15:38 2009 (r190918) +++ head/sys/i386/include/cpufunc.h Sat Apr 11 14:01:01 2009 (r190919) @@ -170,70 +170,12 @@ halt(void) __asm __volatile("hlt"); } -#if !defined(__GNUCLIKE_BUILTIN_CONSTANT_P) || __GNUCLIKE_ASM < 3 - -#define inb(port) inbv(port) -#define outb(port, data) outbv(port, data) - -#else /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3 */ - -/* - * The following complications are to get around gcc not having a - * constraint letter for the range 0..255. We still put "d" in the - * constraint because "i" isn't a valid constraint when the port - * isn't constant. This only matters for -O0 because otherwise - * the non-working version gets optimized away. - * - * Use an expression-statement instead of a conditional expression - * because gcc-2.6.0 would promote the operands of the conditional - * and produce poor code for "if ((inb(var) & const1) == const2)". - * - * The unnecessary test `(port) < 0x10000' is to generate a warning if - * the `port' has type u_short or smaller. Such types are pessimal. - * This actually only works for signed types. The range check is - * careful to avoid generating warnings. - */ -#define inb(port) __extension__ ({ \ - u_char _data; \ - if (__builtin_constant_p(port) && ((port) & 0xffff) < 0x100 \ - && (port) < 0x10000) \ - _data = inbc(port); \ - else \ - _data = inbv(port); \ - _data; }) - -#define outb(port, data) ( \ - __builtin_constant_p(port) && ((port) & 0xffff) < 0x100 \ - && (port) < 0x10000 \ - ? outbc(port, data) : outbv(port, data)) - static __inline u_char -inbc(u_int port) +inb(u_int port) { u_char data; - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - return (data); -} - -static __inline void -outbc(u_int port, u_char data) -{ - __asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port))); -} - -#endif /* __GNUCLIKE_BUILTIN_CONSTANT_P && __GNUCLIKE_ASM >= 3*/ - -static __inline u_char -inbv(u_int port) -{ - u_char data; - /* - * We use %%dx and not %1 here because i/o is done at %dx and not at - * %edx, while gcc generates inferior code (movw instead of movl) - * if we tell it to load (u_short) port. - */ - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inb %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } @@ -242,7 +184,7 @@ inl(u_int port) { u_int data; - __asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inl %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } @@ -284,33 +226,20 @@ inw(u_int port) { u_short data; - __asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port)); + __asm volatile("inw %w1, %0" : "=a" (data) : "Nd" (port)); return (data); } static __inline void -outbv(u_int port, u_char data) +outb(u_int port, u_char data) { - u_char al; - /* - * Use an unnecessary assignment to help gcc's register allocator. - * This make a large difference for gcc-1.40 and a tiny difference - * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for - * best results. gcc-2.6.0 can't handle this. - */ - al = data; - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); + __asm __volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void outl(u_int port, u_int data) { - /* - * outl() and outw() aren't used much so we haven't looked at - * possible micro-optimizations such as the unnecessary - * assignment for them. - */ - __asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port)); + __asm volatile("outl %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void @@ -340,7 +269,7 @@ outsl(u_int port, const void *addr, size static __inline void outw(u_int port, u_short data) { - __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); + __asm volatile("outw %0, %w1" : : "a" (data), "Nd" (port)); } static __inline void From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:15:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F0E1065670; Sat, 11 Apr 2009 14:15:57 +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 003928FC27; Sat, 11 Apr 2009 14:15:57 +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 n3BEFuEC088538; Sat, 11 Apr 2009 14:15:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEFucK088537; Sat, 11 Apr 2009 14:15:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111415.n3BEFucK088537@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:15: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: r190924 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:15:58 -0000 Author: ed Date: Sat Apr 11 14:15:56 2009 New Revision: 190924 URL: http://svn.freebsd.org/changeset/base/190924 Log: Clean up the usage() function to use a single fprintf(). Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:15:09 2009 (r190923) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:15:56 2009 (r190924) @@ -983,30 +983,29 @@ setstr(u_int8_t *dest, const char *src, static void usage(void) { - fprintf(stderr, - "usage: newfs_msdos [ -options ] special [disktype]\n"); - fprintf(stderr, "where the options are:\n"); - fprintf(stderr, "\t-N don't create file system: " - "just print out parameters\n"); - fprintf(stderr, "\t-B get bootstrap from file\n"); - fprintf(stderr, "\t-F FAT type (12, 16, or 32)\n"); - fprintf(stderr, "\t-I volume ID\n"); - fprintf(stderr, "\t-L volume label\n"); - fprintf(stderr, "\t-O OEM string\n"); - fprintf(stderr, "\t-S bytes/sector\n"); - fprintf(stderr, "\t-a sectors/FAT\n"); - fprintf(stderr, "\t-b block size\n"); - fprintf(stderr, "\t-c sectors/cluster\n"); - fprintf(stderr, "\t-e root directory entries\n"); - fprintf(stderr, "\t-f standard format\n"); - fprintf(stderr, "\t-h drive heads\n"); - fprintf(stderr, "\t-i file system info sector\n"); - fprintf(stderr, "\t-k backup boot sector\n"); - fprintf(stderr, "\t-m media descriptor\n"); - fprintf(stderr, "\t-n number of FATs\n"); - fprintf(stderr, "\t-o hidden sectors\n"); - fprintf(stderr, "\t-r reserved sectors\n"); - fprintf(stderr, "\t-s file system size (sectors)\n"); - fprintf(stderr, "\t-u sectors/track\n"); - exit(1); + fprintf(stderr, + "usage: newfs_msdos [ -options ] special [disktype]\n" + "where the options are:\n" + "\t-B get bootstrap from file\n" + "\t-F FAT type (12, 16, or 32)\n" + "\t-I volume ID\n" + "\t-L volume label\n" + "\t-N don't create file system: just print out parameters\n" + "\t-O OEM string\n" + "\t-S bytes/sector\n" + "\t-a sectors/FAT\n" + "\t-b block size\n" + "\t-c sectors/cluster\n" + "\t-e root directory entries\n" + "\t-f standard format\n" + "\t-h drive heads\n" + "\t-i file system info sector\n" + "\t-k backup boot sector\n" + "\t-m media descriptor\n" + "\t-n number of FATs\n" + "\t-o hidden sectors\n" + "\t-r reserved sectors\n" + "\t-s file system size (sectors)\n" + "\t-u sectors/track\n"); + exit(1); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:20:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4EC01065697; Sat, 11 Apr 2009 14:20:45 +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 C2D2B8FC24; Sat, 11 Apr 2009 14:20:45 +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 n3BEKj3r088674; Sat, 11 Apr 2009 14:20:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEKj5b088673; Sat, 11 Apr 2009 14:20:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111420.n3BEKj5b088673@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190925 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:20:46 -0000 Author: ed Date: Sat Apr 11 14:20:45 2009 New Revision: 190925 URL: http://svn.freebsd.org/changeset/base/190925 Log: Show -@ and -C in usage, which were added in r185587. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:15:56 2009 (r190924) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:20:45 2009 (r190925) @@ -986,7 +986,9 @@ usage(void) fprintf(stderr, "usage: newfs_msdos [ -options ] special [disktype]\n" "where the options are:\n" + "\t-@ create file system at specified offset\n" "\t-B get bootstrap from file\n" + "\t-C create image file with specified size\n" "\t-F FAT type (12, 16, or 32)\n" "\t-I volume ID\n" "\t-L volume label\n" From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:24:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB361065678; Sat, 11 Apr 2009 14:24:54 +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 A1FD38FC17; Sat, 11 Apr 2009 14:24:54 +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 n3BEOscb088824; Sat, 11 Apr 2009 14:24:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEOsg3088823; Sat, 11 Apr 2009 14:24:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111424.n3BEOsg3088823@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190927 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:24:55 -0000 Author: ed Date: Sat Apr 11 14:24:54 2009 New Revision: 190927 URL: http://svn.freebsd.org/changeset/base/190927 Log: De-static local variables in main() (which is not recursive) and const-ify others. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:24:29 2009 (r190926) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:24:54 2009 (r190927) @@ -168,7 +168,7 @@ struct bpb { static struct { const char *name; struct bpb bpb; -} stdfmt[] = { +} const stdfmt[] = { {"160", {512, 1, 1, 2, 64, 320, 0xfe, 1, 8, 1, BPBGAP}}, {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, @@ -181,7 +181,7 @@ static struct { {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} }; -static u_int8_t bootcode[] = { +static const u_int8_t bootcode[] = { 0xfa, /* cli */ 0x31, 0xc0, /* xor ax,ax */ 0x8e, 0xd0, /* mov ss,ax */ @@ -232,13 +232,13 @@ static void usage(void); int main(int argc, char *argv[]) { - static char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:u:"; - static const char *opt_B, *opt_L, *opt_O, *opt_f; - static u_int opt_F, opt_I, opt_S, opt_a, opt_b, opt_c, opt_e; - static u_int opt_h, opt_i, opt_k, opt_m, opt_n, opt_o, opt_r; - static u_int opt_s, opt_u; - static int opt_N; - static int Iflag, mflag, oflag; + static const char opts[] = "@:NB:C:F:I:L:O:S:a:b:c:e:f:h:i:k:m:n:o:r:s:u:"; + const char *opt_B = NULL, *opt_L = NULL, *opt_O = NULL, *opt_f = NULL; + u_int opt_F = 0, opt_I = 0, opt_S = 0, opt_a = 0, opt_b = 0, opt_c = 0; + u_int opt_e = 0, opt_h = 0, opt_i = 0, opt_k = 0, opt_m = 0, opt_n = 0; + u_int opt_o = 0, opt_r = 0, opt_s = 0, opt_u = 0; + int opt_N = 0; + int Iflag = 0, mflag = 0, oflag = 0; char buf[MAXPATHLEN]; struct stat sb; struct timeval tv; @@ -255,7 +255,7 @@ main(int argc, char *argv[]) time_t now; u_int fat, bss, rds, cls, dir, lsn, x, x1, x2; int ch, fd, fd1; - static off_t opt_create=0, opt_ofs=0; + off_t opt_create = 0, opt_ofs = 0; while ((ch = getopt(argc, argv, opts)) != -1) switch (ch) { From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:25:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2F9106564A; Sat, 11 Apr 2009 14:25:48 +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 1E6438FC12; Sat, 11 Apr 2009 14:25:48 +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 n3BEPmnl088888; Sat, 11 Apr 2009 14:25:48 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEPl6r088887; Sat, 11 Apr 2009 14:25:47 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200904111425.n3BEPl6r088887@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 11 Apr 2009 14:25: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: r190928 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:25:48 -0000 Author: nyan Date: Sat Apr 11 14:25:47 2009 New Revision: 190928 URL: http://svn.freebsd.org/changeset/base/190928 Log: MFi386: revision 190919 Simplify in/out functions. Remove a hack to generate more efficient code for port numbers below 0x100, which has been obsolete for at least ten years, because GCC has an asm constraint to specify that. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Apr 11 14:24:54 2009 (r190927) +++ head/sys/pc98/pc98/machdep.c Sat Apr 11 14:25:47 2009 (r190928) @@ -2791,45 +2791,24 @@ user_dbreg_trap(void) #ifdef KDB /* - * Provide inb() and outb() as functions. They are normally only - * available as macros calling inlined functions, thus cannot be - * called from the debugger. - * - * The actual code is stolen from , and de-inlined. + * Provide inb() and outb() as functions. They are normally only available as + * inline functions, thus cannot be called from the debugger. */ -#undef inb -#undef outb - /* silence compiler warnings */ -u_char inb(u_int); -void outb(u_int, u_char); +u_char inb_(u_short); +void outb_(u_short, u_char); u_char -inb(u_int port) +inb_(u_short port) { - u_char data; - /* - * We use %%dx and not %1 here because i/o is done at %dx and not at - * %edx, while gcc generates inferior code (movw instead of movl) - * if we tell it to load (u_short) port. - */ - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - return (data); + return inb(port); } void -outb(u_int port, u_char data) +outb_(u_short port, u_char data) { - u_char al; - /* - * Use an unnecessary assignment to help gcc's register allocator. - * This make a large difference for gcc-1.40 and a tiny difference - * for gcc-2.6.0. For gcc-1.40, al had to be ``asm("ax")'' for - * best results. gcc-2.6.0 can't handle this. - */ - al = data; - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); + outb(port, data); } #endif /* KDB */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:33:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA061065674; Sat, 11 Apr 2009 14:33:10 +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 6D6E18FC19; Sat, 11 Apr 2009 14:33:10 +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 n3BEXAgj089074; Sat, 11 Apr 2009 14:33:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEXAbr089073; Sat, 11 Apr 2009 14:33:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111433.n3BEXAbr089073@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14: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: r190929 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:33:11 -0000 Author: ed Date: Sat Apr 11 14:33:10 2009 New Revision: 190929 URL: http://svn.freebsd.org/changeset/base/190929 Log: Use ftruncate() instead of lseek()+write()+lseek() to set the created file (-C) to the requested size. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:25:47 2009 (r190928) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:33:10 2009 (r190929) @@ -356,17 +356,13 @@ main(int argc, char *argv[]) } dtype = *argv; if (opt_create) { - off_t pos; - if (opt_N) errx(1, "create (-C) is incompatible with -N"); fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644); if (fd == -1) errx(1, "failed to create %s", fname); - pos = lseek(fd, opt_create - 1, SEEK_SET); - if (write(fd, "\0", 1) != 1) + if (ftruncate(fd, opt_create)) errx(1, "failed to initialize %jd bytes", (intmax_t)opt_create); - pos = lseek(fd, 0, SEEK_SET); } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1 || fstat(fd, &sb)) err(1, "%s", fname); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:41:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461471065675 for ; Sat, 11 Apr 2009 14:41:00 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9AB848FC22 for ; Sat, 11 Apr 2009 14:40:58 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 11 Apr 2009 14:40:56 -0000 Received: from p54A3D0FE.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.208.254] by mail.gmx.net (mp007) with SMTP; 11 Apr 2009 16:40:56 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX18/le0tN94/2eeYWyYvQVGc/Tve0QH7d+AhNgqfk0 H8Dcf1Hbth3vqr Message-ID: <49E0ABF7.3040002@gmx.de> Date: Sat, 11 Apr 2009 16:40:55 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Takahashi Yoshihiro References: <200904111425.n3BEPl6r088887@svn.freebsd.org> In-Reply-To: <200904111425.n3BEPl6r088887@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.65 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190928 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:41:01 -0000 Takahashi Yoshihiro schrieb: > Author: nyan > Date: Sat Apr 11 14:25:47 2009 > New Revision: 190928 > URL: http://svn.freebsd.org/changeset/base/190928 > > Log: > MFi386: revision 190919 > > Simplify in/out functions. > > Remove a hack to generate more efficient code for port numbers below > 0x100, which has been obsolete for at least ten years, because GCC has > an asm constraint to specify that. Thank you! I forgot about pc98. Christoph From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:43:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FE4C106564A; Sat, 11 Apr 2009 14:43:23 +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 3EAB38FC0C; Sat, 11 Apr 2009 14:43:23 +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 n3BEhNI7089334; Sat, 11 Apr 2009 14:43:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEhNpC089333; Sat, 11 Apr 2009 14:43:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111443.n3BEhNpC089333@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:43: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: r190930 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:43:24 -0000 Author: ed Date: Sat Apr 11 14:43:22 2009 New Revision: 190930 URL: http://svn.freebsd.org/changeset/base/190930 Log: Fix a bug in r185587. fstat(fd, &sb) was not executed unconditionally anymore so sb was read uninitialised when -C is used. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:33:10 2009 (r190929) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:43:22 2009 (r190930) @@ -363,8 +363,9 @@ main(int argc, char *argv[]) errx(1, "failed to create %s", fname); if (ftruncate(fd, opt_create)) errx(1, "failed to initialize %jd bytes", (intmax_t)opt_create); - } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1 || - fstat(fd, &sb)) + } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1) + err(1, "%s", fname); + if (fstat(fd, &sb)) err(1, "%s", fname); if (!opt_N) check_mounted(fname, sb.st_mode); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:53:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8668106566C; Sat, 11 Apr 2009 14:53:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970298FC17; Sat, 11 Apr 2009 14:53:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BErWAt089633; Sat, 11 Apr 2009 14:53:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BErWgc089632; Sat, 11 Apr 2009 14:53:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111453.n3BErWgc089632@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:53: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: r190931 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:53:33 -0000 Author: ed Date: Sat Apr 11 14:53:32 2009 New Revision: 190931 URL: http://svn.freebsd.org/changeset/base/190931 Log: When using -C, do not warn when the file is not a character device, but warn when it is not a regular file. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:43:22 2009 (r190930) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:53:32 2009 (r190931) @@ -367,10 +367,15 @@ main(int argc, char *argv[]) err(1, "%s", fname); if (fstat(fd, &sb)) err(1, "%s", fname); + if (opt_create) { + if (!S_ISREG(sb.st_mode)) + warnx("warning, %s is not a regular file", fname); + } else { + if (!S_ISCHR(sb.st_mode)) + warnx("warning, %s is not a character device", fname); + } if (!opt_N) check_mounted(fname, sb.st_mode); - if (!S_ISCHR(sb.st_mode)) - warnx("warning, %s is not a character device", fname); if (opt_ofs && opt_ofs != lseek(fd, opt_ofs, SEEK_SET)) errx(1, "cannot seek to %jd", (intmax_t)opt_ofs); memset(&bpb, 0, sizeof(bpb)); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 14:56:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E21B106564A; Sat, 11 Apr 2009 14:56:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CDA58FC14; Sat, 11 Apr 2009 14:56:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BEuT0T089742; Sat, 11 Apr 2009 14:56:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BEuT4C089740; Sat, 11 Apr 2009 14:56:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111456.n3BEuT4C089740@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 14:56: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: r190932 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 14:56:30 -0000 Author: ed Date: Sat Apr 11 14:56:29 2009 New Revision: 190932 URL: http://svn.freebsd.org/changeset/base/190932 Log: Do not prepend /dev/ when -C is used. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 14:53:32 2009 (r190931) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 14:56:29 2009 (r190932) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd April 11, 2009 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -72,9 +72,11 @@ to determine geometry, if required. If .Ar special does not contain a -.Ar / , -it is assumed to be a device name and -.Ar /dev +.Ar / +and +.Fl C +is not used, it is assumed to be a device name and +.Ar /dev/ is prepended to the name to construct the actual device name. To work a file in the current directory use .Ar ./filename Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:53:32 2009 (r190931) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:56:29 2009 (r190932) @@ -349,7 +349,7 @@ main(int argc, char *argv[]) if (argc < 1 || argc > 2) usage(); fname = *argv++; - if (!strchr(fname, '/')) { + if (!opt_create && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); if (!(fname = strdup(buf))) err(1, NULL); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 15:03:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3B921065670; Sat, 11 Apr 2009 15:03:44 +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 A11A78FC18; Sat, 11 Apr 2009 15:03:44 +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 n3BF3ib4089938; Sat, 11 Apr 2009 15:03:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BF3iKj089937; Sat, 11 Apr 2009 15:03:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111503.n3BF3iKj089937@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 15:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190933 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 15:03:45 -0000 Author: ed Date: Sat Apr 11 15:03:44 2009 New Revision: 190933 URL: http://svn.freebsd.org/changeset/base/190933 Log: Update documentation (forgotten in r190929). Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.8 Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 14:56:29 2009 (r190932) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 15:03:44 2009 (r190933) @@ -96,10 +96,11 @@ Get bootstrap from file. Create the image file with the specified size. A suffix character appended to the size is interpreted as for the .Fl @ -option. The file is created by truncating any existing file with the -same name, seeking just before the required size and writing -a single 0 byte. As a consequence, the space occupied on disk -may be smaller than the size specified as a parameter. +option. +The file is created by truncating any existing file with the same name and +resizing it to the requested size. +If the file system supports sparse files, the space occupied on disk may be +smaller than the size specified as parameter. .It Fl F Ar FAT-type FAT type (one of 12, 16, or 32). .It Fl I Ar volid From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 15:05:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00642106567A; Sat, 11 Apr 2009 15:05: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 E2F538FC18; Sat, 11 Apr 2009 15:05: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 n3BF5JjO090056; Sat, 11 Apr 2009 15:05:19 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BF5JKu090055; Sat, 11 Apr 2009 15:05:19 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904111505.n3BF5JKu090055@svn.freebsd.org> From: Paolo Pisati Date: Sat, 11 Apr 2009 15:05: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: r190935 - in head/sys: . netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 15:05:20 -0000 Author: piso Date: Sat Apr 11 15:05:19 2009 New Revision: 190935 URL: http://svn.freebsd.org/changeset/base/190935 Log: Remove stale comments. Modified: head/sys/ (props changed) head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Sat Apr 11 15:04:51 2009 (r190934) +++ head/sys/netinet/libalias/alias.c Sat Apr 11 15:05:19 2009 (r190935) @@ -1226,7 +1226,6 @@ FragmentOut(struct libalias *la, struct (prototypes in alias.h) */ -// XXX ip free int LibAliasSaveFragment(struct libalias *la, char *ptr) { @@ -1246,7 +1245,6 @@ LibAliasSaveFragment(struct libalias *la return (iresult); } -// XXX ip free char * LibAliasGetFragment(struct libalias *la, char *ptr) { @@ -1268,7 +1266,6 @@ LibAliasGetFragment(struct libalias *la, return (fptr); } -// XXX ip free void LibAliasFragmentIn(struct libalias *la, char *ptr, /* Points to correctly * de-aliased header From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 15:07:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11531106566B; Sat, 11 Apr 2009 15:07:28 +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 D9B558FC16; Sat, 11 Apr 2009 15:07:27 +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 n3BF7R2U090141; Sat, 11 Apr 2009 15:07:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BF7Rx2090140; Sat, 11 Apr 2009 15:07:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904111507.n3BF7Rx2090140@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Apr 2009 15:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190936 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 15:07:28 -0000 Author: ed Date: Sat Apr 11 15:07:27 2009 New Revision: 190936 URL: http://svn.freebsd.org/changeset/base/190936 Log: Style fixes to the newfs_msdos manpage. Submitted by: Christoph Mallon Modified: head/sbin/newfs_msdos/newfs_msdos.8 Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 15:05:19 2009 (r190935) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sat Apr 11 15:07:27 2009 (r190936) @@ -93,8 +93,8 @@ number is in sectors, kilobytes, megabyt .It Fl B Ar boot Get bootstrap from file. .It Fl C Ar create-size -Create the image file with the specified size. A suffix character appended -to the size is interpreted as for the +Create the image file with the specified size. +A suffix character appended to the size is interpreted as for the .Fl @ option. The file is created by truncating any existing file with the same name and @@ -164,13 +164,14 @@ Number of sectors per track. .El .Sh NOTES If some parameters (e.g. size, number of sectors, etc.) are not specified -through options or disktype, the program tries to generate them -automatically. In particular, the size is determined as the -device or file size minus the offset specified with the +through options or disktype, the program tries to generate them automatically. +In particular, the size is determined as the device or file size minus the +offset specified with the .Fl @ -option. When the geometry is not available, it is assumed to be -63 sectors, 255 heads. The size is then rounded to become -a multiple of the track size and avoid complaints by some filesystem code. +option. +When the geometry is not available, it is assumed to be 63 sectors, 255 heads. +The size is then rounded to become a multiple of the track size and avoid +complaints by some filesystem code. .Pp FAT file system parameters occupy a "Boot Sector BPB (BIOS Parameter Block)" in the first of the "reserved" sectors which precede the actual From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 15:19:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DAA106566C; Sat, 11 Apr 2009 15:19:09 +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 7549C8FC17; Sat, 11 Apr 2009 15:19:09 +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 n3BFJ909090569; Sat, 11 Apr 2009 15:19:09 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BFJ9jx090567; Sat, 11 Apr 2009 15:19:09 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904111519.n3BFJ9jx090567@svn.freebsd.org> From: Paolo Pisati Date: Sat, 11 Apr 2009 15:19: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: r190938 - in head/sys: . netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 15:19:10 -0000 Author: piso Date: Sat Apr 11 15:19:09 2009 New Revision: 190938 URL: http://svn.freebsd.org/changeset/base/190938 Log: Plug two bugs introduced with modules conversion: -UdpAliasIn(): correctly check return code after modules ran. -alias_nbt: in case of malformed packets (or some other unrecoverable error), toss the packet. Modified: head/sys/ (props changed) head/sys/netinet/libalias/alias.c head/sys/netinet/libalias/alias_nbt.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Sat Apr 11 15:16:11 2009 (r190937) +++ head/sys/netinet/libalias/alias.c Sat Apr 11 15:19:09 2009 (r190938) @@ -742,7 +742,7 @@ UdpAliasIn(struct libalias *la, struct i u_short alias_port; u_short proxy_port; int accumulate; - int r = 0, error; + int error; struct alias_data ad = { .lnk = lnk, .oaddr = &original_address, @@ -804,7 +804,7 @@ UdpAliasIn(struct libalias *la, struct i /* * If we cannot figure out the packet, ignore it. */ - if (r < 0) + if (error < 0) return (PKT_ALIAS_IGNORED); else return (PKT_ALIAS_OK); Modified: head/sys/netinet/libalias/alias_nbt.c ============================================================================== --- head/sys/netinet/libalias/alias_nbt.c Sat Apr 11 15:16:11 2009 (r190937) +++ head/sys/netinet/libalias/alias_nbt.c Sat Apr 11 15:19:09 2009 (r190938) @@ -93,8 +93,7 @@ static int protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) { - AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport); - return (0); + return (AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport)); } static int @@ -123,9 +122,8 @@ static int protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) { - AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, - ah->aaddr, ah->aport); - return (0); + return (AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, + ah->aaddr, ah->aport)); } /* Kernel module definition. */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 15:26:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCC1106568A; Sat, 11 Apr 2009 15:26: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 5B4E88FC18; Sat, 11 Apr 2009 15:26: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 n3BFQV8s090885; Sat, 11 Apr 2009 15:26:31 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BFQV2k090884; Sat, 11 Apr 2009 15:26:31 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904111526.n3BFQV2k090884@svn.freebsd.org> From: Paolo Pisati Date: Sat, 11 Apr 2009 15:26: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: r190941 - in head/sys: . netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 15:26:32 -0000 Author: piso Date: Sat Apr 11 15:26:31 2009 New Revision: 190941 URL: http://svn.freebsd.org/changeset/base/190941 Log: What's the point of adjusting a checksum if we are going to toss the packet? Anticipate the check/return code. Modified: head/sys/ (props changed) head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Sat Apr 11 15:21:11 2009 (r190940) +++ head/sys/netinet/libalias/alias.c Sat Apr 11 15:26:31 2009 (r190941) @@ -762,6 +762,9 @@ UdpAliasIn(struct libalias *la, struct i /* Walk out chain. */ error = find_handler(IN, UDP, la, pip, &ad); + /* If we cannot figure out the packet, ignore it. */ + if (error < 0) + return (PKT_ALIAS_IGNORED); /* If UDP checksum is not zero, then adjust since destination port */ /* is being unaliased and destination address is being altered. */ @@ -801,13 +804,7 @@ UdpAliasIn(struct libalias *la, struct i &original_address, &pip->ip_dst, 2); pip->ip_dst = original_address; - /* - * If we cannot figure out the packet, ignore it. - */ - if (error < 0) - return (PKT_ALIAS_IGNORED); - else - return (PKT_ALIAS_OK); + return (PKT_ALIAS_OK); } return (PKT_ALIAS_IGNORED); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 16:12:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E96D1065672; Sat, 11 Apr 2009 16:12: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 7D08D8FC08; Sat, 11 Apr 2009 16:12: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 n3BGCKZH091801; Sat, 11 Apr 2009 16:12:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BGCKs4091800; Sat, 11 Apr 2009 16:12:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904111612.n3BGCKs4091800@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 Apr 2009 16:12: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: r190942 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 16:12:21 -0000 Author: kib Date: Sat Apr 11 16:12:20 2009 New Revision: 190942 URL: http://svn.freebsd.org/changeset/base/190942 Log: When zapping v_cache_dd for !MAKEENTRY case in cache_lookup(), we shall lock cache as writer. Reviewed by: kan Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Apr 11 15:26:31 2009 (r190941) +++ head/sys/kern/vfs_cache.c Sat Apr 11 16:12:20 2009 (r190942) @@ -410,6 +410,8 @@ retry_wlocked: goto unlock; } if ((cnp->cn_flags & MAKEENTRY) == 0) { + if (!wlocked && !CACHE_UPGRADE_LOCK()) + goto wlock; if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) cache_zap(dvp->v_cache_dd); dvp->v_cache_dd = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 16:35:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96EBE1065672; Sat, 11 Apr 2009 16:35:28 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 766768FC15; Sat, 11 Apr 2009 16:35:28 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.3/8.14.3) with ESMTP id n3BGZS5P046627; Sat, 11 Apr 2009 09:35:28 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.3/8.14.3/Submit) id n3BGZSvh046626; Sat, 11 Apr 2009 09:35:28 -0700 (PDT) (envelope-from sgk) Date: Sat, 11 Apr 2009 09:35:28 -0700 From: Steve Kargl To: Ed Schouten Message-ID: <20090411163528.GC46526@troutmask.apl.washington.edu> References: <200904111401.n3BE1108088009@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904111401.n3BE1108088009@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 16:35:29 -0000 On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: > Author: ed > Date: Sat Apr 11 14:01:01 2009 > New Revision: 190919 > URL: http://svn.freebsd.org/changeset/base/190919 > > Log: > Simplify in/out functions (for i386 and AMD64). > > Remove a hack to generate more efficient code for port numbers below > 0x100, which has been obsolete for at least ten years, because GCC has > an asm constraint to specify that. > > Submitted by: Christoph Mallon > I thought Christoph and bde were still hashing out the correctness of this patch. http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html -- Steve From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 16:51:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5992C1065672; Sat, 11 Apr 2009 16:51:16 +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 E9CB58FC14; Sat, 11 Apr 2009 16:51:15 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 0FF9D1CC77; Sat, 11 Apr 2009 18:51:15 +0200 (CEST) Date: Sat, 11 Apr 2009 18:51:14 +0200 From: Ed Schouten To: Steve Kargl Message-ID: <20090411165114.GV32098@hoeg.nl> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="36+Jv5wzUORg1Ut4" Content-Disposition: inline In-Reply-To: <20090411163528.GC46526@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 16:51:16 -0000 --36+Jv5wzUORg1Ut4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Steve, * Steve Kargl wrote: > I thought Christoph and bde were still hashing out the correctness > of this patch. >=20 > http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html Yes, so I've only committed a subset of changes of which there were no major (or in my opinion valid) objections: - The construct that we use now works with many versions of GCC. There is absolutely no reason why we should still try to support GCC <2.95. - There was also the discussion about __inline vs inline and __volatile vs __volatile. As Christoph and I noticed, there is also a lot of inconsistency between the usage of the keywords in the current sources we have. I already spent much time discussing this issue with Christoph to get to at least some compromise. --=20 Ed Schouten WWW: http://80386.nl/ --36+Jv5wzUORg1Ut4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkngyoIACgkQ52SDGA2eCwUyHQCdFp/douLinG9UzD2rW3tXt2mG HOcAn00aDbSPnekJTnM9i/uJmCwqW2ZO =ziVz -----END PGP SIGNATURE----- --36+Jv5wzUORg1Ut4-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 16:57:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D06106566C; Sat, 11 Apr 2009 16:57:51 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 615748FC0A; Sat, 11 Apr 2009 16:57:51 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BGvpdA092704; Sat, 11 Apr 2009 16:57:51 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BGvpsC092703; Sat, 11 Apr 2009 16:57:51 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200904111657.n3BGvpsC092703@svn.freebsd.org> From: David Schultz Date: Sat, 11 Apr 2009 16:57: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: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 16:57:51 -0000 Author: das Date: Sat Apr 11 16:57:50 2009 New Revision: 190943 URL: http://svn.freebsd.org/changeset/base/190943 Log: GNU Pth has some fragile kludges that were broken by r189828. I've discussed this with the Pth maintainer and no clear solution has emerged on the ports side of things, so for now, hack around the issue in signal.h. Modified: head/include/signal.h Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Sat Apr 11 16:12:20 2009 (r190942) +++ head/include/signal.h Sat Apr 11 16:57:50 2009 (r190943) @@ -72,8 +72,10 @@ int raise(int); #if __POSIX_VISIBLE || __XSI_VISIBLE int kill(__pid_t, int); +#ifndef _PTH_PTHREAD_H_ /* XXX kludge to work around GNU Pth brokenness */ int pthread_kill(__pthread_t, int); int pthread_sigmask(int, const __sigset_t *, __sigset_t *); +#endif int sigaction(int, const struct sigaction * __restrict, struct sigaction * __restrict); int sigaddset(sigset_t *, int); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:04:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 793DB106564A; Sat, 11 Apr 2009 17:04:05 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f134.google.com (mail-qy0-f134.google.com [209.85.221.134]) by mx1.freebsd.org (Postfix) with ESMTP id CED068FC13; Sat, 11 Apr 2009 17:04:04 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qyk40 with SMTP id 40so2576052qyk.3 for ; Sat, 11 Apr 2009 10:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=xLNa8/3640t3tKDSWzl+GM4SH3iFPhNYdqYKYhYEKn4=; b=LdkvLe1VGQ8Y+3+785K1op3jZ9z7h/Rnsb/qEzBmKPOCoxdXxvs2g8tfSPEGtKGQGg 0Ab+3ttpyiHODVzpPP1wjnneWiGAMF8sHMU2dOVnKx19/b6XPtexibmDFiHSKuPypqY8 iWhedukuGo6FTREfcqxtPu+VEpyC6yhfrqRvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=WSYTlzo1olLTDpNJ0JJvUVMsmWS8ZU9XmX1Gk8IOL+3psdDonftf0FaJTHcXf08OGo hUThVgWWeaRAHUVAWRYb4gU4SRbhVEvLMrPfUQ8l3HBESAoE5LpolkosaFeEumA/N+27 4+9CbnpJrC8kMcLwesS0c4QWqL1yDnqTs8rLA= Received: by 10.224.67.67 with SMTP id q3mr4885570qai.5.1239468225036; Sat, 11 Apr 2009 09:43:45 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 26sm4615937qwa.52.2009.04.11.09.43.41 (version=SSLv3 cipher=RC4-MD5); Sat, 11 Apr 2009 09:43:43 -0700 (PDT) Date: Sat, 11 Apr 2009 12:43:35 -0400 From: Alexander Kabaev To: Steve Kargl Message-ID: <20090411124335.0600a72f@kan.dnsalias.net> In-Reply-To: <20090411163528.GC46526@troutmask.apl.washington.edu> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/nbr_NUpyatGoY_GpH4Sseq7"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:04:05 -0000 --Sig_/nbr_NUpyatGoY_GpH4Sseq7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 11 Apr 2009 09:35:28 -0700 Steve Kargl wrote: > On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: > > Author: ed > > Date: Sat Apr 11 14:01:01 2009 > > New Revision: 190919 > > URL: http://svn.freebsd.org/changeset/base/190919 > >=20 > > Log: > > Simplify in/out functions (for i386 and AMD64). > > =20 > > Remove a hack to generate more efficient code for port numbers > > below 0x100, which has been obsolete for at least ten years, > > because GCC has an asm constraint to specify that. > > =20 > > Submitted by: Christoph Mallon > >=20 >=20 > I thought Christoph and bde were still hashing out the correctness > of this patch. >=20 > http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html >=20 > --=20 > Steve The patch is inconsistent in regards to usage of volatile vs. __volatile even within itself. I think the code is sloppy and was not ready to be committed yet. Please fix or back out. --=20 Alexander Kabaev --Sig_/nbr_NUpyatGoY_GpH4Sseq7 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iD8DBQFJ4Mi8Q6z1jMm+XZYRAs1wAJ9R0s0eYED/siLAQ9OMMQAYThLKLgCgy/gX i3ACSeLv6QxxoP1TYXumCok= =WmK8 -----END PGP SIGNATURE----- --Sig_/nbr_NUpyatGoY_GpH4Sseq7-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:07:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78E79106564A for ; Sat, 11 Apr 2009 17:07:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2F58FC25 for ; Sat, 11 Apr 2009 17:07:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 2053D8FC53 for ; Sat, 11 Apr 2009 21:07:03 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 3C0D28FC4E; Sat, 11 Apr 2009 21:07:00 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id B83DD3981A; Sat, 11 Apr 2009 21:07:06 +0400 (MSD) Date: Sat, 11 Apr 2009 21:07:02 +0400 From: Stanislav Sedov To: David Schultz Message-Id: <20090411210702.ce5325b9.stas@FreeBSD.org> In-Reply-To: <200904111657.n3BGvpsC092703@svn.freebsd.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sat Apr 11 21:07:02 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49e0ce36967001990963390 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:07:05 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 11 Apr 2009 16:57:51 +0000 (UTC) David Schultz mentioned: > Author: das > Date: Sat Apr 11 16:57:50 2009 > New Revision: 190943 > URL: http://svn.freebsd.org/changeset/base/190943 > > Log: > GNU Pth has some fragile kludges that were broken by r189828. > I've discussed this with the Pth maintainer and no clear solution > has emerged on the ports side of things, so for now, hack around > the issue in signal.h. > Can't we just put a patch in ports tree itself? What meant under 'no clean solution emerged'? I can prepare a patch, if needed. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkngzjoACgkQK/VZk+smlYFHiACfU95MJRR10OQt22E8BOh0Qf9+ KssAnRLxU38JbNvvN01t3whzeXNPBYqq =Mhh9 -----END PGP SIGNATURE----- !DSPAM:49e0ce36967001990963390! From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:18:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0989106564A; Sat, 11 Apr 2009 17:18:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 5AF5D8FC1A; Sat, 11 Apr 2009 17:18:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3BHIhsE009623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Apr 2009 03:18:44 +1000 Date: Sun, 12 Apr 2009 03:18:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <200904111401.n3BE1108088009@svn.freebsd.org> Message-ID: <20090412025829.M4579@besplex.bde.org> References: <200904111401.n3BE1108088009@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: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:18:47 -0000 On Sat, 11 Apr 2009, Ed Schouten wrote: > Log: > Simplify in/out functions (for i386 and AMD64). > > Remove a hack to generate more efficient code for port numbers below > 0x100, which has been obsolete for at least ten years, because GCC has > an asm constraint to specify that. > > Submitted by: Christoph Mallon This is not quite the submitted patch and is more like I want. It still has a micro-pessimizations and style bugs: > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Sat Apr 11 13:15:38 2009 (r190918) > +++ head/sys/amd64/amd64/machdep.c Sat Apr 11 14:01:01 2009 (r190919) > @@ -2178,45 +2178,24 @@ user_dbreg_trap(void) > #ifdef KDB > > /* > - * Provide inb() and outb() as functions. They are normally only > - * available as macros calling inlined functions, thus cannot be > - * called from the debugger. > - * > - * The actual code is stolen from , and de-inlined. > + * Provide inb() and outb() as functions. They are normally only available as > + * inline functions, thus cannot be called from the debugger. > */ This part should be done differently, but for a quick fix: > > -#undef inb > -#undef outb > - > /* silence compiler warnings */ > -u_char inb(u_int); > -void outb(u_int, u_char); > +u_char inb_(u_short); > +void outb_(u_short, u_char); This still changes the API from u_int port to u_short port. A better way to stop the warnings might be to declare the functions as static and do whatever is done for other ddb functions to prevent the compiler removing static functions that are never called. I think there are a few other static ddb-hack functions that were broken by gcc removing them. It used to take -O3 to remove them, but now -O1 does. > > u_char > -inb(u_int port) > +inb_(u_short port) > { API change. > - u_char data; > - /* > - * We use %%dx and not %1 here because i/o is done at %dx and not at > - * %edx, while gcc generates inferior code (movw instead of movl) > - * if we tell it to load (u_short) port. > - */ > - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); > - return (data); > + return inb(port); This still removes the KNF parentheses around the return value. > Modified: head/sys/amd64/include/cpufunc.h > ============================================================================== > --- head/sys/amd64/include/cpufunc.h Sat Apr 11 13:15:38 2009 (r190918) > +++ head/sys/amd64/include/cpufunc.h Sat Apr 11 14:01:01 2009 (r190919) > ... > -static __inline u_char > -inbv(u_int port) > -{ > ... > - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); > + __asm volatile("inb %w1, %0" : "=a" (data) : "Nd" (port)); > return (data); > } This still replaces __volatile by volatile. This might be a good style change, but should be done globally and separately. Similarly for replacing __inline by inline (which you didn't commit). Similarly for other __volatile's. Similarly for i386. It is easier to review and fix things before they are committed. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:31:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39D8106566C; Sat, 11 Apr 2009 17:31:20 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id 831598FC1E; Sat, 11 Apr 2009 17:31:20 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so929773yxm.13 for ; Sat, 11 Apr 2009 10:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=SpAzW8nnQhTNGRaCksLCrporahL623MIcxieDezJJkk=; b=TguZRJOxfjiaQ7zmceOE+JG6vkGS6KTBXJcOPCaftMlauoY8yOOvNLZzZ6xzI6PDni JplWz1j0f560ODdYimyBBFgC73Yda0cuReYsk+CBwOsi+TZNGsNRKC5WWP+BwhxfATrp btGQTk+a25H5/jg5SVq5OpMVrsVjsESKSifB8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=cL5U8c7mAHIC0Z5N238mnRH6CCcPbNPzZM0xQPHtc2SKmWuaH8g6N3lpObSNFOg20o Yu4L9vTGIjkpgVZjJTot5WTurkd7kvobneu4O5O+PFpQfRsmUXKVaYvrNwMo2zmY53KJ qx9n2JLpr6QptKV11/ZynSKJXf9Pc/hozK1mM= Received: by 10.100.151.8 with SMTP id y8mr4603667and.106.1239471079558; Sat, 11 Apr 2009 10:31:19 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id c40sm417422anc.28.2009.04.11.10.31.18 (version=SSLv3 cipher=RC4-MD5); Sat, 11 Apr 2009 10:31:19 -0700 (PDT) Date: Sat, 11 Apr 2009 13:31:13 -0400 From: Alexander Kabaev To: Stanislav Sedov Message-ID: <20090411133113.79863e2c@kan.dnsalias.net> In-Reply-To: <20090411210702.ce5325b9.stas@FreeBSD.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: base64 Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:31:21 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMQ0KDQpPbiBTYXQs IDExIEFwciAyMDA5IDIxOjA3OjAyICswNDAwDQpTdGFuaXNsYXYgU2Vkb3YgPHN0YXNARnJlZUJT RC5vcmc+IHdyb3RlOg0KDQo+IC0tLS0tQkVHSU4gUEdQIFNJR05FRCBNRVNTQUdFLS0tLS0NCj4g SGFzaDogU0hBMQ0KPiANCj4gT24gU2F0LCAxMSBBcHIgMjAwOSAxNjo1Nzo1MSArMDAwMCAoVVRD KQ0KPiBEYXZpZCBTY2h1bHR6IDxkYXNARnJlZUJTRC5vcmc+IG1lbnRpb25lZDoNCj4gDQo+ID4g QXV0aG9yOiBkYXMNCj4gPiBEYXRlOiBTYXQgQXByIDExIDE2OjU3OjUwIDIwMDkNCj4gPiBOZXcg UmV2aXNpb246IDE5MDk0Mw0KPiA+IFVSTDogaHR0cDovL3N2bi5mcmVlYnNkLm9yZy9jaGFuZ2Vz ZXQvYmFzZS8xOTA5NDMNCj4gPiANCj4gPiBMb2c6DQo+ID4gICBHTlUgUHRoIGhhcyBzb21lIGZy YWdpbGUga2x1ZGdlcyB0aGF0IHdlcmUgYnJva2VuIGJ5IHIxODk4MjguDQo+ID4gICBJJ3ZlIGRp c2N1c3NlZCB0aGlzIHdpdGggdGhlIFB0aCBtYWludGFpbmVyIGFuZCBubyBjbGVhciBzb2x1dGlv bg0KPiA+ICAgaGFzIGVtZXJnZWQgb24gdGhlIHBvcnRzIHNpZGUgb2YgdGhpbmdzLCBzbyBmb3Ig bm93LCBoYWNrIGFyb3VuZA0KPiA+ICAgdGhlIGlzc3VlIGluIHNpZ25hbC5oLg0KPiA+IA0KPiAN Cj4gQ2FuJ3Qgd2UganVzdCBwdXQgYSBwYXRjaCBpbiBwb3J0cyB0cmVlIGl0c2VsZj8gV2hhdCBt ZWFudCB1bmRlciAnbm8NCj4gY2xlYW4gc29sdXRpb24gZW1lcmdlZCc/IEkgY2FuIHByZXBhcmUg YSBwYXRjaCwgaWYgbmVlZGVkLg0KPiANCg0KSSBzdHJvbmdseSBzdXBwb3J0IHRoaXMgYXJndW1l bnQuIFB1dHRpbmcgcG9ydC1zcGVjaWZpYyBoYWNrcyBpbnRvDQpzeXN0ZW0gaW5jbHVkZSBmaWxl cyBpcyBob3JyaWJsZSBpZGVhLg0KDQotIC0tIA0KQWxleGFuZGVyIEthYmFldg0KLS0tLS1CRUdJ TiBQR1AgU0lHTkFUVVJFLS0tLS0NClZlcnNpb246IEdudVBHIHYyLjAuMTEgKEZyZWVCU0QpDQoN CmlEOERCUUZKNE5QbFE2ejFqTW0rWFpZUkFrOGhBS0RVdkNCN2piKy93NjNqRkIrR1RoQWxxRmtK WWdDZ3NUVVYNClc4QUdOdnVYb0E1V1VjOTNHcHREeFlZPQ0KPWJrMFcNCi0tLS0tRU5EIFBHUCBT SUdOQVRVUkUtLS0tLQ0K From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:35:51 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED201065674; Sat, 11 Apr 2009 17:35:51 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0608A8FC21; Sat, 11 Apr 2009 17:35:50 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121] (may be forged)) (authenticated bits=0) by sakura.ninth-nine.com (8.14.3/8.14.3/NinthNine) with ESMTP id n3BHIfb0097846; Sun, 12 Apr 2009 02:18:47 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 12 Apr 2009 02:18:41 +0900 From: Norikatsu Shigemura To: David Schultz , Stanislav Sedov Message-Id: <20090412021841.673a200b.nork@FreeBSD.org> In-Reply-To: <20090411210702.ce5325b9.stas@FreeBSD.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:35:51 -0000 On Sat, 11 Apr 2009 21:07:02 +0400 Stanislav Sedov wrote: > > Log: > > GNU Pth has some fragile kludges that were broken by r189828. > > I've discussed this with the Pth maintainer and no clear solution > > has emerged on the ports side of things, so for now, hack around > > the issue in signal.h. > Can't we just put a patch in ports tree itself? What meant under 'no > clean solution emerged'? I can prepare a patch, if needed. I think so, too. I have a quick hack patch. ports/devel/pth/files/patch-pth_p.h.in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- pth_p.h.in.orig 2006-06-09 02:54:03.000000000 +0900 +++ pth_p.h.in 2009-04-08 15:05:12.911807009 +0900 @@ -32,7 +32,7 @@ #include #include #include -#include +//#include #include #include #include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:36:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8D211065674; Sat, 11 Apr 2009 17:36:11 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A658E8FC1C; Sat, 11 Apr 2009 17:36:11 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BHaBDM093621; Sat, 11 Apr 2009 17:36:11 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BHaBP7093616; Sat, 11 Apr 2009 17:36:11 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904111736.n3BHaBP7093616@svn.freebsd.org> From: Rui Paulo Date: Sat, 11 Apr 2009 17:36: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: r190944 - in head/contrib/libpcap: . bpf/net pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:36:12 -0000 Author: rpaulo Date: Sat Apr 11 17:36:11 2009 New Revision: 190944 URL: http://svn.freebsd.org/changeset/base/190944 Log: Revert previous commit that commented out some bpf functions. Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). This is needed because some ports rely heavely on these arguments (some of them even roll out their own implemenentations of bpf_dump). Modified: head/contrib/libpcap/bpf/net/bpf_filter.c head/contrib/libpcap/bpf_dump.c head/contrib/libpcap/bpf_image.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Sat Apr 11 16:57:50 2009 (r190943) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Sat Apr 11 17:36:11 2009 (r190944) @@ -200,8 +200,8 @@ m_xhalf(m, k, err) */ u_int bpf_filter(pc, p, wirelen, buflen) - register const struct bpf_insn *pc; - register const u_char *p; + register struct bpf_insn *pc; + register u_char *p; u_int wirelen; register u_int buflen; { Modified: head/contrib/libpcap/bpf_dump.c ============================================================================== --- head/contrib/libpcap/bpf_dump.c Sat Apr 11 16:57:50 2009 (r190943) +++ head/contrib/libpcap/bpf_dump.c Sat Apr 11 17:36:11 2009 (r190944) @@ -31,7 +31,7 @@ static const char rcsid[] _U_ = #include void -bpf_dump(const struct bpf_program *p, int option) +bpf_dump(struct bpf_program *p, int option) { const struct bpf_insn *insn; int i; Modified: head/contrib/libpcap/bpf_image.c ============================================================================== --- head/contrib/libpcap/bpf_image.c Sat Apr 11 16:57:50 2009 (r190943) +++ head/contrib/libpcap/bpf_image.c Sat Apr 11 17:36:11 2009 (r190944) @@ -39,7 +39,7 @@ static const char rcsid[] _U_ = char * bpf_image(p, n) - const struct bpf_insn *p; + struct bpf_insn *p; int n; { int v; Modified: head/contrib/libpcap/pcap/bpf.h ============================================================================== --- head/contrib/libpcap/pcap/bpf.h Sat Apr 11 16:57:50 2009 (r190943) +++ head/contrib/libpcap/pcap/bpf.h Sat Apr 11 17:36:11 2009 (r190944) @@ -916,7 +916,7 @@ struct bpf_insn { #if __STDC__ || defined(__cplusplus) extern int bpf_validate(const struct bpf_insn *, int); -extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); #else extern int bpf_validate(); extern u_int bpf_filter(); Modified: head/contrib/libpcap/pcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap/pcap.h Sat Apr 11 16:57:50 2009 (r190943) +++ head/contrib/libpcap/pcap/pcap.h Sat Apr 11 17:36:11 2009 (r190944) @@ -334,10 +334,10 @@ void pcap_freealldevs(pcap_if_t *); const char *pcap_lib_version(void); /* XXX this guy lives in the bpf tree */ -/* u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); -int bpf_validate(const struct bpf_insn *f, int len); */ -char *bpf_image(const struct bpf_insn *, int); -void bpf_dump(const struct bpf_program *, int); +u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); +int bpf_validate(struct bpf_insn *f, int len); +char *bpf_image(struct bpf_insn *, int); +void bpf_dump(struct bpf_program *, int); #if defined(WIN32) From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:37:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80205106564A; Sat, 11 Apr 2009 17:37:54 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com [209.85.218.164]) by mx1.freebsd.org (Postfix) with ESMTP id 763A38FC1B; Sat, 11 Apr 2009 17:37:53 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by bwz8 with SMTP id 8so1536198bwz.43 for ; Sat, 11 Apr 2009 10:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=e3PZ6pV+nb1WKM550gUaPnw8GaK3z4i4Aikopl0NUbo=; b=bfkGrcw4JObN56SictO/BroD9dw4ogq/QYZ3+GK1Ct/85+C7jGRcyywf3+OROeWx/h 0B+BOsQ0/Iy4XMEpyOljCfqJEoRYizb0e4ED7FjKjxVqWow5XM5ZN+7PnY1Esq2EqUal 1RWcKM6r8qwZvuOpDOo2g8hdJbQvLy38w5TXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=RqpzoeSxr9W6quYdrgv13agVyIPXD5ckAg3nE5tDZmFY8U7y6e63JOzVXzU9kQoBcL ILYmQrzxvUq1q4sAcynExa4fhaQ2huqA7uYo/pToPfauMpph1+dyOTIQ9BpEQj1sPvxS xibEjBbvgG79PvYEIY8h1XUNq2YxLJLNwq4JA= Received: by 10.204.97.204 with SMTP id m12mr4345939bkn.185.1239471472573; Sat, 11 Apr 2009 10:37:52 -0700 (PDT) Received: from ?89.214.101.88? ([89.214.101.88]) by mx.google.com with ESMTPS id f31sm3020596fkf.16.2009.04.11.10.37.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 11 Apr 2009 10:37:52 -0700 (PDT) Message-Id: <1281775D-CD42-4430-9ED0-8472F10826EA@gmail.com> From: Rui Paulo To: Rui Paulo In-Reply-To: <200904111736.n3BHaBP7093616@svn.freebsd.org> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-8--828756432" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sat, 11 Apr 2009 18:37:28 +0100 References: <200904111736.n3BHaBP7093616@svn.freebsd.org> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190944 - in head/contrib/libpcap: . bpf/net pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:37:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-8--828756432 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 11 Apr 2009, at 18:36, Rui Paulo wrote: > Author: rpaulo > Date: Sat Apr 11 17:36:11 2009 > New Revision: 190944 > URL: http://svn.freebsd.org/changeset/base/190944 > > Log: > Revert previous commit that commented out some bpf functions. > Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). > This > is needed because some ports rely heavely on these arguments (some of > them even roll out their own implemenentations of bpf_dump). We can revisit this issue in the future if ports start complying with new libpcap headers. -- Rui Paulo --Apple-Mail-8--828756432 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkng1VgACgkQfD8M/ASTygIP4wCglqJpg/qjs3JkhuParNjWD0Tr IyUAn0mSvfaQXLtyxMvhsdeJJSXXI+o0 =badv -----END PGP SIGNATURE----- --Apple-Mail-8--828756432-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:44:07 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9ADA106564A for ; Sat, 11 Apr 2009 17:44:07 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 79AA08FC0A for ; Sat, 11 Apr 2009 17:44:07 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 7A42D8FC52 for ; Sat, 11 Apr 2009 21:44:06 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id E15BE8FC1D; Sat, 11 Apr 2009 21:44:02 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 7A0E73981A; Sat, 11 Apr 2009 21:44:10 +0400 (MSD) Date: Sat, 11 Apr 2009 21:44:10 +0400 From: Stanislav Sedov To: Norikatsu Shigemura Message-Id: <20090411214410.c53d0fb1.stas@FreeBSD.org> In-Reply-To: <20090412021841.673a200b.nork@FreeBSD.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Sat Apr 11 21:44:06 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 49e0d6e6967003214620014 Cc: svn-src-head@FreeBSD.org, vd@FreeBSD.org, David Schultz , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:44:08 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 12 Apr 2009 02:18:41 +0900 Norikatsu Shigemura mentioned: > On Sat, 11 Apr 2009 21:07:02 +0400 > Stanislav Sedov wrote: > > > Log: > > > GNU Pth has some fragile kludges that were broken by r189828. > > > I've discussed this with the Pth maintainer and no clear solution > > > has emerged on the ports side of things, so for now, hack around > > > the issue in signal.h. > > Can't we just put a patch in ports tree itself? What meant under 'no > > clean solution emerged'? I can prepare a patch, if needed. > > I think so, too. I have a quick hack patch. > > ports/devel/pth/files/patch-pth_p.h.in > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > --- pth_p.h.in.orig 2006-06-09 02:54:03.000000000 +0900 > +++ pth_p.h.in 2009-04-08 15:05:12.911807009 +0900 > @@ -32,7 +32,7 @@ > #include > #include > #include > -#include > +//#include > #include > #include > #include > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Or just drop the line. Vasil, what do you think about the possibility to commit this patch into the tree? I think we should have a workaround in ports tree (it is one of the things what it was designed for) than in the src tree. Better would be to implement a workaround upstream, though. I think something like #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) #include #endif where %%PTHREAD_CHANGE_VERSION%% would correspond to the __FreeBSD_version where the change was introduced, could be safely submitted upstream. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkng1uoACgkQK/VZk+smlYErSwCfbHR20spUIzAvATR9wvWvco5B RBkAn0Ailghm/yDk2kjImZLVnGXqiGAc =KTfP -----END PGP SIGNATURE----- !DSPAM:49e0d6e6967003214620014! From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 17:47:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92109106564A for ; Sat, 11 Apr 2009 17:47:42 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 42BFD8FC18 for ; Sat, 11 Apr 2009 17:47:42 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 4958F8FC51 for ; Sat, 11 Apr 2009 21:47:41 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id A25DC8FC1D; Sat, 11 Apr 2009 21:47:38 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id C714C3981A; Sat, 11 Apr 2009 21:47:46 +0400 (MSD) Date: Sat, 11 Apr 2009 21:47:46 +0400 From: Stanislav Sedov To: Rui Paulo Message-Id: <20090411214746.92c585da.stas@FreeBSD.org> In-Reply-To: <1281775D-CD42-4430-9ED0-8472F10826EA@gmail.com> References: <200904111736.n3BHaBP7093616@svn.freebsd.org> <1281775D-CD42-4430-9ED0-8472F10826EA@gmail.com> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Sat Apr 11 21:47:40 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49e0d7bc967002332039797 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r190944 - in head/contrib/libpcap: . bpf/net pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 17:47:42 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 11 Apr 2009 18:37:28 +0100 Rui Paulo mentioned: > > On 11 Apr 2009, at 18:36, Rui Paulo wrote: > > > Author: rpaulo > > Date: Sat Apr 11 17:36:11 2009 > > New Revision: 190944 > > URL: http://svn.freebsd.org/changeset/base/190944 > > > > Log: > > Revert previous commit that commented out some bpf functions. > > Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). > > This > > is needed because some ports rely heavely on these arguments (some of > > them even roll out their own implemenentations of bpf_dump). > > We can revisit this issue in the future if ports start complying with > new libpcap headers. > Have you analyzed how much ports depend on this? We can fix them locally if the number is not that high. We have already done that with usb and other changes. - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkng18IACgkQK/VZk+smlYHhwgCaAmP+CLt6ZrQZZG2Bb+1JhYsb 3O8Ani6vtivghQMfeQAutTyVjjobpFfL =iCge -----END PGP SIGNATURE----- !DSPAM:49e0d7bc967002332039797! From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 18:17:53 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDD11065673; Sat, 11 Apr 2009 18:17:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 56AFF8FC14; Sat, 11 Apr 2009 18:17:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3BIHPtH015376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Apr 2009 04:17:28 +1000 Date: Sun, 12 Apr 2009 04:17:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten In-Reply-To: <20090411165114.GV32098@hoeg.nl> Message-ID: <20090412033326.O4999@besplex.bde.org> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> <20090411165114.GV32098@hoeg.nl> 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, Steve Kargl Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 18:17:54 -0000 On Sat, 11 Apr 2009, Ed Schouten wrote: > * Steve Kargl wrote: >> I thought Christoph and bde were still hashing out the correctness >> of this patch. >> >> http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html > > Yes, so I've only committed a subset of changes of which there were no > major (or in my opinion valid) objections: > > - The construct that we use now works with many versions of GCC. There > is absolutely no reason why we should still try to support GCC <2.95. But should we ifdef for it? The old code did. Eleswhere we have ugly mazes of ifdefs that don't actually work since they are not ugly enough to be complete. > - There was also the discussion about __inline vs inline and __volatile > vs __volatile. As Christoph and I noticed, there is also a lot of > inconsistency between the usage of the keywords in the current sources > we have. Actually, current sources are remarkably consistent about this, at least in i386/include/*.h (header files are likely to be more carefully maintained so this is not very surprising). In i386/include/*.h, there are just the 2 inconsistencies that were pointed out in the discussion: before this commit: __volatile, etc.: - 71 lines match 'volatile' but not __volatile. All uses of plain volatile are for Standard C declarations - 126 lines match __volatile. All uses of __volatile are in `__asm __volatile' statements, except 2 in comments in in_cksum.h. BTW, these comments and probably their code are wrong. Christoph apparently hasn't looked at this or he would point it out more strongly than me :-). Some related bad code for checksums has been fixed by writing it as a single asm. - 0 lines match the Gnuish __asm__ or __volatile__. __asm, etc.: - 8 lines match asm but not __asm. Only 2 of these are in code (style bugs). The others are in comments or unrelated. Oops, one very bogus one is related: acpoca_machdep.h #define's asm as __asm, which I think only makes the style bugs in the code not be fatal. (Our non-use of plain asm is enforced except for bogusness like this by compiling with fairly strict CFLAGS so that plain asm is a syntax error.) - 18 lines match __asm but not '__asm __volatile'. I think __volatile is used excessively (we get most of the style consistency by blindly copying it for safety). - 1 of these lines is for the bogus #define mentioned above. - 10 of these lines are for correctly renaming labels. - 3 of these lines are in endian.h but 1 or 2 of them were recently replaced by C code due to work of Cristoph. I think not using __volatile for these is correct. - 4 of these lines are in profile.h for bogus code that has already been pointed out by Christoph. These lines need __volatile more than most, except it is insufficient. They need to be written using a single asm and more. __inline, etc.: - 6 lines match `inline' but not __inline. 4 are in comments and 2 give the inconsistencies pointed out in the discussion. - 183 lines match __inline. All of these match 'static __inline'. (These matches and the ones for `__asm __volatile' are literal, with no style bugs in the whitspace between the keywords.) - 0 lines match the Gnuish __inline__. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 18:23:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74DC6106566C; Sat, 11 Apr 2009 18:23:58 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f167.google.com (mail-fx0-f167.google.com [209.85.220.167]) by mx1.freebsd.org (Postfix) with ESMTP id 44B068FC12; Sat, 11 Apr 2009 18:23:57 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by fxm11 with SMTP id 11so1529013fxm.43 for ; Sat, 11 Apr 2009 11:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=ohFDUabKVBjKV08HLBLMpWWN+XPlRsJtSescKZkLO2s=; b=CiqnVONxnAej+VwXUlCOMXR5KpWjxdJc4IphgfjogK2O0wObRtaLJsZ2EnoBmilUfT 1dCro9qTKgep6ZaCzhdlUomTnoxo07sS3aHyTNmmPCHGDrE/muwvJlI+kFaOzc9s2VN1 zYpJfmtQFGKTO5fx8jMGyijV4gcf0Wsaj23Wc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=YWbyN2nl58gGUdTHa+tSBhlM9ZK0IvrLjoWJuGZUZme4MiT8Mto0uBFUsiWnHKh6zK 2+CY5U9x8OjyJYni37J43Z0PJwV7bO/rhQXRJEnoNfTbPDnJvyouSeqaW8Y1XUkJVas3 I1hQ725SvdXYqMTLngUHjYvtFmJ2kqweiARic= Received: by 10.204.31.207 with SMTP id z15mr4409623bkc.63.1239474236191; Sat, 11 Apr 2009 11:23:56 -0700 (PDT) Received: from ?89.214.101.88? ([89.214.101.88]) by mx.google.com with ESMTPS id z10sm3069075fka.18.2009.04.11.11.23.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 11 Apr 2009 11:23:55 -0700 (PDT) Message-Id: <7D536C42-7C2B-4E5F-A1AA-C2AF298370A6@gmail.com> From: Rui Paulo To: Stanislav Sedov In-Reply-To: <20090411214746.92c585da.stas@FreeBSD.org> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-9--825978146" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Sat, 11 Apr 2009 19:23:46 +0100 References: <200904111736.n3BHaBP7093616@svn.freebsd.org> <1281775D-CD42-4430-9ED0-8472F10826EA@gmail.com> <20090411214746.92c585da.stas@FreeBSD.org> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190944 - in head/contrib/libpcap: . bpf/net pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 18:23:59 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-9--825978146 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 11 Apr 2009, at 18:47, Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sat, 11 Apr 2009 18:37:28 +0100 > Rui Paulo mentioned: > >> >> On 11 Apr 2009, at 18:36, Rui Paulo wrote: >> >>> Author: rpaulo >>> Date: Sat Apr 11 17:36:11 2009 >>> New Revision: 190944 >>> URL: http://svn.freebsd.org/changeset/base/190944 >>> >>> Log: >>> Revert previous commit that commented out some bpf functions. >>> Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). >>> This >>> is needed because some ports rely heavely on these arguments (some >>> of >>> them even roll out their own implemenentations of bpf_dump). >> >> We can revisit this issue in the future if ports start complying with >> new libpcap headers. >> > > Have you analyzed how much ports depend on this? We can fix them > locally > if the number is not that high. We have already done that with usb > and other > changes. Around 10. See the end of http://wiki.freebsd.org/PortsBrokenOnCurrent . -- Rui Paulo --Apple-Mail-9--825978146 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkng4DIACgkQfD8M/ASTygIAxgCgvIiwKg5PK0vIIOV3Cxx2XR3v GiEAoNxweOaYi8sVFZpP6DWtXCIqJgQH =gfdd -----END PGP SIGNATURE----- --Apple-Mail-9--825978146-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 18:25:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690D01065670; Sat, 11 Apr 2009 18:25:11 +0000 (UTC) (envelope-from erwin@mail.droso.net) Received: from mail.droso.net (koala.ipv6.droso.net [IPv6:2001:6c8:6:c:20d:56ff:fe6f:f935]) by mx1.freebsd.org (Postfix) with ESMTP id E7BA68FC12; Sat, 11 Apr 2009 18:25:10 +0000 (UTC) (envelope-from erwin@mail.droso.net) Received: by mail.droso.net (Postfix, from userid 1001) id 3FC831CC2B; Sat, 11 Apr 2009 20:25:09 +0200 (CEST) Date: Sat, 11 Apr 2009 20:25:09 +0200 From: Erwin Lansing To: Stanislav Sedov Message-ID: <20090411182508.GL78186@droso.net> References: <200904111736.n3BHaBP7093616@svn.freebsd.org> <1281775D-CD42-4430-9ED0-8472F10826EA@gmail.com> <20090411214746.92c585da.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZqYDZSN9O5ZeiDmL" Content-Disposition: inline In-Reply-To: <20090411214746.92c585da.stas@FreeBSD.org> X-Operating-System: FreeBSD/i386 7.1-PRERELEASE User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Rui Paulo , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r190944 - in head/contrib/libpcap: . bpf/net pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 18:25:13 -0000 --ZqYDZSN9O5ZeiDmL Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 11, 2009 at 09:47:46PM +0400, Stanislav Sedov wrote: > On Sat, 11 Apr 2009 18:37:28 +0100 > Rui Paulo mentioned: >=20 > >=20 > > On 11 Apr 2009, at 18:36, Rui Paulo wrote: > >=20 > > > Author: rpaulo > > > Date: Sat Apr 11 17:36:11 2009 > > > New Revision: 190944 > > > URL: http://svn.freebsd.org/changeset/base/190944 > > > > > > Log: > > > Revert previous commit that commented out some bpf functions. > > > Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). = =20 > > > This > > > is needed because some ports rely heavely on these arguments (some of > > > them even roll out their own implemenentations of bpf_dump). > >=20 > > We can revisit this issue in the future if ports start complying with = =20 > > new libpcap headers. > >=20 >=20 > Have you analyzed how much ports depend on this? We can fix them locally > if the number is not that high. We have already done that with usb and ot= her > changes. >=20 http://wiki.freebsd.org/PortsBrokenOnCurrent near the bottom. About 8 ports, so definately fixable. How do other OSes handle this? it would certainly be a good thing to be consistent with them for portability and easier upstream integreation. Cheers, -erwin --=20 Erwin Lansing http://droso.org Prediction is very difficult erwin@FreeBSD.org especially about the future erwin@aauug.dk --ZqYDZSN9O5ZeiDmL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJ4OCEqy9aWxUlaZARAuGhAJ9WM3zbdnR4/EbZRnKXXMglDvdmrgCfShKX jlGTYprj+JLtE/MF0bMqlpk= =ypfT -----END PGP SIGNATURE----- --ZqYDZSN9O5ZeiDmL-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 19:30:37 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEF9C106567C for ; Sat, 11 Apr 2009 19:30:37 +0000 (UTC) (envelope-from cokane@cokane.org) Received: from mail-out2.fuse.net (mail-out2.fuse.net [216.68.8.171]) by mx1.freebsd.org (Postfix) with ESMTP id A180B8FC22 for ; Sat, 11 Apr 2009 19:30:37 +0000 (UTC) (envelope-from cokane@cokane.org) X-CNFS-Analysis: v=1.0 c=1 a=g2CHTHa2IaQA:10 a=6I5d2MoRAAAA:8 a=GSfbVeVPvHpJqZVy4VcA:9 a=8CPma2sQlQqFpa87IRsA:7 a=5ZlNOZUpwx5GaYLShau2ROsknWEA:4 a=LY0hPdMaydYA:10 a=SV7veod9ZcQA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: gwout2 smtp.mail=cokane@cokane.org; spf=neutral Received-SPF: neutral (gwout2: 74.215.227.9 is neither permitted nor denied by domain of cokane.org) Received: from [74.215.227.9] ([74.215.227.9:50655] helo=mail.cokane.org) by gwout2 (envelope-from ) (ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP id 33/21-25989-A3CE0E94; Sat, 11 Apr 2009 15:15:06 -0400 Received: from [10.128.128.2] (unknown [10.128.128.2]) by mail.cokane.org (Postfix) with ESMTPSA id A6A8C1143C; Sat, 11 Apr 2009 16:20:31 -0400 (EDT) From: Coleman Kane To: Stanislav Sedov In-Reply-To: <20090411214410.c53d0fb1.stas@FreeBSD.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090411214410.c53d0fb1.stas@FreeBSD.org> Content-Type: text/plain Date: Sat, 11 Apr 2009 15:13:15 -0400 Message-Id: <1239477195.2952.14.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Norikatsu Shigemura , vd@FreeBSD.org, svn-src-head@FreeBSD.org, David Schultz Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 19:30:38 -0000 On Sat, 2009-04-11 at 21:44 +0400, Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sun, 12 Apr 2009 02:18:41 +0900 > Norikatsu Shigemura mentioned: > > > On Sat, 11 Apr 2009 21:07:02 +0400 > > Stanislav Sedov wrote: > > > > Log: > > > > GNU Pth has some fragile kludges that were broken by r189828. > > > > I've discussed this with the Pth maintainer and no clear solution > > > > has emerged on the ports side of things, so for now, hack around > > > > the issue in signal.h. > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > clean solution emerged'? I can prepare a patch, if needed. > > > > I think so, too. I have a quick hack patch. > > > > ports/devel/pth/files/patch-pth_p.h.in > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > --- pth_p.h.in.orig 2006-06-09 02:54:03.000000000 +0900 > > +++ pth_p.h.in 2009-04-08 15:05:12.911807009 +0900 > > @@ -32,7 +32,7 @@ > > #include > > #include > > #include > > -#include > > +//#include > > #include > > #include > > #include > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > Or just drop the line. Vasil, what do you think about the possibility to > commit this patch into the tree? I think we should have a workaround in ports > tree (it is one of the things what it was designed for) than in the src tree. > Better would be to implement a workaround upstream, though. I think something > like > #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) > #include > #endif > where %%PTHREAD_CHANGE_VERSION%% would correspond to the __FreeBSD_version where > the change was introduced, could be safely submitted upstream. > > - -- > Stanislav Sedov > ST4096-RIPE I agree... if you've been discussing it with the Pth maintainer, then what are the chances that you can get Pth to change their behavior? Since Pth is supposed to be a support library that works on a large collection of platforms to provide a consistent multithreading and I/O API to users, I would imagine that their code should not #include when: a) They don't need it on our platform, and b) It breaks things on our platform. -- Coleman Kane From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 19:49:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC3B31065677; Sat, 11 Apr 2009 19:49:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id F24968FC18; Sat, 11 Apr 2009 19:49:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3BGwOdT021517; Sun, 12 Apr 2009 02:58:24 +1000 Received: from besplex.bde.org (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3BGwIJ6004295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Apr 2009 02:58:21 +1000 Date: Sun, 12 Apr 2009 02:58:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl In-Reply-To: <20090411163528.GC46526@troutmask.apl.washington.edu> Message-ID: <20090412025611.V4579@besplex.bde.org> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 19:49:26 -0000 On Sat, 11 Apr 2009, Steve Kargl wrote: > On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: >> Author: ed >> Date: Sat Apr 11 14:01:01 2009 >> New Revision: 190919 >> URL: http://svn.freebsd.org/changeset/base/190919 >> >> Log: >> Simplify in/out functions (for i386 and AMD64). >> >> Remove a hack to generate more efficient code for port numbers below >> 0x100, which has been obsolete for at least ten years, because GCC has >> an asm constraint to specify that. >> >> Submitted by: Christoph Mallon >> > > I thought Christoph and bde were still hashing out the correctness > of this patch. > > http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html Yes, but the patch was not committed verbatim and has most of the changes that I want. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 20:23:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 185B51065674; Sat, 11 Apr 2009 20:23:09 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 070438FC18; Sat, 11 Apr 2009 20:23:09 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BKN8fT097657; Sat, 11 Apr 2009 20:23:08 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BKN8si097656; Sat, 11 Apr 2009 20:23:08 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904112023.n3BKN8si097656@svn.freebsd.org> From: Alexander Kabaev Date: Sat, 11 Apr 2009 20:23: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: r190945 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 20:23:09 -0000 Author: kan Date: Sat Apr 11 20:23:08 2009 New Revision: 190945 URL: http://svn.freebsd.org/changeset/base/190945 Log: Fix v_cache_dd handling for negative entries. v_cache_dd pointer was not populated in parent directory if negative entry was being created, yet entry itself was added to the nc_neg list. It was possible for parent vnode to get discarded later, leaving negative entry pointing to now unused memory block. Reported by: dho Revewed by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Apr 11 17:36:11 2009 (r190944) +++ head/sys/kern/vfs_cache.c Sat Apr 11 20:23:08 2009 (r190945) @@ -678,14 +678,19 @@ cache_enter(dvp, vp, cnp) } } - /* - * See if we are trying to add .. entry, but some other lookup - * has populated v_cache_dd pointer already. - */ - if (flag == NCF_ISDOTDOT && dvp->v_cache_dd != NULL) { - CACHE_WUNLOCK(); - cache_free(ncp); - return; + if (flag == NCF_ISDOTDOT) { + /* + * See if we are trying to add .. entry, but some other lookup + * has populated v_cache_dd pointer already. + */ + if (dvp->v_cache_dd != NULL) { + CACHE_WUNLOCK(); + cache_free(ncp); + return; + } + KASSERT(vp == NULL || vp->v_type == VDIR, + ("wrong vnode type %p", vp)); + dvp->v_cache_dd = ncp; } numcache++; @@ -694,11 +699,7 @@ cache_enter(dvp, vp, cnp) if (cnp->cn_flags & ISWHITEOUT) ncp->nc_flag |= NCF_WHITE; } else if (vp->v_type == VDIR) { - if (flag == NCF_ISDOTDOT) { - KASSERT(dvp->v_cache_dd == NULL, - ("dangling v_cache_dd")); - dvp->v_cache_dd = ncp; - } else { + if (flag != NCF_ISDOTDOT) { if ((n2 = vp->v_cache_dd) != NULL && (n2->nc_flag & NCF_ISDOTDOT) != 0) cache_zap(n2); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 20:31:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF452106566B; Sat, 11 Apr 2009 20:31:01 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 21E658FC18; Sat, 11 Apr 2009 20:31:01 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qw-out-2122.google.com with SMTP id 9so1008261qwb.7 for ; Sat, 11 Apr 2009 13:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=AYRLX/VRzGk4JU1vnbGtZCj+EkPl//cAnDp8TGe+6hI=; b=rQcdfj4vGJSdlx1TdFmHoDwRKPEzObvKVws/rJ+stsLASM1XOZNYofPTkU9OLeGrjL VmqpqmoXJGK2pkLSDq04GqLoINuW1lljJkMBt/s/OTbFIpdLZeVYhLqhhcWjV9kW5kx+ s6EjunRuTf4sKPgziBMMijPcYZZT3jKRvyM/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=lypEPiyR7C6yJcRNgqTa1XD8Rgyr6F0TQ8yO7MjampEnrskIgBV3wSn7YxTEzhsTtO MK4uupnuKp5Fz3umhsM3lQwJ1vDvDDr6l32zrdkEACazppuCsxWcExtO4/etfeR6B6In XbtIbcGKJS2yELfqzCLuDY3IwuaW4qqKE9t6Q= Received: by 10.224.80.141 with SMTP id t13mr4943308qak.351.1239481860606; Sat, 11 Apr 2009 13:31:00 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 6sm1519691qwd.0.2009.04.11.13.30.59 (version=SSLv3 cipher=RC4-MD5); Sat, 11 Apr 2009 13:31:00 -0700 (PDT) Date: Sat, 11 Apr 2009 16:30:54 -0400 From: Alexander Kabaev To: Alexander Kabaev Message-ID: <20090411163054.11dd6d03@kan.dnsalias.net> In-Reply-To: <200904112023.n3BKN8si097656@svn.freebsd.org> References: <200904112023.n3BKN8si097656@svn.freebsd.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/qnj20v_l0W+E_GqR5iOSsAt"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190945 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 20:31:02 -0000 --Sig_/qnj20v_l0W+E_GqR5iOSsAt Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 11 Apr 2009 20:23:08 +0000 (UTC) Alexander Kabaev wrote: > Author: kan > Date: Sat Apr 11 20:23:08 2009 > New Revision: 190945 > URL: http://svn.freebsd.org/changeset/base/190945 >=20 > Log: > Fix v_cache_dd handling for negative entries. v_cache_dd pointer was > not populated in parent directory if negative entry was being > created, yet entry itself was added to the nc_neg list. It was > possible for parent vnode to get discarded later, leaving negative > entry pointing to now unused memory block. > =20 > Reported by: dho > Revewed by: kib >=20 > Modified: > head/sys/kern/vfs_cache.c >=20 Reported by: pho --=20 Alexander Kabaev --Sig_/qnj20v_l0W+E_GqR5iOSsAt Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iD8DBQFJ4P4CQ6z1jMm+XZYRApV2AKDfyUzM9FbEx5/jrbnahedt6OBahACgxCFv UpZB98/ym374J9JmB8dFomk= =84Rq -----END PGP SIGNATURE----- --Sig_/qnj20v_l0W+E_GqR5iOSsAt-- From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 20:43:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E55E106564A; Sat, 11 Apr 2009 20:43:42 +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 3C1C88FC16; Sat, 11 Apr 2009 20:43:42 +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 n3BKhfe1098260; Sat, 11 Apr 2009 20:43:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BKhfMG098259; Sat, 11 Apr 2009 20:43:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904112043.n3BKhfMG098259@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 11 Apr 2009 20:43: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: r190946 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 20:43:42 -0000 Author: nwhitehorn Date: Sat Apr 11 20:43:41 2009 New Revision: 190946 URL: http://svn.freebsd.org/changeset/base/190946 Log: Fix recognition of kernel-mode traps that pass through the KDB trap handler but do not actually invoke KDB. This includes recoverable machine checks encountered in kernel mode. This patch causes machines with Grackle host-PCI bridges to be able to correctly enumerate them again. MFC after: 3 days Modified: head/sys/powerpc/aim/trap_subr.S Modified: head/sys/powerpc/aim/trap_subr.S ============================================================================== --- head/sys/powerpc/aim/trap_subr.S Sat Apr 11 20:23:08 2009 (r190945) +++ head/sys/powerpc/aim/trap_subr.S Sat Apr 11 20:43:41 2009 (r190946) @@ -460,9 +460,7 @@ disitrap: stw %r30,(PC_DBSAVE +CPUSAVE_R30)(%r1) /* save r30 */ lwz %r31,(PC_DISISAVE+CPUSAVE_R31)(%r1) /* get r31 */ stw %r31,(PC_DBSAVE +CPUSAVE_R31)(%r1) /* save r31 */ - lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l - b dbtrap + bla dbtrap #endif /* XXX need stack probe here */ @@ -631,7 +629,7 @@ dbtrap: mflr %r28 mfcr %r29 lwz %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) - mtlr %r31 + mtsprg3 %r31 /* SPRG3 was clobbered by FRAME_LEAVE */ mfsprg1 %r1 b realtrap dbleave: From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 22:01:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C903A106566C; Sat, 11 Apr 2009 22:01:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B780F8FC0C; Sat, 11 Apr 2009 22:01:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BM1e3K000620; Sat, 11 Apr 2009 22:01:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BM1eSu000619; Sat, 11 Apr 2009 22:01:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904112201.n3BM1eSu000619@svn.freebsd.org> From: Robert Watson Date: Sat, 11 Apr 2009 22:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190947 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 22:01:41 -0000 Author: rwatson Date: Sat Apr 11 22:01:40 2009 New Revision: 190947 URL: http://svn.freebsd.org/changeset/base/190947 Log: Remove conditionally compiled time counter statistics; tools like DTrace, kernel profiling, etc, can provide this information without the overhead. MFC after: 3 days Suggested by: bde Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Apr 11 20:43:41 2009 (r190946) +++ head/sys/kern/kern_tc.c Sat Apr 11 22:01:40 2009 (r190947) @@ -103,24 +103,6 @@ static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, ×tepwarnings, 0, ""); -#ifdef TC_COUNTERS -#define TC_STATS(foo) \ - static u_int foo; \ - SYSCTL_UINT(_kern_timecounter, OID_AUTO, foo, CTLFLAG_RD, &foo, 0, "");\ - struct __hack - -TC_STATS(nbinuptime); TC_STATS(nnanouptime); TC_STATS(nmicrouptime); -TC_STATS(nbintime); TC_STATS(nnanotime); TC_STATS(nmicrotime); -TC_STATS(ngetbinuptime); TC_STATS(ngetnanouptime); TC_STATS(ngetmicrouptime); -TC_STATS(ngetbintime); TC_STATS(ngetnanotime); TC_STATS(ngetmicrotime); -TC_STATS(nsetclock); - -#define TC_COUNT(var) var++ -#undef TC_STATS -#else -#define TC_COUNT(var) /* nothing */ -#endif /* TC_COUNTERS */ - static void tc_windup(void); static void cpu_tick_calibrate(int); @@ -185,7 +167,6 @@ binuptime(struct bintime *bt) struct timehands *th; u_int gen; - TC_COUNT(nbinuptime); do { th = timehands; gen = th->th_generation; @@ -199,7 +180,6 @@ nanouptime(struct timespec *tsp) { struct bintime bt; - TC_COUNT(nnanouptime); binuptime(&bt); bintime2timespec(&bt, tsp); } @@ -209,7 +189,6 @@ microuptime(struct timeval *tvp) { struct bintime bt; - TC_COUNT(nmicrouptime); binuptime(&bt); bintime2timeval(&bt, tvp); } @@ -218,7 +197,6 @@ void bintime(struct bintime *bt) { - TC_COUNT(nbintime); binuptime(bt); bintime_add(bt, &boottimebin); } @@ -228,7 +206,6 @@ nanotime(struct timespec *tsp) { struct bintime bt; - TC_COUNT(nnanotime); bintime(&bt); bintime2timespec(&bt, tsp); } @@ -238,7 +215,6 @@ microtime(struct timeval *tvp) { struct bintime bt; - TC_COUNT(nmicrotime); bintime(&bt); bintime2timeval(&bt, tvp); } @@ -249,7 +225,6 @@ getbinuptime(struct bintime *bt) struct timehands *th; u_int gen; - TC_COUNT(ngetbinuptime); do { th = timehands; gen = th->th_generation; @@ -263,7 +238,6 @@ getnanouptime(struct timespec *tsp) struct timehands *th; u_int gen; - TC_COUNT(ngetnanouptime); do { th = timehands; gen = th->th_generation; @@ -277,7 +251,6 @@ getmicrouptime(struct timeval *tvp) struct timehands *th; u_int gen; - TC_COUNT(ngetmicrouptime); do { th = timehands; gen = th->th_generation; @@ -291,7 +264,6 @@ getbintime(struct bintime *bt) struct timehands *th; u_int gen; - TC_COUNT(ngetbintime); do { th = timehands; gen = th->th_generation; @@ -306,7 +278,6 @@ getnanotime(struct timespec *tsp) struct timehands *th; u_int gen; - TC_COUNT(ngetnanotime); do { th = timehands; gen = th->th_generation; @@ -320,7 +291,6 @@ getmicrotime(struct timeval *tvp) struct timehands *th; u_int gen; - TC_COUNT(ngetmicrotime); do { th = timehands; gen = th->th_generation; @@ -411,7 +381,6 @@ tc_setclock(struct timespec *ts) struct bintime bt, bt2; cpu_tick_calibrate(1); - TC_COUNT(nsetclock); nanotime(&tbef); timespec2bintime(ts, &bt); binuptime(&bt2); From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 22:07:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A88ED106566C; Sat, 11 Apr 2009 22:07:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 951908FC15; Sat, 11 Apr 2009 22:07:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BM7KVI000822; Sat, 11 Apr 2009 22:07:20 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BM7KX3000808; Sat, 11 Apr 2009 22:07:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904112207.n3BM7KX3000808@svn.freebsd.org> From: Robert Watson Date: Sat, 11 Apr 2009 22:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190948 - in head/sys: contrib/pf/net dev/cxgb/ulp/tom netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 22:07:21 -0000 Author: rwatson Date: Sat Apr 11 22:07:19 2009 New Revision: 190948 URL: http://svn.freebsd.org/changeset/base/190948 Log: Update stats in struct tcpstat using two new macros, TCPSTAT_ADD() and TCPSTAT_INC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/contrib/pf/net/pf.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/contrib/pf/net/pf.c Sat Apr 11 22:07:19 2009 (r190948) @@ -6291,7 +6291,7 @@ pf_route(struct mbuf **m, struct pf_rule } /* Update relevant hardware checksum stats for TCP/UDP */ if (m0->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT) - V_tcpstat.tcps_outhwcsum++; + TCPSTAT_INC(tcpstat.tcps_outhwcsum); else if (m0->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT) V_udpstat.udps_outhwcsum++; error = (*ifp->if_output)(ifp, m0, sintosa(dst), NULL); @@ -6635,7 +6635,7 @@ pf_check_proto_cksum(struct mbuf *m, int case IPPROTO_TCP: { INIT_VNET_INET(curvnet); - V_tcpstat.tcps_rcvbadsum++; + TCPSTAT_INC(tcps_rcvbadsum); break; } case IPPROTO_UDP: @@ -6741,7 +6741,7 @@ pf_check_proto_cksum(struct mbuf *m, int m->m_pkthdr.csum_flags |= flag_bad; switch (p) { case IPPROTO_TCP: - V_tcpstat.tcps_rcvbadsum++; + TCPSTAT_INC(tcps_rcvbadsum); break; case IPPROTO_UDP: V_udpstat.udps_badsum++; Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Apr 11 22:07:19 2009 (r190948) @@ -3829,7 +3829,7 @@ socket_act_establish(struct socket *so, #endif toep->tp_state = tp->t_state; - V_tcpstat.tcps_connects++; + TCPSTAT_INC(tcps_connects); } Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_hostcache.c Sat Apr 11 22:07:19 2009 (r190948) @@ -341,7 +341,7 @@ tcp_hc_insert(struct in_conninfo *inc) TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q); V_tcp_hostcache.hashbase[hash].hch_length--; V_tcp_hostcache.cache_count--; - V_tcpstat.tcps_hc_bucketoverflow++; + TCPSTAT_INC(tcps_hc_bucketoverflow); #if 0 uma_zfree(V_tcp_hostcache.zone, hc_entry); #endif @@ -373,7 +373,7 @@ tcp_hc_insert(struct in_conninfo *inc) TAILQ_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); V_tcp_hostcache.hashbase[hash].hch_length++; V_tcp_hostcache.cache_count++; - V_tcpstat.tcps_hc_added++; + TCPSTAT_INC(tcps_hc_added); return hc_entry; } @@ -508,7 +508,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_rtt = (hc_entry->rmx_rtt + hcml->rmx_rtt) / 2; - V_tcpstat.tcps_cachedrtt++; + TCPSTAT_INC(tcps_cachedrtt); } if (hcml->rmx_rttvar != 0) { if (hc_entry->rmx_rttvar == 0) @@ -516,7 +516,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_rttvar = (hc_entry->rmx_rttvar + hcml->rmx_rttvar) / 2; - V_tcpstat.tcps_cachedrttvar++; + TCPSTAT_INC(tcps_cachedrttvar); } if (hcml->rmx_ssthresh != 0) { if (hc_entry->rmx_ssthresh == 0) @@ -524,7 +524,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_ssthresh = (hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2; - V_tcpstat.tcps_cachedssthresh++; + TCPSTAT_INC(tcps_cachedssthresh); } if (hcml->rmx_bandwidth != 0) { if (hc_entry->rmx_bandwidth == 0) @@ -532,7 +532,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_bandwidth = (hc_entry->rmx_bandwidth + hcml->rmx_bandwidth) / 2; - /* V_tcpstat.tcps_cachedbandwidth++; */ + /* TCPSTAT_INC(tcps_cachedbandwidth); */ } if (hcml->rmx_cwnd != 0) { if (hc_entry->rmx_cwnd == 0) @@ -540,7 +540,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_cwnd = (hc_entry->rmx_cwnd + hcml->rmx_cwnd) / 2; - /* V_tcpstat.tcps_cachedcwnd++; */ + /* TCPSTAT_INC(tcps_cachedcwnd); */ } if (hcml->rmx_sendpipe != 0) { if (hc_entry->rmx_sendpipe == 0) @@ -548,7 +548,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_sendpipe = (hc_entry->rmx_sendpipe + hcml->rmx_sendpipe) /2; - /* V_tcpstat.tcps_cachedsendpipe++; */ + /* TCPSTAT_INC(tcps_cachedsendpipe); */ } if (hcml->rmx_recvpipe != 0) { if (hc_entry->rmx_recvpipe == 0) @@ -556,7 +556,7 @@ tcp_hc_update(struct in_conninfo *inc, s else hc_entry->rmx_recvpipe = (hc_entry->rmx_recvpipe + hcml->rmx_recvpipe) /2; - /* V_tcpstat.tcps_cachedrecvpipe++; */ + /* TCPSTAT_INC(tcps_cachedrecvpipe); */ } TAILQ_REMOVE(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_input.c Sat Apr 11 22:07:19 2009 (r190948) @@ -352,7 +352,7 @@ tcp_input(struct mbuf *m, int off0) #endif to.to_flags = 0; - V_tcpstat.tcps_rcvtotal++; + TCPSTAT_INC(tcps_rcvtotal); if (isipv6) { #ifdef INET6 @@ -360,7 +360,7 @@ tcp_input(struct mbuf *m, int off0) ip6 = mtod(m, struct ip6_hdr *); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; if (in6_cksum(m, IPPROTO_TCP, off0, tlen)) { - V_tcpstat.tcps_rcvbadsum++; + TCPSTAT_INC(tcps_rcvbadsum); goto drop; } th = (struct tcphdr *)((caddr_t)ip6 + off0); @@ -392,7 +392,7 @@ tcp_input(struct mbuf *m, int off0) if (m->m_len < sizeof (struct tcpiphdr)) { if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == NULL) { - V_tcpstat.tcps_rcvshort++; + TCPSTAT_INC(tcps_rcvshort); return; } } @@ -426,7 +426,7 @@ tcp_input(struct mbuf *m, int off0) th->th_sum = in_cksum(m, len); } if (th->th_sum) { - V_tcpstat.tcps_rcvbadsum++; + TCPSTAT_INC(tcps_rcvbadsum); goto drop; } /* Re-initialization for later version check */ @@ -446,7 +446,7 @@ tcp_input(struct mbuf *m, int off0) */ off = th->th_off << 2; if (off < sizeof (struct tcphdr) || off > tlen) { - V_tcpstat.tcps_rcvbadoff++; + TCPSTAT_INC(tcps_rcvbadoff); goto drop; } tlen -= off; /* tlen is used instead of ti->ti_len */ @@ -461,7 +461,7 @@ tcp_input(struct mbuf *m, int off0) if (m->m_len < sizeof(struct ip) + off) { if ((m = m_pullup(m, sizeof (struct ip) + off)) == NULL) { - V_tcpstat.tcps_rcvshort++; + TCPSTAT_INC(tcps_rcvshort); return; } ip = mtod(m, struct ip *); @@ -860,7 +860,7 @@ findpcb: log(LOG_DEBUG, "%s; %s: Listen socket: " "SYN is missing, segment ignored\n", s, __func__); - V_tcpstat.tcps_badsyn++; + TCPSTAT_INC(tcps_badsyn); goto dropunlock; } /* @@ -872,7 +872,7 @@ findpcb: "SYN|ACK invalid, segment rejected\n", s, __func__); syncache_badack(&inc); /* XXX: Not needed! */ - V_tcpstat.tcps_badsyn++; + TCPSTAT_INC(tcps_badsyn); rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } @@ -892,7 +892,7 @@ findpcb: log(LOG_DEBUG, "%s; %s: Listen socket: " "SYN|FIN segment ignored (based on " "sysctl setting)\n", s, __func__); - V_tcpstat.tcps_badsyn++; + TCPSTAT_INC(tcps_badsyn); goto dropunlock; } /* @@ -1155,13 +1155,13 @@ tcp_do_segment(struct mbuf *m, struct tc switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags |= TF_ECN_SND_ECE; - V_tcpstat.tcps_ecn_ce++; + TCPSTAT_INC(tcps_ecn_ce); break; case IPTOS_ECN_ECT0: - V_tcpstat.tcps_ecn_ect0++; + TCPSTAT_INC(tcps_ecn_ect0); break; case IPTOS_ECN_ECT1: - V_tcpstat.tcps_ecn_ect1++; + TCPSTAT_INC(tcps_ecn_ect1); break; } @@ -1174,7 +1174,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((thflags & TH_ECE) && SEQ_LEQ(th->th_ack, tp->snd_recover)) { - V_tcpstat.tcps_ecn_rcwnd++; + TCPSTAT_INC(tcps_ecn_rcwnd); tcp_congestion_exp(tp); } } @@ -1291,14 +1291,14 @@ tcp_do_segment(struct mbuf *m, struct tc __func__, ti_locked); ti_locked = TI_UNLOCKED; - ++V_tcpstat.tcps_predack; + TCPSTAT_INC(tcps_predack); /* * "bad retransmit" recovery. */ if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) { - ++V_tcpstat.tcps_sndrexmitbad; + TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = tp->snd_ssthresh_prev; @@ -1334,8 +1334,8 @@ tcp_do_segment(struct mbuf *m, struct tc } tcp_xmit_bandwidth_limit(tp, th->th_ack); acked = th->th_ack - tp->snd_una; - V_tcpstat.tcps_rcvackpack++; - V_tcpstat.tcps_rcvackbyte += acked; + TCPSTAT_INC(tcps_rcvackpack); + TCPSTAT_ADD(tcps_rcvackbyte, acked); sbdrop(&so->so_snd, acked); if (SEQ_GT(tp->snd_una, tp->snd_recover) && SEQ_LEQ(th->th_ack, tp->snd_recover)) @@ -1396,7 +1396,7 @@ tcp_do_segment(struct mbuf *m, struct tc /* Clean receiver SACK report if present */ if ((tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks) tcp_clean_sackreport(tp); - ++V_tcpstat.tcps_preddat; + TCPSTAT_INC(tcps_preddat); tp->rcv_nxt += tlen; /* * Pull snd_wl1 up to prevent seq wrap relative to @@ -1408,8 +1408,8 @@ tcp_do_segment(struct mbuf *m, struct tc * rcv_nxt. */ tp->rcv_up = tp->rcv_nxt; - V_tcpstat.tcps_rcvpack++; - V_tcpstat.tcps_rcvbyte += tlen; + TCPSTAT_INC(tcps_rcvpack); + TCPSTAT_ADD(tcps_rcvbyte, tlen); ND6_HINT(tp); /* Some progress has been made */ #ifdef TCPDEBUG if (so->so_options & SO_DEBUG) @@ -1559,7 +1559,7 @@ tcp_do_segment(struct mbuf *m, struct tc tp->irs = th->th_seq; tcp_rcvseqinit(tp); if (thflags & TH_ACK) { - V_tcpstat.tcps_connects++; + TCPSTAT_INC(tcps_connects); soisconnected(so); #ifdef MAC SOCK_LOCK(so); @@ -1585,7 +1585,7 @@ tcp_do_segment(struct mbuf *m, struct tc if ((thflags & TH_ECE) && V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; - V_tcpstat.tcps_ecn_shs++; + TCPSTAT_INC(tcps_ecn_shs); } /* @@ -1635,8 +1635,8 @@ tcp_do_segment(struct mbuf *m, struct tc m_adj(m, -todrop); tlen = tp->rcv_wnd; thflags &= ~TH_FIN; - V_tcpstat.tcps_rcvpackafterwin++; - V_tcpstat.tcps_rcvbyteafterwin += todrop; + TCPSTAT_INC(tcps_rcvpackafterwin); + TCPSTAT_ADD(tcps_rcvbyteafterwin, todrop); } tp->snd_wl1 = th->th_seq - 1; tp->rcv_up = th->th_seq; @@ -1740,7 +1740,7 @@ tcp_do_segment(struct mbuf *m, struct tc SEQ_LEQ(th->th_seq, tp->rcv_nxt + 1)) && !(SEQ_GEQ(th->th_seq, tp->last_ack_sent - 1) && SEQ_LEQ(th->th_seq, tp->last_ack_sent + 1))) { - V_tcpstat.tcps_badrst++; + TCPSTAT_INC(tcps_badrst); goto drop; } /* FALLTHROUGH */ @@ -1755,7 +1755,7 @@ tcp_do_segment(struct mbuf *m, struct tc INP_INFO_WLOCK_ASSERT(&V_tcbinfo); tp->t_state = TCPS_CLOSED; - V_tcpstat.tcps_drops++; + TCPSTAT_INC(tcps_drops); tp = tcp_close(tp); break; @@ -1795,9 +1795,9 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->ts_recent = 0; } else { - V_tcpstat.tcps_rcvduppack++; - V_tcpstat.tcps_rcvdupbyte += tlen; - V_tcpstat.tcps_pawsdrop++; + TCPSTAT_INC(tcps_rcvduppack); + TCPSTAT_ADD(tcps_rcvdupbyte, tlen); + TCPSTAT_INC(tcps_pawsdrop); if (tlen) goto dropafterack; goto drop; @@ -1845,11 +1845,11 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->t_flags |= TF_ACKNOW; todrop = tlen; - V_tcpstat.tcps_rcvduppack++; - V_tcpstat.tcps_rcvdupbyte += todrop; + TCPSTAT_INC(tcps_rcvduppack); + TCPSTAT_ADD(tcps_rcvdupbyte, todrop); } else { - V_tcpstat.tcps_rcvpartduppack++; - V_tcpstat.tcps_rcvpartdupbyte += todrop; + TCPSTAT_INC(tcps_rcvpartduppack); + TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); } drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; @@ -1881,7 +1881,7 @@ tcp_do_segment(struct mbuf *m, struct tc free(s, M_TCPLOG); } tp = tcp_close(tp); - V_tcpstat.tcps_rcvafterclose++; + TCPSTAT_INC(tcps_rcvafterclose); rstreason = BANDLIM_UNLIMITED; goto dropwithreset; } @@ -1892,9 +1892,9 @@ tcp_do_segment(struct mbuf *m, struct tc */ todrop = (th->th_seq + tlen) - (tp->rcv_nxt + tp->rcv_wnd); if (todrop > 0) { - V_tcpstat.tcps_rcvpackafterwin++; + TCPSTAT_INC(tcps_rcvpackafterwin); if (todrop >= tlen) { - V_tcpstat.tcps_rcvbyteafterwin += tlen; + TCPSTAT_ADD(tcps_rcvbyteafterwin, tlen); /* * If window is closed can only take segments at * window edge, and have to drop data and PUSH from @@ -1904,11 +1904,11 @@ tcp_do_segment(struct mbuf *m, struct tc */ if (tp->rcv_wnd == 0 && th->th_seq == tp->rcv_nxt) { tp->t_flags |= TF_ACKNOW; - V_tcpstat.tcps_rcvwinprobe++; + TCPSTAT_INC(tcps_rcvwinprobe); } else goto dropafterack; } else - V_tcpstat.tcps_rcvbyteafterwin += todrop; + TCPSTAT_ADD(tcps_rcvbyteafterwin, todrop); m_adj(m, -todrop); tlen -= todrop; thflags &= ~(TH_PUSH|TH_FIN); @@ -1981,7 +1981,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ case TCPS_SYN_RECEIVED: - V_tcpstat.tcps_connects++; + TCPSTAT_INC(tcps_connects); soisconnected(so); /* Do window scaling? */ if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == @@ -2027,7 +2027,7 @@ tcp_do_segment(struct mbuf *m, struct tc case TCPS_CLOSING: case TCPS_LAST_ACK: if (SEQ_GT(th->th_ack, tp->snd_max)) { - V_tcpstat.tcps_rcvacktoomuch++; + TCPSTAT_INC(tcps_rcvacktoomuch); goto dropafterack; } if ((tp->t_flags & TF_SACK_PERMIT) && @@ -2036,7 +2036,7 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_sack_doack(tp, &to, th->th_ack); if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { - V_tcpstat.tcps_rcvdupack++; + TCPSTAT_INC(tcps_rcvdupack); /* * If we have outstanding data (other than * a window probe), this is a completely @@ -2119,7 +2119,8 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; if (tp->t_flags & TF_SACK_PERMIT) { - V_tcpstat.tcps_sack_recovery_episode++; + TCPSTAT_INC( + tcps_sack_recovery_episode); tp->sack_newdata = tp->snd_nxt; tp->snd_cwnd = tp->t_maxseg; (void) tcp_output(tp); @@ -2241,8 +2242,8 @@ process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); acked = th->th_ack - tp->snd_una; - V_tcpstat.tcps_rcvackpack++; - V_tcpstat.tcps_rcvackbyte += acked; + TCPSTAT_INC(tcps_rcvackpack); + TCPSTAT_ADD(tcps_rcvackbyte, acked); /* * If we just performed our first retransmit, and the ACK @@ -2252,7 +2253,7 @@ process_ACK: * we left off. */ if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) { - ++V_tcpstat.tcps_sndrexmitbad; + TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = tp->snd_ssthresh_prev; tp->snd_recover = tp->snd_recover_prev; @@ -2476,7 +2477,7 @@ step6: /* keep track of pure window updates */ if (tlen == 0 && tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) - V_tcpstat.tcps_rcvwinupd++; + TCPSTAT_INC(tcps_rcvwinupd); tp->snd_wnd = tiwin; tp->snd_wl1 = th->th_seq; tp->snd_wl2 = th->th_ack; @@ -2586,8 +2587,8 @@ dodata: /* XXX */ tp->t_flags |= TF_ACKNOW; tp->rcv_nxt += tlen; thflags = th->th_flags & TH_FIN; - V_tcpstat.tcps_rcvpack++; - V_tcpstat.tcps_rcvbyte += tlen; + TCPSTAT_INC(tcps_rcvpack); + TCPSTAT_ADD(tcps_rcvbyte, tlen); ND6_HINT(tp); SOCKBUF_LOCK(&so->so_rcv); if (so->so_rcv.sb_state & SBS_CANTRCVMORE) @@ -2940,7 +2941,7 @@ tcp_dooptions(struct tcpopt *to, u_char to->to_flags |= TOF_SACK; to->to_nsacks = (optlen - 2) / TCPOLEN_SACK; to->to_sacks = cp + 2; - V_tcpstat.tcps_sack_rcv_blocks++; + TCPSTAT_INC(tcps_sack_rcv_blocks); break; default: continue; @@ -2995,7 +2996,7 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt INP_WLOCK_ASSERT(tp->t_inpcb); - V_tcpstat.tcps_rttupdated++; + TCPSTAT_INC(tcps_rttupdated); tp->t_rttupdated++; if (tp->t_srtt != 0) { /* @@ -3317,10 +3318,10 @@ tcp_mss(struct tcpcb *tp, int offer) if (tp->t_srtt == 0 && (rtt = metrics.rmx_rtt)) { tp->t_srtt = rtt; tp->t_rttbest = tp->t_srtt + TCP_RTT_SCALE; - V_tcpstat.tcps_usedrtt++; + TCPSTAT_INC(tcps_usedrtt); if (metrics.rmx_rttvar) { tp->t_rttvar = metrics.rmx_rttvar; - V_tcpstat.tcps_usedrttvar++; + TCPSTAT_INC(tcps_usedrttvar); } else { /* default variation is +- 1 rtt */ tp->t_rttvar = @@ -3338,7 +3339,7 @@ tcp_mss(struct tcpcb *tp, int offer) * threshold to no less than 2*mss. */ tp->snd_ssthresh = max(2 * mss, metrics.rmx_ssthresh); - V_tcpstat.tcps_usedssthresh++; + TCPSTAT_INC(tcps_usedssthresh); } if (metrics.rmx_bandwidth) tp->snd_bandwidth = metrics.rmx_bandwidth; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_output.c Sat Apr 11 22:07:19 2009 (r190948) @@ -264,9 +264,9 @@ again: if (len > 0) { sack_rxmit = 1; sendalot = 1; - V_tcpstat.tcps_sack_rexmits++; - V_tcpstat.tcps_sack_rexmit_bytes += - min(len, tp->t_maxseg); + TCPSTAT_INC(tcps_sack_rexmits); + TCPSTAT_ADD(tcps_sack_rexmit_bytes, + min(len, tp->t_maxseg)); } } after_sack_rexmit: @@ -768,13 +768,13 @@ send: u_int moff; if ((tp->t_flags & TF_FORCEDATA) && len == 1) - V_tcpstat.tcps_sndprobe++; + TCPSTAT_INC(tcps_sndprobe); else if (SEQ_LT(tp->snd_nxt, tp->snd_max) || sack_rxmit) { - V_tcpstat.tcps_sndrexmitpack++; - V_tcpstat.tcps_sndrexmitbyte += len; + TCPSTAT_INC(tcps_sndrexmitpack); + TCPSTAT_ADD(tcps_sndrexmitbyte, len); } else { - V_tcpstat.tcps_sndpack++; - V_tcpstat.tcps_sndbyte += len; + TCPSTAT_INC(tcps_sndpack); + TCPSTAT_ADD(tcps_sndbyte, len); } #ifdef notyet if ((m = m_copypack(so->so_snd.sb_mb, off, @@ -841,13 +841,13 @@ send: } else { SOCKBUF_UNLOCK(&so->so_snd); if (tp->t_flags & TF_ACKNOW) - V_tcpstat.tcps_sndacks++; + TCPSTAT_INC(tcps_sndacks); else if (flags & (TH_SYN|TH_FIN|TH_RST)) - V_tcpstat.tcps_sndctrl++; + TCPSTAT_INC(tcps_sndctrl); else if (SEQ_GT(tp->snd_up, tp->snd_una)) - V_tcpstat.tcps_sndurg++; + TCPSTAT_INC(tcps_sndurg); else - V_tcpstat.tcps_sndwinup++; + TCPSTAT_INC(tcps_sndwinup); MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { @@ -919,7 +919,7 @@ send: else #endif ip->ip_tos |= IPTOS_ECN_ECT0; - V_tcpstat.tcps_ecn_ect0++; + TCPSTAT_INC(tcps_ecn_ect0); } /* @@ -1085,7 +1085,7 @@ send: if (tp->t_rtttime == 0) { tp->t_rtttime = ticks; tp->t_rtseq = startseq; - V_tcpstat.tcps_segstimed++; + TCPSTAT_INC(tcps_segstimed); } } @@ -1262,7 +1262,7 @@ out: return (error); } } - V_tcpstat.tcps_sndtotal++; + TCPSTAT_INC(tcps_sndtotal); /* * Data sent (as far as we can tell). @@ -1437,7 +1437,7 @@ tcp_addoptions(struct tcpopt *to, u_char optlen += TCPOLEN_SACK; sack++; } - V_tcpstat.tcps_sack_send_blocks++; + TCPSTAT_INC(tcps_sack_send_blocks); break; } default: Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_reass.c Sat Apr 11 22:07:19 2009 (r190948) @@ -172,7 +172,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd (V_tcp_reass_qsize + 1 >= V_tcp_reass_maxseg || tp->t_segqlen >= V_tcp_reass_maxqlen)) { V_tcp_reass_overflows++; - V_tcpstat.tcps_rcvmemdrop++; + TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; return (0); @@ -184,7 +184,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd */ te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { - V_tcpstat.tcps_rcvmemdrop++; + TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; return (0); @@ -212,8 +212,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd i = p->tqe_th->th_seq + p->tqe_len - th->th_seq; if (i > 0) { if (i >= *tlenp) { - V_tcpstat.tcps_rcvduppack++; - V_tcpstat.tcps_rcvdupbyte += *tlenp; + TCPSTAT_INC(tcps_rcvduppack); + TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp); m_freem(m); uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; @@ -231,8 +231,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd th->th_seq += i; } } - V_tcpstat.tcps_rcvoopack++; - V_tcpstat.tcps_rcvoobyte += *tlenp; + TCPSTAT_INC(tcps_rcvoopack); + TCPSTAT_ADD(tcps_rcvoobyte, *tlenp); /* * While we overlap succeeding segments trim them or, Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_sack.c Sat Apr 11 22:07:19 2009 (r190948) @@ -260,7 +260,7 @@ tcp_sackhole_alloc(struct tcpcb *tp, tcp if (tp->snd_numholes >= V_tcp_sack_maxholes || V_tcp_sack_globalholes >= V_tcp_sack_globalmaxholes) { - V_tcpstat.tcps_sack_sboverflow++; + TCPSTAT_INC(tcps_sack_sboverflow); return NULL; } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_subr.c Sat Apr 11 22:07:19 2009 (r190948) @@ -764,9 +764,9 @@ tcp_drop(struct tcpcb *tp, int errno) if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_state = TCPS_CLOSED; (void) tcp_output_reset(tp); - V_tcpstat.tcps_drops++; + TCPSTAT_INC(tcps_drops); } else - V_tcpstat.tcps_conndrops++; + TCPSTAT_INC(tcps_conndrops); if (errno == ETIMEDOUT && tp->t_softerror) errno = tp->t_softerror; so->so_error = errno; @@ -889,7 +889,7 @@ tcp_close(struct tcpcb *tp) if (tp->t_state == TCPS_LISTEN) tcp_offload_listen_close(tp); in_pcbdrop(inp); - V_tcpstat.tcps_closed++; + TCPSTAT_INC(tcps_closed); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; soisdisconnected(so); @@ -1638,7 +1638,7 @@ tcp_mtudisc(struct inpcb *inp, int errno tp->t_maxseg = so->so_snd.sb_hiwat; SOCKBUF_UNLOCK(&so->so_snd); - V_tcpstat.tcps_mturesent++; + TCPSTAT_INC(tcps_mturesent); tp->t_rtttime = 0; tp->snd_nxt = tp->snd_una; tcp_free_sackholes(tp); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_syncache.c Sat Apr 11 22:07:19 2009 (r190948) @@ -294,7 +294,7 @@ syncache_insert(struct syncache *sc, str ("sch->sch_length incorrect")); sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head); syncache_drop(sc2, sch); - V_tcpstat.tcps_sc_bucketoverflow++; + TCPSTAT_INC(tcps_sc_bucketoverflow); } /* Put it into the bucket. */ @@ -309,7 +309,7 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); V_tcp_syncache.cache_count++; - V_tcpstat.tcps_sc_added++; + TCPSTAT_INC(tcps_sc_added); } /* @@ -398,7 +398,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } syncache_drop(sc, sch); - V_tcpstat.tcps_sc_stale++; + TCPSTAT_INC(tcps_sc_stale); continue; } if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { @@ -409,7 +409,7 @@ syncache_timer(void *xsch) } (void) syncache_respond(sc); - V_tcpstat.tcps_sc_retransmitted++; + TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } if (!TAILQ_EMPTY(&(sch)->sch_bucket)) @@ -489,7 +489,7 @@ syncache_chkrst(struct in_conninfo *inc, if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: Spurious RST with ACK, SYN or " "FIN flag set, segment ignored\n", s, __func__); - V_tcpstat.tcps_badrst++; + TCPSTAT_INC(tcps_badrst); goto done; } @@ -506,7 +506,7 @@ syncache_chkrst(struct in_conninfo *inc, log(LOG_DEBUG, "%s; %s: Spurious RST without matching " "syncache entry (possibly syncookie only), " "segment ignored\n", s, __func__); - V_tcpstat.tcps_badrst++; + TCPSTAT_INC(tcps_badrst); goto done; } @@ -530,13 +530,13 @@ syncache_chkrst(struct in_conninfo *inc, log(LOG_DEBUG, "%s; %s: Our SYN|ACK was rejected, " "connection attempt aborted by remote endpoint\n", s, __func__); - V_tcpstat.tcps_sc_reset++; + TCPSTAT_INC(tcps_sc_reset); } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: RST with invalid SEQ %u != " "IRS %u (+WND %u), segment ignored\n", s, __func__, th->th_seq, sc->sc_irs, sc->sc_wnd); - V_tcpstat.tcps_badrst++; + TCPSTAT_INC(tcps_badrst); } done: @@ -556,7 +556,7 @@ syncache_badack(struct in_conninfo *inc) SCH_LOCK_ASSERT(sch); if (sc != NULL) { syncache_drop(sc, sch); - V_tcpstat.tcps_sc_badack++; + TCPSTAT_INC(tcps_sc_badack); } SCH_UNLOCK(sch); } @@ -590,7 +590,7 @@ syncache_unreach(struct in_conninfo *inc goto done; } syncache_drop(sc, sch); - V_tcpstat.tcps_sc_unreach++; + TCPSTAT_INC(tcps_sc_unreach); done: SCH_UNLOCK(sch); } @@ -622,7 +622,7 @@ syncache_socket(struct syncache *sc, str * have the peer retransmit its SYN again after its * RTO and try again. */ - V_tcpstat.tcps_listendrop++; + TCPSTAT_INC(tcps_listendrop); if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Socket create failed " "due to limits or memory shortage\n", @@ -792,7 +792,7 @@ syncache_socket(struct syncache *sc, str INP_WUNLOCK(inp); - V_tcpstat.tcps_accepts++; + TCPSTAT_INC(tcps_accepts); return (so); abort: @@ -912,9 +912,9 @@ syncache_expand(struct in_conninfo *inc, *lsop = syncache_socket(sc, *lsop, m); if (*lsop == NULL) - V_tcpstat.tcps_sc_aborted++; + TCPSTAT_INC(tcps_sc_aborted); else - V_tcpstat.tcps_sc_completed++; + TCPSTAT_INC(tcps_sc_completed); /* how do we find the inp for the new socket? */ if (sc != &scs) @@ -1046,7 +1046,7 @@ _syncache_add(struct in_conninfo *inc, s sc->sc_tu->tu_syncache_event(TOE_SC_ENTRY_PRESENT, sc->sc_toepcb); #endif - V_tcpstat.tcps_sc_dupsyn++; + TCPSTAT_INC(tcps_sc_dupsyn); if (ipopts) { /* * If we were remembering a previous source route, @@ -1081,8 +1081,8 @@ _syncache_add(struct in_conninfo *inc, s if (!TOEPCB_ISSET(sc) && syncache_respond(sc) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); - V_tcpstat.tcps_sndacks++; - V_tcpstat.tcps_sndtotal++; + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); } SCH_UNLOCK(sch); goto done; @@ -1095,7 +1095,7 @@ _syncache_add(struct in_conninfo *inc, s * Treat this as if the cache was full; drop the oldest * entry and insert the new one. */ - V_tcpstat.tcps_sc_zonefail++; + TCPSTAT_INC(tcps_sc_zonefail); if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) syncache_drop(sc, sch); sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); @@ -1233,12 +1233,12 @@ _syncache_add(struct in_conninfo *inc, s syncache_free(sc); else if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ - V_tcpstat.tcps_sndacks++; - V_tcpstat.tcps_sndtotal++; + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); } else { if (sc != &scs) syncache_free(sc); - V_tcpstat.tcps_sc_dropped++; + TCPSTAT_INC(tcps_sc_dropped); } done: @@ -1351,7 +1351,7 @@ syncache_respond(struct syncache *sc) if (sc->sc_flags & SCF_ECN) { th->th_flags |= TH_ECE; - V_tcpstat.tcps_ecn_shs++; + TCPSTAT_INC(tcps_ecn_shs); } /* Tack on the TCP options. */ @@ -1584,7 +1584,7 @@ syncookie_generate(struct syncache_head sc->sc_tsoff = data - ticks; /* after XOR */ } - V_tcpstat.tcps_sc_sendcookie++; + TCPSTAT_INC(tcps_sc_sendcookie); } static struct syncache * @@ -1687,7 +1687,7 @@ syncookie_lookup(struct in_conninfo *inc sc->sc_rxmits = 0; sc->sc_peer_mss = tcp_sc_msstab[mss]; - V_tcpstat.tcps_sc_recvcookie++; + TCPSTAT_INC(tcps_sc_recvcookie); return (sc); } Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_timer.c Sat Apr 11 22:07:19 2009 (r190948) @@ -191,7 +191,7 @@ tcp_timer_delack(void *xtp) callout_deactivate(&tp->t_timers->tt_delack); tp->t_flags |= TF_ACKNOW; - V_tcpstat.tcps_delack++; + TCPSTAT_INC(tcps_delack); (void) tcp_output(tp); INP_WUNLOCK(inp); CURVNET_RESTORE(); @@ -250,7 +250,7 @@ tcp_timer_2msl(void *xtp) if (tcp_fast_finwait2_recycle && tp->t_state == TCPS_FIN_WAIT_2 && tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { - V_tcpstat.tcps_finwait2_drops++; + TCPSTAT_INC(tcps_finwait2_drops); tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && @@ -313,7 +313,7 @@ tcp_timer_keep(void *xtp) * Keep-alive timer went off; send something * or drop connection if idle for too long. */ - V_tcpstat.tcps_keeptimeo++; + TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && @@ -332,7 +332,7 @@ tcp_timer_keep(void *xtp) * by the protocol spec, this requires the * correspondent TCP to respond. */ - V_tcpstat.tcps_keepprobe++; + TCPSTAT_INC(tcps_keepprobe); t_template = tcpip_maketemplate(inp); if (t_template) { tcp_respond(tp, t_template->tt_ipgen, @@ -355,7 +355,7 @@ tcp_timer_keep(void *xtp) return; dropit: - V_tcpstat.tcps_keepdrops++; + TCPSTAT_INC(tcps_keepdrops); tp = tcp_drop(tp, ETIMEDOUT); #ifdef TCPDEBUG @@ -409,7 +409,7 @@ tcp_timer_persist(void *xtp) * Persistance timer into zero window. * Force a byte to be output, if possible. */ - V_tcpstat.tcps_persisttimeo++; + TCPSTAT_INC(tcps_persisttimeo); /* * Hack: if the peer is dead/unreachable, we do not * time out if the window is closed. After a full @@ -420,7 +420,7 @@ tcp_timer_persist(void *xtp) if (tp->t_rxtshift == TCP_MAXRXTSHIFT && ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { - V_tcpstat.tcps_persistdrop++; + TCPSTAT_INC(tcps_persistdrop); tp = tcp_drop(tp, ETIMEDOUT); goto out; } @@ -487,7 +487,7 @@ tcp_timer_rexmt(void * xtp) */ if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { tp->t_rxtshift = TCP_MAXRXTSHIFT; - V_tcpstat.tcps_timeoutdrop++; + TCPSTAT_INC(tcps_timeoutdrop); tp = tcp_drop(tp, tp->t_softerror ? tp->t_softerror : ETIMEDOUT); goto out; @@ -513,7 +513,7 @@ tcp_timer_rexmt(void * xtp) tp->t_flags &= ~TF_WASFRECOVERY; tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1)); } - V_tcpstat.tcps_rexmttimeo++; + TCPSTAT_INC(tcps_rexmttimeo); if (tp->t_state == TCPS_SYN_SENT) rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift]; else Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_timewait.c Sat Apr 11 22:07:19 2009 (r190948) @@ -472,7 +472,7 @@ tcp_twclose(struct tcptw *tw, int reuse) } } else in_pcbfree(inp); - V_tcpstat.tcps_closed++; + TCPSTAT_INC(tcps_closed); crfree(tw->tw_cred); tw->tw_cred = NULL; if (reuse) @@ -567,10 +567,10 @@ tcp_twrespond(struct tcptw *tw, int flag NULL, inp); } if (flags & TH_ACK) - V_tcpstat.tcps_sndacks++; + TCPSTAT_INC(tcps_sndacks); else - V_tcpstat.tcps_sndctrl++; - V_tcpstat.tcps_sndtotal++; + TCPSTAT_INC(tcps_sndctrl); + TCPSTAT_INC(tcps_sndtotal); return (error); } Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sat Apr 11 22:01:40 2009 (r190947) +++ head/sys/netinet/tcp_usrreq.c Sat Apr 11 22:07:19 2009 (r190948) @@ -1113,7 +1113,7 @@ tcp_connect(struct tcpcb *tp, struct soc tp->request_r_scale++; soisconnecting(so); - V_tcpstat.tcps_connattempt++; + TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); tp->iss = tcp_new_isn(tp); @@ -1177,7 +1177,7 @@ tcp6_connect(struct tcpcb *tp, struct so tp->request_r_scale++; soisconnecting(so); - V_tcpstat.tcps_connattempt++; + TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 22:34:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD051065676; Sat, 11 Apr 2009 22:34:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1248FC18; Sat, 11 Apr 2009 22:34:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BMY9ZS001778; Sat, 11 Apr 2009 22:34:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BMY9LQ001777; Sat, 11 Apr 2009 22:34:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200904112234.n3BMY9LQ001777@svn.freebsd.org> From: Alan Cox Date: Sat, 11 Apr 2009 22:34: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: r190949 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 22:34:10 -0000 Author: alc Date: Sat Apr 11 22:34:08 2009 New Revision: 190949 URL: http://svn.freebsd.org/changeset/base/190949 Log: Remove execute permission from the memory allocated by sbrk(). Pre-announced on: -arch (3/31/09) Discussed with: rwatson Tested by: marius (sparc64) Modified: head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Sat Apr 11 22:07:19 2009 (r190948) +++ head/sys/vm/vm_unix.c Sat Apr 11 22:34:08 2009 (r190949) @@ -117,7 +117,7 @@ obreak(td, uap) goto done; } rv = vm_map_insert(&vm->vm_map, NULL, 0, old, new, - VM_PROT_ALL, VM_PROT_ALL, 0); + VM_PROT_RW, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) { error = ENOMEM; goto done; From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 22:39:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B75106566B; Sat, 11 Apr 2009 22:39:38 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64EC98FC1C; Sat, 11 Apr 2009 22:39:38 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BMdcHI001975; Sat, 11 Apr 2009 22:39:38 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BMdceE001974; Sat, 11 Apr 2009 22:39:38 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904112239.n3BMdceE001974@svn.freebsd.org> From: Tim Kientzle Date: Sat, 11 Apr 2009 22:39: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: r190950 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 22:39:39 -0000 Author: kientzle Date: Sat Apr 11 22:39:38 2009 New Revision: 190950 URL: http://svn.freebsd.org/changeset/base/190950 Log: Any tar program should work here; the explicit reference to bsdtar is misleading. Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Sat Apr 11 22:34:08 2009 (r190949) +++ head/share/man/man4/textdump.4 Sat Apr 11 22:39:38 2009 (r190950) @@ -98,7 +98,7 @@ sysctl. .El .Pp Kernel textdumps may be extracted using -.Xr bsdtar 1 . +.Xr tar 1 . .Sh CONFIGURATION The .Nm @@ -153,7 +153,7 @@ These scripts may also be configured usi .Xr ddb 8 utility. .Sh SEE ALSO -.Xr bsdtar 1 , +.Xr tar 1 , .Xr ddb 4 , .Xr tar 5 , .Xr ddb 8 , From owner-svn-src-head@FreeBSD.ORG Sat Apr 11 23:35:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8123C106566C; Sat, 11 Apr 2009 23:35:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8D58FC1B; Sat, 11 Apr 2009 23:35:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3BNZLVA003742; Sat, 11 Apr 2009 23:35:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3BNZKDl003729; Sat, 11 Apr 2009 23:35:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904112335.n3BNZKDl003729@svn.freebsd.org> From: Robert Watson Date: Sat, 11 Apr 2009 23:35: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: r190951 - in head/sys: contrib/pf/net net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 23:35:22 -0000 Author: rwatson Date: Sat Apr 11 23:35:20 2009 New Revision: 190951 URL: http://svn.freebsd.org/changeset/base/190951 Log: Update stats in struct ipstat using four new macros, IPSTAT_ADD(), IPSTAT_INC(), IPSTAT_SUB(), and IPSTAT_DEC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/contrib/pf/net/pf.c head/sys/net/if_bridge.c head/sys/netinet/igmp.c head/sys/netinet/in_gif.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/raw_ip.c head/sys/netinet/udp_usrreq.c Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/contrib/pf/net/pf.c Sat Apr 11 23:35:20 2009 (r190951) @@ -6153,7 +6153,7 @@ pf_route(struct mbuf **m, struct pf_rule if (r->rt == PF_FASTROUTE) { in_rtalloc(ro, 0); if (ro->ro_rt == 0) { - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); goto bad; } @@ -6284,7 +6284,7 @@ pf_route(struct mbuf **m, struct pf_rule if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) && ifp->if_bridge == NULL) { m0->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT; - V_ipstat.ips_outhwcsum++; + IPSTAT_INC(ips_outhwcsum); } else { ip->ip_sum = 0; ip->ip_sum = in_cksum(m0, ip->ip_hl << 2); @@ -6303,7 +6303,7 @@ pf_route(struct mbuf **m, struct pf_rule * Must be able to put at least 8 bytes per fragment. */ if (ip->ip_off & htons(IP_DF)) { - V_ipstat.ips_cantfrag++; + IPSTAT_INC(ips_cantfrag); if (r->rt != PF_DUPTO) { #ifdef __FreeBSD__ /* icmp_error() expects host byte ordering */ @@ -6360,7 +6360,7 @@ pf_route(struct mbuf **m, struct pf_rule } if (error == 0) - V_ipstat.ips_fragmented++; + IPSTAT_INC(ips_fragmented); done: if (r->rt != PF_DUPTO) Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/net/if_bridge.c Sat Apr 11 23:35:20 2009 (r190951) @@ -3243,12 +3243,12 @@ bridge_ip_checkbasic(struct mbuf **mp) if ((m = m_copyup(m, sizeof(struct ip), (max_linkhdr + 3) & ~3)) == NULL) { /* XXXJRT new stat, please */ - V_ipstat.ips_toosmall++; + IPSTAT_INC(ips_toosmall); goto bad; } } else if (__predict_false(m->m_len < sizeof (struct ip))) { if ((m = m_pullup(m, sizeof (struct ip))) == NULL) { - V_ipstat.ips_toosmall++; + IPSTAT_INC(ips_toosmall); goto bad; } } @@ -3256,17 +3256,17 @@ bridge_ip_checkbasic(struct mbuf **mp) if (ip == NULL) goto bad; if (ip->ip_v != IPVERSION) { - V_ipstat.ips_badvers++; + IPSTAT_INC(ips_badvers); goto bad; } hlen = ip->ip_hl << 2; if (hlen < sizeof(struct ip)) { /* minimum header length */ - V_ipstat.ips_badhlen++; + IPSTAT_INC(ips_badhlen); goto bad; } if (hlen > m->m_len) { if ((m = m_pullup(m, hlen)) == 0) { - V_ipstat.ips_badhlen++; + IPSTAT_INC(ips_badhlen); goto bad; } ip = mtod(m, struct ip *); @@ -3283,7 +3283,7 @@ bridge_ip_checkbasic(struct mbuf **mp) } } if (sum) { - V_ipstat.ips_badsum++; + IPSTAT_INC(ips_badsum); goto bad; } @@ -3294,7 +3294,7 @@ bridge_ip_checkbasic(struct mbuf **mp) * Check for additional length bogosity */ if (len < hlen) { - V_ipstat.ips_badlen++; + IPSTAT_INC(ips_badlen); goto bad; } @@ -3304,7 +3304,7 @@ bridge_ip_checkbasic(struct mbuf **mp) * Drop packet if shorter than we expect. */ if (m->m_pkthdr.len < len) { - V_ipstat.ips_tooshort++; + IPSTAT_INC(ips_tooshort); goto bad; } @@ -3419,7 +3419,7 @@ bridge_fragment(struct ifnet *ifp, struc } if (error == 0) - V_ipstat.ips_fragmented++; + IPSTAT_INC(ips_fragmented); return (error); Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/igmp.c Sat Apr 11 23:35:20 2009 (r190951) @@ -3413,7 +3413,7 @@ igmp_intr(struct mbuf *m) CTR3(KTR_IGMPV3, "%s: dropped %p as ifindex %u went away.", __func__, m, ifindex); m_freem(m); - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); goto out; } @@ -3441,7 +3441,7 @@ igmp_intr(struct mbuf *m) if (m0 == NULL) { CTR2(KTR_IGMPV3, "%s: dropped %p", __func__, m); m_freem(m); - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); goto out; } } Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/in_gif.c Sat Apr 11 23:35:20 2009 (r190951) @@ -273,14 +273,14 @@ in_gif_input(struct mbuf *m, int off) sc = (struct gif_softc *)encap_getarg(m); if (sc == NULL) { m_freem(m); - V_ipstat.ips_nogif++; + IPSTAT_INC(ips_nogif); return; } gifp = GIF2IFP(sc); if (gifp == NULL || (gifp->if_flags & IFF_UP) == 0) { m_freem(m); - V_ipstat.ips_nogif++; + IPSTAT_INC(ips_nogif); return; } @@ -340,7 +340,7 @@ in_gif_input(struct mbuf *m, int off) break; default: - V_ipstat.ips_nogif++; + IPSTAT_INC(ips_nogif); m_freem(m); return; } Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_divert.c Sat Apr 11 23:35:20 2009 (r190951) @@ -186,7 +186,7 @@ div_input(struct mbuf *m, int off) { INIT_VNET_INET(curvnet); - V_ipstat.ips_noproto++; + IPSTAT_INC(ips_noproto); m_freem(m); } @@ -307,8 +307,8 @@ divert_packet(struct mbuf *m, int incomi INP_INFO_RUNLOCK(&V_divcbinfo); if (sa == NULL) { m_freem(m); - V_ipstat.ips_noproto++; - V_ipstat.ips_delivered--; + IPSTAT_INC(ips_noproto); + IPSTAT_DEC(ips_delivered); } } @@ -394,7 +394,7 @@ div_output(struct socket *so, struct mbu ip->ip_off = ntohs(ip->ip_off); /* Send packet to output processing */ - V_ipstat.ips_rawout++; /* XXX */ + IPSTAT_INC(ips_rawout); /* XXX */ #ifdef MAC mac_inpcb_create_mbuf(inp, m); @@ -570,7 +570,7 @@ div_send(struct socket *so, int flags, s /* Packet must have a header (but that's about it) */ if (m->m_len < sizeof (struct ip) && (m = m_pullup(m, sizeof (struct ip))) == 0) { - V_ipstat.ips_toosmall++; + IPSTAT_INC(ips_toosmall); m_freem(m); return EINVAL; } Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_fastfwd.c Sat Apr 11 23:35:20 2009 (r190951) @@ -140,8 +140,8 @@ ip_findroute(struct route *ro, struct in if (rt->rt_flags & RTF_GATEWAY) dst = (struct sockaddr_in *)rt->rt_gateway; } else { - V_ipstat.ips_noroute++; - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_noroute); + IPSTAT_INC(ips_cantforward); if (rt) RTFREE(rt); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); @@ -193,7 +193,7 @@ ip_fastforward(struct mbuf *m) * Is entire packet big enough? */ if (m->m_pkthdr.len < sizeof(struct ip)) { - V_ipstat.ips_tooshort++; + IPSTAT_INC(ips_tooshort); goto drop; } @@ -202,7 +202,7 @@ ip_fastforward(struct mbuf *m) */ if (m->m_len < sizeof (struct ip) && (m = m_pullup(m, sizeof (struct ip))) == NULL) { - V_ipstat.ips_toosmall++; + IPSTAT_INC(ips_toosmall); return NULL; /* mbuf already free'd */ } @@ -212,7 +212,7 @@ ip_fastforward(struct mbuf *m) * Is it IPv4? */ if (ip->ip_v != IPVERSION) { - V_ipstat.ips_badvers++; + IPSTAT_INC(ips_badvers); goto drop; } @@ -221,12 +221,12 @@ ip_fastforward(struct mbuf *m) */ hlen = ip->ip_hl << 2; if (hlen < sizeof(struct ip)) { /* minimum header length */ - V_ipstat.ips_badlen++; + IPSTAT_INC(ips_badlen); goto drop; } if (hlen > m->m_len) { if ((m = m_pullup(m, hlen)) == NULL) { - V_ipstat.ips_badhlen++; + IPSTAT_INC(ips_badhlen); return NULL; /* mbuf already free'd */ } ip = mtod(m, struct ip *); @@ -244,7 +244,7 @@ ip_fastforward(struct mbuf *m) sum = in_cksum(m, hlen); } if (sum) { - V_ipstat.ips_badsum++; + IPSTAT_INC(ips_badsum); goto drop; } @@ -259,7 +259,7 @@ ip_fastforward(struct mbuf *m) * Is IP length longer than packet we have got? */ if (m->m_pkthdr.len < ip_len) { - V_ipstat.ips_tooshort++; + IPSTAT_INC(ips_tooshort); goto drop; } @@ -279,7 +279,7 @@ ip_fastforward(struct mbuf *m) */ if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { - V_ipstat.ips_badaddr++; + IPSTAT_INC(ips_badaddr); goto drop; } @@ -337,7 +337,7 @@ ip_fastforward(struct mbuf *m) if (in_localip(ip->ip_dst)) return m; - V_ipstat.ips_total++; + IPSTAT_INC(ips_total); /* * Step 3: incoming packet firewall processing @@ -519,7 +519,7 @@ passout: */ if ((ifp->if_snd.ifq_len + ip->ip_len / ifp->if_mtu + 1) >= ifp->if_snd.ifq_maxlen) { - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); /* would send source quench here but that is depreciated */ goto drop; } @@ -558,7 +558,7 @@ passout: * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery */ if (ip->ip_off & IP_DF) { - V_ipstat.ips_cantfrag++; + IPSTAT_INC(ips_cantfrag); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, mtu); goto consumed; @@ -596,16 +596,16 @@ passout: m_freem(m); } } else - V_ipstat.ips_fragmented++; + IPSTAT_INC(ips_fragmented); } } if (error != 0) - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); else { ro.ro_rt->rt_rmx.rmx_pksent++; - V_ipstat.ips_forward++; - V_ipstat.ips_fastforward++; + IPSTAT_INC(ips_forward); + IPSTAT_INC(ips_fastforward); } consumed: RTFREE(ro.ro_rt); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_input.c Sat Apr 11 23:35:20 2009 (r190951) @@ -381,31 +381,31 @@ ip_input(struct mbuf *m) goto ours; } - V_ipstat.ips_total++; + IPSTAT_INC(ips_total); if (m->m_pkthdr.len < sizeof(struct ip)) goto tooshort; if (m->m_len < sizeof (struct ip) && (m = m_pullup(m, sizeof (struct ip))) == NULL) { - V_ipstat.ips_toosmall++; + IPSTAT_INC(ips_toosmall); return; } ip = mtod(m, struct ip *); if (ip->ip_v != IPVERSION) { - V_ipstat.ips_badvers++; + IPSTAT_INC(ips_badvers); goto bad; } hlen = ip->ip_hl << 2; if (hlen < sizeof(struct ip)) { /* minimum header length */ - V_ipstat.ips_badhlen++; + IPSTAT_INC(ips_badhlen); goto bad; } if (hlen > m->m_len) { if ((m = m_pullup(m, hlen)) == NULL) { - V_ipstat.ips_badhlen++; + IPSTAT_INC(ips_badhlen); return; } ip = mtod(m, struct ip *); @@ -415,7 +415,7 @@ ip_input(struct mbuf *m) if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { - V_ipstat.ips_badaddr++; + IPSTAT_INC(ips_badaddr); goto bad; } } @@ -430,7 +430,7 @@ ip_input(struct mbuf *m) } } if (sum) { - V_ipstat.ips_badsum++; + IPSTAT_INC(ips_badsum); goto bad; } @@ -445,7 +445,7 @@ ip_input(struct mbuf *m) */ ip->ip_len = ntohs(ip->ip_len); if (ip->ip_len < hlen) { - V_ipstat.ips_badlen++; + IPSTAT_INC(ips_badlen); goto bad; } ip->ip_off = ntohs(ip->ip_off); @@ -458,7 +458,7 @@ ip_input(struct mbuf *m) */ if (m->m_pkthdr.len < ip->ip_len) { tooshort: - V_ipstat.ips_tooshort++; + IPSTAT_INC(ips_tooshort); goto bad; } if (m->m_pkthdr.len > ip->ip_len) { @@ -609,7 +609,7 @@ passin: } /* RFC 3927 2.7: Do not forward datagrams for 169.254.0.0/16. */ if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr))) { - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); m_freem(m); return; } @@ -625,7 +625,7 @@ passin: */ if (ip_mforward && ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) { - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); m_freem(m); return; } @@ -637,7 +637,7 @@ passin: */ if (ip->ip_p == IPPROTO_IGMP) goto ours; - V_ipstat.ips_forward++; + IPSTAT_INC(ips_forward); } /* * Assume the packet is for us, to avoid prematurely taking @@ -667,7 +667,7 @@ passin: * Not for us; forward if possible and desirable. */ if (V_ipforwarding == 0) { - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); m_freem(m); } else { #ifdef IPSEC @@ -727,7 +727,7 @@ ours: /* * Switch out to protocol's input routine. */ - V_ipstat.ips_delivered++; + IPSTAT_INC(ips_delivered); (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen); return; @@ -825,8 +825,8 @@ ip_reass(struct mbuf *m) /* If maxnipq or maxfragsperpacket are 0, never accept fragments. */ if (V_maxnipq == 0 || V_maxfragsperpacket == 0) { - V_ipstat.ips_fragments++; - V_ipstat.ips_fragdropped++; + IPSTAT_INC(ips_fragments); + IPSTAT_INC(ips_fragdropped); m_freem(m); return (NULL); } @@ -868,14 +868,14 @@ ip_reass(struct mbuf *m) for (i = 0; i < IPREASS_NHASH; i++) { struct ipq *r = TAILQ_LAST(&V_ipq[i], ipqhead); if (r) { - V_ipstat.ips_fragtimeout += - r->ipq_nfrags; + IPSTAT_ADD(ips_fragtimeout, + r->ipq_nfrags); ip_freef(&V_ipq[i], r); break; } } } else { - V_ipstat.ips_fragtimeout += q->ipq_nfrags; + IPSTAT_ADD(ips_fragtimeout, q->ipq_nfrags); ip_freef(head, q); } } @@ -892,7 +892,7 @@ found: * that's a non-zero multiple of 8 bytes. */ if (ip->ip_len == 0 || (ip->ip_len & 0x7) != 0) { - V_ipstat.ips_toosmall++; /* XXX */ + IPSTAT_INC(ips_toosmall); /* XXX */ goto dropfrag; } m->m_flags |= M_FRAG; @@ -905,7 +905,7 @@ found: * Attempt reassembly; if it succeeds, proceed. * ip_reass() will return a different mbuf. */ - V_ipstat.ips_fragments++; + IPSTAT_INC(ips_fragments); m->m_pkthdr.header = ip; /* Previous ip_reass() started here. */ @@ -1016,7 +1016,7 @@ found: } nq = q->m_nextpkt; m->m_nextpkt = nq; - V_ipstat.ips_fragdropped++; + IPSTAT_INC(ips_fragdropped); fp->ipq_nfrags--; m_freem(q); } @@ -1035,7 +1035,7 @@ found: for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) { if (GETIP(q)->ip_off != next) { if (fp->ipq_nfrags > V_maxfragsperpacket) { - V_ipstat.ips_fragdropped += fp->ipq_nfrags; + IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); ip_freef(head, fp); } goto done; @@ -1045,7 +1045,7 @@ found: /* Make sure the last packet didn't have the IP_MF flag */ if (p->m_flags & M_FRAG) { if (fp->ipq_nfrags > V_maxfragsperpacket) { - V_ipstat.ips_fragdropped += fp->ipq_nfrags; + IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); ip_freef(head, fp); } goto done; @@ -1057,8 +1057,8 @@ found: q = fp->ipq_frags; ip = GETIP(q); if (next + (ip->ip_hl << 2) > IP_MAXPACKET) { - V_ipstat.ips_toolong++; - V_ipstat.ips_fragdropped += fp->ipq_nfrags; + IPSTAT_INC(ips_toolong); + IPSTAT_ADD(ips_fragdropped, fp->ipq_nfrags); ip_freef(head, fp); goto done; } @@ -1107,12 +1107,12 @@ found: /* some debugging cruft by sklower, below, will go away soon */ if (m->m_flags & M_PKTHDR) /* XXX this should be done elsewhere */ m_fixhdr(m); - V_ipstat.ips_reassembled++; + IPSTAT_INC(ips_reassembled); IPQ_UNLOCK(); return (m); dropfrag: - V_ipstat.ips_fragdropped++; + IPSTAT_INC(ips_fragdropped); if (fp != NULL) fp->ipq_nfrags--; m_freem(m); @@ -1169,8 +1169,8 @@ ip_slowtimo(void) fpp = fp; fp = TAILQ_NEXT(fp, ipq_list); if(--fpp->ipq_ttl == 0) { - V_ipstat.ips_fragtimeout += - fpp->ipq_nfrags; + IPSTAT_ADD(ips_fragtimeout, + fpp->ipq_nfrags); ip_freef(&V_ipq[i], fpp); } } @@ -1184,8 +1184,8 @@ ip_slowtimo(void) for (i = 0; i < IPREASS_NHASH; i++) { while (V_nipq > V_maxnipq && !TAILQ_EMPTY(&V_ipq[i])) { - V_ipstat.ips_fragdropped += - TAILQ_FIRST(&V_ipq[i])->ipq_nfrags; + IPSTAT_ADD(ips_fragdropped, + TAILQ_FIRST(&V_ipq[i])->ipq_nfrags); ip_freef(&V_ipq[i], TAILQ_FIRST(&V_ipq[i])); } @@ -1213,8 +1213,8 @@ ip_drain(void) INIT_VNET_INET(vnet_iter); for (i = 0; i < IPREASS_NHASH; i++) { while(!TAILQ_EMPTY(&V_ipq[i])) { - V_ipstat.ips_fragdropped += - TAILQ_FIRST(&V_ipq[i])->ipq_nfrags; + IPSTAT_ADD(ips_fragdropped, + TAILQ_FIRST(&V_ipq[i])->ipq_nfrags); ip_freef(&V_ipq[i], TAILQ_FIRST(&V_ipq[i])); } } @@ -1346,7 +1346,7 @@ ip_forward(struct mbuf *m, int srcrt) int error, type = 0, code = 0, mtu = 0; if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) { - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); m_freem(m); return; } @@ -1465,11 +1465,11 @@ ip_forward(struct mbuf *m, int srcrt) RTFREE(ro.ro_rt); if (error) - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); else { - V_ipstat.ips_forward++; + IPSTAT_INC(ips_forward); if (type) - V_ipstat.ips_redirectsent++; + IPSTAT_INC(ips_redirectsent); else { if (mcopy) m_freem(mcopy); @@ -1521,7 +1521,7 @@ ip_forward(struct mbuf *m, int srcrt) else mtu = ip_next_mtu(ip->ip_len, 0); } - V_ipstat.ips_cantfrag++; + IPSTAT_INC(ips_cantfrag); break; case ENOBUFS: Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_ipsec.c Sat Apr 11 23:35:20 2009 (r190951) @@ -129,7 +129,7 @@ ip_ipsec_fwd(struct mbuf *m) KEY_FREESP(&sp); splx(s); if (error) { - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); return 1; } #endif /* IPSEC */ Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_options.c Sat Apr 11 23:35:20 2009 (r190951) @@ -218,7 +218,7 @@ nosourcerouting: #ifdef IPSTEALTH dropit: #endif - V_ipstat.ips_cantforward++; + IPSTAT_INC(ips_cantforward); m_freem(m); return (1); } @@ -366,7 +366,7 @@ dropit: return (0); bad: icmp_error(m, type, code, 0, 0); - V_ipstat.ips_badoptions++; + IPSTAT_INC(ips_badoptions); return (1); } Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_output.c Sat Apr 11 23:35:20 2009 (r190951) @@ -182,7 +182,7 @@ ip_output(struct mbuf *m, struct mbuf *o ip->ip_v = IPVERSION; ip->ip_hl = hlen >> 2; ip->ip_id = ip_newid(); - V_ipstat.ips_localout++; + IPSTAT_INC(ips_localout); } else { hlen = ip->ip_hl << 2; } @@ -221,7 +221,7 @@ again: if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst)))) == NULL && (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL) { - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; } @@ -233,7 +233,7 @@ again: } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; } @@ -265,7 +265,7 @@ again: inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #endif if (ro->ro_rt == NULL) { - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); error = EHOSTUNREACH; goto bad; } @@ -322,7 +322,7 @@ again: */ if ((imo == NULL) || (imo->imo_multicast_vif == -1)) { if ((ifp->if_flags & IFF_MULTICAST) == 0) { - V_ipstat.ips_noroute++; + IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; } @@ -420,7 +420,7 @@ again: #endif /* ALTQ */ { error = ENOBUFS; - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); ifp->if_snd.ifq_drops += (ip->ip_len / ifp->if_mtu + 1); goto bad; } @@ -538,7 +538,7 @@ passout: if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { if ((ifp->if_flags & IFF_LOOPBACK) == 0) { - V_ipstat.ips_badaddr++; + IPSTAT_INC(ips_badaddr); error = EADDRNOTAVAIL; goto bad; } @@ -602,7 +602,7 @@ passout: /* Balk when DF bit is set or the interface didn't support TSO. */ if ((ip->ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { error = EMSGSIZE; - V_ipstat.ips_cantfrag++; + IPSTAT_INC(ips_cantfrag); goto bad; } @@ -635,7 +635,7 @@ passout: } if (error == 0) - V_ipstat.ips_fragmented++; + IPSTAT_INC(ips_fragmented); done: if (ro == &iproute && ro->ro_rt) { @@ -671,7 +671,7 @@ ip_fragment(struct ip *ip, struct mbuf * int nfrags; if (ip->ip_off & IP_DF) { /* Fragmentation not allowed */ - V_ipstat.ips_cantfrag++; + IPSTAT_INC(ips_cantfrag); return EMSGSIZE; } @@ -752,7 +752,7 @@ smart_frag_failure: MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); goto done; } m->m_flags |= (m0->m_flags & M_MCAST) | M_FRAG; @@ -782,7 +782,7 @@ smart_frag_failure: if (m->m_next == NULL) { /* copy failed */ m_free(m); error = ENOBUFS; /* ??? */ - V_ipstat.ips_odropped++; + IPSTAT_INC(ips_odropped); goto done; } m->m_pkthdr.len = mhlen + len; @@ -798,7 +798,7 @@ smart_frag_failure: *mnext = m; mnext = &m->m_nextpkt; } - V_ipstat.ips_ofragments += nfrags; + IPSTAT_ADD(ips_ofragments, nfrags); /* set first marker for fragment chain */ m0->m_flags |= M_FIRSTFRAG | M_FRAG; Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/ip_var.h Sat Apr 11 23:35:20 2009 (r190951) @@ -132,6 +132,11 @@ struct ipstat { #ifdef _KERNEL +#define IPSTAT_ADD(name, val) V_ipstat.name += (val) +#define IPSTAT_SUB(name, val) V_ipstat.name -= (val) +#define IPSTAT_INC(name) IPSTAT_ADD(name, 1) +#define IPSTAT_DEC(name) IPSTAT_SUB(name, 1) + /* flags passed to ip_output as last parameter */ #define IP_FORWARDING 0x1 /* most of ip header exists */ #define IP_RAWOUTPUT 0x2 /* raw ip header exists */ Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/raw_ip.c Sat Apr 11 23:35:20 2009 (r190951) @@ -345,7 +345,7 @@ rip_input(struct mbuf *m, int off) (struct sockaddr *)&group, (struct sockaddr *)&ripsrc); if (blocked != MCAST_PASS) { - V_ipstat.ips_notmember++; + IPSTAT_INC(ips_notmember); continue; } } @@ -364,12 +364,12 @@ rip_input(struct mbuf *m, int off) INP_INFO_RUNLOCK(&V_ripcbinfo); if (last != NULL) { if (rip_append(last, ip, m, &ripsrc) != 0) - V_ipstat.ips_delivered--; + IPSTAT_INC(ips_delivered); INP_RUNLOCK(last); } else { m_freem(m); - V_ipstat.ips_noproto++; - V_ipstat.ips_delivered--; + IPSTAT_INC(ips_noproto); + IPSTAT_DEC(ips_delivered); } } @@ -450,7 +450,7 @@ rip_output(struct mbuf *m, struct socket * XXX prevent ip_output from overwriting header fields. */ flags |= IP_RAWOUTPUT; - V_ipstat.ips_rawout++; + IPSTAT_INC(ips_rawout); } if (inp->inp_flags & INP_ONESBCAST) Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Apr 11 22:39:38 2009 (r190950) +++ head/sys/netinet/udp_usrreq.c Sat Apr 11 23:35:20 2009 (r190951) @@ -439,7 +439,7 @@ udp_input(struct mbuf *m, int off) (struct sockaddr *)&udp_in); if (blocked != MCAST_PASS) { if (blocked == MCAST_NOTGMEMBER) - V_ipstat.ips_notmember++; + IPSTAT_INC(ips_notmember); if (blocked == MCAST_NOTSMEMBER || blocked == MCAST_MUTED) V_udpstat.udps_filtermcast++;