From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 00:28:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD36B1065670; Sun, 15 Feb 2009 00:28:28 +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 AAEF08FC0C; Sun, 15 Feb 2009 00:28:28 +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 n1F0SS4E034539; Sun, 15 Feb 2009 00:28:28 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F0SSBX034537; Sun, 15 Feb 2009 00:28:28 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902150028.n1F0SSBX034537@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 15 Feb 2009 00:28: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: r188626 - in head/sys: net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 00:28:29 -0000 Author: luigi Date: Sun Feb 15 00:28:28 2009 New Revision: 188626 URL: http://svn.freebsd.org/changeset/base/188626 Log: remove unnecessary #include from vnet.h and vinet.h Approved by: Marko Zec Modified: head/sys/net/vnet.h head/sys/netinet/vinet.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Sat Feb 14 23:48:26 2009 (r188625) +++ head/sys/net/vnet.h Sun Feb 15 00:28:28 2009 (r188626) @@ -35,14 +35,8 @@ #include "opt_route.h" -#include -#include -#include - #include -#include #include -#include struct vnet_net { int _if_index; Modified: head/sys/netinet/vinet.h ============================================================================== --- head/sys/netinet/vinet.h Sat Feb 14 23:48:26 2009 (r188625) +++ head/sys/netinet/vinet.h Sun Feb 15 00:28:28 2009 (r188626) @@ -33,12 +33,9 @@ #ifndef _NETINET_VINET_H_ #define _NETINET_VINET_H_ -#include #include -#include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 01:12:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530081065672; Sun, 15 Feb 2009 01:12:17 +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 416088FC15; Sun, 15 Feb 2009 01:12:17 +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 n1F1CHj0035317; Sun, 15 Feb 2009 01:12:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F1CHh1035316; Sun, 15 Feb 2009 01:12:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150112.n1F1CHh1035316@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 01:12: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: r188627 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 01:12:17 -0000 Author: imp Date: Sun Feb 15 01:12:16 2009 New Revision: 188627 URL: http://svn.freebsd.org/changeset/base/188627 Log: Remove stray __P() Modified: head/sys/mips/include/frame.h Modified: head/sys/mips/include/frame.h ============================================================================== --- head/sys/mips/include/frame.h Sun Feb 15 00:28:28 2009 (r188626) +++ head/sys/mips/include/frame.h Sun Feb 15 01:12:16 2009 (r188627) @@ -130,7 +130,7 @@ struct trapframe { }; /* REVISIT */ -struct frame *get_current_fp __P((void)); +struct frame *get_current_fp(void); #define get_next_fp(fp) (0) #define get_return_ptr(fp) (0) void get_stack_trace(u_int32_t depth, u_int32_t *trace); From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 01:26:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64FE81065670; Sun, 15 Feb 2009 01:26: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 514168FC0A; Sun, 15 Feb 2009 01:26: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 n1F1Qn9O035595; Sun, 15 Feb 2009 01:26:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F1Qn9J035592; Sun, 15 Feb 2009 01:26:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150126.n1F1Qn9J035592@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 01:26: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: r188628 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 01:26:50 -0000 Author: imp Date: Sun Feb 15 01:26:49 2009 New Revision: 188628 URL: http://svn.freebsd.org/changeset/base/188628 Log: Add preliminary support for truss on MIPS. It compiles, but has not been extensively tested. And the ELF64 stuff likely is not quite right... # There's a lot of cut-n-paste code here that could easily be # refactored, at least for FreeBSD syscalls. Added: head/usr.bin/truss/mips-fbsd.c (contents, props changed) Modified: head/usr.bin/truss/extern.h head/usr.bin/truss/main.c Modified: head/usr.bin/truss/extern.h ============================================================================== --- head/usr.bin/truss/extern.h Sun Feb 15 01:12:16 2009 (r188627) +++ head/usr.bin/truss/extern.h Sun Feb 15 01:26:49 2009 (r188628) @@ -63,4 +63,8 @@ extern long powerpc_syscall_exit(struct extern void sparc64_syscall_entry(struct trussinfo *, int); extern long sparc64_syscall_exit(struct trussinfo *, int); #endif +#ifdef __mips__ +extern void mips_syscall_entry(struct trussinfo *, int); +extern long mips_syscall_exit(struct trussinfo *, int); +#endif Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Feb 15 01:12:16 2009 (r188627) +++ head/usr.bin/truss/main.c Sun Feb 15 01:26:49 2009 (r188628) @@ -99,6 +99,11 @@ struct ex_types { #ifdef __sparc64__ { "FreeBSD ELF64", sparc64_syscall_entry, sparc64_syscall_exit }, #endif +#ifdef __mips__ + { "FreeBSD ELF", mips_syscall_entry, mips_syscall_exit }, + { "FreeBSD ELF32", mips_syscall_entry, mips_syscall_exit }, + { "FreeBSD ELF64", mips_syscall_entry, mips_syscall_exit }, // XXX +#endif { 0, 0, 0 }, }; Added: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truss/mips-fbsd.c Sun Feb 15 01:26:49 2009 (r188628) @@ -0,0 +1,345 @@ +/* + * Copryight 1998 Sean Eric Fagan + * + * 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 Sean Eric Fagan + * 4. Neither the name of the author may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * 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. + */ + +#ifndef lint +static const char rcsid[] = + "$FreeBSD$"; +#endif /* not lint */ + +/* + * FreeBSD/sparc64-specific system call handling. This is probably the most + * complex part of the entire truss program, although I've got lots of + * it handled relatively cleanly now. The system call names are generated + * automatically, thanks to /usr/src/sys/kern/syscalls.master. The + * names used for the various structures are confusing, I sadly admit. + * + * This file is almost nothing more than a slightly-edited i386-fbsd.c. + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "truss.h" +#include "syscall.h" +#include "extern.h" + +static int cpid = -1; + +#include "syscalls.h" + +static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); + +/* + * This is what this particular file uses to keep track of a system call. + * It is probably not quite sufficient -- I can probably use the same + * structure for the various syscall personalities, and I also probably + * need to nest system calls (for signal handlers). + * + * 'struct syscall' describes the system call; it may be NULL, however, + * if we don't know about this particular system call yet. + */ +static struct freebsd_syscall { + struct syscall *sc; + const char *name; + int number; + unsigned long *args; + int nargs; /* number of arguments -- *not* number of words! */ + char **s_args; /* the printable arguments */ +} fsc; + +/* Clear up and free parts of the fsc structure. */ +static __inline void +clear_fsc(void) { + if (fsc.args) { + free(fsc.args); + } + if (fsc.s_args) { + int i; + for (i = 0; i < fsc.nargs; i++) + if (fsc.s_args[i]) + free(fsc.s_args[i]); + free(fsc.s_args); + } + memset(&fsc, 0, sizeof(fsc)); +} + +/* + * Called when a process has entered a system call. nargs is the + * number of words, not number of arguments (a necessary distinction + * in some cases). Note that if the STOPEVENT() code in sparc64/sparc64/trap.c + * is ever changed these functions need to keep up. + */ + +void +mips_syscall_entry(struct trussinfo *trussinfo, int nargs) { + struct reg regs; + int syscall_num; + int i; + struct syscall *sc; + int indir = 0; /* indirect system call */ + struct ptrace_io_desc iorequest; + + cpid = trussinfo->curthread->tid; + + clear_fsc(); + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); + return; + } + + syscall_num = regs.r_regs[V0]; + if (syscall_num == SYS_syscall) { + indir = 1; + syscall_num = regs.r_regs[A0]; + } + + fsc.number = syscall_num; + fsc.name = + (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num]; + if (!fsc.name) { + fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); + } + + if (fsc.name && (trussinfo->flags & FOLLOWFORKS) + && ((!strcmp(fsc.name, "fork") + || !strcmp(fsc.name, "rfork") + || !strcmp(fsc.name, "vfork")))) + { + trussinfo->curthread->in_fork = 1; + } + + if (nargs == 0) + return; + +#if 0 // XXX + fsc.args = malloc((1+nargs) * sizeof(unsigned long)); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)parm_offset; + iorequest.piod_addr = fsc.args; + iorequest.piod_len = (1+nargs) * sizeof(unsigned long); + ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + if (iorequest.piod_len == 0) + return; +#else + iorequest.piod_op = PIOD_READ_D; +#endif + + switch (nargs) { + default: + /* + * The OS doesn't seem to allow more than 10 words of + * parameters (yay!). So we shouldn't be here. + */ + warn("More than 10 words (%d) of arguments!\n", nargs); + break; + case 10: case 9: case 8: case 7: case 6: case 5: + /* + * If there are 7-10 words of arguments, they are placed + * on the stack, as is normal for other processors. + * The fall-through for all of these is deliberate!!! + */ + // XXX BAD constant used here + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)(regs.r_regs[SP] + 4 * sizeof(uint32_t)); + iorequest.piod_addr = &fsc.args[4]; + iorequest.piod_len = (nargs - 4) * sizeof(fsc.args[0]); + ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + if (iorequest.piod_len == 0) return; + case 4: fsc.args[3] = regs.r_regs[A3]; + case 3: fsc.args[2] = regs.r_regs[A2]; + case 2: fsc.args[1] = regs.r_regs[A1]; + case 1: fsc.args[0] = regs.r_regs[A0]; + case 0: + break; + } + if (indir) { + memmove(&fsc.args[0], &fsc.args[1], (nargs-1) * sizeof(fsc.args[0])); + } + + sc = get_syscall(fsc.name); + if (sc) { + fsc.nargs = sc->nargs; + } else { +#if DEBUG + fprintf(trussinfo->outfile, "unknown syscall %s -- setting args to %d\n", + fsc.name, nargs); +#endif + fsc.nargs = nargs; + } + + fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*)); + memset(fsc.s_args, 0, fsc.nargs * sizeof(char*)); + fsc.sc = sc; + + /* + * At this point, we set up the system call arguments. + * We ignore any OUT ones, however -- those are arguments that + * are set by the system call, and so are probably meaningless + * now. This doesn't currently support arguments that are + * passed in *and* out, however. + */ + + if (fsc.name) { + +#if DEBUG + fprintf(stderr, "syscall %s(", fsc.name); +#endif + for (i = 0; i < fsc.nargs; i++) { +#if DEBUG + fprintf(stderr, "0x%x%s", + sc + ? fsc.args[sc->args[i].offset] + : fsc.args[i], + i < (fsc.nargs - 1) ? "," : ""); +#endif + if (sc && !(sc->args[i].type & OUT)) { + fsc.s_args[i] = print_arg(&sc->args[i], fsc.args, 0, trussinfo); + } + } +#if DEBUG + fprintf(stderr, ")\n"); +#endif + } + +#if DEBUG + fprintf(trussinfo->outfile, "\n"); +#endif + + if (fsc.name != NULL && + (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { + + /* XXX + * This could be done in a more general + * manner but it still wouldn't be very pretty. + */ + if (!strcmp(fsc.name, "execve")) { + if ((trussinfo->flags & EXECVEARGS) == 0) + if (fsc.s_args[1]) { + free(fsc.s_args[1]); + fsc.s_args[1] = NULL; + } + if ((trussinfo->flags & EXECVEENVS) == 0) + if (fsc.s_args[2]) { + free(fsc.s_args[2]); + fsc.s_args[2] = NULL; + } + } + } + + return; +} + +/* + * And when the system call is done, we handle it here. + * Currently, no attempt is made to ensure that the system calls + * match -- this needs to be fixed (and is, in fact, why S_SCX includes + * the sytem call number instead of, say, an error status). + */ + +long +mips_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { + struct reg regs; + long retval; + int i; + int errorp; + struct syscall *sc; + + if (fsc.name == NULL) + return (-1); + cpid = trussinfo->curthread->tid; + + if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + fprintf(trussinfo->outfile, "\n"); + return (-1); + } + retval = regs.r_regs[V0]; + errorp = !!regs.r_regs[A3]; + + /* + * This code, while simpler than the initial versions I used, could + * stand some significant cleaning. + */ + + sc = fsc.sc; + if (!sc) { + for (i = 0; i < fsc.nargs; i++) + asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + } else { + /* + * Here, we only look for arguments that have OUT masked in -- + * otherwise, they were handled in the syscall_entry function. + */ + for (i = 0; i < sc->nargs; i++) { + char *temp; + if (sc->args[i].type & OUT) { + /* + * If an error occurred, than don't bothe getting the data; + * it may not be valid. + */ + if (errorp) + asprintf(&temp, "0x%lx", fsc.args[sc->args[i].offset]); + else + temp = print_arg(&sc->args[i], fsc.args, retval, trussinfo); + fsc.s_args[i] = temp; + } + } + } + + if (fsc.name != NULL && + (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { + trussinfo->curthread->in_syscall = 1; + } + /* + * It would probably be a good idea to merge the error handling, + * but that complicates things considerably. + */ + + print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, retval); + clear_fsc(); + + return (retval); +} From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 01:32:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24A97106566C; Sun, 15 Feb 2009 01:32:51 +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 ECAB28FC15; Sun, 15 Feb 2009 01:32: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 n1F1WoEf035728; Sun, 15 Feb 2009 01:32:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F1Wo1v035727; Sun, 15 Feb 2009 01:32:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150132.n1F1Wo1v035727@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 01:32: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: r188629 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 01:32:51 -0000 Author: imp Date: Sun Feb 15 01:32:50 2009 New Revision: 188629 URL: http://svn.freebsd.org/changeset/base/188629 Log: Truss builds on mips, so don't filter it building there anymore. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Feb 15 01:26:49 2009 (r188628) +++ head/usr.bin/Makefile Sun Feb 15 01:32:50 2009 (r188629) @@ -233,7 +233,7 @@ SUBDIR= alias \ ${_ypmatch} \ ${_ypwhich} -.if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips" +.if ${MACHINE_ARCH} != "arm" _truss= truss .endif From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 02:45:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDE9106564A; Sun, 15 Feb 2009 02:45:54 +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 0AC3D8FC12; Sun, 15 Feb 2009 02:45:53 +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 n1F2jqL6060126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Feb 2009 18:45:52 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <499781DF.20304@freebsd.org> Date: Sat, 14 Feb 2009 18:45:51 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Julian Elischer References: <200902131514.n1DFEhft091837@svn.freebsd.org> <4997531E.3000900@elischer.org> In-Reply-To: <4997531E.3000900@elischer.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Rhyolite-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 02:45:54 -0000 Julian Elischer wrote: > Luigi Rizzo wrote: >> Author: luigi >> Date: Fri Feb 13 15:14:43 2009 >> New Revision: 188578 >> URL: http://svn.freebsd.org/changeset/base/188578 >> >> Log: >> Use uint32_t instead of n_long and n_time, and uint16_t instead of >> n_short. >> Add a note next to fields in network format. >> The n_* types are not enough for compiler checks on endianness, >> and their >> use often requires an otherwise unnecessary #include >> >> The typedef in in_systm.h are still there. > > There is a project out there (intel was involved frommemory) to make a > compiler that knows the endianness of stuff. I know it exists because > it was reported that one well known piece of big endian embedded > software was compiled successfully to actually run on little endian > machines. You can of course see why intel was interested.. linux has endian annotations for sparse. I've thought it would be worthwhile to mod freebsd but it's ugly and w/o (native) tools to use seemed pointless. Sam From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:04:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADB9106564A; Sun, 15 Feb 2009 03:04:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BED9B8FC37; Sun, 15 Feb 2009 03:04:20 +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 n1F34KNo037526; Sun, 15 Feb 2009 03:04:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F34KRm037525; Sun, 15 Feb 2009 03:04:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150304.n1F34KRm037525@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 03:04: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: r188630 - head/usr.sbin/pccard X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:04:21 -0000 Author: imp Date: Sun Feb 15 03:04:20 2009 New Revision: 188630 URL: http://svn.freebsd.org/changeset/base/188630 Log: This directory isn't needed anymore. Deleted: head/usr.sbin/pccard/ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:10:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47997106566B; Sun, 15 Feb 2009 03:10:21 +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 2A2E78FC17; Sun, 15 Feb 2009 03:10:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1F3ALxs037808; Sun, 15 Feb 2009 03:10:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3AKSH037802; Sun, 15 Feb 2009 03:10:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150310.n1F3AKSH037802@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 03: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: r188631 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:10:21 -0000 Author: imp Date: Sun Feb 15 03:10:20 2009 New Revision: 188631 URL: http://svn.freebsd.org/changeset/base/188631 Log: Remove vestiges of OLDCARD PC Card support. We haven't needed/used this since 5.x. Deleted: head/usr.sbin/sysinstall/pccard.c Modified: head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/main.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/options.c head/usr.sbin/sysinstall/sysinstall.h head/usr.sbin/sysinstall/tcpip.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/install.c Sun Feb 15 03:10:20 2009 (r188631) @@ -1184,7 +1184,6 @@ installVarDefaults(dialogMenuItem *self) variable_set2(VAR_CPIO_VERBOSITY, "high", 0); variable_set2(VAR_INSTALL_ROOT, "/", 0); variable_set2(VAR_INSTALL_CFG, "install.cfg", 0); - variable_set2(VAR_SKIP_PCCARD, "NO", 0); cp = getenv("EDITOR"); if (!cp) cp = "/usr/bin/ee"; Modified: head/usr.sbin/sysinstall/main.c ============================================================================== --- head/usr.sbin/sysinstall/main.c Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/main.c Sun Feb 15 03:10:20 2009 (r188631) @@ -129,16 +129,6 @@ main(int argc, char **argv) pvariable_set("modulesInitialize=1"); } - /* Initialize PC Card, if we haven't already done so. */ -#ifdef PCCARD_ARCH - if (!variable_cmp(VAR_SKIP_PCCARD, "YES") && - variable_get(VAR_SKIP_PCCARD)!=1 && - !pvariable_get("pccardInitialize")) { - pccardInitialize(); - pvariable_set("pccardInitialize=1"); - } -#endif - /* Probe for all relevant devices on the system */ deviceGetAll(); Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/menus.c Sun Feb 15 03:10:20 2009 (r188631) @@ -1168,14 +1168,6 @@ DMenu MenuStartup = { { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, #endif -#ifdef PCCARD_ARCH - { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", - dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, - { " pccard mem", "Set PCCARD memory address (if enabled)", - dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, - { " pccard ifconfig", "List of PCCARD ethernet devices to configure", - dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, -#endif { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " Startup dirs", "Set the list of dirs to look for startup scripts", dmenuVarCheck, dmenuISetVariable, NULL, "local_startup" }, Modified: head/usr.sbin/sysinstall/options.c ============================================================================== --- head/usr.sbin/sysinstall/options.c Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/options.c Sun Feb 15 03:10:20 2009 (r188631) @@ -122,8 +122,6 @@ static Option Options[] = { OPT_IS_VAR, NULL, VAR_TRY_DHCP, varCheck }, { "IPv6", "Attempt IPv6 configuration of interfaces", OPT_IS_VAR, NULL, VAR_TRY_RTSOL, varCheck }, -{ "Skip PCCARD", "Skip PC Card probing, do not use PC Card devices for installation", - OPT_IS_VAR, NULL, VAR_SKIP_PCCARD, varCheck }, { "FTP username", "Username and password to use instead of anonymous", OPT_IS_FUNC, mediaSetFTPUserPass, VAR_FTP_USER, varCheck }, { "Editor", "Which text editor to use during installation", Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/sysinstall.h Sun Feb 15 03:10:20 2009 (r188631) @@ -184,7 +184,6 @@ #define VAR_SWAP_SIZE "swapSize" #define VAR_TRY_DHCP "tryDHCP" #define VAR_TRY_RTSOL "tryRTSOL" -#define VAR_SKIP_PCCARD "skipPCCARD" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" @@ -813,9 +812,6 @@ extern int package_add(char *name); extern int package_extract(Device *dev, char *name, Boolean depended); extern Boolean package_installed(char *name); -/* pccard.c */ -extern void pccardInitialize(void); - /* system.c */ extern void systemInitialize(int argc, char **argv); extern void systemShutdown(int status); Modified: head/usr.sbin/sysinstall/tcpip.c ============================================================================== --- head/usr.sbin/sysinstall/tcpip.c Sun Feb 15 03:04:20 2009 (r188630) +++ head/usr.sbin/sysinstall/tcpip.c Sun Feb 15 03:10:20 2009 (r188631) @@ -567,9 +567,6 @@ netconfig: if (!cancel) { DevInfo *di; char temp[512], ifn[255]; -#ifdef PCCARD_ARCH - char *pccard; -#endif int ipv4_enable = FALSE; if (hostname[0]) { @@ -610,12 +607,6 @@ netconfig: ipaddr, extras, netmask); variable_set2(ifn, temp, 1); } -#ifdef PCCARD_ARCH - pccard = variable_get("_pccard_install"); - if (pccard && strcmp(pccard, "YES") == 0 && ipv4_enable) { - variable_set2("pccard_ifconfig", temp, 1); - } -#endif if (use_rtsol) variable_set2(VAR_IPV6_ENABLE, "YES", 1); if (!use_dhcp) From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:12:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB86D106564A; Sun, 15 Feb 2009 03:12: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 D9E6B8FC15; Sun, 15 Feb 2009 03:12: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 n1F3Ckkn037894; Sun, 15 Feb 2009 03:12:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3CkxI037893; Sun, 15 Feb 2009 03:12:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150312.n1F3CkxI037893@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 03:12: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: r188632 - head/usr.sbin/dumpcis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:12:47 -0000 Author: imp Date: Sun Feb 15 03:12:46 2009 New Revision: 188632 URL: http://svn.freebsd.org/changeset/base/188632 Log: Remove unnecessary pccard/cardinfo.h include. Modified: head/usr.sbin/dumpcis/printcis.c Modified: head/usr.sbin/dumpcis/printcis.c ============================================================================== --- head/usr.sbin/dumpcis/printcis.c Sun Feb 15 03:10:20 2009 (r188631) +++ head/usr.sbin/dumpcis/printcis.c Sun Feb 15 03:12:46 2009 (r188632) @@ -41,7 +41,6 @@ static const char rcsid[] = #include #include -#include #include #include "readcis.h" From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:21:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF991065724; Sun, 15 Feb 2009 03:21:37 +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 990828FC13; Sun, 15 Feb 2009 03:21:37 +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 n1F3Lbwr038181; Sun, 15 Feb 2009 03:21:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3LbfS038177; Sun, 15 Feb 2009 03:21:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150321.n1F3LbfS038177@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 03:21: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: r188633 - head/usr.sbin/dumpcis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:21:38 -0000 Author: imp Date: Sun Feb 15 03:21:37 2009 New Revision: 188633 URL: http://svn.freebsd.org/changeset/base/188633 Log: Move sys/pccard/*.h here. Added: head/usr.sbin/dumpcis/cardinfo.h (props changed) - copied unchanged from r188632, head/sys/pccard/cardinfo.h head/usr.sbin/dumpcis/cis.h (props changed) - copied unchanged from r188632, head/sys/pccard/cis.h Modified: head/usr.sbin/dumpcis/printcis.c head/usr.sbin/dumpcis/readcis.c Copied: head/usr.sbin/dumpcis/cardinfo.h (from r188632, head/sys/pccard/cardinfo.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/dumpcis/cardinfo.h Sun Feb 15 03:21:37 2009 (r188633, copy of r188632, head/sys/pccard/cardinfo.h) @@ -0,0 +1,205 @@ +/* + * Include file for PCMCIA user process interface + * + *------------------------------------------------------------------------- + */ +/*- + * Copyright (c) 1995 Andrew McRae. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _PCCARD_CARDINFO_H_ +#define _PCCARD_CARDINFO_H_ + +#ifndef _KERNEL +#include +#endif +#include + +#define PIOCGSTATE _IOR('P', 1, struct slotstate) /* Get slot state */ +#define PIOCGMEM _IOWR('P', 2, struct mem_desc) /* Get memory map */ +#define PIOCSMEM _IOW('P', 3, struct mem_desc) /* Set memory map */ +#define PIOCGIO _IOWR('P', 4, struct io_desc) /* Get I/O map */ +#define PIOCSIO _IOW('P', 5, struct io_desc) /* Set I/O map */ +#define PIOCSDRV _IOWR('P', 6, struct dev_desc) /* Set driver */ +#define PIOCRWFLAG _IOW('P', 7, int) /* Set flags for drv use */ +#define PIOCRWMEM _IOWR('P', 8, unsigned long) /* Set mem for drv use */ +#define PIOCSPOW _IOW('P', 9, struct power) /* Set power structure */ +#define PIOCSVIR _IOW('P', 10, int) /* Virtual insert/remove */ +#define PIOCSBEEP _IOW('P', 11, int) /* Select Beep */ +#define PIOCSRESOURCE _IOWR('P', 12, struct pccard_resource) /* get resource info */ +/* + * Debug codes. + */ +#define PIOCGREG _IOWR('P',100, struct pcic_reg) /* get reg */ +#define PIOCSREG _IOW('P', 101, struct pcic_reg) /* Set reg */ + +/* + * Slot states for PIOCGSTATE + * + * Here's a state diagram of all the possible states: + * + * power x 1 + * ------------------- + * / \ + * / v + * resume +----------+ power x 0 +----------+ + * ------->| inactive |<--------------| filled | + * / +----------+ +----------+ + * / / \ ^ | + * nil <--------- \ insert or | | suspend or + * suspend \ power x 1 | | eject + * \ | v + * \ +----------+ + * ----------->| empty | + * eject +----------+ + * + * Note, the above diagram is for the state. On suspend, the laststate + * gets set to suspend to tell pccardd what happened. Also the nil state + * means that when the no state change has happened. Note: if you eject + * while suspended in the inactive state, you will return to the + * empty state if you do not insert a new card and to the inactive state + * if you do insert a new card. + * + * Some might argue that inactive should be sticky forever and + * eject/insert shouldn't take it out of that state. They might be + * right. On the other hand, some would argue that eject resets all + * state. They might be right. They both can't be right. The above + * represents a reasonable compromise between the two. + * + * Some bridges allow one to query to see if the card was changed while + * we were suspended. Others do not. We make no use of this functionality + * at this time. + */ +enum cardstate { noslot, empty, suspend, filled, inactive }; + +/* + * Descriptor structure for memory map. + */ +struct mem_desc { + int window; /* Memory map window number (0-4) */ + int flags; /* Flags - see below */ + caddr_t start; /* System memory start */ + int size; /* Size of memory area */ + unsigned long card; /* Card memory address */ +}; + +#define MDF_16BITS 0x01 /* Memory is 16 bits wide */ +#define MDF_ZEROWS 0x02 /* Set no wait states for memory */ +#define MDF_WS0 0x04 /* Wait state flags */ +#define MDF_WS1 0x08 +#define MDF_ATTR 0x10 /* Memory is attribute memory */ +#define MDF_WP 0x20 /* Write protect memory */ +#define MDF_ACTIVE 0x40 /* Context active (read-only) */ + +/* + * Descriptor structure for I/O map + */ +struct io_desc { + int window; /* I/O map number (0-1) */ + int flags; /* Flags - see below */ + int start; /* I/O port start */ + int size; /* Number of port addresses */ +}; + +#define IODF_WS 0x01 /* Set wait states for 16 bit I/O access */ +#define IODF_16BIT 0x02 /* I/O access are 16 bit */ +#define IODF_CS16 0x04 /* Allow card selection of 16 bit access */ +#define IODF_ZEROWS 0x08 /* No wait states for 8 bit I/O */ +#define IODF_ACTIVE 0x10 /* Context active (read-only) */ + +/* + * Device descriptor for allocation of driver. + */ +#define DEV_MISC_LEN 36 +#define DEV_MAX_CIS_LEN 40 +struct dev_desc { + char name[16]; /* Driver name */ + int unit; /* Driver unit number */ + unsigned long mem; /* Memory address of driver */ + int memsize; /* Memory size (if used) */ + int iobase; /* base of I/O ports */ + int iosize; /* Length of I/O ports */ + int irqmask; /* Interrupt number(s) to allocate */ + int flags; /* Device flags */ + uint8_t misc[DEV_MISC_LEN]; /* For any random info */ + uint8_t manufstr[DEV_MAX_CIS_LEN]; + uint8_t versstr[DEV_MAX_CIS_LEN]; + uint8_t cis3str[DEV_MAX_CIS_LEN]; + uint8_t cis4str[DEV_MAX_CIS_LEN]; + uint32_t manufacturer; /* Manufacturer ID */ + uint32_t product; /* Product ID */ + uint32_t prodext; /* Product ID (extended) */ +}; +#define DEV_DESC_HAS_SIZE 1 + +struct pcic_reg { + unsigned char reg; + unsigned char value; +}; + +/* + * Slot information. Used to read current status of slot. + */ +struct slotstate { + enum cardstate state; /* Current state of slot */ + enum cardstate laststate; /* Previous state of slot */ + int maxmem; /* Max allowed memory windows */ + int maxio; /* Max allowed I/O windows */ + int irqs; /* Bitmap of IRQs allowed */ + int flags; /* Capability flags */ +}; + +/* + * The power values are in volts * 10, e.g. 5V is 50, 3.3V is 33. + */ +struct power { + int vcc; + int vpp; +}; + +/* + * The PC-Card resource IOC_GET_RESOURCE_RANGE + */ +struct pccard_resource { + int type; + u_long size; + u_long min; + u_long max; + u_long resource_addr; +}; + + +/* + * Other system limits + */ +#define MAXSLOT 16 +#define NUM_MEM_WINDOWS 10 +#define NUM_IO_WINDOWS 6 +#define CARD_DEVICE "/dev/card%d" /* String for snprintf */ +#define PCCARD_MEMSIZE (4*1024) + +#endif /* !_PCCARD_CARDINFO_H_ */ Copied: head/usr.sbin/dumpcis/cis.h (from r188632, head/sys/pccard/cis.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/dumpcis/cis.h Sun Feb 15 03:21:37 2009 (r188633, copy of r188632, head/sys/pccard/cis.h) @@ -0,0 +1,279 @@ +/* + * PCMCIA card structures and defines. + * These defines relate to the user level + * structures and card information, not + * driver/process communication. + *------------------------------------------------------------------------- + */ +/*- + * Copyright (c) 1995 Andrew McRae. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +/* + * Card Information Structure tuples definitions + * The structure of a tuple is basically: + * + * Tuple_code + * Tuple_data_length + * Tuple_data ... + * + * Tuples are contiguous in attribute memory, and + * are terminated with a 0xFF for the tuple code or + * the tuple length. + */ +#ifndef _PCCARD_CIS_H +#define _PCCARD_CIS_H + +#define CIS_NULL 0 /* Empty tuple */ +#define CIS_MEM_COMMON 0x01 /* Device descriptor, common memory */ +#define CIS_LONGLINK_CB 0x02 /* Long link to next chain for CardBus */ +#define CIS_INDIRECT 0x03 /* Indirect access */ +#define CIS_CONF_MAP_CB 0x04 /* Card Configuration map for CardBus */ +#define CIS_CONFIG_CB 0x05 /* Card Configuration entry for CardBus */ +#define CIS_LONGLINK_MFC 0x06 /* Long link to next chain for Multi function card */ +#define CIS_BAR 0x07 /* Base address register for CardBus */ +#define CIS_CHECKSUM 0x10 /* Checksum */ +#define CIS_LONGLINK_A 0x11 /* Link to Attribute memory */ +#define CIS_LONGLINK_C 0x12 /* Link to Common memory */ +#define CIS_LINKTARGET 0x13 /* Linked tuple must start with this. */ +#define CIS_NOLINK 0x14 /* Assume no common memory link tuple. */ +#define CIS_INFO_V1 0x15 /* Card info data, version 1 */ +#define CIS_ALTSTR 0x16 /* Alternate language string tuple. */ +#define CIS_MEM_ATTR 0x17 /* Device descriptor, Attribute memory */ +#define CIS_JEDEC_C 0x18 /* JEDEC descr for common memory */ +#define CIS_JEDEC_A 0x19 /* JEDEC descr for Attribute memory */ +#define CIS_CONF_MAP 0x1A /* Card Configuration map */ +#define CIS_CONFIG 0x1B /* Card Configuration entry */ +#define CIS_DEVICE_OC 0x1C /* Other conditions info - common memory */ +#define CIS_DEVICE_OA 0x1D /* Other conditions info - attribute memory */ +#define CIS_DEVICEGEO 0x1E /* Geometry info for common memory */ +#define CIS_DEVICEGEO_A 0x1F /* Geometry info for attribute memory */ +#define CIS_MANUF_ID 0x20 /* Card manufacturer's ID */ +#define CIS_FUNC_ID 0x21 /* Function of card */ +#define CIS_FUNC_EXT 0x22 /* Functional extension */ +/* + * Data recording format tuples. + */ +#define CIS_SW_INTERLV 0x23 /* Software interleave */ +#define CIS_VERS_2 0x40 /* Card info data, version 2 */ +#define CIS_FORMAT 0x41 /* Memory card format */ +#define CIS_GEOMETRY 0x42 /* Disk sector layout */ +#define CIS_BYTEORDER 0x43 /* Byte order of memory data */ +#define CIS_DATE 0x44 /* Format data/time */ +#define CIS_BATTERY 0x45 /* Battery replacement date */ +#define CIS_ORG 0x46 /* Organization of data on card */ +#define CIS_END 0xFF /* Termination code */ + +/* + * Internal tuple definitions. + * + * Device descriptor for memory (CIS_MEM_ATTR, CIS_MEM_COMMON) + * + * Byte 1: + * 0xF0 - Device type + * 0x08 - Write protect switch + * 0x07 - Speed index (7 = extended speed) + * Byte 2: Extended speed (bit 7 = another follows) + * Byte 3: (ignored if 0xFF) + * 0xF8 - Addressable units (0's numbered) + * 0x07 - Unit size + * The three byte sequence is repeated until byte 1 == 0xFF + */ + +/* + * CIS_INFO_V1 - Version one card information. + * + * Byte 1: Major version number (should be 4) + * Byte 2: Minor version number (should be 1) + * Byte 3-x: Null terminated Manufacturer name + * Byte x-x: Null terminated product name + * Byte x-x: Null terminated additional info 1 + * Byte x-x: Null terminated additional info 2 + * Byte x: final byte must be 0xFF + */ +#define CIS_MAJOR_VERSION 4 +#define CIS_MINOR_VERSION 1 + +/* + * CIS_CONF_MAP - Provides an address map for the card + * configuration register(s), and a max value + * identifying the last configuration tuple. + * + * Byte 1: + * 0x3C - Register mask size (0's numbered) + * 0x03 - Register address size (0's numbered) + * Byte 2: + * 0x3F - ID of last configuration. + * Byte 3-n: Card register address (size is determined by + * the value in byte 1). + * Byte x-x: Card register masks (size determined by the + * value in byte 1) + */ + +/* + * CIS_CONFIG - Card configuration entry. Multiple tuples may + * exist of this type, each one describing a different + * memory/I-O map that can be used to address this card. + * The first one usually has extra config data about the + * card features. The final configuration tuple number + * is stored in the CIS_CONF_MAP tuple so that the complete + * list can be scanned. + * + * Byte 1: + * 0x3F - Configuration ID number. + * 0x40 - Indicates this is the default configuration + * 0x80 - Interface byte exists + * Byte 2: (exists only if bit 0x80 set in byte 1) + * 0x0F - Interface type value + * 0x10 - Battery voltage detect + * 0x20 - Write protect active + * 0x40 - RdyBsy active bit + * 0x80 - Wait signal required + * Byte 3: (features byte) + * 0x03 - Power sub-tuple(s) exists + * 0x04 - Timing sub-tuple exists + * 0x08 - I/O space sub-tuple exists + * 0x10 - IRQ sub-tuple exists + * 0x60 - Memory space sub-tuple(s) exists + * 0x80 - Miscellaneous sub-tuple exists + */ +#define CIS_FEAT_POWER(x) ((x) & 0x3) +#define CIS_FEAT_TIMING 0x4 +#define CIS_FEAT_I_O 0x8 +#define CIS_FEAT_IRQ 0x10 +#define CIS_FEAT_MEMORY(x) (((x) >> 5) & 0x3) +#define CIS_FEAT_MISC 0x80 +/* + * Depending on whether the "features" byte has the corresponding + * bit set, a number of sub-tuples follow. Some features have + * more than one sub-tuple, depending on the count within the + * features byte (e.g power feature bits allows up to 3 sub-tuples). + * + * Power structure sub-tuple: + * Byte 1: parameter exists - Each bit (starting from 0x01) indicates + * that a parameter block exists - up to 8 parameter blocks + * are therefore allowed). + * Byte 2: + * 0x7F - Parameter data + * 0x80 - More bytes follow (0 = last byte) + * + * Timing sub-tuple + * Byte 1: + * 0x03 - Wait scale + * 0x1C - Ready scale + * 0xE0 - Reserved scale + * Byte 2: extended wait scale if wait scale != 3 + * Byte 3: extended ready scale if ready scale != 7 + * Byte 4: extended reserved scale if reserved scale != 7 + */ +#define CIS_WAIT_SCALE(x) ((x) & 0x3) +#define CIS_READY_SCALE(x) (((x)>>2) & 0x7) +#define CIS_RESERVED_SCALE(x) (((x)>>5) & 0x7) +/* + * I/O mapping sub-tuple: + * Byte 1: + * 0x1F - I/O address lines + * 0x20 - 8 bit I/O + * 0x40 - 16 bit I/O + * 0x80 - I/O range?? + * Byte 2: + * 0x0F - 0's numbered count of I/O block subtuples following. + * 0x30 - Size of I/O address value within subtuple. Values + * can be 1 (8 bits), 2 (16 bits) or 3 (32 bits). + * 0xC0 - Size of I/O port block size value within subtuple. + * I/O block sub-tuples, count from previous block: + * Byte 1-n: I/O start address + * Byte x-x: Size of I/O port block. + */ +#define CIS_IO_ADDR(x) ((x) & 0x1F) +#define CIS_IO_8BIT 0x20 +#define CIS_IO_16BIT 0x40 +#define CIS_IO_RANGE 0x80 +#define CIS_IO_BLKS(x) ((x) & 0xF) +#define CIS_IO_ADSZ(x) (((x)>>4) & 3) +#define CIS_IO_BLKSZ(x) (((x)>>6) & 3) +/* + * IRQ sub-tuple. + * Byte 1: + * 0x0F - Irq number or mask bits + * 0x10 - IRQ mask values exist + * 0x20 - Level triggered interrupts + * 0x40 - Pulse triggered requests + * 0x80 - Interrupt sharing. + * Byte 2-3: Interrupt req mask (if 0x10 of byte 1 set). + */ +#define CIS_IRQ_IRQN(x) ((x) & 0xF) +#define CIS_IRQ_MASK 0x10 +#define CIS_IRQ_LEVEL 0x20 +#define CIS_IRQ_PULSE 0x40 +#define CIS_IRQ_SHARING 0x80 +/* + * Memory block subtuple. Depending on the features bits, the + * following subtuples are used: + * mem features == 1 + * Byte 1-2: upper 16 bits of 24 bit memory length. + * mem features == 2 + * Byte 1-2: upper 16 bits of 24 bit memory length. + * Byte 3-4: upper 16 bits of 24 bit memory address. + * mem_features == 3 + * Byte 1: + * 0x07 - 0's numbered count of memory sub-tuples + * 0x18 - Memory length size (1's numbered) + * 0x60 - Memory address size (1's numbered) + * 0x80 - Host address value exists + * Memory sub-tuples follow: + * Byte 1-n: Memory length value (<< 8) + * Byte n-n: Memory card address value (<< 8) + * Byte n-n: Memory host address value (<< 8) + */ +#define CIS_FEAT_MEM_NONE 0 /* No memory config */ +#define CIS_FEAT_MEM_LEN 1 /* Just length */ +#define CIS_FEAT_MEM_ADDR 2 /* Card address & length */ +#define CIS_FEAT_MEM_WIN 3 /* Multiple windows */ + +#define CIS_MEM_WINS(x) (((x) & 0x7)+1) +#define CIS_MEM_LENSZ(x) (((x) >> 3) & 0x3) +#define CIS_MEM_ADDRSZ(x) (((x) >> 5) & 0x3) +#define CIS_MEM_HOST 0x80 +/* + * Misc sub-tuple. + * Byte 1: + * Byte 2: + * 0x0c - DMA Request Signal + * 00 - not support DMA + * 01 - use SPKR# line + * 10 - use IOIS16# line + * 11 - use INPACK# line + * 0x10 - DMA Width + * 0 - 8 bit DMA + * 1 - 16 bit DMA + */ +#define CIS_MISC_DMA_WIDTH(x) (((x) & 0x10) >> 4) +#define CIS_MISC_DMA_REQ(x) (((x) >> 2) & 0x3) + +#endif /* _PCCARD_CIS_H */ Modified: head/usr.sbin/dumpcis/printcis.c ============================================================================== --- head/usr.sbin/dumpcis/printcis.c Sun Feb 15 03:12:46 2009 (r188632) +++ head/usr.sbin/dumpcis/printcis.c Sun Feb 15 03:21:37 2009 (r188633) @@ -41,8 +41,7 @@ static const char rcsid[] = #include #include -#include - +#include "cis.h" #include "readcis.h" static void dump_config_map(struct tuple *tp); Modified: head/usr.sbin/dumpcis/readcis.c ============================================================================== --- head/usr.sbin/dumpcis/readcis.c Sun Feb 15 03:12:46 2009 (r188632) +++ head/usr.sbin/dumpcis/readcis.c Sun Feb 15 03:21:37 2009 (r188633) @@ -40,9 +40,8 @@ static const char rcsid[] = #include #include -#include -#include - +#include "cardinfo.h" +#include "cis.h" #include "readcis.h" static int ck_linktarget(int, off_t, int); From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:22:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D8A61065670; Sun, 15 Feb 2009 03:22:15 +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 614388FC27; Sun, 15 Feb 2009 03:22:15 +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 n1F3MFR3038245; Sun, 15 Feb 2009 03:22:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3MFW0038244; Sun, 15 Feb 2009 03:22:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902150322.n1F3MFW0038244@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 03:22: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: r188634 - head/sys/pccard X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:22:16 -0000 Author: imp Date: Sun Feb 15 03:22:15 2009 New Revision: 188634 URL: http://svn.freebsd.org/changeset/base/188634 Log: This directory is no logner needed after copy to usr.sbin/dumpcis. Deleted: head/sys/pccard/ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:42:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 138E3106564A; Sun, 15 Feb 2009 03:42:16 +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 01B748FC13; Sun, 15 Feb 2009 03:42:16 +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 n1F3gEPK038614; Sun, 15 Feb 2009 03:42:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3gE6H038612; Sun, 15 Feb 2009 03:42:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902150342.n1F3gE6H038612@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 15 Feb 2009 03:42: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: r188635 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:42:16 -0000 Author: marcel Date: Sun Feb 15 03:42:14 2009 New Revision: 188635 URL: http://svn.freebsd.org/changeset/base/188635 Log: Don't remove gdbserver on ARM. It's not obsolete. In fact, it's quite nouveau... Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Feb 15 03:22:15 2009 (r188634) +++ head/ObsoleteFiles.inc Sun Feb 15 03:42:14 2009 (r188635) @@ -1670,7 +1670,7 @@ OLD_FILES+=usr/lib/libpam_ssh.a OLD_FILES+=usr/lib/libpam_ssh_p.a OLD_FILES+=usr/bin/help OLD_FILES+=usr/bin/sccs -.if ${TARGET_ARCH} != "i386" +.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" OLD_FILES+=usr/bin/gdbserver .endif OLD_FILES+=usr/bin/ssh-keysign From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 03:50:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BDB106566B; Sun, 15 Feb 2009 03:50:27 +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 B7EB68FC0A; Sun, 15 Feb 2009 03:50:27 +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 n1F3oRfY038806; Sun, 15 Feb 2009 03:50:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F3oRxi038805; Sun, 15 Feb 2009 03:50:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902150350.n1F3oRxi038805@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 15 Feb 2009 03:50: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: r188636 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 03:50:28 -0000 Author: marcel Date: Sun Feb 15 03:50:27 2009 New Revision: 188636 URL: http://svn.freebsd.org/changeset/base/188636 Log: Actually include geom_part_ebr.c when options GEOM_PART_EBR is present. Pointy hat: marcel Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 15 03:42:14 2009 (r188635) +++ head/sys/conf/files Sun Feb 15 03:50:27 2009 (r188636) @@ -1840,6 +1840,7 @@ geom/part/g_part.c standard geom/part/g_part_if.m standard geom/part/g_part_apm.c optional geom_part_apm geom/part/g_part_bsd.c optional geom_part_bsd +geom/part/g_part_ebr.c optional geom_part_ebr geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 04:12:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6600106564A; Sun, 15 Feb 2009 04:12:27 +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 72CB38FC13; Sun, 15 Feb 2009 04:12:27 +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 n1F49xhD060940; Sat, 14 Feb 2009 21:09:59 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 14 Feb 2009 21:10:01 -0700 (MST) Message-Id: <20090214.211001.-1962670480.imp@bsdimp.com> To: sam@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <499781DF.20304@freebsd.org> References: <200902131514.n1DFEhft091837@svn.freebsd.org> <4997531E.3000900@elischer.org> <499781DF.20304@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, luigi@FreeBSD.org, src-committers@FreeBSD.org, julian@elischer.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r188578 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 04:12:28 -0000 In message: <499781DF.20304@freebsd.org> Sam Leffler writes: : Julian Elischer wrote: : > Luigi Rizzo wrote: : >> Author: luigi : >> Date: Fri Feb 13 15:14:43 2009 : >> New Revision: 188578 : >> URL: http://svn.freebsd.org/changeset/base/188578 : >> : >> Log: : >> Use uint32_t instead of n_long and n_time, and uint16_t instead of : >> n_short. : >> Add a note next to fields in network format. : >> The n_* types are not enough for compiler checks on endianness, : >> and their : >> use often requires an otherwise unnecessary #include : >> : >> The typedef in in_systm.h are still there. : > : > There is a project out there (intel was involved frommemory) to make a : > compiler that knows the endianness of stuff. I know it exists because : > it was reported that one well known piece of big endian embedded : > software was compiled successfully to actually run on little endian : > machines. You can of course see why intel was interested.. : : linux has endian annotations for sparse. I've thought it would be : worthwhile to mod freebsd but it's ugly and w/o (native) tools to use : seemed pointless. I've been playing with sparse seeing if it would be useful to FreeBSD, and how intrusive the annotations would need to be to make it useful. It is still early days, though... Warner From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 06:36:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CB6106566B; Sun, 15 Feb 2009 06:36:03 +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 116E28FC0A; Sun, 15 Feb 2009 06:36:03 +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 n1F6a2km042831; Sun, 15 Feb 2009 06:36:02 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F6a2jR042830; Sun, 15 Feb 2009 06:36:02 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200902150636.n1F6a2jR042830@svn.freebsd.org> From: Kip Macy Date: Sun, 15 Feb 2009 06: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: r188637 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 06:36:03 -0000 Author: kmacy Date: Sun Feb 15 06:36:02 2009 New Revision: 188637 URL: http://svn.freebsd.org/changeset/base/188637 Log: - fix formatting - fix types in ticks_to_system_time Modified: head/sys/i386/xen/clock.c Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Sun Feb 15 03:50:27 2009 (r188636) +++ head/sys/i386/xen/clock.c Sun Feb 15 06:36:02 2009 (r188637) @@ -125,7 +125,6 @@ int wall_cmos_clock; u_int timer_freq = TIMER_FREQ; static int independent_wallclock; static int xen_disable_rtc_set; -static u_long cached_gtm; /* cached quotient for TSC -> microseconds */ static u_long cyc2ns_scale; static struct timespec shadow_tv; static uint32_t shadow_tv_version; /* XXX: lazy locking */ @@ -205,8 +204,8 @@ scale_delta(uint64_t delta, uint32_t mul "mov %4,%%eax ; " "mov %%edx,%4 ; " "mul %5 ; " - "add %4,%%eax ; " "xor %5,%5 ; " + "add %4,%%eax ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) ); @@ -214,7 +213,8 @@ scale_delta(uint64_t delta, uint32_t mul return product; } -static uint64_t get_nsec_offset(struct shadow_time_info *shadow) +static uint64_t +get_nsec_offset(struct shadow_time_info *shadow) { uint64_t now, delta; rdtscll(now); @@ -507,13 +507,6 @@ startrtclock() /* (10^6 * 2^32) / cpu_hz = (10^3 * 2^32) / cpu_khz = (2^32 * 1 / (clocks/us)) */ - { - unsigned long eax=0, edx=1000; - __asm__("divl %2" - :"=a" (cached_gtm), "=d" (edx) - :"r" (cpu_khz), - "0" (eax), "1" (edx)); - } set_cyc2ns_scale(cpu_khz/1000); tsc_freq = cpu_khz * 1000; @@ -761,9 +754,9 @@ cpu_initclocks(void) { unsigned int time_irq; int error; - - xen_set_periodic_tick.period_ns = NS_PER_TICK; + xen_set_periodic_tick.period_ns = NS_PER_TICK; + HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0, &xen_set_periodic_tick); @@ -772,8 +765,6 @@ cpu_initclocks(void) INTR_TYPE_CLK | INTR_FAST, &time_irq); if (error) panic("failed to register clock interrupt\n"); - - /* should fast clock be enabled ? */ } @@ -840,63 +831,29 @@ get_system_time(int ticks) * Track behavior of cur_timer->get_offset() functionality in timer_tsc.c */ -#if 0 -static uint32_t -xen_get_offset(void) -{ - register unsigned long eax, edx; - - /* Read the Time Stamp Counter */ - - rdtsc(eax,edx); - - /* .. relative to previous jiffy (32 bits is enough) */ - eax -= shadow_tsc_stamp; - - /* - * Time offset = (tsc_low delta) * cached_gtm - * = (tsc_low delta) * (usecs_per_clock) - * = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy) - * - * Using a mull instead of a divl saves up to 31 clock cycles - * in the critical path. - */ - - __asm__("mull %2" - :"=a" (eax), "=d" (edx) - :"rm" (cached_gtm), - "0" (eax)); - - /* our adjusted time offset in microseconds */ - return edx; -} -#endif /* Convert jiffies to system time. */ static uint64_t -ticks_to_system_time(unsigned long newticks) +ticks_to_system_time(int newticks) { -#if 0 - unsigned long seq; -#endif - long delta; - uint64_t st; - + int delta; + uint64_t st; - delta = newticks - ticks; - if (delta < 1) { - /* Triggers in some wrap-around cases, but that's okay: - * we just end up with a shorter timeout. */ - st = processed_system_time + NS_PER_TICK; - } else if (((unsigned long)delta >> (BITS_PER_LONG-3)) != 0) { - /* Very long timeout means there is no pending timer. - * We indicate this to Xen by passing zero timeout. */ - st = 0; - } else { - st = processed_system_time + delta * (uint64_t)NS_PER_TICK; - } + delta = newticks - ticks; + if (delta < 1) { + /* Triggers in some wrap-around cases, + * but that's okay: + * we just end up with a shorter timeout. */ + st = processed_system_time + NS_PER_TICK; + } else if (((unsigned int)delta >> (BITS_PER_LONG-3)) != 0) { + /* Very long timeout means there is no pending timer. + * We indicate this to Xen by passing zero timeout. */ + st = 0; + } else { + st = processed_system_time + delta * (uint64_t)NS_PER_TICK; + } - return (st); + return (st); } void @@ -904,7 +861,7 @@ idle_block(void) { uint64_t timeout; - timeout = ticks_to_system_time(ticks + 1) + NS_PER_TICK/2; + timeout = ticks_to_system_time(ticks + 1) + NS_PER_TICK/2; __get_time_values_from_xen(); PANIC_IF(HYPERVISOR_set_timer_op(timeout) != 0); From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 09:49:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33022106566B; Sun, 15 Feb 2009 09:49:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A3D8FC14; Sun, 15 Feb 2009 09:49:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1F9nM2J062037; Sun, 15 Feb 2009 09:49:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F9nMcb062036; Sun, 15 Feb 2009 09:49:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902150949.n1F9nMcb062036@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 09:49: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: r188639 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 09:49:22 -0000 Author: mav Date: Sun Feb 15 09:49:21 2009 New Revision: 188639 URL: http://svn.freebsd.org/changeset/base/188639 Log: Add SATA and PCI Advanced Features capabilities constants. Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Sun Feb 15 06:37:34 2009 (r188638) +++ head/sys/dev/pci/pcireg.h Sun Feb 15 09:49:21 2009 (r188639) @@ -112,6 +112,8 @@ #define PCIY_SECDEV 0x0f /* Secure Device */ #define PCIY_EXPRESS 0x10 /* PCI Express */ #define PCIY_MSIX 0x11 /* MSI-X */ +#define PCIY_SATA 0x12 /* SATA */ +#define PCIY_PCIAF 0x13 /* PCI Advanced Features */ /* config registers for header type 0 devices */ @@ -611,3 +613,12 @@ #define PCIM_MSIX_BIR_BAR_20 4 #define PCIM_MSIX_BIR_BAR_24 5 #define PCIM_MSIX_VCTRL_MASK 0x1 + +/* PCI Advanced Features definitions */ +#define PCIR_PCIAF_CAP 0x3 +#define PCIM_PCIAFCAP_TP 0x01 +#define PCIM_PCIAFCAP_FLR 0x02 +#define PCIR_PCIAF_CTRL 0x4 +#define PCIR_PCIAFCTRL_FLR 0x01 +#define PCIR_PCIAF_STATUS 0x5 +#define PCIR_PCIAFSTATUS_TP 0x01 From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 09:56:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C9C5106564A; Sun, 15 Feb 2009 09:56:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B04F8FC16; Sun, 15 Feb 2009 09:56:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1F9ulif062862; Sun, 15 Feb 2009 09:56:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1F9ulEG062861; Sun, 15 Feb 2009 09:56:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902150956.n1F9ulEG062861@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 09:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188640 - head/usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 09:56:47 -0000 Author: mav Date: Sun Feb 15 09:56:47 2009 New Revision: 188640 URL: http://svn.freebsd.org/changeset/base/188640 Log: Add SATA and PCI Advanced Features capabilities reporting. Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Sun Feb 15 09:49:21 2009 (r188639) +++ head/usr.sbin/pciconf/cap.c Sun Feb 15 09:56:47 2009 (r188640) @@ -414,6 +414,24 @@ cap_msix(int fd, struct pci_conf *p, uin printf(" enabled"); } +static void +cap_sata(int fd, struct pci_conf *p, uint8_t ptr) +{ + + printf("SATA Index-Data Pair"); +} + +static void +cap_pciaf(int fd, struct pci_conf *p, uint8_t ptr) +{ + uint8_t cap; + + cap = read_config(fd, &p->pc_sel, ptr + PCIR_PCIAF_CAP, 1); + printf("PCI Advanced Features: %s%s", + (cap & PCIM_PCIAFCAP_FLR)?"FLR ":"", + (cap & PCIM_PCIAFCAP_TP)?"TP ":""); +} + void list_caps(int fd, struct pci_conf *p) { @@ -476,6 +494,12 @@ list_caps(int fd, struct pci_conf *p) case PCIY_MSIX: cap_msix(fd, p, ptr); break; + case PCIY_SATA: + cap_sata(fd, p, ptr); + break; + case PCIY_PCIAF: + cap_pciaf(fd, p, ptr); + break; default: printf("unknown"); break; From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 10:41:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB9E1065672; Sun, 15 Feb 2009 10:41:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA2878FC1A; Sun, 15 Feb 2009 10:41:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FAfgOj071808; Sun, 15 Feb 2009 10:41:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FAfg0s071807; Sun, 15 Feb 2009 10:41:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902151041.n1FAfg0s071807@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 10:41: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: r188641 - head/usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 10:41:43 -0000 Author: mav Date: Sun Feb 15 10:41:42 2009 New Revision: 188641 URL: http://svn.freebsd.org/changeset/base/188641 Log: Tune output to remove trailing space. Submitted by: Christoph Mallon Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Sun Feb 15 09:56:47 2009 (r188640) +++ head/usr.sbin/pciconf/cap.c Sun Feb 15 10:41:42 2009 (r188641) @@ -427,9 +427,9 @@ cap_pciaf(int fd, struct pci_conf *p, ui uint8_t cap; cap = read_config(fd, &p->pc_sel, ptr + PCIR_PCIAF_CAP, 1); - printf("PCI Advanced Features: %s%s", - (cap & PCIM_PCIAFCAP_FLR)?"FLR ":"", - (cap & PCIM_PCIAFCAP_TP)?"TP ":""); + printf("PCI Advanced Features:%s%s", + cap & PCIM_PCIAFCAP_FLR ? " FLR" : "", + cap & PCIM_PCIAFCAP_TP ? " TP" : ""); } void From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 11:05:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA3E10656C4; Sun, 15 Feb 2009 11:05:50 +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 D9EA18FC15; Sun, 15 Feb 2009 11:05:50 +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 n1FB5ogF074376; Sun, 15 Feb 2009 11:05:50 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FB5opL074374; Sun, 15 Feb 2009 11:05:50 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200902151105.n1FB5opL074374@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 15 Feb 2009 11:05: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: r188642 - in head: etc/mtree include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 11:05:51 -0000 Author: nyan Date: Sun Feb 15 11:05:50 2009 New Revision: 188642 URL: http://svn.freebsd.org/changeset/base/188642 Log: sys/pccard is gone. Modified: head/etc/mtree/BSD.include.dist head/include/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sun Feb 15 10:41:42 2009 (r188641) +++ head/etc/mtree/BSD.include.dist Sun Feb 15 11:05:50 2009 (r188642) @@ -255,8 +255,6 @@ .. openssl .. - pccard - .. protocols .. readline Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Feb 15 10:41:42 2009 (r188641) +++ head/include/Makefile Sun Feb 15 11:05:50 2009 (r188642) @@ -36,7 +36,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set. LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ netipsec ${_netipx} netnatm ${_netncp} netsmb \ nfs nfsclient nfsserver \ - pccard sys vm + sys vm LSUBDIRS= cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 11:47:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9ABE106566B; Sun, 15 Feb 2009 11:47:59 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) by mx1.freebsd.org (Postfix) with ESMTP id 72CCD8FC1D; Sun, 15 Feb 2009 11:47:59 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.21] (helo=11.mx.freenet.de) by mout0.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LYfTa-00009K-4C; Sun, 15 Feb 2009 12:47:58 +0100 Received: from taa85.t.pppool.de ([89.55.170.133]:45132 helo=ernst.jennejohn.org) by 11.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LYfTZ-0000O3-SI; Sun, 15 Feb 2009 12:47:58 +0100 Date: Sun, 15 Feb 2009 12:47:57 +0100 From: Gary Jennejohn To: svn-src-head@freebsd.org Message-ID: <20090215124757.4aacabbc@ernst.jennejohn.org> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: booting with ATA-AHCI now broken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 11:48:00 -0000 The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks booting on my machine. I didn't save the commit message so I can't quote the exact commit revision number. _Every_ ata port now times out. Here the relevant bits from pciconf: atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 vendor = 'ATI Technologies Inc' class = mass storage subclass = SATA --- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 12:06:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A1721065678; Sun, 15 Feb 2009 12:06:28 +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 1210B8FC20; Sun, 15 Feb 2009 12:06:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 234671993; Sun, 15 Feb 2009 14:06:26 +0200 Message-ID: <4998053F.7040506@FreeBSD.org> Date: Sun, 15 Feb 2009 14:06:23 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.19 (X11/20090118) MIME-Version: 1.0 To: gary.jennejohn@freenet.de References: <20090215124757.4aacabbc@ernst.jennejohn.org> In-Reply-To: <20090215124757.4aacabbc@ernst.jennejohn.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: booting with ATA-AHCI now broken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 12:06:29 -0000 Gary Jennejohn wrote: > The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks > booting on my machine. > > I didn't save the commit message so I can't quote the exact commit > revision number. > > _Every_ ata port now times out. > > Here the relevant bits from pciconf: > > atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 > vendor = 'ATI Technologies Inc' > class = mass storage > subclass = SATA Can you somehow show me verbose boot messages with the problem? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 12:10:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97D8E106566C; Sun, 15 Feb 2009 12:10:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85DD48FC1B; Sun, 15 Feb 2009 12:10:05 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FCA5tM078409; Sun, 15 Feb 2009 12:10:05 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FCA5uZ078408; Sun, 15 Feb 2009 12:10:05 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200902151210.n1FCA5uZ078408@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 15 Feb 2009 12:10: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: r188643 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 12:10:06 -0000 Author: bms Date: Sun Feb 15 12:10:05 2009 New Revision: 188643 URL: http://svn.freebsd.org/changeset/base/188643 Log: Fix a typo which caused ifmcstat's sysctl path to print the network-layer endpoint address of the group membership, rather than its link-layer mapping as intended. The KVM path is not affected. MFC after: 1 week Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 11:05:50 2009 (r188642) +++ head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 12:10:05 2009 (r188643) @@ -768,7 +768,7 @@ ifmcstat_getifmaddrs(void) /* Link-layer mapping, if present. */ pllsa = (sockunion_t *)ifma->ifma_lladdr; if (pllsa != NULL) { - error = getnameinfo(&pifasa->sa, pifasa->sa.sa_len, + error = getnameinfo(&pllsa->sa, pllsa->sa.sa_len, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); fprintf(stdout, "\t\t\tmcast-macaddr %s\n", addrbuf); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 12:42:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42FDF106566B; Sun, 15 Feb 2009 12:42:46 +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 4EDF48FC0A; Sun, 15 Feb 2009 12:42:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 234673748; Sun, 15 Feb 2009 14:42:44 +0200 Message-ID: <49980DC1.7090900@FreeBSD.org> Date: Sun, 15 Feb 2009 14:42:41 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.19 (X11/20090118) MIME-Version: 1.0 To: gary.jennejohn@freenet.de References: <20090215124757.4aacabbc@ernst.jennejohn.org> In-Reply-To: <20090215124757.4aacabbc@ernst.jennejohn.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: booting with ATA-AHCI now broken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 12:42:46 -0000 Gary Jennejohn wrote: > The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks > booting on my machine. > > I didn't save the commit message so I can't quote the exact commit > revision number. > > _Every_ ata port now times out. > > Here the relevant bits from pciconf: > > atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 > vendor = 'ATI Technologies Inc' > class = mass storage > subclass = SATA According to Linux drivers, this chip has bug with port multiplier probing which this commit may trigger. Can you try to change 'ata_ahci_softreset(dev, ATA_PM)' with 'ata_ahci_softreset(dev, 0)' in ata-ahci.c to check it? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 13:22:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E13E106566C; Sun, 15 Feb 2009 13:22:22 +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 2C32C8FC1F; Sun, 15 Feb 2009 13:22:22 +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 n1FDMMZV079752; Sun, 15 Feb 2009 13:22:22 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FDMMYt079751; Sun, 15 Feb 2009 13:22:22 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200902151322.n1FDMMYt079751@svn.freebsd.org> From: Ulf Lilleengen Date: Sun, 15 Feb 2009 13:22: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: r188644 - head/contrib/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 13:22:22 -0000 Author: lulf Date: Sun Feb 15 13:22:21 2009 New Revision: 188644 URL: http://svn.freebsd.org/changeset/base/188644 Log: - Do not free the pattern lists immediately after use, as they might be needed again in case the connection is interrupted and csup have to reconnect. The lists will be freed after the collection has been completely processed. PR: bin/131477 Tested by: dchagin Modified: head/contrib/csup/proto.c Modified: head/contrib/csup/proto.c ============================================================================== --- head/contrib/csup/proto.c Sun Feb 15 12:10:05 2009 (r188643) +++ head/contrib/csup/proto.c Sun Feb 15 13:22:21 2009 (r188644) @@ -521,12 +521,6 @@ proto_xchgcoll(struct config *config) coll->co_filefilter = globtree_and(fileaccept, globtree_not(filerefuse)); - /* At this point we don't need the pattern lists anymore. */ - pattlist_free(coll->co_accepts); - pattlist_free(coll->co_refusals); - coll->co_accepts = NULL; - coll->co_refusals = NULL; - /* Set up a mask of file attributes that we don't want to sync with the server. */ if (!(coll->co_options & CO_SETOWNER)) From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 13:32:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4D7F1065674; Sun, 15 Feb 2009 13:32:21 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout1.freenet.de (mout1.freenet.de [IPv6:2001:748:100:40::2:3]) by mx1.freebsd.org (Postfix) with ESMTP id 3B24C8FC13; Sun, 15 Feb 2009 13:32:21 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.10] (helo=0.mx.freenet.de) by mout1.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LYh6a-0008KW-3F; Sun, 15 Feb 2009 14:32:20 +0100 Received: from taa85.t.pppool.de ([89.55.170.133]:16218 helo=ernst.jennejohn.org) by 0.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #76) id 1LYh6Z-0004mh-N2; Sun, 15 Feb 2009 14:32:19 +0100 Date: Sun, 15 Feb 2009 14:32:19 +0100 From: Gary Jennejohn To: Alexander Motin Message-ID: <20090215143219.718a8bec@ernst.jennejohn.org> In-Reply-To: <49980DC1.7090900@FreeBSD.org> References: <20090215124757.4aacabbc@ernst.jennejohn.org> <49980DC1.7090900@FreeBSD.org> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; amd64-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: booting with ATA-AHCI now broken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 13:32:22 -0000 On Sun, 15 Feb 2009 14:42:41 +0200 Alexander Motin wrote: > Gary Jennejohn wrote: > > The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks > > booting on my machine. > > > > I didn't save the commit message so I can't quote the exact commit > > revision number. > > > > _Every_ ata port now times out. > > > > Here the relevant bits from pciconf: > > > > atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 > > vendor = 'ATI Technologies Inc' > > class = mass storage > > subclass = SATA > > According to Linux drivers, this chip has bug with port multiplier > probing which this commit may trigger. Can you try to change > 'ata_ahci_softreset(dev, ATA_PM)' with 'ata_ahci_softreset(dev, 0)' in > ata-ahci.c to check it? > Yes, that fixes it. Thanks for the quick response. Do you still want the verbose boot output? --- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 14:44:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E9C106566C; Sun, 15 Feb 2009 14:44:55 +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 0D4588FC08; Sun, 15 Feb 2009 14:44:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 234678607; Sun, 15 Feb 2009 16:44:52 +0200 Message-ID: <49982A62.1040507@FreeBSD.org> Date: Sun, 15 Feb 2009 16:44:50 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.19 (X11/20090118) MIME-Version: 1.0 To: gary.jennejohn@freenet.de References: <20090215124757.4aacabbc@ernst.jennejohn.org> <49980DC1.7090900@FreeBSD.org> <20090215143219.718a8bec@ernst.jennejohn.org> In-Reply-To: <20090215143219.718a8bec@ernst.jennejohn.org> Content-Type: multipart/mixed; boundary="------------050207020204000004060502" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: booting with ATA-AHCI now broken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 14:44:55 -0000 This is a multi-part message in MIME format. --------------050207020204000004060502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Gary Jennejohn wrote: > On Sun, 15 Feb 2009 14:42:41 +0200 > Alexander Motin wrote: > >> Gary Jennejohn wrote: >>> The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks >>> booting on my machine. >>> >>> I didn't save the commit message so I can't quote the exact commit >>> revision number. >>> >>> _Every_ ata port now times out. >>> >>> Here the relevant bits from pciconf: >>> >>> atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 >>> vendor = 'ATI Technologies Inc' >>> class = mass storage >>> subclass = SATA >> According to Linux drivers, this chip has bug with port multiplier >> probing which this commit may trigger. Can you try to change >> 'ata_ahci_softreset(dev, ATA_PM)' with 'ata_ahci_softreset(dev, 0)' in >> ata-ahci.c to check it? >> > > Yes, that fixes it. Thanks for the quick response. > > Do you still want the verbose boot output? Please try attached patch instead, it should be more correct solution, and send me it's output instead. -- Alexander Motin --------------050207020204000004060502 Content-Type: text/plain; name="ata.ati_pm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata.ati_pm.patch" diff -ruNp ata.prev3/chipsets/ata-ahci.c ata/chipsets/ata-ahci.c --- ata.prev3/chipsets/ata-ahci.c 2009-02-14 23:07:18.000000000 +0200 +++ ata/chipsets/ata-ahci.c 2009-02-15 16:36:39.000000000 +0200 @@ -595,7 +595,7 @@ ata_ahci_start(device_t dev) (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); } -static void +static int ata_ahci_wait_ready(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -608,11 +608,12 @@ ata_ahci_wait_ready(device_t dev) DELAY(1000); if (timeout++ > 1000) { device_printf(dev, "port is not ready\n"); - break; + return (-1); } } if (bootverbose) device_printf(dev, "ready wait time=%dms\n", timeout); + return (0); } static u_int32_t @@ -651,7 +652,8 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - ata_ahci_wait_ready(dev); + if (ata_ahci_wait_ready(dev)) + return (-1); return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } @@ -713,9 +715,14 @@ ata_ahci_reset(device_t dev) ata_ahci_wait_ready(dev); /* only probe for PortMultiplier if HW has support */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) + if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { signature = ata_ahci_softreset(dev, ATA_PM); - else { + /* Workaround for some ATI chips, failing to soft-reset + * when port multiplicator supported, but absent. + * XXX: We can also check PxIS.IPMS==1 here to be sure. */ + if (signature == 0xffffffff) + signature = ata_ahci_softreset(dev, 0); + } else { signature = ata_ahci_softreset(dev, 0); } if (bootverbose) --------------050207020204000004060502-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 15:19:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B761065674; Sun, 15 Feb 2009 15:19:35 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4348FC19; Sun, 15 Feb 2009 15:19:35 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FFJYCk081895; Sun, 15 Feb 2009 15:19:34 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FFJYlW081893; Sun, 15 Feb 2009 15:19:34 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200902151519.n1FFJYlW081893@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 15 Feb 2009 15:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188645 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 15:19:36 -0000 Author: bms Date: Sun Feb 15 15:19:34 2009 New Revision: 188645 URL: http://svn.freebsd.org/changeset/base/188645 Log: Improve ifmcstat(8) and fix a few bugs while we're at it: * Retire the old 'ifmcstat ' usage. * Print AF_LINK records even if run against KVM. This makes the KVM backend consistent with the sysctl backend. * Suppress printing of link-layer group records by default. * Add a -v switch to allow link-layer groups to be printed. * If compiled without INET6 support, actually work. * If compiled with INET6 support, print the scope ID of all IPv6 addresses in both backends. * Update man page. * Update copyrights. With this change, it is now reasonable to retire netstat -g. Most of the SSM related gunk in this file will require later refactoring. MFC after: 2 weeks Modified: head/usr.sbin/ifmcstat/ifmcstat.8 head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.8 ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.8 Sun Feb 15 13:22:21 2009 (r188644) +++ head/usr.sbin/ifmcstat/ifmcstat.8 Sun Feb 15 15:19:34 2009 (r188645) @@ -1,5 +1,6 @@ .\" $KAME: ifmcstat.8,v 1.6 2002/10/31 04:23:43 suz Exp $ .\" +.\" Copyright (c) 2007-2009 Bruce Simpson. .\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. .\" All rights reserved. .\" @@ -29,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd February 15, 2009 .Dt IFMCSTAT 8 .Os .Sh NAME @@ -39,10 +40,9 @@ .Nm .Op Fl i Ar interface .Op Fl f Ar address-family +.Op Fl v .Op Fl M Ar core .Op Fl N Ar system -.Nm -.Op Ar kernel .\" .Sh DESCRIPTION The @@ -55,17 +55,23 @@ The following options are supported: specifies the interface to be displayed. .Pp .It Fl f Ar address-family -specifies the address-family to be displayed; currently only -.Ar inet -and +specifies the address family to be displayed; +.Ar inet , .Ar inet6 +and +.Ar link are supported. +.It Fl v +specifies that link-layer memberships should be printed; +they are suppressed by default. +It may not be specified for +.Fl f Ar link . .El .Pp The following options are only available if .Nm has been built with support for -.Xr kvm 3 . +.Xr kvm 3 : .Bl -tag -width Fl .It Fl M Ar core extracts values associated with the name list from the specified core, @@ -74,24 +80,11 @@ instead of the default .It Fl N Ar system extracts the name list from the specified kernel instead of the default, which is the kernel image the system has booted from. -.It Nm Ar system -This is the same as specifying -.Nm -.Fl N Ar system . -This usage is deprecated; it is supported only for backwards compatibility. .El .Sh IMPLEMENTATION NOTES -When built without -.Xr kvm 3 -support, the information displayed by -.Nm -is more limited. -This support is recommended for debugging purposes. -It requires superuser privilege if used to inspect a running kernel. -.Pp -When run without using -.Xr kvm 3 -support, +When run with the +.Fl v +option, .Nm may print multicast MAC addresses twice if they are referenced by a layer 3 protocol. @@ -101,16 +94,24 @@ When run with support, the names of all interfaces configured in the system will be printed in the first column of output, even if no multicast -addresses are configured on those interfaces. +group memberships are present on those interfaces. +The output may also be slightly different, as the kernel +data structures are being traversed with minimal post-processing +of the output. +.Pp +When built without +.Xr kvm 3 +support, the information displayed by +.Nm +is more limited. +This support is recommended for debugging purposes. +It requires super-user privilege if used to inspect a running kernel. +.Xr kvm 3 +will be used by default if +.Nm +is run with super-user privileges. .Sh SEE ALSO .Xr getifaddrs 3 , .Xr getifmaddrs 3 , .Xr kvm 3 , .Xr netstat 8 -.Sh BUGS -.Nm -does not support the -.Ar link -argument to the -.Ar address-family -option. Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 13:22:21 2009 (r188644) +++ head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 15:19:34 2009 (r188645) @@ -1,7 +1,7 @@ /* $KAME: ifmcstat.c,v 1.48 2006/11/15 05:13:59 itojun Exp $ */ /* - * Copyright (c) 2007 Bruce M. Simpson + * Copyright (c) 2007-2009 Bruce Simpson. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * @@ -111,6 +111,7 @@ typedef union sockunion sockunion_t; uint32_t ifindex = 0; int af = AF_UNSPEC; +int vflag = 0; #define sa_equal(a1, a2) \ (bcmp((a1), (a2), ((a1))->sa_len) == 0) @@ -144,10 +145,11 @@ static struct in6_multi * #ifdef HAVE_MLDV2 static void in6_addr_slistentry(struct in6_addr_slist *, char *); #endif -static const char * inet6_n2a(struct in6_addr *); #endif /* INET6 */ static void kread(u_long, void *, int); +static void ll_addrlist(struct ifaddr *); + static int ifmcstat_kvm(const char *kernel, const char *core); #define KREAD(addr, buf, type) \ @@ -163,8 +165,25 @@ struct nlist nl[] = { #endif /* WITH_KVM */ static int ifmcstat_getifmaddrs(void); +#ifdef INET6 +static const char * inet6_n2a(struct in6_addr *); +#endif int main(int, char **); +static void +usage() +{ + + fprintf(stderr, + "usage: ifmcstat [-i interface] [-f address family]" + " [-v]" +#ifdef WITH_KVM + " [-M core] [-N system]" +#endif + "\n"); + exit(EX_USAGE); +} + int main(int argc, char **argv) { @@ -172,13 +191,9 @@ main(int argc, char **argv) #ifdef WITH_KVM const char *kernel = NULL; const char *core = NULL; - - /* "ifmcstat [kernel]" format is supported for backward compatiblity */ - if (argc == 2) - kernel = argv[1]; #endif - while ((c = getopt(argc, argv, "i:f:M:N:")) != -1) { + while ((c = getopt(argc, argv, "i:f:vM:N:")) != -1) { switch (c) { case 'i': if ((ifindex = if_nametoindex(optarg)) == 0) { @@ -201,11 +216,19 @@ main(int argc, char **argv) break; } #endif + if (strcmp(optarg, "link") == 0) { + af = AF_LINK; + break; + } fprintf(stderr, "%s: unknown address family\n", optarg); exit(1); /*NOTREACHED*/ break; + case 'v': + vflag = 1; + break; + #ifdef WITH_KVM case 'M': core = strdup(optarg); @@ -217,18 +240,15 @@ main(int argc, char **argv) #endif default: - fprintf(stderr, - "usage: ifmcstat [-i interface] [-f address family]" -#ifdef WITH_KVM - " [-M core] [-N system]" -#endif - "\n"); - exit(1); + usage(); break; /*NOTREACHED*/ } } + if (af == AF_LINK && vflag) + usage(); + #ifdef WITH_KVM error = ifmcstat_kvm(kernel, core); /* @@ -280,6 +300,8 @@ ifmcstat_kvm(const char *kernel, const c #ifdef INET6 if6_addrlist(TAILQ_FIRST(&ifnet.if_addrhead)); #endif + if (vflag) + ll_addrlist(TAILQ_FIRST(&ifnet.if_addrhead)); next: ifp = nifp; } @@ -297,36 +319,67 @@ kread(u_long addr, void *buf, int len) } } -#ifdef INET6 - -static const char * -inet6_n2a(struct in6_addr *p) +static void +ll_addrlist(struct ifaddr *ifap) { - static char buf[NI_MAXHOST]; - struct sockaddr_in6 sin6; - u_int32_t scopeid; - const int niflags = NI_NUMERICHOST; + char addrbuf[NI_MAXHOST]; + struct ifaddr ifa; + struct sockaddr sa; + struct sockaddr_dl sdl; + struct ifaddr *ifap0; + int error; - memset(&sin6, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr = *p; - if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p) || - IN6_IS_ADDR_MC_NODELOCAL(p)) { - scopeid = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); - if (scopeid) { - sin6.sin6_scope_id = scopeid; - sin6.sin6_addr.s6_addr[2] = 0; - sin6.sin6_addr.s6_addr[3] = 0; + if (af && af != AF_LINK) + return; + + ifap0 = ifap; + while (ifap) { + KREAD(ifap, &ifa, struct ifaddr); + if (ifa.ifa_addr == NULL) + goto nextifap; + KREAD(ifa.ifa_addr, &sa, struct sockaddr); + if (sa.sa_family != PF_LINK) + goto nextifap; + KREAD(ifa.ifa_addr, &sdl, struct sockaddr_dl); + if (sdl.sdl_alen == 0) + goto nextifap; + addrbuf[0] = '\0'; + error = getnameinfo((struct sockaddr *)&sdl, sdl.sdl_len, + addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); + printf("\tlink %s\n", addrbuf); + nextifap: + ifap = ifa.ifa_link.tqe_next; + } + if (ifap0) { + struct ifnet ifnet; + struct ifmultiaddr ifm, *ifmp = 0; + + KREAD(ifap0, &ifa, struct ifaddr); + KREAD(ifa.ifa_ifp, &ifnet, struct ifnet); + if (TAILQ_FIRST(&ifnet.if_multiaddrs)) + ifmp = TAILQ_FIRST(&ifnet.if_multiaddrs); + while (ifmp) { + KREAD(ifmp, &ifm, struct ifmultiaddr); + if (ifm.ifma_addr == NULL) + goto nextmulti; + KREAD(ifm.ifma_addr, &sa, struct sockaddr); + if (sa.sa_family != AF_LINK) + goto nextmulti; + KREAD(ifm.ifma_addr, &sdl, struct sockaddr_dl); + addrbuf[0] = '\0'; + error = getnameinfo((struct sockaddr *)&sdl, + sdl.sdl_len, addrbuf, sizeof(addrbuf), + NULL, 0, NI_NUMERICHOST); + printf("\t\tgroup %s refcnt %d\n", + addrbuf, ifm.ifma_refcount); + nextmulti: + ifmp = TAILQ_NEXT(&ifm, ifma_link); } } - if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, - buf, sizeof(buf), NULL, 0, niflags) == 0) - return buf; - else - return "(invalid)"; } +#ifdef INET6 + static void if6_addrlist(struct ifaddr *ifap) { @@ -619,11 +672,41 @@ in_addr_slistentry(struct in_addr_slist #endif /* WITH_KVM */ +#ifdef INET6 +static const char * +inet6_n2a(struct in6_addr *p) +{ + static char buf[NI_MAXHOST]; + struct sockaddr_in6 sin6; + u_int32_t scopeid; + const int niflags = NI_NUMERICHOST; + + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_addr = *p; + if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p) || + IN6_IS_ADDR_MC_NODELOCAL(p)) { + scopeid = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); + if (scopeid) { + sin6.sin6_scope_id = scopeid; + sin6.sin6_addr.s6_addr[2] = 0; + sin6.sin6_addr.s6_addr[3] = 0; + } + } + if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, + buf, sizeof(buf), NULL, 0, niflags) == 0) + return buf; + else + return "(invalid)"; +} +#endif /* INET6 */ + static int ifmcstat_getifmaddrs(void) { char thisifname[IFNAMSIZ]; - char addrbuf[INET6_ADDRSTRLEN]; + char addrbuf[NI_MAXHOST]; struct ifaddrs *ifap, *ifa; struct ifmaddrs *ifmap, *ifma; sockunion_t lastifasa; @@ -698,25 +781,28 @@ ifmcstat_getifmaddrs(void) (ifa->ifa_addr == NULL) || (ifa->ifa_addr->sa_family != pgsa->sa.sa_family)) continue; -#ifdef INET6 /* * For AF_INET6 only the link-local address should - * be returned. - * XXX: ifmcstat actually prints all of the inet6 - * addresses, but never mind... + * be returned. If built without IPv6 support, + * skip this address entirely. */ pifasa = (sockunion_t *)ifa->ifa_addr; - if (pifasa->sa.sa_family == AF_INET6 && - !IN6_IS_ADDR_LINKLOCAL(&pifasa->sin6.sin6_addr)) { + if (pifasa->sa.sa_family == AF_INET6 +#ifdef INET6 + && !IN6_IS_ADDR_LINKLOCAL(&pifasa->sin6.sin6_addr) +#endif + ) { pifasa = NULL; continue; } -#endif break; } if (pifasa == NULL) continue; /* primary address not found */ + if (!vflag && pifasa->sa.sa_family == AF_LINK) + continue; + /* Parse and print primary address, if not already printed. */ if (lastifasa.ss.ss_family == AF_UNSPEC || ((lastifasa.ss.ss_family == AF_LINK && @@ -739,8 +825,18 @@ ifmcstat_getifmaddrs(void) } switch (pifasa->sa.sa_family) { - case AF_INET: case AF_INET6: +#ifdef INET6 + { + const char *p = + inet6_n2a(&pifasa->sin6.sin6_addr); + strlcpy(addrbuf, p, sizeof(addrbuf)); + break; + } +#else + /* FALLTHROUGH */ +#endif + case AF_INET: case AF_LINK: error = getnameinfo(&pifasa->sa, pifasa->sa.sa_len, @@ -759,10 +855,19 @@ ifmcstat_getifmaddrs(void) } /* Print this group address. */ - error = getnameinfo(&pgsa->sa, pgsa->sa.sa_len, addrbuf, - sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); - if (error) - perror("getnameinfo"); +#ifdef INET6 + if (pgsa->sa.sa_family == AF_INET6) { + const char *p = inet6_n2a(&pgsa->sin6.sin6_addr); + strlcpy(addrbuf, p, sizeof(addrbuf)); + } else +#endif + { + error = getnameinfo(&pgsa->sa, pgsa->sa.sa_len, + addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST); + if (error) + perror("getnameinfo"); + } + fprintf(stdout, "\t\tgroup %s\n", addrbuf); /* Link-layer mapping, if present. */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 15:21:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55D4C106566C; Sun, 15 Feb 2009 15:21:34 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4354A8FC18; Sun, 15 Feb 2009 15:21:34 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FFLYv7081971; Sun, 15 Feb 2009 15:21:34 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FFLY3T081970; Sun, 15 Feb 2009 15:21:34 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200902151521.n1FFLY3T081970@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 15 Feb 2009 15:21: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: r188646 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 15:21:34 -0000 Author: bms Date: Sun Feb 15 15:21:34 2009 New Revision: 188646 URL: http://svn.freebsd.org/changeset/base/188646 Log: Blow away KAME MLDv2 hooks. This code can be gotten from change history here and it's more than likely our implementation will differ significantly because of VIMAGE and SMPng. Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 15:19:34 2009 (r188645) +++ head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 15:21:34 2009 (r188646) @@ -61,9 +61,6 @@ __FBSDID("$FreeBSD$"); #undef _KERNEL #ifdef INET6 -# ifdef HAVE_MLDV2 -# include -# endif #include #define _KERNEL # include @@ -142,9 +139,6 @@ static void in_addr_slistentry(struct i static void if6_addrlist(struct ifaddr *); static struct in6_multi * in6_multientry(struct in6_multi *); -#ifdef HAVE_MLDV2 -static void in6_addr_slistentry(struct in6_addr_slist *, char *); -#endif #endif /* INET6 */ static void kread(u_long, void *, int); @@ -437,88 +431,14 @@ static struct in6_multi * in6_multientry(struct in6_multi *mc) { struct in6_multi multi; -#ifdef HAVE_MLDV2 - struct in6_multi_source src; - struct router6_info rt6i; -#endif KREAD(mc, &multi, struct in6_multi); printf("\t\tgroup %s", inet6_n2a(&multi.in6m_addr)); printf(" refcnt %u\n", multi.in6m_refcount); -#ifdef HAVE_MLDV2 - if (multi.in6m_rti != NULL) { - KREAD(multi.in6m_rti, &rt6i, struct router_info); - printf("\t\t\t"); - switch (rt6i.rt6i_type) { - case MLD_V1_ROUTER: - printf("mldv1"); - break; - case MLD_V2_ROUTER: - printf("mldv2"); - break; - default: - printf("mldv?(%d)", rt6i.rt6i_type); - break; - } - - if (multi.in6m_source == NULL) { - printf("\n"); - return(multi.in6m_entry.le_next); - } - - KREAD(multi.in6m_source, &src, struct in6_multi_source); - printf(" mode=%s grpjoin=%d\n", - src.i6ms_mode == MCAST_INCLUDE ? "include" : - src.i6ms_mode == MCAST_EXCLUDE ? "exclude" : - "???", - src.i6ms_grpjoin); - in6_addr_slistentry(src.i6ms_cur, "current"); - in6_addr_slistentry(src.i6ms_rec, "recorded"); - in6_addr_slistentry(src.i6ms_in, "included"); - in6_addr_slistentry(src.i6ms_ex, "excluded"); - in6_addr_slistentry(src.i6ms_alw, "allowed"); - in6_addr_slistentry(src.i6ms_blk, "blocked"); - in6_addr_slistentry(src.i6ms_toin, "to-include"); - in6_addr_slistentry(src.i6ms_ex, "to-exclude"); - } -#endif return(multi.in6m_entry.le_next); } -#ifdef HAVE_MLDV2 -static void -in6_addr_slistentry(struct in6_addr_slist *ias, char *heading) -{ - struct in6_addr_slist slist; - struct i6as_head head; - struct in6_addr_source src; - - if (ias == NULL) { - printf("\t\t\t\t%s (none)\n", heading); - return; - } - memset(&slist, 0, sizeof(slist)); - KREAD(ias, &slist, struct in6_addr_source); - printf("\t\t\t\t%s (entry num=%d)\n", heading, slist.numsrc); - if (slist.numsrc == 0) { - return; - } - KREAD(slist.head, &head, struct i6as_head); - - KREAD(head.lh_first, &src, struct in6_addr_source); - while (1) { - printf("\t\t\t\t\tsource %s (ref=%d)\n", - inet6_n2a(&src.i6as_addr.sin6_addr), - src.i6as_refcount); - if (src.i6as_list.le_next == NULL) - break; - KREAD(src.i6as_list.le_next, &src, struct in6_addr_source); - } - return; -} -#endif /* HAVE_MLDV2 */ - #endif /* INET6 */ #ifdef INET From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 15:26:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69DA21065670; Sun, 15 Feb 2009 15:26:43 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DAA58FC35; Sun, 15 Feb 2009 15:26:43 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FFQh3A082102; Sun, 15 Feb 2009 15:26:43 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FFQhZ2082101; Sun, 15 Feb 2009 15:26:43 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200902151526.n1FFQhZ2082101@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 15 Feb 2009 15:26: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: r188647 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 15:26:43 -0000 Author: bms Date: Sun Feb 15 15:26:42 2009 New Revision: 188647 URL: http://svn.freebsd.org/changeset/base/188647 Log: nits Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 15:21:34 2009 (r188646) +++ head/usr.sbin/ifmcstat/ifmcstat.c Sun Feb 15 15:26:42 2009 (r188647) @@ -193,7 +193,7 @@ main(int argc, char **argv) if ((ifindex = if_nametoindex(optarg)) == 0) { fprintf(stderr, "%s: unknown interface\n", optarg); - exit(1); + exit(EX_NOHOST); } break; @@ -215,7 +215,7 @@ main(int argc, char **argv) break; } fprintf(stderr, "%s: unknown address family\n", optarg); - exit(1); + exit(EX_USAGE); /*NOTREACHED*/ break; @@ -253,9 +253,9 @@ main(int argc, char **argv) #endif error = ifmcstat_getifmaddrs(); if (error != 0) - exit(1); + exit(EX_OSERR); - exit(0); + exit(EX_OK); /*NOTREACHED*/ } @@ -296,7 +296,7 @@ ifmcstat_kvm(const char *kernel, const c #endif if (vflag) ll_addrlist(TAILQ_FIRST(&ifnet.if_addrhead)); -next: + next: ifp = nifp; } @@ -309,7 +309,7 @@ kread(u_long addr, void *buf, int len) if (kvm_read(kvmd, addr, buf, len) != len) { perror("kvm_read"); - exit(1); + exit(EX_OSERR); } } @@ -436,7 +436,7 @@ in6_multientry(struct in6_multi *mc) printf("\t\tgroup %s", inet6_n2a(&multi.in6m_addr)); printf(" refcnt %u\n", multi.in6m_refcount); - return(multi.in6m_entry.le_next); + return (multi.in6m_entry.le_next); } #endif /* INET6 */ @@ -584,7 +584,6 @@ in_addr_slistentry(struct in_addr_slist break; KREAD(src.ias_list.le_next, &src, struct in_addr_source); } - return; } #endif /* HAVE_IGMPV3 */ @@ -615,10 +614,11 @@ inet6_n2a(struct in6_addr *p) } } if (getnameinfo((struct sockaddr *)&sin6, sin6.sin6_len, - buf, sizeof(buf), NULL, 0, niflags) == 0) - return buf; - else - return "(invalid)"; + buf, sizeof(buf), NULL, 0, niflags) == 0) { + return (buf); + } else { + return ("(invalid)"); + } } #endif /* INET6 */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 16:05:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71826106564A; Sun, 15 Feb 2009 16:05:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4653B8FC17; Sun, 15 Feb 2009 16:05:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FG5mcs082810; Sun, 15 Feb 2009 16:05:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FG5m9n082809; Sun, 15 Feb 2009 16:05:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902151605.n1FG5m9n082809@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 16:05: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: r188648 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 16:05:48 -0000 Author: mav Date: Sun Feb 15 16:05:48 2009 New Revision: 188648 URL: http://svn.freebsd.org/changeset/base/188648 Log: Add workaround for some ATI chips, failing to soft-reset when port multiplicator supported, but absent. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 15 15:26:42 2009 (r188647) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 15 16:05:48 2009 (r188648) @@ -595,7 +595,7 @@ ata_ahci_start(device_t dev) (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); } -static void +static int ata_ahci_wait_ready(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -608,11 +608,12 @@ ata_ahci_wait_ready(device_t dev) DELAY(1000); if (timeout++ > 1000) { device_printf(dev, "port is not ready\n"); - break; + return (-1); } } if (bootverbose) device_printf(dev, "ready wait time=%dms\n", timeout); + return (0); } static u_int32_t @@ -651,7 +652,8 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - ata_ahci_wait_ready(dev); + if (ata_ahci_wait_ready(dev)) + return (-1); return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } @@ -713,9 +715,14 @@ ata_ahci_reset(device_t dev) ata_ahci_wait_ready(dev); /* only probe for PortMultiplier if HW has support */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) + if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { signature = ata_ahci_softreset(dev, ATA_PM); - else { + /* Workaround for some ATI chips, failing to soft-reset + * when port multiplicator supported, but absent. + * XXX: We can also check PxIS.IPMS==1 here to be sure. */ + if (signature == 0xffffffff) + signature = ata_ahci_softreset(dev, 0); + } else { signature = ata_ahci_softreset(dev, 0); } if (bootverbose) From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 16:16:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D2E1065675; Sun, 15 Feb 2009 16:16:39 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 465FB8FC16; Sun, 15 Feb 2009 16:16:39 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FGGdLV083032; Sun, 15 Feb 2009 16:16:39 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FGGdE1083028; Sun, 15 Feb 2009 16:16:39 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200902151616.n1FGGdE1083028@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 15 Feb 2009 16:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188649 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 16:16:41 -0000 Author: bms Date: Sun Feb 15 16:16:38 2009 New Revision: 188649 URL: http://svn.freebsd.org/changeset/base/188649 Log: Now that ifmcstat(8) does not suck, retire host-mode netstat -g. This change will not be back-ported. Deleted: head/usr.bin/netstat/mcast.c Modified: head/usr.bin/netstat/Makefile head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Sun Feb 15 16:05:48 2009 (r188648) +++ head/usr.bin/netstat/Makefile Sun Feb 15 16:16:38 2009 (r188649) @@ -4,7 +4,7 @@ .include PROG= netstat -SRCS= if.c inet.c main.c mbuf.c mcast.c mroute.c route.c \ +SRCS= if.c inet.c main.c mbuf.c mroute.c route.c \ unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Sun Feb 15 16:05:48 2009 (r188648) +++ head/usr.bin/netstat/main.c Sun Feb 15 16:16:38 2009 (r188649) @@ -558,7 +558,6 @@ main(int argc, char *argv[]) nl[N_MIF6TABLE].n_value); #endif } - ifmalist_dump(); exit(0); } Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sun Feb 15 16:05:48 2009 (r188648) +++ head/usr.bin/netstat/netstat.1 Sun Feb 15 16:16:38 2009 (r188649) @@ -32,7 +32,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 16, 2008 +.Dd February 15, 2009 .Dt NETSTAT 1 .Os .Sh NAME @@ -265,9 +265,15 @@ is repeated, counters with a value of ze .Op Fl N Ar system .Ek .Xc -Show information related to multicast (group address) routing. -By default, show the IP Multicast virtual-interface and routing tables, -and multicast group memberships. +Display the contents of the multicast virtual interface tables, +and multicast forwarding caches. +Entries in these tables will appear only when the kernel is +actively forwarding multicast sessions. +This option is applicable only to the +.Cm inet +and +.Cm inet6 +address families. .It Xo .Bk -words .Nm Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Sun Feb 15 16:05:48 2009 (r188648) +++ head/usr.bin/netstat/netstat.h Sun Feb 15 16:16:38 2009 (r188649) @@ -160,7 +160,6 @@ void tp_protopr(u_long, const char *, in void tp_inproto(u_long); void tp_stats(caddr_t, caddr_t); -void ifmalist_dump(void); void mroutepr(u_long, u_long); void mrt_stats(u_long); void bpf_stats(char *); From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 17:56:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65ED81065675; Sun, 15 Feb 2009 17:56:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 549378FC14; Sun, 15 Feb 2009 17:56:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FHuGg5084843; Sun, 15 Feb 2009 17:56:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FHuGiv084842; Sun, 15 Feb 2009 17:56:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902151756.n1FHuGiv084842@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 17:56: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: r188650 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 17:56:17 -0000 Author: imp Date: Sun Feb 15 17:56:16 2009 New Revision: 188650 URL: http://svn.freebsd.org/changeset/base/188650 Log: Make dumper_t definition conform more closely to stlye(9). This also avoid keywords in other languages that may have been present before. Submitted by: Andriy Gapon, jkoshy@ Modified: head/sys/sys/conf.h Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Sun Feb 15 16:16:38 2009 (r188649) +++ head/sys/sys/conf.h Sun Feb 15 17:56:16 2009 (r188650) @@ -141,11 +141,11 @@ typedef void d_purge_t(struct cdev *dev) typedef int d_spare2_t(struct cdev *dev); typedef int dumper_t( - void *priv, /* Private to the driver. */ - void *virtual, /* Virtual (mapped) address. */ - vm_offset_t physical, /* Physical address of virtual. */ - off_t offset, /* Byte-offset to write at. */ - size_t length); /* Number of bytes to dump. */ + void *_priv, /* Private to the driver. */ + void *_virtual, /* Virtual (mapped) address. */ + vm_offset_t _physical, /* Physical address of virtual. */ + off_t _offset, /* Byte-offset to write at. */ + size_t _length); /* Number of bytes to dump. */ #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 18:19:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10231065672; Sun, 15 Feb 2009 18:19:24 +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 AF8358FC0A; Sun, 15 Feb 2009 18:19:24 +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 n1FIJOWS085304; Sun, 15 Feb 2009 18:19:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FIJOB8085303; Sun, 15 Feb 2009 18:19:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902151819.n1FIJOB8085303@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 18:19: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: r188651 - head/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 18:19:25 -0000 Author: imp Date: Sun Feb 15 18:19:24 2009 New Revision: 188651 URL: http://svn.freebsd.org/changeset/base/188651 Log: Removal pccard directory requires removing it from the list of things that get installed too. Submitted by: Olivier Smedts (identical patches to what I came up with before checking email) Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Sun Feb 15 17:56:16 2009 (r188650) +++ head/sys/Makefile Sun Feb 15 18:19:24 2009 (r188651) @@ -12,7 +12,7 @@ CSCOPEDIRS= boot bsm cam cddl compat con geom gnu isa kern libkern modules net net80211 netatalk \ netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfs4client nfsclient nfsserver nlm opencrypto \ - pccard pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} + pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} .if defined(ALL_ARCH) CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v .else From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 18:30:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCEA1065670; Sun, 15 Feb 2009 18:30: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 CC6F08FC20; Sun, 15 Feb 2009 18:30: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 n1FIUiIX085565; Sun, 15 Feb 2009 18:30:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FIUiaE085563; Sun, 15 Feb 2009 18:30:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902151830.n1FIUiaE085563@svn.freebsd.org> From: Ed Schouten Date: Sun, 15 Feb 2009 18:30: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: r188652 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 18:30:45 -0000 Author: ed Date: Sun Feb 15 18:30:44 2009 New Revision: 188652 URL: http://svn.freebsd.org/changeset/base/188652 Log: Add the pccard header files to ObsoleteFiles.inc. Reviewed by: imp Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Feb 15 18:19:24 2009 (r188651) +++ head/ObsoleteFiles.inc Sun Feb 15 18:30:44 2009 (r188652) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090203: removal of pccard header files +OLD_FILES+=usr/include/pccard/cardinfo.h +OLD_FILES+=usr/include/pccard/cis.h +OLD_DIRS+=usr/include/pccard # 20090203: adding_user.8 moved to adding_user.7 OLD_FILES+=usr/share/man/man8/adding_user.8.gz # 20090122: tzdata2009a import From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 20:05:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24294106566C; Sun, 15 Feb 2009 20:05:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E2C48FC08; Sun, 15 Feb 2009 20:05:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FK5Drm089042; Sun, 15 Feb 2009 20:05:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FK5DpK089041; Sun, 15 Feb 2009 20:05:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902152005.n1FK5DpK089041@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Feb 2009 20:05: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: r188653 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 20:05:14 -0000 Author: imp Date: Sun Feb 15 20:05:13 2009 New Revision: 188653 URL: http://svn.freebsd.org/changeset/base/188653 Log: It appears that none of the contents of this file are necessary, so replace the amd64-ish version with a blank version. Modified: head/sys/mips/include/fpu.h Modified: head/sys/mips/include/fpu.h ============================================================================== --- head/sys/mips/include/fpu.h Sun Feb 15 18:30:44 2009 (r188652) +++ head/sys/mips/include/fpu.h Sun Feb 15 20:05:13 2009 (r188653) @@ -1,109 +1,9 @@ /*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. + * This file is in the public domain. * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. - * - * from: @(#)npx.h 5.3 (Berkeley) 1/18/91 * $FreeBSD$ */ - -/* - * Floating Point Data Structures and Constants - * W. Jolitz 1/90 - */ - #ifndef _MACHINE_FPU_H_ #define _MACHINE_FPU_H_ -/* Contents of each x87 floating point accumulator */ -struct fpacc87 { - u_char fp_bytes[10]; -}; - -/* Contents of each SSE extended accumulator */ -struct xmmacc { - u_char xmm_bytes[16]; -}; - -struct envxmm { - u_int16_t en_cw; /* control word (16bits) */ - u_int16_t en_sw; /* status word (16bits) */ - u_int8_t en_tw; /* tag word (8bits) */ - u_int8_t en_zero; - u_int16_t en_opcode; /* opcode last executed (11 bits ) */ - u_int64_t en_rip; /* floating point instruction pointer */ - u_int64_t en_rdp; /* floating operand pointer */ - u_int32_t en_mxcsr; /* SSE sontorol/status register */ - u_int32_t en_mxcsr_mask; /* valid bits in mxcsr */ -}; - -struct savefpu { - struct envxmm sv_env; - struct { - struct fpacc87 fp_acc; - u_char fp_pad[6]; /* padding */ - } sv_fp[8]; - struct xmmacc sv_xmm[16]; - u_char sv_pad[96]; -} __aligned(16); - -/* - * The hardware default control word for i387's and later coprocessors is - * 0x37F, giving: - * - * round to nearest - * 64-bit precision - * all exceptions masked. - * - * FreeBSD/i386 uses 53 bit precision for things like fadd/fsub/fsqrt etc - * because of the difference between memory and fpu register stack arguments. - * If its using an intermediate fpu register, it has 80/64 bits to work - * with. If it uses memory, it has 64/53 bits to work with. However, - * gcc is aware of this and goes to a fair bit of trouble to make the - * best use of it. - * - * This is mostly academic for AMD64, because the ABI prefers the use - * SSE2 based math. For FreeBSD/amd64, we go with the default settings. - */ -#define __INITIAL_FPUCW__ 0x037F -#define __INITIAL_MXCSR__ 0x1F80 -#define __INITIAL_MXCSR_MASK__ 0xFFBF - -#ifdef _KERNEL -int fpudna(void); -void fpudrop(void); -void fpuexit(struct thread *td); -int fpuformat(void); -int fpugetregs(struct thread *td, struct savefpu *addr); -void fpuinit(void); -void fpusetregs(struct thread *td, struct savefpu *addr); -int fputrap(void); -#endif - #endif /* !_MACHINE_FPU_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 20:24:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94A6E1065672; Sun, 15 Feb 2009 20:24:21 +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 82B8A8FC20; Sun, 15 Feb 2009 20:24:21 +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 n1FKOLMY091070; Sun, 15 Feb 2009 20:24:21 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FKOLg4091065; Sun, 15 Feb 2009 20:24:21 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902152024.n1FKOLg4091065@svn.freebsd.org> From: Andrew Thompson Date: Sun, 15 Feb 2009 20:24: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: r188654 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 20:24:22 -0000 Author: thompsa Date: Sun Feb 15 20:24:21 2009 New Revision: 188654 URL: http://svn.freebsd.org/changeset/base/188654 Log: Pull in kbd.c with usb2_input_kbd, just like ukbd. Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.pc98 head/sys/conf/files.sparc64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Feb 15 20:05:13 2009 (r188653) +++ head/sys/conf/files.amd64 Sun Feb 15 20:24:21 2009 (r188654) @@ -188,7 +188,7 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/k8temp/k8temp.c optional k8temp -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Feb 15 20:05:13 2009 (r188653) +++ head/sys/conf/files.i386 Sun Feb 15 20:24:21 2009 (r188654) @@ -199,7 +199,7 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/k8temp/k8temp.c optional k8temp -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/le/if_le_isa.c optional le isa dev/mem/memutil.c optional mem dev/mse/mse.c optional mse Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Sun Feb 15 20:05:13 2009 (r188653) +++ head/sys/conf/files.ia64 Sun Feb 15 20:24:21 2009 (r188654) @@ -56,7 +56,7 @@ dev/atkbdc/psm.c optional psm atkbdc dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Sun Feb 15 20:05:13 2009 (r188653) +++ head/sys/conf/files.pc98 Sun Feb 15 20:24:21 2009 (r188654) @@ -108,7 +108,7 @@ dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional pckbd | sc | ukbd +dev/kbd/kbd.c optional pckbd | sc | ukbd | usb2_input_kbd dev/le/if_le_cbus.c optional le isa dev/mem/memutil.c optional mem dev/mse/mse.c optional mse Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Sun Feb 15 20:05:13 2009 (r188653) +++ head/sys/conf/files.sparc64 Sun Feb 15 20:24:21 2009 (r188654) @@ -38,7 +38,7 @@ dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 20:37:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A647F106566B; Sun, 15 Feb 2009 20:37:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3028FC12; Sun, 15 Feb 2009 20:37:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FKbtnP092555; Sun, 15 Feb 2009 20:37:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FKbt9V092553; Sun, 15 Feb 2009 20:37:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902152037.n1FKbt9V092553@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 20:37: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: r188655 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 20:37:56 -0000 Author: mav Date: Sun Feb 15 20:37:55 2009 New Revision: 188655 URL: http://svn.freebsd.org/changeset/base/188655 Log: Add initial single-vector MSI support into atapci driver. Works fine with AHCI and theoretically other MSI capable devices. At this moment support disabled by default. To enable it, set "hint.atapci.X.msi=1" device hint. Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sun Feb 15 20:24:21 2009 (r188654) +++ head/sys/dev/ata/ata-pci.c Sun Feb 15 20:37:55 2009 (r188655) @@ -150,7 +150,9 @@ ata_pci_detach(device_t dev) if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); - bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ctlr->r_irq); + bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq); + if (ctlr->r_irq_rid != ATA_IRQ_RID) + pci_release_msi(dev); } if (ctlr->r_res2) bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); @@ -653,11 +655,19 @@ int ata_setup_interrupt(device_t dev, void *intr_func) { struct ata_pci_controller *ctlr = device_get_softc(dev); - int rid = ATA_IRQ_RID; + int i, msi = 0; if (!ctlr->legacy) { - if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE))) { + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "msi", &i) == 0 && i != 0) + msi = 1; + if (msi && pci_msi_count(dev) > 0 && pci_alloc_msi(dev, &msi) == 0) { + ctlr->r_irq_rid = 0x1; + } else { + ctlr->r_irq_rid = ATA_IRQ_RID; + } + if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &ctlr->r_irq_rid, RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, "unable to map interrupt\n"); return ENXIO; } Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Sun Feb 15 20:24:21 2009 (r188654) +++ head/sys/dev/ata/ata-pci.h Sun Feb 15 20:37:55 2009 (r188655) @@ -45,6 +45,7 @@ struct ata_pci_controller { int r_type2; int r_rid2; struct resource *r_res2; + int r_irq_rid; struct resource *r_irq; void *handle; struct ata_chip_id *chip; From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 21:17:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE716106566B; Sun, 15 Feb 2009 21:17:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 822958FC08; Sun, 15 Feb 2009 21:17:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FLHM3C096706; Sun, 15 Feb 2009 21:17:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FLHM7J096705; Sun, 15 Feb 2009 21:17:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902152117.n1FLHM7J096705@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 21:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188656 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 21:17:23 -0000 Author: mav Date: Sun Feb 15 21:17:21 2009 New Revision: 188656 URL: http://svn.freebsd.org/changeset/base/188656 Log: Enable MSI support by default. Still can be disabled using device.hints. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Feb 15 20:37:55 2009 (r188655) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Feb 15 21:17:21 2009 (r188656) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090131_0127" +#define HDA_DRV_TEST_REV "20090215_0128" SND_DECLARE_FILE("$FreeBSD$"); @@ -109,12 +109,6 @@ SND_DECLARE_FILE("$FreeBSD$"); #define hdac_lockassert(sc) snd_mtxassert((sc)->lock) #define hdac_lockowned(sc) mtx_owned((sc)->lock) -#undef HDAC_MSI_ENABLED -#if __FreeBSD_version >= 700026 || \ - (__FreeBSD_version < 700000 && __FreeBSD_version >= 602106) -#define HDAC_MSI_ENABLED 1 -#endif - #define HDA_FLAG_MATCH(fl, v) (((fl) & (v)) == (v)) #define HDA_DEV_MATCH(fl, v) ((fl) == (v) || \ (fl) == 0xffffffff || \ @@ -1750,13 +1744,11 @@ hdac_irq_alloc(struct hdac_softc *sc) irq = &sc->irq; irq->irq_rid = 0x0; -#ifdef HDAC_MSI_ENABLED if ((sc->flags & HDAC_F_MSI) && (result = pci_msi_count(sc->dev)) == 1 && pci_alloc_msi(sc->dev, &result) == 0) irq->irq_rid = 0x1; else -#endif sc->flags &= ~HDAC_F_MSI; irq->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, @@ -1799,10 +1791,8 @@ hdac_irq_free(struct hdac_softc *sc) if (irq->irq_res != NULL) bus_release_resource(sc->dev, SYS_RES_IRQ, irq->irq_rid, irq->irq_res); -#ifdef HDAC_MSI_ENABLED - if ((sc->flags & HDAC_F_MSI) && irq->irq_rid == 0x1) + if (irq->irq_rid == 0x1) pci_release_msi(sc->dev); -#endif irq->irq_handle = NULL; irq->irq_res = NULL; irq->irq_rid = 0x0; @@ -4059,14 +4049,11 @@ hdac_attach(device_t dev) ); } -#ifdef HDAC_MSI_ENABLED if (resource_int_value(device_get_name(dev), - device_get_unit(dev), "msi", &i) == 0 && i != 0 && - pci_msi_count(dev) == 1) - sc->flags |= HDAC_F_MSI; - else -#endif + device_get_unit(dev), "msi", &i) == 0 && i == 0) sc->flags &= ~HDAC_F_MSI; + else + sc->flags |= HDAC_F_MSI; #if defined(__i386__) || defined(__amd64__) sc->flags |= HDAC_F_DMA_NOCACHE; From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 21:54:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9B00106564A; Sun, 15 Feb 2009 21:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81008FC1A; Sun, 15 Feb 2009 21:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FLsGDG000807; Sun, 15 Feb 2009 21:54:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FLsGr9000806; Sun, 15 Feb 2009 21:54:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902152154.n1FLsGr9000806@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Feb 2009 21:54: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: r188658 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 21:54:17 -0000 Author: mav Date: Sun Feb 15 21:54:16 2009 New Revision: 188658 URL: http://svn.freebsd.org/changeset/base/188658 Log: Remove unneeded AND operation. We have already checked that bit is set. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 15 21:51:32 2009 (r188657) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Feb 15 21:54:16 2009 (r188658) @@ -240,7 +240,7 @@ ata_ahci_status(device_t dev) /* clear interrupt(s) */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset, istatus); - ATA_OUTL(ctlr->r_res2, ATA_AHCI_IS, action & (1 << ch->unit)); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_IS, 1 << ch->unit); /* do we have any PHY events ? */ if (istatus & (ATA_AHCI_P_IX_PRC | ATA_AHCI_P_IX_PC)) From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 22:18:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCA5E1065672; Sun, 15 Feb 2009 22:18:16 +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 BA4F78FC17; Sun, 15 Feb 2009 22:18:16 +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 n1FMIG2D003438; Sun, 15 Feb 2009 22:18:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FMIGqF003435; Sun, 15 Feb 2009 22:18:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902152218.n1FMIGqF003435@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 15 Feb 2009 22: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: r188659 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 22:18:17 -0000 Author: marcel Date: Sun Feb 15 22:18:16 2009 New Revision: 188659 URL: http://svn.freebsd.org/changeset/base/188659 Log: Add method precheck to the g_part interface. The precheck method allows schemes to reject the ctl request, pre-check the parameters and/or modify/set parameters. There are 2 use cases that triggered the addition: 1. When implementing a R/O scheme, deletes will still happen to the in-memory representation. The scheme is not involved in that operation. The pre-check method can be used to fail the delete up-front. Without this the write to disk will typically fail, but at that time the delete already happened. 2. The EBR scheme uses a linked list to record slices. There's no index. The EBR scheme defines the index as a function of the start LBA of the partition. The add verb picks an index for the range and then invokes the add method of the scheme to fill in the blanks. It is too late for the add method to change the index. The pre-check is used to set the index up-front. This also (silently) overrides/nullifies any (pointless) user-specified index value. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_if.m Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun Feb 15 21:54:16 2009 (r188658) +++ head/sys/geom/part/g_part.c Sun Feb 15 22:18:16 2009 (r188659) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002, 2005-2008 Marcel Moolenaar + * Copyright (c) 2002, 2005-2009 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -110,23 +110,6 @@ static struct g_class g_part_class = { DECLARE_GEOM_CLASS(g_part_class, g_part); -enum g_part_ctl { - G_PART_CTL_NONE, - G_PART_CTL_ADD, - G_PART_CTL_BOOTCODE, - G_PART_CTL_COMMIT, - G_PART_CTL_CREATE, - G_PART_CTL_DELETE, - G_PART_CTL_DESTROY, - G_PART_CTL_MODIFY, - G_PART_CTL_MOVE, - G_PART_CTL_RECOVER, - G_PART_CTL_RESIZE, - G_PART_CTL_SET, - G_PART_CTL_UNDO, - G_PART_CTL_UNSET -}; - /* * Support functions. */ @@ -1349,7 +1332,7 @@ g_part_ctlreq(struct gctl_req *req, stru /* Obtain permissions if possible/necessary. */ close_on_error = 0; - table = NULL; /* Suppress uninit. warning. */ + table = NULL; if (modifies && (gpp.gpp_parms & G_PART_PARM_GEOM)) { table = gpp.gpp_geom->softc; if (table != NULL && !table->gpt_opened) { @@ -1365,7 +1348,16 @@ g_part_ctlreq(struct gctl_req *req, stru } } - error = EDOOFUS; /* Prevent bogus uninit. warning. */ + /* Allow the scheme to check or modify the parameters. */ + if (table != NULL) { + error = G_PART_PRECHECK(table, ctlreq, &gpp); + if (error) { + gctl_error(req, "%d pre-check failed", error); + goto out; + } + } else + error = EDOOFUS; /* Prevent bogus uninit. warning. */ + switch (ctlreq) { case G_PART_CTL_NONE: panic("%s", __func__); @@ -1421,6 +1413,7 @@ g_part_ctlreq(struct gctl_req *req, stru } } + out: if (error && close_on_error) { g_access(LIST_FIRST(&gpp.gpp_geom->consumer), -1, -1, -1); table->gpt_opened = 0; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Sun Feb 15 21:54:16 2009 (r188658) +++ head/sys/geom/part/g_part.h Sun Feb 15 22:18:16 2009 (r188659) @@ -123,6 +123,23 @@ struct g_part_table { struct g_part_entry *g_part_new_entry(struct g_part_table *, int, quad_t, quad_t); +enum g_part_ctl { + G_PART_CTL_NONE, + G_PART_CTL_ADD, + G_PART_CTL_BOOTCODE, + G_PART_CTL_COMMIT, + G_PART_CTL_CREATE, + G_PART_CTL_DELETE, + G_PART_CTL_DESTROY, + G_PART_CTL_MODIFY, + G_PART_CTL_MOVE, + G_PART_CTL_RECOVER, + G_PART_CTL_RESIZE, + G_PART_CTL_SET, + G_PART_CTL_UNDO, + G_PART_CTL_UNSET +}; + /* G_PART ctlreq parameters. */ #define G_PART_PARM_ENTRIES 0x0001 #define G_PART_PARM_FLAGS 0x0002 Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Sun Feb 15 21:54:16 2009 (r188658) +++ head/sys/geom/part/g_part_if.m Sun Feb 15 22:18:16 2009 (r188659) @@ -95,6 +95,19 @@ METHOD const char * name { size_t bufsz; }; +# precheck() - method to allow schemes to check the parameters given +# to the mentioned ctl request. This only applies to the requests that +# operate on a GEOM. In other words, it does not apply to the create +# request. +# It is allowed (intended actually) to change the parameters according +# to the schemes needs before they are used. Returning an error will +# terminate the request immediately. +METHOD int precheck { + struct g_part_table *table; + enum g_part_ctl req; + struct g_part_parms *gpp; +}; + # probe() - probe the provider attached to the given consumer for the # existence of the scheme implemented by the G_PART interface handler. METHOD int probe { From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 22:33:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428EA1065676; Sun, 15 Feb 2009 22:33:45 +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 2A1158FC1E; Sun, 15 Feb 2009 22:33:45 +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 n1FMXjCf005147; Sun, 15 Feb 2009 22:33:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FMXimc005138; Sun, 15 Feb 2009 22:33:44 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902152233.n1FMXimc005138@svn.freebsd.org> From: Andrew Thompson Date: Sun, 15 Feb 2009 22:33: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: r188660 - in head: . sys/amd64/conf sys/i386/conf sys/ia64/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 22:33:48 -0000 Author: thompsa Date: Sun Feb 15 22:33:44 2009 New Revision: 188660 URL: http://svn.freebsd.org/changeset/base/188660 Log: Switch over GENERIC kernels to USB2 by default. Tested by: make universe Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Feb 15 22:18:16 2009 (r188659) +++ head/UPDATING Sun Feb 15 22:33:44 2009 (r188660) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090215: + The GENERIC kernels for all architectures now default to the new USB2 + stack. No kernel config options or code have been removed so if a + problem arises please report it and optionally revert to the old USB + stack. If you are loading USB kernel modules or have a custom kernel + that includes GENERIC then ensure that usb names are also changed over, + eg uftdi -> usb2_serial_ftdi + 20090203: The ichsmb(4) driver has been changed to require SMBus slave addresses be left-justified (xxxxxxx0b) rather than right-justified. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/amd64/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -281,40 +281,96 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) +# USB core support +device usb2_core +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +device usb2_storage +device usb2_storage_mass +# USB ethernet support, requires miibus +device usb2_ethernet +device usb2_ethernet_aue +device usb2_ethernet_axe +device usb2_ethernet_cdce +device usb2_ethernet_cue +device usb2_ethernet_kue +device usb2_ethernet_rue +device usb2_ethernet_dav +# USB wireless LAN support +device usb2_wlan +device usb2_wlan_rum +device usb2_wlan_ral +device usb2_wlan_zyd +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +device usb2_image +device usb2_scanner + +# USB support (deprecated) +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic -device uhid # "Human Interface Devices" -device ukbd # Keyboard -device ulpt # Printer -device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device ural # Ralink Technology RT2500USB wireless NICs -device rum # Ralink Technology RT2501USB wireless NICs -device urio # Diamond Rio 500 MP3 player -device uscanner # Scanners +#device ugen # Generic +#device uhid # "Human Interface Devices" +#device ukbd # Keyboard +#device ulpt # Printer +#device umass # Disks/Mass storage - Requires scbus and da +#device ums # Mouse +#device ural # Ralink Technology RT2500USB wireless NICs +#device rum # Ralink Technology RT2501USB wireless NICs +#device urio # Diamond Rio 500 MP3 player +#device uscanner # Scanners # USB Serial devices -device ucom # Generic com ttys -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS +#device ucom # Generic com ttys +#device uark # Technologies ARK3116 based serial adapters +#device ubsa # Belkin F5U103 and compatible serial adapters +#device uftdi # For FTDI usb serial adapters +#device uipaq # Some WinCE based devices +#device uplcom # Prolific PL-2303 serial adapters +#device uslcom # SI Labs CP2101/CP2102 serial adapters +#device uvisor # Visor and Palm devices +#device uvscom # USB serial support for DDI pocket's PHS # USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB # FireWire support device firewire # FireWire bus code Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/i386/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -294,42 +294,98 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) +# USB core support +device usb2_core +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +device usb2_storage +device usb2_storage_mass +# USB ethernet support, requires miibus +device usb2_ethernet +device usb2_ethernet_aue +device usb2_ethernet_axe +device usb2_ethernet_cdce +device usb2_ethernet_cue +device usb2_ethernet_kue +device usb2_ethernet_rue +device usb2_ethernet_dav +# USB wireless LAN support +device usb2_wlan +device usb2_wlan_rum +device usb2_wlan_ral +device usb2_wlan_zyd +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +device usb2_image +device usb2_scanner + +# USB support (deprecated) +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic -device uhid # "Human Interface Devices" -device ukbd # Keyboard -device ulpt # Printer -device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device ural # Ralink Technology RT2500USB wireless NICs -device rum # Ralink Technology RT2501USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs -device urio # Diamond Rio 500 MP3 player -device uscanner # Scanners +#device ugen # Generic +#device uhid # "Human Interface Devices" +#device ukbd # Keyboard +#device ulpt # Printer +#device umass # Disks/Mass storage - Requires scbus and da +#device ums # Mouse +#device ural # Ralink Technology RT2500USB wireless NICs +#device rum # Ralink Technology RT2501USB wireless NICs +#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device urio # Diamond Rio 500 MP3 player +#device uscanner # Scanners # USB Serial devices -device ucom # Generic com ttys -device u3g # USB-based 3G modems (Option, Huawei, Sierra) -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS +#device ucom # Generic com ttys +#device u3g # USB-based 3G modems (Option, Huawei, Sierra) +#device uark # Technologies ARK3116 based serial adapters +#device ubsa # Belkin F5U103 and compatible serial adapters +#device uftdi # For FTDI usb serial adapters +#device uipaq # Some WinCE based devices +#device uplcom # Prolific PL-2303 serial adapters +#device uslcom # SI Labs CP2101/CP2102 serial adapters +#device uvisor # Visor and Palm devices +#device uvscom # USB serial support for DDI pocket's PHS # USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB # FireWire support device firewire # FireWire bus code Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/ia64/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -70,7 +70,8 @@ device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support device scbus # SCSI bus (required for SCSI) -device usb # USB Bus (required for USB) +#device usb # USB Bus (required for USB) +device usb2_core # USB Bus (required for USB) # ATA and ATAPI devices device ata # ATA controller @@ -107,16 +108,56 @@ device amr # AMI MegaRAID device ida # Compaq Smart RAID device mlx # Mylex DAC960 family +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +device usb2_storage +device usb2_storage_mass +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +#device usb2_image +#device usb2_scanner + # USB host controllers and peripherals -device ehci # EHCI host controller -device ohci # OHCI PCI->USB interface -device ugen # Generic device -device uhci # UHCI PCI->USB interface -device uhid # Human Interface Devices -device ukbd # Keyboard -device ulpt # Printer -device umass # Disks/Mass storage (need scbus & da) -device ums # Mouse +#device ehci # EHCI host controller +#device ohci # OHCI PCI->USB interface +#device ugen # Generic device +#device uhci # UHCI PCI->USB interface +#device uhid # Human Interface Devices +#device ukbd # Keyboard +#device ulpt # Printer +#device umass # Disks/Mass storage (need scbus & da) +#device ums # Mouse # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') @@ -136,11 +177,21 @@ device sf # Adaptec AIC-6915 (``Starfi device sis # Silicon Integrated Systems SiS 900/SiS 7016 device xl # 3Com 3c90x ("Boomerang", "Cyclone") -# USB Ethernet -device aue # ADMtek USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet +# USB ethernet support, requires miibus +device usb2_ethernet +device usb2_ethernet_aue +device usb2_ethernet_axe +device usb2_ethernet_cdce +device usb2_ethernet_cue +device usb2_ethernet_kue +device usb2_ethernet_rue +device usb2_ethernet_dav + +# USB Ethernet (deprecated) +#device aue # ADMtek USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet # FireWire support device sbp # SCSI over FireWire (need scbus & da) Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/pc98/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -250,7 +250,63 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support +# USB core support +#device usb2_core +# USB controller support +#device usb2_controller +#device usb2_controller_ehci +#device usb2_controller_ohci +#device usb2_controller_uhci +# USB mass storage support +#device usb2_storage +#device usb2_storage_mass +# USB ethernet support, requires miibus +#device usb2_ethernet +#device usb2_ethernet_aue +#device usb2_ethernet_axe +#device usb2_ethernet_cdce +#device usb2_ethernet_cue +#device usb2_ethernet_kue +#device usb2_ethernet_rue +#device usb2_ethernet_dav +# USB wireless LAN support +#device usb2_wlan +#device usb2_wlan_rum +#device usb2_wlan_ral +#device usb2_wlan_zyd +# USB serial device support +#device usb2_serial +#device usb2_serial_ark +#device usb2_serial_bsa +#device usb2_serial_bser +#device usb2_serial_chcom +#device usb2_serial_cycom +#device usb2_serial_foma +#device usb2_serial_ftdi +#device usb2_serial_gensa +#device usb2_serial_ipaq +#device usb2_serial_lpt +#device usb2_serial_mct +#device usb2_serial_modem +#device usb2_serial_moscom +#device usb2_serial_plcom +#device usb2_serial_visor +#device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +#device usb2_input +#device usb2_input_hid +#device usb2_input_kbd +#device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +#device usb2_image +#device usb2_scanner + +# USB support (deprecated) #device uhci # UHCI PCI->USB interface #device ohci # OHCI PCI->USB interface #device ehci # EHCI PCI->USB interface (USB 2.0) Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/powerpc/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -128,26 +128,77 @@ device faith # IPv6-to-IPv4 relaying/( # Note that 'bpf' is required for DHCP. device bpf #Berkeley packet filter -# USB support -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface -device usb # USB Bus (required) -device ugen # Generic -device uhid # "Human Interface Devices" -device ukbd # Keyboard -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -device ulpt # Printer -device umass # Disks/Mass storage - Requires scbus and da0 -device ums # Mouse -device urio # Diamond Rio 500 MP3 player -device uscanner # Scanners +# USB core support +device usb2_core +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +device usb2_storage +device usb2_storage_mass +# USB ethernet support, requires miibus +device usb2_ethernet +device usb2_ethernet_aue +device usb2_ethernet_axe +device usb2_ethernet_cdce +device usb2_ethernet_cue +device usb2_ethernet_kue +device usb2_ethernet_rue +device usb2_ethernet_dav +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +device usb2_image +device usb2_scanner + +# USB support (deprecated) +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface +#device usb # USB Bus (required) +#device ugen # Generic +#device uhid # "Human Interface Devices" +#device ukbd # Keyboard +#options KBD_INSTALL_CDEV # install a CDEV entry in /dev +#device ulpt # Printer +#device umass # Disks/Mass storage - Requires scbus and da0 +#device ums # Mouse +#device urio # Diamond Rio 500 MP3 player +#device uscanner # Scanners # USB Ethernet -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet # FireWire support device firewire # FireWire bus code Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/sparc64/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -219,17 +219,68 @@ device firmware # firmware assist modul # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support +# USB core support +device usb2_core +# USB controller support +device usb2_controller +#device usb2_controller_ehci +device usb2_controller_ohci +#device usb2_controller_uhci +# USB mass storage support +#device usb2_storage +#device usb2_storage_mass +# USB ethernet support, requires miibus +#device usb2_ethernet +#device usb2_ethernet_aue +#device usb2_ethernet_axe +#device usb2_ethernet_cdce +#device usb2_ethernet_cue +#device usb2_ethernet_kue +#device usb2_ethernet_rue +#device usb2_ethernet_dav +# USB serial device support +#device usb2_serial +#device usb2_serial_ark +#device usb2_serial_bsa +#device usb2_serial_bser +#device usb2_serial_chcom +#device usb2_serial_cycom +#device usb2_serial_foma +#device usb2_serial_ftdi +#device usb2_serial_gensa +#device usb2_serial_ipaq +#device usb2_serial_lpt +#device usb2_serial_mct +#device usb2_serial_modem +#device usb2_serial_moscom +#device usb2_serial_plcom +#device usb2_serial_visor +#device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +#device usb2_image +#device usb2_scanner + +# USB support (deprecated) #device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device usb # USB Bus (required) +#device ohci # OHCI PCI->USB interface +#device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices #device ugen # Generic #device uhid # "Human Interface Devices" -device ukbd # Keyboard +#device ukbd # Keyboard #device ulpt # Printer #device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse +#device ums # Mouse #device urio # Diamond Rio 500 MP3 player #device uscanner # Scanners # USB Ethernet, requires mii Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Sun Feb 15 22:18:16 2009 (r188659) +++ head/sys/sun4v/conf/GENERIC Sun Feb 15 22:33:44 2009 (r188660) @@ -180,17 +180,68 @@ device faith # IPv6-to-IPv4 relaying ( # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support +# USB core support +device usb2_core +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +#device usb2_storage +#device usb2_storage_mass +# USB ethernet support, requires miibus +#device usb2_ethernet +#device usb2_ethernet_aue +#device usb2_ethernet_axe +#device usb2_ethernet_cdce +#device usb2_ethernet_cue +#device usb2_ethernet_kue +#device usb2_ethernet_rue +#device usb2_ethernet_dav +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +#device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +#device usb2_image +#device usb2_scanner + +# USB support (deprecated) #device uhci # UHCI PCI->USB interface #device ohci # OHCI PCI->USB interface -device usb # USB Bus (required) +#device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic -device uhid # "Human Interface Devices" +#device ugen # Generic +#device uhid # "Human Interface Devices" #device ukbd # Keyboard -device ulpt # Printer +#device ulpt # Printer #device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse +#device ums # Mouse #device urio # Diamond Rio 500 MP3 player #device uscanner # Scanners # USB Ethernet, requires mii From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 22:50:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C33106564A; Sun, 15 Feb 2009 22:50:01 +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 440438FC1A; Sun, 15 Feb 2009 22:50:01 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 6DA1AFF39; Mon, 16 Feb 2009 11:50:00 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fBaYr0OdjDQN; Mon, 16 Feb 2009 11:49:56 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Mon, 16 Feb 2009 11:49:56 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 0D6231142B; Mon, 16 Feb 2009 11:49:55 +1300 (NZDT) Date: Sun, 15 Feb 2009 14:49:55 -0800 From: Andrew Thompson To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090215224955.GD74071@citylink.fud.org.nz> References: <200902152233.n1FMXimc005138@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902152233.n1FMXimc005138@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: Re: svn commit: r188660 - in head: . sys/amd64/conf sys/i386/conf sys/ia64/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 22:50:02 -0000 On Sun, Feb 15, 2009 at 10:33:44PM +0000, Andrew Thompson wrote: > Author: thompsa > Date: Sun Feb 15 22:33:44 2009 > New Revision: 188660 > URL: http://svn.freebsd.org/changeset/base/188660 > > Log: > Switch over GENERIC kernels to USB2 by default. > > Tested by: make universe I mentioned it in my HEADSUP email to the lists but just to be clear the current kernel option and module naming is temporary. Once the code is properly moved in svn then the old naming will resume (ie, usb, ehci, uftdi). > Modified: > head/UPDATING > head/sys/amd64/conf/GENERIC > head/sys/i386/conf/GENERIC > head/sys/ia64/conf/GENERIC > head/sys/pc98/conf/GENERIC > head/sys/powerpc/conf/GENERIC > head/sys/sparc64/conf/GENERIC > head/sys/sun4v/conf/GENERIC > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Sun Feb 15 22:18:16 2009 (r188659) > +++ head/UPDATING Sun Feb 15 22:33:44 2009 (r188660) > @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > to maximize performance. (To disable malloc debugging, run > ln -s aj /etc/malloc.conf.) > > +20090215: > + The GENERIC kernels for all architectures now default to the new USB2 > + stack. No kernel config options or code have been removed so if a > + problem arises please report it and optionally revert to the old USB > + stack. If you are loading USB kernel modules or have a custom kernel > + that includes GENERIC then ensure that usb names are also changed over, > + eg uftdi -> usb2_serial_ftdi > + > 20090203: > The ichsmb(4) driver has been changed to require SMBus slave > addresses be left-justified (xxxxxxx0b) rather than right-justified. From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 23:18:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB8F106566C; Sun, 15 Feb 2009 23:18:29 +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 986E48FC13; Sun, 15 Feb 2009 23:18:29 +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 n1FNITDA010358; Sun, 15 Feb 2009 23:18:29 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FNITpY010357; Sun, 15 Feb 2009 23:18:29 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902152318.n1FNITpY010357@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Feb 2009 23:18: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: r188661 - head/sys/dev/cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 23:18:30 -0000 Author: rwatson Date: Sun Feb 15 23:18:29 2009 New Revision: 188661 URL: http://svn.freebsd.org/changeset/base/188661 Log: Remove debug.cp.mpsafenet: we no longer support running the network stack with conditional Giant acquisition, and IFF_NEEDSGIANT will be removed in the near future. Modified: head/sys/dev/cp/if_cp.c Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Sun Feb 15 22:33:44 2009 (r188660) +++ head/sys/dev/cp/if_cp.c Sun Feb 15 23:18:29 2009 (r188661) @@ -79,25 +79,9 @@ __FBSDID("$FreeBSD$"); printf ("%s: ", d->name); printf s;}}) #define CP_LOCK_NAME "cpX" -static int cp_mpsafenet = 1; -TUNABLE_INT("debug.cp.mpsafenet", &cp_mpsafenet); -SYSCTL_NODE(_debug, OID_AUTO, cp, CTLFLAG_RD, 0, "Cronyx Tau-PCI Adapters"); -SYSCTL_INT(_debug_cp, OID_AUTO, mpsafenet, CTLFLAG_RD, &cp_mpsafenet, 0, - "Enable/disable MPSAFE network support for Cronyx Tau-PCI Adapters"); - -#define CP_LOCK(_bd) do { \ - if (cp_mpsafenet) \ - mtx_lock (&(_bd)->cp_mtx); \ - } while (0) -#define CP_UNLOCK(_bd) do { \ - if (cp_mpsafenet) \ - mtx_unlock (&(_bd)->cp_mtx); \ - } while (0) - -#define CP_LOCK_ASSERT(_bd) do { \ - if (cp_mpsafenet) \ - mtx_assert (&(_bd)->cp_mtx, MA_OWNED); \ - } while (0) +#define CP_LOCK(_bd) mtx_lock (&(_bd)->cp_mtx) +#define CP_UNLOCK(_bd) mtx_unlock (&(_bd)->cp_mtx) +#define CP_LOCK_ASSERT(_bd) mtx_assert (&(_bd)->cp_mtx, MA_OWNED) static int cp_probe __P((device_t)); static int cp_attach __P((device_t)); @@ -194,7 +178,6 @@ static struct cdevsw cp_cdevsw = { .d_close = cp_close, .d_ioctl = cp_ioctl, .d_name = "cp", - .d_flags = D_NEEDGIANT, }; /* @@ -478,9 +461,9 @@ static int cp_attach (device_t dev) splx (s); return (ENXIO); } - callout_init (&led_timo[unit], cp_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&led_timo[unit], CALLOUT_MPSAFE); error = bus_setup_intr (dev, bd->cp_irq, - INTR_TYPE_NET|(cp_mpsafenet?INTR_MPSAFE:0), + INTR_TYPE_NET|INTR_MPSAFE, NULL, cp_intr, bd, &bd->cp_intrhand); if (error) { cp_destroy = 1; @@ -525,8 +508,7 @@ static int cp_attach (device_t dev) d->hi_queue.ifq_maxlen = IFQ_MAXLEN; mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cp_queue_hi", NULL, MTX_DEF); - callout_init (&d->timeout_handle, - cp_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->timeout_handle, CALLOUT_MPSAFE); #else /*NETGRAPH*/ d->ifp = if_alloc(IFT_PPP); if (d->ifp == NULL) { @@ -537,8 +519,6 @@ static int cp_attach (device_t dev) if_initname (d->ifp, "cp", b->num * NCHAN + c->num); d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; - if (!cp_mpsafenet) - d->ifp->if_flags |= IFF_NEEDSGIANT; d->ifp->if_ioctl = cp_sioctl; d->ifp->if_start = cp_ifstart; d->ifp->if_watchdog = cp_ifwatchdog; @@ -2270,9 +2250,6 @@ static int cp_modevent (module_t mod, in { static int load_count = 0; - if (cp_mpsafenet) - cp_cdevsw.d_flags &= ~D_NEEDGIANT; - switch (type) { case MOD_LOAD: #ifdef NETGRAPH @@ -2280,7 +2257,7 @@ static int cp_modevent (module_t mod, in printf ("Failed to register ng_cp\n"); #endif ++load_count; - callout_init (&timeout_handle, cp_mpsafenet?CALLOUT_MPSAFE:0); + callout_init (&timeout_handle, CALLOUT_MPSAFE); callout_reset (&timeout_handle, hz*5, cp_timeout, 0); break; case MOD_UNLOAD: From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 23:21:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65441065670; Sun, 15 Feb 2009 23:21:52 +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 D256E8FC14; Sun, 15 Feb 2009 23:21:52 +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 n1FNLqYs010992; Sun, 15 Feb 2009 23:21:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FNLqwX010991; Sun, 15 Feb 2009 23:21:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902152321.n1FNLqwX010991@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Feb 2009 23:21: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: r188662 - head/sys/dev/ctau X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 23:21:54 -0000 Author: rwatson Date: Sun Feb 15 23:21:52 2009 New Revision: 188662 URL: http://svn.freebsd.org/changeset/base/188662 Log: Remove debug.ctau.mpsafenet: we no longer support running the network stack with conditional Giant acquisition, and IFF_NEEDSGIANT will be removed in the near future. Modified: head/sys/dev/ctau/if_ct.c Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Sun Feb 15 23:18:29 2009 (r188661) +++ head/sys/dev/ctau/if_ct.c Sun Feb 15 23:21:52 2009 (r188662) @@ -79,24 +79,9 @@ __FBSDID("$FreeBSD$"); #define CT_LOCK_NAME "ctX" -static int ct_mpsafenet = 1; -TUNABLE_INT("debug.ctau.mpsafenet", &ct_mpsafenet); -SYSCTL_NODE(_debug, OID_AUTO, ctau, CTLFLAG_RD, 0, "Cronyx Tau-ISA Adapters"); -SYSCTL_INT(_debug_ctau, OID_AUTO, mpsafenet, CTLFLAG_RD, &ct_mpsafenet, 0, - "Enable/disable MPSAFE network support for Cronyx Tau-ISA Adapters"); - -#define CT_LOCK(_bd) do { \ - if (ct_mpsafenet) \ - mtx_lock (&(_bd)->ct_mtx); \ - } while (0) -#define CT_UNLOCK(_bd) do { \ - if (ct_mpsafenet) \ - mtx_unlock (&(_bd)->ct_mtx); \ - } while (0) -#define CT_LOCK_ASSERT(_bd) do { \ - if (ct_mpsafenet) \ - mtx_assert (&(_bd)->ct_mtx, MA_OWNED); \ - } while (0) +#define CT_LOCK(_bd) mtx_lock (&(_bd)->ct_mtx) +#define CT_UNLOCK(_bd) mtx_unlock (&(_bd)->ct_mtx) +#define CT_LOCK_ASSERT(_bd) mtx_assert (&(_bd)->ct_mtx, MA_OWNED) static void ct_identify __P((driver_t *, device_t)); static int ct_probe __P((device_t)); @@ -195,7 +180,6 @@ static struct cdevsw ct_cdevsw = { .d_close = ct_close, .d_ioctl = ct_ioctl, .d_name = "ct", - .d_flags = D_NEEDGIANT, }; /* @@ -678,10 +662,10 @@ static int ct_attach (device_t dev) return ENXIO; } - callout_init (&led_timo[unit], ct_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&led_timo[unit], CALLOUT_MPSAFE); s = splimp (); if (bus_setup_intr (dev, bd->irq_res, - INTR_TYPE_NET|(ct_mpsafenet?INTR_MPSAFE:0), + INTR_TYPE_NET|INTR_MPSAFE, NULL, ct_intr, bd, &bd->intrhand)) { printf ("ct%d: Can't setup irq %ld\n", unit, irq); bd->board = 0; @@ -741,8 +725,7 @@ static int ct_attach (device_t dev) d->hi_queue.ifq_maxlen = IFQ_MAXLEN; mtx_init (&d->queue.ifq_mtx, "ct_queue", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "ct_queue_hi", NULL, MTX_DEF); - callout_init (&d->timeout_handle, - ct_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->timeout_handle, CALLOUT_MPSAFE); #else /*NETGRAPH*/ d->ifp = if_alloc(IFT_PPP); if (d->ifp == NULL) { @@ -757,8 +740,6 @@ static int ct_attach (device_t dev) if_initname (d->ifp, "ct", b->num * NCHAN + c->num); d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; - if (!ct_mpsafenet) - d->ifp->if_flags |= IFF_NEEDSGIANT; d->ifp->if_ioctl = ct_sioctl; d->ifp->if_start = ct_ifstart; d->ifp->if_watchdog = ct_ifwatchdog; @@ -2211,9 +2192,6 @@ static int ct_modevent (module_t mod, in { static int load_count = 0; - if (ct_mpsafenet) - ct_cdevsw.d_flags &= ~D_NEEDGIANT; - switch (type) { case MOD_LOAD: #ifdef NETGRAPH @@ -2221,7 +2199,7 @@ static int ct_modevent (module_t mod, in printf ("Failed to register ng_ct\n"); #endif ++load_count; - callout_init (&timeout_handle, ct_mpsafenet?CALLOUT_MPSAFE:0); + callout_init (&timeout_handle, CALLOUT_MPSAFE); callout_reset (&timeout_handle, hz*5, ct_timeout, 0); break; case MOD_UNLOAD: From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 23:29:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9F0106566C; Sun, 15 Feb 2009 23:29:14 +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 3B56D8FC18; Sun, 15 Feb 2009 23:29:14 +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 n1FNTEvQ012300; Sun, 15 Feb 2009 23:29:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FNTEiV012299; Sun, 15 Feb 2009 23:29:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902152329.n1FNTEiV012299@svn.freebsd.org> From: Robert Watson Date: Sun, 15 Feb 2009 23:29: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: r188663 - head/sys/dev/ce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 23:29:14 -0000 Author: rwatson Date: Sun Feb 15 23:29:13 2009 New Revision: 188663 URL: http://svn.freebsd.org/changeset/base/188663 Log: Remove debug.ce.mpsafenet: we no longer support running the network stack with conditional Giant acquisition, and IFF_NEEDSGIANT will be removed in the near future. Modified: head/sys/dev/ce/if_ce.c Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Sun Feb 15 23:21:52 2009 (r188662) +++ head/sys/dev/ce/if_ce.c Sun Feb 15 23:29:13 2009 (r188663) @@ -127,35 +127,11 @@ __FBSDID("$FreeBSD$"); #define callout_drain callout_stop #endif -#if __FreeBSD_version >= 504000 #define CE_LOCK_NAME "ceX" -static int ce_mpsafenet = 1; -TUNABLE_INT("debug.ce.mpsafenet", &ce_mpsafenet); -SYSCTL_NODE(_debug, OID_AUTO, ce, CTLFLAG_RD, 0, "Cronyx Tau32-PCI Adapters"); -SYSCTL_INT(_debug_ce, OID_AUTO, mpsafenet, CTLFLAG_RD, &ce_mpsafenet, 0, - "Enable/disable MPSAFE network support for Cronyx Tau32-PCI Adapters"); - -#define CE_LOCK(_bd) do { \ - if (ce_mpsafenet) \ - mtx_lock (&(_bd)->ce_mtx); \ - } while (0) -#define CE_UNLOCK(_bd) do { \ - if (ce_mpsafenet) \ - mtx_unlock (&(_bd)->ce_mtx); \ - } while (0) - -#define CE_LOCK_ASSERT(_bd) do { \ - if (ce_mpsafenet) \ - mtx_assert (&(_bd)->ce_mtx, MA_OWNED); \ - } while (0) -#else -static int ce_mpsafenet = 0; - -#define CE_LOCK(_bd) do {} while (0 && (_bd) && ce_mpsafenet) -#define CE_UNLOCK(_bd) do {} while (0 && (_bd) && ce_mpsafenet) -#define CE_LOCK_ASSERT(_bd) do {} while (0 && (_bd) && ce_mpsafenet) -#endif +#define CE_LOCK(_bd) mtx_lock (&(_bd)->ce_mtx) +#define CE_UNLOCK(_bd) mtx_unlock (&(_bd)->ce_mtx) +#define CE_LOCK_ASSERT(_bd) mtx_assert (&(_bd)->ce_mtx, MA_OWNED) #define CDEV_MAJOR 185 @@ -317,7 +293,6 @@ static struct cdevsw ce_cdevsw = { .d_close = ce_close, .d_ioctl = ce_ioctl, .d_name = "ce", - .d_flags = D_NEEDGIANT, }; #endif @@ -650,13 +625,13 @@ static int ce_attach (device_t dev) return (ENXIO); } #if __FreeBSD_version >= 500000 - callout_init (&led_timo[unit], ce_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&led_timo[unit], CALLOUT_MPSAFE); #else callout_init (&led_timo[unit]); #endif error = bus_setup_intr (dev, bd->ce_irq, #if __FreeBSD_version >= 500013 - INTR_TYPE_NET|(ce_mpsafenet?INTR_MPSAFE:0), + INTR_TYPE_NET|INTR_MPSAFE, #else INTR_TYPE_NET, #endif @@ -710,8 +685,7 @@ static int ce_attach (device_t dev) } #if __FreeBSD_version >= 500000 NG_NODE_SET_PRIVATE (d->node, d); - callout_init (&d->timeout_handle, - ce_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->timeout_handle, CALLOUT_MPSAFE); #else d->node->private = d; #endif @@ -755,10 +729,6 @@ static int ce_attach (device_t dev) #endif d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; -#if __FreeBSD_version >= 502125 - if (!ce_mpsafenet) - d->ifp->if_flags |= IFF_NEEDSGIANT; -#endif d->ifp->if_ioctl = ce_sioctl; d->ifp->if_start = ce_ifstart; d->ifp->if_watchdog = ce_ifwatchdog; @@ -2608,10 +2578,6 @@ static int ce_modevent (module_t mod, in #if __FreeBSD_version < 500000 dev = makedev (CDEV_MAJOR, 0); #endif -#if __FreeBSD_version >= 502103 - if (ce_mpsafenet) - ce_cdevsw.d_flags &= ~D_NEEDGIANT; -#endif switch (type) { case MOD_LOAD: @@ -2632,7 +2598,7 @@ static int ce_modevent (module_t mod, in cdevsw_add (&ce_cdevsw); #endif #if __FreeBSD_version >= 500000 - callout_init (&timeout_handle, ce_mpsafenet?CALLOUT_MPSAFE:0); + callout_init (&timeout_handle, CALLOUT_MPSAFE); #else callout_init (&timeout_handle); #endif From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 23:38:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2BC5106566C; Sun, 15 Feb 2009 23:38: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 C05E78FC0A; Sun, 15 Feb 2009 23:38: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 n1FNcwQ5013961; Sun, 15 Feb 2009 23:38:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FNcwWW013960; Sun, 15 Feb 2009 23:38:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902152338.n1FNcwWW013960@svn.freebsd.org> From: Andrew Thompson Date: Sun, 15 Feb 2009 23:38: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: r188664 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 23:38:59 -0000 Author: thompsa Date: Sun Feb 15 23:38:58 2009 New Revision: 188664 URL: http://svn.freebsd.org/changeset/base/188664 Log: Make uslcom compile, cut'n'paste errors from uplcom. Modified: head/sys/dev/usb2/serial/uslcom2.c Modified: head/sys/dev/usb2/serial/uslcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uslcom2.c Sun Feb 15 23:29:13 2009 (r188663) +++ head/sys/dev/usb2/serial/uslcom2.c Sun Feb 15 23:38:58 2009 (r188664) @@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$"); #if USB_DEBUG static int uslcom_debug = 0; -SYSCTL_NODE(_hw_usb2, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom"); -SYSCTL_INT(_hw_usb2_uplcom, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_NODE(_hw_usb2, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom"); +SYSCTL_INT(_hw_usb2_uslcom, OID_AUTO, debug, CTLFLAG_RW, &uslcom_debug, 0, "Debug level"); #endif @@ -188,15 +188,15 @@ static device_method_t uslcom_methods[] static devclass_t uslcom_devclass; static driver_t uslcom_driver = { - .name = "uplcom", + .name = "uslcom", .methods = uslcom_methods, .size = sizeof(struct uslcom_softc), }; -DRIVER_MODULE(uplcom, ushub, uslcom_driver, uslcom_devclass, NULL, 0); -MODULE_DEPEND(uplcom, usb2_serial, 1, 1, 1); -MODULE_DEPEND(uplcom, usb2_core, 1, 1, 1); -MODULE_VERSION(uplcom, 1); +DRIVER_MODULE(uslcom, ushub, uslcom_driver, uslcom_devclass, NULL, 0); +MODULE_DEPEND(uslcom, usb2_serial, 1, 1, 1); +MODULE_DEPEND(uslcom, usb2_core, 1, 1, 1); +MODULE_VERSION(uslcom, 1); static int uslcom_probe(device_t dev) From owner-svn-src-all@FreeBSD.ORG Sun Feb 15 23:40:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A344106566C; Sun, 15 Feb 2009 23:40:30 +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 2701B8FC1A; Sun, 15 Feb 2009 23:40: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 n1FNeU0E014268; Sun, 15 Feb 2009 23:40:30 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1FNeTo2014261; Sun, 15 Feb 2009 23:40:29 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902152340.n1FNeTo2014261@svn.freebsd.org> From: Andrew Thompson Date: Sun, 15 Feb 2009 23:40: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: r188665 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 23:40:31 -0000 Author: thompsa Date: Sun Feb 15 23:40:29 2009 New Revision: 188665 URL: http://svn.freebsd.org/changeset/base/188665 Log: Add uslcom to the build too. Reminded by: Michael Butler Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/amd64/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -321,6 +321,7 @@ device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom +device usb2_serial_slcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/i386/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -334,6 +334,7 @@ device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom +device usb2_serial_slcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/ia64/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -132,6 +132,7 @@ device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom +device usb2_serial_slcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/pc98/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -290,6 +290,7 @@ device bpf # Berkeley packet filter #device usb2_serial_modem #device usb2_serial_moscom #device usb2_serial_plcom +#device usb2_serial_slcom #device usb2_serial_visor #device usb2_serial_vscom # USB bluetooth support Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/powerpc/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -163,6 +163,7 @@ device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom +device usb2_serial_slcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/sparc64/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -254,6 +254,7 @@ device usb2_controller_ohci #device usb2_serial_modem #device usb2_serial_moscom #device usb2_serial_plcom +#device usb2_serial_slcom #device usb2_serial_visor #device usb2_serial_vscom # USB bluetooth support Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Sun Feb 15 23:38:58 2009 (r188664) +++ head/sys/sun4v/conf/GENERIC Sun Feb 15 23:40:29 2009 (r188665) @@ -215,6 +215,7 @@ device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom +device usb2_serial_slcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 02:42:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 540B8106566B; Mon, 16 Feb 2009 02:42:18 +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 27F3D8FC15; Mon, 16 Feb 2009 02:42:18 +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 n1G2gId1035887; Mon, 16 Feb 2009 02:42:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1G2gIGx035885; Mon, 16 Feb 2009 02:42:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902160242.n1G2gIGx035885@svn.freebsd.org> From: Andrew Thompson Date: Mon, 16 Feb 2009 02:42: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: r188666 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 02:42:18 -0000 Author: thompsa Date: Mon Feb 16 02:42:17 2009 New Revision: 188666 URL: http://svn.freebsd.org/changeset/base/188666 Log: Add a helper function for loading geli keys from the loader. Modified: head/sys/boot/common/loader.8 head/sys/boot/common/module.c Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sun Feb 15 23:40:29 2009 (r188665) +++ head/sys/boot/common/loader.8 Mon Feb 16 02:42:17 2009 (r188666) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2007 +.Dd February 15, 2009 .Dt LOADER 8 .Os .Sh NAME @@ -215,6 +215,17 @@ Any arguments passed after the name of t will be passed as arguments to that file. Currently, argument passing does not work for the kernel. .Pp +.It Ic load_geli Xo +.Op Fl n Ar keyno +.Ar prov Ar file +.Xc +Loads a +.Xr geli 8 +encryption keyfile for the given provider name. +The key index can be specified via +.Ar keyno +or will default to zero. +.Pp .It Ic ls Xo .Op Fl l .Op Ar path Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sun Feb 15 23:40:29 2009 (r188665) +++ head/sys/boot/common/module.c Mon Feb 16 02:42:17 2009 (r188666) @@ -154,6 +154,44 @@ command_load(int argc, char *argv[]) return (error == 0 ? CMD_OK : CMD_ERROR); } +COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); + +static int +command_load_geli(int argc, char *argv[]) +{ + char typestr[80]; + char *cp; + int ch, num; + + if (argc < 3) { + command_errmsg = "usage is [-n key#] "; + return(CMD_ERROR); + } + + num = 0; + optind = 1; + optreset = 1; + while ((ch = getopt(argc, argv, "n:")) != -1) { + switch(ch) { + case 'n': + num = strtol(optarg, &cp, 0); + if (cp == optarg) { + sprintf(command_errbuf, "bad key index '%s'", optarg); + return(CMD_ERROR); + } + break; + case '?': + default: + /* getopt has already reported an error */ + return(CMD_OK); + } + } + argv += (optind - 1); + argc -= (optind - 1); + sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); + return(file_loadraw(typestr, argv[2])); +} + COMMAND_SET(unload, "unload", "unload all modules", command_unload); static int From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 03:54:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 033D7106566B; Mon, 16 Feb 2009 03:54:29 +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 E504D8FC12; Mon, 16 Feb 2009 03:54:28 +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 n1G3sSRC043311; Mon, 16 Feb 2009 03:54:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1G3sS4J043310; Mon, 16 Feb 2009 03:54:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902160354.n1G3sS4J043310@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 16 Feb 2009 03:54: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: r188667 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 03:54:29 -0000 Author: marcel Date: Mon Feb 16 03:54:28 2009 New Revision: 188667 URL: http://svn.freebsd.org/changeset/base/188667 Log: Add support to add, delete and modify logical partitions, as well as to create and destroy the extended partitioning scheme. In other words: full support. 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 Mon Feb 16 02:42:17 2009 (r188666) +++ head/sys/geom/part/g_part_ebr.c Mon Feb 16 03:54:28 2009 (r188667) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -68,6 +67,8 @@ static int g_part_ebr_modify(struct g_pa struct g_part_parms *); static const char *g_part_ebr_name(struct g_part_table *, struct g_part_entry *, char *, size_t); +static int g_part_ebr_precheck(struct g_part_table *, enum g_part_ctl, + struct g_part_parms *); static int g_part_ebr_probe(struct g_part_table *, struct g_consumer *); static int g_part_ebr_read(struct g_part_table *, struct g_consumer *); static int g_part_ebr_setunset(struct g_part_table *, struct g_part_entry *, @@ -84,6 +85,7 @@ static kobj_method_t g_part_ebr_methods[ KOBJMETHOD(g_part_dumpto, g_part_ebr_dumpto), KOBJMETHOD(g_part_modify, g_part_ebr_modify), KOBJMETHOD(g_part_name, g_part_ebr_name), + KOBJMETHOD(g_part_precheck, g_part_ebr_precheck), KOBJMETHOD(g_part_probe, g_part_ebr_probe), KOBJMETHOD(g_part_read, g_part_ebr_read), KOBJMETHOD(g_part_setunset, g_part_ebr_setunset), @@ -102,6 +104,9 @@ static struct g_part_scheme g_part_ebr_s }; G_PART_SCHEME_DECLARE(g_part_ebr); +static void ebr_set_chs(struct g_part_table *, uint32_t, u_char *, u_char *, + u_char *); + static void ebr_entry_decode(const char *p, struct dos_partition *ent) { @@ -117,19 +122,140 @@ ebr_entry_decode(const char *p, struct d ent->dp_size = le32dec(p + 12); } +static void +ebr_entry_link(struct g_part_table *table, uint32_t start, uint32_t end, + u_char *buf) +{ + + buf[0] = 0 /* dp_flag */; + ebr_set_chs(table, start, &buf[3] /* dp_scyl */, &buf[1] /* dp_shd */, + &buf[2] /* dp_ssect */); + buf[4] = 5 /* dp_typ */; + ebr_set_chs(table, end, &buf[7] /* dp_ecyl */, &buf[5] /* dp_ehd */, + &buf[6] /* dp_esect */); + le32enc(buf + 8, start); + le32enc(buf + 12, end - start + 1); +} + +static int +ebr_parse_type(const char *type, u_char *dp_typ) +{ + const char *alias; + char *endp; + long lt; + + if (type[0] == '!') { + lt = strtol(type + 1, &endp, 0); + if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 256) + return (EINVAL); + *dp_typ = (u_char)lt; + return (0); + } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); + if (!strcasecmp(type, alias)) { + *dp_typ = DOSPTYP_386BSD; + return (0); + } + return (EINVAL); +} + +static void +ebr_set_chs(struct g_part_table *table, uint32_t lba, u_char *cylp, u_char *hdp, + u_char *secp) +{ + uint32_t cyl, hd, sec; + + sec = lba % table->gpt_sectors + 1; + lba /= table->gpt_sectors; + hd = lba % table->gpt_heads; + lba /= table->gpt_heads; + cyl = lba; + if (cyl > 1023) + sec = hd = cyl = ~0; + + *cylp = cyl & 0xff; + *hdp = hd & 0xff; + *secp = (sec & 0x3f) | ((cyl >> 2) & 0xc0); +} + static int g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { + struct g_geom *gp; + struct g_provider *pp; + struct g_part_ebr_entry *entry; + uint32_t start, size, sectors; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); - return (ENOSYS); + gp = basetable->gpt_gp; + pp = LIST_FIRST(&gp->consumer)->provider; + sectors = basetable->gpt_sectors; + + entry = (struct g_part_ebr_entry *)baseentry; + + start = gpp->gpp_start; + size = gpp->gpp_size; + if (size < 2 * sectors) + return (EINVAL); + if (start % sectors) { + size = size - sectors + (start % sectors); + start = start - (start % sectors) + sectors; + } + if (size % sectors) + size = size - (size % sectors); + if (size < 2 * sectors) + return (EINVAL); + + if (baseentry->gpe_deleted) + bzero(&entry->ent, sizeof(entry->ent)); + + KASSERT(baseentry->gpe_start <= start, (__func__)); + KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); + baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; + baseentry->gpe_start = start; + baseentry->gpe_end = start + size - 1; + entry->ent.dp_start = sectors; + entry->ent.dp_size = size - sectors; + ebr_set_chs(basetable, entry->ent.dp_start, &entry->ent.dp_scyl, + &entry->ent.dp_shd, &entry->ent.dp_ssect); + ebr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, + &entry->ent.dp_ehd, &entry->ent.dp_esect); + return (ebr_parse_type(gpp->gpp_type, &entry->ent.dp_typ)); } static int g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp) { + char psn[8]; + struct g_consumer *cp; + struct g_provider *pp; + uint64_t msize; + int error; + + pp = gpp->gpp_provider; + + if (pp->sectorsize < EBRSIZE) + return (ENOSPC); + if (pp->sectorsize > 4096) + return (ENXIO); + + /* Check that we have a parent and that it's a MBR. */ + if (basetable->gpt_depth == 0) + return (ENXIO); + cp = LIST_FIRST(&pp->consumers); + error = g_getattr("PART::scheme", cp, &psn); + if (error) + return (error); + if (strcmp(psn, "MBR")) + return (ENXIO); - return (ENOSYS); + msize = pp->mediasize / pp->sectorsize; + basetable->gpt_first = 0; + basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + return (0); } static int @@ -176,8 +302,15 @@ static int g_part_ebr_modify(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { + struct g_part_ebr_entry *entry; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); - return (ENOSYS); + entry = (struct g_part_ebr_entry *)baseentry; + if (gpp->gpp_parms & G_PART_PARM_TYPE) + return (ebr_parse_type(gpp->gpp_type, &entry->ent.dp_typ)); + return (0); } static const char * @@ -190,6 +323,23 @@ g_part_ebr_name(struct g_part_table *tab } static int +g_part_ebr_precheck(struct g_part_table *table, enum g_part_ctl req, + struct g_part_parms *gpp) +{ + + /* + * The index is a function of the start of the partition. + * This is not something the user can override, nor is it + * something the common code will do right. We can set the + * index now so that we get what we need. + */ + if (req == G_PART_CTL_ADD) + gpp->gpp_index = (gpp->gpp_start / table->gpt_sectors) + 1; + + return (0); +} + +static int g_part_ebr_probe(struct g_part_table *table, struct g_consumer *cp) { char psn[8]; @@ -312,8 +462,37 @@ static int g_part_ebr_setunset(struct g_part_table *table, struct g_part_entry *baseentry, const char *attrib, unsigned int set) { + struct g_part_entry *iter; + struct g_part_ebr_entry *entry; + int changed; + + if (strcasecmp(attrib, "active") != 0) + return (EINVAL); - return (ENOSYS); + /* Only one entry can have the active attribute. */ + LIST_FOREACH(iter, &table->gpt_entry, gpe_entry) { + if (iter->gpe_deleted) + continue; + changed = 0; + entry = (struct g_part_ebr_entry *)iter; + if (iter == baseentry) { + if (set && (entry->ent.dp_flag & 0x80) == 0) { + entry->ent.dp_flag |= 0x80; + changed = 1; + } else if (!set && (entry->ent.dp_flag & 0x80)) { + entry->ent.dp_flag &= ~0x80; + changed = 1; + } + } else { + if (set && (entry->ent.dp_flag & 0x80)) { + entry->ent.dp_flag &= ~0x80; + changed = 1; + } + } + if (changed && !iter->gpe_created) + iter->gpe_modified = 1; + } + return (0); } static const char * @@ -334,6 +513,72 @@ g_part_ebr_type(struct g_part_table *bas static int g_part_ebr_write(struct g_part_table *basetable, struct g_consumer *cp) { + struct g_provider *pp; + struct g_part_entry *baseentry, *next; + struct g_part_ebr_entry *entry; + u_char *buf; + u_char *p; + int error; + + pp = cp->provider; + buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + le16enc(buf + DOSMAGICOFFSET, DOSMAGIC); + + baseentry = LIST_FIRST(&basetable->gpt_entry); + while (baseentry != NULL && baseentry->gpe_deleted) + baseentry = LIST_NEXT(baseentry, gpe_entry); + + /* Wipe-out the the first EBR when there are no slices. */ + if (baseentry == NULL) { + error = g_write_data(cp, 0, buf, pp->sectorsize); + goto out; + } + + /* + * If the first partition is not in LBA 0, we need to + * put a "link" EBR in LBA 0. + */ + if (baseentry->gpe_start != 0) { + ebr_entry_link(basetable, (uint32_t)baseentry->gpe_start, + (uint32_t)baseentry->gpe_end, buf + DOSPARTOFF); + error = g_write_data(cp, 0, buf, pp->sectorsize); + if (error) + goto out; + } + + do { + entry = (struct g_part_ebr_entry *)baseentry; + + p = buf + DOSPARTOFF; + p[0] = entry->ent.dp_flag; + p[1] = entry->ent.dp_shd; + p[2] = entry->ent.dp_ssect; + p[3] = entry->ent.dp_scyl; + p[4] = entry->ent.dp_typ; + p[5] = entry->ent.dp_ehd; + p[6] = entry->ent.dp_esect; + p[7] = entry->ent.dp_ecyl; + le32enc(p + 8, entry->ent.dp_start); + le32enc(p + 12, entry->ent.dp_size); + + do { + next = LIST_NEXT(baseentry, gpe_entry); + } while (next != NULL && next->gpe_deleted); + + p += DOSPARTSIZE; + if (next != NULL) + ebr_entry_link(basetable, (uint32_t)next->gpe_start, + (uint32_t)next->gpe_end, p); + else + bzero(p, DOSPARTSIZE); + + error = g_write_data(cp, baseentry->gpe_start * pp->sectorsize, + buf, pp->sectorsize); + + baseentry = next; + } while (!error && baseentry != NULL); - return (ENOSYS); + out: + g_free(buf); + return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 10:29:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 357441065672; Mon, 16 Feb 2009 10:29:04 +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 230EE8FC17; Mon, 16 Feb 2009 10:29:04 +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 n1GAT4vZ050462; Mon, 16 Feb 2009 10:29:04 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GAT46m050461; Mon, 16 Feb 2009 10:29:04 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902161029.n1GAT46m050461@svn.freebsd.org> From: Robert Watson Date: Mon, 16 Feb 2009 10:29: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: r188668 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 10:29:04 -0000 Author: rwatson Date: Mon Feb 16 10:29:03 2009 New Revision: 188668 URL: http://svn.freebsd.org/changeset/base/188668 Log: IFF_NEEDSGIANT will no longer be supported, so remove compatibility code from if_sppp framework for interfaces requiring Giant. Modified: head/sys/net/if_spppsubr.c Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Mon Feb 16 03:54:28 2009 (r188667) +++ head/sys/net/if_spppsubr.c Mon Feb 16 10:29:03 2009 (r188668) @@ -236,25 +236,10 @@ struct cp { #define SPP_FMT "%s: " #define SPP_ARGS(ifp) (ifp)->if_xname -#define SPPP_LOCK(sp) \ - do { \ - if (!(SP2IFP(sp)->if_flags & IFF_NEEDSGIANT)) \ - mtx_lock (&(sp)->mtx); \ - } while (0) -#define SPPP_UNLOCK(sp) \ - do { \ - if (!(SP2IFP(sp)->if_flags & IFF_NEEDSGIANT)) \ - mtx_unlock (&(sp)->mtx); \ - } while (0) - -#define SPPP_LOCK_ASSERT(sp) \ - do { \ - if (!(SP2IFP(sp)->if_flags & IFF_NEEDSGIANT)) \ - mtx_assert (&(sp)->mtx, MA_OWNED); \ - } while (0) -#define SPPP_LOCK_OWNED(sp) \ - (!(SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) && \ - mtx_owned (&sp->mtx)) +#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) #ifdef INET /* @@ -1055,8 +1040,7 @@ sppp_attach(struct ifnet *ifp) mtx_init(&sp->mtx, "sppp", MTX_NETWORK_LOCK, MTX_DEF | MTX_RECURSE); /* Initialize keepalive handler. */ - callout_init(&sp->keepalive_callout, - (ifp->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->keepalive_callout, CALLOUT_MPSAFE); callout_reset(&sp->keepalive_callout, hz * 10, sppp_keepalive, (void *)sp); @@ -1088,8 +1072,7 @@ sppp_attach(struct ifnet *ifp) #ifdef INET6 sp->confflags |= CONF_ENABLE_IPV6; #endif - callout_init(&sp->ifstart_callout, - (ifp->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ifstart_callout, CALLOUT_MPSAFE); sp->if_start = ifp->if_start; ifp->if_start = sppp_ifstart; sp->pp_comp = malloc(sizeof(struct slcompress), M_TEMP, M_WAITOK); @@ -2211,8 +2194,7 @@ sppp_lcp_init(struct sppp *sp) sp->lcp.max_terminate = 2; sp->lcp.max_configure = 10; sp->lcp.max_failure = 10; - callout_init(&sp->ch[IDX_LCP], - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_LCP], CALLOUT_MPSAFE); } static void @@ -2903,8 +2885,7 @@ sppp_ipcp_init(struct sppp *sp) sp->fail_counter[IDX_IPCP] = 0; sp->pp_seq[IDX_IPCP] = 0; sp->pp_rseq[IDX_IPCP] = 0; - callout_init(&sp->ch[IDX_IPCP], - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_IPCP], CALLOUT_MPSAFE); } static void @@ -3463,8 +3444,7 @@ sppp_ipv6cp_init(struct sppp *sp) sp->fail_counter[IDX_IPV6CP] = 0; sp->pp_seq[IDX_IPV6CP] = 0; sp->pp_rseq[IDX_IPV6CP] = 0; - callout_init(&sp->ch[IDX_IPV6CP], - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_IPV6CP], CALLOUT_MPSAFE); } static void @@ -4272,8 +4252,7 @@ sppp_chap_init(struct sppp *sp) sp->fail_counter[IDX_CHAP] = 0; sp->pp_seq[IDX_CHAP] = 0; sp->pp_rseq[IDX_CHAP] = 0; - callout_init(&sp->ch[IDX_CHAP], - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_CHAP], CALLOUT_MPSAFE); } static void @@ -4604,10 +4583,8 @@ sppp_pap_init(struct sppp *sp) sp->fail_counter[IDX_PAP] = 0; sp->pp_seq[IDX_PAP] = 0; sp->pp_rseq[IDX_PAP] = 0; - callout_init(&sp->ch[IDX_PAP], - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); - callout_init(&sp->pap_my_to_ch, - (SP2IFP(sp)->if_flags & IFF_NEEDSGIANT) ? 0 : CALLOUT_MPSAFE); + callout_init(&sp->ch[IDX_PAP], CALLOUT_MPSAFE); + callout_init(&sp->pap_my_to_ch, CALLOUT_MPSAFE); } static void From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 12:09:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66D781065757; Mon, 16 Feb 2009 12:09:53 +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 511088FC16; Mon, 16 Feb 2009 12:09:53 +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 n1GC9rpv056034; Mon, 16 Feb 2009 12:09:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GC9rb0056033; Mon, 16 Feb 2009 12:09:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161209.n1GC9rb0056033@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 12:09: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: r188669 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 12:10:00 -0000 Author: luigi Date: Mon Feb 16 12:09:52 2009 New Revision: 188669 URL: http://svn.freebsd.org/changeset/base/188669 Log: use a const format string in the log message so we can check the arguments (if/when we enable those checks) Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Mon Feb 16 10:29:03 2009 (r188668) +++ head/sys/netinet/ip_fw2.c Mon Feb 16 12:09:52 2009 (r188669) @@ -3762,8 +3762,8 @@ zero_entry(struct ip_fw_chain *chain, u_ continue; clear_counters(rule, log_only); } - msg = log_only ? "ipfw: All logging counts reset.\n" : - "ipfw: Accounting cleared.\n"; + msg = log_only ? "All logging counts reset" : + "Accounting cleared"; } else { int cleared = 0; /* @@ -3784,13 +3784,18 @@ zero_entry(struct ip_fw_chain *chain, u_ IPFW_WUNLOCK(chain); return (EINVAL); } - msg = log_only ? "ipfw: Entry %d logging count reset.\n" : - "ipfw: Entry %d cleared.\n"; + msg = log_only ? "logging count reset" : "cleared"; } IPFW_WUNLOCK(chain); - if (V_fw_verbose) - log(LOG_SECURITY | LOG_NOTICE, msg, rulenum); + if (V_fw_verbose) { + int lev = LOG_SECURITY | LOG_NOTICE; + + if (rulenum) + log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); + else + log(lev, "ipfw: %s.\n", msg); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 14:38:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97E3106566B; Mon, 16 Feb 2009 14:38:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0788FC1E; Mon, 16 Feb 2009 14:38:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GEcqPg058800; Mon, 16 Feb 2009 14:38:52 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GEcqtZ058799; Mon, 16 Feb 2009 14:38:52 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902161438.n1GEcqtZ058799@svn.freebsd.org> From: Scott Long Date: Mon, 16 Feb 2009 14:38: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: r188670 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 14:38:53 -0000 Author: scottl Date: Mon Feb 16 14:38:52 2009 New Revision: 188670 URL: http://svn.freebsd.org/changeset/base/188670 Log: Instrument the probe state machine so that things like DV can be tracked. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 16 12:09:52 2009 (r188669) +++ head/sys/cam/cam_xpt.c Mon Feb 16 14:38:52 2009 (r188670) @@ -5419,9 +5419,33 @@ typedef enum { PROBE_TUR_FOR_NEGOTIATION, PROBE_INQUIRY_BASIC_DV1, PROBE_INQUIRY_BASIC_DV2, - PROBE_DV_EXIT + PROBE_DV_EXIT, + PROBE_INVALID } probe_action; +static char *probe_action_text[] = { + "PROBE_TUR", + "PROBE_INQUIRY", + "PROBE_FULL_INQUIRY", + "PROBE_MODE_SENSE", + "PROBE_SERIAL_NUM_0", + "PROBE_SERIAL_NUM_1", + "PROBE_TUR_FOR_NEGOTIATION", + "PROBE_INQUIRY_BASIC_DV1", + "PROBE_INQUIRY_BASIC_DV2", + "PROBE_DV_EXIT", + "PROBE_INVALID" +}; + +#define PROBE_SET_ACTION(softc, newaction) \ +do { \ + char **text = probe_action_text; \ + CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ + ("Probe %s to %s\n", text[(softc)->action], \ + text[(newaction)])); \ + (softc)->action = (newaction); \ +} while(0) + typedef enum { PROBE_INQUIRY_CKSUM = 0x01, PROBE_SERIAL_CKSUM = 0x02, @@ -5435,6 +5459,7 @@ typedef struct { probe_flags flags; MD5_CTX context; u_int8_t digest[16]; + struct cam_periph *periph; } probe_softc; static void @@ -5566,6 +5591,8 @@ proberegister(struct cam_periph *periph, periph_links.tqe); softc->flags = 0; periph->softc = softc; + softc->periph = periph; + softc->action = PROBE_INVALID; status = cam_periph_acquire(periph); if (status != CAM_REQ_CMP) { return (status); @@ -5617,13 +5644,13 @@ probeschedule(struct cam_periph *periph) */ if (((ccb->ccb_h.path->device->flags & CAM_DEV_UNCONFIGURED) == 0) && (ccb->ccb_h.target_lun == 0)) { - softc->action = PROBE_TUR; + PROBE_SET_ACTION(softc, PROBE_TUR); } else if ((cpi.hba_inquiry & (PI_WIDE_32|PI_WIDE_16|PI_SDTR_ABLE)) != 0 && (cpi.hba_misc & PIM_NOBUSRESET) != 0) { proberequestdefaultnegotiation(periph); - softc->action = PROBE_INQUIRY; + PROBE_SET_ACTION(softc, PROBE_INQUIRY); } else { - softc->action = PROBE_INQUIRY; + PROBE_SET_ACTION(softc, PROBE_INQUIRY); } if (ccb->crcn.flags & CAM_EXPECT_INQ_CHANGE) @@ -5712,7 +5739,7 @@ probestart(struct cam_periph *periph, un if (inq_buf == NULL) { xpt_print(periph->path, "malloc failure- skipping Basic" "Domain Validation\n"); - softc->action = PROBE_DV_EXIT; + PROBE_SET_ACTION(softc, PROBE_DV_EXIT); scsi_test_unit_ready(csio, /*retries*/4, probedone, @@ -5758,7 +5785,7 @@ probestart(struct cam_periph *periph, un } xpt_print(periph->path, "Unable to mode sense control page - " "malloc failure\n"); - softc->action = PROBE_SERIAL_NUM_0; + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); } /* FALLTHROUGH */ case PROBE_SERIAL_NUM_0: @@ -5827,6 +5854,11 @@ probestart(struct cam_periph *periph, un probedone(periph, start_ccb); return; } + case PROBE_INVALID: + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_INFO, + ("probestart: invalid action state\n")); + default: + break; } xpt_action(start_ccb); } @@ -5980,7 +6012,7 @@ probedone(struct cam_periph *periph, uni /*count*/1, /*run_queue*/TRUE); } - softc->action = PROBE_INQUIRY; + PROBE_SET_ACTION(softc, PROBE_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; @@ -6017,7 +6049,7 @@ probedone(struct cam_periph *periph, uni additional_length) + 1; if (softc->action == PROBE_INQUIRY && len > SHORT_INQUIRY_LENGTH) { - softc->action = PROBE_FULL_INQUIRY; + PROBE_SET_ACTION(softc, PROBE_FULL_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; @@ -6027,9 +6059,9 @@ probedone(struct cam_periph *periph, uni xpt_devise_transport(path); if (INQ_DATA_TQ_ENABLED(inq_buf)) - softc->action = PROBE_MODE_SENSE; + PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); else - softc->action = PROBE_SERIAL_NUM_0; + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -6094,7 +6126,7 @@ probedone(struct cam_periph *periph, uni } xpt_release_ccb(done_ccb); free(mode_hdr, M_CAMXPT); - softc->action = PROBE_SERIAL_NUM_0; + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_0); xpt_schedule(periph, priority); return; } @@ -6139,7 +6171,7 @@ probedone(struct cam_periph *periph, uni if (serialnum_supported) { xpt_release_ccb(done_ccb); - softc->action = PROBE_SERIAL_NUM_1; + PROBE_SET_ACTION(softc, PROBE_SERIAL_NUM_1); xpt_schedule(periph, priority); return; } @@ -6250,7 +6282,7 @@ probedone(struct cam_periph *periph, uni * Perform a TUR to allow the controller to * perform any necessary transfer negotiation. */ - softc->action = PROBE_TUR_FOR_NEGOTIATION; + PROBE_SET_ACTION(softc, PROBE_TUR_FOR_NEGOTIATION); xpt_schedule(periph, priority); return; } @@ -6283,7 +6315,7 @@ probedone(struct cam_periph *periph, uni ("Begin Domain Validation\n")); path->device->flags |= CAM_DEV_IN_DV; xpt_release_ccb(done_ccb); - softc->action = PROBE_INQUIRY_BASIC_DV1; + PROBE_SET_ACTION(softc, PROBE_INQUIRY_BASIC_DV1); xpt_schedule(periph, priority); return; } @@ -6321,10 +6353,10 @@ probedone(struct cam_periph *periph, uni softc->action == PROBE_INQUIRY_BASIC_DV1 ? 1 : 2); if (proberequestbackoff(periph, path->device)) { path->device->flags &= ~CAM_DEV_IN_DV; - softc->action = PROBE_TUR_FOR_NEGOTIATION; + PROBE_SET_ACTION(softc, PROBE_TUR_FOR_NEGOTIATION); } else { /* give up */ - softc->action = PROBE_DV_EXIT; + PROBE_SET_ACTION(softc, PROBE_DV_EXIT); } free(nbuf, M_CAMXPT); xpt_release_ccb(done_ccb); @@ -6333,12 +6365,12 @@ probedone(struct cam_periph *periph, uni } free(nbuf, M_CAMXPT); if (softc->action == PROBE_INQUIRY_BASIC_DV1) { - softc->action = PROBE_INQUIRY_BASIC_DV2; + PROBE_SET_ACTION(softc, PROBE_INQUIRY_BASIC_DV2); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; } - if (softc->action == PROBE_DV_EXIT) { + if (softc->action == PROBE_INQUIRY_BASIC_DV2) { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Leave Domain Validation Successfully\n")); } @@ -6354,6 +6386,11 @@ probedone(struct cam_periph *periph, uni xpt_release_ccb(done_ccb); break; } + case PROBE_INVALID: + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_INFO, + ("probedone: invalid action state\n")); + default: + break; } done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 14:57:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB03B106564A; Mon, 16 Feb 2009 14:57:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7F28FC15; Mon, 16 Feb 2009 14:57:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GEvFrr059221; Mon, 16 Feb 2009 14:57:15 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GEvFfg059220; Mon, 16 Feb 2009 14:57:15 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902161457.n1GEvFfg059220@svn.freebsd.org> From: Scott Long Date: Mon, 16 Feb 2009 14:57: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: r188671 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 14:57:16 -0000 Author: scottl Date: Mon Feb 16 14:57:15 2009 New Revision: 188671 URL: http://svn.freebsd.org/changeset/base/188671 Log: Fix parallel SCSI negotiation in the CAM_NEW_TRAN_CODE world order. Overzealous sanity checks were locking the sync_rate and offset values to zero, thanks to a twisty maze of recursive code. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 16 14:38:52 2009 (r188670) +++ head/sys/cam/cam_xpt.c Mon Feb 16 14:57:15 2009 (r188671) @@ -6679,9 +6679,7 @@ xpt_set_transfer_settings(struct ccb_tra if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0 && (inq_data->flags & SID_Sync) == 0 && cts->type == CTS_TYPE_CURRENT_SETTINGS) - || ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) - || (spi->sync_offset == 0) - || (spi->sync_period == 0)) { + || ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0)) { /* Force async */ spi->sync_period = 0; spi->sync_offset = 0; @@ -6729,7 +6727,8 @@ xpt_set_transfer_settings(struct ccb_tra if (spi->bus_width == 0) spi->ppr_options = 0; - if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) == 0) { + if ((spi->valid & CTS_SPI_VALID_DISC) + && ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) == 0)) { /* * Can't tag queue without disconnection. */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:07:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D4B1065677; Mon, 16 Feb 2009 15:07:40 +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 D12CB8FC1B; Mon, 16 Feb 2009 15:07:40 +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 n1GF7eRT059442; Mon, 16 Feb 2009 15:07:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GF7eDl059441; Mon, 16 Feb 2009 15:07:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161507.n1GF7eDl059441@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 15:07: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: r188672 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:07:41 -0000 Author: luigi Date: Mon Feb 16 15:07:40 2009 New Revision: 188672 URL: http://svn.freebsd.org/changeset/base/188672 Log: remove dependency on net/if.h of this header Modified: head/sys/netinet/if_ether.h Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Mon Feb 16 14:57:15 2009 (r188671) +++ head/sys/netinet/if_ether.h Mon Feb 16 15:07:40 2009 (r188672) @@ -110,6 +110,7 @@ extern u_char ether_ipmulticast_min[ETHE extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN]; struct llentry; +struct ifaddr; int arpresolve(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m, struct sockaddr *dst, u_char *desten, From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:08:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678DE106566B; Mon, 16 Feb 2009 15:08:41 +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 571618FC1D; Mon, 16 Feb 2009 15:08:41 +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 n1GF8fcS059499; Mon, 16 Feb 2009 15:08:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GF8fos059498; Mon, 16 Feb 2009 15:08:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161508.n1GF8fos059498@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 15:08: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: r188673 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:08:41 -0000 Author: luigi Date: Mon Feb 16 15:08:41 2009 New Revision: 188673 URL: http://svn.freebsd.org/changeset/base/188673 Log: remove dependency on eventhandler.h, we only need a forward declaration Modified: head/sys/netinet/ip_fw.h Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Mon Feb 16 15:07:40 2009 (r188672) +++ head/sys/netinet/ip_fw.h Mon Feb 16 15:08:41 2009 (r188673) @@ -682,6 +682,7 @@ typedef int ipfw_nat_t(struct ip_fw_args typedef int ipfw_nat_cfg_t(struct sockopt *); #endif +struct eventhandler_entry; /* * Stack virtualization support. */ @@ -713,7 +714,7 @@ struct vnet_ipfw { u_int32_t _dyn_max; u_int64_t _norule_counter; struct callout _ipfw_timeout; - eventhandler_tag _ifaddr_event_tag; + struct eventhandler_entry *_ifaddr_event_tag; }; #ifndef VIMAGE From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:09:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C30E106566B; Mon, 16 Feb 2009 15:09:38 +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 D58A78FC1B; Mon, 16 Feb 2009 15:09:37 +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 n1GF9bp0059561; Mon, 16 Feb 2009 15:09:37 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GF9b2A059560; Mon, 16 Feb 2009 15:09:37 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161509.n1GF9b2A059560@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 15:09: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: r188674 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:09:38 -0000 Author: luigi Date: Mon Feb 16 15:09:37 2009 New Revision: 188674 URL: http://svn.freebsd.org/changeset/base/188674 Log: remove unnecessary forward declaration Modified: head/sys/net/if.h Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Mon Feb 16 15:08:41 2009 (r188673) +++ head/sys/net/if.h Mon Feb 16 15:09:37 2009 (r188674) @@ -452,8 +452,6 @@ __END_DECLS #endif #ifdef _KERNEL -struct thread; - /* XXX - this should go away soon. */ #include #endif From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:10:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A003510657CD; Mon, 16 Feb 2009 15:10:03 +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 7555B8FC13; Mon, 16 Feb 2009 15:10:03 +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 n1GFA3GV059613; Mon, 16 Feb 2009 15:10:03 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GFA3We059612; Mon, 16 Feb 2009 15:10:03 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161510.n1GFA3We059612@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 15:10: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: r188675 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:10:04 -0000 Author: luigi Date: Mon Feb 16 15:10:03 2009 New Revision: 188675 URL: http://svn.freebsd.org/changeset/base/188675 Log: we need if_var.h not if.h Modified: head/sys/net/vnet.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Mon Feb 16 15:09:37 2009 (r188674) +++ head/sys/net/vnet.h Mon Feb 16 15:10:03 2009 (r188675) @@ -35,7 +35,7 @@ #include "opt_route.h" -#include +#include #include struct vnet_net { From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:10:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A1F1065670; Mon, 16 Feb 2009 15:10:51 +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 D1DE28FC1A; Mon, 16 Feb 2009 15:10:51 +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 n1GFAp3E059664; Mon, 16 Feb 2009 15:10:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GFApkN059662; Mon, 16 Feb 2009 15:10:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161510.n1GFApkN059662@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 15:10: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: r188676 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:10:52 -0000 Author: luigi Date: Mon Feb 16 15:10:51 2009 New Revision: 188676 URL: http://svn.freebsd.org/changeset/base/188676 Log: correct some #include Modified: head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_pfil.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Mon Feb 16 15:10:03 2009 (r188675) +++ head/sys/netinet/ip_fw2.c Mon Feb 16 15:10:51 2009 (r188676) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* for ETHERTYPE_IP */ #include #include #include @@ -98,8 +99,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include /* XXX for ETHERTYPE_IP */ - #include /* XXX for in_cksum */ #ifdef MAC Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Mon Feb 16 15:10:03 2009 (r188675) +++ head/sys/netinet/ip_fw_pfil.c Mon Feb 16 15:10:51 2009 (r188676) @@ -51,13 +51,13 @@ __FBSDID("$FreeBSD$"); #include #include +#define _NET_IF_VAR_H_ /* we don't want if_var.h, only if.h */ #include #include #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:17:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 782861065692; Mon, 16 Feb 2009 15:17:27 +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 4A1EE8FC1B; Mon, 16 Feb 2009 15:17:27 +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 n1GFHRwN059836; Mon, 16 Feb 2009 15:17:27 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GFHRmI059834; Mon, 16 Feb 2009 15:17:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200902161517.n1GFHRmI059834@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 16 Feb 2009 15:17: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: r188677 - in head/sys/fs: procfs pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:17:29 -0000 Author: des Date: Mon Feb 16 15:17:26 2009 New Revision: 188677 URL: http://svn.freebsd.org/changeset/base/188677 Log: Fix a logic bug that caused the pfs_attr method to be called only for PFS_PROCDEP nodes. Submitted by: Andrew Brampton MFC after: 2 weeks Modified: head/sys/fs/procfs/procfs.c head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Mon Feb 16 15:10:51 2009 (r188676) +++ head/sys/fs/procfs/procfs.c Mon Feb 16 15:17:26 2009 (r188677) @@ -99,7 +99,6 @@ procfs_docurproc(PFS_FILL_ARGS) int procfs_attr(PFS_ATTR_ARGS) { - PROC_LOCK_ASSERT(p, MA_OWNED); /* XXX inefficient, split into separate functions */ if (strcmp(pn->pn_name, "ctl") == 0 || @@ -112,11 +111,12 @@ procfs_attr(PFS_ATTR_ARGS) strcmp(pn->pn_name, "fpregs") == 0) vap->va_mode = 0600; - if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir) - vap->va_mode = 0; + if (p != NULL) { + PROC_LOCK_ASSERT(p, MA_OWNED); - vap->va_uid = p->p_ucred->cr_uid; - vap->va_gid = p->p_ucred->cr_gid; + if ((p->p_flag & P_SUGID) && pn->pn_type != pfstype_procdir) + vap->va_mode = 0; + } return (0); } Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 16 15:10:51 2009 (r188676) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 16 15:17:26 2009 (r188677) @@ -226,14 +226,17 @@ pfs_getattr(struct vop_getattr_args *va) if (proc != NULL) { vap->va_uid = proc->p_ucred->cr_ruid; vap->va_gid = proc->p_ucred->cr_rgid; - if (pn->pn_attr != NULL) - error = pn_attr(curthread, proc, pn, vap); - PROC_UNLOCK(proc); } else { vap->va_uid = 0; vap->va_gid = 0; } + if (pn->pn_attr != NULL) + error = pn_attr(curthread, proc, pn, vap); + + if(proc != NULL) + PROC_UNLOCK(proc); + PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 15:32:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542271065677; Mon, 16 Feb 2009 15:32: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 433B08FC14; Mon, 16 Feb 2009 15:32: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 n1GFWCwa060204; Mon, 16 Feb 2009 15:32:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GFWChu060203; Mon, 16 Feb 2009 15:32:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902161532.n1GFWChu060203@svn.freebsd.org> From: Andrew Thompson Date: Mon, 16 Feb 2009 15:32: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: r188678 - head/lib/libusb20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 15:32:13 -0000 Author: thompsa Date: Mon Feb 16 15:32:12 2009 New Revision: 188678 URL: http://svn.freebsd.org/changeset/base/188678 Log: MFp4 //depot/projects/usb@157783 libusb20: Make return value compatible with libusb0.12.x in case of a USB transfer timeout. Submitted by: Hans Petter Selasky Modified: head/lib/libusb20/libusb20_compat01.c Modified: head/lib/libusb20/libusb20_compat01.c ============================================================================== --- head/lib/libusb20/libusb20_compat01.c Mon Feb 16 15:17:26 2009 (r188677) +++ head/lib/libusb20/libusb20_compat01.c Mon Feb 16 15:32:12 2009 (r188678) @@ -32,6 +32,7 @@ #include #include +#include #include "libusb20.h" #include "libusb20_desc.h" @@ -617,9 +618,16 @@ usb_std_io(usb_dev_handle * dev, int ep, libusb20_dev_wait_process((void *)dev, -1); } - if (libusb20_tr_get_status(xfer)) { - /* transfer error */ - return (-1); + switch (libusb20_tr_get_status(xfer)) { + case 0: + /* success */ + break; + case LIBUSB20_TRANSFER_TIMED_OUT: + /* transfer timeout */ + return (-ETIMEDOUT); + default: + /* other transfer error */ + return (-ENXIO); } actlen = libusb20_tr_get_actual_length(xfer); From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 16:36:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F428106564A; Mon, 16 Feb 2009 16:36:32 +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 3DC478FC18; Mon, 16 Feb 2009 16:36:32 +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 n1GGaWLZ067187; Mon, 16 Feb 2009 16:36:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GGaWDO067186; Mon, 16 Feb 2009 16:36:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161636.n1GGaWDO067186@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 16:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188679 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:36:33 -0000 Author: luigi Date: Mon Feb 16 16:36:31 2009 New Revision: 188679 URL: http://svn.freebsd.org/changeset/base/188679 Log: make the dependency on lock.h and mutex.h explicit instead of inheriting them from net/if.h Modified: stable/7/sys/netinet/ip_dummynet.c Modified: stable/7/sys/netinet/ip_dummynet.c ============================================================================== --- stable/7/sys/netinet/ip_dummynet.c Mon Feb 16 15:32:12 2009 (r188678) +++ stable/7/sys/netinet/ip_dummynet.c Mon Feb 16 16:36:31 2009 (r188679) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -70,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ +#include /* IFNAMSIZ, struct ifaddr, ifq head */ #include #include #include /* ip_len, ip_off */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 16:48:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1898B10656CC; Mon, 16 Feb 2009 16:48:50 +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 EEA158FC15; Mon, 16 Feb 2009 16:48:49 +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 n1GGmn2m068532; Mon, 16 Feb 2009 16:48:49 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GGmnYQ068531; Mon, 16 Feb 2009 16:48:49 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161648.n1GGmnYQ068531@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 16:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188680 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:48:52 -0000 Author: luigi Date: Mon Feb 16 16:48:49 2009 New Revision: 188680 URL: http://svn.freebsd.org/changeset/base/188680 Log: various cleanup (mostly MFC, one not applicable to head): - remove 3 unneeded headers (this is not applicable to head); - replace netinet/if_ether.h with net/ethernet.h which is really needed; - add missing #ifdef SYSCTL_NODE / #endif - use the 'ch' argument instead of &layer3_chain when adding entries to a table; - remove an assigment within a conditional; - properly initialize a couple of variables - use a constant format string in a log message - remove unnecessary braces and simplify the error messages in IP_FW_NAT_* handler Modified: stable/7/sys/netinet/ip_fw2.c Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Mon Feb 16 16:36:31 2009 (r188679) +++ stable/7/sys/netinet/ip_fw2.c Mon Feb 16 16:48:49 2009 (r188680) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include @@ -58,12 +56,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include +#include /* for ETHERTYPE_IP */ #include #include #include @@ -94,8 +92,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include /* XXX for ETHERTYPE_IP */ - #include /* XXX for in_cksum */ #ifdef MAC @@ -111,11 +107,10 @@ __FBSDID("$FreeBSD$"); * Rules in set RESVD_SET can only be deleted explicitly. */ static u_int32_t set_disable; - static int fw_verbose; +static struct callout ipfw_timeout; static int verbose_limit; -static struct callout ipfw_timeout; static uma_zone_t ipfw_dyn_rule_zone; /* @@ -176,6 +171,9 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, ve &verbose_limit, 0, "Set upper limit of matches of ipfw rules logged"); SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, default_rule, CTLFLAG_RD, NULL, IPFW_DEFAULT_RULE, "The default/max possible rule number."); +SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, tables_max, CTLFLAG_RD, + NULL, IPFW_TABLES_MAX, "The maximum number of tables."); +#endif /* SYSCTL_NODE */ /* * Description of dynamic rules. @@ -252,6 +250,7 @@ static u_int32_t static_len; /* size in static u_int32_t dyn_count; /* # of dynamic rules */ static u_int32_t dyn_max = 4096; /* max # of dynamic rules */ +#ifdef SYSCTL_NODE SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, CTLFLAG_RW, &dyn_buckets, 0, "Number of dyn. buckets"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_RD, @@ -276,17 +275,19 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, dy &dyn_short_lifetime, 0, "Lifetime of dyn. rules for other situations"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_RW, &dyn_keepalive, 0, "Enable keepalives for dyn. rules"); +#endif /* SYSCTL_NODE */ #ifdef INET6 /* * IPv6 specific variables */ +#ifdef SYSCTL_NODE SYSCTL_DECL(_net_inet6_ip6); +#endif /* SYSCTL_NODE */ static struct sysctl_ctx_list ip6_fw_sysctl_ctx; static struct sysctl_oid *ip6_fw_sysctl_tree; #endif /* INET6 */ -#endif /* SYSCTL_NODE */ static int fw_deny_unknown_exthdrs = 1; @@ -1773,6 +1774,7 @@ add_table_entry(struct ip_fw_chain *ch, { struct radix_node_head *rnh; struct table_entry *ent; + struct radix_node *rn; if (tbl >= IPFW_TABLES_MAX) return (EINVAL); @@ -1784,14 +1786,14 @@ add_table_entry(struct ip_fw_chain *ch, ent->addr.sin_len = ent->mask.sin_len = 8; ent->mask.sin_addr.s_addr = htonl(mlen ? ~((1 << (32 - mlen)) - 1) : 0); ent->addr.sin_addr.s_addr = addr & ent->mask.sin_addr.s_addr; - IPFW_WLOCK(&layer3_chain); - if (rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent) == - NULL) { - IPFW_WUNLOCK(&layer3_chain); + IPFW_WLOCK(ch); + rn = rnh->rnh_addaddr(&ent->addr, &ent->mask, rnh, (void *)ent); + if (rn == NULL) { + IPFW_WUNLOCK(ch); free(ent, M_IPFW_TBL); return (EEXIST); } - IPFW_WUNLOCK(&layer3_chain); + IPFW_WUNLOCK(ch); return (0); } @@ -2205,6 +2207,7 @@ ipfw_chk(struct ip_fw_args *args) if (m->m_flags & M_SKIP_FIREWALL) return (IP_FW_PASS); /* accept */ + dst_ip.s_addr = 0; /* make sure it is initialized */ pktlen = m->m_pkthdr.len; args->f_id.fib = M_GETFIB(m); /* note mbuf not altered) */ proto = args->f_id.proto = 0; /* mark f_id invalid */ @@ -2662,7 +2665,7 @@ check_body: uint32_t a = (cmd->opcode == O_IP_DST_LOOKUP) ? dst_ip.s_addr : src_ip.s_addr; - uint32_t v; + uint32_t v = 0; match = lookup_table(chain, cmd->arg1, a, &v); @@ -3714,8 +3717,8 @@ zero_entry(struct ip_fw_chain *chain, u_ continue; clear_counters(rule, log_only); } - msg = log_only ? "ipfw: All logging counts reset.\n" : - "ipfw: Accounting cleared.\n"; + msg = log_only ? "logging counts reset" : + "Accounting cleared"; } else { int cleared = 0; /* @@ -3736,13 +3739,18 @@ zero_entry(struct ip_fw_chain *chain, u_ IPFW_WUNLOCK(chain); return (EINVAL); } - msg = log_only ? "ipfw: Entry %d logging count reset.\n" : - "ipfw: Entry %d cleared.\n"; + msg = log_only ? "logging count reset" : "cleared"; } IPFW_WUNLOCK(chain); - if (fw_verbose) - log(LOG_SECURITY | LOG_NOTICE, msg, rulenum); + if (fw_verbose) { + int lev = LOG_SECURITY | LOG_NOTICE; + + if (rulenum) + log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); + else + log(lev, "ipfw: %s.\n", msg); + } return (0); } @@ -4357,49 +4365,44 @@ ipfw_ctl(struct sockopt *sopt) break; case IP_FW_NAT_CFG: - { if (IPFW_NAT_LOADED) error = ipfw_nat_cfg_ptr(sopt); else { - printf("IP_FW_NAT_CFG: ipfw_nat not present, please load it.\n"); + printf("IP_FW_NAT_CFG: %s\n", + "ipfw_nat not present, please load it"); error = EINVAL; } - } - break; + break; case IP_FW_NAT_DEL: - { if (IPFW_NAT_LOADED) error = ipfw_nat_del_ptr(sopt); else { - printf("IP_FW_NAT_DEL: ipfw_nat not present, please load it.\n"); - printf("ipfw_nat not loaded: %d\n", sopt->sopt_name); + printf("IP_FW_NAT_DEL: %s\n", + "ipfw_nat not present, please load it"); error = EINVAL; } - } - break; + break; case IP_FW_NAT_GET_CONFIG: - { if (IPFW_NAT_LOADED) error = ipfw_nat_get_cfg_ptr(sopt); else { - printf("IP_FW_NAT_GET_CFG: ipfw_nat not present, please load it.\n"); + printf("IP_FW_NAT_GET_CFG: %s\n", + "ipfw_nat not present, please load it"); error = EINVAL; } - } - break; + break; case IP_FW_NAT_GET_LOG: - { if (IPFW_NAT_LOADED) error = ipfw_nat_get_log_ptr(sopt); else { - printf("IP_FW_NAT_GET_LOG: ipfw_nat not present, please load it.\n"); + printf("IP_FW_NAT_GET_LOG: %s\n", + "ipfw_nat not present, please load it"); error = EINVAL; } - } - break; + break; default: printf("ipfw: ipfw_ctl invalid option %d\n", sopt->sopt_name); From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 18:02:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E116B106567D; Mon, 16 Feb 2009 18:02:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF1008FC1C; Mon, 16 Feb 2009 18:02:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GI2WJw076950; Mon, 16 Feb 2009 18:02:32 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GI2W3d076949; Mon, 16 Feb 2009 18:02:32 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902161802.n1GI2W3d076949@svn.freebsd.org> From: Scott Long Date: Mon, 16 Feb 2009 18:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188688 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 18:02:34 -0000 Author: scottl Date: Mon Feb 16 18:02:32 2009 New Revision: 188688 URL: http://svn.freebsd.org/changeset/base/188688 Log: GCC attacks! Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 16 17:45:29 2009 (r188687) +++ head/sys/cam/cam_xpt.c Mon Feb 16 18:02:32 2009 (r188688) @@ -5439,7 +5439,8 @@ static char *probe_action_text[] = { #define PROBE_SET_ACTION(softc, newaction) \ do { \ - char **text = probe_action_text; \ + char **text; \ + text = probe_action_text; \ CAM_DEBUG((softc)->periph->path, CAM_DEBUG_INFO, \ ("Probe %s to %s\n", text[(softc)->action], \ text[(newaction)])); \ From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 18:24:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E778106566B; Mon, 16 Feb 2009 18:24:49 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5DB8FC15; Mon, 16 Feb 2009 18:24:49 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GIOnoK079454; Mon, 16 Feb 2009 18:24:49 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GIOnO3079452; Mon, 16 Feb 2009 18:24:49 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200902161824.n1GIOnO3079452@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 16 Feb 2009 18:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188690 - in stable/7/lib/libc: . net string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 18:24:50 -0000 Author: ume Date: Mon Feb 16 18:24:48 2009 New Revision: 188690 URL: http://svn.freebsd.org/changeset/base/188690 Log: MFH 188316: Shutup warning for DNAME RR. PR: bin/127591 Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv> Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/net/getaddrinfo.c stable/7/lib/libc/net/gethostbydns.c stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/7/lib/libc/net/getaddrinfo.c Mon Feb 16 18:07:23 2009 (r188689) +++ stable/7/lib/libc/net/getaddrinfo.c Mon Feb 16 18:24:48 2009 (r188690) @@ -1884,7 +1884,8 @@ getanswer(const querybuf *answer, int an } } else if (type != qtype) { #ifdef DEBUG - if (type != T_KEY && type != T_SIG) + if (type != T_KEY && type != T_SIG && + type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), Modified: stable/7/lib/libc/net/gethostbydns.c ============================================================================== --- stable/7/lib/libc/net/gethostbydns.c Mon Feb 16 18:07:23 2009 (r188689) +++ stable/7/lib/libc/net/gethostbydns.c Mon Feb 16 18:24:48 2009 (r188690) @@ -294,7 +294,7 @@ gethostanswer(const querybuf *answer, in continue; } if (type != qtype) { - if (type != T_SIG) + if (type != T_SIG && type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 18:32:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F1C1065839; Mon, 16 Feb 2009 18:32:28 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901EF8FC16; Mon, 16 Feb 2009 18:32:28 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GIWSHP080360; Mon, 16 Feb 2009 18:32:28 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GIWSpr080358; Mon, 16 Feb 2009 18:32:28 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200902161832.n1GIWSpr080358@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 16 Feb 2009 18:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188691 - in stable/6/lib/libc: . inet net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 18:32:34 -0000 Author: ume Date: Mon Feb 16 18:32:28 2009 New Revision: 188691 URL: http://svn.freebsd.org/changeset/base/188691 Log: MFH 188316: Shutup warning for DNAME RR. PR: bin/127591 Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv> Modified: stable/6/lib/libc/ (props changed) stable/6/lib/libc/inet/inet_net_pton.c (props changed) stable/6/lib/libc/net/getaddrinfo.c stable/6/lib/libc/net/gethostbydns.c stable/6/lib/libc/sys/ (props changed) Modified: stable/6/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/6/lib/libc/net/getaddrinfo.c Mon Feb 16 18:24:48 2009 (r188690) +++ stable/6/lib/libc/net/getaddrinfo.c Mon Feb 16 18:32:28 2009 (r188691) @@ -1686,7 +1686,8 @@ getanswer(const querybuf *answer, int an } } else if (type != qtype) { #ifdef DEBUG - if (type != T_KEY && type != T_SIG) + if (type != T_KEY && type != T_SIG && + type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), Modified: stable/6/lib/libc/net/gethostbydns.c ============================================================================== --- stable/6/lib/libc/net/gethostbydns.c Mon Feb 16 18:24:48 2009 (r188690) +++ stable/6/lib/libc/net/gethostbydns.c Mon Feb 16 18:32:28 2009 (r188691) @@ -298,7 +298,7 @@ gethostanswer(const querybuf *answer, in continue; } if (type != qtype) { - if (type != T_SIG) + if (type != T_SIG && type != ns_t_dname) syslog(LOG_NOTICE|LOG_AUTH, "gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"", qname, p_class(C_IN), p_type(qtype), From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 18:51:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 282311065673; Mon, 16 Feb 2009 18:51:35 +0000 (UTC) (envelope-from beat@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 167118FC29; Mon, 16 Feb 2009 18:51:35 +0000 (UTC) (envelope-from beat@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GIpYUb082518; Mon, 16 Feb 2009 18:51:34 GMT (envelope-from beat@svn.freebsd.org) Received: (from beat@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GIpYeY082517; Mon, 16 Feb 2009 18:51:34 GMT (envelope-from beat@svn.freebsd.org) Message-Id: <200902161851.n1GIpYeY082517@svn.freebsd.org> From: Beat Gaetzi Date: Mon, 16 Feb 2009 18:51: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: r188692 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 18:51:35 -0000 Author: beat (ports committer) Date: Mon Feb 16 18:51:34 2009 New Revision: 188692 URL: http://svn.freebsd.org/changeset/base/188692 Log: - Add myself to the list of ports committers. Approved by: miwi (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Feb 16 18:32:28 2009 (r188691) +++ head/share/misc/committers-ports.dot Mon Feb 16 18:51:34 2009 (r188692) @@ -52,6 +52,7 @@ anray [label="Andrey Slusar\nanray@FreeB araujo [label="Marcelo Araujo\naraujo@FreeBSD.org\n2007/04/26"] arved [label="Tilman Linneweh\narved@FreeBSD.org\n2002/10/15"] az [label="Andrej Zverev\naz@FreeBSD.org\n2005/10/03"] +beat [label="Beat Gaetzi\nbeat@FreeBSD.org\n2009/01/28"] beech [label="Beech Rintoul\nbeech@FreeBSD.org\n2007/05/30"] bland [label="Alexander Nedotsukov\nbland@FreeBSD.org\n2003/08/14"] brix [label="Henrik Brix Andersen\nbrix@FreeBSD.org\n2007/10/31"] @@ -259,6 +260,7 @@ mat -> thierry mezz -> tmclaugh miwi -> amdmi3 +miwi -> beat miwi -> farrokhi miwi -> gahr miwi -> nox From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 18:59:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5ECA1065709; Mon, 16 Feb 2009 18:59:18 +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 A272B8FC12; Mon, 16 Feb 2009 18:59:18 +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 n1GIxIaQ083402; Mon, 16 Feb 2009 18:59:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GIxIeL083401; Mon, 16 Feb 2009 18:59:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902161859.n1GIxIeL083401@svn.freebsd.org> From: Andrew Thompson Date: Mon, 16 Feb 2009 18:59: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: r188693 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 18:59:20 -0000 Author: thompsa Date: Mon Feb 16 18:59:18 2009 New Revision: 188693 URL: http://svn.freebsd.org/changeset/base/188693 Log: Add an entry for xorg+hal+USB2 not detecting input devices. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Feb 16 18:51:34 2009 (r188692) +++ head/UPDATING Mon Feb 16 18:59:18 2009 (r188693) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090216: + xorg 7.4 wants to configure its input devices via hald which does not + yet work with USB2. If the keyboard/mouse does not work in xorg then + add + Option "AllowEmptyInput" "off" + to your ServerLayout section. This will cause X to use the configured + kbd and mouse sections from your xorg.conf + 20090215: The GENERIC kernels for all architectures now default to the new USB2 stack. No kernel config options or code have been removed so if a From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 19:10:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91F7B106566C; Mon, 16 Feb 2009 19:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65A148FC12; Mon, 16 Feb 2009 19:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GJA7gI084646; Mon, 16 Feb 2009 19:10:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GJA7su084643; Mon, 16 Feb 2009 19:10:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902161910.n1GJA7su084643@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Feb 2009 19:10: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: r188694 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 19:10:08 -0000 Author: mav Date: Mon Feb 16 19:10:07 2009 New Revision: 188694 URL: http://svn.freebsd.org/changeset/base/188694 Log: Give atapci knowledge about set of implemented AHCI ports. It is possible to not allocate them after the recent ata channels enumeration changes. It allows to save some resources, not bother user with unexisting hardware and not check unimplemented ports status on every interrupt. Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Mon Feb 16 18:59:18 2009 (r188693) +++ head/sys/dev/ata/ata-pci.c Mon Feb 16 19:10:07 2009 (r188694) @@ -98,6 +98,7 @@ ata_pci_attach(device_t dev) ctlr->channels = 2; else ctlr->channels = 1; + ctlr->ichannels = -1; ctlr->allocate = ata_pci_allocate; ctlr->dmainit = ata_pci_dmainit; ctlr->dev = dev; @@ -122,6 +123,8 @@ ata_pci_attach(device_t dev) /* attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { + if ((ctlr->ichannels & (1 << unit)) == 0) + continue; child = device_add_child(dev, "ata", ((unit == 0 || unit == 1) && ctlr->legacy) ? unit : devclass_find_free_unit(ata_devclass, 2)); Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Mon Feb 16 18:59:18 2009 (r188693) +++ head/sys/dev/ata/ata-pci.h Mon Feb 16 19:10:07 2009 (r188694) @@ -51,6 +51,7 @@ struct ata_pci_controller { struct ata_chip_id *chip; int legacy; int channels; + int ichannels; int (*chipinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Feb 16 18:59:18 2009 (r188693) +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Feb 16 19:10:07 2009 (r188694) @@ -122,8 +122,9 @@ ata_ahci_chipinit(device_t dev) }; /* get the number of HW channels */ + ctlr->ichannels = ATA_INL(ctlr->r_res2, ATA_AHCI_PI); ctlr->channels = - MAX(flsl(ATA_INL(ctlr->r_res2, ATA_AHCI_PI)), + MAX(flsl(ctlr->ichannels), (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK) + 1); ctlr->reset = ata_ahci_reset; @@ -667,11 +668,6 @@ ata_ahci_reset(device_t dev) u_int32_t signature; int offset = ch->unit << 7; - if (!(ATA_INL(ctlr->r_res2, ATA_AHCI_PI) & (1 << ch->unit))) { - device_printf(dev, "port not implemented\n"); - return; - } - /* setup work areas */ work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 20:04:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388BD106566B; Mon, 16 Feb 2009 20:04:58 +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 2423F8FC24; Mon, 16 Feb 2009 20:04:58 +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 n1GK4wVf090682; Mon, 16 Feb 2009 20:04:58 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GK4vwb090681; Mon, 16 Feb 2009 20:04:57 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200902162004.n1GK4vwb090681@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 16 Feb 2009 20:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188696 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/kbdmux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 20:04:59 -0000 Author: emax Date: Mon Feb 16 20:04:57 2009 New Revision: 188696 URL: http://svn.freebsd.org/changeset/base/188696 Log: MFC r188603 Since r188030 the error value for attach is returned, this means if kbdmux fails to attach (possibly due to disable hints) then we get called back for unload. Correctly handle the case where the keyboard isnt found rather than calling panic. Submitted by: thompsa Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/kbdmux/kbdmux.c Modified: stable/7/sys/dev/kbdmux/kbdmux.c ============================================================================== --- stable/7/sys/dev/kbdmux/kbdmux.c Mon Feb 16 19:18:14 2009 (r188695) +++ stable/7/sys/dev/kbdmux/kbdmux.c Mon Feb 16 20:04:57 2009 (r188696) @@ -1367,15 +1367,14 @@ kbdmux_modevent(module_t mod, int type, panic("kbd_get_switch(" KEYBOARD_NAME ") == NULL"); kbd = kbd_get_keyboard(kbd_find_keyboard(KEYBOARD_NAME, 0)); - if (kbd == NULL) - panic("kbd_get_keyboard(kbd_find_keyboard(" KEYBOARD_NAME ", 0)) == NULL"); - - (*sw->disable)(kbd); + if (kbd != NULL) { + (*sw->disable)(kbd); #ifdef KBD_INSTALL_CDEV - kbd_detach(kbd); + kbd_detach(kbd); #endif - (*sw->term)(kbd); - kbd_delete_driver(&kbdmux_kbd_driver); + (*sw->term)(kbd); + kbd_delete_driver(&kbdmux_kbd_driver); + } error = 0; break; From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 20:12:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 405BF1065672; Mon, 16 Feb 2009 20:12:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E56B8FC0A; Mon, 16 Feb 2009 20:12:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GKCT9U091538; Mon, 16 Feb 2009 20:12:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GKCTQi091537; Mon, 16 Feb 2009 20:12:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902162012.n1GKCTQi091537@svn.freebsd.org> From: Ed Schouten Date: Mon, 16 Feb 2009 20:12: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: r188697 - head/sys/dev/streams X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 20:12:29 -0000 Author: ed Date: Mon Feb 16 20:12:28 2009 New Revision: 188697 URL: http://svn.freebsd.org/changeset/base/188697 Log: The streams ptm code is pretty awful and likely incorrect. I don't know anything about streams, so I'm not going to fix it. Just a small comment to redirect folks to posix_openpt(). Modified: head/sys/dev/streams/streams.c Modified: head/sys/dev/streams/streams.c ============================================================================== --- head/sys/dev/streams/streams.c Mon Feb 16 20:04:57 2009 (r188696) +++ head/sys/dev/streams/streams.c Mon Feb 16 20:12:28 2009 (r188697) @@ -288,6 +288,8 @@ svr4_ptm_alloc(td) * * Cycle through the names. If sys_open() returns ENOENT (or * ENXIO), short circuit the cycle and exit. + * + * XXX: Maybe this can now be implemented by posix_openpt()? */ static char ptyname[] = "/dev/ptyXX"; static char ttyletters[] = "pqrstuwxyzPQRST"; From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:42:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56530106566C; Mon, 16 Feb 2009 21:42:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43AB88FC1A; Mon, 16 Feb 2009 21:42:42 +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 n1GLggQv095411; Mon, 16 Feb 2009 21:42:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GLggqX095410; Mon, 16 Feb 2009 21:42:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902162142.n1GLggqX095410@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 16 Feb 2009 21:42: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: r188698 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 21:42:42 -0000 Author: marcel Date: Mon Feb 16 21:42:41 2009 New Revision: 188698 URL: http://svn.freebsd.org/changeset/base/188698 Log: Include Marvell EHCI HC driver for USB2. Modified: head/sys/arm/mv/files.mv Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Mon Feb 16 20:12:28 2009 (r188697) +++ head/sys/arm/mv/files.mv Mon Feb 16 21:42:41 2009 (r188698) @@ -33,3 +33,4 @@ dev/uart/uart_bus_mbus.c optional uart dev/uart/uart_cpu_mv.c optional uart dev/uart/uart_dev_ns8250.c optional uart dev/usb/ehci_mbus.c optional ehci +dev/usb2/controller/ehci2_mbus.c optional usb2_core usb2_controller usb2_controller_ehci From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:56:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB7D7106564A; Mon, 16 Feb 2009 21:56:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D47538FC13; Mon, 16 Feb 2009 21:56:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GLuHUC095724; Mon, 16 Feb 2009 21:56:17 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GLuHkd095723; Mon, 16 Feb 2009 21:56:17 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200902162156.n1GLuHkd095723@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Feb 2009 21:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188699 - head/contrib/telnet/telnetd releng/7.0 releng/7.0/contrib/telnet/telnetd releng/7.0/sys/conf releng/7.1 releng/7.1/contrib/telnet/telnetd releng/7.1/sys/conf stable/7/contrib/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 21:56:19 -0000 Author: cperciva Date: Mon Feb 16 21:56:17 2009 New Revision: 188699 URL: http://svn.freebsd.org/changeset/base/188699 Log: Correctly scrub telnetd's environment. Approved by: so (cperciva) Security: FreeBSD-SA-09:05.telnetd Modified: stable/7/contrib/telnet/telnetd/sys_term.c Changes in other areas also in this revision: Modified: head/contrib/telnet/telnetd/sys_term.c releng/7.0/UPDATING releng/7.0/contrib/telnet/telnetd/sys_term.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/telnet/telnetd/sys_term.c releng/7.1/sys/conf/newvers.sh Modified: stable/7/contrib/telnet/telnetd/sys_term.c ============================================================================== --- stable/7/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:42:41 2009 (r188698) +++ stable/7/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:56:17 2009 (r188699) @@ -1285,8 +1285,18 @@ scrub_env(void) char **cpp, **cpp2; const char **p; - - for (cpp2 = cpp = environ; *cpp; cpp++) { + char ** new_environ; + size_t count; + + /* Allocate space for scrubbed environment. */ + for (count = 1, cpp = environ; *cpp; count++, cpp++) + continue; + if ((new_environ = malloc(count * sizeof(char *))) == NULL) { + environ = NULL; + return; + } + + for (cpp2 = new_environ, cpp = environ; *cpp; cpp++) { int reject_it = 0; for(p = rej; *p; p++) @@ -1300,10 +1310,15 @@ scrub_env(void) for(p = acc; *p; p++) if(strncmp(*cpp, *p, strlen(*p)) == 0) break; - if(*p != NULL) - *cpp2++ = *cpp; + if(*p != NULL) { + if ((*cpp2++ = strdup(*cpp)) == NULL) { + environ = new_environ; + return; + } + } } *cpp2 = NULL; + environ = new_environ; } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:56:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BF75106566B; Mon, 16 Feb 2009 21:56:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91418FC14; Mon, 16 Feb 2009 21:56:17 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GLuH1S095730; Mon, 16 Feb 2009 21:56:17 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GLuHVX095729; Mon, 16 Feb 2009 21:56:17 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200902162156.n1GLuHVX095729@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Feb 2009 21:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188699 - head/contrib/telnet/telnetd releng/7.0 releng/7.0/contrib/telnet/telnetd releng/7.0/sys/conf releng/7.1 releng/7.1/contrib/telnet/telnetd releng/7.1/sys/conf stable/7/contrib/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 21:56:20 -0000 Author: cperciva Date: Mon Feb 16 21:56:17 2009 New Revision: 188699 URL: http://svn.freebsd.org/changeset/base/188699 Log: Correctly scrub telnetd's environment. Approved by: so (cperciva) Security: FreeBSD-SA-09:05.telnetd Modified: head/contrib/telnet/telnetd/sys_term.c Changes in other areas also in this revision: Modified: releng/7.0/UPDATING releng/7.0/contrib/telnet/telnetd/sys_term.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/telnet/telnetd/sys_term.c releng/7.1/sys/conf/newvers.sh stable/7/contrib/telnet/telnetd/sys_term.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:42:41 2009 (r188698) +++ head/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:56:17 2009 (r188699) @@ -1271,8 +1271,18 @@ scrub_env(void) char **cpp, **cpp2; const char **p; - - for (cpp2 = cpp = environ; *cpp; cpp++) { + char ** new_environ; + size_t count; + + /* Allocate space for scrubbed environment. */ + for (count = 1, cpp = environ; *cpp; count++, cpp++) + continue; + if ((new_environ = malloc(count * sizeof(char *))) == NULL) { + environ = NULL; + return; + } + + for (cpp2 = new_environ, cpp = environ; *cpp; cpp++) { int reject_it = 0; for(p = rej; *p; p++) @@ -1286,10 +1296,15 @@ scrub_env(void) for(p = acc; *p; p++) if(strncmp(*cpp, *p, strlen(*p)) == 0) break; - if(*p != NULL) - *cpp2++ = *cpp; + if(*p != NULL) { + if ((*cpp2++ = strdup(*cpp)) == NULL) { + environ = new_environ; + return; + } + } } *cpp2 = NULL; + environ = new_environ; } /* From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:56:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52AD3106566C; Mon, 16 Feb 2009 21:56:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1B68FC15; Mon, 16 Feb 2009 21:56:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GLuIcW095741; Mon, 16 Feb 2009 21:56:18 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GLuHBL095735; Mon, 16 Feb 2009 21:56:17 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200902162156.n1GLuHBL095735@svn.freebsd.org> From: Colin Percival Date: Mon, 16 Feb 2009 21:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188699 - head/contrib/telnet/telnetd releng/7.0 releng/7.0/contrib/telnet/telnetd releng/7.0/sys/conf releng/7.1 releng/7.1/contrib/telnet/telnetd releng/7.1/sys/conf stable/7/contrib/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 21:56:21 -0000 Author: cperciva Date: Mon Feb 16 21:56:17 2009 New Revision: 188699 URL: http://svn.freebsd.org/changeset/base/188699 Log: Correctly scrub telnetd's environment. Approved by: so (cperciva) Security: FreeBSD-SA-09:05.telnetd Modified: releng/7.0/UPDATING releng/7.0/contrib/telnet/telnetd/sys_term.c releng/7.0/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/telnet/telnetd/sys_term.c releng/7.1/sys/conf/newvers.sh Changes in other areas also in this revision: Modified: head/contrib/telnet/telnetd/sys_term.c stable/7/contrib/telnet/telnetd/sys_term.c Modified: releng/7.0/UPDATING ============================================================================== --- releng/7.0/UPDATING Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.0/UPDATING Mon Feb 16 21:56:17 2009 (r188699) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090216: p10 FreeBSD-SA-09:05.telnetd + Correctly scrub telnetd's environment. + 20090113: p9 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind Correct ntpd cryptographic signature bypass. [09:03] Modified: releng/7.0/contrib/telnet/telnetd/sys_term.c ============================================================================== --- releng/7.0/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.0/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:56:17 2009 (r188699) @@ -1285,8 +1285,18 @@ scrub_env(void) char **cpp, **cpp2; const char **p; - - for (cpp2 = cpp = environ; *cpp; cpp++) { + char ** new_environ; + size_t count; + + /* Allocate space for scrubbed environment. */ + for (count = 1, cpp = environ; *cpp; count++, cpp++) + continue; + if ((new_environ = malloc(count * sizeof(char *))) == NULL) { + environ = NULL; + return; + } + + for (cpp2 = new_environ, cpp = environ; *cpp; cpp++) { int reject_it = 0; for(p = rej; *p; p++) @@ -1300,10 +1310,15 @@ scrub_env(void) for(p = acc; *p; p++) if(strncmp(*cpp, *p, strlen(*p)) == 0) break; - if(*p != NULL) - *cpp2++ = *cpp; + if(*p != NULL) { + if ((*cpp2++ = strdup(*cpp)) == NULL) { + environ = new_environ; + return; + } + } } *cpp2 = NULL; + environ = new_environ; } /* Modified: releng/7.0/sys/conf/newvers.sh ============================================================================== --- releng/7.0/sys/conf/newvers.sh Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.0/sys/conf/newvers.sh Mon Feb 16 21:56:17 2009 (r188699) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.0" -BRANCH="RELEASE-p9" +BRANCH="RELEASE-p10" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.1/UPDATING Mon Feb 16 21:56:17 2009 (r188699) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090216: p3 FreeBSD-SA-09:05.telnetd + Correctly scrub telnetd's environment. + 20090113: p2 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind Correct ntpd cryptographic signature bypass. [09:03] Modified: releng/7.1/contrib/telnet/telnetd/sys_term.c ============================================================================== --- releng/7.1/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.1/contrib/telnet/telnetd/sys_term.c Mon Feb 16 21:56:17 2009 (r188699) @@ -1285,8 +1285,18 @@ scrub_env(void) char **cpp, **cpp2; const char **p; - - for (cpp2 = cpp = environ; *cpp; cpp++) { + char ** new_environ; + size_t count; + + /* Allocate space for scrubbed environment. */ + for (count = 1, cpp = environ; *cpp; count++, cpp++) + continue; + if ((new_environ = malloc(count * sizeof(char *))) == NULL) { + environ = NULL; + return; + } + + for (cpp2 = new_environ, cpp = environ; *cpp; cpp++) { int reject_it = 0; for(p = rej; *p; p++) @@ -1300,10 +1310,15 @@ scrub_env(void) for(p = acc; *p; p++) if(strncmp(*cpp, *p, strlen(*p)) == 0) break; - if(*p != NULL) - *cpp2++ = *cpp; + if(*p != NULL) { + if ((*cpp2++ = strdup(*cpp)) == NULL) { + environ = new_environ; + return; + } + } } *cpp2 = NULL; + environ = new_environ; } /* Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Mon Feb 16 21:42:41 2009 (r188698) +++ releng/7.1/sys/conf/newvers.sh Mon Feb 16 21:56:17 2009 (r188699) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 22:25:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 506181065821; Mon, 16 Feb 2009 22:25:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 387E88FC1C; Mon, 16 Feb 2009 22:25:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GMPeO5096429; Mon, 16 Feb 2009 22:25:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GMPeUi096428; Mon, 16 Feb 2009 22:25:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902162225.n1GMPeUi096428@svn.freebsd.org> From: Alexander Motin Date: Mon, 16 Feb 2009 22:25: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: r188700 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 22:25:44 -0000 Author: mav Date: Mon Feb 16 22:25:39 2009 New Revision: 188700 URL: http://svn.freebsd.org/changeset/base/188700 Log: Make core dumping to ad not to freeze even if interrupts, not disabled for some reason, stealing our events. Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Mon Feb 16 21:56:17 2009 (r188699) +++ head/sys/dev/ata/ata-queue.c Mon Feb 16 22:25:39 2009 (r188700) @@ -214,7 +214,7 @@ ata_start(device_t dev) if (dumping) { mtx_unlock(&ch->state_mtx); mtx_unlock(&ch->queue_mtx); - while (!ata_interrupt(ch)) + while (!ata_interrupt(ch) && ch->running) DELAY(10); return; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 02:14:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496761065673; Tue, 17 Feb 2009 02:14:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DDEF8FC14; Tue, 17 Feb 2009 02:14:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H2E5En000573; Tue, 17 Feb 2009 02:14:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1H2E4mW000570; Tue, 17 Feb 2009 02:14:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902170214.n1H2E4mW000570@svn.freebsd.org> From: Warner Losh Date: Tue, 17 Feb 2009 02: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: r188701 - head/sys/dev/pccbb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 02:14:05 -0000 Author: imp Date: Tue Feb 17 02:14:04 2009 New Revision: 188701 URL: http://svn.freebsd.org/changeset/base/188701 Log: Hold off root mounting until we've gone through the loop of our thread almost once. After we've configured the devices that were present the first time through, then we know that we're done. If the device has other devices that are deferred, then it must do a similar dance. This catches both PC Cards and CardBus cards. Modified: head/sys/dev/pccbb/pccbb.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pccbb/pccbbvar.h Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Feb 16 22:25:39 2009 (r188700) +++ head/sys/dev/pccbb/pccbb.c Tue Feb 17 02:14:04 2009 (r188701) @@ -500,6 +500,15 @@ cbb_event_thread(void *arg) mtx_unlock(&Giant); /* + * First time through we need to tell mountroot that we're + * done. + */ + if (sc->sc_root_token) { + root_mount_rel(sc->sc_root_token); + sc->sc_root_token = NULL; + } + + /* * Wait until it has been 250ms since the last time we * get an interrupt. We handle the rest of the interrupt * at the top of the loop. Although we clear the bit in the Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon Feb 16 22:25:39 2009 (r188700) +++ head/sys/dev/pccbb/pccbb_pci.c Tue Feb 17 02:14:04 2009 (r188701) @@ -439,6 +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)); return (0); err: if (sc->irq_res) Modified: head/sys/dev/pccbb/pccbbvar.h ============================================================================== --- head/sys/dev/pccbb/pccbbvar.h Mon Feb 16 22:25:39 2009 (r188700) +++ head/sys/dev/pccbb/pccbbvar.h Tue Feb 17 02:14:04 2009 (r188701) @@ -88,6 +88,7 @@ struct cbb_softc { struct proc *event_thread; void (*chipinit)(struct cbb_softc *); int powerintr; + struct root_hold_token *sc_root_token; }; /* result of detect_card */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 04:08:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB9951065705; Tue, 17 Feb 2009 04:08:08 +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 996778FC13; Tue, 17 Feb 2009 04:08:08 +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 n1H488jD003017; Tue, 17 Feb 2009 04:08:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1H488wV003016; Tue, 17 Feb 2009 04:08:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902170408.n1H488wV003016@svn.freebsd.org> From: Sean Bruno Date: Tue, 17 Feb 2009 04:08: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: r188704 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 04:08:09 -0000 Author: sbruno Date: Tue Feb 17 04:08:08 2009 New Revision: 188704 URL: http://svn.freebsd.org/changeset/base/188704 Log: Synopsis: If speed of link between two devices is slower than the reported max speed of both endpoints, the current driver will fail and be unable to negotiate. Summary: Test negotiated speed by reading the CSRROM into a dummy variable. If that read fails, decrement our speed and retry. If all else fails, go to lowest speed possible(0). Report speed to the user. Add display of the Bus Info Block when debug.firewire_debug > 1 Support the Bus Info Block(1394a-2000) method of speed detection. I also should note that I am moving "hold_count" to 0 for future releases. This variable determines how many bus resets to "hold" a removed firewire device before deletion. I don't feel this is useful and will probably drop support for this sysctl in the future. Reviewed by: scottl(mentor) MFC after: 2 weeks Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Tue Feb 17 03:58:15 2009 (r188703) +++ head/sys/dev/firewire/firewire.c Tue Feb 17 04:08:08 2009 (r188704) @@ -77,7 +77,7 @@ struct crom_src_buf { struct crom_chunk hw; }; -int firewire_debug=0, try_bmr=1, hold_count=3; +int firewire_debug=0, try_bmr=1, hold_count=0; SYSCTL_INT(_debug, OID_AUTO, firewire_debug, CTLFLAG_RW, &firewire_debug, 0, "FireWire driver debug flag"); SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD, 0, "FireWire Subsystem"); @@ -1503,7 +1503,8 @@ fw_explore_node(struct fw_device *dfwdev uint32_t *csr; struct csrhdr *hdr; struct bus_info *binfo; - int err, node, spd; + int err, node; + uint32_t speed_test = 0; fc = dfwdev->fc; csr = dfwdev->csrrom; @@ -1511,8 +1512,12 @@ fw_explore_node(struct fw_device *dfwdev /* First quad */ err = fw_explore_read_quads(dfwdev, CSRROMOFF, &csr[0], 1); - if (err) + if (err) { + device_printf(fc->bdev, "%s: node%d: explore_read_quads failure\n", + __func__, node); + dfwdev->status = FWDEVINVAL; return (-1); + } hdr = (struct csrhdr *)&csr[0]; if (hdr->info_len != 4) { if (firewire_debug) @@ -1532,7 +1537,18 @@ fw_explore_node(struct fw_device *dfwdev node, binfo->bus_name); return (-1); } - spd = fc->speed_map->speed[fc->nodeid][node]; + + if (firewire_debug) + device_printf(fc->bdev, "%s: node(%d) BUS INFO BLOCK:\n" + "irmc(%d) cmc(%d) isc(%d) bmc(%d) pmc(%d) " + "cyc_clk_acc(%d) max_rec(%d) max_rom(%d) " + "generation(%d) link_spd(%d)\n", + __func__, node, + binfo->irmc, binfo->cmc, binfo->isc, + binfo->bmc, binfo->pmc, binfo->cyc_clk_acc, + binfo->max_rec, binfo->max_rom, + binfo->generation, binfo->link_spd); + STAILQ_FOREACH(fwdev, &fc->devices, link) if (FW_EUI64_EQUAL(fwdev->eui, binfo->eui64)) break; @@ -1547,6 +1563,40 @@ fw_explore_node(struct fw_device *dfwdev } fwdev->fc = fc; fwdev->eui = binfo->eui64; + /* + * Pre-1394a-2000 didn't have link_spd in + * the Bus Info block, so try and use the + * speed map value. + * 1394a-2000 compliant devices only use + * the Bus Info Block link spd value, so + * ignore the speed map alltogether. SWB + */ + if ( binfo->link_spd == FWSPD_S100 /* 0 */) { + device_printf(fc->bdev, "%s" + "Pre 1394a-2000 detected\n", + __func__); + fwdev->speed = fc->speed_map->speed[fc->nodeid][node]; + } else + fwdev->speed = binfo->link_spd; + /* + * Test this speed with a read to the CSRROM. + * If it fails, slow down the speed and retry. + */ + while (fwdev->speed > 0) { + err = fw_explore_read_quads(fwdev, CSRROMOFF, + &speed_test, 1); + if (err) + fwdev->speed--; + else + break; + + } + if (fwdev->speed != binfo->link_spd) + device_printf(fc->bdev, "%s: fwdev->speed(%s)" + " set lower than binfo->link_spd(%s)\n", + __func__, + linkspeed[fwdev->speed], + linkspeed[binfo->link_spd]); /* inesrt into sorted fwdev list */ pfwdev = NULL; STAILQ_FOREACH(tfwdev, &fc->devices, link) { @@ -1562,12 +1612,11 @@ fw_explore_node(struct fw_device *dfwdev STAILQ_INSERT_AFTER(&fc->devices, pfwdev, fwdev, link); device_printf(fc->bdev, "New %s device ID:%08x%08x\n", - linkspeed[spd], + linkspeed[fwdev->speed], fwdev->eui.hi, fwdev->eui.lo); } fwdev->dst = node; fwdev->status = FWDEVINIT; - fwdev->speed = spd; /* unchanged ? */ if (bcmp(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5) == 0) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 04:12:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7278106564A; Tue, 17 Feb 2009 04:12:10 +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 7B1778FC08; Tue, 17 Feb 2009 04:12:10 +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 n1H4CAFm003136; Tue, 17 Feb 2009 04:12:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1H4CAli003134; Tue, 17 Feb 2009 04:12:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902170412.n1H4CAli003134@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 17 Feb 2009 04: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: r188705 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 04:12:11 -0000 Author: marcel Date: Tue Feb 17 04:12:10 2009 New Revision: 188705 URL: http://svn.freebsd.org/changeset/base/188705 Log: Remove gpt_offset and related code. It was introduced for use by the BSD scheme, ended up not to be needed. Remove to avoid abuse and to keep the bloat to a minimum. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Feb 17 04:08:08 2009 (r188704) +++ head/sys/geom/part/g_part.c Tue Feb 17 04:12:10 2009 (r188705) @@ -701,14 +701,6 @@ g_part_ctl_create(struct gctl_req *req, error = g_getattr("PART::depth", cp, &attr); table->gpt_depth = (!error) ? attr + 1 : 0; - /* If we're nested, get the absolute sector offset on disk. */ - if (table->gpt_depth) { - error = g_getattr("PART::offset", cp, &attr); - if (error) - goto fail; - table->gpt_offset = attr; - } - /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1488,14 +1480,6 @@ g_part_taste(struct g_class *mp, struct table = gp->softc; - /* If we're nested, get the absolute sector offset on disk. */ - if (table->gpt_depth) { - error = g_getattr("PART::offset", cp, &attr); - if (error) - goto fail; - table->gpt_offset = attr; - } - /* * Synthesize a disk geometry. Some partitioning schemes * depend on it and since some file systems need it even @@ -1686,9 +1670,6 @@ g_part_start(struct bio *bp) return; if (g_handleattr_int(bp, "PART::depth", table->gpt_depth)) return; - if (g_handleattr_int(bp, "PART::offset", - table->gpt_offset + entry->gpe_start)) - return; if (g_handleattr_str(bp, "PART::scheme", table->gpt_scheme->name)) return; Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Tue Feb 17 04:08:08 2009 (r188704) +++ head/sys/geom/part/g_part.h Tue Feb 17 04:12:10 2009 (r188705) @@ -104,13 +104,6 @@ struct g_part_table { */ uint32_t gpt_sectors; uint32_t gpt_heads; - /* - * gpt_offset holds the absolute block address of the scheme - * on disk. Some partitioning schemes (historically) use - * absolute addressing. Relative addresses are obtained by - * subtracting gpt_offset from the absolute addresses. - */ - uint64_t gpt_offset; int gpt_depth; /* Sub-partitioning level. */ int gpt_isleaf:1; /* Cannot be sub-partitioned. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 10:49:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A62AC106566B; Tue, 17 Feb 2009 10:49:36 +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 951AF8FC08; Tue, 17 Feb 2009 10:49:36 +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 n1HAnavh012964; Tue, 17 Feb 2009 10:49:36 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HAnaTG012963; Tue, 17 Feb 2009 10:49:36 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902171049.n1HAnaTG012963@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 17 Feb 2009 10: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: r188708 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 10:49:37 -0000 Author: maxim Date: Tue Feb 17 10:49:36 2009 New Revision: 188708 URL: http://svn.freebsd.org/changeset/base/188708 Log: o Teminate sentences by dot. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 17 10:01:21 2009 (r188707) +++ head/UPDATING Tue Feb 17 10:49:36 2009 (r188708) @@ -28,7 +28,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. add Option "AllowEmptyInput" "off" to your ServerLayout section. This will cause X to use the configured - kbd and mouse sections from your xorg.conf + kbd and mouse sections from your xorg.conf. 20090215: The GENERIC kernels for all architectures now default to the new USB2 @@ -36,7 +36,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. problem arises please report it and optionally revert to the old USB stack. If you are loading USB kernel modules or have a custom kernel that includes GENERIC then ensure that usb names are also changed over, - eg uftdi -> usb2_serial_ftdi + eg uftdi -> usb2_serial_ftdi. 20090203: The ichsmb(4) driver has been changed to require SMBus slave From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 10:50:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0524106566B; Tue, 17 Feb 2009 10:50:18 +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 DF7D48FC27; Tue, 17 Feb 2009 10:50:18 +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 n1HAoIeG013025; Tue, 17 Feb 2009 10:50:18 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HAoIFf013024; Tue, 17 Feb 2009 10:50:18 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902171050.n1HAoIFf013024@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 17 Feb 2009 10:50: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: r188709 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 10:50:19 -0000 Author: maxim Date: Tue Feb 17 10:50:18 2009 New Revision: 188709 URL: http://svn.freebsd.org/changeset/base/188709 Log: o Trim EOL whitespaces. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 17 10:49:36 2009 (r188708) +++ head/UPDATING Tue Feb 17 10:50:18 2009 (r188709) @@ -74,13 +74,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. the base system (it was a port). 20081216: - The afdata and ifnet locks have been changed from mutexes to + The afdata and ifnet locks have been changed from mutexes to rwlocks, network modules will need to be re-compiled. 20081214: __FreeBSD_version 800059 incorporates the new arp-v2 rewrite. RTF_CLONING, RTF_LLINFO and RTF_WASCLONED flags are eliminated. - The new code reduced struct rtentry{} by 16 bytes on 32-bit + The new code reduced struct rtentry{} by 16 bytes on 32-bit architecture and 40 bytes on 64-bit architecture. The userland applications "arp" and "ndp" have been updated accordingly. The output from "netstat -r" shows only routing entries and From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 11:55:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DCC1065672; Tue, 17 Feb 2009 11:55:50 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D570C8FC15; Tue, 17 Feb 2009 11:55:50 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HBto7H014269; Tue, 17 Feb 2009 11:55:50 GMT (envelope-from mtm@svn.freebsd.org) Received: (from mtm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HBto7E014265; Tue, 17 Feb 2009 11:55:50 GMT (envelope-from mtm@svn.freebsd.org) Message-Id: <200902171155.n1HBto7E014265@svn.freebsd.org> From: Mike Makonnen Date: Tue, 17 Feb 2009 11:55: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: r188710 - in head: . etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 11:55:51 -0000 Author: mtm Date: Tue Feb 17 11:55:50 2009 New Revision: 188710 URL: http://svn.freebsd.org/changeset/base/188710 Log: Rename the rc.conf(5) knob if_up_delay to defaultroute_delay to better reflect its purpose. Modified: head/UPDATING head/etc/defaults/rc.conf head/etc/rc.d/defaultroute head/share/man/man5/rc.conf.5 Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Feb 17 10:50:18 2009 (r188709) +++ head/UPDATING Tue Feb 17 11:55:50 2009 (r188710) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090217: + The rc.conf(5) option if_up_delay has been renamed to + defaultroute_delay to better reflect its purpose. If you have + customized this setting in /etc/rc.conf you need to update it to + use the new name. + 20090216: xorg 7.4 wants to configure its input devices via hald which does not yet work with USB2. If the keyboard/mouse does not work in xorg then Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Feb 17 10:50:18 2009 (r188709) +++ head/etc/defaults/rc.conf Tue Feb 17 11:55:50 2009 (r188710) @@ -105,6 +105,7 @@ background_dhclient="YES" # Start dhcp c #background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. synchronous_dhclient="NO" # Start dhclient directly on configured # interfaces during startup. +defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. wpa_supplicant_program="/usr/sbin/wpa_supplicant" wpa_supplicant_flags="-s" # Extra flags to pass to wpa_supplicant wpa_supplicant_conf_file="/etc/wpa_supplicant.conf" @@ -189,7 +190,6 @@ tcp_drop_synfin="NO" # Set to YES to dr icmp_drop_redirect="NO" # Set to YES to ignore ICMP REDIRECT packets icmp_log_redirect="NO" # Set to YES to log ICMP REDIRECT packets network_interfaces="auto" # List of network interfaces (or "auto"). -if_up_delay="30" # Time to wait for interfaces to come up. cloned_interfaces="" # List of cloned network interfaces to create. #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. Modified: head/etc/rc.d/defaultroute ============================================================================== --- head/etc/rc.d/defaultroute Tue Feb 17 10:50:18 2009 (r188709) +++ head/etc/rc.d/defaultroute Tue Feb 17 11:55:50 2009 (r188710) @@ -35,16 +35,16 @@ defaultroute_start() fi # Wait for a default route - delay=${if_up_delay} + delay=${defaultroute_delay} while [ ${delay} -gt 0 ]; do defif=`get_default_if -inet` if [ -n "${defif}" ]; then - if [ ${delay} -ne ${if_up_delay} ]; then + if [ ${delay} -ne ${defaultroute_delay} ]; then echo -n "($defif)" fi break fi - if [ ${delay} -eq ${if_up_delay} ]; then + if [ ${delay} -eq ${defaultroute_delay} ]; then echo -n "Waiting ${delay}s for the default route interface: " else echo -n . Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Feb 17 10:50:18 2009 (r188709) +++ head/share/man/man5/rc.conf.5 Tue Feb 17 11:55:50 2009 (r188710) @@ -406,7 +406,7 @@ variable with .Dq Li SYNCDHCP or .Dq Li NOSYNCDHCP . -.It Va if_up_delay +.It Va defaultroute_delay .Pq Vt int When set to a positive value, wait up to this long after configuring DHCP interfaces at startup to give the interfaces time to receive a lease. From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 14:57:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D06106567E; Tue, 17 Feb 2009 14:57:05 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B39368FC21; Tue, 17 Feb 2009 14:57:05 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HEv551017772; Tue, 17 Feb 2009 14:57:05 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HEv5Wd017770; Tue, 17 Feb 2009 14:57:05 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171457.n1HEv5Wd017770@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 14:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188711 - in head/sys: dev/tsec powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 14:57:07 -0000 Author: raj Date: Tue Feb 17 14:57:05 2009 New Revision: 188711 URL: http://svn.freebsd.org/changeset/base/188711 Log: Additional features for the tsec(4) Ethernet driver. - interrupt coalescing - polling - jumbo frames - multicast - VLAN tagging The enhanced version of the chip (eTSEC) can also take advantage of: - TCP/IP checksum calculation h/w offloading Obtained from: Freescale, Semihalf Modified: head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_ocp.c head/sys/dev/tsec/if_tsecreg.h head/sys/powerpc/conf/MPC85XX Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 11:55:50 2009 (r188710) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:57:05 2009 (r188711) @@ -30,6 +30,10 @@ #include __FBSDID("$FreeBSD$"); +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" +#endif + #include #include #include @@ -50,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include @@ -62,7 +70,8 @@ static int tsec_alloc_dma_desc(device_t bus_dmamap_t *dmap, bus_size_t dsize, void **vaddr, void *raddr, const char *dname); static void tsec_dma_ctl(struct tsec_softc *sc, int state); -static int tsec_encap(struct tsec_softc *sc, struct mbuf *m_head); +static int tsec_encap(struct tsec_softc *sc, struct mbuf *m_head, + int fcb_inserted); static void tsec_free_dma(struct tsec_softc *sc); static void tsec_free_dma_desc(bus_dma_tag_t dtag, bus_dmamap_t dmap, void *vaddr); static int tsec_ifmedia_upd(struct ifnet *ifp); @@ -83,6 +92,19 @@ static void tsec_start_locked(struct ifn static void tsec_stop(struct tsec_softc *sc); static void tsec_tick(void *arg); static void tsec_watchdog(struct tsec_softc *sc); +static void tsec_add_sysctls(struct tsec_softc *sc); +static int tsec_sysctl_ic_time(SYSCTL_HANDLER_ARGS); +static int tsec_sysctl_ic_count(SYSCTL_HANDLER_ARGS); +static void tsec_set_rxic(struct tsec_softc *sc); +static void tsec_set_txic(struct tsec_softc *sc); +static void tsec_receive_intr_locked(struct tsec_softc *sc, int count); +static void tsec_transmit_intr_locked(struct tsec_softc *sc); +static void tsec_error_intr_locked(struct tsec_softc *sc, int count); +static void tsec_offload_setup(struct tsec_softc *sc); +static void tsec_offload_process_frame(struct tsec_softc *sc, + struct mbuf *m); +static void tsec_setup_multicast(struct tsec_softc *sc); +static int tsec_set_mtu(struct tsec_softc *sc, unsigned int mtu); struct tsec_softc *tsec0_sc = NULL; /* XXX ugly hack! */ @@ -113,18 +135,28 @@ tsec_attach(struct tsec_softc *sc) /* Disable interrupts for now */ tsec_intrs_ctl(sc, 0); + /* Configure defaults for interrupts coalescing */ + sc->rx_ic_time = 768; + sc->rx_ic_count = 16; + sc->tx_ic_time = 768; + sc->tx_ic_count = 16; + tsec_set_rxic(sc); + tsec_set_txic(sc); + tsec_add_sysctls(sc); + /* Allocate a busdma tag and DMA safe memory for TX descriptors. */ - error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_tx_dtag, &sc->tsec_tx_dmap, - sizeof(*sc->tsec_tx_vaddr) * TSEC_TX_NUM_DESC, + error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_tx_dtag, + &sc->tsec_tx_dmap, sizeof(*sc->tsec_tx_vaddr) * TSEC_TX_NUM_DESC, (void **)&sc->tsec_tx_vaddr, &sc->tsec_tx_raddr, "TX"); + if (error) { tsec_detach(sc); return (ENXIO); } /* Allocate a busdma tag and DMA safe memory for RX descriptors. */ - error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_rx_dtag, &sc->tsec_rx_dmap, - sizeof(*sc->tsec_rx_vaddr) * TSEC_RX_NUM_DESC, + error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_rx_dtag, + &sc->tsec_rx_dmap, sizeof(*sc->tsec_rx_vaddr) * TSEC_RX_NUM_DESC, (void **)&sc->tsec_rx_vaddr, &sc->tsec_rx_raddr, "RX"); if (error) { tsec_detach(sc); @@ -213,7 +245,7 @@ tsec_attach(struct tsec_softc *sc) ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); ifp->if_mtu = ETHERMTU; - ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST; + ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; ifp->if_init = tsec_init; ifp->if_start = tsec_start; ifp->if_ioctl = tsec_ioctl; @@ -222,10 +254,17 @@ tsec_attach(struct tsec_softc *sc) ifp->if_snd.ifq_drv_maxlen = TSEC_TX_NUM_DESC - 1; IFQ_SET_READY(&ifp->if_snd); - /* XXX No special features of TSEC are supported currently */ - ifp->if_capabilities = 0; + ifp->if_capabilities = IFCAP_VLAN_MTU; + if (sc->is_etsec) + ifp->if_capabilities |= IFCAP_HWCSUM; + ifp->if_capenable = ifp->if_capabilities; +#ifdef DEVICE_POLLING + /* Advertise that polling is supported */ + ifp->if_capabilities |= IFCAP_POLLING; +#endif + /* Probe PHY(s) */ error = mii_phy_probe(sc->dev, &sc->tsec_miibus, tsec_ifmedia_upd, tsec_ifmedia_sts); @@ -249,6 +288,11 @@ int tsec_detach(struct tsec_softc *sc) { +#ifdef DEVICE_POLLING + if (sc->tsec_ifp->if_capenable & IFCAP_POLLING) + ether_poll_deregister(sc->tsec_ifp); +#endif + /* Stop TSEC controller and free TX queue */ if (sc->sc_rres && sc->tsec_ifp) tsec_shutdown(sc->dev); @@ -381,7 +425,16 @@ tsec_init_locked(struct tsec_softc *sc) /* Step 10: Clear IEVENT register */ TSEC_WRITE(sc, TSEC_REG_IEVENT, 0xffffffff); - /* Step 11: Initialize IMASK */ + /* Step 11: Enable interrupts */ +#ifdef DEVICE_POLLING + /* + * ...only if polling is not turned on. Disable interrupts explicitly + * if polling is enabled. + */ + if (ifp->if_capenable & IFCAP_POLLING ) + tsec_intrs_ctl(sc, 0); + else +#endif /* DEVICE_POLLING */ tsec_intrs_ctl(sc, 1); /* Step 12: Initialize IADDRn */ @@ -434,37 +487,47 @@ tsec_init_locked(struct tsec_softc *sc) rx_desc[i].flags = TSEC_RXBD_E | TSEC_RXBD_I | ((i == TSEC_RX_NUM_DESC - 1) ? TSEC_RXBD_W : 0); } - bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_PREREAD | - BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* Step 18: Initialize the maximum receive buffer length */ + TSEC_WRITE(sc, TSEC_REG_MRBLR, MCLBYTES); - /* Step 18: Initialize the maximum and minimum receive buffer length */ - TSEC_WRITE(sc, TSEC_REG_MRBLR, TSEC_DEFAULT_MAX_RX_BUFFER_SIZE); - TSEC_WRITE(sc, TSEC_REG_MINFLR, TSEC_DEFAULT_MIN_RX_BUFFER_SIZE); + /* Step 19: Configure ethernet frame sizes */ + TSEC_WRITE(sc, TSEC_REG_MINFLR, TSEC_MIN_FRAME_SIZE); + tsec_set_mtu(sc, ifp->if_mtu); - /* Step 19: Enable Rx and RxBD sdata snooping */ + /* Step 20: Enable Rx and RxBD sdata snooping */ TSEC_WRITE(sc, TSEC_REG_ATTR, TSEC_ATTR_RDSEN | TSEC_ATTR_RBDSEN); TSEC_WRITE(sc, TSEC_REG_ATTRELI, 0); - /* Step 20: Reset collision counters in hardware */ + /* Step 21: Reset collision counters in hardware */ TSEC_WRITE(sc, TSEC_REG_MON_TSCL, 0); TSEC_WRITE(sc, TSEC_REG_MON_TMCL, 0); TSEC_WRITE(sc, TSEC_REG_MON_TLCL, 0); TSEC_WRITE(sc, TSEC_REG_MON_TXCL, 0); TSEC_WRITE(sc, TSEC_REG_MON_TNCL, 0); - /* Step 21: Mask all CAM interrupts */ + /* Step 22: Mask all CAM interrupts */ TSEC_WRITE(sc, TSEC_REG_MON_CAM1, 0xffffffff); TSEC_WRITE(sc, TSEC_REG_MON_CAM2, 0xffffffff); - /* Step 22: Enable Rx and Tx */ + /* Step 23: Enable Rx and Tx */ val = TSEC_READ(sc, TSEC_REG_MACCFG1); val |= (TSEC_MACCFG1_RX_EN | TSEC_MACCFG1_TX_EN); TSEC_WRITE(sc, TSEC_REG_MACCFG1, val); - /* Step 23: Reset TSEC counters for Tx and Rx rings */ + /* Step 24: Reset TSEC counters for Tx and Rx rings */ TSEC_TX_RX_COUNTERS_INIT(sc); - /* Step 24: Activate network interface */ + /* Step 25: Setup TCP/IP Off-Load engine */ + if (sc->is_etsec) + tsec_offload_setup(sc); + + /* Step 26: Setup multicast filters */ + tsec_setup_multicast(sc); + + /* Step 27: Activate network interface */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->tsec_if_flags = ifp->if_flags; @@ -632,9 +695,10 @@ static void tsec_start_locked(struct ifnet *ifp) { struct tsec_softc *sc; - struct mbuf *m0; - struct mbuf *mtmp; + struct mbuf *m0, *mtmp; + struct tsec_tx_fcb *tx_fcb; unsigned int queued = 0; + int csum_flags, fcb_inserted = 0; sc = ifp->if_softc; @@ -656,11 +720,39 @@ tsec_start_locked(struct ifnet *ifp) if (m0 == NULL) break; + /* Insert TCP/IP Off-load frame control block */ + csum_flags = m0->m_pkthdr.csum_flags; + if (csum_flags) { + + M_PREPEND(m0, sizeof(struct tsec_tx_fcb), M_DONTWAIT); + if (m0 == NULL) + break; + + tx_fcb = mtod(m0, struct tsec_tx_fcb *); + tx_fcb->flags = 0; + tx_fcb->l3_offset = ETHER_HDR_LEN; + tx_fcb->l4_offset = sizeof(struct ip); + + if (csum_flags & CSUM_IP) + tx_fcb->flags |= TSEC_TX_FCB_IP4 | + TSEC_TX_FCB_CSUM_IP; + + if (csum_flags & CSUM_TCP) + tx_fcb->flags |= TSEC_TX_FCB_TCP | + TSEC_TX_FCB_CSUM_TCP_UDP; + + if (csum_flags & CSUM_UDP) + tx_fcb->flags |= TSEC_TX_FCB_UDP | + TSEC_TX_FCB_CSUM_TCP_UDP; + + fcb_inserted = 1; + } + mtmp = m_defrag(m0, M_DONTWAIT); if (mtmp) m0 = mtmp; - if (tsec_encap(sc, m0)) { + if (tsec_encap(sc, m0, fcb_inserted)) { IF_PREPEND(&ifp->if_snd, m0); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; @@ -679,14 +771,13 @@ tsec_start_locked(struct ifnet *ifp) } static int -tsec_encap(struct tsec_softc *sc, struct mbuf *m0) +tsec_encap(struct tsec_softc *sc, struct mbuf *m0, int fcb_inserted) { struct tsec_desc *tx_desc = NULL; struct ifnet *ifp; bus_dma_segment_t segs[TSEC_TX_NUM_DESC]; bus_dmamap_t *mapp; - int error; - int seg, nsegs; + int csum_flag = 0, error, seg, nsegs; TSEC_TRANSMIT_LOCK_ASSERT(sc); @@ -713,6 +804,9 @@ tsec_encap(struct tsec_softc *sc, struct if ((ifp->if_flags & IFF_DEBUG) && (nsegs > 1)) if_printf(ifp, "TX buffer has %d segments\n", nsegs); + if (fcb_inserted) + csum_flag = TSEC_TXBD_TOE; + /* Everything is ok, now we can send buffers */ for (seg = 0; seg < nsegs; seg++) { tx_desc = TSEC_GET_CUR_TX_DESC(sc); @@ -720,13 +814,18 @@ tsec_encap(struct tsec_softc *sc, struct tx_desc->length = segs[seg].ds_len; tx_desc->bufptr = segs[seg].ds_addr; + /* + * Set flags: + * - wrap + * - checksum + * - ready to send + * - transmit the CRC sequence after the last data byte + * - interrupt after the last buffer + */ tx_desc->flags = - (tx_desc->flags & TSEC_TXBD_W) | /* wrap */ - TSEC_TXBD_I | /* interrupt */ - TSEC_TXBD_R | /* ready to send */ - TSEC_TXBD_TC | /* transmit the CRC sequence - * after the last data byte */ - ((seg == nsegs-1) ? TSEC_TXBD_L : 0);/* last in frame */ + (tx_desc->flags & TSEC_TXBD_W) | + ((seg == 0) ? csum_flag : 0) | TSEC_TXBD_R | TSEC_TXBD_TC | + ((seg == nsegs - 1) ? TSEC_TXBD_L | TSEC_TXBD_I : 0); } /* Save mbuf and DMA mapping for release at later stage */ @@ -754,23 +853,69 @@ tsec_setfilter(struct tsec_softc *sc) TSEC_WRITE(sc, TSEC_REG_RCTRL, flags); } +#ifdef DEVICE_POLLING +static poll_handler_t tsec_poll; + +static void +tsec_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) +{ + uint32_t ie; + struct tsec_softc *sc = ifp->if_softc; + + TSEC_GLOBAL_LOCK(sc); + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + TSEC_GLOBAL_UNLOCK(sc); + return; + } + + if (cmd == POLL_AND_CHECK_STATUS) { + ie = TSEC_READ(sc, TSEC_REG_IEVENT); + + /* Clear all events reported */ + TSEC_WRITE(sc, TSEC_REG_IEVENT, ie); + tsec_error_intr_locked(sc, count); + } + + tsec_transmit_intr_locked(sc); + + TSEC_GLOBAL_TO_RECEIVE_LOCK(sc); + + tsec_receive_intr_locked(sc, count); + + TSEC_RECEIVE_UNLOCK(sc); +} +#endif /* DEVICE_POLLING */ + static int tsec_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct tsec_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; device_t dev; - int error = 0; + int mask, error = 0; dev = sc->dev; switch (command) { + case SIOCSIFMTU: + TSEC_GLOBAL_LOCK(sc); + if (tsec_set_mtu(sc, ifr->ifr_mtu)) + ifp->if_mtu = ifr->ifr_mtu; + else + error = EINVAL; + TSEC_GLOBAL_UNLOCK(sc); + break; case SIOCSIFFLAGS: TSEC_GLOBAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if ((sc->tsec_if_flags ^ ifp->if_flags) & IFF_PROMISC) + if ((sc->tsec_if_flags ^ ifp->if_flags) & + IFF_PROMISC) tsec_setfilter(sc); + + if ((sc->tsec_if_flags ^ ifp->if_flags) & + IFF_ALLMULTI) + tsec_setup_multicast(sc); } else tsec_init_locked(sc); } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -779,10 +924,51 @@ tsec_ioctl(struct ifnet *ifp, u_long com sc->tsec_if_flags = ifp->if_flags; TSEC_GLOBAL_UNLOCK(sc); break; + case SIOCADDMULTI: + case SIOCDELMULTI: + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + TSEC_GLOBAL_LOCK(sc); + tsec_setup_multicast(sc); + TSEC_GLOBAL_UNLOCK(sc); + } case SIOCGIFMEDIA: case SIOCSIFMEDIA: - error = ifmedia_ioctl(ifp, ifr, &sc->tsec_mii->mii_media, command); + error = ifmedia_ioctl(ifp, ifr, &sc->tsec_mii->mii_media, + command); break; + case SIOCSIFCAP: + mask = ifp->if_capenable ^ ifr->ifr_reqcap; + if ((mask & IFCAP_HWCSUM) && sc->is_etsec) { + TSEC_GLOBAL_LOCK(sc); + ifp->if_capenable &= ~IFCAP_HWCSUM; + ifp->if_capenable |= IFCAP_HWCSUM & ifr->ifr_reqcap; + tsec_offload_setup(sc); + TSEC_GLOBAL_UNLOCK(sc); + } +#ifdef DEVICE_POLLING + if (mask & IFCAP_POLLING) { + if (ifr->ifr_reqcap & IFCAP_POLLING) { + error = ether_poll_register(tsec_poll, ifp); + if (error) + return (error); + + TSEC_GLOBAL_LOCK(sc); + /* Disable interrupts */ + tsec_intrs_ctl(sc, 0); + ifp->if_capenable |= IFCAP_POLLING; + TSEC_GLOBAL_UNLOCK(sc); + } else { + error = ether_poll_deregister(ifp); + TSEC_GLOBAL_LOCK(sc); + /* Enable interrupts */ + tsec_intrs_ctl(sc, 1); + ifp->if_capenable &= ~IFCAP_POLLING; + TSEC_GLOBAL_UNLOCK(sc); + } + } +#endif + break; + default: error = ether_ioctl(ifp, command, data); } @@ -831,12 +1017,11 @@ tsec_new_rxbuf(bus_dma_tag_t tag, bus_dm { struct mbuf *new_mbuf; bus_dma_segment_t seg[1]; - int error; - int nsegs; + int error, nsegs; KASSERT(mbufp != NULL, ("NULL mbuf pointer!")); - new_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + new_mbuf = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MCLBYTES); if (new_mbuf == NULL) return (ENOBUFS); new_mbuf->m_len = new_mbuf->m_pkthdr.len = new_mbuf->m_ext.ext_size; @@ -1013,55 +1198,83 @@ tsec_stop(struct tsec_softc *sc) m0 = TSEC_GET_TX_MBUF(sc); mapp = TSEC_GET_TX_MAP(sc); - bus_dmamap_sync(sc->tsec_tx_mtag, *mapp, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(sc->tsec_tx_mtag, *mapp, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->tsec_tx_mtag, *mapp); TSEC_FREE_TX_MAP(sc, mapp); m_freem(m0); } - /* Disable Rx and Tx */ + /* Disable RX and TX */ tmpval = TSEC_READ(sc, TSEC_REG_MACCFG1); tmpval &= ~(TSEC_MACCFG1_RX_EN | TSEC_MACCFG1_TX_EN); TSEC_WRITE(sc, TSEC_REG_MACCFG1, tmpval); DELAY(10); } -void -tsec_receive_intr(void *arg) +static void +tsec_tick(void *arg) { - struct mbuf *rcv_mbufs[TSEC_RX_NUM_DESC]; struct tsec_softc *sc = arg; + struct ifnet *ifp; + int link; + + TSEC_GLOBAL_LOCK(sc); + + tsec_watchdog(sc); + + ifp = sc->tsec_ifp; + link = sc->tsec_link; + + mii_tick(sc->tsec_mii); + + if (link == 0 && sc->tsec_link == 1 && + (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))) + tsec_start_locked(ifp); + + /* Schedule another timeout one second from now. */ + callout_reset(&sc->tsec_callout, hz, tsec_tick, sc); + + TSEC_GLOBAL_UNLOCK(sc); +} + +/* + * This is the core RX routine. It replenishes mbufs in the descriptor and + * sends data which have been dma'ed into host memory to upper layer. + * + * Loops at most count times if count is > 0, or until done if count < 0. + */ +static void +tsec_receive_intr_locked(struct tsec_softc *sc, int count) +{ struct tsec_desc *rx_desc; struct ifnet *ifp; struct rx_data_type *rx_data; struct mbuf *m; device_t dev; uint32_t i; - int count; - int c1 = 0; - int c2; + int c; uint16_t flags; - uint16_t length; + + TSEC_RECEIVE_LOCK_ASSERT(sc); ifp = sc->tsec_ifp; rx_data = sc->rx_data; dev = sc->dev; - /* Confirm the interrupt was received by driver */ - TSEC_WRITE(sc, TSEC_REG_IEVENT, TSEC_IEVENT_RXB | TSEC_IEVENT_RXF); - - TSEC_RECEIVE_LOCK(sc); + bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_POSTREAD | - BUS_DMASYNC_POSTWRITE); + for (c = 0; ; c++) { + if (count >= 0 && count-- == 0) + break; - for (count = 0; /* count < TSEC_RX_NUM_DESC */; count++) { rx_desc = TSEC_GET_CUR_RX_DESC(sc); flags = rx_desc->flags; /* Check if there is anything to receive */ - if ((flags & TSEC_RXBD_E) || (count >= TSEC_RX_NUM_DESC)) { + if ((flags & TSEC_RXBD_E) || (c >= TSEC_RX_NUM_DESC)) { /* * Avoid generating another interrupt */ @@ -1080,65 +1293,103 @@ tsec_receive_intr(void *arg) TSEC_RXBD_CR | TSEC_RXBD_OV | TSEC_RXBD_TR)) { rx_desc->length = 0; - rx_desc->flags = (rx_desc->flags & ~TSEC_RXBD_ZEROONINIT) | - TSEC_RXBD_E | TSEC_RXBD_I; + rx_desc->flags = (rx_desc->flags & + ~TSEC_RXBD_ZEROONINIT) | TSEC_RXBD_E | TSEC_RXBD_I; + + if (sc->frame != NULL) { + m_free(sc->frame); + sc->frame = NULL; + } + continue; } - if ((flags & TSEC_RXBD_L) == 0) - device_printf(dev, "buf is not the last in frame!\n"); - /* Ok... process frame */ - length = rx_desc->length - ETHER_CRC_LEN; i = TSEC_GET_CUR_RX_DESC_CNT(sc); - m = rx_data[i].mbuf; + m->m_len = rx_desc->length; + + if (sc->frame != NULL) { + if ((flags & TSEC_RXBD_L) != 0) + m->m_len -= m_length(sc->frame, NULL); + + m->m_flags &= ~M_PKTHDR; + m_cat(sc->frame, m); + } else { + sc->frame = m; + } + + m = NULL; + + if ((flags & TSEC_RXBD_L) != 0) { + m = sc->frame; + sc->frame = NULL; + } if (tsec_new_rxbuf(sc->tsec_rx_mtag, rx_data[i].map, &rx_data[i].mbuf, &rx_data[i].paddr)) { ifp->if_ierrors++; continue; } - /* Attach new buffer to descriptor, and clear flags */ + + /* Attach new buffer to descriptor and clear flags */ rx_desc->bufptr = rx_data[i].paddr; rx_desc->length = 0; rx_desc->flags = (rx_desc->flags & ~TSEC_RXBD_ZEROONINIT) | TSEC_RXBD_E | TSEC_RXBD_I; - /* Prepare buffer for upper layers */ - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = m->m_len = length; + if (m != NULL) { + m->m_pkthdr.rcvif = ifp; - /* Save it for push */ - rcv_mbufs[c1++] = m; - } + m_fixhdr(m); + m_adj(m, -ETHER_CRC_LEN); - bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_PREREAD | - BUS_DMASYNC_PREWRITE); + if (sc->is_etsec) + tsec_offload_process_frame(sc, m); - TSEC_RECEIVE_UNLOCK(sc); + TSEC_RECEIVE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + TSEC_RECEIVE_LOCK(sc); + } + } - /* Push it now */ - for (c2 = 0; c2 < c1; c2++) - (*ifp->if_input)(ifp, rcv_mbufs[c2]); + bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } void -tsec_transmit_intr(void *arg) +tsec_receive_intr(void *arg) { struct tsec_softc *sc = arg; + + TSEC_RECEIVE_LOCK(sc); + +#ifdef DEVICE_POLLING + if (sc->tsec_ifp->if_capenable & IFCAP_POLLING) { + TSEC_RECEIVE_UNLOCK(sc); + return; + } +#endif + + /* Confirm the interrupt was received by driver */ + TSEC_WRITE(sc, TSEC_REG_IEVENT, TSEC_IEVENT_RXB | TSEC_IEVENT_RXF); + tsec_receive_intr_locked(sc, -1); + + TSEC_RECEIVE_UNLOCK(sc); +} + +static void +tsec_transmit_intr_locked(struct tsec_softc *sc) +{ struct tsec_desc *tx_desc; struct ifnet *ifp; struct mbuf *m0; bus_dmamap_t *mapp; int send = 0; - ifp = sc->tsec_ifp; - - /* Confirm the interrupt was received by driver */ - TSEC_WRITE(sc, TSEC_REG_IEVENT, TSEC_IEVENT_TXB | TSEC_IEVENT_TXF); + TSEC_TRANSMIT_LOCK_ASSERT(sc); - TSEC_TRANSMIT_LOCK(sc); + ifp = sc->tsec_ifp; /* Update collision statistics */ ifp->if_collisions += TSEC_READ(sc, TSEC_REG_MON_TNCL); @@ -1178,45 +1429,58 @@ tsec_transmit_intr(void *arg) ifp->if_opackets++; send = 1; } - bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_PREREAD | - BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if (send) { /* Now send anything that was pending */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; tsec_start_locked(ifp); - /* Stop watchdog if all sent */ + /* Stop wathdog if all sent */ if (TSEC_EMPTYQ_TX_MBUF(sc)) sc->tsec_watchdog = 0; } - TSEC_TRANSMIT_UNLOCK(sc); } void -tsec_error_intr(void *arg) +tsec_transmit_intr(void *arg) { struct tsec_softc *sc = arg; + + TSEC_TRANSMIT_LOCK(sc); + +#ifdef DEVICE_POLLING + if (sc->tsec_ifp->if_capenable & IFCAP_POLLING) { + TSEC_TRANSMIT_UNLOCK(sc); + return; + } +#endif + /* Confirm the interrupt was received by driver */ + TSEC_WRITE(sc, TSEC_REG_IEVENT, TSEC_IEVENT_TXB | TSEC_IEVENT_TXF); + tsec_transmit_intr_locked(sc); + + TSEC_TRANSMIT_UNLOCK(sc); +} + +static void +tsec_error_intr_locked(struct tsec_softc *sc, int count) +{ struct ifnet *ifp; uint32_t eflags; + TSEC_GLOBAL_LOCK_ASSERT(sc); + ifp = sc->tsec_ifp; eflags = TSEC_READ(sc, TSEC_REG_IEVENT); - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "tsec_error_intr(): event flags: 0x%x\n", eflags); - /* Clear events bits in hardware */ TSEC_WRITE(sc, TSEC_REG_IEVENT, TSEC_IEVENT_RXC | TSEC_IEVENT_BSY | TSEC_IEVENT_EBERR | TSEC_IEVENT_MSRO | TSEC_IEVENT_BABT | TSEC_IEVENT_TXC | TSEC_IEVENT_TXE | TSEC_IEVENT_LC | TSEC_IEVENT_CRL | TSEC_IEVENT_XFUN); - if (eflags & TSEC_IEVENT_EBERR) - if_printf(ifp, "System bus error occurred during" - " a DMA transaction (flags: 0x%x)\n", eflags); - /* Check transmitter errors */ if (eflags & TSEC_IEVENT_TXE) { ifp->if_oerrors++; @@ -1226,8 +1490,6 @@ tsec_error_intr(void *arg) TSEC_WRITE(sc, TSEC_REG_TSTAT, TSEC_TSTAT_THLT); } - if (eflags & TSEC_IEVENT_BABT) - ifp->if_oerrors++; /* Check receiver errors */ if (eflags & TSEC_IEVENT_BSY) { @@ -1235,37 +1497,36 @@ tsec_error_intr(void *arg) ifp->if_iqdrops++; /* Get data from RX buffers */ - tsec_receive_intr(arg); + tsec_receive_intr_locked(sc, count); /* Make receiver again active */ TSEC_WRITE(sc, TSEC_REG_RSTAT, TSEC_RSTAT_QHLT); } + + if (ifp->if_flags & IFF_DEBUG) + if_printf(ifp, "tsec_error_intr(): event flags: 0x%x\n", + eflags); + + if (eflags & TSEC_IEVENT_EBERR) { + if_printf(ifp, "System bus error occurred during" + "DMA transaction (flags: 0x%x)\n", eflags); + tsec_init_locked(sc); + } + + if (eflags & TSEC_IEVENT_BABT) + ifp->if_oerrors++; + if (eflags & TSEC_IEVENT_BABR) ifp->if_ierrors++; } -static void -tsec_tick(void *xsc) +void +tsec_error_intr(void *arg) { - struct tsec_softc *sc = xsc; - struct ifnet *ifp; - int link; + struct tsec_softc *sc = arg; TSEC_GLOBAL_LOCK(sc); - - tsec_watchdog(sc); - - ifp = sc->tsec_ifp; - link = sc->tsec_link; - - mii_tick(sc->tsec_mii); - - if (link == 0 && sc->tsec_link == 1 && (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))) - tsec_start_locked(ifp); - - /* Schedule another timeout one second from now. */ - callout_reset(&sc->tsec_callout, hz, tsec_tick, sc); - + tsec_error_intr_locked(sc, -1); TSEC_GLOBAL_UNLOCK(sc); } @@ -1373,3 +1634,271 @@ tsec_miibus_statchg(device_t dev) TSEC_WRITE(sc, TSEC_REG_ECNTRL, ecntrl); } } + +static void +tsec_add_sysctls(struct tsec_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; + struct sysctl_oid *tree; + + ctx = device_get_sysctl_ctx(sc->dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); + tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "int_coal", + CTLFLAG_RD, 0, "TSEC Interrupts coalescing"); + children = SYSCTL_CHILDREN(tree); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_time", + CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_RX, tsec_sysctl_ic_time, + "I", "IC RX time threshold (0-65535)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_count", + CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_RX, tsec_sysctl_ic_count, + "I", "IC RX frame count threshold (0-255)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_time", + CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_TX, tsec_sysctl_ic_time, + "I", "IC TX time threshold (0-65535)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_count", + CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_TX, tsec_sysctl_ic_count, + "I", "IC TX frame count threshold (0-255)"); +} + +/* + * With Interrupt Coalescing (IC) active, a transmit/receive frame + * interrupt is raised either upon: + * + * - threshold-defined period of time elapsed, or + * - threshold-defined number of frames is received/transmitted, + * whichever occurs first. + * + * The following sysctls regulate IC behaviour (for TX/RX separately): + * + * dev.tsec..int_coal.rx_time + * dev.tsec..int_coal.rx_count + * dev.tsec..int_coal.tx_time + * dev.tsec..int_coal.tx_count + * + * Values: + * + * - 0 for either time or count disables IC on the given TX/RX path + * + * - count: 1-255 (expresses frame count number; note that value of 1 is + * effectively IC off) + * + * - time: 1-65535 (value corresponds to a real time period and is + * expressed in units equivalent to 64 TSEC interface clocks, i.e. one timer + * threshold unit is 26.5 us, 2.56 us, or 512 ns, corresponding to 10 Mbps, + * 100 Mbps, or 1Gbps, respectively. For detailed discussion consult the + * TSEC reference manual. + */ + +static int +tsec_sysctl_ic_time(SYSCTL_HANDLER_ARGS) +{ + int error; + uint32_t time; + struct tsec_softc *sc = (struct tsec_softc *)arg1; + + time = (arg2 == TSEC_IC_RX) ? sc->rx_ic_time : sc->tx_ic_time; + + error = sysctl_handle_int(oidp, &time, 0, req); + if (error != 0) + return (error); + + if (time > 65535) + return (EINVAL); + + TSEC_IC_LOCK(sc); + if (arg2 == TSEC_IC_RX) { + sc->rx_ic_time = time; + tsec_set_rxic(sc); + } else { + sc->tx_ic_time = time; + tsec_set_txic(sc); + } + TSEC_IC_UNLOCK(sc); + + return (0); +} + +static int +tsec_sysctl_ic_count(SYSCTL_HANDLER_ARGS) +{ + int error; + uint32_t count; + struct tsec_softc *sc = (struct tsec_softc *)arg1; + + count = (arg2 == TSEC_IC_RX) ? sc->rx_ic_count : sc->tx_ic_count; + + error = sysctl_handle_int(oidp, &count, 0, req); + if (error != 0) + return (error); + + if (count > 255) + return (EINVAL); + + TSEC_IC_LOCK(sc); + if (arg2 == TSEC_IC_RX) { + sc->rx_ic_count = count; + tsec_set_rxic(sc); + } else { + sc->tx_ic_count = count; + tsec_set_txic(sc); + } + TSEC_IC_UNLOCK(sc); + + return (0); +} + +static void +tsec_set_rxic(struct tsec_softc *sc) +{ + uint32_t rxic_val; + + if (sc->rx_ic_count == 0 || sc->rx_ic_time == 0) + /* Disable RX IC */ + rxic_val = 0; + else { + rxic_val = 0x80000000; + rxic_val |= (sc->rx_ic_count << 21); + rxic_val |= sc->rx_ic_time; + } + + TSEC_WRITE(sc, TSEC_REG_RXIC, rxic_val); +} + +static void +tsec_set_txic(struct tsec_softc *sc) +{ + uint32_t txic_val; + + if (sc->tx_ic_count == 0 || sc->tx_ic_time == 0) + /* Disable TX IC */ + txic_val = 0; + else { + txic_val = 0x80000000; + txic_val |= (sc->tx_ic_count << 21); + txic_val |= sc->tx_ic_time; + } + + TSEC_WRITE(sc, TSEC_REG_TXIC, txic_val); +} + +static void +tsec_offload_setup(struct tsec_softc *sc) +{ + struct ifnet *ifp = sc->tsec_ifp; + uint32_t reg; + + TSEC_GLOBAL_LOCK_ASSERT(sc); + + reg = TSEC_READ(sc, TSEC_REG_TCTRL); + reg |= TSEC_TCTRL_IPCSEN | TSEC_TCTRL_TUCSEN; + + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist = TSEC_CHECKSUM_FEATURES; + else + ifp->if_hwassist = 0; + + TSEC_WRITE(sc, TSEC_REG_TCTRL, reg); + + reg = TSEC_READ(sc, TSEC_REG_RCTRL); + reg &= ~(TSEC_RCTRL_IPCSEN | TSEC_RCTRL_TUCSEN | TSEC_RCTRL_PRSDEP); + reg |= TSEC_RCTRL_PRSDEP_PARSE_L2 | TSEC_RCTRL_VLEX; + + if (ifp->if_capenable & IFCAP_RXCSUM) + reg |= TSEC_RCTRL_IPCSEN | TSEC_RCTRL_TUCSEN | + TSEC_RCTRL_PRSDEP_PARSE_L234; + + TSEC_WRITE(sc, TSEC_REG_RCTRL, reg); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 14:59:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DC7C1065673; Tue, 17 Feb 2009 14:59:48 +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 2ACED8FC17; Tue, 17 Feb 2009 14:59:48 +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 n1HExmjk017858; Tue, 17 Feb 2009 14:59:48 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HExmch017855; Tue, 17 Feb 2009 14:59:48 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171459.n1HExmch017855@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 14: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: r188712 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 14:59:48 -0000 Author: raj Date: Tue Feb 17 14:59:47 2009 New Revision: 188712 URL: http://svn.freebsd.org/changeset/base/188712 Log: tsec(4) style improvements and clean-up. Modified: head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_ocp.c Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:57:05 2009 (r188711) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:59:47 2009 (r188712) @@ -165,34 +165,36 @@ tsec_attach(struct tsec_softc *sc) /* Allocate a busdma tag for TX mbufs. */ error = bus_dma_tag_create(NULL, /* parent */ - TSEC_TXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES * (TSEC_TX_NUM_DESC - 1),/* maxsize */ - TSEC_TX_NUM_DESC - 1, /* nsegments */ - MCLBYTES, 0, /* maxsegsz, flags */ - NULL, NULL, /* lockfunc, lockfuncarg */ - &sc->tsec_tx_mtag); /* dmat */ + TSEC_TXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES * (TSEC_TX_NUM_DESC - 1), /* maxsize */ + TSEC_TX_NUM_DESC - 1, /* nsegments */ + MCLBYTES, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->tsec_tx_mtag); /* dmat */ if (error) { - device_printf(sc->dev, "failed to allocate busdma tag(tx mbufs)\n"); + device_printf(sc->dev, "failed to allocate busdma tag " + "(tx mbufs)\n"); tsec_detach(sc); return (ENXIO); } /* Allocate a busdma tag for RX mbufs. */ error = bus_dma_tag_create(NULL, /* parent */ - TSEC_RXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES, /* maxsize */ - 1, /* nsegments */ - MCLBYTES, 0, /* maxsegsz, flags */ - NULL, NULL, /* lockfunc, lockfuncarg */ - &sc->tsec_rx_mtag); /* dmat */ + TSEC_RXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->tsec_rx_mtag); /* dmat */ if (error) { - device_printf(sc->dev, "failed to allocate busdma tag(rx mbufs)\n"); + device_printf(sc->dev, "failed to allocate busdma tag " + "(rx mbufs)\n"); tsec_detach(sc); return (ENXIO); } @@ -213,7 +215,8 @@ tsec_attach(struct tsec_softc *sc) /* Create RX busdma maps and zero mbuf handlers */ for (i = 0; i < TSEC_RX_NUM_DESC; i++) { - error = bus_dmamap_create(sc->tsec_rx_mtag, 0, &sc->rx_data[i].map); + error = bus_dmamap_create(sc->tsec_rx_mtag, 0, + &sc->rx_data[i].map); if (error) { device_printf(sc->dev, "failed to init RX ring\n"); tsec_detach(sc); @@ -227,8 +230,8 @@ tsec_attach(struct tsec_softc *sc) error = tsec_new_rxbuf(sc->tsec_rx_mtag, sc->rx_data[i].map, &sc->rx_data[i].mbuf, &sc->rx_data[i].paddr); if (error) { - device_printf(sc->dev, "can't load rx DMA map %d, error = " - "%d\n", i, error); + device_printf(sc->dev, "can't load rx DMA map %d, " + "error = %d\n", i, error); tsec_detach(sc); return (error); } @@ -354,9 +357,7 @@ tsec_init_locked(struct tsec_softc *sc) struct tsec_desc *tx_desc = sc->tsec_tx_vaddr; struct tsec_desc *rx_desc = sc->tsec_rx_vaddr; struct ifnet *ifp = sc->tsec_ifp; - uint32_t timeout; - uint32_t val; - uint32_t i; + uint32_t timeout, val, i; TSEC_GLOBAL_LOCK_ASSERT(sc); tsec_stop(sc); @@ -476,7 +477,8 @@ tsec_init_locked(struct tsec_softc *sc) for (i = 0; i < TSEC_TX_NUM_DESC; i++) { tx_desc[i].bufptr = 0; tx_desc[i].length = 0; - tx_desc[i].flags = ((i == TSEC_TX_NUM_DESC - 1) ? TSEC_TXBD_W : 0); + tx_desc[i].flags = ((i == TSEC_TX_NUM_DESC - 1) ? + TSEC_TXBD_W : 0); } bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -541,14 +543,14 @@ static void tsec_set_mac_address(struct tsec_softc *sc) { uint32_t macbuf[2] = { 0, 0 }; - char *macbufp; - char *curmac; + char *macbufp, *curmac; int i; TSEC_GLOBAL_LOCK_ASSERT(sc); KASSERT((ETHER_ADDR_LEN <= sizeof(macbuf)), - ("tsec_set_mac_address: (%d <= %d", ETHER_ADDR_LEN, sizeof(macbuf))); + ("tsec_set_mac_address: (%d <= %d", ETHER_ADDR_LEN, + sizeof(macbuf))); macbufp = (char *)macbuf; curmac = (char *)IF_LLADDR(sc->tsec_ifp); @@ -571,8 +573,7 @@ static void tsec_dma_ctl(struct tsec_softc *sc, int state) { device_t dev; - uint32_t dma_flags; - uint32_t timeout; + uint32_t dma_flags, timeout; dev = sc->dev; @@ -636,10 +637,10 @@ tsec_intrs_ctl(struct tsec_softc *sc, in TSEC_WRITE(sc, TSEC_REG_IMASK, 0); break; case 1: - TSEC_WRITE(sc, TSEC_REG_IMASK, TSEC_IMASK_BREN | TSEC_IMASK_RXCEN | - TSEC_IMASK_BSYEN | TSEC_IMASK_EBERREN | TSEC_IMASK_BTEN | - TSEC_IMASK_TXEEN | TSEC_IMASK_TXBEN | TSEC_IMASK_TXFEN | - TSEC_IMASK_XFUNEN | TSEC_IMASK_RXFEN); + TSEC_WRITE(sc, TSEC_REG_IMASK, TSEC_IMASK_BREN | + TSEC_IMASK_RXCEN | TSEC_IMASK_BSYEN | TSEC_IMASK_EBERREN | + TSEC_IMASK_BTEN | TSEC_IMASK_TXEEN | TSEC_IMASK_TXBEN | + TSEC_IMASK_TXFEN | TSEC_IMASK_XFUNEN | TSEC_IMASK_RXFEN); break; default: device_printf(dev, "tsec_intrs_ctl(): unknown state value: %d\n", @@ -711,8 +712,8 @@ tsec_start_locked(struct ifnet *ifp) if (sc->tsec_link == 0) return; - bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_POSTREAD | - BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (;;) { /* Get packet from the queue */ @@ -760,8 +761,8 @@ tsec_start_locked(struct ifnet *ifp) queued++; BPF_MTAP(ifp, m0); } - bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_PREREAD | - BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if (queued) { /* Enable transmitter and watchdog timer */ @@ -793,7 +794,7 @@ tsec_encap(struct tsec_softc *sc, struct /* Create mapping in DMA memory */ error = bus_dmamap_load_mbuf_sg(sc->tsec_tx_mtag, - *mapp, m0, segs, &nsegs, BUS_DMA_NOWAIT); + *mapp, m0, segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0 || nsegs > TSEC_FREE_TX_DESC(sc) || nsegs <= 0) { bus_dmamap_unload(sc->tsec_tx_mtag, *mapp); TSEC_FREE_TX_MAP(sc, mapp); @@ -1032,7 +1033,7 @@ tsec_new_rxbuf(bus_dma_tag_t tag, bus_dm } error = bus_dmamap_load_mbuf_sg(tag, map, new_mbuf, seg, &nsegs, - BUS_DMA_NOWAIT); + BUS_DMA_NOWAIT); KASSERT(nsegs == 1, ("Too many segments returned!")); if (nsegs != 1 || error) panic("tsec_new_rxbuf(): nsegs(%d), error(%d)", nsegs, error); @@ -1085,26 +1086,27 @@ tsec_alloc_dma_desc(device_t dev, bus_dm dtag); /* dmat */ if (error) { - device_printf(dev, "failed to allocate busdma %s tag\n", dname); + device_printf(dev, "failed to allocate busdma %s tag\n", + dname); (*vaddr) = NULL; return (ENXIO); } error = bus_dmamem_alloc(*dtag, vaddr, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - dmap); + dmap); if (error) { device_printf(dev, "failed to allocate %s DMA safe memory\n", - dname); + dname); bus_dma_tag_destroy(*dtag); (*vaddr) = NULL; return (ENXIO); } - error = bus_dmamap_load(*dtag, *dmap, *vaddr, dsize, tsec_map_dma_addr, - raddr, BUS_DMA_NOWAIT); + error = bus_dmamap_load(*dtag, *dmap, *vaddr, dsize, + tsec_map_dma_addr, raddr, BUS_DMA_NOWAIT); if (error) { - device_printf(dev, "cannot get address of the %s descriptors\n", - dname); + device_printf(dev, "cannot get address of the %s " + "descriptors\n", dname); bus_dmamem_free(*dtag, *vaddr, *dmap); bus_dma_tag_destroy(*dtag); (*vaddr) = NULL; @@ -1122,7 +1124,8 @@ tsec_free_dma_desc(bus_dma_tag_t dtag, b return; /* Unmap descriptors from DMA memory */ - bus_dmamap_sync(dtag, dmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(dtag, dmap, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(dtag, dmap); /* Free descriptors memory */ @@ -1140,8 +1143,9 @@ tsec_free_dma(struct tsec_softc *sc) /* Free TX maps */ for (i = 0; i < TSEC_TX_NUM_DESC; i++) if (sc->tx_map_data[i] != NULL) - bus_dmamap_destroy(sc->tsec_tx_mtag, sc->tx_map_data[i]); - /* Destroy tag for Tx mbufs */ + bus_dmamap_destroy(sc->tsec_tx_mtag, + sc->tx_map_data[i]); + /* Destroy tag for TX mbufs */ bus_dma_tag_destroy(sc->tsec_tx_mtag); /* Free RX mbufs and maps */ @@ -1150,7 +1154,8 @@ tsec_free_dma(struct tsec_softc *sc) /* Unload buffer from DMA */ bus_dmamap_sync(sc->tsec_rx_mtag, sc->rx_data[i].map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->tsec_rx_mtag, sc->rx_data[i].map); + bus_dmamap_unload(sc->tsec_rx_mtag, + sc->rx_data[i].map); /* Free buffer */ m_freem(sc->rx_data[i].mbuf); @@ -1160,7 +1165,7 @@ tsec_free_dma(struct tsec_softc *sc) bus_dmamap_destroy(sc->tsec_rx_mtag, sc->rx_data[i].map); } - /* Destroy tag for Rx mbufs */ + /* Destroy tag for RX mbufs */ bus_dma_tag_destroy(sc->tsec_rx_mtag); /* Unload TX/RX descriptors */ @@ -1182,10 +1187,8 @@ tsec_stop(struct tsec_softc *sc) ifp = sc->tsec_ifp; - /* Stop tick engine */ - callout_stop(&sc->tsec_callout); - /* Disable interface and watchdog timer */ + callout_stop(&sc->tsec_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->tsec_watchdog = 0; @@ -1420,7 +1423,8 @@ tsec_transmit_intr_locked(struct tsec_so m0 = TSEC_GET_TX_MBUF(sc); mapp = TSEC_GET_TX_MAP(sc); - bus_dmamap_sync(sc->tsec_tx_mtag, *mapp, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(sc->tsec_tx_mtag, *mapp, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->tsec_tx_mtag, *mapp); TSEC_FREE_TX_MAP(sc, mapp); @@ -1567,7 +1571,8 @@ tsec_miibus_writereg(device_t dev, int p sc = device_get_softc(dev); if (device_get_unit(dev) != phy) - device_printf(dev, "Trying to write to an alien PHY(%d)\n", phy); + device_printf(dev, "Trying to write to an alien PHY(%d)\n", + phy); sc = tsec0_sc; @@ -1575,7 +1580,8 @@ tsec_miibus_writereg(device_t dev, int p TSEC_WRITE(sc, TSEC_REG_MIIMCON, value); timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) + while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) & + TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) @@ -1614,7 +1620,8 @@ tsec_miibus_statchg(device_t dev) break; case IFM_NONE: if (link) - device_printf(dev, "No speed selected but link active!\n"); + device_printf(dev, "No speed selected but link " + "active!\n"); sc->tsec_link = 0; return; default: Modified: head/sys/dev/tsec/if_tsec.h ============================================================================== --- head/sys/dev/tsec/if_tsec.h Tue Feb 17 14:57:05 2009 (r188711) +++ head/sys/dev/tsec/if_tsec.h Tue Feb 17 14:59:47 2009 (r188712) @@ -141,11 +141,11 @@ struct tsec_softc { #define TSEC_PUT_GENERIC(hand, tab, count, wrap, val) \ ((hand)->tab[TSEC_INC((hand)->count, wrap)] = val) -#define TSEC_BACK_GENERIC(sc, count, wrap) do { \ - if ((sc)->count > 0) \ - (sc)->count--; \ - else \ - (sc)->count = (wrap) - 1; \ +#define TSEC_BACK_GENERIC(sc, count, wrap) do { \ + if ((sc)->count > 0) \ + (sc)->count--; \ + else \ + (sc)->count = (wrap) - 1; \ } while (0) /* TX maps interface */ @@ -197,12 +197,12 @@ struct tsec_softc { TSEC_CNT_INIT((sc)->tx_dirty_desc_cnt, TSEC_TX_NUM_DESC); \ } while (0) -#define TSEC_GET_CUR_TX_DESC(sc) \ - &TSEC_GET_GENERIC(sc, tsec_tx_vaddr, tx_cur_desc_cnt, \ +#define TSEC_GET_CUR_TX_DESC(sc) \ + &TSEC_GET_GENERIC(sc, tsec_tx_vaddr, tx_cur_desc_cnt, \ TSEC_TX_NUM_DESC) -#define TSEC_GET_DIRTY_TX_DESC(sc) \ - &TSEC_GET_GENERIC(sc, tsec_tx_vaddr, tx_dirty_desc_cnt, \ +#define TSEC_GET_DIRTY_TX_DESC(sc) \ + &TSEC_GET_GENERIC(sc, tsec_tx_vaddr, tx_dirty_desc_cnt, \ TSEC_TX_NUM_DESC) #define TSEC_BACK_DIRTY_TX_DESC(sc) \ @@ -366,4 +366,4 @@ int tsec_suspend(device_t dev); /* XXX * void tsec_get_hwaddr(struct tsec_softc *sc, uint8_t *addr); -#endif +#endif /* _IF_TSEC_H */ Modified: head/sys/dev/tsec/if_tsec_ocp.c ============================================================================== --- head/sys/dev/tsec/if_tsec_ocp.c Tue Feb 17 14:57:05 2009 (r188711) +++ head/sys/dev/tsec/if_tsec_ocp.c Tue Feb 17 14:59:47 2009 (r188712) @@ -272,8 +272,8 @@ tsec_release_intr(struct tsec_softc *sc, error = bus_release_resource(sc->dev, SYS_RES_IRQ, irid, ires); if (error) - device_printf(sc->dev, "bus_release_resource() failed for %s intr" - ", error %d\n", iname, error); + device_printf(sc->dev, "bus_release_resource() failed for %s " + "intr, error %d\n", iname, error); } static int From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:39:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359551065689; Tue, 17 Feb 2009 15:39:17 +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 1CCC78FC17; Tue, 17 Feb 2009 15:39:17 +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 n1HFdHMh018654; Tue, 17 Feb 2009 15:39:17 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFdGB8018653; Tue, 17 Feb 2009 15:39:16 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171539.n1HFdGB8018653@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 15:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188713 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:39:21 -0000 Author: raj Date: Tue Feb 17 15:39:16 2009 New Revision: 188713 URL: http://svn.freebsd.org/changeset/base/188713 Log: Handle mbuf exhaustion scenario in tsec(4). Without this fix the system would hang under heavy networking load. Submitted by: Leon Theunissen leon ! parsec dot co dot za Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:59:47 2009 (r188712) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:39:16 2009 (r188713) @@ -1332,7 +1332,12 @@ tsec_receive_intr_locked(struct tsec_sof if (tsec_new_rxbuf(sc->tsec_rx_mtag, rx_data[i].map, &rx_data[i].mbuf, &rx_data[i].paddr)) { ifp->if_ierrors++; - continue; + /* + * We ran out of mbufs; didn't consume current + * descriptor and have to return it to the queue. + */ + TSEC_BACK_CUR_RX_DESC(sc); + break; } /* Attach new buffer to descriptor and clear flags */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:41:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B2B91065677; Tue, 17 Feb 2009 15:41:41 +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 774F88FC18; Tue, 17 Feb 2009 15:41:41 +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 n1HFffOx018868; Tue, 17 Feb 2009 15:41:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFffIZ018867; Tue, 17 Feb 2009 15:41:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902171541.n1HFffIZ018867@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 15:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188714 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:41:43 -0000 Author: jhb Date: Tue Feb 17 15:41:41 2009 New Revision: 188714 URL: http://svn.freebsd.org/changeset/base/188714 Log: MFC 1.39: Include in in the kernel so that curthread is always defined. Modified: stable/7/sys/sys/sx.h Modified: stable/7/sys/sys/sx.h ============================================================================== --- stable/7/sys/sys/sx.h Tue Feb 17 15:39:16 2009 (r188713) +++ stable/7/sys/sys/sx.h Tue Feb 17 15:41:41 2009 (r188714) @@ -34,9 +34,10 @@ #include #include -#include #ifdef _KERNEL +#include +#include #include #endif From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:47:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12AEA1065812; Tue, 17 Feb 2009 15:47:15 +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 B273D8FC43; Tue, 17 Feb 2009 15:47:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HFlDoI019523; Tue, 17 Feb 2009 15:47:13 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFlD1O019522; Tue, 17 Feb 2009 15:47:13 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171547.n1HFlD1O019522@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 15:47: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: r188715 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:47:19 -0000 Author: raj Date: Tue Feb 17 15:47:13 2009 New Revision: 188715 URL: http://svn.freebsd.org/changeset/base/188715 Log: tsec(4): do not clear interrupt events register before use. Prior to this fix, IEVENT register was always cleared before calling tsec_error_intr_locked(), which prevented error recovery actions from happening with polling enabled (and could lead to serious problems, including controller hang). Submitted by: Marcin Ligenza marcinl ! pacomp dot com dot pl Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:41:41 2009 (r188714) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:47:13 2009 (r188715) @@ -870,11 +870,11 @@ tsec_poll(struct ifnet *ifp, enum poll_c } if (cmd == POLL_AND_CHECK_STATUS) { - ie = TSEC_READ(sc, TSEC_REG_IEVENT); + tsec_error_intr_locked(sc, count); /* Clear all events reported */ + ie = TSEC_READ(sc, TSEC_REG_IEVENT); TSEC_WRITE(sc, TSEC_REG_IEVENT, ie); - tsec_error_intr_locked(sc, count); } tsec_transmit_intr_locked(sc); From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:54:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8351065678; Tue, 17 Feb 2009 15:54: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 59EA58FC19; Tue, 17 Feb 2009 15:54:09 +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 n1HFs9wt019931; Tue, 17 Feb 2009 15:54:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFs994019930; Tue, 17 Feb 2009 15:54:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902171554.n1HFs994019930@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 15:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188716 - in stable/7/cddl/contrib/opensolaris: . lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:54:10 -0000 Author: jhb Date: Tue Feb 17 15:54:09 2009 New Revision: 188716 URL: http://svn.freebsd.org/changeset/base/188716 Log: MFC: Correct the sense of the "use32" terenary operator so that it uses 'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries. Remove an #ifdef __i386__ that defined use32 to the wrong value on i386 to workaround the bug in the terenary operator. Modified: stable/7/cddl/contrib/opensolaris/ (props changed) stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Feb 17 15:47:13 2009 (r188715) +++ stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Feb 17 15:54:09 2009 (r188716) @@ -1739,15 +1739,11 @@ dtrace_program_link(dtrace_hdl_t *dtp, d * Arches which are 32-bit only just use the normal * library path. */ -#if defined(__i386__) - int use_32 = 1; /* use /usr/lib/... -sson */ -#else int use_32 = 0; #endif -#endif (void) snprintf(drti, sizeof (drti), "/usr/lib%s/dtrace/drti.o", - use_32 ? "":"32"); + use_32 ? "32":""); len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile, drti) + 1; From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:58:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F6E8106564A; Tue, 17 Feb 2009 15:58:42 +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 7C5B48FC0C; Tue, 17 Feb 2009 15:58:42 +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 n1HFwgSG020071; Tue, 17 Feb 2009 15:58:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFwgPq020070; Tue, 17 Feb 2009 15:58:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902171558.n1HFwgPq020070@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 15:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188717 - in stable/7/sys: . compat/linprocfs contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:58:44 -0000 Author: jhb Date: Tue Feb 17 15:58:42 2009 New Revision: 188717 URL: http://svn.freebsd.org/changeset/base/188717 Log: MFC: Fix a bug in the previous change to the mtab handler: use the path returned by vn_fullpath() when vn_fullpath() succeeds instead of when it fails. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Tue Feb 17 15:54:09 2009 (r188716) +++ stable/7/sys/compat/linprocfs/linprocfs.c Tue Feb 17 15:58:42 2009 (r188717) @@ -317,7 +317,7 @@ linprocfs_domtab(PFS_FILL_ARGS) error = namei(&nd); lep = linux_emul_path; if (error == 0) { - if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) == 0) lep = dlep; vrele(nd.ni_vp); VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 15:59:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB6DA106566C; Tue, 17 Feb 2009 15:59:27 +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 D93E98FC12; Tue, 17 Feb 2009 15:59:27 +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 n1HFxR6l020125; Tue, 17 Feb 2009 15:59:27 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HFxRvo020124; Tue, 17 Feb 2009 15:59:27 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171559.n1HFxRvo020124@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 15:59: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: r188718 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 15:59:29 -0000 Author: raj Date: Tue Feb 17 15:59:27 2009 New Revision: 188718 URL: http://svn.freebsd.org/changeset/base/188718 Log: tsec(4): Always try to resume the receiver. This helps recover from RX stall under heavy loads. Submitted by: Piotr Ziecik kosmo ! semihalf dot com Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:58:42 2009 (r188717) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:59:27 2009 (r188718) @@ -1363,6 +1363,16 @@ tsec_receive_intr_locked(struct tsec_sof bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* + * Make sure TSEC receiver is not halted. + * + * Various conditions can stop the TSEC receiver, but not all are + * signaled and handled by error interrupt, so make sure the receiver + * is running. Writing to TSEC_REG_RSTAT restarts the receiver when + * halted, and is harmless if already running. + */ + TSEC_WRITE(sc, TSEC_REG_RSTAT, TSEC_RSTAT_QHLT); } void @@ -1507,9 +1517,6 @@ tsec_error_intr_locked(struct tsec_softc /* Get data from RX buffers */ tsec_receive_intr_locked(sc, count); - - /* Make receiver again active */ - TSEC_WRITE(sc, TSEC_REG_RSTAT, TSEC_RSTAT_QHLT); } if (ifp->if_flags & IFF_DEBUG) From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 16:02:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 409231065677; Tue, 17 Feb 2009 16:02:46 +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 2F0118FC1B; Tue, 17 Feb 2009 16:02:46 +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 n1HG2kLD020240; Tue, 17 Feb 2009 16:02:46 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HG2kme020239; Tue, 17 Feb 2009 16:02:46 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200902171602.n1HG2kme020239@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 17 Feb 2009 16:02: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: r188719 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 16:02:46 -0000 Author: raj Date: Tue Feb 17 16:02:45 2009 New Revision: 188719 URL: http://svn.freebsd.org/changeset/base/188719 Log: tsec(4) cosmetics. Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c ============================================================================== --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:59:27 2009 (r188718) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 16:02:45 2009 (r188719) @@ -968,7 +968,7 @@ tsec_ioctl(struct ifnet *ifp, u_long com } } #endif - break; + break; default: error = ether_ioctl(ifp, command, data); @@ -1710,7 +1710,6 @@ tsec_add_sysctls(struct tsec_softc *sc) * 100 Mbps, or 1Gbps, respectively. For detailed discussion consult the * TSEC reference manual. */ - static int tsec_sysctl_ic_time(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 16:35:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0F9106566B; Tue, 17 Feb 2009 16:35:19 +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 96D9D8FC15; Tue, 17 Feb 2009 16:35:19 +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 n1HGZJAY020974; Tue, 17 Feb 2009 16:35:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HGZJ7g020971; Tue, 17 Feb 2009 16:35:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200902171635.n1HGZJ7g020971@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 17 Feb 2009 16:35: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: r188720 - in head: contrib/openpam contrib/openpam/include/security contrib/openpam/lib lib/libpam/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 16:35:21 -0000 Author: des Date: Tue Feb 17 16:35:19 2009 New Revision: 188720 URL: http://svn.freebsd.org/changeset/base/188720 Log: Don't try to auto-detect dynamic linking; it fails on mips. The Makefile part of the patch is an ugly (and hopefully temporary) hack. Discussed with: imp@ Modified: head/contrib/openpam/ (props changed) head/contrib/openpam/include/security/openpam.h head/contrib/openpam/lib/openpam_dynamic.c head/lib/libpam/modules/Makefile.inc Modified: head/contrib/openpam/include/security/openpam.h ============================================================================== --- head/contrib/openpam/include/security/openpam.h Tue Feb 17 16:02:45 2009 (r188719) +++ head/contrib/openpam/include/security/openpam.h Tue Feb 17 16:35:19 2009 (r188720) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2002-2003 Networks Associates Technology, Inc. - * Copyright (c) 2004-2007 Dag-Erling Smørgrav + * Copyright (c) 2004-2008 Dag-Erling Smørgrav * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam.h 408 2007-12-21 11:36:24Z des $ + * $Id: openpam.h 418 2008-12-13 22:39:24Z des $ */ #ifndef SECURITY_OPENPAM_H_INCLUDED @@ -309,18 +309,17 @@ struct pam_module { * Infrastructure for static modules using GCC linker sets. * You are not expected to understand this. */ -#if defined(__FreeBSD__) +#if !defined(PAM_SOEXT) # define PAM_SOEXT ".so" -#else -# undef NO_STATIC_MODULES -# define NO_STATIC_MODULES #endif -#if defined(__GNUC__) && !defined(__PIC__) && !defined(NO_STATIC_MODULES) +#if defined(OPENPAM_STATIC_MODULES) +# if !defined(__GNUC__) +# error "Don't know how to build static modules on non-GNU compilers" +# endif /* gcc, static linking */ # include # include -# define OPENPAM_STATIC_MODULES # define PAM_EXTERN static # define PAM_MODULE_ENTRY(name) \ static char _pam_name[] = name PAM_SOEXT; \ Modified: head/contrib/openpam/lib/openpam_dynamic.c ============================================================================== --- head/contrib/openpam/lib/openpam_dynamic.c Tue Feb 17 16:02:45 2009 (r188719) +++ head/contrib/openpam/lib/openpam_dynamic.c Tue Feb 17 16:35:19 2009 (r188720) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2002-2003 Networks Associates Technology, Inc. - * Copyright (c) 2004-2007 Dag-Erling Smørgrav + * Copyright (c) 2004-2008 Dag-Erling Smørgrav * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,9 +32,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_dynamic.c 408 2007-12-21 11:36:24Z des $ + * $Id: openpam_dynamic.c 417 2008-02-14 18:36:22Z des $ */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -57,6 +61,7 @@ pam_module_t * openpam_dynamic(const char *path) { + const pam_module_t *dlmodule; pam_module_t *module; const char *prefix; char *vpath; @@ -64,8 +69,6 @@ openpam_dynamic(const char *path) int i; dlh = NULL; - if ((module = calloc(1, sizeof *module)) == NULL) - goto buf_err; /* Prepend the standard prefix if not an absolute pathname. */ if (path[0] != '/') @@ -75,33 +78,37 @@ openpam_dynamic(const char *path) /* try versioned module first, then unversioned module */ if (asprintf(&vpath, "%s%s.%d", prefix, path, LIB_MAJ) < 0) - goto buf_err; + goto err; if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) { openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror()); *strrchr(vpath, '.') = '\0'; if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) { openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror()); FREE(vpath); - FREE(module); return (NULL); } } FREE(vpath); + if ((module = calloc(1, sizeof *module)) == NULL) + goto buf_err; if ((module->path = strdup(path)) == NULL) goto buf_err; module->dlh = dlh; + dlmodule = dlsym(dlh, "_pam_module"); for (i = 0; i < PAM_NUM_PRIMITIVES; ++i) { - module->func[i] = (pam_func_t)dlsym(dlh, _pam_sm_func_name[i]); + module->func[i] = dlmodule ? dlmodule->func[i] : + (pam_func_t)dlsym(dlh, _pam_sm_func_name[i]); if (module->func[i] == NULL) openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s", path, _pam_sm_func_name[i], dlerror()); } return (module); - buf_err: - openpam_log(PAM_LOG_ERROR, "%m"); +buf_err: if (dlh != NULL) dlclose(dlh); FREE(module); +err: + openpam_log(PAM_LOG_ERROR, "%m"); return (NULL); } Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Tue Feb 17 16:02:45 2009 (r188719) +++ head/lib/libpam/modules/Makefile.inc Tue Feb 17 16:35:19 2009 (r188720) @@ -19,4 +19,7 @@ DPADD+= ${LIBPAM} LDADD+= -lpam .endif +.c.o: + ${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC} + .include "../Makefile.inc" From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 17:30:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C77CC1065686; Tue, 17 Feb 2009 17:30:01 +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 9C2878FC08; Tue, 17 Feb 2009 17:30:01 +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 n1HHU1a9022409; Tue, 17 Feb 2009 17:30:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HHU1Km022408; Tue, 17 Feb 2009 17:30:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200902171730.n1HHU1Km022408@svn.freebsd.org> From: Rui Paulo Date: Tue, 17 Feb 2009 17:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188721 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 17:30:02 -0000 Author: rpaulo Date: Tue Feb 17 17:30:00 2009 New Revision: 188721 URL: http://svn.freebsd.org/changeset/base/188721 Log: Welcome Andriy Gapon (avg) as a src committer. rpaulo an jhb are the mentors. Andriy will work mostly on x86, ACPI and fs/udf. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Feb 17 16:35:19 2009 (r188720) +++ svnadmin/conf/access Tue Feb 17 17:30:00 2009 (r188721) @@ -27,6 +27,7 @@ antoine ariff attilio avatar +avg bde benjsc benno From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 17:46:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38D6C1065670; Tue, 17 Feb 2009 17:46:44 +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 262158FC26; Tue, 17 Feb 2009 17:46:44 +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 n1HHkiqs022743; Tue, 17 Feb 2009 17:46:44 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HHkiib022742; Tue, 17 Feb 2009 17:46:44 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902171746.n1HHkiib022742@svn.freebsd.org> From: Sean Bruno Date: Tue, 17 Feb 2009 17:46: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: r188722 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 17:46:44 -0000 Author: sbruno Date: Tue Feb 17 17:46:43 2009 New Revision: 188722 URL: http://svn.freebsd.org/changeset/base/188722 Log: Simplify some debugging messages and try to consolodate some of the more interesting conditional printf's into single device_printf's Change a couple of variable names so that I don't have to trace what they acutally do anymore. Enable the display of the Self ID PHY packet if firewire_debug > 0 Reviewed by: scottl(mentor) MFC after: 2 weeks Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Tue Feb 17 17:30:00 2009 (r188721) +++ head/sys/dev/firewire/firewire.c Tue Feb 17 17:46:43 2009 (r188722) @@ -1257,12 +1257,11 @@ fw_phy_config(struct firewire_comm *fc, fp->mode.common.tcode |= FWTCODE_PHY; if (firewire_debug) - printf("send phy_config root_node=%d gap_count=%d\n", - root_node, gap_count); + device_printf(fc->bdev, "%s: root_node=%d gap_count=%d\n", + __func__, root_node, gap_count); fw_asyreq(fc, -1, xfer); } -#if 0 /* * Dump self ID. */ @@ -1278,7 +1277,6 @@ fw_print_sid(uint32_t sid) s->p0.power_class, s->p0.port0, s->p0.port1, s->p0.port2, s->p0.initiated_reset, s->p0.more_packets); } -#endif /* * To receive self ID. @@ -1302,7 +1300,8 @@ void fw_sidrcv(struct firewire_comm* fc, self_id = &fc->topology_map->self_id[0]; for(i = 0; i < fc->sid_cnt; i ++){ if (sid[1] != ~sid[0]) { - printf("fw_sidrcv: invalid self-id packet\n"); + device_printf(fc->bdev, "%s: ERROR invalid self-id packet\n", + __func__); sid += 2; continue; } @@ -1311,9 +1310,8 @@ void fw_sidrcv(struct firewire_comm* fc, if(self_id->p0.sequel == 0){ fc->topology_map->node_count ++; c_port = 0; -#if 0 - fw_print_sid(sid[0]); -#endif + if (firewire_debug) + fw_print_sid(sid[0]); node = self_id->p0.phy_id; if(fc->max_node < node){ fc->max_node = self_id->p0.phy_id; @@ -1348,7 +1346,6 @@ void fw_sidrcv(struct firewire_comm* fc, self_id++; fc->topology_map->self_id_count ++; } - device_printf(fc->bdev, "%d nodes", fc->max_node + 1); /* CRC */ fc->topology_map->crc = fw_crc16( (uint32_t *)&fc->topology_map->generation, @@ -1367,16 +1364,11 @@ void fw_sidrcv(struct firewire_comm* fc, bcopy(p, &CSRARC(fc, SPED_MAP + 8), (fc->speed_map->crc_len - 1)*4); fc->max_hop = fc->max_node - i_branch; - printf(", maxhop <= %d", fc->max_hop); - - if(fc->irm == -1 ){ - printf(", Not found IRM capable node"); - }else{ - printf(", cable IRM = %d", fc->irm); - if (fc->irm == fc->nodeid) - printf(" (me)"); - } - printf("\n"); + device_printf(fc->bdev, "%d nodes, maxhop <= %d %s irm(%d) %s\n", + fc->max_node + 1, fc->max_hop, + (fc->irm == -1) ? "Not IRM capable" : "cable IRM", + fc->irm, + (fc->irm == fc->nodeid) ? " (me) " : ""); if (try_bmr && (fc->irm != -1) && (CSRARC(fc, BUS_MGR_ID) == 0x3f)) { if (fc->irm == fc->nodeid) { @@ -1408,10 +1400,23 @@ fw_bus_probe(struct firewire_comm *fc) fc->status = FWBUSEXPLORE; /* Invalidate all devices, just after bus reset. */ + if (firewire_debug) + device_printf(fc->bdev, "%s:" + "iterate and invalidate all nodes\n", + __func__); STAILQ_FOREACH(fwdev, &fc->devices, link) if (fwdev->status != FWDEVINVAL) { fwdev->status = FWDEVINVAL; fwdev->rcnt = 0; + if (firewire_debug) + device_printf(fc->bdev, "%s:" + "Invalidate Dev ID: %08x%08x\n", + __func__, fwdev->eui.hi, fwdev->eui.lo); + } else { + if (firewire_debug) + device_printf(fc->bdev, "%s:" + "Dev ID: %08x%08x already invalid\n", + __func__, fwdev->eui.hi, fwdev->eui.lo); } splx(s); @@ -1420,13 +1425,13 @@ fw_bus_probe(struct firewire_comm *fc) static int fw_explore_read_quads(struct fw_device *fwdev, int offset, - uint32_t *quad, int n) + uint32_t *quad, int length) { struct fw_xfer *xfer; uint32_t tmp; int i, error; - for (i = 0; i < n; i ++, offset += sizeof(uint32_t)) { + for (i = 0; i < length; i ++, offset += sizeof(uint32_t)) { xfer = fwmem_read_quad(fwdev, NULL, -1, 0xffff, 0xf0000000 | offset, (void *)&tmp, fw_xferwake); @@ -1521,20 +1526,25 @@ fw_explore_node(struct fw_device *dfwdev hdr = (struct csrhdr *)&csr[0]; if (hdr->info_len != 4) { if (firewire_debug) - printf("node%d: wrong bus info len(%d)\n", - node, hdr->info_len); + device_printf(fc->bdev, "%s: node%d: wrong bus info len(%d)\n", + __func__, node, hdr->info_len); + dfwdev->status = FWDEVINVAL; return (-1); } /* bus info */ err = fw_explore_read_quads(dfwdev, CSRROMOFF + 0x04, &csr[1], 4); - if (err) + if (err) { + device_printf(fc->bdev, "%s: node%d: error reading 0x04\n", + __func__, node); + dfwdev->status = FWDEVINVAL; return (-1); + } binfo = (struct bus_info *)&csr[1]; if (binfo->bus_name != CSR_BUS_NAME_IEEE1394) { - if (firewire_debug) - printf("node%d: invalid bus name 0x%08x\n", - node, binfo->bus_name); + device_printf(fc->bdev, "%s: node%d: invalid bus name 0x%08x\n", + __func__, node, binfo->bus_name); + dfwdev->status = FWDEVINVAL; return (-1); } @@ -1557,8 +1567,8 @@ fw_explore_node(struct fw_device *dfwdev fwdev = malloc(sizeof(struct fw_device), M_FW, M_NOWAIT | M_ZERO); if (fwdev == NULL) { - if (firewire_debug) - printf("node%d: no memory\n", node); + device_printf(fc->bdev, "%s: node%d: no memory\n", + __func__, node); return (-1); } fwdev->fc = fc; @@ -1677,12 +1687,22 @@ fw_explore(struct firewire_comm *fc) for (node = 0; node <= fc->max_node; node ++) { /* We don't probe myself and linkdown nodes */ - if (node == fc->nodeid) + if (node == fc->nodeid) { + if (firewire_debug) + device_printf(fc->bdev, "%s:" + "found myself node(%d) fc->nodeid(%d) fc->max_node(%d)\n", + __func__, node, fc->nodeid, fc->max_node); continue; + } else if (firewire_debug) { + device_printf(fc->bdev, "%s:" + "node(%d) fc->max_node(%d) found\n", + __func__, node, fc->max_node); + } fwsid = fw_find_self_id(fc, node); if (!fwsid || !fwsid->p0.link_active) { if (firewire_debug) - printf("node%d: link down\n", node); + device_printf(fc->bdev, "%s: node%d: link down\n", + __func__, node); continue; } nodes[todo++] = node; @@ -1697,8 +1717,8 @@ fw_explore(struct firewire_comm *fc) if (err) nodes[todo2++] = nodes[i]; if (firewire_debug) - printf("%s: node %d, err = %d\n", - __FUNCTION__, node, err); + device_printf(fc->bdev, "%s: node %d, err = %d\n", + __func__, node, err); } todo = todo2; } @@ -1748,11 +1768,18 @@ fw_attach_dev(struct firewire_comm *fc) fwdev->status = FWDEVATTACHED; } else if (fwdev->status == FWDEVINVAL) { fwdev->rcnt ++; + if (firewire_debug) + device_printf(fc->bdev, "%s:" + "fwdev->rcnt(%d), hold_count(%d)\n", + __func__, fwdev->rcnt, hold_count); if (fwdev->rcnt > hold_count) { /* * Remove devices which have not been seen * for a while. */ + device_printf(fc->bdev, "%s:" + "Removing missing device ID:%08x%08x\n", + __func__, fwdev->eui.hi, fwdev->eui.lo); STAILQ_REMOVE(&fc->devices, fwdev, fw_device, link); free(fwdev, M_FW); @@ -1761,16 +1788,16 @@ fw_attach_dev(struct firewire_comm *fc) } err = device_get_children(fc->bdev, &devlistp, &devcnt); - if( err != 0 ) - return; - for( i = 0 ; i < devcnt ; i++){ - if (device_get_state(devlistp[i]) >= DS_ATTACHED) { - fdc = device_get_softc(devlistp[i]); - if (fdc->post_explore != NULL) - fdc->post_explore(fdc); + if( err == 0 ) { + for( i = 0 ; i < devcnt ; i++){ + if (device_get_state(devlistp[i]) >= DS_ATTACHED) { + fdc = device_get_softc(devlistp[i]); + if (fdc->post_explore != NULL) + fdc->post_explore(fdc); + } } + free(devlistp, M_TEMP); } - free(devlistp, M_TEMP); return; } @@ -1850,8 +1877,9 @@ fw_rcv_copy(struct fw_rcv_buf *rb) for (i = 0; i < rb->nvec; i++, rb->vec++) { len = MIN(rb->vec->iov_len, plen); if (res < len) { - printf("rcv buffer(%d) is %d bytes short.\n", - rb->xfer->recv.pay_len, len - res); + device_printf(rb->fc->bdev, "%s:" + " rcv buffer(%d) is %d bytes short.\n", + __func__, rb->xfer->recv.pay_len, len - res); len = res; } bcopy(rb->vec->iov_base, p, len); @@ -1898,13 +1926,15 @@ fw_rcv(struct fw_rcv_buf *rb) rb->xfer = fw_tl2xfer(rb->fc, fp->mode.hdr.src, fp->mode.hdr.tlrt >> 2, fp->mode.hdr.tcode); if(rb->xfer == NULL) { - printf("fw_rcv: unknown response " - "%s(%x) src=0x%x tl=0x%x rt=%d data=0x%x\n", - tcode_str[tcode], tcode, - fp->mode.hdr.src, - fp->mode.hdr.tlrt >> 2, - fp->mode.hdr.tlrt & 3, - fp->mode.rresq.data); + device_printf(rb->fc->bdev, "%s: " + "unknown response " + "%s(%x) src=0x%x tl=0x%x rt=%d data=0x%x\n", + __func__, + tcode_str[tcode], tcode, + fp->mode.hdr.src, + fp->mode.hdr.tlrt >> 2, + fp->mode.hdr.tlrt & 3, + fp->mode.rresq.data); #if 0 printf("try ad-hoc work around!!\n"); rb->xfer = fw_tl2xfer(rb->fc, fp->mode.hdr.src, @@ -1936,7 +1966,8 @@ fw_rcv(struct fw_rcv_buf *rb) #endif break; default: - printf("unexpected flag 0x%02x\n", rb->xfer->flag); + device_printf(rb->fc->bdev, "%s: " + "unexpected flag 0x%02x\n", __func__, rb->xfer->flag); } return; case FWTCODE_WREQQ: @@ -1947,17 +1978,23 @@ fw_rcv(struct fw_rcv_buf *rb) bind = fw_bindlookup(rb->fc, fp->mode.rreqq.dest_hi, fp->mode.rreqq.dest_lo); if(bind == NULL){ - printf("Unknown service addr 0x%04x:0x%08x %s(%x)" + device_printf(rb->fc->bdev, "%s: " + "Unknown service addr 0x%04x:0x%08x %s(%x)" #if defined(__DragonFly__) || __FreeBSD_version < 500000 - " src=0x%x data=%lx\n", + " src=0x%x data=%lx\n", #else - " src=0x%x data=%x\n", + " src=0x%x data=%x\n", #endif - fp->mode.wreqq.dest_hi, fp->mode.wreqq.dest_lo, - tcode_str[tcode], tcode, - fp->mode.hdr.src, ntohl(fp->mode.wreqq.data)); + __func__, + fp->mode.wreqq.dest_hi, + fp->mode.wreqq.dest_lo, + tcode_str[tcode], tcode, + fp->mode.hdr.src, + ntohl(fp->mode.wreqq.data)); + if (rb->fc->status == FWBUSINIT) { - printf("fw_rcv: cannot respond(bus reset)!\n"); + device_printf(rb->fc->bdev, "%s: cannot respond(bus reset)!\n", + __func__); return; } rb->xfer = fw_xfer_alloc(M_FWXFER); @@ -2003,9 +2040,9 @@ fw_rcv(struct fw_rcv_buf *rb) len += rb->vec[i].iov_len; rb->xfer = STAILQ_FIRST(&bind->xferlist); if (rb->xfer == NULL) { -#if 1 - printf("Discard a packet for this bind.\n"); -#endif + device_printf(rb->fc->bdev, "%s: " + "Discard a packet for this bind.\n", + __func__); return; } STAILQ_REMOVE_HEAD(&bind->xferlist, link); @@ -2056,7 +2093,8 @@ fw_rcv(struct fw_rcv_buf *rb) } #endif default: - printf("fw_rcv: unknow tcode %d\n", tcode); + device_printf(rb->fc->bdev,"%s: unknown tcode %d\n", + __func__, tcode); break; } } @@ -2229,6 +2267,12 @@ fw_crc16(uint32_t *ptr, uint32_t len){ return((uint16_t) crc); } +/* + * Find the root node, if it is not + * Cycle Master Capable, then we should + * override this and become the Cycle + * Master + */ static int fw_bmr(struct firewire_comm *fc) { @@ -2253,13 +2297,13 @@ fw_bmr(struct firewire_comm *fc) } else cmstr = -1; - device_printf(fc->bdev, "bus manager %d ", CSRARC(fc, BUS_MGR_ID)); + device_printf(fc->bdev, "bus manager %d %s\n", + CSRARC(fc, BUS_MGR_ID), + (CSRARC(fc, BUS_MGR_ID) != fc->nodeid) ? "(me)" : ""); if(CSRARC(fc, BUS_MGR_ID) != fc->nodeid) { /* We are not the bus manager */ - printf("\n"); return(0); } - printf("(me)\n"); /* Optimize gapcount */ if(fc->max_hop <= MAX_GAPHOP ) From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 17:48:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1A201065672; Tue, 17 Feb 2009 17:48:01 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3118FC16; Tue, 17 Feb 2009 17:48:01 +0000 (UTC) (envelope-from remko@elvandar.org) Received: from adslgebruiker.xs4all.nl ([195.64.94.120] helo=[10.0.2.153]) by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LZU36-000KkX-6H; Tue, 17 Feb 2009 18:48:00 +0100 Message-Id: From: Remko Lodder To: Rui Paulo In-Reply-To: <200902171730.n1HHU1Km022408@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: Tue, 17 Feb 2009 18:47:56 +0100 References: <200902171730.n1HHU1Km022408@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-svnadmin@freebsd.org Subject: Re: svn commit: r188721 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 17:48:02 -0000 yay, this is great news :) On Feb 17, 2009, at 6:30 PM, Rui Paulo wrote: > Author: rpaulo > Date: Tue Feb 17 17:30:00 2009 > New Revision: 188721 > URL: http://svn.freebsd.org/changeset/base/188721 > > Log: > Welcome Andriy Gapon (avg) as a src committer. rpaulo an jhb are the > mentors. > Andriy will work mostly on x86, ACPI and fs/udf. > > Approved by: core > > Modified: > svnadmin/conf/access > > Modified: svnadmin/conf/access > = > = > = > = > = > = > = > = > ====================================================================== > --- svnadmin/conf/access Tue Feb 17 16:35:19 2009 (r188720) > +++ svnadmin/conf/access Tue Feb 17 17:30:00 2009 (r188721) > @@ -27,6 +27,7 @@ antoine > ariff > attilio > avatar > +avg > bde > benjsc > benno -- /"\ Best regards, | remko@FreeBSD.org \ / Remko Lodder | remko@EFnet X http://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 18:24:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0DA21065676; Tue, 17 Feb 2009 18:24:59 +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 AE2688FC22; Tue, 17 Feb 2009 18:24:59 +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 n1HIOx5v023568; Tue, 17 Feb 2009 18:24:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HIOx3D023567; Tue, 17 Feb 2009 18:24:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902171824.n1HIOx3D023567@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 17 Feb 2009 18:24: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: r188723 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 18:25:01 -0000 Author: marcel Date: Tue Feb 17 18:24:58 2009 New Revision: 188723 URL: http://svn.freebsd.org/changeset/base/188723 Log: Add a default implementation for pre-check. It should always succeed if not implemented. Pointy hat: marcel Modified: head/sys/geom/part/g_part_if.m Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Tue Feb 17 17:46:43 2009 (r188722) +++ head/sys/geom/part/g_part_if.m Tue Feb 17 18:24:58 2009 (r188723) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2006-2008 Marcel Moolenaar +# Copyright (c) 2006-2009 Marcel Moolenaar # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,6 +40,16 @@ INTERFACE g_part; +# Default implementations of methods. +CODE { + static int + default_precheck(struct g_part_table *t __unused, + enum g_part_ctl r __unused, struct g_part_parms *p __unused) + { + return (0); + } +}; + # add() - scheme specific processing for the add verb. METHOD int add { struct g_part_table *table; @@ -106,7 +116,7 @@ METHOD int precheck { struct g_part_table *table; enum g_part_ctl req; struct g_part_parms *gpp; -}; +} DEFAULT default_precheck; # probe() - probe the provider attached to the given consumer for the # existence of the scheme implemented by the G_PART interface handler. From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:03:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A49FB1065672; Tue, 17 Feb 2009 19:03:35 +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 5EAE98FC13; Tue, 17 Feb 2009 19:03:35 +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 n1HJ3XiH023559; Tue, 17 Feb 2009 12:03:34 -0700 Received: from apn-77-112-13-25.gprs.plus.pl (apn-77-112-13-25.gprs.plus.pl [77.112.13.25]) by mail.semihalf.com (Postfix) with ESMTP id E32B1149D7; Tue, 17 Feb 2009 20:27:16 +0100 (CET) Message-Id: <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> From: =?ISO-8859-2?Q?Rafa=B3_Jaworowski?= To: Marcel Moolenaar In-Reply-To: <200902162142.n1GLggqX095410@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: Tue, 17 Feb 2009 20:03:18 +0100 References: <200902162142.n1GLggqX095410@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: r188698 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:03:36 -0000 On 2009-02-16, at 22:42, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Feb 16 21:42:41 2009 > New Revision: 188698 > URL: http://svn.freebsd.org/changeset/base/188698 > > Log: > Include Marvell EHCI HC driver for USB2. Hi Marcel, So did you get the new stack to work on MV? The last time we tried (a month ago roughly) we were encountering stability problems, and didn't have the time to investigate further. But there was a number of fixes and patches flying around since then, so is it working for you now? Rafal From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:10:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F0D21065800; Tue, 17 Feb 2009 19:10:15 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by mx1.freebsd.org (Postfix) with ESMTP id 435E78FC08; Tue, 17 Feb 2009 19:10:15 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed; delsp=yes Received: from jflores-gxdt755.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KF8009LD58AIK10@asmtp014.mac.com>; Tue, 17 Feb 2009 11:09:47 -0800 (PST) Message-id: <0E150BD8-2EE1-4764-A14F-C63E1CE8C69E@mac.com> From: Marcel Moolenaar To: =?UTF-8?Q?Rafa=C5=82_Jaworowski?= In-reply-to: <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> Content-transfer-encoding: quoted-printable Date: Tue, 17 Feb 2009 11:09:46 -0800 References: <200902162142.n1GLggqX095410@svn.freebsd.org> <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> 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: r188698 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:10:17 -0000 On Feb 17, 2009, at 11:03 AM, Rafa=C5=82 Jaworowski wrote: > > On 2009-02-16, at 22:42, Marcel Moolenaar wrote: > >> Author: marcel >> Date: Mon Feb 16 21:42:41 2009 >> New Revision: 188698 >> URL: http://svn.freebsd.org/changeset/base/188698 >> >> Log: >> Include Marvell EHCI HC driver for USB2. > > Hi Marcel, > So did you get the new stack to work on MV? The last time we tried =20 > (a month ago roughly) we were encountering stability problems, and =20 > didn't have the time to investigate further. But there was a number =20= > of fixes and patches flying around since then, so is it working for =20= > you now? Yes, it fundamentally works. Since I have the root file system on USB, I did ran into the problem that USB2 doesn't block the root mount until it's done enumerating the USB busses, but that's a generic problem. I boot with a kluge right now until it's resolved, but I use USB2 on my Orion. I haven't stress-tested anything yet, though... FYI, --=20 Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:12:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B44A01065777; Tue, 17 Feb 2009 19:12:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D02A8FC1D; Tue, 17 Feb 2009 19:12:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HJCF37024707; Tue, 17 Feb 2009 19:12:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HJCFW0024706; Tue, 17 Feb 2009 19:12:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902171912.n1HJCFW0024706@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Feb 2009 19: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: r188724 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:12:22 -0000 Author: mav Date: Tue Feb 17 19:12:15 2009 New Revision: 188724 URL: http://svn.freebsd.org/changeset/base/188724 Log: Add support for interruptless kernel dumping. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Tue Feb 17 18:24:58 2009 (r188723) +++ head/sys/dev/sdhci/sdhci.c Tue Feb 17 19:12:15 2009 (r188724) @@ -1187,6 +1187,12 @@ sdhci_request(device_t brdev, device_t r slot->flags = 0; sdhci_start(slot); SDHCI_UNLOCK(slot); + if (dumping) { + while (slot->req != NULL) { + sdhci_intr(slot->sc); + DELAY(10); + } + } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:12:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF3C71065676; Tue, 17 Feb 2009 19:12:48 +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 835A68FC1A; Tue, 17 Feb 2009 19:12:48 +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 n1HJCl7q077623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Feb 2009 11:12:48 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <499B0C2F.3080809@freebsd.org> Date: Tue, 17 Feb 2009 11:12:47 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: =?UTF-8?B?UmFmYcWCIEphd29yb3dza2k=?= References: <200902162142.n1GLggqX095410@svn.freebsd.org> <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> In-Reply-To: <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r188698 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:12:52 -0000 RafaÅ‚ Jaworowski wrote: > > On 2009-02-16, at 22:42, Marcel Moolenaar wrote: > >> Author: marcel >> Date: Mon Feb 16 21:42:41 2009 >> New Revision: 188698 >> URL: http://svn.freebsd.org/changeset/base/188698 >> >> Log: >> Include Marvell EHCI HC driver for USB2. > > Hi Marcel, > So did you get the new stack to work on MV? The last time we tried (a > month ago roughly) we were encountering stability problems, and didn't > have the time to investigate further. But there was a number of fixes > and patches flying around since then, so is it working for you now? I have tried it on Gateworks 2348 boards w/ mixed success. HS devices worked under cursory examination (didn't do any real testing) but FS and DS devices did not enumerate. Sam From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:17:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8508510656FA; Tue, 17 Feb 2009 19:17:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 582D18FC17; Tue, 17 Feb 2009 19:17:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HJHPN6024878; Tue, 17 Feb 2009 19:17:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HJHPhI024877; Tue, 17 Feb 2009 19:17:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902171917.n1HJHPhI024877@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Feb 2009 19:17: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: r188725 - head/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:17:27 -0000 Author: mav Date: Tue Feb 17 19:17:25 2009 New Revision: 188725 URL: http://svn.freebsd.org/changeset/base/188725 Log: Add kernel dumping support. Works fine with sdhci controller driver. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Tue Feb 17 19:12:15 2009 (r188724) +++ head/sys/dev/mmc/mmcsd.c Tue Feb 17 19:17:25 2009 (r188725) @@ -91,6 +91,8 @@ static int mmcsd_detach(device_t dev); static int mmcsd_open(struct disk *dp); static int mmcsd_close(struct disk *dp); static void mmcsd_strategy(struct bio *bp); +static int mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, + off_t offset, size_t length); static void mmcsd_task(void *arg); static const char *mmcsd_card_name(device_t dev); @@ -130,7 +132,7 @@ mmcsd_attach(device_t dev) d->d_open = mmcsd_open; d->d_close = mmcsd_close; d->d_strategy = mmcsd_strategy; - // d->d_dump = mmcsd_dump; Need polling mmc layer + d->d_dump = mmcsd_dump; d->d_name = "mmcsd"; d->d_drv1 = sc; d->d_maxsize = 4*1024*1024; /* Maximum defined SD card AU size. */ @@ -415,6 +417,33 @@ mmcsd_delete(struct mmcsd_softc *sc, str return (end); } +static int +mmcsd_dump(void *arg, void *virtual, vm_offset_t physical, + off_t offset, size_t length) +{ + struct disk *disk = arg; + struct mmcsd_softc *sc = (struct mmcsd_softc *)disk->d_drv1; + device_t dev = sc->dev; + struct bio bp; + daddr_t block, end; + + /* length zero is special and really means flush buffers to media */ + if (!length) + return (0); + + bzero(&bp, sizeof(struct bio)); + bp.bio_disk = disk; + bp.bio_pblkno = offset / disk->d_sectorsize; + bp.bio_bcount = length; + bp.bio_data = virtual; + bp.bio_cmd = BIO_WRITE; + end = bp.bio_pblkno + bp.bio_bcount / sc->disk->d_sectorsize; + MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev); + block = mmcsd_rw(sc, &bp); + MMCBUS_RELEASE_BUS(device_get_parent(dev), dev); + return ((end < block) ? EIO : 0); +} + static void mmcsd_task(void *arg) { From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:37:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 785C910656DC; Tue, 17 Feb 2009 19:37:04 +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 5AD328FC1C; Tue, 17 Feb 2009 19:37:04 +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 n1HJb47P025750; Tue, 17 Feb 2009 19:37:04 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HJb4E6025748; Tue, 17 Feb 2009 19:37:04 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902171937.n1HJb4E6025748@svn.freebsd.org> From: Sean Bruno Date: Tue, 17 Feb 2009 19: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: r188726 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:37:05 -0000 Author: sbruno Date: Tue Feb 17 19:37:04 2009 New Revision: 188726 URL: http://svn.freebsd.org/changeset/base/188726 Log: Introduce 1394a-2000 extended PHY Self ID packets. Deprecate unused phy_delay Self ID field as it was removed by 1394a-2000. Attempt to parse extended Self ID PHY packets if they are detected Reviewed by: scottl (mentor) MFC after: 2 weeks Modified: head/sys/dev/firewire/firewire.c head/sys/dev/firewire/firewire.h Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Tue Feb 17 19:17:25 2009 (r188725) +++ head/sys/dev/firewire/firewire.c Tue Feb 17 19:37:04 2009 (r188726) @@ -1270,12 +1270,29 @@ fw_print_sid(uint32_t sid) { union fw_self_id *s; s = (union fw_self_id *) &sid; - printf("node:%d link:%d gap:%d spd:%d del:%d con:%d pwr:%d" - " p0:%d p1:%d p2:%d i:%d m:%d\n", - s->p0.phy_id, s->p0.link_active, s->p0.gap_count, - s->p0.phy_speed, s->p0.phy_delay, s->p0.contender, - s->p0.power_class, s->p0.port0, s->p0.port1, - s->p0.port2, s->p0.initiated_reset, s->p0.more_packets); + if ( s->p0.sequel ) { + if ( s->p1.sequence_num == FW_SELF_ID_PAGE0 ) { + printf("node:%d p3:%d p4:%d p5:%d p6:%d p7:%d" + "p8:%d p9:%d p10:%d\n", + s->p1.phy_id, s->p1.port3, s->p1.port4, + s->p1.port5, s->p1.port6, s->p1.port7, + s->p1.port8, s->p1.port9, s->p1.port10); + } else if (s->p2.sequence_num == FW_SELF_ID_PAGE1 ){ + printf("node:%d p11:%d p12:%d p13:%d p14:%d p15:%d\n", + s->p2.phy_id, s->p2.port11, s->p2.port12, + s->p2.port13, s->p2.port14, s->p2.port15); + } else { + printf("node:%d Unknown Self ID Page number %d\n", + s->p1.phy_id, s->p1.sequence_num); + } + } else { + printf("node:%d link:%d gap:%d spd:%d con:%d pwr:%d" + " p0:%d p1:%d p2:%d i:%d m:%d\n", + s->p0.phy_id, s->p0.link_active, s->p0.gap_count, + s->p0.phy_speed, s->p0.contender, + s->p0.power_class, s->p0.port0, s->p0.port1, + s->p0.port2, s->p0.initiated_reset, s->p0.more_packets); + } } /* Modified: head/sys/dev/firewire/firewire.h ============================================================================== --- head/sys/dev/firewire/firewire.h Tue Feb 17 19:17:25 2009 (r188725) +++ head/sys/dev/firewire/firewire.h Tue Feb 17 19:37:04 2009 (r188726) @@ -292,6 +292,10 @@ struct fw_devlstreq { #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2 #define FW_SELF_ID_PORT_NOT_CONNECTED 1 #define FW_SELF_ID_PORT_NOT_EXISTS 0 + +#define FW_SELF_ID_PAGE0 0 +#define FW_SELF_ID_PAGE1 1 + #if BYTE_ORDER == BIG_ENDIAN union fw_self_id { struct { @@ -301,7 +305,7 @@ union fw_self_id { link_active:1, gap_count:6, phy_speed:2, - phy_delay:2, + reserved:2, contender:1, power_class:3, port0:2, @@ -353,7 +357,7 @@ union fw_self_id { port0:2, power_class:3, contender:1, - phy_delay:2, + reserved:2, phy_speed:2, gap_count:6, link_active:1, From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:43:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B37821065672; Tue, 17 Feb 2009 19:43:14 +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 6A33E8FC22; Tue, 17 Feb 2009 19:43:14 +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 n1HJhCd4013760; Tue, 17 Feb 2009 12:43:13 -0700 Received: from apn-77-112-13-25.gprs.plus.pl (apn-77-112-13-25.gprs.plus.pl [77.112.13.25]) by mail.semihalf.com (Postfix) with ESMTP id C0E44149D7; Tue, 17 Feb 2009 21:06:55 +0100 (CET) Message-Id: <7064FB5C-3AB1-40C2-8EA6-CDE9E5ADE5E9@semihalf.com> From: =?ISO-8859-2?Q?Rafa=B3_Jaworowski?= To: Marcel Moolenaar In-Reply-To: <0E150BD8-2EE1-4764-A14F-C63E1CE8C69E@mac.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v930.3) Date: Tue, 17 Feb 2009 20:42:51 +0100 References: <200902162142.n1GLggqX095410@svn.freebsd.org> <3BB0DCB1-2279-422E-995E-9D723479AE83@semihalf.com> <0E150BD8-2EE1-4764-A14F-C63E1CE8C69E@mac.com> 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: r188698 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:43:15 -0000 On 2009-02-17, at 20:09, Marcel Moolenaar wrote: > On Feb 17, 2009, at 11:03 AM, Rafa=B3 Jaworowski wrote: > >> >> On 2009-02-16, at 22:42, Marcel Moolenaar wrote: >> >>> Author: marcel >>> Date: Mon Feb 16 21:42:41 2009 >>> New Revision: 188698 >>> URL: http://svn.freebsd.org/changeset/base/188698 >>> >>> Log: >>> Include Marvell EHCI HC driver for USB2. >> >> Hi Marcel, >> So did you get the new stack to work on MV? The last time we tried =20= >> (a month ago roughly) we were encountering stability problems, and =20= >> didn't have the time to investigate further. But there was a number =20= >> of fixes and patches flying around since then, so is it working for =20= >> you now? > > Yes, it fundamentally works. Since I have the root file system on USB, > I did ran into the problem that USB2 doesn't block the root mount =20 > until > it's done enumerating the USB busses, but that's a generic problem. > > I boot with a kluge right now until it's resolved, but I use USB2 on > my Orion. > > I haven't stress-tested anything yet, though... Seems like things could improve then, so I should give this another =20 spin. Rafal From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 19:57:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 217BE106564A; Tue, 17 Feb 2009 19:57:53 +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 0BFF58FC15; Tue, 17 Feb 2009 19:57:53 +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 n1HJvrfd026148; Tue, 17 Feb 2009 19:57:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HJvqk8026145; Tue, 17 Feb 2009 19:57:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902171957.n1HJvqk8026145@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 19:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:57:53 -0000 Author: jhb Date: Tue Feb 17 19:57:52 2009 New Revision: 188727 URL: http://svn.freebsd.org/changeset/base/188727 Log: MFC: Rework the lifetime management of the kernel implementation of POSIX semaphores. Specifically, semaphores are now represented as new file descriptor type that is set to close on exec. This removes the need for all of the manual process reference counting (and fork, exec, and exit event handlers) as the normal file descriptor operations handle all of that for us nicely. It is also suggested as one possible implementation in the spec and at least one other OS (OS X) uses this approach. Refer to the original commit for more details on specific bug fixes, etc. A notable difference in this MFC relative to the original commit to HEAD is that the MAC entry points are unchanged to preserve the ABI for MAC policy modules. fstat() on a POSIX semaphore in 7 uses the mac_check_posix_sem_getvalue() hook to determine access as that is the closest match to stat() of the available hooks. Discussed with: rwatson (MAC bits (or lack thereof)) Added: stable/7/tools/regression/posixsem/ - copied from r180059, head/tools/regression/posixsem/ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_descrip.c stable/7/sys/kern/uipc_sem.c stable/7/sys/modules/sem/Makefile stable/7/sys/sys/file.h stable/7/sys/sys/ksem.h stable/7/sys/sys/user.h stable/7/usr.bin/procstat/ (props changed) stable/7/usr.bin/procstat/procstat_files.c Modified: stable/7/sys/kern/kern_descrip.c ============================================================================== --- stable/7/sys/kern/kern_descrip.c Tue Feb 17 19:37:04 2009 (r188726) +++ stable/7/sys/kern/kern_descrip.c Tue Feb 17 19:57:52 2009 (r188727) @@ -2933,6 +2933,10 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER kif->kf_type = KF_TYPE_MQUEUE; break; + case DTYPE_SEM: + kif->kf_type = KF_TYPE_SEM; + break; + default: kif->kf_type = KF_TYPE_UNKNOWN; break; @@ -3070,6 +3074,8 @@ file_type_to_name(short type) return ("crpt"); case DTYPE_MQUEUE: return ("mque"); + case DTYPE_SEM: + return ("ksem"); default: return ("unkn"); } Modified: stable/7/sys/kern/uipc_sem.c ============================================================================== --- stable/7/sys/kern/uipc_sem.c Tue Feb 17 19:37:04 2009 (r188726) +++ stable/7/sys/kern/uipc_sem.c Tue Feb 17 19:57:52 2009 (r188727) @@ -38,583 +38,592 @@ __FBSDID("$FreeBSD$"); #include "opt_posix.h" #include -#include -#include -#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -static int sem_count_proc(struct proc *p); -static struct ksem *sem_lookup_byname(const char *name); -static int sem_create(struct thread *td, const char *name, - struct ksem **ksret, mode_t mode, unsigned int value); -static void sem_free(struct ksem *ksnew); -static int sem_perm(struct thread *td, struct ksem *ks); -static void sem_enter(struct proc *p, struct ksem *ks); -static int sem_leave(struct proc *p, struct ksem *ks); -static void sem_exechook(void *arg, struct proc *p, - struct image_params *imgp); -static void sem_exithook(void *arg, struct proc *p); -static void sem_forkhook(void *arg, struct proc *p1, struct proc *p2, - int flags); -static int sem_hasopen(struct thread *td, struct ksem *ks); - -static int kern_sem_close(struct thread *td, semid_t id); -static int kern_sem_post(struct thread *td, semid_t id); -static int kern_sem_wait(struct thread *td, semid_t id, int tryflag, - struct timespec *abstime); -static int kern_sem_init(struct thread *td, int dir, unsigned int value, - semid_t *idp); -static int kern_sem_open(struct thread *td, int dir, const char *name, - int oflag, mode_t mode, unsigned int value, semid_t *idp); -static int kern_sem_unlink(struct thread *td, const char *name); +/* + * TODO + * + * - Resource limits? + * - Update fstat(1) + * - Replace global sem_lock with mtx_pool locks? + * - Add a MAC check_create() hook for creating new named semaphores. + */ #ifndef SEM_MAX #define SEM_MAX 30 #endif -#define SEM_MAX_NAMELEN 14 - -#define SEM_TO_ID(x) ((intptr_t)(x)) -#define ID_TO_SEM(x) id_to_sem(x) - -/* - * Available semaphores go here, this includes sem_init and any semaphores - * created via sem_open that have not yet been unlinked. - */ -LIST_HEAD(, ksem) ksem_head = LIST_HEAD_INITIALIZER(&ksem_head); +#ifdef SEM_DEBUG +#define DP(x) printf x +#else +#define DP(x) +#endif -/* - * Semaphores still in use but have been sem_unlink()'d go here. - */ -LIST_HEAD(, ksem) ksem_deadhead = LIST_HEAD_INITIALIZER(&ksem_deadhead); +struct ksem_mapping { + char *km_path; + Fnv32_t km_fnv; + struct ksem *km_ksem; + LIST_ENTRY(ksem_mapping) km_link; +}; +static MALLOC_DEFINE(M_KSEM, "ksem", "semaphore file descriptor"); +static LIST_HEAD(, ksem_mapping) *ksem_dictionary; +static struct sx ksem_dict_lock; +static struct mtx ksem_count_lock; static struct mtx sem_lock; -static MALLOC_DEFINE(M_SEM, "sems", "semaphore data"); +static u_long ksem_hash; +static int ksem_dead; + +#define KSEM_HASH(fnv) (&ksem_dictionary[(fnv) & ksem_hash]) static int nsems = 0; SYSCTL_DECL(_p1003_1b); -SYSCTL_INT(_p1003_1b, OID_AUTO, nsems, CTLFLAG_RD, &nsems, 0, ""); +SYSCTL_INT(_p1003_1b, OID_AUTO, nsems, CTLFLAG_RD, &nsems, 0, + "Number of active kernel POSIX semaphores"); -static eventhandler_tag sem_exit_tag, sem_exec_tag, sem_fork_tag; +static int kern_sem_wait(struct thread *td, semid_t id, int tryflag, + struct timespec *abstime); +static int ksem_access(struct ksem *ks, struct ucred *ucred); +static struct ksem *ksem_alloc(struct ucred *ucred, mode_t mode, + unsigned int value); +static int ksem_create(struct thread *td, const char *path, + semid_t *semidp, mode_t mode, unsigned int value, + int flags); +static void ksem_drop(struct ksem *ks); +static int ksem_get(struct thread *td, semid_t id, struct file **fpp); +static struct ksem *ksem_hold(struct ksem *ks); +static void ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks); +static struct ksem *ksem_lookup(char *path, Fnv32_t fnv); +static void ksem_module_destroy(void); +static int ksem_module_init(void); +static int ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred); +static int sem_modload(struct module *module, int cmd, void *arg); -#ifdef SEM_DEBUG -#define DP(x) printf x -#else -#define DP(x) -#endif +static fo_rdwr_t ksem_read; +static fo_rdwr_t ksem_write; +static fo_ioctl_t ksem_ioctl; +static fo_poll_t ksem_poll; +static fo_kqfilter_t ksem_kqfilter; +static fo_stat_t ksem_stat; +static fo_close_t ksem_closef; + +/* File descriptor operations. */ +static struct fileops ksem_ops = { + .fo_read = ksem_read, + .fo_write = ksem_write, + .fo_ioctl = ksem_ioctl, + .fo_poll = ksem_poll, + .fo_kqfilter = ksem_kqfilter, + .fo_stat = ksem_stat, + .fo_close = ksem_closef, + .fo_flags = DFLAG_PASSABLE +}; -static __inline void -sem_ref(struct ksem *ks) +FEATURE(posix_sem, "POSIX semaphores"); + +static int +ksem_read(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) { - mtx_assert(&sem_lock, MA_OWNED); - ks->ks_ref++; - DP(("sem_ref: ks = %p, ref = %d\n", ks, ks->ks_ref)); + return (EOPNOTSUPP); } -static __inline void -sem_rel(struct ksem *ks) +static int +ksem_write(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) { - mtx_assert(&sem_lock, MA_OWNED); - DP(("sem_rel: ks = %p, ref = %d\n", ks, ks->ks_ref - 1)); - if (--ks->ks_ref == 0) - sem_free(ks); + return (EOPNOTSUPP); } -static __inline -struct ksem * -id_to_sem(semid_t id) +static int +ksem_ioctl(struct file *fp, u_long com, void *data, + struct ucred *active_cred, struct thread *td) { - struct ksem *ks; - mtx_assert(&sem_lock, MA_OWNED); - DP(("id_to_sem: id = %0x,%p\n", id, (struct ksem *)id)); - LIST_FOREACH(ks, &ksem_head, ks_entry) { - DP(("id_to_sem: ks = %p\n", ks)); - if (ks == (struct ksem *)id) - return (ks); - } - return (NULL); + return (EOPNOTSUPP); } -static struct ksem * -sem_lookup_byname(const char *name) +static int +ksem_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) { - struct ksem *ks; - mtx_assert(&sem_lock, MA_OWNED); - LIST_FOREACH(ks, &ksem_head, ks_entry) - if (ks->ks_name != NULL && strcmp(ks->ks_name, name) == 0) - return (ks); - return (NULL); + return (EOPNOTSUPP); } static int -sem_create(struct thread *td, const char *name, struct ksem **ksret, - mode_t mode, unsigned int value) +ksem_kqfilter(struct file *fp, struct knote *kn) { - struct ksem *ret; - struct proc *p; - struct ucred *uc; - size_t len; + + return (EOPNOTSUPP); +} + +static int +ksem_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, + struct thread *td) +{ + struct ksem *ks; +#ifdef MAC int error; +#endif - DP(("sem_create\n")); - p = td->td_proc; - uc = td->td_ucred; - if (value > SEM_VALUE_MAX) - return (EINVAL); - ret = malloc(sizeof(*ret), M_SEM, M_WAITOK | M_ZERO); - if (name != NULL) { - len = strlen(name); - if (len > SEM_MAX_NAMELEN) { - free(ret, M_SEM); - return (ENAMETOOLONG); - } + ks = fp->f_data; - /* Name must start with a '/' but not contain one. */ - if (*name != '/' || len < 2 || index(name + 1, '/') != NULL) { - free(ret, M_SEM); - return (EINVAL); - } - ret->ks_name = malloc(len + 1, M_SEM, M_WAITOK); - strcpy(ret->ks_name, name); - } else { - ret->ks_name = NULL; - } - ret->ks_mode = mode; - ret->ks_value = value; - ret->ks_ref = 1; - ret->ks_waiters = 0; - ret->ks_uid = uc->cr_uid; - ret->ks_gid = uc->cr_gid; - ret->ks_onlist = 0; - cv_init(&ret->ks_cv, "sem"); - LIST_INIT(&ret->ks_users); #ifdef MAC - mac_init_posix_sem(ret); - mac_create_posix_sem(uc, ret); + /* + * XXX: This isn't quite right, but adding a new stat() hook + * would break the ABI. This seems to be the closest match of + * the existing MAC hooks for POSIX semaphores in 7. + */ + error = mac_check_posix_sem_getvalue(active_cred, ks); + if (error) + return (error); #endif - if (name != NULL) - sem_enter(td->td_proc, ret); - *ksret = ret; - mtx_lock(&sem_lock); - nsems++; - if (nsems > p31b_getcfg(CTL_P1003_1B_SEM_NSEMS_MAX)) { - sem_leave(td->td_proc, ret); - sem_free(ret); - error = ENFILE; - } else - error = 0; - mtx_unlock(&sem_lock); - return (error); + + /* + * Attempt to return sanish values for fstat() on a semaphore + * file descriptor. + */ + bzero(sb, sizeof(*sb)); + sb->st_mode = S_IFREG | ks->ks_mode; /* XXX */ + + sb->st_atimespec = ks->ks_atime; + sb->st_ctimespec = ks->ks_ctime; + sb->st_mtimespec = ks->ks_mtime; + sb->st_birthtimespec = ks->ks_birthtime; + sb->st_uid = ks->ks_uid; + sb->st_gid = ks->ks_gid; + + return (0); } -#ifndef _SYS_SYSPROTO_H_ -struct ksem_init_args { - unsigned int value; - semid_t *idp; -}; -int ksem_init(struct thread *td, struct ksem_init_args *uap); -#endif -int -ksem_init(struct thread *td, struct ksem_init_args *uap) +static int +ksem_closef(struct file *fp, struct thread *td) { + struct ksem *ks; - return (kern_sem_init(td, UIO_USERSPACE, uap->value, uap->idp)); + ks = fp->f_data; + fp->f_data = NULL; + ksem_drop(ks); + + return (0); } -static int -kern_sem_init(struct thread *td, int dir, unsigned int value, semid_t *idp) +/* + * ksem object management including creation and reference counting + * routines. + */ +static struct ksem * +ksem_alloc(struct ucred *ucred, mode_t mode, unsigned int value) { struct ksem *ks; - semid_t id; - int error; - error = sem_create(td, NULL, &ks, S_IRWXU | S_IRWXG, value); - if (error) - return (error); - id = SEM_TO_ID(ks); - if (dir == UIO_USERSPACE) { - error = copyout(&id, idp, sizeof(id)); - if (error) { - mtx_lock(&sem_lock); - sem_rel(ks); - mtx_unlock(&sem_lock); - return (error); - } - } else { - *idp = id; + mtx_lock(&ksem_count_lock); + if (nsems == p31b_getcfg(CTL_P1003_1B_SEM_NSEMS_MAX) || ksem_dead) { + mtx_unlock(&ksem_count_lock); + return (NULL); } - mtx_lock(&sem_lock); - LIST_INSERT_HEAD(&ksem_head, ks, ks_entry); - ks->ks_onlist = 1; - mtx_unlock(&sem_lock); - return (error); + nsems++; + mtx_unlock(&ksem_count_lock); + ks = malloc(sizeof(*ks), M_KSEM, M_WAITOK | M_ZERO); + ks->ks_uid = ucred->cr_uid; + ks->ks_gid = ucred->cr_gid; + ks->ks_mode = mode; + ks->ks_value = value; + cv_init(&ks->ks_cv, "ksem"); + vfs_timestamp(&ks->ks_birthtime); + ks->ks_atime = ks->ks_mtime = ks->ks_ctime = ks->ks_birthtime; + refcount_init(&ks->ks_ref, 1); +#ifdef MAC + mac_init_posix_sem(ks); + mac_create_posix_sem(ucred, ks); +#endif + + return (ks); } -#ifndef _SYS_SYSPROTO_H_ -struct ksem_open_args { - char *name; - int oflag; - mode_t mode; - unsigned int value; - semid_t *idp; -}; -int ksem_open(struct thread *td, struct ksem_open_args *uap); +static struct ksem * +ksem_hold(struct ksem *ks) +{ + + refcount_acquire(&ks->ks_ref); + return (ks); +} + +static void +ksem_drop(struct ksem *ks) +{ + + if (refcount_release(&ks->ks_ref)) { +#ifdef MAC + mac_destroy_posix_sem(ks); #endif -int -ksem_open(struct thread *td, struct ksem_open_args *uap) + cv_destroy(&ks->ks_cv); + free(ks, M_KSEM); + mtx_lock(&ksem_count_lock); + nsems--; + mtx_unlock(&ksem_count_lock); + } +} + +/* + * Determine if the credentials have sufficient permissions for read + * and write access. + */ +static int +ksem_access(struct ksem *ks, struct ucred *ucred) { - char name[SEM_MAX_NAMELEN + 1]; - size_t done; int error; - error = copyinstr(uap->name, name, SEM_MAX_NAMELEN + 1, &done); + error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, + VREAD | VWRITE, ucred, NULL); if (error) - return (error); - DP((">>> sem_open start\n")); - error = kern_sem_open(td, UIO_USERSPACE, - name, uap->oflag, uap->mode, uap->value, uap->idp); - DP(("<<< sem_open end\n")); + error = priv_check_cred(ucred, PRIV_SEM_WRITE, 0); return (error); } -static int -kern_sem_open(struct thread *td, int dir, const char *name, int oflag, - mode_t mode, unsigned int value, semid_t *idp) +/* + * Dictionary management. We maintain an in-kernel dictionary to map + * paths to semaphore objects. We use the FNV hash on the path to + * store the mappings in a hash table. + */ +static struct ksem * +ksem_lookup(char *path, Fnv32_t fnv) { - struct ksem *ksnew, *ks; - int error; - semid_t id; - - ksnew = NULL; - mtx_lock(&sem_lock); - ks = sem_lookup_byname(name); + struct ksem_mapping *map; - /* - * If we found it but O_EXCL is set, error. - */ - if (ks != NULL && (oflag & O_EXCL) != 0) { - mtx_unlock(&sem_lock); - return (EEXIST); + LIST_FOREACH(map, KSEM_HASH(fnv), km_link) { + if (map->km_fnv != fnv) + continue; + if (strcmp(map->km_path, path) == 0) + return (map->km_ksem); } - /* - * If we didn't find it... - */ - if (ks == NULL) { - /* - * didn't ask for creation? error. - */ - if ((oflag & O_CREAT) == 0) { - mtx_unlock(&sem_lock); - return (ENOENT); - } + return (NULL); +} - /* - * We may block during creation, so drop the lock. - */ - mtx_unlock(&sem_lock); - error = sem_create(td, name, &ksnew, mode, value); - if (error != 0) - return (error); - id = SEM_TO_ID(ksnew); - if (dir == UIO_USERSPACE) { - DP(("about to copyout! %d to %p\n", id, idp)); - error = copyout(&id, idp, sizeof(id)); - if (error) { - mtx_lock(&sem_lock); - sem_leave(td->td_proc, ksnew); - sem_rel(ksnew); - mtx_unlock(&sem_lock); - return (error); - } - } else { - DP(("about to set! %d to %p\n", id, idp)); - *idp = id; - } +static void +ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks) +{ + struct ksem_mapping *map; - /* - * We need to make sure we haven't lost a race while - * allocating during creation. - */ - mtx_lock(&sem_lock); - ks = sem_lookup_byname(name); - if (ks != NULL) { - /* we lost... */ - sem_leave(td->td_proc, ksnew); - sem_rel(ksnew); - /* we lost and we can't loose... */ - if ((oflag & O_EXCL) != 0) { - mtx_unlock(&sem_lock); - return (EEXIST); - } - } else { - DP(("sem_create: about to add to list...\n")); - LIST_INSERT_HEAD(&ksem_head, ksnew, ks_entry); - DP(("sem_create: setting list bit...\n")); - ksnew->ks_onlist = 1; - DP(("sem_create: done, about to unlock...\n")); - } - } else { + map = malloc(sizeof(struct ksem_mapping), M_KSEM, M_WAITOK); + map->km_path = path; + map->km_fnv = fnv; + map->km_ksem = ksem_hold(ks); + LIST_INSERT_HEAD(KSEM_HASH(fnv), map, km_link); +} + +static int +ksem_remove(char *path, Fnv32_t fnv, struct ucred *ucred) +{ + struct ksem_mapping *map; + int error; + + LIST_FOREACH(map, KSEM_HASH(fnv), km_link) { + if (map->km_fnv != fnv) + continue; + if (strcmp(map->km_path, path) == 0) { #ifdef MAC - error = mac_check_posix_sem_open(td->td_ucred, ks); - if (error) - goto err_open; + error = mac_check_posix_sem_unlink(ucred, map->km_ksem); + if (error) + return (error); #endif - /* - * if we aren't the creator, then enforce permissions. - */ - error = sem_perm(td, ks); - if (error) - goto err_open; - sem_ref(ks); - mtx_unlock(&sem_lock); - id = SEM_TO_ID(ks); - if (dir == UIO_USERSPACE) { - error = copyout(&id, idp, sizeof(id)); - if (error) { - mtx_lock(&sem_lock); - sem_rel(ks); - mtx_unlock(&sem_lock); + error = ksem_access(map->km_ksem, ucred); + if (error) return (error); - } - } else { - *idp = id; + LIST_REMOVE(map, km_link); + ksem_drop(map->km_ksem); + free(map->km_path, M_KSEM); + free(map, M_KSEM); + return (0); } - sem_enter(td->td_proc, ks); - mtx_lock(&sem_lock); - sem_rel(ks); } -err_open: - mtx_unlock(&sem_lock); - return (error); + + return (ENOENT); } +/* Other helper routines. */ static int -sem_perm(struct thread *td, struct ksem *ks) +ksem_create(struct thread *td, const char *name, semid_t *semidp, mode_t mode, + unsigned int value, int flags) { - struct ucred *uc; + struct filedesc *fdp; + struct ksem *ks; + struct file *fp; + char *path; + semid_t semid; + Fnv32_t fnv; + int error, fd; + + if (value > SEM_VALUE_MAX) + return (EINVAL); + + fdp = td->td_proc->p_fd; + mode = (mode & ~fdp->fd_cmask) & ACCESSPERMS; + error = falloc(td, &fp, &fd); + if (error) { + if (name == NULL) + error = ENOSPC; + return (error); + } /* - * XXXRW: This permission routine appears to be incorrect. If the - * user matches, we shouldn't go on to the group if the user - * permissions don't allow the action? Not changed for now. To fix, - * change from a series of if (); if (); to if () else if () else... + * Go ahead and copyout the file descriptor now. This is a bit + * premature, but it is a lot easier to handle errors as opposed + * to later when we've possibly created a new semaphore, etc. */ - uc = td->td_ucred; - DP(("sem_perm: uc(%d,%d) ks(%d,%d,%o)\n", - uc->cr_uid, uc->cr_gid, - ks->ks_uid, ks->ks_gid, ks->ks_mode)); - if ((uc->cr_uid == ks->ks_uid) && (ks->ks_mode & S_IWUSR) != 0) - return (0); - if ((uc->cr_gid == ks->ks_gid) && (ks->ks_mode & S_IWGRP) != 0) - return (0); - if ((ks->ks_mode & S_IWOTH) != 0) - return (0); - return (priv_check(td, PRIV_SEM_WRITE)); -} + semid = fd; + error = copyout(&semid, semidp, sizeof(semid)); + if (error) { + fdclose(fdp, fp, fd, td); + fdrop(fp, td); + return (error); + } -static void -sem_free(struct ksem *ks) -{ + if (name == NULL) { + /* Create an anonymous semaphore. */ + ks = ksem_alloc(td->td_ucred, mode, value); + if (ks == NULL) + error = ENOSPC; + else + ks->ks_flags |= KS_ANONYMOUS; + } else { + path = malloc(MAXPATHLEN, M_KSEM, M_WAITOK); + error = copyinstr(name, path, MAXPATHLEN, NULL); + + /* Require paths to start with a '/' character. */ + if (error == 0 && path[0] != '/') + error = EINVAL; + if (error) { + fdclose(fdp, fp, fd, td); + fdrop(fp, td); + free(path, M_KSEM); + return (error); + } + fnv = fnv_32_str(path, FNV1_32_INIT); + sx_xlock(&ksem_dict_lock); + ks = ksem_lookup(path, fnv); + if (ks == NULL) { + /* Object does not exist, create it if requested. */ + if (flags & O_CREAT) { + ks = ksem_alloc(td->td_ucred, mode, value); + if (ks == NULL) + error = ENFILE; + else { + ksem_insert(path, fnv, ks); + path = NULL; + } + } else + error = ENOENT; + } else { + /* + * Object already exists, obtain a new + * reference if requested and permitted. + */ + if ((flags & (O_CREAT | O_EXCL)) == + (O_CREAT | O_EXCL)) + error = EEXIST; + else { #ifdef MAC - mac_destroy_posix_sem(ks); + error = mac_check_posix_sem_open(td->td_ucred, + ks); + if (error == 0) #endif - nsems--; - if (ks->ks_onlist) - LIST_REMOVE(ks, ks_entry); - if (ks->ks_name != NULL) - free(ks->ks_name, M_SEM); - cv_destroy(&ks->ks_cv); - free(ks, M_SEM); -} + error = ksem_access(ks, td->td_ucred); + } + if (error == 0) + ksem_hold(ks); +#ifdef INVARIANTS + else + ks = NULL; +#endif + } + sx_xunlock(&ksem_dict_lock); + if (path) + free(path, M_KSEM); + } -static __inline struct kuser * -sem_getuser(struct proc *p, struct ksem *ks) -{ - struct kuser *k; + if (error) { + KASSERT(ks == NULL, ("ksem_create error with a ksem")); + fdclose(fdp, fp, fd, td); + fdrop(fp, td); + return (error); + } + KASSERT(ks != NULL, ("ksem_create w/o a ksem")); - LIST_FOREACH(k, &ks->ks_users, ku_next) - if (k->ku_pid == p->p_pid) - return (k); - return (NULL); -} + fp->f_data = ks; + fp->f_flag = FREAD | FWRITE; + fp->f_type = DTYPE_SEM; + fp->f_ops = &ksem_ops; -static int -sem_hasopen(struct thread *td, struct ksem *ks) -{ - - return ((ks->ks_name == NULL && sem_perm(td, ks) == 0) - || sem_getuser(td->td_proc, ks) != NULL); + FILEDESC_XLOCK(fdp); + if (fdp->fd_ofiles[fd] == fp) + fdp->fd_ofileflags[fd] |= UF_EXCLOSE; + FILEDESC_XUNLOCK(fdp); + fdrop(fp, td); + + return (0); } static int -sem_leave(struct proc *p, struct ksem *ks) +ksem_get(struct thread *td, semid_t id, struct file **fpp) { - struct kuser *k; + struct ksem *ks; + struct file *fp; + int error; - DP(("sem_leave: ks = %p\n", ks)); - k = sem_getuser(p, ks); - DP(("sem_leave: ks = %p, k = %p\n", ks, k)); - if (k != NULL) { - LIST_REMOVE(k, ku_next); - sem_rel(ks); - DP(("sem_leave: about to free k\n")); - free(k, M_SEM); - DP(("sem_leave: returning\n")); - return (0); + error = fget(td, id, &fp); + if (error) + return (EINVAL); + if (fp->f_type != DTYPE_SEM) { + fdrop(fp, td); + return (EINVAL); } - return (EINVAL); + ks = fp->f_data; + if (ks->ks_flags & KS_DEAD) { + fdrop(fp, td); + return (EINVAL); + } + *fpp = fp; + return (0); } -static void -sem_enter(struct proc *p, struct ksem *ks) +/* System calls. */ +#ifndef _SYS_SYSPROTO_H_ +struct ksem_init_args { + unsigned int value; + semid_t *idp; +}; +#endif +int +ksem_init(struct thread *td, struct ksem_init_args *uap) { - struct kuser *ku, *k; - ku = malloc(sizeof(*ku), M_SEM, M_WAITOK); - ku->ku_pid = p->p_pid; - mtx_lock(&sem_lock); - k = sem_getuser(p, ks); - if (k != NULL) { - mtx_unlock(&sem_lock); - free(ku, M_TEMP); - return; - } - LIST_INSERT_HEAD(&ks->ks_users, ku, ku_next); - sem_ref(ks); - mtx_unlock(&sem_lock); + return (ksem_create(td, NULL, uap->idp, S_IRWXU | S_IRWXG, uap->value, + 0)); } #ifndef _SYS_SYSPROTO_H_ -struct ksem_unlink_args { - char *name; +struct ksem_open_args { + char *name; + int oflag; + mode_t mode; + unsigned int value; + semid_t *idp; }; -int ksem_unlink(struct thread *td, struct ksem_unlink_args *uap); #endif int -ksem_unlink(struct thread *td, struct ksem_unlink_args *uap) +ksem_open(struct thread *td, struct ksem_open_args *uap) { - char name[SEM_MAX_NAMELEN + 1]; - size_t done; - int error; - error = copyinstr(uap->name, name, SEM_MAX_NAMELEN + 1, &done); - return (error ? error : - kern_sem_unlink(td, name)); + if ((uap->oflag & ~(O_CREAT | O_EXCL)) != 0) + return (EINVAL); + return (ksem_create(td, uap->name, uap->idp, uap->mode, uap->value, + uap->oflag)); } -static int -kern_sem_unlink(struct thread *td, const char *name) +#ifndef _SYS_SYSPROTO_H_ +struct ksem_unlink_args { + char *name; +}; +#endif +int +ksem_unlink(struct thread *td, struct ksem_unlink_args *uap) { - struct ksem *ks; + char *path; + Fnv32_t fnv; int error; - mtx_lock(&sem_lock); - ks = sem_lookup_byname(name); - if (ks != NULL) { -#ifdef MAC - error = mac_check_posix_sem_unlink(td->td_ucred, ks); - if (error) { - mtx_unlock(&sem_lock); - return (error); - } -#endif - error = sem_perm(td, ks); - } else - error = ENOENT; - DP(("sem_unlink: '%s' ks = %p, error = %d\n", name, ks, error)); - if (error == 0) { - LIST_REMOVE(ks, ks_entry); - LIST_INSERT_HEAD(&ksem_deadhead, ks, ks_entry); - sem_rel(ks); + path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + error = copyinstr(uap->name, path, MAXPATHLEN, NULL); + if (error) { + free(path, M_TEMP); + return (error); } - mtx_unlock(&sem_lock); + + fnv = fnv_32_str(path, FNV1_32_INIT); + sx_xlock(&ksem_dict_lock); + error = ksem_remove(path, fnv, td->td_ucred); + sx_xunlock(&ksem_dict_lock); + free(path, M_TEMP); + return (error); } #ifndef _SYS_SYSPROTO_H_ struct ksem_close_args { - semid_t id; + semid_t id; }; -int ksem_close(struct thread *td, struct ksem_close_args *uap); #endif int ksem_close(struct thread *td, struct ksem_close_args *uap) { - - return (kern_sem_close(td, uap->id)); -} - -static int -kern_sem_close(struct thread *td, semid_t id) -{ struct ksem *ks; + struct file *fp; int error; - error = EINVAL; - mtx_lock(&sem_lock); - ks = ID_TO_SEM(id); - - /* - * This is not a valid operation for unnamed sems. - */ - if (ks != NULL && ks->ks_name != NULL) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 20:22:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A3210656CE; Tue, 17 Feb 2009 20:22:58 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 34ACA8FC20; Tue, 17 Feb 2009 20:22:58 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 8FDC01E8C07; Tue, 17 Feb 2009 20:22:57 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 7467D5C19; Tue, 17 Feb 2009 21:22:57 +0100 (CET) Date: Tue, 17 Feb 2009 21:22:57 +0100 From: "Simon L. Nielsen" To: Michael Reifenberger Message-ID: <20090217202256.GA1091@arthur.nitro.dk> References: <200902111215.n1BCFZUh025391@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902111215.n1BCFZUh025391@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: r188482 - in head/tools/tools/nanobsd/rescue: . Files Files/conf Files/etc Files/etc/ssh Files/root Files/usr Files/usr/ports Pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 20:22:59 -0000 On 2009.02.11 12:15:35 +0000, Michael Reifenberger wrote: > Author: mr > Date: Wed Feb 11 12:15:35 2009 > New Revision: 188482 > URL: http://svn.freebsd.org/changeset/base/188482 > > Log: > Add files to build i386/amd64 bootable rescue ISO images using the > nanobsd framework. Hmm, why do you duplicate the scripts already in nanobsd/Files/root etc. ? Just because it was simpler instead of taking files from multiple directories, or? -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 20:30:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82DBF1065673; Tue, 17 Feb 2009 20:30:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3AB8FC24; Tue, 17 Feb 2009 20:30:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HKUHlC026873; Tue, 17 Feb 2009 20:30:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HKUHhC026872; Tue, 17 Feb 2009 20:30:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200902172030.n1HKUHhC026872@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 17 Feb 2009 20:30: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: r188728 - head/sbin/geom/class/journal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 20:30:19 -0000 Author: pjd Date: Tue Feb 17 20:30:17 2009 New Revision: 188728 URL: http://svn.freebsd.org/changeset/base/188728 Log: Document kern.geom.journal.* sysctls. PR: docs/130548 Submitted by: Hywel Mallett MFC after: 1 week Modified: head/sbin/geom/class/journal/gjournal.8 Modified: head/sbin/geom/class/journal/gjournal.8 ============================================================================== --- head/sbin/geom/class/journal/gjournal.8 Tue Feb 17 19:57:52 2009 (r188727) +++ head/sbin/geom/class/journal/gjournal.8 Tue Feb 17 20:30:17 2009 (r188728) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006-2007 Pawel Jakub Dawidek +.\" Copyright (c) 2006-2009 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2008 +.Dd February 17, 2008 .Dt GJOURNAL 8 .Os .Sh NAME @@ -223,6 +223,106 @@ gjournal label da0s1d da0s1e && \e mount -o async /dev/da0s1d.journal /mnt || \e mount /dev/da0s1d /mnt .Ed +.Sh SYSCTLS +Gjournal adds the sysctl level kern.geom.journal. +The string and integer information available is detailed below. +The changeable column shows whether a process with appropriate privilege may +change the value. +.Bl -column "accept_immediatelyXXXXXX" integerXXX -offset indent +.It Sy "sysctl name Type Changeable" +.It "debug integer yes" +.It "switch_time integer yes" +.It "force_switch integer yes" +.It "parallel_flushes integer yes" +.It "accept_immediately integer yes" +.It "parallel_copies integer yes" +.It "record_entries integer yes" +.It "optimize integer yes" +.El +.Pp +.Bl -tag -width 6n +.It Li debug +Setting a non-zero value enables debugging at various levels. +Debug level 1 will record actions at a journal level, relating to journal +switches, metadata updates etc. +Debug level 2 will record actions at a higher level, relating to the numbers of +entries in journals, access requests etc. +Debug level 3 will record verbose detail, including insertion of I/Os to the +journal. +.It Li switch_time +The maximum number of seconds a journal is allowed to remain open before +switching to a new journal. +.It Li force_switch +Force a journal switch when the journal uses more than N% of the free journal space. +.It Li parallel_flushes +The number of flush I/O requests to be sent in parallel when flushing the journal to the data provider. +.It Li accept_immediately +The maximum number of I/O requests accepted at the same time. +.It Li parallel_copies +The number of copy I/O requests to send in parallel. +.It Li record_entries +The maximum number of record entries to allow in a single journal. +.It Li optimize +Controls whether entries in a journal will be optimized, by combining overlapping I/Os into a single I/O, and reordering the entries in a journal. This can be disabled by setting the sysctl to 0. +.El +.Ss cache +The string and integer information available for the cache level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "alloc_failuresXXXXXX" integerXXX -offset indent +.It Sy "sysctl name Type Changeable" +.It "used integer no" +.It "limit integer yes" +.It "divisor integer no" +.It "switch integer yes" +.It "misses integer yes" +.It "alloc_failures integer yes" +.El +.Pp +.Bl -tag -width 6n +.It Li used +The number of bytes currently allocated to the cache. +.It Li limit +The maximum number of bytes to be allocated to the cache. +.It Li divisor +Sets the cache size to be used as a proportion of kmem_size. A value of 2 (the default) will cause the cache size to be set to 1/2 of the kmem_size. +.It Li switch +Force a journal switch when this percentage of cache has been used. +.It Li misses +The number of cache misses, when data has been read, but was not found in the cache. +.It Li alloc_failures +The number of times memory failed to be allocated to the cache because the cache limit was hit. +.El +.Ss stats +The string and integer information available for the statistics level +is detailed below. +The changeable column shows whether a process with appropriate +privilege may change the value. +.Bl -column "skipped_bytesXXXXXX" integerXXX -offset indent +.It Sy "sysctl name Type Changeable" +.It "skipped_bytes integer yes" +.It "combined_ios integer yes" +.It "switches integer yes" +.It "wait_for_copy integer yes" +.It "journal_full integer yes" +.It "low_mem integer yes" +.El +.Pp +.Bl -tag -width 6n +.It Li skipped_bytes +The number of bytes skipped. +.It Li combined_ios +The number of I/Os which were combined by journal optimization. +.It Li switches +The number of journal switches. +.It Li wait_for_copy +The number of times the journal switch process had to wait for the previous journal copy to complete. +.It Li journal_full +The number of times the journal was almost full, forcing a journal switch. +.It Li low_mem +The number of times the low_mem hook was called. +.El .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , @@ -237,7 +337,3 @@ utility appeared in .Fx 7.0 . .Sh AUTHORS .An Pawel Jakub Dawidek Aq pjd@FreeBSD.org -.Sh BUGS -Documentation for sysctls -.Va kern.geom.journal.* -is missing. From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 20:35:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9741065690; Tue, 17 Feb 2009 20:35:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8634E8FC17; Tue, 17 Feb 2009 20:35:11 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HKZBME027041; Tue, 17 Feb 2009 20:35:11 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HKZBDS027040; Tue, 17 Feb 2009 20:35:11 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200902172035.n1HKZBDS027040@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 17 Feb 2009 20:35: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: r188729 - head/sbin/geom/class/journal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 20:35:13 -0000 Author: pjd Date: Tue Feb 17 20:35:11 2009 New Revision: 188729 URL: http://svn.freebsd.org/changeset/base/188729 Log: Correct the year. Reported by: Florian Smeets Modified: head/sbin/geom/class/journal/gjournal.8 Modified: head/sbin/geom/class/journal/gjournal.8 ============================================================================== --- head/sbin/geom/class/journal/gjournal.8 Tue Feb 17 20:30:17 2009 (r188728) +++ head/sbin/geom/class/journal/gjournal.8 Tue Feb 17 20:35:11 2009 (r188729) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 17, 2008 +.Dd February 17, 2009 .Dt GJOURNAL 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:02:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C121F10656C6; Tue, 17 Feb 2009 21:02:35 +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 B69FE8FC0A; Tue, 17 Feb 2009 21:02:35 +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 n1HL2ZUN027564; Tue, 17 Feb 2009 21:02:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HL2ZZJ027560; Tue, 17 Feb 2009 21:02:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902172102.n1HL2ZZJ027560@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 21:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188730 - in stable/7: share/man/man9 sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:02:38 -0000 Author: jhb Date: Tue Feb 17 21:02:35 2009 New Revision: 188730 URL: http://svn.freebsd.org/changeset/base/188730 Log: MFC: Permit Giant to be passed as the explicit interlock either to msleep/mtx_sleep or the various cv_*wait*() routines. Modified: stable/7/share/man/man9/ (props changed) stable/7/share/man/man9/condvar.9 stable/7/share/man/man9/sleep.9 stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_condvar.c stable/7/sys/kern/kern_synch.c Modified: stable/7/share/man/man9/condvar.9 ============================================================================== --- stable/7/share/man/man9/condvar.9 Tue Feb 17 20:35:11 2009 (r188729) +++ stable/7/share/man/man9/condvar.9 Tue Feb 17 21:02:35 2009 (r188730) @@ -136,9 +136,27 @@ When a thread waits on a condition, .Fa lock is atomically released before the thread is blocked, then reacquired before the function call returns. +In addition, the thread will fully drop the +.Va Giant +mutex +(even if recursed) +while the it is suspended and will reacquire the +.Va Giant +mutex before the function returns. The .Fn cv_wait_unlock function does not reacquire the lock before returning. +Note that the +.Va Giant +mutex may be specified as +.Fa lock . +However, +.Va Giant +may not be used as +.Fa lock +for the +.Fn cv_wait_unlock +function. All waiters must pass the same .Fa lock in conjunction with Modified: stable/7/share/man/man9/sleep.9 ============================================================================== --- stable/7/share/man/man9/sleep.9 Tue Feb 17 20:35:11 2009 (r188729) +++ stable/7/share/man/man9/sleep.9 Tue Feb 17 21:02:35 2009 (r188730) @@ -153,6 +153,12 @@ mutex while the thread is suspended and will reacquire the .Va Giant mutex before the function returns. +Note that the +.Va Giant +mutex may be specified as the lock to drop. +In that case, however, the +.Dv PDROP +flag is not allowed. .Pp To avoid lost wakeups, either a lock should be used to protect against races, Modified: stable/7/sys/kern/kern_condvar.c ============================================================================== --- stable/7/sys/kern/kern_condvar.c Tue Feb 17 20:35:11 2009 (r188729) +++ stable/7/sys/kern/kern_condvar.c Tue Feb 17 21:02:35 2009 (r188730) @@ -100,6 +100,7 @@ _cv_wait(struct cv *cvp, struct lock_obj int lock_state; td = curthread; + lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0); @@ -126,11 +127,13 @@ _cv_wait(struct cv *cvp, struct lock_obj DROP_GIANT(); sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_release(cvp); - lock_state = class->lc_unlock(lock); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_lock(cvp); + if (lock != &Giant.lock_object) { + if (class->lc_flags & LC_SLEEPABLE) + sleepq_release(cvp); + lock_state = class->lc_unlock(lock); + if (class->lc_flags & LC_SLEEPABLE) + sleepq_lock(cvp); + } sleepq_wait(cvp); #ifdef KTRACE @@ -138,8 +141,10 @@ _cv_wait(struct cv *cvp, struct lock_obj ktrcsw(0, 0); #endif PICKUP_GIANT(); - class->lc_lock(lock, lock_state); - WITNESS_RESTORE(lock, lock_witness); + if (lock != &Giant.lock_object) { + class->lc_lock(lock, lock_state); + WITNESS_RESTORE(lock, lock_witness); + } } /* @@ -160,6 +165,8 @@ _cv_wait_unlock(struct cv *cvp, struct l CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Waiting on \"%s\"", cvp->cv_description); + KASSERT(lock != &Giant.lock_object, + ("cv_wait_unlock cannot be used with Giant")); class = LOCK_CLASS(lock); if (cold || panicstr) { @@ -210,6 +217,7 @@ _cv_wait_sig(struct cv *cvp, struct lock td = curthread; p = td->td_proc; + lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0); @@ -237,11 +245,13 @@ _cv_wait_sig(struct cv *cvp, struct lock sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE, 0); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_release(cvp); - lock_state = class->lc_unlock(lock); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_lock(cvp); + if (lock != &Giant.lock_object) { + if (class->lc_flags & LC_SLEEPABLE) + sleepq_release(cvp); + lock_state = class->lc_unlock(lock); + if (class->lc_flags & LC_SLEEPABLE) + sleepq_lock(cvp); + } rval = sleepq_wait_sig(cvp); #ifdef KTRACE @@ -249,8 +259,10 @@ _cv_wait_sig(struct cv *cvp, struct lock ktrcsw(0, 0); #endif PICKUP_GIANT(); - class->lc_lock(lock, lock_state); - WITNESS_RESTORE(lock, lock_witness); + if (lock != &Giant.lock_object) { + class->lc_lock(lock, lock_state); + WITNESS_RESTORE(lock, lock_witness); + } return (rval); } @@ -270,6 +282,7 @@ _cv_timedwait(struct cv *cvp, struct loc td = curthread; rval = 0; + lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0); @@ -297,11 +310,13 @@ _cv_timedwait(struct cv *cvp, struct loc sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); sleepq_set_timeout(cvp, timo); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_release(cvp); - lock_state = class->lc_unlock(lock); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_lock(cvp); + if (lock != &Giant.lock_object) { + if (class->lc_flags & LC_SLEEPABLE) + sleepq_release(cvp); + lock_state = class->lc_unlock(lock); + if (class->lc_flags & LC_SLEEPABLE) + sleepq_lock(cvp); + } rval = sleepq_timedwait(cvp); #ifdef KTRACE @@ -309,8 +324,10 @@ _cv_timedwait(struct cv *cvp, struct loc ktrcsw(0, 0); #endif PICKUP_GIANT(); - class->lc_lock(lock, lock_state); - WITNESS_RESTORE(lock, lock_witness); + if (lock != &Giant.lock_object) { + class->lc_lock(lock, lock_state); + WITNESS_RESTORE(lock, lock_witness); + } return (rval); } @@ -333,6 +350,7 @@ _cv_timedwait_sig(struct cv *cvp, struct td = curthread; p = td->td_proc; rval = 0; + lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(1, 0); @@ -361,11 +379,13 @@ _cv_timedwait_sig(struct cv *cvp, struct sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR | SLEEPQ_INTERRUPTIBLE, 0); sleepq_set_timeout(cvp, timo); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_release(cvp); - lock_state = class->lc_unlock(lock); - if (class->lc_flags & LC_SLEEPABLE) - sleepq_lock(cvp); + if (lock != &Giant.lock_object) { + if (class->lc_flags & LC_SLEEPABLE) + sleepq_release(cvp); + lock_state = class->lc_unlock(lock); + if (class->lc_flags & LC_SLEEPABLE) + sleepq_lock(cvp); + } rval = sleepq_timedwait_sig(cvp); #ifdef KTRACE @@ -373,8 +393,10 @@ _cv_timedwait_sig(struct cv *cvp, struct ktrcsw(0, 0); #endif PICKUP_GIANT(); - class->lc_lock(lock, lock_state); - WITNESS_RESTORE(lock, lock_witness); + if (lock != &Giant.lock_object) { + class->lc_lock(lock, lock_state); + WITNESS_RESTORE(lock, lock_witness); + } return (rval); } Modified: stable/7/sys/kern/kern_synch.c ============================================================================== --- stable/7/sys/kern/kern_synch.c Tue Feb 17 20:35:11 2009 (r188729) +++ stable/7/sys/kern/kern_synch.c Tue Feb 17 21:02:35 2009 (r188730) @@ -139,6 +139,9 @@ _sleep(void *ident, struct lock_object * ident == &lbolt, ("sleeping without a lock")); KASSERT(p != NULL, ("msleep1")); KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); + if (priority & PDROP) + KASSERT(lock != NULL && lock != &Giant.lock_object, + ("PDROP requires a non-Giant lock")); if (lock != NULL) class = LOCK_CLASS(lock); else @@ -180,7 +183,8 @@ _sleep(void *ident, struct lock_object * td->td_tid, p->p_pid, p->p_comm, wmesg, ident); DROP_GIANT(); - if (lock != NULL && !(class->lc_flags & LC_SLEEPABLE)) { + if (lock != NULL && lock != &Giant.lock_object && + !(class->lc_flags & LC_SLEEPABLE)) { WITNESS_SAVE(lock, lock_witness); lock_state = class->lc_unlock(lock); } else @@ -231,7 +235,7 @@ _sleep(void *ident, struct lock_object * ktrcsw(0, 0); #endif PICKUP_GIANT(); - if (lock != NULL && !(priority & PDROP)) { + if (lock != NULL && lock != &Giant.lock_object && !(priority & PDROP)) { class->lc_lock(lock, lock_state); WITNESS_RESTORE(lock, lock_witness); } From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:06:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB95106564A for ; Tue, 17 Feb 2009 21:06:21 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-bw0-f170.google.com (mail-bw0-f170.google.com [209.85.218.170]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9358FC0C for ; Tue, 17 Feb 2009 21:06:20 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by bwz18 with SMTP id 18so5554823bwz.19 for ; Tue, 17 Feb 2009 13:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mWensWHrBeRfDD5V8VayxAk5piWDBr9z258kzuKn2ns=; b=pePmp9Szkpjq9e3FtLC8OysFSWrmTonZqwev+HlUTeTnYooqZJ71GF64kXLz9vJlg7 NvRFJWVYDAnWh0NzaeFdqCKvwUXeaZegY9vzwsQYVJ2i2dttQ9TRfL67LjRyD7XQJtIV 1k8j+zLjSSM89sedkD4Bd5KAS2oAoYZguB+5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bQn2yN0MzZt+PBgyvP1cVQMb8OpC0BAJEoCRbwX1x9QBVFvWJpaslLhnJ7GONTwrST R3mBWCFK0xueEXmiARrREMbnUIHXt8+Zv+0OKYReO0V9A9tBfUXAP5/8q8JImmcmw5re ktNXjTIce9/b0FXSUnXsrvqFJ5rCyWLYWeHvk= MIME-Version: 1.0 Received: by 10.103.11.5 with SMTP id o5mr405168mui.132.1234903546065; Tue, 17 Feb 2009 12:45:46 -0800 (PST) In-Reply-To: <200902161859.n1GIxIeL083401@svn.freebsd.org> References: <200902161859.n1GIxIeL083401@svn.freebsd.org> Date: Tue, 17 Feb 2009 17:45:45 -0300 Message-ID: From: "Carlos A. M. dos Santos" To: Andrew Thompson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188693 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:06:22 -0000 On Mon, Feb 16, 2009 at 3:59 PM, Andrew Thompson wrote: > Author: thompsa > Date: Mon Feb 16 18:59:18 2009 > New Revision: 188693 > URL: http://svn.freebsd.org/changeset/base/188693 > > Log: > Add an entry for xorg+hal+USB2 not detecting input devices. > > Modified: > head/UPDATING > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Mon Feb 16 18:51:34 2009 (r188692) > +++ head/UPDATING Mon Feb 16 18:59:18 2009 (r188693) > @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > to maximize performance. (To disable malloc debugging, run > ln -s aj /etc/malloc.conf.) > > +20090216: > + xorg 7.4 wants to configure its input devices via hald which does not > + yet work with USB2. If the keyboard/mouse does not work in xorg then > + add > + Option "AllowEmptyInput" "off" > + to your ServerLayout section. This will cause X to use the configured > + kbd and mouse sections from your xorg.conf > + > 20090215: Suggestion: s/ServerLayout/ServerFlags/ I know that both are currently accepted by Xorg but the option is clearly a server flag, not related to layout. -- My preferred quotation of Robert Louis Stevenson is "You cannot make an omelette without breaking eggs". Not because I like the omelettes, but because I like the sound of eggs being broken. From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:17:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4958F106566B; Tue, 17 Feb 2009 21:17:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDC88FC1B; Tue, 17 Feb 2009 21:17:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLHMY2027890; Tue, 17 Feb 2009 21:17:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HLHLlY027887; Tue, 17 Feb 2009 21:17:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902172117.n1HLHLlY027887@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Feb 2009 21:17: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: r188731 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:17:23 -0000 Author: mav Date: Tue Feb 17 21:17:21 2009 New Revision: 188731 URL: http://svn.freebsd.org/changeset/base/188731 Log: ata_interrupt() does not need to return anything. It is not it's business to report request completion, expecially when it is not reliable. Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Tue Feb 17 21:02:35 2009 (r188730) +++ head/sys/dev/ata/ata-all.c Tue Feb 17 21:17:21 2009 (r188731) @@ -147,7 +147,7 @@ ata_attach(device_t dev) return ENXIO; } if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL, - (driver_intr_t *)ata_interrupt, ch, &ch->ih))) { + ata_interrupt, ch, &ch->ih))) { device_printf(dev, "unable to setup interrupt\n"); return error; } @@ -319,7 +319,7 @@ ata_resume(device_t dev) return error; } -int +void ata_interrupt(void *data) { struct ata_channel *ch = (struct ata_channel *)data; @@ -354,11 +354,11 @@ ata_interrupt(void *data) mtx_unlock(&ch->state_mtx); ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); - return 1; + return; } } while (0); mtx_unlock(&ch->state_mtx); - return 0; + return; } /* Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Tue Feb 17 21:02:35 2009 (r188730) +++ head/sys/dev/ata/ata-all.h Tue Feb 17 21:17:21 2009 (r188731) @@ -554,7 +554,7 @@ int ata_detach(device_t dev); int ata_reinit(device_t dev); int ata_suspend(device_t dev); int ata_resume(device_t dev); -int ata_interrupt(void *data); +void ata_interrupt(void *data); int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data); int ata_getparam(struct ata_device *atadev, int init); int ata_identify(device_t dev); Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Tue Feb 17 21:02:35 2009 (r188730) +++ head/sys/dev/ata/ata-queue.c Tue Feb 17 21:17:21 2009 (r188731) @@ -214,8 +214,10 @@ ata_start(device_t dev) if (dumping) { mtx_unlock(&ch->state_mtx); mtx_unlock(&ch->queue_mtx); - while (!ata_interrupt(ch) && ch->running) + while (ch->running) { + ata_interrupt(ch); DELAY(10); + } return; } } From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:29:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8223F1065675; Tue, 17 Feb 2009 21:29:39 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 703348FC17; Tue, 17 Feb 2009 21:29:39 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLTddQ028150; Tue, 17 Feb 2009 21:29:39 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HLTdhN028149; Tue, 17 Feb 2009 21:29:39 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200902172129.n1HLTdhN028149@svn.freebsd.org> From: Jamie Gritton Date: Tue, 17 Feb 2009 21:29: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: r188732 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:29:40 -0000 Author: jamie Date: Tue Feb 17 21:29:39 2009 New Revision: 188732 URL: http://svn.freebsd.org/changeset/base/188732 Log: Remove obsolete prison_service declarations. Approved by: bz (mentor) Modified: head/sys/sys/jail.h Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Tue Feb 17 21:17:21 2009 (r188731) +++ head/sys/sys/jail.h Tue Feb 17 21:29:39 2009 (r188732) @@ -195,21 +195,5 @@ int prison_check_af(struct ucred *cred, int prison_if(struct ucred *cred, struct sockaddr *sa); int prison_priv_check(struct ucred *cred, int priv); -/* - * Kernel jail services. - */ -struct prison_service; -typedef int (*prison_create_t)(struct prison_service *psrv, struct prison *pr); -typedef int (*prison_destroy_t)(struct prison_service *psrv, struct prison *pr); - -struct prison_service *prison_service_register(const char *name, - prison_create_t create, prison_destroy_t destroy); -void prison_service_deregister(struct prison_service *psrv); - -void prison_service_data_set(struct prison_service *psrv, struct prison *pr, - void *data); -void *prison_service_data_get(struct prison_service *psrv, struct prison *pr); -void *prison_service_data_del(struct prison_service *psrv, struct prison *pr); - #endif /* _KERNEL */ #endif /* !_SYS_JAIL_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:35:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D1081065676; Tue, 17 Feb 2009 21:35:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41EDE8FC13; Tue, 17 Feb 2009 21:35:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLZIaU028295; Tue, 17 Feb 2009 21:35:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HLZIcS028294; Tue, 17 Feb 2009 21:35:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902172135.n1HLZIcS028294@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Feb 2009 21:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188733 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:35:18 -0000 Author: mav Date: Tue Feb 17 21:35:17 2009 New Revision: 188733 URL: http://svn.freebsd.org/changeset/base/188733 Log: Remove useless return, that left from previous commit. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Tue Feb 17 21:29:39 2009 (r188732) +++ head/sys/dev/ata/ata-all.c Tue Feb 17 21:35:17 2009 (r188733) @@ -358,7 +358,6 @@ ata_interrupt(void *data) } } while (0); mtx_unlock(&ch->state_mtx); - return; } /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:35:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E50106568D; Tue, 17 Feb 2009 21:35:54 +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 651568FC1A; Tue, 17 Feb 2009 21:35:54 +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 n1HLZsJF028341; Tue, 17 Feb 2009 21:35:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HLZs40028338; Tue, 17 Feb 2009 21:35:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902172135.n1HLZs40028338@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 21:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188734 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:35:56 -0000 Author: jhb Date: Tue Feb 17 21:35:54 2009 New Revision: 188734 URL: http://svn.freebsd.org/changeset/base/188734 Log: MFC: Use shared vnode locks instead of exclusive vnode locks for the access(), chdir(), chroot(), eaccess(), fchdir(), fpathconf(), fstat(), fstatfs(), lseek() (when figuring out the current size of the file in the SEEK_END case), pathconf(), readlink(), and statfs() system calls. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_descrip.c stable/7/sys/kern/vfs_syscalls.c stable/7/sys/kern/vfs_vnops.c Modified: stable/7/sys/kern/kern_descrip.c ============================================================================== --- stable/7/sys/kern/kern_descrip.c Tue Feb 17 21:35:17 2009 (r188733) +++ stable/7/sys/kern/kern_descrip.c Tue Feb 17 21:35:54 2009 (r188734) @@ -1261,7 +1261,7 @@ fpathconf(struct thread *td, struct fpat if (vp != NULL) { int vfslocked; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_PATHCONF(vp, uap->name, td->td_retval); VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Tue Feb 17 21:35:17 2009 (r188733) +++ stable/7/sys/kern/vfs_syscalls.c Tue Feb 17 21:35:54 2009 (r188734) @@ -296,8 +296,8 @@ kern_statfs(struct thread *td, char *pat int error; struct nameidata nd; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, td); error = namei(&nd); if (error) return (error); @@ -378,7 +378,7 @@ kern_fstatfs(struct thread *td, int fd, return (error); vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); #ifdef AUDIT AUDIT_ARG(vnode, vp, ARG_VNODE1); #endif @@ -746,7 +746,7 @@ fchdir(td, uap) VREF(vp); fdrop(fp, td); vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, vp, ARG_VNODE1); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { @@ -754,7 +754,7 @@ fchdir(td, uap) if (vfs_busy(mp, 0, 0, td)) continue; tvfslocked = VFS_LOCK_GIANT(mp); - error = VFS_ROOT(mp, LK_EXCLUSIVE, &tdp, td); + error = VFS_ROOT(mp, LK_SHARED, &tdp, td); vfs_unbusy(mp, td); if (error) { VFS_UNLOCK_GIANT(tvfslocked); @@ -810,8 +810,8 @@ kern_chdir(struct thread *td, char *path struct vnode *vp; int vfslocked; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1 | MPSAFE, - pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | + MPSAFE, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); @@ -896,8 +896,8 @@ chroot(td, uap) error = priv_check(td, PRIV_VFS_CHROOT); if (error) return (error); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) goto error; @@ -1779,7 +1779,7 @@ lseek(td, uap) offset += fp->f_offset; break; case L_XTND: - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_GETATTR(vp, &vattr, cred, td); VOP_UNLOCK(vp, 0, td); if (error) @@ -1936,8 +1936,8 @@ kern_access(struct thread *td, char *pat tmpcred->cr_uid = cred->cr_ruid; tmpcred->cr_groups[0] = cred->cr_rgid; td->td_ucred = tmpcred; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) goto out1; vfslocked = NDHASGIANT(&nd); @@ -2308,8 +2308,8 @@ kern_pathconf(struct thread *td, char *p struct nameidata nd; int error, vfslocked; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); @@ -2360,8 +2360,8 @@ kern_readlink(struct thread *td, char *p struct nameidata nd; int vfslocked; - NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - pathseg, path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); Modified: stable/7/sys/kern/vfs_vnops.c ============================================================================== --- stable/7/sys/kern/vfs_vnops.c Tue Feb 17 21:35:17 2009 (r188733) +++ stable/7/sys/kern/vfs_vnops.c Tue Feb 17 21:35:54 2009 (r188734) @@ -610,7 +610,7 @@ vn_statfile(fp, sb, active_cred, td) int error; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); error = vn_stat(vp, sb, active_cred, fp->f_cred, td); VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 21:59:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80451065673; Tue, 17 Feb 2009 21:59:54 +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 8A2268FC08; Tue, 17 Feb 2009 21:59:54 +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 n1HLxstE028842; Tue, 17 Feb 2009 21:59:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HLxsdo028840; Tue, 17 Feb 2009 21:59:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902172159.n1HLxsdo028840@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 21:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188735 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:59:55 -0000 Author: jhb Date: Tue Feb 17 21:59:54 2009 New Revision: 188735 URL: http://svn.freebsd.org/changeset/base/188735 Log: MFC: Use shared vnode locks for auditing vnode arguments. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_syscalls.c stable/7/sys/security/audit/audit_arg.c Modified: stable/7/sys/kern/vfs_syscalls.c ============================================================================== --- stable/7/sys/kern/vfs_syscalls.c Tue Feb 17 21:35:54 2009 (r188734) +++ stable/7/sys/kern/vfs_syscalls.c Tue Feb 17 21:59:54 2009 (r188735) @@ -2525,7 +2525,7 @@ fchflags(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0, td); #endif @@ -2665,7 +2665,7 @@ fchmod(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0, td); #endif @@ -2822,7 +2822,7 @@ fchown(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0, td); #endif @@ -3035,7 +3035,7 @@ kern_futimes(struct thread *td, int fd, return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY, td); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0, td); #endif Modified: stable/7/sys/security/audit/audit_arg.c ============================================================================== --- stable/7/sys/security/audit/audit_arg.c Tue Feb 17 21:35:54 2009 (r188734) +++ stable/7/sys/security/audit/audit_arg.c Tue Feb 17 21:59:54 2009 (r188735) @@ -633,7 +633,7 @@ audit_arg_file(struct proc *p, struct fi */ vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + vn_lock(vp, LK_SHARED | LK_RETRY, curthread); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0, curthread); VFS_UNLOCK_GIANT(vfslocked); @@ -851,7 +851,7 @@ audit_sysclose(struct thread *td, int fd vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_SHARED | LK_RETRY, td); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 22:14:54 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2CEE106567C; Tue, 17 Feb 2009 22:14:54 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 51E518FC1F; Tue, 17 Feb 2009 22:14:54 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl126-61.kln.forthnet.gr [77.49.245.61]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-6) with ESMTP id n1HMEgDA022293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Feb 2009 00:14:47 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n1HMEgsS031386; Wed, 18 Feb 2009 00:14:42 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n1HMEg5d031385; Wed, 18 Feb 2009 00:14:42 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Sean Bruno References: <200902171937.n1HJb4E6025748@svn.freebsd.org> Date: Wed, 18 Feb 2009 00:14:42 +0200 In-Reply-To: <200902171937.n1HJb4E6025748@svn.freebsd.org> (Sean Bruno's message of "Tue, 17 Feb 2009 19:37:04 +0000 (UTC)") Message-ID: <87iqn8yalp.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Hellug-MailScanner-ID: n1HMEgDA022293 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.875, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.52, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188726 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 22:14:55 -0000 On Tue, 17 Feb 2009 19:37:04 +0000 (UTC), Sean Bruno wrote: > Author: sbruno > Date: Tue Feb 17 19:37:04 2009 > New Revision: 188726 > URL: http://svn.freebsd.org/changeset/base/188726 > > Log: > Introduce 1394a-2000 extended PHY Self ID packets. This breaks /head/usr.sbin/fwcontrol :( > Modified: head/sys/dev/firewire/firewire.h > ============================================================================== > --- head/sys/dev/firewire/firewire.h Tue Feb 17 19:17:25 2009 (r188725) > +++ head/sys/dev/firewire/firewire.h Tue Feb 17 19:37:04 2009 (r188726) > @@ -292,6 +292,10 @@ struct fw_devlstreq { > #define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2 > #define FW_SELF_ID_PORT_NOT_CONNECTED 1 > #define FW_SELF_ID_PORT_NOT_EXISTS 0 > + > +#define FW_SELF_ID_PAGE0 0 > +#define FW_SELF_ID_PAGE1 1 > + > #if BYTE_ORDER == BIG_ENDIAN > union fw_self_id { > struct { > @@ -301,7 +305,7 @@ union fw_self_id { > link_active:1, > gap_count:6, > phy_speed:2, > - phy_delay:2, > + reserved:2, phy_delay is used in usr.sbin/fwcontrol at recent /head snapshots, so the following change is also needed to build everything: %%% diff -r e41e9f254a62 usr.sbin/fwcontrol/fwcontrol.c --- a/usr.sbin/fwcontrol/fwcontrol.c Tue Feb 17 22:37:39 2009 +0200 +++ b/usr.sbin/fwcontrol/fwcontrol.c Wed Feb 18 00:13:18 2009 +0200 @@ -537,13 +537,12 @@ printf("%02d sequel packet\n", sid.p0.phy_id); continue; } - printf("%02d %2d %2d %4s %d %d %3s" + printf("%02d %2d %2d %4s %d %3s" " %s %s %s %d %d\n", sid.p0.phy_id, sid.p0.link_active, sid.p0.gap_count, speed[sid.p0.phy_speed], - sid.p0.phy_delay, sid.p0.contender, pwr_class[sid.p0.power_class], port_status[sid.p0.port0], %%% From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 22:15:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C4F106566C; Tue, 17 Feb 2009 22:15:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F30908FC21; Tue, 17 Feb 2009 22:15:58 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HMFwo4029213; Tue, 17 Feb 2009 22:15:58 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HMFwlH029211; Tue, 17 Feb 2009 22:15:58 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200902172215.n1HMFwlH029211@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 17 Feb 2009 22:15: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: r188736 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 22:15:59 -0000 Author: gallatin Date: Tue Feb 17 22:15:58 2009 New Revision: 188736 URL: http://svn.freebsd.org/changeset/base/188736 Log: Better support for recent Myricom 10GbE NICs - Update to firmware 1.4.39 for dual-chip NIC (10G-PCIE2-xxx) support, and SFP+ i2c support - Identify newer "B" NICs (10G-PCIEx-8B-x) correctly, rather than mis-identifying them as "A" NICs (cosmetic only) - Identify the IFM_10G_LRM ifmedia type, where applicable. - Identify ifmedia types for SFP+ based NICs - Update copyright Sponsored by: Myricom MFC after: 1 week Modified: head/sys/dev/mxge/eth_z8e.h head/sys/dev/mxge/ethp_z8e.h head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h head/sys/dev/mxge/mxge_mcp.h head/sys/dev/mxge/rss_eth_z8e.h head/sys/dev/mxge/rss_ethp_z8e.h Modified: head/sys/dev/mxge/eth_z8e.h ============================================================================== --- head/sys/dev/mxge/eth_z8e.h Tue Feb 17 21:59:54 2009 (r188735) +++ head/sys/dev/mxge/eth_z8e.h Tue Feb 17 22:15:58 2009 (r188736) @@ -1,6 +1,6 @@ /******************************************************************************* -Copyright (c) 2006-2008, Myricom Inc. +Copyright (c) 2006-2009, Myricom Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7074 +28,6951 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 369604; -static unsigned int eth_z8e_length = 113069; -static unsigned char eth_z8e[113069 + 1] = - "\x78\x9c\xec\xbd\x7f\x7c\x54\xd5\xb5\x37\xbc\x66\x32\xc0\x24\x0d" - "\x4c\xb4\x94\x8e\x88\x3a\x2a\xb6\xa3\xa2\x46\xc5\x16\x2d\x6a\x2c" - "\x70\x1b\xef\x8b\x12\x21\x68\x90\x1f\x09\x36\xf8\x44\x45\x18\x21" - "\xc0\x04\x43\x26\x0c\xd8\x06\xca\xaf\x6a\xb4\x28\x81\xa4\x15\x6f" - "\xb1\xc5\x8a\xb7\x78\x4b\x5b\x7e\x8c\x12\xef\xa5\x36\xc9\x44\xc1" - "\xe7\x06\x3f\xb4\x4e\x79\x22\x4d\x79\x82\x4e\xc9\x40\x62\x32\x33" - "\xfb\xfd\xae\xbd\xcf\x99\x9c\x99\x9c\x09\x72\xef\xfd\xbc\xef\x3f" - "\xcd\xe7\x73\x72\x66\xef\xbd\xf6\xda\x6b\xad\xbd\xf6\xda\x6b\xff" - "\x38\x7b\x13\xfd\x37\xfe\xac\x47\x03\xff\x9d\xec\xff\xf8\xfb\xc7" - "\xdf\x3f\xfe\xfe\xf1\xf7\x8f\xbf\x7f\xfc\xfd\xe3\xef\xff\x9f\xbf" - "\xb3\x56\x1b\xbd\xbb\x85\xa8\xdb\x6f\x77\x86\x2c\xb7\x4e\xfe\xc9" - "\x0b\x22\x8a\x68\x4b\x88\xec\x4e\x7e\x6b\x0f\x3d\x8f\x78\xeb\x16" - "\xb2\x5f\x93\x43\xd9\x93\xb6\x13\xd5\x8e\x12\x9d\x2f\xbc\x24\xc2" - "\x6b\x5e\x12\x9d\x93\x5f\x23\x6a\x1c\x4b\xf4\xc2\x28\x11\x01\x9e" - "\x39\x21\x5a\x5b\xc9\x78\xd6\x20\xcc\xe9\x6b\x47\x89\x30\xe2\xcb" - "\x11\x1f\xe1\xf8\xd5\xa3\x80\x6b\x24\x91\xff\x25\xd1\x63\xc0\x6b" - "\xe7\xfc\x8c\x73\xf2\xd5\x92\x9e\x9d\x29\x78\x18\xc7\xbe\x10\x3d" - "\xb7\x70\x10\x1c\xd9\x9c\x5f\xd2\x86\x3c\x5d\x7e\x72\x46\xac\x64" - "\x89\xf8\x03\x5f\x43\xde\x08\x78\x72\x73\xde\xcd\x48\x17\x7e\xca" - "\x60\xbc\xc1\x9e\x28\x35\x56\x12\x01\x96\x5c\x55\x64\x39\x45\x99" - "\x77\x03\xde\xb2\x46\xe5\x77\x21\xce\x2a\xe3\x80\x87\xe3\x38\x0d" - "\xf1\x63\x39\xdc\xed\xcf\xcc\x4f\xe0\x64\x59\x70\xba\x35\x60\x45" - "\xba\x05\xf9\x6c\xc8\xb7\xac\xb1\x81\x48\xe1\xca\xc9\x0c\x51\x66" - "\x9d\x96\xaf\x1a\xf9\xaa\x39\xdf\x61\xa4\x4f\xaa\x53\x3c\xce\xa8" - "\x23\x2b\xa7\xb3\x7c\x51\x8e\x15\x70\xbb\x74\xfc\x0a\x87\xf5\x7e" - "\x8d\x9f\xaf\x20\xad\x31\x39\xcd\xf6\xbc\x96\x96\x8d\xb4\x50\x72" - "\x1a\xf0\xa9\xb4\x4b\x90\x16\x4d\x93\x76\x69\xb7\x3f\xcb\x99\x9c" - "\x76\x30\x57\x4b\xfb\x3a\xd2\xc6\x27\xa7\x59\xf4\x7c\x4e\xa4\x15" - "\xe8\x69\xc6\x7a\x51\x1a\x66\xc3\x33\xc4\x4e\x34\x14\xcf\x30\xbb" - "\x5e\x57\x4b\x9d\x22\xee\xbb\x8c\x6c\x62\xfd\x7e\x7b\xdc\x2f\x28" - "\xe8\xed\x21\xd7\x68\xf2\x9d\xa4\xac\x00\xf0\xd2\xa6\x95\x64\xf7" - "\x79\x44\x4f\xd0\xdb\x49\x2d\xe1\x4e\xf2\x85\x45\x47\x30\x7a\x8e" - "\xaa\xce\x91\x3d\x18\x3d\x43\x55\xcf\x90\xb3\xb1\xf2\x53\x32\xd3" - "\x83\xb8\x55\x90\x6f\x0c\xe7\x6d\xa7\x96\xba\x76\xf2\xd5\x25\xe7" - "\xf5\x5d\x41\xce\x66\x84\xa1\x03\x8e\xf2\xad\x22\xde\xe8\x8a\x52" - "\x34\x6b\xbf\xbd\xf2\x35\xb2\xf9\xae\x26\x6b\x73\x69\x80\x5c\xdf" - "\x60\x5a\xbe\x52\xc3\xb4\xac\x7d\x92\xec\xaf\x3e\x1e\xb0\x8a\xf5" - "\x8d\xf6\x5f\xf5\xf6\x58\xd7\x9c\x26\xdb\x61\xe7\x64\x3a\xec\x3c" - "\x41\xc1\xad\x77\x53\x30\x12\xa5\x4d\x4f\x52\xf6\xe1\xc8\x44\x0a" - "\xae\x8d\x13\xe3\x0b\x2e\x9c\x88\xf7\x39\xc0\x74\x92\x6b\x09\xd1" - "\x29\xfa\x8a\xb7\x16\x78\x42\x0a\x27\x74\xe0\x2b\x6b\xdf\xf1\x10" - "\xb1\xcc\x38\x9c\x46\x9f\x73\x5e\x60\x5d\xb5\x4a\x1d\xea\xac\x1f" - "\x25\x3a\xae\xad\xa5\x91\x80\xcf\x41\xfe\xc6\x90\x75\xef\x3e\x4d" - "\x9f\x3b\x6e\xa9\xa5\x9c\xbd\x55\x61\x1b\xf4\xb0\xd3\xe1\x85\xfe" - "\xad\xa4\x21\x8e\x28\x59\xc0\xc3\xeb\xf5\x88\xbb\x76\xa4\xcc\xd3" - "\x13\xa2\xb7\xda\x38\x8f\xf8\xfa\xec\xbf\xc7\xbf\x3e\x3b\x1c\xff" - "\xc9\xec\xb3\xe2\x27\xb3\xbb\x62\x3f\x99\x1d\xf1\x55\x90\x3d\xf6" - "\xf5\xd9\xe7\x5a\x3c\x52\x56\x39\x2d\x1e\xc8\x2a\x46\xf6\x55\x67" - "\x28\x67\xde\x33\xa8\xa3\xe8\x9f\x68\xd5\x13\xe4\x8c\x67\xbe\x1b" - "\x08\x46\x3f\xa2\x79\x95\x24\xf0\xbb\xd5\x8c\xf6\xae\xac\xc6\x7c" - "\xa5\x5b\x76\xb4\xe5\x6c\x0f\x68\x95\xe5\x76\x65\x35\x69\xf1\x4c" - "\x4f\x76\x8d\x1e\x2f\xb2\x1a\x0b\x51\x1f\xbe\x11\xab\x2d\xb4\xa3" - "\x97\xe8\x96\x38\x59\x4e\x53\x76\x2d\x78\xc9\x31\xe2\x9f\x3e\xe5" - "\xe1\xbb\x29\xf7\xce\x9b\x72\x6f\xff\xf6\x84\xdb\xe9\x81\xfb\x26" - "\xdd\x4d\x05\x8f\x4c\xc7\xbf\x07\xef\xa6\xa2\x7f\xba\x1f\x3f\x26" - "\xdd\x7d\x6b\xee\xf7\x6e\x2a\x98\x74\xff\x94\x9b\x26\xd0\x43\x85" - "\xb7\xe5\xde\x76\x1b\xdd\x37\x65\xea\xad\xb9\xb9\xda\xfb\xd6\x5c" - "\x06\x7a\x74\xc2\x94\x19\x37\x15\x2c\x59\x5c\xbe\xf8\xa6\x07\xef" - "\x9f\x64\xb4\x6f\x39\xf1\xe5\x71\xda\x01\x1d\x17\x5d\xf9\xc4\xb2" - "\x0f\x54\x9d\x45\xfd\x0d\xff\x29\xe4\x1f\x56\xba\x9f\xbd\x07\xf4" - "\xdb\xba\xfd\xc3\xf3\x43\xd6\xb7\x9d\x4c\xbf\xeb\x1a\xae\xe3\x11" - "\x5b\xb9\x3d\xa3\x0e\x22\xcc\x5f\x46\xa5\x84\x59\xa8\xd7\x53\x3c" - "\x6b\x7f\x6e\x64\x69\x99\xb4\x3b\x88\x5f\x8b\xbc\x21\x8e\xdf\x84" - "\x70\xa3\x27\x8f\xc4\xab\xf9\x16\x9b\x4b\xda\x0e\x2e\x2f\xb7\x96" - "\x69\xc8\x6a\x2a\x12\x7d\x45\xa4\xc5\xb5\xc6\x39\xbc\xbe\x69\x96" - "\xf0\x21\x6e\xa5\x8c\xfb\x00\xe1\xa2\x6e\xd8\xb3\x6e\x51\x46\xf1" - "\xa5\x45\xac\x6f\x19\xa0\x65\x0a\x78\xe8\x90\xf0\x5d\x32\xff\x50" - "\xc4\x5d\x07\x7c\xb3\xf0\x3c\xaa\xe1\x84\x6d\xbb\x24\x8c\xfc\xb3" - "\xe3\xa2\x88\x44\xf6\x65\x76\xfc\x9e\x13\x58\xd9\x49\xa7\x3c\x64" - "\x0d\x21\x2d\xee\x2b\x23\x43\xf9\x11\xee\x0f\x50\x96\xad\xbb\xaf" - "\x8c\x42\x34\xbc\x47\xe2\x62\x9c\xfd\x30\xed\x5c\x26\x78\x0c\x43" - "\x4e\x6f\x77\xfb\x47\x80\xff\x7f\x33\xca\xa8\x86\xe1\xc1\x73\x07" - "\xf3\x01\x1c\x21\x2e\x03\x38\xad\x1a\x4e\x3d\x3f\xcb\xf9\xa0\x92" - "\xf3\x88\x3d\x29\x72\x6e\x43\xda\x61\xe8\x7d\x24\xc3\x2b\xd3\x5b" - "\xd1\xae\x6a\x39\x1d\xf9\xcb\x99\x46\x65\x8b\x65\x5a\x67\x72\x5e" - "\x87\xd3\x50\x47\x59\xaa\x8e\x1c\x39\x7a\x1d\x71\xfe\x48\xe6\x71" - "\x8f\x56\xfe\x11\xc0\x64\x20\x3d\x37\x05\xc7\x54\xa4\x35\x71\xbd" - "\x8d\xf0\x50\x06\xe7\xd9\x31\x4a\xb7\xff\x12\x5f\x49\x32\x7c\xce" - "\x18\xc0\x7f\xb0\x59\xe1\xfc\x04\x3a\x6d\x83\x2e\x75\x1e\xf6\x72" - "\x3f\xe7\xd8\x90\x2c\x1f\xc7\x2e\x96\x8b\x94\x87\x90\xf2\xd0\xf9" - "\xe9\x44\xde\x53\x80\xdf\x9f\x02\xdf\x06\x79\xcd\x92\xf5\xdf\x35" - "\x00\xfe\x33\xc0\x77\x26\xc3\xe7\x64\x4b\xfd\x51\x79\xf4\x7a\x2c" - "\xd7\xea\xd5\x92\x52\x26\xf3\x33\xbc\xdb\x9f\x93\xc2\xff\x25\xfb" - "\x80\xfb\xfc\x26\xd5\x46\x46\xa0\xde\x6f\x02\xde\x05\x23\xc2\xe4" - "\x40\xd8\x61\x08\xe7\xe0\xb9\x44\x74\xff\x3f\x71\xc4\xdd\x86\xb8" - "\xe7\xd0\x9e\xac\x08\xc7\x54\xf8\x92\xb7\x10\xb6\x80\x9e\x47\x05" - "\xeb\x59\x77\x3e\xeb\xd0\x78\xc4\xbf\xae\xa5\xff\x54\xc2\x03\x26" - "\xce\x7a\xd6\x95\xd0\xd9\x97\x99\x3e\xd6\x5b\x3d\x9f\x58\x21\xd3" - "\x26\x21\xed\x39\xbc\xef\xc7\xfb\x19\xbc\x1f\xc2\xfb\x01\xdf\x17" - "\xe4\xf4\xc5\x44\x87\x16\xbe\x13\xef\xe9\x78\x5f\x87\xf7\x0c\xbc" - "\x2f\xe1\x36\xc6\x3c\x87\x9f\x45\xfb\xc9\x92\x6d\x69\xa8\x51\x96" - "\xc6\xf6\x95\x88\x53\x70\x56\xa3\xfc\x40\x07\xb7\xdd\x02\xf0\xd9" - "\xc1\x65\x6a\xb8\x86\x98\xe0\xb2\x99\xe0\xb2\x18\x71\x85\x28\x67" - "\xbf\xcf\x2b\x04\xde\xbb\x46\x44\x38\x7c\x49\x03\xe4\x60\x43\x78" - "\x2d\xcb\x44\xd9\x90\x4b\x8e\x24\xd7\xed\xf0\x72\x96\x89\xae\x3b" - "\x5a\x59\x43\x8c\x65\x99\xd9\xea\x3e\xeb\xc8\x77\xd0\x0f\x5f\xda" - "\xe7\x73\x93\xa8\xd9\xef\xba\x89\xc8\x3a\xae\x9a\x32\x83\xd1\x63" - "\x34\x2d\x2a\x62\x78\xfa\xae\x27\xba\x24\x18\x6d\xa2\x6f\x12\x5d" - "\x1d\x8c\xd6\xa2\x2f\x28\xe7\xb4\x43\xd7\x92\xc5\x82\xb7\xef\x06" - "\xb2\x5a\x82\xd1\xf1\x88\xdf\x49\x63\xc9\x66\xf9\xa7\xe7\x44\x77" - "\x30\x3a\x19\xe1\x85\x54\x1c\xa3\x9c\xa9\x43\x84\x6f\x5a\x4c\x7c" - "\xf2\x4f\x43\xe2\x22\x18\x6d\x44\x7c\x29\x4d\x8b\x7d\x21\xa6\xc5" - "\xba\xf1\x7c\x8e\xe7\x13\x3c\x87\xf0\xf8\x84\x58\xb7\xdf\xd5\x87" - "\x3e\x02\x34\xe5\xf6\x89\xb2\x0c\xd0\x94\x8b\x3e\x43\x88\xac\xfd" - "\x79\xc1\xe8\x44\xe0\xb3\x12\x60\x72\xfb\xfa\x90\xb6\x7e\xff\xbd" - "\x12\x26\x6b\xff\x3d\x32\x5c\xb3\xbf\x40\xd8\xf7\xe7\xdd\x54\x4d" - "\xc3\x98\xfe\x38\x64\x16\x8c\xa2\x9f\x8e\x7e\x4a\xd3\x2a\xc2\x82" - "\x79\x18\xb1\x5a\xe0\xf7\x21\x01\xb9\x3a\xa6\x55\xf8\x44\x71\x94" - "\xec\x22\x93\x71\x77\x32\xde\x02\xe0\x7a\x40\xc3\xe5\x01\x6c\x98" - "\xe1\x18\x97\x8e\x87\x71\x30\xec\xb4\x18\xf4\x7d\xdd\x7e\x4f\xdf" - "\xba\xfd\x25\x78\xaa\xf1\xec\x41\xde\x77\xfb\x9e\x95\x72\x6c\xc5" - "\xef\x50\x0f\xea\x55\xca\x31\x46\xc3\x00\xdb\x8a\xfa\x98\xdc\x2d" - "\xe9\x3e\x40\x92\xee\xf5\xfb\x45\x8f\xa2\x3f\xae\xf1\x13\xe3\xf8" - "\x08\xea\x0d\x30\xae\x88\x4c\x3b\x70\x15\xf2\x15\xca\x7c\x35\x07" - "\x5c\xc2\x7e\x20\x37\x0e\x7d\x84\x3c\xab\x59\x96\x90\x6f\x35\xfb" - "\x49\x2c\x53\xb1\x0e\xe9\x99\x07\x72\xfb\xd6\x1d\xc8\x43\xfe\xe9" - "\x7d\x02\xb4\x64\x1d\x28\xe9\x51\x65\x16\x03\xcf\x9c\x6e\xc6\x69" - "\x3f\x50\x02\x5c\x9e\x2f\xfc\x2e\xc8\x42\xf4\x4c\x8b\xae\x8e\x16" - "\x57\x50\x86\x9b\xaa\x41\xef\x76\xf8\x63\x0b\x81\x6f\x2d\xa7\x7d" - "\x32\xad\x82\xbe\x8a\xb2\x0e\x01\x6f\x09\x97\x87\x32\x3c\xc0\xf9" - "\x34\x70\x95\x32\x4d\xbd\x7e\xca\x41\xb8\xba\x57\xd1\xd7\x10\xaf" - "\x39\x10\x88\xdb\x0f\xec\x31\xea\x8f\x92\x19\xeb\xcd\x1b\x1c\x97" - "\xa3\xeb\x4a\xac\xe6\xc0\x96\x1b\x89\x72\x1e\x8c\x88\x28\xeb\xcb" - "\x2d\xe4\xb1\xb4\x44\x9a\xa8\x38\x6a\xa7\x16\xcf\x5e\xba\x81\xd8" - "\x67\x8b\x50\x4b\xa4\x16\xe1\x8d\x78\x97\x53\x73\xe7\x4e\x62\x1a" - "\x1f\xf4\x44\x56\xc7\xec\x07\x73\x9a\x3b\x1f\x20\xe4\x3f\x04\x1a" - "\xe3\xf3\x3c\xb6\xea\x16\x4f\x84\xc3\xbe\xe6\x4e\xe8\x68\x4c\xc4" - "\xa2\x35\x07\xaa\xa3\xf6\x83\xae\x07\xcf\x89\xf0\x03\x9d\xd5\x43" - "\x10\xd7\xe7\xb0\x88\xa8\xc3\xeb\x13\xcd\x9d\x6b\x69\xde\x39\xb2" - "\x34\x97\xed\x95\xba\x3a\xcf\xe3\x21\x99\xff\x5c\xd4\x31\xb7\xb3" - "\x9a\xe6\x96\xd1\x08\xc0\x7f\xce\xba\x2b\x46\x54\x53\x53\x7b\x29" - "\x3d\x70\x26\x9a\xf1\xe0\xb9\x3e\xd1\x54\x52\x4b\xcd\x65\xb5\x2c" - "\x8f\x06\xf6\x99\x1e\x38\xd3\x25\x1e\x3c\xd7\x2d\x9a\xcb\xde\xa0" - "\xa6\x92\xbd\x34\xf5\xd3\x80\x23\xb6\xee\xc0\x96\x78\xe6\x81\x3d" - "\xf1\x75\x07\x02\xd1\x75\x07\xaa\x63\x99\x07\x73\xa2\x99\x07\x5d" - "\x62\xfd\xc1\x2d\x90\x5f\xa6\xac\x8b\xac\x83\x9b\xf0\xdb\x25\xeb" - "\xd7\x7e\xb0\x41\xd4\x1c\x0c\xf4\xad\x3b\xb8\x27\xe8\x9d\x48\x22" - "\xf3\x60\x03\xeb\xbc\x58\x77\x30\x00\xb8\x80\xd2\x91\x83\xad\xac" - "\x23\x80\x09\xe1\x09\xf7\xad\x3b\x84\xb6\x72\xa8\x00\x38\x2e\x51" - "\xf8\x0e\x4d\x63\xb8\xb8\xfd\x50\x41\xbc\xe6\x50\x89\xb0\x1f\xf2" - "\xc0\xb7\xb2\x3e\xf8\x4c\x0f\xe4\x07\xd9\x79\x21\x77\x3f\xda\x87" - "\x37\x86\x70\x8c\xe6\x3d\x43\xbe\xa0\xf7\x04\x7e\x9f\x20\x71\x70" - "\x0b\x3d\xf8\xcc\x21\xc1\x69\x0f\x3e\xe3\x13\x90\x8d\x23\x9e\x09" - "\x3c\xeb\x80\x27\x13\x78\xd6\x07\x2e\xed\x61\x9d\xaa\x09\xe4\x3c" - "\xf0\x9c\x08\x0b\x7b\xc0\x13\x1f\x4a\xb2\x6d\xc4\x0f\x0a\xa1\xda" - "\x47\x27\x74\x72\x74\x75\xb1\x97\x1a\xc4\xba\x40\x8e\xc8\x0c\x20" - "\xdf\xbb\xff\x0a\xbb\x95\x21\xa4\x8d\x79\x77\x4f\xdf\xba\x77\x5b" - "\xf1\x04\xfa\xdb\x14\xb7\xbd\x77\xf7\x7c\xd9\xf1\x43\xb7\x7f\x14" - "\xc6\x3f\xc7\xa4\xff\x84\xdf\xe8\xff\x3f\xda\xab\xfd\x3e\x11\xa2" - "\xfd\xd9\xd2\xa7\x84\x2d\xf3\x54\xd1\xd7\x4e\xd3\xd7\xb7\x80\x5f" - "\xc2\xef\x6c\xfc\xae\x9d\x76\xfd\x21\x11\xdf\x60\x9b\x80\x3a\xed" - "\x66\x5b\x23\xfc\xe3\xd9\xff\xc8\xeb\xee\x2e\xb3\x8b\x6e\x77\xb6" - "\xc8\x6a\x7e\x49\xf4\x39\xd9\xf7\x75\x20\x3c\x02\xb2\x1b\x8b\xf7" - "\xa5\xdb\xcf\xd3\x48\x3c\xce\xed\xfe\x78\x35\xdb\x52\xfc\xce\x15" - "\x2b\x9c\x59\x9b\x96\xd3\x38\x47\x84\xec\xf5\xfe\x78\x91\x63\x75" - "\x0e\xc1\xef\x1e\xc9\xbf\x85\x3f\x90\x5b\x7f\x9e\x6c\xec\x8f\xc7" - "\x87\xa3\x3c\xaf\x43\x88\xa5\x6e\xaa\x5f\x02\x7b\x83\xb1\x69\xbd" - "\x5f\xec\x89\x75\xbb\xad\x4c\xa7\x4e\x0b\xd3\x06\x3a\xaf\x00\x9d" - "\x3b\x67\x56\xe4\xd1\x7b\xf0\x11\xcc\x6c\x76\xb7\xff\xeb\x09\xfe" - "\xd3\xa4\xb7\xeb\x32\x31\x4f\x77\xda\x74\x39\xa5\x19\x7b\x8c\xe4" - "\xb6\x1c\x3b\x2f\xc2\x9b\x17\x11\xcb\xc2\xe9\x8b\x8a\xff\x03\x7b" - "\x5a\x5d\x15\xa3\x2b\xa6\x55\x5c\x25\x82\x61\x11\x08\x7a\xcf\xc8" - "\x71\x7f\x3d\x60\xaa\xa2\x22\xae\x8f\xbf\x6b\x5f\x82\xef\xb9\xae" - "\xd9\x2b\xd6\x35\x97\x77\x2d\x17\x51\xf8\x47\xed\x28\xd3\x1b\xa2" - "\x5b\xa3\xaa\x6e\x0e\x34\xc0\x7f\x68\xef\xb2\x37\x97\x03\xf7\x25" - "\x8c\xbb\xc5\x23\x02\xf1\xcc\xe6\x4a\xc0\x35\x84\xe8\x2f\xd9\xc6" - "\xb1\xff\x5a\xe0\x5c\x0b\x9c\x48\xdb\x1f\xa2\x2b\x06\xcc\x01\xa8" - "\x59\x0a\x42\xbd\xb8\xfa\x27\x37\x2c\x9a\xfa\xe8\x7f\x39\x78\xf2" - "\xcc\x93\x75\xbe\xd1\xf6\x5c\x5d\xf0\xf9\x7d\xab\x68\x0c\xea\xe1" - "\xf2\xd3\x74\xd9\xad\xe8\x87\x4f\x09\xbf\xf3\xc8\xab\x2b\x7b\x30" - "\x26\xbf\x6c\x62\x88\x76\xd5\xa6\x93\x9b\x60\xdb\x77\x5e\x74\x6c" - "\x5e\x9e\x90\xd9\x5f\xa6\x55\xc4\x05\xff\xe6\x36\x55\x8f\x78\x96" - "\x07\xf0\xac\xd5\x65\x91\x46\xfe\x36\x51\xd3\x5c\xa3\x7c\xea\xcb" - "\xda\x05\xc6\xc8\x81\x2b\xa3\xfc\xfb\x53\xe9\x33\xd4\x1c\xdc\xd3" - "\x05\x5b\xc1\xe3\x33\x8c\xef\x22\x18\x4f\xf7\x00\x67\x5b\x88\xae" - "\x0e\x69\xf3\x11\x91\x60\x74\x0a\xdb\x8d\x3d\xe9\xeb\x57\xc7\x3f" - "\xe6\x98\x86\x33\x20\xec\xc7\xf7\x56\x29\xba\x7b\xaa\x22\xa2\x83" - "\x71\xf3\xf8\xa7\x1d\x30\x3b\x50\x0f\xa2\xe6\xf8\xae\x4d\x1c\xb7" - "\xbc\x97\xe3\x3e\x82\x1e\x0b\x45\xd7\x98\x8f\x20\xb7\xaf\xc3\xc7" - "\x0d\x07\x56\xf6\xd2\xa9\x4a\xca\xe0\x71\x67\xb7\x7f\xf4\xc2\x10" - "\xdd\xd3\x20\xc7\x7e\x7e\xfa\x45\x97\x75\xe6\x4c\xc4\x55\x87\xe8" - "\xde\x46\x19\x67\xa5\xaf\x21\xbc\x25\x01\x03\x1c\x08\x37\x18\xf2" - "\xcc\xec\xb2\xde\xf0\x0b\xc4\xed\x4d\xc9\xd3\x98\x92\xe7\x98\x1e" - "\x06\x7d\x9d\xae\xe5\x92\xaf\x17\x91\xbf\x01\x4f\xb5\x56\x6e\x4f" - "\x32\x8e\xcb\xed\xc9\x38\x2e\x77\x0e\xa4\xf5\xf2\x71\x29\x79\x26" - "\xa6\xe4\x99\x3a\x90\xd6\xcb\x4b\x52\xf2\x78\x52\xf2\x54\xeb\x61" - "\x6d\x0e\x26\x17\x71\xb5\x29\x79\x76\xa6\xe4\xd9\x6b\x08\x7f\x15" - "\xe1\x04\xff\x5c\xd7\xf0\x07\x04\x8f\xab\xa1\xb7\xac\xc3\x0d\x6c" - "\x4f\x79\xce\x63\x69\x25\xdc\x8b\x75\x07\x1b\x00\x1f\xd1\xf1\xeb" - "\xba\x23\xe1\x95\xfe\x74\x28\xfd\x19\xe3\x4c\xc0\xc0\xc5\x6a\x74" - "\x45\x08\xb2\xec\xe0\xf9\xb2\x60\x64\x8a\x36\xde\x1c\x33\x87\x75" - "\x4a\x2f\xd3\x51\xa9\xf4\x86\xe7\x0e\xf4\x32\x43\xd0\x15\xee\xaf" - "\x0c\xfa\xd9\xce\x65\x69\x65\x54\xea\x65\x00\x77\x3b\xeb\x8f\x9c" - "\x2f\x01\x7e\x2d\xdf\x1e\x25\xf7\x31\x3b\x93\xe5\x31\x66\x6f\xb2" - "\x3c\xc6\x34\x1a\x65\xc8\x36\x22\x44\x97\xd7\xa4\xf3\x71\xe1\xef" - "\x78\xe0\x93\x5f\xe9\x8b\x8b\x93\xa7\xe8\x8a\x59\xd0\xfb\x0c\x7e" - "\x4b\x3f\xaa\x07\xfc\xda\x8f\x4e\x94\x3e\x54\xe5\x39\xf4\xb9\x12" - "\xf6\xab\x80\x6d\x07\xcc\xfd\x1a\xec\xfd\x6a\x4e\x4f\xbe\x87\xf1" - "\x1b\xfe\xd4\xd3\xb0\x45\x25\x61\x1f\xf7\xdb\xc7\x3d\x7a\x18\x63" - "\x12\x8c\x09\xaf\x70\x8a\x75\x47\x27\x9a\xd3\x82\x3e\x53\xd9\xd6" - "\x4e\x94\xf3\x75\xb6\x11\x90\xdf\x65\xb0\x33\x7f\xa9\x5a\x45\x5f" - "\x65\xfb\x20\x32\x9b\x6b\x95\xbc\xaf\xd8\x2d\xfc\xd5\x14\x44\x6f" - "\xe8\x59\x4e\x97\xc3\x9e\x6e\x38\x4d\x57\xbc\x53\x5c\xe9\x02\xad" - "\x18\xc7\x7e\x46\x24\xfb\x8e\xcc\xe6\x2d\xdc\x8f\xd6\x7f\xc6\x63" - "\xca\x2b\x42\xba\x6d\xc1\xef\xce\xc1\xec\x3c\xea\x2e\xac\xc6\x54" - "\x57\xce\xe2\x3a\x3a\x49\x57\x4e\x66\x7e\xd5\x5c\xe8\x95\x77\x88" - "\xf3\x62\x8e\x60\x5f\x1c\xbe\x46\x88\xae\xf4\xe0\x1d\x96\x8f\x9f" - "\x4a\xb4\x70\x08\x70\x63\xc5\xf9\x38\xc3\xa0\x0e\xae\x9c\x28\xfc" - "\x16\xb6\x71\xfb\xbb\xfd\x57\x96\x85\x68\x7c\x40\x8d\xab\xaf\x1c" - "\xcf\xb8\xd2\xd0\x10\xea\x9f\x67\xb9\xf2\x03\x57\x95\x85\xe9\x78" - "\x4d\xda\x24\xe0\xaa\xb7\xaa\xfe\x36\x0e\x5a\x77\xf8\xe3\x65\xe8" - "\x5b\xcb\xe2\xeb\xff\xb7\x57\xfe\xd6\xd2\x98\x8e\x38\xca\x37\xc5" - "\x9f\xb0\x51\x57\xad\xd2\xec\x5c\x6b\xdc\x7e\x30\xac\xd9\x67\x1e" - "\x17\x66\x9e\xa4\xab\x2a\x11\xc6\x58\xf3\x2a\xd7\xaf\xe2\x61\xeb" - "\x3b\xe5\x7a\x17\x71\x55\xa5\xc9\x93\x8f\xa7\x08\x4f\xa9\x16\xf6" - "\x48\x1e\xba\x4a\x31\x4e\xbb\xaa\x32\x9e\x09\xf9\xd4\xb0\xbc\xae" - "\x2a\x10\x5d\x63\xad\xfa\xef\xfa\xbf\xf3\xdc\xc0\x55\xd0\xff\x2b" - "\x2b\xd3\xd6\x47\x82\x56\xd7\x9d\x06\x5a\x43\x06\x5a\xed\x27\xc9" - "\x35\x41\xa3\xb5\x29\x99\x56\xd7\x04\x3c\xe8\xd2\x5c\x63\xf0\x8c" - "\xd3\xc2\x86\xe7\xaa\x30\xca\x47\x5d\x5c\xd1\xa3\xea\x84\xe3\x50" - "\x06\xcb\xe2\xef\x64\x8f\xf7\x15\x11\xcf\x8f\x72\x3c\xcb\x93\xe3" - "\xe3\xf0\x83\x10\xce\x41\x7a\x0e\xeb\xca\xe6\xb8\xd2\x05\x73\x9f" - "\xc2\x55\x94\xf0\xbd\xe0\x7b\xb2\xfe\x76\xd2\xd5\xa5\xd0\x71\xf0" - "\xf1\x9f\x5e\xd5\xd7\x5c\xbd\x80\xc3\x68\x5b\x7f\xc1\xef\x92\x66" - "\x48\xaf\x77\x7d\x53\x7e\x9f\x95\x86\xf5\x5a\x29\x2f\xba\xc9\x36" - "\x27\x9a\xd5\x58\x18\xec\xd8\x4b\x2d\xd1\x7f\x25\xd7\x93\x12\xc7" - "\xac\x60\x19\x6c\x55\x85\x88\xbd\xd9\xbb\x0b\xe3\xb9\xcf\x03\xe8" - "\x9b\xaf\x3a\x4d\x57\x4b\xfa\x7f\x74\x12\xdc\xcd\x93\xb8\x15\x3f" - "\xd9\xb6\x09\x9b\x1e\x87\x7d\x39\x25\x22\xf0\xe3\xb2\x36\xf6\xd2" - "\xb8\x57\x56\x52\x6e\x5d\x2f\x8d\xdd\xd1\x4b\x6e\xf1\x57\xb7\xb5" - "\x0e\xfe\xd9\xbc\x73\x39\x04\x1d\x2a\x1a\xe1\x21\xfb\x8e\x95\xf0" - "\xd3\xa2\x64\x89\x6d\x84\x9f\x16\x85\x9f\xf6\xb9\x9b\xdb\x52\xc2" - "\x4f\xeb\xeb\x63\x3f\xad\xb9\x87\x61\xd0\x06\x7b\x86\x97\x91\x25" - "\xbb\x84\x72\x40\x9f\xef\x33\x72\xbd\x9c\xdd\x0e\x1f\x11\x3c\x87" - "\x34\x7e\x21\xb3\xdd\x8e\x32\x1a\x26\x79\x45\xfb\x16\xeb\xfe\xd3" - "\x9b\x6e\xdd\x83\x6d\x6d\xe0\xca\x08\xcf\x47\x33\x0f\x6f\xf1\x5c" - "\xed\xde\xd1\x3d\xb6\xa5\x75\xa2\x87\xe3\xcb\xaf\x16\x3d\x88\xdf" - "\xca\x65\xef\x41\x7c\xb7\xff\xea\x40\xc8\xfa\xd6\x89\x8b\x99\x6f" - "\x67\x7f\x42\xae\x89\xc8\xbe\xe3\x1a\x4a\xe9\x7f\x60\x33\xae\x19" - "\xa9\xdb\xdb\xf2\xab\xc9\x59\xee\x12\x1d\x83\xcc\x49\x47\x74\x3f" - "\xef\xf0\x18\x99\xb7\x20\xe1\x77\xa8\xb5\x15\x52\x3e\xc3\x35\xb2" - "\x0d\xb3\x4f\xc0\x7d\x0c\xfb\xc1\x3c\x87\xaa\xe6\xbd\xae\x59\x6b" - "\xf0\x55\xb8\x8f\x89\xec\x5d\xd9\x63\xe3\xfc\xcc\xa7\x96\xbf\x34" - "\x9d\x3d\xe7\xb5\x1e\xf8\x22\x5b\x5b\xea\x88\x5a\xe0\xf2\x35\xd7" - "\xe5\xc1\x3f\xea\x95\xbe\xe8\x49\xba\x46\xce\x99\x07\x16\xf5\x12" - "\xff\x0e\x56\xde\x45\x41\xc0\x28\x7b\x7a\xed\xd8\x46\xaf\x9a\xff" - "\x6b\xf4\x9c\xe5\x75\x1f\x11\x58\xc2\x76\xe7\xda\x87\x0e\x57\x86" - "\x41\xd7\xb5\x63\xf4\x39\xe9\x10\x5d\x5b\xc0\xe5\x77\xd5\x1c\xdf" - "\xc2\xf3\x7b\x72\xce\x2e\x32\x81\x61\xf2\x42\x74\x4d\x62\x2d\x09" - "\x7e\x2c\xec\xde\x35\x3d\x83\xd0\x9a\xa3\xfa\xac\x6b\xbd\xc9\xfe" - "\xc5\x10\xf4\x73\xd7\x6e\x48\xee\xe7\xae\xad\x4b\xee\xe7\xae\xdd" - "\x9d\xec\x5f\x58\xe1\x5f\x5c\x1b\x48\xc9\xd3\x9a\x92\x27\x64\xc8" - "\xb3\x45\x2b\x27\x92\x9c\x67\xac\x2d\x39\xcf\xd8\x91\x86\x30\x78" - "\x1c\x3b\x56\xaf\x9f\x2e\xb9\x5e\x31\x76\xbc\x21\x6c\xad\x95\x6b" - "\x7a\x63\xf3\xf5\x38\xf4\xa3\x04\xff\x30\xc2\x3a\xa1\xe1\x2b\x4d" - "\xd1\x31\x86\xf7\xa6\xd0\x50\x93\x42\xc3\xd6\x84\x4f\x03\xfc\xa8" - "\xaf\x77\x4f\xd1\x75\x1e\xa9\x43\xec\xd3\x55\xd1\x34\x0e\x03\xd7" - "\x56\xc0\x43\x0e\x63\x8f\xa4\xe0\x6b\x4b\xc1\xd7\x61\x08\xe7\x20" - "\xdc\x63\xe0\x21\x27\xc3\x49\x16\xe8\x0b\xc6\x14\xd7\xe5\xe8\xf1" - "\xec\xdb\x82\xde\x0e\x9f\x5c\x2b\xca\xe3\x35\xa9\x4b\x4f\xd2\xd8" - "\x18\xfb\xc1\x0a\xe7\x75\x46\xff\x8f\x14\x5f\xd7\x15\x24\xd3\x71" - "\x5d\x49\x32\x1d\xd7\x79\x0c\x7c\x45\x1c\xab\xe9\x21\x47\x74\xfa" - "\x2c\xf6\x93\x79\xdd\x90\xfd\x55\xf8\x6d\x4e\x94\x99\xc3\xeb\x60" - "\xa7\xca\x29\x23\xe8\xed\x80\x1f\xd2\x1c\x49\xab\x4f\x59\xc7\x1b" - "\xb4\x75\x14\x17\xf0\xb7\xea\xfa\x88\xdf\x18\xff\x5e\x3b\x47\xda" - "\xe0\xf5\x47\x03\xc2\x57\xb4\x15\x72\x44\x5f\xfe\x8d\xf7\x54\x7f" - "\x72\x7c\x2f\xb7\x45\xf8\x4b\x1d\xb0\x33\xd9\x6a\xbe\xfa\x1b\x39" - "\x06\x7d\x8e\xb8\x56\xde\x2b\x4e\xd2\x37\x3e\x60\x3b\xc4\xfe\x1f" - "\xfb\xfc\x87\x23\x61\xf4\x0d\xa7\x89\x69\x46\x5a\xab\x96\x2f\xdf" - "\x90\x2f\xcc\x6d\x8a\xe1\x39\xed\x96\x28\xd9\x38\x0f\x70\x8c\x94" - "\xe3\x01\xe0\x3b\x8c\x36\x8a\x3c\x95\x7a\x1e\xc0\xca\x3c\x8e\x72" - "\xb2\xdd\x5c\x49\xb6\xc0\xca\x93\x12\xb7\x56\xdf\x1d\x1b\x21\x97" - "\x60\x65\x07\x7c\xc3\x36\x1e\x53\xdb\x02\x55\x27\x19\x4f\x6b\x46" - "\x0f\xd9\xbb\xd6\x1d\xc7\x98\xe1\x1b\xad\xb1\x75\xc7\xb7\xc6\x6b" - "\x8e\xef\x09\xd1\x75\x3d\xd0\x3f\x53\x9b\x65\xbe\x46\x48\x8e\xcd" - "\xfe\x78\x5b\xa0\xaa\x9d\x71\x46\xb9\xdf\x0d\x3a\xa3\xd4\x52\x17" - "\x45\x3f\x43\x39\x72\xad\x10\x63\xdb\x60\x03\x7c\x53\x8c\xdb\x8a" - "\xbd\x94\x07\x5f\xa3\x4d\x24\xf2\x45\x90\xef\x9b\xe3\x99\xd6\xb5" - "\x1c\x8f\xfc\xb0\x99\x61\xf6\x65\xd3\xf4\xeb\x0e\x86\x0b\x5c\xc3" - "\x7d\xfb\x37\x17\x2a\xdf\x86\xf2\xe1\xcb\xb4\x99\xae\x9f\x59\x29" - "\xd8\xed\xff\xe6\xae\x10\x4d\xca\xd7\x75\xed\xf0\x56\x59\xdf\x18" - "\x83\x7e\x13\xed\xff\x1b\xe1\x74\x3e\x84\xa6\x97\x1e\xc0\x0e\x03" - "\x6c\xe7\x60\xb0\x4c\xf7\x61\xf0\x2d\xd6\x37\x95\xbc\x5a\x95\x3b" - "\x44\xd3\x29\xf4\xe5\xee\xb1\x7a\xbe\x2f\xc3\x1f\xdb\x63\xb6\x09" - "\xe8\x17\x22\x6a\x2e\xfa\xfa\x97\x79\xed\x12\x78\x30\xfe\xfb\xe6" - "\x16\x8d\x87\xaf\x20\x8c\xfa\xff\x66\x8f\xbe\xee\xc5\x7d\xdf\x52" - "\x0f\xfa\x04\x67\x04\xba\xe1\xde\xaa\xa7\xc9\xf1\x05\xa7\x61\xfc" - "\x72\xd8\xd9\xce\x69\x7b\x13\x69\x9c\x8f\xe9\xf6\x46\x39\xbe\x49" - "\x8f\x57\x76\xcb\x7d\x22\x25\xdc\xa9\x87\xf1\x1b\xed\xff\x9b\x25" - "\xfa\x7a\x3d\x74\x8e\xe7\xeb\x2d\x27\xe9\xfa\x59\x3b\xa4\x3d\xbb" - "\xde\xa9\xa7\x33\x5d\xbe\x9f\x8a\x30\xcf\x3d\xc6\xb3\x9a\x4a\xa4" - "\x9d\x47\x9e\x37\xcf\xf6\x0c\xc1\xd8\xd2\x22\xfa\xca\x88\xe3\x18" - "\x0f\xf7\x6b\xd0\x77\xee\xdb\x3a\x81\x2b\xbb\x9e\xf5\x1a\xf5\xba" - "\x22\x4a\x63\x3c\xf7\xf0\x18\xe2\xfa\x22\xa9\xd3\x7e\xa9\x3f\x82" - "\xf1\xc1\x27\x90\xb8\x19\xdf\x26\xee\x33\xbb\x78\x0d\xec\x7a\xe6" - "\xbf\x29\xfd\x9c\xcd\xf5\xfb\x0c\xb2\x1c\x82\xf0\x91\x64\x5e\xaf" - "\x6f\x4b\x09\x77\xe8\x61\xc8\xab\x5a\xe9\xde\xf5\x27\x54\xda\x0d" - "\xb6\xc1\xca\x62\x7f\x01\x30\xee\xe4\xf2\x6e\x98\x90\x8c\xff\x86" - "\xfc\x94\x70\x91\x1e\xae\x95\xeb\x13\x37\x94\xe9\x65\xc8\x3a\x83" - "\x8e\xed\xac\x0a\x0f\xf9\x72\xfa\x73\xe3\x3b\x4a\x7f\x6e\xd8\x6d" - "\xa0\x61\x28\xc2\xfb\xfb\xeb\xf3\x86\x23\x3a\x7e\xfc\x3e\x66\x80" - "\x43\x1b\xb9\xa1\x3d\x55\x5f\x96\x7a\x59\xcf\x58\x67\x6e\x24\x93" - "\xb4\x1e\x2d\x6d\x8c\xb9\x9e\xdd\x38\xde\x10\x1f\x56\xbe\xc4\x8d" - "\x2f\xeb\x7d\x93\x5c\xdb\xf3\x15\x5a\xa4\x8f\xf3\x92\xd2\x0b\xe8" - "\x43\x44\xea\x85\xdc\xbb\x72\x63\x79\x2a\xde\xc0\xca\x68\x3f\x8e" - "\x7e\x9c\x93\xd5\x5a\xdc\x8d\x3b\xfb\x79\xbb\x11\xf6\xed\xfa\x9d" - "\xba\xde\x2a\x3f\xfa\x86\x86\x74\xfe\x06\xe0\x43\xc9\x32\xbb\x31" - "\xdc\x2f\xb3\x1b\xa3\xfd\x78\xc7\xd9\x0d\x70\xff\x81\xb0\xb3\x1f" - "\x6e\xdc\xd8\x0b\xe9\x87\xda\xef\x33\x6e\x6a\x72\x59\xe3\xe6\x18" - "\x70\x94\x19\xca\x2a\x37\xc0\xb5\x21\xbc\x36\x7d\xfd\x8c\x6b\x48" - "\x5f\x3f\xe3\xf6\x9b\xd7\xcf\xb8\x63\x86\x72\x43\x17\xd6\xed\x9b" - "\x6c\x06\x7a\xea\x11\x1e\x99\xac\xcb\x37\x8d\x4d\x09\x27\xea\x5f" - "\xa0\xfd\xee\x5c\x99\x37\x84\xe3\xe1\x2b\xe7\x28\x5d\xbf\xa9\xd0" - "\x98\xfe\x66\xaf\x4a\x67\x1a\x79\x0e\x44\xce\xfd\x29\xb8\xca\x54" - "\x38\x86\x31\xa4\xd7\xe9\xb4\xaf\x45\x38\xd5\xbf\x4f\xd8\x6d\xad" - "\x1f\x0a\xc6\xb9\x1f\xba\x69\xbf\x1a\x03\x37\x97\x08\xff\xa1\xa2" - "\x74\x7d\x0a\x70\xc3\xfe\xdd\xb4\x47\xcd\x01\x35\x97\x40\x8f\x7a" - "\x4f\xd1\xcd\x3f\xc6\xbb\x0f\xef\x65\xc9\x7d\xdb\xcd\x39\x18\x7b" - "\xcf\xa8\xf7\xa7\xf6\x79\x37\xbb\xe1\xbf\xf4\x3a\xa2\xd5\x45\x26" - "\x69\x93\x85\x3f\x63\xba\x49\x3c\xcf\x21\xf4\x86\xe8\xe6\x2d\x4c" - "\xa3\x21\xbe\x5c\xf8\x47\x14\x32\x7c\x88\xcb\x43\x1e\xf3\xf9\x81" - "\xe6\x92\xa5\x97\x91\x13\x74\x7e\x71\x8a\x6e\xb9\x7e\xa9\x53\x8e" - "\x83\x41\xf3\x2d\xab\x52\xca\x69\x4c\x43\xf3\x09\xd0\xfc\x45\x1a" - "\x9a\xa5\xdf\x2e\xac\xa0\x7b\x40\xff\x7e\xcb\x48\xd0\xfd\x85\x94" - "\x6b\x72\xfc\x38\xdf\xcb\xc4\xf4\xca\x3c\x33\x2a\xfb\xeb\x43\x4b" - "\x9f\xea\xd8\x4a\x05\x03\xcb\xba\xa5\x54\xf8\x87\xcd\x08\xd1\x2d" - "\x75\x7a\x7f\xa0\xc5\x57\x2a\x1a\x20\x0b\xab\x94\x45\x23\xe7\x4b" - "\x57\x8f\x7a\xdb\x63\x39\x74\xfb\x6f\x41\xff\x77\x73\x9d\xde\x67" - "\xa2\xbf\x0c\xb3\xac\xb4\xb4\x8e\x94\xb4\x9e\xfe\xb4\x5c\x5b\x52" - "\xda\xaa\x44\xfc\x18\x3d\xfe\x02\x75\x01\xf9\xe7\xbe\xc3\x79\x92" - "\x79\xcc\xcd\x37\xaf\x83\xdc\x12\xd4\x41\x9f\x79\x1d\xe4\x56\x9a" - "\xeb\x4d\x6e\xad\x78\x9e\xcc\x70\xed\x46\xbd\xf4\x71\xbd\x70\x3d" - "\x0c\x94\x7f\x6e\x93\x2e\xff\x0b\xf0\x10\x3b\x45\xb7\x2e\xeb\xd7" - "\xa7\x5b\xdf\x49\xc6\x73\xeb\x48\x73\x5e\x6e\x1d\x07\x5e\x62\xe6" - "\xbc\xdc\x9a\x6f\xce\xcb\xad\x68\x9b\x14\x1b\xa8\x4b\xb7\x7a\x11" - "\x6f\x06\xbf\x45\xf8\x4d\xf1\xef\x62\xdf\x21\x44\xb7\x9e\xe0\x39" - "\x21\x43\x7c\xa0\xbf\x2d\x81\x6e\xe4\xe1\xf9\xa2\x40\xd5\x6d\xc4" - "\xf4\x9c\x72\x91\x75\x30\x79\x80\xff\xcf\x4f\xd1\x6d\xab\xe3\x56" - "\xcb\x4e\x25\x8b\xdb\x6f\x4d\x2e\xf7\x36\x97\xb9\x2c\x6e\x9b\x00" - "\x59\x7c\x6e\x2e\x8b\xdb\x0a\xcd\x65\x71\xdb\x42\xf0\xfc\xf9\x40" - "\x59\xdc\xb6\x56\x97\x05\xc6\x93\x0e\xb1\xad\x58\xdc\xec\x21\x3b" - "\xf8\xcc\x71\xa0\x8e\x15\x5c\x27\xc3\xed\x76\xf4\xa8\xfa\x75\x2d" - "\x21\xfb\x67\x74\x5b\x9d\xdc\x47\xb2\x6d\xb6\x18\x11\xa6\x61\x0c" - "\x1f\xf4\x7e\x1e\x08\xa2\xa7\xe3\x31\x7d\x4a\x19\x1d\xe6\x6d\xf3" - "\x76\x96\xd3\xf3\x26\xf1\x4e\xb5\x1f\xe3\xf6\xa9\xc9\x6d\xf6\xf6" - "\xdc\x7e\x79\x43\x36\xc8\x63\xd8\x2f\x3b\xe8\x33\x78\x1d\x8c\xbf" - "\x5a\xc9\x7f\xfc\x90\x14\x3a\x1a\xcc\xe5\x7f\xfb\xbe\xf4\xf2\xbf" - "\xfd\x98\xb9\xfc\x6f\xe7\x39\x9a\xcf\x43\x34\xde\x95\x6c\x8f\xc7" - "\xdb\xfa\x79\xba\x9d\xf7\x9b\x38\x84\x7f\xe8\x57\x39\xfc\x65\x79" - "\xd3\x1f\xe0\xb7\xd4\xbf\x42\x90\xa9\xe5\xea\xff\x4a\xfe\x74\xcf" - "\x96\xd1\xe6\xeb\xa1\x18\x2b\x90\xeb\x4a\x1e\xe7\x8e\xff\x14\xba" - "\xd3\x86\xdf\xd6\x53\xf4\xad\x8d\x71\xbf\xb5\x52\x93\xed\x27\xa7" - "\xe8\x8e\xf9\x4a\xb6\xdf\x7a\x3a\x59\x1e\xe3\xa3\xe6\xb2\xbd\x63" - "\x24\x64\xfb\x89\xb9\x6c\xef\xc8\x4d\xdf\x6f\xdc\x31\x15\xfc\x7f" - "\x32\x50\xbf\xef\x28\x55\x79\x68\x0d\xe7\x51\xfb\x42\xef\xf8\x88" - "\x61\x94\x1e\xdf\x71\x80\xd3\x59\xe7\x0d\x79\xb6\x02\x57\x51\xbf" - "\xae\xdf\x51\xab\xe1\x30\xe2\xdd\xef\x08\x9b\xe9\xf4\x1d\x72\x5d" - "\xef\xe6\x88\x94\x4f\xd1\x0e\x2e\x73\x39\xd1\x67\xf4\xad\xeb\x19" - "\x8e\xe3\xaf\x75\x1a\x75\xfa\x5b\x36\x1d\x8e\x6d\x8c\x82\xbd\x23" - "\x2a\xb6\x95\x11\xc3\x25\xe3\xfe\x96\xc6\xff\xb0\x19\xf5\x1a\x3c" - "\xc3\xa5\xc0\x14\xaa\xb6\xf3\xad\xad\xc9\x6d\xe7\x5b\x0b\x93\xfb" - "\xbb\xf1\x3c\xde\x72\xc4\xfd\x16\xf8\xbc\xe3\xdb\x41\xc3\x97\xd6" - "\x97\x41\xda\x12\xea\xfb\xdb\x4f\xab\xfa\xfe\xf6\x43\x29\x74\x75" - "\x9a\xd7\xf7\xb7\x6d\xe9\xeb\xfb\xdb\x2e\xf3\xb6\xf4\xed\x09\x5c" - "\xd7\x21\xfa\xf6\xc2\xe4\xb6\xf4\xed\x82\xfe\xb6\xf4\xad\x4e\xd5" - "\x96\xe8\x92\x8b\x69\x0b\xf0\x15\xd2\xb6\x3d\xbd\x7d\x7d\x59\x99" - "\xa0\x3d\x30\x4d\xd2\xd7\xc1\x18\x7f\x02\xcb\xa8\xc5\x29\xf7\xbc" - "\xfb\x4e\xd1\x84\x0a\x9e\xc7\x55\xb2\xba\xf3\x8e\x64\xfe\x26\x38" - "\xcd\x65\x35\x21\x17\xb2\xf2\x99\xcb\x6a\xc2\x54\x73\x59\x4d\x28" - "\xe5\x3d\xbe\x03\xdb\xc5\x84\x4a\xb6\xfb\xa0\x91\xf7\x50\xb4\x7d" - "\x46\x13\x9a\xa5\xfd\xef\x2a\x16\xd0\x3b\x13\xfb\x3f\xa1\xdf\xfe" - "\x8f\xe6\x36\x31\x41\xfa\x53\xa2\x0b\xf6\x7f\x2b\x0d\xe3\xbe\xa0" - "\xbf\x0f\xc8\x35\xe9\x03\x26\x74\x9a\xf7\x01\x77\xda\xcc\xfb\x80" - "\x3b\xc7\x28\x3d\xbe\xb3\x20\x59\x8f\xef\x1c\xdf\x5f\xc7\x90\xd3" - "\xff\x4c\x1f\xb0\xf9\x14\xdd\x95\x89\x7e\xb8\x5a\xd5\xc7\x5d\xbf" - "\x4d\xa1\x65\x97\x79\x7d\xdc\x19\x40\x7d\x6c\x36\xaf\x8f\x3b\x4f" - "\x98\xd7\xc7\x9d\x3c\x7e\xda\x3c\xb0\x3e\xee\xca\xfe\x72\xfd\xf0" - "\x5d\xe3\x93\xfb\xe1\xbb\xc6\x7e\xf9\x7e\xf8\x2e\x8f\x79\x1d\xdc" - "\x55\x63\x5e\x07\x77\x35\xa8\x3a\xb8\xeb\x58\x72\x1d\xdc\xb5\xaf" - "\xbf\x0e\x20\x9b\xff\x7e\x1d\x94\xaa\xf5\xdd\xef\xdc\xd1\x25\xe7" - "\xcf\xbe\x33\x2e\x44\xdf\x89\xa8\xf5\x80\xef\x74\xa8\x39\x54\x59" - "\x4f\x6f\x02\xc6\x35\xd0\x16\x7f\x27\x5f\x8b\x7b\x64\x60\xbf\xf0" - "\x9d\x52\xd8\xc9\xce\xc6\x4a\xb9\xd6\xa3\xea\x09\xf2\xdd\x0c\x38" - "\x35\x17\xf0\x9d\xb5\x9c\x17\xf5\x28\xf8\xbb\x14\xb6\xad\x80\x8f" - "\x30\x9e\x46\x57\x2c\x45\x7e\xdf\xd9\x73\x31\xfd\x66\x3a\x5e\xd9" - "\x3f\x3c\x45\xf7\xcc\x67\x98\x38\xf3\xb5\x9c\xea\x4f\xd1\xc4\x8d" - "\x78\x43\xf7\xee\xb9\x2f\xb9\xcc\x89\x63\xcd\x75\x6f\xe2\x44\xd0" - "\x5c\x6f\xae\x7b\x13\x8b\xd2\xf7\x93\x13\xe5\x9e\x54\xe8\x58\x7d" - "\x5c\xf9\xf2\x97\xce\xab\x0c\xa5\xf8\xf2\x13\xb7\xea\x7d\x5b\x57" - "\x26\xea\x66\x39\xcb\xfd\xee\x9b\x34\xfa\xae\x4b\x81\x6d\x54\x65" - "\x59\x66\x98\x94\x15\x02\x8d\x6f\xa6\xa1\x31\x6a\xde\x3e\xee\x1e" - "\xa9\xd5\xe5\x9b\x22\x33\xb5\x8d\xdc\x0d\xff\xcf\x6c\x6c\x72\xb7" - "\x5e\xff\x45\x92\x86\xa4\xfa\xbd\xbb\x34\xb9\x7e\xa9\xa8\x1c\xe3" - "\x35\x13\xb8\x0d\x46\x38\xde\x8b\xc3\xb0\xac\x03\x26\xb0\xfb\x52" - "\x71\xa6\x81\x0b\x0d\xd0\x2d\xde\x9b\x61\xaa\x5b\xf7\x64\xab\xb6" - "\x76\xcf\xc2\xe4\xb6\x76\xcf\xd8\xfe\xb6\x36\xb1\x31\x25\x4f\x5e" - "\x72\x9f\x3e\x71\xac\xec\xd3\xa1\x53\xf8\xbd\x97\xeb\xed\x7f\xc0" - "\x36\x1e\x3a\x45\xf7\x6a\xfe\xf1\xbd\x29\xf3\x15\xf7\x04\xcc\x75" - "\xf3\x9e\x36\xf0\x7c\xc8\xbc\xde\xef\x89\x98\xd7\xfb\xbd\x6c\xff" - "\x0e\x69\xe3\xcb\x4b\x67\x54\xe6\x0d\x4b\x49\x1f\x67\x6e\xbb\xee" - "\x4d\x33\xff\x71\xef\x1c\x25\xcf\x7b\xb7\x24\xcb\xf3\x5e\xc3\xfc" - "\x07\xe8\xff\x9f\xe9\x3f\x82\xa7\x28\xef\x7e\x25\xa3\xfb\x6e\x4a" - "\xa1\xa3\xdd\x5c\x46\xf7\x46\x21\xa3\xa0\xb9\x8c\xf2\x9c\xe9\xdb" - "\x6f\x1e\xfa\x3f\x0a\x0e\xec\x3f\xf2\xa6\xfa\xb6\xcb\xf9\x11\xd9" - "\x0e\x67\x44\xe1\x7f\xfa\xf5\x74\xee\x37\xf2\x78\xfc\x27\x1c\x63" - "\xa8\x20\xb8\x35\xca\x7b\x90\x72\x18\xae\xb8\x32\x75\x9d\x24\x4f" - "\xf9\xba\x7e\x41\x0e\x6f\x02\xd6\xae\xc3\xa6\xe0\xe4\xfe\x4f\xe8" - "\x70\x6a\x5e\xa6\x3a\xc5\x96\xe4\xb5\x9b\xd7\x5b\x5e\x9a\xf6\x7f" - "\xdf\x48\x55\x6f\xf7\xa5\x8c\xfd\xee\x1b\x97\xac\xeb\x90\xeb\x45" - "\xd4\x1d\xaf\xa3\x98\xd6\xdf\x9a\xd9\x6d\x9e\x2a\xba\xf2\x34\xdd" - "\xf7\x37\x89\x1f\x61\xfe\x1e\xaa\x38\x4a\x56\xb1\xe6\x29\xe8\xb1" - "\x85\xea\xfd\xa2\x67\xb3\x55\xb4\x6e\xf6\x8b\xd6\x60\xf4\x2c\xfb" - "\x6c\x5f\x3d\x49\xf7\xfd\x56\xd1\x27\x7a\x94\x2c\xee\xdb\xc3\xb0" - "\xdd\xfe\xfb\x3a\xf4\xf9\xbe\x74\xe5\xf1\xfe\x6c\xc6\x3d\xf8\x1c" - "\xef\x77\x73\x21\x83\xb5\xfa\x5a\x2e\xc2\x79\xfd\xfb\x8b\xbe\x3b" - "\x15\x69\x5f\xea\xbb\x4e\xc0\x7a\x8d\x78\xd4\x37\x9d\xdf\xdd\xa0" - "\xef\x11\xc2\xef\xad\x17\xc0\xa5\xd3\x13\x48\xa1\xa7\x15\x7d\xff" - "\x5a\x0d\xc7\x89\xc1\x70\x70\x3d\x29\xfd\xe2\x7a\xfc\x6e\x64\xb0" - "\x79\xa2\x0c\x27\x15\xbc\x30\x40\xe7\x27\xb9\x59\xd6\x8c\x23\x5d" - "\x1b\x54\x7d\xea\xe4\xcb\x54\x1b\x9c\xf4\x45\x4a\xfe\x32\x35\x77" - "\xa8\xfa\xa8\x79\xd1\x54\x1d\x9d\x54\xe3\x88\x98\xe9\xe8\xa4\x06" - "\x5d\x47\xe1\xf3\x32\xde\xe3\x29\xe9\x01\xa5\xab\x93\x9d\xe8\x27" - "\x0d\xe3\x90\x49\x72\xfc\x20\x2e\x55\x6d\x31\x04\xb8\x94\x7c\x3d" - "\xc9\xba\x3c\xa9\x6c\xb0\x79\x58\x8d\xb7\xb7\x14\x6f\x53\x7e\x9c" - "\x8c\x6b\xf2\xe4\xc1\x79\x9b\x5c\x6a\xce\xdb\xe4\xca\x64\xde\xa6" - "\x3c\x93\x92\x2e\xfd\xfb\xae\x01\x7d\xf0\xe4\xbd\xba\x9f\xea\xba" - "\x86\xfd\xcf\x29\x43\xa4\xbf\x5a\x5f\x2c\xc6\xba\xcc\xfc\xd5\xc9" - "\xed\x09\x7f\x55\xc2\x4f\x56\xfb\x5e\xeb\xe1\xaf\x36\xa4\x8e\x1b" - "\xf2\xe8\x70\x34\xd5\x67\x9d\x32\xd6\x51\x67\x46\xff\x94\x89\x9a" - "\x8d\x7c\x7e\xa0\x8d\x9c\x52\xa4\xea\x65\xca\x9e\x64\x1b\x32\xc5" - "\x93\x5c\x2f\x93\xeb\x52\xf2\x6d\x49\xae\x97\xc9\x93\xff\xab\xfd" - "\x03\x0f\x12\x33\x32\x32\xac\x19\x16\xab\x25\x03\xc9\x60\x93\x86" - "\x65\xd8\x32\x86\xe0\x19\xaa\xbd\x87\x59\x33\xac\x36\x3c\x43\xb4" - "\xf7\xd0\x94\xf0\x30\xce\x8b\xc7\xa6\xbd\x87\xa4\x84\x87\x5e\x20" - "\x7d\x98\x56\xae\x5e\xbe\x2d\x25\x3c\xe4\x02\xe9\x43\xff\x9b\xf9" - "\x69\x40\x38\x79\x9f\xd4\xfd\x8b\x96\xcf\x5f\xf8\x44\xa9\x6b\xc5" - "\x92\x27\xca\x17\xb8\xe6\x7f\xff\xfb\x0b\x96\x2e\x75\x95\x2f\x76" - "\x7d\xf7\xbe\xe9\xb7\xdd\xe5\xca\xf5\x5e\xe7\x1d\xe7\x5a\x78\xf7" - "\x75\xa5\x59\xf4\xc0\x8a\x25\x9c\xf0\xc0\x8c\xfb\x8b\x5c\x05\xdf" - "\xbd\x2f\x39\x51\x47\xb3\x64\xc1\xfc\xd2\x41\xb1\x18\x6c\x5a\xde" - "\xba\x51\x44\x1b\x47\x49\xdb\xd6\xde\x8c\x51\x8e\x1a\xab\x3f\xb6" - "\xa0\x69\x27\x91\xe8\xf5\x89\xc0\x35\xbc\xe7\xe2\x7b\x6f\x33\x13" - "\x37\x35\x54\x93\xe7\x71\xfe\x8e\xe1\x7b\x1f\x88\x83\x61\x72\xfd" - "\x33\x59\x4f\xd2\xea\xcc\x46\x78\x9d\x1c\x0e\xb6\x47\xc9\xe5\x23" - "\x3b\xf2\x5f\x82\x34\x8b\xb8\x27\x8e\xb8\x88\xb6\xb7\xf2\x9f\xdf" - "\x93\x71\x07\xab\x75\x38\xc7\x29\xca\xaf\x10\x07\x85\x0c\x8b\x7b" - "\xb6\x68\x70\xf9\xf7\xc7\xfd\xdf\x93\x6b\xb2\x2f\x5f\x4a\xf6\x97" - "\x47\x89\x13\x75\xcf\x93\x6d\xc7\xf3\xbc\x0e\x96\x3f\x31\x64\xfd" - "\xd7\xdd\x6c\x5f\xd7\x21\x3e\x44\xab\xed\x5c\x36\xc3\xc6\xad\xdf" - "\xbb\x8d\xe1\x25\xec\xa5\x44\x9c\x0f\xf0\x0b\x93\xe1\xf3\xf3\xac" - "\x80\x9d\xf6\x29\x39\x7a\xb2\x1a\xf3\x83\x95\xd5\xe4\x88\x89\xbf" - "\xdf\x9c\x4f\x96\x16\x8c\x7e\x2a\xa2\x22\x1a\x58\x72\x9a\x69\x38" - "\xe0\xa8\x10\x7f\x0f\x46\x88\x1e\xe8\xf4\x89\x4d\x67\xc8\x86\x31" - "\xa8\x25\xb0\x84\xf7\x92\xe4\xef\xdc\xf1\x05\xd9\x20\x87\x31\xa7" - "\xe9\xfe\x63\x95\x0f\x88\x98\xef\x01\xb2\xbd\xef\xad\x26\xb1\xbe" - "\xf9\xa5\x4d\x1f\x92\xed\x97\xbd\xd5\xd6\x5e\xe1\xa4\xca\x72\x5e" - "\x9f\x10\xe4\x8b\x88\x1e\x5e\x6f\x6f\x2a\x89\x31\xcc\x0f\xba\x7d" - "\x4e\x6a\x29\x8f\xd0\xaa\x13\xa2\xa7\xe6\x43\xb2\xf3\x5c\x57\x73" - "\x67\x84\xbf\x2b\xb7\xaf\x7a\x80\x32\x4e\x15\x91\xb5\xb9\x6c\x2b" - "\x05\xe7\x44\xa8\xf2\x84\xe8\x68\x2a\xf9\x94\x5a\xca\xf6\x50\x71" - "\x1b\x59\x9b\xda\xff\x44\xf2\x5b\xe9\x4d\xb6\x82\xaa\x73\xe4\x5c" - "\xf5\x04\xc7\x9d\xa3\x95\xab\x68\xf8\xca\x8f\xc8\x11\xec\x68\x43" - "\x39\x67\xe8\xd1\x63\x64\x01\x3e\xeb\xb3\x7f\x22\xe7\xb3\xb3\x78" - "\xbf\x66\x1e\xd5\x55\x91\x53\xf8\xdc\xd9\xbd\x3e\x77\x4e\xaf\x70" - "\x5f\xda\xed\x73\x8f\x6c\xf1\x00\xbe\xfd\x00\x8d\x68\xa3\x91\x07" - "\x4f\xb7\x59\xb7\x9e\xa5\x31\xae\x07\x59\x07\xee\x6f\xad\x3b\x0b" - "\xf8\xf5\xc7\x5b\xe3\xc8\x6b\xcc\x13\xcd\x3c\xde\x11\x2c\xea\xa1" - "\x38\x70\x6d\xed\xa5\x31\x75\xbd\xe4\x8c\xaf\x3b\xde\xca\xb2\xe8" - "\x5b\xdf\x94\x0f\x3b\x38\xec\xcd\xc7\xf6\xd9\x82\x4d\x9d\xd4\x1c" - "\xe9\xa5\x16\xfa\x98\x82\xde\xbf\x06\x7e\xf9\xd8\xbe\x21\x71\x34" - "\x80\xc0\x4a\xde\xf7\xa2\xf4\xc6\xd7\xcc\xdf\xc8\x55\xd3\xe6\x2a" - "\xca\xf6\xac\xa4\x61\xa7\x11\xaf\xc6\xb9\x87\x0a\x82\xd1\xbf\x06" - "\x56\xca\xbd\x9a\xab\xed\x55\xcd\x94\xd1\x12\xd9\xca\xdf\x86\x5b" - "\x63\x23\x6c\x05\xc1\x48\x2b\x05\x3d\x9f\x04\xe2\xd9\xb6\x09\x1b" - "\xe2\x64\x7f\xe3\x7c\xab\x35\x68\x3b\x4f\xc1\xa2\x08\x1d\x42\xd9" - "\x62\x93\x6d\x0e\x6c\x56\x5e\x4b\xa4\x87\xbf\x79\xc9\x15\x5d\xce" - "\xac\xcd\x4b\x68\xdc\x8e\xb3\x34\x76\xfb\x59\x72\x8b\x6e\xb7\x95" - "\xf7\x5f\xce\x3d\x93\x43\xdb\xf1\xce\x6e\x87\xee\x9c\x55\xfb\x30" - "\xc5\x70\x6d\x1f\x66\x9f\x9b\xea\x7b\xfb\xf7\x61\xf6\x76\xf5\xef" - "\xc3\x64\x5d\xe2\xbd\x98\x68\x1b\x3d\xac\xd3\x1b\x16\x91\x6d\xcd" - "\x67\x44\xb7\x54\x5b\x79\xdf\xa8\x38\x89\xf4\xc3\xa5\x31\xf2\xfd" - "\x8d\x65\xff\xcf\x3d\xc9\x7b\x65\xf3\x31\x5e\x99\x06\x23\x30\x2d" - "\x07\xcf\x18\x3c\xe8\xd7\xa7\x8d\xc7\x03\x89\x4c\x83\xbf\x3e\x0d" - "\xf6\x79\x9a\x17\x4f\x0d\x9e\xad\x78\xd0\x32\xa7\xed\xc2\x03\x3b" - "\x3e\x0d\x63\xae\x69\xe8\x6f\xa7\x35\xe1\xc1\xb8\x6a\x1a\xb4\xb4" - "\x00\x76\xa4\x00\x78\x0a\x26\xe0\x29\xc4\x83\xfc\x05\xd5\x78\x90" - "\xb7\x00\x79\x0a\x90\xa7\xe0\x08\x9e\x56\x3c\xe8\x93\x0b\x90\xaf" - "\xa0\x93\xe8\x21\x90\xf3\x10\x2c\xf5\x43\x28\xff\x21\xf4\x23\x0f" - "\xa1\xbf\x78\x08\x54\x3e\x04\xfb\xff\x10\xca\x7c\x08\xf9\x1e\x42" - "\x9e\x87\x90\xe7\xa1\x0e\x3c\x61\x3c\xb0\xe9\xd3\x91\x6f\x3a\xc6" - "\x69\xd3\x5d\x78\x40\xf7\x74\xd0\x3d\x1d\x74\x4f\x07\xcd\xd3\xe1" - "\x37\x4f\x47\x99\xd3\x41\xe3\x74\xe4\x9b\x8e\x3c\xd3\x91\x67\x06" - "\x68\x9c\x01\x7e\x67\xc0\xa7\x9f\x81\x7c\x33\xe0\xc7\xce\x80\x1c" - "\x66\x80\xde\x19\x65\x78\x2a\xf1\x80\xde\x19\x7b\xf1\xa0\xcc\x19" - "\xa0\x71\x06\xf2\x15\x22\x4f\x21\xf2\x14\x82\xc6\xc2\x5c\x3c\xe0" - "\xb1\x10\xf9\x0a\x91\xaf\x10\x7c\x16\x62\xbc\x5a\x08\xd9\x14\x62" - "\xfc\x5d\x08\x1a\x67\x82\xae\x99\x80\x9b\x09\x9a\x66\x02\xef\x4c" - "\xc8\x70\x26\xf8\x99\x09\x98\x99\xa0\x6b\x26\x78\x9a\x09\xda\x66" - "\xa2\xff\x9d\x09\xda\x1e\x06\xfc\xc3\xc0\xfd\xf0\x64\x3c\x80\x7f" - "\x18\xf8\x1e\x06\xdc\xc3\x90\xd7\xc3\xc0\xf7\x08\xe8\x7e\x04\x34" - "\x3c\x02\x98\x47\x80\xf7\x11\x94\xff\x08\xca\x7f\x04\xe5\x3f\x82" - "\xf2\x1f\x01\xfc\x23\xc0\xfd\x08\xca\x7f\x04\xf0\x45\xc0\x57\x04" - "\xb8\x22\x94\x5f\x04\x7c\x45\x28\xbf\x08\xe5\x17\x01\xa6\x08\x78" - "\x8b\x50\x7e\x11\xca\x2f\x02\xfe\x22\xc8\xa7\x88\xf3\x80\xcf\x59" - "\x28\x67\x16\xe4\x32\x0b\xf8\x67\x15\xe0\x81\x3c\x67\x01\xff\x2c" - "\x58\xa6\x59\x28\x63\x16\x64\x33\x0b\x75\x32\x0b\x78\x66\x01\xcf" - "\x2c\xe0\x98\x85\xfc\xb3\xc0\xc3\xa3\xc8\xfb\x28\xf2\x3e\x0a\xba" - "\x1e\x2d\xc1\x83\xba\x7f\x14\xf5\xf0\x28\xe0\x1e\x85\x9e\xc0\x1a" - "\xd0\xa3\x28\xe7\x51\x86\x45\x59\xb3\x51\x7f\xb3\xc1\xd3\x6c\xf0" - "\x34\x1b\x79\x66\xa3\xde\x67\xa3\xac\xd9\xa0\x73\x36\xf2\xcc\x86" - "\xfc\x67\xb7\x13\xf1\xd0\x71\x0e\xf4\x6a\xce\x58\x3c\xa0\x6b\x0e" - "\x60\xe7\x80\xaf\x39\xa0\x6f\x0e\xca\x99\x83\xfa\x9e\x83\x3c\x73" - "\x40\xd3\x1c\xd0\x33\x07\x75\x36\x17\x79\xe6\x82\x96\xb9\xd0\x8b" - "\xb9\x80\x9b\x8b\x71\xfc\x5c\xe8\xd4\x5c\xc8\x61\x2e\x60\xe7\x82" - "\x8f\xb9\xe0\x63\x2e\xf2\xcc\x85\x2c\xe6\x42\x0e\x73\xc1\xc7\x5c" - "\xd0\x37\x0f\x79\xe7\xa1\xae\xe7\x41\x7e\xf3\xa0\x8f\xf3\x90\x7f" - "\x5e\x29\x1e\xe0\x98\x87\xb2\xe6\x81\xaf\x79\xc0\x33\x0f\x78\xe6" - "\x01\xc7\x3c\xe4\x9f\x07\x5a\xe7\x21\x6f\x31\xf2\x16\xa3\xdc\x62" - "\xd0\x58\x0c\xda\x8a\x51\x66\x31\xe0\x8a\x77\xe3\x81\x4e\x15\xa3" - "\x9c\x62\xc0\xc2\x8a\x52\x31\xe8\x2c\x86\x2c\x4a\x20\xb7\x12\xe4" - "\x29\x01\x6f\x25\x28\xab\x04\x32\x28\x41\x9e\x12\xc8\xa0\x04\xf5" - "\x59\x02\xb8\x92\x28\xd1\x7c\xb4\xd5\xf9\xa0\x6b\x3e\x60\xe7\x43" - "\x66\x0f\x72\x1c\x68\x9c\x8f\xb2\xe6\x23\xdf\x7c\x94\x37\x1f\x79" - "\xe7\x83\xb6\xf9\xa0\x6b\x3e\xe8\x9a\x8f\xfc\xf3\x51\xd6\x7c\xb4" - "\xb3\xf9\x68\xa3\x8f\x81\xbe\xc7\x50\xde\x83\x3d\x2f\xbc\x42\xc4" - "\xf6\xa3\x6e\x34\xd9\xf8\x7c\x10\x69\x4b\xb6\x95\xf1\x59\x21\x61" - "\xed\xb7\xa5\xff\xb7\x9b\xe3\x7b\xb4\x78\x2b\xc3\xf3\xf9\x22\x0c" - "\x2f\xe3\x2e\x97\x71\x61\x2d\xce\x32\x30\xce\x9d\x80\xe3\x77\xd7" - "\xb6\xb2\x0c\xc6\xa1\xe7\xd7\xc2\x61\x3d\x2f\x87\x43\xb0\x49\xea" - "\xcd\x61\x37\xf2\x4d\xb3\x69\xef\x1c\xf5\xce\xcf\x63\x1e\x7c\xa1" - "\x04\xed\x36\x94\xd5\xc1\x61\xfe\xad\x95\xc7\xe7\xa0\x84\x53\xe2" - "\x2c\x03\xe3\xdc\xf2\xbc\x94\x14\x38\xc5\x67\x89\xe8\xa8\x02\xef" - "\x08\xdb\xe2\xdb\x14\xfd\xba\x9c\xd2\xa4\x59\xd2\xa7\xb9\xc9\x58" - "\x86\xe4\xdb\x40\x33\xd3\x6b\x88\x0f\x1b\xe2\x8d\x72\x89\xc8\xf4" - "\x24\x3c\x52\x2e\x4d\xda\x3b\xa4\xbd\x03\x9a\x7c\xf4\xfa\x1c\xa2" - "\x95\xc5\x72\x1e\x92\x22\x1f\x63\x9c\x65\x60\x5c\x42\x3e\x46\x38" - "\x5d\x3e\x61\x8d\xcf\x21\x26\xf2\x31\x4b\xb3\xa4\x4f\x93\xf2\x49" - "\x94\x61\x90\x8f\x8c\x33\x91\x8f\x1e\x6f\x90\xcf\x43\x23\x35\xf9" - "\x18\xf0\xb0\x3c\x0a\x3a\xd5\xfb\x21\xd2\xc2\xa1\x64\xf9\xb8\x6d" - "\xfd\x65\xb9\x53\xf5\xc7\x18\x67\x19\x18\x67\x94\x8f\x3b\x55\x7f" - "\x34\x3e\xdd\x66\xfa\x63\x96\x66\x49\x9f\xa6\xcb\xc7\x9d\xaa\x3f" - "\x32\xce\x5c\x3e\xee\x14\xfd\x99\x3e\xbe\x5f\x3e\x6e\x83\xfe\x4c" - "\xcf\xd6\xde\x2e\xed\x4d\x9a\x7c\xf4\x76\x3f\x54\x2b\x8b\xdb\xf8" - "\xd0\x14\xf9\x18\xe3\x2c\x03\xe3\x12\xf2\x31\xc2\xe9\xf2\xe9\xd1" - "\xf4\x60\xa8\x89\x7c\xcc\xd2\x2c\xe9\xd3\xa4\x7c\x12\x65\x18\xe4" - "\x23\xe3\x4c\xe4\xa3\xc7\x1b\xe4\x33\xa3\x50\x93\x8f\x01\x0f\xcb" - "\x63\xc6\x38\xed\xad\x87\x5d\xba\xfd\x61\x5a\x0c\x76\x63\x68\xc2" - "\x6e\x84\x54\xfb\xd7\xed\x5c\x7c\x9b\x4c\x0b\xa7\xa4\x59\xd2\xa7" - "\xb9\x8d\xf9\x7a\x52\xf2\x59\xf5\xb4\x2a\xcd\x86\xb0\x8c\xab\x14" - "\xdd\x5c\xe7\xd6\xf8\xe5\xfd\xe5\x56\x69\xf6\xc4\x04\xc6\x72\x61" - "\x18\x03\x1d\x06\x7e\x75\xfb\x9c\x8e\xe7\xb8\xb1\x1e\x4c\xf8\x36" - "\xa6\x87\xe0\x43\xe9\x76\xad\x1f\xbf\xb2\xf3\x8c\x1f\xe9\x85\x2a" - "\x5c\xe8\xd1\xde\xba\xfd\x0f\x6b\xf0\x43\x52\x68\x09\x6b\x65\x0d" - "\x31\x91\xbf\x31\x2d\x55\xfe\x86\xb4\x01\xf2\x37\xe6\x4b\x95\x7f" - "\xd8\x20\xb7\x21\x69\xe4\x6f\x06\x93\x2a\x7f\x13\x98\x24\xf9\x27" - "\xf8\x35\x91\x7f\x12\xcf\x26\xf2\x4f\xe2\x3b\x59\xfe\x0f\x67\xeb" - "\x76\xa1\x1f\xbf\x51\xfe\x33\x8f\xa9\xf0\xcc\xb0\xf6\x0e\x24\xcb" - "\xdf\x9d\xaa\xff\x5a\x59\x6e\x33\xfd\x37\xa6\xa5\x91\xbf\xdb\x4c" - "\xff\x8d\xf9\x06\x91\xbf\x3b\x9d\xfe\x9b\xc1\x0c\x22\x7f\xb7\x99" - "\xfe\x27\xf8\x4d\x2f\x7f\x77\x3a\xfd\x4f\xe2\x3b\x59\xfe\x8f\x6c" - "\x48\x96\xbf\x3b\x45\xff\x1f\xd1\xf4\xff\x11\x4d\xff\x1f\xc9\xd3" - "\x7d\xb8\xe8\xe5\x65\xc3\xb8\x7c\x7e\x1b\xed\xa7\x21\x6c\x49\x0e" - "\x2b\x7f\xce\x90\x6e\x95\x76\x52\x8b\xd3\x65\x9b\xb0\xef\x03\xe3" - "\x2d\xe6\xf1\x6e\xd2\x71\xea\x3e\x9e\x96\x9e\xe4\xe7\x69\x71\x06" - "\x9b\x5b\xd4\xc1\xef\xfe\xbc\xcc\x5f\xd1\x11\xed\xdd\xa6\xbd\x75" - "\x7d\x4b\xf8\x3d\x92\x6f\x13\xff\x49\x8b\x1f\xe0\x3f\x0d\x8c\x77" - "\x1b\xe1\x7b\x0c\xf0\x56\xa3\x5c\x53\x7d\x39\x9d\x1f\x2d\x7d\x80" - "\xaf\xa7\xf3\x96\x3e\xdd\x50\xae\x56\xa6\xae\x4b\x66\x3c\xa5\xa4" - "\x25\xf1\x65\x4c\x0b\x61\x1c\x66\xf4\x0d\x75\xfd\xd1\xd2\x02\x2a" - "\x3c\x4b\x93\xe7\xac\x3d\x7a\xfb\xd5\x6d\xa7\xa1\xec\x24\x7f\xcb" - "\x50\x6e\x92\xbf\x35\x30\x7e\x80\x3c\x75\xf8\x54\x79\x26\xf9\x7e" - "\x26\xf2\x4c\x4d\x4f\x95\x67\x4a\x7a\x92\x3c\xc3\x46\xdb\x68\xc6" - "\x93\x89\x3c\x13\x7c\x25\xcb\x73\x76\x9e\xd1\x97\x4c\x96\xe7\x6c" - "\x6d\x1c\x32\xdb\xad\xbd\xa9\x5f\x9e\xee\x54\xfd\x4c\xf2\xcf\x92" - "\xcb\x75\x9b\xe9\xa7\x16\x6f\x26\x4f\xb7\x99\x7e\x26\xf9\x8a\xe9" - "\xe5\xe9\x4e\xa7\x9f\x29\xe9\xa9\xf2\x74\x9b\xe9\x67\x82\x27\x73" - "\x79\xba\x4d\xf4\x73\xce\x16\xa3\xef\x99\x2c\xcf\x39\x25\x2a\x3c" - "\xc7\xab\xbd\x0b\xfa\xed\x9b\x7b\xa8\xb2\x25\xee\xa1\xc9\xf6\x2d" - "\x11\xb6\x24\x87\x75\xfb\x96\x48\x37\xd8\x37\xf7\x50\x73\xfb\x96" - "\x14\x6f\x31\x8f\x67\xfb\xe6\x36\xda\xf4\x0e\x2d\x3d\xc5\xbe\xc9" - "\x38\x83\x7d\x9b\x7b\x44\xd9\x37\xb7\xc1\x9f\x9c\xbb\x4b\x7b\xef" - "\xd3\xde\x0d\x03\xed\x9b\x7b\xa8\xb9\x7d\x93\xf1\x26\xf6\x2d\x35" - "\xde\x6d\x84\x37\xb1\x6f\xee\xa1\x83\xdb\x37\xf7\xd0\xc1\xed\x5b" - "\xba\x74\x43\xb9\x03\xec\xdb\x40\x9e\x52\xd2\xd2\xd8\x37\x96\xdd" - "\xbc\x56\x73\xfb\x26\xd3\x1a\x54\x78\x9e\x26\xcf\x79\x5b\x06\xda" - "\xb7\x44\xd9\x29\xf6\x2d\x51\x6e\x8a\x7d\x4b\x8d\x1f\x20\xcf\x14" - "\xfb\xe6\x1e\x3a\xb8\x7d\x73\x0f\x1d\xdc\xbe\xa5\x4b\x4f\x92\x67" - "\x8a\x7d\x1b\xc8\x93\x89\x3c\x4d\xec\x1b\xcb\xac\xc4\x65\x6e\xdf" - "\x38\xad\x58\xf3\xf3\x4a\xec\xea\x5d\xac\xc6\xcb\xe0\x8f\xe7\x8c" - "\x8c\xed\xd0\x10\xb6\x24\x87\x55\x3b\x34\xa4\x27\xda\x21\xc7\x99" - "\xb5\xc3\x94\x78\x8b\x79\xbc\x9b\x74\x9c\x7a\x3b\xd4\xd2\x93\xda" - "\xa1\x16\x67\x68\x87\xf3\x0b\xf8\xdd\x9f\x97\xf9\x9a\x9f\xab\xbd" - "\x65\xf8\x24\x7d\xaf\x9d\xd7\x8c\xba\xac\x0e\x71\xb8\x74\xbc\x5c" - "\xc3\xd9\x3e\x4a\x1c\xd9\xfe\x92\x68\xec\xf6\x3f\x36\x21\x44\x1b" - "\xe5\x19\xd1\x1b\x11\xde\x88\xf8\xc3\x2e\x22\x9e\x73\x6f\x2c\xe3" - "\xb5\xa1\xc7\x8a\x42\x94\xd5\x94\xba\x36\x24\xfc\x53\x3a\x78\x5d" - "\xf6\x57\x55\xad\x43\x84\xf5\x9f\x3a\x5a\x3a\x3a\x69\xf7\xca\x8e" - "\x21\xbe\x3f\x90\x35\x18\x3d\x49\xb7\x8c\x24\x27\xef\x0f\xa8\x7f" - "\x49\x84\xf0\xee\xc0\xd3\xe9\x59\xc9\x67\x60\x3d\xf6\xfa\x8d\xb5" - "\x34\xf2\x8f\x7c\xf6\x89\x5c\xf3\x7a\xec\x9d\xfe\x35\xaf\xea\x8f" - "\x9a\xdb\x03\x86\xf5\xae\xea\xd5\xae\x01\xeb\x5d\x8f\x5f\x27\xe3" - "\x0e\x8a\xa8\x5a\xdf\x8a\x85\xb4\xf8\xcc\x94\xf8\x0e\x15\xbf\xe0" - "\x4c\x4a\x7c\x8f\x16\xff\x51\x4a\x7c\x58\x8b\x1f\xee\xd2\xd6\xd3" - "\x5a\x98\x8e\x15\xbc\x9e\x56\xfa\x77\x5e\x4f\x6b\x29\xd5\xd6\xd3" - "\xe4\xd9\x02\xa5\x1f\x89\x9f\x55\x13\x9f\x99\x84\xdf\x3f\x66\xfa" - "\xc5\x41\xd2\x69\xcf\x44\xdc\x43\x1c\xb7\xe5\xcf\x64\xc3\x23\xd7" - "\xd2\x84\xff\x7b\xd3\x78\x1d\x8d\xd7\xd3\xea\x9f\x27\xda\xf6\x92" - "\x38\x56\x37\x4a\xb4\xd6\xbd\x24\x9a\xba\xfd\xdf\x0f\xe8\x6b\x6a" - "\x1b\x10\xb7\x01\x71\x3f\x42\x3a\xaf\xab\xb1\x4c\xde\x9f\x13\x20" - "\x3e\x5b\x4b\xd4\x34\xd7\x3a\x2c\xe4\xd9\x74\x96\x6c\x7c\x96\xd9" - "\x5a\xc8\x37\x58\x1e\x91\xdf\x33\x6f\x7e\x49\xb4\xc7\xad\xb9\xd4" - "\x52\xde\xce\xeb\x39\xa3\xd6\xc4\xf9\x1b\xb5\x4f\xa9\x2a\x22\x4e" - "\xf3\x77\xcf\x4c\x43\x71\xc5\x3f\xf3\xf9\x89\x96\xc6\x02\x22\x3e" - "\x8b\xa2\xfe\x52\xa2\x1d\x97\x82\x46\xd0\x74\x78\x21\xd7\x77\x69" - "\x7e\x88\x02\xe5\x6a\x6f\xe4\x6a\x3b\x9f\x95\x7c\x92\xbe\xbf\x41" - "\xf8\x45\x0f\xf3\xe6\x88\x55\x13\x9f\xd5\x22\xac\x72\xcf\x4e\xd9" - "\x36\xfc\xde\xa2\x9f\xd7\xe2\x27\x1b\xc3\x04\x4f\xf4\x10\xd3\x1c" - "\xa2\xef\xb7\xbd\x5f\x19\xe0\xfc\x95\x2c\x1b\xe1\xf7\xe9\x38\x2c" - "\xf2\xbc\x17\x3f\xd9\xf9\xbc\x97\x2f\x83\x43\x64\x35\xe5\xbf\x5f" - "\x12\x26\x5e\x63\x0c\xb6\xf6\xd0\xfb\x95\x27\x65\x1a\xc3\x88\xac" - "\xc6\xa4\x34\x3d\x5f\xd6\x2a\xf1\x77\x94\x9d\xcf\x75\xc9\xe7\xb1" - "\xc5\xd4\xd9\x48\xd9\x7c\x76\x47\xa0\xea\x63\xae\xeb\x3f\xd4\xa3" - "\x6e\xb4\x33\xe5\xa0\x8b\x0b\x8e\xf0\xb9\x3b\x7c\x8e\x9c\x3c\x43" - "\xce\x3a\x9e\xc4\x0a\x77\x76\xe2\x1c\xb9\xff\x0f\xce\x90\x43\xdd" - "\x38\x77\x58\xd5\x19\x72\x09\xfe\xe7\x48\x19\xe6\xb2\xae\x72\xdc" - "\x8b\xf3\xc8\x18\xef\xe4\xf8\xcd\x7e\x71\x44\xd7\x13\x4e\x63\xbe" - "\x90\x46\x5a\x5a\xeb\xc0\xb4\xc7\x3a\x38\x8d\xd7\xd5\x82\xa5\x31" - "\xfa\xe5\xe3\x31\xeb\xfa\x5e\xb2\xf1\x1a\x9b\x86\x57\xca\x56\xad" - "\xb3\x3d\x5e\x92\xbc\xce\xf6\xa4\x07\x8f\x17\x4f\x0d\x9e\xad\x78" - "\x76\xe1\xd9\x87\xa7\x15\x4f\x07\xd1\x53\x00\x7b\x2a\x1b\x0f\x2c" - "\xc9\x53\xe3\xf1\x4c\xc4\x03\xab\xf1\x14\xb4\xee\xa9\x22\x3c\xa5" - "\x78\x80\xed\xa9\x0d\x78\x76\xe2\xd9\x8f\xe7\x18\x9e\x08\xd1\xc2" - "\x91\x78\x90\x67\x21\xe0\x17\x02\x6e\x21\x64\xba\x10\xe5\x2c\xac" - "\xc3\x03\xd8\x85\xbb\xf1\xec\xc5\xd3\x88\xe7\x04\x1e\xe4\x79\x1a" - "\x65\x3d\x3d\x16\xcf\x64\x3c\xc8\xf3\xf4\x5a\x3c\xa0\xeb\x69\xc0" - "\x3d\x0d\x9a\x9e\x6e\xc3\xd3\x89\x87\x61\xa3\x44\x8b\x6c\x78\x50" - "\xce\xa2\x71\x78\x90\x67\xd1\x1c\x3c\xa0\x67\x51\x2d\x1e\xe4\x59" - "\x04\x5a\x16\x81\x8f\xc5\x80\x5b\x0c\x1e\x16\xbb\xf1\x80\x87\xc5" - "\x80\x5d\x3c\x15\x4f\x21\x1e\x94\xb3\xb8\x12\x0f\xf2\x2c\x06\x4d" - "\x8b\x41\xcf\xe2\x76\x58\x35\xe4\xf1\x80\x16\xcf\x04\x3c\x80\xf3" - "\x40\x56\x1e\xc8\xca\x03\x5e\x3d\x80\xf5\x80\x0f\x0f\xf8\xf0\x80" - "\x67\x0f\xe8\xf7\x80\x9e\x67\xc6\xe0\x01\xfe\x67\x80\xf3\x19\xc0" - "\x3d\x03\x1a\x9e\x01\xdd\xcf\x80\xde\x25\x4e\x3c\xa0\x61\x09\xd2" - "\x97\xa0\xfc\x25\x28\x7f\x09\xf0\x2e\x41\x6b\x5d\x02\xd8\x25\x28" - "\x7b\x49\x13\x1e\xf0\xb7\x14\x3c\x2d\x05\xdc\x52\xe0\x59\x0a\xb9" - "\x2d\x45\x39\x4b\x8f\xe0\x01\xae\xa5\x9c\x0e\x7c\x4b\x51\x5e\x39" - "\x68\x2c\x47\x99\xe5\x80\x2d\x07\xef\xe5\xe0\xa3\x1c\x74\x95\x83" - "\x87\x72\xc0\x2d\x03\x9e\x65\xb9\x78\x50\xce\x32\xd0\xbe\x0c\xb8" - "\x96\x21\x7d\x19\xf0\x2d\x43\x79\xcb\x40\xdf\xb2\x00\x1e\xc8\x69" - "\x19\xe4\xb4\x0c\x38\x97\xe7\xe0\x81\x3c\x97\xa3\xde\x96\xa3\xfc" - "\xe5\x90\xe7\x72\xd0\xb7\x1c\x79\x96\x23\xcf\x72\xf0\xbb\x1c\xf8" - "\x97\x83\xd6\xe5\xc8\xb7\x1c\xf9\x56\x80\x8e\x15\xe0\x6d\x05\xe8" - "\x58\x01\xbd\x58\x01\x3a\x56\x34\xe0\x01\xdc\x0a\xc8\x66\x05\xf0" - "\x7a\x41\xa7\x17\xf2\xf4\x02\xc6\x0b\xfe\xbd\xe0\xdf\x0b\xba\xbc" - "\xe8\x9d\xbc\xa8\x67\x2f\xe0\xbd\xc0\xed\x45\x1d\x7b\x01\x5f\x01" - "\x7c\x15\x80\xab\x00\x5f\x15\xc0\x57\x01\xba\x2b\x40\x43\x05\x60" - "\x2a\x80\xb7\x02\xe5\x57\xa0\xfc\x0a\x94\xbf\x12\xe5\xaf\x04\xfc" - "\x4a\xe0\x5e\x89\xf2\x57\x02\x7e\x25\xf0\xad\x04\xdc\x4a\x94\xbf" - "\x12\xf8\x9e\x45\xf9\xcf\xa2\xfc\x67\x01\xf3\x2c\xf0\x3e\x8b\xf2" - "\x9f\x45\xf9\xcf\x96\xe0\x01\x8f\xcf\x42\x37\x9f\x45\x19\xcf\xee" - "\xc1\x03\xdc\xcf\x02\x6f\x25\xf0\x56\x42\x86\x95\x90\x47\x25\xf2" - "\x54\x22\x4f\x25\xe8\xa9\x84\x5c\x2a\x51\x6f\x95\xc8\x57\x89\x7c" - "\x95\xa0\x0b\xc6\x8d\x2a\x51\x56\x25\x7a\xc4\x55\x28\x6b\x55\x1e" - "\x1e\xc0\xad\x02\x2d\xab\x80\x77\x15\xe8\x5e\x05\x7a\x56\x01\x66" - "\x15\xf4\x6b\x15\xea\x67\x15\xea\xb1\xca\x8e\x07\x74\x55\x01\xbe" - "\x0a\xb8\xab\x50\x4f\x55\x80\xaf\x02\xbe\xaa\x76\x3e\xb9\x11\xd6" - "\x0e\xf8\x7c\xa0\xdb\x07\x1a\x7c\x80\xf1\x01\xaf\x0f\xe5\x3f\xc9" - "\x6f\xd0\xe0\xab\x61\xef\x07\x0f\x68\xf7\x35\xb2\x67\x89\x07\xf9" - "\xaa\xa1\x73\xd5\xd0\xf9\x6a\xe0\xae\x86\x5c\xaa\xc1\x6b\x35\xf4" - "\xb8\x9a\xdb\x7c\xc9\x36\xd8\x9f\x57\xfe\xcc\xfe\x86\xb2\x11\xfa" - "\xdb\xd7\x06\x1f\xf6\x93\x32\x63\x38\x8c\xb0\x25\x39\xec\x36\xa6" - "\xf7\x20\xdd\x6a\xcc\xef\x2b\x92\x71\x24\x8a\x93\xe2\xc3\x5a\xbc" - "\xc5\x3c\xde\x9d\x04\xdf\x57\xcc\x7e\x51\x32\x4d\x3a\x9d\x9c\xa6" - "\xd3\x65\x8c\x0b\xc1\x8e\xf1\xbb\xaf\xd8\x6d\xed\xe7\xeb\x49\xaf" - "\x0a\x3f\x59\xc3\xef\x6d\x9a\xdd\x95\x78\x8f\x49\xbc\x09\x19\x80" - "\x8e\x0e\x3d\x0e\xb4\x90\x21\x3e\x6c\x88\xb7\x98\xc7\xbb\x8d\xf0" - "\x3d\x06\xf8\x64\xd9\x14\x62\x4c\xc2\x32\x2b\xc6\x98\x04\x72\x4b" - "\x95\xb5\x49\xba\x65\xf0\x74\xf7\x00\x7e\x92\x64\x97\xc2\x53\x92" - "\x0c\x53\xf8\x4a\x96\xe5\x53\x3b\x25\x4c\x02\xa7\x51\xa6\x4f\x95" - "\xab\xf0\x53\x1b\xb4\x77\x29\xcb\x15\xb0\x5c\x27\x43\x52\xca\x96" - "\x71\x26\xf2\xd4\xe3\x53\xe5\xa9\xc5\x0f\x90\xa7\x0e\x9f\x2a\xcf" - "\xb0\x26\x8f\x21\x69\xe4\x99\x9a\x9e\x2a\xcf\x94\xf4\x24\x79\xca" - "\x32\x4d\xe4\x99\xe0\xc9\x44\x9e\x09\xbe\x92\xe5\xb9\x30\xa2\xc9" - "\x53\xc3\x69\x94\xe7\xc2\x46\x15\x5e\x78\x42\x7b\xef\xed\x97\xa7" - "\x3b\x55\x3f\x65\x9c\xb9\x3c\xdd\x66\xfa\xa9\xc5\x9b\xc9\xd3\x6d" - "\xa6\x9f\x9a\x3c\xdc\xe9\xf4\x33\x35\x3d\x8d\x3c\xdd\x66\xfa\x29" - "\xcb\x34\x97\xa7\x3b\x9d\x7e\x26\xf8\x4a\x96\xe7\xa2\xc9\xfd\xf2" - "\x74\xa7\xe8\xe7\xa2\x91\x2a\xbc\x68\x9c\xf6\xb6\x69\xf2\x64\xfb" - "\x33\x34\xa5\x6c\x19\x67\x22\x4f\x3d\x3e\x55\x9e\x5a\xfc\x00\x79" - "\xea\xf0\xa9\xf2\xec\xd1\xf4\x6b\x68\x1a\x79\xa6\xa6\xa7\xca\x33" - "\x25\x3d\x49\x9e\xb2\x4c\x13\x79\x26\x78\x32\x91\x67\x82\xaf\x64" - "\x79\x2e\xae\xd5\xe4\xa9\xe1\x34\xca\x73\x71\xa9\x0a\x2f\xae\xd4" - "\xde\x85\x9a\x3c\x25\x7f\x9a\xfd\x18\x9a\xc2\x77\x47\xd5\x31\x65" - "\xa7\x98\xe7\xf8\x27\x49\xe9\xe1\x94\x74\xcb\xe0\xe9\xee\xd4\xfc" - "\x3d\x29\xf9\xad\xc6\xf4\x2a\xcd\xe6\x71\xbd\x54\x1d\x4b\xd0\x67" - "\x8d\x17\x27\xd3\x51\xa5\xd9\x3f\x13\x38\xcb\x97\x83\x4b\xa1\xcb" - "\x20\x0f\x96\xe5\x97\x91\x49\x6a\x9f\x66\x26\x97\xe4\x7a\xf2\x44" - "\x75\xbb\xdc\x5f\x96\xdb\x6a\x2c\x0b\x30\xfb\x55\x3d\x79\x34\x7b" - "\xe2\xd9\xa9\xdb\x13\x2d\xcf\x10\x13\xda\xc2\x5a\xb9\x43\xd2\xd4" - "\x97\x31\xdd\xac\xbe\x0c\xe9\xa6\xf5\x65\xcc\x6f\x56\x5f\x61\x83" - "\x7c\x87\x0c\x52\x5f\x66\x70\x66\xf5\x65\x02\x37\xa0\xbe\x12\xf2" - "\x48\x53\x5f\x03\x64\x62\x52\x5f\x03\xe4\x92\x5c\x5f\x4b\x76\xeb" - "\x76\xaa\xbf\xac\xd4\xfa\x5a\xb2\x50\xd5\xd3\x12\xad\x3f\x5d\x52" - "\x98\x5c\x5f\x6e\xb3\xf6\xa5\x95\xeb\x4e\xd7\xbe\x8c\xe9\x83\xd4" - "\x97\x3b\x5d\xfb\x32\xe6\xbf\x40\x7d\xb9\x07\x6b\x5f\x66\x70\x17" - "\xa8\x2f\x77\xba\xf6\x95\x90\xc7\xe0\xf5\xe5\x1e\xac\x7d\x0d\x90" - "\x4b\x72\x7d\x95\xcf\x49\xae\x2f\xb7\x49\xfb\x2a\x1f\xa3\xea\xa9" - "\x7c\xa2\xf6\x96\xfd\x4b\xef\x27\xbc\x5e\xd0\x4f\x0f\x87\x53\xed" - "\xbd\x16\x67\x19\x18\x97\xec\x53\x6b\x70\xfd\x7d\x09\xcb\xdc\x10" - "\x3f\xa0\xbf\x4a\x4e\xb3\xa4\x4f\xeb\x2f\x87\xe3\x52\xfd\x6c\x9d" - "\xe6\x54\xb9\xe9\x74\x27\xcb\x6a\x59\x07\xbf\x15\x1e\x63\x7f\xb1" - "\x2c\xa0\xc2\xcb\x8e\x69\x6f\xdd\x9f\x91\xbe\xa4\x8e\x83\xf3\xa5" - "\xf3\x4f\xb5\x34\x53\xff\x74\x60\x9a\x3b\x35\x5f\x92\xff\x9d\x94" - "\x96\xc6\x07\x4f\x81\x31\xf5\xc3\x2f\x0c\x93\x42\x87\xc1\x1f\xbf" - "\x10\xcf\x7a\x3d\xa4\xe3\xdb\x98\x1e\xc2\x78\x3b\xd5\x37\x37\xe2" - "\x0f\x61\x5c\xae\xe4\xbe\x42\xf3\x8b\x96\x1f\x33\xfa\xe7\x26\xb4" - "\x0c\xf0\x67\x0d\x74\x0c\xf0\x67\x07\xa6\x99\xca\x3f\xe1\xaf\x9b" - "\xc8\x7f\x80\xcf\x6e\x22\xdb\x01\x7e\xfb\x85\x61\x06\xc8\x3f\xe1" - "\xbf\x5f\x88\x67\x13\xf9\x27\xf1\x9d\x2c\x7f\x6f\x43\xaa\x2f\x9f" - "\x2c\x7f\x6f\x99\x92\xbb\x77\xad\xf6\x2e\x34\xfa\xf3\xe6\xb4\xb8" - "\xd3\xe9\xff\x00\xff\x77\x60\x5a\x3a\xf9\xbb\xd3\xe9\xff\x00\x1f" - "\x3f\xbd\x6c\xdd\x83\xe9\xff\x00\x5f\x7f\xa0\xfc\xdd\xe9\xf4\x3f" - "\x89\x67\x73\xf9\xbb\xd3\xe8\xff\x4a\x57\x5f\x8a\xef\x9f\x2c\xff" - "\x0a\x4d\xff\x57\x6a\xfa\x5f\x71\x4c\xd9\x67\x77\x52\x7f\xc1\xe1" - "\x81\xf6\x59\xc6\x59\x06\xc6\xa5\xda\x67\x09\x67\x62\x9f\x55\xbc" - "\xb9\x7d\x4e\xa4\x99\xd8\x67\x3d\xcd\x68\x9f\xdd\xc9\xbe\xbd\x81" - "\xe6\x81\xf6\x59\xd1\x9d\x6c\x9f\x9f\xad\x51\xf6\xd9\x9d\xe2\xcf" - "\x3f\x5b\xa2\xc2\xcf\x6a\xe3\xf8\x67\x0b\xcd\xed\xb3\x7b\x68\x7a" - "\xfb\x2c\xd3\xd2\xd8\xe7\xd4\x34\x77\x6a\xbe\x34\xf6\x19\x69\x17" - "\xb4\xcf\x12\xe6\x02\xf6\x39\x1d\x4c\x0a\x1d\xa6\xf6\xd9\x9c\xe7" - "\x7e\xfd\x33\xe7\xdb\x98\x1e\xa2\xca\x40\x7a\xfb\x2c\xd3\x6b\x94" - "\xdc\x2b\x77\x6a\xef\x72\x73\xfb\x9c\xa0\xc5\xc4\x3e\x27\xe8\x30" - "\xb1\xcf\xa9\x69\xa6\xf2\x37\xb1\xcf\x09\xf9\x0f\x62\x9f\x13\xb2" - "\x1d\xc4\x3e\xa7\x83\x19\x20\x7f\x13\xfb\x6c\xce\xb3\x89\xfc\xd3" - "\xd8\x67\x96\x6f\x55\x5e\x7a\xfb\x2c\xd3\xed\x4a\xee\x55\x63\xd5" - "\x7b\x55\x44\xca\x1f\xbc\xf3\x9c\x68\xaa\x4d\xd0\xe2\x2c\x03\xe3" - "\x92\x6d\x82\x06\x37\xc0\x26\xe8\xf1\x66\x36\xc1\x90\x36\xc0\x26" - "\xf4\xa7\xf5\x97\xc3\x71\xa9\x36\x41\xa7\x39\xd5\x26\xe8\x74\x27" - "\xdb\x04\x5f\x1d\xbf\x15\x1e\xa3\x4d\xf0\x69\xb6\xc0\x27\x75\xf3" - "\x24\x3d\x76\xcc\xb8\xde\x9c\xbc\xce\x59\xbd\x4b\x5f\x6f\x3e\xec" - "\xe2\xf5\xc6\xea\x7d\x21\xca\xf2\x70\x98\xd7\x3b\x6b\x21\x4b\x7d" - "\xfd\x53\x5f\xaf\xe2\x32\xd6\x8e\x12\x21\x0e\x4f\x3a\x43\xc3\x0e" - "\x17\x10\xbd\x32\x4a\xb4\xa9\xf5\xeb\xea\x1e\xfd\xec\xe9\xf5\x88" - "\xe3\x35\x6c\xce\x63\xf6\xbd\xac\xfe\x7d\x66\xcc\x4f\x57\xc5\xac" - "\x64\x09\x56\x7f\x4c\xc1\xad\xa2\xba\x25\x7a\x8c\xe6\x95\x93\x35" - "\x9e\xf1\xd4\x5f\x78\x1d\xcd\x51\x49\x43\xf9\xcd\xeb\xc1\xa7\x69" - "\xf5\x94\xe2\x08\x0d\x15\x6b\x90\x66\x45\x9a\x97\xbe\x63\x48\x53" - "\x67\xac\xf4\xe7\xbb\xc9\x90\x26\xef\xa5\xb8\xe9\x33\xbe\xf3\x74" - "\xb5\x3b\x95\x9e\xff\x22\x2d\x1f\x0c\x42\xcb\x99\xf4\xb4\xf8\xe5" - "\xb7\x7f\x37\x75\x92\xc5\xb5\x88\x2e\xf9\x8c\x56\xef\xe5\xb0\xbc" - "\x9f\x70\x8d\x59\x39\xfe\x3b\xb5\xf4\x21\x86\x74\x43\x59\xfe\x59" - "\x26\xf9\x8d\xe5\x55\x5c\x00\xff\xcb\x17\xc0\xff\xdb\x0b\xe0\x3f" - "\xce\xeb\xd2\x90\x9d\x23\x6e\x4d\x86\xbb\x39\x2a\xcf\x4c\x00\xdc" - "\x69\xc0\xad\x91\x1f\x09\x8b\x35\xb3\xff\xe2\xbb\x5a\x7e\x07\x2e" - "\xef\xdb\xd8\x84\xf4\x60\xb4\x5d\xae\x99\x4f\x06\xa5\x37\x47\x92" - "\xf2\xdc\x91\x4a\xdb\x88\xa8\x4e\x9b\x4c\x9f\x99\x4a\x1b\xd2\x6f" - "\x32\xa4\x2f\xeb\xaf\x77\x7f\x38\x5d\xbd\xf3\x5a\x7c\x70\x2b\x11" - "\xdf\x8b\x7d\xd8\x46\xc4\xe7\x0b\xd7\x26\xce\x54\x58\xd3\x14\xa2" - "\xd5\x4e\xc3\x79\xea\x7c\xd6\xd8\x55\x2d\x91\x08\xf1\xf7\xae\xda" - "\xf9\xb3\x5f\xaf\x3a\x47\x97\xf2\xdd\x1e\x7c\x3f\x4f\x71\xac\xc0" - "\x7a\xb8\x92\xdb\xd3\x5a\xbb\x9e\x37\xdd\xd9\x0d\x5c\xae\x56\xa6" - "\x3c\x9b\x19\x79\x26\xea\x79\x18\x37\x9f\x47\x1c\x87\x5e\xaa\xfb" - "\x07\x3b\x79\xbd\xfb\xeb\xbe\x0a\x2e\x8b\xcb\x29\x21\xad\x1c\x0f" - "\xf2\xec\x1c\xa4\x9c\x41\xf8\x5b\xbb\xfb\xe2\xf9\x23\x9d\xbf\x8e" - "\x0b\xf0\x37\x48\xb9\xcf\x8d\xbd\xf8\x72\x73\xb4\x72\x9f\x2b\xb9" - "\x78\xb9\x3e\x57\xfb\xe5\xe5\x9a\xab\xc9\xf5\xb9\x23\x17\x90\xab" - "\x59\x39\xd1\x2f\x5f\x8e\x4b\x2b\xe7\x07\xb9\x66\xe5\x18\xed\xa4" - "\x3c\xe7\x83\xcb\x50\x77\x3d\x58\xd0\xe6\x32\x91\xaf\xcc\x78\x87" - "\x3b\xc7\x23\xae\x52\xbf\xc3\xbd\xff\x2c\xeb\x1f\xbc\x5c\xdc\x20" - "\xcf\x79\x89\x87\xe8\x07\x75\x7c\xc6\xfc\xe4\x55\xfa\xbd\xe9\x32" - "\xcf\x9e\xc1\xee\x8e\xe7\x7b\x4e\x85\x28\x92\xe7\xe3\xab\xbb\x9a" - "\x7e\xf0\x37\x3e\x7b\x59\xdd\x79\xfc\x83\x88\x6a\x83\x3f\x88\x00" - "\x77\xde\x20\x38\xe4\x9d\xca\x63\x9d\xbe\x2f\xe4\xfd\xed\x2b\xc9" - "\x16\x74\x2a\xdd\x38\x45\x3f\x9c\xa9\xce\x80\xfe\xe1\x04\x9d\x1f" - "\xed\x8c\x7d\xe0\xfd\xe1\x54\x9d\x9f\x10\xfd\x50\x9e\xf3\x23\xd6" - "\xff\x67\xf5\x60\xe7\x9c\x0b\xfb\x71\x79\xc7\x39\xca\xb0\x9f\xa2" - "\x9a\x9d\xf5\xea\x6c\x74\xfd\x4e\x67\x1b\xca\x3b\xa7\xe3\x8f\x58" - "\xab\xb9\xdc\x3d\x26\xe5\x36\xea\xe5\x0a\x3f\x65\xb3\xcc\x5c\xd7" - "\xc8\xbc\x67\x22\x99\xc7\x03\xa2\xe6\x78\x80\xef\x0a\x3a\xe5\xe2" - "\xfb\x89\x6b\x76\x92\x3c\x83\xe2\x87\x6d\x61\xa4\x71\x5f\xaa\x70" - "\x1f\xce\xee\xf6\xd7\x64\x0f\xc4\x5d\xe3\x32\xe0\xce\xe0\x3b\x10" - "\x94\x5c\x6b\x5e\x56\xf7\x42\xd5\xdc\x7f\x38\xca\x7b\x74\x28\x9b" - "\x71\x8a\x75\xc7\x03\x9c\x17\xf8\xbe\xc2\x6d\x88\xcb\x00\x8e\x52" - "\x1d\xaf\xb0\xb7\x55\x73\xfb\x61\x18\x79\xff\x4b\x94\x65\x59\xb3" - "\x36\xa1\x07\x88\x2b\x77\xc1\x7f\x83\xdc\x18\x9f\x76\x8f\x79\x44" - "\xc7\x9d\xee\x0e\x0c\x29\x33\xd4\xfb\x0b\x4a\x8f\xac\xa7\x68\xfd" - "\xf5\xac\x7f\xea\x9e\xae\x75\xcf\x69\x34\xcb\xfa\x64\x5a\x19\x57" - "\x88\xd6\xf3\xdd\xdd\xa4\xe8\xad\xe6\x76\xd1\xd1\xed\x5f\x97\xa3" - "\xd3\xca\xf7\x4e\xe8\x72\x68\x94\xba\xbf\x6e\x9c\xae\x7b\xbc\x37" - "\x86\xf7\x32\x09\xf0\xa7\xee\xb6\x5b\x97\x0f\x1a\xcb\x38\x4d\x9d" - "\x59\xbf\xee\x69\x52\xe7\xf0\xb4\xca\x3b\xd3\xe4\xf9\x3c\x19\x7f" - "\x3d\x49\xeb\xee\x96\x7a\xa1\xea\x24\x1b\x34\x85\x1b\x6d\xbc\x3e" - "\xbc\x5e\x9d\x09\x22\xef\xdc\xe0\xfc\x35\x7c\x2e\x6b\xf6\x66\x79" - "\x77\xb6\xac\x9f\x2c\x91\xd9\x56\x8d\x72\xf6\x18\xe8\x0b\xeb\xed" - "\x62\x6c\x65\xb1\xd4\x4f\xa4\xb7\x26\x68\xb4\x82\x46\x3f\x68\x04" - "\xaf\xf5\xf2\xfc\xfc\x75\x9d\xc9\x34\xae\xbf\x24\x0d\x8d\x7f\x19" - "\x8c\xc6\x7e\x7d\x7c\x17\xe5\xad\xcf\x1b\xa8\x33\xeb\x0b\xf5\xfa" - "\xe4\xf0\xe1\x6b\x26\x72\x59\x7b\x18\x87\xd2\xe1\xf5\xe5\x09\x1e" - "\x12\xfc\xae\xaf\xe5\xfb\xb5\x99\x5f\xdf\x17\x64\x77\x44\xc9\xca" - "\xed\xde\x80\x73\x97\xce\x57\x48\xc9\xc6\x9e\x6a\x7f\xd2\xdd\x77" - "\x84\x7e\x9c\xeb\xd1\x1a\x5e\x77\xb4\x7c\x5a\x54\xc4\xe1\x07\xa1" - "\x9e\xd7\xc3\xff\xdb\x28\x6d\x9f\x58\x2e\x9a\x36\xf7\xaa\xbb\x18" - "\xa7\xc5\xba\x44\x71\xcc\xce\xe7\x0c\x80\xce\x1f\x8d\xd1\xcf\x36" - "\x52\x6d\xfe\x47\xa8\xff\x1f\xec\xe7\x70\x38\xe3\x86\x4b\xf1\xb8" - "\x4d\xed\x87\x8e\x2f\xf3\x68\x79\x71\x2c\x5b\xe2\x52\xf7\x3c\xfe" - "\x68\x61\xe2\xce\x4b\xd0\x24\xb2\x9a\xcb\xf8\x3e\x9d\x70\x5f\x19" - "\x9f\xeb\x64\x51\x74\xfd\x68\x8b\x5e\xc6\x85\xee\x2f\x19\x84\xdf" - "\x36\xfd\x9c\x28\xe0\x0b\x85\x68\x53\x07\xe3\x73\x58\xf8\xfe\x34" - "\xd1\x83\x32\x47\x22\x3e\xc1\x3f\x9f\x15\xc5\x69\xea\xac\x99\x1f" - "\x1d\x53\x36\x72\x83\xd3\xec\xbc\xa8\xc7\x16\x2f\x2e\x2f\x5e\xb2" - "\x80\x5f\xee\xeb\x96\x5d\x9f\x95\x62\xf7\xb3\xd5\x1d\x56\x1b\xc6" - "\xf2\xfe\xc0\x17\x2e\xd5\xcf\x68\xda\x50\xaa\xef\x51\xe4\xb6\x8c" - "\x76\x73\x2f\xf7\x9b\xdc\xbf\x20\xad\xfa\x9d\xca\x55\x72\x7f\xd8" - "\x5f\xec\x64\x4d\xe7\xf7\xb0\x8e\x76\x65\x8a\x6a\x96\x97\xd8\x38" - "\x0a\x7d\xf2\x06\xf8\xff\x1b\x26\x0c\x72\x36\xb9\x27\xb6\xfe\xe3" - "\x1c\xd7\x68\xe2\x7b\x10\xad\xbf\x5e\xd9\x66\xe5\x73\x22\xaa\xf0" - "\x9b\xfd\x38\x79\xae\x84\x95\x04\xd3\x71\xf0\x6c\x1b\xec\xc5\x46" - "\xd8\x84\x66\xf8\x26\x1b\x6d\x69\x69\x30\x9c\xb5\xc5\x67\x1f\xb5" - "\xd3\xc6\xb1\xe9\x60\x45\x4d\x9b\x76\x9f\xe6\xc6\x8a\x46\x3e\x5b" - "\x75\x34\xfd\xf0\x24\x6d\x5c\x66\x73\x92\x13\xbf\x7f\x8e\xdf\xd2" - "\xd7\xe5\xb4\xa4\x3a\xbd\xe2\x4c\x83\x2d\x43\x58\x85\x10\x16\xa1" - "\xfe\x30\xa0\x52\x7f\x19\x78\xac\xc2\x22\x4f\xac\xc9\x80\xa4\x86" - "\x0d\xb5\x91\x63\x44\xb6\xfd\xaa\x2b\xc7\x38\xef\xbd\x67\xe2\x04" - "\x5f\x55\xa5\x57\xc4\xa3\x3d\x0e\x61\xbc\xc3\x54\xb8\x66\x5e\x5f" - "\xad\xce\x0d\x5b\x27\x5c\x66\xb4\x6e\xf4\x0b\x0f\xdf\xd9\x14\x1f" - "\x31\xaa\xc4\xb7\x8c\xac\x6f\xf6\x86\xac\x7c\xcf\xb8\x6b\x39\xef" - "\xc9\xfd\x13\x9d\xa4\x4d\x43\x0e\x21\x0e\xfc\x7b\xc5\x86\x51\x25" - "\x4a\x4f\x36\x4d\x89\x6f\x1a\x55\xd2\x8f\xdf\x46\x8c\xdf\xf7\x32" - "\x59\x77\x56\x75\x58\x83\xb6\x7b\x28\xe8\x8a\xd0\x21\xfc\x4e\x53" - "\x9f\x1e\xc8\x9f\x18\x47\xbd\x3f\x5e\x83\x36\x6f\xe5\x7d\x8d\xb0" - "\x05\xd6\xcf\x68\xd3\xaa\x3d\x69\xf2\xf1\x9d\x34\x5d\x59\x47\xef" - "\xea\xf6\x6f\x42\xfd\x7f\x3b\x71\x07\x15\xc2\x47\x74\x7d\x46\xfa" - "\x9d\x5d\x7e\x19\x77\x42\x87\x31\xef\xe7\x79\x4f\xaa\x08\x48\x3b" - "\x79\xfe\x6f\x1d\xf5\x55\xe6\xe7\x49\x83\xce\x61\x41\xef\x6d\x7c" - "\xce\xcb\x90\x11\x3d\x94\xed\x3b\x27\xfa\x30\x86\x18\x09\xb5\xb5" - "\x62\x0c\x76\x55\xf4\xbc\x28\x6a\xee\x3c\x4b\x2d\x91\x63\x7c\x46" - "\x94\xe5\x57\x8f\xbf\x6b\x0d\xf6\x7c\x1e\x08\xae\x8d\x53\x8b\x27" - "\x4a\xc1\xba\xcf\x03\xcd\x9d\xc7\xf0\x3b\x46\xcd\xf4\x31\x35\x7b" - "\xff\xb3\x5a\x8e\xdb\xea\x44\x35\xcb\xb9\xef\xbc\x28\x0c\xda\xfe" - "\x37\x71\x5f\x08\x3b\x31\x07\x72\x77\x7d\x46\x9b\x5f\x3b\x08\x3c" - "\x6f\xfe\x19\xb8\xa2\xec\x67\xde\x4d\x87\xf0\xbb\xdb\xbf\x79\x8f" - "\x7e\xbe\x99\x19\xad\x0e\x4b\x60\xa3\xc3\x3b\xd7\x1a\x3f\x2f\x26" - "\xf0\xfd\xb2\xe2\xbc\x18\xcf\x7c\x21\x9c\xcb\x61\xbc\xc7\xf1\xdb" - "\xb1\x3a\xb0\xdd\x11\x9d\x4b\xb0\x55\x45\x6c\x9f\x10\x5f\x58\x7f" - "\x9e\x38\x5c\xa0\x85\xa7\x6a\xe1\x7c\x2d\x3c\x59\x0b\xe7\x69\xe1" - "\x89\x1c\x66\x7a\xbb\xfd\x5b\x26\xeb\x34\x75\x59\x87\xb5\x22\x5c" - "\xa8\xd7\x05\xe8\x19\xee\xf0\xae\xb2\x0a\xa6\x47\xd1\x31\x5e\xa3" - "\x2b\x57\x0b\xeb\xf4\x5c\xe1\x88\xae\xfa\x9f\xa2\xe7\x58\x0a\x3d" - "\xed\x06\x7a\xc8\xe1\xcd\xfb\x32\xf4\xe4\x38\xa2\x79\xff\x2d\x7a" - "\x98\x16\x8e\xeb\xf6\xff\xb8\x34\x99\x9e\x1f\x97\xeb\xf4\xa4\xe9" - "\x3f\x3a\xb8\xff\x58\x7a\x99\xbc\x6b\x7d\x58\x30\x7a\x87\xa1\x0f" - "\xf9\xf1\x9e\xc1\xee\x0a\x46\x5b\x70\x02\x06\xfc\xff\xb8\x5a\x96" - "\xb7\x5c\xec\x57\xfd\xe7\x8f\x3b\xf4\xb3\xf5\xc0\xeb\xae\xcd\x8a" - "\xd7\xdd\x6b\xf9\x6e\xe2\x0a\xba\xdc\xe7\x15\x1d\xf0\xbb\xfe\x4f" - "\xa3\x2b\x9c\xd4\x06\x16\x96\x2f\x5d\xfa\xf4\x5d\xae\x85\xf3\x17" - "\x2d\x70\x5d\x57\xea\x5a\x5a\xf6\xc4\xe3\xe5\x0b\x92\xcf\xac\xca" - "\x61\xdb\xc1\x76\x7e\x87\xba\xbf\x2c\xcc\x6d\x80\xf5\x9f\xfb\x76" - "\x75\xde\xe8\xf3\xaf\x0b\xff\xf3\x23\xb9\x6f\xd8\xf1\x3c\xd9\xea" - "\xe5\xd9\x51\xcf\x7b\xf5\x3e\x61\x8d\xe6\xe3\x58\x73\xf8\x5e\x92" - "\xe7\xd1\xff\x6d\xce\x31\xc4\x33\xec\x4e\x3d\x8e\xf1\x6b\xb6\x69" - "\xd8\x49\x7a\x7e\x0a\x97\x69\x2a\xc3\xf3\xa2\x01\x3e\xb4\x25\x2e" - "\x8a\xac\xb0\x29\x82\xef\xaa\x84\xff\x6b\x45\x3e\x01\x7a\xce\xb1" - "\xed\x2d\x44\x98\xc7\xf6\x2e\x9f\x00\x8d\x2f\x64\x22\xcf\x4e\xc4" - "\xd9\x36\xc5\x79\x97\xa3\xe8\xe0\x7c\x88\xbf\x9a\xef\x7f\x2b\xe4" - "\x33\xe4\xa2\xf2\x6e\x08\x8e\xbb\x83\xef\x67\x43\x5c\x8e\x21\xee" - "\x7e\xc4\x39\x11\xe7\xd2\xf0\xcd\x62\x39\x23\x9c\xa7\xf9\xf2\x0c" - "\xf3\xb4\x56\x6e\xb5\x91\xe6\x82\x49\xf7\x4f\xb9\xed\xe6\x5c\x57" - "\xe1\x8c\x6f\xdd\x7d\xcf\xf7\x17\x2f\x7a\x3c\x8b\xa4\xd8\xdd\xb9" - "\xde\xeb\x72\x6f\xf3\x5e\x7f\x97\xcb\xb3\x60\xc1\x12\xd7\x8a\x05" - "\x8b\xca\x5d\xf3\x57\xcc\xaf\xc8\xa2\xc7\x17\x2f\xf9\xfe\x13\x8b" - "\xfe\x97\xac\x96\xa5\xc5\xdf\x7f\xfc\x7f\xf1\xc1\x62\x0a\x3a\x2b" - "\xa9\x3f\x2e\xe4\xbe\x5d\xbb\x8f\xef\x08\x1e\xbe\x2b\xd3\x89\x77" - "\x23\x9e\xfd\x78\xf6\xe1\xe1\xbb\x9c\x5b\x4f\xd3\xcb\x76\xbc\xf7" - "\x76\xfb\x6b\x73\x74\x7f\xa1\x5f\x77\x6a\xc7\xea\xba\x83\xfe\x7b" - "\xaf\xea\xd7\x6a\x0b\x5b\xa2\xb2\xdd\x24\x74\x69\xf3\xf9\x7e\x5d" - "\x92\x77\x78\xf3\x99\x79\xcb\x91\x0e\xdd\xe5\x7b\xb2\x20\xeb\x4c" - "\x96\xd7\x29\xfa\xc9\x65\xf0\x99\x9b\xf8\x6e\x48\xbc\x1b\xa1\x27" - "\x4d\xca\x07\xac\x6d\x05\xdc\xd5\x28\x63\xbf\x56\x86\x0a\x8f\x12" - "\x47\x90\x9e\x71\x52\x0b\x33\xae\x53\xf4\xd2\xeb\xfc\x9b\xdf\xda" - "\xfe\x7f\x47\x30\x22\xc7\x26\xd6\xfe\xb4\x17\xef\xd4\xca\xe0\x73" - "\x0e\xab\xd9\xf7\xd1\xfd\x5d\x1e\xe7\x3a\x2c\xf7\x0a\xd0\xf3\x79" - "\x3c\x63\x76\x9b\xbc\xaf\xb8\xba\x17\xb6\xe1\xf6\xdb\x83\x5e\x11" - "\x40\xba\x85\xc7\xc1\x0f\x7a\x44\xbc\xc5\x73\x8e\xe2\x19\x4f\xb5" - "\xb1\x2c\x59\x7e\xa7\xa9\x76\x88\x1a\x43\xbd\x6c\x97\xf8\x80\x5f" - "\xd1\xfb\xa2\x3a\x23\x57\xf9\xdd\x7c\x07\x18\xfb\xd5\xfb\xb8\x7c" - "\xbe\xcb\x0f\x70\xad\xf5\x2a\x7c\xac\x9f\xe7\x17\xd7\xea\x34\x69" - "\xf1\xad\x80\x3b\xa6\xee\xc9\xab\x3d\xa1\xa7\x29\xdf\xbc\x2e\x0f" - "\x32\xf8\x0b\xf3\xc2\x78\xe5\x37\x0f\xbd\x51\x09\x87\xbc\x7b\x74" - "\xbb\xc1\x76\xa2\x38\x86\x76\x26\x7d\xd8\x17\x43\x09\x1f\x36\x51" - "\x9f\x2f\x46\xcc\x6c\x81\x59\xfd\x69\x32\x9e\x2b\xfc\x2f\x78\x41" - "\xd7\x1e\x29\x4b\x43\x39\xb0\x4f\x7d\xaa\x9c\x97\xf2\x13\xbe\xad" - "\x96\x8e\xb4\x58\x88\x69\xeb\x95\xdf\xb1\x68\xed\xfe\x25\x8f\xde" - "\xee\x75\xb8\x78\x4d\x4b\x36\xda\xbe\xcd\x61\x11\x71\x87\xd7\x22" - "\x78\xce\x86\xfb\x3c\xe9\x53\x00\x66\xc4\x39\xc8\xb2\x97\xc7\x1f" - "\x2f\x8d\x8b\xaf\x6b\x51\x3e\xa6\xff\x85\x1f\xf5\xdb\x92\x97\x1a" - "\x53\x71\xb2\x2d\x91\x77\x27\xdb\x5b\xb2\x8b\x63\x36\x3e\x33\xd6" - "\x22\x32\x5b\xb2\x39\x5d\xa3\xb7\x27\x95\x5e\xd6\xb3\x69\xb1\x3e" - "\xa1\xdd\x4d\x0a\x7f\xe2\xa5\x42\x99\x36\x4a\x34\xaa\xba\xda\xfa" - "\x0e\xd7\x07\xda\xc9\xee\x6e\xff\x4f\x30\xfe\x7f\xbe\x51\x1b\xc3" - "\x34\xc1\x2e\xed\x3e\xbc\x72\x32\x60\x7e\x52\x98\x52\x9f\xfb\x35" - "\xdd\xae\x30\x8c\xb5\x8e\xa9\xfa\xbc\xa7\xfa\x24\xfd\xa4\xd6\x10" - "\xaf\xd5\xf3\xe1\x82\x93\xb4\xf5\x01\x35\x06\x6b\x6e\x52\xba\xf5" - "\x13\xa9\x0b\x3a\xad\x42\x8d\x9f\xf7\xf2\xfd\xa9\x5c\x07\xfd\x7c" - "\xfd\xa4\x55\xb7\xfd\xdc\x56\x43\x4a\x37\xf6\xb3\xcc\x20\x2b\x1b" - "\xe4\xf6\x0b\x25\xb3\x9f\xf4\x24\x64\xc6\x77\xd4\xa3\x8c\x11\xab" - "\x45\x7c\x44\x04\x6e\x27\xca\x2c\xae\xb0\x11\xeb\x3f\xb7\x59\x9e" - "\xef\x64\x18\xee\x1f\x75\xb9\x76\xfb\xb7\x4e\x18\x58\xdf\x7d\x22" - "\x44\x3f\xd9\xc5\x74\x24\xf3\x39\xac\xf5\xa4\xce\x3f\xec\x10\x8f" - "\xc5\x11\xf6\x6a\xe3\xdd\xa6\xc0\x68\xfe\x2e\xaa\x76\xd5\x61\xdb" - "\xb7\xe8\xb0\x77\x3c\x29\xf9\x6e\xdd\x0a\xf9\x8e\xd3\xc7\xda\x5c" - "\x37\x2c\x63\x96\xa9\xa8\x69\xb1\xeb\x75\xa4\xce\x7e\xab\xf5\x8a" - "\x75\x2d\x72\x8c\xc0\xb4\x74\x59\xe5\x3d\xe3\xad\x4c\x13\xdb\x3a" - "\x6e\x8f\xb2\x3d\x80\x9e\x7e\x39\x6d\xed\x31\xc8\xa9\x91\x65\xa4" - "\xc9\x6a\x6f\x8a\x6d\x5e\xe0\x5a\x78\xb7\xb2\xad\x2e\xf7\x75\xa5" - "\xb7\xf0\xc9\x8d\xd7\xbb\xfe\x69\xd2\x5d\xae\x82\xbb\xaf\xf3\x96" - "\x8d\x7b\x90\x5f\xff\xab\x6c\xdc\xa4\x82\xa9\x1c\x4e\xb6\xbf\xae" - "\x6e\xff\xcb\x25\x21\xcb\x3d\x36\x2e\x27\xbe\x5c\x74\x6e\x3e\x4b" - "\x14\x63\x79\x2f\x62\xbd\x6f\xde\x35\x0d\x36\x74\x5a\x85\xf8\xa2" - "\x1e\xf1\xf5\x88\xe3\xbe\x8d\xc7\x9a\xf1\x75\xcd\xbb\xc2\x99\xc2" - "\x15\xce\x8c\x87\xc2\x99\x47\xa7\x4e\xb9\xde\x27\x80\x6b\xb7\x4e" - "\xb3\xc8\xc0\xf8\x11\xf9\x75\x3b\x15\x8c\x76\xf0\xbd\x94\x36\x8c" - "\x61\x76\x89\x0c\x1e\x47\xbe\xdc\x06\x3b\x5e\xaa\xce\xc1\x7d\x19" - "\xfe\xcf\x0b\x47\x34\x5f\xb9\x00\x61\xb4\xff\x6f\xc8\x3b\x83\x85" - "\xd5\x49\x22\xe3\x86\xe9\x6c\x4b\x24\xce\x75\xf1\x90\x09\xde\xa1" - "\x3a\x5e\xfa\x92\x67\x8e\x8a\xac\x96\x1a\xfe\x76\xa9\xde\x1a\x2f" - "\x72\x44\x2d\xd5\xfc\xfd\x92\xfe\xad\x56\x7c\x3d\xd2\x2c\xea\xbe" - "\x65\xb4\xf7\x6a\x86\xd1\xd3\x36\xfb\xe3\xa1\xcd\xd6\x78\x0f\xc6" - "\x68\x39\xca\xef\xed\x64\xfb\x8d\x31\xe4\x2b\xbb\xf4\x7e\x49\xeb" - "\xd3\xaa\xd5\x39\xae\xaf\xfc\x81\xf3\x9d\xf5\xdb\x60\x1f\x5e\x2e" - "\xb8\x66\xa4\x1c\x5b\xf4\x08\xab\x3e\x9e\x7d\x65\x3b\xa7\x6f\x52" - "\xf3\x35\x57\x39\x56\x8b\x70\x55\x44\x84\x1d\x51\x11\xe6\xf9\x5b" - "\x69\xfb\xe9\x34\x05\x2b\xbb\xab\xf9\x5e\x75\xe9\xbb\xa0\x5c\x65" - "\xf7\x63\xca\xee\xa3\x7c\x8c\xf5\x4b\x60\xfb\x2d\xa7\xe9\x95\x85" - "\x4c\xbf\x26\xa3\xec\x38\xe4\x15\xe4\x7e\x8e\xe5\x93\xd5\x6a\x4f" - "\xc7\x33\x78\x0a\x6d\xf2\x83\x2f\x2b\xf8\xf2\x9e\xe1\xf6\xd1\xc3" - "\xdf\xd8\xa1\x7d\x8d\xea\xbf\xef\x6d\xdb\x06\x73\x1e\xb7\xbd\x31" - "\x38\x8f\xdb\x56\x6b\x6d\x4b\xd2\xc9\xf6\xa2\x93\xb6\xe5\x8d\x58" - "\xcd\xdf\xaf\x35\xef\x82\x4e\x4d\xe2\x76\xb2\xc3\x2f\xf8\xce\xb5" - "\x5d\x66\xf5\xa5\xce\x8b\x66\x5c\x75\x53\x1d\xab\xab\x4b\xba\xfd" - "\x75\x4e\x23\x2d\xdc\xe7\x68\xe9\x77\x9a\xd1\x12\xf7\x33\x2d\x4c" - "\x6b\xdd\x70\xce\xcf\x74\xf0\xfc\x98\x23\x8a\x41\x36\x74\x18\xe3" - "\xac\x1a\xb3\x72\x47\xac\x6e\x60\xba\x4c\xd3\x60\x73\x3a\xd9\x2e" - "\xc9\xfe\xcc\x4b\x62\x1a\x1e\xb6\x41\xa0\x6d\xaf\x6e\x7b\x1c\x16" - "\x57\x86\xb4\x05\x56\xb1\xc5\x0c\x87\x63\xf5\x16\xfe\x7e\x6e\x12" - "\xca\x37\x4d\x87\x8c\x5d\x90\xd1\xd6\xf8\x9a\x1b\xaf\x71\x58\xe8" - "\xde\x70\xc6\x8d\x59\x0e\x6f\x74\x2c\xcb\x10\x38\xbd\xa7\x68\xc7" - "\x3b\x3c\xbe\x54\xf7\x1e\x6f\x1f\x17\xa2\x37\xe4\xbc\x71\x38\xb3" - "\x79\xab\x9a\x13\xda\x9e\x17\xa2\xbd\xd9\xfd\x73\x44\xdb\x0b\x42" - "\x96\x2b\x95\x5d\xcd\xb8\xfc\x15\xb1\xfe\xa8\x33\xee\x77\x08\xd7" - "\x4a\x07\xfc\xbf\xed\x7f\x8b\x0b\xb7\x55\x64\x1d\x75\xf6\xeb\x89" - "\xfa\xb6\x4f\xd7\x13\xe4\xdf\x62\xae\x03\xdb\xdf\x1a\x5c\x07\xb6" - "\x3f\xc7\xe9\x2c\x77\x35\xc6\xd8\xde\x96\x98\xdf\x5a\x73\xf9\x2b" - "\xae\x2a\x59\xfe\x42\x55\x36\xcb\x24\x8f\xe7\xd6\xa6\x42\x2e\xd5" - "\xdd\xfe\x1d\xb6\x84\x3d\x80\xbe\x38\x62\x64\x61\xbb\xc4\xba\x82" - "\x34\x17\x6c\x8e\x9c\x8f\xe2\x3b\x84\x61\xd3\xc6\xc4\xfd\x2f\x8f" - "\x0c\xfb\xca\xb6\xf1\x19\xb0\x91\xcc\x96\x1c\xc0\x60\xfc\x77\x62" - "\x9f\x9a\xdf\x6d\xb1\xc3\x3e\x67\xd7\x5e\x0a\x7b\xab\xbe\x57\xcd" - "\xe6\x36\x8d\x77\x0e\xb7\x6b\xc4\x8d\x04\xdd\x39\x08\x63\x9c\xb2" - "\xa3\x52\xef\x83\xe2\xfe\x3c\xd8\x03\x21\x75\x13\x7d\xcc\x98\x2e" - "\xc8\xee\x45\x6b\x7c\xd7\xf9\x5b\x9c\xc4\x3c\x9f\x5f\x33\x7a\xd7" - "\x0f\x6f\x26\xdb\xbf\x3b\x1f\x23\xcf\x6d\x34\x72\xf5\xb7\x6c\xf4" - "\x7f\x27\x90\x95\xe5\x10\xa2\x1d\x1b\x94\xec\x76\x34\xe9\xf5\x13" - "\xa2\xed\xe3\xb9\x3e\x52\xfd\x6c\xd7\x13\x4b\x5d\xa5\x8b\x57\x2c" - "\xba\xfa\xea\xa4\x31\x8c\x8d\x1f\xe1\xdf\x11\x52\x7d\x63\xfd\x48" - "\x9d\x2e\xab\xbc\x1f\xb2\x1e\xfe\xef\xcb\xf9\xa9\x63\xae\xa9\xc5" - "\xda\x11\xbf\xc5\xb9\xd4\xff\xfb\x56\x9a\x7a\xab\x21\x78\x3b\x4d" - "\xbd\xed\xf6\xe2\xe9\x0b\xe6\x97\x56\x18\x62\xef\x30\xce\x9b\x6d" - "\x7e\x85\x6d\xef\xe8\xef\xc2\x16\x58\x1e\x7c\x96\xfb\xfa\x86\xcc" - "\xaa\xa8\xf8\xab\xe0\xbb\x79\xac\x54\xdc\x5c\x1e\xa5\x66\xd8\x2a" - "\x71\x39\x6c\xb5\x7f\x98\xba\x07\x02\x3e\x12\x74\xc7\x31\x0d\x76" - "\x0c\xfe\xda\x39\x9e\x37\x41\xbe\x9b\x5a\xb6\xf6\xa0\xcd\x1f\x2d" - "\x54\x3e\x43\x3d\x8f\x61\x2e\x41\xfc\x25\x78\x0f\xc5\xfb\x6b\xae" - "\x45\x18\x8f\xf0\x39\xc2\xcb\xf9\x1c\xe1\xfa\x18\xcb\xed\xe6\x48" - "\x35\xdd\xbc\x84\x7d\xea\xfa\x86\xc3\xe5\xec\x67\x35\x14\xc8\x35" - "\x09\xc0\x22\xee\x6f\xae\x27\x29\x97\xdf\xec\xd3\x86\x80\x53\xac" - "\x3b\x5a\x28\xb6\x61\x5c\x55\x45\x63\x81\xf3\x81\x0c\xcb\x5f\x28" - "\xc3\x39\x74\x7f\xb7\xbf\x61\x6a\x88\x36\xd4\xb2\x9c\x90\xdf\x7c" - "\x5e\x2c\xc5\xd7\x28\xae\x80\xaf\x87\x7e\xa6\xd8\xbb\x9e\xf0\xdb" - "\x56\x5f\xa5\x8f\x73\x1b\xb6\x1a\xe6\x5e\xb3\x10\xde\xa5\xeb\x33" - "\x7e\xef\xd5\xf5\xcd\x58\xc6\x94\x45\xe5\x0b\x96\x2c\x28\x75\x5d" - "\xb7\x34\x8b\x0a\x9f\x78\x7a\x41\xe9\x4d\x8b\x97\x95\xbb\x56\x94" - "\x2d\x58\xe4\x5a\xb2\xe0\x99\x65\x0b\x96\x96\xf3\x98\x89\x53\x93" - "\xfa\xe8\x91\x22\xeb\x83\x1a\xfd\x5c\x7a\xd7\x68\x96\xe3\x4f\x2f" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 22:25:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9DA7106564A; Tue, 17 Feb 2009 22:25:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D816B8FC1A; Tue, 17 Feb 2009 22:25:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HMPJ7H029452; Tue, 17 Feb 2009 22:25:19 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HMPJYI029451; Tue, 17 Feb 2009 22:25:19 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200902172225.n1HMPJYI029451@svn.freebsd.org> From: Andrew Gallatin Date: Tue, 17 Feb 2009 22:25: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: r188737 - head/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 22:25:20 -0000 Author: gallatin Date: Tue Feb 17 22:25:19 2009 New Revision: 188737 URL: http://svn.freebsd.org/changeset/base/188737 Log: Fix cut/paste error in previous commit and use the correct value for SFP+ reserved media type. MFC after: 1 week Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Tue Feb 17 22:15:58 2009 (r188736) +++ head/sys/dev/mxge/if_mxge.c Tue Feb 17 22:25:19 2009 (r188737) @@ -2535,7 +2535,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { - {0, (1 << 0), "Reserved"}, + {0, (1 << 7), "Reserved"}, {IFM_10G_LRM, (1 << 6), "10GBASE-LRM"}, {IFM_10G_LR, (1 << 5), "10GBASE-LR"}, {IFM_10G_SR, (1 << 4), "10GBASE-SR"} From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 22:46:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D3E1065674; Tue, 17 Feb 2009 22:46:31 +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 130A98FC0C; Tue, 17 Feb 2009 22:46:31 +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 n1HMkUZB029941; Tue, 17 Feb 2009 22:46:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HMkUeQ029936; Tue, 17 Feb 2009 22:46:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902172246.n1HMkUeQ029936@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 22:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188738 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 22:46:32 -0000 Author: jhb Date: Tue Feb 17 22:46:30 2009 New Revision: 188738 URL: http://svn.freebsd.org/changeset/base/188738 Log: MFC: Remove unnecessary locking around vn_fullpath(). This also includes closing some races between procfs' /file and execve(2) and using a shared vnode lock for the VOP_GETATTR() in the kern.proc.vmmap sysctl handler. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/hwpmc/hwpmc_mod.c stable/7/sys/fs/procfs/procfs.c stable/7/sys/fs/procfs/procfs_map.c stable/7/sys/kern/kern_descrip.c stable/7/sys/kern/kern_proc.c Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Tue Feb 17 22:25:19 2009 (r188737) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Tue Feb 17 22:46:30 2009 (r188738) @@ -669,9 +669,7 @@ pmc_getfilename(struct vnode *v, char ** td = curthread; *fullpath = "unknown"; *freepath = NULL; - vn_lock(v, LK_CANRECURSE | LK_EXCLUSIVE | LK_RETRY, td); vn_fullpath(td, v, fullpath, freepath); - VOP_UNLOCK(v, 0, td); } /* Modified: stable/7/sys/fs/procfs/procfs.c ============================================================================== --- stable/7/sys/fs/procfs/procfs.c Tue Feb 17 22:25:19 2009 (r188737) +++ stable/7/sys/fs/procfs/procfs.c Tue Feb 17 22:46:30 2009 (r188738) @@ -70,17 +70,13 @@ procfs_doprocfile(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; struct vnode *textvp; - int err; + PROC_LOCK(p); textvp = p->p_textvp; - VI_LOCK(textvp); - vholdl(textvp); - err = vn_lock(textvp, LK_EXCLUSIVE | LK_INTERLOCK, td); - vdrop(textvp); - if (err) - return (err); + vhold(textvp); + PROC_UNLOCK(p); vn_fullpath(td, textvp, &fullpath, &freepath); - VOP_UNLOCK(textvp, 0, td); + vdrop(textvp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Tue Feb 17 22:25:19 2009 (r188737) +++ stable/7/sys/fs/procfs/procfs_map.c Tue Feb 17 22:46:30 2009 (r188738) @@ -190,10 +190,9 @@ procfs_doprocmap(PFS_FILL_ARGS) shadow_count = obj->shadow_count; VM_OBJECT_UNLOCK(obj); if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); vn_fullpath(td, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); } } else { Modified: stable/7/sys/kern/kern_descrip.c ============================================================================== --- stable/7/sys/kern/kern_descrip.c Tue Feb 17 22:25:19 2009 (r188737) +++ stable/7/sys/kern/kern_descrip.c Tue Feb 17 22:46:30 2009 (r188738) @@ -2836,10 +2836,9 @@ export_vnode_for_sysctl(struct vnode *vp freepath = NULL; fullpath = "-"; FILEDESC_SUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); vn_fullpath(curthread, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) @@ -3001,10 +3000,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER freepath = NULL; fullpath = "-"; FILEDESC_SUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); vn_fullpath(curthread, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Tue Feb 17 22:25:19 2009 (r188737) +++ stable/7/sys/kern/kern_proc.c Tue Feb 17 22:46:30 2009 (r188738) @@ -1475,12 +1475,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_UNLOCK(obj); if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, - curthread); vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY, curthread); if (VOP_GETATTR(vp, &va, cred, curthread) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 22:49:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 017DA106564A; Tue, 17 Feb 2009 22:49:59 +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 E31498FC08; Tue, 17 Feb 2009 22:49:58 +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 n1HMnwXe030038; Tue, 17 Feb 2009 22:49:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HMnwAG030037; Tue, 17 Feb 2009 22:49:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902172249.n1HMnwAG030037@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Feb 2009 22:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188739 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 22:50:00 -0000 Author: jhb Date: Tue Feb 17 22:49:58 2009 New Revision: 188739 URL: http://svn.freebsd.org/changeset/base/188739 Log: The previous MFC only fixed the old kern.proc.vmmap sysctl. Fix the new one as well to not hold the vnode lock for vn_fullpath() and only use a shared vnode lock for VOP_GETATTR(). Modified: stable/7/sys/kern/kern_proc.c Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Tue Feb 17 22:46:30 2009 (r188738) +++ stable/7/sys/kern/kern_proc.c Tue Feb 17 22:49:58 2009 (r188739) @@ -1646,12 +1646,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_UNLOCK(obj); if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, - curthread); vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY, curthread); if (VOP_GETATTR(vp, &va, cred, curthread) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 23:20:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 631F9106566C; Tue, 17 Feb 2009 23:20:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51E9B8FC14; Tue, 17 Feb 2009 23:20:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HNK6lX030605; Tue, 17 Feb 2009 23:20:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HNK6RF030604; Tue, 17 Feb 2009 23:20:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902172320.n1HNK6RF030604@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Feb 2009 23:20: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: r188740 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 23:20:06 -0000 Author: mav Date: Tue Feb 17 23:20:04 2009 New Revision: 188740 URL: http://svn.freebsd.org/changeset/base/188740 Log: Adaptively increase control command timeout when drive is spun down. This should fix, for example, cache flush timeout error on shutdown, if some drives are not mounted. PR: kern/111023 Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Tue Feb 17 22:49:58 2009 (r188739) +++ head/sys/dev/ata/ata-queue.c Tue Feb 17 23:20:04 2009 (r188740) @@ -119,6 +119,7 @@ int ata_controlcmd(device_t dev, u_int8_t command, u_int16_t feature, u_int64_t lba, u_int16_t count) { + struct ata_device *atadev = device_get_softc(dev); struct ata_request *request = ata_alloc_request(); int error = ENOMEM; @@ -129,7 +130,13 @@ ata_controlcmd(device_t dev, u_int8_t co request->u.ata.count = count; request->u.ata.feature = feature; request->flags = ATA_R_CONTROL; - request->timeout = 1; + if (atadev->spindown_state) { + device_printf(dev, "request while spun down, starting.\n"); + atadev->spindown_state = 0; + request->timeout = 31; + } else { + request->timeout = 5; + } request->retries = 0; ata_queue_request(request); error = request->result; From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 23:43:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B3D106566B; Tue, 17 Feb 2009 23:43:17 +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 50B0C8FC14; Tue, 17 Feb 2009 23:43:17 +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 n1HNhHSL031045; Tue, 17 Feb 2009 23:43:17 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HNhHVM031044; Tue, 17 Feb 2009 23:43:17 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902172343.n1HNhHVM031044@svn.freebsd.org> From: Sam Leffler Date: Tue, 17 Feb 2009 23:43: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: r188741 - head/sys/dev/cfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 23:43:17 -0000 Author: sam Date: Tue Feb 17 23:43:17 2009 New Revision: 188741 URL: http://svn.freebsd.org/changeset/base/188741 Log: fix whitespace Modified: head/sys/dev/cfi/cfi_bus_ixp4xx.c Modified: head/sys/dev/cfi/cfi_bus_ixp4xx.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_ixp4xx.c Tue Feb 17 23:20:04 2009 (r188740) +++ head/sys/dev/cfi/cfi_bus_ixp4xx.c Tue Feb 17 23:43:17 2009 (r188741) @@ -77,4 +77,4 @@ static driver_t cfi_ixp4xx_driver = { cfi_ixp4xx_methods, sizeof(struct cfi_softc), }; -DRIVER_MODULE (cfi, ixp, cfi_ixp4xx_driver, cfi_devclass, 0, 0); +DRIVER_MODULE(cfi, ixp, cfi_ixp4xx_driver, cfi_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Feb 17 23:56:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61EB21065672; Tue, 17 Feb 2009 23:56:16 +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 50AD58FC1D; Tue, 17 Feb 2009 23:56:16 +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 n1HNuGcf031316; Tue, 17 Feb 2009 23:56:16 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1HNuG6q031315; Tue, 17 Feb 2009 23:56:16 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902172356.n1HNuG6q031315@svn.freebsd.org> From: Sean Bruno Date: Tue, 17 Feb 2009 23:56: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: r188742 - head/usr.sbin/fwcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 23:56:17 -0000 Author: sbruno Date: Tue Feb 17 23:56:16 2009 New Revision: 188742 URL: http://svn.freebsd.org/changeset/base/188742 Log: Remove reference to phy_delay from fwcontrol. Thanks for the catch! Submitted by: Giorgos Keramidas MFC after: 2 weeks Modified: head/usr.sbin/fwcontrol/fwcontrol.c Modified: head/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- head/usr.sbin/fwcontrol/fwcontrol.c Tue Feb 17 23:43:17 2009 (r188741) +++ head/usr.sbin/fwcontrol/fwcontrol.c Tue Feb 17 23:56:16 2009 (r188742) @@ -537,13 +537,12 @@ show_topology_map(int fd) printf("%02d sequel packet\n", sid.p0.phy_id); continue; } - printf("%02d %2d %2d %4s %d %d %3s" + printf("%02d %2d %2d %4s %d %3s" " %s %s %s %d %d\n", sid.p0.phy_id, sid.p0.link_active, sid.p0.gap_count, speed[sid.p0.phy_speed], - sid.p0.phy_delay, sid.p0.contender, pwr_class[sid.p0.power_class], port_status[sid.p0.port0], From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 00:09:29 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF517106564A; Wed, 18 Feb 2009 00:09:28 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 456738FC15; Wed, 18 Feb 2009 00:09:27 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl126-61.kln.forthnet.gr [77.49.245.61]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-6) with ESMTP id n1I08jiA004920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Feb 2009 02:08:51 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n1I08jln017621; Wed, 18 Feb 2009 02:08:45 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n1I08jik017615; Wed, 18 Feb 2009 02:08:45 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Sean Bruno References: <200902172356.n1HNuG6q031315@svn.freebsd.org> Date: Wed, 18 Feb 2009 02:08:45 +0200 In-Reply-To: <200902172356.n1HNuG6q031315@svn.freebsd.org> (Sean Bruno's message of "Tue, 17 Feb 2009 23:56:16 +0000 (UTC)") Message-ID: <874oysobci.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Hellug-MailScanner-ID: n1I08jiA004920 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.876, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.52, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188742 - head/usr.sbin/fwcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 00:09:29 -0000 On Tue, 17 Feb 2009 23:56:16 +0000 (UTC), Sean Bruno wrote: > Author: sbruno > Date: Tue Feb 17 23:56:16 2009 > New Revision: 188742 > URL: http://svn.freebsd.org/changeset/base/188742 > > Log: > Remove reference to phy_delay from fwcontrol. Thanks for the catch! > > Submitted by: Giorgos Keramidas > MFC after: 2 weeks That would be just 'keramida', sorry for not using my FreeBSD email. Thanks for the quick fix, I've just installed the patched version and it works fine ;) From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 00:15:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE0FC1065676; Wed, 18 Feb 2009 00:15:40 +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 666FF8FC13; Wed, 18 Feb 2009 00:15:40 +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 n1I0FX4r010359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Feb 2009 11:15:34 +1100 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 n1I0FXP9003253; Wed, 18 Feb 2009 11:15:33 +1100 (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 n1I0FXpx003252; Wed, 18 Feb 2009 11:15:33 +1100 (EST) (envelope-from peter) Date: Wed, 18 Feb 2009 11:15:33 +1100 From: Peter Jeremy To: John Baldwin Message-ID: <20090218001533.GA3214@server.vk2pj.dyndns.org> References: <200902121437.n1CEbwUe058325@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <200902121437.n1CEbwUe058325@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Phil Kim Subject: Re: svn commit: r188514 - in stable/7/sys: . contrib/pf dev/cxgb libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 00:15:41 -0000 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2009-Feb-12 14:37:58 +0000, John Baldwin wrote: >Log: > MFC: Add simple locking for the in-kernel iconv code. This breaks building LIBICONV: Given a config file comprising include GENERIC options LIBICONV you get: cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -march=3Dnocona -st= d=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -W= missing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-point= er-sign -fformat-extensions -nostdinc -I. -I/home/pjeremy/xxx/src/sys -I/h= ome/pjeremy/xxx/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS= -include opt_global.h -fno-common -finline-limit=3D8000 --param inline-uni= t-growth=3D100 --param large-function-growth=3D1000 -mcmodel=3Dkernel -mno= -red-zone -mfpmath=3D387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-fl= oat -fno-asynchronous-unwind-tables -ffreestanding -Werror /home/pjeremy/x= xx/src/sys/libkern/iconv.c /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_mod_unload': /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: 'curthread' undeclared= (first use in this function) /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: (Each undeclared ident= ifier is reported only once /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: for each function it a= ppears in.) /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_sysctl_add': /home/pjeremy/xxx/src/sys/libkern/iconv.c:401: error: 'curthread' undeclare= d (first use in this function) /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_converter_han= dler': /home/pjeremy/xxx/src/sys/libkern/iconv.c:452: error: 'curthread' undeclare= d (first use in this function) *** Error code 1 Stop in /var/obj/home/pjeremy/xxx/src/sys/LIBICONV. I think you need to include to get curthread. (This should probably be documented in sx(9)). --=20 Peter Jeremy --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAkmbUyUACgkQ/opHv/APuIdVcwCgmHxNJqcSUdjk27AMgyY2aai+ Z08An1wYeZH24EmoIJfKcXcS6V6k9OSm =vITA -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 00:30:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E051D106564A; Wed, 18 Feb 2009 00:30:19 +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 9E7468FC14; Wed, 18 Feb 2009 00:30:19 +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 5F7DF6D43F; Wed, 18 Feb 2009 00:30:18 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 43A89844DF; Wed, 18 Feb 2009 01:30:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Sean Bruno References: <200902171937.n1HJb4E6025748@svn.freebsd.org> Date: Wed, 18 Feb 2009 01:30:18 +0100 In-Reply-To: <200902171937.n1HJb4E6025748@svn.freebsd.org> (Sean Bruno's message of "Tue, 17 Feb 2009 19:37:04 +0000 (UTC)") Message-ID: <8663j8r3hh.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, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188726 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 00:30:20 -0000 Sean Bruno writes: > Deprecate unused phy_delay Self ID field as it was removed > by 1394a-2000. You forgot fwcontrol(8). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 01:36:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D77F106564A; Wed, 18 Feb 2009 01:36:21 +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 117FF8FC17; Wed, 18 Feb 2009 01:36:21 +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 n1I1aKJB033258; Wed, 18 Feb 2009 01:36:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1I1aKIA033256; Wed, 18 Feb 2009 01:36:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200902180136.n1I1aKIA033256@svn.freebsd.org> From: Ed Maste Date: Wed, 18 Feb 2009 01:36: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: r188743 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 01:36:21 -0000 Author: emaste Date: Wed Feb 18 01:36:20 2009 New Revision: 188743 URL: http://svn.freebsd.org/changeset/base/188743 Log: Use outbound message register 0 instead of mailbox 7 in aac_{rx,rkt}_get_fwstatus, as done in Adaptec's vendor driver as well as the Linux drivers. Submitted by: jkim, from Adaptec's driver Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aacreg.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Feb 17 23:56:16 2009 (r188742) +++ head/sys/dev/aac/aac.c Wed Feb 18 01:36:20 2009 (r188743) @@ -2375,7 +2375,7 @@ aac_rx_get_fwstatus(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RX_FWSTATUS)); + return(AAC_GETREG4(sc, AAC_RX_OMR0)); } static int @@ -2394,7 +2394,7 @@ aac_rkt_get_fwstatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RKT_FWSTATUS)); + return(AAC_GETREG4(sc, AAC_RKT_OMR0)); } /* Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Tue Feb 17 23:56:16 2009 (r188742) +++ head/sys/dev/aac/aacreg.h Wed Feb 18 01:36:20 2009 (r188743) @@ -1495,6 +1495,8 @@ enum { * and other related adapters. */ +#define AAC_RX_OMR0 0x18 /* outbound message register 0 */ +#define AAC_RX_OMR1 0x1c /* outbound message register 1 */ #define AAC_RX_IDBR 0x20 /* inbound doorbell register */ #define AAC_RX_IISR 0x24 /* inbound interrupt status register */ #define AAC_RX_IIMR 0x28 /* inbound interrupt mask register */ @@ -1512,6 +1514,8 @@ enum { * Unsurprisingly, it's quite similar to the i960! */ +#define AAC_RKT_OMR0 0x18 /* outbound message register 0 */ +#define AAC_RKT_OMR1 0x1c /* outbound message register 1 */ #define AAC_RKT_IDBR 0x20 /* inbound doorbell register */ #define AAC_RKT_IISR 0x24 /* inbound interrupt status register */ #define AAC_RKT_IIMR 0x28 /* inbound interrupt mask register */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 01:37:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 995E410656C9; Wed, 18 Feb 2009 01:37:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 878618FC1C; Wed, 18 Feb 2009 01:37:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1I1bvau033320; Wed, 18 Feb 2009 01:37:57 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1I1bv6C033318; Wed, 18 Feb 2009 01:37:57 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902180137.n1I1bv6C033318@svn.freebsd.org> From: Sam Leffler Date: Wed, 18 Feb 2009 01:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188744 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 01:37:58 -0000 Author: sam Date: Wed Feb 18 01:37:57 2009 New Revision: 188744 URL: http://svn.freebsd.org/changeset/base/188744 Log: use mii instead of miibus so we don't drag in all phy support (we only need ukphy which is brought in by mii) MFC after: 1 week Modified: head/sys/arm/conf/AVILA head/sys/arm/conf/CAMBRIA Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Feb 18 01:36:20 2009 (r188743) +++ head/sys/arm/conf/AVILA Wed Feb 18 01:37:57 2009 (r188744) @@ -88,7 +88,7 @@ device npe # Network Processing Engine device npe_fw device firmware device qmgr # Q Manager (required by npe) -device miibus # NB: required by npe +device mii # NB: required by npe device ether device bpf Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Wed Feb 18 01:36:20 2009 (r188743) +++ head/sys/arm/conf/CAMBRIA Wed Feb 18 01:37:57 2009 (r188744) @@ -87,7 +87,7 @@ device npe # Network Processing Engine device npe_fw device firmware device qmgr # Q Manager (required by npe) -device miibus # NB: required by npe +device mii # NB: required by npe device ether device bpf From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 02:17:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF576106564A; Wed, 18 Feb 2009 02:17:49 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id A2ECF8FC12; Wed, 18 Feb 2009 02:17:49 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=daemon.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LZbVK-000FQL-VC; Wed, 18 Feb 2009 09:45:39 +0800 Message-ID: <499B6865.5050108@micom.mng.net> Date: Wed, 18 Feb 2009 09:46:13 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.12 (X11/20080415) MIME-Version: 1.0 To: Alexander Motin References: <200902172117.n1HLHLlY027887@svn.freebsd.org> In-Reply-To: <200902172117.n1HLHLlY027887@svn.freebsd.org> X-Enigmail-Version: 0.95.6 OpenPGP: id=78F6425E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188731 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 02:17:50 -0000 Alexander Motin wrote: > Author: mav > Date: Tue Feb 17 21:17:21 2009 > New Revision: 188731 > URL: http://svn.freebsd.org/changeset/base/188731 > > Log: > ata_interrupt() does not need to return anything. It is not it's business > to report request completion, expecially when it is not reliable. > > Alexander, Since you are there, can you remove unused variable in ata-all.c? http://people.freebsd.org/~ganbold/cp_patches/ata-all.c.patch thanks, Ganbold From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 04:54:28 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB2151065673; Wed, 18 Feb 2009 04:54:28 +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 813AB8FC1D; Wed, 18 Feb 2009 04:54:28 +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 n1I4pmAk040911; Tue, 17 Feb 2009 21:51:48 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 17 Feb 2009 21:51:56 -0700 (MST) Message-Id: <20090217.215156.-1148289713.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200902171917.n1HJHPhI024877@svn.freebsd.org> References: <200902171917.n1HJHPhI024877@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188725 - head/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 04:54:29 -0000 In message: <200902171917.n1HJHPhI024877@svn.freebsd.org> Alexander Motin writes: : Add kernel dumping support. Works fine with sdhci controller driver. Woot! Warner From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 06:17:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36555106564A; Wed, 18 Feb 2009 06:17: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 240DE8FC1C; Wed, 18 Feb 2009 06:17: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 n1I6HEZp046784; Wed, 18 Feb 2009 06:17:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1I6HEnO046783; Wed, 18 Feb 2009 06:17:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902180617.n1I6HEnO046783@svn.freebsd.org> From: Andrew Thompson Date: Wed, 18 Feb 2009 06:17: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: r188745 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 06:17:15 -0000 Author: thompsa Date: Wed Feb 18 06:17:13 2009 New Revision: 188745 URL: http://svn.freebsd.org/changeset/base/188745 Log: Bump __FreeBSD_version to 800063 after GENERIC changed to USB2. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Feb 18 01:37:57 2009 (r188744) +++ head/sys/sys/param.h Wed Feb 18 06:17:13 2009 (r188745) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800062 /* Master, propagated to newvers */ +#define __FreeBSD_version 800063 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 06:33:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 045FE106566B; Wed, 18 Feb 2009 06:33:15 +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 E179F8FC08; Wed, 18 Feb 2009 06:33: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 n1I6XEHn047682; Wed, 18 Feb 2009 06:33:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1I6XArW047591; Wed, 18 Feb 2009 06:33:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902180633.n1I6XArW047591@svn.freebsd.org> From: Andrew Thompson Date: Wed, 18 Feb 2009 06: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: r188746 - in head/sys: conf dev/usb2/bluetooth dev/usb2/core dev/usb2/ethernet dev/usb2/image dev/usb2/include dev/usb2/input dev/usb2/misc dev/usb2/quirk dev/usb2/serial dev/usb2/sound... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 06:33:15 -0000 Author: thompsa Date: Wed Feb 18 06:33:10 2009 New Revision: 188746 URL: http://svn.freebsd.org/changeset/base/188746 Log: Switch over to usbdevs.h generated at compile time. Deleted: head/sys/dev/usb2/include/Makefile head/sys/dev/usb2/include/usb2_devid.h head/sys/dev/usb2/include/usb2_devtable.h Modified: head/sys/conf/files head/sys/dev/usb2/bluetooth/ng_ubt2.c head/sys/dev/usb2/bluetooth/ubtbcmfw2.c head/sys/dev/usb2/core/usb2_device.c head/sys/dev/usb2/ethernet/if_aue2.c head/sys/dev/usb2/ethernet/if_axe2.c head/sys/dev/usb2/ethernet/if_cdce2.c head/sys/dev/usb2/ethernet/if_cue2.c head/sys/dev/usb2/ethernet/if_kue2.c head/sys/dev/usb2/ethernet/if_rue2.c head/sys/dev/usb2/ethernet/if_udav2.c head/sys/dev/usb2/image/uscanner2.c head/sys/dev/usb2/input/uhid2.c head/sys/dev/usb2/input/ums2.c head/sys/dev/usb2/misc/udbp2.c head/sys/dev/usb2/misc/ufm2.c head/sys/dev/usb2/quirk/usb2_quirk.c head/sys/dev/usb2/serial/u3g2.c head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/ulpt2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/uslcom2.c head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c head/sys/dev/usb2/sound/uaudio2.c head/sys/dev/usb2/storage/ata-usb2.c head/sys/dev/usb2/storage/umass2.c head/sys/dev/usb2/storage/urio2.c head/sys/dev/usb2/storage/ustorage2_fs.c head/sys/dev/usb2/wlan/if_rum2.c head/sys/dev/usb2/wlan/if_ural2.c head/sys/dev/usb2/wlan/if_zyd2.c head/sys/modules/usb2/bluetooth_fw/Makefile head/sys/modules/usb2/bluetooth_ng/Makefile head/sys/modules/usb2/core/Makefile head/sys/modules/usb2/ethernet_aue/Makefile head/sys/modules/usb2/ethernet_axe/Makefile head/sys/modules/usb2/ethernet_cdce/Makefile head/sys/modules/usb2/ethernet_cue/Makefile head/sys/modules/usb2/ethernet_dav/Makefile head/sys/modules/usb2/ethernet_kue/Makefile head/sys/modules/usb2/ethernet_rue/Makefile head/sys/modules/usb2/input_hid/Makefile head/sys/modules/usb2/input_kbd/Makefile head/sys/modules/usb2/input_ms/Makefile head/sys/modules/usb2/misc_dbp/Makefile head/sys/modules/usb2/misc_fm/Makefile head/sys/modules/usb2/quirk/Makefile head/sys/modules/usb2/scanner/Makefile head/sys/modules/usb2/serial_3g/Makefile head/sys/modules/usb2/serial_ark/Makefile head/sys/modules/usb2/serial_bsa/Makefile head/sys/modules/usb2/serial_bser/Makefile head/sys/modules/usb2/serial_chcom/Makefile head/sys/modules/usb2/serial_cycom/Makefile head/sys/modules/usb2/serial_foma/Makefile head/sys/modules/usb2/serial_ftdi/Makefile head/sys/modules/usb2/serial_gensa/Makefile head/sys/modules/usb2/serial_ipaq/Makefile head/sys/modules/usb2/serial_lpt/Makefile head/sys/modules/usb2/serial_mct/Makefile head/sys/modules/usb2/serial_modem/Makefile head/sys/modules/usb2/serial_moscom/Makefile head/sys/modules/usb2/serial_plcom/Makefile head/sys/modules/usb2/serial_slcom/Makefile head/sys/modules/usb2/serial_visor/Makefile head/sys/modules/usb2/serial_vscom/Makefile head/sys/modules/usb2/sound/Makefile head/sys/modules/usb2/storage_ata/Makefile head/sys/modules/usb2/storage_fs/Makefile head/sys/modules/usb2/storage_mass/Makefile head/sys/modules/usb2/storage_rio/Makefile head/sys/modules/usb2/template/Makefile head/sys/modules/usb2/wlan_ral/Makefile head/sys/modules/usb2/wlan_rum/Makefile head/sys/modules/usb2/wlan_zyd/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/conf/files Wed Feb 18 06:33:10 2009 (r188746) @@ -80,12 +80,12 @@ teken_state.h optional sc \ compile-with "${AWK} -f $S/dev/syscons/teken/gensequences $S/dev/syscons/teken/sequences > teken_state.h" \ no-obj no-implicit-rule before-depend \ clean "teken_state.h" -usbdevs.h optional usb \ +usbdevs.h optional usb | usb2_core \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ no-obj no-implicit-rule before-depend \ clean "usbdevs.h" -usbdevs_data.h optional usb \ +usbdevs_data.h optional usb | usb2_core \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ no-obj no-implicit-rule before-depend \ Modified: head/sys/dev/usb2/bluetooth/ng_ubt2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ng_ubt2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/bluetooth/ng_ubt2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -92,7 +92,7 @@ * that this pointer is valid. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/bluetooth/ubtbcmfw2.c ============================================================================== --- head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/bluetooth/ubtbcmfw2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -31,7 +31,7 @@ * $FreeBSD$ */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/core/usb2_device.c ============================================================================== --- head/sys/dev/usb2/core/usb2_device.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/core/usb2_device.c Wed Feb 18 06:33:10 2009 (r188746) @@ -29,7 +29,7 @@ #include #include #include -#include +#include "usbdevs.h" #define USB_DEBUG_VAR usb2_debug @@ -1869,8 +1869,8 @@ struct usb_knowndev { #define USB_KNOWNDEV_NOPROD 0x01 /* match on vendor only */ -#include -#include +#include "usbdevs.h" +#include "usbdevs_data.h" #endif /* USB_VERBOSE */ /*------------------------------------------------------------------------* Modified: head/sys/dev/usb2/ethernet/if_aue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_aue2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_aue2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); * transfers are done using usb2_transfer() and friends. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_axe2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_axe2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_axe2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); * http://www.asix.com.tw/FrootAttach/datasheet/AX88772_datasheet_Rev10.pdf */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_cdce2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cdce2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_cdce2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -43,7 +43,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_cue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_cue2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_cue2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); * transaction, which helps performance a great deal. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_kue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_kue2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_kue2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); * the development of this driver. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_rue2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_rue2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_rue2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); * ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/ethernet/if_udav2.c ============================================================================== --- head/sys/dev/usb2/ethernet/if_udav2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/ethernet/if_udav2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -46,7 +46,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/image/uscanner2.c ============================================================================== --- head/sys/dev/usb2/image/uscanner2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/image/uscanner2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/input/uhid2.c ============================================================================== --- head/sys/dev/usb2/input/uhid2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/input/uhid2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/input/ums2.c ============================================================================== --- head/sys/dev/usb2/input/ums2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/input/ums2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/misc/udbp2.c ============================================================================== --- head/sys/dev/usb2/misc/udbp2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/misc/udbp2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); * */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/misc/ufm2.c ============================================================================== --- head/sys/dev/usb2/misc/ufm2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/misc/ufm2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/quirk/usb2_quirk.c ============================================================================== --- head/sys/dev/usb2/quirk/usb2_quirk.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/quirk/usb2_quirk.c Wed Feb 18 06:33:10 2009 (r188746) @@ -29,7 +29,7 @@ #include #include #include -#include +#include "usbdevs.h" #define USB_DEBUG_VAR usb2_debug Modified: head/sys/dev/usb2/serial/u3g2.c ============================================================================== --- head/sys/dev/usb2/serial/u3g2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/u3g2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -33,7 +33,7 @@ * - The device ID's are stored in "core/usb2_msctest.c" */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uark2.c ============================================================================== --- head/sys/dev/usb2/serial/uark2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uark2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -23,7 +23,7 @@ * be called from within the config thread function ! */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/ubsa2.c ============================================================================== --- head/sys/dev/usb2/serial/ubsa2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/ubsa2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uchcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uchcom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uchcom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); * driver for WinChipHead CH341/340, the worst USB-serial chip in the world. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/ucycom2.c ============================================================================== --- head/sys/dev/usb2/serial/ucycom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/ucycom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); * RS232 bridges. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/ufoma2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); * be called from within the config thread function ! */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uftdi2.c ============================================================================== --- head/sys/dev/usb2/serial/uftdi2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uftdi2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); * FTDI FT8U100AX serial adapter driver */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/ugensa2.c ============================================================================== --- head/sys/dev/usb2/serial/ugensa2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/ugensa2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -42,7 +42,7 @@ * be called from within the config thread function ! */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uipaq2.c ============================================================================== --- head/sys/dev/usb2/serial/uipaq2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uipaq2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -51,7 +51,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/ulpt2.c ============================================================================== --- head/sys/dev/usb2/serial/ulpt2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/ulpt2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); * Printer Class spec: http://www.usb.org/developers/devclass_docs/usbprint11.pdf */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/umct2.c ============================================================================== --- head/sys/dev/usb2/serial/umct2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/umct2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); * be called from within the config thread function ! */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/umodem2.c ============================================================================== --- head/sys/dev/usb2/serial/umodem2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/umodem2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); * */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/umoscom2.c ============================================================================== --- head/sys/dev/usb2/serial/umoscom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/umoscom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -17,7 +17,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uplcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uplcom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uplcom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); * documented in the datasheet. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uslcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uslcom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uslcom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$"); * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uvisor2.c ============================================================================== --- head/sys/dev/usb2/serial/uvisor2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uvisor2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -54,7 +54,7 @@ * Handspring Visor (Palmpilot compatible PDA) driver */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/serial/uvscom2.c ============================================================================== --- head/sys/dev/usb2/serial/uvscom2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/serial/uvscom2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); * P-in m@ater and various data communication card adapters. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/sound/uaudio2.c ============================================================================== --- head/sys/dev/usb2/sound/uaudio2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/sound/uaudio2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -52,7 +52,7 @@ * $NetBSD: uaudio.c,v 1.97 2005/02/24 08:19:38 martin Exp $ */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/storage/ata-usb2.c ============================================================================== --- head/sys/dev/usb2/storage/ata-usb2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/storage/ata-usb2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/storage/umass2.c ============================================================================== --- head/sys/dev/usb2/storage/umass2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/storage/umass2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); * umass_cam_cb again to complete the CAM command. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/storage/urio2.c ============================================================================== --- head/sys/dev/usb2/storage/urio2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/storage/urio2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); * 2000/2/24 first version. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/storage/ustorage2_fs.c ============================================================================== --- head/sys/dev/usb2/storage/ustorage2_fs.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/storage/ustorage2_fs.c Wed Feb 18 06:33:10 2009 (r188746) @@ -35,7 +35,7 @@ * NOTE: Much of the SCSI statemachine handling code derives from the * Linux USB gadget stack. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/wlan/if_rum2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_rum2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/wlan/if_rum2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); * http://www.ralinktech.com.tw/ */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/wlan/if_ural2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_ural2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/wlan/if_ural2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); * http://www.ralinktech.com/ */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/dev/usb2/wlan/if_zyd2.c Wed Feb 18 06:33:10 2009 (r188746) @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); * ZyDAS ZD1211/ZD1211B USB WLAN driver. */ -#include +#include "usbdevs.h" #include #include #include Modified: head/sys/modules/usb2/bluetooth_fw/Makefile ============================================================================== --- head/sys/modules/usb2/bluetooth_fw/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/bluetooth_fw/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_bluetooth_fw SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_netgraph.h +SRCS+= opt_usb.h opt_bus.h opt_netgraph.h usbdevs.h SRCS+= ubtbcmfw2.c .include Modified: head/sys/modules/usb2/bluetooth_ng/Makefile ============================================================================== --- head/sys/modules/usb2/bluetooth_ng/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/bluetooth_ng/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_bluetooth_ng SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_netgraph.h +SRCS+= opt_usb.h opt_bus.h opt_netgraph.h usbdevs.h SRCS+= ng_ubt2.c .include Modified: head/sys/modules/usb2/core/Makefile ============================================================================== --- head/sys/modules/usb2/core/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/core/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,6 +32,7 @@ S= ${.CURDIR}/../../.. KMOD= usb2_core SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h opt_usb.h opt_bus.h +SRCS+= usbdevs.h usbdevs_data.h SRCS+= usb2_if.c SRCS+= usb2_busdma.c SRCS+= usb2_compat_linux.c Modified: head/sys/modules/usb2/ethernet_aue/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_aue/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_aue/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_aue SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_aue2.c .include Modified: head/sys/modules/usb2/ethernet_axe/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_axe/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_axe/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_axe SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_axe2.c .include Modified: head/sys/modules/usb2/ethernet_cdce/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_cdce/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_cdce/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_cdce SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_cdce2.c .include Modified: head/sys/modules/usb2/ethernet_cue/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_cue/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_cue/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_cue SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_cue2.c .include Modified: head/sys/modules/usb2/ethernet_dav/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_dav/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_dav/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_dav SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_udav2.c .include Modified: head/sys/modules/usb2/ethernet_kue/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_kue/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_kue/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_kue SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_kue2.c .include Modified: head/sys/modules/usb2/ethernet_rue/Makefile ============================================================================== --- head/sys/modules/usb2/ethernet_rue/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/ethernet_rue/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_ethernet_rue SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_rue2.c .include Modified: head/sys/modules/usb2/input_hid/Makefile ============================================================================== --- head/sys/modules/usb2/input_hid/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/input_hid/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_input_hid SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h usbdevs.h SRCS+= uhid2.c .include Modified: head/sys/modules/usb2/input_kbd/Makefile ============================================================================== --- head/sys/modules/usb2/input_kbd/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/input_kbd/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_input_kbd SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h usbdevs.h SRCS+= ukbd2.c .include Modified: head/sys/modules/usb2/input_ms/Makefile ============================================================================== --- head/sys/modules/usb2/input_ms/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/input_ms/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_input_ms SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h opt_kbd.h opt_ukbd.h usbdevs.h SRCS+= ums2.c .include Modified: head/sys/modules/usb2/misc_dbp/Makefile ============================================================================== --- head/sys/modules/usb2/misc_dbp/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/misc_dbp/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_misc_dbp SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_netgraph.h +SRCS+= opt_usb.h opt_bus.h opt_netgraph.h usbdevs.h SRCS+= udbp2.c .include Modified: head/sys/modules/usb2/misc_fm/Makefile ============================================================================== --- head/sys/modules/usb2/misc_fm/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/misc_fm/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_misc_fm SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_netgraph.h +SRCS+= opt_usb.h opt_bus.h opt_netgraph.h usbdevs.h SRCS+= ufm2.c .include Modified: head/sys/modules/usb2/quirk/Makefile ============================================================================== --- head/sys/modules/usb2/quirk/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/quirk/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -31,7 +31,7 @@ S= ${.CURDIR}/../../.. KMOD= usb2_quirk SRCS= -SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h opt_usb.h opt_bus.h +SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h opt_usb.h opt_bus.h usbdevs.h SRCS+= usb2_quirk.c .include Modified: head/sys/modules/usb2/scanner/Makefile ============================================================================== --- head/sys/modules/usb2/scanner/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/scanner/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_scanner SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h +SRCS+= opt_usb.h opt_bus.h usbdevs.h SRCS+= uscanner2.c .include Modified: head/sys/modules/usb2/serial_3g/Makefile ============================================================================== --- head/sys/modules/usb2/serial_3g/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_3g/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_3g SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= u3g2.c .include Modified: head/sys/modules/usb2/serial_ark/Makefile ============================================================================== --- head/sys/modules/usb2/serial_ark/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_ark/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_ark SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uark2.c .include Modified: head/sys/modules/usb2/serial_bsa/Makefile ============================================================================== --- head/sys/modules/usb2/serial_bsa/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_bsa/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_bsa SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ubsa2.c .include Modified: head/sys/modules/usb2/serial_bser/Makefile ============================================================================== --- head/sys/modules/usb2/serial_bser/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_bser/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_bser SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ubser2.c .include Modified: head/sys/modules/usb2/serial_chcom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_chcom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_chcom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_chcom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uchcom2.c .include Modified: head/sys/modules/usb2/serial_cycom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_cycom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_cycom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_cycom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ucycom2.c .include Modified: head/sys/modules/usb2/serial_foma/Makefile ============================================================================== --- head/sys/modules/usb2/serial_foma/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_foma/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_foma SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ufoma2.c .include Modified: head/sys/modules/usb2/serial_ftdi/Makefile ============================================================================== --- head/sys/modules/usb2/serial_ftdi/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_ftdi/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_ftdi SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uftdi2.c .include Modified: head/sys/modules/usb2/serial_gensa/Makefile ============================================================================== --- head/sys/modules/usb2/serial_gensa/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_gensa/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_gensa SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ugensa2.c .include Modified: head/sys/modules/usb2/serial_ipaq/Makefile ============================================================================== --- head/sys/modules/usb2/serial_ipaq/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_ipaq/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_ipaq SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uipaq2.c .include Modified: head/sys/modules/usb2/serial_lpt/Makefile ============================================================================== --- head/sys/modules/usb2/serial_lpt/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_lpt/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_lpt SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= ulpt2.c .include Modified: head/sys/modules/usb2/serial_mct/Makefile ============================================================================== --- head/sys/modules/usb2/serial_mct/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_mct/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_mct SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= umct2.c .include Modified: head/sys/modules/usb2/serial_modem/Makefile ============================================================================== --- head/sys/modules/usb2/serial_modem/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_modem/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_modem SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= umodem2.c .include Modified: head/sys/modules/usb2/serial_moscom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_moscom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_moscom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_moscom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= umoscom2.c .include Modified: head/sys/modules/usb2/serial_plcom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_plcom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_plcom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_plcom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uplcom2.c .include Modified: head/sys/modules/usb2/serial_slcom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_slcom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_slcom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_slcom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uslcom2.c .include Modified: head/sys/modules/usb2/serial_visor/Makefile ============================================================================== --- head/sys/modules/usb2/serial_visor/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_visor/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_visor SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uvisor2.c .include Modified: head/sys/modules/usb2/serial_vscom/Makefile ============================================================================== --- head/sys/modules/usb2/serial_vscom/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/serial_vscom/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_serial_vscom SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_compat.h +SRCS+= opt_usb.h opt_bus.h opt_compat.h usbdevs.h SRCS+= uvscom2.c .include Modified: head/sys/modules/usb2/sound/Makefile ============================================================================== --- head/sys/modules/usb2/sound/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/sound/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S= ${.CURDIR}/../../.. KMOD= usb2_sound SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h +SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h usbdevs.h SRCS+= mixer_if.h SRCS+= usb2_sound.c Modified: head/sys/modules/usb2/storage_ata/Makefile ============================================================================== --- head/sys/modules/usb2/storage_ata/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/storage_ata/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_storage_ata SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h +SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h usbdevs.h SRCS+= ata-usb2.c .include Modified: head/sys/modules/usb2/storage_fs/Makefile ============================================================================== --- head/sys/modules/usb2/storage_fs/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/storage_fs/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_storage_fs SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h +SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h usbdevs.h SRCS+= ustorage2_fs.c .include Modified: head/sys/modules/usb2/storage_mass/Makefile ============================================================================== --- head/sys/modules/usb2/storage_mass/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/storage_mass/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_storage_mass SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h +SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h usbdevs.h SRCS+= umass2.c .include Modified: head/sys/modules/usb2/storage_rio/Makefile ============================================================================== --- head/sys/modules/usb2/storage_rio/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/storage_rio/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_storage_rio SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h +SRCS+= opt_usb.h opt_bus.h opt_cam.h opt_ata.h ata_if.h usbdevs.h SRCS+= urio2.c .include Modified: head/sys/modules/usb2/template/Makefile ============================================================================== --- head/sys/modules/usb2/template/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/template/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -31,7 +31,7 @@ S= ${.CURDIR}/../../.. KMOD= usb2_template SRCS= -SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h opt_usb.h opt_bus.h +SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h opt_usb.h opt_bus.h usbdevs.h SRCS+= usb2_template.c SRCS+= usb2_template_cdce.c SRCS+= usb2_template_msc.c Modified: head/sys/modules/usb2/wlan_ral/Makefile ============================================================================== --- head/sys/modules/usb2/wlan_ral/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/wlan_ral/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_wlan_ral SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_ural2.c .include Modified: head/sys/modules/usb2/wlan_rum/Makefile ============================================================================== --- head/sys/modules/usb2/wlan_rum/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/wlan_rum/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_wlan_rum SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_rum2.c .include Modified: head/sys/modules/usb2/wlan_zyd/Makefile ============================================================================== --- head/sys/modules/usb2/wlan_zyd/Makefile Wed Feb 18 06:17:13 2009 (r188745) +++ head/sys/modules/usb2/wlan_zyd/Makefile Wed Feb 18 06:33:10 2009 (r188746) @@ -32,7 +32,7 @@ S=${.CURDIR}/../../.. KMOD=usb2_wlan_zyd SRCS= SRCS+= bus_if.h usb2_if.h device_if.h vnode_if.h -SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h +SRCS+= opt_usb.h miibus_if.h opt_inet.h opt_bus.h usbdevs.h SRCS+= if_zyd2.c .include From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 08:18:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7EE106566C; Wed, 18 Feb 2009 08:18:07 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id B79358FC15; Wed, 18 Feb 2009 08:18:07 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 86E38299991; Wed, 18 Feb 2009 03:18:06 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 18 Feb 2009 03:18:06 -0500 X-Sasl-enc: 9VbU2RwHv594ZFsVm+gAl7DYpB7x1cGKod1xWkeizewT 1234945086 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id A5E4720617; Wed, 18 Feb 2009 03:18:05 -0500 (EST) Message-ID: <499BC43B.6030701@incunabulum.net> Date: Wed, 18 Feb 2009 08:18:03 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: John Baldwin References: <200902171957.n1HJvqk8026145@svn.freebsd.org> In-Reply-To: <200902171957.n1HJvqk8026145@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 08:18:09 -0000 John Baldwin wrote: > Author: jhb > Date: Tue Feb 17 19:57:52 2009 > New Revision: 188727 > URL: http://svn.freebsd.org/changeset/base/188727 > > Log: > MFC: Rework the lifetime management of the kernel implementation of POSIX > semaphores. Specifically, semaphores are now represented as new file > descriptor type that is set to close on exec. This removes the need for > all of the manual process reference counting (and fork, exec, and exit > event handlers) as the normal file descriptor operations handle all of > that for us nicely. It is also suggested as one possible implementation > in the spec and at least one other OS (OS X) uses this approach. FYI: This change *may* fix Python 2.6's 'multiprocessing' module on FreeBSD 7-STABLE, which is known to have problems there; it depends on POSIX semaphores to synchronize its IPC between different fork()'s of the Python interpreter. If anyone else has an interest in ths they may wish to test, if not, I will try to get around to it eventually. cheers BMS From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 10:02:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD6E9106566B; Wed, 18 Feb 2009 10:02:33 +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 774B78FC12; Wed, 18 Feb 2009 10:02:33 +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 n1IA2XSN058799; Wed, 18 Feb 2009 10:02:33 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IA2XGV058798; Wed, 18 Feb 2009 10:02:33 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902181002.n1IA2XGV058798@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 18 Feb 2009 10:02: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: r188749 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 10:02:34 -0000 Author: maxim Date: Wed Feb 18 10:02:32 2009 New Revision: 188749 URL: http://svn.freebsd.org/changeset/base/188749 Log: o DragonFly 2.2.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Feb 18 07:09:47 2009 (r188748) +++ head/share/misc/bsd-family-tree Wed Feb 18 10:02:32 2009 (r188749) @@ -226,7 +226,7 @@ FreeBSD 5.2 | | | | 6.4 | | | | | | | | | | | FreeBSD 7.1 | | | | - | | | | | | + | | | | | DragonFly 2.2.0 | V | | | | | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | @@ -495,6 +495,7 @@ DragonFly 2.0.0 2008-07-21 [DFB] OpenBSD 4.4 2008-11-01 [OBD] FreeBSD 6.4 2008-11-28 [FBD] FreeBSD 7.1 2009-01-04 [FBD] +DragonFly 2.2.0 2000-02-17 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 12:04:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2987610657E9; Wed, 18 Feb 2009 12:04:03 +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 A77EF8FC12; Wed, 18 Feb 2009 12:04:02 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 53B4B1CF52; Wed, 18 Feb 2009 13:04:01 +0100 (CET) Date: Wed, 18 Feb 2009 13:04:01 +0100 From: Ed Schouten To: Andrew Thompson Message-ID: <20090218120401.GM79178@hoeg.nl> References: <200902180617.n1I6HEnO046783@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w+rhPQc/K9ract27" Content-Disposition: inline In-Reply-To: <200902180617.n1I6HEnO046783@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: r188745 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 12:04:17 -0000 --w+rhPQc/K9ract27 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andrew Thompson wrote: > Bump __FreeBSD_version to 800063 after GENERIC changed to USB2. Let this __FreeBSD_version also indicate the addition of fdevname() and fdevname_r(). I didn't increase __FreeBSD_version for this, because I suspected it would be done anyway. I'll add it to the porters handbook. --=20 Ed Schouten WWW: http://80386.nl/ --w+rhPQc/K9ract27 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmb+TEACgkQ52SDGA2eCwWhqgCfeOeonQpaZk4i2arqXpF8tNKn xpwAnidHU2wrHRmEJPVgl47Ik1u+uP/4 =k4vO -----END PGP SIGNATURE----- --w+rhPQc/K9ract27-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 14:16:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8956A1065672; Wed, 18 Feb 2009 14:16:39 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id 580178FC1D; Wed, 18 Feb 2009 14:16:39 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id DB159296C91; Wed, 18 Feb 2009 09:16:38 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 18 Feb 2009 09:16:38 -0500 X-Sasl-enc: NNQeH852CdtHgW9b8FhEL6vsmen6LLBVmvpFlyne7xXq 1234966598 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 01F3C30711; Wed, 18 Feb 2009 09:16:37 -0500 (EST) Message-ID: <499C1843.90008@incunabulum.net> Date: Wed, 18 Feb 2009 14:16:35 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.19 (X11/20081209) MIME-Version: 1.0 To: John Baldwin References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <499BC43B.6030701@incunabulum.net> In-Reply-To: <499BC43B.6030701@incunabulum.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 14:16:40 -0000 Bruce Simpson wrote: > .... > FYI: > This change *may* fix Python 2.6's 'multiprocessing' module on FreeBSD > 7-STABLE, which is known to have problems there; it depends on POSIX > semaphores to synchronize its IPC between different fork()'s of the > Python interpreter. > If anyone else has an interest in ths they may wish to test, if not, I > will try to get around to it eventually. I just tested this and Python 2.5 still dumps core in sem_open() when called from semlock_new() in _multiprocessing.so, this is with the most recent back-port of multiprocessing to Python 2.5: http://pypi.python.org/pypi/multiprocessing cheers BMS From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 15:10:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BC3D1065676; Wed, 18 Feb 2009 15:10:50 +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 192D78FC21; Wed, 18 Feb 2009 15:10:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 6DF9D46B2D; Wed, 18 Feb 2009 10:10:49 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1IFAhsM043449; Wed, 18 Feb 2009 10:10:43 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Peter Jeremy Date: Wed, 18 Feb 2009 09:48:52 -0500 User-Agent: KMail/1.9.7 References: <200902121437.n1CEbwUe058325@svn.freebsd.org> <20090218001533.GA3214@server.vk2pj.dyndns.org> In-Reply-To: <20090218001533.GA3214@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902180948.52908.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 18 Feb 2009 10:10:43 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9001/Tue Feb 17 23:29:20 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Phil Kim Subject: Re: svn commit: r188514 - in stable/7/sys: . contrib/pf dev/cxgb libkern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:10:51 -0000 On Tuesday 17 February 2009 7:15:33 pm Peter Jeremy wrote: > On 2009-Feb-12 14:37:58 +0000, John Baldwin wrote: > >Log: > > MFC: Add simple locking for the in-kernel iconv code. > > This breaks building LIBICONV: Given a config file comprising > include GENERIC > options LIBICONV > > you get: > cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -march=nocona -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/home/pjeremy/xxx/src/sys -I/home/pjeremy/xxx/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror /home/pjeremy/xxx/src/sys/libkern/iconv.c > /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_mod_unload': > /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: 'curthread' undeclared (first use in this function) > /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: (Each undeclared identifier is reported only once > /home/pjeremy/xxx/src/sys/libkern/iconv.c:92: error: for each function it appears in.) > /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_sysctl_add': > /home/pjeremy/xxx/src/sys/libkern/iconv.c:401: error: 'curthread' undeclared (first use in this function) > /home/pjeremy/xxx/src/sys/libkern/iconv.c: In function 'iconv_converter_handler': > /home/pjeremy/xxx/src/sys/libkern/iconv.c:452: error: 'curthread' undeclared (first use in this function) > *** Error code 1 > > Stop in /var/obj/home/pjeremy/xxx/src/sys/LIBICONV. > > I think you need to include to get curthread. (This should > probably be documented in sx(9)). This was fixed by the MFC to yesterday to include in the _KERNEL section. I had missed this since the build worked fine with LINT and the module build. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 15:10:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029C210656E3; Wed, 18 Feb 2009 15:10:55 +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 B6D558FC1D; Wed, 18 Feb 2009 15:10:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 53B5F46B35; Wed, 18 Feb 2009 10:10:55 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1IFAhsN043449; Wed, 18 Feb 2009 10:10:49 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Bruce Simpson Date: Wed, 18 Feb 2009 09:49:32 -0500 User-Agent: KMail/1.9.7 References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <499BC43B.6030701@incunabulum.net> In-Reply-To: <499BC43B.6030701@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902180949.32691.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 18 Feb 2009 10:10:49 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9001/Tue Feb 17 23:29:20 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:10:59 -0000 On Wednesday 18 February 2009 3:18:03 am Bruce Simpson wrote: > John Baldwin wrote: > > Author: jhb > > Date: Tue Feb 17 19:57:52 2009 > > New Revision: 188727 > > URL: http://svn.freebsd.org/changeset/base/188727 > > > > Log: > > MFC: Rework the lifetime management of the kernel implementation of POSIX > > semaphores. Specifically, semaphores are now represented as new file > > descriptor type that is set to close on exec. This removes the need for > > all of the manual process reference counting (and fork, exec, and exit > > event handlers) as the normal file descriptor operations handle all of > > that for us nicely. It is also suggested as one possible implementation > > in the spec and at least one other OS (OS X) uses this approach. > > FYI: > This change *may* fix Python 2.6's 'multiprocessing' module on FreeBSD > 7-STABLE, which is known to have problems there; it depends on POSIX > semaphores to synchronize its IPC between different fork()'s of the > Python interpreter. > > If anyone else has an interest in ths they may wish to test, if not, I > will try to get around to it eventually. When Kris tested it, it made things significantly better. I'm not sure if it resolved all the issues though. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 15:11:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED4810657B0; Wed, 18 Feb 2009 15:11:01 +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 9A3588FC22; Wed, 18 Feb 2009 15:11:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 3C07C46B2C; Wed, 18 Feb 2009 10:11:01 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1IFAhsO043449; Wed, 18 Feb 2009 10:10:55 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Bruce Simpson Date: Wed, 18 Feb 2009 10:05:28 -0500 User-Agent: KMail/1.9.7 References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <499BC43B.6030701@incunabulum.net> <499C1843.90008@incunabulum.net> In-Reply-To: <499C1843.90008@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902181005.28625.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 18 Feb 2009 10:10:55 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9001/Tue Feb 17 23:29:20 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:11:04 -0000 On Wednesday 18 February 2009 9:16:35 am Bruce Simpson wrote: > Bruce Simpson wrote: > > .... > > FYI: > > This change *may* fix Python 2.6's 'multiprocessing' module on FreeBSD > > 7-STABLE, which is known to have problems there; it depends on POSIX > > semaphores to synchronize its IPC between different fork()'s of the > > Python interpreter. > > If anyone else has an interest in ths they may wish to test, if not, I > > will try to get around to it eventually. > > I just tested this and Python 2.5 still dumps core in sem_open() when > called from semlock_new() in _multiprocessing.so, this is with the most > recent back-port of multiprocessing to Python 2.5: > http://pypi.python.org/pypi/multiprocessing Do you have a core dump with symbols? If so, can you get the trace? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 15:17:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A05C106564A; Wed, 18 Feb 2009 15:17:54 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id 051E38FC08; Wed, 18 Feb 2009 15:17:53 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 6DF7C299E41; Wed, 18 Feb 2009 10:17:53 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 18 Feb 2009 10:17:53 -0500 X-Sasl-enc: B0Y9+LqUJBjGs1uhX5G4nWGIcdTbuVUZ4YabfwmQTFfL 1234970272 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 2EAFE2C721; Wed, 18 Feb 2009 10:17:52 -0500 (EST) Message-ID: <499C269D.7030406@incunabulum.net> Date: Wed, 18 Feb 2009 15:17:49 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.19 (X11/20081209) MIME-Version: 1.0 To: John Baldwin References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <499BC43B.6030701@incunabulum.net> <499C1843.90008@incunabulum.net> <200902181005.28625.jhb@freebsd.org> In-Reply-To: <200902181005.28625.jhb@freebsd.org> Content-Type: multipart/mixed; boundary="------------030408070501040503000606" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:17:54 -0000 This is a multi-part message in MIME format. --------------030408070501040503000606 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit John Baldwin wrote: > ... > >> I just tested this and Python 2.5 still dumps core in sem_open() when >> called from semlock_new() in _multiprocessing.so, this is with the most >> recent back-port of multiprocessing to Python 2.5: >> http://pypi.python.org/pypi/multiprocessing >> > > Do you have a core dump with symbols? If so, can you get the trace? > Here you are... have runtime ELF symbols but no line numbers. I had to comment out some stuff in its "setup.py" to persuade the _multiprocessing C shim to use sem_open() (remove freebsd7 and/or freebsd8 from that file before "python setup.py config" and "python setup.py build"). I was running the Doc/includes/mp_benchmarks.py file which ships with multiprocessing. multiprocessing is part of Python 2.6 base now, so likely what is Not OK in the backport, would need to be forward-ported when it is happy with sem_open() in Python 2.5. cheers BMS --------------030408070501040503000606 Content-Type: text/plain; name="sch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="sch" KGdkYikgYnQKIzAgIDB4MDAwMDAwMDgwMGE5ZWM3YyBpbiBrc2VtX29wZW4gKCkgZnJvbSAv bGliL2xpYmMuc28uNwojMSAgMHgwMDAwMDAwODAwYTk1MDRkIGluIHNlbV9vcGVuICgpIGZy b20gL2xpYi9saWJjLnNvLjcKIzIgIDB4MDAwMDAwMDgwMTMxODQyYyBpbiBzZW1sb2NrX25l dyAoKQogICBmcm9tIC91c3IvbG9jYWwvbGliL3B5dGhvbjIuNS9zaXRlLXBhY2thZ2VzL211 bHRpcHJvY2Vzc2luZy0yLjYuMS4xLXB5Mi41LWZyZWVic2QtNy4xLVNUQUJMRS1hbWQ2NC5l Z2cvbXVsdGlwcm9jZXNzaW5nL19tdWx0aXByb2Nlc3Npbmcuc28KIzMgIDB4MDAwMDAwMDAw MDQ0YmM3MyBpbiBQeVR5cGVfSXNTdWJ0eXBlICgpCiM0ICAweDAwMDAwMDAwMDA0MTUxZDMg aW4gUHlPYmplY3RfQ2FsbCAoKQojNSAgMHgwMDAwMDAwMDAwNDZlNTViIGluIFB5RXZhbF9F dmFsRnJhbWVFeCAoKQojNiAgMHgwMDAwMDAwMDAwNDcxNzRjIGluIFB5RXZhbF9FdmFsQ29k ZUV4ICgpCiM3ICAweDAwMDAwMDAwMDA0YWZiZGEgaW4gUHlDbGFzc01ldGhvZF9OZXcgKCkK IzggIDB4MDAwMDAwMDAwMDQxNTFkMyBpbiBQeU9iamVjdF9DYWxsICgpCiM5ICAweDAwMDAw MDAwMDA0MWFlMGQgaW4gUHlDbGFzc19Jc1N1YmNsYXNzICgpCiMxMCAweDAwMDAwMDAwMDA0 MTUxZDMgaW4gUHlPYmplY3RfQ2FsbCAoKQojMTEgMHgwMDAwMDAwMDAwNDZlNTViIGluIFB5 RXZhbF9FdmFsRnJhbWVFeCAoKQojMTIgMHgwMDAwMDAwMDAwNDcxNzRjIGluIFB5RXZhbF9F dmFsQ29kZUV4ICgpCiMxMyAweDAwMDAwMDAwMDA0YWZiZGEgaW4gUHlDbGFzc01ldGhvZF9O ZXcgKCkKIzE0IDB4MDAwMDAwMDAwMDQxNTFkMyBpbiBQeU9iamVjdF9DYWxsICgpCiMxNSAw eDAwMDAwMDAwMDA0MWFlMGQgaW4gUHlDbGFzc19Jc1N1YmNsYXNzICgpCiMxNiAweDAwMDAw MDAwMDA0MTUxZDMgaW4gUHlPYmplY3RfQ2FsbCAoKQojMTcgMHgwMDAwMDAwMDAwNDRmOTM4 IGluIF9QeVR5cGVfTG9va3VwICgpCiMxOCAweDAwMDAwMDAwMDA0NGJjYjggaW4gUHlUeXBl X0lzU3VidHlwZSAoKQojMTkgMHgwMDAwMDAwMDAwNDE1MWQzIGluIFB5T2JqZWN0X0NhbGwg KCkKIzIwIDB4MDAwMDAwMDAwMDQ2ZTU1YiBpbiBQeUV2YWxfRXZhbEZyYW1lRXggKCkKIzIx IDB4MDAwMDAwMDAwMDQ3MTc0YyBpbiBQeUV2YWxfRXZhbENvZGVFeCAoKQojMjIgMHgwMDAw MDAwMDAwNGFmYmRhIGluIFB5Q2xhc3NNZXRob2RfTmV3ICgpCiMyMyAweDAwMDAwMDAwMDA0 MTUxZDMgaW4gUHlPYmplY3RfQ2FsbCAoKQojMjQgMHgwMDAwMDAwMDAwNDFhZTBkIGluIFB5 Q2xhc3NfSXNTdWJjbGFzcyAoKQojMjUgMHgwMDAwMDAwMDAwNDE1MWQzIGluIFB5T2JqZWN0 X0NhbGwgKCkKIzI2IDB4MDAwMDAwMDAwMDQ0ZjkzOCBpbiBfUHlUeXBlX0xvb2t1cCAoKQoj MjcgMHgwMDAwMDAwMDAwNDRiY2I4IGluIFB5VHlwZV9Jc1N1YnR5cGUgKCkKIzI4IDB4MDAw MDAwMDAwMDQxNTFkMyBpbiBQeU9iamVjdF9DYWxsICgpCiMyOSAweDAwMDAwMDAwMDA0NmU1 NWIgaW4gUHlFdmFsX0V2YWxGcmFtZUV4ICgpCiMzMCAweDAwMDAwMDAwMDA0NzE3NGMgaW4g UHlFdmFsX0V2YWxDb2RlRXggKCkKIzMxIDB4MDAwMDAwMDAwMDQ2ZmVmNCBpbiBQeUV2YWxf RXZhbEZyYW1lRXggKCkKIzMyIDB4MDAwMDAwMDAwMDQ3MDZmZCBpbiBQeUV2YWxfRXZhbEZy YW1lRXggKCkKIzMzIDB4MDAwMDAwMDAwMDQ3MTc0YyBpbiBQeUV2YWxfRXZhbENvZGVFeCAo KQojMzQgMHgwMDAwMDAwMDAwNDcxODYyIGluIFB5RXZhbF9FdmFsQ29kZSAoKQojMzUgMHgw MDAwMDAwMDAwNDhhZTAyIGluIFB5X0NvbXBpbGVTdHJpbmcgKCkKIzM2IDB4MDAwMDAwMDAw MDQ4YWVkNiBpbiBQeVJ1bl9GaWxlRXhGbGFncyAoKQojMzcgMHgwMDAwMDAwMDAwNDhjMzcz IGluIFB5UnVuX1NpbXBsZUZpbGVFeEZsYWdzICgpCiMzOCAweDAwMDAwMDAwMDA0MTIyMTkg aW4gUHlfTWFpbiAoKQojMzkgMHgwMDAwMDAwMDAwNDExODk3IGluIG1haW4gKCkK --------------030408070501040503000606-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 15:55:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79DA106566C; Wed, 18 Feb 2009 15:55:05 +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 B45598FC16; Wed, 18 Feb 2009 15:55:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 5989946B03; Wed, 18 Feb 2009 10:55:05 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1IFsrIV043674; Wed, 18 Feb 2009 10:54:59 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Bruce Simpson Date: Wed, 18 Feb 2009 10:54:35 -0500 User-Agent: KMail/1.9.7 References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <200902181005.28625.jhb@freebsd.org> <499C269D.7030406@incunabulum.net> In-Reply-To: <499C269D.7030406@incunabulum.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902181054.35709.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 18 Feb 2009 10:54:59 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9002/Wed Feb 18 06:16:50 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 15:55:06 -0000 On Wednesday 18 February 2009 10:17:49 am Bruce Simpson wrote: > John Baldwin wrote: > > ... > > > >> I just tested this and Python 2.5 still dumps core in sem_open() when > >> called from semlock_new() in _multiprocessing.so, this is with the most > >> recent back-port of multiprocessing to Python 2.5: > >> http://pypi.python.org/pypi/multiprocessing > >> > > > > Do you have a core dump with symbols? If so, can you get the trace? > > > > Here you are... have runtime ELF symbols but no line numbers. > > I had to comment out some stuff in its "setup.py" to persuade the > _multiprocessing C shim to use sem_open() (remove freebsd7 and/or > freebsd8 from that file before "python setup.py config" and "python > setup.py build"). > > I was running the Doc/includes/mp_benchmarks.py file which ships with > multiprocessing. > > multiprocessing is part of Python 2.6 base now, so likely what is Not OK > in the backport, would need to be forward-ported when it is happy with > sem_open() in Python 2.5. Hmm, by symbols I meant having things built with debug symbols (i.e. "-g"). Also, do you have 'sem.ko' loaded? The only reason I can think of why you would get a core dump in ksem_open() itself would be if you got a SIGSYS because the module wasn't loaded. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 16:11:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 527351065672; Wed, 18 Feb 2009 16:11:40 +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 25D9E8FC23; Wed, 18 Feb 2009 16:11:40 +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 n1IGBeZp068461; Wed, 18 Feb 2009 16:11:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IGBdcK068459; Wed, 18 Feb 2009 16:11:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902181611.n1IGBdcK068459@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Feb 2009 16:11: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: r188750 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 16:11:41 -0000 Author: kib Date: Wed Feb 18 16:11:39 2009 New Revision: 188750 URL: http://svn.freebsd.org/changeset/base/188750 Log: Adapt linux emulation to use cv for vfork wait. Submitted by: Takahiro Kurosawa PR: kern/131506 Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/i386/linux/linux_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Wed Feb 18 10:02:32 2009 (r188749) +++ head/sys/amd64/linux32/linux32_machdep.c Wed Feb 18 16:11:39 2009 (r188750) @@ -560,7 +560,7 @@ linux_vfork(struct thread *td, struct li /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); while (p2->p_flag & P_PPWAIT) - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); + cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); return (0); @@ -749,7 +749,7 @@ linux_clone(struct thread *td, struct li /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); while (p2->p_flag & P_PPWAIT) - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); + cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); } Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Wed Feb 18 10:02:32 2009 (r188749) +++ head/sys/i386/linux/linux_machdep.c Wed Feb 18 16:11:39 2009 (r188750) @@ -376,7 +376,7 @@ linux_vfork(struct thread *td, struct li /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); while (p2->p_flag & P_PPWAIT) - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); + cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); return (0); @@ -581,7 +581,7 @@ linux_clone(struct thread *td, struct li /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); while (p2->p_flag & P_PPWAIT) - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); + cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); } From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 16:34:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5102106566B; Wed, 18 Feb 2009 16:34:13 +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 935998FC13; Wed, 18 Feb 2009 16:34:13 +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 n1IGYDKC068996; Wed, 18 Feb 2009 16:34:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IGYDLs068995; Wed, 18 Feb 2009 16:34:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902181634.n1IGYDLs068995@svn.freebsd.org> From: John Baldwin Date: Wed, 18 Feb 2009 16:34: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: r188751 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 16:34:14 -0000 Author: jhb Date: Wed Feb 18 16:34:13 2009 New Revision: 188751 URL: http://svn.freebsd.org/changeset/base/188751 Log: Reindent a small bit of code that was not 8-space indented like the rest of the nfs_lookup() function. Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Wed Feb 18 16:11:39 2009 (r188750) +++ head/sys/nfsclient/nfs_vnops.c Wed Feb 18 16:34:13 2009 (r188751) @@ -897,12 +897,12 @@ nfs_lookup(struct vop_lookup_args *ap) newvp = *vpp; if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { - nfsstats.lookupcache_hits++; - if (cnp->cn_nameiop != LOOKUP && - (flags & ISLASTCN)) - cnp->cn_flags |= SAVENAME; - return (0); + && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + nfsstats.lookupcache_hits++; + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); } cache_purge(newvp); if (dvp != newvp) From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 17:36:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B334B10657CF; Wed, 18 Feb 2009 17:36:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF998FC08; Wed, 18 Feb 2009 17:36:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IHaiRH070249; Wed, 18 Feb 2009 17:36:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IHaip7070248; Wed, 18 Feb 2009 17:36:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902181736.n1IHaip7070248@svn.freebsd.org> From: Andriy Gapon Date: Wed, 18 Feb 2009 17:36: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: r188752 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 17:36:47 -0000 Author: avg Date: Wed Feb 18 17:36:44 2009 New Revision: 188752 URL: http://svn.freebsd.org/changeset/base/188752 Log: add myself to committers tree Approved by: rpaulo (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Feb 18 16:34:13 2009 (r188751) +++ head/share/misc/committers-src.dot Wed Feb 18 17:36:44 2009 (r188752) @@ -59,6 +59,7 @@ andre [label="Andre Oppermann\nandre@Fre anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] +avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] benjsc [label="Benjamin Close\nbenjsc@FreeBSD.org\n2007/02/09"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29"] @@ -300,6 +301,7 @@ jb -> sson jdp -> fjoe jhb -> arr +jhb -> avg jhb -> jeff jhb -> kbyanc jhb -> rnoland @@ -369,6 +371,8 @@ philip -> matteo pjd -> lulf +rpaulo -> avg + ru -> ceri ru -> cjc ru -> eik From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 18:25:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D22C1065670; Wed, 18 Feb 2009 18:25:17 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5A78FC27; Wed, 18 Feb 2009 18:25:17 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IIPHwv071205; Wed, 18 Feb 2009 18:25:17 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IIPH9n071204; Wed, 18 Feb 2009 18:25:17 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200902181825.n1IIPH9n071204@svn.freebsd.org> From: Roman Divacky Date: Wed, 18 Feb 2009 18:25: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: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 18:25:17 -0000 Author: rdivacky Date: Wed Feb 18 18:25:16 2009 New Revision: 188753 URL: http://svn.freebsd.org/changeset/base/188753 Log: Mark these variables as __used as those are used in the asm block. Approved by: kib (mentor) Modified: head/sys/i386/acpica/acpi_wakeup.c Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Wed Feb 18 17:36:44 2009 (r188752) +++ head/sys/i386/acpica/acpi_wakeup.c Wed Feb 18 18:25:16 2009 (r188753) @@ -64,13 +64,13 @@ extern uint32_t acpi_reset_video; extern void initializecpu(void); static struct region_descriptor saved_idt, saved_gdt, *p_gdt; -static uint16_t saved_ldt; +static uint16_t __used saved_ldt; -static uint32_t r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, +static uint32_t __used r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr; -static uint16_t r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; -static uint32_t r_esp; +static uint16_t __used r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; +static uint32_t __used r_esp; static void acpi_printcpu(void); static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 18:36:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35F10106564A; Wed, 18 Feb 2009 18:36:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24D0F8FC14; Wed, 18 Feb 2009 18:36:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IIaEsm071557; Wed, 18 Feb 2009 18:36:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IIaE15071556; Wed, 18 Feb 2009 18:36:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902181836.n1IIaE15071556@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Feb 2009 18:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188755 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 18:36:14 -0000 Author: mav Date: Wed Feb 18 18:36:13 2009 New Revision: 188755 URL: http://svn.freebsd.org/changeset/base/188755 Log: Remove unused variable. Submitted by: ganbold Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Feb 18 18:27:48 2009 (r188754) +++ head/sys/dev/ata/ata-all.c Wed Feb 18 18:36:13 2009 (r188755) @@ -304,11 +304,10 @@ ata_suspend(device_t dev) int ata_resume(device_t dev) { - struct ata_channel *ch; int error; /* check for valid device */ - if (!dev || !(ch = device_get_softc(dev))) + if (!dev || !device_get_softc(dev)) return ENXIO; /* reinit the devices, we dont know what mode/state they are in */ From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 18:41:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 735291065676; Wed, 18 Feb 2009 18:41:34 +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 5F7DC8FC19; Wed, 18 Feb 2009 18:41:34 +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 n1IIfYW1071681; Wed, 18 Feb 2009 18:41:34 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IIfYft071680; Wed, 18 Feb 2009 18:41:34 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902181841.n1IIfYft071680@svn.freebsd.org> From: Sean Bruno Date: Wed, 18 Feb 2009 18:41: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: r188756 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 18:41:36 -0000 Author: sbruno Date: Wed Feb 18 18:41:34 2009 New Revision: 188756 URL: http://svn.freebsd.org/changeset/base/188756 Log: Enhance debugging mode by storing the string "BB:TT:LL" once and use it instead of overloading sbp_show_sdev_info(). replace calls to printf with calls to device_printf and cleanup debug messages Remove a bit of dead, commented out code. Reviewed by: scottl(mentor) MFC after: 2 weeks Modified: head/sys/dev/firewire/sbp.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Wed Feb 18 18:36:13 2009 (r188755) +++ head/sys/dev/firewire/sbp.c Wed Feb 18 18:41:34 2009 (r188756) @@ -218,6 +218,7 @@ struct sbp_dev{ char vendor[32]; char product[32]; char revision[10]; + char bustgtlun[32]; }; struct sbp_target { @@ -364,36 +365,35 @@ END_DEBUG return (0); } +/* + * Display device characteristics on the console + */ static void -sbp_show_sdev_info(struct sbp_dev *sdev, int new) +sbp_show_sdev_info(struct sbp_dev *sdev) { struct fw_device *fwdev; - printf("%s:%d:%d ", - device_get_nameunit(sdev->target->sbp->fd.dev), - sdev->target->target_id, - sdev->lun_id - ); - if (new == 2) { - return; - } fwdev = sdev->target->fwdev; - printf("ordered:%d type:%d EUI:%08x%08x node:%d " - "speed:%d maxrec:%d", + device_printf(sdev->target->sbp->fd.dev, + "%s: %s: ordered:%d type:%d EUI:%08x%08x node:%d " + "speed:%d maxrec:%d\n", + __func__, + sdev->bustgtlun, (sdev->type & 0x40) >> 6, (sdev->type & 0x1f), fwdev->eui.hi, fwdev->eui.lo, fwdev->dst, fwdev->speed, - fwdev->maxrec - ); - if (new) - printf(" new!\n"); - else - printf("\n"); - sbp_show_sdev_info(sdev, 2); - printf("'%s' '%s' '%s'\n", sdev->vendor, sdev->product, sdev->revision); + fwdev->maxrec); + + device_printf(sdev->target->sbp->fd.dev, + "%s: %s '%s' '%s' '%s'\n", + __func__, + sdev->bustgtlun, + sdev->vendor, + sdev->product, + sdev->revision); } static struct { @@ -549,6 +549,10 @@ END_DEBUG CALLOUT_INIT(&sdev->login_callout); sdev->status = SBP_DEV_RESET; new = 1; + snprintf(sdev->bustgtlun, 32, "%s:%d:%d", + device_get_nameunit(sdev->target->sbp->fd.dev), + sdev->target->target_id, + sdev->lun_id); } sdev->flags |= VALID_LUN; sdev->type = (reg->val & 0xff0000) >> 16; @@ -717,20 +721,18 @@ static void sbp_probe_target(void *arg) { struct sbp_target *target = (struct sbp_target *)arg; - struct sbp_softc *sbp; + struct sbp_softc *sbp = target->sbp; struct sbp_dev *sdev; - struct firewire_comm *fc; int i, alive; alive = SBP_FWDEV_ALIVE(target->fwdev); SBP_DEBUG(1) - printf("sbp_probe_target %d\n", target->target_id); - if (!alive) - printf("not alive\n"); + device_printf(sbp->fd.dev, "%s %d%salive\n", + __func__, target->target_id, + (!alive) ? " not " : ""); END_DEBUG sbp = target->sbp; - fc = target->sbp->fd.fc; sbp_alloc_lun(target); /* XXX untimeout mgm_ocb and dequeue */ @@ -746,10 +748,7 @@ END_DEBUG SBP_UNLOCK(sbp); } sbp_probe_lun(sdev); -SBP_DEBUG(0) - sbp_show_sdev_info(sdev, - (sdev->status == SBP_DEV_RESET)); -END_DEBUG + sbp_show_sdev_info(sdev); sbp_abort_all_ocbs(sdev, CAM_SCSI_BUS_RESET); switch (sdev->status) { @@ -771,8 +770,8 @@ END_DEBUG case SBP_DEV_ATTACHED: SBP_DEBUG(0) /* the device has gone */ - sbp_show_sdev_info(sdev, 2); - printf("lost target\n"); + device_printf(sbp->fd.dev, "%s: lost target\n", + __func__); END_DEBUG if (sdev->path) { SBP_LOCK(sbp); @@ -857,12 +856,10 @@ END_DEBUG /* traverse device list */ STAILQ_FOREACH(fwdev, &sbp->fd.fc->devices, link) { SBP_DEBUG(0) - printf("sbp_post_explore: EUI:%08x%08x ", - fwdev->eui.hi, fwdev->eui.lo); - if (fwdev->status != FWDEVATTACHED) - printf("not attached, state=%d.\n", fwdev->status); - else - printf("attached\n"); + device_printf(sbp->fd.dev,"%s:: EUI:%08x%08x %s attached, state=%d\n", + __func__, fwdev->eui.hi, fwdev->eui.lo, + (fwdev->status != FWDEVATTACHED) ? "not" : "", + fwdev->status); END_DEBUG alive = SBP_FWDEV_ALIVE(fwdev); for(i = 0 ; i < SBP_NUM_TARGETS ; i ++){ @@ -899,8 +896,7 @@ sbp_loginres_callback(struct fw_xfer *xf struct sbp_dev *sdev; sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_loginres_callback\n"); + device_printf(sdev->target->sbp->fd.dev,"%s\n", __func__); END_DEBUG /* recycle */ s = splfw(); @@ -933,8 +929,8 @@ sbp_reset_start_callback(struct fw_xfer int i; if (xfer->resp != 0) { - sbp_show_sdev_info(sdev, 2); - printf("sbp_reset_start failed: resp=%d\n", xfer->resp); + device_printf(sdev->target->sbp->fd.dev, + "%s: %s failed: resp=%d\n", __func__, sdev->bustgtlun, xfer->resp); } for (i = 0; i < target->num_lun; i++) { @@ -951,8 +947,8 @@ sbp_reset_start(struct sbp_dev *sdev) struct fw_pkt *fp; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_reset_start\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__,sdev->bustgtlun); END_DEBUG xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0); @@ -973,18 +969,11 @@ sbp_mgm_callback(struct fw_xfer *xfer) sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_mgm_callback\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG resp = xfer->resp; sbp_xfer_free(xfer); -#if 0 - if (resp != 0) { - sbp_show_sdev_info(sdev, 2); - printf("management ORB failed(%d) ... RESET_START\n", resp); - sbp_reset_start(sdev); - } -#endif return; } @@ -1011,14 +1000,14 @@ sbp_cam_scan_lun(struct cam_periph *peri sdev = (struct sbp_dev *) ccb->ccb_h.ccb_sdev_ptr; target = sdev->target; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_cam_scan_lun\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { sdev->status = SBP_DEV_ATTACHED; } else { - sbp_show_sdev_info(sdev, 2); - printf("scan failed\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s failed\n", __func__, sdev->bustgtlun); } sdev = sbp_next_dev(target, sdev->lun_id + 1); if (sdev == NULL) { @@ -1047,8 +1036,8 @@ sbp_cam_scan_target(void *arg) return; } SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_cam_scan_target\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO); if (ccb == NULL) { @@ -1089,8 +1078,8 @@ sbp_do_attach(struct fw_xfer *xfer) target = sdev->target; sbp = target->sbp; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_do_attach\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG sbp_xfer_free(xfer); @@ -1120,12 +1109,12 @@ sbp_agent_reset_callback(struct fw_xfer sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("%s\n", __func__); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG if (xfer->resp != 0) { - sbp_show_sdev_info(sdev, 2); - printf("%s: resp=%d\n", __func__, xfer->resp); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s resp=%d\n", __func__, sdev->bustgtlun, xfer->resp); } sbp_xfer_free(xfer); @@ -1144,8 +1133,8 @@ sbp_agent_reset(struct sbp_dev *sdev) struct fw_pkt *fp; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_agent_reset\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0x04); if (xfer == NULL) @@ -1167,8 +1156,8 @@ sbp_busy_timeout_callback(struct fw_xfer sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_busy_timeout_callback\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG sbp_xfer_free(xfer); sbp_agent_reset(sdev); @@ -1180,8 +1169,8 @@ sbp_busy_timeout(struct sbp_dev *sdev) struct fw_pkt *fp; struct fw_xfer *xfer; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("sbp_busy_timeout\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0); @@ -1200,8 +1189,8 @@ sbp_orb_pointer_callback(struct fw_xfer sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(2) - sbp_show_sdev_info(sdev, 2); - printf("%s\n", __func__); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG if (xfer->resp != 0) { /* XXX */ @@ -1230,8 +1219,10 @@ sbp_orb_pointer(struct sbp_dev *sdev, st struct fw_xfer *xfer; struct fw_pkt *fp; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("%s: 0x%08x\n", __func__, (uint32_t)ocb->bus_addr); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s 0x%08x\n", + __func__, sdev->bustgtlun, + (uint32_t)ocb->bus_addr); END_DEBUG mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); @@ -1278,12 +1269,13 @@ sbp_doorbell_callback(struct fw_xfer *xf sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_doorbell_callback\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG if (xfer->resp != 0) { /* XXX */ - printf("%s: xfer->resp = %d\n", __func__, xfer->resp); + device_printf(sdev->target->sbp->fd.dev, + "%s: xfer->resp = %d\n", __func__, xfer->resp); } sbp_xfer_free(xfer); sdev->flags &= ~ORB_DOORBELL_ACTIVE; @@ -1302,8 +1294,8 @@ sbp_doorbell(struct sbp_dev *sdev) struct fw_xfer *xfer; struct fw_pkt *fp; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_doorbell\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG if ((sdev->flags & ORB_DOORBELL_ACTIVE) != 0) { @@ -1431,8 +1423,10 @@ sbp_mgm_orb(struct sbp_dev *sdev, int fu ocb->orb[7] = htonl(SBP_DEV2ADDR(target->target_id, sdev->lun_id)); SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("%s\n", orb_fun_name[(func>>16)&0xf]); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s %s\n", + __func__,sdev->bustgtlun, + orb_fun_name[(func>>16)&0xf]); END_DEBUG switch (func) { case ORB_FUN_LGI: @@ -1485,10 +1479,6 @@ start: fp->mode.wreqb.extcode = 0; xfer->send.payload[0] = htonl(nid << 16); xfer->send.payload[1] = htonl(ocb->bus_addr & 0xffffffff); -SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("mgm orb: %08x\n", (uint32_t)ocb->bus_addr); -END_DEBUG fw_asyreq(xfer->fc, -1, xfer); } @@ -1532,16 +1522,15 @@ sbp_scsi_status(struct sbp_status *sbp_s SBP_DEBUG(0) sbp_print_scsi_cmd(ocb); /* XXX need decode status */ - sbp_show_sdev_info(ocb->sdev, 2); - printf("SCSI status %x sfmt %x valid %x key %x code %x qlfr %x len %d\n", + printf("%s: SCSI status %x sfmt %x valid %x key %x code %x qlfr %x len %d\n", + ocb->sdev->bustgtlun, sbp_cmd_status->status, sbp_cmd_status->sfmt, sbp_cmd_status->valid, sbp_cmd_status->s_key, sbp_cmd_status->s_code, sbp_cmd_status->s_qlfr, - sbp_status->len - ); + sbp_status->len); END_DEBUG switch (sbp_cmd_status->status) { @@ -1601,9 +1590,10 @@ END_DEBUG */ break; default: - sbp_show_sdev_info(ocb->sdev, 2); - printf("sbp_scsi_status: unknown scsi status 0x%x\n", - sbp_cmd_status->status); + device_printf(ocb->sdev->target->sbp->fd.dev, + "%s:%s unknown scsi status 0x%x\n", + __func__, ocb->sdev->bustgtlun, + sbp_cmd_status->status); } } @@ -1620,8 +1610,8 @@ sbp_fix_inq_data(struct sbp_ocb *ocb) if (ccb->csio.cdb_io.cdb_bytes[1] & SI_EVPD) return; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); - printf("sbp_fix_inq_data\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG inq = (struct scsi_inquiry_data *) ccb->csio.data_ptr; switch (SID_TYPE(inq)) { @@ -1730,23 +1720,26 @@ END_DEBUG } ocb = sbp_dequeue_ocb(sdev, sbp_status); if (ocb == NULL) { - sbp_show_sdev_info(sdev, 2); + device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("No ocb(%lx) on the queue\n", + "%s:%s No ocb(%lx) on the queue\n", #else - printf("No ocb(%x) on the queue\n", + "%s:%s No ocb(%x) on the queue\n", #endif - ntohl(sbp_status->orb_lo)); + __func__,sdev->bustgtlun, + ntohl(sbp_status->orb_lo)); } break; case 2: /* unsolicit */ - sbp_show_sdev_info(sdev, 2); - printf("unsolicit status received\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s unsolicit status received\n", + __func__, sdev->bustgtlun); break; default: - sbp_show_sdev_info(sdev, 2); - printf("unknown sbp_status->src\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s unknown sbp_status->src\n", + __func__, sdev->bustgtlun); } status_valid0 = (sbp_status->src < 2 @@ -1757,18 +1750,20 @@ END_DEBUG if (!status_valid0 || debug > 2){ int status; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("ORB status src:%x resp:%x dead:%x" + device_printf(sdev->target->sbp->fd.dev, + "%s:%s ORB status src:%x resp:%x dead:%x" #if defined(__DragonFly__) || __FreeBSD_version < 500000 " len:%x stat:%x orb:%x%08lx\n", #else " len:%x stat:%x orb:%x%08x\n", #endif + __func__, sdev->bustgtlun, sbp_status->src, sbp_status->resp, sbp_status->dead, sbp_status->len, sbp_status->status, ntohs(sbp_status->orb_hi), ntohl(sbp_status->orb_lo)); END_DEBUG - sbp_show_sdev_info(sdev, 2); + device_printf(sdev->target->sbp->fd.dev, + "%s\n", sdev->bustgtlun); status = sbp_status->status; switch(sbp_status->resp) { case 0: @@ -1827,14 +1822,19 @@ END_DEBUG login_res->cmd_lo = ntohl(login_res->cmd_lo); if (status_valid) { SBP_DEBUG(0) -sbp_show_sdev_info(sdev, 2); -printf("login: len %d, ID %d, cmd %08x%08x, recon_hold %d\n", login_res->len, login_res->id, login_res->cmd_hi, login_res->cmd_lo, ntohs(login_res->recon_hold)); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s login: len %d, ID %d, cmd %08x%08x, recon_hold %d\n", + __func__, sdev->bustgtlun, + login_res->len, login_res->id, + login_res->cmd_hi, login_res->cmd_lo, + ntohs(login_res->recon_hold)); END_DEBUG sbp_busy_timeout(sdev); } else { /* forgot logout? */ - sbp_show_sdev_info(sdev, 2); - printf("login failed\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s login failed\n", + __func__, sdev->bustgtlun); sdev->status = SBP_DEV_RESET; } break; @@ -1842,23 +1842,22 @@ END_DEBUG login_res = sdev->login; if (status_valid) { SBP_DEBUG(0) -sbp_show_sdev_info(sdev, 2); -printf("reconnect: len %d, ID %d, cmd %08x%08x\n", login_res->len, login_res->id, login_res->cmd_hi, login_res->cmd_lo); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s reconnect: len %d, ID %d, cmd %08x%08x\n", + __func__, sdev->bustgtlun, + login_res->len, login_res->id, + login_res->cmd_hi, login_res->cmd_lo); END_DEBUG -#if 1 if (sdev->status == SBP_DEV_ATTACHED) sbp_scan_dev(sdev); else sbp_agent_reset(sdev); -#else - sdev->status = SBP_DEV_ATTACHED; - sbp_mgm_orb(sdev, ORB_FUN_ATS, NULL); -#endif } else { /* reconnection hold time exceed? */ SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); - printf("reconnect failed\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s reconnect failed\n", + __func__, sdev->bustgtlun); END_DEBUG sbp_login(sdev); } @@ -1875,8 +1874,9 @@ END_DEBUG sbp_agent_reset(sdev); break; default: - sbp_show_sdev_info(sdev, 2); - printf("unknown function %d\n", orb_fun); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s unknown function %d\n", + __func__, sdev->bustgtlun, orb_fun); break; } sbp_mgm_orb(sdev, ORB_FUN_RUNQUEUE, NULL); @@ -1885,15 +1885,7 @@ END_DEBUG sdev->timeout = 0; if(ocb->ccb != NULL){ union ccb *ccb; -/* - uint32_t *ld; - ld = ocb->ccb->csio.data_ptr; - if(ld != NULL && ocb->ccb->csio.dxfer_len != 0) - printf("ptr %08x %08x %08x %08x\n", ld[0], ld[1], ld[2], ld[3]); - else - printf("ptr NULL\n"); -printf("len %d\n", sbp_status->len); -*/ + ccb = ocb->ccb; if(sbp_status->len > 1){ sbp_scsi_status(sbp_status, ocb); @@ -2279,9 +2271,9 @@ sbp_mgm_timeout(void *arg) struct sbp_dev *sdev = ocb->sdev; struct sbp_target *target = sdev->target; - sbp_show_sdev_info(sdev, 2); - printf("request timeout(mgm orb:0x%08x) ... ", - (uint32_t)ocb->bus_addr); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s request timeout(mgm orb:0x%08x)\n", + __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr); target->mgm_ocb_cur = NULL; sbp_free_ocb(sdev, ocb); #if 0 @@ -2289,10 +2281,10 @@ sbp_mgm_timeout(void *arg) printf("run next request\n"); sbp_mgm_orb(sdev, ORB_FUN_RUNQUEUE, NULL); #endif -#if 1 - printf("reset start\n"); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s reset start\n", + __func__, sdev->bustgtlun); sbp_reset_start(sdev); -#endif } static void @@ -2301,9 +2293,9 @@ sbp_timeout(void *arg) struct sbp_ocb *ocb = (struct sbp_ocb *)arg; struct sbp_dev *sdev = ocb->sdev; - sbp_show_sdev_info(sdev, 2); - printf("request timeout(cmd orb:0x%08x) ... ", - (uint32_t)ocb->bus_addr); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s request timeout(cmd orb:0x%08x) ... ", + __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr); sdev->timeout ++; switch(sdev->timeout) { @@ -2760,13 +2752,13 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, st int flags; SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); + device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("%s: 0x%08lx src %d\n", + "%s:%s 0x%08lx src %d\n", #else - printf("%s: 0x%08x src %d\n", + "%s:%s 0x%08x src %d\n", #endif - __func__, ntohl(sbp_status->orb_lo), sbp_status->src); + __func__, sdev->bustgtlun, ntohl(sbp_status->orb_lo), sbp_status->src); END_DEBUG SBP_LOCK(sdev->target->sbp); for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) { @@ -2823,8 +2815,9 @@ END_DEBUG splx(s); SBP_DEBUG(0) if (ocb && order > 0) { - sbp_show_sdev_info(sdev, 2); - printf("unordered execution order:%d\n", order); + device_printf(sdev->target->sbp->fd.dev, + "%s:%s unordered execution order:%d\n", + __func__, sdev->bustgtlun, order); } END_DEBUG return (ocb); @@ -2838,11 +2831,11 @@ sbp_enqueue_ocb(struct sbp_dev *sdev, st mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); SBP_DEBUG(1) - sbp_show_sdev_info(sdev, 2); + device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("%s: 0x%08x\n", __func__, ocb->bus_addr); + "%s:%s 0x%08x\n", __func__, sdev->bustgtlun, ocb->bus_addr); #else - printf("%s: 0x%08jx\n", __func__, (uintmax_t)ocb->bus_addr); + "%s:%s 0x%08jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr); #endif END_DEBUG prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); @@ -2924,11 +2917,11 @@ sbp_abort_ocb(struct sbp_ocb *ocb, int s sdev = ocb->sdev; SBP_DEBUG(0) - sbp_show_sdev_info(sdev, 2); + device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 - printf("sbp_abort_ocb 0x%x\n", ocb->bus_addr); + "%s:%s 0x%x\n", __func__, sdev->bustgtlun, ocb->bus_addr); #else - printf("sbp_abort_ocb 0x%jx\n", (uintmax_t)ocb->bus_addr); + "%s:%s 0x%jx\n", __func__, sdev->bustgtlun, (uintmax_t)ocb->bus_addr); #endif END_DEBUG SBP_DEBUG(1) From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 18:55:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DB52106566C; Wed, 18 Feb 2009 18:55:36 +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 0739B8FC15; Wed, 18 Feb 2009 18:55:36 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 11A811D0E8; Wed, 18 Feb 2009 19:55:35 +0100 (CET) Date: Wed, 18 Feb 2009 19:55:35 +0100 From: Ed Schouten To: Roman Divacky Message-ID: <20090218185535.GO79178@hoeg.nl> References: <200902181825.n1IIPH9n071204@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ht+/lPZLak6eP81R" Content-Disposition: inline In-Reply-To: <200902181825.n1IIPH9n071204@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: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 18:55:37 -0000 --Ht+/lPZLak6eP81R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Roman, This file doesn't seem to compile with LLVM properly. I don't know a lot about inline asm, but shouldn't these variables be passed as arguments to the __asm block? I would fix it if I knew how, but I don't. :-( --=20 Ed Schouten WWW: http://80386.nl/ --Ht+/lPZLak6eP81R Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmcWaYACgkQ52SDGA2eCwVIQACeIlw+xZlNl2Emsrbtv2OOobgF 5JoAnAr8mWbyP3QUt9+jJV8v1x2dDdk6 =+gWc -----END PGP SIGNATURE----- --Ht+/lPZLak6eP81R-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 18:56:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DAFB106567B; Wed, 18 Feb 2009 18:56: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 3E3F08FC23; Wed, 18 Feb 2009 18:56:50 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 42F4C9CB078; Wed, 18 Feb 2009 19:53:48 +0100 (CET) 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 A-EXPTl38dI7; Wed, 18 Feb 2009 19:53:42 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id CAEE69CB0F2; Wed, 18 Feb 2009 19:53:42 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1IIrgxu016225; Wed, 18 Feb 2009 19:53:42 +0100 (CET) (envelope-from rdivacky) Date: Wed, 18 Feb 2009 19:53:42 +0100 From: Roman Divacky To: Ed Schouten Message-ID: <20090218185342.GA16122@freebsd.org> References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090218185535.GO79178@hoeg.nl> 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: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 18:56:52 -0000 On Wed, Feb 18, 2009 at 07:55:35PM +0100, Ed Schouten wrote: > Roman, > > This file doesn't seem to compile with LLVM properly. I don't know a lot > about inline asm, but shouldn't these variables be passed as arguments > to the __asm block? I would fix it if I knew how, but I don't. :-( it does compile with clang trunk.... what are you doing exactly? From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:05:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F8711065673; Wed, 18 Feb 2009 19:05:28 +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 0E2258FC23; Wed, 18 Feb 2009 19:05:28 +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 n1IJ5Rpt072258; Wed, 18 Feb 2009 19:05:27 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IJ5Rv9072257; Wed, 18 Feb 2009 19:05:27 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902181905.n1IJ5Rv9072257@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 18 Feb 2009 19:05: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: r188759 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:05:28 -0000 Author: maxim Date: Wed Feb 18 19:05:27 2009 New Revision: 188759 URL: http://svn.freebsd.org/changeset/base/188759 Log: o Fix year in the previous commit. Submitted by: Munehiro Matsuda Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Feb 18 19:02:51 2009 (r188758) +++ head/share/misc/bsd-family-tree Wed Feb 18 19:05:27 2009 (r188759) @@ -495,7 +495,7 @@ DragonFly 2.0.0 2008-07-21 [DFB] OpenBSD 4.4 2008-11-01 [OBD] FreeBSD 6.4 2008-11-28 [FBD] FreeBSD 7.1 2009-01-04 [FBD] -DragonFly 2.2.0 2000-02-17 [DFB] +DragonFly 2.2.0 2009-02-17 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:06:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772D41065688 for ; Wed, 18 Feb 2009 19:06:03 +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 8AB798FC15 for ; Wed, 18 Feb 2009 19:06:02 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 18 Feb 2009 19:05:57 -0000 Received: from p54A3F2A9.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.242.169] by mail.gmx.net (mp007) with SMTP; 18 Feb 2009 20:05:57 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19xsP4NuK5x/EUTwSOnVkKUJsB3uYATkjFeuFNjiV vz4AFRaw/KbzsG Message-ID: <499C5C10.9020700@gmx.de> Date: Wed, 18 Feb 2009 20:05:52 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ed Schouten References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> In-Reply-To: <20090218185535.GO79178@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.75 Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:06:03 -0000 Ed Schouten schrieb: > Roman, > > This file doesn't seem to compile with LLVM properly. I don't know a lot > about inline asm, but shouldn't these variables be passed as arguments > to the __asm block? I would fix it if I knew how, but I don't. :-( You cannot pass variables to global asm statements. From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:08:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C9610657A4 for ; Wed, 18 Feb 2009 19:08:49 +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 971788FC1E for ; Wed, 18 Feb 2009 19:08:48 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 18 Feb 2009 19:08:39 -0000 Received: from p54A3F2A9.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.242.169] by mail.gmx.net (mp037) with SMTP; 18 Feb 2009 20:08:39 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX18DSNoFQhkDTGxQwZ42ZBgJMb3yBgKDD3QejHkOM+ 3VJ4YIPgTidI+U Message-ID: <499C5CA4.8020603@gmx.de> Date: Wed, 18 Feb 2009 20:08:20 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ed Schouten References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> <499C5C10.9020700@gmx.de> In-Reply-To: <499C5C10.9020700@gmx.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.73 Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:08:50 -0000 Christoph Mallon schrieb: > Ed Schouten schrieb: >> Roman, >> >> This file doesn't seem to compile with LLVM properly. I don't know a lot >> about inline asm, but shouldn't these variables be passed as arguments >> to the __asm block? I would fix it if I knew how, but I don't. :-( > > You cannot pass variables to global asm statements. s/variables/arguments/ *sigh* From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:32:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59781106567D; Wed, 18 Feb 2009 19:32:57 +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 1B4058FC20; Wed, 18 Feb 2009 19:32:57 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 78FE81D0E8; Wed, 18 Feb 2009 20:32:56 +0100 (CET) Date: Wed, 18 Feb 2009 20:32:56 +0100 From: Ed Schouten To: Christoph Mallon Message-ID: <20090218193256.GP79178@hoeg.nl> References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> <499C5C10.9020700@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4v4CeaphHHcoDrun" Content-Disposition: inline In-Reply-To: <499C5C10.9020700@gmx.de> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:32:58 -0000 --4v4CeaphHHcoDrun Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Christoph Mallon wrote: > You cannot pass variables to global asm statements. Oh, yuck. So I guess the only solution would be to move it into its own assembly file? --=20 Ed Schouten WWW: http://80386.nl/ --4v4CeaphHHcoDrun Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmcYmgACgkQ52SDGA2eCwUO/ACdGrGJcDO68v06ET/9fY24VLqC e3kAn0JylmbM8fVCkf8a3vw56tNOw3un =M2J/ -----END PGP SIGNATURE----- --4v4CeaphHHcoDrun-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:40:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5906F10656D5 for ; Wed, 18 Feb 2009 19:40:42 +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 907B88FC1D for ; Wed, 18 Feb 2009 19:40:41 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 18 Feb 2009 19:40:38 -0000 Received: from p54A3F2A9.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.242.169] by mail.gmx.net (mp024) with SMTP; 18 Feb 2009 20:40:38 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+M1j1eDaqMeunS0Lj1FGKOYDpqFytkhsGmk8aqOS cjNs5ijhcj/ow3 Message-ID: <499C6434.8020807@gmx.de> Date: Wed, 18 Feb 2009 20:40:36 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ed Schouten References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> <499C5C10.9020700@gmx.de> <20090218193256.GP79178@hoeg.nl> In-Reply-To: <20090218193256.GP79178@hoeg.nl> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.71 Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:40:43 -0000 Ed Schouten schrieb: > * Christoph Mallon wrote: >> You cannot pass variables to global asm statements. > > Oh, yuck. So I guess the only solution would be to move it into its own > assembly file? Marking the involved variables as __used (which evaluates to __attribute__((used))) is fine. That's exactly what Roman is doing. From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:55:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E83A106564A; Wed, 18 Feb 2009 19:55:48 +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 022F48FC08; Wed, 18 Feb 2009 19:55:48 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id C8DDB1D0E8; Wed, 18 Feb 2009 20:55:46 +0100 (CET) Date: Wed, 18 Feb 2009 20:55:46 +0100 From: Ed Schouten To: Roman Divacky Message-ID: <20090218195546.GQ79178@hoeg.nl> References: <200902181825.n1IIPH9n071204@svn.freebsd.org> <20090218185535.GO79178@hoeg.nl> <20090218185342.GA16122@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIA99zTjfw9iS5Gl" Content-Disposition: inline In-Reply-To: <20090218185342.GA16122@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: r188753 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:55:48 -0000 --WIA99zTjfw9iS5Gl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Roman Divacky wrote: > On Wed, Feb 18, 2009 at 07:55:35PM +0100, Ed Schouten wrote: > > Roman, > >=20 > > This file doesn't seem to compile with LLVM properly. I don't know a lot > > about inline asm, but shouldn't these variables be passed as arguments > > to the __asm block? I would fix it if I knew how, but I don't. :-( >=20 > it does compile with clang trunk.... >=20 > what are you doing exactly? No, then it's okay. I didn't know this fix was related to LLVM support. I'll shut up. ;-) --=20 Ed Schouten WWW: http://80386.nl/ --WIA99zTjfw9iS5Gl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmcZ8IACgkQ52SDGA2eCwVFIACfcNZKPvmQJE5ERNHLx5T/JC0H c2wAnAua8/lb8+xdRAm4OkRQ+no5ZGR0 =EhqJ -----END PGP SIGNATURE----- --WIA99zTjfw9iS5Gl-- From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 19:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C261065670; Wed, 18 Feb 2009 19:59:28 +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 37E218FC0C; Wed, 18 Feb 2009 19:59:28 +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 n1IJxS11073306; Wed, 18 Feb 2009 19:59:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IJxSJV073305; Wed, 18 Feb 2009 19:59:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902181959.n1IJxSJV073305@svn.freebsd.org> From: Warner Losh Date: Wed, 18 Feb 2009 19:59: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: r188760 - head/contrib/bsnmp/snmp_mibII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:59:28 -0000 Author: imp Date: Wed Feb 18 19:59:27 2009 New Revision: 188760 URL: http://svn.freebsd.org/changeset/base/188760 Log: Add an extra (void *) cast. The struct if_msghdr has an 8 byte alignment requirement, while rt_msghdr has a 4 byte alignment requirement. The root cause is that if_msghdr has an struct if_data which has an 8-byte alignment requirement due to a time_t that's embedded in it. On MIPS, time_t is a 64-bit number, so must be 64-bit aligned. Since we don't access ifm_data.ifi_epoch, a simple cast is all that's necessary here. It is likely the case that ifi_epoch should *NOT* be a time_t because it is an uptime (time delta) an not an absolute time since 1970. u_long is likely sufficient there since that gives an uptime of 136 years will suffice for the foreseeable future. Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Wed Feb 18 19:05:27 2009 (r188759) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Wed Feb 18 19:59:27 2009 (r188760) @@ -1013,7 +1013,7 @@ handle_rtmsg(struct rt_msghdr *rtm) break; case RTM_IFINFO: - ifm = (struct if_msghdr *)rtm; + ifm = (struct if_msghdr *)(void *)rtm; mib_extract_addrs(ifm->ifm_addrs, (u_char *)(ifm + 1), addrs); if ((ifp = mib_find_if_sys(ifm->ifm_index)) == NULL) break; From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 20:12:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CAD510656F8; Wed, 18 Feb 2009 20:12:09 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0ADE8FC22; Wed, 18 Feb 2009 20:12:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IKC8lY073586; Wed, 18 Feb 2009 20:12:08 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IKC88S073575; Wed, 18 Feb 2009 20:12:08 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200902182012.n1IKC88S073575@svn.freebsd.org> From: Jamie Gritton Date: Wed, 18 Feb 2009 20:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188761 - in stable/7: lib/libc lib/libc/string lib/libc/sys sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/net sys/netinet sys/netinet6 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 20:12:10 -0000 Author: jamie Date: Wed Feb 18 20:12:08 2009 New Revision: 188761 URL: http://svn.freebsd.org/changeset/base/188761 Log: MFC: r188144: Standardize the various prison_foo_ip[46] functions and prison_if to return zero on success and an error code otherwise. The possible errors are EADDRNOTAVAIL if an address being checked for doesn't match the prison, and EAFNOSUPPORT if the prison doesn't have any addresses in that address family. For most callers of these functions, use the returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or EINVAL. Always include a jailed() check in these functions, where a non-jailed cred always returns success (and makes no changes). Remove the explicit jailed() checks that preceded many of the function calls. r188146: Don't allow creating a socket with a protocol family that the current jail doesn't support. This involves a new function prison_check_af, like prison_check_ip[46] but that checks only the family. With this change, most of the errors generated by jailed sockets shouldn't ever occur, at least until jails are changeable. r188148: Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of prison_local_ip6 in in6_pcbbind. r188149: Call prison_if from rtm_get_jailed, instead of splitting it out into prison_check_ip4 and prison_check_ip6. As prison_if includes a jailed() check, remove that check before calling rtm_get_jailed. r188151: Don't bother null-checking the thread pointer before the prison checks in udp6_connect (td is already dereferenced elsewhere without such a check). This makes the conversion from a sockaddr to a sockaddr_in6 always happen, so convert once at the beginning of the function rather than twice in the middle. Approved by: bz (mentor) Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) stable/7/lib/libc/sys/send.2 stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_jail.c stable/7/sys/kern/uipc_socket.c stable/7/sys/net/if.c stable/7/sys/net/rtsock.c stable/7/sys/netinet/in.c stable/7/sys/netinet/in_pcb.c stable/7/sys/netinet/raw_ip.c stable/7/sys/netinet/tcp_usrreq.c stable/7/sys/netinet/udp_usrreq.c stable/7/sys/netinet6/in6.c stable/7/sys/netinet6/in6_pcb.c stable/7/sys/netinet6/in6_src.c stable/7/sys/netinet6/raw_ip6.c stable/7/sys/netinet6/udp6_usrreq.c stable/7/sys/sys/jail.h Modified: stable/7/lib/libc/sys/send.2 ============================================================================== --- stable/7/lib/libc/sys/send.2 Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/lib/libc/sys/send.2 Wed Feb 18 20:12:08 2009 (r188761) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd February 5, 2009 .Dt SEND 2 .Os .Sh NAME @@ -190,7 +190,7 @@ receiver is not listening on the remote The remote host was down. .It Bq Er ENETDOWN The remote network was down. -.It Bq Er EPERM +.It Bq Er EADDRNOTAVAIL The process using a .Dv SOCK_RAW socket was jailed and the source Modified: stable/7/sys/kern/kern_jail.c ============================================================================== --- stable/7/sys/kern/kern_jail.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/kern/kern_jail.c Wed Feb 18 20:12:08 2009 (r188761) @@ -230,7 +230,7 @@ prison_check_conflicting_ips(struct pris if ((p->pr_ip4s >= 1 && pr->pr_ip4s > 1) || (p->pr_ip4s > 1 && pr->pr_ip4s >= 1)) { for (i = 0; i < p->pr_ip4s; i++) { - if (_prison_check_ip4(pr, &p->pr_ip4[i])) + if (_prison_check_ip4(pr, &p->pr_ip4[i]) == 0) return (EINVAL); } } @@ -239,7 +239,7 @@ prison_check_conflicting_ips(struct pris if ((p->pr_ip6s >= 1 && pr->pr_ip6s > 1) || (p->pr_ip6s > 1 && pr->pr_ip6s >= 1)) { for (i = 0; i < p->pr_ip6s; i++) { - if (_prison_check_ip6(pr, &p->pr_ip6[i])) + if (_prison_check_ip6(pr, &p->pr_ip6[i]) == 0) return (EINVAL); } } @@ -841,9 +841,10 @@ prison_proc_free(struct prison *pr) * Pass back primary IPv4 address of this jail. * * If not jailed return success but do not alter the address. Caller has to - * make sure to intialize it correctly (INADDR_ANY). + * make sure to intialize it correctly (e.g. INADDR_ANY). * - * Returns 0 on success, 1 on error. Address returned in NBO. + * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. + * Address returned in NBO. */ int prison_get_ip4(struct ucred *cred, struct in_addr *ia) @@ -857,7 +858,7 @@ prison_get_ip4(struct ucred *cred, struc return (0); if (cred->cr_prison->pr_ip4 == NULL) - return (1); + return (EAFNOSUPPORT); ia->s_addr = cred->cr_prison->pr_ip4[0].s_addr; return (0); @@ -867,8 +868,9 @@ prison_get_ip4(struct ucred *cred, struc * Make sure our (source) address is set to something meaningful to this * jail. * - * Returns 0 on success, 1 on error. Address passed in in NBO and returned - * in NBO. + * Returns 0 if not jailed or if address belongs to jail, EADDRNOTAVAIL if + * the address doesn't belong, or EAFNOSUPPORT if the jail doesn't allow IPv4. + * Address passed in in NBO and returned in NBO. */ int prison_local_ip4(struct ucred *cred, struct in_addr *ia) @@ -881,7 +883,7 @@ prison_local_ip4(struct ucred *cred, str if (!jailed(cred)) return (0); if (cred->cr_prison->pr_ip4 == NULL) - return (1); + return (EAFNOSUPPORT); ia0.s_addr = ntohl(ia->s_addr); if (ia0.s_addr == INADDR_LOOPBACK) { @@ -889,25 +891,23 @@ prison_local_ip4(struct ucred *cred, str return (0); } - /* - * In case there is only 1 IPv4 address, bind directly. - */ - if (ia0.s_addr == INADDR_ANY && cred->cr_prison->pr_ip4s == 1) { - ia->s_addr = cred->cr_prison->pr_ip4[0].s_addr; + if (ia0.s_addr == INADDR_ANY) { + /* + * In case there is only 1 IPv4 address, bind directly. + */ + if (cred->cr_prison->pr_ip4s == 1) + ia->s_addr = cred->cr_prison->pr_ip4[0].s_addr; return (0); } - if (ia0.s_addr == INADDR_ANY || prison_check_ip4(cred, ia)) - return (0); - - return (1); + return (_prison_check_ip4(cred->cr_prison, ia)); } /* * Rewrite destination address in case we will connect to loopback address. * - * Returns 0 on success, 1 on error. Address passed in in NBO and returned - * in NBO. + * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv4. + * Address passed in in NBO and returned in NBO. */ int prison_remote_ip4(struct ucred *cred, struct in_addr *ia) @@ -919,7 +919,8 @@ prison_remote_ip4(struct ucred *cred, st if (!jailed(cred)) return (0); if (cred->cr_prison->pr_ip4 == NULL) - return (1); + return (EAFNOSUPPORT); + if (ntohl(ia->s_addr) == INADDR_LOOPBACK) { ia->s_addr = cred->cr_prison->pr_ip4[0].s_addr; return (0); @@ -932,23 +933,22 @@ prison_remote_ip4(struct ucred *cred, st } /* - * Check if given address belongs to the jail referenced by cred. + * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 1 if address belongs to jail, 0 if not. Address passed in in NBO. + * Returns 0 if not jailed or if address belongs to jail, EADDRNOTAVAIL if + * the address doesn't belong, or EAFNOSUPPORT if the jail doesn't allow IPv4. + * Address passed in in NBO. */ static int _prison_check_ip4(struct prison *pr, struct in_addr *ia) { int i, a, z, d; - if (pr->pr_ip4 == NULL) - return (0); - /* * Check the primary IP. */ if (pr->pr_ip4[0].s_addr == ia->s_addr) - return (1); + return (0); /* * All the other IPs are sorted so we can do a binary search. @@ -963,9 +963,10 @@ _prison_check_ip4(struct prison *pr, str else if (d < 0) a = i + 1; else - return (1); + return (0); } - return (0); + + return (EADDRNOTAVAIL); } int @@ -976,7 +977,9 @@ prison_check_ip4(struct ucred *cred, str KASSERT(ia != NULL, ("%s: ia is NULL", __func__)); if (!jailed(cred)) - return (1); + return (0); + if (cred->cr_prison->pr_ip4 == NULL) + return (EAFNOSUPPORT); return (_prison_check_ip4(cred->cr_prison, ia)); } @@ -987,9 +990,9 @@ prison_check_ip4(struct ucred *cred, str * Pass back primary IPv6 address for this jail. * * If not jailed return success but do not alter the address. Caller has to - * make sure to intialize it correctly (IN6ADDR_ANY_INIT). + * make sure to intialize it correctly (e.g. IN6ADDR_ANY_INIT). * - * Returns 0 on success, 1 on error. + * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. */ int prison_get_ip6(struct ucred *cred, struct in6_addr *ia6) @@ -1001,7 +1004,8 @@ prison_get_ip6(struct ucred *cred, struc if (!jailed(cred)) return (0); if (cred->cr_prison->pr_ip6 == NULL) - return (1); + return (EAFNOSUPPORT); + bcopy(&cred->cr_prison->pr_ip6[0], ia6, sizeof(struct in6_addr)); return (0); } @@ -1012,7 +1016,8 @@ prison_get_ip6(struct ucred *cred, struc * v6only should be set based on (inp->inp_flags & IN6P_IPV6_V6ONLY != 0) * when needed while binding. * - * Returns 0 on success, 1 on error. + * Returns 0 if not jailed or if address belongs to jail, EADDRNOTAVAIL if + * the address doesn't belong, or EAFNOSUPPORT if the jail doesn't allow IPv6. */ int prison_local_ip6(struct ucred *cred, struct in6_addr *ia6, int v6only) @@ -1024,32 +1029,32 @@ prison_local_ip6(struct ucred *cred, str if (!jailed(cred)) return (0); if (cred->cr_prison->pr_ip6 == NULL) - return (1); + return (EAFNOSUPPORT); + if (IN6_IS_ADDR_LOOPBACK(ia6)) { bcopy(&cred->cr_prison->pr_ip6[0], ia6, sizeof(struct in6_addr)); return (0); } - /* - * In case there is only 1 IPv6 address, and v6only is true, then - * bind directly. - */ - if (v6only != 0 && IN6_IS_ADDR_UNSPECIFIED(ia6) && - cred->cr_prison->pr_ip6s == 1) { - bcopy(&cred->cr_prison->pr_ip6[0], ia6, - sizeof(struct in6_addr)); + if (IN6_IS_ADDR_UNSPECIFIED(ia6)) { + /* + * In case there is only 1 IPv6 address, and v6only is true, + * then bind directly. + */ + if (v6only != 0 && cred->cr_prison->pr_ip6s == 1) + bcopy(&cred->cr_prison->pr_ip6[0], ia6, + sizeof(struct in6_addr)); return (0); } - if (IN6_IS_ADDR_UNSPECIFIED(ia6) || prison_check_ip6(cred, ia6)) - return (0); - return (1); + + return (_prison_check_ip6(cred->cr_prison, ia6)); } /* * Rewrite destination address in case we will connect to loopback address. * - * Returns 0 on success, 1 on error. + * Returns 0 on success, EAFNOSUPPORT if the jail doesn't allow IPv6. */ int prison_remote_ip6(struct ucred *cred, struct in6_addr *ia6) @@ -1061,7 +1066,8 @@ prison_remote_ip6(struct ucred *cred, st if (!jailed(cred)) return (0); if (cred->cr_prison->pr_ip6 == NULL) - return (1); + return (EAFNOSUPPORT); + if (IN6_IS_ADDR_LOOPBACK(ia6)) { bcopy(&cred->cr_prison->pr_ip6[0], ia6, sizeof(struct in6_addr)); @@ -1075,23 +1081,21 @@ prison_remote_ip6(struct ucred *cred, st } /* - * Check if given address belongs to the jail referenced by cred. + * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 1 if address belongs to jail, 0 if not. + * Returns 0 if not jailed or if address belongs to jail, EADDRNOTAVAIL if + * the address doesn't belong, or EAFNOSUPPORT if the jail doesn't allow IPv6. */ static int _prison_check_ip6(struct prison *pr, struct in6_addr *ia6) { int i, a, z, d; - if (pr->pr_ip6 == NULL) - return (0); - /* * Check the primary IP. */ if (IN6_ARE_ADDR_EQUAL(&pr->pr_ip6[0], ia6)) - return (1); + return (0); /* * All the other IPs are sorted so we can do a binary search. @@ -1106,9 +1110,10 @@ _prison_check_ip6(struct prison *pr, str else if (d < 0) a = i + 1; else - return (1); + return (0); } - return (0); + + return (EADDRNOTAVAIL); } int @@ -1119,18 +1124,63 @@ prison_check_ip6(struct ucred *cred, str KASSERT(ia6 != NULL, ("%s: ia6 is NULL", __func__)); if (!jailed(cred)) - return (1); + return (0); + if (cred->cr_prison->pr_ip6 == NULL) + return (EAFNOSUPPORT); return (_prison_check_ip6(cred->cr_prison, ia6)); } #endif /* + * Check if a jail supports the given address family. + * + * Returns 0 if not jailed or the address family is supported, EAFNOSUPPORT + * if not. + */ +int +prison_check_af(struct ucred *cred, int af) +{ + int error; + + KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); + + + if (!jailed(cred)) + return (0); + + error = 0; + switch (af) + { +#ifdef INET + case AF_INET: + if (cred->cr_prison->pr_ip4 == NULL) + error = EAFNOSUPPORT; + break; +#endif +#ifdef INET6 + case AF_INET6: + if (cred->cr_prison->pr_ip6 == NULL) + error = EAFNOSUPPORT; + break; +#endif + case AF_LOCAL: + case AF_ROUTE: + break; + default: + if (jail_socket_unixiproute_only) + error = EAFNOSUPPORT; + } + return (error); +} + +/* * Check if given address belongs to the jail referenced by cred (wrapper to * prison_check_ip[46]). * - * Returns 1 if address belongs to jail, 0 if not. IPv4 Address passed in in - * NBO. + * Returns 0 if not jailed or if address belongs to jail, EADDRNOTAVAIL if + * the address doesn't belong, or EAFNOSUPPORT if the jail doesn't allow + * the address family. IPv4 Address passed in in NBO. */ int prison_if(struct ucred *cred, struct sockaddr *sa) @@ -1141,35 +1191,31 @@ prison_if(struct ucred *cred, struct soc #ifdef INET6 struct sockaddr_in6 *sai6; #endif - int ok; + int error; KASSERT(cred != NULL, ("%s: cred is NULL", __func__)); KASSERT(sa != NULL, ("%s: sa is NULL", __func__)); - ok = 0; - switch(sa->sa_family) + error = 0; + switch (sa->sa_family) { #ifdef INET case AF_INET: sai = (struct sockaddr_in *)sa; - if (prison_check_ip4(cred, &sai->sin_addr)) - ok = 1; + error = prison_check_ip4(cred, &sai->sin_addr); break; - #endif #ifdef INET6 case AF_INET6: sai6 = (struct sockaddr_in6 *)sa; - if (prison_check_ip6(cred, (struct in6_addr *)&sai6->sin6_addr)) - ok = 1; + error = prison_check_ip6(cred, &sai6->sin6_addr); break; - #endif default: - if (!jail_socket_unixiproute_only) - ok = 1; + if (jailed(cred) && jail_socket_unixiproute_only) + error = EAFNOSUPPORT; } - return (ok); + return (error); } /* Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/kern/uipc_socket.c Wed Feb 18 20:12:08 2009 (r188761) @@ -345,15 +345,8 @@ socreate(int dom, struct socket **aso, i prp->pr_usrreqs->pru_attach == pru_attach_notsupp) return (EPROTONOSUPPORT); - if (jailed(cred) && jail_socket_unixiproute_only && - prp->pr_domain->dom_family != PF_LOCAL && - prp->pr_domain->dom_family != PF_INET && -#ifdef INET6 - prp->pr_domain->dom_family != PF_INET6 && -#endif - prp->pr_domain->dom_family != PF_ROUTE) { + if (prison_check_af(cred, prp->pr_domain->dom_family) != 0) return (EPROTONOSUPPORT); - } if (prp->pr_type != type) return (EPROTOTYPE); Modified: stable/7/sys/net/if.c ============================================================================== --- stable/7/sys/net/if.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/net/if.c Wed Feb 18 20:12:08 2009 (r188761) @@ -2196,8 +2196,7 @@ again: TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; - if (jailed(curthread->td_ucred) && - !prison_if(curthread->td_ucred, sa)) + if (prison_if(curthread->td_ucred, sa) != 0) continue; addrs++; #ifdef COMPAT_43 Modified: stable/7/sys/net/rtsock.c ============================================================================== --- stable/7/sys/net/rtsock.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/net/rtsock.c Wed Feb 18 20:12:08 2009 (r188761) @@ -329,55 +329,48 @@ rtm_get_jailed(struct rt_addrinfo *info, struct rtentry *rt, union sockaddr_union *saun, struct ucred *cred) { + /* First, see if the returned address is part of the jail. */ + if (prison_if(cred, rt->rt_ifa->ifa_addr) == 0) { + info->rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; + return (0); + } + switch (info->rti_info[RTAX_DST]->sa_family) { #ifdef INET case AF_INET: { struct in_addr ia; + struct ifaddr *ifa; + int found; + found = 0; /* - * 1. Check if the returned address is part of the jail. + * Try to find an address on the given outgoing interface + * that belongs to the jail. */ - ia = ((struct sockaddr_in *)rt->rt_ifa->ifa_addr)->sin_addr; - if (prison_check_ip4(cred, &ia) != 0) { - info->rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; - - } else { - struct ifaddr *ifa; - int found; - - found = 0; - + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + struct sockaddr *sa; + sa = ifa->ifa_addr; + if (sa->sa_family != AF_INET) + continue; + ia = ((struct sockaddr_in *)sa)->sin_addr; + if (prison_check_ip4(cred, &ia) == 0) { + found = 1; + break; + } + } + if (!found) { /* - * 2. Try to find an address on the given outgoing - * interface that belongs to the jail. + * As a last resort return the 'default' jail address. */ - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct sockaddr *sa; - sa = ifa->ifa_addr; - if (sa->sa_family != AF_INET) - continue; - ia = ((struct sockaddr_in *)sa)->sin_addr; - if (prison_check_ip4(cred, &ia) != 0) { - found = 1; - break; - } - } - if (!found) { - /* - * 3. As a last resort return the 'default' - * jail address. - */ - if (prison_get_ip4(cred, &ia) != 0) - return (ESRCH); - } - bzero(&saun->sin, sizeof(struct sockaddr_in)); - saun->sin.sin_len = sizeof(struct sockaddr_in); - saun->sin.sin_family = AF_INET; - saun->sin.sin_addr.s_addr = ia.s_addr; - info->rti_info[RTAX_IFA] = - (struct sockaddr *)&saun->sin; + if (prison_get_ip4(cred, &ia) != 0) + return (ESRCH); } + bzero(&saun->sin, sizeof(struct sockaddr_in)); + saun->sin.sin_len = sizeof(struct sockaddr_in); + saun->sin.sin_family = AF_INET; + saun->sin.sin_addr.s_addr = ia.s_addr; + info->rti_info[RTAX_IFA] = (struct sockaddr *)&saun->sin; break; } #endif @@ -385,54 +378,40 @@ rtm_get_jailed(struct rt_addrinfo *info, case AF_INET6: { struct in6_addr ia6; + struct ifaddr *ifa; + int found; + found = 0; /* - * 1. Check if the returned address is part of the jail. + * Try to find an address on the given outgoing interface + * that belongs to the jail. */ - bcopy(&((struct sockaddr_in6 *)rt->rt_ifa->ifa_addr)->sin6_addr, - &ia6, sizeof(struct in6_addr)); - if (prison_check_ip6(cred, &ia6) != 0) { - info->rti_info[RTAX_IFA] = rt->rt_ifa->ifa_addr; - } else { - struct ifaddr *ifa; - int found; - - found = 0; - + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + struct sockaddr *sa; + sa = ifa->ifa_addr; + if (sa->sa_family != AF_INET6) + continue; + bcopy(&((struct sockaddr_in6 *)sa)->sin6_addr, + &ia6, sizeof(struct in6_addr)); + if (prison_check_ip6(cred, &ia6) == 0) { + found = 1; + break; + } + } + if (!found) { /* - * 2. Try to find an address on the given outgoing - * interface that belongs to the jail. + * As a last resort return the 'default' jail address. */ - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct sockaddr *sa; - sa = ifa->ifa_addr; - if (sa->sa_family != AF_INET6) - continue; - bcopy(&((struct sockaddr_in6 *)sa)->sin6_addr, - &ia6, sizeof(struct in6_addr)); - if (prison_check_ip6(cred, &ia6) != 0) { - found = 1; - break; - } - } - if (!found) { - /* - * 3. As a last resort return the 'default' - * jail address. - */ - if (prison_get_ip6(cred, &ia6) != 0) - return (ESRCH); - } - bzero(&saun->sin6, sizeof(struct sockaddr_in6)); - saun->sin6.sin6_len = sizeof(struct sockaddr_in6); - saun->sin6.sin6_family = AF_INET6; - bcopy(&ia6, &saun->sin6.sin6_addr, - sizeof(struct in6_addr)); - if (sa6_recoverscope(&saun->sin6) != 0) + if (prison_get_ip6(cred, &ia6) != 0) return (ESRCH); - info->rti_info[RTAX_IFA] = - (struct sockaddr *)&saun->sin6; } + bzero(&saun->sin6, sizeof(struct sockaddr_in6)); + saun->sin6.sin6_len = sizeof(struct sockaddr_in6); + saun->sin6.sin6_family = AF_INET6; + bcopy(&ia6, &saun->sin6.sin6_addr, sizeof(struct in6_addr)); + if (sa6_recoverscope(&saun->sin6) != 0) + return (ESRCH); + info->rti_info[RTAX_IFA] = (struct sockaddr *)&saun->sin6; break; } #endif @@ -585,9 +564,10 @@ route_output(struct mbuf *m, struct sock case RTM_GET: report: RT_LOCK_ASSERT(rt); - if (jailed(curthread->td_ucred) && - ((rt->rt_flags & RTF_HOST) == 0 || - !prison_if(curthread->td_ucred, rt_key(rt)))) { + if ((rt->rt_flags & RTF_HOST) == 0 + ? jailed(curthread->td_ucred) + : prison_if(curthread->td_ucred, + rt_key(rt)) != 0) { RT_UNLOCK(rt); senderr(ESRCH); } @@ -600,17 +580,11 @@ route_output(struct mbuf *m, struct sock if (ifp) { info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; - if (jailed(curthread->td_ucred)) { - error = rtm_get_jailed( - &info, ifp, rt, &saun, - curthread->td_ucred); - if (error != 0) { - RT_UNLOCK(rt); - senderr(ESRCH); - } - } else { - info.rti_info[RTAX_IFA] = - rt->rt_ifa->ifa_addr; + error = rtm_get_jailed(&info, ifp, rt, + &saun, curthread->td_ucred); + if (error != 0) { + RT_UNLOCK(rt); + senderr(error); } if (ifp->if_flags & IFF_POINTOPOINT) info.rti_info[RTAX_BRD] = @@ -1230,9 +1204,9 @@ sysctl_dumpentry(struct radix_node *rn, if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; - if (jailed(w->w_req->td->td_ucred) && - ((rt->rt_flags & RTF_HOST) == 0 || - !prison_if(w->w_req->td->td_ucred, rt_key(rt)))) + if ((rt->rt_flags & RTF_HOST) == 0 + ? jailed(w->w_req->td->td_ucred) + : prison_if(w->w_req->td->td_ucred, rt_key(rt)) != 0) return (0); bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = rt_key(rt); @@ -1293,8 +1267,8 @@ sysctl_iflist(int af, struct walkarg *w) while ((ifa = TAILQ_NEXT(ifa, ifa_link)) != NULL) { if (af && af != ifa->ifa_addr->sa_family) continue; - if (jailed(w->w_req->td->td_ucred) && - !prison_if(w->w_req->td->td_ucred, ifa->ifa_addr)) + if (prison_if(w->w_req->td->td_ucred, + ifa->ifa_addr) != 0) continue; info.rti_info[RTAX_IFA] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; @@ -1341,8 +1315,8 @@ sysctl_ifmalist(int af, struct walkarg * TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (af && af != ifma->ifma_addr->sa_family) continue; - if (jailed(w->w_req->td->td_ucred) && - !prison_if(w->w_req->td->td_ucred, ifma->ifma_addr)) + if (prison_if(w->w_req->td->td_ucred, + ifma->ifma_addr) != 0) continue; info.rti_info[RTAX_IFA] = ifma->ifma_addr; info.rti_info[RTAX_GATEWAY] = Modified: stable/7/sys/netinet/in.c ============================================================================== --- stable/7/sys/netinet/in.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/netinet/in.c Wed Feb 18 20:12:08 2009 (r188761) @@ -255,7 +255,7 @@ in_control(struct socket *so, u_long cmd if (iap->ia_ifp == ifp && iap->ia_addr.sin_addr.s_addr == dst.s_addr) { if (td == NULL || prison_check_ip4( - td->td_ucred, &dst)) + td->td_ucred, &dst) == 0) ia = iap; break; } @@ -264,8 +264,8 @@ in_control(struct socket *so, u_long cmd iap = ifatoia(ifa); if (iap->ia_addr.sin_family == AF_INET) { if (td != NULL && - !prison_check_ip4(td->td_ucred, - &iap->ia_addr.sin_addr)) + prison_check_ip4(td->td_ucred, + &iap->ia_addr.sin_addr) != 0) continue; ia = iap; break; Modified: stable/7/sys/netinet/in_pcb.c ============================================================================== --- stable/7/sys/netinet/in_pcb.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/netinet/in_pcb.c Wed Feb 18 20:12:08 2009 (r188761) @@ -296,7 +296,10 @@ in_pcbbind_setup(struct inpcb *inp, stru return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) wild = INPLOOKUP_WILDCARD; - if (nam) { + if (nam == NULL) { + if ((error = prison_local_ip4(cred, &laddr)) != 0) + return (error); + } else { sin = (struct sockaddr_in *)nam; if (nam->sa_len != sizeof (*sin)) return (EINVAL); @@ -308,8 +311,9 @@ in_pcbbind_setup(struct inpcb *inp, stru if (sin->sin_family != AF_INET) return (EAFNOSUPPORT); #endif - if (prison_local_ip4(cred, &sin->sin_addr)) - return (EINVAL); + error = prison_local_ip4(cred, &sin->sin_addr); + if (error) + return (error); if (sin->sin_port != *lportp) { /* Don't allow the port to change. */ if (*lportp != 0) @@ -365,8 +369,6 @@ in_pcbbind_setup(struct inpcb *inp, stru t->inp_cred->cr_uid)) return (EADDRINUSE); } - if (prison_local_ip4(cred, &sin->sin_addr)) - return (EADDRNOTAVAIL); t = in_pcblookup_local(pcbinfo, sin->sin_addr, lport, wild, cred); if (t && (t->inp_vflag & INP_TIMEWAIT)) { @@ -400,9 +402,6 @@ in_pcbbind_setup(struct inpcb *inp, stru u_short first, last; int count; - if (prison_local_ip4(cred, &laddr)) - return (EINVAL); - if (inp->inp_flags & INP_HIGHPORT) { first = ipport_hifirstauto; /* sysctl */ last = ipport_hilastauto; @@ -485,8 +484,6 @@ in_pcbbind_setup(struct inpcb *inp, stru wild, cred)); } } - if (prison_local_ip4(cred, &laddr)) - return (EINVAL); *laddrp = laddr.s_addr; *lportp = lport; return (0); @@ -606,7 +603,7 @@ in_pcbladdr(struct inpcb *inp, struct in if (sa->sa_family != AF_INET) continue; sin = (struct sockaddr_in *)sa; - if (prison_check_ip4(cred, &sin->sin_addr)) { + if (prison_check_ip4(cred, &sin->sin_addr) == 0) { ia = (struct in_ifaddr *)ifa; break; } @@ -617,8 +614,7 @@ in_pcbladdr(struct inpcb *inp, struct in } /* 3. As a last resort return the 'default' jail address. */ - if (prison_get_ip4(cred, laddr) != 0) - error = EADDRNOTAVAIL; + error = prison_get_ip4(cred, laddr); goto done; } @@ -643,7 +639,7 @@ in_pcbladdr(struct inpcb *inp, struct in /* Jailed. */ /* 1. Check if the iface address belongs to the jail. */ sin = (struct sockaddr_in *)sro.ro_rt->rt_ifa->ifa_addr; - if (prison_check_ip4(cred, &sin->sin_addr)) { + if (prison_check_ip4(cred, &sin->sin_addr) == 0) { ia = (struct in_ifaddr *)sro.ro_rt->rt_ifa; laddr->s_addr = ia->ia_addr.sin_addr.s_addr; goto done; @@ -659,7 +655,7 @@ in_pcbladdr(struct inpcb *inp, struct in if (sa->sa_family != AF_INET) continue; sin = (struct sockaddr_in *)sa; - if (prison_check_ip4(cred, &sin->sin_addr)) { + if (prison_check_ip4(cred, &sin->sin_addr) == 0) { ia = (struct in_ifaddr *)ifa; break; } @@ -670,8 +666,7 @@ in_pcbladdr(struct inpcb *inp, struct in } /* 3. As a last resort return the 'default' jail address. */ - if (prison_get_ip4(cred, laddr) != 0) - error = EADDRNOTAVAIL; + error = prison_get_ip4(cred, laddr); goto done; } @@ -721,7 +716,8 @@ in_pcbladdr(struct inpcb *inp, struct in if (sa->sa_family != AF_INET) continue; sin = (struct sockaddr_in *)sa; - if (prison_check_ip4(cred, &sin->sin_addr)) { + if (prison_check_ip4(cred, + &sin->sin_addr) == 0) { ia = (struct in_ifaddr *)ifa; break; } @@ -733,8 +729,7 @@ in_pcbladdr(struct inpcb *inp, struct in } /* 3. As a last resort return the 'default' jail address. */ - if (prison_get_ip4(cred, laddr) != 0) - error = EADDRNOTAVAIL; + error = prison_get_ip4(cred, laddr); goto done; } @@ -767,7 +762,7 @@ in_pcbconnect_setup(struct inpcb *inp, s struct sockaddr_in *sin = (struct sockaddr_in *)nam; struct in_ifaddr *ia; struct inpcb *oinp; - struct in_addr laddr, faddr, jailia; + struct in_addr laddr, faddr; u_short lport, fport; int error; @@ -800,15 +795,11 @@ in_pcbconnect_setup(struct inpcb *inp, s * choose the broadcast address for that interface. */ if (faddr.s_addr == INADDR_ANY) { - if (cred != NULL && jailed(cred)) { - if (prison_get_ip4(cred, &jailia) != 0) - return (EADDRNOTAVAIL); - faddr.s_addr = jailia.s_addr; - } else { - faddr = - IA_SIN(TAILQ_FIRST(&in_ifaddrhead))-> - sin_addr; - } + faddr = + IA_SIN(TAILQ_FIRST(&in_ifaddrhead))->sin_addr; + if (cred != NULL && + (error = prison_get_ip4(cred, &faddr)) != 0) + return (error); } else if (faddr.s_addr == (u_long)INADDR_BROADCAST && (TAILQ_FIRST(&in_ifaddrhead)->ia_ifp->if_flags & IFF_BROADCAST)) @@ -1290,7 +1281,8 @@ in_pcblookup_hash(struct inpcbinfo *pcbi injail = jailed(inp->inp_cred); if (injail) { - if (!prison_check_ip4(inp->inp_cred, &laddr)) + if (prison_check_ip4(inp->inp_cred, + &laddr) != 0) continue; } else { if (local_exact != NULL) Modified: stable/7/sys/netinet/raw_ip.c ============================================================================== --- stable/7/sys/netinet/raw_ip.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/netinet/raw_ip.c Wed Feb 18 20:12:08 2009 (r188761) @@ -265,10 +265,8 @@ rip_input(struct mbuf *m, int off) continue; if (inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed(inp->inp_cred)) { - if (!prison_check_ip4(inp->inp_cred, &ip->ip_dst)) - continue; - } + if (prison_check_ip4(inp->inp_cred, &ip->ip_dst) != 0) + continue; if (last) { struct mbuf *n; @@ -295,10 +293,8 @@ rip_input(struct mbuf *m, int off) if (inp->inp_faddr.s_addr && inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed(inp->inp_cred)) { - if (!prison_check_ip4(inp->inp_cred, &ip->ip_dst)) - continue; - } + if (prison_check_ip4(inp->inp_cred, &ip->ip_dst) != 0) + continue; if (last) { struct mbuf *n; @@ -358,14 +354,12 @@ rip_output(struct mbuf *m, struct socket ip->ip_off = 0; ip->ip_p = inp->inp_ip_p; ip->ip_len = m->m_pkthdr.len; - if (jailed(inp->inp_cred)) { - if (prison_get_ip4(inp->inp_cred, &ip->ip_src) != 0) { - INP_RUNLOCK(inp); - m_freem(m); - return (EPERM); - } - } else { - ip->ip_src = inp->inp_laddr; + ip->ip_src = inp->inp_laddr; + error = prison_get_ip4(inp->inp_cred, &ip->ip_src); + if (error != 0) { + INP_RUNLOCK(inp); + m_freem(m); + return (error); } ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; @@ -376,10 +370,11 @@ rip_output(struct mbuf *m, struct socket } INP_RLOCK(inp); ip = mtod(m, struct ip *); - if (!prison_check_ip4(inp->inp_cred, &ip->ip_src)) { + error = prison_check_ip4(inp->inp_cred, &ip->ip_src); + if (error != 0) { INP_RUNLOCK(inp); m_freem(m); - return (EPERM); + return (error); } /* @@ -783,12 +778,14 @@ rip_bind(struct socket *so, struct socka { struct sockaddr_in *addr = (struct sockaddr_in *)nam; struct inpcb *inp; + int error; if (nam->sa_len != sizeof(*addr)) return (EINVAL); - if (!prison_check_ip4(td->td_ucred, &addr->sin_addr)) - return (EADDRNOTAVAIL); + error = prison_check_ip4(td->td_ucred, &addr->sin_addr); + if (error != 0) + return (error); if (TAILQ_EMPTY(&ifnet) || (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) || Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/netinet/tcp_usrreq.c Wed Feb 18 20:12:08 2009 (r188761) @@ -462,8 +462,8 @@ tcp_usr_connect(struct socket *so, struc if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) return (EAFNOSUPPORT); - if (prison_remote_ip4(td->td_ucred, &sinp->sin_addr) != 0) - return (EINVAL); + if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) + return (error); TCPDEBUG0; INP_INFO_WLOCK(&tcbinfo); @@ -528,10 +528,9 @@ tcp6_usr_connect(struct socket *so, stru in6_sin6_2_sin(&sin, sin6p); inp->inp_vflag |= INP_IPV4; inp->inp_vflag &= ~INP_IPV6; - if (prison_remote_ip4(td->td_ucred, &sin.sin_addr) != 0) { - error = EINVAL; + if ((error = prison_remote_ip4(td->td_ucred, + &sin.sin_addr)) != 0) goto out; - } if ((error = tcp_connect(tp, (struct sockaddr *)&sin, td)) != 0) goto out; error = tcp_output_connect(so, nam); @@ -540,10 +539,8 @@ tcp6_usr_connect(struct socket *so, stru inp->inp_vflag &= ~INP_IPV4; inp->inp_vflag |= INP_IPV6; inp->inp_inc.inc_isipv6 = 1; - if (prison_remote_ip6(td->td_ucred, &sin6p->sin6_addr) != 0) { - error = EINVAL; + if ((error = prison_remote_ip6(td->td_ucred, &sin6p->sin6_addr)) != 0) goto out; - } if ((error = tcp6_connect(tp, nam, td)) != 0) goto out; error = tcp_output_connect(so, nam); Modified: stable/7/sys/netinet/udp_usrreq.c ============================================================================== --- stable/7/sys/netinet/udp_usrreq.c Wed Feb 18 19:59:27 2009 (r188760) +++ stable/7/sys/netinet/udp_usrreq.c Wed Feb 18 20:12:08 2009 (r188761) @@ -938,10 +938,9 @@ udp_output(struct inpcb *inp, struct mbu * Jail may rewrite the destination address, so let it do *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 20:42:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C9D106566B; Wed, 18 Feb 2009 20:42:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0CC8FC15; Wed, 18 Feb 2009 20:42:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IKghBB074156; Wed, 18 Feb 2009 20:42:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IKghwU074155; Wed, 18 Feb 2009 20:42:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902182042.n1IKghwU074155@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Feb 2009 20:42: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: r188762 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 20:42:44 -0000 Author: mav Date: Wed Feb 18 20:42:42 2009 New Revision: 188762 URL: http://svn.freebsd.org/changeset/base/188762 Log: Implement proper attach/detach routines for ISA driver. Modified: head/sys/dev/ata/ata-isa.c Modified: head/sys/dev/ata/ata-isa.c ============================================================================== --- head/sys/dev/ata/ata-isa.c Wed Feb 18 20:12:08 2009 (r188761) +++ head/sys/dev/ata/ata-isa.c Wed Feb 18 20:42:42 2009 (r188762) @@ -60,15 +60,49 @@ static struct isa_pnp_id ata_ids[] = { static int ata_isa_probe(device_t dev) { - struct ata_channel *ch = device_get_softc(dev); struct resource *io = NULL, *ctlio = NULL; u_long tmp; - int i, rid; + int rid; /* check isapnp ids */ if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO) return ENXIO; - + + /* allocate the io port range */ + rid = ATA_IOADDR_RID; + if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, + ATA_IOSIZE, RF_ACTIVE))) + return ENXIO; + + /* set the altport range */ + if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, &tmp, &tmp)) { + bus_set_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, + rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE); + } + + /* allocate the altport range */ + rid = ATA_CTLADDR_RID; + if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, + ATA_CTLIOSIZE, RF_ACTIVE))) { + bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); + return ENXIO; + } + + /* Release resources to reallocate on attach. */ + bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, ctlio); + bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); + + return (ata_probe(dev)); +} + +static int +ata_isa_attach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + struct resource *io = NULL, *ctlio = NULL; + u_long tmp; + int i, rid; + /* allocate the io port range */ rid = ATA_IOADDR_RID; if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, @@ -103,13 +137,29 @@ ata_isa_probe(device_t dev) ch->unit = 0; ch->flags |= ATA_USE_16BIT; ata_generic_hw(dev); - return ata_probe(dev); + return ata_attach(dev); +} + +static int +ata_isa_detach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + error = ata_detach(dev); + + bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, + ch->r_io[ATA_CONTROL].res); + bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, + ch->r_io[ATA_IDX_ADDR].res); + return (error); } static device_method_t ata_isa_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_isa_probe), - DEVMETHOD(device_attach, ata_attach), + DEVMETHOD(device_attach, ata_isa_attach), + DEVMETHOD(device_detach, ata_isa_detach), DEVMETHOD(device_suspend, ata_suspend), DEVMETHOD(device_resume, ata_resume), From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 21:12:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A164106566B; Wed, 18 Feb 2009 21:12:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789DB8FC19; Wed, 18 Feb 2009 21:12:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ILCmg8074868; Wed, 18 Feb 2009 21:12:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ILCm4Q074866; Wed, 18 Feb 2009 21:12:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902182112.n1ILCm4Q074866@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Feb 2009 21:12: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: r188763 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 21:12:49 -0000 Author: mav Date: Wed Feb 18 21:12:48 2009 New Revision: 188763 URL: http://svn.freebsd.org/changeset/base/188763 Log: Make ch->dma.free() called symmetrically to ch->dma.alloc(). Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-pci.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Feb 18 20:42:42 2009 (r188762) +++ head/sys/dev/ata/ata-all.c Wed Feb 18 21:12:48 2009 (r188763) @@ -186,6 +186,11 @@ ata_detach(device_t dev) bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); ch->r_irq = NULL; + + /* free DMA resources if DMA HW present*/ + if (ch->dma.free) + ch->dma.free(dev); + mtx_destroy(&ch->state_mtx); mtx_destroy(&ch->queue_mtx); return 0; Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Feb 18 20:42:42 2009 (r188762) +++ head/sys/dev/ata/ata-pci.c Wed Feb 18 21:12:48 2009 (r188763) @@ -544,14 +544,11 @@ ata_pcichannel_attach(device_t dev) static int ata_pcichannel_detach(device_t dev) { - struct ata_channel *ch = device_get_softc(dev); int error; if ((error = ata_detach(dev))) return error; - ch->dma.free(dev); - /* XXX SOS free resources for io and ctlio ?? */ return 0; From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 21:52:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DCE106574A; Wed, 18 Feb 2009 21:52:13 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66C748FC21; Wed, 18 Feb 2009 21:52:13 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ILqDNU075753; Wed, 18 Feb 2009 21:52:13 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ILqD9Q075752; Wed, 18 Feb 2009 21:52:13 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200902182152.n1ILqD9Q075752@svn.freebsd.org> From: Attilio Rao Date: Wed, 18 Feb 2009 21:52: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: r188764 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 21:52:14 -0000 Author: attilio Date: Wed Feb 18 21:52:13 2009 New Revision: 188764 URL: http://svn.freebsd.org/changeset/base/188764 Log: - Add a function (fill_kinfo_aggregate()) which aggregates relevant members for a kinfo entry on a process-wide system. - Use the newly introduced function in order to fix cases like KERN_PROC_PROC where aggregating stats are broken because they just consider the first thread in the pool for each process. (Note, additively, that KERN_PROC_PROC is rather inaccurate on thread-wide informations like the 'state' of the process. Such informations should maybe be invalidated and being forceably discarded by the consumers?). - Simplify the logic of sysctl_out_proc() and adjust the fill_kinfo_thread() accordingly. - Remove checks on the FIRST_THREAD_IN_PROC() being NULL but add assertives. This patch should fix aggregate statistics for KERN_PROC_PROC. This is one of the reasons why top doesn't use this option and now it can be use it safely. ps, when launched in order to display just processes, now should report correct cpu utilization percentages and times (as opposed by the old code). Reviewed by: jhb, emaste Sponsored by: Sandvine Incorporated Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Feb 18 21:12:48 2009 (r188763) +++ head/sys/kern/kern_proc.c Wed Feb 18 21:52:13 2009 (r188764) @@ -115,6 +115,7 @@ MALLOC_DEFINE(M_SUBPROC, "subproc", "Pro static void doenterpgrp(struct proc *, struct pgrp *); static void orphanpg(struct pgrp *pg); +static void fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread); @@ -670,6 +671,30 @@ DB_SHOW_COMMAND(pgrpdump, pgrpdump) #endif /* DDB */ /* + * Calculate the kinfo_proc members which contain process-wide + * informations. + * Must be called with the target process locked. + */ +static void +fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp) +{ + struct thread *td; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + kp->ki_estcpu = 0; + kp->ki_pctcpu = 0; + kp->ki_runtime = 0; + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + kp->ki_pctcpu += sched_pctcpu(td); + kp->ki_runtime += cputick2usec(td->td_runtime); + kp->ki_estcpu += td->td_estcpu; + thread_unlock(td); + } +} + +/* * Clear kinfo_proc and fill in any information that is common * to all threads in the process. * Must be called with the target process locked. @@ -869,14 +894,15 @@ fill_kinfo_thread(struct thread *td, str kp->ki_numthreads = p->p_numthreads; kp->ki_pcb = td->td_pcb; kp->ki_kstack = (void *)td->td_kstack; - kp->ki_pctcpu = sched_pctcpu(td); - kp->ki_estcpu = td->td_estcpu; kp->ki_slptime = (ticks - td->td_slptick) / hz; kp->ki_pri.pri_class = td->td_pri_class; kp->ki_pri.pri_user = td->td_user_pri; - if (preferthread) + if (preferthread) { kp->ki_runtime = cputick2usec(td->td_runtime); + kp->ki_pctcpu = sched_pctcpu(td); + kp->ki_estcpu = td->td_estcpu; + } /* We can't get this anymore but ps etc never used it anyway. */ kp->ki_rqindex = 0; @@ -894,9 +920,11 @@ void fill_kinfo_proc(struct proc *p, struct kinfo_proc *kp) { + MPASS(FIRST_THREAD_IN_PROC(p) != NULL); + fill_kinfo_proc_only(p, kp); - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp, 0); + fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp, 0); + fill_kinfo_aggregate(p, kp); } struct pstats * @@ -960,26 +988,20 @@ sysctl_out_proc(struct proc *p, struct s pid_t pid = p->p_pid; PROC_LOCK_ASSERT(p, MA_OWNED); + MPASS(FIRST_THREAD_IN_PROC(p) != NULL); - fill_kinfo_proc_only(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) { - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), - &kinfo_proc, 0); + fill_kinfo_proc(p, &kinfo_proc); + if (flags & KERN_PROC_NOTHREADS) error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - } else { - if (FIRST_THREAD_IN_PROC(p) != NULL) - FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc, 1); - error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - if (error) - break; - } - else + sizeof(kinfo_proc)); + else { + FOREACH_THREAD_IN_PROC(p, td) { + fill_kinfo_thread(td, &kinfo_proc, 1); error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); + sizeof(kinfo_proc)); + if (error) + break; + } } PROC_UNLOCK(p); if (error) From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 22:17:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 854351065672; Wed, 18 Feb 2009 22:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72BCF8FC14; Wed, 18 Feb 2009 22:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IMHn4K076550; Wed, 18 Feb 2009 22:17:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IMHmXV076531; Wed, 18 Feb 2009 22:17:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902182217.n1IMHmXV076531@svn.freebsd.org> From: Alexander Motin Date: Wed, 18 Feb 2009 22:17: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: r188765 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:17:50 -0000 Author: mav Date: Wed Feb 18 22:17:48 2009 New Revision: 188765 URL: http://svn.freebsd.org/changeset/base/188765 Log: As soon as they called in only same one place (ata_pcichannel_attach()), join allocate() and dmainit() atapci subdriver's channel initialization methods into single ch_attach() method. As opposite to ch_attach() add new ch_detach() method to deallocate/disable channel. Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-netcell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/ata-pci.c Wed Feb 18 22:17:48 2009 (r188765) @@ -99,8 +99,7 @@ ata_pci_attach(device_t dev) else ctlr->channels = 1; ctlr->ichannels = -1; - ctlr->allocate = ata_pci_allocate; - ctlr->dmainit = ata_pci_dmainit; + ctlr->ch_attach = ata_pci_ch_attach; ctlr->dev = dev; /* if needed try to enable busmastering */ @@ -344,7 +343,7 @@ ata_generic_chipinit(device_t dev) } int -ata_pci_allocate(device_t dev) +ata_pci_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -361,6 +360,8 @@ ata_pci_allocate(device_t dev) return ENXIO; } + ata_pci_dmainit(dev); + for (i = ATA_DATA; i <= ATA_COMMAND; i ++) { ch->r_io[i].res = io; ch->r_io[i].offset = i; @@ -532,10 +533,7 @@ ata_pcichannel_attach(device_t dev) ch->unit = (intptr_t)device_get_ivars(dev); - if (ctlr->dmainit) - ctlr->dmainit(dev); - - if ((error = ctlr->allocate(dev))) + if ((error = ctlr->ch_attach(dev))) return error; return ata_attach(dev); @@ -544,14 +542,16 @@ ata_pcichannel_attach(device_t dev) static int ata_pcichannel_detach(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); int error; if ((error = ata_detach(dev))) return error; - /* XXX SOS free resources for io and ctlio ?? */ + if (ctlr->ch_detach) + return (ctlr->ch_detach(dev)); - return 0; + return (0); } static int Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/ata-pci.h Wed Feb 18 22:17:48 2009 (r188765) @@ -55,10 +55,10 @@ struct ata_pci_controller { int (*chipinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); - int (*allocate)(device_t); + int (*ch_attach)(device_t); + int (*ch_detach)(device_t); int (*locking)(device_t, int); void (*reset)(device_t); - void (*dmainit)(device_t); void (*setmode)(device_t, int); struct { void (*function)(void *); @@ -409,7 +409,7 @@ struct resource * ata_pci_alloc_resource int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); -int ata_pci_allocate(device_t dev); +int ata_pci_ch_attach(device_t dev); int ata_pci_status(device_t dev); void ata_pci_hw(device_t dev); void ata_pci_dmainit(device_t dev); @@ -434,7 +434,7 @@ void ata_pm_identify(device_t dev); /* global prototypes from chipsets/ata-*.c */ int ata_ahci_chipinit(device_t); -int ata_ahci_allocate(device_t dev); +int ata_ahci_ch_attach(device_t dev); void ata_ahci_reset(device_t dev); void ata_ahci_dmainit(device_t dev); int ata_marvell_edma_chipinit(device_t); Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-acard.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_acard_chipinit(device_t dev); -static int ata_acard_allocate(device_t dev); +static int ata_acard_ch_attach(device_t dev); static int ata_acard_status(device_t dev); static void ata_acard_850_setmode(device_t dev, int mode); static void ata_acard_86X_setmode(device_t dev, int mode); @@ -97,7 +97,7 @@ ata_acard_chipinit(device_t dev) if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->allocate = ata_acard_allocate; + ctlr->ch_attach = ata_acard_ch_attach; if (ctlr->chip->cfg1 == ATP_OLD) { ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; @@ -108,12 +108,12 @@ ata_acard_chipinit(device_t dev) } static int -ata_acard_allocate(device_t dev) +ata_acard_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; ch->hw.status = ata_acard_status; Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ali_chipinit(device_t dev); -static int ata_ali_allocate(device_t dev); -static int ata_ali_sata_allocate(device_t dev); +static int ata_ali_ch_attach(device_t dev); +static int ata_ali_sata_ch_attach(device_t dev); static void ata_ali_reset(device_t dev); static void ata_ali_setmode(device_t dev, int mode); @@ -105,7 +105,7 @@ ata_ali_chipinit(device_t dev) switch (ctlr->chip->cfg2) { case ALI_SATA: ctlr->channels = ctlr->chip->cfg1; - ctlr->allocate = ata_ali_sata_allocate; + ctlr->ch_attach = ata_ali_sata_ch_attach; ctlr->setmode = ata_sata_setmode; /* AHCI mode is correctly supported only on the ALi 5288. */ @@ -133,7 +133,7 @@ ata_ali_chipinit(device_t dev) device_printf(dev, "using PIO transfers above 137GB as workaround for " "48bit DMA access bug, expect reduced performance\n"); - ctlr->allocate = ata_ali_allocate; + ctlr->ch_attach = ata_ali_ch_attach; ctlr->reset = ata_ali_reset; ctlr->setmode = ata_ali_setmode; break; @@ -148,13 +148,13 @@ ata_ali_chipinit(device_t dev) } static int -ata_ali_allocate(device_t dev) +ata_ali_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; /* older chips can't do 48bit DMA transfers */ @@ -165,7 +165,7 @@ ata_ali_allocate(device_t dev) } static int -ata_ali_sata_allocate(device_t dev) +ata_ali_sata_ch_attach(device_t dev) { device_t parent = device_get_parent(dev); struct ata_pci_controller *ctlr = device_get_softc(parent); Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-ahci.c Wed Feb 18 22:17:48 2009 (r188765) @@ -128,8 +128,7 @@ ata_ahci_chipinit(device_t dev) (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK) + 1); ctlr->reset = ata_ahci_reset; - ctlr->dmainit = ata_ahci_dmainit; - ctlr->allocate = ata_ahci_allocate; + ctlr->ch_attach = ata_ahci_ch_attach; ctlr->setmode = ata_sata_setmode; ctlr->suspend = ata_ahci_suspend; ctlr->resume = ata_ahci_ctlr_reset; @@ -197,12 +196,14 @@ ata_ahci_suspend(device_t dev) int -ata_ahci_allocate(device_t dev) +ata_ahci_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; + ata_ahci_dmainit(dev); + /* set the SATA resources */ ch->r_io[ATA_SSTATUS].res = ctlr->r_res2; ch->r_io[ATA_SSTATUS].offset = ATA_AHCI_P_SSTS + offset; Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_highpoint_chipinit(device_t dev); -static int ata_highpoint_allocate(device_t dev); +static int ata_highpoint_ch_attach(device_t dev); static void ata_highpoint_setmode(device_t dev, int mode); static int ata_highpoint_check_80pin(device_t dev, int mode); @@ -134,18 +134,18 @@ ata_highpoint_chipinit(device_t dev) pci_write_config(dev, 0x5b, (pci_read_config(dev, 0x5b, 1) & 0x01) | 0x20, 1); } - ctlr->allocate = ata_highpoint_allocate; + ctlr->ch_attach = ata_highpoint_ch_attach; ctlr->setmode = ata_highpoint_setmode; return 0; } static int -ata_highpoint_allocate(device_t dev) +ata_highpoint_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; ch->flags |= ATA_ALWAYS_DMASTAT; Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-intel.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,12 +53,12 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_intel_chipinit(device_t dev); -static int ata_intel_allocate(device_t dev); +static int ata_intel_ch_attach(device_t dev); static void ata_intel_reset(device_t dev); static void ata_intel_old_setmode(device_t dev, int mode); static void ata_intel_new_setmode(device_t dev, int mode); static void ata_intel_sata_setmode(device_t dev, int mode); -static int ata_intel_31244_allocate(device_t dev); +static int ata_intel_31244_ch_attach(device_t dev); static int ata_intel_31244_status(device_t dev); static void ata_intel_31244_tf_write(struct ata_request *request); static void ata_intel_31244_reset(device_t dev); @@ -171,7 +171,7 @@ ata_intel_chipinit(device_t dev) RF_ACTIVE))) return ENXIO; ctlr->channels = 4; - ctlr->allocate = ata_intel_31244_allocate; + ctlr->ch_attach = ata_intel_31244_ch_attach; ctlr->reset = ata_intel_31244_reset; } ctlr->setmode = ata_sata_setmode; @@ -180,7 +180,7 @@ ata_intel_chipinit(device_t dev) /* non SATA intel chips goes here */ else if (ctlr->chip->max_dma < ATA_SA150) { ctlr->channels = ctlr->chip->cfg2; - ctlr->allocate = ata_intel_allocate; + ctlr->ch_attach = ata_intel_ch_attach; ctlr->setmode = ata_intel_new_setmode; } @@ -189,7 +189,7 @@ ata_intel_chipinit(device_t dev) /* force all ports active "the legacy way" */ pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0f, 2); - ctlr->allocate = ata_intel_allocate; + ctlr->ch_attach = ata_intel_ch_attach; ctlr->reset = ata_intel_reset; /* @@ -218,13 +218,13 @@ ata_intel_chipinit(device_t dev) } static int -ata_intel_allocate(device_t dev) +ata_intel_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; /* if r_res2 is valid it points to SATA interface registers */ @@ -257,7 +257,7 @@ ata_intel_reset(device_t dev) mask = 0x0003; else { mask = (0x0001 << ch->unit); - /* XXX SOS should be in intel_allocate if we grow it */ + /* XXX SOS should be in intel_ch_attach if we grow it */ ch->flags |= ATA_NO_SLAVE; } } @@ -396,7 +396,7 @@ ata_intel_sata_setmode(device_t dev, int } static int -ata_intel_31244_allocate(device_t dev) +ata_intel_31244_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_jmicron_chipinit(device_t dev); -static int ata_jmicron_allocate(device_t dev); +static int ata_jmicron_ch_attach(device_t dev); static void ata_jmicron_reset(device_t dev); static void ata_jmicron_dmainit(device_t dev); static void ata_jmicron_setmode(device_t dev, int mode); @@ -112,9 +112,8 @@ ata_jmicron_chipinit(device_t dev) return 0; /* otherwise we are on the PATA part */ - ctlr->allocate = ata_pci_allocate; + ctlr->ch_attach = ata_pci_ch_attach; ctlr->reset = ata_generic_reset; - ctlr->dmainit = ata_pci_dmainit; ctlr->setmode = ata_jmicron_setmode; ctlr->channels = ctlr->chip->cfg2; } @@ -126,9 +125,8 @@ ata_jmicron_chipinit(device_t dev) if (ctlr->chip->cfg1 && (error = ata_ahci_chipinit(dev))) return error; - ctlr->allocate = ata_jmicron_allocate; + ctlr->ch_attach = ata_jmicron_ch_attach; ctlr->reset = ata_jmicron_reset; - ctlr->dmainit = ata_jmicron_dmainit; ctlr->setmode = ata_jmicron_setmode; /* set the number of HW channels */ @@ -138,19 +136,21 @@ ata_jmicron_chipinit(device_t dev) } static int -ata_jmicron_allocate(device_t dev) +ata_jmicron_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int error; + ata_jmicron_dmainit(dev); + if (ch->unit >= ctlr->chip->cfg1) { ch->unit -= ctlr->chip->cfg1; - error = ata_pci_allocate(dev); + error = ata_pci_ch_attach(dev); ch->unit += ctlr->chip->cfg1; } else - error = ata_ahci_allocate(dev); + error = ata_ahci_ch_attach(dev); return error; } Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-marvell.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,9 +53,9 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_marvell_pata_chipinit(device_t dev); -static int ata_marvell_pata_allocate(device_t dev); +static int ata_marvell_pata_ch_attach(device_t dev); static void ata_marvell_pata_setmode(device_t dev, int mode); -static int ata_marvell_edma_allocate(device_t dev); +static int ata_marvell_edma_ch_attach(device_t dev); static int ata_marvell_edma_status(device_t dev); static int ata_marvell_edma_begin_transaction(struct ata_request *request); static int ata_marvell_edma_end_transaction(struct ata_request *request); @@ -135,19 +135,19 @@ ata_marvell_pata_chipinit(device_t dev) if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->allocate = ata_marvell_pata_allocate; + ctlr->ch_attach = ata_marvell_pata_ch_attach; ctlr->setmode = ata_marvell_pata_setmode; ctlr->channels = ctlr->chip->cfg1; return 0; } static int -ata_marvell_pata_allocate(device_t dev) +ata_marvell_pata_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; /* dont use 32 bit PIO transfers */ @@ -189,9 +189,8 @@ ata_marvell_edma_chipinit(device_t dev) /* mask all PCI interrupts */ ATA_OUTL(ctlr->r_res1, 0x01d5c, 0x00000000); - ctlr->allocate = ata_marvell_edma_allocate; + ctlr->ch_attach = ata_marvell_edma_ch_attach; ctlr->reset = ata_marvell_edma_reset; - ctlr->dmainit = ata_marvell_edma_dmainit; ctlr->setmode = ata_sata_setmode; ctlr->channels = ctlr->chip->cfg1; @@ -217,13 +216,15 @@ ata_marvell_edma_chipinit(device_t dev) } static int -ata_marvell_edma_allocate(device_t dev) +ata_marvell_edma_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); u_int64_t work = ch->dma.work_bus; int i; + ata_marvell_edma_dmainit(dev); + /* clear work area */ bzero(ch->dma.work, 1024+256); Modified: head/sys/dev/ata/chipsets/ata-netcell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-netcell.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-netcell.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_netcell_chipinit(device_t dev); -static int ata_netcell_allocate(device_t dev); +static int ata_netcell_ch_attach(device_t dev); static void ata_netcell_setmode(device_t dev, int mode); @@ -81,18 +81,18 @@ ata_netcell_chipinit(device_t dev) if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->allocate = ata_netcell_allocate; + ctlr->ch_attach = ata_netcell_ch_attach; ctlr->setmode = ata_netcell_setmode; return 0; } static int -ata_netcell_allocate(device_t dev) +ata_netcell_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; /* the NetCell only supports 16 bit PIO transfers */ Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_nvidia_chipinit(device_t dev); -static int ata_nvidia_allocate(device_t dev); +static int ata_nvidia_ch_attach(device_t dev); static int ata_nvidia_status(device_t dev); static void ata_nvidia_reset(device_t dev); static void ata_nvidia_setmode(device_t dev, int mode); @@ -130,7 +130,7 @@ ata_nvidia_chipinit(device_t dev) &ctlr->r_rid2, RF_ACTIVE))) { int offset = ctlr->chip->cfg1 & NV4 ? 0x0440 : 0x0010; - ctlr->allocate = ata_nvidia_allocate; + ctlr->ch_attach = ata_nvidia_ch_attach; ctlr->reset = ata_nvidia_reset; /* enable control access */ @@ -171,13 +171,13 @@ ata_nvidia_chipinit(device_t dev) } static int -ata_nvidia_allocate(device_t dev) +ata_nvidia_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; ch->r_io[ATA_SSTATUS].res = ctlr->r_res2; Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-promise.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,16 +53,16 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_promise_chipinit(device_t dev); -static int ata_promise_allocate(device_t dev); +static int ata_promise_ch_attach(device_t dev); static int ata_promise_status(device_t dev); static int ata_promise_dmastart(struct ata_request *request); static int ata_promise_dmastop(struct ata_request *request); static void ata_promise_dmareset(device_t dev); static void ata_promise_dmainit(device_t dev); static void ata_promise_setmode(device_t dev, int mode); -static int ata_promise_tx2_allocate(device_t dev); +static int ata_promise_tx2_ch_attach(device_t dev); static int ata_promise_tx2_status(device_t dev); -static int ata_promise_mio_allocate(device_t dev); +static int ata_promise_mio_ch_attach(device_t dev); static void ata_promise_mio_intr(void *data); static int ata_promise_mio_status(device_t dev); static int ata_promise_mio_command(struct ata_request *request); @@ -226,19 +226,17 @@ ata_promise_chipinit(device_t dev) case PR_NEW: /* setup clocks */ ATA_OUTB(ctlr->r_res1, 0x11, ATA_INB(ctlr->r_res1, 0x11) | 0x0a); - - ctlr->dmainit = ata_promise_dmainit; /* FALLTHROUGH */ case PR_OLD: /* enable burst mode */ ATA_OUTB(ctlr->r_res1, 0x1f, ATA_INB(ctlr->r_res1, 0x1f) | 0x01); - ctlr->allocate = ata_promise_allocate; + ctlr->ch_attach = ata_promise_ch_attach; ctlr->setmode = ata_promise_setmode; return 0; case PR_TX: - ctlr->allocate = ata_promise_tx2_allocate; + ctlr->ch_attach = ata_promise_tx2_ch_attach; ctlr->setmode = ata_promise_setmode; return 0; @@ -284,9 +282,8 @@ ata_promise_chipinit(device_t dev) TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; device_set_ivars(dev, hpkt); - ctlr->allocate = ata_promise_mio_allocate; + ctlr->ch_attach = ata_promise_mio_ch_attach; ctlr->reset = ata_promise_mio_reset; - ctlr->dmainit = ata_promise_mio_dmainit; ctlr->setmode = ata_promise_setmode; ctlr->channels = 4; return 0; @@ -337,9 +334,8 @@ sataii: if ((ctlr->chip->cfg2 == PR_SATA2) || (ctlr->chip->cfg2 == PR_CMBO2)) ATA_OUTL(ctlr->r_res2, 0x44, ATA_INL(ctlr->r_res2, 0x44) | 0x2000); - ctlr->allocate = ata_promise_mio_allocate; + ctlr->ch_attach = ata_promise_mio_ch_attach; ctlr->reset = ata_promise_mio_reset; - ctlr->dmainit = ata_promise_mio_dmainit; ctlr->setmode = ata_promise_mio_setmode; return 0; @@ -354,11 +350,15 @@ failnfree: } static int -ata_promise_allocate(device_t dev) +ata_promise_ch_attach(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - if (ata_pci_allocate(dev)) + if (ctlr->chip->cfg1 == PR_NEW) + ata_promise_dmainit(dev); + + if (ata_pci_ch_attach(dev)) return ENXIO; ch->hw.status = ata_promise_status; @@ -521,11 +521,11 @@ ata_promise_setmode(device_t dev, int mo } static int -ata_promise_tx2_allocate(device_t dev) +ata_promise_tx2_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; ch->hw.status = ata_promise_tx2_status; @@ -545,13 +545,15 @@ ata_promise_tx2_status(device_t dev) } static int -ata_promise_mio_allocate(device_t dev) +ata_promise_mio_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = (ctlr->chip->cfg2 & PR_SX4X) ? 0x000c0000 : 0; int i; - + + ata_promise_mio_dmainit(dev); + for (i = ATA_DATA; i <= ATA_COMMAND; i++) { ch->r_io[i].res = ctlr->r_res2; ch->r_io[i].offset = offset + 0x0200 + (i << 2) + (ch->unit << 7); Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_serverworks_chipinit(device_t dev); -static int ata_serverworks_allocate(device_t dev); +static int ata_serverworks_ch_attach(device_t dev); static void ata_serverworks_tf_read(struct ata_request *request); static void ata_serverworks_tf_write(struct ata_request *request); static void ata_serverworks_setmode(device_t dev, int mode); @@ -113,7 +113,7 @@ ata_serverworks_chipinit(device_t dev) return ENXIO; ctlr->channels = ctlr->chip->cfg2; - ctlr->allocate = ata_serverworks_allocate; + ctlr->ch_attach = ata_serverworks_ch_attach; ctlr->setmode = ata_sata_setmode; return 0; } @@ -144,7 +144,7 @@ ata_serverworks_chipinit(device_t dev) } static int -ata_serverworks_allocate(device_t dev) +ata_serverworks_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Wed Feb 18 22:17:48 2009 (r188765) @@ -52,14 +52,14 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ -static int ata_cmd_allocate(device_t dev); +static int ata_cmd_ch_attach(device_t dev); static int ata_cmd_status(device_t dev); static void ata_cmd_setmode(device_t dev, int mode); -static int ata_sii_allocate(device_t dev); +static int ata_sii_ch_attach(device_t dev); static int ata_sii_status(device_t dev); static void ata_sii_reset(device_t dev); static void ata_sii_setmode(device_t dev, int mode); -static int ata_siiprb_allocate(device_t dev); +static int ata_siiprb_ch_attach(device_t dev); static int ata_siiprb_status(device_t dev); static int ata_siiprb_begin_transaction(struct ata_request *request); static int ata_siiprb_end_transaction(struct ata_request *request); @@ -138,9 +138,8 @@ ata_sii_chipinit(device_t dev) bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1); return ENXIO; } - ctlr->allocate = ata_siiprb_allocate; + ctlr->ch_attach = ata_siiprb_ch_attach; ctlr->reset = ata_siiprb_reset; - ctlr->dmainit = ata_siiprb_dmainit; ctlr->setmode = ata_sata_setmode; ctlr->channels = (ctlr->chip->cfg2 == SII_4CH) ? 4 : 2; @@ -187,7 +186,7 @@ ata_sii_chipinit(device_t dev) pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1); if (ctlr->r_res2) - ctlr->allocate = ata_sii_allocate; + ctlr->ch_attach = ata_sii_ch_attach; if (ctlr->chip->max_dma >= ATA_SA150) { ctlr->reset = ata_sii_reset; @@ -206,7 +205,7 @@ ata_sii_chipinit(device_t dev) /* enable interrupt as BIOS might not */ pci_write_config(dev, 0x71, 0x01, 1); - ctlr->allocate = ata_cmd_allocate; + ctlr->ch_attach = ata_cmd_ch_attach; ctlr->setmode = ata_cmd_setmode; break; } @@ -214,13 +213,13 @@ ata_sii_chipinit(device_t dev) } static int -ata_cmd_allocate(device_t dev) +ata_cmd_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; if (ctlr->chip->cfg2 & SII_INTR) @@ -300,7 +299,7 @@ ata_cmd_setmode(device_t dev, int mode) } static int -ata_sii_allocate(device_t dev) +ata_sii_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -467,12 +466,14 @@ struct ata_siiprb_command { } __packed; static int -ata_siiprb_allocate(device_t dev) +ata_siiprb_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit * 0x2000; + ata_siiprb_dmainit(dev); + /* set the SATA resources */ ch->r_io[ATA_SSTATUS].res = ctlr->r_res2; ch->r_io[ATA_SSTATUS].offset = 0x1f04 + offset; Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-sis.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_sis_chipinit(device_t dev); -static int ata_sis_allocate(device_t dev); +static int ata_sis_ch_attach(device_t dev); static void ata_sis_reset(device_t dev); static void ata_sis_setmode(device_t dev, int mode); @@ -186,7 +186,7 @@ ata_sis_chipinit(device_t dev) ctlr->r_rid2 = PCIR_BAR(5); if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, RF_ACTIVE))) { - ctlr->allocate = ata_sis_allocate; + ctlr->ch_attach = ata_sis_ch_attach; ctlr->reset = ata_sis_reset; /* enable PCI interrupt */ @@ -203,14 +203,14 @@ ata_sis_chipinit(device_t dev) } static int -ata_sis_allocate(device_t dev) +ata_sis_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << ((ctlr->chip->chipid == ATA_SIS182) ? 5 : 6); /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; ch->r_io[ATA_SSTATUS].res = ctlr->r_res2; Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Wed Feb 18 21:52:13 2009 (r188764) +++ head/sys/dev/ata/chipsets/ata-via.c Wed Feb 18 22:17:48 2009 (r188765) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_via_chipinit(device_t dev); -static int ata_via_allocate(device_t dev); +static int ata_via_ch_attach(device_t dev); static void ata_via_reset(device_t dev); static void ata_via_old_setmode(device_t dev, int mode); static void ata_via_southbridge_fixup(device_t dev); @@ -139,7 +139,7 @@ ata_via_chipinit(device_t dev) ctlr->r_rid2 = PCIR_BAR(5); if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, RF_ACTIVE))) { - ctlr->allocate = ata_via_allocate; + ctlr->ch_attach = ata_via_ch_attach; ctlr->reset = ata_via_reset; /* enable PCI interrupt */ @@ -184,7 +184,7 @@ ata_via_chipinit(device_t dev) } static int -ata_via_allocate(device_t dev) +ata_via_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -218,7 +218,7 @@ ata_via_allocate(device_t dev) } else { /* setup the usual register normal pci style */ - if (ata_pci_allocate(dev)) + if (ata_pci_ch_attach(dev)) return ENXIO; } From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 22:27:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D559910658D6; Wed, 18 Feb 2009 22:27: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 A879E8FC22; Wed, 18 Feb 2009 22:27: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 n1IMRk3B076794; Wed, 18 Feb 2009 22:27:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IMRkZ5076793; Wed, 18 Feb 2009 22:27:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902182227.n1IMRkZ5076793@svn.freebsd.org> From: Warner Losh Date: Wed, 18 Feb 2009 22:27: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: r188766 - head/usr.sbin/rpc.yppasswdd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:27:49 -0000 Author: imp Date: Wed Feb 18 22:27:46 2009 New Revision: 188766 URL: http://svn.freebsd.org/changeset/base/188766 Log: yppasswdd assumed that a struct x_master_passwd is type punable to a struct passwd. This is not the case when sizeof(unsigned long) != sizeof(time_t). Write a dinky function to do the assignment instead of relying on the punning. This does slow things down a little (1 extra function call, 11 pointer or int assignments), but is much safer and machines have been fast enough since the mid 1990s that nobody will notice the difference. time_t is a 64-bits int on arm and mips. Before this change, arm was silently broken. I guess there aren't that many ARM machines running master YP domain servers. :) The client side doesn't assume this type punning, so it doesn't need to be fixed. Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Feb 18 22:17:48 2009 (r188765) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Feb 18 22:27:46 2009 (r188766) @@ -70,6 +70,22 @@ struct dom_binding; static struct passwd yp_password; static void +xlate_passwd(struct x_master_passwd *xpwd, struct passwd *pwd) +{ + pwd->pw_name = xpwd->pw_name; + pwd->pw_passwd = xpwd->pw_passwd; + pwd->pw_uid = xpwd->pw_uid; + pwd->pw_gid = xpwd->pw_gid; + pwd->pw_change = xpwd->pw_change; + pwd->pw_class = xpwd->pw_class; + pwd->pw_gecos = xpwd->pw_gecos; + pwd->pw_dir = xpwd->pw_dir; + pwd->pw_shell = xpwd->pw_shell; + pwd->pw_expire = xpwd->pw_expire; + pwd->pw_fields = xpwd->pw_fields; +} + +static void copy_yp_pass(char *p, int x, int m) { char *t, *s = p; @@ -709,6 +725,7 @@ yppasswdproc_update_master_1_svc(master_ char passfile_hold_buf[MAXPATHLEN + 2]; struct sockaddr_in *rqhost; SVCXPRT *transp; + struct passwd newpasswd; result = 1; transp = rqstp->rq_xprt; @@ -820,7 +837,8 @@ allow additions to be made to the passwo yp_error("pw_tmp() failed"); return &result; } - if (pw_copy(pfd, tfd, (struct passwd *)&argp->newpw, NULL) == -1) { + xlate_passwd(&argp->newpw, &newpasswd); + if (pw_copy(pfd, tfd, &newpasswd, NULL) == -1) { pw_fini(); yp_error("pw_copy() failed"); return &result; @@ -858,8 +876,8 @@ allow additions to be made to the passwo pw_fini(); if (inplace) { - if ((rval = update_inplace((struct passwd *)&argp->newpw, - argp->domain))) { + xlate_passwd(&argp->newpw, &newpasswd); + if ((rval = update_inplace(&newpasswd, argp->domain))) { yp_error("inplace update failed -- rebuilding maps"); } } From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 22:44:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D2B9106564A; Wed, 18 Feb 2009 22:44:56 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B4C98FC1B; Wed, 18 Feb 2009 22:44:56 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IMitvA077158; Wed, 18 Feb 2009 22:44:55 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1IMitba077157; Wed, 18 Feb 2009 22:44:55 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200902182244.n1IMitba077157@svn.freebsd.org> From: Roman Divacky Date: Wed, 18 Feb 2009 22:44: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: r188767 - head/sys/i386/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:44:57 -0000 Author: rdivacky Date: Wed Feb 18 22:44:55 2009 New Revision: 188767 URL: http://svn.freebsd.org/changeset/base/188767 Log: Mark these variables as __used too. Fix a style of previous commit. Noticed by: Christoph Mallon Approved by: kib (mentor) Modified: head/sys/i386/acpica/acpi_wakeup.c Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Wed Feb 18 22:27:46 2009 (r188766) +++ head/sys/i386/acpica/acpi_wakeup.c Wed Feb 18 22:44:55 2009 (r188767) @@ -63,14 +63,15 @@ extern uint32_t acpi_resume_beep; extern uint32_t acpi_reset_video; extern void initializecpu(void); -static struct region_descriptor saved_idt, saved_gdt, *p_gdt; -static uint16_t __used saved_ldt; +static struct region_descriptor __used saved_idt, saved_gdt; +static struct region_descriptor *p_gdt; +static uint16_t __used saved_ldt; -static uint32_t __used r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, +static uint32_t __used r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr; -static uint16_t __used r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; -static uint32_t __used r_esp; +static uint16_t __used r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; +static uint32_t __used r_esp; static void acpi_printcpu(void); static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, From owner-svn-src-all@FreeBSD.ORG Wed Feb 18 22:56:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23A5C10657C6 for ; Wed, 18 Feb 2009 22:56:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id AC6848FC26 for ; Wed, 18 Feb 2009 22:56:19 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so841290fgb.35 for ; Wed, 18 Feb 2009 14:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=C4B0Hl96ARKRxuswPLZyZHw9s85NVSH+3awz+OKuSfI=; b=I62/ZgsmleAqGqHXCElFrgmhT3tei4c6v1WIvePThCBUUNbgNReXoz0M+C1SZXvnKR bw6SPcSVzz1lb5rpM4y1CWlP8rsfm3lMnn2Hv+yEC8dHCNNPFy/HcJ4LmPeEuX33Sdna 9DSkzrf+F4Ug48i0r/QjuGPlFzcXhz9vUfRw0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=tIqyEtj3eIv1jlWCic10sX26Yl6wEbsVP8kMc1wiVRWeYTdZ+bF6pGkiG01grkL51j cfB1j134rFQlxqHMmWb68RFa1a54ixs8Tr/BWbg3aDe/JCGh0cOAoEQxgNTRRnTKjmI8 lvTzxJI68P569pWKDqEP9Sayvx9Wi3R2B4sBc= MIME-Version: 1.0 Received: by 10.86.60.14 with SMTP id i14mr3070255fga.21.1234996522612; Wed, 18 Feb 2009 14:35:22 -0800 (PST) Date: Thu, 19 Feb 2009 01:35:22 +0300 Message-ID: From: pluknet To: svn-src-all@freebsd.org, freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: OT: svn commit: r188764 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:56:20 -0000 Hi. Am I right that td_estcpu is only updated under SCHED_4BSD ? (well, user's ki_estcpu is not used in top anyway. ps shows all zeroes under SCHED_ULE (as it should then though). I'm just interested.) -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 00:06:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52F3C106566C; Thu, 19 Feb 2009 00:06:02 +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 4167C8FC1A; Thu, 19 Feb 2009 00:06:02 +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 n1J062ps078717; Thu, 19 Feb 2009 00:06:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J062Qg078716; Thu, 19 Feb 2009 00:06:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200902190006.n1J062Qg078716@svn.freebsd.org> From: Robert Watson Date: Thu, 19 Feb 2009 00: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: r188768 - head/sys/dev/cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 00:06:02 -0000 Author: rwatson Date: Thu Feb 19 00:06:01 2009 New Revision: 188768 URL: http://svn.freebsd.org/changeset/base/188768 Log: if_cx is currently disconnected from the build due to a dependence on the old TTY implementation; however, take a cut at stripping its optional Giant-protected code paths enabled using debug.cx.mpsafenet, which will no longer work once IFF_NEEDSGIANT is removed. Modified: head/sys/dev/cx/if_cx.c Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Wed Feb 18 22:44:55 2009 (r188767) +++ head/sys/dev/cx/if_cx.c Thu Feb 19 00:06:01 2009 (r188768) @@ -83,24 +83,9 @@ __FBSDID("$FreeBSD$"); #define CX_LOCK_NAME "cxX" -static int cx_mpsafenet = 1; -TUNABLE_INT("debug.cx.mpsafenet", &cx_mpsafenet); -SYSCTL_NODE(_debug, OID_AUTO, cx, CTLFLAG_RD, 0, "Cronyx Sigma Adapters"); -SYSCTL_INT(_debug_cx, OID_AUTO, mpsafenet, CTLFLAG_RD, &cx_mpsafenet, 0, - "Enable/disable MPSAFE network support for Cronyx Sigma Adapters"); - -#define CX_LOCK(_bd) do { \ - if (cx_mpsafenet) \ - mtx_lock (&(_bd)->cx_mtx); \ - } while (0) -#define CX_UNLOCK(_bd) do { \ - if (cx_mpsafenet) \ - mtx_unlock (&(_bd)->cx_mtx); \ - } while (0) -#define CX_LOCK_ASSERT(_bd) do { \ - if (cx_mpsafenet) \ - mtx_assert (&(_bd)->cx_mtx, MA_OWNED); \ - } while (0) +#define CX_LOCK(_bd) mtx_lock (&(_bd)->cx_mtx) +#define CX_UNLOCK(_bd) mtx_unlock (&(_bd)->cx_mtx) +#define CX_LOCK_ASSERT(_bd) mtx_assert (&(_bd)->cx_mtx, MA_OWNED) typedef struct _async_q { int beg; @@ -239,7 +224,7 @@ static struct cdevsw cx_cdevsw = { .d_close = cx_close, .d_ioctl = cx_ioctl, .d_name = "cx", - .d_flags = D_TTY | D_NEEDGIANT, + .d_flags = D_TTY, }; static int MY_SOFT_INTR; @@ -776,10 +761,10 @@ static int cx_attach (device_t dev) return ENXIO; } b->sys = bd; - callout_init (&led_timo[b->num], cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&led_timo[b->num], CALLOUT_MPSAFE); s = splhigh (); if (bus_setup_intr (dev, bd->irq_res, - INTR_TYPE_NET|(cx_mpsafenet?INTR_MPSAFE:0), + INTR_TYPE_NET|INTR_MPSAFE, NULL, cx_intr, bd, &bd->intrhand)) { printf ("cx%d: Can't setup irq %ld\n", unit, irq); bd->board = 0; @@ -849,8 +834,7 @@ static int cx_attach (device_t dev) d->hi_queue.ifq_maxlen = IFQ_MAXLEN; mtx_init (&d->lo_queue.ifq_mtx, "cx_queue_lo", NULL, MTX_DEF); mtx_init (&d->hi_queue.ifq_mtx, "cx_queue_hi", NULL, MTX_DEF); - callout_init (&d->timeout_handle, - cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->timeout_handle, CALLOUT_MPSAFE); #else /*NETGRAPH*/ d->ifp = if_alloc(IFT_PPP); if (d->ifp == NULL) { @@ -865,8 +849,6 @@ static int cx_attach (device_t dev) if_initname (d->ifp, "cx", b->num * NCHAN + c->num); d->ifp->if_mtu = PP_MTU; d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; - if (!cx_mpsafenet) - d->ifp->if_flags |= IFF_NEEDSGIANT; d->ifp->if_ioctl = cx_sioctl; d->ifp->if_start = cx_ifstart; d->ifp->if_watchdog = cx_ifwatchdog; @@ -901,8 +883,7 @@ static int cx_attach (device_t dev) ttycreate(d->tty, TS_CALLOUT, "x%r%r", b->num, c->num); d->devt = make_dev (&cx_cdevsw, b->num*NCHAN + c->num + 64, UID_ROOT, GID_WHEEL, 0600, "cx%d", b->num*NCHAN + c->num); d->devt->si_drv1 = d; - callout_init (&d->dcd_timeout_handle, - cx_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init (&d->dcd_timeout_handle, CALLOUT_MPSAFE); } splx (s); @@ -2538,9 +2519,6 @@ static int cx_modevent (module_t mod, in { static int load_count = 0; - if (cx_mpsafenet) - cx_cdevsw.d_flags &= ~D_NEEDGIANT; - switch (type) { case MOD_LOAD: #ifdef NETGRAPH @@ -2549,11 +2527,11 @@ static int cx_modevent (module_t mod, in #endif ++load_count; - callout_init (&timeout_handle, cx_mpsafenet?CALLOUT_MPSAFE:0); + callout_init (&timeout_handle, CALLOUT_MPSAFE); callout_reset (&timeout_handle, hz*5, cx_timeout, 0); /* Software interrupt. */ swi_add(&tty_intr_event, "cx", cx_softintr, NULL, SWI_TTY, - (cx_mpsafenet?INTR_MPSAFE:0), &cx_fast_ih); + INTR_MPSAFE, &cx_fast_ih); break; case MOD_UNLOAD: if (load_count == 1) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 00:32:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70603106564A; Thu, 19 Feb 2009 00:32:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D9DC8FC14; Thu, 19 Feb 2009 00:32:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J0WuVW079328; Thu, 19 Feb 2009 00:32:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J0WtAL079311; Thu, 19 Feb 2009 00:32:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902190032.n1J0WtAL079311@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Feb 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: r188769 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 00:32:56 -0000 Author: mav Date: Thu Feb 19 00:32:55 2009 New Revision: 188769 URL: http://svn.freebsd.org/changeset/base/188769 Log: Quite mechanical ch_detach implementations for all atapci subdrivers. Some dmainit call fixes for previous commit. Modified: head/sys/dev/ata/ata-dma.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-netcell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/ata-dma.c Thu Feb 19 00:32:55 2009 (r188769) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include /* prototypes */ -static void ata_dmafini(device_t dev); static void ata_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static void ata_dmaalloc(device_t dev); static void ata_dmafree(device_t dev); Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/ata-pci.c Thu Feb 19 00:32:55 2009 (r188769) @@ -100,6 +100,7 @@ ata_pci_attach(device_t dev) ctlr->channels = 1; ctlr->ichannels = -1; ctlr->ch_attach = ata_pci_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->dev = dev; /* if needed try to enable busmastering */ @@ -382,6 +383,21 @@ ata_pci_ch_attach(device_t dev) } int +ata_pci_ch_detach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + ata_pci_dmafini(dev); + + bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, + ch->r_io[ATA_CONTROL].res); + bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, + ch->r_io[ATA_IDX_ADDR].res); + + return (0); +} + +int ata_pci_status(device_t dev) { struct ata_pci_controller *controller = @@ -477,6 +493,12 @@ ata_pci_dmainit(device_t dev) ch->dma.reset = ata_pci_dmareset; } +void +ata_pci_dmafini(device_t dev) +{ + + ata_dmafini(dev); +} static device_method_t ata_pci_methods[] = { /* device interface */ Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/ata-pci.h Thu Feb 19 00:32:55 2009 (r188769) @@ -410,9 +410,11 @@ int ata_pci_release_resource(device_t de int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); int ata_pci_ch_attach(device_t dev); +int ata_pci_ch_detach(device_t dev); int ata_pci_status(device_t dev); void ata_pci_hw(device_t dev); void ata_pci_dmainit(device_t dev); +void ata_pci_dmafini(device_t dev); char *ata_pcivendor2str(device_t dev); int ata_legacy(device_t); void ata_generic_intr(void *data); @@ -435,13 +437,14 @@ void ata_pm_identify(device_t dev); /* global prototypes from chipsets/ata-*.c */ int ata_ahci_chipinit(device_t); int ata_ahci_ch_attach(device_t dev); +int ata_ahci_ch_detach(device_t dev); void ata_ahci_reset(device_t dev); -void ata_ahci_dmainit(device_t dev); int ata_marvell_edma_chipinit(device_t); int ata_sii_chipinit(device_t); /* global prototypes ata-dma.c */ void ata_dmainit(device_t); +void ata_dmafini(device_t dev); /* externs */ extern devclass_t ata_pci_devclass; Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-acard.c Thu Feb 19 00:32:55 2009 (r188769) @@ -98,6 +98,7 @@ ata_acard_chipinit(device_t dev) return ENXIO; ctlr->ch_attach = ata_acard_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; if (ctlr->chip->cfg1 == ATP_OLD) { ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Thu Feb 19 00:32:55 2009 (r188769) @@ -106,6 +106,7 @@ ata_ali_chipinit(device_t dev) case ALI_SATA: ctlr->channels = ctlr->chip->cfg1; ctlr->ch_attach = ata_ali_sata_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_sata_setmode; /* AHCI mode is correctly supported only on the ALi 5288. */ @@ -134,6 +135,7 @@ ata_ali_chipinit(device_t dev) "using PIO transfers above 137GB as workaround for " "48bit DMA access bug, expect reduced performance\n"); ctlr->ch_attach = ata_ali_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_ali_reset; ctlr->setmode = ata_ali_setmode; break; Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-ahci.c Thu Feb 19 00:32:55 2009 (r188769) @@ -62,6 +62,7 @@ static int ata_ahci_pm_write(device_t de static u_int32_t ata_ahci_softreset(device_t dev, int port); static void ata_ahci_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static int ata_ahci_setup_fis(struct ata_ahci_cmd_tab *ctp, struct ata_request *equest); +static void ata_ahci_dmainit(device_t dev); /* * AHCI v1.x compliant SATA chipset support functions @@ -129,6 +130,7 @@ ata_ahci_chipinit(device_t dev) ctlr->reset = ata_ahci_reset; ctlr->ch_attach = ata_ahci_ch_attach; + ctlr->ch_detach = ata_ahci_ch_detach; ctlr->setmode = ata_sata_setmode; ctlr->suspend = ata_ahci_suspend; ctlr->resume = ata_ahci_ctlr_reset; @@ -225,6 +227,14 @@ ata_ahci_ch_attach(device_t dev) return 0; } +int +ata_ahci_ch_detach(device_t dev) +{ + + ata_dmafini(dev); + return (0); +} + static int ata_ahci_status(device_t dev) { @@ -763,7 +773,7 @@ ata_ahci_dmasetprd(void *xsc, bus_dma_se args->nsegs = nsegs; } -void +static void ata_ahci_dmainit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Thu Feb 19 00:32:55 2009 (r188769) @@ -135,6 +135,7 @@ ata_highpoint_chipinit(device_t dev) (pci_read_config(dev, 0x5b, 1) & 0x01) | 0x20, 1); } ctlr->ch_attach = ata_highpoint_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_highpoint_setmode; return 0; } Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-intel.c Thu Feb 19 00:32:55 2009 (r188769) @@ -59,6 +59,7 @@ static void ata_intel_old_setmode(device static void ata_intel_new_setmode(device_t dev, int mode); static void ata_intel_sata_setmode(device_t dev, int mode); static int ata_intel_31244_ch_attach(device_t dev); +static int ata_intel_31244_ch_detach(device_t dev); static int ata_intel_31244_status(device_t dev); static void ata_intel_31244_tf_write(struct ata_request *request); static void ata_intel_31244_reset(device_t dev); @@ -172,6 +173,7 @@ ata_intel_chipinit(device_t dev) return ENXIO; ctlr->channels = 4; ctlr->ch_attach = ata_intel_31244_ch_attach; + ctlr->ch_detach = ata_intel_31244_ch_detach; ctlr->reset = ata_intel_31244_reset; } ctlr->setmode = ata_sata_setmode; @@ -181,6 +183,7 @@ ata_intel_chipinit(device_t dev) else if (ctlr->chip->max_dma < ATA_SA150) { ctlr->channels = ctlr->chip->cfg2; ctlr->ch_attach = ata_intel_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_intel_new_setmode; } @@ -190,6 +193,7 @@ ata_intel_chipinit(device_t dev) pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0f, 2); ctlr->ch_attach = ata_intel_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_intel_reset; /* @@ -403,6 +407,8 @@ ata_intel_31244_ch_attach(device_t dev) int i; int ch_offset; + ata_pci_dmainit(dev); + ch_offset = 0x200 + ch->unit * 0x200; for (i = ATA_DATA; i < ATA_MAX_RES; i++) @@ -444,6 +450,14 @@ ata_intel_31244_ch_attach(device_t dev) } static int +ata_intel_31244_ch_detach(device_t dev) +{ + + ata_pci_dmafini(dev); + return (0); +} + +static int ata_intel_31244_status(device_t dev) { /* do we have any PHY events ? */ Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Thu Feb 19 00:32:55 2009 (r188769) @@ -54,11 +54,10 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_jmicron_chipinit(device_t dev); static int ata_jmicron_ch_attach(device_t dev); +static int ata_jmicron_ch_detach(device_t dev); static void ata_jmicron_reset(device_t dev); -static void ata_jmicron_dmainit(device_t dev); static void ata_jmicron_setmode(device_t dev, int mode); - /* * JMicron chipset support functions */ @@ -113,6 +112,7 @@ ata_jmicron_chipinit(device_t dev) /* otherwise we are on the PATA part */ ctlr->ch_attach = ata_pci_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_generic_reset; ctlr->setmode = ata_jmicron_setmode; ctlr->channels = ctlr->chip->cfg2; @@ -126,6 +126,7 @@ ata_jmicron_chipinit(device_t dev) return error; ctlr->ch_attach = ata_jmicron_ch_attach; + ctlr->ch_detach = ata_jmicron_ch_detach; ctlr->reset = ata_jmicron_reset; ctlr->setmode = ata_jmicron_setmode; @@ -142,8 +143,6 @@ ata_jmicron_ch_attach(device_t dev) struct ata_channel *ch = device_get_softc(dev); int error; - ata_jmicron_dmainit(dev); - if (ch->unit >= ctlr->chip->cfg1) { ch->unit -= ctlr->chip->cfg1; error = ata_pci_ch_attach(dev); @@ -154,28 +153,34 @@ ata_jmicron_ch_attach(device_t dev) return error; } -static void -ata_jmicron_reset(device_t dev) +static int +ata_jmicron_ch_detach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); + int error; - if (ch->unit >= ctlr->chip->cfg1) - ata_generic_reset(dev); + if (ch->unit >= ctlr->chip->cfg1) { + ch->unit -= ctlr->chip->cfg1; + error = ata_pci_ch_detach(dev); + ch->unit += ctlr->chip->cfg1; + } else - ata_ahci_reset(dev); + error = ata_ahci_ch_detach(dev); + + return (error); } static void -ata_jmicron_dmainit(device_t dev) +ata_jmicron_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); if (ch->unit >= ctlr->chip->cfg1) - ata_pci_dmainit(dev); + ata_generic_reset(dev); else - ata_ahci_dmainit(dev); + ata_ahci_reset(dev); } static void Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-marvell.c Thu Feb 19 00:32:55 2009 (r188769) @@ -56,6 +56,7 @@ static int ata_marvell_pata_chipinit(dev static int ata_marvell_pata_ch_attach(device_t dev); static void ata_marvell_pata_setmode(device_t dev, int mode); static int ata_marvell_edma_ch_attach(device_t dev); +static int ata_marvell_edma_ch_detach(device_t dev); static int ata_marvell_edma_status(device_t dev); static int ata_marvell_edma_begin_transaction(struct ata_request *request); static int ata_marvell_edma_end_transaction(struct ata_request *request); @@ -136,6 +137,7 @@ ata_marvell_pata_chipinit(device_t dev) return ENXIO; ctlr->ch_attach = ata_marvell_pata_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_marvell_pata_setmode; ctlr->channels = ctlr->chip->cfg1; return 0; @@ -190,6 +192,7 @@ ata_marvell_edma_chipinit(device_t dev) ATA_OUTL(ctlr->r_res1, 0x01d5c, 0x00000000); ctlr->ch_attach = ata_marvell_edma_ch_attach; + ctlr->ch_detach = ata_marvell_edma_ch_detach; ctlr->reset = ata_marvell_edma_reset; ctlr->setmode = ata_sata_setmode; ctlr->channels = ctlr->chip->cfg1; @@ -308,6 +311,14 @@ ata_marvell_edma_ch_attach(device_t dev) } static int +ata_marvell_edma_ch_detach(device_t dev) +{ + + ata_dmafini(dev); + return (0); +} + +static int ata_marvell_edma_status(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: head/sys/dev/ata/chipsets/ata-netcell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-netcell.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-netcell.c Thu Feb 19 00:32:55 2009 (r188769) @@ -82,6 +82,7 @@ ata_netcell_chipinit(device_t dev) return ENXIO; ctlr->ch_attach = ata_netcell_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_netcell_setmode; return 0; } Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Thu Feb 19 00:32:55 2009 (r188769) @@ -131,6 +131,7 @@ ata_nvidia_chipinit(device_t dev) int offset = ctlr->chip->cfg1 & NV4 ? 0x0440 : 0x0010; ctlr->ch_attach = ata_nvidia_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_nvidia_reset; /* enable control access */ Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-promise.c Thu Feb 19 00:32:55 2009 (r188769) @@ -58,11 +58,11 @@ static int ata_promise_status(device_t d static int ata_promise_dmastart(struct ata_request *request); static int ata_promise_dmastop(struct ata_request *request); static void ata_promise_dmareset(device_t dev); -static void ata_promise_dmainit(device_t dev); static void ata_promise_setmode(device_t dev, int mode); static int ata_promise_tx2_ch_attach(device_t dev); static int ata_promise_tx2_status(device_t dev); static int ata_promise_mio_ch_attach(device_t dev); +static int ata_promise_mio_ch_detach(device_t dev); static void ata_promise_mio_intr(void *data); static int ata_promise_mio_status(device_t dev); static int ata_promise_mio_command(struct ata_request *request); @@ -232,11 +232,13 @@ ata_promise_chipinit(device_t dev) /* enable burst mode */ ATA_OUTB(ctlr->r_res1, 0x1f, ATA_INB(ctlr->r_res1, 0x1f) | 0x01); ctlr->ch_attach = ata_promise_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_promise_setmode; return 0; case PR_TX: ctlr->ch_attach = ata_promise_tx2_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_promise_setmode; return 0; @@ -283,6 +285,7 @@ ata_promise_chipinit(device_t dev) hpkt->busy = 0; device_set_ivars(dev, hpkt); ctlr->ch_attach = ata_promise_mio_ch_attach; + ctlr->ch_detach = ata_promise_mio_ch_detach; ctlr->reset = ata_promise_mio_reset; ctlr->setmode = ata_promise_setmode; ctlr->channels = 4; @@ -335,6 +338,7 @@ sataii: ATA_OUTL(ctlr->r_res2, 0x44, ATA_INL(ctlr->r_res2, 0x44) | 0x2000); ctlr->ch_attach = ata_promise_mio_ch_attach; + ctlr->ch_detach = ata_promise_mio_ch_detach; ctlr->reset = ata_promise_mio_reset; ctlr->setmode = ata_promise_mio_setmode; @@ -355,12 +359,15 @@ ata_promise_ch_attach(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - if (ctlr->chip->cfg1 == PR_NEW) - ata_promise_dmainit(dev); - if (ata_pci_ch_attach(dev)) return ENXIO; + if (ctlr->chip->cfg1 == PR_NEW) { + ch->dma.start = ata_promise_dmastart; + ch->dma.stop = ata_promise_dmastop; + ch->dma.reset = ata_promise_dmareset; + } + ch->hw.status = ata_promise_status; return 0; } @@ -434,17 +441,6 @@ ata_promise_dmareset(device_t dev) } static void -ata_promise_dmainit(device_t dev) -{ - struct ata_channel *ch = device_get_softc(dev); - - ata_dmainit(dev); - ch->dma.start = ata_promise_dmastart; - ch->dma.stop = ata_promise_dmastop; - ch->dma.reset = ata_promise_dmareset; -} - -static void ata_promise_setmode(device_t dev, int mode) { device_t gparent = GRANDPARENT(dev); @@ -588,6 +584,14 @@ ata_promise_mio_ch_attach(device_t dev) return 0; } +static int +ata_promise_mio_ch_detach(device_t dev) +{ + + ata_dmafini(dev); + return (0); +} + static void ata_promise_mio_intr(void *data) { Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Thu Feb 19 00:32:55 2009 (r188769) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_serverworks_chipinit(device_t dev); static int ata_serverworks_ch_attach(device_t dev); +static int ata_serverworks_ch_detach(device_t dev); static void ata_serverworks_tf_read(struct ata_request *request); static void ata_serverworks_tf_write(struct ata_request *request); static void ata_serverworks_setmode(device_t dev, int mode); @@ -114,6 +115,7 @@ ata_serverworks_chipinit(device_t dev) ctlr->channels = ctlr->chip->cfg2; ctlr->ch_attach = ata_serverworks_ch_attach; + ctlr->ch_detach = ata_serverworks_ch_detach; ctlr->setmode = ata_sata_setmode; return 0; } @@ -151,6 +153,8 @@ ata_serverworks_ch_attach(device_t dev) int ch_offset; int i; + ata_pci_dmainit(dev); + ch_offset = ch->unit * 0x100; for (i = ATA_DATA; i < ATA_MAX_RES; i++) @@ -189,6 +193,14 @@ ata_serverworks_ch_attach(device_t dev) return 0; } +static int +ata_serverworks_ch_detach(device_t dev) +{ + + ata_pci_dmafini(dev); + return (0); +} + static void ata_serverworks_tf_read(struct ata_request *request) { Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Feb 19 00:32:55 2009 (r188769) @@ -56,10 +56,12 @@ static int ata_cmd_ch_attach(device_t de static int ata_cmd_status(device_t dev); static void ata_cmd_setmode(device_t dev, int mode); static int ata_sii_ch_attach(device_t dev); +static int ata_sii_ch_detach(device_t dev); static int ata_sii_status(device_t dev); static void ata_sii_reset(device_t dev); static void ata_sii_setmode(device_t dev, int mode); static int ata_siiprb_ch_attach(device_t dev); +static int ata_siiprb_ch_detach(device_t dev); static int ata_siiprb_status(device_t dev); static int ata_siiprb_begin_transaction(struct ata_request *request); static int ata_siiprb_end_transaction(struct ata_request *request); @@ -139,6 +141,7 @@ ata_sii_chipinit(device_t dev) return ENXIO; } ctlr->ch_attach = ata_siiprb_ch_attach; + ctlr->ch_detach = ata_siiprb_ch_detach; ctlr->reset = ata_siiprb_reset; ctlr->setmode = ata_sata_setmode; ctlr->channels = (ctlr->chip->cfg2 == SII_4CH) ? 4 : 2; @@ -185,8 +188,10 @@ ata_sii_chipinit(device_t dev) /* enable PCI interrupt as BIOS might not */ pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1); - if (ctlr->r_res2) + if (ctlr->r_res2) { ctlr->ch_attach = ata_sii_ch_attach; + ctlr->ch_detach = ata_sii_ch_detach; + } if (ctlr->chip->max_dma >= ATA_SA150) { ctlr->reset = ata_sii_reset; @@ -206,6 +211,7 @@ ata_sii_chipinit(device_t dev) pci_write_config(dev, 0x71, 0x01, 1); ctlr->ch_attach = ata_cmd_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->setmode = ata_cmd_setmode; break; } @@ -306,6 +312,8 @@ ata_sii_ch_attach(device_t dev) int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2); int i; + ata_pci_dmainit(dev); + for (i = ATA_DATA; i <= ATA_COMMAND; i++) { ch->r_io[i].res = ctlr->r_res2; ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 8); @@ -347,6 +355,14 @@ ata_sii_ch_attach(device_t dev) } static int +ata_sii_ch_detach(device_t dev) +{ + + ata_pci_dmafini(dev); + return (0); +} + +static int ata_sii_status(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -496,6 +512,14 @@ ata_siiprb_ch_attach(device_t dev) } static int +ata_siiprb_ch_detach(device_t dev) +{ + + ata_dmafini(dev); + return 0; +} + +static int ata_siiprb_status(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-sis.c Thu Feb 19 00:32:55 2009 (r188769) @@ -187,6 +187,7 @@ ata_sis_chipinit(device_t dev) if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, RF_ACTIVE))) { ctlr->ch_attach = ata_sis_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->reset = ata_sis_reset; /* enable PCI interrupt */ Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Thu Feb 19 00:06:01 2009 (r188768) +++ head/sys/dev/ata/chipsets/ata-via.c Thu Feb 19 00:32:55 2009 (r188769) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_via_chipinit(device_t dev); static int ata_via_ch_attach(device_t dev); +static int ata_via_ch_detach(device_t dev); static void ata_via_reset(device_t dev); static void ata_via_old_setmode(device_t dev, int mode); static void ata_via_southbridge_fixup(device_t dev); @@ -140,6 +141,7 @@ ata_via_chipinit(device_t dev) if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, &ctlr->r_rid2, RF_ACTIVE))) { ctlr->ch_attach = ata_via_ch_attach; + ctlr->ch_detach = ata_via_ch_detach; ctlr->reset = ata_via_reset; /* enable PCI interrupt */ @@ -194,6 +196,8 @@ ata_via_ch_attach(device_t dev) struct resource *r_io; int i, rid; + ata_pci_dmainit(dev); + rid = PCIR_BAR(ch->unit); if (!(r_io = bus_alloc_resource_any(device_get_parent(dev), SYS_RES_IOPORT, @@ -235,6 +239,31 @@ ata_via_ch_attach(device_t dev) return 0; } +static int +ata_via_ch_detach(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + + /* newer SATA chips has resources in one BAR for each channel */ + if (ctlr->chip->cfg2 & VIABAR) { + int rid; + + rid = PCIR_BAR(ch->unit); + bus_release_resource(device_get_parent(dev), + SYS_RES_IOPORT, rid, ch->r_io[ATA_CONTROL].res); + + ata_pci_dmafini(dev); + } + else { + /* setup the usual register normal pci style */ + if (ata_pci_ch_detach(dev)) + return ENXIO; + } + + return 0; +} + static void ata_via_reset(device_t dev) { From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:10:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD741106566C; Thu, 19 Feb 2009 04:10:51 +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 BBB298FC17; Thu, 19 Feb 2009 04:10:51 +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 n1J4Ap8S083520; Thu, 19 Feb 2009 04:10:51 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4ApNB083519; Thu, 19 Feb 2009 04:10:51 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190410.n1J4ApNB083519@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:10: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: r188770 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:10:52 -0000 Author: sam Date: Thu Feb 19 04:10:51 2009 New Revision: 188770 URL: http://svn.freebsd.org/changeset/base/188770 Log: whitespace Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Feb 19 00:32:55 2009 (r188769) +++ head/sys/dev/ath/ath_hal/ah.h Thu Feb 19 04:10:51 2009 (r188770) @@ -409,8 +409,8 @@ typedef struct { int rateCount; /* NB: for proper padding */ uint8_t rateCodeToIndex[144]; /* back mapping */ struct { - uint8_t valid; /* valid for rate control use */ - uint8_t phy; /* CCK/OFDM/XR */ + uint8_t valid; /* valid for rate control use */ + uint8_t phy; /* CCK/OFDM/XR */ uint32_t rateKbps; /* transfer rate in kbs */ uint8_t rateCode; /* rate for h/w descriptors */ uint8_t shortPreamble; /* mask for enabling short From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:15:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DD2106566C; Thu, 19 Feb 2009 04:15:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 950F38FC08; Thu, 19 Feb 2009 04:15:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J4FEBG083659; Thu, 19 Feb 2009 04:15:14 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4FEE6083657; Thu, 19 Feb 2009 04:15:14 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190415.n1J4FEE6083657@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:15: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: r188771 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:15:15 -0000 Author: sam Date: Thu Feb 19 04:15:14 2009 New Revision: 188771 URL: http://svn.freebsd.org/changeset/base/188771 Log: add HAL_DIAG_SETREGS to write registers via the diag api Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Feb 19 04:10:51 2009 (r188770) +++ head/sys/dev/ath/ath_hal/ah.c Thu Feb 19 04:15:14 2009 (r188771) @@ -539,6 +539,15 @@ ath_hal_getregdump(struct ath_hal *ah, c } return (char *) dp - (char *) dstbuf; } + +static void +ath_hal_setregs(struct ath_hal *ah, const HAL_REGWRITE *regs, int space) +{ + while (space >= sizeof(HAL_REGWRITE)) { + OS_REG_WRITE(ah, regs->addr, regs->value); + regs++, space -= sizeof(HAL_REGWRITE); + } +} HAL_BOOL ath_hal_getdiagstate(struct ath_hal *ah, int request, @@ -553,6 +562,10 @@ ath_hal_getdiagstate(struct ath_hal *ah, case HAL_DIAG_REGS: *resultsize = ath_hal_getregdump(ah, args, *result,*resultsize); return AH_TRUE; + case HAL_DIAG_SETREGS: + ath_hal_setregs(ah, args, argsize); + *resultsize = 0; + return AH_TRUE; case HAL_DIAG_FATALERR: *result = &AH_PRIVATE(ah)->ah_fatalState[0]; *resultsize = sizeof(AH_PRIVATE(ah)->ah_fatalState); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 04:10:51 2009 (r188770) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 04:15:14 2009 (r188771) @@ -49,6 +49,11 @@ typedef struct { uint16_t end; /* ending register or zero */ } HAL_REGRANGE; +typedef struct { + uint32_t addr; /* regiser address/offset */ + uint32_t value; /* value to write */ +} HAL_REGWRITE; + /* * Transmit power scale factor. * @@ -609,16 +614,14 @@ enum { HAL_DIAG_RESETKEY = 16, /* Reset keycache backdoor */ HAL_DIAG_EEREAD = 17, /* Read EEPROM word */ HAL_DIAG_EEWRITE = 18, /* Write EEPROM word */ - /* 19 was HAL_DIAG_TXCONT, 20-23 were for radar */ - HAL_DIAG_REGREAD = 24, /* Reg reads */ - HAL_DIAG_REGWRITE = 25, /* Reg writes */ - HAL_DIAG_GET_REGBASE = 26, /* Get register base */ + /* 19-26 removed, do not reuse */ HAL_DIAG_RDWRITE = 27, /* Write regulatory domain */ HAL_DIAG_RDREAD = 28, /* Get regulatory domain */ HAL_DIAG_FATALERR = 29, /* Read cached interrupt state */ HAL_DIAG_11NCOMPAT = 30, /* 11n compatibility tweaks */ HAL_DIAG_ANI_PARAMS = 31, /* ANI noise immunity parameters */ HAL_DIAG_CHECK_HANGS = 32, /* check h/w hangs */ + HAL_DIAG_SETREGS = 33, /* write registers */ }; enum { From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:19:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59BD2106564A; Thu, 19 Feb 2009 04:19:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480568FC13; Thu, 19 Feb 2009 04:19: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 n1J4JwcB083781; Thu, 19 Feb 2009 04:19:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4Jwjf083780; Thu, 19 Feb 2009 04:19:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190419.n1J4Jwjf083780@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:19: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: r188772 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:19:59 -0000 Author: sam Date: Thu Feb 19 04:19:58 2009 New Revision: 188772 URL: http://svn.freebsd.org/changeset/base/188772 Log: add phy types for 1/2 and 1/4-rate modes Modified: head/sys/net80211/_ieee80211.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Thu Feb 19 04:15:14 2009 (r188771) +++ head/sys/net80211/_ieee80211.h Thu Feb 19 04:19:58 2009 (r188772) @@ -43,6 +43,8 @@ enum ieee80211_phytype { IEEE80211_T_OFDM, /* frequency division multiplexing */ IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */ IEEE80211_T_HT, /* high throughput */ + IEEE80211_T_OFDM_HALF, /* 1/2 rate OFDM */ + IEEE80211_T_OFDM_QUARTER, /* 1/4 rate OFDM */ }; #define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:24:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7505F106566B; Thu, 19 Feb 2009 04:24:22 +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 61D8F8FC0C; Thu, 19 Feb 2009 04:24:22 +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 n1J4OMUB083927; Thu, 19 Feb 2009 04:24:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4OMVR083924; Thu, 19 Feb 2009 04:24:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190424.n1J4OMVR083924@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:24: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: r188773 - in head/sys/dev/ath/ath_hal: . ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:24:23 -0000 Author: sam Date: Thu Feb 19 04:24:22 2009 New Revision: 188773 URL: http://svn.freebsd.org/changeset/base/188773 Log: Cleanup ath_hal_computetxtime's handling of 1/2 and 1/4-width channels: o mark phy type to indicate 1/2 or 1/4-rate operation o use phy type instead of channel attributes to identify 1/2 and 1/4-rate operation o general cleanup of code including move phy constants to ah_internal.h Eventually this code should go away and we should use the net0211 equivalents. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Feb 19 04:19:58 2009 (r188772) +++ head/sys/dev/ath/ath_hal/ah.c Thu Feb 19 04:24:22 2009 (r188773) @@ -166,11 +166,7 @@ ath_hal_computetxtime(struct ath_hal *ah if (kbps == 0) return 0; switch (rates->info[rateix].phy) { - case IEEE80211_T_CCK: -#define CCK_SIFS_TIME 10 -#define CCK_PREAMBLE_BITS 144 -#define CCK_PLCP_BITS 48 phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; if (shortPreamble && rates->info[rateix].shortPreamble) phyTime >>= 1; @@ -178,81 +174,47 @@ ath_hal_computetxtime(struct ath_hal *ah txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000)/kbps); break; -#undef CCK_SIFS_TIME -#undef CCK_PREAMBLE_BITS -#undef CCK_PLCP_BITS - case IEEE80211_T_OFDM: -#define OFDM_SIFS_TIME 16 -#define OFDM_PREAMBLE_TIME 20 -#define OFDM_PLCP_BITS 22 -#define OFDM_SYMBOL_TIME 4 - -#define OFDM_SIFS_TIME_HALF 32 -#define OFDM_PREAMBLE_TIME_HALF 40 -#define OFDM_PLCP_BITS_HALF 22 -#define OFDM_SYMBOL_TIME_HALF 8 - -#define OFDM_SIFS_TIME_QUARTER 64 -#define OFDM_PREAMBLE_TIME_QUARTER 80 -#define OFDM_PLCP_BITS_QUARTER 22 -#define OFDM_SYMBOL_TIME_QUARTER 16 - - if (AH_PRIVATE(ah)->ah_curchan != AH_NULL && - IEEE80211_IS_CHAN_QUARTER(AH_PRIVATE(ah)->ah_curchan)) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; - HALASSERT(bitsPerSymbol != 0); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_QUARTER - + OFDM_PREAMBLE_TIME_QUARTER - + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); - } else if (AH_PRIVATE(ah)->ah_curchan != AH_NULL && - IEEE80211_IS_CHAN_HALF(AH_PRIVATE(ah)->ah_curchan)) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; - HALASSERT(bitsPerSymbol != 0); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_HALF + - OFDM_PREAMBLE_TIME_HALF - + (numSymbols * OFDM_SYMBOL_TIME_HALF); - } else { /* full rate channel */ - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; - HALASSERT(bitsPerSymbol != 0); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME + OFDM_PREAMBLE_TIME - + (numSymbols * OFDM_SYMBOL_TIME); - } + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; + HALASSERT(bitsPerSymbol != 0); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME + + OFDM_PREAMBLE_TIME + + (numSymbols * OFDM_SYMBOL_TIME); break; + case IEEE80211_T_OFDM_HALF: + bitsPerSymbol = (kbps * OFDM_HALF_SYMBOL_TIME) / 1000; + HALASSERT(bitsPerSymbol != 0); -#undef OFDM_SIFS_TIME -#undef OFDM_PREAMBLE_TIME -#undef OFDM_PLCP_BITS -#undef OFDM_SYMBOL_TIME + numBits = OFDM_HALF_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_HALF_SIFS_TIME + + OFDM_HALF_PREAMBLE_TIME + + (numSymbols * OFDM_HALF_SYMBOL_TIME); + break; + case IEEE80211_T_OFDM_QUARTER: + bitsPerSymbol = (kbps * OFDM_QUARTER_SYMBOL_TIME) / 1000; + HALASSERT(bitsPerSymbol != 0); + numBits = OFDM_QUARTER_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_QUARTER_SIFS_TIME + + OFDM_QUARTER_PREAMBLE_TIME + + (numSymbols * OFDM_QUARTER_SYMBOL_TIME); + break; case IEEE80211_T_TURBO: -#define TURBO_SIFS_TIME 8 -#define TURBO_PREAMBLE_TIME 14 -#define TURBO_PLCP_BITS 22 -#define TURBO_SYMBOL_TIME 4 /* we still save OFDM rates in kbps - so double them */ bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000; HALASSERT(bitsPerSymbol != 0); - numBits = TURBO_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME - + (numSymbols * TURBO_SYMBOL_TIME); + numBits = TURBO_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = TURBO_SIFS_TIME + + TURBO_PREAMBLE_TIME + + (numSymbols * TURBO_SYMBOL_TIME); break; -#undef TURBO_SIFS_TIME -#undef TURBO_PREAMBLE_TIME -#undef TURBO_PLCP_BITS -#undef TURBO_SYMBOL_TIME - default: HALDEBUG(ah, HAL_DEBUG_PHYIO, "%s: unknown phy %u (rate ix %u)\n", Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 04:19:58 2009 (r188772) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 04:24:22 2009 (r188773) @@ -773,5 +773,29 @@ extern void ath_hal_ini_bank_setup(uint3 extern int ath_hal_ini_bank_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia, const uint32_t data[], int regWr); +#define CCK_SIFS_TIME 10 +#define CCK_PREAMBLE_BITS 144 +#define CCK_PLCP_BITS 48 + +#define OFDM_SIFS_TIME 16 +#define OFDM_PREAMBLE_TIME 20 +#define OFDM_PLCP_BITS 22 +#define OFDM_SYMBOL_TIME 4 + +#define OFDM_HALF_SIFS_TIME 32 +#define OFDM_HALF_PREAMBLE_TIME 40 +#define OFDM_HALF_PLCP_BITS 22 +#define OFDM_HALF_SYMBOL_TIME 8 + +#define OFDM_QUARTER_SIFS_TIME 64 +#define OFDM_QUARTER_PREAMBLE_TIME 80 +#define OFDM_QUARTER_PLCP_BITS 22 +#define OFDM_QUARTER_SYMBOL_TIME 16 + +#define TURBO_SIFS_TIME 8 +#define TURBO_PREAMBLE_TIME 14 +#define TURBO_PLCP_BITS 22 +#define TURBO_SYMBOL_TIME 4 + #define WLAN_CTRL_FRAME_SIZE (2+2+6+4) /* ACK+FCS */ #endif /* _ATH_AH_INTERAL_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c Thu Feb 19 04:19:58 2009 (r188772) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c Thu Feb 19 04:24:22 2009 (r188773) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_phy.c,v 1.5 2008/11/15 03:43:53 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -27,6 +27,8 @@ #define OFDM IEEE80211_T_OFDM #define CCK IEEE80211_T_CCK #define TURBO IEEE80211_T_TURBO +#define HALF IEEE80211_T_OFDM_HALF +#define QUART IEEE80211_T_OFDM_QUARTER HAL_RATE_TABLE ar5212_11a_table = { 8, /* number of rates */ @@ -51,14 +53,14 @@ HAL_RATE_TABLE ar5212_half_table = { { /* short ctrl */ /* valid rateCode Preamble dot11Rate Rate */ -/* 6 Mb */ { AH_TRUE, OFDM, 3000, 0x0b, 0x00, (0x80|6), 0 }, -/* 9 Mb */ { AH_TRUE, OFDM, 4500, 0x0f, 0x00, 9, 0 }, -/* 12 Mb */ { AH_TRUE, OFDM, 6000, 0x0a, 0x00, (0x80|12), 2 }, -/* 18 Mb */ { AH_TRUE, OFDM, 9000, 0x0e, 0x00, 18, 2 }, -/* 24 Mb */ { AH_TRUE, OFDM, 12000, 0x09, 0x00, (0x80|24), 4 }, -/* 36 Mb */ { AH_TRUE, OFDM, 18000, 0x0d, 0x00, 36, 4 }, -/* 48 Mb */ { AH_TRUE, OFDM, 24000, 0x08, 0x00, 48, 4 }, -/* 54 Mb */ { AH_TRUE, OFDM, 27000, 0x0c, 0x00, 54, 4 } +/* 3 Mb */ { AH_TRUE, HALF, 3000, 0x0b, 0x00, (0x80|6), 0 }, +/* 4.5 Mb */ { AH_TRUE, HALF, 4500, 0x0f, 0x00, 9, 0 }, +/* 6 Mb */ { AH_TRUE, HALF, 6000, 0x0a, 0x00, (0x80|12), 2 }, +/* 9 Mb */ { AH_TRUE, HALF, 9000, 0x0e, 0x00, 18, 2 }, +/* 12 Mb */ { AH_TRUE, HALF, 12000, 0x09, 0x00, (0x80|24), 4 }, +/* 18 Mb */ { AH_TRUE, HALF, 18000, 0x0d, 0x00, 36, 4 }, +/* 24 Mb */ { AH_TRUE, HALF, 24000, 0x08, 0x00, 48, 4 }, +/* 27 Mb */ { AH_TRUE, HALF, 27000, 0x0c, 0x00, 54, 4 } }, }; @@ -68,14 +70,14 @@ HAL_RATE_TABLE ar5212_quarter_table = { { /* short ctrl */ /* valid rateCode Preamble dot11Rate Rate */ -/* 6 Mb */ { AH_TRUE, OFDM, 1500, 0x0b, 0x00, (0x80|3), 0 }, -/* 9 Mb */ { AH_TRUE, OFDM, 2250, 0x0f, 0x00, 4, 0 }, -/* 12 Mb */ { AH_TRUE, OFDM, 3000, 0x0a, 0x00, (0x80|6), 2 }, -/* 18 Mb */ { AH_TRUE, OFDM, 4500, 0x0e, 0x00, 9, 2 }, -/* 24 Mb */ { AH_TRUE, OFDM, 6000, 0x09, 0x00, (0x80|12), 4 }, -/* 36 Mb */ { AH_TRUE, OFDM, 9000, 0x0d, 0x00, 18, 4 }, -/* 48 Mb */ { AH_TRUE, OFDM, 12000, 0x08, 0x00, 24, 4 }, -/* 54 Mb */ { AH_TRUE, OFDM, 13500, 0x0c, 0x00, 27, 4 } +/* 1.5 Mb */ { AH_TRUE, QUART, 1500, 0x0b, 0x00, (0x80|3), 0 }, +/* 2 Mb */ { AH_TRUE, QUART, 2250, 0x0f, 0x00, 4, 0 }, +/* 3 Mb */ { AH_TRUE, QUART, 3000, 0x0a, 0x00, (0x80|6), 2 }, +/* 4.5 Mb */ { AH_TRUE, QUART, 4500, 0x0e, 0x00, 9, 2 }, +/* 6 Mb */ { AH_TRUE, QUART, 6000, 0x09, 0x00, (0x80|12), 4 }, +/* 9 Mb */ { AH_TRUE, QUART, 9000, 0x0d, 0x00, 18, 4 }, +/* 12 Mb */ { AH_TRUE, QUART, 12000, 0x08, 0x00, 24, 4 }, +/*13.5 Mb */ { AH_TRUE, QUART, 13500, 0x0c, 0x00, 27, 4 } }, }; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:33:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF013106566B; Thu, 19 Feb 2009 04:33:36 +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 C321C8FC0C; Thu, 19 Feb 2009 04:33:36 +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 n1J4XaT5084118; Thu, 19 Feb 2009 04:33:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4Xasg084116; Thu, 19 Feb 2009 04:33:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190433.n1J4Xasg084116@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:33: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: r188774 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:33:37 -0000 Author: sam Date: Thu Feb 19 04:33:36 2009 New Revision: 188774 URL: http://svn.freebsd.org/changeset/base/188774 Log: instead of special casing lookups for the 11na/g legacy rate set, just install the rates once when creating the com structure Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu Feb 19 04:24:22 2009 (r188773) +++ head/sys/net80211/ieee80211.c Thu Feb 19 04:33:36 2009 (r188774) @@ -185,6 +185,8 @@ ieee80211_chan_init(struct ieee80211com DEFAULTRATES(IEEE80211_MODE_TURBO_A, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_TURBO_G, ieee80211_rateset_11g); DEFAULTRATES(IEEE80211_MODE_STURBO_A, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_11NA, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); /* * Set auto mode to reset active channel state and any desired channel. @@ -1011,12 +1013,7 @@ ieee80211_get_suprates(struct ieee80211c return &ieee80211_rateset_half; if (IEEE80211_IS_CHAN_QUARTER(c)) return &ieee80211_rateset_quarter; - if (IEEE80211_IS_CHAN_HTA(c)) - return &ic->ic_sup_rates[IEEE80211_MODE_11A]; - if (IEEE80211_IS_CHAN_HTG(c)) { - /* XXX does this work for basic rates? */ - return &ic->ic_sup_rates[IEEE80211_MODE_11G]; - } + /* XXX does this work for 11ng basic rates? */ return &ic->ic_sup_rates[ieee80211_chan2mode(c)]; } Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 04:24:22 2009 (r188773) +++ head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 04:33:36 2009 (r188774) @@ -2121,8 +2121,7 @@ ieee80211_ioctl_settxparams(struct ieee8 continue; src = &parms.params[i]; dst = &vap->iv_txparms[i]; - rs = &ic->ic_sup_rates[i == IEEE80211_MODE_11NA ? - IEEE80211_MODE_11A : IEEE80211_MODE_11G]; + rs = &ic->ic_sup_rates[i]; if (src->ucastrate != dst->ucastrate) { if (!checkmcs(src->ucastrate) && !checkrate(rs, src->ucastrate)) From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:34:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D9561065672; Thu, 19 Feb 2009 04:34:23 +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 EFBF98FC17; Thu, 19 Feb 2009 04:34:22 +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 n1J4YMQB084173; Thu, 19 Feb 2009 04:34:22 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4YMHI084172; Thu, 19 Feb 2009 04:34:22 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190434.n1J4YMHI084172@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:34: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: r188775 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:34:23 -0000 Author: sam Date: Thu Feb 19 04:34:22 2009 New Revision: 188775 URL: http://svn.freebsd.org/changeset/base/188775 Log: check ptr against NULL Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu Feb 19 04:33:36 2009 (r188774) +++ head/sys/net80211/ieee80211.c Thu Feb 19 04:34:22 2009 (r188775) @@ -1442,7 +1442,7 @@ ieee80211_rate2media(struct ieee80211com return findmedia(rates, N(rates), rate | IFM_IEEE80211_FH); case IEEE80211_MODE_AUTO: /* NB: ic may be NULL for some drivers */ - if (ic && ic->ic_phytype == IEEE80211_T_FH) + if (ic != NULL && ic->ic_phytype == IEEE80211_T_FH) return findmedia(rates, N(rates), rate | IFM_IEEE80211_FH); /* NB: hack, 11g matches both 11b+11a rates */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:37:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8151065673; Thu, 19 Feb 2009 04:37:44 +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 89BE88FC15; Thu, 19 Feb 2009 04:37:44 +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 n1J4biD8084266; Thu, 19 Feb 2009 04:37:44 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4bixJ084265; Thu, 19 Feb 2009 04:37:44 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190437.n1J4bixJ084265@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:37: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: r188776 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:37:45 -0000 Author: sam Date: Thu Feb 19 04:37:44 2009 New Revision: 188776 URL: http://svn.freebsd.org/changeset/base/188776 Log: simplify setting up the roaming parameters; writing default parameters only for active modes hasn't turned out to be useful so just define a const table and copy it in place Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Feb 19 04:34:22 2009 (r188775) +++ head/sys/net80211/ieee80211_scan.c Thu Feb 19 04:37:44 2009 (r188776) @@ -73,16 +73,18 @@ struct scan_state { /* * Roaming-related defaults. RSSI thresholds are as returned by the - * driver (dBm). Transmit rate thresholds are IEEE rate codes (i.e + * driver (.5dBm). Transmit rate thresholds are IEEE rate codes (i.e * .5M units) or MCS. */ -#define ROAM_RSSI_11A_DEFAULT 14 /* rssi threshold for 11a bss */ -#define ROAM_RSSI_11B_DEFAULT 14 /* rssi threshold for 11b bss */ -#define ROAM_RSSI_11BONLY_DEFAULT 14 /* rssi threshold for 11b-only bss */ -#define ROAM_RATE_11A_DEFAULT 2*12 /* tx rate thresh for 11a bss */ -#define ROAM_RATE_11B_DEFAULT 2*5 /* tx rate thresh for 11b bss */ -#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* tx rate thresh for 11b-only bss */ -#define ROAM_MCS_11N_DEFAULT 1 /* tx MCS thresh for 11n bss*/ +/* rssi thresholds */ +#define ROAM_RSSI_11A_DEFAULT 14 /* 11a bss */ +#define ROAM_RSSI_11B_DEFAULT 14 /* 11b bss */ +#define ROAM_RSSI_11BONLY_DEFAULT 14 /* 11b-only bss */ +/* transmit rate thresholds */ +#define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */ +#define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */ +#define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */ +#define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ static void scan_restart_pwrsav(void *); static void scan_curchan(struct ieee80211_scan_state *, unsigned long); @@ -126,50 +128,34 @@ ieee80211_scan_detach(struct ieee80211co } } -static __inline void -setparams(struct ieee80211_roamparam *rp, int8_t rssi, uint8_t txrate) -{ - rp->rssi = rssi; - rp->rate = txrate; -} +static const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX] = { + [IEEE80211_MODE_11A] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_11G] = { .rssi = ROAM_RSSI_11B_DEFAULT, + .rate = ROAM_RATE_11B_DEFAULT }, + [IEEE80211_MODE_11B] = { .rssi = ROAM_RSSI_11BONLY_DEFAULT, + .rate = ROAM_RATE_11BONLY_DEFAULT }, + [IEEE80211_MODE_TURBO_A]= { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_TURBO_G]= { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_STURBO_A]={ .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_11NA] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_MCS_11N_DEFAULT }, + [IEEE80211_MODE_11NG] = { .rssi = ROAM_RSSI_11B_DEFAULT, + .rate = ROAM_MCS_11N_DEFAULT }, +}; void ieee80211_scan_vattach(struct ieee80211vap *vap) { - struct ieee80211com *ic = vap->iv_ic; - vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz; vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz; vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz; vap->iv_roaming = IEEE80211_ROAMING_AUTO; - - /* NB: only set supported modes so user apps can identify */ - if (isset(ic->ic_modecaps, IEEE80211_MODE_11A)) - setparams(&vap->iv_roamparms[IEEE80211_MODE_11A], - ROAM_RSSI_11A_DEFAULT, ROAM_RATE_11A_DEFAULT); - if (isset(ic->ic_modecaps, IEEE80211_MODE_11G)) - setparams(&vap->iv_roamparms[IEEE80211_MODE_11G], - ROAM_RSSI_11B_DEFAULT, ROAM_RATE_11B_DEFAULT); - if (isset(ic->ic_modecaps, IEEE80211_MODE_11B)) - setparams(&vap->iv_roamparms[IEEE80211_MODE_11B], - ROAM_RSSI_11BONLY_DEFAULT, ROAM_RATE_11BONLY_DEFAULT); - /* NB: default turbo controls to be the same as !turbo */ - if (isset(ic->ic_modecaps, IEEE80211_MODE_TURBO_A)) - vap->iv_roamparms[IEEE80211_MODE_TURBO_A] = - vap->iv_roamparms[IEEE80211_MODE_11A]; - if (isset(ic->ic_modecaps, IEEE80211_MODE_TURBO_G)) - vap->iv_roamparms[IEEE80211_MODE_TURBO_G] = - vap->iv_roamparms[IEEE80211_MODE_11G]; - if (isset(ic->ic_modecaps, IEEE80211_MODE_STURBO_A)) - vap->iv_roamparms[IEEE80211_MODE_STURBO_A] = - vap->iv_roamparms[IEEE80211_MODE_11A]; - if (isset(ic->ic_modecaps, IEEE80211_MODE_11NA)) - setparams(&vap->iv_roamparms[IEEE80211_MODE_11NA], - ROAM_RSSI_11A_DEFAULT, ROAM_MCS_11N_DEFAULT | 0x80); - if (isset(ic->ic_modecaps, IEEE80211_MODE_11NG)) - setparams(&vap->iv_roamparms[IEEE80211_MODE_11NG], - ROAM_RSSI_11B_DEFAULT, ROAM_MCS_11N_DEFAULT | 0x80); + memcpy(vap->iv_roamparms, defroam, sizeof(defroam)); } void From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:40:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54C28106566C; Thu, 19 Feb 2009 04:40:48 +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 434468FC18; Thu, 19 Feb 2009 04:40:48 +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 n1J4emhK084360; Thu, 19 Feb 2009 04:40:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4emHO084359; Thu, 19 Feb 2009 04:40:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190440.n1J4emHO084359@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04: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: r188777 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:40:48 -0000 Author: sam Date: Thu Feb 19 04:40:47 2009 New Revision: 188777 URL: http://svn.freebsd.org/changeset/base/188777 Log: use c99 initializer Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu Feb 19 04:37:44 2009 (r188776) +++ head/sys/net80211/ieee80211_scan_sta.c Thu Feb 19 04:40:47 2009 (r188777) @@ -405,17 +405,20 @@ find11gchannel(struct ieee80211com *ic, } return NULL; } + static const u_int chanflags[IEEE80211_MODE_MAX] = { - IEEE80211_CHAN_B, /* IEEE80211_MODE_AUTO */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ - IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ - IEEE80211_CHAN_G, /* IEEE80211_MODE_11G */ - IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_TURBO_A (check base channel)*/ - IEEE80211_CHAN_G, /* IEEE80211_MODE_TURBO_G */ - IEEE80211_CHAN_ST, /* IEEE80211_MODE_STURBO_A */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_11NA (check legacy) */ - IEEE80211_CHAN_G, /* IEEE80211_MODE_11NG (check legacy) */ + [IEEE80211_MODE_AUTO] = IEEE80211_CHAN_B, + [IEEE80211_MODE_11A] = IEEE80211_CHAN_A, + [IEEE80211_MODE_11B] = IEEE80211_CHAN_B, + [IEEE80211_MODE_11G] = IEEE80211_CHAN_G, + [IEEE80211_MODE_FH] = IEEE80211_CHAN_FHSS, + /* check base channel */ + [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_A, + [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_G, + [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_ST, + /* check legacy */ + [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, + [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, }; static void From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:44:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5B03106566B; Thu, 19 Feb 2009 04:44:18 +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 C417F8FC08; Thu, 19 Feb 2009 04:44:18 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J4iIoL084468; Thu, 19 Feb 2009 04:44:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4iIBd084467; Thu, 19 Feb 2009 04:44:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190444.n1J4iIBd084467@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:44: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: r188778 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:44:19 -0000 Author: sam Date: Thu Feb 19 04:44:18 2009 New Revision: 188778 URL: http://svn.freebsd.org/changeset/base/188778 Log: Change country ie construction to simplify forthcoming changes: o use c99 initializer for skipflags o calculate band flags instead of statically listing them in the table Modified: head/sys/net80211/ieee80211_regdomain.c Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Thu Feb 19 04:40:47 2009 (r188777) +++ head/sys/net80211/ieee80211_regdomain.c Thu Feb 19 04:44:18 2009 (r188778) @@ -216,17 +216,19 @@ ieee80211_alloc_countryie(struct ieee802 /* XXX what about auto? */ /* flag set of channels to be excluded */ static const int skipflags[IEEE80211_MODE_MAX] = { - CHAN_UNINTERESTING, /* MODE_AUTO */ - CHAN_UNINTERESTING | IEEE80211_CHAN_2GHZ, /* MODE_11A */ - CHAN_UNINTERESTING | IEEE80211_CHAN_5GHZ, /* MODE_11B */ - CHAN_UNINTERESTING | IEEE80211_CHAN_5GHZ, /* MODE_11G */ - CHAN_UNINTERESTING | IEEE80211_CHAN_OFDM | /* MODE_FH */ - IEEE80211_CHAN_CCK | IEEE80211_CHAN_DYN, - CHAN_UNINTERESTING | IEEE80211_CHAN_2GHZ, /* MODE_TURBO_A */ - CHAN_UNINTERESTING | IEEE80211_CHAN_5GHZ, /* MODE_TURBO_G */ - CHAN_UNINTERESTING | IEEE80211_CHAN_2GHZ, /* MODE_STURBO_A */ - CHAN_UNINTERESTING | IEEE80211_CHAN_2GHZ, /* MODE_11NA */ - CHAN_UNINTERESTING | IEEE80211_CHAN_5GHZ, /* MODE_11NG */ + [IEEE80211_MODE_AUTO] = CHAN_UNINTERESTING, + [IEEE80211_MODE_11A] = CHAN_UNINTERESTING, + [IEEE80211_MODE_11B] = CHAN_UNINTERESTING, + [IEEE80211_MODE_11G] = CHAN_UNINTERESTING, + [IEEE80211_MODE_FH] = CHAN_UNINTERESTING + | IEEE80211_CHAN_OFDM + | IEEE80211_CHAN_CCK + | IEEE80211_CHAN_DYN, + [IEEE80211_MODE_TURBO_A] = CHAN_UNINTERESTING, + [IEEE80211_MODE_TURBO_G] = CHAN_UNINTERESTING, + [IEEE80211_MODE_STURBO_A] = CHAN_UNINTERESTING, + [IEEE80211_MODE_11NA] = CHAN_UNINTERESTING, + [IEEE80211_MODE_11NG] = CHAN_UNINTERESTING, }; const struct ieee80211_regdomain *rd = &ic->ic_regdomain; uint8_t nextchan, chans[IEEE80211_CHAN_BYTES], *frm; @@ -268,6 +270,10 @@ ieee80211_alloc_countryie(struct ieee802 nruns = 0; memset(chans, 0, sizeof(chans)); skip = skipflags[ieee80211_chan2mode(ic->ic_bsschan)]; + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_bsschan)) + skip |= IEEE80211_CHAN_2GHZ; + else if (IEEE80211_IS_CHAN_2GHZ(ic->ic_bsschan)) + skip |= IEEE80211_CHAN_5GHZ; for (i = 0; i < ic->ic_nchans; i++) { const struct ieee80211_channel *c = &ic->ic_channels[i]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:46:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092D4106564A; Thu, 19 Feb 2009 04:46:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBF348FC16; Thu, 19 Feb 2009 04:46:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J4k9mx084541; Thu, 19 Feb 2009 04:46:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4k9lB084540; Thu, 19 Feb 2009 04:46:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190446.n1J4k9lB084540@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04:46: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: r188779 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:46:10 -0000 Author: sam Date: Thu Feb 19 04:46:09 2009 New Revision: 188779 URL: http://svn.freebsd.org/changeset/base/188779 Log: o consolidate loops to eliminate assumptions about ordering of modes o replace 0x80 by IEEE80211_RATE_MCS Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Feb 19 04:44:18 2009 (r188778) +++ head/sys/net80211/ieee80211_proto.c Thu Feb 19 04:46:09 2009 (r188779) @@ -182,22 +182,19 @@ ieee80211_proto_vattach(struct ieee80211 * max retry count. These settings can be changed by the * driver and/or user applications. */ - for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_11NA; i++) { + for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; - /* NB: we default to min supported rate for channel */ - vap->iv_txparms[i].mgmtrate = - rs->rs_rates[0] & IEEE80211_RATE_VAL; - vap->iv_txparms[i].mcastrate = - rs->rs_rates[0] & IEEE80211_RATE_VAL; - vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT; - } - for (; i < IEEE80211_MODE_MAX; i++) { - vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; - /* NB: default to MCS 0 */ - vap->iv_txparms[i].mgmtrate = 0 | 0x80; - vap->iv_txparms[i].mcastrate = 0 | 0x80; + if (i == IEEE80211_MODE_11NA || i == IEEE80211_MODE_11NG) { + vap->iv_txparms[i].mgmtrate = 0 | IEEE80211_RATE_MCS; + vap->iv_txparms[i].mcastrate = 0 | IEEE80211_RATE_MCS; + } else { + vap->iv_txparms[i].mgmtrate = + rs->rs_rates[0] & IEEE80211_RATE_VAL; + vap->iv_txparms[i].mcastrate = + rs->rs_rates[0] & IEEE80211_RATE_VAL; + } vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT; } vap->iv_roaming = IEEE80211_ROAMING_AUTO; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 04:52:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDEF106564A; Thu, 19 Feb 2009 04:52:03 +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 A925B8FC08; Thu, 19 Feb 2009 04:52:03 +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 n1J4q33X084734; Thu, 19 Feb 2009 04:52:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J4q3hF084732; Thu, 19 Feb 2009 04:52:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190452.n1J4q3hF084732@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 04: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: r188780 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 04:52:04 -0000 Author: sam Date: Thu Feb 19 04:52:03 2009 New Revision: 188780 URL: http://svn.freebsd.org/changeset/base/188780 Log: use c99 initializers Modified: head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 04:46:09 2009 (r188779) +++ head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 04:52:03 2009 (r188780) @@ -1758,17 +1758,17 @@ static struct ieee80211_channel * findchannel(struct ieee80211com *ic, int ieee, int mode) { static const u_int chanflags[IEEE80211_MODE_MAX] = { - 0, /* IEEE80211_MODE_AUTO */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */ - IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */ - IEEE80211_CHAN_G, /* IEEE80211_MODE_11G */ - IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */ - IEEE80211_CHAN_108A, /* IEEE80211_MODE_TURBO_A */ - IEEE80211_CHAN_108G, /* IEEE80211_MODE_TURBO_G */ - IEEE80211_CHAN_STURBO, /* IEEE80211_MODE_STURBO_A */ - /* NB: handled specially below */ - IEEE80211_CHAN_A, /* IEEE80211_MODE_11NA */ - IEEE80211_CHAN_G, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = 0, + [IEEE80211_MODE_11A] = IEEE80211_CHAN_A, + [IEEE80211_MODE_11B] = IEEE80211_CHAN_B, + [IEEE80211_MODE_11G] = IEEE80211_CHAN_G, + [IEEE80211_MODE_FH] = IEEE80211_CHAN_FHSS, + [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_108A, + [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_108G, + [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_STURBO, + /* NB: handled specially below */ + [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, + [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, }; u_int modeflags; int i; Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Feb 19 04:46:09 2009 (r188779) +++ head/sys/net80211/ieee80211_proto.c Thu Feb 19 04:52:03 2009 (r188780) @@ -655,16 +655,16 @@ setbasicrates(struct ieee80211_rateset * enum ieee80211_phymode mode, int add) { static const struct ieee80211_rateset basic[IEEE80211_MODE_MAX] = { - { .rs_nrates = 0 }, /* IEEE80211_MODE_AUTO */ - { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11A */ - { 2, { 2, 4 } }, /* IEEE80211_MODE_11B */ - { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11G (mixed b/g) */ - { .rs_nrates = 0 }, /* IEEE80211_MODE_FH */ - { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_TURBO_A */ - { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */ - { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_STURBO_A */ - { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11NA */ - { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11NG (mixed b/g) */ + [IEEE80211_MODE_11A] = { 3, { 12, 24, 48 } }, + [IEEE80211_MODE_11B] = { 2, { 2, 4 } }, + /* NB: mixed b/g */ + [IEEE80211_MODE_11G] = { 4, { 2, 4, 11, 22 } }, + [IEEE80211_MODE_TURBO_A] = { 3, { 12, 24, 48 } }, + [IEEE80211_MODE_TURBO_G] = { 4, { 2, 4, 11, 22 } }, + [IEEE80211_MODE_STURBO_A] = { 3, { 12, 24, 48 } }, + [IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } }, + /* NB: mixed b/g */ + [IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } }, }; int i, j; @@ -717,89 +717,89 @@ typedef struct phyParamType { } paramType; static const struct phyParamType phyParamForAC_BE[IEEE80211_MODE_MAX] = { - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_AUTO */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11A */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11B */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11G */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_FH */ - { 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11NA */ - { 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_11A] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_11B] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_11G] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_FH] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_TURBO_A]= { 2, 3, 5, 0, 0 }, + [IEEE80211_MODE_TURBO_G]= { 2, 3, 5, 0, 0 }, + [IEEE80211_MODE_STURBO_A]={ 2, 3, 5, 0, 0 }, + [IEEE80211_MODE_11NA] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_11NG] = { 3, 4, 6, 0, 0 }, }; static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = { - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_AUTO */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11A */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11B */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11G */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_FH */ - { 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NA */ - { 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_11A] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_11B] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_11G] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_FH] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_TURBO_A]= { 7, 3, 10, 0, 0 }, + [IEEE80211_MODE_TURBO_G]= { 7, 3, 10, 0, 0 }, + [IEEE80211_MODE_STURBO_A]={ 7, 3, 10, 0, 0 }, + [IEEE80211_MODE_11NA] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_11NG] = { 7, 4, 10, 0, 0 }, }; static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = { - { 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_AUTO */ - { 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11A */ - { 1, 3, 4, 188, 0 }, /* IEEE80211_MODE_11B */ - { 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11G */ - { 1, 3, 4, 188, 0 }, /* IEEE80211_MODE_FH */ - { 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NA */ - { 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_11A] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_11B] = { 1, 3, 4, 188, 0 }, + [IEEE80211_MODE_11G] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_FH] = { 1, 3, 4, 188, 0 }, + [IEEE80211_MODE_TURBO_A]= { 1, 2, 3, 94, 0 }, + [IEEE80211_MODE_TURBO_G]= { 1, 2, 3, 94, 0 }, + [IEEE80211_MODE_STURBO_A]={ 1, 2, 3, 94, 0 }, + [IEEE80211_MODE_11NA] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_11NG] = { 1, 3, 4, 94, 0 }, }; static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = { - { 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_AUTO */ - { 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11A */ - { 1, 2, 3, 102, 0 }, /* IEEE80211_MODE_11B */ - { 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11G */ - { 1, 2, 3, 102, 0 }, /* IEEE80211_MODE_FH */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NA */ - { 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_11A] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_11B] = { 1, 2, 3, 102, 0 }, + [IEEE80211_MODE_11G] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_FH] = { 1, 2, 3, 102, 0 }, + [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_11NA] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_11NG] = { 1, 2, 3, 47, 0 }, }; static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = { - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_AUTO */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11A */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11B */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11G */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_FH */ - { 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NA */ - { 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_11A] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_11B] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_11G] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_FH] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_TURBO_A]= { 2, 3, 10, 0, 0 }, + [IEEE80211_MODE_TURBO_G]= { 2, 3, 10, 0, 0 }, + [IEEE80211_MODE_STURBO_A]={ 2, 3, 10, 0, 0 }, + [IEEE80211_MODE_11NA] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_11NG] = { 3, 4, 10, 0, 0 }, }; static const struct phyParamType bssPhyParamForAC_VI[IEEE80211_MODE_MAX] = { - { 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_AUTO */ - { 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11A */ - { 2, 3, 4, 188, 0 }, /* IEEE80211_MODE_11B */ - { 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11G */ - { 2, 3, 4, 188, 0 }, /* IEEE80211_MODE_FH */ - { 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NA */ - { 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_11A] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_11B] = { 2, 3, 4, 188, 0 }, + [IEEE80211_MODE_11G] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_FH] = { 2, 3, 4, 188, 0 }, + [IEEE80211_MODE_TURBO_A]= { 2, 2, 3, 94, 0 }, + [IEEE80211_MODE_TURBO_G]= { 2, 2, 3, 94, 0 }, + [IEEE80211_MODE_STURBO_A]={ 2, 2, 3, 94, 0 }, + [IEEE80211_MODE_11NA] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_11NG] = { 2, 3, 4, 94, 0 }, }; static const struct phyParamType bssPhyParamForAC_VO[IEEE80211_MODE_MAX] = { - { 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_AUTO */ - { 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11A */ - { 2, 2, 3, 102, 0 }, /* IEEE80211_MODE_11B */ - { 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11G */ - { 2, 2, 3, 102, 0 }, /* IEEE80211_MODE_FH */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NA */ - { 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NG */ + [IEEE80211_MODE_AUTO] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_11A] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_11B] = { 2, 2, 3, 102, 0 }, + [IEEE80211_MODE_11G] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_FH] = { 2, 2, 3, 102, 0 }, + [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_11NA] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_11NG] = { 2, 2, 3, 47, 0 }, }; static void @@ -922,16 +922,16 @@ void ieee80211_wme_updateparams_locked(struct ieee80211vap *vap) { static const paramType phyParam[IEEE80211_MODE_MAX] = { - { 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_AUTO */ - { 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11A */ - { 2, 5, 10, 64, 0 }, /* IEEE80211_MODE_11B */ - { 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11G */ - { 2, 5, 10, 64, 0 }, /* IEEE80211_MODE_FH */ - { 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_TURBO_A */ - { 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_TURBO_G */ - { 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_STURBO_A */ - { 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11NA */ /*XXXcheck*/ - { 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11NG */ /*XXXcheck*/ + [IEEE80211_MODE_AUTO] = { 2, 4, 10, 64, 0 }, + [IEEE80211_MODE_11A] = { 2, 4, 10, 64, 0 }, + [IEEE80211_MODE_11B] = { 2, 5, 10, 64, 0 }, + [IEEE80211_MODE_11G] = { 2, 4, 10, 64, 0 }, + [IEEE80211_MODE_FH] = { 2, 5, 10, 64, 0 }, + [IEEE80211_MODE_TURBO_A] = { 1, 3, 10, 64, 0 }, + [IEEE80211_MODE_TURBO_G] = { 1, 3, 10, 64, 0 }, + [IEEE80211_MODE_STURBO_A] = { 1, 3, 10, 64, 0 }, + [IEEE80211_MODE_11NA] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ + [IEEE80211_MODE_11NG] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ }; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_wme_state *wme = &ic->ic_wme; @@ -1007,17 +1007,17 @@ ieee80211_wme_updateparams_locked(struct /* XXX multi-bss */ if (vap->iv_opmode == IEEE80211_M_HOSTAP && ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) { - static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { - 3, /* IEEE80211_MODE_AUTO */ - 3, /* IEEE80211_MODE_11A */ - 4, /* IEEE80211_MODE_11B */ - 3, /* IEEE80211_MODE_11G */ - 4, /* IEEE80211_MODE_FH */ - 3, /* IEEE80211_MODE_TURBO_A */ - 3, /* IEEE80211_MODE_TURBO_G */ - 3, /* IEEE80211_MODE_STURBO_A */ - 3, /* IEEE80211_MODE_11NA */ - 3, /* IEEE80211_MODE_11NG */ + static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { + [IEEE80211_MODE_AUTO] = 3, + [IEEE80211_MODE_11A] = 3, + [IEEE80211_MODE_11B] = 4, + [IEEE80211_MODE_11G] = 3, + [IEEE80211_MODE_FH] = 4, + [IEEE80211_MODE_TURBO_A] = 3, + [IEEE80211_MODE_TURBO_G] = 3, + [IEEE80211_MODE_STURBO_A] = 3, + [IEEE80211_MODE_11NA] = 3, + [IEEE80211_MODE_11NG] = 3, }; chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 05:03:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0621065670; Thu, 19 Feb 2009 05:03:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A05E8FC0A; Thu, 19 Feb 2009 05:03:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J53B3U084979; Thu, 19 Feb 2009 05:03:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J53BrE084978; Thu, 19 Feb 2009 05:03:11 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190503.n1J53BrE084978@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:03: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: r188781 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:03:11 -0000 Author: sam Date: Thu Feb 19 05:03:10 2009 New Revision: 188781 URL: http://svn.freebsd.org/changeset/base/188781 Log: o looseen abi dependencies on IEEE80211_MODE_MAX by accepting smaller parameters for IEEE80211_IOC_ROAM and IEEE80211_IOC_TXPARAMS; this lets us add more modes and still have old apps work o consolidate loops to remote assumptions about mode ordering Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 04:52:03 2009 (r188780) +++ head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 05:03:10 2009 (r188781) @@ -675,19 +675,22 @@ static __noinline int ieee80211_ioctl_getroam(struct ieee80211vap *vap, const struct ieee80211req *ireq) { - if (ireq->i_len != sizeof(vap->iv_roamparms)) - return EINVAL; - return copyout(vap->iv_roamparms, ireq->i_data, - sizeof(vap->iv_roamparms)); + size_t len = ireq->i_len; + /* NB: accept short requests for backwards compat */ + if (len > sizeof(vap->iv_roamparms)) + len = sizeof(vap->iv_roamparms); + return copyout(vap->iv_roamparms, ireq->i_data, len); } static __noinline int ieee80211_ioctl_gettxparams(struct ieee80211vap *vap, const struct ieee80211req *ireq) { - if (ireq->i_len != sizeof(vap->iv_txparms)) - return EINVAL; - return copyout(vap->iv_txparms, ireq->i_data, sizeof(vap->iv_txparms)); + size_t len = ireq->i_len; + /* NB: accept short requests for backwards compat */ + if (len > sizeof(vap->iv_txparms)) + len = sizeof(vap->iv_txparms); + return copyout(vap->iv_txparms, ireq->i_data, len); } static __noinline int @@ -2082,61 +2085,40 @@ ieee80211_ioctl_settxparams(struct ieee8 struct ieee80211_txparams_req parms; /* XXX stack use? */ struct ieee80211_txparam *src, *dst; const struct ieee80211_rateset *rs; - int error, i, changed; + int error, mode, changed, is11n, nmodes; - if (ireq->i_len != sizeof(parms)) + /* NB: accept short requests for backwards compat */ + if (ireq->i_len > sizeof(parms)) return EINVAL; - error = copyin(ireq->i_data, &parms, sizeof(parms)); + error = copyin(ireq->i_data, &parms, ireq->i_len); if (error != 0) return error; + nmodes = ireq->i_len / sizeof(struct ieee80211_txparam); changed = 0; /* validate parameters and check if anything changed */ - for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_11NA; i++) { - if (isclr(ic->ic_modecaps, i)) - continue; - src = &parms.params[i]; - dst = &vap->iv_txparms[i]; - rs = &ic->ic_sup_rates[i]; - if (src->ucastrate != dst->ucastrate) { - if (!checkrate(rs, src->ucastrate)) - return EINVAL; - changed++; - } - if (src->mcastrate != dst->mcastrate) { - if (!checkrate(rs, src->mcastrate)) - return EINVAL; - changed++; - } - if (src->mgmtrate != dst->mgmtrate) { - if (!checkrate(rs, src->mgmtrate)) - return EINVAL; - changed++; - } - if (src->maxretry != dst->maxretry) /* NB: no bounds */ - changed++; - } - /* 11n parameters are handled differently */ - for (; i < IEEE80211_MODE_MAX; i++) { - if (isclr(ic->ic_modecaps, i)) + for (mode = IEEE80211_MODE_11A; mode < nmodes; mode++) { + if (isclr(ic->ic_modecaps, mode)) continue; - src = &parms.params[i]; - dst = &vap->iv_txparms[i]; - rs = &ic->ic_sup_rates[i]; + src = &parms.params[mode]; + dst = &vap->iv_txparms[mode]; + rs = &ic->ic_sup_rates[mode]; /* NB: 11n maps to legacy */ + is11n = (mode == IEEE80211_MODE_11NA || + mode == IEEE80211_MODE_11NG); if (src->ucastrate != dst->ucastrate) { - if (!checkmcs(src->ucastrate) && - !checkrate(rs, src->ucastrate)) + if (!checkrate(rs, src->ucastrate) && + (!is11n || !checkmcs(src->ucastrate))) return EINVAL; changed++; } if (src->mcastrate != dst->mcastrate) { - if (!checkmcs(src->mcastrate) && - !checkrate(rs, src->mcastrate)) + if (!checkrate(rs, src->mcastrate) && + (!is11n || !checkmcs(src->mcastrate))) return EINVAL; changed++; } if (src->mgmtrate != dst->mgmtrate) { - if (!checkmcs(src->mgmtrate) && - !checkrate(rs, src->mgmtrate)) + if (!checkrate(rs, src->mgmtrate) && + (!is11n || !checkmcs(src->mgmtrate))) return EINVAL; changed++; } @@ -2148,9 +2130,9 @@ ieee80211_ioctl_settxparams(struct ieee8 * Copy new parameters in place and notify the * driver so it can push state to the device. */ - for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { - if (isset(ic->ic_modecaps, i)) - vap->iv_txparms[i] = parms.params[i]; + for (mode = IEEE80211_MODE_11A; mode < nmodes; mode++) { + if (isset(ic->ic_modecaps, mode)) + vap->iv_txparms[mode] = parms.params[mode]; } /* XXX could be more intelligent, e.g. don't reset if setting not being used */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 05:21:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2BB2106566B; Thu, 19 Feb 2009 05:21:55 +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 8FE208FC12; Thu, 19 Feb 2009 05:21:55 +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 n1J5LtXm085333; Thu, 19 Feb 2009 05:21:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J5Ls0f085324; Thu, 19 Feb 2009 05:21:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190521.n1J5Ls0f085324@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:21: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: r188782 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:21:56 -0000 Author: sam Date: Thu Feb 19 05:21:54 2009 New Revision: 188782 URL: http://svn.freebsd.org/changeset/base/188782 Log: Add modes for 1/2 and 1/4-width channels so we have separate roaming and xmit parameters. This makes it possible to use tdma on fractional channels. o add IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER; note these are band-agnostic (may need revisiting) o setup all default rates in ic_sup_rates instead of doing it only for active modes; we need these to calculate the default tx parameters which are not recalculated after a regulatory update (can't just recalculate after installing a new channel list because we might clobber user settings) o remove special case code in ieee80211_get_suprates; this is now a candidate for an inline or removal o add various entries for new modes (roaming+tx params, wme, rate mapping, scan set setup, country ie construction, tdma, basic rates) Note these modes are intentionally not visible through if_media. Modified: head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_tdma.c Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/_ieee80211.h Thu Feb 19 05:21:54 2009 (r188782) @@ -66,8 +66,10 @@ enum ieee80211_phymode { IEEE80211_MODE_STURBO_A = 7, /* 5GHz, OFDM, 2x clock, static */ IEEE80211_MODE_11NA = 8, /* 5GHz, w/ HT */ IEEE80211_MODE_11NG = 9, /* 2GHz, w/ HT */ + IEEE80211_MODE_HALF = 10, /* OFDM, 1/2x clock */ + IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ }; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_11NG+1) +#define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) /* * Operating mode. Devices do not necessarily support Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211.c Thu Feb 19 05:21:54 2009 (r188782) @@ -58,6 +58,8 @@ const char *ieee80211_phymode_name[IEEE8 [IEEE80211_MODE_TURBO_A] = "turboA", [IEEE80211_MODE_TURBO_G] = "turboG", [IEEE80211_MODE_STURBO_A] = "sturboA", + [IEEE80211_MODE_HALF] = "half", + [IEEE80211_MODE_QUARTER] = "quarter", [IEEE80211_MODE_11NA] = "11na", [IEEE80211_MODE_11NG] = "11ng", }; @@ -112,7 +114,7 @@ static void ieee80211_chan_init(struct ieee80211com *ic) { #define DEFAULTRATES(m, def) do { \ - if (isset(ic->ic_modecaps, m) && ic->ic_sup_rates[m].rs_nrates == 0) \ + if (ic->ic_sup_rates[m].rs_nrates == 0) \ ic->ic_sup_rates[m] = def; \ } while (0) struct ieee80211_channel *c; @@ -159,6 +161,10 @@ ieee80211_chan_init(struct ieee80211com setbit(ic->ic_modecaps, IEEE80211_MODE_TURBO_G); if (IEEE80211_IS_CHAN_ST(c)) setbit(ic->ic_modecaps, IEEE80211_MODE_STURBO_A); + if (IEEE80211_IS_CHAN_HALF(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_HALF); + if (IEEE80211_IS_CHAN_QUARTER(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_QUARTER); if (IEEE80211_IS_CHAN_HTA(c)) setbit(ic->ic_modecaps, IEEE80211_MODE_11NA); if (IEEE80211_IS_CHAN_HTG(c)) @@ -185,6 +191,8 @@ ieee80211_chan_init(struct ieee80211com DEFAULTRATES(IEEE80211_MODE_TURBO_A, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_TURBO_G, ieee80211_rateset_11g); DEFAULTRATES(IEEE80211_MODE_STURBO_A, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_HALF, ieee80211_rateset_half); + DEFAULTRATES(IEEE80211_MODE_QUARTER, ieee80211_rateset_quarter); DEFAULTRATES(IEEE80211_MODE_11NA, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); @@ -867,6 +875,8 @@ addmedia(struct ifmedia *media, int caps [IEEE80211_MODE_TURBO_A] = IFM_IEEE80211_11A|IFM_IEEE80211_TURBO, [IEEE80211_MODE_TURBO_G] = IFM_IEEE80211_11G|IFM_IEEE80211_TURBO, [IEEE80211_MODE_STURBO_A] = IFM_IEEE80211_11A|IFM_IEEE80211_TURBO, + [IEEE80211_MODE_HALF] = IFM_IEEE80211_11A, /* XXX */ + [IEEE80211_MODE_QUARTER] = IFM_IEEE80211_11A, /* XXX */ [IEEE80211_MODE_11NA] = IFM_IEEE80211_11NA, [IEEE80211_MODE_11NG] = IFM_IEEE80211_11NG, }; @@ -955,7 +965,7 @@ ieee80211_media_setup(struct ieee80211co * use a "placeholder" media subtype and any fixed MCS * must be specified with a different mechanism. */ - for (; mode < IEEE80211_MODE_MAX; mode++) { + for (; mode <= IEEE80211_MODE_11NG; mode++) { if (isclr(ic->ic_modecaps, mode)) continue; addmedia(media, caps, addsta, mode, IFM_AUTO); @@ -1006,13 +1016,10 @@ ieee80211_media_init(struct ieee80211com /* XXX need to propagate new media settings to vap's */ } +/* XXX inline or eliminate? */ const struct ieee80211_rateset * ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel *c) { - if (IEEE80211_IS_CHAN_HALF(c)) - return &ieee80211_rateset_half; - if (IEEE80211_IS_CHAN_QUARTER(c)) - return &ieee80211_rateset_quarter; /* XXX does this work for 11ng basic rates? */ return &ic->ic_sup_rates[ieee80211_chan2mode(c)]; } @@ -1317,6 +1324,10 @@ ieee80211_chan2mode(const struct ieee802 return IEEE80211_MODE_STURBO_A; else if (IEEE80211_IS_CHAN_TURBO(chan)) return IEEE80211_MODE_TURBO_A; + else if (IEEE80211_IS_CHAN_HALF(chan)) + return IEEE80211_MODE_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + return IEEE80211_MODE_QUARTER; else if (IEEE80211_IS_CHAN_A(chan)) return IEEE80211_MODE_11A; else if (IEEE80211_IS_CHAN_ANYG(chan)) @@ -1432,6 +1443,8 @@ ieee80211_rate2media(struct ieee80211com rate &= IEEE80211_RATE_VAL; switch (mode) { case IEEE80211_MODE_11A: + case IEEE80211_MODE_HALF: /* XXX good 'nuf */ + case IEEE80211_MODE_QUARTER: case IEEE80211_MODE_11NA: case IEEE80211_MODE_TURBO_A: case IEEE80211_MODE_STURBO_A: Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_ioctl.c Thu Feb 19 05:21:54 2009 (r188782) @@ -1769,6 +1769,8 @@ findchannel(struct ieee80211com *ic, int [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_108A, [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_108G, [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_STURBO, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_HALF, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_QUARTER, /* NB: handled specially below */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_node.c Thu Feb 19 05:21:54 2009 (r188782) @@ -237,6 +237,10 @@ node_setuptxparms(struct ieee80211_node /* NB: 108A/108G should be handled as 11a/11g respectively */ if (IEEE80211_IS_CHAN_ST(ni->ni_chan)) mode = IEEE80211_MODE_STURBO_A; + else if (IEEE80211_IS_CHAN_HALF(ni->ni_chan)) + mode = IEEE80211_MODE_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(ni->ni_chan)) + mode = IEEE80211_MODE_QUARTER; else if (IEEE80211_IS_CHAN_A(ni->ni_chan)) mode = IEEE80211_MODE_11A; else if (ni->ni_flags & IEEE80211_NODE_ERP) Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_proto.c Thu Feb 19 05:21:54 2009 (r188782) @@ -662,6 +662,8 @@ setbasicrates(struct ieee80211_rateset * [IEEE80211_MODE_TURBO_A] = { 3, { 12, 24, 48 } }, [IEEE80211_MODE_TURBO_G] = { 4, { 2, 4, 11, 22 } }, [IEEE80211_MODE_STURBO_A] = { 3, { 12, 24, 48 } }, + [IEEE80211_MODE_HALF] = { 3, { 6, 12, 24 } }, + [IEEE80211_MODE_QUARTER] = { 3, { 3, 6, 12 } }, [IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } }, /* NB: mixed b/g */ [IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } }, @@ -725,6 +727,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_TURBO_A]= { 2, 3, 5, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 3, 5, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 3, 5, 0, 0 }, + [IEEE80211_MODE_HALF] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NA] = { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NG] = { 3, 4, 6, 0, 0 }, }; @@ -737,6 +741,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_TURBO_A]= { 7, 3, 10, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 7, 3, 10, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 7, 3, 10, 0, 0 }, + [IEEE80211_MODE_HALF] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NA] = { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NG] = { 7, 4, 10, 0, 0 }, }; @@ -749,6 +755,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_TURBO_A]= { 1, 2, 3, 94, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 3, 94, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 3, 94, 0 }, + [IEEE80211_MODE_HALF] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_QUARTER]= { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NA] = { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NG] = { 1, 3, 4, 94, 0 }, }; @@ -761,6 +769,8 @@ static const struct phyParamType phyPara [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_HALF] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_QUARTER]= { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NA] = { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NG] = { 1, 2, 3, 47, 0 }, }; @@ -774,6 +784,8 @@ static const struct phyParamType bssPhyP [IEEE80211_MODE_TURBO_A]= { 2, 3, 10, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 3, 10, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 3, 10, 0, 0 }, + [IEEE80211_MODE_HALF] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 3, 4, 10, 0, 0 }, [IEEE80211_MODE_11NA] = { 3, 4, 10, 0, 0 }, [IEEE80211_MODE_11NG] = { 3, 4, 10, 0, 0 }, }; @@ -786,6 +798,8 @@ static const struct phyParamType bssPhyP [IEEE80211_MODE_TURBO_A]= { 2, 2, 3, 94, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 2, 3, 94, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 2, 3, 94, 0 }, + [IEEE80211_MODE_HALF] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_QUARTER]= { 2, 3, 4, 94, 0 }, [IEEE80211_MODE_11NA] = { 2, 3, 4, 94, 0 }, [IEEE80211_MODE_11NG] = { 2, 3, 4, 94, 0 }, }; @@ -798,6 +812,8 @@ static const struct phyParamType bssPhyP [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_HALF] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_QUARTER]= { 2, 2, 3, 47, 0 }, [IEEE80211_MODE_11NA] = { 2, 2, 3, 47, 0 }, [IEEE80211_MODE_11NG] = { 2, 2, 3, 47, 0 }, }; @@ -930,6 +946,8 @@ ieee80211_wme_updateparams_locked(struct [IEEE80211_MODE_TURBO_A] = { 1, 3, 10, 64, 0 }, [IEEE80211_MODE_TURBO_G] = { 1, 3, 10, 64, 0 }, [IEEE80211_MODE_STURBO_A] = { 1, 3, 10, 64, 0 }, + [IEEE80211_MODE_HALF] = { 2, 4, 10, 64, 0 }, + [IEEE80211_MODE_QUARTER] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11NA] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ [IEEE80211_MODE_11NG] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ }; @@ -1016,6 +1034,8 @@ ieee80211_wme_updateparams_locked(struct [IEEE80211_MODE_TURBO_A] = 3, [IEEE80211_MODE_TURBO_G] = 3, [IEEE80211_MODE_STURBO_A] = 3, + [IEEE80211_MODE_HALF] = 3, + [IEEE80211_MODE_QUARTER] = 3, [IEEE80211_MODE_11NA] = 3, [IEEE80211_MODE_11NG] = 3, }; Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_regdomain.c Thu Feb 19 05:21:54 2009 (r188782) @@ -214,7 +214,7 @@ ieee80211_alloc_countryie(struct ieee802 (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO | \ IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER) /* XXX what about auto? */ - /* flag set of channels to be excluded */ + /* flag set of channels to be excluded (band added below) */ static const int skipflags[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = CHAN_UNINTERESTING, [IEEE80211_MODE_11A] = CHAN_UNINTERESTING, @@ -227,6 +227,10 @@ ieee80211_alloc_countryie(struct ieee802 [IEEE80211_MODE_TURBO_A] = CHAN_UNINTERESTING, [IEEE80211_MODE_TURBO_G] = CHAN_UNINTERESTING, [IEEE80211_MODE_STURBO_A] = CHAN_UNINTERESTING, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_TURBO + | IEEE80211_CHAN_STURBO, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_TURBO + | IEEE80211_CHAN_STURBO, [IEEE80211_MODE_11NA] = CHAN_UNINTERESTING, [IEEE80211_MODE_11NG] = CHAN_UNINTERESTING, }; Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_scan.c Thu Feb 19 05:21:54 2009 (r188782) @@ -84,6 +84,8 @@ struct scan_state { #define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */ #define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */ #define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */ +#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ +#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ #define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ static void scan_restart_pwrsav(void *); @@ -141,6 +143,10 @@ static const struct ieee80211_roamparam .rate = ROAM_RATE_11A_DEFAULT }, [IEEE80211_MODE_STURBO_A]={ .rssi = ROAM_RSSI_11A_DEFAULT, .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_HALF] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_HALF_DEFAULT }, + [IEEE80211_MODE_QUARTER]= { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_QUARTER_DEFAULT }, [IEEE80211_MODE_11NA] = { .rssi = ROAM_RSSI_11A_DEFAULT, .rate = ROAM_MCS_11N_DEFAULT }, [IEEE80211_MODE_11NG] = { .rssi = ROAM_RSSI_11B_DEFAULT, Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_scan_sta.c Thu Feb 19 05:21:54 2009 (r188782) @@ -416,6 +416,8 @@ static const u_int chanflags[IEEE80211_M [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_A, [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_G, [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_ST, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_HALF, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_QUARTER, /* check legacy */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, Modified: head/sys/net80211/ieee80211_tdma.c ============================================================================== --- head/sys/net80211/ieee80211_tdma.c Thu Feb 19 05:03:10 2009 (r188781) +++ head/sys/net80211/ieee80211_tdma.c Thu Feb 19 05:21:54 2009 (r188782) @@ -82,6 +82,12 @@ __FBSDID("$FreeBSD$"); #ifndef TDMA_TXRATE_STURBO_A_DEFAULT #define TDMA_TXRATE_STURBO_A_DEFAULT 2*24 #endif +#ifndef TDMA_TXRATE_HALF_DEFAULT +#define TDMA_TXRATE_HALF_DEFAULT 2*12 +#endif +#ifndef TDMA_TXRATE_QUARTER_DEFAULT +#define TDMA_TXRATE_QUARTER_DEFAULT 2*6 +#endif #ifndef TDMA_TXRATE_11NA_DEFAULT #define TDMA_TXRATE_11NA_DEFAULT (4 | IEEE80211_RATE_MCS) #endif @@ -148,6 +154,8 @@ ieee80211_tdma_vattach(struct ieee80211v settxparms(vap, IEEE80211_MODE_STURBO_A, TDMA_TXRATE_STURBO_A_DEFAULT); settxparms(vap, IEEE80211_MODE_11NA, TDMA_TXRATE_11NA_DEFAULT); settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT); + settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT); + settxparms(vap, IEEE80211_MODE_QUARTER, TDMA_TXRATE_QUARTER_DEFAULT); setackpolicy(vap->iv_ic, 1); /* disable ACK's */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 05:22:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260B2106564A; Thu, 19 Feb 2009 05:22:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14FE48FC1C; Thu, 19 Feb 2009 05:22:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J5MeH2085396; Thu, 19 Feb 2009 05:22:40 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J5MeGR085393; Thu, 19 Feb 2009 05:22:40 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190522.n1J5MeGR085393@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:22: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: r188783 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:22:41 -0000 Author: sam Date: Thu Feb 19 05:22:40 2009 New Revision: 188783 URL: http://svn.freebsd.org/changeset/base/188783 Log: remove private support for IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER now that net80211 has them Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Feb 19 05:21:54 2009 (r188782) +++ head/sys/dev/ath/if_ath.c Thu Feb 19 05:22:40 2009 (r188783) @@ -5641,12 +5641,7 @@ ath_chan_change(struct ath_softc *sc, st * Change channels and update the h/w rate map * if we're switching; e.g. 11a to 11b/g. */ - if (IEEE80211_IS_CHAN_HALF(chan)) - mode = IEEE80211_MODE_HALF; - else if (IEEE80211_IS_CHAN_QUARTER(chan)) - mode = IEEE80211_MODE_QUARTER; - else - mode = ieee80211_chan2mode(chan); + mode = ieee80211_chan2mode(chan); if (mode != sc->sc_curmode) ath_setcurmode(sc, mode); sc->sc_curchan = chan; Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Feb 19 05:21:54 2009 (r188782) +++ head/sys/dev/ath/if_athvar.h Thu Feb 19 05:22:40 2009 (r188783) @@ -259,9 +259,7 @@ struct ath_softc { uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ -#define IEEE80211_MODE_HALF (IEEE80211_MODE_MAX+0) -#define IEEE80211_MODE_QUARTER (IEEE80211_MODE_MAX+1) - const HAL_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX+2]; + const HAL_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX]; const HAL_RATE_TABLE *sc_currates; /* current rate table */ enum ieee80211_phymode sc_curmode; /* current phy mode */ HAL_OPMODE sc_opmode; /* current operating mode */ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 05:28:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0A8A106566B; Thu, 19 Feb 2009 05:28:03 +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 AE2988FC12; Thu, 19 Feb 2009 05:28:03 +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 n1J5S3wI085525; Thu, 19 Feb 2009 05:28:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J5S30e085524; Thu, 19 Feb 2009 05:28:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190528.n1J5S30e085524@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188784 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:28:04 -0000 Author: sam Date: Thu Feb 19 05:28:03 2009 New Revision: 188784 URL: http://svn.freebsd.org/changeset/base/188784 Log: Fixup handling of roaming and xmit parameters to support 1/2 and 1/4-width channel modes: o usurp 'h' mode flag for half-width channels o add 'q' mode flag for quarter-width channels o rewrite rate parameter parsing to handle fractional values o merge mode loops to eliminate ordering assumptions o replace 0x80 with IEEE80211_RATE_MCS Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Thu Feb 19 05:22:40 2009 (r188783) +++ head/sbin/ifconfig/ifieee80211.c Thu Feb 19 05:28:03 2009 (r188784) @@ -126,9 +126,19 @@ static void LINE_INIT(char c); static void LINE_BREAK(void); static void LINE_CHECK(const char *fmt, ...); -static const char *modename[] = { - "auto", "11a", "11b", "11g", "fh", "turboA", "turboG", - "sturbo", "11na", "11ng" +static const char *modename[IEEE80211_MODE_MAX] = { + [IEEE80211_MODE_AUTO] = "auto", + [IEEE80211_MODE_11A] = "11a", + [IEEE80211_MODE_11B] = "11b", + [IEEE80211_MODE_11G] = "11g", + [IEEE80211_MODE_FH] = "fh", + [IEEE80211_MODE_TURBO_A] = "turboA", + [IEEE80211_MODE_TURBO_G] = "turboG", + [IEEE80211_MODE_STURBO_A] = "sturbo", + [IEEE80211_MODE_11NA] = "11na", + [IEEE80211_MODE_11NG] = "11ng", + [IEEE80211_MODE_HALF] = "half", + [IEEE80211_MODE_QUARTER] = "quarter" }; static void set80211(int s, int type, int val, int len, void *data); @@ -357,6 +367,10 @@ chan2mode(const struct ieee80211_channel return IEEE80211_MODE_STURBO_A; if (IEEE80211_IS_CHAN_FHSS(c)) return IEEE80211_MODE_FH; + if (IEEE80211_IS_CHAN_HALF(c)) + return IEEE80211_MODE_HALF; + if (IEEE80211_IS_CHAN_QUARTER(c)) + return IEEE80211_MODE_QUARTER; if (IEEE80211_IS_CHAN_A(c)) return IEEE80211_MODE_11A; if (IEEE80211_IS_CHAN_ANYG(c)) @@ -1303,7 +1317,6 @@ getmodeflags(const char *val) case 'g': /* 802.11g */ flags |= IEEE80211_CHAN_G; break; - case 'h': /* ht = 802.11n */ case 'n': /* 802.11n */ flags |= IEEE80211_CHAN_HT; break; @@ -1318,6 +1331,12 @@ getmodeflags(const char *val) case 's': /* st = Atheros Static Turbo */ flags |= IEEE80211_CHAN_STURBO; break; + case 'h': /* 1/2-width channels */ + flags |= IEEE80211_CHAN_HALF; + break; + case 'q': /* 1/4-width channels */ + flags |= IEEE80211_CHAN_QUARTER; + break; default: errx(-1, "%s: Invalid mode attribute %c\n", val, *cp); @@ -1357,6 +1376,10 @@ getmodeflags(const char *val) _base.params[IEEE80211_MODE_11G]._param = _v; \ if ((_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) \ _base.params[IEEE80211_MODE_11B]._param = _v; \ + if (_flags & IEEE80211_CHAN_HALF) \ + _base.params[IEEE80211_MODE_HALF]._param = _v; \ + if (_flags & IEEE80211_CHAN_QUARTER) \ + _base.params[IEEE80211_MODE_QUARTER]._param = _v; \ } while (0) #define _APPLY1(_flags, _base, _param, _v) do { \ if (_flags & IEEE80211_CHAN_HT) { \ @@ -1370,6 +1393,10 @@ getmodeflags(const char *val) _base.params[IEEE80211_MODE_TURBO_G]._param = _v; \ else if ((_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST) \ _base.params[IEEE80211_MODE_STURBO_A]._param = _v; \ + else if (_flags & IEEE80211_CHAN_HALF) \ + _base.params[IEEE80211_MODE_HALF]._param = _v; \ + else if (_flags & IEEE80211_CHAN_QUARTER) \ + _base.params[IEEE80211_MODE_QUARTER]._param = _v; \ else if ((_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) \ _base.params[IEEE80211_MODE_11A]._param = _v; \ else if ((_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) \ @@ -1379,50 +1406,15 @@ getmodeflags(const char *val) } while (0) #define _APPLY_RATE(_flags, _base, _param, _v) do { \ if (_flags & IEEE80211_CHAN_HT) { \ - if ((_flags & (IEEE80211_CHAN_5GHZ|IEEE80211_CHAN_2GHZ)) == 0) {\ - _base.params[IEEE80211_MODE_11NA]._param = _v|0x80; \ - _base.params[IEEE80211_MODE_11NG]._param = _v|0x80; \ - } else if (_flags & IEEE80211_CHAN_5GHZ) \ - _base.params[IEEE80211_MODE_11NA]._param = _v|0x80; \ - else \ - _base.params[IEEE80211_MODE_11NG]._param = _v|0x80; \ + (_v) = (_v / 2) | IEEE80211_RATE_MCS; \ } \ - if (_flags & IEEE80211_CHAN_TURBO) { \ - if ((_flags & (IEEE80211_CHAN_5GHZ|IEEE80211_CHAN_2GHZ)) == 0) {\ - _base.params[IEEE80211_MODE_TURBO_A]._param = 2*_v; \ - _base.params[IEEE80211_MODE_TURBO_G]._param = 2*_v; \ - } else if (_flags & IEEE80211_CHAN_5GHZ) \ - _base.params[IEEE80211_MODE_TURBO_A]._param = 2*_v; \ - else \ - _base.params[IEEE80211_MODE_TURBO_G]._param = 2*_v; \ - } \ - if (_flags & IEEE80211_CHAN_STURBO) \ - _base.params[IEEE80211_MODE_STURBO_A]._param = 2*_v; \ - if ((_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) \ - _base.params[IEEE80211_MODE_11A]._param = 2*_v; \ - if ((_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) \ - _base.params[IEEE80211_MODE_11G]._param = (_v == 5 ? 11 : 2*_v);\ - if ((_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) \ - _base.params[IEEE80211_MODE_11B]._param = (_v == 5 ? 11 : 2*_v);\ + _APPLY(_flags, _base, _param, _v); \ } while (0) #define _APPLY_RATE1(_flags, _base, _param, _v) do { \ if (_flags & IEEE80211_CHAN_HT) { \ - if (_flags & IEEE80211_CHAN_5GHZ) \ - _base.params[IEEE80211_MODE_11NA]._param = _v|0x80; \ - else \ - _base.params[IEEE80211_MODE_11NG]._param = _v|0x80; \ - } else if ((_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A) \ - _base.params[IEEE80211_MODE_TURBO_A]._param = 2*_v; \ - else if ((_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) \ - _base.params[IEEE80211_MODE_TURBO_G]._param = 2*_v; \ - else if ((_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST) \ - _base.params[IEEE80211_MODE_STURBO_A]._param = 2*_v; \ - else if ((_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) \ - _base.params[IEEE80211_MODE_11A]._param = 2*_v; \ - else if ((_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) \ - _base.params[IEEE80211_MODE_11G]._param = (_v == 5 ? 11 : 2*_v);\ - else if ((_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) \ - _base.params[IEEE80211_MODE_11B]._param = (_v == 5 ? 11 : 2*_v);\ + (_v) = (_v / 2) | IEEE80211_RATE_MCS; \ + } \ + _APPLY1(_flags, _base, _param, _v); \ } while (0) static @@ -1444,55 +1436,70 @@ DECL_CMD_FUNC(set80211roamrssi, val, d) callback_register(setroam_cb, &roamparams); } +static int +getrate(const char *val, const char *tag) +{ + double v = atof(val); + int rate; + + rate = (int) (2*v); + if (rate != 2*v) + errx(-1, "invalid %s rate (must be .5 Mb/s units)", tag); + return rate; /* NB: returns 2x the specified value */ +} + static DECL_CMD_FUNC(set80211roamrate, val, d) { - int v = atoi(val), flags; + int rate, flags; + rate = getrate(val, "roam"); flags = getmodeflags(val); getroam(s); if (flags == 0) { /* NB: no flags => current channel */ flags = getcurchan(s)->ic_flags; - _APPLY_RATE1(flags, roamparams, rate, v); + _APPLY_RATE1(flags, roamparams, rate, rate); } else - _APPLY_RATE(flags, roamparams, rate, v); + _APPLY_RATE(flags, roamparams, rate, rate); callback_register(setroam_cb, &roamparams); } static DECL_CMD_FUNC(set80211mcastrate, val, d) { - int v = atoi(val), flags; + int rate, flags; + rate = getrate(val, "mcast"); flags = getmodeflags(val); gettxparams(s); if (flags == 0) { /* NB: no flags => current channel */ flags = getcurchan(s)->ic_flags; - _APPLY_RATE1(flags, txparams, mcastrate, v); + _APPLY_RATE1(flags, txparams, mcastrate, rate); } else - _APPLY_RATE(flags, txparams, mcastrate, v); + _APPLY_RATE(flags, txparams, mcastrate, rate); callback_register(settxparams_cb, &txparams); } static DECL_CMD_FUNC(set80211mgtrate, val, d) { - int v = atoi(val), flags; + int rate, flags; + rate = getrate(val, "mgmt"); flags = getmodeflags(val); gettxparams(s); if (flags == 0) { /* NB: no flags => current channel */ flags = getcurchan(s)->ic_flags; - _APPLY_RATE1(flags, txparams, mgmtrate, v); + _APPLY_RATE1(flags, txparams, mgmtrate, rate); } else - _APPLY_RATE(flags, txparams, mgmtrate, v); + _APPLY_RATE(flags, txparams, mgmtrate, rate); callback_register(settxparams_cb, &txparams); } static DECL_CMD_FUNC(set80211ucastrate, val, d) { - int v, flags; + int flags; gettxparams(s); flags = getmodeflags(val); @@ -1505,12 +1512,12 @@ DECL_CMD_FUNC(set80211ucastrate, val, d) _APPLY(flags, txparams, ucastrate, IEEE80211_FIXED_RATE_NONE); } else { - v = atoi(val); + int rate = getrate(val, "ucast"); if (flags == 0) { /* NB: no flags => current channel */ flags = getcurchan(s)->ic_flags; - _APPLY_RATE1(flags, txparams, ucastrate, v); + _APPLY_RATE1(flags, txparams, ucastrate, rate); } else - _APPLY_RATE(flags, txparams, ucastrate, v); + _APPLY_RATE(flags, txparams, ucastrate, rate); } callback_register(settxparams_cb, &txparams); } @@ -3518,27 +3525,27 @@ list_roam(int s) int mode; getroam(s); - for (mode = IEEE80211_MODE_11A; mode < IEEE80211_MODE_11NA; mode++) { - rp = &roamparams.params[mode]; - if (rp->rssi == 0 && rp->rate == 0) - continue; - if (rp->rssi & 1) - LINE_CHECK("roam:%-6.6s rssi %2u.5dBm rate %2u Mb/s", - modename[mode], rp->rssi/2, rp->rate/2); - else - LINE_CHECK("roam:%-6.6s rssi %4udBm rate %2u Mb/s", - modename[mode], rp->rssi/2, rp->rate/2); - } - for (; mode < IEEE80211_MODE_MAX; mode++) { + for (mode = IEEE80211_MODE_11A; mode < IEEE80211_MODE_MAX; mode++) { rp = &roamparams.params[mode]; if (rp->rssi == 0 && rp->rate == 0) continue; - if (rp->rssi & 1) - LINE_CHECK("roam:%-6.6s rssi %2u.5dBm MCS %2u ", - modename[mode], rp->rssi/2, rp->rate &~ 0x80); - else - LINE_CHECK("roam:%-6.6s rssi %4udBm MCS %2u ", - modename[mode], rp->rssi/2, rp->rate &~ 0x80); + if (mode == IEEE80211_MODE_11NA || mode == IEEE80211_MODE_11NG) { + if (rp->rssi & 1) + LINE_CHECK("roam:%-7.7s rssi %2u.5dBm MCS %2u ", + modename[mode], rp->rssi/2, + rp->rate &~ IEEE80211_RATE_MCS); + else + LINE_CHECK("roam:%-7.7s rssi %4udBm MCS %2u ", + modename[mode], rp->rssi/2, + rp->rate &~ IEEE80211_RATE_MCS); + } else { + if (rp->rssi & 1) + LINE_CHECK("roam:%-7.7s rssi %2u.5dBm rate %2u Mb/s", + modename[mode], rp->rssi/2, rp->rate/2); + else + LINE_CHECK("roam:%-7.7s rssi %4udBm rate %2u Mb/s", + modename[mode], rp->rssi/2, rp->rate/2); + } } } @@ -3549,36 +3556,40 @@ list_txparams(int s) int mode; gettxparams(s); - for (mode = IEEE80211_MODE_11A; mode < IEEE80211_MODE_11NA; mode++) { - tp = &txparams.params[mode]; - if (tp->mgmtrate == 0 && tp->mcastrate == 0) - continue; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - LINE_CHECK("%-6.6s ucast NONE mgmt %2u Mb/s " - "mcast %2u Mb/s maxretry %u", - modename[mode], tp->mgmtrate/2, - tp->mcastrate/2, tp->maxretry); - else - LINE_CHECK("%-6.6s ucast %2u Mb/s mgmt %2u Mb/s " - "mcast %2u Mb/s maxretry %u", - modename[mode], tp->ucastrate/2, tp->mgmtrate/2, - tp->mcastrate/2, tp->maxretry); - } - for (; mode < IEEE80211_MODE_MAX; mode++) { + for (mode = IEEE80211_MODE_11A; mode < IEEE80211_MODE_MAX; mode++) { tp = &txparams.params[mode]; if (tp->mgmtrate == 0 && tp->mcastrate == 0) continue; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - LINE_CHECK("%-6.6s ucast NONE mgmt %2u MCS " - "mcast %2u MCS maxretry %u", - modename[mode], tp->mgmtrate &~ 0x80, - tp->mcastrate &~ 0x80, tp->maxretry); - else - LINE_CHECK("%-6.6s ucast %2u MCS mgmt %2u MCS " - "mcast %2u MCS maxretry %u", - modename[mode], tp->ucastrate &~ 0x80, - tp->mgmtrate &~ 0x80, - tp->mcastrate &~ 0x80, tp->maxretry); + if (mode == IEEE80211_MODE_11NA || mode == IEEE80211_MODE_11NG) { + if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) + LINE_CHECK("%-7.7s ucast NONE mgmt %2u MCS " + "mcast %2u MCS maxretry %u", + modename[mode], + tp->mgmtrate &~ IEEE80211_RATE_MCS, + tp->mcastrate &~ IEEE80211_RATE_MCS, + tp->maxretry); + else + LINE_CHECK("%-7.7s ucast %2u MCS mgmt %2u MCS " + "mcast %2u MCS maxretry %u", + modename[mode], + tp->ucastrate &~ IEEE80211_RATE_MCS, + tp->mgmtrate &~ IEEE80211_RATE_MCS, + tp->mcastrate &~ IEEE80211_RATE_MCS, + tp->maxretry); + } else { + if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) + LINE_CHECK("%-7.7s ucast NONE mgmt %2u Mb/s " + "mcast %2u Mb/s maxretry %u", + modename[mode], + tp->mgmtrate/2, + tp->mcastrate/2, tp->maxretry); + else + LINE_CHECK("%-7.7s ucast %2u Mb/s mgmt %2u Mb/s " + "mcast %2u Mb/s maxretry %u", + modename[mode], + tp->ucastrate/2, tp->mgmtrate/2, + tp->mcastrate/2, tp->maxretry); + } } } @@ -3880,14 +3891,16 @@ printkey(const struct ieee80211req_key * static void printrate(const char *tag, int v, int defrate, int defmcs) { - if (v == 11) - LINE_CHECK("%s 5.5", tag); - else if (v & 0x80) { + if ((v & IEEE80211_RATE_MCS) == 0) { + if (v != defrate) { + if (v & 1) + LINE_CHECK("%s %d.5", tag, v/2); + else + LINE_CHECK("%s %d", tag, v/2); + } + } else { if (v != defmcs) LINE_CHECK("%s %d", tag, v &~ 0x80); - } else { - if (v != defrate) - LINE_CHECK("%s %d", tag, v/2); } } @@ -4180,8 +4193,10 @@ end: tp = &txparams.params[chan2mode(c)]; printrate("ucastrate", tp->ucastrate, IEEE80211_FIXED_RATE_NONE, IEEE80211_FIXED_RATE_NONE); - printrate("mcastrate", tp->mcastrate, 2*1, 0x80|0); - printrate("mgmtrate", tp->mgmtrate, 2*1, 0x80|0); + printrate("mcastrate", tp->mcastrate, 2*1, + IEEE80211_RATE_MCS|0); + printrate("mgmtrate", tp->mgmtrate, 2*1, + IEEE80211_RATE_MCS|0); if (tp->maxretry != 6) /* XXX */ LINE_CHECK("maxretry %d", tp->maxretry); } else { From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 05:36:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D63C1065672; Thu, 19 Feb 2009 05:36:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A98B8FC12; Thu, 19 Feb 2009 05:36:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J5a8pg085708; Thu, 19 Feb 2009 05:36:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1J5a8N8085707; Thu, 19 Feb 2009 05:36:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902190536.n1J5a8N8085707@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 05:36: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: r188785 - head/tools/tools/net80211/wlantxtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 05:36:09 -0000 Author: sam Date: Thu Feb 19 05:36:07 2009 New Revision: 188785 URL: http://svn.freebsd.org/changeset/base/188785 Log: revamp after 1/2 and 1/4 rate changes Modified: head/tools/tools/net80211/wlantxtime/wlantxtime.c Modified: head/tools/tools/net80211/wlantxtime/wlantxtime.c ============================================================================== --- head/tools/tools/net80211/wlantxtime/wlantxtime.c Thu Feb 19 05:28:03 2009 (r188784) +++ head/tools/tools/net80211/wlantxtime/wlantxtime.c Thu Feb 19 05:36:07 2009 (r188785) @@ -91,7 +91,9 @@ panic(const char *fmt, ...) #define OFDM IEEE80211_T_OFDM #define CCK IEEE80211_T_CCK #define TURBO IEEE80211_T_TURBO -#define PBCC (IEEE80211_T_HT+1) /* XXX */ +#define HALF IEEE80211_T_OFDM_HALF +#define QUART IEEE80211_T_OFDM_QUARTER +#define PBCC (IEEE80211_T_OFDM_QUARTER+1) /* XXX */ #define B(r) (0x80 | r) #define Mb(x) (x*1000) @@ -149,14 +151,14 @@ static struct ieee80211_rate_table ieee8 .info = { /* short ctrl */ /* Preamble dot11Rate Rate */ - [0] = { .phy = OFDM, 3000, 0x00, B(6), 0 }, - [1] = { .phy = OFDM, 4500, 0x00, 9, 0 }, - [2] = { .phy = OFDM, 6000, 0x00, B(12), 2 }, - [3] = { .phy = OFDM, 9000, 0x00, 18, 2 }, - [4] = { .phy = OFDM, 12000, 0x00, B(24), 4 }, - [5] = { .phy = OFDM, 18000, 0x00, 36, 4 }, - [6] = { .phy = OFDM, 24000, 0x00, 48, 4 }, - [7] = { .phy = OFDM, 27000, 0x00, 54, 4 } + [0] = { .phy = HALF, 3000, 0x00, B(6), 0 }, + [1] = { .phy = HALF, 4500, 0x00, 9, 0 }, + [2] = { .phy = HALF, 6000, 0x00, B(12), 2 }, + [3] = { .phy = HALF, 9000, 0x00, 18, 2 }, + [4] = { .phy = HALF, 12000, 0x00, B(24), 4 }, + [5] = { .phy = HALF, 18000, 0x00, 36, 4 }, + [6] = { .phy = HALF, 24000, 0x00, 48, 4 }, + [7] = { .phy = HALF, 27000, 0x00, 54, 4 } }, }; @@ -165,14 +167,14 @@ static struct ieee80211_rate_table ieee8 .info = { /* short ctrl */ /* Preamble dot11Rate Rate */ - [0] = { .phy = OFDM, 1500, 0x00, B(3), 0 }, - [1] = { .phy = OFDM, 2250, 0x00, 4, 0 }, - [2] = { .phy = OFDM, 3000, 0x00, B(9), 2 }, - [3] = { .phy = OFDM, 4500, 0x00, 9, 2 }, - [4] = { .phy = OFDM, 6000, 0x00, B(12), 4 }, - [5] = { .phy = OFDM, 9000, 0x00, 18, 4 }, - [6] = { .phy = OFDM, 12000, 0x00, 24, 4 }, - [7] = { .phy = OFDM, 13500, 0x00, 27, 4 } + [0] = { .phy = QUART, 1500, 0x00, B(3), 0 }, + [1] = { .phy = QUART, 2250, 0x00, 4, 0 }, + [2] = { .phy = QUART, 3000, 0x00, B(9), 2 }, + [3] = { .phy = QUART, 4500, 0x00, 9, 2 }, + [4] = { .phy = QUART, 6000, 0x00, B(12), 4 }, + [5] = { .phy = QUART, 9000, 0x00, 18, 4 }, + [6] = { .phy = QUART, 12000, 0x00, 24, 4 }, + [7] = { .phy = QUART, 13500, 0x00, 27, 4 } }, }; @@ -292,6 +294,36 @@ ieee80211_phy_init(void) #undef N } +#define CCK_SIFS_TIME 10 +#define CCK_PREAMBLE_BITS 144 +#define CCK_PLCP_BITS 48 + +#define OFDM_SIFS_TIME 16 +#define OFDM_PREAMBLE_TIME 20 +#define OFDM_PLCP_BITS 22 +#define OFDM_SYMBOL_TIME 4 + +#define OFDM_HALF_SIFS_TIME 32 +#define OFDM_HALF_PREAMBLE_TIME 40 +#define OFDM_HALF_PLCP_BITS 22 +#define OFDM_HALF_SYMBOL_TIME 8 + +#define OFDM_QUARTER_SIFS_TIME 64 +#define OFDM_QUARTER_PREAMBLE_TIME 80 +#define OFDM_QUARTER_PLCP_BITS 22 +#define OFDM_QUARTER_SYMBOL_TIME 16 + +#define TURBO_SIFS_TIME 8 +#define TURBO_PREAMBLE_TIME 14 +#define TURBO_PLCP_BITS 22 +#define TURBO_SYMBOL_TIME 4 + +#define HT_L_STF 8 +#define HT_L_LTF 8 +#define HT_L_SIG 4 +#define HT_SIG 8 +#define HT_STF 4 +#define HT_LTF(n) ((n) * 4) /* * Compute the time to transmit a frame of length frameLen bytes @@ -313,9 +345,6 @@ ieee80211_compute_duration(const struct switch (rt->info[rix].phy) { case IEEE80211_T_CCK: -#define CCK_SIFS_TIME 10 -#define CCK_PREAMBLE_BITS 144 -#define CCK_PLCP_BITS 48 phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; if (isShortPreamble && rt->info[rix].shortPreamble) phyTime >>= 1; @@ -323,65 +352,37 @@ ieee80211_compute_duration(const struct txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000)/kbps); break; -#undef CCK_SIFS_TIME -#undef CCK_PREAMBLE_BITS -#undef CCK_PLCP_BITS - case IEEE80211_T_OFDM: -#define OFDM_SIFS_TIME 16 -#define OFDM_PREAMBLE_TIME 20 -#define OFDM_PLCP_BITS 22 -#define OFDM_SYMBOL_TIME 4 + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("full rate bps")); -#define OFDM_SIFS_TIME_HALF 32 -#define OFDM_PREAMBLE_TIME_HALF 40 -#define OFDM_PLCP_BITS_HALF 22 -#define OFDM_SYMBOL_TIME_HALF 8 - -#define OFDM_SIFS_TIME_QUARTER 64 -#define OFDM_PREAMBLE_TIME_QUARTER 80 -#define OFDM_PLCP_BITS_QUARTER 22 -#define OFDM_SYMBOL_TIME_QUARTER 16 - if (rt == &ieee80211_half_table) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; - KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_QUARTER - + OFDM_PREAMBLE_TIME_QUARTER - + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); - } else if (rt == &ieee80211_quarter_table) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; - KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_HALF - + OFDM_PREAMBLE_TIME_HALF - + (numSymbols * OFDM_SYMBOL_TIME_HALF); - } else { /* full rate channel */ - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; - KASSERT(bitsPerSymbol != 0, ("full rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME - + OFDM_PREAMBLE_TIME - + (numSymbols * OFDM_SYMBOL_TIME); - } + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME + + OFDM_PREAMBLE_TIME + + (numSymbols * OFDM_SYMBOL_TIME); + break; + case IEEE80211_T_OFDM_HALF: + bitsPerSymbol = (kbps * OFDM_HALF_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_HALF_SIFS_TIME + + OFDM_HALF_PREAMBLE_TIME + + (numSymbols * OFDM_HALF_SYMBOL_TIME); + break; + case IEEE80211_T_OFDM_QUARTER: + bitsPerSymbol = (kbps * OFDM_QUARTER_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_QUARTER_SIFS_TIME + + OFDM_QUARTER_PREAMBLE_TIME + + (numSymbols * OFDM_QUARTER_SYMBOL_TIME); break; - -#undef OFDM_SIFS_TIME -#undef OFDM_PREAMBLE_TIME -#undef OFDM_PLCP_BITS -#undef OFDM_SYMBOL_TIME - case IEEE80211_T_TURBO: -#define TURBO_SIFS_TIME 8 -#define TURBO_PREAMBLE_TIME 14 -#define TURBO_PLCP_BITS 22 -#define TURBO_SYMBOL_TIME 4 /* we still save OFDM rates in kbps - so double them */ bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000; KASSERT(bitsPerSymbol != 0, ("turbo bps")); @@ -391,11 +392,6 @@ ieee80211_compute_duration(const struct txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME + (numSymbols * TURBO_SYMBOL_TIME); break; -#undef TURBO_SIFS_TIME -#undef TURBO_PREAMBLE_TIME -#undef TURBO_PLCP_BITS -#undef TURBO_SYMBOL_TIME - default: panic("%s: unknown phy %u (rate %u)\n", __func__, rt->info[rix].phy, rate); @@ -404,14 +400,6 @@ ieee80211_compute_duration(const struct return txTime; } -#define OFDM_PLCP_BITS 22 -#define HT_L_STF 8 -#define HT_L_LTF 8 -#define HT_L_SIG 4 -#define HT_SIG 8 -#define HT_STF 4 -#define HT_LTF(n) ((n) * 4) - uint32_t ieee80211_compute_duration_ht(const struct ieee80211_rate_table *rt, uint32_t frameLen, uint16_t rate, From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 09:20:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BC0106564A for ; Thu, 19 Feb 2009 09:20:42 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 29B478FC2B for ; Thu, 19 Feb 2009 09:20:41 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: by yx-out-2324.google.com with SMTP id 31so113757yxl.13 for ; Thu, 19 Feb 2009 01:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2j5R0vAGRepeqmst39zvuFcUVQgwLpQ2soS/2QozbNw=; b=cGIn10xTB1w4DnANIq/Q8FrEkWp0w+aHx5hIhujXidRc/mcoIx+G/i1OFLLadwp2Ew VqYhMNaYeLxhGb556mPxqJOyqn2Q1fScOP8RmUoCwTlwLFmf3y+/nuVd1kLaJBnM+ItB Xm7pLIVVBsTxiryL1y0FAl0nlkHBMSKC71cVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CmRVjZz7PvnsjOnlcEiIcM215VsykcTMpt62A9/b5aSIagx7MmF6hEfU9TvABe1zrO utXVuPjQqX/fQF0lSYH93xJkJTHoOO4XKxWjOcVFQ5FQM3BkybU3tq4jMtir233ouAtC 1Ih0fPF5e1dkrXtkrzUzJZOLc/p78GnyxNYQU= MIME-Version: 1.0 Received: by 10.101.70.15 with SMTP id x15mr767770ank.14.1235033916584; Thu, 19 Feb 2009 00:58:36 -0800 (PST) In-Reply-To: <200902182227.n1IMRkZ5076793@svn.freebsd.org> References: <200902182227.n1IMRkZ5076793@svn.freebsd.org> Date: Thu, 19 Feb 2009 09:58:36 +0100 Message-ID: <4e6cba830902190058ndd6cc9dga02bb8ddd52a7827@mail.gmail.com> From: Giovanni Trematerra To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r188766 - head/usr.sbin/rpc.yppasswdd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 09:20:43 -0000 On Wed, Feb 18, 2009 at 11:27 PM, Warner Losh wrote: > > time_t is a 64-bits int on arm and mips. Before this change, arm was > silently broken. I guess there aren't that many ARM machines running > master YP domain servers. :) > If I'm not wrong, time_t is a 64-bits int on amd64 too. Was amd64 silently broken so far? -- Trematerra Giovanni From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 12:47:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39A3A106571B; Thu, 19 Feb 2009 12:47:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24F0B8FC1F; Thu, 19 Feb 2009 12:47:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JClOSh097370; Thu, 19 Feb 2009 12:47:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JClOsg097363; Thu, 19 Feb 2009 12:47:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902191247.n1JClOsg097363@svn.freebsd.org> From: Alexander Motin Date: Thu, 19 Feb 2009 12:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188812 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 12:47:27 -0000 Author: mav Date: Thu Feb 19 12:47:24 2009 New Revision: 188812 URL: http://svn.freebsd.org/changeset/base/188812 Log: Use channel driver's attach/detach routines instead of ata_attach()/ ata_detach() to implement IOCATAATTACH/IOCATADETACH ioctls. This will permit channel drivers to properly shutdown port hardware on channel detach and init it on attach. Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-card.c head/sys/dev/ata/ata-cbus.c head/sys/dev/ata/ata-isa.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-usb.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-all.c Thu Feb 19 12:47:24 2009 (r188812) @@ -385,30 +385,32 @@ ata_ioctl(struct cdev *dev, u_long cmd, case IOCATAREINIT: if (*value >= devclass_get_maxunit(ata_devclass) || - !(device = devclass_get_device(ata_devclass, *value))) + !(device = devclass_get_device(ata_devclass, *value)) || + !device_is_attached(device)) return ENXIO; error = ata_reinit(device); break; case IOCATAATTACH: if (*value >= devclass_get_maxunit(ata_devclass) || - !(device = devclass_get_device(ata_devclass, *value))) + !(device = devclass_get_device(ata_devclass, *value)) || + !device_is_attached(device)) return ENXIO; - /* XXX SOS should enable channel HW on controller */ - error = ata_attach(device); + error = DEVICE_ATTACH(device); break; case IOCATADETACH: if (*value >= devclass_get_maxunit(ata_devclass) || - !(device = devclass_get_device(ata_devclass, *value))) + !(device = devclass_get_device(ata_devclass, *value)) || + !device_is_attached(device)) return ENXIO; - error = ata_detach(device); - /* XXX SOS should disable channel HW on controller */ + error = DEVICE_DETACH(device); break; case IOCATADEVICES: if (devices->channel >= devclass_get_maxunit(ata_devclass) || - !(device = devclass_get_device(ata_devclass, devices->channel))) + !(device = devclass_get_device(ata_devclass, devices->channel)) || + !device_is_attached(device)) return ENXIO; bzero(devices->name[0], 32); bzero(&devices->params[0], sizeof(struct ata_params)); Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-all.h Thu Feb 19 12:47:24 2009 (r188812) @@ -500,6 +500,7 @@ struct ata_resource { struct ata_channel { device_t dev; /* device handle */ int unit; /* physical channel */ + int attached; /* channel is attached */ struct ata_resource r_io[ATA_MAX_RES];/* I/O resources */ struct resource *r_irq; /* interrupt of this channel */ void *ih; /* interrupt handle */ Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-card.c Thu Feb 19 12:47:24 2009 (r188812) @@ -91,6 +91,10 @@ ata_pccard_attach(device_t dev) struct resource *io, *ctlio; int i, rid, err; + if (ch->attached) + return (0); + ch->attached = 1; + /* allocate the io range to get start and length */ rid = ATA_IOADDR_RID; if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, @@ -142,6 +146,10 @@ ata_pccard_detach(device_t dev) struct ata_channel *ch = device_get_softc(dev); int i; + if (!ch->attached) + return (0); + ch->attached = 0; + ata_detach(dev); if (ch->r_io[ATA_CONTROL].res != ch->r_io[ATA_DATA].res) bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-cbus.c Thu Feb 19 12:47:24 2009 (r188812) @@ -279,6 +279,10 @@ ata_cbuschannel_attach(device_t dev) struct ata_channel *ch = device_get_softc(dev); int i; + if (ch->attached) + return (0); + ch->attached = 1; + ch->unit = (intptr_t)device_get_ivars(dev); /* setup the resource vectors */ for (i = ATA_DATA; i <= ATA_COMMAND; i ++) { @@ -298,6 +302,17 @@ ata_cbuschannel_attach(device_t dev) } static int +ata_cbuschannel_detach(device_t dev) +{ + + if (!ch->attached) + return (0); + ch->attached = 0; + + return ata_detach(dev); +} + +static int ata_cbuschannel_banking(device_t dev, int flags) { struct ata_cbus_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -343,7 +358,7 @@ static device_method_t ata_cbuschannel_m /* device interface */ DEVMETHOD(device_probe, ata_cbuschannel_probe), DEVMETHOD(device_attach, ata_cbuschannel_attach), - DEVMETHOD(device_detach, ata_detach), + DEVMETHOD(device_detach, ata_cbuschannel_detach), DEVMETHOD(device_suspend, ata_suspend), DEVMETHOD(device_resume, ata_resume), Modified: head/sys/dev/ata/ata-isa.c ============================================================================== --- head/sys/dev/ata/ata-isa.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-isa.c Thu Feb 19 12:47:24 2009 (r188812) @@ -103,6 +103,10 @@ ata_isa_attach(device_t dev) u_long tmp; int i, rid; + if (ch->attached) + return (0); + ch->attached = 1; + /* allocate the io port range */ rid = ATA_IOADDR_RID; if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, @@ -146,6 +150,10 @@ ata_isa_detach(device_t dev) struct ata_channel *ch = device_get_softc(dev); int error; + if (!ch->attached) + return (0); + ch->attached = 0; + error = ata_detach(dev); bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-pci.c Thu Feb 19 12:47:24 2009 (r188812) @@ -550,8 +550,9 @@ ata_pcichannel_attach(device_t dev) struct ata_channel *ch = device_get_softc(dev); int error; - /* take care of green memory */ - bzero(ch, sizeof(struct ata_channel)); + if (ch->attached) + return (0); + ch->attached = 1; ch->unit = (intptr_t)device_get_ivars(dev); @@ -565,8 +566,13 @@ static int ata_pcichannel_detach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); int error; + if (!ch->attached) + return (0); + ch->attached = 0; + if ((error = ata_detach(dev))) return error; Modified: head/sys/dev/ata/ata-usb.c ============================================================================== --- head/sys/dev/ata/ata-usb.c Thu Feb 19 08:25:29 2009 (r188811) +++ head/sys/dev/ata/ata-usb.c Thu Feb 19 12:47:24 2009 (r188812) @@ -842,8 +842,9 @@ ata_usbchannel_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - /* take care of green memory */ - bzero(ch, sizeof(struct ata_channel)); + if (ch->attached) + return (0); + ch->attached = 1; /* initialize the softc basics */ ch->dev = dev; @@ -876,6 +877,10 @@ ata_usbchannel_detach(device_t dev) device_t *children; int nchildren, i; + if (!ch->attached) + return (0); + ch->attached = 0; + /* detach & delete all children */ if (!device_get_children(dev, &children, &nchildren)) { for (i = 0; i < nchildren; i++) From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 13:45:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA03106564A; Thu, 19 Feb 2009 13:45:25 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE888FC15; Thu, 19 Feb 2009 13:45:25 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JDjPtL098576; Thu, 19 Feb 2009 13:45:25 GMT (envelope-from mtm@svn.freebsd.org) Received: (from mtm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JDjPZY098575; Thu, 19 Feb 2009 13:45:25 GMT (envelope-from mtm@svn.freebsd.org) Message-Id: <200902191345.n1JDjPZY098575@svn.freebsd.org> From: Mike Makonnen Date: Thu, 19 Feb 2009 13:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188813 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 13:45:26 -0000 Author: mtm Date: Thu Feb 19 13:45:25 2009 New Revision: 188813 URL: http://svn.freebsd.org/changeset/base/188813 Log: o grammar fix o remove mention of libkse Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Feb 19 12:47:24 2009 (r188812) +++ head/share/man/man5/src.conf.5 Thu Feb 19 13:45:25 2009 (r188813) @@ -62,7 +62,7 @@ for a particular build via the .Fl D option of .Xr make 1 -or in environment; see +or in its environment; see .Xr environ 7 . .Pp The values of variables are ignored regardless of their setting; @@ -463,13 +463,10 @@ On amd64, set to not build 32-bit librar runtime linker. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 172498 2007-10-09 17:53:33Z obrien -Set to not build either of the +Set to not build the .Nm libpthread -providing libraries -.Nm ( libthr -(1:1) & -.Nm libkse -(M:N)). +providing library, +.Nm libthr . When set, it also enforces the following options: .Pp .Bl -item -compact From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 14:39:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68CE91065675; Thu, 19 Feb 2009 14:39:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7808FC24; Thu, 19 Feb 2009 14:39:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JEdq29099734; Thu, 19 Feb 2009 14:39:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JEdqRM099733; Thu, 19 Feb 2009 14:39:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902191439.n1JEdqRM099733@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Feb 2009 14:39: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: r188814 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 14:39:53 -0000 Author: avg Date: Thu Feb 19 14:39:52 2009 New Revision: 188814 URL: http://svn.freebsd.org/changeset/base/188814 Log: acpi_cpu: fixup for PIIX4E PCI config related to C2 This is triggered only if BIOS configures ACPI_BITREG_BUS_MASTER_RLD aka BRLD_EN_BM to 1. Rationale: 1. we do not support C3 on PIIX4E 2. bus master activity need not break out of C2 state 3. because of CPU_QUIRK_NO_BM_CTRL quirk we may reset bus master status which would result in immediate break out from C2 So if you have seen cpu0: too many short sleeps, backing off to C1 with this chipset before you may want to try cx_lowest of C2 again. Reviewed by: rpaulo (mentor), njl Approved by: rpaulo (mentor) Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Thu Feb 19 13:45:25 2009 (r188813) +++ head/sys/dev/acpica/acpi_cpu.c Thu Feb 19 14:39:52 2009 (r188814) @@ -1082,6 +1082,10 @@ acpi_cpu_quirks(void) * * Also, make sure that all interrupts cause a "Stop Break" * event to exit from C2 state. + * Also, BRLD_EN_BM (ACPI_BITREG_BUS_MASTER_RLD in ACPI-speak) + * should be set to zero, otherwise it causes C2 to short-sleep. + * PIIX4 doesn't properly support C3 and bus master activity + * need not break out of C2. */ case PCI_REVISION_A_STEP: case PCI_REVISION_B_STEP: @@ -1094,10 +1098,16 @@ acpi_cpu_quirks(void) val = pci_read_config(acpi_dev, PIIX4_DEVACTB_REG, 4); if ((val & PIIX4_STOP_BREAK_MASK) != PIIX4_STOP_BREAK_MASK) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "PIIX4: enabling IRQs to generate Stop Break\n")); + "acpi_cpu: PIIX4: enabling IRQs to generate Stop Break\n")); val |= PIIX4_STOP_BREAK_MASK; pci_write_config(acpi_dev, PIIX4_DEVACTB_REG, val, 4); } + AcpiGetRegister(ACPI_BITREG_BUS_MASTER_RLD, &val); + if (val) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "acpi_cpu: PIIX4: reset BRLD_EN_BM\n")); + AcpiSetRegister(ACPI_BITREG_BUS_MASTER_RLD, 0); + } break; default: break; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 14:43:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A983106566C; Thu, 19 Feb 2009 14:43:13 +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 B16F98FC15; Thu, 19 Feb 2009 14:43:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id E961E46B51; Thu, 19 Feb 2009 09:43:11 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1JEh3lo051774; Thu, 19 Feb 2009 09:43:03 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Giovanni Trematerra Date: Thu, 19 Feb 2009 08:51:36 -0500 User-Agent: KMail/1.9.7 References: <200902182227.n1IMRkZ5076793@svn.freebsd.org> <4e6cba830902190058ndd6cc9dga02bb8ddd52a7827@mail.gmail.com> In-Reply-To: <4e6cba830902190058ndd6cc9dga02bb8ddd52a7827@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902190851.37430.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 19 Feb 2009 09:43:03 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9009/Thu Feb 19 01:22:56 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188766 - head/usr.sbin/rpc.yppasswdd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 14:43:14 -0000 On Thursday 19 February 2009 3:58:36 am Giovanni Trematerra wrote: > On Wed, Feb 18, 2009 at 11:27 PM, Warner Losh wrote: > > > > > time_t is a 64-bits int on arm and mips. Before this change, arm was > > silently broken. I guess there aren't that many ARM machines running > > master YP domain servers. :) > > > > If I'm not wrong, time_t is a 64-bits int on amd64 too. > Was amd64 silently broken so far? On amd64, a long is 64-bits, so sizeof(long) == sizeof(time_t). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 15:05:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1F1106566C; Thu, 19 Feb 2009 15:05:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 943F18FC0C; Thu, 19 Feb 2009 15:05:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JF5U6H000538; Thu, 19 Feb 2009 15:05:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JF5Uqk000537; Thu, 19 Feb 2009 15:05:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902191505.n1JF5Uqk000537@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Feb 2009 15:05: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: r188815 - head/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 15:05:33 -0000 Author: avg Date: Thu Feb 19 15:05:30 2009 New Revision: 188815 URL: http://svn.freebsd.org/changeset/base/188815 Log: fs/udf: fix incorrect error return (-1) when reading a large dir Not enough space in user-land buffer is not an error, userland will read further until eof is reached. So instead of propagating -1 to caller we convert it to zero/success. cd9660 code works exactly the same way. PR: kern/78987 Reviewed by: jhb (mentor) Approved by: jhb (mentor) Modified: head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Thu Feb 19 14:39:52 2009 (r188814) +++ head/sys/fs/udf/udf_vnops.c Thu Feb 19 15:05:30 2009 (r188815) @@ -831,17 +831,16 @@ udf_readdir(struct vop_readdir_args *a) error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); } - if (error) { - printf("uiomove returned %d\n", error); + if (error) break; - } - } /* tell the calling layer whether we need to be called again */ *a->a_eofflag = uiodir.eofflag; uio->uio_offset = ds->offset + ds->off; + if(error < 0) + error = 0; if (!error) error = ds->error; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 15:11:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66638106564A; Thu, 19 Feb 2009 15:11:24 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mxf2.bahnhof.se (mxf2.bahnhof.se [213.80.101.26]) by mx1.freebsd.org (Postfix) with ESMTP id D90E58FC12; Thu, 19 Feb 2009 15:11:23 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from localhost (mxf2.local [127.0.0.1]) by mxf2-reinject (Postfix) with ESMTP id 47EC96BD028; Thu, 19 Feb 2009 16:11:22 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 2.777 X-Spam-Level: ** X-Spam-Status: No, score=2.777 tagged_above=-99 required=5 tests=[DNS_FROM_RFC_POST=1.708, SPF_NEUTRAL=1.069] Received: from mxf2.bahnhof.se ([127.0.0.1]) by localhost (mxf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7J-ZWIRJd4ja; Thu, 19 Feb 2009 16:11:20 +0100 (CET) Received: from [10.0.0.3] (h-85-24-219-30.NA.cust.bahnhof.se [85.24.219.30]) by mxf2.bahnhof.se (Postfix) with ESMTP id B627F6BD055; Thu, 19 Feb 2009 16:11:20 +0100 (CET) Received: from 127.0.0.1 (AVG SMTP 8.0.237 [270.11.0/1959]); Thu, 19 Feb 2009 16:10:52 +0100 Message-ID: <499D767C.7020207@gmail.com> Date: Thu, 19 Feb 2009 16:10:52 +0100 From: Niclas Zeising User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Mike Makonnen References: <200902191345.n1JDjPZY098575@svn.freebsd.org> In-Reply-To: <200902191345.n1JDjPZY098575@svn.freebsd.org> Content-Type: multipart/mixed; boundary="------------020500020505030509030004" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188813 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 15:11:24 -0000 This is a multi-part message in MIME format. --------------020500020505030509030004 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mike Makonnen wrote: > Author: mtm > Date: Thu Feb 19 13:45:25 2009 > New Revision: 188813 > URL: http://svn.freebsd.org/changeset/base/188813 > > Log: > o grammar fix > o remove mention of libkse > > Modified: > head/share/man/man5/src.conf.5 > > Modified: head/share/man/man5/src.conf.5 > ============================================================================== > --- head/share/man/man5/src.conf.5 Thu Feb 19 12:47:24 2009 (r188812) > +++ head/share/man/man5/src.conf.5 Thu Feb 19 13:45:25 2009 (r188813) > @@ -62,7 +62,7 @@ for a particular build via the > .Fl D > option of > .Xr make 1 > -or in environment; see > +or in its environment; see > .Xr environ 7 . > .Pp > The values of variables are ignored regardless of their setting; > @@ -463,13 +463,10 @@ On amd64, set to not build 32-bit librar > runtime linker. > .It Va WITHOUT_LIBPTHREAD > .\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 172498 2007-10-09 17:53:33Z obrien > -Set to not build either of the > +Set to not build the > .Nm libpthread > -providing libraries > -.Nm ( libthr > -(1:1) & > -.Nm libkse > -(M:N)). > +providing library, > +.Nm libthr . > When set, it also enforces the following options: > .Pp > .Bl -item -compact Shouldn't this file be auto-generated from the contents in src/tools/build/options/ and therefore not be edited by hand? You should change the contents of WITHOUT_LIBPTHREAD for the latter change, and makeman for the former change, and then regen by running make makeman. See the attached patch for changes. Regards! //Niclas --------------020500020505030509030004 Content-Type: text/plain; name="src.conf.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="src.conf.patch" SW5kZXg6IHNyYy90b29scy9idWlsZC9vcHRpb25zL1dJVEhPVVRfTElCUFRIUkVBRAo9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09ClJDUyBmaWxlOiAvaG9tZS9uY3ZzL3NyYy90b29scy9idWlsZC9vcHRpb25z L1dJVEhPVVRfTElCUFRIUkVBRCx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4zCmRpZmYgLXUg LWQgLXIxLjMgV0lUSE9VVF9MSUJQVEhSRUFECi0tLSBzcmMvdG9vbHMvYnVpbGQvb3B0aW9u cy9XSVRIT1VUX0xJQlBUSFJFQUQJOSBPY3QgMjAwNyAxNzo1MzozMyAtMDAwMAkxLjMKKysr IHNyYy90b29scy9idWlsZC9vcHRpb25zL1dJVEhPVVRfTElCUFRIUkVBRAkxOSBGZWIgMjAw OSAxNTowNjo1OSAtMDAwMApAQCAtMSw4ICsxLDYgQEAKIC5cIiAkRnJlZUJTRDogc3JjL3Rv b2xzL2J1aWxkL29wdGlvbnMvV0lUSE9VVF9MSUJQVEhSRUFELHYgMS4zIDIwMDcvMTAvMDkg MTc6NTM6MzMgb2JyaWVuIEV4cCAkCi1TZXQgdG8gbm90IGJ1aWxkIGVpdGhlciBvZiB0aGUK K1NldCB0byBub3QgYnVpbGQgdGhlCiAuTm0gbGlicHRocmVhZAotcHJvdmlkaW5nIGxpYnJh cmllcworcHJvdmlkaW5nIGxpYnJhcnkKIC5ObSAoIGxpYnRocgotKDE6MSkgJgotLk5tIGxp YmtzZQotKE06TikpLgorKDE6MSkKSW5kZXg6IHNyYy90b29scy9idWlsZC9vcHRpb25zL21h a2VtYW4KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2hvbWUvbmN2cy9zcmMvdG9vbHMvYnVp bGQvb3B0aW9ucy9tYWtlbWFuLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjgKZGlmZiAtdSAt ZCAtcjEuOCBtYWtlbWFuCi0tLSBzcmMvdG9vbHMvYnVpbGQvb3B0aW9ucy9tYWtlbWFuCTEy IERlYyAyMDA3IDE2OjM5OjMxIC0wMDAwCTEuOAorKysgc3JjL3Rvb2xzL2J1aWxkL29wdGlv bnMvbWFrZW1hbgkxOSBGZWIgMjAwOSAxNTowNjo1OSAtMDAwMApAQCAtMTE4LDcgKzExOCw3 IEBACiAuRmwgRAogb3B0aW9uIG9mCiAuWHIgbWFrZSAxCi1vciBpbiBlbnZpcm9ubWVudDsg c2VlCitvciBpbiBpdHMgZW52aXJvbm1lbnQ7IHNlZQogLlhyIGVudmlyb24gNyAuCiAuUHAK IFRoZSB2YWx1ZXMgb2YgdmFyaWFibGVzIGFyZSBpZ25vcmVkIHJlZ2FyZGxlc3Mgb2YgdGhl aXIgc2V0dGluZzsK --------------020500020505030509030004-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 15:37:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4BFF106566B; Thu, 19 Feb 2009 15:37:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D350F8FC1C; Thu, 19 Feb 2009 15:37:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JFbhXx001191; Thu, 19 Feb 2009 15:37:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JFbht3001190; Thu, 19 Feb 2009 15:37:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200902191537.n1JFbht3001190@svn.freebsd.org> From: Andriy Gapon Date: Thu, 19 Feb 2009 15:37: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: r188816 - head/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 15:37:45 -0000 Author: avg Date: Thu Feb 19 15:37:43 2009 New Revision: 188816 URL: http://svn.freebsd.org/changeset/base/188816 Log: style nit in r188815 Pointed out by: jhb, rpaulo Approved by: jhb (mentor) Modified: head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Thu Feb 19 15:05:30 2009 (r188815) +++ head/sys/fs/udf/udf_vnops.c Thu Feb 19 15:37:43 2009 (r188816) @@ -839,7 +839,7 @@ udf_readdir(struct vop_readdir_args *a) *a->a_eofflag = uiodir.eofflag; uio->uio_offset = ds->offset + ds->off; - if(error < 0) + if (error < 0) error = 0; if (!error) error = ds->error; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 16:01:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05BEA10656CE; Thu, 19 Feb 2009 16:01:01 +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 DD0F08FC1D; Thu, 19 Feb 2009 16:01:00 +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 n1JG10vN001673; Thu, 19 Feb 2009 16:01:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JG10YG001669; Thu, 19 Feb 2009 16:01:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902191601.n1JG10YG001669@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Feb 2009 16:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188817 - in stable/7/sys: . cddl/contrib/opensolaris/uts/common/fs cddl/contrib/opensolaris/uts/common/fs/zfs contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 16:01:02 -0000 Author: kib Date: Thu Feb 19 16:01:00 2009 New Revision: 188817 URL: http://svn.freebsd.org/changeset/base/188817 Log: Unbreak ZFS after the r188610: MFC r182781 (by pjd): Catch up after last insmntque() changes: - The vnode has to be locked exclusively before calling insmntque(). - Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag to force insmntque() to always succeed. MFC r182824 (by pjd): Lock vnode exclusively around insmntque(). MFC r182840 (by pjd): Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer. Tested by: cy, pjd No objections by: pjd Modified: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Thu Feb 19 15:37:43 2009 (r188816) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Thu Feb 19 16:01:00 2009 (r188817) @@ -358,6 +358,7 @@ gfs_file_create(size_t size, vnode_t *pv fp = kmem_zalloc(size, KM_SLEEP); error = getnewvnode("zfs", vfsp, ops, &vp); ASSERT(error == 0); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); vp->v_data = (caddr_t)fp; /* @@ -368,7 +369,9 @@ gfs_file_create(size_t size, vnode_t *pv fp->gfs_size = size; fp->gfs_type = GFS_FILE; + vp->v_vflag |= VV_FORCEINSMQ; error = insmntque(vp, vfsp); + vp->v_vflag &= ~VV_FORCEINSMQ; KASSERT(error == 0, ("insmntque() failed: error %d", error)); /* Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Feb 19 15:37:43 2009 (r188816) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Feb 19 16:01:00 2009 (r188817) @@ -176,6 +176,8 @@ zfsctl_create(zfsvfs_t *zfsvfs) vp->v_vflag &= ~VV_ROOT; zfsvfs->z_ctldir = vp; + + VOP_UNLOCK(vp, 0, curthread); } /* @@ -789,6 +791,7 @@ zfsctl_mknode_snapdir(vnode_t *pvp) mutex_init(&sdp->sd_lock, NULL, MUTEX_DEFAULT, NULL); avl_create(&sdp->sd_snaps, snapentry_compare, sizeof (zfs_snapentry_t), offsetof(zfs_snapentry_t, se_node)); + VOP_UNLOCK(vp, 0, curthread); return (vp); } @@ -862,6 +865,7 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin &zfsctl_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL); zcp = vp->v_data; zcp->zc_id = objset; + VOP_UNLOCK(vp, 0, curthread); return (vp); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Feb 19 15:37:43 2009 (r188816) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Feb 19 16:01:00 2009 (r188817) @@ -1303,12 +1303,6 @@ top: } } out: - - if (error == 0) { - *vpp = ZTOV(zp); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td); - } - if (dl) zfs_dirent_unlock(dl); @@ -1588,8 +1582,6 @@ top: zfs_log_create(zilog, tx, TX_MKDIR, dzp, zp, dirname); dmu_tx_commit(tx); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread); - zfs_dirent_unlock(dl); ZFS_EXIT(zfsvfs); @@ -2773,7 +2765,6 @@ out: if (error == 0) { zfs_log_symlink(zilog, tx, TX_SYMLINK, dzp, zp, name, link); *vpp = ZTOV(zp); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td); } dmu_tx_commit(tx); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Feb 19 15:37:43 2009 (r188816) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Feb 19 16:01:00 2009 (r188817) @@ -113,6 +113,7 @@ zfs_znode_cache_constructor(void *buf, v if (cdrarg != NULL) { error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); ASSERT(error == 0); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); zp->z_vnode = vp; vp->v_data = (caddr_t)zp; vp->v_vnlock->lk_flags |= LK_CANRECURSE; @@ -348,7 +349,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu if (vp == NULL) return (zp); + vp->v_vflag |= VV_FORCEINSMQ; error = insmntque(vp, zfsvfs->z_vfs); + vp->v_vflag &= ~VV_FORCEINSMQ; KASSERT(error == 0, ("insmntque() failed: error %d", error)); vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode); @@ -535,8 +538,10 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, u *zpp = zp; } else { - if (ZTOV(zp) != NULL) + if (ZTOV(zp) != NULL) { ZTOV(zp)->v_count = 0; + VOP_UNLOCK(ZTOV(zp), 0, curthread); + } dmu_buf_rele(dbp, NULL); zfs_znode_free(zp); } @@ -598,14 +603,18 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_ &zp->z_vnode); ASSERT(err == 0); vp = ZTOV(zp); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); vp->v_data = (caddr_t)zp; vp->v_vnlock->lk_flags |= LK_CANRECURSE; vp->v_vnlock->lk_flags &= ~LK_NOSHARE; vp->v_type = IFTOVT((mode_t)zp->z_phys->zp_mode); if (vp->v_type == VDIR) zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */ + vp->v_vflag |= VV_FORCEINSMQ; err = insmntque(vp, zfsvfs->z_vfs); + vp->v_vflag &= ~VV_FORCEINSMQ; KASSERT(err == 0, ("insmntque() failed: error %d", err)); + VOP_UNLOCK(vp, 0, curthread); } mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); @@ -621,6 +630,8 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_ zfs_znode_dmu_init(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); *zpp = zp; + if ((vp = ZTOV(zp)) != NULL) + VOP_UNLOCK(vp, 0, curthread); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 16:15:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04C9A1065695; Thu, 19 Feb 2009 16:15:31 +0000 (UTC) (envelope-from makc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E68D48FC33; Thu, 19 Feb 2009 16:15:30 +0000 (UTC) (envelope-from makc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JGFUns001962; Thu, 19 Feb 2009 16:15:30 GMT (envelope-from makc@svn.freebsd.org) Received: (from makc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JGFUsU001961; Thu, 19 Feb 2009 16:15:30 GMT (envelope-from makc@svn.freebsd.org) Message-Id: <200902191615.n1JGFUsU001961@svn.freebsd.org> From: Max Brazhnikov Date: Thu, 19 Feb 2009 16:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188818 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 16:15:32 -0000 Author: makc (ports committer) Date: Thu Feb 19 16:15:30 2009 New Revision: 188818 URL: http://svn.freebsd.org/changeset/base/188818 Log: Add myself. Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Feb 19 16:01:00 2009 (r188817) +++ head/share/misc/committers-ports.dot Thu Feb 19 16:15:30 2009 (r188818) @@ -108,6 +108,7 @@ lth [label="Lars Thegler\nlth@FreeBSD.or lwhsu [label="Li-Wen Hsu\nlwhsu@FreeBSD.org\n2007/04/03"] lx [label="David Thiel\nlx@FreeBSD.org\n2006/11/29"] maho [label="Maho Nakata\nmaho@FreeBSD.org\n2002/10/17"] +makc [label="Max Brazhnikov\makc@FreeBSD.org\n2008/08/25"] marcus [label="Joe Marcus Clarke\nmarcus@FreeBSD.org\n2002/04/05"] markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2004/02/21"] mat [label="Mathieu Arnold\nmat@FreeBSD.org\n2003/08/15"] @@ -263,6 +264,7 @@ miwi -> amdmi3 miwi -> beat miwi -> farrokhi miwi -> gahr +miwi -> makc miwi -> nox miwi -> tabthorpe miwi -> trasz From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 16:16:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23D41065687; Thu, 19 Feb 2009 16:16:44 +0000 (UTC) (envelope-from makc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A06FA8FC1A; Thu, 19 Feb 2009 16:16:44 +0000 (UTC) (envelope-from makc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JGGiDd002017; Thu, 19 Feb 2009 16:16:44 GMT (envelope-from makc@svn.freebsd.org) Received: (from makc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JGGiWc002016; Thu, 19 Feb 2009 16:16:44 GMT (envelope-from makc@svn.freebsd.org) Message-Id: <200902191616.n1JGGiWc002016@svn.freebsd.org> From: Max Brazhnikov Date: Thu, 19 Feb 2009 16:16: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: r188819 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 16:16:45 -0000 Author: makc (ports committer) Date: Thu Feb 19 16:16:44 2009 New Revision: 188819 URL: http://svn.freebsd.org/changeset/base/188819 Log: Add myself. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 19 16:15:30 2009 (r188818) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 19 16:16:44 2009 (r188819) @@ -210,6 +210,7 @@ 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 08/12 Joe Marcus Clarke born in Lakeland, Florida, United States, 1976 +08/12 Max Brazhnikov born in Leningradskaya, Russia, 1979 08/14 Stefan Esser born in Cologne, Nordrhein-Westfalen, Germany, 1961 08/17 Olivier Houchard born in Nancy, France, 1980 08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 16:30:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F9A51065676; Thu, 19 Feb 2009 16:30:12 +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 F20888FC13; Thu, 19 Feb 2009 16:30:11 +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 n1JGUBeB002371; Thu, 19 Feb 2009 16:30:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JGUBU6002370; Thu, 19 Feb 2009 16:30:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191630.n1JGUBU6002370@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 16:30: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: r188820 - head/usr.sbin/rtadvd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 16:30:13 -0000 Author: imp Date: Thu Feb 19 16:30:11 2009 New Revision: 188820 URL: http://svn.freebsd.org/changeset/base/188820 Log: Properly convert bit value to a bit field. Before we were storing values like 0x80 or 0x40 into a uint8_t foo:1 bitfield. This would result in the bit always being 0. One of these caused a warning for overflow (one that was 0x80), but the other didn't. They were both wrong. This is why I hate code that mixes c struct bitfields and #defines. The rest of the fields accessed by the program should be audited. Modified: head/usr.sbin/rtadvd/rrenum.c Modified: head/usr.sbin/rtadvd/rrenum.c ============================================================================== --- head/usr.sbin/rtadvd/rrenum.c Thu Feb 19 16:16:44 2009 (r188819) +++ head/usr.sbin/rtadvd/rrenum.c Thu Feb 19 16:30:11 2009 (r188820) @@ -176,9 +176,9 @@ do_use_prefix(int len, struct rr_pco_mat irr->irr_u_uselen = rpu->rpu_uselen; irr->irr_u_keeplen = rpu->rpu_keeplen; irr->irr_raf_mask_onlink = - (rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK); + !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK); irr->irr_raf_mask_auto = - (rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO); + !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO); irr->irr_vltime = ntohl(rpu->rpu_vltime); irr->irr_pltime = ntohl(rpu->rpu_pltime); irr->irr_raf_onlink = From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 17:44:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7131E106564A; Thu, 19 Feb 2009 17:44:23 +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 5EA3F8FC15; Thu, 19 Feb 2009 17:44:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JHiNih003789; Thu, 19 Feb 2009 17:44:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JHiNAe003788; Thu, 19 Feb 2009 17:44:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902191744.n1JHiNAe003788@svn.freebsd.org> From: Sam Leffler Date: Thu, 19 Feb 2009 17:44: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: r188821 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:44:23 -0000 Author: sam Date: Thu Feb 19 17:44:23 2009 New Revision: 188821 URL: http://svn.freebsd.org/changeset/base/188821 Log: use 1/2 and 1/4 rate phy types to simplify txtime calculation Modified: head/sys/net80211/ieee80211_phy.c Modified: head/sys/net80211/ieee80211_phy.c ============================================================================== --- head/sys/net80211/ieee80211_phy.c Thu Feb 19 16:30:11 2009 (r188820) +++ head/sys/net80211/ieee80211_phy.c Thu Feb 19 17:44:23 2009 (r188821) @@ -58,7 +58,9 @@ struct ieee80211_ds_plcp_hdr { #define OFDM IEEE80211_T_OFDM #define CCK IEEE80211_T_CCK #define TURBO IEEE80211_T_TURBO -#define PBCC (IEEE80211_T_HT+1) /* XXX */ +#define HALF IEEE80211_T_OFDM_HALF +#define QUART IEEE80211_T_OFDM_QUARTER +#define PBCC (IEEE80211_T_OFDM_QUARTER+1) /* XXX */ #define B(r) (0x80 | r) #define Mb(x) (x*1000) @@ -116,14 +118,14 @@ static struct ieee80211_rate_table ieee8 .info = { /* short ctrl */ /* Preamble dot11Rate Rate */ - [0] = { .phy = OFDM, 3000, 0x00, B(6), 0 }, - [1] = { .phy = OFDM, 4500, 0x00, 9, 0 }, - [2] = { .phy = OFDM, 6000, 0x00, B(12), 2 }, - [3] = { .phy = OFDM, 9000, 0x00, 18, 2 }, - [4] = { .phy = OFDM, 12000, 0x00, B(24), 4 }, - [5] = { .phy = OFDM, 18000, 0x00, 36, 4 }, - [6] = { .phy = OFDM, 24000, 0x00, 48, 4 }, - [7] = { .phy = OFDM, 27000, 0x00, 54, 4 } + [0] = { .phy = HALF, 3000, 0x00, B(6), 0 }, + [1] = { .phy = HALF, 4500, 0x00, 9, 0 }, + [2] = { .phy = HALF, 6000, 0x00, B(12), 2 }, + [3] = { .phy = HALF, 9000, 0x00, 18, 2 }, + [4] = { .phy = HALF, 12000, 0x00, B(24), 4 }, + [5] = { .phy = HALF, 18000, 0x00, 36, 4 }, + [6] = { .phy = HALF, 24000, 0x00, 48, 4 }, + [7] = { .phy = HALF, 27000, 0x00, 54, 4 } }, }; @@ -132,14 +134,14 @@ static struct ieee80211_rate_table ieee8 .info = { /* short ctrl */ /* Preamble dot11Rate Rate */ - [0] = { .phy = OFDM, 1500, 0x00, B(3), 0 }, - [1] = { .phy = OFDM, 2250, 0x00, 4, 0 }, - [2] = { .phy = OFDM, 3000, 0x00, B(9), 2 }, - [3] = { .phy = OFDM, 4500, 0x00, 9, 2 }, - [4] = { .phy = OFDM, 6000, 0x00, B(12), 4 }, - [5] = { .phy = OFDM, 9000, 0x00, 18, 4 }, - [6] = { .phy = OFDM, 12000, 0x00, 24, 4 }, - [7] = { .phy = OFDM, 13500, 0x00, 27, 4 } + [0] = { .phy = QUART, 1500, 0x00, B(3), 0 }, + [1] = { .phy = QUART, 2250, 0x00, 4, 0 }, + [2] = { .phy = QUART, 3000, 0x00, B(9), 2 }, + [3] = { .phy = QUART, 4500, 0x00, 9, 2 }, + [4] = { .phy = QUART, 6000, 0x00, B(12), 4 }, + [5] = { .phy = QUART, 9000, 0x00, 18, 4 }, + [6] = { .phy = QUART, 12000, 0x00, 24, 4 }, + [7] = { .phy = QUART, 13500, 0x00, 27, 4 } }, }; @@ -177,6 +179,8 @@ static struct ieee80211_rate_table ieee8 #undef Mb #undef B #undef OFDM +#undef HALF +#undef QUART #undef CCK #undef TURBO #undef XR @@ -361,6 +365,30 @@ ieee80211_rate2plcp(int rate, enum ieee8 return 0; /* XXX unsupported/unknown rate */ } +#define CCK_SIFS_TIME 10 +#define CCK_PREAMBLE_BITS 144 +#define CCK_PLCP_BITS 48 + +#define OFDM_SIFS_TIME 16 +#define OFDM_PREAMBLE_TIME 20 +#define OFDM_PLCP_BITS 22 +#define OFDM_SYMBOL_TIME 4 + +#define OFDM_HALF_SIFS_TIME 32 +#define OFDM_HALF_PREAMBLE_TIME 40 +#define OFDM_HALF_PLCP_BITS 22 +#define OFDM_HALF_SYMBOL_TIME 8 + +#define OFDM_QUARTER_SIFS_TIME 64 +#define OFDM_QUARTER_PREAMBLE_TIME 80 +#define OFDM_QUARTER_PLCP_BITS 22 +#define OFDM_QUARTER_SYMBOL_TIME 16 + +#define TURBO_SIFS_TIME 8 +#define TURBO_PREAMBLE_TIME 14 +#define TURBO_PLCP_BITS 22 +#define TURBO_SYMBOL_TIME 4 + /* * Compute the time to transmit a frame of length frameLen bytes * using the specified rate, phy, and short preamble setting. @@ -381,9 +409,6 @@ ieee80211_compute_duration(const struct switch (rt->info[rix].phy) { case IEEE80211_T_CCK: -#define CCK_SIFS_TIME 10 -#define CCK_PREAMBLE_BITS 144 -#define CCK_PLCP_BITS 48 phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS; if (isShortPreamble && rt->info[rix].shortPreamble) phyTime >>= 1; @@ -391,65 +416,37 @@ ieee80211_compute_duration(const struct txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000)/kbps); break; -#undef CCK_SIFS_TIME -#undef CCK_PREAMBLE_BITS -#undef CCK_PLCP_BITS - case IEEE80211_T_OFDM: -#define OFDM_SIFS_TIME 16 -#define OFDM_PREAMBLE_TIME 20 -#define OFDM_PLCP_BITS 22 -#define OFDM_SYMBOL_TIME 4 + bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("full rate bps")); -#define OFDM_SIFS_TIME_HALF 32 -#define OFDM_PREAMBLE_TIME_HALF 40 -#define OFDM_PLCP_BITS_HALF 22 -#define OFDM_SYMBOL_TIME_HALF 8 - -#define OFDM_SIFS_TIME_QUARTER 64 -#define OFDM_PREAMBLE_TIME_QUARTER 80 -#define OFDM_PLCP_BITS_QUARTER 22 -#define OFDM_SYMBOL_TIME_QUARTER 16 - if (rt == &ieee80211_half_table) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; - KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_QUARTER - + OFDM_PREAMBLE_TIME_QUARTER - + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); - } else if (rt == &ieee80211_quarter_table) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; - KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME_HALF - + OFDM_PREAMBLE_TIME_HALF - + (numSymbols * OFDM_SYMBOL_TIME_HALF); - } else { /* full rate channel */ - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000; - KASSERT(bitsPerSymbol != 0, ("full rate bps")); - - numBits = OFDM_PLCP_BITS + (frameLen << 3); - numSymbols = howmany(numBits, bitsPerSymbol); - txTime = OFDM_SIFS_TIME - + OFDM_PREAMBLE_TIME - + (numSymbols * OFDM_SYMBOL_TIME); - } + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_SIFS_TIME + + OFDM_PREAMBLE_TIME + + (numSymbols * OFDM_SYMBOL_TIME); + break; + case IEEE80211_T_OFDM_HALF: + bitsPerSymbol = (kbps * OFDM_HALF_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_HALF_SIFS_TIME + + OFDM_HALF_PREAMBLE_TIME + + (numSymbols * OFDM_HALF_SYMBOL_TIME); + break; + case IEEE80211_T_OFDM_QUARTER: + bitsPerSymbol = (kbps * OFDM_QUARTER_SYMBOL_TIME) / 1000; + KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); + + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + txTime = OFDM_QUARTER_SIFS_TIME + + OFDM_QUARTER_PREAMBLE_TIME + + (numSymbols * OFDM_QUARTER_SYMBOL_TIME); break; - -#undef OFDM_SIFS_TIME -#undef OFDM_PREAMBLE_TIME -#undef OFDM_PLCP_BITS -#undef OFDM_SYMBOL_TIME - case IEEE80211_T_TURBO: -#define TURBO_SIFS_TIME 8 -#define TURBO_PREAMBLE_TIME 14 -#define TURBO_PLCP_BITS 22 -#define TURBO_SYMBOL_TIME 4 /* we still save OFDM rates in kbps - so double them */ bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000; KASSERT(bitsPerSymbol != 0, ("turbo bps")); @@ -459,11 +456,6 @@ ieee80211_compute_duration(const struct txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME + (numSymbols * TURBO_SYMBOL_TIME); break; -#undef TURBO_SIFS_TIME -#undef TURBO_PREAMBLE_TIME -#undef TURBO_PLCP_BITS -#undef TURBO_SYMBOL_TIME - default: panic("%s: unknown phy %u (rate %u)\n", __func__, rt->info[rix].phy, rate); From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 17:54:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24B9E106564A; Thu, 19 Feb 2009 17:54:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 132C28FC1B; Thu, 19 Feb 2009 17:54:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JHsgZQ003996; Thu, 19 Feb 2009 17:54:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JHsgar003995; Thu, 19 Feb 2009 17:54:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902191754.n1JHsgar003995@svn.freebsd.org> From: Ed Schouten Date: Thu, 19 Feb 2009 17:54: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: r188822 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:54:43 -0000 Author: ed Date: Thu Feb 19 17:54:42 2009 New Revision: 188822 URL: http://svn.freebsd.org/changeset/base/188822 Log: Squash some small bugs in pts(4). - Don't return a negative errno when using an unknown ioctl() on a pseudo-terminal master device. Be sure to convert ENOIOCTL to ENOTTY, just like the TTY layer does. - Even though we should return st_rdev of the master device node when emulating pty(4) devices, FIODGNAME should still return the name of the slave device. Otherwise ptsname(3) and ttyname(3) return an invalid device name. Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Thu Feb 19 17:44:23 2009 (r188821) +++ head/sys/kern/tty_pts.c Thu Feb 19 17:54:42 2009 (r188822) @@ -290,12 +290,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd /* Reverse device name lookups, for ptsname() and ttyname(). */ fgn = data; -#ifdef PTS_EXTERNAL - if (psc->pts_cdev != NULL) - p = devtoname(psc->pts_cdev); - else -#endif /* PTS_EXTERNAL */ - p = tty_devname(tp); + p = tty_devname(tp); i = strlen(p) + 1; if (i > fgn->len) return (EINVAL); @@ -385,6 +380,8 @@ ptsdev_ioctl(struct file *fp, u_long cmd tty_lock(tp); error = tty_ioctl(tp, cmd, data, td); tty_unlock(tp); + if (error == ENOIOCTL) + error = ENOTTY; return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 17:56:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1441065674; Thu, 19 Feb 2009 17:56:13 +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 BF9AE8FC24; Thu, 19 Feb 2009 17:56:12 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id D194D1D22B; Thu, 19 Feb 2009 18:56:11 +0100 (CET) Date: Thu, 19 Feb 2009 18:56:11 +0100 From: Ed Schouten To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090219175611.GE19161@hoeg.nl> References: <200902191754.n1JHsgar003995@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9crTWz/Z+Zyzu20v" Content-Disposition: inline In-Reply-To: <200902191754.n1JHsgar003995@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Subject: Re: svn commit: r188822 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:56:14 -0000 --9crTWz/Z+Zyzu20v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > just like the TTY layer does. This should read: "just like devfs does." --=20 Ed Schouten WWW: http://80386.nl/ --9crTWz/Z+Zyzu20v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmdnTsACgkQ52SDGA2eCwUq6ACfTg42h/19o/H8vjX2HSOXWuqj saoAn0j67L6gyWgaErrMsfbhkmaiAB/O =1GPA -----END PGP SIGNATURE----- --9crTWz/Z+Zyzu20v-- From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 18:03:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B86BB106566C; Thu, 19 Feb 2009 18:03:41 +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 A6E008FC17; Thu, 19 Feb 2009 18:03:41 +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 n1JI3fkU004224; Thu, 19 Feb 2009 18:03:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JI3fED004223; Thu, 19 Feb 2009 18:03:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191803.n1JI3fED004223@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 18:03: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: r188823 - head/lib/libc/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 18:03:42 -0000 Author: imp Date: Thu Feb 19 18:03:41 2009 New Revision: 188823 URL: http://svn.freebsd.org/changeset/base/188823 Log: These symbols don't belong here. Remove them. Since mips hasn't had a release, I think there's no impact here... Reviewed by: cognet@ Modified: head/lib/libc/mips/Symbol.map Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Thu Feb 19 17:54:42 2009 (r188822) +++ head/lib/libc/mips/Symbol.map Thu Feb 19 18:03:41 2009 (r188823) @@ -34,7 +34,6 @@ FBSD_1.0 { vfork; brk; cerror; /* XXX - Should this be .cerror (see sys/cerror.S)? */ - fork; sbrk; }; @@ -57,12 +56,9 @@ FBSDprivate_1.0 { __siglongjmp; __sys_vfork; _vfork; - _brk; end; /* XXX - Should this be _end (see sys/brk.S)? */ curbrk; minbrk; _brk; - __sys_fork; - _fork; _sbrk; }; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 18:21:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CDE106564A; Thu, 19 Feb 2009 18:21:25 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D91C98FC13; Thu, 19 Feb 2009 18:21:23 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (beta-e.starpoint.kiev.ua [212.40.38.102]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA25319; Thu, 19 Feb 2009 20:01:57 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <499D9E94.1090309@freebsd.org> Date: Thu, 19 Feb 2009 20:01:56 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200902191439.n1JEdqRM099733@svn.freebsd.org> In-Reply-To: <200902191439.n1JEdqRM099733@svn.freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r188814 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 18:21:25 -0000 on 19/02/2009 16:39 Andriy Gapon said the following: > Author: avg > Date: Thu Feb 19 14:39:52 2009 > New Revision: 188814 > URL: http://svn.freebsd.org/changeset/base/188814 > > Log: > acpi_cpu: fixup for PIIX4E PCI config related to C2 > > This is triggered only if BIOS configures ACPI_BITREG_BUS_MASTER_RLD > aka BRLD_EN_BM to 1. > Rationale: > 1. we do not support C3 on PIIX4E > 2. bus master activity need not break out of C2 state > 3. because of CPU_QUIRK_NO_BM_CTRL quirk we may reset bus master here should have been "never" --------------------^^^ > status which would result in immediate break out from C2 > > So if you have seen > cpu0: too many short sleeps, backing off to C1 > with this chipset before you may want to try cx_lowest of C2 again. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 18:52:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCC61106564A; Thu, 19 Feb 2009 18:52:31 +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 A97AF8FC1F; Thu, 19 Feb 2009 18:52:31 +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 n1JIqVTi005259; Thu, 19 Feb 2009 18:52:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JIqVlC005258; Thu, 19 Feb 2009 18:52:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191852.n1JIqVlC005258@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 18:52: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: r188824 - head/sys/boot/ficl/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 18:52:32 -0000 Author: imp Date: Thu Feb 19 18:52:31 2009 New Revision: 188824 URL: http://svn.freebsd.org/changeset/base/188824 Log: Add basic mips support. This has been compile tested only. Added: head/sys/boot/ficl/mips/ head/sys/boot/ficl/mips/sysdep.c (contents, props changed) head/sys/boot/ficl/mips/sysdep.h (contents, props changed) Added: head/sys/boot/ficl/mips/sysdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl/mips/sysdep.c Thu Feb 19 18:52:31 2009 (r188824) @@ -0,0 +1,101 @@ +/******************************************************************* +** s y s d e p . c +** Forth Inspired Command Language +** Author: John Sadler (john_sadler@alum.mit.edu) +** Created: 16 Oct 1997 +** Implementations of FICL external interface functions... +** +*******************************************************************/ + +/* $FreeBSD$ */ + +#ifdef TESTMAIN +#include +#include +#else +#include +#endif +#include "ficl.h" + +/* +******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith +*/ + +#if PORTABLE_LONGMULDIV == 0 +DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y) +{ + DPUNS q; + u_int64_t qx; + + qx = (u_int64_t)x * (u_int64_t) y; + + q.hi = (u_int32_t)( qx >> 32 ); + q.lo = (u_int32_t)( qx & 0xFFFFFFFFL); + + return q; +} + +UNSQR ficlLongDiv(DPUNS q, FICL_UNS y) +{ + UNSQR result; + u_int64_t qx, qh; + + qh = q.hi; + qx = (qh << 32) | q.lo; + + result.quot = qx / y; + result.rem = qx % y; + + return result; +} +#endif + +void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline) +{ + IGNORE(pVM); + + while(*msg != 0) + putchar(*(msg++)); + if (fNewline) + putchar('\n'); + + return; +} + +void *ficlMalloc (size_t size) +{ + return malloc(size); +} + +void *ficlRealloc (void *p, size_t size) +{ + return realloc(p, size); +} + +void ficlFree (void *p) +{ + free(p); +} + + +/* +** Stub function for dictionary access control - does nothing +** by default, user can redefine to guarantee exclusive dict +** access to a single thread for updates. All dict update code +** is guaranteed to be bracketed as follows: +** ficlLockDictionary(TRUE); +** +** ficlLockDictionary(FALSE); +** +** Returns zero if successful, nonzero if unable to acquire lock +** befor timeout (optional - could also block forever) +*/ +#if FICL_MULTITHREAD +int ficlLockDictionary(short fLock) +{ + IGNORE(fLock); + return 0; +} +#endif /* FICL_MULTITHREAD */ + + Added: head/sys/boot/ficl/mips/sysdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/ficl/mips/sysdep.h Thu Feb 19 18:52:31 2009 (r188824) @@ -0,0 +1,432 @@ +/******************************************************************* + s y s d e p . h +** Forth Inspired Command Language +** Author: John Sadler (john_sadler@alum.mit.edu) +** Created: 16 Oct 1997 +** Ficl system dependent types and prototypes... +** +** Note: Ficl also depends on the use of "assert" when +** FICL_ROBUST is enabled. This may require some consideration +** in firmware systems since assert often +** assumes stderr/stdout. +** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $ +*******************************************************************/ +/* +** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu) +** All rights reserved. +** +** Get the latest Ficl release at http://ficl.sourceforge.net +** +** L I C E N S E and D I S C L A I M E R +** +** 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. +** +** I am interested in hearing from anyone who uses ficl. If you have +** a problem, a success story, a defect, an enhancement request, or +** if you would like to contribute to the ficl release, please send +** contact me by email at the address above. +** +** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $ +** $FreeBSD$ +*/ + +#if !defined (__SYSDEP_H__) +#define __SYSDEP_H__ + +#include + +#include /* size_t, NULL */ +#include +#include + +#if !defined IGNORE /* Macro to silence unused param warnings */ +#define IGNORE(x) &x +#endif + +/* +** TRUE and FALSE for C boolean operations, and +** portable 32 bit types for CELLs +** +*/ +#if !defined TRUE +#define TRUE 1 +#endif +#if !defined FALSE +#define FALSE 0 +#endif + + +/* +** System dependent data type declarations... +*/ +#if !defined INT32 +#define INT32 int +#endif + +#if !defined UNS32 +#define UNS32 unsigned int +#endif + +#if !defined UNS16 +#define UNS16 unsigned short +#endif + +#if !defined UNS8 +#define UNS8 unsigned char +#endif + +#if !defined NULL +#define NULL ((void *)0) +#endif + +/* +** FICL_UNS and FICL_INT must have the same size as a void* on +** the target system. A CELL is a union of void*, FICL_UNS, and +** FICL_INT. +** (11/2000: same for FICL_FLOAT) +*/ +#if !defined FICL_INT +#define FICL_INT INT32 +#endif + +#if !defined FICL_UNS +#define FICL_UNS UNS32 +#endif + +#if !defined FICL_FLOAT +#define FICL_FLOAT float +#endif + +/* +** Ficl presently supports values of 32 and 64 for BITS_PER_CELL +*/ +#if !defined BITS_PER_CELL +#define BITS_PER_CELL 32 +#endif + +#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64)) + Error! +#endif + +typedef struct +{ + FICL_UNS hi; + FICL_UNS lo; +} DPUNS; + +typedef struct +{ + FICL_UNS quot; + FICL_UNS rem; +} UNSQR; + +typedef struct +{ + FICL_INT hi; + FICL_INT lo; +} DPINT; + +typedef struct +{ + FICL_INT quot; + FICL_INT rem; +} INTQR; + + +/* +** B U I L D C O N T R O L S +*/ + +#if !defined (FICL_MINIMAL) +#define FICL_MINIMAL 0 +#endif +#if (FICL_MINIMAL) +#define FICL_WANT_SOFTWORDS 0 +#define FICL_WANT_FILE 0 +#define FICL_WANT_FLOAT 0 +#define FICL_WANT_USER 0 +#define FICL_WANT_LOCALS 0 +#define FICL_WANT_DEBUGGER 0 +#define FICL_WANT_OOP 0 +#define FICL_PLATFORM_EXTEND 0 +#define FICL_MULTITHREAD 0 +#define FICL_ROBUST 1 +#define FICL_EXTENDED_PREFIX 0 +#endif + +/* +** FICL_PLATFORM_EXTEND +** Includes words defined in ficlCompilePlatform +*/ +#if !defined (FICL_PLATFORM_EXTEND) +#define FICL_PLATFORM_EXTEND 1 +#endif + +/* +** FICL_WANT_FILE +** Includes the FILE and FILE-EXT wordset and associated code. Turn this off if you do not +** have a filesystem! +** Contributed by Larry Hastings +*/ +#if !defined (FICL_WANT_FILE) +#define FICL_WANT_FILE 0 +#endif + +/* +** FICL_WANT_FLOAT +** Includes a floating point stack for the VM, and words to do float operations. +** Contributed by Guy Carver +*/ +#if !defined (FICL_WANT_FLOAT) +#define FICL_WANT_FLOAT 0 +#endif + +/* +** FICL_WANT_DEBUGGER +** Inludes a simple source level debugger +*/ +#if !defined (FICL_WANT_DEBUGGER) +#define FICL_WANT_DEBUGGER 1 +#endif + +/* +** User variables: per-instance variables bound to the VM. +** Kinda like thread-local storage. Could be implemented in a +** VM private dictionary, but I've chosen the lower overhead +** approach of an array of CELLs instead. +*/ +#if !defined FICL_WANT_USER +#define FICL_WANT_USER 1 +#endif + +#if !defined FICL_USER_CELLS +#define FICL_USER_CELLS 16 +#endif + +/* +** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and +** a private dictionary for local variable compilation. +*/ +#if !defined FICL_WANT_LOCALS +#define FICL_WANT_LOCALS 1 +#endif + +/* Max number of local variables per definition */ +#if !defined FICL_MAX_LOCALS +#define FICL_MAX_LOCALS 16 +#endif + +/* +** FICL_WANT_OOP +** Inludes object oriented programming support (in softwords) +** OOP support requires locals and user variables! +*/ +#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER) +#if !defined (FICL_WANT_OOP) +#define FICL_WANT_OOP 0 +#endif +#endif + +#if !defined (FICL_WANT_OOP) +#define FICL_WANT_OOP 1 +#endif + +/* +** FICL_WANT_SOFTWORDS +** Controls inclusion of all softwords in softcore.c +*/ +#if !defined (FICL_WANT_SOFTWORDS) +#define FICL_WANT_SOFTWORDS 1 +#endif + +/* +** FICL_MULTITHREAD enables dictionary mutual exclusion +** wia the ficlLockDictionary system dependent function. +** Note: this implementation is experimental and poorly +** tested. Further, it's unnecessary unless you really +** intend to have multiple SESSIONS (poor choice of name +** on my part) - that is, threads that modify the dictionary +** at the same time. +*/ +#if !defined FICL_MULTITHREAD +#define FICL_MULTITHREAD 0 +#endif + +/* +** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be +** defined in C in sysdep.c. Use this if you cannot easily +** generate an inline asm definition +*/ +#if !defined (PORTABLE_LONGMULDIV) +#define PORTABLE_LONGMULDIV 0 +#endif + +/* +** INLINE_INNER_LOOP causes the inner interpreter to be inline code +** instead of a function call. This is mainly because MS VC++ 5 +** chokes with an internal compiler error on the function version. +** in release mode. Sheesh. +*/ +#if !defined INLINE_INNER_LOOP +#if defined _DEBUG +#define INLINE_INNER_LOOP 0 +#else +#define INLINE_INNER_LOOP 1 +#endif +#endif + +/* +** FICL_ROBUST enables bounds checking of stacks and the dictionary. +** This will detect stack over and underflows and dictionary overflows. +** Any exceptional condition will result in an assertion failure. +** (As generated by the ANSI assert macro) +** FICL_ROBUST == 1 --> stack checking in the outer interpreter +** FICL_ROBUST == 2 also enables checking in many primitives +*/ + +#if !defined FICL_ROBUST +#define FICL_ROBUST 2 +#endif + +/* +** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of +** a new virtual machine's stacks, unless overridden at +** create time. +*/ +#if !defined FICL_DEFAULT_STACK +#define FICL_DEFAULT_STACK 128 +#endif + +/* +** FICL_DEFAULT_DICT specifies the number of CELLs to allocate +** for the system dictionary by default. The value +** can be overridden at startup time as well. +** FICL_DEFAULT_ENV specifies the number of cells to allot +** for the environment-query dictionary. +*/ +#if !defined FICL_DEFAULT_DICT +#define FICL_DEFAULT_DICT 12288 +#endif + +#if !defined FICL_DEFAULT_ENV +#define FICL_DEFAULT_ENV 260 +#endif + +/* +** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in +** the dictionary search order. See Forth DPANS sec 16.3.3 +** (file://dpans16.htm#16.3.3) +*/ +#if !defined FICL_DEFAULT_VOCS +#define FICL_DEFAULT_VOCS 16 +#endif + +/* +** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure +** that stores pointers to parser extension functions. I would never expect to have +** more than 8 of these, so that's the default limit. Too many of these functions +** will probably exact a nasty performance penalty. +*/ +#if !defined FICL_MAX_PARSE_STEPS +#define FICL_MAX_PARSE_STEPS 8 +#endif + +/* +** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if +** included as part of softcore.c) +*/ +#if !defined FICL_EXTENDED_PREFIX +#define FICL_EXTENDED_PREFIX 0 +#endif + +/* +** FICL_ALIGN is the power of two to which the dictionary +** pointer address must be aligned. This value is usually +** either 1 or 2, depending on the memory architecture +** of the target system; 2 is safe on any 16 or 32 bit +** machine. 3 would be appropriate for a 64 bit machine. +*/ +#if !defined FICL_ALIGN +#define FICL_ALIGN 2 +#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) +#endif + +/* +** System dependent routines -- +** edit the implementations in sysdep.c to be compatible +** with your runtime environment... +** ficlTextOut sends a NULL terminated string to the +** default output device - used for system error messages +** ficlMalloc and ficlFree have the same semantics as malloc and free +** in standard C +** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned +** product +** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient +** and remainder +*/ +struct vm; +void ficlTextOut(struct vm *pVM, char *msg, int fNewline); +void *ficlMalloc (size_t size); +void ficlFree (void *p); +void *ficlRealloc(void *p, size_t size); +/* +** Stub function for dictionary access control - does nothing +** by default, user can redefine to guarantee exclusive dict +** access to a single thread for updates. All dict update code +** must be bracketed as follows: +** ficlLockDictionary(TRUE); +** +** ficlLockDictionary(FALSE); +** +** Returns zero if successful, nonzero if unable to acquire lock +** before timeout (optional - could also block forever) +** +** NOTE: this function must be implemented with lock counting +** semantics: nested calls must behave properly. +*/ +#if FICL_MULTITHREAD +int ficlLockDictionary(short fLock); +#else +#define ficlLockDictionary(x) 0 /* ignore */ +#endif + +/* +** 64 bit integer math support routines: multiply two UNS32s +** to get a 64 bit product, & divide the product by an UNS32 +** to get an UNS32 quotient and remainder. Much easier in asm +** on a 32 bit CPU than in C, which usually doesn't support +** the double length result (but it should). +*/ +DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y); +UNSQR ficlLongDiv(DPUNS q, FICL_UNS y); + +/* +** FICL_HAVE_FTRUNCATE indicates whether the current OS supports +** the ftruncate() function (available on most UNIXes). This +** function is necessary to provide the complete File-Access wordset. +*/ +#if !defined (FICL_HAVE_FTRUNCATE) +#define FICL_HAVE_FTRUNCATE 0 +#endif + + +#endif /*__SYSDEP_H__*/ From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 18:53:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C669610656DE; Thu, 19 Feb 2009 18:53:08 +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 B4CFE8FC1B; Thu, 19 Feb 2009 18:53:08 +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 n1JIr80P005306; Thu, 19 Feb 2009 18:53:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JIr8X3005305; Thu, 19 Feb 2009 18:53:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191853.n1JIr8X3005305@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 18:53: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: r188825 - head/sys/boot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 18:53:09 -0000 Author: imp Date: Thu Feb 19 18:53:08 2009 New Revision: 188825 URL: http://svn.freebsd.org/changeset/base/188825 Log: Enable building of ficl on MIPS. It compiles, but needs more testing. Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Thu Feb 19 18:52:31 2009 (r188824) +++ head/sys/boot/Makefile Thu Feb 19 18:53:08 2009 (r188825) @@ -2,10 +2,6 @@ .include -.if ${MACHINE_ARCH} == "mips" -MK_FORTH=no # not yet -.endif - .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 19:45:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD93D1065675; Thu, 19 Feb 2009 19:45: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 AB3628FC32; Thu, 19 Feb 2009 19:45: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 n1JJjnnx006245; Thu, 19 Feb 2009 19:45:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JJjnXj006244; Thu, 19 Feb 2009 19:45:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191945.n1JJjnXj006244@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 19:45: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: r188826 - head/usr.sbin/lmcconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 19:45:50 -0000 Author: imp Date: Thu Feb 19 19:45:49 2009 New Revision: 188826 URL: http://svn.freebsd.org/changeset/base/188826 Log: Include string.h for strncpy prototype Include strings.h for bcopy and bzero prototype Modified: head/usr.sbin/lmcconfig/lmcconfig.c Modified: head/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- head/usr.sbin/lmcconfig/lmcconfig.c Thu Feb 19 18:53:08 2009 (r188825) +++ head/usr.sbin/lmcconfig/lmcconfig.c Thu Feb 19 19:45:49 2009 (r188826) @@ -68,6 +68,8 @@ #include #include #include +#include +#include #include #if defined(NETGRAPH) # include From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 19:53:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3F7106564A; Thu, 19 Feb 2009 19:53:58 +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 DADB18FC0A; Thu, 19 Feb 2009 19:53:58 +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 n1JJrwqV006422; Thu, 19 Feb 2009 19:53:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JJrwhe006420; Thu, 19 Feb 2009 19:53:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902191953.n1JJrwhe006420@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 19:53: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: r188827 - in head/lib/libc: arm/sys mips/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 19:53:59 -0000 Author: imp Date: Thu Feb 19 19:53:58 2009 New Revision: 188827 URL: http://svn.freebsd.org/changeset/base/188827 Log: These warnings are only relevant on NetBSD it seems. They don't seem to be relevant to FreeBSD at all. Modified: head/lib/libc/arm/sys/Ovfork.S head/lib/libc/mips/sys/Ovfork.S Modified: head/lib/libc/arm/sys/Ovfork.S ============================================================================== --- head/lib/libc/arm/sys/Ovfork.S Thu Feb 19 19:45:49 2009 (r188826) +++ head/lib/libc/arm/sys/Ovfork.S Thu Feb 19 19:53:58 2009 (r188827) @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" -WARN_REFERENCES(vfork, \ - "warning: reference to compatibility vfork(); include for correct reference") - /* * pid = vfork(); * Modified: head/lib/libc/mips/sys/Ovfork.S ============================================================================== --- head/lib/libc/mips/sys/Ovfork.S Thu Feb 19 19:45:49 2009 (r188826) +++ head/lib/libc/mips/sys/Ovfork.S Thu Feb 19 19:53:58 2009 (r188827) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); ASMSTR("$NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ -WARN_REFERENCES(vfork, \ - "warning: reference to compatibility vfork(); include for correct reference") - /* * pid = vfork(); * From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 20:08:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A52106564A; Thu, 19 Feb 2009 20:08:00 +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 1DF958FC12; Thu, 19 Feb 2009 20:08:00 +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 n1JK80gn006727; Thu, 19 Feb 2009 20:08:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JK7xLl006708; Thu, 19 Feb 2009 20:07:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902192007.n1JK7xLl006708@svn.freebsd.org> From: Warner Losh Date: Thu, 19 Feb 2009 20:07: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: r188828 - head/usr.bin/window X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 20:08:00 -0000 Author: imp Date: Thu Feb 19 20:07:59 2009 New Revision: 188828 URL: http://svn.freebsd.org/changeset/base/188828 Log: Include proper header files for system functions that are used and that gcc complains about this code changing from the built-in versions. Modified: head/usr.bin/window/compress.c head/usr.bin/window/context.c head/usr.bin/window/lcmd1.c head/usr.bin/window/lcmd2.c head/usr.bin/window/scanner.c head/usr.bin/window/startup.c head/usr.bin/window/string.c head/usr.bin/window/ttoutput.c head/usr.bin/window/tttermcap.c head/usr.bin/window/ttzapple.c head/usr.bin/window/var.c head/usr.bin/window/wwdump.c head/usr.bin/window/wwend.c head/usr.bin/window/wwenviron.c head/usr.bin/window/wwflush.c head/usr.bin/window/wwinit.c head/usr.bin/window/wwpty.c head/usr.bin/window/wwspawn.c head/usr.bin/window/xx.c Modified: head/usr.bin/window/compress.c ============================================================================== --- head/usr.bin/window/compress.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/compress.c Thu Feb 19 20:07:59 2009 (r188828) @@ -47,6 +47,7 @@ static char rcsid[] = #include #include #include +#include int cc_trace = 0; FILE *cc_trace_fp; Modified: head/usr.bin/window/context.c ============================================================================== --- head/usr.bin/window/context.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/context.c Thu Feb 19 20:07:59 2009 (r188828) @@ -44,6 +44,7 @@ static char rcsid[] = #include "mystring.h" #include "context.h" #include +#include /* * Context push/pop for nested command files. Modified: head/usr.bin/window/lcmd1.c ============================================================================== --- head/usr.bin/window/lcmd1.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/lcmd1.c Thu Feb 19 20:07:59 2009 (r188828) @@ -46,6 +46,7 @@ static char rcsid[] = #include "value.h" #include "lcmd.h" #include "var.h" +#include struct lcmd_arg arg_window[] = { { "row", 1, ARG_NUM }, Modified: head/usr.bin/window/lcmd2.c ============================================================================== --- head/usr.bin/window/lcmd2.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/lcmd2.c Thu Feb 19 20:07:59 2009 (r188828) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include "var.h" #include "lcmd.h" #include "alias.h" +#include #include #include Modified: head/usr.bin/window/scanner.c ============================================================================== --- head/usr.bin/window/scanner.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/scanner.c Thu Feb 19 20:07:59 2009 (r188828) @@ -46,6 +46,7 @@ static char rcsid[] = #include "context.h" #include "string.h" #include "mystring.h" +#include s_getc() { Modified: head/usr.bin/window/startup.c ============================================================================== --- head/usr.bin/window/startup.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/startup.c Thu Feb 19 20:07:59 2009 (r188828) @@ -45,6 +45,7 @@ static char rcsid[] = #include "var.h" #include "char.h" #include "local.h" +#include doconfig() { Modified: head/usr.bin/window/string.c ============================================================================== --- head/usr.bin/window/string.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/string.c Thu Feb 19 20:07:59 2009 (r188828) @@ -42,6 +42,8 @@ static char rcsid[] = #include /* System string definitions. */ #include "mystring.h" /* Local string definitions. */ +#include +#include char * str_cpy(s) Modified: head/usr.bin/window/ttoutput.c ============================================================================== --- head/usr.bin/window/ttoutput.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/ttoutput.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,8 @@ static char rcsid[] = #include "ww.h" #include "tt.h" #include +#include +#include #include /* Modified: head/usr.bin/window/tttermcap.c ============================================================================== --- head/usr.bin/window/tttermcap.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/tttermcap.c Thu Feb 19 20:07:59 2009 (r188828) @@ -41,6 +41,7 @@ static char rcsid[] = #endif /* not lint */ #include "tt.h" +#include char *tgetstr(); char *tgoto(); Modified: head/usr.bin/window/ttzapple.c ============================================================================== --- head/usr.bin/window/ttzapple.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/ttzapple.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include "ww.h" #include "tt.h" #include "char.h" +#include /* zz|zapple|perfect apple:\ Modified: head/usr.bin/window/var.c ============================================================================== --- head/usr.bin/window/var.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/var.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include "value.h" #include "var.h" #include "mystring.h" +#include struct var * var_set1(head, name, v) Modified: head/usr.bin/window/wwdump.c ============================================================================== --- head/usr.bin/window/wwdump.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwdump.c Thu Feb 19 20:07:59 2009 (r188828) @@ -40,6 +40,7 @@ static char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include "ww.h" #include "tt.h" Modified: head/usr.bin/window/wwend.c ============================================================================== --- head/usr.bin/window/wwend.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwend.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include #include "ww.h" #include "tt.h" +#include /*ARGSUSED*/ int Modified: head/usr.bin/window/wwenviron.c ============================================================================== --- head/usr.bin/window/wwenviron.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwenviron.c Thu Feb 19 20:07:59 2009 (r188828) @@ -46,6 +46,7 @@ static char rcsid[] = #endif #include #include +#include /* * Set up the environment of this process to run in window 'wp'. Modified: head/usr.bin/window/wwflush.c ============================================================================== --- head/usr.bin/window/wwflush.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwflush.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include "ww.h" #include "tt.h" #include +#include wwflush() { Modified: head/usr.bin/window/wwinit.c ============================================================================== --- head/usr.bin/window/wwinit.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwinit.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include "ww.h" #include "tt.h" #include +#include #include #include #include "char.h" Modified: head/usr.bin/window/wwpty.c ============================================================================== --- head/usr.bin/window/wwpty.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwpty.c Thu Feb 19 20:07:59 2009 (r188828) @@ -43,6 +43,7 @@ static char rcsid[] = #include "ww.h" #include #include +#include #if !defined(OLD_TTY) && !defined(TIOCPKT) #include #endif Modified: head/usr.bin/window/wwspawn.c ============================================================================== --- head/usr.bin/window/wwspawn.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/wwspawn.c Thu Feb 19 20:07:59 2009 (r188828) @@ -42,6 +42,7 @@ static char rcsid[] = #include "ww.h" #include +#include /* * There is a dead lock with vfork and closing of pseudo-ports. Modified: head/usr.bin/window/xx.c ============================================================================== --- head/usr.bin/window/xx.c Thu Feb 19 19:53:58 2009 (r188827) +++ head/usr.bin/window/xx.c Thu Feb 19 20:07:59 2009 (r188828) @@ -44,6 +44,7 @@ static char rcsid[] = #include "xx.h" #include "tt.h" #include +#include xxinit() { From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 20:45:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB5E106566B; Thu, 19 Feb 2009 20:45:38 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0818FC23; Thu, 19 Feb 2009 20:45:38 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JKjcFB007413; Thu, 19 Feb 2009 20:45:38 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JKjc2g007412; Thu, 19 Feb 2009 20:45:38 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200902192045.n1JKjc2g007412@svn.freebsd.org> From: Roman Divacky Date: Thu, 19 Feb 2009 20:45: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: r188829 - head/sbin/atacontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 20:45:38 -0000 Author: rdivacky Date: Thu Feb 19 20:45:37 2009 New Revision: 188829 URL: http://svn.freebsd.org/changeset/base/188829 Log: Display an error message when the requested mode is not known. So the user can distinguish between a typo in the mode name and that the device does not support a certain mode (till now both causes show the same result, i.e. the old mode is displayed). Submitted by: Christoph Mallon Approved by: kib (mentor) Modified: head/sbin/atacontrol/atacontrol.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Thu Feb 19 20:07:59 2009 (r188828) +++ head/sbin/atacontrol/atacontrol.c Thu Feb 19 20:45:37 2009 (r188829) @@ -364,6 +364,8 @@ main(int argc, char **argv) fd = open_dev(argv[2], O_RDONLY); if (argc == 4) { mode = str2mode(argv[3]); + if (mode == -1) + errx(1, "unknown mode"); if (ioctl(fd, IOCATASMODE, &mode) < 0) warn("ioctl(IOCATASMODE)"); } From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 21:29:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15529106566C; Thu, 19 Feb 2009 21:29:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 028A28FC15; Thu, 19 Feb 2009 21:29:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JLTUCF008298; Thu, 19 Feb 2009 21:29:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JLTUq4008297; Thu, 19 Feb 2009 21:29:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902192129.n1JLTUq4008297@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 19 Feb 2009 21:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188830 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 21:29:32 -0000 Author: luigi Date: Thu Feb 19 21:29:30 2009 New Revision: 188830 URL: http://svn.freebsd.org/changeset/base/188830 Log: correct the spelling of a log message (missing "All "); on passing, rename a variable within a macro to reduce the chance of shadowing other variables with the same name Modified: stable/7/sys/netinet/ip_fw2.c Modified: stable/7/sys/netinet/ip_fw2.c ============================================================================== --- stable/7/sys/netinet/ip_fw2.c Thu Feb 19 20:45:37 2009 (r188829) +++ stable/7/sys/netinet/ip_fw2.c Thu Feb 19 21:29:30 2009 (r188830) @@ -2219,15 +2219,15 @@ ipfw_chk(struct ip_fw_args *args) * pointer might become stale after other pullups (but we never use it * this way). */ -#define PULLUP_TO(len, p, T) \ +#define PULLUP_TO(_len, p, T) \ do { \ - int x = (len) + sizeof(T); \ + int x = (_len) + sizeof(T); \ if ((m)->m_len < x) { \ args->m = m = m_pullup(m, x); \ if (m == NULL) \ goto pullup_failed; \ } \ - p = (mtod(m, char *) + (len)); \ + p = (mtod(m, char *) + (_len)); \ } while (0) /* @@ -3717,7 +3717,7 @@ zero_entry(struct ip_fw_chain *chain, u_ continue; clear_counters(rule, log_only); } - msg = log_only ? "logging counts reset" : + msg = log_only ? "All logging counts reset" : "Accounting cleared"; } else { int cleared = 0; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 22:10:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E85E01065670; Thu, 19 Feb 2009 22:10:39 +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 D67538FC23; Thu, 19 Feb 2009 22:10:39 +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 n1JMAdXf009075; Thu, 19 Feb 2009 22:10:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JMAddn009074; Thu, 19 Feb 2009 22:10:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902192210.n1JMAddn009074@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Feb 2009 22:10: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: r188831 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:10:40 -0000 Author: jhb Date: Thu Feb 19 22:10:39 2009 New Revision: 188831 URL: http://svn.freebsd.org/changeset/base/188831 Log: Don't clear the attribute cache of a file when it is closed. A subsequent open() of the same file will load fresh attributes, so they do not need to be explicitly flushed in close() to guarantee close to open consistency. However, other file desciptors may still reference this file and clearing the attributes in close() forces those other file descriptors to fetch fresh attributes the next time they need them. Reviewed by: mohans MFC after: 1 week Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu Feb 19 21:29:30 2009 (r188830) +++ head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:10:39 2009 (r188831) @@ -594,13 +594,6 @@ nfs_close(struct vop_close_args *ap) error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); mtx_lock(&np->n_mtx); } - /* - * Invalidate the attribute cache in all cases. - * An open is going to fetch fresh attrs any way, other procs - * on this node that have file open will be forced to do an - * otw attr fetch, but this is safe. - */ - np->n_attrstamp = 0; if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; error = np->n_error; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 22:18:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 364D91065680; Thu, 19 Feb 2009 22:18:01 +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 223CD8FC0C; Thu, 19 Feb 2009 22:18:01 +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 n1JMI1bW009246; Thu, 19 Feb 2009 22:18:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JMI1HF009245; Thu, 19 Feb 2009 22:18:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902192218.n1JMI1HF009245@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Feb 2009 22: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: r188832 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:18:03 -0000 Author: jhb Date: Thu Feb 19 22:18:00 2009 New Revision: 188832 URL: http://svn.freebsd.org/changeset/base/188832 Log: When fetching attributes for a file for NFSv3 mounts, do not perform an opportunistic ACCESS RPC to populate both the access and attribute caches of the file and instead always use a GETATTR RPC. On many modern NFS servers, an ACCESS RPC is much more expensive to service than a GETATTR RPC. Submitted by: mohans Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:10:39 2009 (r188831) +++ head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:18:00 2009 (r188832) @@ -644,12 +644,6 @@ nfs_getattr(struct vop_getattr_args *ap) */ if (nfs_getattrcache(vp, &vattr) == 0) goto nfsmout; - if (v3 && nfsaccess_cache_timeout > 0) { - nfsstats.accesscache_misses++; - nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred); - if (nfs_getattrcache(vp, &vattr) == 0) - goto nfsmout; - } nfsstats.rpccnt[NFSPROC_GETATTR]++; mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3)); mb = mreq; From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 22:28:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74C2F1065672; Thu, 19 Feb 2009 22:28:49 +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 570AC8FC2A; Thu, 19 Feb 2009 22:28:49 +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 n1JMSnAB009476; Thu, 19 Feb 2009 22:28:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JMSn2Q009472; Thu, 19 Feb 2009 22:28:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200902192228.n1JMSn2Q009472@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Feb 2009 22:28: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: r188833 - in head/sys: kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:28:50 -0000 Author: jhb Date: Thu Feb 19 22:28:48 2009 New Revision: 188833 URL: http://svn.freebsd.org/changeset/base/188833 Log: Enable caching of negative pathname lookups in the NFS client. To avoid stale entries, we save a copy of the directory's modification time when the first negative cache entry was added in the directory's NFS node. When a negative cache entry is hit during a pathname lookup, the parent directory's modification time is checked. If it has changed, all of the negative cache entries for that parent are purged and the lookup falls back to using the RPC. This required adding a new cache_purge_negative() method to the name cache to purge only negative cache entries for a given directory. Submitted by: mohans, Rick Macklem, Ricardo Labiaga @ NetApp Reviewed by: mohans Modified: head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsclient/nfsnode.h head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Feb 19 22:18:00 2009 (r188832) +++ head/sys/kern/vfs_cache.c Thu Feb 19 22:28:48 2009 (r188833) @@ -663,6 +663,24 @@ cache_purge(vp) } /* + * Invalidate all negative entries for a particular directory vnode. + */ +void +cache_purge_negative(vp) + struct vnode *vp; +{ + struct namecache *cp, *ncp; + + CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); + CACHE_WLOCK(); + LIST_FOREACH_SAFE(cp, &vp->v_cache_src, nc_src, ncp) { + if (cp->nc_vp == NULL) + cache_zap(cp); + } + CACHE_WUNLOCK(); +} + +/* * Flush all entries referencing a particular filesystem. */ void Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:18:00 2009 (r188832) +++ head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:28:48 2009 (r188833) @@ -852,6 +852,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct componentname *cnp = ap->a_cnp; struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; + struct vattr vattr; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; @@ -880,8 +881,12 @@ nfs_lookup(struct vop_lookup_args *ap) if (error > 0 && error != ENOENT) return (error); if (error == -1) { - struct vattr vattr; - + /* + * We only accept a positive hit in the cache if the + * change time of the file matches our cached copy. + * Otherwise, we discard the cache entry and fallback + * to doing a lookup RPC. + */ newvp = *vpp; if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { @@ -897,6 +902,24 @@ nfs_lookup(struct vop_lookup_args *ap) else vrele(newvp); *vpp = NULLVP; + } else if (error == ENOENT) { + /* + * We only accept a negative hit in the cache if the + * modification time of the parent directory matches + * our cached copy. Otherwise, we discard all of the + * negative cache entries for this directory. + */ + if (VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && + vattr.va_mtime.tv_sec == np->n_dmtime) { + nfsstats.lookupcache_hits++; + if ((cnp->cn_nameiop == CREATE || + cnp->cn_nameiop == RENAME) && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (ENOENT); + } + cache_purge_negative(dvp); + np->n_dmtime = 0; } error = 0; newvp = NULLVP; @@ -982,16 +1005,38 @@ nfsmout: vput(newvp); *vpp = NULLVP; } + + if (error != ENOENT) + goto done; + + /* The requested file was not found. */ if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && - (flags & ISLASTCN) && error == ENOENT) { + (flags & ISLASTCN)) { + /* + * XXX: UFS does a full VOP_ACCESS(dvp, + * VWRITE) here instead of just checking + * MNT_RDONLY. + */ if (dvp->v_mount->mnt_flag & MNT_RDONLY) - error = EROFS; - else - error = EJUSTRETURN; - } - if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) + return (EROFS); cnp->cn_flags |= SAVENAME; + return (EJUSTRETURN); + } + + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + /* + * Maintain n_dmtime as the modification time + * of the parent directory when the oldest -ve + * name cache entry for this directory was + * added. + */ + if (np->n_dmtime == 0) + np->n_dmtime = np->n_vattr.va_mtime.tv_sec; + cache_enter(dvp, NULL, cnp); + } + return (ENOENT); } +done: return (error); } Modified: head/sys/nfsclient/nfsnode.h ============================================================================== --- head/sys/nfsclient/nfsnode.h Thu Feb 19 22:18:00 2009 (r188832) +++ head/sys/nfsclient/nfsnode.h Thu Feb 19 22:28:48 2009 (r188833) @@ -109,6 +109,7 @@ struct nfsnode { time_t n_modestamp; /* mode cache timestamp */ struct timespec n_mtime; /* Prev modify time. */ time_t n_ctime; /* Prev create time. */ + time_t n_dmtime; /* Prev dir modify time. */ time_t n_expiry; /* Lease expiry time */ nfsfh_t *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Feb 19 22:18:00 2009 (r188832) +++ head/sys/sys/vnode.h Thu Feb 19 22:28:48 2009 (r188833) @@ -562,6 +562,7 @@ void cache_enter(struct vnode *dvp, stru int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp); void cache_purge(struct vnode *vp); +void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp); int change_dir(struct vnode *vp, struct thread *td); int change_root(struct vnode *vp, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 22:45:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4B43106566B; Thu, 19 Feb 2009 22:45:16 +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 571D68FC17; Thu, 19 Feb 2009 22:45:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id C5CBC46B55; Thu, 19 Feb 2009 17:45:15 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1JMj70E054317; Thu, 19 Feb 2009 17:45:07 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Thu, 19 Feb 2009 17:39:46 -0500 User-Agent: KMail/1.9.7 References: <200902192228.n1JMSn2Q009472@svn.freebsd.org> In-Reply-To: <200902192228.n1JMSn2Q009472@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902191739.46808.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 19 Feb 2009 17:45:07 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9015/Thu Feb 19 13:30:06 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.3 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, HOT_NASTY autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r188833 - in head/sys: kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:45:17 -0000 On Thursday 19 February 2009 5:28:49 pm John Baldwin wrote: > Author: jhb > Date: Thu Feb 19 22:28:48 2009 > New Revision: 188833 > URL: http://svn.freebsd.org/changeset/base/188833 > > Log: > Enable caching of negative pathname lookups in the NFS client. To avoid > stale entries, we save a copy of the directory's modification time when > the first negative cache entry was added in the directory's NFS node. > When a negative cache entry is hit during a pathname lookup, the parent > directory's modification time is checked. If it has changed, all of the > negative cache entries for that parent are purged and the lookup falls > back to using the RPC. This required adding a new cache_purge_negative() > method to the name cache to purge only negative cache entries for a given > directory. > > Submitted by: mohans, Rick Macklem, Ricardo Labiaga @ NetApp > Reviewed by: mohans Together with the previous two changes I measured a 30% drop in the number of RPCs for a kernel build (no modules): x nfs.old + nfs.new +------------------------------------------------------------------------------+ | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + xx| | + xx| | + xx| |++ xx| |++ xx| |+++ xx| |+++ xx| |+++ xx| |+++ xxx| | A A|| +------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 30 250515 252053 251393 251352.13 362.86492 + 30 173990 175930 175117 175011.87 474.44092 Difference at 95.0% confidence -76340.3 +/- 218.321 -30.3718% +/- 0.0868584% (Student's t, pooled s = 422.354) The majority of the drop was in the number of LOOKUP RPCs performed: x nfs.old + nfs.new +------------------------------------------------------------------------------+ | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + x | | + xx| | + xx| | + xx| | + xx| |+++ xx| |+++ xx| |+++ xx| |+++ xx| |+++ xxx| | A| A|| +------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 30 116997 118613 117898 117887.47 372.34733 + 30 40791 42782 41975 41846.5 481.79805 Difference at 95.0% confidence -76041 +/- 222.565 -64.503% +/- 0.188794% (Student's t, pooled s = 430.565) The old client performed 0 GETATTR RPC calls during the test. The new client performs a mix of GETATTR and ACCESS calls. One of the worries was that the client might now perform more RPC calls due to not priming the access cache, but this is not true in this test. This next histogram is for combined totals of ACCESS and GETATTR calls: x nfs.attr.old + nfs.attr.new +------------------------------------------------------------------------------+ | + + x x | | + + + + + x xxx xx | | +++++++++ + x x xxx xx | |+ ++++++++++ + + xxxx xxxxxxxxxx| ||_______M_A________| |__MA__| | +------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 30 90823 90898 90858 90859.633 19.496212 + 30 90494 90792 90537 90543.467 50.121737 Difference at 95.0% confidence -316.167 +/- 19.6573 -0.347973% +/- 0.0216348% (Student's t, pooled s = 38.0282) With the new client, of the ~90k ACCESS + GETATTR calls are now split into approximately 94% GETATTR and 6% ACCESS versus 0% GETATTR and 100% ACCESS. All of these changes are more the product of other folks who deserve the credit moreso than myself. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Feb 19 23:29:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B52B0106564A; Thu, 19 Feb 2009 23:29:05 +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 A1D1B8FC19; Thu, 19 Feb 2009 23:29:05 +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 n1JNT5ea010641; Thu, 19 Feb 2009 23:29:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1JNT5LF010637; Thu, 19 Feb 2009 23:29:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902192329.n1JNT5LF010637@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 19 Feb 2009 23:29: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: r188834 - in head/release/picobsd: bridge floppy.tree/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 23:29:06 -0000 Author: luigi Date: Thu Feb 19 23:29:05 2009 New Revision: 188834 URL: http://svn.freebsd.org/changeset/base/188834 Log: update 'sio' with 'uart' and apply related changes. Modified: head/release/picobsd/bridge/PICOBSD head/release/picobsd/bridge/PICOBSD.hints head/release/picobsd/bridge/crunch.conf head/release/picobsd/floppy.tree/etc/ttys Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Thu Feb 19 22:28:48 2009 (r188833) +++ head/release/picobsd/bridge/PICOBSD Thu Feb 19 23:29:05 2009 (r188834) @@ -7,6 +7,10 @@ options MD_ROOT_SIZE=3200 # same as def_sz hints "PICOBSD.hints" + +# values accessible through getenv() +# env "PICOBSD.env" + cpu I486_CPU cpu I586_CPU cpu I686_CPU @@ -68,7 +72,7 @@ device sc device npx # Serial (COM) ports -device sio +device uart # Audio support #device pcm @@ -107,10 +111,10 @@ device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" #device gif 4 # IPv6 and IPv4 tunneling #device faith 1 # IPv6-to-IPv4 relaying (translation) -#device tap +device tap -options DEVICE_POLLING +#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 +device bpf # Berkeley packet filter Modified: head/release/picobsd/bridge/PICOBSD.hints ============================================================================== --- head/release/picobsd/bridge/PICOBSD.hints Thu Feb 19 22:28:48 2009 (r188833) +++ head/release/picobsd/bridge/PICOBSD.hints Thu Feb 19 23:29:05 2009 (r188834) @@ -22,13 +22,13 @@ hint.sc.0.at="isa" hint.npx.0.at="nexus" hint.npx.0.port="0x0F0" hint.npx.0.irq="13" -hint.sio.0.at="isa" -hint.sio.0.port="0x3F8" -hint.sio.0.flags="0x10" -hint.sio.0.irq="4" -hint.sio.1.at="isa" -hint.sio.1.port="0x2F8" -hint.sio.1.irq="3" +hint.uart.0.at="isa" +hint.uart.0.port="0x3F8" +hint.uart.0.flags="0x10" +hint.uart.0.irq="4" +hint.uart.1.at="isa" +hint.uart.1.port="0x2F8" +hint.uart.1.irq="3" hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Thu Feb 19 22:28:48 2009 (r188833) +++ head/release/picobsd/bridge/crunch.conf Thu Feb 19 23:29:05 2009 (r188834) @@ -94,7 +94,7 @@ progs w # 0KB. progs msg # 0KB. ln msg dmesg progs reboot # 0KB. -#progs less # 36KB +progs less # 36KB #ln less more #progs more # 12KB special more srcdir /usr/ports/misc/44bsd-more/work @@ -181,4 +181,5 @@ libs -ledit -lutil -lmd -lcrypt -lmp -lm libs -lz -lpcap -lwrap libs -ltermcap -lgnuregex # -lcurses libs -lgeom +libs -lsbuf libs -lbsdxml # used by ifconfig Modified: head/release/picobsd/floppy.tree/etc/ttys ============================================================================== --- head/release/picobsd/floppy.tree/etc/ttys Thu Feb 19 22:28:48 2009 (r188833) +++ head/release/picobsd/floppy.tree/etc/ttys Thu Feb 19 23:29:05 2009 (r188834) @@ -1,6 +1,8 @@ # # @(#)ttys 5.1 (Berkeley) 4/17/89 # +# $FreeBSD$ +# # name getty type status comments # # This entry needed for asking password when init goes to single-user mode @@ -30,4 +32,4 @@ ttyp6 none network secure ttyp7 none network secure ttyp8 none network secure ttyp9 none network secure -ttyd0 "/usr/libexec/getty std.9600" dialup on secure +ttyu0 "/usr/libexec/getty std.9600" dialup on secure From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 00:05:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D48F106566C; Fri, 20 Feb 2009 00:05:35 +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 892238FC12; Fri, 20 Feb 2009 00:05:35 +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 n1K05Yh5011305; Fri, 20 Feb 2009 00:05:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K05YUB011304; Fri, 20 Feb 2009 00:05:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902200005.n1K05YUB011304@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 20 Feb 2009 00:05: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: r188835 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 00:05:36 -0000 Author: luigi Date: Fri Feb 20 00:05:33 2009 New Revision: 188835 URL: http://svn.freebsd.org/changeset/base/188835 Log: use /boot/loader by default, because the boot code seems to have problems with kernels larger than 4MB. Add a flag to avoid the /boot/loader and use the old method. Add support for an additional makefile to perform custom manipulation (this is not documented yet). Add support for building an ISO image (not complete) Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Thu Feb 19 23:29:05 2009 (r188834) +++ head/release/picobsd/build/picobsd Fri Feb 20 00:05:33 2009 (r188835) @@ -21,7 +21,6 @@ # Makefile.conf Makefile used to build the kernel # config shell variables, sourced here. # mfs.mtree mtree config file -# # floppy.tree/ files which go on the floppy # mfs_tree/ files which go onto the mfs # @@ -29,10 +28,13 @@ # PICOBSD kernel config file # config shell variables, sourced here. # crunch.conf crunchgen configuration +# mfs.mtree overrides ${PICO_TREE}/mfs.mtree # floppy.tree.exclude files from floppy.tree/ which we do not need here. -# floppy.tree/ local additions to the floppy.tree +# floppy.tree/ local additions to ${PICO_TREE}/mfs_free # floppy.tree.${site}/ same as above, site specific. # mfs_tree/ local additions to the mfs_free +# buildtree.mk optional makefile to build an extension for floppy tree +# (generated in buildtree/ ) # #--- The main entry point is at the end. @@ -98,6 +100,7 @@ set_defaults() { EDITOR=${EDITOR:-vi} fd_size=${fd_size:-1440} + o_use_loader="yes" # use /boot/loader o_all_in_mfs="yes" # put all files in mfs so you can boot and run # the image via diskless boot. o_clean="" # do not clean @@ -127,6 +130,7 @@ set_defaults() { # mountpoint used to build memory filesystems c_fs=fs.PICOBSD # filename used for the memory filesystem c_img=picobsd.bin # filename used for the picobsd image + generate_iso="NO" # don't generate the iso image # select the right memory disk name case `uname -r` in @@ -146,6 +150,7 @@ set_defaults() { trap fail 15 } +# entry for 4.x and earlier trees create_includes_and_libraries2() { local no log "create_includes_and_libraries2() for ${SRC}" @@ -207,7 +212,7 @@ create_includes_and_libraries() { # set_type looks in user or system directories for the floppy type # specified as first argument, and sets variables according to the config. -# file. Sets THETYPE, SITE, name, MY_TREE and BUILDDIR +# file. Also sets MY_TREE and BUILDDIR and SITE set_type() { local a i @@ -255,6 +260,13 @@ set_msgs() { # OK \t3. Site-info: ${SITE}\n\t4. Full-path: ${MY_TREE}\n" } +# build the iso image +build_iso_image() { + log "build_iso_image()" + clear + set_msgs + printf "${MSG}---> Build the iso image not ready yet\n\n" +} # Main build procedure. build_image() { @@ -307,10 +319,6 @@ build_package() { echo "##############################################" >>build.status for z in bridge dial router net isp ; do set_type ${z} - if [ "${name}" = "" ] ; then - echo "*** TYPE=${z} not found" >>build.status - continue - fi echo "---------------------------------------------">>build.status echo "Building TYPE=${z}, SIZE=${MFS_SIZE}" >>build.status msg="(ok)" # error message @@ -484,10 +492,10 @@ populate_floppy_fs() { # OK dst=${BUILDDIR}/floppy.tree log "pwd=`pwd` Populating floppy filesystem..." - # clean relics from old compilations. - rm -rf ${dst} || true - mkdir ${dst} + rm -rf ${dst} || true # clean relics from old compilations. + mkdir ${dst} # create a clean tree + # compute exclude list for generic tree excl=${MY_TREE}/floppy.tree.exclude if [ -f ${excl} ] ; then log "Files excluded from generic tree: `echo;cat ${excl}`" @@ -495,29 +503,26 @@ populate_floppy_fs() { # OK else excl="" fi - (cd ${PICO_TREE}/floppy.tree ; tar -cf - --exclude CVS --exclude .svn \ - ${excl} . ) | \ + # copy from the floppy trees into the destination + for FLOPPY_TREE in ${PICO_TREE}/floppy.tree ${MY_TREE}/floppy.tree \ + ${MY_TREE}/floppy.tree.${SITE} ; do + if [ -d ${FLOPPY_TREE} ] ; then + (cd ${FLOPPY_TREE} ; tar -cf - --exclude CVS \ + --exclude .svn ${excl} . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) - log "Copied from generic floppy-tree `echo; ls -laR ${dst}`" - - srcdir=${MY_TREE}/floppy.tree - if [ -d ${srcdir} ] ; then - log "update with type-specific files:" - (cd ${srcdir} ; tar -cf - --exclude CVS --exclude .svn . ) | \ - (cd ${dst} ; tar x${o_tarv}f - ) - log "Copied from type floppy-tree `echo; ls -laR ${dst}`" - else - log "No type-specific floppy-tree" - fi - if [ -d ${srcdir}.${SITE} ] ; then - log "Update with site-specific (${SITE}) files:" - (cd ${srcdir}.${SITE} ; tar -cf - --exclude CVS --exclude .svn . ) | \ - (cd ${dst} ; tar x${o_tarv}f - ) - log "Copied from site floppy-tree `echo; ls -laR ${dst}`" - else - log "No site-specific floppy-tree" - fi + log "Copied from ${FLOPPY_TREE}" + fi + excl="" # reset the exclude list. + done + # add local manipulation + if [ -f ${MY_TREE}/buildtree.mk ] ; then + log "building local floppy tree" + ${BINMAKE} -C ${dst} -f ${MY_TREE}/buildtree.mk floppy.tree + fi + + # compress the files in etc/, just in case + # XXX this should be done in the makefile. # gzip returns an error if it fails to compress some file (cd $dst ; gzip -9 etc/* log "Compressed files in etc/ `echo; ls -l etc`" @@ -532,13 +537,12 @@ populate_floppy_fs() { # OK # Finally, if required, make a copy of the floppy.tree onto /fd populate_mfs_tree() { - local a dst + local a dst MFS_TREE log "populate_mfs_tree()" dst=${BUILDDIR}/mfs.tree - # clean relics from old compilations. - rm -rf ${dst} || true - mkdir ${dst} + rm -rf ${dst} || true # clean relics from old compilations. + mkdir ${dst} # create a fresh tree log "pwd=`pwd`, Populating MFS tree..." @@ -555,7 +559,7 @@ populate_mfs_tree() { ln -s /dev/null ${dst}/var/run/log ln -s /etc/termcap ${dst}/usr/share/misc/termcap - + ### now build the crunched binaries ### ( cd ${BUILDDIR}/crunch log "Making and installing crunch1 from `pwd` src ${SRC}..." @@ -599,12 +603,18 @@ populate_mfs_tree() { fi done + if [ -f ${MY_TREE}/buildtree.mk ] ; then + log "building local floppy tree" + ${BINMAKE} -C ${dst} -f ${MY_TREE}/buildtree.mk mfs.tree + fi + if [ "${o_all_in_mfs}" = "yes" ]; then log "Copy generic floppy_tree into MFS..." - # this may fail in case the floppy is empty + # ignore failure in case the floppy is empty cp -Rp ${BUILDDIR}/floppy.tree/* ${dst}/fd || true fi + # 4.x compatibility - create device nodes if [ "${o_no_devfs}" != "" ] ; then # create device entries using MAKEDEV (cd ${dst}/dev @@ -623,19 +633,21 @@ populate_mfs_tree() { log "importing ${import_files} into mfs" # We do it in a chroot environment on the target so # symlinks are followed correctly. - cp `which tar` ${dst}/my_copy_of_tar + # Make sure we have a statically linked tar there. + mkdir -p ${dst}/rescue + cp /rescue/tar ${dst}/rescue (cd ${l_usrtree}/.. ; tar cf - ${import_files} ) | \ - (chroot ${dst} /my_copy_of_tar xf - ) - rm ${dst}/my_copy_of_tar + (chroot ${dst} /rescue/tar xPf - ) + rm -rf ${dst}/rescue fi (cd ${BUILDDIR} # override the owner echo "/set uid=0 gid=0" > mtree.out - mtree -c -p ${dst} -k "" >> mtree.out + mtree -ic -p ${dst} -k "" >> mtree.out log "mtre.out at ${BUILDDIR}/mtree.out" makefs -t ffs -o bsize=4096 -o fsize=512 \ - -s ${MFS_SIZE}k -f 100 -F mtree.out ${c_fs} ${dst} + -s ${MFS_SIZE}k -f 1000 -F mtree.out ${c_fs} ${dst} ls -l ${c_fs} ) log "done mfs image" } @@ -712,14 +724,16 @@ fill_floppy_image() { fi log "Labeling floppy image" - log "patch ${c_boot2} to boot /kernel right away" b2=${BUILDDIR}/boot2 # modified boot2 cp -f ${c_boot2} ${b2} chmod 0644 ${b2} - set `strings -at d ${b2} | grep "/boot/loader"` - echo -e "/kernel\0\0\0\0\0" | \ - dd of=${b2} obs=$1 oseek=1 conv=notrunc 2>/dev/null + if [ ${o_use_loader} = "no" ] ; then + log "patch ${c_boot2} to boot /kernel right away" + set `strings -at d ${b2} | grep "/boot/loader"` + echo -e "/kernel\0\0\0\0\0" | \ + dd of=${b2} obs=$1 oseek=1 conv=notrunc 2>/dev/null + fi chmod 0444 ${b2} dst=${BUILDDIR}/image.tree @@ -739,22 +753,39 @@ fill_floppy_image() { if [ ${mfs_start} -gt 0 -a ${mfs_size} -ge ${imgsize} ] ; then mfs_ofs=$((${mfs_start} + 8192)) log "Preload kernel with file ${c_fs} at ${mfs_ofs}" + logverbose "`ls -l ${c_fs}` to fit in ${mfs_size}" dd if=${c_fs} ibs=8192 iseek=1 of=kernel obs=${mfs_ofs} \ - oseek=1 conv=notrunc 2> /dev/null + oseek=1 conv=notrunc # 2> /dev/null else log "not loading mfs, size ${mfs_size} img ${imgsize}" fi log "Compress with kgzip and copy to floppy image" - kgzip -o kernel.gz kernel - cp -p kernel.gz ${dst}/kernel || fail $? no_space "copying kernel" + if [ ${o_use_loader} = "no" ] ; then + kgzip -o kernel.gz kernel + cp -p kernel.gz ${dst}/kernel || fail $? no_space "copying kernel" + else + gzip kernel + mkdir -p ${dst}/boot/kernel + echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf + echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf + cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" + cp -p kernel.gz ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" + fi - log "Now transfer floppy tree if not already in MFS image" # now transfer the floppy tree. If it is already in mfs, dont bother. if [ "${o_all_in_mfs}" != "yes" ] ; then + log "Now transfer floppy tree if not already in MFS image" cp -Rp floppy.tree/* ${dst} || \ fail $? no_space "copying floppy tree" fi ) + + # add local manipulation to the image + if [ -f ${MY_TREE}/buildtree.mk ] ; then + ${BINMAKE} -C ${dst} -f ${MY_TREE}/buildtree.mk image.tree + fi + + log "image used `du -s ${dst}` of ${blocks}k" (cd ${BUILDDIR} makefs -t ffs -o bsize=4096 -o fsize=512 \ -s ${blocks}k -f 50 ${c_img} ${dst} @@ -764,9 +795,19 @@ fill_floppy_image() { ${l_label} -f `pwd`/${c_img} | sed -e '/ c:/{p;s/c:/a:/;}' | \ ${l_label} -R -f `pwd`/${c_img} /dev/stdin ${l_label} -f `pwd`/${c_img} + ls -l ${c_img} - logverbose "after disklabel" - ) + ${l_label} -f `pwd`/${c_img} + logverbose "after disklabel" + ) + + echo "BUILDDIR ${BUILDDIR}" + if [ "${generate_iso}" = "YES" ]; then + echo "generate_iso ${generate_iso}" + #build_iso_image() + exit 1 + fi + # dump the primary and secondary boot # XXX primary is 512 bytes dd if=${c_boot1} of=${BUILDDIR}/${c_img} conv=notrunc 2>/dev/null @@ -781,7 +822,8 @@ fill_floppy_image() { rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply rm -rf ${dst} - rm ${BUILDDIR}/kernel.gz ${BUILDDIR}/${c_fs} + rm ${BUILDDIR}/${c_fs} + # rm ${BUILDDIR}/kernel.gz } # This function creates variables which depend on the source tree in use: @@ -824,8 +866,7 @@ set_build_parameters() { # arguments. set_defaults -args="" -while [ x"$1" != x ]; do +while [ true ]; do case $1 in --src) # set the source path instead of /usr/src SRC=`(cd $2; pwd)` @@ -840,12 +881,17 @@ while [ x"$1" != x ]; do shift ;; + --no_loader) # omit /boot/loader, just rely on boot2 + # (it may have problems with kernels > 4MB) + o_use_loader="no" + ;; + --all_in_mfs) o_all_in_mfs="yes" ;; --no_all_in_mfs) - o_all_in_mfs="" + o_all_in_mfs="no" ;; --modules) # also build kernel modules @@ -865,21 +911,24 @@ while [ x"$1" != x ]; do o_tarv="v" # tar verbose flag o_makeopts="-d l" # be verbose ;; + + --iso) # generate iso image + generate_iso="YES" + ;; + *) - args="$args $1" # accumulate args + break ;; esac shift done set_build_parameters # things that depend on ${SRC} +set_type $1 $2 # type and site, respectively # If $1="package", it creates a neat set of floppies -set -- ${args} [ "$1" = "package" ] && build_package -set_type $args # type and site, respectively - [ "${o_interactive}" != "NO" ] && main_dialog if [ "${o_clean}" = "YES" ] ; then From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 00:25:07 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55E0106566B; Fri, 20 Feb 2009 00:25:07 +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 993B48FC16; Fri, 20 Feb 2009 00:25:07 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n1K0P4Lu011485; Thu, 19 Feb 2009 17:25:04 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <499DF860.8020903@samsco.org> Date: Thu, 19 Feb 2009 17:25:04 -0700 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: John Baldwin References: <200902192218.n1JMI1HF009245@svn.freebsd.org> In-Reply-To: <200902192218.n1JMI1HF009245@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: r188832 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 00:25:08 -0000 John Baldwin wrote: > Author: jhb > Date: Thu Feb 19 22:18:00 2009 > New Revision: 188832 > URL: http://svn.freebsd.org/changeset/base/188832 > > Log: > When fetching attributes for a file for NFSv3 mounts, do not perform an > opportunistic ACCESS RPC to populate both the access and attribute caches > of the file and instead always use a GETATTR RPC. On many modern NFS > servers, an ACCESS RPC is much more expensive to service than a GETATTR > RPC. > Not too long ago, this was a very useful and important optimization. Can you say which servers this applies to? Could it have been made an option instead of outright deleted? Scott From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 00:26:06 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2ABD106564A; Fri, 20 Feb 2009 00:26: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 4B9E58FC24; Fri, 20 Feb 2009 00:26:06 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n1K0Q2RU011497; Thu, 19 Feb 2009 17:26:02 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <499DF89A.2030703@samsco.org> Date: Thu, 19 Feb 2009 17:26:02 -0700 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: John Baldwin References: <200902192228.n1JMSn2Q009472@svn.freebsd.org> <200902191739.46808.jhb@freebsd.org> In-Reply-To: <200902191739.46808.jhb@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.2 required=3.8 tests=ALL_TRUSTED,BAYES_00, HOT_NASTY 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: r188833 - in head/sys: kern nfsclient sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 00:26:07 -0000 John Baldwin wrote: > On Thursday 19 February 2009 5:28:49 pm John Baldwin wrote: >> Author: jhb >> Date: Thu Feb 19 22:28:48 2009 >> New Revision: 188833 >> URL: http://svn.freebsd.org/changeset/base/188833 >> >> Log: >> Enable caching of negative pathname lookups in the NFS client. To avoid >> stale entries, we save a copy of the directory's modification time when >> the first negative cache entry was added in the directory's NFS node. >> When a negative cache entry is hit during a pathname lookup, the parent >> directory's modification time is checked. If it has changed, all of the >> negative cache entries for that parent are purged and the lookup falls >> back to using the RPC. This required adding a new cache_purge_negative() >> method to the name cache to purge only negative cache entries for a given >> directory. >> >> Submitted by: mohans, Rick Macklem, Ricardo Labiaga @ NetApp >> Reviewed by: mohans > > Together with the previous two changes I measured a 30% drop in the number of > RPCs for a kernel build (no modules): > > x nfs.old > + nfs.new > +------------------------------------------------------------------------------+ > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + xx| > | + xx| > | + xx| > |++ xx| > |++ xx| > |+++ xx| > |+++ xx| > |+++ xx| > |+++ xxx| > | A A|| > +------------------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 30 250515 252053 251393 251352.13 362.86492 > + 30 173990 175930 175117 175011.87 474.44092 > Difference at 95.0% confidence > -76340.3 +/- 218.321 > -30.3718% +/- 0.0868584% > (Student's t, pooled s = 422.354) > > The majority of the drop was in the number of LOOKUP RPCs performed: > > x nfs.old > + nfs.new > +------------------------------------------------------------------------------+ > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + x | > | + xx| > | + xx| > | + xx| > | + xx| > |+++ xx| > |+++ xx| > |+++ xx| > |+++ xx| > |+++ xxx| > | A| A|| > +------------------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 30 116997 118613 117898 117887.47 372.34733 > + 30 40791 42782 41975 41846.5 481.79805 > Difference at 95.0% confidence > -76041 +/- 222.565 > -64.503% +/- 0.188794% > (Student's t, pooled s = 430.565) > > The old client performed 0 GETATTR RPC calls during the test. The new client > performs a mix of GETATTR and ACCESS calls. One of the worries was that the > client might now perform more RPC calls due to not priming the access cache, > but this is not true in this test. This next histogram is for combined totals > of ACCESS and GETATTR calls: > > x nfs.attr.old > + nfs.attr.new > +------------------------------------------------------------------------------+ > | + + x x | > | + + + + + x xxx xx | > | +++++++++ + x x xxx xx | > |+ ++++++++++ + + xxxx xxxxxxxxxx| > ||_______M_A________| |__MA__| | > +------------------------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 30 90823 90898 90858 90859.633 19.496212 > + 30 90494 90792 90537 90543.467 50.121737 > Difference at 95.0% confidence > -316.167 +/- 19.6573 > -0.347973% +/- 0.0216348% > (Student's t, pooled s = 38.0282) > > With the new client, of the ~90k ACCESS + GETATTR calls are now split into > approximately 94% GETATTR and 6% ACCESS versus 0% GETATTR and 100% ACCESS. > > All of these changes are more the product of other folks who deserve the credit > moreso than myself. > These graphs are fun, but are useless without more information on the characteristics of the server and the NFS connections. Scott From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 00:37:46 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1060) id 3D9211065676; Fri, 20 Feb 2009 00:37:46 +0000 (UTC) Date: Fri, 20 Feb 2009 00:37:46 +0000 From: Craig Rodrigues To: Scott Long Message-ID: <20090220003746.GA30711@crodrigues.org> References: <200902192218.n1JMI1HF009245@svn.freebsd.org> <499DF860.8020903@samsco.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <499DF860.8020903@samsco.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r188832 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 00:37:46 -0000 On Thu, Feb 19, 2009 at 05:25:04PM -0700, Scott Long wrote: > >URL: http://svn.freebsd.org/changeset/base/188832 > > Not too long ago, this was a very useful and important optimization. > Can you say which servers this applies to? Could it have been made an > option instead of outright deleted? At work, I was talking to a senior engineer at Netapp who looked at the FreeBSD NFS client code, and recommended that this very change be made for FreeBSD, i.e. replace ACCESS RPC calls with GETATTR RPC calls. ACCESS calls involve more work on the server for evaluating ACLS and UID mappings. -- Craig Rodrigues rodrigc@crodrigues.org From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 00:39:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B8C10656DF; Fri, 20 Feb 2009 00:39:39 +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 C40338FC23; Fri, 20 Feb 2009 00:39:39 +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 n1K0ddKA011951; Fri, 20 Feb 2009 00:39:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K0ddVa011946; Fri, 20 Feb 2009 00:39:39 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902200039.n1K0ddVa011946@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 20 Feb 2009 00:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188836 - stable/7/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 00:39:42 -0000 Author: luigi Date: Fri Feb 20 00:39:39 2009 New Revision: 188836 URL: http://svn.freebsd.org/changeset/base/188836 Log: MFC: sync the ipfw code with the version in HEAD. The only new feature is that now one can write "table all {flush | list}" to act on all tables. Just for the records, there is one difference which probably has no practical importance; two "tos" flags are represented differently now: @@ -182,8 +182,8 @@ static struct _s_x f_iptos[] = { { "throughput", IPTOS_THROUGHPUT}, { "reliability", IPTOS_RELIABILITY}, { "mincost", IPTOS_MINCOST}, - { "congestion", IPTOS_CE}, - { "ecntransport", IPTOS_ECT}, + { "congestion", IPTOS_ECN_CE}, + { "ecntransport", IPTOS_ECN_ECT0}, { "ip tos option", 0}, { NULL, 0 } }; IPTOS_ECT = IPTOS_ECN_ECT0 = 2 so 'ecntransport' is the same. IPTOS_CE = 1, IPTOS_ECN_CE = 3 so 'congestion' is represented by a different codepoint, but this also reflects a different specification (RFC3168 obsoletes RFC2481) so the change is just adopting the new spec. Added: stable/7/sbin/ipfw/altq.c (contents, props changed) stable/7/sbin/ipfw/dummynet.c (contents, props changed) stable/7/sbin/ipfw/ipfw2.h (contents, props changed) stable/7/sbin/ipfw/ipv6.c (contents, props changed) stable/7/sbin/ipfw/main.c (contents, props changed) stable/7/sbin/ipfw/nat.c (contents, props changed) Modified: stable/7/sbin/ipfw/Makefile stable/7/sbin/ipfw/ipfw.8 stable/7/sbin/ipfw/ipfw2.c Modified: stable/7/sbin/ipfw/Makefile ============================================================================== --- stable/7/sbin/ipfw/Makefile Fri Feb 20 00:05:33 2009 (r188835) +++ stable/7/sbin/ipfw/Makefile Fri Feb 20 00:39:39 2009 (r188836) @@ -1,8 +1,8 @@ # $FreeBSD$ PROG= ipfw -SRCS= ipfw2.c -WARNS?= 0 +SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c altq.c +WARNS?= 2 MAN= ipfw.8 .include Added: stable/7/sbin/ipfw/altq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sbin/ipfw/altq.c Fri Feb 20 00:39:39 2009 (r188836) @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2002-2003 Luigi Rizzo + * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Idea and grammar partially left from: + * Copyright (c) 1993 Daniel Boulet + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + * NEW command line interface for IP firewall facility + * + * $FreeBSD$ + * + * altq interface + */ + +#include +#include +#include + +#include "ipfw2.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include /* IFNAMSIZ */ +#include +#include + +/* + * Map between current altq queue id numbers and names. + */ +static TAILQ_HEAD(, pf_altq) altq_entries = + TAILQ_HEAD_INITIALIZER(altq_entries); + +void +altq_set_enabled(int enabled) +{ + int pffd; + + pffd = open("/dev/pf", O_RDWR); + if (pffd == -1) + err(EX_UNAVAILABLE, + "altq support opening pf(4) control device"); + if (enabled) { + if (ioctl(pffd, DIOCSTARTALTQ) != 0 && errno != EEXIST) + err(EX_UNAVAILABLE, "enabling altq"); + } else { + if (ioctl(pffd, DIOCSTOPALTQ) != 0 && errno != ENOENT) + err(EX_UNAVAILABLE, "disabling altq"); + } + close(pffd); +} + +static void +altq_fetch(void) +{ + struct pfioc_altq pfioc; + struct pf_altq *altq; + int pffd; + unsigned int mnr; + static int altq_fetched = 0; + + if (altq_fetched) + return; + altq_fetched = 1; + pffd = open("/dev/pf", O_RDONLY); + if (pffd == -1) { + warn("altq support opening pf(4) control device"); + return; + } + bzero(&pfioc, sizeof(pfioc)); + if (ioctl(pffd, DIOCGETALTQS, &pfioc) != 0) { + warn("altq support getting queue list"); + close(pffd); + return; + } + mnr = pfioc.nr; + for (pfioc.nr = 0; pfioc.nr < mnr; pfioc.nr++) { + if (ioctl(pffd, DIOCGETALTQ, &pfioc) != 0) { + if (errno == EBUSY) + break; + warn("altq support getting queue list"); + close(pffd); + return; + } + if (pfioc.altq.qid == 0) + continue; + altq = safe_calloc(1, sizeof(*altq)); + *altq = pfioc.altq; + TAILQ_INSERT_TAIL(&altq_entries, altq, entries); + } + close(pffd); +} + +u_int32_t +altq_name_to_qid(const char *name) +{ + struct pf_altq *altq; + + altq_fetch(); + TAILQ_FOREACH(altq, &altq_entries, entries) + if (strcmp(name, altq->qname) == 0) + break; + if (altq == NULL) + errx(EX_DATAERR, "altq has no queue named `%s'", name); + return altq->qid; +} + +const char * +altq_qid_to_name(u_int32_t qid) +{ + struct pf_altq *altq; + + altq_fetch(); + TAILQ_FOREACH(altq, &altq_entries, entries) + if (qid == altq->qid) + break; + if (altq == NULL) + return NULL; + return altq->qname; +} + +void +print_altq_cmd(ipfw_insn_altq *altqptr) +{ + if (altqptr) { + const char *qname; + + qname = altq_qid_to_name(altqptr->qid); + if (qname == NULL) + printf(" altq ?<%u>", altqptr->qid); + else + printf(" altq %s", qname); + } +} Added: stable/7/sbin/ipfw/dummynet.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sbin/ipfw/dummynet.c Fri Feb 20 00:39:39 2009 (r188836) @@ -0,0 +1,719 @@ +/* + * Copyright (c) 2002-2003 Luigi Rizzo + * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Idea and grammar partially left from: + * Copyright (c) 1993 Daniel Boulet + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + * NEW command line interface for IP firewall facility + * + * $FreeBSD$ + * + * dummynet support + */ + +#include +#include +#include +/* XXX there are several sysctl leftover here */ +#include + +#include "ipfw2.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include /* inet_ntoa */ + +static struct _s_x dummynet_params[] = { + { "plr", TOK_PLR }, + { "noerror", TOK_NOERROR }, + { "buckets", TOK_BUCKETS }, + { "dst-ip", TOK_DSTIP }, + { "src-ip", TOK_SRCIP }, + { "dst-port", TOK_DSTPORT }, + { "src-port", TOK_SRCPORT }, + { "proto", TOK_PROTO }, + { "weight", TOK_WEIGHT }, + { "all", TOK_ALL }, + { "mask", TOK_MASK }, + { "droptail", TOK_DROPTAIL }, + { "red", TOK_RED }, + { "gred", TOK_GRED }, + { "bw", TOK_BW }, + { "bandwidth", TOK_BW }, + { "delay", TOK_DELAY }, + { "pipe", TOK_PIPE }, + { "queue", TOK_QUEUE }, + { "flow-id", TOK_FLOWID}, + { "dst-ipv6", TOK_DSTIP6}, + { "dst-ip6", TOK_DSTIP6}, + { "src-ipv6", TOK_SRCIP6}, + { "src-ip6", TOK_SRCIP6}, + { "dummynet-params", TOK_NULL }, + { NULL, 0 } /* terminator */ +}; + +static int +sort_q(const void *pa, const void *pb) +{ + int rev = (co.do_sort < 0); + int field = rev ? -co.do_sort : co.do_sort; + long long res = 0; + const struct dn_flow_queue *a = pa; + const struct dn_flow_queue *b = pb; + + switch (field) { + case 1: /* pkts */ + res = a->len - b->len; + break; + case 2: /* bytes */ + res = a->len_bytes - b->len_bytes; + break; + + case 3: /* tot pkts */ + res = a->tot_pkts - b->tot_pkts; + break; + + case 4: /* tot bytes */ + res = a->tot_bytes - b->tot_bytes; + break; + } + if (res < 0) + res = -1; + if (res > 0) + res = 1; + return (int)(rev ? res : -res); +} + +static void +list_queues(struct dn_flow_set *fs, struct dn_flow_queue *q) +{ + int l; + int index_printed, indexes = 0; + char buff[255]; + struct protoent *pe; + + if (fs->rq_elements == 0) + return; + + if (co.do_sort != 0) + heapsort(q, fs->rq_elements, sizeof *q, sort_q); + + /* Print IPv4 flows */ + index_printed = 0; + for (l = 0; l < fs->rq_elements; l++) { + struct in_addr ina; + + /* XXX: Should check for IPv4 flows */ + if (IS_IP6_FLOW_ID(&(q[l].id))) + continue; + + if (!index_printed) { + index_printed = 1; + if (indexes > 0) /* currently a no-op */ + printf("\n"); + indexes++; + printf(" " + "mask: 0x%02x 0x%08x/0x%04x -> 0x%08x/0x%04x\n", + fs->flow_mask.proto, + fs->flow_mask.src_ip, fs->flow_mask.src_port, + fs->flow_mask.dst_ip, fs->flow_mask.dst_port); + + printf("BKT Prot ___Source IP/port____ " + "____Dest. IP/port____ " + "Tot_pkt/bytes Pkt/Byte Drp\n"); + } + + printf("%3d ", q[l].hash_slot); + pe = getprotobynumber(q[l].id.proto); + if (pe) + printf("%-4s ", pe->p_name); + else + printf("%4u ", q[l].id.proto); + ina.s_addr = htonl(q[l].id.src_ip); + printf("%15s/%-5d ", + inet_ntoa(ina), q[l].id.src_port); + ina.s_addr = htonl(q[l].id.dst_ip); + printf("%15s/%-5d ", + inet_ntoa(ina), q[l].id.dst_port); + printf("%4llu %8llu %2u %4u %3u\n", + align_uint64(&q[l].tot_pkts), + align_uint64(&q[l].tot_bytes), + q[l].len, q[l].len_bytes, q[l].drops); + if (co.verbose) + printf(" S %20llu F %20llu\n", + align_uint64(&q[l].S), align_uint64(&q[l].F)); + } + + /* Print IPv6 flows */ + index_printed = 0; + for (l = 0; l < fs->rq_elements; l++) { + if (!IS_IP6_FLOW_ID(&(q[l].id))) + continue; + + if (!index_printed) { + index_printed = 1; + if (indexes > 0) + printf("\n"); + indexes++; + printf("\n mask: proto: 0x%02x, flow_id: 0x%08x, ", + fs->flow_mask.proto, fs->flow_mask.flow_id6); + inet_ntop(AF_INET6, &(fs->flow_mask.src_ip6), + buff, sizeof(buff)); + printf("%s/0x%04x -> ", buff, fs->flow_mask.src_port); + inet_ntop( AF_INET6, &(fs->flow_mask.dst_ip6), + buff, sizeof(buff) ); + printf("%s/0x%04x\n", buff, fs->flow_mask.dst_port); + + printf("BKT ___Prot___ _flow-id_ " + "______________Source IPv6/port_______________ " + "_______________Dest. IPv6/port_______________ " + "Tot_pkt/bytes Pkt/Byte Drp\n"); + } + printf("%3d ", q[l].hash_slot); + pe = getprotobynumber(q[l].id.proto); + if (pe != NULL) + printf("%9s ", pe->p_name); + else + printf("%9u ", q[l].id.proto); + printf("%7d %39s/%-5d ", q[l].id.flow_id6, + inet_ntop(AF_INET6, &(q[l].id.src_ip6), buff, sizeof(buff)), + q[l].id.src_port); + printf(" %39s/%-5d ", + inet_ntop(AF_INET6, &(q[l].id.dst_ip6), buff, sizeof(buff)), + q[l].id.dst_port); + printf(" %4llu %8llu %2u %4u %3u\n", + align_uint64(&q[l].tot_pkts), + align_uint64(&q[l].tot_bytes), + q[l].len, q[l].len_bytes, q[l].drops); + if (co.verbose) + printf(" S %20llu F %20llu\n", + align_uint64(&q[l].S), + align_uint64(&q[l].F)); + } +} + +static void +print_flowset_parms(struct dn_flow_set *fs, char *prefix) +{ + int l; + char qs[30]; + char plr[30]; + char red[90]; /* Display RED parameters */ + + l = fs->qsize; + if (fs->flags_fs & DN_QSIZE_IS_BYTES) { + if (l >= 8192) + sprintf(qs, "%d KB", l / 1024); + else + sprintf(qs, "%d B", l); + } else + sprintf(qs, "%3d sl.", l); + if (fs->plr) + sprintf(plr, "plr %f", 1.0 * fs->plr / (double)(0x7fffffff)); + else + plr[0] = '\0'; + if (fs->flags_fs & DN_IS_RED) /* RED parameters */ + sprintf(red, + "\n\t %cRED w_q %f min_th %d max_th %d max_p %f", + (fs->flags_fs & DN_IS_GENTLE_RED) ? 'G' : ' ', + 1.0 * fs->w_q / (double)(1 << SCALE_RED), + SCALE_VAL(fs->min_th), + SCALE_VAL(fs->max_th), + 1.0 * fs->max_p / (double)(1 << SCALE_RED)); + else + sprintf(red, "droptail"); + + printf("%s %s%s %d queues (%d buckets) %s\n", + prefix, qs, plr, fs->rq_elements, fs->rq_size, red); +} + +void +ipfw_list_pipes(void *data, uint nbytes, int ac, char *av[]) +{ + int rulenum; + void *next = data; + struct dn_pipe *p = (struct dn_pipe *) data; + struct dn_flow_set *fs; + struct dn_flow_queue *q; + int l; + + if (ac > 0) + rulenum = strtoul(*av++, NULL, 10); + else + rulenum = 0; + for (; nbytes >= sizeof *p; p = (struct dn_pipe *)next) { + double b = p->bandwidth; + char buf[30]; + char prefix[80]; + + if (SLIST_NEXT(p, next) != (struct dn_pipe *)DN_IS_PIPE) + break; /* done with pipes, now queues */ + + /* + * compute length, as pipe have variable size + */ + l = sizeof(*p) + p->fs.rq_elements * sizeof(*q); + next = (char *)p + l; + nbytes -= l; + + if ((rulenum != 0 && rulenum != p->pipe_nr) || co.do_pipe == 2) + continue; + + /* + * Print rate (or clocking interface) + */ + if (p->if_name[0] != '\0') + sprintf(buf, "%s", p->if_name); + else if (b == 0) + sprintf(buf, "unlimited"); + else if (b >= 1000000) + sprintf(buf, "%7.3f Mbit/s", b/1000000); + else if (b >= 1000) + sprintf(buf, "%7.3f Kbit/s", b/1000); + else + sprintf(buf, "%7.3f bit/s ", b); + + sprintf(prefix, "%05d: %s %4d ms ", + p->pipe_nr, buf, p->delay); + print_flowset_parms(&(p->fs), prefix); + if (co.verbose) + printf(" V %20llu\n", align_uint64(&p->V) >> MY_M); + + q = (struct dn_flow_queue *)(p+1); + list_queues(&(p->fs), q); + } + for (fs = next; nbytes >= sizeof *fs; fs = next) { + char prefix[80]; + + if (SLIST_NEXT(fs, next) != (struct dn_flow_set *)DN_IS_QUEUE) + break; + l = sizeof(*fs) + fs->rq_elements * sizeof(*q); + next = (char *)fs + l; + nbytes -= l; + + if (rulenum != 0 && ((rulenum != fs->fs_nr && co.do_pipe == 2) || + (rulenum != fs->parent_nr && co.do_pipe == 1))) { + continue; + } + + q = (struct dn_flow_queue *)(fs+1); + sprintf(prefix, "q%05d: weight %d pipe %d ", + fs->fs_nr, fs->weight, fs->parent_nr); + print_flowset_parms(fs, prefix); + list_queues(fs, q); + } +} + +/* + * Delete pipe or queue i + */ +int +ipfw_delete_pipe(int pipe_or_queue, int i) +{ + struct dn_pipe p; + + memset(&p, 0, sizeof p); + if (pipe_or_queue == 1) + p.pipe_nr = i; /* pipe */ + else + p.fs.fs_nr = i; /* queue */ + i = do_cmd(IP_DUMMYNET_DEL, &p, sizeof p); + if (i) { + i = 1; + warn("rule %u: setsockopt(IP_DUMMYNET_DEL)", i); + } + return i; +} + +void +ipfw_config_pipe(int ac, char **av) +{ + struct dn_pipe p; + int i; + char *end; + void *par = NULL; + + memset(&p, 0, sizeof p); + + av++; ac--; + /* Pipe number */ + if (ac && isdigit(**av)) { + i = atoi(*av); av++; ac--; + if (co.do_pipe == 1) + p.pipe_nr = i; + else + p.fs.fs_nr = i; + } + while (ac > 0) { + double d; + int tok = match_token(dummynet_params, *av); + ac--; av++; + + switch(tok) { + case TOK_NOERROR: + p.fs.flags_fs |= DN_NOERROR; + break; + + case TOK_PLR: + NEED1("plr needs argument 0..1\n"); + d = strtod(av[0], NULL); + if (d > 1) + d = 1; + else if (d < 0) + d = 0; + p.fs.plr = (int)(d*0x7fffffff); + ac--; av++; + break; + + case TOK_QUEUE: + NEED1("queue needs queue size\n"); + end = NULL; + p.fs.qsize = strtoul(av[0], &end, 0); + if (*end == 'K' || *end == 'k') { + p.fs.flags_fs |= DN_QSIZE_IS_BYTES; + p.fs.qsize *= 1024; + } else if (*end == 'B' || + _substrcmp2(end, "by", "bytes") == 0) { + p.fs.flags_fs |= DN_QSIZE_IS_BYTES; + } + ac--; av++; + break; + + case TOK_BUCKETS: + NEED1("buckets needs argument\n"); + p.fs.rq_size = strtoul(av[0], NULL, 0); + ac--; av++; + break; + + case TOK_MASK: + NEED1("mask needs mask specifier\n"); + /* + * per-flow queue, mask is dst_ip, dst_port, + * src_ip, src_port, proto measured in bits + */ + par = NULL; + + bzero(&p.fs.flow_mask, sizeof(p.fs.flow_mask)); + end = NULL; + + while (ac >= 1) { + uint32_t *p32 = NULL; + uint16_t *p16 = NULL; + uint32_t *p20 = NULL; + struct in6_addr *pa6 = NULL; + uint32_t a; + + tok = match_token(dummynet_params, *av); + ac--; av++; + switch(tok) { + case TOK_ALL: + /* + * special case, all bits significant + */ + p.fs.flow_mask.dst_ip = ~0; + p.fs.flow_mask.src_ip = ~0; + p.fs.flow_mask.dst_port = ~0; + p.fs.flow_mask.src_port = ~0; + p.fs.flow_mask.proto = ~0; + n2mask(&(p.fs.flow_mask.dst_ip6), 128); + n2mask(&(p.fs.flow_mask.src_ip6), 128); + p.fs.flow_mask.flow_id6 = ~0; + p.fs.flags_fs |= DN_HAVE_FLOW_MASK; + goto end_mask; + + case TOK_DSTIP: + p32 = &p.fs.flow_mask.dst_ip; + break; + + case TOK_SRCIP: + p32 = &p.fs.flow_mask.src_ip; + break; + + case TOK_DSTIP6: + pa6 = &(p.fs.flow_mask.dst_ip6); + break; + + case TOK_SRCIP6: + pa6 = &(p.fs.flow_mask.src_ip6); + break; + + case TOK_FLOWID: + p20 = &p.fs.flow_mask.flow_id6; + break; + + case TOK_DSTPORT: + p16 = &p.fs.flow_mask.dst_port; + break; + + case TOK_SRCPORT: + p16 = &p.fs.flow_mask.src_port; + break; + + case TOK_PROTO: + break; + + default: + ac++; av--; /* backtrack */ + goto end_mask; + } + if (ac < 1) + errx(EX_USAGE, "mask: value missing"); + if (*av[0] == '/') { + a = strtoul(av[0]+1, &end, 0); + if (pa6 == NULL) + a = (a == 32) ? ~0 : (1 << a) - 1; + } else + a = strtoul(av[0], &end, 0); + if (p32 != NULL) + *p32 = a; + else if (p16 != NULL) { + if (a > 0xFFFF) + errx(EX_DATAERR, + "port mask must be 16 bit"); + *p16 = (uint16_t)a; + } else if (p20 != NULL) { + if (a > 0xfffff) + errx(EX_DATAERR, + "flow_id mask must be 20 bit"); + *p20 = (uint32_t)a; + } else if (pa6 != NULL) { + if (a > 128) + errx(EX_DATAERR, + "in6addr invalid mask len"); + else + n2mask(pa6, a); + } else { + if (a > 0xFF) + errx(EX_DATAERR, + "proto mask must be 8 bit"); + p.fs.flow_mask.proto = (uint8_t)a; + } + if (a != 0) + p.fs.flags_fs |= DN_HAVE_FLOW_MASK; + ac--; av++; + } /* end while, config masks */ +end_mask: + break; + + case TOK_RED: + case TOK_GRED: + NEED1("red/gred needs w_q/min_th/max_th/max_p\n"); + p.fs.flags_fs |= DN_IS_RED; + if (tok == TOK_GRED) + p.fs.flags_fs |= DN_IS_GENTLE_RED; + /* + * the format for parameters is w_q/min_th/max_th/max_p + */ + if ((end = strsep(&av[0], "/"))) { + double w_q = strtod(end, NULL); + if (w_q > 1 || w_q <= 0) + errx(EX_DATAERR, "0 < w_q <= 1"); + p.fs.w_q = (int) (w_q * (1 << SCALE_RED)); + } + if ((end = strsep(&av[0], "/"))) { + p.fs.min_th = strtoul(end, &end, 0); + if (*end == 'K' || *end == 'k') + p.fs.min_th *= 1024; + } + if ((end = strsep(&av[0], "/"))) { + p.fs.max_th = strtoul(end, &end, 0); + if (*end == 'K' || *end == 'k') + p.fs.max_th *= 1024; + } + if ((end = strsep(&av[0], "/"))) { + double max_p = strtod(end, NULL); + if (max_p > 1 || max_p <= 0) + errx(EX_DATAERR, "0 < max_p <= 1"); + p.fs.max_p = (int)(max_p * (1 << SCALE_RED)); + } + ac--; av++; + break; + + case TOK_DROPTAIL: + p.fs.flags_fs &= ~(DN_IS_RED|DN_IS_GENTLE_RED); + break; + + case TOK_BW: + NEED1("bw needs bandwidth or interface\n"); + if (co.do_pipe != 1) + errx(EX_DATAERR, "bandwidth only valid for pipes"); + /* + * set clocking interface or bandwidth value + */ + if (av[0][0] >= 'a' && av[0][0] <= 'z') { + int l = sizeof(p.if_name)-1; + /* interface name */ + strncpy(p.if_name, av[0], l); + p.if_name[l] = '\0'; + p.bandwidth = 0; + } else { + p.if_name[0] = '\0'; + p.bandwidth = strtoul(av[0], &end, 0); + if (*end == 'K' || *end == 'k') { + end++; + p.bandwidth *= 1000; + } else if (*end == 'M') { + end++; + p.bandwidth *= 1000000; + } + if ((*end == 'B' && + _substrcmp2(end, "Bi", "Bit/s") != 0) || + _substrcmp2(end, "by", "bytes") == 0) + p.bandwidth *= 8; + if (p.bandwidth < 0) + errx(EX_DATAERR, "bandwidth too large"); + } + ac--; av++; + break; + + case TOK_DELAY: + if (co.do_pipe != 1) + errx(EX_DATAERR, "delay only valid for pipes"); + NEED1("delay needs argument 0..10000ms\n"); + p.delay = strtoul(av[0], NULL, 0); + ac--; av++; + break; + + case TOK_WEIGHT: + if (co.do_pipe == 1) + errx(EX_DATAERR,"weight only valid for queues"); + NEED1("weight needs argument 0..100\n"); + p.fs.weight = strtoul(av[0], &end, 0); + ac--; av++; + break; + + case TOK_PIPE: + if (co.do_pipe == 1) + errx(EX_DATAERR,"pipe only valid for queues"); + NEED1("pipe needs pipe_number\n"); + p.fs.parent_nr = strtoul(av[0], &end, 0); + ac--; av++; + break; + + default: + errx(EX_DATAERR, "unrecognised option ``%s''", av[-1]); + } + } + if (co.do_pipe == 1) { + if (p.pipe_nr == 0) + errx(EX_DATAERR, "pipe_nr must be > 0"); + if (p.delay > 10000) + errx(EX_DATAERR, "delay must be < 10000"); + } else { /* co.do_pipe == 2, queue */ + if (p.fs.parent_nr == 0) + errx(EX_DATAERR, "pipe must be > 0"); + if (p.fs.weight >100) + errx(EX_DATAERR, "weight must be <= 100"); + } + if (p.fs.flags_fs & DN_QSIZE_IS_BYTES) { + size_t len; + long limit; + + len = sizeof(limit); + if (sysctlbyname("net.inet.ip.dummynet.pipe_byte_limit", + &limit, &len, NULL, 0) == -1) + limit = 1024*1024; + if (p.fs.qsize > limit) + errx(EX_DATAERR, "queue size must be < %ldB", limit); + } else { + size_t len; + long limit; + + len = sizeof(limit); + if (sysctlbyname("net.inet.ip.dummynet.pipe_slot_limit", + &limit, &len, NULL, 0) == -1) + limit = 100; + if (p.fs.qsize > limit) + errx(EX_DATAERR, "2 <= queue size <= %ld", limit); + } + if (p.fs.flags_fs & DN_IS_RED) { + size_t len; + int lookup_depth, avg_pkt_size; + double s, idle, weight, w_q; + struct clockinfo ck; + int t; + + if (p.fs.min_th >= p.fs.max_th) + errx(EX_DATAERR, "min_th %d must be < than max_th %d", + p.fs.min_th, p.fs.max_th); + if (p.fs.max_th == 0) + errx(EX_DATAERR, "max_th must be > 0"); + + len = sizeof(int); + if (sysctlbyname("net.inet.ip.dummynet.red_lookup_depth", + &lookup_depth, &len, NULL, 0) == -1) + errx(1, "sysctlbyname(\"%s\")", + "net.inet.ip.dummynet.red_lookup_depth"); + if (lookup_depth == 0) + errx(EX_DATAERR, "net.inet.ip.dummynet.red_lookup_depth" + " must be greater than zero"); + + len = sizeof(int); + if (sysctlbyname("net.inet.ip.dummynet.red_avg_pkt_size", + &avg_pkt_size, &len, NULL, 0) == -1) + + errx(1, "sysctlbyname(\"%s\")", + "net.inet.ip.dummynet.red_avg_pkt_size"); + if (avg_pkt_size == 0) + errx(EX_DATAERR, + "net.inet.ip.dummynet.red_avg_pkt_size must" + " be greater than zero"); + + len = sizeof(struct clockinfo); + if (sysctlbyname("kern.clockrate", &ck, &len, NULL, 0) == -1) + errx(1, "sysctlbyname(\"%s\")", "kern.clockrate"); + + /* + * Ticks needed for sending a medium-sized packet. + * Unfortunately, when we are configuring a WF2Q+ queue, we + * do not have bandwidth information, because that is stored + * in the parent pipe, and also we have multiple queues + * competing for it. So we set s=0, which is not very + * correct. But on the other hand, why do we want RED with + * WF2Q+ ? + */ + if (p.bandwidth==0) /* this is a WF2Q+ queue */ + s = 0; + else + s = (double)ck.hz * avg_pkt_size * 8 / p.bandwidth; + + /* + * max idle time (in ticks) before avg queue size becomes 0. + * NOTA: (3/w_q) is approx the value x so that + * (1-w_q)^x < 10^-3. + */ + w_q = ((double)p.fs.w_q) / (1 << SCALE_RED); + idle = s * 3. / w_q; + p.fs.lookup_step = (int)idle / lookup_depth; + if (!p.fs.lookup_step) + p.fs.lookup_step = 1; + weight = 1 - w_q; + for (t = p.fs.lookup_step; t > 1; --t) + weight *= 1 - w_q; + p.fs.lookup_weight = (int)(weight * (1 << SCALE_RED)); + } + i = do_cmd(IP_DUMMYNET_CONFIGURE, &p, sizeof p); + if (i) + err(1, "setsockopt(%s)", "IP_DUMMYNET_CONFIGURE"); +} Modified: stable/7/sbin/ipfw/ipfw.8 ============================================================================== --- stable/7/sbin/ipfw/ipfw.8 Fri Feb 20 00:05:33 2009 (r188835) +++ stable/7/sbin/ipfw/ipfw.8 Fri Feb 20 00:39:39 2009 (r188836) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2007 +.Dd September 27, 2008 .Dt IPFW 8 .Os .Sh NAME @@ -49,9 +49,13 @@ .Nm .Cm table Ar number Cm delete Ar addr Ns Op / Ns Ar masklen .Nm -.Cm table Ar number Cm flush +.Cm table +.Brq Ar number | all +.Cm flush .Nm -.Cm table Ar number Cm list +.Cm table +.Brq Ar number | all +.Cm list .Pp .Nm .Brq Cm pipe | queue @@ -537,7 +541,7 @@ A match is only declared with the specif This can be useful for a number of applications such as random packet drop or (in conjunction with -.Xr dummynet 4 ) +.Nm dummynet ) to simulate the effect of multiple paths leading to out-of-order packet delivery. .Pp @@ -553,7 +557,7 @@ with a .Dv LOG_SECURITY facility. The logging only occurs if the sysctl variable -.Em net.inet.ip.fw.verbose +.Va net.inet.ip.fw.verbose is set to 1 (which is the default when the kernel is compiled with .Dv IPFIREWALL_VERBOSE ) @@ -564,7 +568,7 @@ parameter. If no .Cm logamount is specified, the limit is taken from the sysctl variable -.Em net.inet.ip.fw.verbose_limit . +.Va net.inet.ip.fw.verbose_limit . In both cases, a value of 0 removes the logging limit. .Pp Once the limit is reached, logging can be re-enabled by @@ -666,7 +670,7 @@ and .Nm .Cm disable Ar altq . The usage of -.Em net.inet.ip.fw.one_pass +.Va net.inet.ip.fw.one_pass is irrelevant to ALTQ traffic shaping, as the actual rule action is followed always after adding an ALTQ tag. .El @@ -760,7 +764,7 @@ see the Section for further information. .It Cm pipe Ar pipe_nr Pass packet to a -.Xr dummynet 4 +.Nm dummynet .Dq pipe (for bandwidth limitation, delay, etc.). See the @@ -770,12 +774,12 @@ The search terminates; however, on exit the .Xr sysctl 8 variable -.Em net.inet.ip.fw.one_pass +.Va net.inet.ip.fw.one_pass is not set, the packet is passed again to the firewall code starting from the next rule. .It Cm queue Ar queue_nr Pass packet to a -.Xr dummynet 4 +.Nm dummynet .Dq queue (for bandwidth limitation using WF2Q+). .It Cm reject @@ -841,12 +845,12 @@ Divert packet into netgraph with given The search terminates. If packet is later returned from netgraph it is either accepted or continues with the next rule, depending on -.Em net.inet.ip.fw.one_pass +.Va net.inet.ip.fw.one_pass sysctl variable. .It Cm ngtee Ar cookie A copy of packet is diverted into netgraph, original packet is either accepted or continues with the next rule, depending on -.Em net.inet.ip.fw.one_pass +.Va net.inet.ip.fw.one_pass sysctl variable. See .Xr ng_ipfw 4 @@ -1193,7 +1197,7 @@ Matches ICMP packets whose ICMP type is .Ar types . The list may be specified as any combination of individual types (numeric) separated by commas. -.Em Ranges are not allowed. +.Em Ranges are not allowed . The supported ICMP types are: .Pp echo reply @@ -1231,7 +1235,7 @@ Matches ICMP6 packets whose ICMP6 type i *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 02:48:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9BB106566B; Fri, 20 Feb 2009 02:48:59 +0000 (UTC) (envelope-from beech@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0FF8FC12; Fri, 20 Feb 2009 02:48:59 +0000 (UTC) (envelope-from beech@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K2mwkW014445; Fri, 20 Feb 2009 02:48:58 GMT (envelope-from beech@svn.freebsd.org) Received: (from beech@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K2mwkK014444; Fri, 20 Feb 2009 02:48:58 GMT (envelope-from beech@svn.freebsd.org) Message-Id: <200902200248.n1K2mwkK014444@svn.freebsd.org> From: Beech Rintoul Date: Fri, 20 Feb 2009 02:48: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: r188837 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 02:48:59 -0000 Author: beech (ports committer) Date: Fri Feb 20 02:48:58 2009 New Revision: 188837 URL: http://svn.freebsd.org/changeset/base/188837 Log: - Add glarkin and mva to mentor section Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Feb 20 00:39:39 2009 (r188836) +++ head/share/misc/committers-ports.dot Fri Feb 20 02:48:58 2009 (r188837) @@ -173,6 +173,9 @@ arved -> stefan asami -> obrien +beech -> glarkin +beech -> mva + billf -> sobomax billf -> will @@ -265,6 +268,7 @@ miwi -> beat miwi -> farrokhi miwi -> gahr miwi -> makc +miwi -> mva miwi -> nox miwi -> tabthorpe miwi -> trasz From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 04:10:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A401065675; Fri, 20 Feb 2009 04:10:31 +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 D5C798FC08; Fri, 20 Feb 2009 04:10:31 +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 n1K4AVfQ016237; Fri, 20 Feb 2009 04:10:31 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K4AVZg016236; Fri, 20 Feb 2009 04:10:31 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902200410.n1K4AVZg016236@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 20 Feb 2009 04:10: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: r188838 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 04:10:32 -0000 Author: marcel Date: Fri Feb 20 04:10:31 2009 New Revision: 188838 URL: http://svn.freebsd.org/changeset/base/188838 Log: Fix an infinite loop created when the last logical partition is removed. 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 Fri Feb 20 02:48:58 2009 (r188837) +++ head/sys/geom/part/g_part_ebr.c Fri Feb 20 04:10:31 2009 (r188838) @@ -561,9 +561,9 @@ g_part_ebr_write(struct g_part_table *ba le32enc(p + 8, entry->ent.dp_start); le32enc(p + 12, entry->ent.dp_size); - do { - next = LIST_NEXT(baseentry, gpe_entry); - } while (next != NULL && next->gpe_deleted); + next = LIST_NEXT(baseentry, gpe_entry); + while (next != NULL && next->gpe_deleted) + next = LIST_NEXT(next, gpe_entry); p += DOSPARTSIZE; if (next != NULL) From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 04:48:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 611A1106564A; Fri, 20 Feb 2009 04:48:41 +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 4EEF98FC08; Fri, 20 Feb 2009 04:48:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K4mfg2016924; Fri, 20 Feb 2009 04:48:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K4mfYW016919; Fri, 20 Feb 2009 04:48:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902200448.n1K4mfYW016919@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 20 Feb 2009 04:48: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: r188839 - in head/sys: geom geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 04:48:42 -0000 Author: marcel Date: Fri Feb 20 04:48:40 2009 New Revision: 188839 URL: http://svn.freebsd.org/changeset/base/188839 Log: Provide compatibility symlink for logical partitions: 1. Extend geom_dev by having it create the symlink (i.e. call make_dev_alias) based on the DIOCGPROVIDERALIAS ioctl. In this way the functionaility is generic and thus usable by any geom/provider. 2. Have g_part handle said ioctl through the devalias method, so that it's under control of the scheme itself. By design the alias will not be created for newly added partitions. Modified: head/sys/geom/geom_dev.c head/sys/geom/part/g_part.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_if.m head/sys/sys/disk.h Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Feb 20 04:10:31 2009 (r188838) +++ head/sys/geom/geom_dev.c Fri Feb 20 04:48:40 2009 (r188839) @@ -113,6 +113,7 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; + char *alias; int error; struct cdev *dev; @@ -134,6 +135,17 @@ g_dev_taste(struct g_class *mp, struct g gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; + + g_topology_unlock(); + + alias = g_malloc(MAXPATHLEN, M_WAITOK | M_ZERO); + error = (pp->geom->ioctl == NULL) ? ENODEV : + pp->geom->ioctl(pp, DIOCGPROVIDERALIAS, alias, 0, curthread); + if (!error && alias[0] != '\0') + make_dev_alias(dev, "%s", alias); + g_free(alias); + + g_topology_lock(); return (gp); } Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Feb 20 04:10:31 2009 (r188838) +++ head/sys/geom/part/g_part.c Fri Feb 20 04:48:40 2009 (r188839) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -87,6 +88,7 @@ static g_taste_t g_part_taste; static g_access_t g_part_access; static g_dumpconf_t g_part_dumpconf; +static g_ioctl_t g_part_ioctl; static g_orphan_t g_part_orphan; static g_spoiled_t g_part_spoiled; static g_start_t g_part_start; @@ -103,6 +105,7 @@ static struct g_class g_part_class = { /* Geom methods. */ .access = g_part_access, .dumpconf = g_part_dumpconf, + .ioctl = g_part_ioctl, .orphan = g_part_orphan, .spoiled = g_part_spoiled, .start = g_part_start, @@ -566,6 +569,8 @@ g_part_ctl_commit(struct gctl_req *req, return (EPERM); } + g_topology_unlock(); + cp = LIST_FIRST(&gp->consumer); if ((table->gpt_smhead | table->gpt_smtail) != 0) { pp = cp->provider; @@ -594,6 +599,7 @@ g_part_ctl_commit(struct gctl_req *req, } if (table->gpt_scheme == &g_part_null_scheme) { + g_topology_lock(); g_access(cp, -1, -1, -1); g_part_wither(gp, ENXIO); return (0); @@ -614,10 +620,13 @@ g_part_ctl_commit(struct gctl_req *req, } table->gpt_created = 0; table->gpt_opened = 0; + + g_topology_lock(); g_access(cp, -1, -1, -1); return (0); fail: + g_topology_lock(); gctl_error(req, "%d", error); return (error); } @@ -1591,6 +1600,31 @@ g_part_dumpconf(struct sbuf *sb, const c } } +static int +g_part_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct g_geom *gp; + struct g_part_table *table; + struct g_part_entry *entry; + int error; + + gp = pp->geom; + table = gp->softc; + entry = pp->private; + + switch (cmd) { + case DIOCGPROVIDERALIAS: + error = G_PART_DEVALIAS(table, entry, data, MAXPATHLEN); + break; + default: + error = ENOTTY; + break; + } + + return (error); +} + static void g_part_orphan(struct g_consumer *cp) { Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Fri Feb 20 04:10:31 2009 (r188838) +++ head/sys/geom/part/g_part_ebr.c Fri Feb 20 04:48:40 2009 (r188839) @@ -54,12 +54,15 @@ struct g_part_ebr_table { struct g_part_ebr_entry { struct g_part_entry base; struct dos_partition ent; + int alias; }; static int g_part_ebr_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static int g_part_ebr_create(struct g_part_table *, struct g_part_parms *); static int g_part_ebr_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_ebr_devalias(struct g_part_table *, struct g_part_entry *, + char *, size_t); static void g_part_ebr_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_ebr_dumpto(struct g_part_table *, struct g_part_entry *); @@ -81,6 +84,7 @@ static kobj_method_t g_part_ebr_methods[ KOBJMETHOD(g_part_add, g_part_ebr_add), KOBJMETHOD(g_part_create, g_part_ebr_create), KOBJMETHOD(g_part_destroy, g_part_ebr_destroy), + KOBJMETHOD(g_part_devalias, g_part_ebr_devalias), KOBJMETHOD(g_part_dumpconf, g_part_ebr_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_ebr_dumpto), KOBJMETHOD(g_part_modify, g_part_ebr_modify), @@ -267,6 +271,25 @@ g_part_ebr_destroy(struct g_part_table * return (0); } +static int +g_part_ebr_devalias(struct g_part_table *table, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + struct g_part_ebr_entry *entry; + size_t len; + + entry = (struct g_part_ebr_entry *)baseentry; + if (entry->alias == 0) + return (ENOENT); + + len = strlcpy(buf, table->gpt_gp->name, bufsz); + if (len == 0) + return (EINVAL); + + snprintf(buf + len - 1, bufsz - len, "%d", entry->alias); + return (0); +} + static void g_part_ebr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) @@ -413,12 +436,13 @@ g_part_ebr_read(struct g_part_table *bas u_char *buf; off_t ofs, msize; u_int lba; - int error, index; + int alias, error, index; pp = cp->provider; table = (struct g_part_ebr_table *)basetable; msize = pp->mediasize / pp->sectorsize; + alias = 5; lba = 0; while (1) { ofs = (off_t)lba * pp->sectorsize; @@ -445,6 +469,7 @@ g_part_ebr_read(struct g_part_table *bas pp->sectorsize; entry = (struct g_part_ebr_entry *)baseentry; entry->ent = ent[0]; + entry->alias = alias++; if (ent[1].dp_typ == 0) break; Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Fri Feb 20 04:10:31 2009 (r188838) +++ head/sys/geom/part/g_part_if.m Fri Feb 20 04:48:40 2009 (r188839) @@ -75,6 +75,15 @@ METHOD int destroy { struct g_part_parms *gpp; }; +# devalias() - return the name (if any) to be used as an alias for +# the device special file created for the partition entry. +METHOD int devalias { + struct g_part_table *table; + struct g_part_entry *entry; + char *buf; + size_t bufsz; +}; + # dumpconf() METHOD void dumpconf { struct g_part_table *table; Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Fri Feb 20 04:10:31 2009 (r188838) +++ head/sys/sys/disk.h Fri Feb 20 04:48:40 2009 (r188839) @@ -104,4 +104,10 @@ void disk_err(struct bio *bp, const char * must be at least MAXPATHLEN bytes long. */ +#define DIOCGPROVIDERALIAS _IOR('d', 139, char[MAXPATHLEN]) + /*- + * Store the provider alias, if present, in a buffer. The buffer must + * be at least MAXPATHLEN bytes long. + */ + #endif /* _SYS_DISK_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 06:10:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3046A106564A; Fri, 20 Feb 2009 06:10:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5288FC13; Fri, 20 Feb 2009 06:10:13 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K6ADOL018373; Fri, 20 Feb 2009 06:10:13 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K6ACM1018370; Fri, 20 Feb 2009 06:10:12 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902200610.n1K6ACM1018370@svn.freebsd.org> From: Scott Long Date: Fri, 20 Feb 2009 06:10: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: r188840 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 06:10:13 -0000 Author: scottl Date: Fri Feb 20 06:10:12 2009 New Revision: 188840 URL: http://svn.freebsd.org/changeset/base/188840 Log: Add basic support for DDF, often found on Adaptec HostRAID controllers. Spares and rebuilds are not supported, so this code should be considered for entertainment purposes only. Added: head/sys/dev/ata/ata-raid-ddf.h (contents, props changed) Modified: head/sys/dev/ata/ata-raid.c head/sys/dev/ata/ata-raid.h Added: head/sys/dev/ata/ata-raid-ddf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ata/ata-raid-ddf.h Fri Feb 20 06:10:12 2009 (r188840) @@ -0,0 +1,333 @@ +/*- + * Copyright (c) 2008 Scott Long + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR 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 ATA_RAID_DDF_H +#define ATA_RAID_DDF_H + +/* Definitions from the SNIA DDF spec, rev 1.2 */ + +#define DDF_HEADER_LENGTH 512 +struct ddf_header { + uint32_t Signature; +#define DDF_HEADER_SIGNATURE 0xde11de11 + uint32_t CRC; + uint8_t DDF_Header_GUID[24]; + uint8_t DDF_rev[8]; + uint32_t Sequence_Number; + uint32_t TimeStamp; + uint8_t Open_Flag; +#define DDF_HEADER_CLOSED 0x00 +#define DDF_HEADER_OPENED_MASK 0x0f +#define DDF_HEADER_OPEN_ANCHOR 0xff + uint8_t Foreign_Flag; + uint8_t Diskgrouping; + uint8_t pad1[13]; + uint8_t Header_ext[32]; + uint64_t Primary_Header_LBA; + uint64_t Secondary_Header_LBA; + uint8_t Header_Type; +#define DDF_HEADER_ANCHOR 0x00 +#define DDF_HEADER_PRIMARY 0x01 +#define DDF_HEADER_SECONDARY 0x02 + uint8_t pad2[3]; + uint32_t WorkSpace_Length; + uint64_t WorkSpace_LBA; + uint16_t Max_PD_Entries; + uint16_t Max_VD_Entries; + uint16_t Max_Partitions; + uint16_t Configuration_Record_Length; + uint16_t Max_Primary_Element_Entries; + uint8_t pad3[54]; + uint32_t cd_section; /* Controller_Data_Section */ + uint32_t cd_length; /* Controller_Data_Section_Length */ + uint32_t pdr_section; /* Physical_Drive_Records_Section */ + uint32_t pdr_length; /* Physical_Drive_Records_Length */ + uint32_t vdr_section; /* Virtual_Drive_Records_Section */ + uint32_t vdr_length; /* Virtual_Drive_Records_Length */ + uint32_t cr_section; /* Configuration_Records_Section */ + uint32_t cr_length; /* Configuration_Records_Length */ + uint32_t pdd_section; /* Physical_Drive_Data_Section */ + uint32_t pdd_length; /* Physical_Drive_Data_Length */ + uint32_t bbmlog_section; /* BBM_Log_Section */ + uint32_t bbmlog_length; /* BBM_Log_Section_Length */ + uint32_t Diagnostic_Space; + uint32_t Diagnostic_Space_Length; + uint32_t Vendor_Specific_Logs; + uint32_t Vendor_Specific_Logs_Length; + uint8_t pad4[256]; +} __packed; + +struct ddf_cd_record { + uint32_t Signature; +#define DDF_CONTROLLER_DATA_SIGNATURE 0xad111111 + uint32_t CRC; + uint8_t Controller_GUID[24]; + struct { + uint16_t Vendor_ID; + uint16_t Device_ID; + uint16_t SubVendor_ID; + uint16_t SubDevice_ID; + } Controller_Type __packed; + uint8_t Product_ID[16]; + uint8_t pad1[8]; + uint8_t Controller_Data[448]; +} __packed; + +struct ddf_device_scsi { + uint8_t Lun; + uint8_t Id; + uint8_t Channel; + uint8_t Path_Flags; +#define DDF_DEVICE_SCSI_FLAG_BROKEN (1 << 7) +} __packed; + +struct ddf_device_sas { + uint64_t Initiator_Path; +} __packed; + +union ddf_pathinfo { + struct { + struct ddf_device_scsi Path0; + struct ddf_device_scsi Path1; + uint8_t pad[10]; + } __packed scsi; + struct { + struct ddf_device_sas Path0; + struct ddf_device_sas Path1; + uint8_t Path0_Flags; + uint8_t Path1_Flags; +#define DDF_DEVICE_SAS_FLAG_BROKEN (1 << 7) + } __packed sas; +} __packed; + +struct ddf_pd_entry { + uint8_t PD_GUID[24]; + uint32_t PD_Reference; + uint16_t PD_Type; +#define DDF_PDE_GUID_FORCE (1 << 0) +#define DDF_PDE_PARTICIPATING (1 << 1) +#define DDF_PDE_GLOBAL_SPARE (1 << 2) +#define DDF_PDE_CONFIG_SPARE (1 << 3) +#define DDF_PDE_FOREIGN (1 << 4) +#define DDF_PDE_LEGACY (1 << 5) +#define DDF_PDE_TYPE_MASK (0x0f << 12) +#define DDF_PDE_UNKNOWN (0x00 << 12) +#define DDF_PDE_SCSI (0x01 << 12) +#define DDF_PDE_SAS (0x02 << 12) +#define DDF_PDE_SATA (0x03 << 12) +#define DDF_PDE_FC (0x04 << 12) + uint16_t PD_State; +#define DDF_PDE_ONLINE (1 << 0) +#define DDF_PDE_FAILED (1 << 1) +#define DDF_PDE_REBUILD (1 << 2) +#define DDF_PDE_TRANSITION (1 << 3) +#define DDF_PDE_PFA (1 << 4) +#define DDF_PDE_UNRECOVERED (1 << 5) +#define DDF_PDE_MISSING (1 << 6) + uint64_t Configured_Size; + union ddf_pathinfo Path_Information; + uint8_t pad1[6]; +} __packed; + +struct ddf_pd_record { + uint32_t Signature; +#define DDF_PDR_SIGNATURE 0x22222222 + uint32_t CRC; + uint16_t Populated_PDEs; + uint16_t Max_PDE_Supported; + uint8_t pad1[52]; + struct ddf_pd_entry entry[0]; +} __packed; + +struct ddf_vd_entry { + uint8_t VD_GUID[24]; + uint16_t VD_Number; + uint8_t pad1[2]; + uint16_t VD_Type; +#define DDF_VDE_SHARED (1 << 0) +#define DDF_VDE_ENFORCE_GROUP (1 << 1) +#define DDF_VDE_UNICODE_NAME (1 << 2) +#define DDF_VDE_OWNER_ID_VALID (1 << 3) + uint16_t Controller_GUID_CRC; + uint8_t VD_State; +#define DDF_VDE_OPTIMAL 0x00 +#define DDF_VDE_DEGRADED 0x01 +#define DDF_VDE_DELETED 0x02 +#define DDF_VDE_MISSING 0x03 +#define DDF_VDE_FAILED 0x04 +#define DDF_VDE_PARTIAL 0x05 +#define DDF_VDE_STATE_MASK 0x07 +#define DDF_VDE_MORPH (1 << 3) +#define DDF_VDE_DIRTY (1 << 4) + uint8_t Init_State; +#define DDF_VDE_UNINTIALIZED 0x00 +#define DDF_VDE_INIT_QUICK 0x01 +#define DDF_VDE_INIT_FULL 0x02 +#define DDF_VDE_INIT_MASK 0x03 +#define DDF_VDE_UACCESS_RW 0x00 +#define DDF_VDE_UACCESS_RO 0x80 +#define DDF_VDE_UACCESS_BLOCKED 0xc0 +#define DDF_VDE_UACCESS_MASK 0xc0 + uint8_t pad2[14]; + uint8_t VD_Name[16]; +} __packed; + +struct ddf_vd_record { + uint32_t Signature; +#define DDF_VD_RECORD_SIGNATURE 0xdddddddd + uint32_t CRC; + uint16_t Populated_VDEs; + uint16_t Max_VDE_Supported; + uint8_t pad1[52]; + struct ddf_vd_entry entry[0]; +} __packed; + +#define DDF_CR_INVALID 0xffffffff + +struct ddf_vdc_record { + uint32_t Signature; +#define DDF_VDCR_SIGNATURE 0xeeeeeeee + uint32_t CRC; + uint8_t VD_GUID[24]; + uint32_t Timestamp; + uint32_t Sequence_Number; + uint8_t pad1[24]; + uint16_t Primary_Element_Count; + uint8_t Stripe_Size; + uint8_t Primary_RAID_Level; +#define DDF_VDCR_RAID0 0x00 +#define DDF_VDCR_RAID1 0x01 +#define DDF_VDCR_RAID3 0x03 +#define DDF_VDCR_RAID4 0x04 +#define DDF_VDCR_RAID5 0x05 +#define DDF_VDCR_RAID6 0x06 +#define DDF_VDCR_RAID1E 0x11 +#define DDF_VDCR_SINGLE 0x0f +#define DDF_VDCR_CONCAT 0x1f +#define DDF_VDCR_RAID5E 0x15 +#define DDF_VDCR_RAID5EE 0x25 + uint8_t RLQ; + uint8_t Secondary_Element_Count; + uint8_t Secondary_Element_Seq; + uint8_t Secondary_RAID_Level; + uint64_t Block_Count; + uint64_t VD_Size; + uint8_t pad2[8]; + uint32_t Associated_Spares[8]; + uint64_t Cache_Flags; +#define DDF_VDCR_CACHE_WB (1 << 0) +#define DDF_VDCR_CACHE_WB_ADAPTIVE (1 << 1) +#define DDF_VDCR_CACHE_RA (1 << 2) +#define DDF_VDCR_CACHE_RA_ADAPTIVE (1 << 3) +#define DDF_VDCR_CACHE_WCACHE_NOBATTERY (1 << 4) +#define DDF_VDCR_CACHE_WCACHE_ALLOW (1 << 5) +#define DDF_VDCR_CACHE_RCACHE_ALLOW (1 << 6) +#define DDF_VDCR_CACHE_VENDOR (1 << 7) + uint8_t BG_Rate; + uint8_t pad3[3]; + uint8_t pad4[52]; + uint8_t pad5[192]; + uint8_t V0[32]; + uint8_t V1[32]; + uint8_t V2[16]; + uint8_t V3[16]; + uint8_t Vendor_Scratch[32]; + uint32_t Physical_Disk_Sequence[0]; +} __packed; + +struct ddf_vuc_record { + uint32_t Signature; +#define DDF_VUCR_SIGNATURE 0x88888888 + uint32_t CRC; + uint8_t VD_GUID[24]; +} __packed; + +struct ddf_sa_entry { + uint8_t VD_GUID[24]; + uint16_t Secondary_Element; + uint8_t rsrvd2[6]; +} __packed; + +struct ddf_sa_record { + uint32_t Signature; +#define DDF_SA_SIGNATURE 0x55555555 + uint32_t CRC; + uint32_t Timestamp; + uint8_t pad1[7]; + uint8_t Spare_Type; +#define DDF_SAR_TYPE_DEDICATED (1 << 0) +#define DDF_SAR_TYPE_REVERTIBLE (1 << 1) +#define DDF_SAR_TYPE_ACTIVE (1 << 2) +#define DDF_SAR_TYPE_ENCL_AFFINITY (1 << 3) + uint16_t Populated_SAEs; + uint16_t MAX_SAE_Supported; + uint8_t pad2[8]; + struct ddf_sa_entry entry[0]; +} __packed; + +struct ddf_pdd_record { + uint32_t Signature; +#define DDF_PDD_SIGNATURE 0x33333333 + uint32_t CRC; + uint8_t PD_GUID[24]; + uint32_t PD_Reference; + uint8_t Forced_Ref_Flag; +#define DDF_PDD_FORCED_REF 0x01 + uint8_t Forced_PD_GUID_Flag; +#define DDF_PDD_FORCED_GUID 0x01 + uint8_t Vendor_Scratch[32]; + uint8_t pad2[442]; +} __packed; + +struct ddf_bbm_entry { + uint64_t Defective_Block_Start; + uint32_t Spare_Block_Offset; + uint16_t Remapped_Count; + uint8_t pad[2]; +}; + +struct ddf_bbm_log { + uint32_t Signature; +#define DDF_BBML_SIGNATURE 0xabadb10c + uint32_t CRC; + uint16_t Entry_Count; + uint32_t Spare_Block_Count; + uint8_t pad1[10]; + uint64_t First_Spare_LBA; + uint64_t Mapped_Block_Entry[0]; +} __packed; + +struct ddf_vendor_log { + uint32_t Signature; +#define DDF_VENDOR_LOG_SIGNATURE 0x01dbeef0 + uint32_t CRC; + uint64_t Log_Owner; + uint8_t pad1[16]; +} __packed; + +#endif Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Fri Feb 20 04:48:40 2009 (r188839) +++ head/sys/dev/ata/ata-raid.c Fri Feb 20 06:10:12 2009 (r188840) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -65,6 +66,7 @@ static int ata_raid_read_metadata(device static int ata_raid_write_metadata(struct ar_softc *rdp); static int ata_raid_wipe_metadata(struct ar_softc *rdp); static int ata_raid_adaptec_read_meta(device_t dev, struct ar_softc **raidp); +static int ata_raid_ddf_read_meta(device_t dev, struct ar_softc **raidp); static int ata_raid_hptv2_read_meta(device_t dev, struct ar_softc **raidp); static int ata_raid_hptv2_write_meta(struct ar_softc *rdp); static int ata_raid_hptv3_read_meta(device_t dev, struct ar_softc **raidp); @@ -93,6 +95,7 @@ static char * ata_raid_flags(struct ar_s /* debugging only */ static void ata_raid_print_meta(struct ar_softc *meta); static void ata_raid_adaptec_print_meta(struct adaptec_raid_conf *meta); +static void ata_raid_ddf_print_meta(uint8_t *meta); static void ata_raid_hptv2_print_meta(struct hptv2_raid_conf *meta); static void ata_raid_hptv3_print_meta(struct hptv3_raid_conf *meta); static void ata_raid_intel_print_meta(struct intel_raid_conf *meta); @@ -1417,6 +1420,10 @@ ata_raid_read_metadata(device_t subdisk) if (ata_raid_lsiv2_read_meta(subdisk, ata_raid_arrays)) return 0; + /* DDF (used by Adaptec, maybe others) */ + if (ata_raid_ddf_read_meta(subdisk, ata_raid_arrays)) + return 0; + /* if none of the above matched, try FreeBSD native format */ return ata_raid_promise_read_meta(subdisk, ata_raid_arrays, 1); } @@ -1688,6 +1695,338 @@ adaptec_out: return retval; } +static uint64_t +ddfbe64toh(uint64_t val) +{ + return (be64toh(val)); +} + +static uint32_t +ddfbe32toh(uint32_t val) +{ + return (be32toh(val)); +} + +static uint16_t +ddfbe16toh(uint16_t val) +{ + return (be16toh(val)); +} + +static uint64_t +ddfle64toh(uint64_t val) +{ + return (le64toh(val)); +} + +static uint32_t +ddfle32toh(uint32_t val) +{ + return (le32toh(val)); +} + +static uint16_t +ddfle16toh(uint16_t val) +{ + return (le16toh(val)); +} + +static int +ata_raid_ddf_read_meta(device_t dev, struct ar_softc **raidp) +{ + struct ata_raid_subdisk *ars; + device_t parent = device_get_parent(dev); + struct ddf_header *hdr; + struct ddf_pd_record *pdr; + struct ddf_pd_entry *pde = NULL; + struct ddf_vd_record *vdr; + struct ddf_pdd_record *pdd; + struct ddf_sa_record *sa = NULL; + struct ddf_vdc_record *vdcr = NULL; + struct ddf_vd_entry *vde = NULL; + struct ar_softc *raid; + uint64_t pri_lba; + uint32_t pd_ref, pd_pos; + uint8_t *meta, *cr; + int hdr_len, vd_state = 0, pd_state = 0; + int i, disk, array, retval = 0; + uintptr_t max_cr_addr; + uint64_t (*ddf64toh)(uint64_t) = NULL; + uint32_t (*ddf32toh)(uint32_t) = NULL; + uint16_t (*ddf16toh)(uint16_t) = NULL; + + ars = device_get_softc(dev); + raid = NULL; + + /* Read in the anchor header */ + if (!(meta = malloc(DDF_HEADER_LENGTH, M_AR, M_NOWAIT | M_ZERO))) + return ENOMEM; + + if (ata_raid_rw(parent, DDF_LBA(parent), + meta, DDF_HEADER_LENGTH, ATA_R_READ)) { + if (testing || bootverbose) + device_printf(parent, "DDF read metadata failed\n"); + goto ddf_out; + } + + /* + * Check if this is a DDF RAID struct. Note the apparent "flexibility" + * regarding endianness. + */ + hdr = (struct ddf_header *)meta; + if (be32toh(hdr->Signature) == DDF_HEADER_SIGNATURE) { + ddf64toh = ddfbe64toh; + ddf32toh = ddfbe32toh; + ddf16toh = ddfbe16toh; + } else if (le32toh(hdr->Signature) == DDF_HEADER_SIGNATURE) { + ddf64toh = ddfle64toh; + ddf32toh = ddfle32toh; + ddf16toh = ddfle16toh; + } else + goto ddf_out; + + if (hdr->Header_Type != DDF_HEADER_ANCHOR) { + if (testing || bootverbose) + device_printf(parent, "DDF check1 failed\n"); + goto ddf_out; + } + + pri_lba = ddf64toh(hdr->Primary_Header_LBA); + hdr_len = ddf32toh(hdr->cd_section) + ddf32toh(hdr->cd_length); + hdr_len = max(hdr_len,ddf32toh(hdr->pdr_section)+ddf32toh(hdr->pdr_length)); + hdr_len = max(hdr_len,ddf32toh(hdr->vdr_section)+ddf32toh(hdr->vdr_length)); + hdr_len = max(hdr_len,ddf32toh(hdr->cr_section) +ddf32toh(hdr->cr_length)); + hdr_len = max(hdr_len,ddf32toh(hdr->pdd_section)+ddf32toh(hdr->pdd_length)); + if (testing || bootverbose) + device_printf(parent, "DDF pri_lba= %llu length= %d blocks\n", + (unsigned long long)pri_lba, hdr_len); + if ((pri_lba + hdr_len) > DDF_LBA(parent)) { + device_printf(parent, "DDF exceeds length of disk\n"); + goto ddf_out; + } + + /* Don't need the anchor anymore, read the rest of the metadata */ + free(meta, M_AR); + if (!(meta = malloc(hdr_len * DEV_BSIZE, M_AR, M_NOWAIT | M_ZERO))) + return ENOMEM; + + if (ata_raid_rw(parent, pri_lba, meta, hdr_len * DEV_BSIZE, ATA_R_READ)) { + if (testing || bootverbose) + device_printf(parent, "DDF read full metadata failed\n"); + goto ddf_out; + } + + /* Check that we got a Primary Header */ + hdr = (struct ddf_header *)meta; + if ((ddf32toh(hdr->Signature) != DDF_HEADER_SIGNATURE) || + (hdr->Header_Type != DDF_HEADER_PRIMARY)) { + if (testing || bootverbose) + device_printf(parent, "DDF check2 failed\n"); + goto ddf_out; + } + + if (testing || bootverbose) + ata_raid_ddf_print_meta(meta); + + if ((hdr->Open_Flag >= 0x01) && (hdr->Open_Flag <= 0x0f)) { + device_printf(parent, "DDF Header open, possibly corrupt metadata\n"); + goto ddf_out; + } + + pdr = (struct ddf_pd_record*)(meta + ddf32toh(hdr->pdr_section)*DEV_BSIZE); + vdr = (struct ddf_vd_record*)(meta + ddf32toh(hdr->vdr_section)*DEV_BSIZE); + cr = (uint8_t *)(meta + ddf32toh(hdr->cr_section)*DEV_BSIZE); + pdd = (struct ddf_pdd_record*)(meta + ddf32toh(hdr->pdd_section)*DEV_BSIZE); + + /* Verify the Physical Disk Device Record */ + if (ddf32toh(pdd->Signature) != DDF_PDD_SIGNATURE) { + device_printf(parent, "Invalid PD Signature\n"); + goto ddf_out; + } + pd_ref = ddf32toh(pdd->PD_Reference); + pd_pos = -1; + + /* Verify the Physical Disk Record and make sure the disk is usable */ + if (ddf32toh(pdr->Signature) != DDF_PDR_SIGNATURE) { + device_printf(parent, "Invalid PDR Signature\n"); + goto ddf_out; + } + for (i = 0; i < ddf16toh(pdr->Populated_PDEs); i++) { + if (ddf32toh(pdr->entry[i].PD_Reference) != pd_ref) + continue; + pde = &pdr->entry[i]; + pd_state = ddf16toh(pde->PD_State); + } + if ((pde == NULL) || + ((pd_state & DDF_PDE_ONLINE) == 0) || + (pd_state & (DDF_PDE_FAILED|DDF_PDE_MISSING|DDF_PDE_UNRECOVERED))) { + device_printf(parent, "Physical disk not usable\n"); + goto ddf_out; + } + + /* Parse out the configuration record, look for spare and VD records. + * While DDF supports a disk being part of more than one array, and + * thus having more than one VDCR record, that feature is not supported + * by ATA-RAID. Therefore, the first record found takes precedence. + */ + max_cr_addr = (uintptr_t)cr + ddf32toh(hdr->cr_length) * DEV_BSIZE - 1; + for ( ; (uintptr_t)cr < max_cr_addr; + cr += ddf16toh(hdr->Configuration_Record_Length) * DEV_BSIZE) { + switch (ddf32toh(((uint32_t *)cr)[0])) { + case DDF_VDCR_SIGNATURE: + vdcr = (struct ddf_vdc_record *)cr; + goto cr_found; + break; + case DDF_VUCR_SIGNATURE: + /* Don't care about this record */ + break; + case DDF_SA_SIGNATURE: + sa = (struct ddf_sa_record *)cr; + goto cr_found; + break; + case DDF_CR_INVALID: + /* A record was deliberately invalidated */ + break; + default: + device_printf(parent, "Invalid CR signature found\n"); + } + } +cr_found: + if ((vdcr == NULL) /* && (sa == NULL) * Spares not supported yet */) { + device_printf(parent, "No usable configuration record found\n"); + goto ddf_out; + } + + if (vdcr != NULL) { + if (vdcr->Secondary_Element_Count != 1) { + device_printf(parent, "Unsupported multi-level Virtual Disk\n"); + goto ddf_out; + } + + /* Find the Virtual Disk Entry for this array */ + if (ddf32toh(vdr->Signature) != DDF_VD_RECORD_SIGNATURE) { + device_printf(parent, "Invalid VDR Signature\n"); + goto ddf_out; + } + for (i = 0; i < ddf16toh(vdr->Populated_VDEs); i++) { + if (bcmp(vdr->entry[i].VD_GUID, vdcr->VD_GUID, 24)) + continue; + vde = &vdr->entry[i]; + vd_state = vde->VD_State & DDF_VDE_STATE_MASK; + } + if ((vde == NULL) || + ((vd_state != DDF_VDE_OPTIMAL) && (vd_state != DDF_VDE_DEGRADED))) { + device_printf(parent, "Unusable Virtual Disk\n"); + goto ddf_out; + } + for (i = 0; i < ddf16toh(hdr->Max_Primary_Element_Entries); i++) { + uint32_t pd_tmp; + + pd_tmp = ddf32toh(vdcr->Physical_Disk_Sequence[i]); + if ((pd_tmp == 0x00000000) || (pd_tmp == 0xffffffff)) + continue; + if (pd_tmp == pd_ref) { + pd_pos = i; + break; + } + } + if (pd_pos == -1) { + device_printf(parent, "Physical device not part of array\n"); + goto ddf_out; + } + } + + /* now convert DDF metadata into our generic form */ + for (array = 0; array < MAX_ARRAYS; array++) { + if (!raidp[array]) { + raid = (struct ar_softc *)malloc(sizeof(struct ar_softc), M_AR, + M_NOWAIT | M_ZERO); + if (!raid) { + device_printf(parent, "failed to allocate metadata storage\n"); + goto ddf_out; + } + } else + raid = raidp[array]; + + if (raid->format && (raid->format != AR_F_DDF_RAID)) + continue; + + if (raid->magic_0 && (raid->magic_0 != crc32(vde->VD_GUID, 24))) + continue; + + if (!raidp[array]) { + raidp[array] = raid; + + switch (vdcr->Primary_RAID_Level) { + case DDF_VDCR_RAID0: + raid->magic_0 = crc32(vde->VD_GUID, 24); + raid->magic_1 = ddf16toh(vde->VD_Number); + raid->type = AR_T_RAID0; + raid->interleave = 1 << vdcr->Stripe_Size; + raid->width = ddf16toh(vdcr->Primary_Element_Count); + break; + + case DDF_VDCR_RAID1: + raid->magic_0 = crc32(vde->VD_GUID, 24); + raid->magic_1 = ddf16toh(vde->VD_Number); + raid->type = AR_T_RAID1; + raid->width = 1; + break; + + default: + device_printf(parent, "DDF unsupported RAID type 0x%02x\n", + vdcr->Primary_RAID_Level); + free(raidp[array], M_AR); + raidp[array] = NULL; + goto ddf_out; + } + + raid->format = AR_F_DDF_RAID; + raid->generation = ddf32toh(vdcr->Sequence_Number); + raid->total_disks = ddf16toh(vdcr->Primary_Element_Count); + raid->total_sectors = ddf64toh(vdcr->VD_Size); + raid->heads = 255; + raid->sectors = 63; + raid->cylinders = raid->total_sectors / (63 * 255); + raid->offset_sectors = 0; + raid->rebuild_lba = 0; + raid->lun = array; + strncpy(raid->name, vde->VD_Name, + min(sizeof(raid->name), sizeof(vde->VD_Name))); + + /* clear out any old info */ + if (raid->generation) { + for (disk = 0; disk < raid->total_disks; disk++) { + raid->disks[disk].dev = NULL; + raid->disks[disk].flags = 0; + } + } + } + if (ddf32toh(vdcr->Sequence_Number) >= raid->generation) { + int disk_number = pd_pos; + + raid->disks[disk_number].dev = parent; + + /* Adaptec appears to not set vdcr->Block_Count, yet again in + * gross violation of the spec. + */ + raid->disks[disk_number].sectors = ddf64toh(vdcr->Block_Count); + if (raid->disks[disk_number].sectors == 0) + raid->disks[disk_number].sectors=ddf64toh(pde->Configured_Size); + raid->disks[disk_number].flags = + (AR_DF_ONLINE | AR_DF_PRESENT | AR_DF_ASSIGNED); + ars->raid[raid->volume] = raid; + ars->disk_number[raid->volume] = disk_number; + retval = 1; + } + break; + } + +ddf_out: + free(meta, M_AR); + return retval; +} + /* Highpoint V2 RocketRAID Metadata */ static int ata_raid_hptv2_read_meta(device_t dev, struct ar_softc **raidp) @@ -4271,6 +4610,7 @@ ata_raid_format(struct ar_softc *rdp) switch (rdp->format) { case AR_F_FREEBSD_RAID: return "FreeBSD PseudoRAID"; case AR_F_ADAPTEC_RAID: return "Adaptec HostRAID"; + case AR_F_DDF_RAID: return "DDF"; case AR_F_HPTV2_RAID: return "HighPoint v2 RocketRAID"; case AR_F_HPTV3_RAID: return "HighPoint v3 RocketRAID"; case AR_F_INTEL_RAID: return "Intel MatrixRAID"; @@ -4427,6 +4767,71 @@ ata_raid_adaptec_print_meta(struct adapt printf("=================================================\n"); } +static void +ata_raid_ddf_print_meta(uint8_t *meta) +{ + struct ddf_header *hdr; + struct ddf_cd_record *cd; + struct ddf_pd_record *pdr; + struct ddf_pd_entry *pde; + struct ddf_vd_record *vdr; + struct ddf_vd_entry *vde; + struct ddf_pdd_record *pdd; + uint64_t (*ddf64toh)(uint64_t) = NULL; + uint32_t (*ddf32toh)(uint32_t) = NULL; + uint16_t (*ddf16toh)(uint16_t) = NULL; + uint8_t *cr; + char *r; + + /* Check if this is a DDF RAID struct */ + hdr = (struct ddf_header *)meta; + if (be32toh(hdr->Signature) == DDF_HEADER_SIGNATURE) { + ddf64toh = ddfbe64toh; + ddf32toh = ddfbe32toh; + ddf16toh = ddfbe16toh; + } else { + ddf64toh = ddfle64toh; + ddf32toh = ddfle32toh; + ddf16toh = ddfle16toh; + } + + hdr = (struct ddf_header*)meta; + cd = (struct ddf_cd_record*)(meta + ddf32toh(hdr->cd_section) *DEV_BSIZE); + pdr = (struct ddf_pd_record*)(meta + ddf32toh(hdr->pdr_section)*DEV_BSIZE); + vdr = (struct ddf_vd_record*)(meta + ddf32toh(hdr->vdr_section)*DEV_BSIZE); + cr = (uint8_t *)(meta + ddf32toh(hdr->cr_section) * DEV_BSIZE); + pdd = (struct ddf_pdd_record*)(meta + ddf32toh(hdr->pdd_section)*DEV_BSIZE); + pde = NULL; + vde = NULL; + + printf("********* ATA DDF Metadata *********\n"); + printf("**** Header ****\n"); + r = (char *)&hdr->DDF_rev[0]; + printf("DDF_rev= %8.8s Sequence_Number= 0x%x Open_Flag= 0x%x\n", r, + ddf32toh(hdr->Sequence_Number), hdr->Open_Flag); + printf("Primary Header LBA= %llu Header_Type = 0x%x\n", + (unsigned long long)ddf64toh(hdr->Primary_Header_LBA), + hdr->Header_Type); + printf("Max_PD_Entries= %d Max_VD_Entries= %d Max_Partitions= %d " + "CR_Length= %d\n", ddf16toh(hdr->Max_PD_Entries), + ddf16toh(hdr->Max_VD_Entries), ddf16toh(hdr->Max_Partitions), + ddf16toh(hdr->Configuration_Record_Length)); + printf("CD= %d:%d PDR= %d:%d VDR= %d:%d CR= %d:%d PDD= %d%d\n", + ddf32toh(hdr->cd_section), ddf32toh(hdr->cd_length), + ddf32toh(hdr->pdr_section), ddf32toh(hdr->pdr_length), + ddf32toh(hdr->vdr_section), ddf32toh(hdr->vdr_length), + ddf32toh(hdr->cr_section), ddf32toh(hdr->cr_length), + ddf32toh(hdr->pdd_section), ddf32toh(hdr->pdd_length)); + printf("**** Controler Data ****\n"); + r = (char *)&cd->Product_ID[0]; + printf("Product_ID: %16.16s\n", r); + printf("Vendor 0x%x, Device 0x%x, SubVendor 0x%x, Sub_Device 0x%x\n", + ddf16toh(cd->Controller_Type.Vendor_ID), + ddf16toh(cd->Controller_Type.Device_ID), + ddf16toh(cd->Controller_Type.SubVendor_ID), + ddf16toh(cd->Controller_Type.SubDevice_ID)); +} + static char * ata_raid_hptv2_type(int type) { Modified: head/sys/dev/ata/ata-raid.h ============================================================================== --- head/sys/dev/ata/ata-raid.h Fri Feb 20 04:48:40 2009 (r188839) +++ head/sys/dev/ata/ata-raid.h Fri Feb 20 06:10:12 2009 (r188840) @@ -76,7 +76,8 @@ struct ar_softc { #define AR_F_SII_RAID 0x0800 #define AR_F_SIS_RAID 0x1000 #define AR_F_VIA_RAID 0x2000 -#define AR_F_FORMAT_MASK 0x3fff +#define AR_F_DDF_RAID 0x4000 +#define AR_F_FORMAT_MASK 0x7fff u_int generation; u_int64_t total_sectors; @@ -164,6 +165,9 @@ struct adaptec_raid_conf { u_int32_t dummy_9[62]; } __packed; +/* DDF Information. Metadata definitions are in another file */ +#define DDF_LBA(dev) \ + (((struct ad_softc *)device_get_ivars(dev))->total_secs - 1) /* Highpoint V2 RocketRAID Metadata */ #define HPTV2_LBA(dev) 9 From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 07:10:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 839C1106566C; Fri, 20 Feb 2009 07:10:33 +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 7150F8FC0C; Fri, 20 Feb 2009 07:10:33 +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 n1K7AXu1019622; Fri, 20 Feb 2009 07:10:33 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K7AX1E019621; Fri, 20 Feb 2009 07:10:33 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902200710.n1K7AX1E019621@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 20 Feb 2009 07:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188841 - stable/7/usr.bin/stat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 07:10:34 -0000 Author: maxim Date: Fri Feb 20 07:10:33 2009 New Revision: 188841 URL: http://svn.freebsd.org/changeset/base/188841 Log: MFC r188481: print an octal representation of suid, sgid and sticky bits with -x flag. Modified: stable/7/usr.bin/stat/ (props changed) stable/7/usr.bin/stat/stat.c Modified: stable/7/usr.bin/stat/stat.c ============================================================================== --- stable/7/usr.bin/stat/stat.c Fri Feb 20 06:10:12 2009 (r188840) +++ stable/7/usr.bin/stat/stat.c Fri Feb 20 07:10:33 2009 (r188841) @@ -108,7 +108,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_FORMAT \ " File: \"%N\"%n" \ " Size: %-11z FileType: %HT%n" \ - " Mode: (%04OLp/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \ + " Mode: (%OMp%03OLp/%.10Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%n" \ "Device: %Hd,%Ld Inode: %i Links: %l%n" \ "Access: %Sa%n" \ "Modify: %Sm%n" \ From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 07:17:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 122F41065672; Fri, 20 Feb 2009 07:17:07 +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 325968FC1C; Fri, 20 Feb 2009 07:17:07 +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 n1K7H6NG019774; Fri, 20 Feb 2009 07:17:06 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K7H6fi019773; Fri, 20 Feb 2009 07:17:06 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902200717.n1K7H6fi019773@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 20 Feb 2009 07:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188842 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 07:17:08 -0000 Author: maxim Date: Fri Feb 20 07:17:06 2009 New Revision: 188842 URL: http://svn.freebsd.org/changeset/base/188842 Log: MFC r188575: don't leak a device unit number. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/net/if_vlan.c Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Fri Feb 20 07:10:33 2009 (r188841) +++ stable/7/sys/net/if_vlan.c Fri Feb 20 07:17:06 2009 (r188842) @@ -740,6 +740,7 @@ vlan_clone_create(struct if_clone *ifc, ether_ifdetach(ifp); vlan_unconfig(ifp); if_free_type(ifp, IFT_ETHER); + ifc_free_unit(ifc, unit); free(ifv, M_VLAN); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 07:23:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5672B106566B; Fri, 20 Feb 2009 07:23:00 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440BC8FC1A; Fri, 20 Feb 2009 07:23:00 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K7MwQV019968; Fri, 20 Feb 2009 07:22:58 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K7Mwga019967; Fri, 20 Feb 2009 07:22:58 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200902200722.n1K7Mwga019967@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 20 Feb 2009 07:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188843 - stable/7/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 07:23:01 -0000 Author: maxim Date: Fri Feb 20 07:22:58 2009 New Revision: 188843 URL: http://svn.freebsd.org/changeset/base/188843 Log: MFC r188749,188759: DragonFly 2.2.0. Modified: stable/7/share/misc/ (props changed) stable/7/share/misc/bsd-family-tree Modified: stable/7/share/misc/bsd-family-tree ============================================================================== --- stable/7/share/misc/bsd-family-tree Fri Feb 20 07:17:06 2009 (r188842) +++ stable/7/share/misc/bsd-family-tree Fri Feb 20 07:22:58 2009 (r188843) @@ -226,7 +226,7 @@ FreeBSD 5.2 | | | | 6.4 | | | | | | | | | | | FreeBSD 7.1 | | | | - | | | | | | + | | | | | DragonFly 2.2.0 | V | | | | | | | | | FreeBSD 8 -current | NetBSD -current OpenBSD -current | @@ -495,6 +495,7 @@ DragonFly 2.0.0 2008-07-21 [DFB] OpenBSD 4.4 2008-11-01 [OBD] FreeBSD 6.4 2008-11-28 [FBD] FreeBSD 7.1 2009-01-04 [FBD] +DragonFly 2.2.0 2009-02-17 [DFB] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 07:40:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D32AC106566C; Fri, 20 Feb 2009 07:40:54 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C15D08FC1C; Fri, 20 Feb 2009 07:40:54 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K7es2I020314; Fri, 20 Feb 2009 07:40:54 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K7esQQ020313; Fri, 20 Feb 2009 07:40:54 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902200740.n1K7esQQ020313@svn.freebsd.org> From: Scott Long Date: Fri, 20 Feb 2009 07:40: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: r188844 - head/sys/dev/arcmsr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 07:40:55 -0000 Author: scottl Date: Fri Feb 20 07:40:54 2009 New Revision: 188844 URL: http://svn.freebsd.org/changeset/base/188844 Log: Tell CAM that SPI disconnect works, which in turn will let it use tags. This fixes the low "max device openings" count that has lead to poor performance in FreeBSD 7.0 and 7.1. Extra thanks goes to Mike Tancsa at Sentex for providing a debug system for this. Modified: head/sys/dev/arcmsr/arcmsr.c Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Fri Feb 20 07:22:58 2009 (r188843) +++ head/sys/dev/arcmsr/arcmsr.c Fri Feb 20 07:40:54 2009 (r188844) @@ -2150,7 +2150,8 @@ static void arcmsr_action(struct cam_sim spi->sync_offset=32; spi->bus_width=MSG_EXT_WDTR_BUS_16_BIT; scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; - spi->valid = CTS_SPI_VALID_SYNC_RATE + spi->valid = CTS_SPI_VALID_DISC + | CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 07:43:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0F97106566C; Fri, 20 Feb 2009 07:43:43 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF0F18FC0C; Fri, 20 Feb 2009 07:43:43 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K7hhh7020395; Fri, 20 Feb 2009 07:43:43 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K7hh6i020394; Fri, 20 Feb 2009 07:43:43 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200902200743.n1K7hh6i020394@svn.freebsd.org> From: Scott Long Date: Fri, 20 Feb 2009 07:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188845 - head/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 07:43:44 -0000 Author: scottl Date: Fri Feb 20 07:43:43 2009 New Revision: 188845 URL: http://svn.freebsd.org/changeset/base/188845 Log: Tell CAM that CISS logical devices support tagged queueing. This fixes the low "max device openings" count that has led to poor performance in FreeBSD 7.0 and 7.1 Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Feb 20 07:40:54 2009 (r188844) +++ head/sys/dev/ciss/ciss.c Fri Feb 20 07:43:43 2009 (r188845) @@ -2981,8 +2981,8 @@ ciss_cam_action(struct cam_sim *sim, uni { struct ccb_trans_settings *cts = &ccb->cts; int bus, target; - struct ccb_trans_settings_spi *spi = - &cts->xport_specific.spi; + struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; + struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; bus = cam_sim_bus(sim); target = cts->ccb_h.target_id; @@ -2997,6 +2997,9 @@ ciss_cam_action(struct cam_sim *sim, uni spi->valid = CTS_SPI_VALID_DISC; spi->flags = CTS_SPI_FLAGS_DISC_ENB; + scsi->valid = CTS_SCSI_VALID_TQ; + scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; + cts->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 08:49:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE2F6106564A; Fri, 20 Feb 2009 08:49:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB30B8FC13; Fri, 20 Feb 2009 08:49:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1K8nuNs021699; Fri, 20 Feb 2009 08:49:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1K8nuY4021697; Fri, 20 Feb 2009 08:49:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902200849.n1K8nuY4021697@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 08:49: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: r188846 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 08:49:57 -0000 Author: mav Date: Fri Feb 20 08:49:56 2009 New Revision: 188846 URL: http://svn.freebsd.org/changeset/base/188846 Log: Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report itself as ATA RAID, but generic ATAPCI driver unable to detect drives there. AHCI driver reported to handle them fine. Linux does the same. Submitted by: Andrey V. Elsukov on stable@ Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-nvidia.c Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Fri Feb 20 07:43:43 2009 (r188845) +++ head/sys/dev/ata/ata-pci.h Fri Feb 20 08:49:56 2009 (r188846) @@ -258,8 +258,32 @@ struct ata_connect_task { #define ATA_NFORCE_MCP61_S2 0x03f610de #define ATA_NFORCE_MCP61_S3 0x03f710de #define ATA_NFORCE_MCP65 0x044810de +#define ATA_NFORCE_MCP67_A0 0x055010de +#define ATA_NFORCE_MCP67_A1 0x055110de +#define ATA_NFORCE_MCP67_A2 0x055210de +#define ATA_NFORCE_MCP67_A3 0x055310de +#define ATA_NFORCE_MCP67_A4 0x055410de +#define ATA_NFORCE_MCP67_A5 0x055510de +#define ATA_NFORCE_MCP67_A6 0x055610de +#define ATA_NFORCE_MCP67_A7 0x055710de +#define ATA_NFORCE_MCP67_A8 0x055810de +#define ATA_NFORCE_MCP67_A9 0x055910de +#define ATA_NFORCE_MCP67_AA 0x055A10de +#define ATA_NFORCE_MCP67_AB 0x055B10de #define ATA_NFORCE_MCP67 0x056010de #define ATA_NFORCE_MCP73 0x056c10de +#define ATA_NFORCE_MCP73_A0 0x07f010de +#define ATA_NFORCE_MCP73_A1 0x07f110de +#define ATA_NFORCE_MCP73_A2 0x07f210de +#define ATA_NFORCE_MCP73_A3 0x07f310de +#define ATA_NFORCE_MCP73_A4 0x07f410de +#define ATA_NFORCE_MCP73_A5 0x07f510de +#define ATA_NFORCE_MCP73_A6 0x07f610de +#define ATA_NFORCE_MCP73_A7 0x07f710de +#define ATA_NFORCE_MCP73_A8 0x07f810de +#define ATA_NFORCE_MCP73_A9 0x07f910de +#define ATA_NFORCE_MCP73_AA 0x07fa10de +#define ATA_NFORCE_MCP73_AB 0x07fb10de #define ATA_NFORCE_MCP77 0x075910de #define ATA_PROMISE_ID 0x105a Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Fri Feb 20 07:43:43 2009 (r188845) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Fri Feb 20 08:49:56 2009 (r188846) @@ -61,6 +61,7 @@ static void ata_nvidia_setmode(device_t /* misc defines */ #define NV4 0x01 #define NVQ 0x02 +#define NVAHCI 0x04 /* @@ -97,7 +98,31 @@ ata_nvidia_probe(device_t dev) { ATA_NFORCE_MCP61_S3, 0, NV4|NVQ, 0, ATA_SA300, "nForce MCP61" }, { ATA_NFORCE_MCP65, 0, 0, 0, ATA_UDMA6, "nForce MCP65" }, { ATA_NFORCE_MCP67, 0, 0, 0, ATA_UDMA6, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A5, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A6, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A7, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A8, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_A9, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, + { ATA_NFORCE_MCP67_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP67" }, { ATA_NFORCE_MCP73, 0, 0, 0, ATA_UDMA6, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A5, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A6, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A7, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A8, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_A9, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, + { ATA_NFORCE_MCP73_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP73" }, { ATA_NFORCE_MCP77, 0, 0, 0, ATA_UDMA6, "nForce MCP77" }, { 0, 0, 0, 0, 0, 0}} ; @@ -108,7 +133,10 @@ ata_nvidia_probe(device_t dev) return ENXIO; ata_set_desc(dev); - ctlr->chipinit = ata_nvidia_chipinit; + if (ctlr->chip->cfg1 & NVAHCI) + ctlr->chipinit = ata_ahci_chipinit; + else + ctlr->chipinit = ata_nvidia_chipinit; return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 11:03:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 827491065673; Fri, 20 Feb 2009 11:03:13 +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 55F718FC14; Fri, 20 Feb 2009 11:03:13 +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 n1KB3Dgc027345; Fri, 20 Feb 2009 11:03:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KB3DpP027344; Fri, 20 Feb 2009 11:03:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200902201103.n1KB3DpP027344@svn.freebsd.org> From: Rui Paulo Date: Fri, 20 Feb 2009 11:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188847 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 11:03:14 -0000 Author: rpaulo Date: Fri Feb 20 11:03:12 2009 New Revision: 188847 URL: http://svn.freebsd.org/changeset/base/188847 Log: Add Andriy Gapon. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Feb 20 08:49:56 2009 (r188846) +++ svnadmin/conf/mentors Fri Feb 20 11:03:12 2009 (r188847) @@ -10,6 +10,7 @@ # Sort by mentee login name. # Mentee Mentor Optional comment +avg rpaulo Co-mentor: jhb eri mlaier Co-mentor: thompsa jamie bz Co-mentor: brooks pho kib From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 11:09:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EE0F106566C; Fri, 20 Feb 2009 11:09:56 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C5B78FC1F; Fri, 20 Feb 2009 11:09:56 +0000 (UTC) (envelope-from mtm@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KB9unw027497; Fri, 20 Feb 2009 11:09:56 GMT (envelope-from mtm@svn.freebsd.org) Received: (from mtm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KB9tjY027495; Fri, 20 Feb 2009 11:09:55 GMT (envelope-from mtm@svn.freebsd.org) Message-Id: <200902201109.n1KB9tjY027495@svn.freebsd.org> From: Mike Makonnen Date: Fri, 20 Feb 2009 11:09: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: r188848 - head/tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 11:09:56 -0000 Author: mtm Date: Fri Feb 20 11:09:55 2009 New Revision: 188848 URL: http://svn.freebsd.org/changeset/base/188848 Log: Doh! r188813 modified an auto-generated file. Fix it for real: o grammar fix o remove mention of libkse Submitted by: Niclas Zeising Modified: head/tools/build/options/WITHOUT_LIBPTHREAD head/tools/build/options/makeman Modified: head/tools/build/options/WITHOUT_LIBPTHREAD ============================================================================== --- head/tools/build/options/WITHOUT_LIBPTHREAD Fri Feb 20 11:03:12 2009 (r188847) +++ head/tools/build/options/WITHOUT_LIBPTHREAD Fri Feb 20 11:09:55 2009 (r188848) @@ -1,8 +1,5 @@ .\" $FreeBSD$ -Set to not build either of the +Set to not build the .Nm libpthread -providing libraries -.Nm ( libthr -(1:1) & -.Nm libkse -(M:N)). +providing library, +.Nm libthr . Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Fri Feb 20 11:03:12 2009 (r188847) +++ head/tools/build/options/makeman Fri Feb 20 11:09:55 2009 (r188848) @@ -118,7 +118,7 @@ for a particular build via the .Fl D option of .Xr make 1 -or in environment; see +or in its environment; see .Xr environ 7 . .Pp The values of variables are ignored regardless of their setting; From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 13:05:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A79106564A; Fri, 20 Feb 2009 13:05:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 928F78FC24; Fri, 20 Feb 2009 13:05:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KD5TMm029684; Fri, 20 Feb 2009 13:05:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KD5TGx029681; Fri, 20 Feb 2009 13:05:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200902201305.n1KD5TGx029681@svn.freebsd.org> From: Ed Schouten Date: Fri, 20 Feb 2009 13:05: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: r188849 - in head/sys: compat/linux kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 13:05:30 -0000 Author: ed Date: Fri Feb 20 13:05:29 2009 New Revision: 188849 URL: http://svn.freebsd.org/changeset/base/188849 Log: Don't make Linux stat() open character devices to resolve its name. The existing code calls kern_open() to resolve the vnode of a pathname right after a stat(). This is not correct, because it causes random character devices to be opened in /dev. This means ls'ing a tape streamer will cause it to rewind, for example. Changes I have made: - Add kern_statat_vnhook() to allow binary emulators to `post-process' struct stat, using the proper vnode. - Remove unneeded printf's from stat() and statfs(). - Make the Linuxolator use kern_statat_vnhook(), replacing translate_path_major_minor_at(). - Let translate_fd_major_minor() use vp->v_rdev instead of vp->v_un.vu_cdev. Result: crw-rw-rw- 1 root root 0, 14 Feb 20 13:54 /dev/ptmx crw--w---- 1 root adm 136, 0 Feb 20 14:03 /dev/pts/0 crw--w---- 1 root adm 136, 1 Feb 20 14:02 /dev/pts/1 crw--w---- 1 ed tty 136, 2 Feb 20 14:03 /dev/pts/2 Before this commit, ptmx also had a major number of 136, because it silently allocated and deallocated a pseudo-terminal. Device nodes that cannot be opened now have proper major/minor-numbers. Reviewed by: kib, netchild, rdivacky (thanks!) Modified: head/sys/compat/linux/linux_stats.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Feb 20 11:09:55 2009 (r188848) +++ head/sys/compat/linux/linux_stats.c Fri Feb 20 13:05:29 2009 (r188849) @@ -62,6 +62,44 @@ __FBSDID("$FreeBSD$"); #include +static void +translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) +{ + int major, minor; + + if (vp->v_type == VCHR && vp->v_rdev != NULL && + linux_driver_get_major_minor(vp->v_rdev->si_name, + &major, &minor) == 0) { + sb->st_rdev = (major << 8 | minor); + } +} + +static int +linux_kern_statat(struct thread *td, int flag, int fd, char *path, + enum uio_seg pathseg, struct stat *sbp) +{ + + return (kern_statat_vnhook(td, flag, fd, path, pathseg, sbp, + translate_vnhook_major_minor)); +} + +static int +linux_kern_stat(struct thread *td, char *path, enum uio_seg pathseg, + struct stat *sbp) +{ + + return (linux_kern_statat(td, 0, AT_FDCWD, path, pathseg, sbp)); +} + +static int +linux_kern_lstat(struct thread *td, char *path, enum uio_seg pathseg, + struct stat *sbp) +{ + + return (linux_kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, + pathseg, sbp)); +} + /* * XXX: This was removed from newstat_copyout(), and almost identical * XXX: code was in stat64_copyout(). findcdev() needs to be replaced @@ -102,14 +140,15 @@ static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) { struct file *fp; + struct vnode *vp; int major, minor; if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || fget(td, fd, &fp) != 0) return; - if (fp->f_vnode != NULL && - fp->f_vnode->v_un.vu_cdev != NULL && - linux_driver_get_major_minor(fp->f_vnode->v_un.vu_cdev->si_name, + vp = fp->f_vnode; + if (vp != NULL && vp->v_rdev != NULL && + linux_driver_get_major_minor(vp->v_rdev->si_name, &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { @@ -124,32 +163,6 @@ translate_fd_major_minor(struct thread * fdrop(fp, td); } -static void -translate_path_major_minor_at(struct thread *td, char *path, - struct stat *buf, int dfd) -{ - struct proc *p = td->td_proc; - struct filedesc *fdp = p->p_fd; - int fd; - int temp; - - if (!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) - return; - temp = td->td_retval[0]; - if (kern_openat(td, dfd, path, UIO_SYSSPACE, O_RDONLY, 0) != 0) - return; - fd = td->td_retval[0]; - td->td_retval[0] = temp; - translate_fd_major_minor(td, fd, buf); - fdclose(fdp, fdp->fd_ofiles[fd], fd, td); -} - -static inline void -translate_path_major_minor(struct thread *td, char *path, struct stat *buf) -{ - translate_path_major_minor_at(td, path, buf, AT_FDCWD); -} - static int newstat_copyout(struct stat *buf, void *ubuf) { @@ -187,9 +200,7 @@ linux_newstat(struct thread *td, struct printf(ARGS(newstat, "%s, *"), path); #endif - error = kern_stat(td, path, UIO_SYSSPACE, &buf); - if (!error) - translate_path_major_minor(td, path, &buf); + error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf); LFREEPATH(path); if (error) return (error); @@ -210,9 +221,7 @@ linux_newlstat(struct thread *td, struct printf(ARGS(newlstat, "%s, *"), path); #endif - error = kern_lstat(td, path, UIO_SYSSPACE, &sb); - if (!error) - translate_path_major_minor(td, path, &sb); + error = linux_kern_lstat(td, path, UIO_SYSSPACE, &sb); LFREEPATH(path); if (error) return (error); @@ -279,12 +288,11 @@ linux_stat(struct thread *td, struct lin if (ldebug(stat)) printf(ARGS(stat, "%s, *"), path); #endif - error = kern_stat(td, path, UIO_SYSSPACE, &buf); + error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf); if (error) { LFREEPATH(path); return (error); } - translate_path_major_minor(td, path, &buf); LFREEPATH(path); return(stat_copyout(&buf, args->up)); } @@ -302,12 +310,11 @@ linux_lstat(struct thread *td, struct li if (ldebug(lstat)) printf(ARGS(lstat, "%s, *"), path); #endif - error = kern_lstat(td, path, UIO_SYSSPACE, &buf); + error = linux_kern_lstat(td, path, UIO_SYSSPACE, &buf); if (error) { LFREEPATH(path); return (error); } - translate_path_major_minor(td, path, &buf); LFREEPATH(path); return(stat_copyout(&buf, args->up)); } @@ -526,9 +533,7 @@ linux_stat64(struct thread *td, struct l printf(ARGS(stat64, "%s, *"), filename); #endif - error = kern_stat(td, filename, UIO_SYSSPACE, &buf); - if (!error) - translate_path_major_minor(td, filename, &buf); + error = linux_kern_stat(td, filename, UIO_SYSSPACE, &buf); LFREEPATH(filename); if (error) return (error); @@ -549,9 +554,7 @@ linux_lstat64(struct thread *td, struct printf(ARGS(lstat64, "%s, *"), args->filename); #endif - error = kern_lstat(td, filename, UIO_SYSSPACE, &sb); - if (!error) - translate_path_major_minor(td, filename, &sb); + error = linux_kern_lstat(td, filename, UIO_SYSSPACE, &sb); LFREEPATH(filename); if (error) return (error); @@ -597,8 +600,7 @@ linux_fstatat64(struct thread *td, struc printf(ARGS(fstatat64, "%i, %s, %i"), args->dfd, path, args->flag); #endif - error = kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); - translate_path_major_minor_at(td, args->pathname, &buf, dfd); + error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); if (!error) error = stat64_copyout(&buf, args->statbuf); LFREEPATH(path); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Feb 20 11:09:55 2009 (r188848) +++ head/sys/kern/vfs_syscalls.c Fri Feb 20 13:05:29 2009 (r188849) @@ -339,8 +339,6 @@ kern_statfs(struct thread *td, char *pat out: vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); - if (mtx_owned(&Giant)) - printf("statfs(%d): %s: %d\n", vfslocked, path, error); return (error); } @@ -2343,6 +2341,15 @@ int kern_statat(struct thread *td, int flag, int fd, char *path, enum uio_seg pathseg, struct stat *sbp) { + + return (kern_statat_vnhook(td, flag, fd, path, pathseg, sbp, NULL)); +} + +int +kern_statat_vnhook(struct thread *td, int flag, int fd, char *path, + enum uio_seg pathseg, struct stat *sbp, + void (*hook)(struct vnode *vp, struct stat *sbp)) +{ struct nameidata nd; struct stat sb; int error, vfslocked; @@ -2362,12 +2369,12 @@ kern_statat(struct thread *td, int flag, SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0); if (S_ISREG(sb.st_mode)) SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0); + if (__predict_false(hook != NULL)) + hook(nd.ni_vp, &sb); } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); - if (mtx_owned(&Giant)) - printf("stat(%d): %s\n", vfslocked, path); if (error) return (error); *sbp = sb; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Fri Feb 20 11:09:55 2009 (r188848) +++ head/sys/sys/syscallsubr.h Fri Feb 20 13:05:29 2009 (r188849) @@ -193,6 +193,9 @@ int kern_stat(struct thread *td, char *p struct stat *sbp); int kern_statat(struct thread *td, int flag, int fd, char *path, enum uio_seg pathseg, struct stat *sbp); +int kern_statat_vnhook(struct thread *td, int flag, int fd, char *path, + enum uio_seg pathseg, struct stat *sbp, + void (*hook)(struct vnode *vp, struct stat *sbp)); int kern_statfs(struct thread *td, char *path, enum uio_seg pathseg, struct statfs *buf); int kern_symlink(struct thread *td, char *path, char *link, From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 14:10:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68C71065679; Fri, 20 Feb 2009 14:10:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D56A48FC18; Fri, 20 Feb 2009 14:10:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KEAN3v030838; Fri, 20 Feb 2009 14:10:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KEANwK030837; Fri, 20 Feb 2009 14:10:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902201410.n1KEANwK030837@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 14:10: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: r188850 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 14:10:24 -0000 Author: mav Date: Fri Feb 20 14:10:23 2009 New Revision: 188850 URL: http://svn.freebsd.org/changeset/base/188850 Log: Fix pc98 build error due to missing variable. Submitted by: avg Modified: head/sys/dev/ata/ata-cbus.c Modified: head/sys/dev/ata/ata-cbus.c ============================================================================== --- head/sys/dev/ata/ata-cbus.c Fri Feb 20 13:05:29 2009 (r188849) +++ head/sys/dev/ata/ata-cbus.c Fri Feb 20 14:10:23 2009 (r188850) @@ -304,6 +304,7 @@ ata_cbuschannel_attach(device_t dev) static int ata_cbuschannel_detach(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); if (!ch->attached) return (0); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 14:28:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADF9E106564A; Fri, 20 Feb 2009 14:28:56 +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 9CB318FC26; Fri, 20 Feb 2009 14:28:56 +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 n1KESuaS031232; Fri, 20 Feb 2009 14:28:56 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KESuIr031231; Fri, 20 Feb 2009 14:28:56 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902201428.n1KESuIr031231@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 20 Feb 2009 14:28: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: r188851 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 14:28:57 -0000 Author: luigi Date: Fri Feb 20 14:28:56 2009 New Revision: 188851 URL: http://svn.freebsd.org/changeset/base/188851 Log: when initializing, also build _includes and _libraries On passing, fix a wrong comment MFC after: 3 days Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri Feb 20 14:10:23 2009 (r188850) +++ head/release/picobsd/build/picobsd Fri Feb 20 14:28:56 2009 (r188851) @@ -150,7 +150,7 @@ set_defaults() { trap fail 15 } -# entry for 4.x and earlier trees +# use the new build infrastructure create_includes_and_libraries2() { local no log "create_includes_and_libraries2() for ${SRC}" @@ -163,7 +163,7 @@ create_includes_and_libraries2() { export MAKEOBJDIRPREFIX ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld - make _+_= $no toolchain + make _+_= $no toolchain _includes _libraries ) } From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 14:33:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DD781065676; Fri, 20 Feb 2009 14:33:45 +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 7BB178FC12; Fri, 20 Feb 2009 14:33:45 +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 n1KEXjcO031368; Fri, 20 Feb 2009 14:33:45 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KEXjTq031367; Fri, 20 Feb 2009 14:33:45 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902201433.n1KEXjTq031367@svn.freebsd.org> From: Randall Stewart Date: Fri, 20 Feb 2009 14:33: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: r188852 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 14:33:46 -0000 Author: rrs Date: Fri Feb 20 14:33:45 2009 New Revision: 188852 URL: http://svn.freebsd.org/changeset/base/188852 Log: Fix a bug. The sending was being restricted improperly by the max_burst. It should only be gated by cwnd in the lower level send. Obtained from: Michael Tuexen MFC after: 1 week. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Feb 20 14:28:56 2009 (r188851) +++ head/sys/netinet/sctp_output.c Fri Feb 20 14:33:45 2009 (r188852) @@ -15014,7 +15014,7 @@ skip_preblock: } else { un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); - if (net->flight_size > (net->mtu * stcb->asoc.max_burst)) { + if (net->flight_size > net->cwnd) { queue_only = 1; SCTP_STAT_INCR(sctps_send_burst_avoid); } else if (net->flight_size > net->cwnd) { @@ -15291,7 +15291,7 @@ skip_out_eof: } else { un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); - if (net->flight_size > (net->mtu * stcb->asoc.max_burst)) { + if (net->flight_size > net->cwnd) { queue_only = 1; SCTP_STAT_INCR(sctps_send_burst_avoid); } else if (net->flight_size > net->cwnd) { From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 14:53:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265021065680; Fri, 20 Feb 2009 14:53:50 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEDF58FC15; Fri, 20 Feb 2009 14:53:49 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KErnoE031863; Fri, 20 Feb 2009 14:53:49 GMT (envelope-from mr@svn.freebsd.org) Received: (from mr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KErnlB031862; Fri, 20 Feb 2009 14:53:49 GMT (envelope-from mr@svn.freebsd.org) Message-Id: <200902201453.n1KErnlB031862@svn.freebsd.org> From: Michael Reifenberger Date: Fri, 20 Feb 2009 14:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188853 - head/tools/tools/nanobsd/rescue/Files/root X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 14:53:50 -0000 Author: mr Date: Fri Feb 20 14:53:49 2009 New Revision: 188853 URL: http://svn.freebsd.org/changeset/base/188853 Log: Delete files which serve no purpose in this environment. Inspired by: simon@ Deleted: head/tools/tools/nanobsd/rescue/Files/root/change_password head/tools/tools/nanobsd/rescue/Files/root/save_cfg head/tools/tools/nanobsd/rescue/Files/root/save_sshkeys head/tools/tools/nanobsd/rescue/Files/root/updatep1 head/tools/tools/nanobsd/rescue/Files/root/updatep2 From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 15:03:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81571065675; Fri, 20 Feb 2009 15:03:55 +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 A61658FC15; Fri, 20 Feb 2009 15:03:55 +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 n1KF3tQR032099; Fri, 20 Feb 2009 15:03:55 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KF3tsh032089; Fri, 20 Feb 2009 15:03:55 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200902201503.n1KF3tsh032089@svn.freebsd.org> From: Randall Stewart Date: Fri, 20 Feb 2009 15:03: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: r188854 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 15:03:56 -0000 Author: rrs Date: Fri Feb 20 15:03:54 2009 New Revision: 188854 URL: http://svn.freebsd.org/changeset/base/188854 Log: Add the add-stream capability. Still needs more testing.. MFC after: 1 month Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_constants.h Fri Feb 20 15:03:54 2009 (r188854) @@ -418,11 +418,12 @@ __FBSDID("$FreeBSD$"); #define SCTP_HOSTNAME_ADDRESS 0x000b #define SCTP_SUPPORTED_ADDRTYPE 0x000c -/* draft-ietf-stewart-strreset-xxx */ +/* draft-ietf-stewart-tsvwg-strreset-xxx */ #define SCTP_STR_RESET_OUT_REQUEST 0x000d #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE 0x0010 +#define SCTP_STR_RESET_ADD_STREAMS 0x0011 #define SCTP_MAX_RESET_PARAMS 2 #define SCTP_STREAM_RESET_TSN_DELTA 0x1000 @@ -794,7 +795,11 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_SPECIAL_SP_FAIL 27 #define SCTP_NOTIFY_NO_PEER_AUTH 28 #define SCTP_NOTIFY_SENDER_DRY 29 -#define SCTP_NOTIFY_MAX 29 +#define SCTP_NOTIFY_STR_RESET_ADD_OK 30 +#define SCTP_NOTIFY_STR_RESET_ADD_FAIL 31 +#define SCTP_NOTIFY_STR_RESET_INSTREAM_ADD_OK 32 +#define SCTP_NOTIFY_MAX 32 + /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_header.h Fri Feb 20 15:03:54 2009 (r188854) @@ -498,7 +498,12 @@ struct sctp_stream_reset_response_tsn { uint32_t receivers_next_tsn; } SCTP_PACKED; - +struct sctp_stream_reset_add_strm { + struct sctp_paramhdr ph; + uint32_t request_seq; + uint16_t number_of_streams; + uint16_t reserved; +}; #define SCTP_STREAM_RESET_NOTHING 0x00000000 /* Nothing for me to do */ #define SCTP_STREAM_RESET_PERFORMED 0x00000001 /* Did it */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_input.c Fri Feb 20 15:03:54 2009 (r188854) @@ -314,7 +314,7 @@ sctp_process_init(struct sctp_init_chunk asoc->pre_open_streams = newcnt; } SCTP_TCB_SEND_UNLOCK(stcb); - asoc->streamoutcnt = asoc->pre_open_streams; + asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; /* init tsn's */ asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; /* EY - nr_sack: initialize highest tsn in nr_mapping_array */ @@ -3440,6 +3440,17 @@ sctp_handle_stream_reset_response(struct if (action != SCTP_STREAM_RESET_PERFORMED) { sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_FAILED_IN, stcb, number_entries, srparam->list_of_streams, SCTP_SO_NOT_LOCKED); } + } else if (type == SCTP_STR_RESET_ADD_STREAMS) { + /* Ok we now may have more streams */ + if (action == SCTP_STREAM_RESET_PERFORMED) { + /* Put the new streams into effect */ + stcb->asoc.streamoutcnt = stcb->asoc.strm_realoutsize; + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD_OK, stcb, + (uint32_t) stcb->asoc.streamoutcnt, NULL, SCTP_SO_NOT_LOCKED); + } else { + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_ADD_FAIL, stcb, + (uint32_t) stcb->asoc.streamoutcnt, NULL, SCTP_SO_NOT_LOCKED); + } } else if (type == SCTP_STR_RESET_TSN_REQUEST) { /** * a) Adopt the new in tsn. @@ -3709,6 +3720,63 @@ sctp_handle_str_reset_request_out(struct } } +static void +sctp_handle_str_reset_add_strm(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk, + struct sctp_stream_reset_add_strm *str_add) +{ + /* + * Peer is requesting to add more streams. If its within our + * max-streams we will allow it. + */ + uint16_t num_stream, i; + uint32_t seq; + + /* Get the number. */ + seq = ntohl(str_add->request_seq); + num_stream = ntohs(str_add->number_of_streams); + /* Now what would be the new total? */ + num_stream += stcb->asoc.streamincnt; + if (num_stream > stcb->asoc.max_inbound_streams) { + /* We must reject it they ask for to many */ +denied: + sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_DENIED); + stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0]; + stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_DENIED; + } else { + /* Ok, we can do that :-) */ + struct sctp_stream_in *oldstrm; + + /* save off the old */ + oldstrm = stcb->asoc.strmin; + SCTP_MALLOC(stcb->asoc.strmin, struct sctp_stream_in *, + (num_stream * sizeof(struct sctp_stream_in)), + SCTP_M_STRMI); + if (stcb->asoc.strmin == NULL) { + stcb->asoc.strmin = oldstrm; + goto denied; + } + /* copy off the old data */ + memcpy(stcb->asoc.strmin, oldstrm, + (stcb->asoc.streamincnt * sizeof(struct sctp_stream_in))); + /* Init the new streams */ + for (i = stcb->asoc.streamincnt; i < num_stream; i++) { + TAILQ_INIT(&stcb->asoc.strmin[i].inqueue); + stcb->asoc.strmin[i].stream_no = i; + stcb->asoc.strmin[i].last_sequence_delivered = 0xffff; + stcb->asoc.strmin[i].delivery_started = 0; + } + SCTP_FREE(oldstrm, SCTP_M_STRMI); + /* update the size */ + stcb->asoc.streamincnt = num_stream; + /* Send the ack */ + sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_PERFORMED); + stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0]; + stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_PERFORMED; + sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_INSTREAM_ADD_OK, stcb, + (uint32_t) stcb->asoc.streamincnt, NULL, SCTP_SO_NOT_LOCKED); + } +} + #ifdef __GNUC__ __attribute__((noinline)) #endif @@ -3803,6 +3871,12 @@ strres_nochunk: } } sctp_handle_str_reset_request_out(stcb, chk, req_out, trunc); + } else if (ptype == SCTP_STR_RESET_ADD_STREAMS) { + struct sctp_stream_reset_add_strm *str_add; + + str_add = (struct sctp_stream_reset_add_strm *)ph; + num_req++; + sctp_handle_str_reset_add_strm(stcb, chk, str_add); } else if (ptype == SCTP_STR_RESET_IN_REQUEST) { struct sctp_stream_reset_in_request *req_in; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_output.c Fri Feb 20 15:03:54 2009 (r188854) @@ -8620,13 +8620,12 @@ re_look: sp->some_taken = 1; } } else { - to_move = sctp_can_we_split_this(stcb, length, goal_mtu, - frag_point, eeor_mode); + to_move = sctp_can_we_split_this(stcb, length, goal_mtu, frag_point, eeor_mode); if (to_move) { /*- - * We use a snapshot of length in case it - * is expanding during the compare. - */ + * We use a snapshot of length in case it + * is expanding during the compare. + */ uint32_t llen; llen = length; @@ -8634,9 +8633,9 @@ re_look: to_move = llen; if (send_lock_up == 0) { /*- - * We are taking all of an incomplete msg - * thus we need a send lock. - */ + * We are taking all of an incomplete msg + * thus we need a send lock. + */ SCTP_TCB_SEND_LOCK(stcb); send_lock_up = 1; if (sp->msg_is_complete) { @@ -8836,8 +8835,7 @@ dont_do_it: goto out_of; } sctp_snd_sb_alloc(stcb, sizeof(struct sctp_data_chunk)); - chk->book_size = chk->send_size = (to_move + - sizeof(struct sctp_data_chunk)); + chk->book_size = chk->send_size = (to_move + sizeof(struct sctp_data_chunk)); chk->book_size_scale = 0; chk->sent = SCTP_DATAGRAM_UNSENT; @@ -13339,13 +13337,49 @@ sctp_add_stream_reset_result_tsn(struct return; } +static void +sctp_add_a_stream(struct sctp_tmit_chunk *chk, + uint32_t seq, + uint16_t adding) +{ + int len, old_len; + struct sctp_chunkhdr *ch; + struct sctp_stream_reset_add_strm *addstr; + + ch = mtod(chk->data, struct sctp_chunkhdr *); + old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); + + /* get to new offset for the param. */ + addstr = (struct sctp_stream_reset_add_strm *)((caddr_t)ch + len); + /* now how long will this param be? */ + len = sizeof(struct sctp_stream_reset_add_strm); + + /* Fill it out. */ + addstr->ph.param_type = htons(SCTP_STR_RESET_ADD_STREAMS); + addstr->ph.param_length = htons(len); + addstr->request_seq = htonl(seq); + addstr->number_of_streams = htons(adding); + addstr->reserved = 0; + + /* now fix the chunk length */ + ch->chunk_length = htons(len + old_len); + chk->send_size = len + old_len; + chk->book_size = SCTP_SIZE32(chk->send_size); + chk->book_size_scale = 0; + SCTP_BUF_LEN(chk->data) = SCTP_SIZE32(chk->send_size); + return; +} int sctp_send_str_reset_req(struct sctp_tcb *stcb, int number_entries, uint16_t * list, - uint8_t send_out_req, uint32_t resp_seq, + uint8_t send_out_req, + uint32_t resp_seq, uint8_t send_in_req, - uint8_t send_tsn_req) + uint8_t send_tsn_req, + uint8_t add_stream, + uint16_t adding +) { struct sctp_association *asoc; @@ -13361,7 +13395,8 @@ sctp_send_str_reset_req(struct sctp_tcb SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EBUSY); return (EBUSY); } - if ((send_out_req == 0) && (send_in_req == 0) && (send_tsn_req == 0)) { + if ((send_out_req == 0) && (send_in_req == 0) && (send_tsn_req == 0) && + (add_stream == 0)) { /* nothing to do */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); @@ -13412,6 +13447,11 @@ sctp_send_str_reset_req(struct sctp_tcb seq++; asoc->stream_reset_outstanding++; } + if (add_stream) { + sctp_add_a_stream(chk, seq, adding); + seq++; + asoc->stream_reset_outstanding++; + } if (send_in_req) { sctp_add_stream_reset_in(chk, number_entries, list, seq); asoc->stream_reset_outstanding++; @@ -14432,7 +14472,7 @@ sctp_lower_sosend(struct socket *so, if (tmp_str != NULL) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); asoc->strmout = tmp_str; - asoc->streamoutcnt = asoc->pre_open_streams; + asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams; } else { asoc->pre_open_streams = asoc->streamoutcnt; } @@ -15016,9 +15056,6 @@ skip_preblock: (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); if (net->flight_size > net->cwnd) { queue_only = 1; - SCTP_STAT_INCR(sctps_send_burst_avoid); - } else if (net->flight_size > net->cwnd) { - queue_only = 1; SCTP_STAT_INCR(sctps_send_cwnd_avoid); } else { queue_only = 0; @@ -15293,9 +15330,6 @@ skip_out_eof: (stcb->asoc.stream_queue_cnt * sizeof(struct sctp_data_chunk))); if (net->flight_size > net->cwnd) { queue_only = 1; - SCTP_STAT_INCR(sctps_send_burst_avoid); - } else if (net->flight_size > net->cwnd) { - queue_only = 1; SCTP_STAT_INCR(sctps_send_cwnd_avoid); } else { queue_only = 0; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_output.h Fri Feb 20 15:03:54 2009 (r188854) @@ -192,10 +192,14 @@ sctp_add_stream_reset_result_tsn(struct int sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, - uint8_t send_out_req, uint32_t resp_seq, + int number_entries, + uint16_t * list, + uint8_t send_out_req, + uint32_t resp_seq, uint8_t send_in_req, - uint8_t send_tsn_req); + uint8_t send_tsn_req, + uint8_t add_str, + uint16_t adding); void Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_pcb.c Fri Feb 20 15:03:54 2009 (r188854) @@ -4885,7 +4885,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_FREE(asoc->strmout, SCTP_M_STRMO); asoc->strmout = NULL; } - asoc->streamoutcnt = 0; + asoc->strm_realoutsize = asoc->streamoutcnt = 0; if (asoc->strmin) { struct sctp_queued_to_read *ctl; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_structs.h Fri Feb 20 15:03:54 2009 (r188854) @@ -935,7 +935,7 @@ struct sctp_association { /* could re-arrange to optimize space here. */ uint16_t streamincnt; uint16_t streamoutcnt; - + uint16_t strm_realoutsize; /* my maximum number of retrans of INIT and SEND */ /* copied from SCTP but should be individually setable */ uint16_t max_init_times; Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_uio.h Fri Feb 20 15:03:54 2009 (r188854) @@ -377,7 +377,7 @@ struct sctp_stream_reset_event { #define SCTP_STRRESET_ALL_STREAMS 0x0004 #define SCTP_STRRESET_STREAM_LIST 0x0008 #define SCTP_STRRESET_FAILED 0x0010 - +#define SCTP_STRRESET_ADD_STREAM 0x0020 /* SCTP notification event */ struct sctp_tlv { @@ -596,6 +596,7 @@ struct sctp_blk_args { #define SCTP_RESET_LOCAL_SEND 0x0002 #define SCTP_RESET_BOTH 0x0003 #define SCTP_RESET_TSN 0x0004 +#define SCTP_RESET_ADD_STREAMS 0x0005 struct sctp_stream_reset { sctp_assoc_t strrst_assoc_id; @@ -941,9 +942,7 @@ struct sctpstat { uint32_t sctps_cached_strmoq; /* Number of cached stream oq's used */ uint32_t sctps_left_abandon; /* Number of unread message abandonded * by close */ - uint32_t sctps_send_burst_avoid; /* Send burst avoidance, - * already max burst inflight - * to net */ + uint32_t sctps_send_burst_avoid; /* Unused */ uint32_t sctps_send_cwnd_avoid; /* Send cwnd full avoidance, already * max burst inflight to net */ uint32_t sctps_fwdtsn_map_over; /* number of map array over-runs via Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctp_usrreq.c Fri Feb 20 15:03:54 2009 (r188854) @@ -3263,7 +3263,9 @@ sctp_setopt(struct socket *so, int optna case SCTP_RESET_STREAMS: { struct sctp_stream_reset *strrst; - uint8_t send_in = 0, send_tsn = 0, send_out = 0; + uint8_t send_in = 0, send_tsn = 0, send_out = 0, + addstream = 0; + uint16_t addstrmcnt = 0; int i; SCTP_CHECK_AND_CAST(strrst, optval, struct sctp_stream_reset, optsize); @@ -3301,6 +3303,60 @@ sctp_setopt(struct socket *so, int optna send_out = 1; } else if (strrst->strrst_flags == SCTP_RESET_TSN) { send_tsn = 1; + } else if (strrst->strrst_flags == SCTP_RESET_ADD_STREAMS) { + if (send_tsn || + send_in || + send_out) { + /* We can't do that and add streams */ + error = EINVAL; + goto skip_stuff; + } + if (stcb->asoc.stream_reset_outstanding) { + error = EBUSY; + goto skip_stuff; + } + addstream = 1; + /* We allocate here */ + addstrmcnt = strrst->strrst_num_streams; + if ((int)(addstrmcnt + stcb->asoc.streamoutcnt) > 0xffff) { + /* You can't have more than 64k */ + error = EINVAL; + goto skip_stuff; + } + if ((stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt) < addstrmcnt) { + /* Need to allocate more */ + struct sctp_stream_out *oldstream; + + oldstream = stcb->asoc.strmout; + /* get some more */ + SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *, + ((stcb->asoc.streamoutcnt + addstrmcnt) * sizeof(struct sctp_stream_out)), + SCTP_M_STRMO); + if (stcb->asoc.strmout == NULL) { + stcb->asoc.strmout = oldstream; + error = ENOMEM; + goto skip_stuff; + } + /* + * Ok now we proceed with copying + * the old out stuff and + * initializing the new stuff. + */ + memcpy(stcb->asoc.strmout, oldstream, + (stcb->asoc.streamoutcnt * sizeof(struct sctp_stream_out))); + /* now the new streams */ + for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + addstrmcnt); i++) { + stcb->asoc.strmout[i].next_sequence_sent = 0x0; + TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].stream_no = i; + stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.strmout[i].next_spoke.tqe_next = 0; + stcb->asoc.strmout[i].next_spoke.tqe_prev = 0; + } + stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + addstrmcnt; + SCTP_FREE(oldstream, SCTP_M_STRMO); + } + goto skip_stuff; } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; @@ -3322,6 +3378,7 @@ sctp_setopt(struct socket *so, int optna goto get_out; } } + skip_stuff: if (error) { get_out: SCTP_TCB_UNLOCK(stcb); @@ -3330,7 +3387,7 @@ sctp_setopt(struct socket *so, int optna error = sctp_send_str_reset_req(stcb, strrst->strrst_num_streams, strrst->strrst_list, send_out, (stcb->asoc.str_reset_seq_in - 3), - send_in, send_tsn); + send_in, send_tsn, addstream, addstrmcnt); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Feb 20 14:53:49 2009 (r188853) +++ head/sys/netinet/sctputil.c Fri Feb 20 15:03:54 2009 (r188854) @@ -1119,7 +1119,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str * Now the stream parameters, here we allocate space for all streams * that we request by default. */ - asoc->streamoutcnt = asoc->pre_open_streams = + asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams = m->sctp_ep.pre_open_stream_count; SCTP_MALLOC(asoc->strmout, struct sctp_stream_out *, asoc->streamoutcnt * sizeof(struct sctp_stream_out), @@ -3351,6 +3351,63 @@ sctp_notify_sender_dry_event(struct sctp &stcb->sctp_socket->so_rcv, 1, so_locked); } + +static void +sctp_notify_stream_reset_add(struct sctp_tcb *stcb, int number_entries, int flag) +{ + struct mbuf *m_notify; + struct sctp_queued_to_read *control; + struct sctp_stream_reset_event *strreset; + int len; + + if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { + /* event not enabled */ + return; + } + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) + /* no space left */ + return; + SCTP_BUF_LEN(m_notify) = 0; + len = sizeof(struct sctp_stream_reset_event) + (number_entries * sizeof(uint16_t)); + if (len > M_TRAILINGSPACE(m_notify)) { + /* never enough room */ + sctp_m_freem(m_notify); + return; + } + strreset = mtod(m_notify, struct sctp_stream_reset_event *); + strreset->strreset_type = SCTP_STREAM_RESET_EVENT; + strreset->strreset_flags = SCTP_STRRESET_ADD_STREAM | flag; + strreset->strreset_length = len; + strreset->strreset_assoc_id = sctp_get_associd(stcb); + strreset->strreset_list[0] = number_entries; + + SCTP_BUF_LEN(m_notify) = len; + SCTP_BUF_NEXT(m_notify) = NULL; + if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) { + /* no space */ + sctp_m_freem(m_notify); + return; + } + /* append to socket */ + control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, + 0, 0, 0, 0, 0, 0, + m_notify); + if (control == NULL) { + /* no memory */ + sctp_m_freem(m_notify); + return; + } + control->spec_flags = M_NOTIFICATION; + control->length = SCTP_BUF_LEN(m_notify); + /* not that we need this */ + control->tail_mbuf = m_notify; + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, + &stcb->sctp_socket->so_rcv, 1, SCTP_SO_NOT_LOCKED); +} + + static void sctp_notify_stream_reset(struct sctp_tcb *stcb, int number_entries, uint16_t * list, int flag) @@ -3528,6 +3585,16 @@ sctp_ulp_notify(uint32_t notification, s break; case SCTP_NOTIFY_HB_RESP: break; + case SCTP_NOTIFY_STR_RESET_INSTREAM_ADD_OK: + sctp_notify_stream_reset_add(stcb, error, SCTP_STRRESET_INBOUND_STR); + break; + case SCTP_NOTIFY_STR_RESET_ADD_OK: + sctp_notify_stream_reset_add(stcb, error, SCTP_STRRESET_OUTBOUND_STR); + break; + case SCTP_NOTIFY_STR_RESET_ADD_FAIL: + sctp_notify_stream_reset_add(stcb, error, (SCTP_STRRESET_FAILED | SCTP_STRRESET_OUTBOUND_STR)); + break; + case SCTP_NOTIFY_STR_RESET_SEND: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), SCTP_STRRESET_OUTBOUND_STR); break; From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 15:52:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81481065673; Fri, 20 Feb 2009 15:52:54 +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 8CF0C8FC13; Fri, 20 Feb 2009 15:52:54 +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 n1KFqsRU033058; Fri, 20 Feb 2009 15:52:54 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KFqsvf033057; Fri, 20 Feb 2009 15:52:54 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902201552.n1KFqsvf033057@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 15:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188857 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 15:52:56 -0000 Author: sam Date: Fri Feb 20 15:52:53 2009 New Revision: 188857 URL: http://svn.freebsd.org/changeset/base/188857 Log: add Chris Zimmermman Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Feb 20 15:26:34 2009 (r188856) +++ svnadmin/conf/mentors Fri Feb 20 15:52:53 2009 (r188857) @@ -11,6 +11,7 @@ # Mentee Mentor Optional comment avg rpaulo Co-mentor: jhb +cbzimmer sam eri mlaier Co-mentor: thompsa jamie bz Co-mentor: brooks pho kib From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 16:19:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D640106564A; Fri, 20 Feb 2009 16:19:34 +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 7CED48FC18; Fri, 20 Feb 2009 16:19:34 +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 n1KGJYqa033593; Fri, 20 Feb 2009 16:19:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KGJYaC033592; Fri, 20 Feb 2009 16:19:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902201619.n1KGJYaC033592@svn.freebsd.org> From: Alan Cox Date: Fri, 20 Feb 2009 16:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188859 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 16:19:35 -0000 Author: alc Date: Fri Feb 20 16:19:34 2009 New Revision: 188859 URL: http://svn.freebsd.org/changeset/base/188859 Log: Eliminate stale comments. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Feb 20 16:11:43 2009 (r188858) +++ head/sys/vm/swap_pager.c Fri Feb 20 16:19:34 2009 (r188859) @@ -1318,10 +1318,6 @@ swap_pager_putpages(vm_object_t object, * because we marked them all VM_PAGER_PEND on return from putpages ). * * This routine may not block. - * This routine is called at splbio() or better - * - * We up ourselves to splvm() as required for various vm_page related - * calls. */ static void swp_pager_async_iodone(struct buf *bp) From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 17:48:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F30E106564A; Fri, 20 Feb 2009 17:48:41 +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 0B9F68FC08; Fri, 20 Feb 2009 17:48:41 +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 n1KHmf52035227; Fri, 20 Feb 2009 17:48:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KHmeQ1035218; Fri, 20 Feb 2009 17:48:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200902201748.n1KHmeQ1035218@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 20 Feb 2009 17:48: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: r188860 - in head/sys/powerpc: aim include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 17:48:41 -0000 Author: nwhitehorn Date: Fri Feb 20 17:48:40 2009 New Revision: 188860 URL: http://svn.freebsd.org/changeset/base/188860 Log: Add Altivec support for supported CPUs. This is derived from the FPU support code, and also reducing the size of trapcode to fit inside a 32 byte handler slot. Reviewed by: grehan MFC after: 2 weeks Added: head/sys/powerpc/include/altivec.h (contents, props changed) head/sys/powerpc/powerpc/altivec.c (contents, props changed) Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/swtch.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr.S head/sys/powerpc/include/pcb.h head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/machdep.c Fri Feb 20 17:48:40 2009 (r188860) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -238,7 +239,6 @@ extern void *dsitrap, *dsisize; extern void *decrint, *decrsize; extern void *extint, *extsize; extern void *dblow, *dbsize; -extern void *vectrap, *vectrapsize; u_int powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp) @@ -340,7 +340,7 @@ powerpc_init(u_int startkernel, u_int en bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_TRC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_FPA, (size_t)&trapsize); - bcopy(&vectrap, (void *)EXC_VEC, (size_t)&vectrapsize); + bcopy(&trapcode, (void *)EXC_VEC, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_VECAST, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize); @@ -647,7 +647,21 @@ grab_mcontext(struct thread *td, mcontex memcpy(mcp->mc_fpreg, pcb->pcb_fpu.fpr, 32*sizeof(double)); } - /* XXX Altivec context ? */ + /* + * Repeat for Altivec context + */ + + if (pcb->pcb_flags & PCB_VEC) { + KASSERT(td == curthread, + ("get_mcontext: fp save not curthread")); + critical_enter(); + save_vec(td); + critical_exit(); + mcp->mc_flags |= _MC_AV_VALID; + mcp->mc_vscr = pcb->pcb_vec.vscr; + mcp->mc_vrsave = pcb->pcb_vec.vrsave; + memcpy(mcp->mc_avec, pcb->pcb_vec.vr, sizeof(mcp->mc_avec)); + } mcp->mc_len = sizeof(*mcp); @@ -701,7 +715,17 @@ set_mcontext(struct thread *td, const mc memcpy(pcb->pcb_fpu.fpr, mcp->mc_fpreg, 32*sizeof(double)); } - /* XXX Altivec context? */ + if (mcp->mc_flags & _MC_AV_VALID) { + if ((pcb->pcb_flags & PCB_VEC) != PCB_VEC) { + critical_enter(); + enable_vec(td); + critical_exit(); + } + pcb->pcb_vec.vscr = mcp->mc_vscr; + pcb->pcb_vec.vrsave = mcp->mc_vrsave; + memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec)); + } + return (0); } Modified: head/sys/powerpc/aim/swtch.S ============================================================================== --- head/sys/powerpc/aim/swtch.S Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/swtch.S Fri Feb 20 17:48:40 2009 (r188860) @@ -106,8 +106,16 @@ ENTRY(cpu_switch) andi. %r6, %r6, PCB_FPU beq .L1 bl save_fpu - mr %r3,%r14 /* restore old thread ptr */ + .L1: + lwz %r6,PCB_FLAGS(%r5) + /* Save Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L2 + bl save_vec + +.L2: + mr %r3,%r14 /* restore old thread ptr */ bl pmap_deactivate /* Deactivate the current pmap */ cpu_switchin: @@ -122,12 +130,20 @@ cpu_switchin: lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU - beq .L2 + beq .L3 mr %r3,%r15 /* Pass curthread to enable_fpu */ bl enable_fpu +.L3: + lwz %r6, PCB_FLAGS(%r17) + /* Restore Altivec context if needed */ + andi. %r6, %r6, PCB_VEC + beq .L4 + mr %r3,%r15 /* Pass curthread to enable_vec */ + bl enable_vec + /* thread to restore is in r3 */ -.L2: +.L4: mr %r3,%r17 /* Recover PCB ptr */ lmw %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs */ mr %r2,%r12 Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/trap.c Fri Feb 20 17:48:40 2009 (r188860) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -188,24 +189,16 @@ trap(struct trapframe *frame) enable_fpu(td); break; -#ifdef ALTIVEC case EXC_VEC: - if ((vecthread = PCPU_GET(vecthread)) != NULL) { - KASSERT(vecthread != td, - ("altivec already enabled")); - save_vec(vecthread); - } - PCPU_SET(vecthread, td); - td->td_pcb->pcb_veccpu = PCPU_GET(cpuid); + KASSERT((td->td_pcb->pcb_flags & PCB_VEC) != PCB_VEC, + ("Altivec already enabled for thread")); enable_vec(td); - frame->srr1 |= PSL_VEC; break; -#else - case EXC_VEC: + case EXC_VECAST: + printf("Vector assist exception!\n"); sig = SIGILL; break; -#endif /* ALTIVEC */ case EXC_ALI: if (fix_unaligned(td, frame) != 0) Modified: head/sys/powerpc/aim/trap_subr.S ============================================================================== --- head/sys/powerpc/aim/trap_subr.S Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/aim/trap_subr.S Fri Feb 20 17:48:40 2009 (r188860) @@ -79,13 +79,13 @@ /* * FRAME_SETUP assumes: * SPRG1 SP (1) + * SPRG3 trap type * savearea r28-r31,DAR,DSISR (DAR & DSISR only for DSI traps) * r28 LR * r29 CR * r30 scratch * r31 scratch * r1 kernel stack - * LR trap type (from calling address, mask with 0xff00) * SRR0/1 as at start of trap */ #define FRAME_SETUP(savearea) \ @@ -146,8 +146,7 @@ lwz %r31,(savearea+CPUSAVE_SRR1)(%r2); /* saved SRR1 */ \ mfxer %r3; \ mfctr %r4; \ - mflr %r5; \ - andi. %r5,%r5,0xff00; /* convert LR to exc # */ \ + mfsprg3 %r5; \ stw %r3, FRAME_XER+8(1); /* save xer/ctr/exc */ \ stw %r4, FRAME_CTR+8(1); \ stw %r5, FRAME_EXC+8(1); \ @@ -264,18 +263,10 @@ CNAME(rstsize) = . - CNAME(rstcode) .globl CNAME(trapcode),CNAME(trapsize) CNAME(trapcode): mtsprg1 %r1 /* save SP */ - GET_CPUINFO(%r1) - stw %r28,(PC_TEMPSAVE+CPUSAVE_R28)(%r1) /* free r28-r31 */ - stw %r29,(PC_TEMPSAVE+CPUSAVE_R29)(%r1) - stw %r30,(PC_TEMPSAVE+CPUSAVE_R30)(%r1) - stw %r31,(PC_TEMPSAVE+CPUSAVE_R31)(%r1) - mfsprg1 %r1 /* restore SP, in case of branch */ - mflr %r28 /* save LR */ - mfcr %r29 /* save CR */ -/* Test whether we already had PR set */ - mfsrr1 %r31 - mtcr %r31 - bla s_trap /* LR & 0xff00 is exception # */ + mflr %r1 /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0x20 /* How to get the vector from LR */ + bla generictrap /* LR & SPRG3 is exception # */ CNAME(trapsize) = .-CNAME(trapcode) /* @@ -296,10 +287,15 @@ CNAME(alitrap): mfsprg1 %r1 /* restore SP, in case of branch */ mflr %r28 /* save LR */ mfcr %r29 /* save CR */ -/* Test whether we already had PR set */ + + /* Put our exception vector in SPRG0 */ + li %r31, EXC_ALI + mtsprg3 %r31 + + /* Test whether we already had PR set */ mfsrr1 %r31 mtcr %r31 - bla s_trap /* LR & 0xff00 is exception # */ + bla s_trap CNAME(alisize) = .-CNAME(alitrap) /* @@ -364,6 +360,11 @@ CNAME(dsisize) = .-CNAME(dsitrap) * Preamble code for DSI/ISI traps */ disitrap: + /* Write the trap vector to SPRG0 by computing LR & 0xff00 */ + mflr %r1 + andi. %r1,%r1,0xff00 + mtsprg3 %r1 + GET_CPUINFO(%r1) lwz %r30,(PC_DISISAVE+CPUSAVE_R28)(%r1) stw %r30,(PC_TEMPSAVE+CPUSAVE_R28)(%r1) @@ -416,6 +417,47 @@ realtrap: mtcr %r1 mfsprg1 %r1 /* restore SP (might have been overwritten) */ + bf 17,k_trap /* branch if PSL_PR is false */ + GET_CPUINFO(%r1) + lwz %r1,PC_CURPCB(%r1) + RESTORE_KERN_SRS(%r30,%r31) /* enable kernel mapping */ + ba s_trap + +/* + * generictrap does some standard setup for trap handling to minimize + * the code that need be installed in the actual vectors. It expects + * the following conditions. + * + * R1 - Trap vector = LR & (0xff00 | R1) + * SPRG1 - Original R1 contents + * SPRG2 - Original LR + */ + +generictrap: + /* Save R1 for computing the exception vector */ + mtsprg3 %r1 + + /* Save interesting registers */ + GET_CPUINFO(%r1) + stw %r28,(PC_TEMPSAVE+CPUSAVE_R28)(%r1) /* free r28-r31 */ + stw %r29,(PC_TEMPSAVE+CPUSAVE_R29)(%r1) + stw %r30,(PC_TEMPSAVE+CPUSAVE_R30)(%r1) + stw %r31,(PC_TEMPSAVE+CPUSAVE_R31)(%r1) + mfsprg1 %r1 /* restore SP, in case of branch */ + mfsprg2 %r28 /* save LR */ + mfcr %r29 /* save CR */ + + /* Compute the exception vector from the link register */ + mfsprg3 %r31 + ori %r31,%r31,0xff00 + mflr %r30 + and %r30,%r30,%r31 + mtsprg3 %r30 + + /* Test whether we already had PR set */ + mfsrr1 %r31 + mtcr %r31 + s_trap: bf 17,k_trap /* branch if PSL_PR is false */ GET_CPUINFO(%r1) @@ -464,14 +506,6 @@ CNAME(asttrapexit): FRAME_LEAVE(PC_TEMPSAVE) rfi -/* - * Temporary: vector-unavailable traps are directed to vector-assist traps - */ - .globl CNAME(vectrap),CNAME(vectrapsize) -CNAME(vectrap): - ba EXC_VECAST -CNAME(vectrapsize) = .-CNAME(vectrap) - #if defined(KDB) /* * Deliberate entry to dbtrap @@ -499,6 +533,14 @@ CNAME(breakpoint): * Now the kdb trap catching code. */ dbtrap: + /* Write the trap vector to SPRG0 by computing LR & 0xff00 */ + mflr %r1 + andi. %r1,%r1,0xff00 + mtsprg3 %r1 + + lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */ + addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l + FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ addi %r3,%r1,8 @@ -536,24 +578,25 @@ CNAME(dblow): mfcr %r29 /* save CR in r29 */ mfsrr1 %r1 mtcr %r1 - GET_CPUINFO(%r1) bf 17,1f /* branch if privileged */ - stw %r28,(PC_TEMPSAVE+CPUSAVE_R28)(%r1) /* free r28 */ - mfsprg2 %r28 /* r29 holds cr ... */ - stw %r28,(PC_TEMPSAVE+CPUSAVE_R29)(%r1) /* free r29 */ - stw %r30,(PC_TEMPSAVE+CPUSAVE_R30)(%r1) /* free r30 */ - stw %r31,(PC_TEMPSAVE+CPUSAVE_R31)(%r1) /* free r31 */ - mflr %r28 /* save LR */ - bla u_trap + + /* Unprivileged case */ + mtcr %r29 /* put the condition register back */ + mfsprg2 %r29 /* ... and r29 */ + mflr %r1 /* save LR */ + mtsprg2 %r1 /* And then in SPRG2 */ + li %r1, 0 /* How to get the vector from LR */ + + bla generictrap /* and we look like a generic trap */ 1: + /* Privileged, so drop to KDB */ + GET_CPUINFO(%r1) stw %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ mfsprg2 %r28 /* r29 holds cr... */ stw %r28,(PC_DBSAVE+CPUSAVE_R29)(%r1) /* free r29 */ stw %r30,(PC_DBSAVE+CPUSAVE_R30)(%r1) /* free r30 */ stw %r31,(PC_DBSAVE+CPUSAVE_R31)(%r1) /* free r31 */ mflr %r28 /* save LR */ - lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l bla dbtrap CNAME(dbsize) = .-CNAME(dblow) #endif /* KDB */ Added: head/sys/powerpc/include/altivec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/include/altivec.h Fri Feb 20 17:48:40 2009 (r188860) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2008 Nathan Whitehorn + * All rights reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_ALTIVEC_H_ +#define _MACHINE_ALTIVEC_H_ + +void enable_vec(struct thread *); +void save_vec(struct thread *); + +#endif /* _MACHINE_ALTIVEC_H_ */ + Modified: head/sys/powerpc/include/pcb.h ============================================================================== --- head/sys/powerpc/include/pcb.h Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/include/pcb.h Fri Feb 20 17:48:40 2009 (r188860) @@ -47,12 +47,21 @@ struct pcb { copyin/copyout */ int pcb_flags; #define PCB_FPU 1 /* Process had FPU initialized */ +#define PCB_VEC 2 /* Process had Altivec initialized */ struct fpu { double fpr[32]; double fpscr; /* FPSCR stored as double for easier access */ } pcb_fpu; /* Floating point processor */ unsigned int pcb_fpcpu; /* which CPU had our FPU stuff. */ + struct vec { + uint32_t vr[32][4]; + register_t vrsave; + register_t spare[2]; + register_t vscr; + } pcb_vec __attribute__((aligned(16))); /* Vector processor */ + unsigned int pcb_veccpu; /* which CPU had our vector + stuff. */ union { struct { Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/include/pcpu.h Fri Feb 20 17:48:40 2009 (r188860) @@ -39,6 +39,7 @@ struct pmap; int pc_inside_intr; \ struct pmap *pc_curpmap; /* current pmap */ \ struct thread *pc_fputhread; /* current fpu user */ \ + struct thread *pc_vecthread; /* current vec user */ \ uintptr_t pc_hwref; \ uint32_t pc_pir; \ int pc_bsp:1; \ Added: head/sys/powerpc/powerpc/altivec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/altivec.c Fri Feb 20 17:48:40 2009 (r188860) @@ -0,0 +1,152 @@ +/*- + * Copyright (C) 1996 Wolfgang Solfrank. + * Copyright (C) 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. + * + * $NetBSD: fpu.c,v 1.5 2001/07/22 11:29:46 wiz Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +void +enable_vec(struct thread *td) +{ + int msr; + struct pcb *pcb; + struct trapframe *tf; + + pcb = td->td_pcb; + tf = trapframe(td); + + /* + * Save the thread's Altivec CPU number, and set the CPU's current + * vector thread + */ + td->td_pcb->pcb_veccpu = PCPU_GET(cpuid); + PCPU_SET(vecthread, td); + + /* + * Enable the vector unit for when the thread returns from the + * exception. If this is the first time the unit has been used by + * the thread, initialise the vector registers and VSCR to 0, and + * set the flag to indicate that the vector unit is in use. + */ + tf->srr1 |= PSL_VEC; + if (!(pcb->pcb_flags & PCB_VEC)) { + memset(&pcb->pcb_vec, 0, sizeof pcb->pcb_vec); + pcb->pcb_flags |= PCB_VEC; + } + + /* + * Temporarily enable the vector unit so the registers + * can be restored. + */ + msr = mfmsr(); + mtmsr(msr | PSL_VEC); + isync(); + + /* + * Restore VSCR by first loading it into a vector and then into VSCR. + * (this needs to done before loading the user's vector registers + * since we need to use a scratch vector register) + */ + __asm __volatile("vxor 0,0,0; lvewx 0,0,%0; mtvscr 0" \ + :: "b"(&pcb->pcb_vec.vscr)); + +#define LVX(n) __asm ("lvx " #n ",0,%0" \ + :: "b"(&pcb->pcb_vec.vr[n])); + LVX(0); LVX(1); LVX(2); LVX(3); + LVX(4); LVX(5); LVX(6); LVX(7); + LVX(8); LVX(9); LVX(10); LVX(11); + LVX(12); LVX(13); LVX(14); LVX(15); + LVX(16); LVX(17); LVX(18); LVX(19); + LVX(20); LVX(21); LVX(22); LVX(23); + LVX(24); LVX(25); LVX(26); LVX(27); + LVX(28); LVX(29); LVX(30); LVX(31); +#undef LVX + + isync(); + mtmsr(msr); +} + +void +save_vec(struct thread *td) +{ + int msr; + struct pcb *pcb; + + pcb = td->td_pcb; + + /* + * Temporarily re-enable the vector unit during the save + */ + msr = mfmsr(); + mtmsr(msr | PSL_VEC); + isync(); + + /* + * Save the vector registers and VSCR to the PCB + */ +#define STVX(n) __asm ("stvx %1,0,%0" \ + :: "b"(pcb->pcb_vec.vr[n]), "n"(n)); + STVX(0); STVX(1); STVX(2); STVX(3); + STVX(4); STVX(5); STVX(6); STVX(7); + STVX(8); STVX(9); STVX(10); STVX(11); + STVX(12); STVX(13); STVX(14); STVX(15); + STVX(16); STVX(17); STVX(18); STVX(19); + STVX(20); STVX(21); STVX(22); STVX(23); + STVX(24); STVX(25); STVX(26); STVX(27); + STVX(28); STVX(29); STVX(30); STVX(31); +#undef STVX + + __asm __volatile("mfvscr 0; stvewx 0,0,%0" :: "b"(&pcb->pcb_vec.vscr)); + + /* + * Disable vector unit again + */ + isync(); + mtmsr(msr); + + /* + * Clear the current vec thread and pcb's CPU id + * XXX should this be left clear to allow lazy save/restore ? + */ + pcb->pcb_veccpu = INT_MAX; + PCPU_SET(vecthread, NULL); +} + Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Fri Feb 20 16:19:34 2009 (r188859) +++ head/sys/powerpc/powerpc/genassym.c Fri Feb 20 17:48:40 2009 (r188860) @@ -171,6 +171,7 @@ ASSYM(PCB_LR, offsetof(struct pcb, pcb_l ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_FPU, PCB_FPU); +ASSYM(PCB_VEC, PCB_VEC); ASSYM(PCB_AIM_USR, offsetof(struct pcb, pcb_cpu.aim.usr)); ASSYM(PCB_BOOKE_CTR, offsetof(struct pcb, pcb_cpu.booke.ctr)); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 20:20:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0793F106566C; Fri, 20 Feb 2009 20:20:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E93D98FC13; Fri, 20 Feb 2009 20:20:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KKK0dD038195; Fri, 20 Feb 2009 20:20:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KKK0Kh038194; Fri, 20 Feb 2009 20:20:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902202020.n1KKK0Kh038194@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 20:20: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: r188861 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 20:20:01 -0000 Author: mav Date: Fri Feb 20 20:20:00 2009 New Revision: 188861 URL: http://svn.freebsd.org/changeset/base/188861 Log: Disable port interrupts before doing PHY reset. PHY reset causes drive connect/disconnect events, unwanted at this moment. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 17:48:40 2009 (r188860) +++ head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 20:20:00 2009 (r188861) @@ -679,6 +679,9 @@ ata_ahci_reset(device_t dev) u_int32_t signature; int offset = ch->unit << 7; + /* Disable port interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); + /* setup work areas */ work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 20:29:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50AF61065672; Fri, 20 Feb 2009 20:29:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DABA8FC18; Fri, 20 Feb 2009 20:29:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KKTXJ5038398; Fri, 20 Feb 2009 20:29:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KKTXYa038397; Fri, 20 Feb 2009 20:29:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902202029.n1KKTXYa038397@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 20:29: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: r188862 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 20:29:34 -0000 Author: mav Date: Fri Feb 20 20:29:32 2009 New Revision: 188862 URL: http://svn.freebsd.org/changeset/base/188862 Log: Reduce soft-reset assertion time from 5ms to 50us. ATA specification declares minimal reset time of 5us. SATA keeps it, but requires devices to handle commands transmitted even one by one without any gap. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 20:20:00 2009 (r188861) +++ head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 20:29:32 2009 (r188862) @@ -653,7 +653,7 @@ ata_ahci_softreset(device_t dev, int por device_printf(dev, "setting SRST failed ??\n"); //return -1; - ata_udelay(5000); + ata_udelay(50); /* pull reset inactive -> device softreset */ bzero(ctp->cfis, 64); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 21:55:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1F8106566C; Fri, 20 Feb 2009 21:55:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E42778FC1F; Fri, 20 Feb 2009 21:55:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KLtNY0039906; Fri, 20 Feb 2009 21:55:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KLtN52039905; Fri, 20 Feb 2009 21:55:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902202155.n1KLtN52039905@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 21:55: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: r188863 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 21:55:24 -0000 Author: sam Date: Fri Feb 20 21:55:23 2009 New Revision: 188863 URL: http://svn.freebsd.org/changeset/base/188863 Log: misc cleanup of wme parameter setting Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Fri Feb 20 20:29:32 2009 (r188862) +++ head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:55:23 2009 (r188863) @@ -819,6 +819,29 @@ static const struct phyParamType bssPhyP }; static void +_setifsparams(struct wmeParams *wmep, const paramType *phy) +{ + wmep->wmep_aifsn = phy->aifsn; + wmep->wmep_logcwmin = phy->logcwmin; + wmep->wmep_logcwmax = phy->logcwmax; + wmep->wmep_txopLimit = phy->txopLimit; +} + +static void +setwmeparams(struct ieee80211vap *vap, const char *type, int ac, + struct wmeParams *wmep, const paramType *phy) +{ + wmep->wmep_acm = phy->acm; + _setifsparams(wmep, phy); + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, + "set %s (%s) [acm %u aifsn %u logcwmin %u logcwmax %u txop %u]\n", + ieee80211_wme_acnames[ac], type, + wmep->wmep_acm, wmep->wmep_aifsn, wmep->wmep_logcwmin, + wmep->wmep_logcwmax, wmep->wmep_txopLimit); +} + +static void ieee80211_wme_initparams_locked(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; @@ -863,49 +886,14 @@ ieee80211_wme_initparams_locked(struct i pBssPhyParam = &bssPhyParamForAC_BE[mode]; break; } - wmep = &wme->wme_wmeChanParams.cap_wmeParams[i]; if (ic->ic_opmode == IEEE80211_M_HOSTAP) { - wmep->wmep_acm = pPhyParam->acm; - wmep->wmep_aifsn = pPhyParam->aifsn; - wmep->wmep_logcwmin = pPhyParam->logcwmin; - wmep->wmep_logcwmax = pPhyParam->logcwmax; - wmep->wmep_txopLimit = pPhyParam->txopLimit; + setwmeparams(vap, "chan", i, wmep, pPhyParam); } else { - wmep->wmep_acm = pBssPhyParam->acm; - wmep->wmep_aifsn = pBssPhyParam->aifsn; - wmep->wmep_logcwmin = pBssPhyParam->logcwmin; - wmep->wmep_logcwmax = pBssPhyParam->logcwmax; - wmep->wmep_txopLimit = pBssPhyParam->txopLimit; - + setwmeparams(vap, "chan", i, wmep, pBssPhyParam); } - IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s chan [acm %u aifsn %u log2(cwmin) %u " - "log2(cwmax) %u txpoLimit %u]\n", __func__ - , ieee80211_wme_acnames[i] - , wmep->wmep_acm - , wmep->wmep_aifsn - , wmep->wmep_logcwmin - , wmep->wmep_logcwmax - , wmep->wmep_txopLimit - ); - wmep = &wme->wme_wmeBssChanParams.cap_wmeParams[i]; - wmep->wmep_acm = pBssPhyParam->acm; - wmep->wmep_aifsn = pBssPhyParam->aifsn; - wmep->wmep_logcwmin = pBssPhyParam->logcwmin; - wmep->wmep_logcwmax = pBssPhyParam->logcwmax; - wmep->wmep_txopLimit = pBssPhyParam->txopLimit; - IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s bss [acm %u aifsn %u log2(cwmin) %u " - "log2(cwmax) %u txpoLimit %u]\n", __func__ - , ieee80211_wme_acnames[i] - , wmep->wmep_acm - , wmep->wmep_aifsn - , wmep->wmep_logcwmin - , wmep->wmep_logcwmax - , wmep->wmep_txopLimit - ); + setwmeparams(vap, "bss ", i, wmep, pBssPhyParam); } /* NB: check ic_bss to avoid NULL deref on initial attach */ if (vap->iv_bss != NULL) { @@ -937,7 +925,7 @@ ieee80211_wme_initparams(struct ieee8021 void ieee80211_wme_updateparams_locked(struct ieee80211vap *vap) { - static const paramType phyParam[IEEE80211_MODE_MAX] = { + static const paramType aggrParam[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11A] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11B] = { 2, 5, 10, 64, 0 }, @@ -958,7 +946,10 @@ ieee80211_wme_updateparams_locked(struct enum ieee80211_phymode mode; int i; - /* set up the channel access parameters for the physical device */ + /* + * Set up the channel access parameters for the physical + * device. First populate the configured settings. + */ for (i = 0; i < WME_NUM_AC; i++) { chanp = &wme->wme_chanParams.cap_wmeParams[i]; wmep = &wme->wme_wmeChanParams.cap_wmeParams[i]; @@ -1002,27 +993,21 @@ ieee80211_wme_updateparams_locked(struct chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; - chanp->wmep_aifsn = bssp->wmep_aifsn = phyParam[mode].aifsn; + chanp->wmep_aifsn = bssp->wmep_aifsn = aggrParam[mode].aifsn; chanp->wmep_logcwmin = bssp->wmep_logcwmin = - phyParam[mode].logcwmin; + aggrParam[mode].logcwmin; chanp->wmep_logcwmax = bssp->wmep_logcwmax = - phyParam[mode].logcwmax; + aggrParam[mode].logcwmax; chanp->wmep_txopLimit = bssp->wmep_txopLimit = - (vap->iv_flags & IEEE80211_F_BURST) ? - phyParam[mode].txopLimit : 0; + (vap->iv_flags & IEEE80211_F_BURST) ? + aggrParam[mode].txopLimit : 0; IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s [acm %u aifsn %u log2(cwmin) %u " - "log2(cwmax) %u txpoLimit %u]\n", __func__ - , ieee80211_wme_acnames[WME_AC_BE] - , chanp->wmep_acm - , chanp->wmep_aifsn - , chanp->wmep_logcwmin - , chanp->wmep_logcwmax - , chanp->wmep_txopLimit - ); + "update %s (chan+bss) [acm %u aifsn %u logcwmin %u " + "logcwmax %u txop %u]\n", ieee80211_wme_acnames[WME_AC_BE], + chanp->wmep_acm, chanp->wmep_aifsn, chanp->wmep_logcwmin, + chanp->wmep_logcwmax, chanp->wmep_txopLimit); } - /* XXX multi-bss */ if (vap->iv_opmode == IEEE80211_M_HOSTAP && ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) { static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { @@ -1044,10 +1029,8 @@ ieee80211_wme_updateparams_locked(struct chanp->wmep_logcwmin = bssp->wmep_logcwmin = logCwMin[mode]; IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: %s log2(cwmin) %u\n", __func__ - , ieee80211_wme_acnames[WME_AC_BE] - , chanp->wmep_logcwmin - ); + "update %s (chan+bss) logcwmin %u\n", + ieee80211_wme_acnames[WME_AC_BE], chanp->wmep_logcwmin); } if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX ibss? */ /* @@ -1062,10 +1045,10 @@ ieee80211_wme_updateparams_locked(struct wme->wme_update(ic); IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, - "%s: WME params updated, cap_info 0x%x\n", __func__, - vap->iv_opmode == IEEE80211_M_STA ? - wme->wme_wmeChanParams.cap_info : - wme->wme_bssChanParams.cap_info); + "%s: WME params updated, cap_info 0x%x\n", __func__, + vap->iv_opmode == IEEE80211_M_STA ? + wme->wme_wmeChanParams.cap_info : + wme->wme_bssChanParams.cap_info); } void From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 21:57:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C737A106564A; Fri, 20 Feb 2009 21:57:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B52618FC08; Fri, 20 Feb 2009 21:57:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KLv5jF039967; Fri, 20 Feb 2009 21:57:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KLv5J2039966; Fri, 20 Feb 2009 21:57:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902202157.n1KLv5J2039966@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 21:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188864 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 21:57:06 -0000 Author: sam Date: Fri Feb 20 21:57:05 2009 New Revision: 188864 URL: http://svn.freebsd.org/changeset/base/188864 Log: o reset aggressive mode flag; it was being left set after marking an interface down o only allow the first vap to initialize shared wme parameters Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:55:23 2009 (r188863) +++ head/sys/net80211/ieee80211_proto.c Fri Feb 20 21:57:05 2009 (r188864) @@ -853,7 +853,7 @@ ieee80211_wme_initparams_locked(struct i IEEE80211_LOCK_ASSERT(ic); - if ((ic->ic_caps & IEEE80211_C_WME) == 0) + if ((ic->ic_caps & IEEE80211_C_WME) == 0 || ic->ic_nrunning > 1) return; /* @@ -905,6 +905,7 @@ ieee80211_wme_initparams_locked(struct i */ wme->wme_hipri_switch_thresh = (HIGH_PRI_SWITCH_THRESH * vap->iv_bss->ni_intval) / 100; + wme->wme_flags &= ~WME_F_AGGRMODE; ieee80211_wme_updateparams(vap); } } From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 22:05:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEDED106566B; Fri, 20 Feb 2009 22:05:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCB658FC14; Fri, 20 Feb 2009 22:05:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KM585b040165; Fri, 20 Feb 2009 22:05:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KM58wY040164; Fri, 20 Feb 2009 22:05:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902202205.n1KM58wY040164@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 22:05: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: r188865 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 22:05:09 -0000 Author: sam Date: Fri Feb 20 22:05:08 2009 New Revision: 188865 URL: http://svn.freebsd.org/changeset/base/188865 Log: don't adjust core clk conversions for 1/2 and 1/4 rate channels; the mac runs at full speed so doing this breaks conversion for ifs parameters Submitted by: Felix Fietkau Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Feb 20 21:57:05 2009 (r188864) +++ head/sys/dev/ath/ath_hal/ah.c Fri Feb 20 22:05:08 2009 (r188865) @@ -266,10 +266,6 @@ ath_hal_mac_clks(struct ath_hal *ah, u_i clks = usecs * CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; if (IEEE80211_IS_CHAN_HT40(c)) clks <<= 1; - else if (IEEE80211_IS_CHAN_HALF(c)) - clks >>= 1; - else if (IEEE80211_IS_CHAN_QUARTER(c)) - clks >>= 2; } else clks = usecs * CLOCK_RATE[WIRELESS_MODE_11b]; return clks; @@ -286,10 +282,6 @@ ath_hal_mac_usec(struct ath_hal *ah, u_i usec = clks / CLOCK_RATE[ath_hal_chan2wmode(ah, c)]; if (IEEE80211_IS_CHAN_HT40(c)) usec >>= 1; - else if (IEEE80211_IS_CHAN_HALF(c)) - usec <<= 1; - else if (IEEE80211_IS_CHAN_QUARTER(c)) - usec <<= 2; } else usec = clks / CLOCK_RATE[WIRELESS_MODE_11b]; return usec; From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 22:06:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CC42106564A; Fri, 20 Feb 2009 22:06:58 +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 4A35E8FC15; Fri, 20 Feb 2009 22:06:58 +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 n1KM6wbh040235; Fri, 20 Feb 2009 22:06:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KM6wP9040234; Fri, 20 Feb 2009 22:06:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902202206.n1KM6wP9040234@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 22:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188866 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 22:06:59 -0000 Author: sam Date: Fri Feb 20 22:06:58 2009 New Revision: 188866 URL: http://svn.freebsd.org/changeset/base/188866 Log: correct SIFS setting; there is a 2usec adjustment between the calculated value and what the hardware requires (based on inspection of INI values) Submitted by: Jiri Fojtasek Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Feb 20 22:05:08 2009 (r188865) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Feb 20 22:06:58 2009 (r188866) @@ -450,7 +450,7 @@ ar5212SetSifsTime(struct ath_hal *ah, u_ return AH_FALSE; } else { /* convert to system clocks */ - OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us)); + OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS, ath_hal_mac_clks(ah, us-2)); ahp->ah_slottime = us; return AH_TRUE; } @@ -460,7 +460,7 @@ u_int ar5212GetSifsTime(struct ath_hal *ah) { u_int clks = OS_REG_READ(ah, AR_D_GBL_IFS_SIFS) & 0xffff; - return ath_hal_mac_usec(ah, clks); /* convert from system clocks */ + return ath_hal_mac_usec(ah, clks)+2; /* convert from system clocks */ } HAL_BOOL From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 22:46:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD131106566B; Fri, 20 Feb 2009 22:46:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACA28FC0C; Fri, 20 Feb 2009 22:46:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KMkO5k040997; Fri, 20 Feb 2009 22:46:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KMkOd8040996; Fri, 20 Feb 2009 22:46:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902202246.n1KMkOd8040996@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 22:46: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: r188867 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 22:46:25 -0000 Author: mav Date: Fri Feb 20 22:46:24 2009 New Revision: 188867 URL: http://svn.freebsd.org/changeset/base/188867 Log: Fix typo: s/SLUMPER/SLUMBER/ Modified: head/sys/dev/ata/ata-all.h Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Fri Feb 20 22:06:58 2009 (r188866) +++ head/sys/dev/ata/ata-all.h Fri Feb 20 22:46:24 2009 (r188867) @@ -212,7 +212,7 @@ #define ATA_AHCI_P_CMD_NOOP 0x00000000 #define ATA_AHCI_P_CMD_ACTIVE 0x10000000 #define ATA_AHCI_P_CMD_PARTIAL 0x20000000 -#define ATA_AHCI_P_CMD_SLUMPER 0x60000000 +#define ATA_AHCI_P_CMD_SLUMBER 0x60000000 #define ATA_AHCI_P_TFD 0x120 #define ATA_AHCI_P_SIG 0x124 From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 23:01:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E636106566B; Fri, 20 Feb 2009 23:01:27 +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 4BA918FC13; Fri, 20 Feb 2009 23:01:27 +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 n1KN1RWt041380; Fri, 20 Feb 2009 23:01:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KN1R93041379; Fri, 20 Feb 2009 23:01:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902202301.n1KN1R93041379@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 20 Feb 2009 23:01: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: r188868 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 23:01:28 -0000 Author: marcel Date: Fri Feb 20 23:01:27 2009 New Revision: 188868 URL: http://svn.freebsd.org/changeset/base/188868 Log: Don't read the TOC for DIOCGPROVIDERALIAS. This causes the acd code to create new provider (?), but not from an expected context, which results in a panic (GEOM topology not held). Modified: head/sys/dev/ata/atapi-cd.c Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Fri Feb 20 22:46:24 2009 (r188867) +++ head/sys/dev/ata/atapi-cd.c Fri Feb 20 23:01:27 2009 (r188868) @@ -219,7 +219,10 @@ acd_geom_ioctl(struct g_provider *pp, u_ case CDIOCRESET: acd_test_ready(dev); break; - + + case DIOCGPROVIDERALIAS: + break; + default: acd_read_toc(dev); acd_prevent_allow(dev, 1); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 23:05:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFFE106566B; Fri, 20 Feb 2009 23:05:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97FD88FC08; Fri, 20 Feb 2009 23:05:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KN555c041486; Fri, 20 Feb 2009 23:05:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KN553O041485; Fri, 20 Feb 2009 23:05:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902202305.n1KN553O041485@svn.freebsd.org> From: Sam Leffler Date: Fri, 20 Feb 2009 23:05: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: r188869 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 23:05:06 -0000 Author: sam Date: Fri Feb 20 23:05:05 2009 New Revision: 188869 URL: http://svn.freebsd.org/changeset/base/188869 Log: mark nodes created by way of neighbor discovery need to be marked as ERP so they get the correct tx parameters setup by node_settxparms Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Feb 20 23:01:27 2009 (r188868) +++ head/sys/net80211/ieee80211_node.c Fri Feb 20 23:05:05 2009 (r188869) @@ -1319,6 +1319,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8 /* XXX no rate negotiation; just dup */ ni->ni_rates = vap->iv_bss->ni_rates; + if (ieee80211_iserp_rateset(&ni->ni_rates)) + ni->ni_flags |= IEEE80211_NODE_ERP; if (vap->iv_opmode == IEEE80211_M_AHDEMO) { /* * In adhoc demo mode there are no management @@ -1394,6 +1396,8 @@ ieee80211_add_neighbor(struct ieee80211v struct ieee80211com *ic = vap->iv_ic; ieee80211_init_neighbor(ni, wh, sp); + if (ieee80211_iserp_rateset(&ni->ni_rates)) + ni->ni_flags |= IEEE80211_NODE_ERP; node_setuptxparms(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); From owner-svn-src-all@FreeBSD.ORG Fri Feb 20 23:17:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC822106566B; Fri, 20 Feb 2009 23:17:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA6568FC12; Fri, 20 Feb 2009 23:17:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KNHqtC042110; Fri, 20 Feb 2009 23:17:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1KNHqmh042109; Fri, 20 Feb 2009 23:17:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902202317.n1KNHqmh042109@svn.freebsd.org> From: Alexander Motin Date: Fri, 20 Feb 2009 23:17: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: r188877 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 23:17:53 -0000 Author: mav Date: Fri Feb 20 23:17:52 2009 New Revision: 188877 URL: http://svn.freebsd.org/changeset/base/188877 Log: Disable port hardware on detach. First switch it to slumber mode to power-down peer transmitter, then disable completely. Side effect of this is saving about 0.5W of power per detached device. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 23:16:47 2009 (r188876) +++ head/sys/dev/ata/chipsets/ata-ahci.c Fri Feb 20 23:17:52 2009 (r188877) @@ -230,6 +230,22 @@ ata_ahci_ch_attach(device_t dev) int ata_ahci_ch_detach(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int offset = ch->unit << 7; + + /* Disable port interrupts. */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); + /* Reset command register. */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, 0); + + /* Allow everything including partial and slumber modes. */ + ATA_IDX_OUTL(ch, ATA_SCONTROL, 0); + /* Request slumber mode transition and give some time to get there. */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, ATA_AHCI_P_CMD_SLUMBER); + DELAY(100); + /* Disable PHY. */ + ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_DISABLE); ata_dmafini(dev); return (0); From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 01:14:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 887B1106567A; Sat, 21 Feb 2009 01:14: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 4058D8FC1A; Sat, 21 Feb 2009 01:14: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 n1L1EoQO044182; Sat, 21 Feb 2009 01:14:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L1EocU044181; Sat, 21 Feb 2009 01:14:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902210114.n1L1EocU044181@svn.freebsd.org> From: Andrew Thompson Date: Sat, 21 Feb 2009 01:14: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: r188878 - head/sys/dev/usb2/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 01:14:51 -0000 Author: thompsa Date: Sat Feb 21 01:14:49 2009 New Revision: 188878 URL: http://svn.freebsd.org/changeset/base/188878 Log: Provide compat typedefs for usb1. Modified: head/sys/dev/usb2/include/usb2_standard.h Modified: head/sys/dev/usb2/include/usb2_standard.h ============================================================================== --- head/sys/dev/usb2/include/usb2_standard.h Fri Feb 20 23:17:52 2009 (r188877) +++ head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 01:14:49 2009 (r188878) @@ -109,6 +109,7 @@ struct usb2_device_request { uWord wIndex; uWord wLength; } __packed; +typedef struct usb2_device_request usb_device_request_t; #define UT_WRITE 0x00 #define UT_READ 0x80 @@ -230,6 +231,7 @@ struct usb2_descriptor { uByte bDescriptorType; uByte bDescriptorSubtype; } __packed; +typedef struct usb2_descriptor usb_descriptor_t; struct usb2_device_descriptor { uByte bLength; @@ -252,6 +254,7 @@ struct usb2_device_descriptor { uByte iSerialNumber; uByte bNumConfigurations; } __packed; +typedef struct usb2_device_descriptor usb_device_descriptor_t; /* Binary Device Object Store (BOS) */ struct usb2_bos_descriptor { @@ -260,6 +263,7 @@ struct usb2_bos_descriptor { uWord wTotalLength; uByte bNumDeviceCaps; } __packed; +typedef struct usb2_bos_descriptor usb_bos_descriptor_t; /* Binary Device Object Store Capability */ struct usb2_bos_cap_descriptor { @@ -273,6 +277,7 @@ struct usb2_bos_cap_descriptor { #define USB_DEVCAP_CONTAINER_ID 0x04 /* data ... */ } __packed; +typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t; struct usb2_devcap_usb2ext_descriptor { uByte bLength; @@ -281,6 +286,7 @@ struct usb2_devcap_usb2ext_descriptor { uByte bmAttributes; #define USB_V2EXT_LPM 0x02 } __packed; +typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; struct usb2_devcap_ss_descriptor { uByte bLength; @@ -292,6 +298,7 @@ struct usb2_devcap_ss_descriptor { uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; +typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t; struct usb2_devcap_container_id_descriptor { uByte bLength; @@ -300,6 +307,8 @@ struct usb2_devcap_container_id_descript uByte bReserved; uByte ContainerID; } __packed; +typedef struct usb2_devcap_container_id_descriptor + usb_devcap_container_id_descriptor_t; /* Device class codes */ #define UDCLASS_IN_INTERFACE 0x00 @@ -330,6 +339,7 @@ struct usb2_config_descriptor { uByte bMaxPower; /* max current in 2 mA units */ #define UC_POWER_FACTOR 2 } __packed; +typedef struct usb2_config_descriptor usb_config_descriptor_t; struct usb2_interface_descriptor { uByte bLength; @@ -342,6 +352,7 @@ struct usb2_interface_descriptor { uByte bInterfaceProtocol; uByte iInterface; } __packed; +typedef struct usb2_interface_descriptor usb_interface_descriptor_t; struct usb2_interface_assoc_descriptor { uByte bLength; @@ -353,6 +364,7 @@ struct usb2_interface_assoc_descriptor { uByte bFunctionProtocol; uByte iFunction; } __packed; +typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t; /* Interface class codes */ #define UICLASS_UNSPEC 0x00 @@ -473,6 +485,7 @@ struct usb2_endpoint_descriptor { #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; } __packed; +typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t; struct usb2_endpoint_ss_comp_descriptor { uByte bLength; @@ -481,6 +494,8 @@ struct usb2_endpoint_ss_comp_descriptor uByte bmAttributes; uWord wBytesPerInterval; } __packed; +typedef struct usb2_endpoint_ss_comp_descriptor + usb_endpoint_ss_comp_descriptor_t; struct usb2_string_descriptor { uByte bLength; @@ -488,6 +503,7 @@ struct usb2_string_descriptor { uWord bString[126]; uByte bUnused; } __packed; +typedef struct usb2_string_descriptor usb_string_descriptor_t; #define USB_MAKE_STRING_DESC(m,name) \ struct name { \ @@ -529,6 +545,7 @@ struct usb2_hub_descriptor { (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1) uByte PortPowerCtrlMask[1]; /* deprecated */ } __packed; +typedef struct usb2_hub_descriptor usb_hub_descriptor_t; struct usb2_hub_ss_descriptor { uByte bDescLength; @@ -541,6 +558,7 @@ struct usb2_hub_ss_descriptor { uWord wHubDelay; uByte DeviceRemovable[2]; /* max 15 ports */ } __packed; +typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t; /* minimum HUB descriptor (8-ports maximum) */ struct usb2_hub_descriptor_min { @@ -553,6 +571,7 @@ struct usb2_hub_descriptor_min { uByte DeviceRemovable[1]; uByte PortPowerCtrlMask[1]; } __packed; +typedef struct usb2_hub_descriptor_min usb_hub_descriptor_min_t; struct usb2_device_qualifier { uByte bLength; @@ -565,6 +584,7 @@ struct usb2_device_qualifier { uByte bNumConfigurations; uByte bReserved; } __packed; +typedef struct usb2_device_qualifier usb_device_qualifier_t; struct usb2_otg_descriptor { uByte bLength; @@ -573,6 +593,7 @@ struct usb2_otg_descriptor { #define UOTG_SRP 0x01 #define UOTG_HNP 0x02 } __packed; +typedef struct usb2_otg_descriptor usb_otg_descriptor_t; /* OTG feature selectors */ #define UOTG_B_HNP_ENABLE 3 @@ -587,6 +608,7 @@ struct usb2_status { /* Endpoint status flags */ #define UES_HALT 0x0001 } __packed; +typedef struct usb2_status usb_status_t; struct usb2_hub_status { uWord wHubStatus; @@ -594,6 +616,7 @@ struct usb2_hub_status { #define UHS_OVER_CURRENT 0x0002 uWord wHubChange; } __packed; +typedef struct usb2_hub_status usb_hub_status_t; struct usb2_port_status { uWord wPortStatus; @@ -615,5 +638,6 @@ struct usb2_port_status { #define UPS_C_OVERCURRENT_INDICATOR 0x0008 #define UPS_C_PORT_RESET 0x0010 } __packed; +typedef struct usb2_port_status usb_port_status_t; #endif /* _USB2_STANDARD_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 02:15:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41CA21065675; Sat, 21 Feb 2009 02:15:09 +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 300998FC17; Sat, 21 Feb 2009 02:15:09 +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 n1L2F8gF045272; Sat, 21 Feb 2009 02:15:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L2F8uA045271; Sat, 21 Feb 2009 02:15:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200902210215.n1L2F8uA045271@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 21 Feb 2009 02:15: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: r188879 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 02:15:09 -0000 Author: nwhitehorn Date: Sat Feb 21 02:15:08 2009 New Revision: 188879 URL: http://svn.freebsd.org/changeset/base/188879 Log: Include altivec.c, missed on previous commit r188860. This should unbreak the build. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Feb 21 01:14:49 2009 (r188878) +++ head/sys/conf/files.powerpc Sat Feb 21 02:15:08 2009 (r188879) @@ -126,6 +126,7 @@ powerpc/powermac/uninorth.c optional pow powerpc/powermac/cuda.c optional powermac cuda powerpc/powermac/pmu.c optional powermac pmu powerpc/powermac/macgpio.c optional powermac pci +powerpc/powerpc/altivec.c optional aim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard powerpc/powerpc/bcopy.c standard From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:06:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E131106566C; Sat, 21 Feb 2009 03:06:30 +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 1BFCE8FC15; Sat, 21 Feb 2009 03:06: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 n1L36T3q046385; Sat, 21 Feb 2009 03:06:29 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L36TOj046384; Sat, 21 Feb 2009 03:06:29 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902210306.n1L36TOj046384@svn.freebsd.org> From: Andrew Thompson Date: Sat, 21 Feb 2009 03:06: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: r188880 - head/sys/dev/usb2/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:06:30 -0000 Author: thompsa Date: Sat Feb 21 03:06:29 2009 New Revision: 188880 URL: http://svn.freebsd.org/changeset/base/188880 Log: Revert r188878 for the moment, this breaks kdump. Modified: head/sys/dev/usb2/include/usb2_standard.h Modified: head/sys/dev/usb2/include/usb2_standard.h ============================================================================== --- head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 02:15:08 2009 (r188879) +++ head/sys/dev/usb2/include/usb2_standard.h Sat Feb 21 03:06:29 2009 (r188880) @@ -109,7 +109,6 @@ struct usb2_device_request { uWord wIndex; uWord wLength; } __packed; -typedef struct usb2_device_request usb_device_request_t; #define UT_WRITE 0x00 #define UT_READ 0x80 @@ -231,7 +230,6 @@ struct usb2_descriptor { uByte bDescriptorType; uByte bDescriptorSubtype; } __packed; -typedef struct usb2_descriptor usb_descriptor_t; struct usb2_device_descriptor { uByte bLength; @@ -254,7 +252,6 @@ struct usb2_device_descriptor { uByte iSerialNumber; uByte bNumConfigurations; } __packed; -typedef struct usb2_device_descriptor usb_device_descriptor_t; /* Binary Device Object Store (BOS) */ struct usb2_bos_descriptor { @@ -263,7 +260,6 @@ struct usb2_bos_descriptor { uWord wTotalLength; uByte bNumDeviceCaps; } __packed; -typedef struct usb2_bos_descriptor usb_bos_descriptor_t; /* Binary Device Object Store Capability */ struct usb2_bos_cap_descriptor { @@ -277,7 +273,6 @@ struct usb2_bos_cap_descriptor { #define USB_DEVCAP_CONTAINER_ID 0x04 /* data ... */ } __packed; -typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t; struct usb2_devcap_usb2ext_descriptor { uByte bLength; @@ -286,7 +281,6 @@ struct usb2_devcap_usb2ext_descriptor { uByte bmAttributes; #define USB_V2EXT_LPM 0x02 } __packed; -typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; struct usb2_devcap_ss_descriptor { uByte bLength; @@ -298,7 +292,6 @@ struct usb2_devcap_ss_descriptor { uByte bU1DevExitLat; uByte bU2DevExitLat; } __packed; -typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t; struct usb2_devcap_container_id_descriptor { uByte bLength; @@ -307,8 +300,6 @@ struct usb2_devcap_container_id_descript uByte bReserved; uByte ContainerID; } __packed; -typedef struct usb2_devcap_container_id_descriptor - usb_devcap_container_id_descriptor_t; /* Device class codes */ #define UDCLASS_IN_INTERFACE 0x00 @@ -339,7 +330,6 @@ struct usb2_config_descriptor { uByte bMaxPower; /* max current in 2 mA units */ #define UC_POWER_FACTOR 2 } __packed; -typedef struct usb2_config_descriptor usb_config_descriptor_t; struct usb2_interface_descriptor { uByte bLength; @@ -352,7 +342,6 @@ struct usb2_interface_descriptor { uByte bInterfaceProtocol; uByte iInterface; } __packed; -typedef struct usb2_interface_descriptor usb_interface_descriptor_t; struct usb2_interface_assoc_descriptor { uByte bLength; @@ -364,7 +353,6 @@ struct usb2_interface_assoc_descriptor { uByte bFunctionProtocol; uByte iFunction; } __packed; -typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t; /* Interface class codes */ #define UICLASS_UNSPEC 0x00 @@ -485,7 +473,6 @@ struct usb2_endpoint_descriptor { #define UE_ZERO_MPS 0xFFFF /* for internal use only */ uByte bInterval; } __packed; -typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t; struct usb2_endpoint_ss_comp_descriptor { uByte bLength; @@ -494,8 +481,6 @@ struct usb2_endpoint_ss_comp_descriptor uByte bmAttributes; uWord wBytesPerInterval; } __packed; -typedef struct usb2_endpoint_ss_comp_descriptor - usb_endpoint_ss_comp_descriptor_t; struct usb2_string_descriptor { uByte bLength; @@ -503,7 +488,6 @@ struct usb2_string_descriptor { uWord bString[126]; uByte bUnused; } __packed; -typedef struct usb2_string_descriptor usb_string_descriptor_t; #define USB_MAKE_STRING_DESC(m,name) \ struct name { \ @@ -545,7 +529,6 @@ struct usb2_hub_descriptor { (((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1) uByte PortPowerCtrlMask[1]; /* deprecated */ } __packed; -typedef struct usb2_hub_descriptor usb_hub_descriptor_t; struct usb2_hub_ss_descriptor { uByte bDescLength; @@ -558,7 +541,6 @@ struct usb2_hub_ss_descriptor { uWord wHubDelay; uByte DeviceRemovable[2]; /* max 15 ports */ } __packed; -typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t; /* minimum HUB descriptor (8-ports maximum) */ struct usb2_hub_descriptor_min { @@ -571,7 +553,6 @@ struct usb2_hub_descriptor_min { uByte DeviceRemovable[1]; uByte PortPowerCtrlMask[1]; } __packed; -typedef struct usb2_hub_descriptor_min usb_hub_descriptor_min_t; struct usb2_device_qualifier { uByte bLength; @@ -584,7 +565,6 @@ struct usb2_device_qualifier { uByte bNumConfigurations; uByte bReserved; } __packed; -typedef struct usb2_device_qualifier usb_device_qualifier_t; struct usb2_otg_descriptor { uByte bLength; @@ -593,7 +573,6 @@ struct usb2_otg_descriptor { #define UOTG_SRP 0x01 #define UOTG_HNP 0x02 } __packed; -typedef struct usb2_otg_descriptor usb_otg_descriptor_t; /* OTG feature selectors */ #define UOTG_B_HNP_ENABLE 3 @@ -608,7 +587,6 @@ struct usb2_status { /* Endpoint status flags */ #define UES_HALT 0x0001 } __packed; -typedef struct usb2_status usb_status_t; struct usb2_hub_status { uWord wHubStatus; @@ -616,7 +594,6 @@ struct usb2_hub_status { #define UHS_OVER_CURRENT 0x0002 uWord wHubChange; } __packed; -typedef struct usb2_hub_status usb_hub_status_t; struct usb2_port_status { uWord wPortStatus; @@ -638,6 +615,5 @@ struct usb2_port_status { #define UPS_C_OVERCURRENT_INDICATOR 0x0008 #define UPS_C_PORT_RESET 0x0010 } __packed; -typedef struct usb2_port_status usb_port_status_t; #endif /* _USB2_STANDARD_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:38:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2416A106566C; Sat, 21 Feb 2009 03:38:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 124DD8FC14; Sat, 21 Feb 2009 03:38:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1L3ckiO047306; Sat, 21 Feb 2009 03:38:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3ckDw047305; Sat, 21 Feb 2009 03:38:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902210338.n1L3ckDw047305@svn.freebsd.org> From: Xin LI Date: Sat, 21 Feb 2009 03:38: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: r188886 - head/usr.bin/talk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:38:47 -0000 Author: delphij Date: Sat Feb 21 03:38:46 2009 New Revision: 188886 URL: http://svn.freebsd.org/changeset/base/188886 Log: Utilize strlcpy(). Modified: head/usr.bin/talk/get_names.c Modified: head/usr.bin/talk/get_names.c ============================================================================== --- head/usr.bin/talk/get_names.c Sat Feb 21 03:37:10 2009 (r188885) +++ head/usr.bin/talk/get_names.c Sat Feb 21 03:38:46 2009 (r188886) @@ -113,10 +113,7 @@ get_names(int argc, char *argv[]) msg.addr.sa_family = htons(AF_INET); msg.ctl_addr.sa_family = htons(AF_INET); msg.id_num = htonl(0); - strncpy(msg.l_name, my_name, NAME_SIZE); - msg.l_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_name, his_name, NAME_SIZE); - msg.r_name[NAME_SIZE - 1] = '\0'; - strncpy(msg.r_tty, his_tty, TTY_SIZE); - msg.r_tty[TTY_SIZE - 1] = '\0'; + strlcpy(msg.l_name, my_name, NAME_SIZE); + strlcpy(msg.r_name, his_name, NAME_SIZE); + strlcpy(msg.r_tty, his_tty, TTY_SIZE); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:42:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15D8106564A; Sat, 21 Feb 2009 03:42:31 +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 DFDF38FC15; Sat, 21 Feb 2009 03:42:31 +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 n1L3gVS6047406; Sat, 21 Feb 2009 03:42:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3gVBu047405; Sat, 21 Feb 2009 03:42:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902210342.n1L3gVBu047405@svn.freebsd.org> From: Xin LI Date: Sat, 21 Feb 2009 03:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188887 - head/usr.bin/truncate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:42:32 -0000 Author: delphij Date: Sat Feb 21 03:42:31 2009 New Revision: 188887 URL: http://svn.freebsd.org/changeset/base/188887 Log: Initialize 'sz' as 0. Modified: head/usr.bin/truncate/truncate.c Modified: head/usr.bin/truncate/truncate.c ============================================================================== --- head/usr.bin/truncate/truncate.c Sat Feb 21 03:38:46 2009 (r188886) +++ head/usr.bin/truncate/truncate.c Sat Feb 21 03:42:31 2009 (r188887) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2000 Sheldon Hearn . * All rights reserved. * @@ -58,7 +58,7 @@ main(int argc, char **argv) char *fname, *rname; fd = -1; - rsize = tsize = 0; + rsize = tsize = sz = 0; error = 0; rname = NULL; while ((ch = getopt(argc, argv, "cr:s:")) != -1) From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:43:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E04511065676; Sat, 21 Feb 2009 03:43:20 +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 CE64F8FC23; Sat, 21 Feb 2009 03:43:20 +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 n1L3hKHx047457; Sat, 21 Feb 2009 03:43:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3hKcQ047456; Sat, 21 Feb 2009 03:43:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902210343.n1L3hKcQ047456@svn.freebsd.org> From: Xin LI Date: Sat, 21 Feb 2009 03:43: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: r188888 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:43:21 -0000 Author: delphij Date: Sat Feb 21 03:43:20 2009 New Revision: 188888 URL: http://svn.freebsd.org/changeset/base/188888 Log: Utilize calloc() instead of bzero'ing manually. Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Sat Feb 21 03:42:31 2009 (r188887) +++ head/usr.bin/vmstat/vmstat.c Sat Feb 21 03:43:20 2009 (r188888) @@ -346,10 +346,8 @@ getdrivedata(char **argv) if ((num_devices = devstat_getnumdevs(NULL)) < 0) errx(1, "%s", devstat_errbuf); - cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); - last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); - bzero(cur.dinfo, sizeof(struct devinfo)); - bzero(last.dinfo, sizeof(struct devinfo)); + cur.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); + last.dinfo = (struct devinfo *)calloc(1, sizeof(struct devinfo)); if (devstat_getdevs(NULL, &cur) == -1) errx(1, "%s", devstat_errbuf); @@ -616,10 +614,8 @@ dovmstat(unsigned int interval, int reps if (Pflag) { ncpus = getcpuinfo(&cpumask, &maxid); size_cp_times = sizeof(long) * (maxid + 1) * CPUSTATES; - cur_cp_times = malloc(size_cp_times); - last_cp_times = malloc(size_cp_times); - bzero(cur_cp_times, size_cp_times); - bzero(last_cp_times, size_cp_times); + cur_cp_times = calloc(1, size_cp_times); + last_cp_times = calloc(1, size_cp_times); } for (hdrcnt = 1;;) { if (!--hdrcnt) From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:50:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 918CD1065670; Sat, 21 Feb 2009 03:50: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 7F5848FC16; Sat, 21 Feb 2009 03:50: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 n1L3oPnR047626; Sat, 21 Feb 2009 03:50:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3oPoC047625; Sat, 21 Feb 2009 03:50:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902210350.n1L3oPoC047625@svn.freebsd.org> From: Xin LI Date: Sat, 21 Feb 2009 03:50: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: r188889 - head/usr.bin/printenv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:50:26 -0000 Author: delphij Date: Sat Feb 21 03:50:25 2009 New Revision: 188889 URL: http://svn.freebsd.org/changeset/base/188889 Log: Define extern **environ in global scope instead of in function. Modified: head/usr.bin/printenv/printenv.c Modified: head/usr.bin/printenv/printenv.c ============================================================================== --- head/usr.bin/printenv/printenv.c Sat Feb 21 03:43:20 2009 (r188888) +++ head/usr.bin/printenv/printenv.c Sat Feb 21 03:50:25 2009 (r188889) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include void usage(void); +extern char **environ; /* * printenv @@ -64,7 +65,6 @@ void usage(void); int main(int argc, char *argv[]) { - extern char **environ; char *cp, **ep; size_t len; int ch; From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 03:53:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85CA3106564A; Sat, 21 Feb 2009 03:53:06 +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 73FEA8FC0A; Sat, 21 Feb 2009 03:53:06 +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 n1L3r6rB047700; Sat, 21 Feb 2009 03:53:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L3r6JM047699; Sat, 21 Feb 2009 03:53:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200902210353.n1L3r6JM047699@svn.freebsd.org> From: Xin LI Date: Sat, 21 Feb 2009 03:53: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: r188890 - head/usr.bin/ktrdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 03:53:07 -0000 Author: delphij Date: Sat Feb 21 03:53:06 2009 New Revision: 188890 URL: http://svn.freebsd.org/changeset/base/188890 Log: Remove unnecessary opt* definations. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Sat Feb 21 03:50:25 2009 (r188889) +++ head/usr.bin/ktrdump/ktrdump.c Sat Feb 21 03:53:06 2009 (r188890) @@ -48,9 +48,6 @@ __FBSDID("$FreeBSD$"); #define USAGE \ "usage: ktrdump [-cfqrt] [-e execfile] [-i ktrfile] [-m corefile] [-o outfile]\n" -extern char *optarg; -extern int optind; - static void usage(void); static struct nlist nl[] = { From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 07:01:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E19E106564A; Sat, 21 Feb 2009 07:01:22 +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 3C2668FC0A; Sat, 21 Feb 2009 07:01:22 +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 n1L71LSX058252; Sat, 21 Feb 2009 07:01:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1L71LZp058251; Sat, 21 Feb 2009 07:01:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902210701.n1L71LZp058251@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 21 Feb 2009 07:01: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: r188893 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 07:01:23 -0000 Author: marcel Date: Sat Feb 21 07:01:21 2009 New Revision: 188893 URL: http://svn.freebsd.org/changeset/base/188893 Log: Add bootcode handling. Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Sat Feb 21 05:54:06 2009 (r188892) +++ head/sys/geom/part/g_part_bsd.c Sat Feb 21 07:01:21 2009 (r188893) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); struct g_part_bsd_table { struct g_part_table base; - u_char *label; + u_char *bbarea; uint32_t offset; }; @@ -58,6 +58,7 @@ struct g_part_bsd_entry { static int g_part_bsd_add(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); +static int g_part_bsd_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_create(struct g_part_table *, struct g_part_parms *); static int g_part_bsd_destroy(struct g_part_table *, struct g_part_parms *); static void g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, @@ -75,6 +76,7 @@ static int g_part_bsd_write(struct g_par static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), + KOBJMETHOD(g_part_bootcode, g_part_bsd_bootcode), KOBJMETHOD(g_part_create, g_part_bsd_create), KOBJMETHOD(g_part_destroy, g_part_bsd_destroy), KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), @@ -95,6 +97,7 @@ static struct g_part_scheme g_part_bsd_s .gps_entrysz = sizeof(struct g_part_bsd_entry), .gps_minent = 8, .gps_maxent = 20, + .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); @@ -157,6 +160,30 @@ g_part_bsd_add(struct g_part_table *base } static int +g_part_bsd_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_part_bsd_table *table; + const u_char *codeptr; + size_t hdsz, tlsz; + size_t codesz, tlofs; + + hdsz = 512; + tlofs = hdsz + 148 + basetable->gpt_entries * 16; + tlsz = BBSIZE - tlofs; + table = (struct g_part_bsd_table *)basetable; + bzero(table->bbarea, hdsz); + bzero(table->bbarea + tlofs, tlsz); + codeptr = gpp->gpp_codeptr; + codesz = MIN(hdsz, gpp->gpp_codesize); + if (codesz > 0) + bcopy(codeptr, table->bbarea, codesz); + codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); + if (codesz > 0) + bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + return (0); +} + +static int g_part_bsd_create(struct g_part_table *basetable, struct g_part_parms *gpp) { struct g_consumer *cp; @@ -173,13 +200,16 @@ g_part_bsd_create(struct g_part_table *b if (pp->sectorsize < sizeof(struct disklabel)) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); msize = pp->mediasize / pp->sectorsize; secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; table = (struct g_part_bsd_table *)basetable; - ptr = table->label = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO); + table->bbarea = g_malloc(BBSIZE, M_WAITOK | M_ZERO); + ptr = table->bbarea + pp->sectorsize; le32enc(ptr + 0, DISKMAGIC); /* d_magic */ le32enc(ptr + 40, pp->sectorsize); /* d_secsize */ @@ -284,6 +314,8 @@ g_part_bsd_probe(struct g_part_table *ta if (pp->sectorsize < sizeof(struct disklabel) || pp->mediasize < BBSIZE) return (ENOSPC); + if (BBSIZE % pp->sectorsize) + return (ENOTBLK); /* Check that there's a disklabel. */ buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); @@ -313,11 +345,11 @@ g_part_bsd_read(struct g_part_table *bas table = (struct g_part_bsd_table *)basetable; msize = pp->mediasize / pp->sectorsize; - buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); - if (buf == NULL) + table->bbarea = g_read_data(cp, 0, BBSIZE, &error); + if (table->bbarea == NULL) return (error); - table->label = buf; + buf = table->bbarea + pp->sectorsize; if (le32dec(buf + 40) != pp->sectorsize) goto invalid_label; @@ -388,7 +420,7 @@ g_part_bsd_read(struct g_part_table *bas invalid_label: printf("GEOM: %s: invalid disklabel.\n", pp->name); - g_free(table->label); + g_free(table->bbarea); return (EINVAL); } @@ -421,14 +453,15 @@ g_part_bsd_write(struct g_part_table *ba struct g_part_bsd_entry *entry; struct g_part_bsd_table *table; uint16_t sum; - u_char *p, *pe; + u_char *label, *p, *pe; int error, index; pp = cp->provider; table = (struct g_part_bsd_table *)basetable; baseentry = LIST_FIRST(&basetable->gpt_entry); + label = table->bbarea + pp->sectorsize; for (index = 1; index <= basetable->gpt_entries; index++) { - p = table->label + 148 + (index - 1) * 16; + p = label + 148 + (index - 1) * 16; entry = (baseentry != NULL && index == baseentry->gpe_index) ? (struct g_part_bsd_entry *)baseentry : NULL; if (entry != NULL && !baseentry->gpe_deleted) { @@ -446,13 +479,13 @@ g_part_bsd_write(struct g_part_table *ba } /* Calculate checksum. */ - le16enc(table->label + 136, 0); - pe = table->label + 148 + basetable->gpt_entries * 16; + le16enc(label + 136, 0); + pe = label + 148 + basetable->gpt_entries * 16; sum = 0; - for (p = table->label; p < pe; p += 2) + for (p = label; p < pe; p += 2) sum ^= le16dec(p); - le16enc(table->label + 136, sum); + le16enc(label + 136, sum); - error = g_write_data(cp, pp->sectorsize, table->label, pp->sectorsize); + error = g_write_data(cp, 0, table->bbarea, BBSIZE); return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 08:47:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 052941065675; Sat, 21 Feb 2009 08:47:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D12768FC1C; Sat, 21 Feb 2009 08:47:50 +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 1723A46B23; Sat, 21 Feb 2009 03:47:50 -0500 (EST) Date: Sat, 21 Feb 2009 08:47:50 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200902192210.n1JMAddn009074@svn.freebsd.org> Message-ID: References: <200902192210.n1JMAddn009074@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: r188831 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 08:47:51 -0000 On Thu, 19 Feb 2009, John Baldwin wrote: > Author: jhb > Date: Thu Feb 19 22:10:39 2009 > New Revision: 188831 > URL: http://svn.freebsd.org/changeset/base/188831 > > Log: > Don't clear the attribute cache of a file when it is closed. A subsequent > open() of the same file will load fresh attributes, so they do not need to > be explicitly flushed in close() to guarantee close to open consistency. > However, other file desciptors may still reference this file and clearing > the attributes in close() forces those other file descriptors to fetch > fresh attributes the next time they need them. (hand wave) Not an area of expertise for me, but I was under the loose impression that one of the reasons for this refresh was to pull in new timestamps, etc so that applications using file attributes to track modification time, size, etc definitely saw the right thing reflecting the server interpretation of all the pending writes having been flushed back on close(). (more hand waving) Robert N M Watson Computer Laboratory University of Cambridge > > Reviewed by: mohans > MFC after: 1 week > > Modified: > head/sys/nfsclient/nfs_vnops.c > > Modified: head/sys/nfsclient/nfs_vnops.c > ============================================================================== > --- head/sys/nfsclient/nfs_vnops.c Thu Feb 19 21:29:30 2009 (r188830) > +++ head/sys/nfsclient/nfs_vnops.c Thu Feb 19 22:10:39 2009 (r188831) > @@ -594,13 +594,6 @@ nfs_close(struct vop_close_args *ap) > error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); > mtx_lock(&np->n_mtx); > } > - /* > - * Invalidate the attribute cache in all cases. > - * An open is going to fetch fresh attrs any way, other procs > - * on this node that have file open will be forced to do an > - * otw attr fetch, but this is safe. > - */ > - np->n_attrstamp = 0; > if (np->n_flag & NWRITEERR) { > np->n_flag &= ~NWRITEERR; > error = np->n_error; > From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 11:15:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB51106566C; Sat, 21 Feb 2009 11:15:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D7938FC18; Sat, 21 Feb 2009 11:15:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LBFcU5064735; Sat, 21 Feb 2009 11:15:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LBFcQn064733; Sat, 21 Feb 2009 11:15:38 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200902211115.n1LBFcQn064733@svn.freebsd.org> From: Jamie Gritton Date: Sat, 21 Feb 2009 11:15: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: r188894 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 11:15:39 -0000 Author: jamie Date: Sat Feb 21 11:15:38 2009 New Revision: 188894 URL: http://svn.freebsd.org/changeset/base/188894 Log: Add support for methods to the OSD subsystem. Each object type has a predefined set of methods, which are set in osd_register() and called via osd_call(). Currently, no methods are defined, though prison objects will have some in the future. Expand the locking from a single per-type mutex to three different kinds of locks (four if you include the requirement that the container (e.g. prison) be locked when getting/setting data). This clears up one existing issue, as well as others added by the method support. Approved by: bz (mentor) Modified: head/sys/kern/kern_osd.c head/sys/sys/osd.h Modified: head/sys/kern/kern_osd.c ============================================================================== --- head/sys/kern/kern_osd.c Sat Feb 21 07:01:21 2009 (r188893) +++ head/sys/kern/kern_osd.c Sat Feb 21 11:15:38 2009 (r188894) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -55,13 +57,26 @@ SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLA } \ } while (0) +static void do_osd_del(u_int type, struct osd *osd, u_int slot, + int list_locked); + /* * Lists of objects with OSD. + * + * Lock key: + * (m) osd_module_lock + * (o) osd_object_lock + * (l) osd_list_lock */ -static LIST_HEAD(, osd) osd_list[OSD_LAST + 1]; -static osd_destructor_t *osd_destructors[OSD_LAST + 1]; -static u_int osd_nslots[OSD_LAST + 1]; -static struct mtx osd_lock[OSD_LAST + 1]; +static LIST_HEAD(, osd) osd_list[OSD_LAST + 1]; /* (m) */ +static osd_method_t *osd_methods[OSD_LAST + 1]; /* (m) */ +static u_int osd_nslots[OSD_LAST + 1]; /* (m) */ +static osd_destructor_t *osd_destructors[OSD_LAST + 1]; /* (o) */ +static const u_int osd_nmethods[OSD_LAST + 1]; + +static struct sx osd_module_lock[OSD_LAST + 1]; +static struct rmlock osd_object_lock[OSD_LAST + 1]; +static struct mtx osd_list_lock[OSD_LAST + 1]; static void osd_default_destructor(void *value __unused) @@ -70,10 +85,10 @@ osd_default_destructor(void *value __unu } int -osd_register(u_int type, osd_destructor_t destructor) +osd_register(u_int type, osd_destructor_t destructor, osd_method_t *methods) { void *newptr; - u_int i; + u_int i, m; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); @@ -84,7 +99,7 @@ osd_register(u_int type, osd_destructor_ if (destructor == NULL) destructor = osd_default_destructor; - mtx_lock(&osd_lock[type]); + sx_xlock(&osd_module_lock[type]); /* * First, we try to find unused slot. */ @@ -100,19 +115,29 @@ osd_register(u_int type, osd_destructor_ */ if (i == osd_nslots[type]) { osd_nslots[type]++; - newptr = realloc(osd_destructors[type], - sizeof(osd_destructor_t) * osd_nslots[type], M_OSD, - M_NOWAIT | M_ZERO); - if (newptr == NULL) { - mtx_unlock(&osd_lock[type]); - return (0); - } + if (osd_nmethods[type] != 0) + osd_methods[type] = realloc(osd_methods[type], + sizeof(osd_method_t) * osd_nslots[type] * + osd_nmethods[type], M_OSD, M_WAITOK); + newptr = malloc(sizeof(osd_destructor_t) * osd_nslots[type], + M_OSD, M_WAITOK); + rm_wlock(&osd_object_lock[type]); + bcopy(osd_destructors[type], newptr, + sizeof(osd_destructor_t) * i); + free(osd_destructors[type], M_OSD); osd_destructors[type] = newptr; + rm_wunlock(&osd_object_lock[type]); OSD_DEBUG("New slot allocated (type=%u, slot=%u).", type, i + 1); } + osd_destructors[type][i] = destructor; - mtx_unlock(&osd_lock[type]); + if (osd_nmethods[type] != 0) { + for (m = 0; m < osd_nmethods[type]; m++) + osd_methods[type][i * osd_nmethods[type] + m] = + methods != NULL ? methods[m] : NULL; + } + sx_xunlock(&osd_module_lock[type]); return (i + 1); } @@ -125,13 +150,15 @@ osd_deregister(u_int type, u_int slot) KASSERT(slot > 0, ("Invalid slot.")); KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); - mtx_lock(&osd_lock[type]); + sx_xlock(&osd_module_lock[type]); + rm_wlock(&osd_object_lock[type]); /* * Free all OSD for the given slot. */ - LIST_FOREACH_SAFE(osd, &osd_list[type], osd_next, tosd) { - osd_del(type, osd, slot); - } + mtx_lock(&osd_list_lock[type]); + LIST_FOREACH_SAFE(osd, &osd_list[type], osd_next, tosd) + do_osd_del(type, osd, slot, 1); + mtx_unlock(&osd_list_lock[type]); /* * Set destructor to NULL to free the slot. */ @@ -141,83 +168,121 @@ osd_deregister(u_int type, u_int slot) osd_destructors[type] = realloc(osd_destructors[type], sizeof(osd_destructor_t) * osd_nslots[type], M_OSD, M_NOWAIT | M_ZERO); + if (osd_nmethods[type] != 0) + osd_methods[type] = realloc(osd_methods[type], + sizeof(osd_method_t) * osd_nslots[type] * + osd_nmethods[type], M_OSD, M_NOWAIT | M_ZERO); /* * We always reallocate to smaller size, so we assume it will * always succeed. */ - KASSERT(osd_destructors[type] != NULL, ("realloc() failed")); + KASSERT(osd_destructors[type] != NULL && + (osd_nmethods[type] == 0 || osd_methods[type] != NULL), + ("realloc() failed")); OSD_DEBUG("Deregistration of the last slot (type=%u, slot=%u).", type, slot); } else { OSD_DEBUG("Slot deregistration (type=%u, slot=%u).", type, slot); } - mtx_unlock(&osd_lock[type]); + rm_wunlock(&osd_object_lock[type]); + sx_xunlock(&osd_module_lock[type]); } int osd_set(u_int type, struct osd *osd, u_int slot, void *value) { + struct rm_priotracker tracker; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); - if (osd->osd_nslots == 0) { - /* - * First OSD for this object, so we need to allocate space and - * put it onto the list. - */ - osd->osd_slots = malloc(sizeof(void *) * slot, M_OSD, - M_NOWAIT | M_ZERO); - if (osd->osd_slots == NULL) - return (ENOMEM); - osd->osd_nslots = slot; - mtx_lock(&osd_lock[type]); - LIST_INSERT_HEAD(&osd_list[type], osd, osd_next); - mtx_unlock(&osd_lock[type]); - OSD_DEBUG("Setting first slot (type=%u).", type); - } else if (slot > osd->osd_nslots) { - void *newptr; - - /* - * Too few slots allocated here, needs to extend the array. - */ - newptr = realloc(osd->osd_slots, sizeof(void *) * slot, M_OSD, - M_NOWAIT | M_ZERO); - if (newptr == NULL) - return (ENOMEM); - osd->osd_slots = newptr; - osd->osd_nslots = slot; - OSD_DEBUG("Growing slots array (type=%u).", type); + rm_rlock(&osd_object_lock[type], &tracker); + if (slot > osd->osd_nslots) { + if (value == NULL) { + OSD_DEBUG( + "Not allocating null slot (type=%u, slot=%u).", + type, slot); + rm_runlock(&osd_object_lock[type], &tracker); + return (0); + } else if (osd->osd_nslots == 0) { + /* + * First OSD for this object, so we need to allocate + * space and put it onto the list. + */ + osd->osd_slots = malloc(sizeof(void *) * slot, M_OSD, + M_NOWAIT | M_ZERO); + if (osd->osd_slots == NULL) { + rm_runlock(&osd_object_lock[type], &tracker); + return (ENOMEM); + } + osd->osd_nslots = slot; + mtx_lock(&osd_list_lock[type]); + LIST_INSERT_HEAD(&osd_list[type], osd, osd_next); + mtx_unlock(&osd_list_lock[type]); + OSD_DEBUG("Setting first slot (type=%u).", type); + } else { + void *newptr; + + /* + * Too few slots allocated here, needs to extend + * the array. + */ + newptr = realloc(osd->osd_slots, sizeof(void *) * slot, + M_OSD, M_NOWAIT | M_ZERO); + if (newptr == NULL) { + rm_runlock(&osd_object_lock[type], &tracker); + return (ENOMEM); + } + osd->osd_slots = newptr; + osd->osd_nslots = slot; + OSD_DEBUG("Growing slots array (type=%u).", type); + } } OSD_DEBUG("Setting slot value (type=%u, slot=%u, value=%p).", type, slot, value); osd->osd_slots[slot - 1] = value; + rm_runlock(&osd_object_lock[type], &tracker); return (0); } void * osd_get(u_int type, struct osd *osd, u_int slot) { + struct rm_priotracker tracker; + void *value; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); KASSERT(osd_destructors[type][slot - 1] != NULL, ("Unused slot.")); + rm_rlock(&osd_object_lock[type], &tracker); if (slot > osd->osd_nslots) { + value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); - return (NULL); + } else { + value = osd->osd_slots[slot - 1]; + OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", + type, slot, value); } - - OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", type, - slot, osd->osd_slots[slot - 1]); - return (osd->osd_slots[slot - 1]); + rm_runlock(&osd_object_lock[type], &tracker); + return (value); } void osd_del(u_int type, struct osd *osd, u_int slot) { + struct rm_priotracker tracker; + + rm_rlock(&osd_object_lock[type], &tracker); + do_osd_del(type, osd, slot, 0); + rm_runlock(&osd_object_lock[type], &tracker); +} + +static void +do_osd_del(u_int type, struct osd *osd, u_int slot, int list_locked) +{ int i; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); @@ -234,20 +299,19 @@ osd_del(u_int type, struct osd *osd, u_i osd->osd_slots[slot - 1] = NULL; for (i = osd->osd_nslots - 1; i >= 0; i--) { if (osd->osd_slots[i] != NULL) { - OSD_DEBUG("Slot still has a value (type=%u, slot=%u).", type, i + 1); + OSD_DEBUG("Slot still has a value (type=%u, slot=%u).", + type, i + 1); break; } } if (i == -1) { - int unlock; - /* No values left for this object. */ OSD_DEBUG("No more slots left (type=%u).", type); - if ((unlock = !mtx_owned(&osd_lock[type]))) - mtx_lock(&osd_lock[type]); + if (!list_locked) + mtx_lock(&osd_list_lock[type]); LIST_REMOVE(osd, osd_next); - if (unlock) - mtx_unlock(&osd_lock[type]); + if (!list_locked) + mtx_unlock(&osd_list_lock[type]); free(osd->osd_slots, M_OSD); osd->osd_slots = NULL; osd->osd_nslots = 0; @@ -266,9 +330,35 @@ osd_del(u_int type, struct osd *osd, u_i } } +int +osd_call(u_int type, u_int method, void *obj, void *data) +{ + osd_method_t methodfun; + int error, i; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(method < osd_nmethods[type], ("Invalid method.")); + + /* + * Call this method for every slot that defines it, stopping if an + * error is encountered. + */ + error = 0; + sx_slock(&osd_module_lock[type]); + for (i = 1; i <= osd_nslots[type]; i++) { + methodfun = + osd_methods[type][(i - 1) * osd_nmethods[type] + method]; + if (methodfun != NULL && (error = methodfun(obj, data)) != 0) + break; + } + sx_sunlock(&osd_module_lock[type]); + return (error); +} + void osd_exit(u_int type, struct osd *osd) { + struct rm_priotracker tracker; u_int i; KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); @@ -279,10 +369,14 @@ osd_exit(u_int type, struct osd *osd) return; } - mtx_lock(&osd_lock[type]); - for (i = 1; i <= osd->osd_nslots; i++) - osd_del(type, osd, i); - mtx_unlock(&osd_lock[type]); + rm_rlock(&osd_object_lock[type], &tracker); + for (i = 1; i <= osd->osd_nslots; i++) { + if (osd_destructors[type][i - 1] != NULL) + do_osd_del(type, osd, i, 0); + else + OSD_DEBUG("Unused slot (type=%u, slot=%u).", type, i); + } + rm_runlock(&osd_object_lock[type], &tracker); OSD_DEBUG("Object exit (type=%u).", type); } @@ -294,8 +388,11 @@ osd_init(void *arg __unused) for (i = OSD_FIRST; i <= OSD_LAST; i++) { osd_nslots[i] = 0; LIST_INIT(&osd_list[i]); - mtx_init(&osd_lock[i], "osd", NULL, MTX_DEF); + sx_init(&osd_module_lock[i], "osd_module"); + rm_init(&osd_object_lock[i], "osd_object", 0); + mtx_init(&osd_list_lock[i], "osd_list", NULL, MTX_DEF); osd_destructors[i] = NULL; + osd_methods[i] = NULL; } } SYSINIT(osd, SI_SUB_LOCK, SI_ORDER_ANY, osd_init, NULL); Modified: head/sys/sys/osd.h ============================================================================== --- head/sys/sys/osd.h Sat Feb 21 07:01:21 2009 (r188893) +++ head/sys/sys/osd.h Sat Feb 21 11:15:38 2009 (r188894) @@ -31,10 +31,15 @@ #include +/* + * Lock key: + * (c) container lock (e.g. jail's pr_mtx) and/or osd_object_lock + * (l) osd_list_lock + */ struct osd { - u_int osd_nslots; - void **osd_slots; - LIST_ENTRY(osd) osd_next; + u_int osd_nslots; /* (c) */ + void **osd_slots; /* (c) */ + LIST_ENTRY(osd) osd_next; /* (l) */ }; #ifdef _KERNEL @@ -46,18 +51,21 @@ struct osd { #define OSD_LAST OSD_JAIL typedef void (*osd_destructor_t)(void *value); +typedef int (*osd_method_t)(void *obj, void *data); -int osd_register(u_int type, osd_destructor_t destructor); +int osd_register(u_int type, osd_destructor_t destructor, + osd_method_t *methods); void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); void *osd_get(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); +int osd_call(u_int type, u_int method, void *obj, void *data); void osd_exit(u_int type, struct osd *osd); #define osd_thread_register(destructor) \ - osd_register(OSD_THREAD, (destructor)) + osd_register(OSD_THREAD, (destructor), NULL) #define osd_thread_deregister(slot) \ osd_deregister(OSD_THREAD, (slot)) #define osd_thread_set(td, slot, value) \ @@ -68,11 +76,13 @@ void osd_exit(u_int type, struct osd *os KASSERT((td) == curthread, ("Not curthread.")); \ osd_del(OSD_THREAD, &(td)->td_osd, (slot)); \ } while (0) +#define osd_thread_call(td, method, data) \ + osd_call(OSD_THREAD, (method), (td), (data)) #define osd_thread_exit(td) \ osd_exit(OSD_THREAD, &(td)->td_osd) #define osd_jail_register(destructor) \ - osd_register(OSD_JAIL, (destructor)) + osd_register(OSD_JAIL, (destructor), NULL) #define osd_jail_deregister(slot) \ osd_deregister(OSD_JAIL, (slot)) #define osd_jail_set(pr, slot, value) \ @@ -81,6 +91,8 @@ void osd_exit(u_int type, struct osd *os osd_get(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_del(pr, slot) \ osd_del(OSD_JAIL, &(pr)->pr_osd, (slot)) +#define osd_jail_call(pr, method, data) \ + osd_call(OSD_JAIL, (method), (pr), (data)) #define osd_jail_exit(pr) \ osd_exit(OSD_JAIL, &(pr)->pr_osd) From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 12:56:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500E81065673; Sat, 21 Feb 2009 12:56:23 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from dhcp-172-28-77-108.eur.corp.google.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D5B8D8FC23; Sat, 21 Feb 2009 12:56:20 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <499FF9F2.3030408@FreeBSD.org> Date: Sat, 21 Feb 2009 12:56:18 +0000 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: John Baldwin References: <200902171957.n1HJvqk8026145@svn.freebsd.org> <499BC43B.6030701@incunabulum.net> <200902180949.32691.jhb@freebsd.org> In-Reply-To: <200902180949.32691.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Bruce Simpson , src-committers@freebsd.org Subject: Re: svn commit: r188727 - in stable/7: sys sys/contrib/pf sys/dev/ath/ath_hal sys/dev/cxgb sys/kern sys/modules/sem sys/sys tools/regression/posixsem usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 12:56:24 -0000 John Baldwin wrote: > On Wednesday 18 February 2009 3:18:03 am Bruce Simpson wrote: >> John Baldwin wrote: >>> Author: jhb >>> Date: Tue Feb 17 19:57:52 2009 >>> New Revision: 188727 >>> URL: http://svn.freebsd.org/changeset/base/188727 >>> >>> Log: >>> MFC: Rework the lifetime management of the kernel implementation of > POSIX >>> semaphores. Specifically, semaphores are now represented as new file >>> descriptor type that is set to close on exec. This removes the need for >>> all of the manual process reference counting (and fork, exec, and exit >>> event handlers) as the normal file descriptor operations handle all of >>> that for us nicely. It is also suggested as one possible implementation >>> in the spec and at least one other OS (OS X) uses this approach. >> FYI: >> This change *may* fix Python 2.6's 'multiprocessing' module on FreeBSD >> 7-STABLE, which is known to have problems there; it depends on POSIX >> semaphores to synchronize its IPC between different fork()'s of the >> Python interpreter. >> >> If anyone else has an interest in ths they may wish to test, if not, I >> will try to get around to it eventually. > > When Kris tested it, it made things significantly better. I'm not sure if it > resolved all the issues though. > Some of the self-tests still failed, but there was confusion about whether the tests were broken or the kernel. Kris From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 15:04:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70D1106566B; Sat, 21 Feb 2009 15:04:32 +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 925638FC18; Sat, 21 Feb 2009 15:04:32 +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 n1LF4WlL068881; Sat, 21 Feb 2009 15:04:32 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LF4VIh068864; Sat, 21 Feb 2009 15:04:31 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200902211504.n1LF4VIh068864@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 21 Feb 2009 15:04: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: r188895 - in head: . gnu/lib/csu gnu/lib/libssp lib/csu lib/libstand lib/libthr libexec/rtld-elf rescue/librescue rescue/rescue sys/boot sys/boot/i386/loader sys/boot/ia64/common sys/bo... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 15:04:33 -0000 Author: ru Date: Sat Feb 21 15:04:31 2009 New Revision: 188895 URL: http://svn.freebsd.org/changeset/base/188895 Log: Fix build when WITH_SSP is set explicitly. Submitted by: Jeremie Le Hen Modified: head/Makefile.inc1 head/gnu/lib/csu/Makefile head/gnu/lib/libssp/Makefile head/lib/csu/Makefile.inc head/lib/libstand/Makefile head/lib/libthr/Makefile head/libexec/rtld-elf/Makefile head/rescue/librescue/Makefile head/rescue/rescue/Makefile head/sys/boot/Makefile.inc head/sys/boot/i386/loader/Makefile head/sys/boot/ia64/common/Makefile head/sys/boot/ia64/efi/Makefile head/sys/boot/ia64/ski/Makefile head/sys/boot/pc98/loader/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 21 11:15:38 2009 (r188894) +++ head/Makefile.inc1 Sat Feb 21 15:04:31 2009 (r188895) @@ -230,7 +230,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ - -DWITHOUT_SSP \ + SSP_CFLAGS= \ -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF @@ -240,8 +240,9 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ + SSP_CFLAGS= \ BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \ - -DNO_WARNS -DNO_CTF -DWITHOUT_SSP + -DNO_WARNS -DNO_CTF # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -458,7 +459,7 @@ build32: .if ${MK_KERBEROS} != "no" .for _t in obj depend all cd ${.CURDIR}/kerberos5/tools; \ - MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \ + MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ ${_t} .endfor .endif @@ -481,7 +482,7 @@ build32: .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ - MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \ + MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ build-tools .endfor cd ${.CURDIR}; \ @@ -782,14 +783,14 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target} + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor .endif .if !defined(NO_KERNELDEPEND) Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/gnu/lib/csu/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,5 +1,8 @@ # $FreeBSD$ +.include +MK_SSP= no + GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs CCDIR= ${.CURDIR}/../../usr.bin/cc @@ -19,7 +22,6 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR} -I${CCDIR}/cc_tools CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -WITHOUT_SSP= .if ${MACHINE_ARCH} == "ia64" BEGINSRC= crtbegin.asm Modified: head/gnu/lib/libssp/Makefile ============================================================================== --- head/gnu/lib/libssp/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/gnu/lib/libssp/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,5 +1,8 @@ # $FreeBSD$ +.include +MK_SSP= no + GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs SRCDIR= ${GCCLIB}/libssp @@ -10,7 +13,6 @@ LIB= ssp SHLIB_MAJOR= 0 SHLIBDIR?= /lib NO_PROFILE= -WITHOUT_SSP= SRCS= ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \ memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \ Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Sat Feb 21 11:15:38 2009 (r188894) +++ head/lib/csu/Makefile.inc Sat Feb 21 15:04:31 2009 (r188895) @@ -1,3 +1,3 @@ # $FreeBSD$ -WITHOUT_SSP= +SSP_CFLAGS= Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/lib/libstand/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -6,13 +6,15 @@ # quite large. # +.include +MK_SSP= no + LIB= stand NO_PROFILE= NO_PIC= INCS= stand.h MAN= libstand.3 -WITHOUT_SSP= CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/lib/libthr/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -8,9 +8,8 @@ # (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the # system call stubs. -WITHOUT_SSP= - .include +MK_SSP= no .if ${SHLIBDIR} == "/usr/lib" SHLIBDIR= /lib Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/libexec/rtld-elf/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no PROG?= ld-elf.so.1 SRCS= rtld_start.S \ Modified: head/rescue/librescue/Makefile ============================================================================== --- head/rescue/librescue/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/rescue/librescue/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -2,9 +2,8 @@ # $FreeBSD$ # -WITHOUT_SSP= - .include +MK_SSP= no # Certain library entries have hard-coded references to # /bin, /sbin, etc, that require those entries to be Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/rescue/rescue/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -2,9 +2,9 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= rescue BINDIR?=/rescue Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/Makefile.inc Sat Feb 21 15:04:31 2009 (r188895) @@ -1,3 +1,3 @@ # $FreeBSD$ -WITHOUT_SSP= +SSP_CFLAGS= Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/i386/loader/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader.sym INTERNALPROG= Modified: head/sys/boot/ia64/common/Makefile ============================================================================== --- head/sys/boot/ia64/common/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/ia64/common/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no LIB= ia64 INTERNALLIB= Modified: head/sys/boot/ia64/efi/Makefile ============================================================================== --- head/sys/boot/ia64/efi/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/ia64/efi/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,9 +1,9 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= loader.sym INTERNALPROG= Modified: head/sys/boot/ia64/ski/Makefile ============================================================================== --- head/sys/boot/ia64/ski/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/ia64/ski/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,9 +1,9 @@ # $FreeBSD$ NO_MAN= -WITHOUT_SSP= .include +MK_SSP= no PROG= skiload STRIP= # We must not strip skiload at install time. Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/pc98/loader/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader.sym INTERNALPROG= Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/powerpc/ofw/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Sat Feb 21 11:15:38 2009 (r188894) +++ head/sys/boot/sparc64/loader/Makefile Sat Feb 21 15:04:31 2009 (r188895) @@ -1,8 +1,7 @@ # $FreeBSD$ -WITHOUT_SSP= - .include +MK_SSP= no PROG= loader NEWVERSWHAT= "bootstrap loader" sparc64 From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 15:40:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C7B1065686; Sat, 21 Feb 2009 15:40:03 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2A078FC15; Sat, 21 Feb 2009 15:40:03 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LFe3cW069512; Sat, 21 Feb 2009 15:40:03 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LFe3pN069507; Sat, 21 Feb 2009 15:40:03 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200902211540.n1LFe3pN069507@svn.freebsd.org> From: Attilio Rao Date: Sat, 21 Feb 2009 15:40: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: r188896 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 15:40:04 -0000 Author: attilio Date: Sat Feb 21 15:40:03 2009 New Revision: 188896 URL: http://svn.freebsd.org/changeset/base/188896 Log: Sync with the official Adaptec vendor driver: [1] Add the support for the NARK controller which seems a variant of the i960Rx. [2] Split up memory regions and other resources in 2 different parts as long as NARK uses them separately (it is not clear to me why though as long as there are no more informations available on this controller). Please note that in all the other cases, the regions overlaps leaving the default behaviour for all the other controllers. [3] Implement a clock daemon responsible for maintain updated the wall clock time of the controller (run any 30 minutes)*. Submitted by: Adaptec (driver build 15317 [1, 2] and 15727 [3]) Reviewed by: emaste Tested by: emaste Sponsored by: Sandvine Incorporated * Please note that originally, in the Adaptec driver, the clock daemon is not implemented with callouts as in our in-tree driver. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_debug.c head/sys/dev/aac/aac_pci.c head/sys/dev/aac/aacreg.h head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sat Feb 21 15:04:31 2009 (r188895) +++ head/sys/dev/aac/aac.c Sat Feb 21 15:40:03 2009 (r188896) @@ -71,6 +71,7 @@ static void aac_startup(void *arg); static void aac_add_container(struct aac_softc *sc, struct aac_mntinforesp *mir, int f); static void aac_get_bus_info(struct aac_softc *sc); +static void aac_daemon(void *arg); /* Command Processing */ static void aac_timeout(struct aac_softc *sc); @@ -292,6 +293,9 @@ aac_attach(struct aac_softc *sc) TAILQ_INIT(&sc->aac_container_tqh); TAILQ_INIT(&sc->aac_ev_cmfree); + /* Initialize the clock daemon callout. */ + callout_init_mtx(&sc->aac_daemontime, &sc->aac_io_lock, 0); + /* * Initialize the adapter. */ @@ -349,9 +353,34 @@ aac_attach(struct aac_softc *sc) aac_get_bus_info(sc); } + mtx_lock(&sc->aac_io_lock); + callout_reset(&sc->aac_daemontime, 30 * 60 * hz, aac_daemon, sc); + mtx_unlock(&sc->aac_io_lock); + return(0); } +static void +aac_daemon(void *arg) +{ + struct timeval tv; + struct aac_softc *sc; + struct aac_fib *fib; + + sc = arg; + mtx_assert(&sc->aac_io_lock, MA_OWNED); + + if (callout_pending(&sc->aac_daemontime) || + callout_active(&sc->aac_daemontime) == 0) + return; + getmicrotime(&tv); + aac_alloc_sync_fib(sc, &fib); + *(uint32_t *)fib->data = tv.tv_sec; + aac_sync_fib(sc, SendHostTime, 0, fib, sizeof(uint32_t)); + aac_release_sync_fib(sc); + callout_schedule(&sc->aac_daemontime, 30 * 60 * hz); +} + void aac_add_event(struct aac_softc *sc, struct aac_event *event) { @@ -632,9 +661,12 @@ aac_free(struct aac_softc *sc) bus_dma_tag_destroy(sc->aac_parent_dmat); /* release the register window mapping */ - if (sc->aac_regs_resource != NULL) + if (sc->aac_regs_res0 != NULL) + bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, + sc->aac_regs_rid0, sc->aac_regs_res0); + if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL) bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid, sc->aac_regs_resource); + sc->aac_regs_rid1, sc->aac_regs_res1); } /* @@ -654,6 +686,8 @@ aac_detach(device_t dev) if (sc->aac_state & AAC_STATE_OPEN) return(EBUSY); + callout_drain(&sc->aac_daemontime); + /* Remove the child containers */ while ((co = TAILQ_FIRST(&sc->aac_container_tqh)) != NULL) { error = device_delete_child(dev, co->co_disk); @@ -834,7 +868,7 @@ aac_new_intr(void *arg) } index &= ~2; for (i = 0; i < sizeof(struct aac_fib)/4; ++i) - ((u_int32_t *)fib)[i] = AAC_GETREG4(sc, index + i*4); + ((u_int32_t *)fib)[i] = AAC_MEM1_GETREG4(sc, index + i*4); aac_handle_aif(sc, fib); free(fib, M_AACBUF); @@ -1754,26 +1788,33 @@ aac_check_firmware(struct aac_softc *sc) /* Remap mem. resource, if required */ if ((sc->flags & AAC_FLAGS_NEW_COMM) && - atu_size > rman_get_size(sc->aac_regs_resource)) { + atu_size > rman_get_size(sc->aac_regs_res1)) { bus_release_resource( sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid, sc->aac_regs_resource); - sc->aac_regs_resource = bus_alloc_resource( - sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid, + sc->aac_regs_rid1, sc->aac_regs_res1); + sc->aac_regs_res1 = bus_alloc_resource( + sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid1, 0ul, ~0ul, atu_size, RF_ACTIVE); - if (sc->aac_regs_resource == NULL) { - sc->aac_regs_resource = bus_alloc_resource_any( + if (sc->aac_regs_res1 == NULL) { + sc->aac_regs_res1 = bus_alloc_resource_any( sc->aac_dev, SYS_RES_MEMORY, - &sc->aac_regs_rid, RF_ACTIVE); - if (sc->aac_regs_resource == NULL) { + &sc->aac_regs_rid1, RF_ACTIVE); + if (sc->aac_regs_res1 == NULL) { device_printf(sc->aac_dev, "couldn't allocate register window\n"); return (ENXIO); } sc->flags &= ~AAC_FLAGS_NEW_COMM; } - sc->aac_btag = rman_get_bustag(sc->aac_regs_resource); - sc->aac_bhandle = rman_get_bushandle(sc->aac_regs_resource); + sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); + sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); + + if (sc->aac_hwif == AAC_HWIF_NARK) { + sc->aac_regs_res0 = sc->aac_regs_res1; + sc->aac_regs_rid0 = sc->aac_regs_rid1; + sc->aac_btag0 = sc->aac_btag1; + sc->aac_bhandle0 = sc->aac_bhandle1; + } } /* Read preferred settings */ @@ -1944,10 +1985,10 @@ aac_init(struct aac_softc *sc) */ switch (sc->aac_hwif) { case AAC_HWIF_I960RX: - AAC_SETREG4(sc, AAC_RX_ODBR, ~0); + AAC_MEM0_SETREG4(sc, AAC_RX_ODBR, ~0); break; case AAC_HWIF_RKT: - AAC_SETREG4(sc, AAC_RKT_ODBR, ~0); + AAC_MEM0_SETREG4(sc, AAC_RKT_ODBR, ~0); break; default: break; @@ -2367,7 +2408,7 @@ aac_sa_get_fwstatus(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_SA_FWSTATUS)); + return(AAC_MEM0_GETREG4(sc, AAC_SA_FWSTATUS)); } static int @@ -2375,7 +2416,7 @@ aac_rx_get_fwstatus(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RX_OMR0)); + return(AAC_MEM0_GETREG4(sc, AAC_RX_OMR0)); } static int @@ -2385,7 +2426,7 @@ aac_fa_get_fwstatus(struct aac_softc *sc fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - val = AAC_GETREG4(sc, AAC_FA_FWSTATUS); + val = AAC_MEM0_GETREG4(sc, AAC_FA_FWSTATUS); return (val); } @@ -2394,7 +2435,7 @@ aac_rkt_get_fwstatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RKT_OMR0)); + return(AAC_MEM0_GETREG4(sc, AAC_RKT_OMR0)); } /* @@ -2406,7 +2447,7 @@ aac_sa_qnotify(struct aac_softc *sc, int { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG2(sc, AAC_SA_DOORBELL1_SET, qbit); + AAC_MEM0_SETREG2(sc, AAC_SA_DOORBELL1_SET, qbit); } static void @@ -2414,7 +2455,7 @@ aac_rx_qnotify(struct aac_softc *sc, int { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RX_IDBR, qbit); + AAC_MEM0_SETREG4(sc, AAC_RX_IDBR, qbit); } static void @@ -2422,7 +2463,7 @@ aac_fa_qnotify(struct aac_softc *sc, int { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG2(sc, AAC_FA_DOORBELL1, qbit); + AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL1, qbit); AAC_FA_HACK(sc); } @@ -2431,7 +2472,7 @@ aac_rkt_qnotify(struct aac_softc *sc, in { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RKT_IDBR, qbit); + AAC_MEM0_SETREG4(sc, AAC_RKT_IDBR, qbit); } /* @@ -2442,7 +2483,7 @@ aac_sa_get_istatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG2(sc, AAC_SA_DOORBELL0)); + return(AAC_MEM0_GETREG2(sc, AAC_SA_DOORBELL0)); } static int @@ -2450,7 +2491,7 @@ aac_rx_get_istatus(struct aac_softc *sc) { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RX_ODBR)); + return(AAC_MEM0_GETREG4(sc, AAC_RX_ODBR)); } static int @@ -2460,7 +2501,7 @@ aac_fa_get_istatus(struct aac_softc *sc) fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - val = AAC_GETREG2(sc, AAC_FA_DOORBELL0); + val = AAC_MEM0_GETREG2(sc, AAC_FA_DOORBELL0); return (val); } @@ -2469,7 +2510,7 @@ aac_rkt_get_istatus(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RKT_ODBR)); + return(AAC_MEM0_GETREG4(sc, AAC_RKT_ODBR)); } /* @@ -2480,7 +2521,7 @@ aac_sa_clear_istatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG2(sc, AAC_SA_DOORBELL0_CLEAR, mask); + AAC_MEM0_SETREG2(sc, AAC_SA_DOORBELL0_CLEAR, mask); } static void @@ -2488,7 +2529,7 @@ aac_rx_clear_istatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RX_ODBR, mask); + AAC_MEM0_SETREG4(sc, AAC_RX_ODBR, mask); } static void @@ -2496,7 +2537,7 @@ aac_fa_clear_istatus(struct aac_softc *s { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask); + AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask); AAC_FA_HACK(sc); } @@ -2505,7 +2546,7 @@ aac_rkt_clear_istatus(struct aac_softc * { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RKT_ODBR, mask); + AAC_MEM0_SETREG4(sc, AAC_RKT_ODBR, mask); } /* @@ -2517,11 +2558,11 @@ aac_sa_set_mailbox(struct aac_softc *sc, { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_SA_MAILBOX, command); - AAC_SETREG4(sc, AAC_SA_MAILBOX + 4, arg0); - AAC_SETREG4(sc, AAC_SA_MAILBOX + 8, arg1); - AAC_SETREG4(sc, AAC_SA_MAILBOX + 12, arg2); - AAC_SETREG4(sc, AAC_SA_MAILBOX + 16, arg3); + AAC_MEM1_SETREG4(sc, AAC_SA_MAILBOX, command); + AAC_MEM1_SETREG4(sc, AAC_SA_MAILBOX + 4, arg0); + AAC_MEM1_SETREG4(sc, AAC_SA_MAILBOX + 8, arg1); + AAC_MEM1_SETREG4(sc, AAC_SA_MAILBOX + 12, arg2); + AAC_MEM1_SETREG4(sc, AAC_SA_MAILBOX + 16, arg3); } static void @@ -2530,11 +2571,11 @@ aac_rx_set_mailbox(struct aac_softc *sc, { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RX_MAILBOX, command); - AAC_SETREG4(sc, AAC_RX_MAILBOX + 4, arg0); - AAC_SETREG4(sc, AAC_RX_MAILBOX + 8, arg1); - AAC_SETREG4(sc, AAC_RX_MAILBOX + 12, arg2); - AAC_SETREG4(sc, AAC_RX_MAILBOX + 16, arg3); + AAC_MEM1_SETREG4(sc, AAC_RX_MAILBOX, command); + AAC_MEM1_SETREG4(sc, AAC_RX_MAILBOX + 4, arg0); + AAC_MEM1_SETREG4(sc, AAC_RX_MAILBOX + 8, arg1); + AAC_MEM1_SETREG4(sc, AAC_RX_MAILBOX + 12, arg2); + AAC_MEM1_SETREG4(sc, AAC_RX_MAILBOX + 16, arg3); } static void @@ -2543,15 +2584,15 @@ aac_fa_set_mailbox(struct aac_softc *sc, { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_FA_MAILBOX, command); + AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX, command); AAC_FA_HACK(sc); - AAC_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0); + AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0); AAC_FA_HACK(sc); - AAC_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1); + AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1); AAC_FA_HACK(sc); - AAC_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2); + AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2); AAC_FA_HACK(sc); - AAC_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3); + AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3); AAC_FA_HACK(sc); } @@ -2561,11 +2602,11 @@ aac_rkt_set_mailbox(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RKT_MAILBOX, command); - AAC_SETREG4(sc, AAC_RKT_MAILBOX + 4, arg0); - AAC_SETREG4(sc, AAC_RKT_MAILBOX + 8, arg1); - AAC_SETREG4(sc, AAC_RKT_MAILBOX + 12, arg2); - AAC_SETREG4(sc, AAC_RKT_MAILBOX + 16, arg3); + AAC_MEM1_SETREG4(sc, AAC_RKT_MAILBOX, command); + AAC_MEM1_SETREG4(sc, AAC_RKT_MAILBOX + 4, arg0); + AAC_MEM1_SETREG4(sc, AAC_RKT_MAILBOX + 8, arg1); + AAC_MEM1_SETREG4(sc, AAC_RKT_MAILBOX + 12, arg2); + AAC_MEM1_SETREG4(sc, AAC_RKT_MAILBOX + 16, arg3); } /* @@ -2576,7 +2617,7 @@ aac_sa_get_mailbox(struct aac_softc *sc, { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_SA_MAILBOX + (mb * 4))); + return(AAC_MEM1_GETREG4(sc, AAC_SA_MAILBOX + (mb * 4))); } static int @@ -2584,7 +2625,7 @@ aac_rx_get_mailbox(struct aac_softc *sc, { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RX_MAILBOX + (mb * 4))); + return(AAC_MEM1_GETREG4(sc, AAC_RX_MAILBOX + (mb * 4))); } static int @@ -2594,7 +2635,7 @@ aac_fa_get_mailbox(struct aac_softc *sc, fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - val = AAC_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4)); + val = AAC_MEM1_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4)); return (val); } @@ -2603,7 +2644,7 @@ aac_rkt_get_mailbox(struct aac_softc *sc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RKT_MAILBOX + (mb * 4))); + return(AAC_MEM1_GETREG4(sc, AAC_RKT_MAILBOX + (mb * 4))); } /* @@ -2615,9 +2656,9 @@ aac_sa_set_interrupts(struct aac_softc * fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); if (enable) { - AAC_SETREG2((sc), AAC_SA_MASK0_CLEAR, AAC_DB_INTERRUPTS); + AAC_MEM0_SETREG2((sc), AAC_SA_MASK0_CLEAR, AAC_DB_INTERRUPTS); } else { - AAC_SETREG2((sc), AAC_SA_MASK0_SET, ~0); + AAC_MEM0_SETREG2((sc), AAC_SA_MASK0_SET, ~0); } } @@ -2628,11 +2669,11 @@ aac_rx_set_interrupts(struct aac_softc * if (enable) { if (sc->flags & AAC_FLAGS_NEW_COMM) - AAC_SETREG4(sc, AAC_RX_OIMR, ~AAC_DB_INT_NEW_COMM); + AAC_MEM0_SETREG4(sc, AAC_RX_OIMR, ~AAC_DB_INT_NEW_COMM); else - AAC_SETREG4(sc, AAC_RX_OIMR, ~AAC_DB_INTERRUPTS); + AAC_MEM0_SETREG4(sc, AAC_RX_OIMR, ~AAC_DB_INTERRUPTS); } else { - AAC_SETREG4(sc, AAC_RX_OIMR, ~0); + AAC_MEM0_SETREG4(sc, AAC_RX_OIMR, ~0); } } @@ -2642,10 +2683,10 @@ aac_fa_set_interrupts(struct aac_softc * fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis"); if (enable) { - AAC_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS); + AAC_MEM0_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS); AAC_FA_HACK(sc); } else { - AAC_SETREG2((sc), AAC_FA_MASK0, ~0); + AAC_MEM0_SETREG2((sc), AAC_FA_MASK0, ~0); AAC_FA_HACK(sc); } } @@ -2657,11 +2698,11 @@ aac_rkt_set_interrupts(struct aac_softc if (enable) { if (sc->flags & AAC_FLAGS_NEW_COMM) - AAC_SETREG4(sc, AAC_RKT_OIMR, ~AAC_DB_INT_NEW_COMM); + AAC_MEM0_SETREG4(sc, AAC_RKT_OIMR, ~AAC_DB_INT_NEW_COMM); else - AAC_SETREG4(sc, AAC_RKT_OIMR, ~AAC_DB_INTERRUPTS); + AAC_MEM0_SETREG4(sc, AAC_RKT_OIMR, ~AAC_DB_INTERRUPTS); } else { - AAC_SETREG4(sc, AAC_RKT_OIMR, ~0); + AAC_MEM0_SETREG4(sc, AAC_RKT_OIMR, ~0); } } @@ -2675,19 +2716,19 @@ aac_rx_send_command(struct aac_softc *sc fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "send command (new comm.)"); - index = AAC_GETREG4(sc, AAC_RX_IQUE); + index = AAC_MEM0_GETREG4(sc, AAC_RX_IQUE); if (index == 0xffffffffL) - index = AAC_GETREG4(sc, AAC_RX_IQUE); + index = AAC_MEM0_GETREG4(sc, AAC_RX_IQUE); if (index == 0xffffffffL) return index; aac_enqueue_busy(cm); device = index; - AAC_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys & 0xffffffffUL)); + AAC_MEM1_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys & 0xffffffffUL)); device += 4; - AAC_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys >> 32)); + AAC_MEM1_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys >> 32)); device += 4; - AAC_SETREG4(sc, device, cm->cm_fib->Header.Size); - AAC_SETREG4(sc, AAC_RX_IQUE, index); + AAC_MEM1_SETREG4(sc, device, cm->cm_fib->Header.Size); + AAC_MEM0_SETREG4(sc, AAC_RX_IQUE, index); return 0; } @@ -2698,19 +2739,19 @@ aac_rkt_send_command(struct aac_softc *s fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "send command (new comm.)"); - index = AAC_GETREG4(sc, AAC_RKT_IQUE); + index = AAC_MEM0_GETREG4(sc, AAC_RKT_IQUE); if (index == 0xffffffffL) - index = AAC_GETREG4(sc, AAC_RKT_IQUE); + index = AAC_MEM0_GETREG4(sc, AAC_RKT_IQUE); if (index == 0xffffffffL) return index; aac_enqueue_busy(cm); device = index; - AAC_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys & 0xffffffffUL)); + AAC_MEM1_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys & 0xffffffffUL)); device += 4; - AAC_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys >> 32)); + AAC_MEM1_SETREG4(sc, device, (u_int32_t)(cm->cm_fibphys >> 32)); device += 4; - AAC_SETREG4(sc, device, cm->cm_fib->Header.Size); - AAC_SETREG4(sc, AAC_RKT_IQUE, index); + AAC_MEM1_SETREG4(sc, device, cm->cm_fib->Header.Size); + AAC_MEM0_SETREG4(sc, AAC_RKT_IQUE, index); return 0; } @@ -2722,7 +2763,7 @@ aac_rx_get_outb_queue(struct aac_softc * { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RX_OQUE)); + return(AAC_MEM0_GETREG4(sc, AAC_RX_OQUE)); } static int @@ -2730,7 +2771,7 @@ aac_rkt_get_outb_queue(struct aac_softc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - return(AAC_GETREG4(sc, AAC_RKT_OQUE)); + return(AAC_MEM0_GETREG4(sc, AAC_RKT_OQUE)); } static void @@ -2738,7 +2779,7 @@ aac_rx_set_outb_queue(struct aac_softc * { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RX_OQUE, index); + AAC_MEM0_SETREG4(sc, AAC_RX_OQUE, index); } static void @@ -2746,7 +2787,7 @@ aac_rkt_set_outb_queue(struct aac_softc { fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - AAC_SETREG4(sc, AAC_RKT_OQUE, index); + AAC_MEM0_SETREG4(sc, AAC_RKT_OQUE, index); } /* Modified: head/sys/dev/aac/aac_debug.c ============================================================================== --- head/sys/dev/aac/aac_debug.c Sat Feb 21 15:04:31 2009 (r188895) +++ head/sys/dev/aac/aac_debug.c Sat Feb 21 15:40:03 2009 (r188896) @@ -134,17 +134,18 @@ aac_printstate0(void) aac_print_queues(sc); switch (sc->aac_hwif) { case AAC_HWIF_I960RX: + case AAC_HWIF_NARK: device_printf(sc->aac_dev, "IDBR 0x%08x IIMR 0x%08x " - "IISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_IDBR), - AAC_GETREG4(sc, AAC_RX_IIMR), AAC_GETREG4(sc, AAC_RX_IISR)); + "IISR 0x%08x\n", AAC_MEM0_GETREG4(sc, AAC_RX_IDBR), + AAC_MEM0_GETREG4(sc, AAC_RX_IIMR), AAC_MEM0_GETREG4(sc, AAC_RX_IISR)); device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x " - "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR), - AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR)); - AAC_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | + "OISR 0x%08x\n", AAC_MEM0_GETREG4(sc, AAC_RX_ODBR), + AAC_MEM0_GETREG4(sc, AAC_RX_OIMR), AAC_MEM0_GETREG4(sc, AAC_RX_OISR)); + AAC_MEM0_SETREG4(sc, AAC_RX_OIMR, 0/*~(AAC_DB_COMMAND_READY | AAC_DB_RESPONSE_READY | AAC_DB_PRINTF)*/); device_printf(sc->aac_dev, "ODBR 0x%08x OIMR 0x%08x " - "OISR 0x%08x\n", AAC_GETREG4(sc, AAC_RX_ODBR), - AAC_GETREG4(sc, AAC_RX_OIMR), AAC_GETREG4(sc, AAC_RX_OISR)); + "OISR 0x%08x\n", AAC_MEM0_GETREG4(sc, AAC_RX_ODBR), + AAC_MEM0_GETREG4(sc, AAC_RX_OIMR), AAC_MEM0_GETREG4(sc, AAC_RX_OISR)); break; case AAC_HWIF_STRONGARM: /* XXX implement */ Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Sat Feb 21 15:04:31 2009 (r188895) +++ head/sys/dev/aac/aac_pci.c Sat Feb 21 15:40:03 2009 (r188896) @@ -372,21 +372,32 @@ aac_pci_attach(device_t dev) /* * Allocate the PCI register window. */ - sc->aac_regs_rid = PCIR_BAR(0); - if ((sc->aac_regs_resource = bus_alloc_resource_any(sc->aac_dev, - SYS_RES_MEMORY, - &sc->aac_regs_rid, - RF_ACTIVE)) == - NULL) { + sc->aac_regs_rid0 = PCIR_BAR(0); + if ((sc->aac_regs_res0 = bus_alloc_resource_any(sc->aac_dev, + SYS_RES_MEMORY, &sc->aac_regs_rid0, RF_ACTIVE)) == NULL) { device_printf(sc->aac_dev, - "couldn't allocate register window\n"); + "couldn't allocate register window 0\n"); goto out; } - sc->aac_btag = rman_get_bustag(sc->aac_regs_resource); - sc->aac_bhandle = rman_get_bushandle(sc->aac_regs_resource); + sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0); + sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0); - /* assume failure is 'out of memory' */ - error = ENOMEM; + if (sc->aac_hwif == AAC_HWIF_NARK) { + sc->aac_regs_rid1 = PCIR_BAR(1); + if ((sc->aac_regs_res1 = bus_alloc_resource_any(sc->aac_dev, + SYS_RES_MEMORY, &sc->aac_regs_rid1, RF_ACTIVE)) == NULL) { + device_printf(sc->aac_dev, + "couldn't allocate register window 1\n"); + goto out; + } + sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); + sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); + } else { + sc->aac_regs_res1 = sc->aac_regs_res0; + sc->aac_regs_rid1 = sc->aac_regs_rid0; + sc->aac_btag1 = sc->aac_btag0; + sc->aac_bhandle1 = sc->aac_bhandle0; + } /* * Allocate the parent bus DMA tag appropriate for our PCI interface. @@ -416,7 +427,8 @@ aac_pci_attach(device_t dev) sc->aac_hwif = id->hwif; switch(sc->aac_hwif) { case AAC_HWIF_I960RX: - fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx"); + case AAC_HWIF_NARK: + fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK"); sc->aac_if = aac_rx_interface; break; case AAC_HWIF_STRONGARM: Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Sat Feb 21 15:04:31 2009 (r188895) +++ head/sys/dev/aac/aacreg.h Sat Feb 21 15:40:03 2009 (r188896) @@ -1468,7 +1468,7 @@ enum { #define AAC_FA_FWSTATUS 0x2c /* Mailbox 7 */ #define AAC_FA_INTSRC 0x900 -#define AAC_FA_HACK(sc) (void)AAC_GETREG4(sc, AAC_FA_INTSRC) +#define AAC_FA_HACK(sc) (void)AAC_MEM0_GETREG4(sc, AAC_FA_INTSRC) /* * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Sat Feb 21 15:04:31 2009 (r188895) +++ head/sys/dev/aac/aacvar.h Sat Feb 21 15:40:03 2009 (r188896) @@ -30,6 +30,7 @@ */ #include +#include #include #include #include @@ -259,18 +260,31 @@ extern struct aac_interface aac_rkt_inte #define AAC_GET_OUTB_QUEUE(sc) ((sc)->aac_if.aif_get_outb_queue((sc))) #define AAC_SET_OUTB_QUEUE(sc, idx) ((sc)->aac_if.aif_set_outb_queue((sc), (idx))) -#define AAC_SETREG4(sc, reg, val) bus_space_write_4(sc->aac_btag, \ - sc->aac_bhandle, reg, val) -#define AAC_GETREG4(sc, reg) bus_space_read_4 (sc->aac_btag, \ - sc->aac_bhandle, reg) -#define AAC_SETREG2(sc, reg, val) bus_space_write_2(sc->aac_btag, \ - sc->aac_bhandle, reg, val) -#define AAC_GETREG2(sc, reg) bus_space_read_2 (sc->aac_btag, \ - sc->aac_bhandle, reg) -#define AAC_SETREG1(sc, reg, val) bus_space_write_1(sc->aac_btag, \ - sc->aac_bhandle, reg, val) -#define AAC_GETREG1(sc, reg) bus_space_read_1 (sc->aac_btag, \ - sc->aac_bhandle, reg) +#define AAC_MEM0_SETREG4(sc, reg, val) bus_space_write_4(sc->aac_btag0, \ + sc->aac_bhandle0, reg, val) +#define AAC_MEM0_GETREG4(sc, reg) bus_space_read_4(sc->aac_btag0, \ + sc->aac_bhandle0, reg) +#define AAC_MEM0_SETREG2(sc, reg, val) bus_space_write_2(sc->aac_btag0, \ + sc->aac_bhandle0, reg, val) +#define AAC_MEM0_GETREG2(sc, reg) bus_space_read_2(sc->aac_btag0, \ + sc->aac_bhandle0, reg) +#define AAC_MEM0_SETREG1(sc, reg, val) bus_space_write_1(sc->aac_btag0, \ + sc->aac_bhandle0, reg, val) +#define AAC_MEM0_GETREG1(sc, reg) bus_space_read_1(sc->aac_btag0, \ + sc->aac_bhandle0, reg) + +#define AAC_MEM1_SETREG4(sc, reg, val) bus_space_write_4(sc->aac_btag1, \ + sc->aac_bhandle1, reg, val) +#define AAC_MEM1_GETREG4(sc, reg) bus_space_read_4(sc->aac_btag1, \ + sc->aac_bhandle1, reg) +#define AAC_MEM1_SETREG2(sc, reg, val) bus_space_write_2(sc->aac_btag1, \ + sc->aac_bhandle1, reg, val) +#define AAC_MEM1_GETREG2(sc, reg) bus_space_read_2(sc->aac_btag1, \ + sc->aac_bhandle1, reg) +#define AAC_MEM1_SETREG1(sc, reg, val) bus_space_write_1(sc->aac_btag1, \ + sc->aac_bhandle1, reg, val) +#define AAC_MEM1_GETREG1(sc, reg) bus_space_read_1(sc->aac_btag1, \ + sc->aac_bhandle1, reg) /* fib context (IOCTL) */ struct aac_fib_context { @@ -287,11 +301,10 @@ struct aac_softc { /* bus connections */ device_t aac_dev; - struct resource *aac_regs_resource; /* register interface - * window */ - int aac_regs_rid; /* resource ID */ - bus_space_handle_t aac_bhandle; /* bus space handle */ - bus_space_tag_t aac_btag; /* bus space tag */ + struct resource *aac_regs_res0, *aac_regs_res1; /* reg. if. window */ + int aac_regs_rid0, aac_regs_rid1; /* resource ID */ + bus_space_handle_t aac_bhandle0, aac_bhandle1; /* bus space handle */ + bus_space_tag_t aac_btag0, aac_btag1; /* bus space tag */ bus_dma_tag_t aac_parent_dmat; /* parent DMA tag */ bus_dma_tag_t aac_buffer_dmat; /* data buffer/command * DMA tag */ @@ -315,6 +328,7 @@ struct aac_softc #define AAC_HWIF_STRONGARM 1 #define AAC_HWIF_FALCON 2 #define AAC_HWIF_RKT 3 +#define AAC_HWIF_NARK 4 #define AAC_HWIF_UNKNOWN -1 bus_dma_tag_t aac_common_dmat; /* common structure * DMA tag */ @@ -398,6 +412,8 @@ struct aac_softc u_int32_t scsi_method_id; TAILQ_HEAD(,aac_sim) aac_sim_tqh; + struct callout aac_daemontime; /* clock daemon callout */ + u_int32_t aac_max_fibs; /* max. FIB count */ u_int32_t aac_max_fibs_alloc; /* max. alloc. per alloc_commands() */ u_int32_t aac_max_fib_size; /* max. FIB size */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 16:39:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AC1106564A; Sat, 21 Feb 2009 16:39:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 445288FC25; Sat, 21 Feb 2009 16:39:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LGdR0C070626; Sat, 21 Feb 2009 16:39:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LGdRVK070622; Sat, 21 Feb 2009 16:39:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902211639.n1LGdRVK070622@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Feb 2009 16:39: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: r188897 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 16:39:28 -0000 Author: mav Date: Sat Feb 21 16:39:26 2009 New Revision: 188897 URL: http://svn.freebsd.org/changeset/base/188897 Log: Teach device drivers' ata_reinit() methods, that there can be more then two devices per channel. Modified: head/sys/dev/ata/ata-disk.c head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-fd.c head/sys/dev/ata/atapi-tape.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Sat Feb 21 15:40:03 2009 (r188896) +++ head/sys/dev/ata/ata-disk.c Sat Feb 21 16:39:26 2009 (r188897) @@ -199,10 +199,9 @@ ad_reinit(device_t dev) struct ata_device *atadev = device_get_softc(dev); /* if detach pending, return error */ - if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATA_MASTER)) || - ((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATA_SLAVE))) { + if (!(ch->devices & (ATA_ATA_MASTER << atadev->unit))) return 1; - } + ad_init(dev); return 0; } Modified: head/sys/dev/ata/atapi-cd.c ============================================================================== --- head/sys/dev/ata/atapi-cd.c Sat Feb 21 15:40:03 2009 (r188896) +++ head/sys/dev/ata/atapi-cd.c Sat Feb 21 16:39:26 2009 (r188897) @@ -159,10 +159,10 @@ acd_reinit(device_t dev) struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) || - ((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) { - return 1; - } + /* if detach pending, return error */ + if (!(ch->devices & (ATA_ATAPI_MASTER << atadev->unit))) + return 1; + ATA_SETMODE(device_get_parent(dev), dev); return 0; } Modified: head/sys/dev/ata/atapi-fd.c ============================================================================== --- head/sys/dev/ata/atapi-fd.c Sat Feb 21 15:40:03 2009 (r188896) +++ head/sys/dev/ata/atapi-fd.c Sat Feb 21 16:39:26 2009 (r188897) @@ -147,11 +147,11 @@ afd_reinit(device_t dev) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - - if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) || - ((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) { + + /* if detach pending, return error */ + if (!(ch->devices & (ATA_ATAPI_MASTER << atadev->unit))) return 1; - } + ATA_SETMODE(device_get_parent(dev), dev); return 0; } Modified: head/sys/dev/ata/atapi-tape.c ============================================================================== --- head/sys/dev/ata/atapi-tape.c Sat Feb 21 15:40:03 2009 (r188896) +++ head/sys/dev/ata/atapi-tape.c Sat Feb 21 16:39:26 2009 (r188897) @@ -191,10 +191,10 @@ ast_reinit(device_t dev) struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) || - ((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) { + /* if detach pending, return error */ + if (!(ch->devices & (ATA_ATAPI_MASTER << atadev->unit))) return 1; - } + ATA_SETMODE(device_get_parent(dev), dev); return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 19:19:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3911065673; Sat, 21 Feb 2009 19:19:12 +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 3CFBD8FC15; Sat, 21 Feb 2009 19:19:12 +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 n1LJJC2A073389; Sat, 21 Feb 2009 19:19:12 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LJJCs2073388; Sat, 21 Feb 2009 19:19:12 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902211919.n1LJJCs2073388@svn.freebsd.org> From: Sam Leffler Date: Sat, 21 Feb 2009 19:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188898 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 19:19:13 -0000 Author: sam Date: Sat Feb 21 19:19:11 2009 New Revision: 188898 URL: http://svn.freebsd.org/changeset/base/188898 Log: fix cross-refs to wlandebug PR: docs/131927 Submitted by: David Horn Modified: stable/7/share/man/man4/wlan.4 Modified: stable/7/share/man/man4/wlan.4 ============================================================================== --- stable/7/share/man/man4/wlan.4 Sat Feb 21 16:39:26 2009 (r188897) +++ stable/7/share/man/man4/wlan.4 Sat Feb 21 19:19:11 2009 (r188898) @@ -101,7 +101,7 @@ For example, enables debugging messages related to scanning for an access point, adhoc neighbor, or an unoccupied channel when operation as an access point. The -.Xr 80211debug +.Xr wlandebug tool provides a more user-friendly mechanism for doing the same thing. .Pp Many drivers will also display the contents of each 802.11 frame @@ -135,7 +135,8 @@ was used to be compatible with .Xr wlan_tkip 4 , .Xr wlan_wep 4 , .Xr wlan_xauth 4 , -.Xr zyd 4 +.Xr zyd 4 , +.Xr wlandebug 8 .Sh STANDARDS More information can be found in the IEEE 802.11 Standard. .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 19:25:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4949A1065670; Sat, 21 Feb 2009 19:25:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37C898FC1B; Sat, 21 Feb 2009 19:25:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LJPEdA073540; Sat, 21 Feb 2009 19:25:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LJPENX073539; Sat, 21 Feb 2009 19:25:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200902211925.n1LJPENX073539@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 21 Feb 2009 19:25: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: r188899 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 19:25:15 -0000 Author: marcel Date: Sat Feb 21 19:25:13 2009 New Revision: 188899 URL: http://svn.freebsd.org/changeset/base/188899 Log: o When creating the EBR scheme, set the number of entries properly. Otherwise the minimum of 1 is used and you can only insert a single partition/slice and only at sector 0 (index 1). o When adding a partition/slice, recalculate the index after the start and size of the partition/slice are adjusted to make them a multiple of the track size. Since the precheck method sets the index based on the start of the partition as provided by the user, we know that we're off by at most 1 and adjusting the index is safe. 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 Sat Feb 21 19:19:11 2009 (r188898) +++ head/sys/geom/part/g_part_ebr.c Sat Feb 21 19:25:13 2009 (r188899) @@ -218,6 +218,7 @@ g_part_ebr_add(struct g_part_table *base KASSERT(baseentry->gpe_start <= start, (__func__)); KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); + baseentry->gpe_index = (start / sectors) + 1; baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; baseentry->gpe_start = start; baseentry->gpe_end = start + size - 1; @@ -257,6 +258,7 @@ g_part_ebr_create(struct g_part_table *b return (ENXIO); msize = pp->mediasize / pp->sectorsize; + basetable->gpt_entries = msize / basetable->gpt_sectors; basetable->gpt_first = 0; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; return (0); From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 20:57:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 495C21065673; Sat, 21 Feb 2009 20:57:26 +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 385D78FC12; Sat, 21 Feb 2009 20:57:26 +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 n1LKvQSZ075177; Sat, 21 Feb 2009 20:57:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LKvQj2075176; Sat, 21 Feb 2009 20:57:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200902212057.n1LKvQj2075176@svn.freebsd.org> From: Alan Cox Date: Sat, 21 Feb 2009 20:57: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: r188900 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 20:57:26 -0000 Author: alc Date: Sat Feb 21 20:57:25 2009 New Revision: 188900 URL: http://svn.freebsd.org/changeset/base/188900 Log: Reduce the scope of the page queues lock in vm_object_page_remove(). MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Feb 21 19:25:13 2009 (r188899) +++ head/sys/vm/vm_object.c Sat Feb 21 20:57:25 2009 (r188900) @@ -1869,7 +1869,6 @@ vm_object_page_remove(vm_object_t object vm_object_pip_add(object, 1); again: - vm_page_lock_queues(); if ((p = TAILQ_FIRST(&object->memq)) != NULL) { if (p->pindex < start) { p = vm_page_splay(start, object->root); @@ -1877,6 +1876,7 @@ again: p = TAILQ_NEXT(p, listq); } } + vm_page_lock_queues(); /* * Assert: the variable p is either (1) the page with the * least pindex greater than or equal to the parameter pindex From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 22:57:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582AB10656E7; Sat, 21 Feb 2009 22:57:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 444BD8FC1D; Sat, 21 Feb 2009 22:57:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LMvRKq077555; Sat, 21 Feb 2009 22:57:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LMvQs1077550; Sat, 21 Feb 2009 22:57:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902212257.n1LMvQs1077550@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Feb 2009 22:57: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: r188903 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 22:57:28 -0000 Author: mav Date: Sat Feb 21 22:57:26 2009 New Revision: 188903 URL: http://svn.freebsd.org/changeset/base/188903 Log: Improve ata_reinit(): - protect againtst recursions, - add new devices detection using ata_identify(). Improve ata_identify(): - do not add duplicate device if device already exist. Rework SATA hot-plug events handling. Instead of unsafe duplicate implementation use common ata_reinit() to handle all state changes. All together this gives quite stable and robust cold- and hot-plug operation, invariant to false, lost and duplicate events. Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-sata.c head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Feb 21 21:12:54 2009 (r188902) +++ head/sys/dev/ata/ata-all.c Sat Feb 21 22:57:26 2009 (r188903) @@ -62,6 +62,7 @@ static struct cdevsw ata_cdevsw = { /* prototypes */ static void ata_boot_attach(void); static device_t ata_add_child(device_t, struct ata_device *, int); +static void ata_conn_event(void *, int); static void bswap(int8_t *, int); static void btrim(int8_t *, int); static void bpack(int8_t *, int8_t *, int); @@ -127,6 +128,7 @@ ata_attach(device_t dev) bzero(&ch->queue_mtx, sizeof(struct mtx)); mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); TAILQ_INIT(&ch->ata_queue); + TASK_INIT(&ch->conntask, 0, ata_conn_event, dev); /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) @@ -181,6 +183,7 @@ ata_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } + taskqueue_drain(taskqueue_thread, &ch->conntask); /* release resources */ bus_teardown_intr(dev, ch->r_irq, ch->ih); @@ -196,6 +199,14 @@ ata_detach(device_t dev) return 0; } +static void +ata_conn_event(void *context, int dummy) +{ + device_t dev = (device_t)context; + + ata_reinit(dev); +} + int ata_reinit(device_t dev) { @@ -217,6 +228,11 @@ ata_reinit(device_t dev) /* catch eventual request in ch->running */ mtx_lock(&ch->state_mtx); + if (ch->state & ATA_STALL_QUEUE) { + /* Recursive reinits and reinits during detach prohobited. */ + mtx_unlock(&ch->state_mtx); + return (ENXIO); + } if ((request = ch->running)) callout_stop(&request->callout); ch->running = NULL; @@ -274,6 +290,9 @@ ata_reinit(device_t dev) mtx_unlock(&ch->state_mtx); ATA_LOCKING(dev, ATA_LF_UNLOCK); + /* Add new children. */ + ata_identify(dev); + if (bootverbose) device_printf(dev, "reinit done ..\n"); @@ -684,14 +703,27 @@ ata_identify(device_t dev) { struct ata_channel *ch = device_get_softc(dev); struct ata_device *atadev; + device_t *children; device_t child; - int i; + int nchildren, i, n = ch->devices; if (bootverbose) - device_printf(dev, "identify ch->devices=%08x\n", ch->devices); + device_printf(dev, "Identifying devices: %08x\n", ch->devices); + mtx_lock(&Giant); + /* Skip existing devices. */ + if (!device_get_children(dev, &children, &nchildren)) { + for (i = 0; i < nchildren; i++) { + if (children[i] && (atadev = device_get_softc(children[i]))) + n &= ~((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << atadev->unit); + } + free(children, M_TEMP); + } + /* Create new devices. */ + if (bootverbose) + device_printf(dev, "New devices: %08x\n", n); for (i = 0; i < ATA_PM; ++i) { - if (ch->devices & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) { + if (n & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) { int unit = -1; if (!(atadev = malloc(sizeof(struct ata_device), @@ -701,7 +733,7 @@ ata_identify(device_t dev) } atadev->unit = i; #ifdef ATA_STATIC_ID - if (ch->devices & ((ATA_ATA_MASTER << i))) + if (n & (ATA_ATA_MASTER << i)) unit = (device_get_unit(dev) << 1) + i; #endif if ((child = ata_add_child(dev, atadev, unit))) { @@ -716,6 +748,7 @@ ata_identify(device_t dev) } bus_generic_probe(dev); bus_generic_attach(dev); + mtx_unlock(&Giant); return 0; } Modified: head/sys/dev/ata/ata-all.h ============================================================================== --- head/sys/dev/ata/ata-all.h Sat Feb 21 21:12:54 2009 (r188902) +++ head/sys/dev/ata/ata-all.h Sat Feb 21 22:57:26 2009 (r188903) @@ -530,6 +530,7 @@ struct ata_channel { TAILQ_HEAD(, ata_request) ata_queue; /* head of ATA queue */ struct ata_request *freezepoint; /* composite freezepoint */ struct ata_request *running; /* currently running request */ + struct task conntask; /* PHY events handling task */ }; /* disk bay/enclosure related */ Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Sat Feb 21 21:12:54 2009 (r188902) +++ head/sys/dev/ata/ata-pci.h Sat Feb 21 22:57:26 2009 (r188903) @@ -66,15 +66,6 @@ struct ata_pci_controller { } interrupt[8]; /* XXX SOS max ch# for now */ }; -/* structure for SATA connection update hotplug/hotswap support */ -struct ata_connect_task { - struct task task; - device_t dev; - int action; -#define ATA_C_ATTACH 1 -#define ATA_C_DETACH 2 -}; - /* defines for known chipset PCI id's */ #define ATA_ACARD_ID 0x1191 #define ATA_ATP850 0x00021191 @@ -451,7 +442,6 @@ int ata_check_80pin(device_t dev, int mo int ata_mode2idx(int mode); /* global prototypes ata-sata.c */ -void ata_sata_phy_event(void *context, int dummy); void ata_sata_phy_check_events(device_t dev); int ata_sata_phy_reset(device_t dev); void ata_sata_setmode(device_t dev, int mode); Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Sat Feb 21 21:12:54 2009 (r188902) +++ head/sys/dev/ata/ata-sata.c Sat Feb 21 22:57:26 2009 (r188903) @@ -50,41 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * SATA support functions - */ -void -ata_sata_phy_event(void *context, int dummy) -{ - struct ata_connect_task *tp = (struct ata_connect_task *)context; - struct ata_channel *ch = device_get_softc(tp->dev); - device_t *children; - int nchildren, i; - - mtx_lock(&Giant); /* newbus suckage it needs Giant */ - if (tp->action == ATA_C_ATTACH) { - if (bootverbose) - device_printf(tp->dev, "CONNECTED\n"); - ATA_RESET(tp->dev); - ata_identify(tp->dev); - } - if (tp->action == ATA_C_DETACH) { - if (!device_get_children(tp->dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(tp->dev, children[i]); - free(children, M_TEMP); - } - mtx_lock(&ch->state_mtx); - ch->state = ATA_IDLE; - mtx_unlock(&ch->state_mtx); - if (bootverbose) - device_printf(tp->dev, "DISCONNECTED\n"); - } - mtx_unlock(&Giant); /* suckage code dealt with, release Giant */ - free(tp, M_ATA); -} - void ata_sata_phy_check_events(device_t dev) { @@ -94,32 +59,17 @@ ata_sata_phy_check_events(device_t dev) /* clear error bits/interrupt */ ATA_IDX_OUTL(ch, ATA_SERROR, error); - /* do we have any events flagged ? */ - if (error) { - struct ata_connect_task *tp; - u_int32_t status = ATA_IDX_INL(ch, ATA_SSTATUS); - - /* if we have a connection event deal with it */ - if ((error & ATA_SE_PHY_CHANGED) && - (tp = (struct ata_connect_task *) - malloc(sizeof(struct ata_connect_task), - M_ATA, M_NOWAIT | M_ZERO))) { - + /* if we have a connection event deal with it */ + if (error & ATA_SE_PHY_CHANGED) { + if (bootverbose) { + u_int32_t status = ATA_IDX_INL(ch, ATA_SSTATUS); if (((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1) || ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2)) { - if (bootverbose) device_printf(dev, "CONNECT requested\n"); - tp->action = ATA_C_ATTACH; - } - else { - if (bootverbose) + } else device_printf(dev, "DISCONNECT requested\n"); - tp->action = ATA_C_DETACH; - } - tp->dev = dev; - TASK_INIT(&tp->task, 0, ata_sata_phy_event, tp); - taskqueue_enqueue(taskqueue_thread, &tp->task); } + taskqueue_enqueue(taskqueue_thread, &ch->conntask); } } Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 21:12:54 2009 (r188902) +++ head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 22:57:26 2009 (r188903) @@ -637,7 +637,6 @@ ata_promise_mio_status(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - struct ata_connect_task *tp; u_int32_t fake_reg, stat_reg, vector, status; switch (ctlr->chip->cfg2) { @@ -663,31 +662,17 @@ ata_promise_mio_status(device_t dev) ATA_OUTL(ctlr->r_res2, stat_reg, status & (0x00000011 << ch->unit)); /* check for and handle disconnect events */ - if ((status & (0x00000001 << ch->unit)) && - (tp = (struct ata_connect_task *) - malloc(sizeof(struct ata_connect_task), - M_ATA, M_NOWAIT | M_ZERO))) { - + if (status & (0x00000001 << ch->unit)) { if (bootverbose) device_printf(dev, "DISCONNECT requested\n"); - tp->action = ATA_C_DETACH; - tp->dev = dev; - TASK_INIT(&tp->task, 0, ata_sata_phy_event, tp); - taskqueue_enqueue(taskqueue_thread, &tp->task); + taskqueue_enqueue(taskqueue_thread, &ch->conntask); } /* check for and handle connect events */ - if ((status & (0x00000010 << ch->unit)) && - (tp = (struct ata_connect_task *) - malloc(sizeof(struct ata_connect_task), - M_ATA, M_NOWAIT | M_ZERO))) { - + if (status & (0x00000010 << ch->unit)) { if (bootverbose) device_printf(dev, "CONNECT requested\n"); - tp->action = ATA_C_ATTACH; - tp->dev = dev; - TASK_INIT(&tp->task, 0, ata_sata_phy_event, tp); - taskqueue_enqueue(taskqueue_thread, &tp->task); + taskqueue_enqueue(taskqueue_thread, &ch->conntask); } /* do we have any device action ? */ From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 23:15:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DFB1065672; Sat, 21 Feb 2009 23:15:34 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D4B8FC18; Sat, 21 Feb 2009 23:15:34 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LNFY0M077944; Sat, 21 Feb 2009 23:15:34 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LNFYMc077942; Sat, 21 Feb 2009 23:15:34 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <200902212315.n1LNFYMc077942@svn.freebsd.org> From: Jeff Roberson Date: Sat, 21 Feb 2009 23: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: r188904 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 23:15:35 -0000 Author: jeff Date: Sat Feb 21 23:15:34 2009 New Revision: 188904 URL: http://svn.freebsd.org/changeset/base/188904 Log: - Resolve an issue where we may clear an idt while an interrupt on a different cpu is still assigned to that vector by never clearing idt entries. This was only provided as a debugging feature and the bugs are caught by other means. - Drop the sched lock when rebinding to reassign an interrupt vector to a new cpu so that pending interrupts have a chance to be delivered before removing the old vector. Discussed with: tegge, jhb Modified: head/sys/amd64/amd64/local_apic.c head/sys/i386/i386/local_apic.c Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Sat Feb 21 22:57:26 2009 (r188903) +++ head/sys/amd64/amd64/local_apic.c Sat Feb 21 23:15:34 2009 (r188904) @@ -900,7 +900,13 @@ apic_disable_vector(u_int apic_id, u_int KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry")); KASSERT(ioint_handlers[vector / 32] != NULL, ("No ISR handler for vector %u", vector)); +#ifdef notyet + /* + * We can not currently clear the idt entry because other cpus + * may have a valid vector at this offset. + */ setidt(vector, &IDTVEC(rsvd), SDT_SYSIGT, SEL_KPL, 0); +#endif } /* Release an APIC vector when it's no longer in use. */ @@ -924,9 +930,11 @@ apic_free_vector(u_int apic_id, u_int ve if (sched_is_bound(td)) panic("apic_free_vector: Thread already bound.\n"); sched_bind(td, apic_cpuid(apic_id)); + thread_unlock(td); mtx_lock_spin(&icu_lock); lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = 0; mtx_unlock_spin(&icu_lock); + thread_lock(td); sched_unbind(td); thread_unlock(td); Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Sat Feb 21 22:57:26 2009 (r188903) +++ head/sys/i386/i386/local_apic.c Sat Feb 21 23:15:34 2009 (r188904) @@ -903,8 +903,14 @@ apic_disable_vector(u_int apic_id, u_int KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry")); KASSERT(ioint_handlers[vector / 32] != NULL, ("No ISR handler for vector %u", vector)); +#ifdef notyet + /* + * We can not currently clear the idt entry because other cpus + * may have a valid vector at this offset. + */ setidt(vector, &IDTVEC(rsvd), SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); +#endif } /* Release an APIC vector when it's no longer in use. */ @@ -928,9 +934,11 @@ apic_free_vector(u_int apic_id, u_int ve if (sched_is_bound(td)) panic("apic_free_vector: Thread already bound.\n"); sched_bind(td, apic_cpuid(apic_id)); + thread_unlock(td); mtx_lock_spin(&icu_lock); lapics[apic_id].la_ioint_irqs[vector - APIC_IO_INTS] = 0; mtx_unlock_spin(&icu_lock); + thread_lock(td); sched_unbind(td); thread_unlock(td); From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 23:42:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBCB4106564A; Sat, 21 Feb 2009 23:42:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA00B8FC15; Sat, 21 Feb 2009 23:42:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LNgSZC078457; Sat, 21 Feb 2009 23:42:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LNgS9w078456; Sat, 21 Feb 2009 23:42:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902212342.n1LNgS9w078456@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Feb 2009 23:42: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: r188905 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 23:42:29 -0000 Author: mav Date: Sat Feb 21 23:42:28 2009 New Revision: 188905 URL: http://svn.freebsd.org/changeset/base/188905 Log: Increase initial busy waiting time. If drive was hot-plugged, it may need much time to spin-up. Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:15:34 2009 (r188904) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:42:28 2009 (r188905) @@ -624,7 +624,7 @@ ata_ahci_start(device_t dev) } static int -ata_ahci_wait_ready(device_t dev) +ata_ahci_wait_ready(device_t dev, int t) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); @@ -634,7 +634,7 @@ ata_ahci_wait_ready(device_t dev) while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & (ATA_S_BUSY | ATA_S_DRQ)) { DELAY(1000); - if (timeout++ > 1000) { + if (timeout++ > t) { device_printf(dev, "port is not ready\n"); return (-1); } @@ -680,7 +680,7 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - if (ata_ahci_wait_ready(dev)) + if (ata_ahci_wait_ready(dev, 1000)) return (-1); return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); @@ -738,7 +738,7 @@ ata_ahci_reset(device_t dev) ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); /* Wait for initial TFD from device. */ - ata_ahci_wait_ready(dev); + ata_ahci_wait_ready(dev, 10000); /* only probe for PortMultiplier if HW has support */ if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 23:46:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBEEB106564A; Sat, 21 Feb 2009 23:46:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA51C8FC08; Sat, 21 Feb 2009 23:46:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LNkY37078582; Sat, 21 Feb 2009 23:46:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LNkYnH078578; Sat, 21 Feb 2009 23:46:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902212346.n1LNkYnH078578@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Feb 2009 23:46: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: r188906 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 23:46:35 -0000 Author: mav Date: Sat Feb 21 23:46:34 2009 New Revision: 188906 URL: http://svn.freebsd.org/changeset/base/188906 Log: Use only higher half of device signature to identify device type. Some devices return incorrect values in lower part confusing detection, while higher part itself gives enough information for proper detetion. Modified: head/sys/dev/ata/ata-sata.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/ata-sata.c Sat Feb 21 23:46:34 2009 (r188906) @@ -295,11 +295,11 @@ ata_pm_identify(device_t dev) device_printf(dev, "p%d: SIGNATURE=%08x\n", port, signature); /* figure out whats there */ - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices |= (ATA_ATA_MASTER << port); continue; - case 0xeb140101: + case 0xeb14: ch->devices |= (ATA_ATAPI_MASTER << port); continue; } Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:46:34 2009 (r188906) @@ -754,15 +754,15 @@ ata_ahci_reset(device_t dev) if (bootverbose) device_printf(dev, "SIGNATURE: %08x\n", signature); - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: /* SOS XXX */ Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 23:46:34 2009 (r188906) @@ -808,15 +808,15 @@ ata_promise_mio_reset(device_t dev) if (1 | bootverbose) device_printf(dev, "SIGNATURE: %08x\n", signature); - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: /* SOS XXX */ Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Feb 21 23:46:34 2009 (r188906) @@ -849,17 +849,17 @@ ata_siiprb_reset(device_t dev) device_printf(dev, "SIGNATURE=%08x\n", signature); /* figure out whats there */ - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ATA_OUTL(ctlr->r_res2, 0x1000 + offset, 0x2000); /* enable PM support */ //SOS XXX need to clear all PM status and interrupts!!!! ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: