From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 18:49:21 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FF0610657FE; Sun, 27 Nov 2011 18:49:17 +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 06C258FC0A; Sun, 27 Nov 2011 18:49:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARInGrh051587; Sun, 27 Nov 2011 18:49:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARInGkY051585; Sun, 27 Nov 2011 18:49:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111271849.pARInGkY051585@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Nov 2011 18:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228032 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 18:49:21 -0000 Author: kib Date: Sun Nov 27 18:49:16 2011 New Revision: 228032 URL: http://svn.freebsd.org/changeset/base/228032 Log: MFC r227485: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Approved by: re (bz) Modified: stable/9/sys/kern/sys_generic.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sys_generic.c ============================================================================== --- stable/9/sys/kern/sys_generic.c Sun Nov 27 17:51:13 2011 (r228031) +++ stable/9/sys/kern/sys_generic.c Sun Nov 27 18:49:16 2011 (r228032) @@ -831,6 +831,54 @@ sys_select(struct thread *td, struct sel NFDBITS)); } +/* + * In the unlikely case when user specified n greater then the last + * open file descriptor, check that no bits are set after the last + * valid fd. We must return EBADF if any is set. + * + * There are applications that rely on the behaviour. + * + * nd is fd_lastfile + 1. + */ +static int +select_check_badfd(fd_set *fd_in, int nd, int ndu, int abi_nfdbits) +{ + char *addr, *oaddr; + int b, i, res; + uint8_t bits; + + if (nd >= ndu || fd_in == NULL) + return (0); + + oaddr = NULL; + bits = 0; /* silence gcc */ + for (i = nd; i < ndu; i++) { + b = i / NBBY; +#if BYTE_ORDER == LITTLE_ENDIAN + addr = (char *)fd_in + b; +#else + addr = (char *)fd_in; + if (abi_nfdbits == NFDBITS) { + addr += rounddown(b, sizeof(fd_mask)) + + sizeof(fd_mask) - 1 - b % sizeof(fd_mask); + } else { + addr += rounddown(b, sizeof(uint32_t)) + + sizeof(uint32_t) - 1 - b % sizeof(uint32_t); + } +#endif + if (addr != oaddr) { + res = fubyte(addr); + if (res == -1) + return (EFAULT); + oaddr = addr; + bits = res; + } + if ((bits & (1 << (i % NBBY))) != 0) + return (EBADF); + } + return (0); +} + int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits) @@ -845,14 +893,26 @@ kern_select(struct thread *td, int nd, f fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv, rtv, ttv; - int error, timo; + int error, lf, ndu, timo; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; if (nd < 0) return (EINVAL); fdp = td->td_proc->p_fd; - if (nd > fdp->fd_lastfile + 1) - nd = fdp->fd_lastfile + 1; + ndu = nd; + lf = fdp->fd_lastfile; + if (nd > lf + 1) + nd = lf + 1; + + error = select_check_badfd(fd_in, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ou, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ex, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); /* * Allocate just enough bits for the non-null fd_sets. Use the From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 18:56:04 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66327106564A; Sun, 27 Nov 2011 18:56:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 553D68FC13; Sun, 27 Nov 2011 18:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARIu4dg051847; Sun, 27 Nov 2011 18:56:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARIu478051845; Sun, 27 Nov 2011 18:56:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111271856.pARIu478051845@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Nov 2011 18:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228033 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 18:56:04 -0000 Author: kib Date: Sun Nov 27 18:56:04 2011 New Revision: 228033 URL: http://svn.freebsd.org/changeset/base/228033 Log: MFC r227952: Fix a race between getvnode() dereferencing half-constructed file and dupfdopen(). Approved by: re (bz) Modified: stable/9/sys/kern/vfs_syscalls.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Sun Nov 27 18:49:16 2011 (r228032) +++ stable/9/sys/kern/vfs_syscalls.c Sun Nov 27 18:56:04 2011 (r228033) @@ -4342,7 +4342,20 @@ getvnode(struct filedesc *fdp, int fd, c fp = fp_fromcap; } #endif /* CAPABILITIES */ - if (fp->f_vnode == NULL) { + + /* + * The file could be not of the vnode type, or it may be not + * yet fully initialized, in which case the f_vnode pointer + * may be set, but f_ops is still badfileops. E.g., + * devfs_open() transiently create such situation to + * facilitate csw d_fdopen(). + * + * Dupfdopen() handling in kern_openat() installs the + * half-baked file into the process descriptor table, allowing + * other thread to dereference it. Guard against the race by + * checking f_ops. + */ + if (fp->f_vnode == NULL || fp->f_ops == &badfileops) { fdrop(fp, curthread); return (EINVAL); } From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 19:09:32 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5509C1065673; Sun, 27 Nov 2011 19:09:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43E618FC0A; Sun, 27 Nov 2011 19:09:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARJ9Wcc052445; Sun, 27 Nov 2011 19:09:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARJ9WhH052442; Sun, 27 Nov 2011 19:09:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111271909.pARJ9WhH052442@svn.freebsd.org> From: Michael Tuexen Date: Sun, 27 Nov 2011 19:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228036 - stable/9/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 19:09:32 -0000 Author: tuexen Date: Sun Nov 27 19:09:31 2011 New Revision: 228036 URL: http://svn.freebsd.org/changeset/base/228036 Log: MFC r228031: Fix a warning reported by arundel@. Fix a bug where the parameter length of a supported address types parameter is set to a wrong value if the kernel is built with with either INET or INET6, but not both. Approved by: re@ Modified: stable/9/sys/netinet/sctp_header.h stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/sctp_header.h ============================================================================== --- stable/9/sys/netinet/sctp_header.h Sun Nov 27 19:02:18 2011 (r228035) +++ stable/9/sys/netinet/sctp_header.h Sun Nov 27 19:09:31 2011 (r228036) @@ -81,8 +81,7 @@ struct sctp_host_name_param { /* supported address type */ struct sctp_supported_addr_param { struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ - uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address - * types */ + uint16_t addr_type[2]; /* array of supported address types */ } SCTP_PACKED; /* ECN parameter */ Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Nov 27 19:02:18 2011 (r228035) +++ stable/9/sys/netinet/sctp_output.c Sun Nov 27 19:09:31 2011 (r228036) @@ -4668,24 +4668,24 @@ sctp_send_initiate(struct sctp_inpcb *in #ifdef INET6 #ifdef INET /* we support 2 types: IPv4/IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); #else /* we support 1 type: IPv6 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif #else /* we support 1 type: IPv4 */ - sup_addr->ph.param_length = htons(sizeof(*sup_addr) + sizeof(uint8_t)); + sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ #endif - SCTP_BUF_LEN(m) += sizeof(*sup_addr) + sizeof(uint16_t); + SCTP_BUF_LEN(m) += sizeof(struct sctp_supported_addr_param); /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(*sup_addr) + sizeof(uint16_t)); + ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); ali->ph.param_length = htons(sizeof(*ali)); ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 19:36:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2000D1065672; Sun, 27 Nov 2011 19:36:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC5A8FC14; Sun, 27 Nov 2011 19:36:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARJaaYt053391; Sun, 27 Nov 2011 19:36:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARJaakd053389; Sun, 27 Nov 2011 19:36:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111271936.pARJaakd053389@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Nov 2011 19:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228038 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 19:36:37 -0000 Author: kib Date: Sun Nov 27 19:36:36 2011 New Revision: 228038 URL: http://svn.freebsd.org/changeset/base/228038 Log: MFC r227485: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Modified: stable/8/sys/kern/sys_generic.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/sys_generic.c ============================================================================== --- stable/8/sys/kern/sys_generic.c Sun Nov 27 19:13:45 2011 (r228037) +++ stable/8/sys/kern/sys_generic.c Sun Nov 27 19:36:36 2011 (r228038) @@ -829,6 +829,54 @@ select(struct thread *td, struct select_ NFDBITS)); } +/* + * In the unlikely case when user specified n greater then the last + * open file descriptor, check that no bits are set after the last + * valid fd. We must return EBADF if any is set. + * + * There are applications that rely on the behaviour. + * + * nd is fd_lastfile + 1. + */ +static int +select_check_badfd(fd_set *fd_in, int nd, int ndu, int abi_nfdbits) +{ + char *addr, *oaddr; + int b, i, res; + uint8_t bits; + + if (nd >= ndu || fd_in == NULL) + return (0); + + oaddr = NULL; + bits = 0; /* silence gcc */ + for (i = nd; i < ndu; i++) { + b = i / NBBY; +#if BYTE_ORDER == LITTLE_ENDIAN + addr = (char *)fd_in + b; +#else + addr = (char *)fd_in; + if (abi_nfdbits == NFDBITS) { + addr += rounddown(b, sizeof(fd_mask)) + + sizeof(fd_mask) - 1 - b % sizeof(fd_mask); + } else { + addr += rounddown(b, sizeof(uint32_t)) + + sizeof(uint32_t) - 1 - b % sizeof(uint32_t); + } +#endif + if (addr != oaddr) { + res = fubyte(addr); + if (res == -1) + return (EFAULT); + oaddr = addr; + bits = res; + } + if ((bits & (1 << (i % NBBY))) != 0) + return (EBADF); + } + return (0); +} + int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits) @@ -843,14 +891,26 @@ kern_select(struct thread *td, int nd, f fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv, rtv, ttv; - int error, timo; + int error, lf, ndu, timo; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; if (nd < 0) return (EINVAL); fdp = td->td_proc->p_fd; - if (nd > fdp->fd_lastfile + 1) - nd = fdp->fd_lastfile + 1; + ndu = nd; + lf = fdp->fd_lastfile; + if (nd > lf + 1) + nd = lf + 1; + + error = select_check_badfd(fd_in, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ou, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ex, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); /* * Allocate just enough bits for the non-null fd_sets. Use the From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 20:07:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F81A106564A; Sun, 27 Nov 2011 20:07: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 1E1F28FC0C; Sun, 27 Nov 2011 20:07:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARK7Vr8054432; Sun, 27 Nov 2011 20:07:31 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARK7VPn054430; Sun, 27 Nov 2011 20:07:31 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111272007.pARK7VPn054430@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 27 Nov 2011 20:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228041 - stable/9/sys/boot/ia64/common X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 20:07:31 -0000 Author: marcel Date: Sun Nov 27 20:07:30 2011 New Revision: 228041 URL: http://svn.freebsd.org/changeset/base/228041 Log: MFC rev. 227629: Wire the kernel text RWX, rather than RX. We're not quite ready for having kernel text non-writable, because we still need to apply relocations. On top of that, the PBVM page table has all pages marked as RWX, so it's an inconsistency to begin with. Approved by: re (kib) Modified: stable/9/sys/boot/ia64/common/exec.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/boot/ia64/common/exec.c ============================================================================== --- stable/9/sys/boot/ia64/common/exec.c Sun Nov 27 19:45:41 2011 (r228040) +++ stable/9/sys/boot/ia64/common/exec.c Sun Nov 27 20:07:30 2011 (r228041) @@ -187,7 +187,7 @@ mmu_setup_paged(struct bootinfo *bi) pa = ia64_va2pa(ia64_text_start, &ia64_text_size); ia64_text_size = sz; /* XXX */ shft = sz2shft(ia64_text_start, ia64_text_size); - shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RX); + shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RWX); ia64_copyin(&shft, (uintptr_t)&bi->bi_text_mapped, 4); /* Wire as much of the data segment as well. */ From owner-svn-src-stable@FreeBSD.ORG Sun Nov 27 20:12:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20AB81065672; Sun, 27 Nov 2011 20:12:09 +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 0FBE58FC0C; Sun, 27 Nov 2011 20:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pARKC8q6054685; Sun, 27 Nov 2011 20:12:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pARKC8pI054683; Sun, 27 Nov 2011 20:12:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111272012.pARKC8pI054683@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 27 Nov 2011 20:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228043 - stable/9/release/ia64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2011 20:12:09 -0000 Author: marcel Date: Sun Nov 27 20:12:08 2011 New Revision: 228043 URL: http://svn.freebsd.org/changeset/base/228043 Log: MFC rev. 227283: Add check-password.4th and screen.4th to the boot image. They are needed by the loader. Approved by: re (kib) Modified: stable/9/release/ia64/mkisoimages.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/ia64/mkisoimages.sh ============================================================================== --- stable/9/release/ia64/mkisoimages.sh Sun Nov 27 20:10:32 2011 (r228042) +++ stable/9/release/ia64/mkisoimages.sh Sun Nov 27 20:12:08 2011 (r228043) @@ -64,6 +64,8 @@ if [ $bootable = yes ]; then cp $BASE/boot/mfsroot.gz $MNT/boot fi cp $BASE/boot/support.4th $MNT/boot + cp $BASE/boot/check-password.4th $MNT/boot + cp $BASE/boot/screen.4th $MNT/boot mv $MNT/boot/loader.efi $MNT/efi/boot/bootia64.efi umount $MNT mdconfig -d -u $md From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 08:12:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39B66106566B; Mon, 28 Nov 2011 08:12:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2869E8FC17; Mon, 28 Nov 2011 08:12:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAS8CcZ3080463; Mon, 28 Nov 2011 08:12:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAS8CcaJ080461; Mon, 28 Nov 2011 08:12:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111280812.pAS8CcaJ080461@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Nov 2011 08:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228051 - stable/9/sbin/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 08:12:38 -0000 Author: glebius Date: Mon Nov 28 08:12:37 2011 New Revision: 228051 URL: http://svn.freebsd.org/changeset/base/228051 Log: MFhead r227901: Fix parsing of redirect_addr argument. PR: kern/162739 Approved by: re (kib) Modified: stable/9/sbin/ipfw/nat.c Directory Properties: stable/9/sbin/ipfw/ (props changed) Modified: stable/9/sbin/ipfw/nat.c ============================================================================== --- stable/9/sbin/ipfw/nat.c Mon Nov 28 08:10:12 2011 (r228050) +++ stable/9/sbin/ipfw/nat.c Mon Nov 28 08:12:37 2011 (r228051) @@ -345,11 +345,12 @@ setup_redir_addr(char *buf, int *ac, cha space = sizeof(struct cfg_redir); /* Extract local address. */ - if ((sep = strtok(**av, ",")) != NULL) { + if (strchr(**av, ',') != NULL) { struct cfg_spool *spool; /* Setup LSNAT server pool. */ r->laddr.s_addr = INADDR_NONE; + sep = strtok(**av, ","); while (sep != NULL) { spool = (struct cfg_spool *)buf; space += sizeof(struct cfg_spool); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 08:16:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76590106564A; Mon, 28 Nov 2011 08:16:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64FFB8FC23; Mon, 28 Nov 2011 08:16:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAS8G0t1080682; Mon, 28 Nov 2011 08:16:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAS8G0TG080680; Mon, 28 Nov 2011 08:16:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111280816.pAS8G0TG080680@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 28 Nov 2011 08:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228053 - stable/8/sbin/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 08:16:00 -0000 Author: glebius Date: Mon Nov 28 08:16:00 2011 New Revision: 228053 URL: http://svn.freebsd.org/changeset/base/228053 Log: MFhead r227901: Fix parsing of redirect_addr argument. PR: kern/162739 Modified: stable/8/sbin/ipfw/nat.c Directory Properties: stable/8/sbin/ipfw/ (props changed) Modified: stable/8/sbin/ipfw/nat.c ============================================================================== --- stable/8/sbin/ipfw/nat.c Mon Nov 28 08:14:59 2011 (r228052) +++ stable/8/sbin/ipfw/nat.c Mon Nov 28 08:16:00 2011 (r228053) @@ -345,11 +345,12 @@ setup_redir_addr(char *buf, int *ac, cha space = sizeof(struct cfg_redir); /* Extract local address. */ - if ((sep = strtok(**av, ",")) != NULL) { + if (strchr(**av, ',') != NULL) { struct cfg_spool *spool; /* Setup LSNAT server pool. */ r->laddr.s_addr = INADDR_NONE; + sep = strtok(**av, ","); while (sep != NULL) { spool = (struct cfg_spool *)buf; space += sizeof(struct cfg_spool); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 11:10:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD4D106564A; Mon, 28 Nov 2011 11:10:13 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3D1C8FC12; Mon, 28 Nov 2011 11:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASBAClR088056; Mon, 28 Nov 2011 11:10:12 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASBACYh088054; Mon, 28 Nov 2011 11:10:12 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111281110.pASBACYh088054@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 28 Nov 2011 11:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228058 - stable/9/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 11:10:13 -0000 Author: lstewart Date: Mon Nov 28 11:10:12 2011 New Revision: 228058 URL: http://svn.freebsd.org/changeset/base/228058 Log: Fast track MFC r228016: Plug a TCP reassembly UMA zone leak introduced in r226228 by only using the backup stack queue entry when the zone is exhausted, otherwise we leak a zone allocation each time we plug a hole in the reassembly queue. Reported by: many on freebsd-stable@ (thread: "TCP Reassembly Issues") Tested by: many on freebsd-stable@ (thread: "TCP Reassembly Issues") Reviewed by: bz (very brief sanity check) Approved by: re (kib) Modified: stable/9/sys/netinet/tcp_reass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_reass.c ============================================================================== --- stable/9/sys/netinet/tcp_reass.c Mon Nov 28 10:01:36 2011 (r228057) +++ stable/9/sys/netinet/tcp_reass.c Mon Nov 28 11:10:12 2011 (r228058) @@ -233,23 +233,28 @@ tcp_reass(struct tcpcb *tp, struct tcphd * when the zone is exhausted. Otherwise we may get stuck. */ te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); - if (te == NULL && th->th_seq != tp->rcv_nxt) { - TCPSTAT_INC(tcps_rcvmemdrop); - m_freem(m); - *tlenp = 0; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: global zone limit reached, " - "segment dropped\n", s, __func__); - free(s, M_TCPLOG); - } - return (0); - } else if (th->th_seq == tp->rcv_nxt) { - bzero(&tqs, sizeof(struct tseg_qent)); - te = &tqs; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { - log(LOG_DEBUG, "%s; %s: global zone limit reached, " - "using stack for missing segment\n", s, __func__); - free(s, M_TCPLOG); + if (te == NULL) { + if (th->th_seq != tp->rcv_nxt) { + TCPSTAT_INC(tcps_rcvmemdrop); + m_freem(m); + *tlenp = 0; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, "%s; %s: global zone limit " + "reached, segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } + return (0); + } else { + bzero(&tqs, sizeof(struct tseg_qent)); + te = &tqs; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, + "%s; %s: global zone limit reached, using " + "stack for missing segment\n", s, __func__); + free(s, M_TCPLOG); + } } } tp->t_segqlen++; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 14:36:07 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7F11065670; Mon, 28 Nov 2011 14:36:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 687C98FC16; Mon, 28 Nov 2011 14:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASEa7Bg095240; Mon, 28 Nov 2011 14:36:07 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASEa69L095237; Mon, 28 Nov 2011 14:36:06 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201111281436.pASEa69L095237@svn.freebsd.org> From: Robert Watson Date: Mon, 28 Nov 2011 14:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228069 - stable/9/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 14:36:07 -0000 Author: rwatson Date: Mon Nov 28 14:36:06 2011 New Revision: 228069 URL: http://svn.freebsd.org/changeset/base/228069 Log: Merge r228039 from head to stable/9: Add an introductory Capsicum man page providing a high-level description of its mechanisms, pointing at other pertinent man pages, and cautioning about the experimental status of Capsicum in FreeBSD. Sponsored by: Google, Inc. Approved by: re (kib) Added: stable/9/share/man/man4/capsicum.4 - copied unchanged from r228039, head/share/man/man4/capsicum.4 Modified: stable/9/share/man/man4/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Nov 28 14:23:09 2011 (r228068) +++ stable/9/share/man/man4/Makefile Mon Nov 28 14:36:06 2011 (r228069) @@ -68,6 +68,7 @@ MAN= aac.4 \ bt.4 \ bwi.4 \ bwn.4 \ + capsicum.4 \ cardbus.4 \ carp.4 \ cas.4 \ Copied: stable/9/share/man/man4/capsicum.4 (from r228039, head/share/man/man4/capsicum.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/capsicum.4 Mon Nov 28 14:36:06 2011 (r228069, copy of r228039, head/share/man/man4/capsicum.4) @@ -0,0 +1,120 @@ +.\" +.\" Copyright (c) 2011 Robert N. M. Watson +.\" Copyright (c) 2011 Jonathan Anderson +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 20, 2011 +.Dt CAPSICUM 4 +.Os +.Sh NAME +.Nm Capsicum +.Nd lightweight OS capability and sandbox framework +.Sh SYNOPSIS +.Cd "options CAPABILITY_MODE" +.Cd "options CAPABILITIES" +.Cd "options PROCDESC" +.Sh DESCRIPTION +.Nm +is a lightweight OS capability and sandbox framework implementing a hybrid +capability system model. +.Nm +can be used for application and library compartmentalisation, the +decomposition of larger bodies of software into isolated (sandboxed) +components in order to implement security policies and limit the impact of +software vulnerabilities. +.Pp +.Nm +provides two core kernel primitives: +.Bl -tag -width indent +.It capability mode +A process mode, entered by invoking +.Xr cap_enter 2 , +in which access to global OS namespaces (such as the file system and PID +namespaces) is restricted; only explicitly delegated rights, referenced by +memory mappings or file descriptors, may be used. +Once set, the flag is inherited by future children proceses, and may not be +cleared. +.It capabilities +File descriptors that wrap other file descriptors, masking operations that can +be called on them; for example, a file descriptor returned by +.Xr open 2 +may be refined using +.Xr cap_new 2 +so that only +.Xr read 2 +and +.Xr write 2 +can be called, but not +.Xr fchmod 2 . +.El +.Pp +In some cases, +.Nm +requires use of alternatives to traditional POSIX APIs in order to name +objects using capabilities rather than global namespaces: +.Bl -tag -width indent +.It process descriptors +File descriptors representing processes, allowing parent processes to manage +child processes without requiring access to the PID namespace. +.It anonymous shared memory +An extension to the POSIX shared memory API to support anonymous swap objects +associated with file descriptors. +.El +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr cap_getmode 2 , +.Xr cap_getrights 2 , +.Xr cap_new 2 , +.Xr fchmod 2 , +.Xr open 2 , +.Xr pdfork 2 , +.Xr pdgetpid 2 , +.Xr pdkill 2 , +.Xr pdwait4 2 , +.Xr read 2 , +.Xr shm_open 2 , +.Xr write 2 +.Sh HISTORY +.Nm +first appeared in +.Fx 9.0 , +and was developed at the University of Cambridge. +.Sh AUTHORS +.Nm +was developed by +.An -nosplit +.An "Robert Watson" Aq rwatson@FreeBSD.org +and +.An "Jonathan Anderson" Aq jonathan@FreeBSD.org +at the University of Cambridge, and +.An "Ben Laurie" Aq benl@FreeBSD.org +and +.An "Kris Kennaway" Aq kris@FreeBSD.org +at Google, Inc. +.Sh BUGS +.Nm +is considered experimental in +.Fx . From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 14:39:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00744106564A; Mon, 28 Nov 2011 14:39:57 +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 E39988FC14; Mon, 28 Nov 2011 14:39:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASEduuP095406; Mon, 28 Nov 2011 14:39:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASEduEI095403; Mon, 28 Nov 2011 14:39:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201111281439.pASEduEI095403@svn.freebsd.org> From: Robert Watson Date: Mon, 28 Nov 2011 14:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228070 - stable/9/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 14:39:57 -0000 Author: rwatson Date: Mon Nov 28 14:39:56 2011 New Revision: 228070 URL: http://svn.freebsd.org/changeset/base/228070 Log: Merge r228040 from head to stable/9: Cross-reference capsicum.4 from cap_enter.2 and cap_new.2. Sponsored by: Google, Inc. Approved by: re (kib) Modified: stable/9/lib/libc/sys/cap_enter.2 stable/9/lib/libc/sys/cap_new.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) Modified: stable/9/lib/libc/sys/cap_enter.2 ============================================================================== --- stable/9/lib/libc/sys/cap_enter.2 Mon Nov 28 14:36:06 2011 (r228069) +++ stable/9/lib/libc/sys/cap_enter.2 Mon Nov 28 14:39:56 2011 (r228070) @@ -89,7 +89,8 @@ acquired rights as possible. .Rv -std cap_enter cap_getmode .Sh SEE ALSO .Xr cap_new 2 , -.Xr fexecve 2 +.Xr fexecve 2 , +.Xr capsicum 4 .Sh HISTORY Support for capabilities and capabilities mode was developed as part of the .Tn TrustedBSD Modified: stable/9/lib/libc/sys/cap_new.2 ============================================================================== --- stable/9/lib/libc/sys/cap_new.2 Mon Nov 28 14:36:06 2011 (r228069) +++ stable/9/lib/libc/sys/cap_new.2 Mon Nov 28 14:39:56 2011 (r228070) @@ -456,6 +456,7 @@ argument is not a capability. .Xr sem_post 3 , .Xr sem_trywait 3 , .Xr sem_wait 3 , +.Xr capsicum 4 , .Xr snp 4 .Sh HISTORY Support for capabilities and capabilities mode was developed as part of the From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 15:09:31 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D5D1065673; Mon, 28 Nov 2011 15:09:31 +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 C31F68FC08; Mon, 28 Nov 2011 15:09:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASF9VaK096494; Mon, 28 Nov 2011 15:09:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASF9VYa096492; Mon, 28 Nov 2011 15:09:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201111281509.pASF9VYa096492@svn.freebsd.org> From: Robert Watson Date: Mon, 28 Nov 2011 15:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228073 - stable/9/cddl/lib/drti X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 15:09:32 -0000 Author: rwatson Date: Mon Nov 28 15:09:31 2011 New Revision: 228073 URL: http://svn.freebsd.org/changeset/base/228073 Log: Merge r228057 from head to stable/9: Change the Makefile in cddl/lib/drti to use bsd.lib.mk instead of bsd.prog.mk -- we need to compile PIC, which requires a library build. With this change, USDT (userspace DTrace probes) work from within shared libraries. PR: kern/159046 Submitted by: Alex Samorukov Comments by: Scott Lystig Fritchie Approved by: re (xxx) Modified: stable/9/cddl/lib/drti/Makefile Directory Properties: stable/9/cddl/lib/drti/ (props changed) Modified: stable/9/cddl/lib/drti/Makefile ============================================================================== --- stable/9/cddl/lib/drti/Makefile Mon Nov 28 14:58:51 2011 (r228072) +++ stable/9/cddl/lib/drti/Makefile Mon Nov 28 15:09:31 2011 (r228073) @@ -18,4 +18,4 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -DPIC ${PICFLAG} -.include +.include From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 15:34:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41CFA106566C; Mon, 28 Nov 2011 15:34:23 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id E7C298FC13; Mon, 28 Nov 2011 15:34:22 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 8C629E3F07C; Mon, 28 Nov 2011 16:16:23 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VgRkNUgf5nMx; Mon, 28 Nov 2011 16:16:16 +0100 (CET) Received: from goofy01.vnodelab.local (unknown [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id C7B5EE3F079; Mon, 28 Nov 2011 16:16:15 +0100 (CET) Date: Mon, 28 Nov 2011 16:16:14 +0100 From: Joel Dahl To: Robert Watson Message-ID: <20111128151613.GG23987@goofy01.vnodelab.local> References: <201111281509.pASF9VYa096492@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111281509.pASF9VYa096492@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r228073 - stable/9/cddl/lib/drti X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 15:34:23 -0000 On 28-11-2011 15:09, Robert Watson wrote: > Author: rwatson > Date: Mon Nov 28 15:09:31 2011 > New Revision: 228073 > URL: http://svn.freebsd.org/changeset/base/228073 > > Log: > Merge r228057 from head to stable/9: > > Change the Makefile in cddl/lib/drti to use bsd.lib.mk instead of > bsd.prog.mk -- we need to compile PIC, which requires a library build. > With this change, USDT (userspace DTrace probes) work from within > shared libraries. > > PR: kern/159046 > Submitted by: Alex Samorukov > Comments by: Scott Lystig Fritchie > > Approved by: re (xxx) xxx ? :-) -- Joel From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 15:36:11 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11479106564A; Mon, 28 Nov 2011 15:36:11 +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 E0B088FC1C; Mon, 28 Nov 2011 15:36:10 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7CF4546B0A; Mon, 28 Nov 2011 10:36:10 -0500 (EST) Date: Mon, 28 Nov 2011 15:36:10 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Joel Dahl In-Reply-To: <20111128151613.GG23987@goofy01.vnodelab.local> Message-ID: References: <201111281509.pASF9VYa096492@svn.freebsd.org> <20111128151613.GG23987@goofy01.vnodelab.local> 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-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r228073 - stable/9/cddl/lib/drti X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 15:36:11 -0000 On Mon, 28 Nov 2011, Joel Dahl wrote: >> Log: >> Merge r228057 from head to stable/9: >> >> Change the Makefile in cddl/lib/drti to use bsd.lib.mk instead of >> bsd.prog.mk -- we need to compile PIC, which requires a library build. >> With this change, USDT (userspace DTrace probes) work from within >> shared libraries. >> >> PR: kern/159046 >> Submitted by: Alex Samorukov >> Comments by: Scott Lystig Fritchie >> >> Approved by: re (xxx) > > xxx ? :-) Sigh -- what I get for rushing before a meeting! This commit was approved by re (bz). He was worried there would be an extra 'x' due to his username being two rather than three characters, and instead there were three extra x's! Robert From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 19:53:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1207B106566B; Mon, 28 Nov 2011 19:53:17 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB37D8FC08; Mon, 28 Nov 2011 19:53:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASJrGrT006355; Mon, 28 Nov 2011 19:53:16 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASJrG1Y006350; Mon, 28 Nov 2011 19:53:16 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201111281953.pASJrG1Y006350@svn.freebsd.org> From: Qing Li Date: Mon, 28 Nov 2011 19:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228092 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 19:53:17 -0000 Author: qingli Date: Mon Nov 28 19:53:16 2011 New Revision: 228092 URL: http://svn.freebsd.org/changeset/base/228092 Log: MFC 227460 A default route learned from the RAs could be deleted manually after its installation. This removal may be accidental and can prevent the default route from being installed in the future if the associated default router has the best preference. The cause is the lack of status update in the default router on the state of its route installation in the kernel FIB. This patch fixes the described problem. Reviewed by: hrs, discussed with hrs Modified: stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6.h stable/8/sys/netinet6/nd6_rtr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Mon Nov 28 19:48:04 2011 (r228091) +++ stable/8/sys/netinet6/in6.c Mon Nov 28 19:53:16 2011 (r228092) @@ -1802,7 +1802,7 @@ in6_ifinit(struct ifnet *ifp, struct in6 struct sockaddr_in6 mask, addr; IF_AFDATA_LOCK(ifp); - ia->ia_ifa.ifa_rtrequest = NULL; + ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; /* XXX QL * we need to report rt_newaddrmsg Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Mon Nov 28 19:48:04 2011 (r228091) +++ stable/8/sys/netinet6/nd6.c Mon Nov 28 19:53:16 2011 (r228092) @@ -1170,6 +1170,46 @@ done: } +/* + * Rejuvenate this function for routing operations related + * processing. + */ +void +nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) +{ + struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct nd_defrouter *dr; + struct ifnet *ifp = rt->rt_ifp; + + RT_LOCK_ASSERT(rt); + + switch (req) { + case RTM_ADD: + break; + + case RTM_DELETE: + if (!ifp) + return; + /* + * Only indirect routes are interesting. + */ + if ((rt->rt_flags & RTF_GATEWAY) == 0) + return; + /* + * check for default route + */ + if (IN6_ARE_ADDR_EQUAL(&in6addr_any, + &SIN6(rt_key(rt))->sin6_addr)) { + + dr = defrouter_lookup(&gateway->sin6_addr, ifp); + if (dr != NULL) + dr->installed = 0; + } + break; + } +} + + int nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) { Modified: stable/8/sys/netinet6/nd6.h ============================================================================== --- stable/8/sys/netinet6/nd6.h Mon Nov 28 19:48:04 2011 (r228091) +++ stable/8/sys/netinet6/nd6.h Mon Nov 28 19:53:16 2011 (r228092) @@ -404,6 +404,7 @@ void nd6_purge __P((struct ifnet *)); void nd6_nud_hint __P((struct rtentry *, struct in6_addr *, int)); int nd6_resolve __P((struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *)); +void nd6_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *)); int nd6_ioctl __P((u_long, caddr_t, struct ifnet *)); struct llentry *nd6_cache_lladdr __P((struct ifnet *, struct in6_addr *, char *, int, int, int)); Modified: stable/8/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/8/sys/netinet6/nd6_rtr.c Mon Nov 28 19:48:04 2011 (r228091) +++ stable/8/sys/netinet6/nd6_rtr.c Mon Nov 28 19:53:16 2011 (r228092) @@ -755,9 +755,10 @@ defrtrlist_update(struct nd_defrouter *n /* * If the preference does not change, there's no need - * to sort the entries. + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. */ - if (rtpref(new) == oldpref) { + if (dr->installed && rtpref(new) == oldpref) { splx(s); return (dr); } From owner-svn-src-stable@FreeBSD.ORG Mon Nov 28 20:28:24 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2CF6106566C; Mon, 28 Nov 2011 20:28:24 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDF7B8FC13; Mon, 28 Nov 2011 20:28:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pASKSOsH007870; Mon, 28 Nov 2011 20:28:24 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pASKSOFw007825; Mon, 28 Nov 2011 20:28:24 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201111282028.pASKSOFw007825@svn.freebsd.org> From: Philip Paeps Date: Mon, 28 Nov 2011 20:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228100 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/sfxge sys/dev/sfxge/common sys/modules sys/modules/sfxge X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 20:28:24 -0000 Author: philip Date: Mon Nov 28 20:28:23 2011 New Revision: 228100 URL: http://svn.freebsd.org/changeset/base/228100 Log: MFC r227569,227633,227640-227641,227662,227699-227700,228077-228078,228085 Add the sfxge(4) driver providing support for 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side Scaling (RSS) using MSI-X interrupts. This work was sponsored by Solarflare Communications, Inc. My sincere thanks to Ben Hutchings for doing a lot of the hard work! Sponsored by: Solarflare Communications, Inc. Approved by: re (bz) Added: stable/9/share/man/man4/sfxge.4 - copied, changed from r227569, head/share/man/man4/sfxge.4 stable/9/sys/dev/sfxge/ - copied from r227569, head/sys/dev/sfxge/ stable/9/sys/modules/sfxge/ - copied from r227569, head/sys/modules/sfxge/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files.amd64 stable/9/sys/dev/sfxge/common/efsys.h stable/9/sys/dev/sfxge/common/efx.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_bootcfg.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_ev.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_filter.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_impl.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_intr.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_mac.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_mcdi.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_mcdi.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_mon.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_nic.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_nvram.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_phy.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_port.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_regs.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_regs_ef10.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_regs_mcdi.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_regs_pci.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_rx.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_sram.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_tx.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_types.h (contents, props changed) stable/9/sys/dev/sfxge/common/efx_vpd.c (contents, props changed) stable/9/sys/dev/sfxge/common/efx_wol.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_flash.h (contents, props changed) stable/9/sys/dev/sfxge/common/siena_impl.h (contents, props changed) stable/9/sys/dev/sfxge/common/siena_mac.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_mon.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_nic.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_nvram.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_phy.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_sram.c (contents, props changed) stable/9/sys/dev/sfxge/common/siena_vpd.c (contents, props changed) stable/9/sys/dev/sfxge/sfxge.h stable/9/sys/dev/sfxge/sfxge_dma.c stable/9/sys/dev/sfxge/sfxge_intr.c stable/9/sys/dev/sfxge/sfxge_port.c stable/9/sys/dev/sfxge/sfxge_tx.c stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Nov 28 20:16:55 2011 (r228099) +++ stable/9/share/man/man4/Makefile Mon Nov 28 20:28:23 2011 (r228100) @@ -378,6 +378,7 @@ MAN= aac.4 \ send.4 \ ses.4 \ sf.4 \ + ${_sfxge.4} \ sge.4 \ si.4 \ siba.4 \ @@ -717,6 +718,7 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "amd64" _qlxgb.4= qlxgb.4 +_sfxge.4= sfxge.4 .endif .if ${MACHINE_CPUARCH} == "powerpc" Copied and modified: stable/9/share/man/man4/sfxge.4 (from r227569, head/share/man/man4/sfxge.4) ============================================================================== --- head/share/man/man4/sfxge.4 Wed Nov 16 17:11:13 2011 (r227569, copy source) +++ stable/9/share/man/man4/sfxge.4 Mon Nov 28 20:28:23 2011 (r228100) @@ -48,25 +48,29 @@ sfxge_load="YES" The .Nm driver provides support for 10Gb Ethernet adapters based on -Solarflare SFC9000 family controllers. The driver supports jumbo +Solarflare SFC9000 family controllers. +The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side Scaling (RSS) using MSI-X interrupts. .Pp The driver allocates 1 receive queue, transmit queue, event queue and -IRQ per CPU up to a maximum of 64. IRQ affinities should be spread -out using +IRQ per CPU up to a maximum of 64. +IRQ affinities should be spread out using .Xr cpuset 8 . Interrupt moderation may be controlled through the sysctl -dev.sfxge.\fIindex\fR.int_mod (units are microseconds). +.Va dev.sfxge.%d.int_mod +(units are microseconds). .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Pp A large number of MAC, PHY and data path statistics are available -under the sysctl dev.sfxge.\fIindex\fR.stats. The adapter's VPD +under the sysctl +.Va dev.sfxge.%d.stats . +The adapter's VPD fields including its serial number are available under the sysctl -dev.sfxge.\fIindex\fR.vpd. +.Va dev.sfxge.%d.vpd . .Sh HARDWARE The .Nm Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Mon Nov 28 20:16:55 2011 (r228099) +++ stable/9/sys/amd64/conf/NOTES Mon Nov 28 20:28:23 2011 (r228100) @@ -294,6 +294,7 @@ options DRM_DEBUG # Include debug print # Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # nve: nVidia nForce MCP on-board Ethernet Networking +# sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters # wpi: Intel 3945ABG Wireless LAN controller # Requires the wpi firmware module @@ -307,6 +308,7 @@ device iwn device mwl device nfe device nve +device sfxge device wpi # IEEE 802.11 adapter firmware modules Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Mon Nov 28 20:16:55 2011 (r228099) +++ stable/9/sys/conf/files.amd64 Mon Nov 28 20:28:23 2011 (r228100) @@ -214,6 +214,37 @@ dev/qlxgb/qla_ioctl.c optional qlxgb pc dev/qlxgb/qla_isr.c optional qlxgb pci dev/qlxgb/qla_misc.c optional qlxgb pci dev/qlxgb/qla_os.c optional qlxgb pci +dev/sfxge/common/efx_bootcfg.c optional sfxge inet pci +dev/sfxge/common/efx_ev.c optional sfxge inet pci +dev/sfxge/common/efx_filter.c optional sfxge inet pci +dev/sfxge/common/efx_intr.c optional sfxge inet pci +dev/sfxge/common/efx_mac.c optional sfxge inet pci +dev/sfxge/common/efx_mcdi.c optional sfxge inet pci +dev/sfxge/common/efx_mon.c optional sfxge inet pci +dev/sfxge/common/efx_nic.c optional sfxge inet pci +dev/sfxge/common/efx_nvram.c optional sfxge inet pci +dev/sfxge/common/efx_phy.c optional sfxge inet pci +dev/sfxge/common/efx_port.c optional sfxge inet pci +dev/sfxge/common/efx_rx.c optional sfxge inet pci +dev/sfxge/common/efx_sram.c optional sfxge inet pci +dev/sfxge/common/efx_tx.c optional sfxge inet pci +dev/sfxge/common/efx_vpd.c optional sfxge inet pci +dev/sfxge/common/efx_wol.c optional sfxge inet pci +dev/sfxge/common/siena_mac.c optional sfxge inet pci +dev/sfxge/common/siena_mon.c optional sfxge inet pci +dev/sfxge/common/siena_nic.c optional sfxge inet pci +dev/sfxge/common/siena_nvram.c optional sfxge inet pci +dev/sfxge/common/siena_phy.c optional sfxge inet pci +dev/sfxge/common/siena_sram.c optional sfxge inet pci +dev/sfxge/common/siena_vpd.c optional sfxge inet pci +dev/sfxge/sfxge.c optional sfxge inet pci +dev/sfxge/sfxge_dma.c optional sfxge inet pci +dev/sfxge/sfxge_ev.c optional sfxge inet pci +dev/sfxge/sfxge_intr.c optional sfxge inet pci +dev/sfxge/sfxge_mcdi.c optional sfxge inet pci +dev/sfxge/sfxge_port.c optional sfxge inet pci +dev/sfxge/sfxge_rx.c optional sfxge inet pci +dev/sfxge/sfxge_tx.c optional sfxge inet pci dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa dev/sio/sio_pccard.c optional sio pccard Modified: stable/9/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efsys.h Mon Nov 28 20:28:23 2011 (r228100) @@ -25,14 +25,13 @@ * 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 _SYS_EFSYS_H #define _SYS_EFSYS_H -#include -__FBSDID("$FreeBSD$"); - #ifdef __cplusplus extern "C" { #endif @@ -97,10 +96,11 @@ extern "C" { MALLOC_DECLARE(M_SFXGE); /* Machine dependend prefetch wrappers */ -#if defined(__i386) || defined(__amd64) +#if defined(__i386__) || defined(__amd64__) static __inline void prefetch_read_many(void *addr) { + __asm__( "prefetcht0 (%0)" : @@ -110,11 +110,44 @@ prefetch_read_many(void *addr) static __inline void prefetch_read_once(void *addr) { + __asm__( "prefetchnta (%0)" : : "r" (addr)); } +#elif defined(__sparc64__) +static __inline void +prefetch_read_many(void *addr) +{ + + __asm__( + "prefetch [%0], 0" + : + : "r" (addr)); +} + +static __inline void +prefetch_read_once(void *addr) +{ + + __asm__( + "prefetch [%0], 1" + : + : "r" (addr)); +} +#else +static __inline void +prefetch_read_many(void *addr) +{ + +} + +static __inline void +prefetch_read_once(void *addr) +{ + +} #endif #if defined(__i386__) || defined(__amd64__) Modified: stable/9/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_H Modified: stable/9/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_bootcfg.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_ev.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_filter.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_impl.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_IMPL_H Modified: stable/9/sys/dev/sfxge/common/efx_intr.c ============================================================================== --- head/sys/dev/sfxge/common/efx_intr.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_intr.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mac.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_mac.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_mcdi.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_mcdi.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_MCDI_H Modified: stable/9/sys/dev/sfxge/common/efx_mon.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mon.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_mon.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nic.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_nic.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_nvram.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_phy.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_port.c ============================================================================== --- head/sys/dev/sfxge/common/efx_port.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_port.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_regs.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_regs.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_REGS_H Modified: stable/9/sys/dev/sfxge/common/efx_regs_ef10.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_ef10.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_regs_ef10.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_EF10_REGS_H Modified: stable/9/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_mcdi.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_regs_mcdi.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,10 +21,10 @@ * 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$ */ -/*! \cidoxg_firmware_mc_cmd */ - #ifndef _SIENA_MC_DRIVER_PCOL_H #define _SIENA_MC_DRIVER_PCOL_H @@ -2783,4 +2783,3 @@ #define MC_CMD_TCM_TXQ_INIT_OUT_LEN 0 #endif /* _SIENA_MC_DRIVER_PCOL_H */ -/*! \cidoxg_end */ Modified: stable/9/sys/dev/sfxge/common/efx_regs_pci.h ============================================================================== --- head/sys/dev/sfxge/common/efx_regs_pci.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_regs_pci.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_EFX_REGS_PCI_H Modified: stable/9/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_rx.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_sram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_sram.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_sram.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_tx.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_types.h Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,8 @@ * SUCH DAMAGE. * * Ackowledgement to Fen Systems Ltd. + * + * $FreeBSD$ */ #ifndef _SYS_EFX_TYPES_H Modified: stable/9/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/efx_vpd.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_vpd.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/efx_wol.c ============================================================================== --- head/sys/dev/sfxge/common/efx_wol.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/efx_wol.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/siena_flash.h ============================================================================== --- head/sys/dev/sfxge/common/siena_flash.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_flash.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,9 +21,10 @@ * 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 _SYS_SIENA_FLASH_H #define _SYS_SIENA_FLASH_H Modified: stable/9/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_impl.h Mon Nov 28 20:28:23 2011 (r228100) @@ -21,6 +21,8 @@ * 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 _SYS_SIENA_IMPL_H Modified: stable/9/sys/dev/sfxge/common/siena_mac.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mac.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_mac.c Mon Nov 28 20:28:23 2011 (r228100) @@ -22,6 +22,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: stable/9/sys/dev/sfxge/common/siena_mon.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mon.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_mon.c Mon Nov 28 20:28:23 2011 (r228100) @@ -22,6 +22,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: stable/9/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_nic.c Mon Nov 28 20:28:23 2011 (r228100) @@ -22,6 +22,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: stable/9/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_nvram.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- head/sys/dev/sfxge/common/siena_phy.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_phy.c Mon Nov 28 20:28:23 2011 (r228100) @@ -22,6 +22,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: stable/9/sys/dev/sfxge/common/siena_sram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_sram.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_sram.c Mon Nov 28 20:28:23 2011 (r228100) @@ -22,6 +22,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_impl.h" Modified: stable/9/sys/dev/sfxge/common/siena_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/siena_vpd.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/common/siena_vpd.c Mon Nov 28 20:28:23 2011 (r228100) @@ -23,6 +23,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "efsys.h" #include "efx.h" #include "efx_types.h" Modified: stable/9/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/sfxge.h Mon Nov 28 20:28:23 2011 (r228100) @@ -144,7 +144,6 @@ struct sfxge_intr { int n_alloc; int type; efsys_mem_t status; - uint64_t mask; uint32_t zero_count; }; Modified: stable/9/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/sfxge_dma.c Mon Nov 28 20:28:23 2011 (r228100) @@ -134,8 +134,8 @@ sfxge_dma_alloc(struct sfxge_softc *sc, /* Create the child DMA tag. */ if (bus_dma_tag_create(sc->parent_dma_tag, PAGE_SIZE, 0, - 0x3FFFFFFFFFFFULL, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, - NULL, NULL, &esmp->esm_tag) != 0) { + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, len, 1, len, 0, NULL, NULL, &esmp->esm_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); return (ENOMEM); } Modified: stable/9/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/sfxge_intr.c Mon Nov 28 20:28:23 2011 (r228100) @@ -65,15 +65,9 @@ sfxge_intr_line_filter(void *arg) KASSERT(intr->type == EFX_INTR_LINE, ("intr->type != EFX_INTR_LINE")); - if (intr->state != SFXGE_INTR_STARTED && - intr->state != SFXGE_INTR_TESTING) + if (intr->state != SFXGE_INTR_STARTED) return FILTER_STRAY; - if (intr->state == SFXGE_INTR_TESTING) { - intr->mask |= 1; /* only one interrupt */ - return FILTER_HANDLED; - } - (void)efx_intr_status_line(enp, &fatal, &qmask); if (fatal) { @@ -137,21 +131,9 @@ sfxge_intr_message(void *arg) KASSERT(intr->type == EFX_INTR_MESSAGE, ("intr->type != EFX_INTR_MESSAGE")); - if (intr->state != SFXGE_INTR_STARTED && - intr->state != SFXGE_INTR_TESTING) + if (intr->state != SFXGE_INTR_STARTED) return; - if (intr->state == SFXGE_INTR_TESTING) { - uint64_t mask; - - do { - mask = intr->mask; - } while (atomic_cmpset_long(&intr->mask, mask, - mask | (1 << index)) == 0); - - return; - } - (void)efx_intr_status_message(enp, index, &fatal); if (fatal) { @@ -447,7 +429,6 @@ sfxge_intr_stop(struct sfxge_softc *sc) intr->state = SFXGE_INTR_INITIALIZED; /* Disable interrupts at the NIC */ - intr->mask = 0; efx_intr_disable(sc->enp); /* Disable interrupts at the bus */ @@ -480,13 +461,11 @@ sfxge_intr_start(struct sfxge_softc *sc) if ((rc = sfxge_intr_bus_enable(sc)) != 0) goto fail; - intr->state = SFXGE_INTR_TESTING; + intr->state = SFXGE_INTR_STARTED; /* Enable interrupts at the NIC */ efx_intr_enable(sc->enp); - intr->state = SFXGE_INTR_STARTED; - return (0); fail: Modified: stable/9/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/sfxge_port.c Mon Nov 28 20:28:23 2011 (r228100) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -219,14 +220,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ -static const int sfxge_link_speed_kbit[EFX_LINK_NMODES] = { - [EFX_LINK_10HDX] = 10000, - [EFX_LINK_10FDX] = 10000, - [EFX_LINK_100HDX] = 100000, - [EFX_LINK_100FDX] = 100000, - [EFX_LINK_1000HDX] = 1000000, - [EFX_LINK_1000FDX] = 1000000, - [EFX_LINK_10000FDX] = 10000000, +static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = { + [EFX_LINK_10HDX] = IF_Mbps(10), + [EFX_LINK_10FDX] = IF_Mbps(10), + [EFX_LINK_100HDX] = IF_Mbps(100), + [EFX_LINK_100FDX] = IF_Mbps(100), + [EFX_LINK_1000HDX] = IF_Gbps(1), + [EFX_LINK_1000FDX] = IF_Gbps(1), + [EFX_LINK_10000FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX), }; void @@ -245,7 +246,7 @@ sfxge_mac_link_update(struct sfxge_softc /* Push link state update to the OS */ link_state = (port->link_mode != EFX_LINK_DOWN ? LINK_STATE_UP : LINK_STATE_DOWN); - sc->ifnet->if_baudrate = sfxge_link_speed_kbit[port->link_mode]; + sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode]; if_link_state_change(sc->ifnet, link_state); } Modified: stable/9/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/sfxge/sfxge_tx.c Mon Nov 28 20:28:23 2011 (r228100) @@ -135,7 +135,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * /* Acquire the put list. */ putp = &stdp->std_put; - put = atomic_readandclear_long(putp); + put = atomic_readandclear_ptr(putp); mbuf = (void *)put; if (mbuf == NULL) @@ -484,7 +484,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, return ENOBUFS; mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; - } while (atomic_cmpset_long(putp, old, new) == 0); + } while (atomic_cmpset_ptr(putp, old, new) == 0); } return (0); @@ -1323,9 +1323,9 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, 0x3FFFFFFFFFFFULL, - BUS_SPACE_MAXADDR, NULL, NULL, 0x11000, - SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM; Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Mon Nov 28 20:16:55 2011 (r228099) +++ stable/9/sys/modules/Makefile Mon Nov 28 20:28:23 2011 (r228100) @@ -275,6 +275,7 @@ SUBDIR= ${_3dfx} \ sem \ send \ sf \ + ${_sfxge} \ sge \ siba_bwn \ siftr \ @@ -627,6 +628,7 @@ _rdma= rdma _s3= s3 _safe= safe _scsi_low= scsi_low +_sfxge= sfxge _smbfs= smbfs _sound= sound _speaker= speaker From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 09:59:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A02F106566B; Tue, 29 Nov 2011 09:59:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 289678FC0C; Tue, 29 Nov 2011 09:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAT9xqs9034250; Tue, 29 Nov 2011 09:59:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAT9xqnH034248; Tue, 29 Nov 2011 09:59:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111290959.pAT9xqnH034248@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Nov 2011 09:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228126 - stable/9/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 09:59:52 -0000 Author: marius Date: Tue Nov 29 09:59:51 2011 New Revision: 228126 URL: http://svn.freebsd.org/changeset/base/228126 Log: MFC: r227960 Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by OpenSolaris. One second turned out to be not enough for certain loads while 10 seconds were sufficient. Reported by: Peter Jeremy Approved by: re (bz) Modified: stable/9/sys/sparc64/pci/schizo.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/pci/schizo.c ============================================================================== --- stable/9/sys/sparc64/pci/schizo.c Tue Nov 29 08:43:04 2011 (r228125) +++ stable/9/sys/sparc64/pci/schizo.c Tue Nov 29 09:59:51 2011 (r228126) @@ -1171,7 +1171,7 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); microuptime(&cur); - end.tv_sec = 1; + end.tv_sec = 15; end.tv_usec = 0; timevaladd(&end, &cur); for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 11:24:25 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFAE11065675; Tue, 29 Nov 2011 11:24:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D66B8FC08; Tue, 29 Nov 2011 11:24:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATBOPmQ041504; Tue, 29 Nov 2011 11:24:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATBOPj7041501; Tue, 29 Nov 2011 11:24:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111291124.pATBOPj7041501@svn.freebsd.org> From: Christian Brueffer Date: Tue, 29 Nov 2011 11:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228128 - in stable/9/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 11:24:25 -0000 Author: brueffer Date: Tue Nov 29 11:24:25 2011 New Revision: 228128 URL: http://svn.freebsd.org/changeset/base/228128 Log: MFC: r227666 Add sfxge(4) to the hardware notes. Approved by: re (bz) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/9/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 09:59:55 2011 (r228127) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 11:24:25 2011 (r228128) @@ -964,6 +964,8 @@ &hwlist.sf; + &hwlist.sfxge; + &hwlist.sge; &hwlist.sis; Modified: stable/9/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/9/release/doc/share/misc/dev.archlist.txt Tue Nov 29 09:59:55 2011 (r228127) +++ stable/9/release/doc/share/misc/dev.archlist.txt Tue Nov 29 11:24:25 2011 (r228128) @@ -108,6 +108,7 @@ rum i386,amd64 run i386,amd64 safe i386,pc98,amd64 sbp i386,sparc64,ia64,amd64 +sfgxe amd64 sn i386,amd64 snc pc98 snd_ad1816 i386,amd64 From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 12:38:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D913106564A; Tue, 29 Nov 2011 12:38:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE128FC16; Tue, 29 Nov 2011 12:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATCcE37043974; Tue, 29 Nov 2011 12:38:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATCcEEq043972; Tue, 29 Nov 2011 12:38:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111291238.pATCcEEq043972@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 29 Nov 2011 12:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228130 - stable/9/share/examples/cvsup X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 12:38:14 -0000 Author: pluknet Date: Tue Nov 29 12:38:13 2011 New Revision: 228130 URL: http://svn.freebsd.org/changeset/base/228130 Log: MFC r225757,r225764: Update the default cvs tag for RELENG_9 by merging the following revisions: r225757 (by kensmith, partial): Shift head from 9.0-CURRENT to 10.0-CURRENT in preparation for releasing it from the 9.0-RELEASE release cycle code freeze. r225764 (by kensmith): Forgot to add "RELENG_8" to list of CVS tags. Reported by: Milan Obuch (cvs tag) Approved by: re (kib) Modified: stable/9/share/examples/cvsup/stable-supfile Directory Properties: stable/9/share/examples/ (props changed) Modified: stable/9/share/examples/cvsup/stable-supfile ============================================================================== --- stable/9/share/examples/cvsup/stable-supfile Tue Nov 29 11:25:00 2011 (r228129) +++ stable/9/share/examples/cvsup/stable-supfile Tue Nov 29 12:38:13 2011 (r228130) @@ -66,11 +66,11 @@ *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr -# The following line is for 8-stable. If you want 7-stable, 6-stable, -# 5-stable, 4-stable, 3-stable, or 2.2-stable, change to "RELENG_7", -# "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or "RELENG_2_2" -# respectively. -*default release=cvs tag=RELENG_8 +# The following line is for 9-stable. If you want 8-stable, 7-stable, +# 6-stable, 5-stable, 4-stable, 3-stable, or 2.2-stable, change to "RELENG_8", +# "RELENG_7", "RELENG_6", "RELENG_5", "RELENG_4", "RELENG_3", or +# "RELENG_2_2" respectively. +*default release=cvs tag=RELENG_9 *default delete use-rel-suffix # If you seem to be limited by CPU rather than network or disk bandwidth, try From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 14:18:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B321065670; Tue, 29 Nov 2011 14:18:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FBA78FC19; Tue, 29 Nov 2011 14:18:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATEI5Vo048519; Tue, 29 Nov 2011 14:18:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATEI5iu048517; Tue, 29 Nov 2011 14:18:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111291418.pATEI5iu048517@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Nov 2011 14:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228134 - stable/9/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 14:18:06 -0000 Author: marius Date: Tue Nov 29 14:18:05 2011 New Revision: 228134 URL: http://svn.freebsd.org/changeset/base/228134 Log: MFC: r228028 - Based on a report on sparc64@ move V245 to the list of known working machines. - Mention that V480 with broken centerplanes have a chance of working with the WAR in the upcoming 8.3-RELEASE and 9.0-RELEASE. Approved by: re (kib) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 13:07:32 2011 (r228133) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 14:18:05 2011 (r228134) @@ -593,6 +593,10 @@ + &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) + + + &sun.fire; V250 @@ -603,7 +607,8 @@ &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for - which support first appeared in 7.3-RELEASE and 8.1-RELEASE) + which support first appeared in 7.3-RELEASE and 8.1-RELEASE, + other centerplanes might work beginning with 8.3-RELEASE and 9.0-RELEASE) @@ -629,10 +634,6 @@ - &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) - - - &sun.fire; V490 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, non-mixed &ultrasparc; IV/IV+ CPU-configurations only) From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 18:21:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF14106566C; Tue, 29 Nov 2011 18:21:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C91B8FC14; Tue, 29 Nov 2011 18:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATILZru060924; Tue, 29 Nov 2011 18:21:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATILZFj060922; Tue, 29 Nov 2011 18:21:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111291821.pATILZFj060922@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 29 Nov 2011 18:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228138 - stable/9/share/examples/cvsup X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 18:21:35 -0000 Author: pluknet Date: Tue Nov 29 18:21:34 2011 New Revision: 228138 URL: http://svn.freebsd.org/changeset/base/228138 Log: Update for RELENG_9. This is a direct commit. Approved by: re (kib) Modified: stable/9/share/examples/cvsup/standard-supfile Modified: stable/9/share/examples/cvsup/standard-supfile ============================================================================== --- stable/9/share/examples/cvsup/standard-supfile Tue Nov 29 16:34:44 2011 (r228137) +++ stable/9/share/examples/cvsup/standard-supfile Tue Nov 29 18:21:34 2011 (r228138) @@ -49,7 +49,7 @@ *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr -*default release=cvs tag=. +*default release=cvs tag=RELENG_9 *default delete use-rel-suffix # If you seem to be limited by CPU rather than network or disk bandwidth, try From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 19:45:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81E71065670; Tue, 29 Nov 2011 19:45:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5A808FC12; Tue, 29 Nov 2011 19:45:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATJjw9p064038; Tue, 29 Nov 2011 19:45:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATJjwkJ064036; Tue, 29 Nov 2011 19:45:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111291945.pATJjwkJ064036@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Nov 2011 19:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228142 - stable/8/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 19:45:58 -0000 Author: marius Date: Tue Nov 29 19:45:58 2011 New Revision: 228142 URL: http://svn.freebsd.org/changeset/base/228142 Log: MFC: r228028 - Based on a report on sparc64@ move V245 to the list of known working machines. - Mention that V480 with broken centerplanes have a chance of working with the WAR in the upcoming 8.3-RELEASE and 9.0-RELEASE. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Directory Properties: stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 19:13:01 2011 (r228141) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Nov 29 19:45:58 2011 (r228142) @@ -540,6 +540,10 @@ + &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) + + + &sun.fire; V250 @@ -550,7 +554,8 @@ &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for - which support first appeared in 7.3-RELEASE and 8.1-RELEASE) + which support first appeared in 7.3-RELEASE and 8.1-RELEASE, + other centerplanes might work beginning with 8.3-RELEASE and 9.0-RELEASE) @@ -576,10 +581,6 @@ - &sun.fire; V245 (support first appeared in 7.3-RELEASE and 8.1-RELEASE) - - - &sun.fire; V490 (support first appeared in 7.4-RELEASE and 8.1-RELEASE, non-mixed &ultrasparc; IV/IV+ CPU-configurations only) From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 19:49:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60561065670; Tue, 29 Nov 2011 19:49:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B40A88FC08; Tue, 29 Nov 2011 19:49:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATJn9XW064274; Tue, 29 Nov 2011 19:49:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATJn9oO064272; Tue, 29 Nov 2011 19:49:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111291949.pATJn9oO064272@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Nov 2011 19:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228145 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 19:49:09 -0000 Author: marius Date: Tue Nov 29 19:49:09 2011 New Revision: 228145 URL: http://svn.freebsd.org/changeset/base/228145 Log: MFC: r227960 Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by OpenSolaris. One second turned out to be not enough for certain loads while 10 seconds were sufficient. Reported by: Peter Jeremy Modified: stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Tue Nov 29 19:47:11 2011 (r228144) +++ stable/8/sys/sparc64/pci/schizo.c Tue Nov 29 19:49:09 2011 (r228145) @@ -1171,7 +1171,7 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); microuptime(&cur); - end.tv_sec = 1; + end.tv_sec = 15; end.tv_usec = 0; timevaladd(&end, &cur); for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, From owner-svn-src-stable@FreeBSD.ORG Tue Nov 29 19:49:12 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7F0106566B; Tue, 29 Nov 2011 19:49:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 097E78FC0A; Tue, 29 Nov 2011 19:49:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pATJnBdK064309; Tue, 29 Nov 2011 19:49:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pATJnBsS064307; Tue, 29 Nov 2011 19:49:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111291949.pATJnBsS064307@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Nov 2011 19:49:11 +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: r228146 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 19:49:12 -0000 Author: marius Date: Tue Nov 29 19:49:11 2011 New Revision: 228146 URL: http://svn.freebsd.org/changeset/base/228146 Log: MFC: r227960 Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by OpenSolaris. One second turned out to be not enough for certain loads while 10 seconds were sufficient. Reported by: Peter Jeremy Modified: stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Tue Nov 29 19:49:09 2011 (r228145) +++ stable/7/sys/sparc64/pci/schizo.c Tue Nov 29 19:49:11 2011 (r228146) @@ -1171,7 +1171,7 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus ; SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); microuptime(&cur); - end.tv_sec = 1; + end.tv_sec = 15; end.tv_usec = 0; timevaladd(&end, &cur); for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, From owner-svn-src-stable@FreeBSD.ORG Wed Nov 30 12:47:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F77C106566B; Wed, 30 Nov 2011 12:47:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8BC8FC14; Wed, 30 Nov 2011 12:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAUClber098103; Wed, 30 Nov 2011 12:47:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAUClaiX098083; Wed, 30 Nov 2011 12:47:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111301247.pAUClaiX098083@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 30 Nov 2011 12:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228152 - stable/8/crypto/openssh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 12:47:37 -0000 Author: bz Date: Wed Nov 30 12:47:36 2011 New Revision: 228152 URL: http://svn.freebsd.org/changeset/base/228152 Log: MFC r224638,224640,224642 (by brooks): Add support for dynamically adjusted buffers to allow the full use of the bandwidth of long fat pipes (i.e. 100Mbps+ trans-oceanic or trans-continental links). Bandwidth-delay products up to 64MB are supported. Also add support (not compiled by default) for the None cypher. The None cypher can only be enabled on non-interactive sessions (those without a pty where -T was not used) and must be enabled in both the client and server configuration files and on the client command line. Additionally, the None cypher will only be activated after authentication is complete. To enable the None cypher you must add -DNONE_CIPHER_ENABLED to CFLAGS via the make command line or in /etc/make.conf. This code is a style(9) compliant version of these features extracted from the patches published at: http://www.psc.edu/networking/projects/hpn-ssh/ Enable keyword expansion for $FreeBSD$ on files. MFC r225852 (by des): Regenerate (ssh_namespace.h) after application of the HPN patch. Discussed with: brooks Added: stable/8/crypto/openssh/README.hpn - copied unchanged from r224638, head/crypto/openssh/README.hpn Modified: stable/8/crypto/openssh/buffer.c (contents, props changed) stable/8/crypto/openssh/buffer.h (contents, props changed) stable/8/crypto/openssh/channels.c (contents, props changed) stable/8/crypto/openssh/channels.h (contents, props changed) stable/8/crypto/openssh/cipher.c (contents, props changed) stable/8/crypto/openssh/clientloop.c (contents, props changed) stable/8/crypto/openssh/compat.c (contents, props changed) stable/8/crypto/openssh/compat.h (contents, props changed) stable/8/crypto/openssh/kex.c (contents, props changed) stable/8/crypto/openssh/kex.h (contents, props changed) stable/8/crypto/openssh/misc.c (contents, props changed) stable/8/crypto/openssh/misc.h (contents, props changed) stable/8/crypto/openssh/myproposal.h (contents, props changed) stable/8/crypto/openssh/packet.c (contents, props changed) stable/8/crypto/openssh/packet.h (contents, props changed) stable/8/crypto/openssh/readconf.c stable/8/crypto/openssh/readconf.h (contents, props changed) stable/8/crypto/openssh/servconf.c stable/8/crypto/openssh/servconf.h (contents, props changed) stable/8/crypto/openssh/serverloop.c (contents, props changed) stable/8/crypto/openssh/session.c stable/8/crypto/openssh/sftp.1 stable/8/crypto/openssh/sftp.c (contents, props changed) stable/8/crypto/openssh/ssh.c stable/8/crypto/openssh/ssh_namespace.h stable/8/crypto/openssh/sshconnect.c stable/8/crypto/openssh/sshconnect2.c (contents, props changed) stable/8/crypto/openssh/sshd.c stable/8/crypto/openssh/sshd_config stable/8/crypto/openssh/version.c stable/8/crypto/openssh/version.h Directory Properties: stable/8/crypto/openssh/ (props changed) Copied: stable/8/crypto/openssh/README.hpn (from r224638, head/crypto/openssh/README.hpn) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/crypto/openssh/README.hpn Wed Nov 30 12:47:36 2011 (r228152, copy of r224638, head/crypto/openssh/README.hpn) @@ -0,0 +1,120 @@ +Notes: + +NONE CIPHER: + To use the NONE option you must have the NoneEnabled switch set on the server + and you MUST have *both* NoneEnabled and NoneSwitch set to yes on the client. + The NONE feature works with ALL ssh subsystems (as far as we can tell) + as long as there is no tty allocated. + If a user uses the -T switch to prevent a tty being created the NONE cipher + will be disabled. + + +PERFORMANCE: + The performance increase will only be as good as the network and TCP stack + tuning on the reciever side of the connection allows. As a rule of thumb a + user will need at least 10Mb/s connection with a 100ms RTT to see a doubling + of performance. + The HPN-SSH home page http://www.psc.edu/networking/projects/hpn-ssh + describes this in greater detail. + + +BUFFER SIZES: +- if HPN is disabled the receive buffer size will be set to the OpenSSH default + of 64K. + +- if a HPN system connects to a non-HPN system the receive buffer will + be set to the HPNBufferSize value. The default is 2MB but user adjustable. + +- If a HPN to HPN connection is established a number of different things might + happen based on the user options and conditions. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = up to 64MB + This is the default state. The HPN buffer size will grow to a maximum of + 64MB as the TCP receive buffer grows. The maximum HPN Buffer size of 64MB + is geared towards 10GigE transcontinental connections. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = TCP receive buffer value. + Users on non-autotuning systesm should disable TCPRcvBufPoll in the + ssh_cofig and sshd_config + + Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = minmum of TCP receive buffer and HPNBufferSize. + This would be the system defined TCP receive buffer (RWIN). + + Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf SET + Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize. + Generally there is no need to set both. + + Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = grows to HPNBufferSize + The buffer will grow up to the maximum size specified here. + + Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf SET + Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize. + Generally there is no need to set both of these, especially on autotuning + systems. However, if the users wishes to override the autotuning this would + be one way to do it. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf SET + Result: HPN Buffer Size = TCPRcvBuf. + This will override autotuning and set the TCP recieve buffer to the user + defined value. + + +HPN SPECIFIC CONFIGURATION OPTIONS: + +- HPNDisabled=[yes/no] client/server + In some situations, such as transfers on a local area network, the impact + of the HPN code produces a net decrease in performance. In these cases it is + helpful to disable the HPN functionality. By default HPNDisabled is set to no. + +- HPNBufferSize=[int]KB client/server + This is the default buffer size the HPN functionality uses when interacting + with non-HPN SSH installations. Conceptually this is similar to the TcpRcvBuf + option as applied to the internal SSH flow control. This value can range from + 1KB to 64MB (1-65536). Use of oversized or undersized buffers can cause + performance problems depending on the roud trip time of the network path. + The default size of this buffer is 2MB. + +- TcpRcvBufPoll=[yes/no] client/server + Enable or disable the polling of the TCP receive buffer through the life + of the connection. You would want to make sure that this option is enabled + for systems making use of autotuning kernels (linux 2.4.24+, 2.6, MS Vista, + FreeBSD 7.x and later). Default is yes. + +- TcpRcvBuf=[int]KB client + Set the TCP socket receive buffer to n Kilobytes. It can be set up to the + maximum socket size allowed by the system. This is useful in situations where + the TCP receive window is set low but the maximum buffer size is set higher + (as is typical). This works on a per TCP connection basis. You can also use + this to artifically limit the transfer rate of the connection. In these cases + the throughput will be no more than n/RTT. The minimum buffer size is 1KB. + Default is the current system wide TCP receive buffer size. + +- NoneEnabled=[yes/no] client/server + Enable or disable the use of the None cipher. Care must always be used when + enabling this as it will allow users to send data in the clear. However, it + is important to note that authentication information remains encrypted even + if this option is enabled. Set to no by default. + +- NoneSwitch=[yes/no] client + Switch the encryption cipher being used to the None cipher after + authentication takes place. NoneEnabled must be enabled on both the client + and server side of the connection. When the connection switches to the NONE + cipher a warning is sent to STDERR. The connection attempt will fail with an + error if a client requests a NoneSwitch from the server that does not + explicitly have NoneEnabled set to yes. + Note: The NONE cipher cannot be used in interactive (shell) sessions and it + will fail silently. Set to no by default. + + +CREDITS: + + This patch was conceived, designed, and led by Chris Rapier (rapier@psc.edu) + The majority of the actual coding for versions up to HPN12v1 was performed + by Michael Stevens (mstevens@andrew.cmu.edu). + The MT-AES-CTR cipher was implemented by Ben Bennet (ben@psc.edu). + This work was financed, in part, by Cisco System, Inc., the National Library + of Medicine, and the National Science Foundation. Modified: stable/8/crypto/openssh/buffer.c ============================================================================== --- stable/8/crypto/openssh/buffer.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/buffer.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: buffer.c,v 1.32 2010/02/09 03:56:28 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -25,7 +26,7 @@ #include "log.h" #define BUFFER_MAX_CHUNK 0x100000 -#define BUFFER_MAX_LEN 0xa00000 +#define BUFFER_MAX_LEN 0x4000000 /* 64MB */ #define BUFFER_ALLOCSZ 0x008000 /* Initializes the buffer structure. */ @@ -165,6 +166,13 @@ buffer_len(const Buffer *buffer) return buffer->end - buffer->offset; } +/* Returns the maximum number of bytes of data that may be in the buffer. */ +u_int +buffer_get_max_len(void) +{ + return (BUFFER_MAX_LEN); +} + /* Gets data from the beginning of the buffer. */ int Modified: stable/8/crypto/openssh/buffer.h ============================================================================== --- stable/8/crypto/openssh/buffer.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/buffer.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: buffer.h,v 1.19 2010/02/09 03:56:28 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -46,6 +47,8 @@ int buffer_get_ret(Buffer *, void *, u_ int buffer_consume_ret(Buffer *, u_int); int buffer_consume_end_ret(Buffer *, u_int); +u_int buffer_get_max_len(void); + #include void buffer_put_bignum(Buffer *, const BIGNUM *); Modified: stable/8/crypto/openssh/channels.c ============================================================================== --- stable/8/crypto/openssh/channels.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/channels.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: channels.c,v 1.303 2010/01/30 21:12:08 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -170,6 +171,11 @@ static void port_open_helper(Channel *c, static int connect_next(struct channel_connect *); static void channel_connect_ctx_free(struct channel_connect *); +/* -- HPN */ + +static int hpn_disabled = 0; +static u_int buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT; + /* -- channel core */ Channel * @@ -309,6 +315,7 @@ channel_new(char *ctype, int type, int r c->self = found; c->type = type; c->ctype = ctype; + c->dynamic_window = 0; c->local_window = window; c->local_window_max = window; c->local_consumed = 0; @@ -810,11 +817,46 @@ channel_pre_open_13(Channel *c, fd_set * FD_SET(c->sock, writeset); } +static u_int +channel_tcpwinsz(void) +{ + u_int32_t tcpwinsz; + socklen_t optsz; + int ret, sd; + u_int maxlen; + + /* If we are not on a socket return 128KB. */ + if (!packet_connection_is_on_socket()) + return (128 * 1024); + + tcpwinsz = 0; + optsz = sizeof(tcpwinsz); + sd = packet_get_connection_in(); + ret = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &tcpwinsz, &optsz); + + /* Return no more than the maximum buffer size. */ + maxlen = buffer_get_max_len(); + if ((ret == 0) && tcpwinsz > maxlen) + tcpwinsz = maxlen; + /* In case getsockopt() failed return a minimum. */ + if (tcpwinsz == 0) + tcpwinsz = CHAN_TCP_WINDOW_DEFAULT; + debug2("tcpwinsz: %d for connection: %d", tcpwinsz, sd); + return (tcpwinsz); +} + static void channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset) { - u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); + u_int limit; + /* Check buffer limits. */ + if (!c->tcpwinsz || c->dynamic_window > 0) + c->tcpwinsz = channel_tcpwinsz(); + + limit = MIN(compat20 ? c->remote_window : packet_get_maxsize(), + 2 * c->tcpwinsz); + if (c->istate == CHAN_INPUT_OPEN && limit > 0 && buffer_len(&c->input) < limit && @@ -1784,14 +1826,25 @@ channel_check_window(Channel *c) c->local_maxpacket*3) || c->local_window < c->local_window_max/2) && c->local_consumed > 0) { + u_int addition = 0; + + /* Adjust max window size if we are in a dynamic environment. */ + if (c->dynamic_window && c->tcpwinsz > c->local_window_max) { + /* + * Grow the window somewhat aggressively to maintain + * pressure. + */ + addition = 1.5 * (c->tcpwinsz - c->local_window_max); + c->local_window_max += addition; + } packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); packet_put_int(c->remote_id); - packet_put_int(c->local_consumed); + packet_put_int(c->local_consumed + addition); packet_send(); debug2("channel %d: window %d sent adjust %d", c->self, c->local_window, c->local_consumed); - c->local_window += c->local_consumed; + c->local_window += c->local_consumed + addition; c->local_consumed = 0; } return 1; @@ -2613,6 +2666,15 @@ channel_set_af(int af) IPv4or6 = af; } +void +channel_set_hpn(int disabled, u_int buf_size) +{ + hpn_disabled = disabled; + buffer_size = buf_size; + debug("HPN Disabled: %d, HPN Buffer Size: %d", + hpn_disabled, buffer_size); +} + static int channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_port, int *allocated_listen_port, @@ -2765,10 +2827,18 @@ channel_setup_fwd_listener(int type, con *allocated_listen_port); } - /* Allocate a channel number for the socket. */ - c = channel_new("port listener", type, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, - 0, "port listener", 1); + /* + * Allocate a channel number for the socket. Explicitly test + * for hpn disabled option. If true use smaller window size. + */ + if (hpn_disabled) + c = channel_new("port listener", type, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); + else + c = channel_new("port listener", type, sock, sock, -1, + buffer_size, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); c->path = xstrdup(host); c->host_port = port_to_connect; c->listening_port = listen_port; @@ -3302,10 +3372,16 @@ x11_create_display_inet(int x11_display_ *chanids = xcalloc(num_socks + 1, sizeof(**chanids)); for (n = 0; n < num_socks; n++) { sock = socks[n]; - nc = channel_new("x11 listener", - SSH_CHANNEL_X11_LISTENER, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, - 0, "X11 inet listener", 1); + if (hpn_disabled) + nc = channel_new("x11 listener", + SSH_CHANNEL_X11_LISTENER, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, + 0, "X11 inet listener", 1); + else + nc = channel_new("x11 listener", + SSH_CHANNEL_X11_LISTENER, sock, sock, -1, + buffer_size, CHAN_X11_PACKET_DEFAULT, + 0, "X11 inet listener", 1); nc->single_connection = single_connection; (*chanids)[n] = nc->self; } Modified: stable/8/crypto/openssh/channels.h ============================================================================== --- stable/8/crypto/openssh/channels.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/channels.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: channels.h,v 1.103 2010/01/26 01:28:35 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -124,6 +125,8 @@ struct Channel { u_int local_window_max; u_int local_consumed; u_int local_maxpacket; + u_int tcpwinsz; + int dynamic_window; int extended_usage; int single_connection; @@ -160,11 +163,15 @@ struct Channel { /* default window/packet sizes for tcp/x11-fwd-channel */ #define CHAN_SES_PACKET_DEFAULT (32*1024) #define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT) + #define CHAN_TCP_PACKET_DEFAULT (32*1024) #define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT) + #define CHAN_X11_PACKET_DEFAULT (16*1024) #define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT) +#define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024) + /* possible input states */ #define CHAN_INPUT_OPEN 0 #define CHAN_INPUT_WAIT_DRAIN 1 @@ -292,4 +299,7 @@ void chan_rcvd_ieof(Channel *); void chan_write_failed(Channel *); void chan_obuf_empty(Channel *); +/* hpn handler */ +void channel_set_hpn(int, u_int); + #endif Modified: stable/8/crypto/openssh/cipher.c ============================================================================== --- stable/8/crypto/openssh/cipher.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/cipher.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: cipher.c,v 1.82 2009/01/26 09:58:15 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -163,7 +164,12 @@ ciphers_valid(const char *names) for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0'; (p = strsep(&cp, CIPHER_SEP))) { c = cipher_by_name(p); - if (c == NULL || c->number != SSH_CIPHER_SSH2) { +#ifdef NONE_CIPHER_ENABLED + if (c == NULL || (c->number != SSH_CIPHER_SSH2 && + c->number != SSH_CIPHER_NONE)) { +#else + if (c == NULL || (c->number != SSH_CIPHER_SSH2)) { +#endif debug("bad cipher %s [%s]", p, names); xfree(cipher_list); return 0; @@ -337,6 +343,9 @@ cipher_get_keyiv(CipherContext *cc, u_ch int evplen; switch (c->number) { +#ifdef NONE_CIPHER_ENABLED + case SSH_CIPHER_NONE: +#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: @@ -371,6 +380,9 @@ cipher_set_keyiv(CipherContext *cc, u_ch int evplen = 0; switch (c->number) { +#ifdef NONE_CIPHER_ENABLED + case SSH_CIPHER_NONE: +#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: Modified: stable/8/crypto/openssh/clientloop.c ============================================================================== --- stable/8/crypto/openssh/clientloop.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/clientloop.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: clientloop.c,v 1.218 2010/01/28 00:21:18 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1700,9 +1701,14 @@ client_request_x11(const char *request_t sock = x11_connect_display(); if (sock < 0) return NULL; - c = channel_new("x11", - SSH_CHANNEL_X11_OPEN, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); + if (options.hpn_disabled) + c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, + 0, "x11", 1); + else + c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, + options.hpn_buffer_size, CHAN_X11_PACKET_DEFAULT, + 0, "x11", 1); c->force_drain = 1; return c; } @@ -1722,10 +1728,16 @@ client_request_agent(const char *request sock = ssh_get_authentication_socket(); if (sock < 0) return NULL; - c = channel_new("authentication agent connection", - SSH_CHANNEL_OPEN, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, - "authentication agent connection", 1); + if (options.hpn_disabled) + c = channel_new("authentication agent connection", + SSH_CHANNEL_OPEN, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0, + "authentication agent connection", 1); + else + c = channel_new("authentication agent connection", + SSH_CHANNEL_OPEN, sock, sock, -1, + options.hpn_buffer_size, options.hpn_buffer_size, 0, + "authentication agent connection", 1); c->force_drain = 1; return c; } @@ -1752,8 +1764,14 @@ client_request_tun_fwd(int tun_mode, int return -1; } - c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); + if (options.hpn_disabled) + c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, + 0, "tun", 1); + else + c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, + options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT, + 0, "tun", 1); c->datagram = 1; #if defined(SSH_TUN_FILTER) Modified: stable/8/crypto/openssh/compat.c ============================================================================== --- stable/8/crypto/openssh/compat.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/compat.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: compat.c,v 1.78 2008/09/11 14:22:37 markus Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -170,6 +171,16 @@ compat_datafellows(const char *version) strlen(check[i].pat), 0) == 1) { debug("match: %s pat %s", version, check[i].pat); datafellows = check[i].bugs; + /* + * Check to see if the remote side is OpenSSH and not + * HPN. It is utterly strange to check it from the + * version string and expose the option that way. + */ + if (strstr(version,"OpenSSH") != NULL && + strstr(version,"hpn") == NULL) { + datafellows |= SSH_BUG_LARGEWINDOW; + debug("Remote is not HPN-aware"); + } return; } } Modified: stable/8/crypto/openssh/compat.h ============================================================================== --- stable/8/crypto/openssh/compat.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/compat.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: compat.h,v 1.42 2008/09/11 14:22:37 markus Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. @@ -58,6 +59,7 @@ #define SSH_OLD_FORWARD_ADDR 0x01000000 #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 +#define SSH_BUG_LARGEWINDOW 0x08000000 void enable_compat13(void); void enable_compat20(void); Modified: stable/8/crypto/openssh/kex.c ============================================================================== --- stable/8/crypto/openssh/kex.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/kex.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: kex.c,v 1.82 2009/10/24 11:13:54 andreas Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * @@ -62,8 +63,13 @@ extern const EVP_MD *evp_ssh_sha256(void static void kex_kexinit_finish(Kex *); static void kex_choose_conf(Kex *); -/* put algorithm proposal into buffer */ +/* Put algorithm proposal into buffer. */ +#ifndef NONE_CIPHER_ENABLED static void +#else +/* Also used in sshconnect2.c. */ +void +#endif kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX]) { u_int i; @@ -375,6 +381,9 @@ kex_choose_conf(Kex *kex) int nenc, nmac, ncomp; u_int mode, ctos, need; int first_kex_follows, type; +#ifdef NONE_CIPHER_ENABLED + int auth_flag; +#endif my = kex_buf2prop(&kex->my, NULL); peer = kex_buf2prop(&kex->peer, &first_kex_follows); @@ -398,6 +407,10 @@ kex_choose_conf(Kex *kex) } /* Algorithm Negotiation */ +#ifdef NONE_CIPHER_ENABLED + auth_flag = packet_get_authentication_state(); + debug ("AUTH STATE is %d", auth_flag); +#endif for (mode = 0; mode < MODE_MAX; mode++) { newkeys = xcalloc(1, sizeof(*newkeys)); kex->newkeys[mode] = newkeys; @@ -409,6 +422,17 @@ kex_choose_conf(Kex *kex) choose_enc (&newkeys->enc, cprop[nenc], sprop[nenc]); choose_mac (&newkeys->mac, cprop[nmac], sprop[nmac]); choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); +#ifdef NONE_CIPHER_ENABLED + debug("REQUESTED ENC.NAME is '%s'", newkeys->enc.name); + if (strcmp(newkeys->enc.name, "none") == 0) { + debug("Requesting NONE. Authflag is %d", auth_flag); + if (auth_flag == 1) + debug("None requested post authentication."); + else + fatal("Pre-authentication none cipher requests " + "are not allowed."); + } +#endif debug("kex: %s %s %s %s", ctos ? "client->server" : "server->client", newkeys->enc.name, Modified: stable/8/crypto/openssh/kex.h ============================================================================== --- stable/8/crypto/openssh/kex.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/kex.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: kex.h,v 1.49 2010/02/26 20:29:54 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -132,6 +133,10 @@ struct Kex { void (*kex[KEX_MAX])(Kex *); }; +#ifdef NONE_CIPHER_ENABLED +void kex_prop2buf(Buffer *, char *[PROPOSAL_MAX]); +#endif + Kex *kex_setup(char *[PROPOSAL_MAX]); void kex_finish(Kex *); Modified: stable/8/crypto/openssh/misc.c ============================================================================== --- stable/8/crypto/openssh/misc.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/misc.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: misc.c,v 1.75 2010/01/09 23:04:13 dtucker Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -860,3 +861,34 @@ sock_set_v6only(int s) error("setsockopt IPV6_V6ONLY: %s", strerror(errno)); #endif } + +void +sock_get_rcvbuf(int *size, int rcvbuf) +{ + int sock, socksize; + socklen_t socksizelen = sizeof(socksize); + + /* + * Create a socket but do not connect it. We use it + * only to get the rcv socket size. + */ + sock = socket(AF_INET6, SOCK_STREAM, 0); + if (sock < 0) + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0) + return; + + /* + * If the tcp_rcv_buf option is set and passed in, attempt to set the + * buffer size to its value. + */ + if (rcvbuf) + setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf, + sizeof(rcvbuf)); + + if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, + &socksize, &socksizelen) == 0) + if (size != NULL) + *size = socksize; + close(sock); +} Modified: stable/8/crypto/openssh/misc.h ============================================================================== --- stable/8/crypto/openssh/misc.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/misc.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: misc.h,v 1.41 2010/01/09 23:04:13 dtucker Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -36,6 +37,7 @@ void sanitise_stdfd(void); void ms_subtract_diff(struct timeval *, int *); void ms_to_timeval(struct timeval *, int); void sock_set_v6only(int); +void sock_get_rcvbuf(int *, int); struct passwd *pwcopy(struct passwd *); const char *ssh_gai_strerror(int); Modified: stable/8/crypto/openssh/myproposal.h ============================================================================== --- stable/8/crypto/openssh/myproposal.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/myproposal.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: myproposal.h,v 1.24 2010/02/26 20:29:54 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -49,6 +50,10 @@ "arcfour256,arcfour128," \ "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" +#ifdef NONE_CIPHER_ENABLED +#define KEX_ENCRYPT_INCLUDE_NONE KEX_DEFAULT_ENCRYPT \ + ",none" +#endif #define KEX_DEFAULT_MAC \ "hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160," \ "hmac-ripemd160@openssh.com," \ Modified: stable/8/crypto/openssh/packet.c ============================================================================== --- stable/8/crypto/openssh/packet.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/packet.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: packet.c,v 1.166 2009/06/27 09:29:06 andreas Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -195,6 +196,9 @@ struct session_state { }; static struct session_state *active_state, *backup_state; +#ifdef NONE_CIPHER_ENABLED +static int rekey_requested = 0; +#endif static struct session_state * alloc_session_state(void) @@ -1840,12 +1844,26 @@ packet_send_ignore(int nbytes) } } +#ifdef NONE_CIPHER_ENABLED +void +packet_request_rekeying(void) +{ + rekey_requested = 1; +} +#endif + #define MAX_PACKETS (1U<<31) int packet_need_rekeying(void) { if (datafellows & SSH_BUG_NOREKEY) return 0; +#ifdef NONE_CIPHER_ENABLED + if (rekey_requested == 1) { + rekey_requested = 0; + return 1; + } +#endif return (active_state->p_send.packets > MAX_PACKETS) || (active_state->p_read.packets > MAX_PACKETS) || @@ -1937,3 +1955,11 @@ packet_restore_state(void) add_recv_bytes(len); } } + +#ifdef NONE_CIPHER_ENABLED +int +packet_get_authentication_state(void) +{ + return (active_state->after_authentication); +} +#endif Modified: stable/8/crypto/openssh/packet.h ============================================================================== --- stable/8/crypto/openssh/packet.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/packet.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: packet.h,v 1.52 2009/06/27 09:29:06 andreas Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -35,6 +36,9 @@ void packet_set_interactive(int); int packet_is_interactive(void); void packet_set_server(void); void packet_set_authenticated(void); +#ifdef NONE_CIPHER_ENABLED +int packet_get_authentication_state(void); +#endif void packet_start(u_char); void packet_put_char(int ch); @@ -107,6 +111,9 @@ do { \ } while (0) int packet_need_rekeying(void); +#ifdef NONE_CIPHER_ENABLED +void packet_request_rekeying(void); +#endif void packet_set_rekey_limit(u_int32_t); void packet_backup_state(void); Modified: stable/8/crypto/openssh/readconf.c ============================================================================== --- stable/8/crypto/openssh/readconf.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/readconf.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: readconf.c,v 1.183 2010/02/08 10:50:20 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -134,6 +135,10 @@ typedef enum { oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, + oHPNDisabled, oHPNBufferSize, oTcpRcvBufPoll, oTcpRcvBuf, +#ifdef NONE_CIPHER_ENABLED + oNoneEnabled, oNoneSwitch, +#endif oVersionAddendum, oDeprecated, oUnsupported } OpCodes; @@ -241,6 +246,14 @@ static struct { #else { "zeroknowledgepasswordauthentication", oUnsupported }, #endif + { "hpndisabled", oHPNDisabled }, + { "hpnbuffersize", oHPNBufferSize }, + { "tcprcvbufpoll", oTcpRcvBufPoll }, + { "tcprcvbuf", oTcpRcvBuf }, +#ifdef NONE_CIPHER_ENABLED + { "noneenabled", oNoneEnabled }, + { "noneswitch", oNoneSwitch }, +#endif { "versionaddendum", oVersionAddendum }, { NULL, oBadOption } @@ -945,6 +958,47 @@ parse_int: } while (arg != NULL && *arg != '\0'); break; + case oHPNDisabled: + intptr = &options->hpn_disabled; + goto parse_flag; + + case oHPNBufferSize: + intptr = &options->hpn_buffer_size; + goto parse_int; + + case oTcpRcvBufPoll: + intptr = &options->tcp_rcv_buf_poll; + goto parse_flag; + + case oTcpRcvBuf: + intptr = &options->tcp_rcv_buf; + goto parse_int; + +#ifdef NONE_CIPHER_ENABLED + case oNoneEnabled: + intptr = &options->none_enabled; + goto parse_flag; + + /* + * We check to see if the command comes from the command line or not. + * If it does then enable it otherwise fail. NONE must never be a + * default configuration. + */ + case oNoneSwitch: + if (strcmp(filename,"command-line") == 0) { + intptr = &options->none_switch; + goto parse_flag; + } else { + debug("NoneSwitch directive found in %.200s.", + filename); + error("NoneSwitch is found in %.200s.\n" + "You may only use this configuration option " + "from the command line", filename); + error("Continuing..."); + return 0; + } +#endif + case oDeprecated: debug("%s line %d: Deprecated option \"%s\"", filename, linenum, keyword); @@ -1097,6 +1151,14 @@ initialize_options(Options * options) options->use_roaming = -1; options->visual_host_key = -1; options->zero_knowledge_password_authentication = -1; + options->hpn_disabled = -1; + options->hpn_buffer_size = -1; + options->tcp_rcv_buf_poll = -1; + options->tcp_rcv_buf = -1; +#ifdef NONE_CIPHER_ENABLED + options->none_enabled = -1; + options->none_switch = -1; +#endif } /* @@ -1243,6 +1305,36 @@ fill_default_options(Options * options) /* options->hostname will be set in the main program if appropriate */ /* options->host_key_alias should not be set by default */ /* options->preferred_authentications will be set in ssh */ + if (options->hpn_disabled == -1) + options->hpn_disabled = 0; + if (options->hpn_buffer_size > -1) + { + u_int maxlen; + + /* If a user tries to set the size to 0 set it to 1KB. */ + if (options->hpn_buffer_size == 0) + options->hpn_buffer_size = 1024; + /* Limit the buffer to BUFFER_MAX_LEN. */ + maxlen = buffer_get_max_len(); + if (options->hpn_buffer_size > (maxlen / 1024)) { + debug("User requested buffer larger than %ub: %ub. " + "Request reverted to %ub", maxlen, + options->hpn_buffer_size * 1024, maxlen); + options->hpn_buffer_size = maxlen; + } + debug("hpn_buffer_size set to %d", options->hpn_buffer_size); + } + if (options->tcp_rcv_buf == 0) + options->tcp_rcv_buf = 1; + if (options->tcp_rcv_buf > -1) + options->tcp_rcv_buf *= 1024; + if (options->tcp_rcv_buf_poll == -1) + options->tcp_rcv_buf_poll = 1; +#ifdef NONE_CIPHER_ENABLED + /* options->none_enabled must not be set by default */ + if (options->none_switch == -1) + options->none_switch = 0; +#endif } /* Modified: stable/8/crypto/openssh/readconf.h ============================================================================== --- stable/8/crypto/openssh/readconf.h Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/readconf.h Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: readconf.h,v 1.82 2010/02/08 10:50:20 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -125,6 +126,17 @@ typedef struct { int use_roaming; + int hpn_disabled; /* Switch to disable HPN buffer management. */ + int hpn_buffer_size; /* User definable size for HPN buffer + * window. */ + int tcp_rcv_buf_poll; /* Option to poll recv buf every window + * transfer. */ + int tcp_rcv_buf; /* User switch to set tcp recv buffer. */ + +#ifdef NONE_CIPHER_ENABLED + int none_enabled; /* Allow none to be used */ + int none_switch; /* Use none cipher */ +#endif } Options; #define SSHCTL_MASTER_NO 0 Modified: stable/8/crypto/openssh/servconf.c ============================================================================== --- stable/8/crypto/openssh/servconf.c Wed Nov 30 10:23:05 2011 (r228151) +++ stable/8/crypto/openssh/servconf.c Wed Nov 30 12:47:36 2011 (r228152) @@ -1,4 +1,5 @@ /* $OpenBSD: servconf.c,v 1.204 2010/03/04 10:36:03 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -133,6 +134,12 @@ initialize_server_options(ServerOptions options->zero_knowledge_password_authentication = -1; options->revoked_keys_file = NULL; options->trusted_user_ca_keys = NULL; + options->hpn_disabled = -1; + options->hpn_buffer_size = -1; + options->tcp_rcv_buf_poll = -1; +#ifdef NONE_CIPHER_ENABLED + options->none_enabled = -1; +#endif } void @@ -267,6 +274,37 @@ fill_default_server_options(ServerOption options->permit_tun = SSH_TUNMODE_NO; if (options->zero_knowledge_password_authentication == -1) options->zero_knowledge_password_authentication = 0; + if (options->hpn_disabled == -1) + options->hpn_disabled = 0; + if (options->hpn_buffer_size == -1) { + /* + * HPN buffer size option not explicitly set. Try to figure + * out what value to use or resort to default. + */ + options->hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT; + if (!options->hpn_disabled) { + sock_get_rcvbuf(&options->hpn_buffer_size, 0); + debug ("HPN Buffer Size: %d", options->hpn_buffer_size); + } + } else { + /* + * In the case that the user sets both values in a + * contradictory manner hpn_disabled overrrides hpn_buffer_size. + */ + if (options->hpn_disabled <= 0) { + u_int maxlen; + + maxlen = buffer_get_max_len(); + if (options->hpn_buffer_size == 0) + options->hpn_buffer_size = 1; + /* Limit the maximum buffer to BUFFER_MAX_LEN. */ + if (options->hpn_buffer_size > maxlen / 1024) + options->hpn_buffer_size = maxlen; + else + options->hpn_buffer_size *= 1024; + } else + options->hpn_buffer_size = CHAN_TCP_WINDOW_DEFAULT; + } /* Turn privilege separation on by default */ if (use_privsep == -1) @@ -313,6 +351,10 @@ typedef enum { sUsePrivilegeSeparation, sAllowAgentForwarding, sZeroKnowledgePasswordAuthentication, sHostCertificate, sRevokedKeys, sTrustedUserCAKeys, + sHPNDisabled, sHPNBufferSize, sTcpRcvBufPoll, +#ifdef NONE_CIPHER_ENABLED + sNoneEnabled, +#endif sVersionAddendum, sDeprecated, sUnsupported } ServerOpCodes; @@ -435,6 +477,12 @@ static struct { { "hostcertificate", sHostCertificate, SSHCFG_GLOBAL }, { "revokedkeys", sRevokedKeys, SSHCFG_ALL }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Nov 30 17:11:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EFE2106566B; Wed, 30 Nov 2011 17:11:00 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 283C38FC15; Wed, 30 Nov 2011 17:10:59 +0000 (UTC) Received: by eaai12 with SMTP id i12so1363471eaa.13 for ; Wed, 30 Nov 2011 09:10:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.14.203 with SMTP id h11mr533967eba.139.1322671705249; Wed, 30 Nov 2011 08:48:25 -0800 (PST) Received: by 10.14.37.136 with HTTP; Wed, 30 Nov 2011 08:48:25 -0800 (PST) X-Originating-IP: [209.66.78.50] In-Reply-To: <20111117183642.GY1455@elvis.mu.org> References: <20111117040109.GU1455@elvis.mu.org> <462306074.1954190.1321506994004.JavaMail.root@erie.cs.uoguelph.ca> <20111117183642.GY1455@elvis.mu.org> Date: Wed, 30 Nov 2011 11:48:25 -0500 Message-ID: From: Mark Saad To: Alfred Perlstein Content-Type: text/plain; charset=UTF-8 Cc: svn-src-stable-7@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Rick Macklem , Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 17:11:00 -0000 On Thu, Nov 17, 2011 at 1:36 PM, Alfred Perlstein wrote: > * Rick Macklem [111116 21:16] wrote: >> Alfred Perlstein wrote: >> > Rick, I have a question, what will happen if the nfs_freesillyrename() >> > call happens when the mount is down? Will it block the >> > taskqueue_thread? >> > >> > If so, it might make more sense to make a taskqueue per mount point. >> > >> > If not, excuse me. :-) >> > >> Well, all nfs_freesillyrename() does is a vrele() on the parent >> directory when the file node's use count has gone to 0. >> I can't think why that would do any RPC, so I don't see a problem? >> If you do see a problem with vrele() on the directory, please let me >> know. >> >> The problem this fixes is a LOR that would occur when the vrele() on >> the directory was done by the thread doing VOP_INACTIVE(), since it >> already has the file vnode lock and the vrele() was locking the parent >> directory. This could cause a fairly rare deadlock. > > Yes, I understand the VFS deadlock. > > I see, I didn't realize the call was against the directory, > thank you for explaining. > > -Alfred Rick Any chance this will make it back into 7.3-RELEASE and 7.4-RELEASE ? -- mark saad | nonesuch@longcount.org From owner-svn-src-stable@FreeBSD.ORG Wed Nov 30 22:53:48 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FDCE106564A; Wed, 30 Nov 2011 22:53:48 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id CF0218FC15; Wed, 30 Nov 2011 22:53:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAPmy1k6DaFvO/2dsb2JhbABEhQOnFIFyAQEFI1YbDgoCAg0ZAlkGE68BkU+BMII9hh2BFgSIKIwvki4 X-IronPort-AV: E=Sophos;i="4.71,273,1320642000"; d="scan'208";a="147739852" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 30 Nov 2011 17:52:21 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id C7C15B3F10; Wed, 30 Nov 2011 17:52:21 -0500 (EST) Date: Wed, 30 Nov 2011 17:52:21 -0500 (EST) From: Rick Macklem To: Mark Saad Message-ID: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , svn-src-stable-7@freebsd.org, Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 22:53:48 -0000 Mark Saad wrote: > On Thu, Nov 17, 2011 at 1:36 PM, Alfred Perlstein > wrote: > > * Rick Macklem [111116 21:16] wrote: > >> Alfred Perlstein wrote: > >> > Rick, I have a question, what will happen if the > >> > nfs_freesillyrename() > >> > call happens when the mount is down? Will it block the > >> > taskqueue_thread? > >> > > >> > If so, it might make more sense to make a taskqueue per mount > >> > point. > >> > > >> > If not, excuse me. :-) > >> > > >> Well, all nfs_freesillyrename() does is a vrele() on the parent > >> directory when the file node's use count has gone to 0. > >> I can't think why that would do any RPC, so I don't see a problem? > >> If you do see a problem with vrele() on the directory, please let > >> me > >> know. > >> > >> The problem this fixes is a LOR that would occur when the vrele() > >> on > >> the directory was done by the thread doing VOP_INACTIVE(), since it > >> already has the file vnode lock and the vrele() was locking the > >> parent > >> directory. This could cause a fairly rare deadlock. > > > > Yes, I understand the VFS deadlock. > > > > I see, I didn't realize the call was against the directory, > > thank you for explaining. > > > > -Alfred > Rick > Any chance this will make it back into 7.3-RELEASE and 7.4-RELEASE ? > I'm relatively new to FreeBSD, but I've never heard of an MFC to a Release branch. (As far as I know, if it ever happens, it's for a serious errata or security issue.) Unless I'm incorrect (someone please correct me if I'm wrong), the answer would be no, rick. > > -- > mark saad | nonesuch@longcount.org From owner-svn-src-stable@FreeBSD.ORG Wed Nov 30 23:10:03 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4A7531065676; Wed, 30 Nov 2011 23:10:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 90D2314E6AB; Wed, 30 Nov 2011 23:10:02 +0000 (UTC) Message-ID: <4ED6B7CA.7050108@FreeBSD.org> Date: Wed, 30 Nov 2011 15:10:02 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111110 Thunderbird/8.0 MIME-Version: 1.0 To: Rick Macklem References: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, Mark Saad , Alfred Perlstein , svn-src-stable-7@freebsd.org, Rick Macklem , svn-src-all@freebsd.org Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2011 23:10:03 -0000 On 11/30/2011 14:52, Rick Macklem wrote: > I'm relatively new to FreeBSD, but I've never heard of an MFC to a > Release branch. (As far as I know, if it ever happens, it's for a > serious errata or security issue.) You are correct sir. :) -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:46:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A506106564A; Thu, 1 Dec 2011 05:46:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7498FC0A; Thu, 1 Dec 2011 05:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15kQ3n030190; Thu, 1 Dec 2011 05:46:26 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15kQub030188; Thu, 1 Dec 2011 05:46:26 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010546.pB15kQub030188@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228165 - stable/9/etc/periodic/daily X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:46:26 -0000 Author: dougb Date: Thu Dec 1 05:46:25 2011 New Revision: 228165 URL: http://svn.freebsd.org/changeset/base/228165 Log: MFC r227482: The default setting, daily_accounting_compress="NO", was causing only 1 old file to be saved, so fix this. While I'm here, fix a very old off-by-one error causing 1 more file than specified in daily_accounting_save to be saved because acct.0 was not taken into account (pun intended). Change that, and use a more thorough method of finding old files to delete. Partly just because this is the right thing to do, but also to silently fix the extra log that would have been left behind forever with the previous method. Approved by: re (kensmith) Modified: stable/9/etc/periodic/daily/310.accounting Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/periodic/daily/310.accounting ============================================================================== --- stable/9/etc/periodic/daily/310.accounting Wed Nov 30 20:43:39 2011 (r228164) +++ stable/9/etc/periodic/daily/310.accounting Thu Dec 1 05:46:25 2011 (r228165) @@ -30,8 +30,13 @@ case "$daily_accounting_enable" in cd /var/account rc=0 - n=$daily_accounting_save - rm -f acct.$n.gz acct.$n || rc=3 + n=$(( $daily_accounting_save - 1 )) + for f in acct.*; do + case "$f" in acct.\*) continue ;; esac # No files match + m=${f%.gz} ; m=${m#acct.} + [ $m -ge $n ] && { rm $f || rc=3; } + done + m=$n n=$(($n - 1)) while [ $n -ge 0 ] @@ -44,13 +49,14 @@ case "$daily_accounting_enable" in /etc/rc.d/accounting rotate_log || rc=3 + rm -f acct.merge && cp acct.0 acct.merge || rc=3 + sa -s $daily_accounting_flags /var/account/acct.merge || rc=3 + rm acct.merge + case "$daily_accounting_compress" in [Yy][Ee][Ss]) - gzip --keep -f acct.0 || rc=3;; + gzip -f acct.0 || rc=3;; esac - - sa -s $daily_accounting_flags /var/account/acct.0 && - unlink acct.0 || rc=3 fi;; *) rc=0;; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:48:50 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA8B106566C; Thu, 1 Dec 2011 05:48:50 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70CCB8FC13; Thu, 1 Dec 2011 05:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15moix030360; Thu, 1 Dec 2011 05:48:50 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15moZj030358; Thu, 1 Dec 2011 05:48:50 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010548.pB15moZj030358@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228167 - stable/8/etc/periodic/daily X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:48:50 -0000 Author: dougb Date: Thu Dec 1 05:48:50 2011 New Revision: 228167 URL: http://svn.freebsd.org/changeset/base/228167 Log: MFC r227482: The default setting, daily_accounting_compress="NO", was causing only 1 old file to be saved, so fix this. While I'm here, fix a very old off-by-one error causing 1 more file than specified in daily_accounting_save to be saved because acct.0 was not taken into account (pun intended). Change that, and use a more thorough method of finding old files to delete. Partly just because this is the right thing to do, but also to silently fix the extra log that would have been left behind forever with the previous method. Modified: stable/8/etc/periodic/daily/310.accounting Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/310.accounting ============================================================================== --- stable/8/etc/periodic/daily/310.accounting Thu Dec 1 05:47:51 2011 (r228166) +++ stable/8/etc/periodic/daily/310.accounting Thu Dec 1 05:48:50 2011 (r228167) @@ -30,8 +30,13 @@ case "$daily_accounting_enable" in cd /var/account rc=0 - n=$daily_accounting_save - rm -f acct.$n.gz acct.$n || rc=3 + n=$(( $daily_accounting_save - 1 )) + for f in acct.*; do + case "$f" in acct.\*) continue ;; esac # No files match + m=${f%.gz} ; m=${m#acct.} + [ $m -ge $n ] && { rm $f || rc=3; } + done + m=$n n=$(($n - 1)) while [ $n -ge 0 ] @@ -44,13 +49,14 @@ case "$daily_accounting_enable" in /etc/rc.d/accounting rotate_log || rc=3 + rm -f acct.merge && cp acct.0 acct.merge || rc=3 + sa -s $daily_accounting_flags /var/account/acct.merge || rc=3 + rm acct.merge + case "$daily_accounting_compress" in [Yy][Ee][Ss]) - gzip --keep -f acct.0 || rc=3;; + gzip -f acct.0 || rc=3;; esac - - sa -s $daily_accounting_flags /var/account/acct.0 && - unlink acct.0 || rc=3 fi;; *) rc=0;; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:49:38 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 026901065679; Thu, 1 Dec 2011 05:49:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBE5B8FC13; Thu, 1 Dec 2011 05:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15nbN4030431; Thu, 1 Dec 2011 05:49:37 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15nbMA030429; Thu, 1 Dec 2011 05:49:37 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010549.pB15nbMA030429@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:49:37 +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: r228168 - stable/7/etc/periodic/daily X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:49:38 -0000 Author: dougb Date: Thu Dec 1 05:49:37 2011 New Revision: 228168 URL: http://svn.freebsd.org/changeset/base/228168 Log: MFC r227482: The default setting, daily_accounting_compress="NO", was causing only 1 old file to be saved, so fix this. While I'm here, fix a very old off-by-one error causing 1 more file than specified in daily_accounting_save to be saved because acct.0 was not taken into account (pun intended). Change that, and use a more thorough method of finding old files to delete. Partly just because this is the right thing to do, but also to silently fix the extra log that would have been left behind forever with the previous method. Modified: stable/7/etc/periodic/daily/310.accounting Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/periodic/daily/310.accounting ============================================================================== --- stable/7/etc/periodic/daily/310.accounting Thu Dec 1 05:48:50 2011 (r228167) +++ stable/7/etc/periodic/daily/310.accounting Thu Dec 1 05:49:37 2011 (r228168) @@ -30,8 +30,13 @@ case "$daily_accounting_enable" in cd /var/account rc=0 - n=$daily_accounting_save - rm -f acct.$n.gz acct.$n || rc=3 + n=$(( $daily_accounting_save - 1 )) + for f in acct.*; do + case "$f" in acct.\*) continue ;; esac # No files match + m=${f%.gz} ; m=${m#acct.} + [ $m -ge $n ] && { rm $f || rc=3; } + done + m=$n n=$(($n - 1)) while [ $n -ge 0 ] @@ -44,13 +49,14 @@ case "$daily_accounting_enable" in /etc/rc.d/accounting rotate_log || rc=3 + rm -f acct.merge && cp acct.0 acct.merge || rc=3 + sa -s $daily_accounting_flags /var/account/acct.merge || rc=3 + rm acct.merge + case "$daily_accounting_compress" in [Yy][Ee][Ss]) - gzip --keep -f acct.0 || rc=3;; + gzip -f acct.0 || rc=3;; esac - - sa -s $daily_accounting_flags /var/account/acct.0 && - unlink acct.0 || rc=3 fi;; *) rc=0;; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:51:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB13D1065673; Thu, 1 Dec 2011 05:51:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F0E8FC12; Thu, 1 Dec 2011 05:51:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15pH7W030540; Thu, 1 Dec 2011 05:51:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15pHhJ030538; Thu, 1 Dec 2011 05:51:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010551.pB15pHhJ030538@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228169 - stable/9/usr.sbin/mergemaster X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:51:17 -0000 Author: dougb Date: Thu Dec 1 05:51:17 2011 New Revision: 228169 URL: http://svn.freebsd.org/changeset/base/228169 Log: MFC r228122: If using DESTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo Approved by: re (kensmith) Modified: stable/9/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/9/usr.sbin/mergemaster/ (props changed) Modified: stable/9/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/9/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:49:37 2011 (r228168) +++ stable/9/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:51:17 2011 (r228169) @@ -1336,14 +1336,14 @@ esac if [ -e "${DESTDIR}/etc/localtime" ]; then # Ignore if TZ == UTC echo '' + [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime" - [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" tzsetup $tzs_args -r else echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime." echo ' You should run tzsetup' - run_it_now tzsetup + run_it_now "tzsetup $tzs_args" fi fi From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:53:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9241065A32; Thu, 1 Dec 2011 05:53:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6943F8FC0C; Thu, 1 Dec 2011 05:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15rU2P030714; Thu, 1 Dec 2011 05:53:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15rUdb030712; Thu, 1 Dec 2011 05:53:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010553.pB15rUdb030712@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228171 - stable/8/usr.sbin/mergemaster X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:53:30 -0000 Author: dougb Date: Thu Dec 1 05:53:30 2011 New Revision: 228171 URL: http://svn.freebsd.org/changeset/base/228171 Log: MFC r228122: If using DESTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/8/usr.sbin/mergemaster/ (props changed) Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:52:50 2011 (r228170) +++ stable/8/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:53:30 2011 (r228171) @@ -1338,14 +1338,14 @@ esac if [ -e "${DESTDIR}/etc/localtime" ]; then # Ignore if TZ == UTC echo '' + [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime" - [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" tzsetup $tzs_args -r else echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime." echo ' You should run tzsetup' - run_it_now tzsetup + run_it_now "tzsetup $tzs_args" fi fi From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 05:54:22 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF08710657E3; Thu, 1 Dec 2011 05:54:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB408FC1C; Thu, 1 Dec 2011 05:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB15sMrY030792; Thu, 1 Dec 2011 05:54:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB15sMK2030790; Thu, 1 Dec 2011 05:54:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112010554.pB15sMK2030790@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 05:54:22 +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: r228172 - stable/7/usr.sbin/mergemaster X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 05:54:22 -0000 Author: dougb Date: Thu Dec 1 05:54:22 2011 New Revision: 228172 URL: http://svn.freebsd.org/changeset/base/228172 Log: MFC r228122: If using DESTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/7/usr.sbin/mergemaster/ (props changed) Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:53:30 2011 (r228171) +++ stable/7/usr.sbin/mergemaster/mergemaster.sh Thu Dec 1 05:54:22 2011 (r228172) @@ -1324,14 +1324,14 @@ esac if [ -e "${DESTDIR}/etc/localtime" ]; then # Ignore if TZ == UTC echo '' + [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime" - [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" tzsetup $tzs_args -r else echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime." echo ' You should run tzsetup' - run_it_now tzsetup + run_it_now "tzsetup $tzs_args" fi fi From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 13:53:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625381065672; Thu, 1 Dec 2011 13:53:09 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50F318FC0C; Thu, 1 Dec 2011 13:53:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB1Dr9PG047763; Thu, 1 Dec 2011 13:53:09 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB1Dr9HN047761; Thu, 1 Dec 2011 13:53:09 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201112011353.pB1Dr9HN047761@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 1 Dec 2011 13:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228179 - stable/9/usr.bin/grep X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 13:53:09 -0000 Author: gabor Date: Thu Dec 1 13:53:08 2011 New Revision: 228179 URL: http://svn.freebsd.org/changeset/base/228179 Log: MFC 228093 - Fix behavior of --null to match GNU grep MFC 228097 - Call warnx() instead of errx() if a directory is not readable when using a recursive search. This is the expected behavior instead of aborting. Approved by: re (kib) Modified: stable/9/usr.bin/grep/util.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/util.c ============================================================================== --- stable/9/usr.bin/grep/util.c Thu Dec 1 11:36:41 2011 (r228178) +++ stable/9/usr.bin/grep/util.c Thu Dec 1 13:53:08 2011 (r228179) @@ -130,7 +130,9 @@ grep_tree(char **argv) case FTS_DNR: /* FALLTHROUGH */ case FTS_ERR: - errx(2, "%s: %s", p->fts_path, strerror(p->fts_errno)); + notfound = true; + if(!sflag) + warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); break; case FTS_D: /* FALLTHROUGH */ @@ -246,9 +248,9 @@ procfile(const char *fn) printf("%u\n", c); } if (lflag && !qflag && c != 0) - printf("%s\n", fn); + printf("%s%c", fn, nullflag ? 0 : '\n'); if (Lflag && !qflag && c == 0) - printf("%s\n", fn); + printf("%s%c", fn, nullflag ? 0 : '\n'); if (c && !cflag && !lflag && !Lflag && binbehave == BINFILE_BIN && f->binary && !qflag) printf(getstr(8), fn); @@ -440,13 +442,13 @@ printline(struct str *line, int sep, reg int i, n = 0; if (!hflag) { - if (nullflag == 0) + if (!nullflag) { fputs(line->file, stdout); - else { + ++n; + } else { printf("%s", line->file); putchar(0); } - ++n; } if (nflag) { if (n > 0) From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 15:15:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0901065673; Thu, 1 Dec 2011 15:15:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59DEE8FC13; Thu, 1 Dec 2011 15:15:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB1FFD82050739; Thu, 1 Dec 2011 15:15:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB1FFDad050737; Thu, 1 Dec 2011 15:15:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201112011515.pB1FFDad050737@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 1 Dec 2011 15:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228182 - stable/9/sys/contrib/pf/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 15:15:13 -0000 Author: glebius Date: Thu Dec 1 15:15:12 2011 New Revision: 228182 URL: http://svn.freebsd.org/changeset/base/228182 Log: MFhead r228150: Return value should be conditional on return value of pfsync_defer_ptr() PR: kern/162947 Submitted by: Matthieu Kraus Approved by: re (kib) Modified: stable/9/sys/contrib/pf/net/pf.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/contrib/pf/ (props changed) Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Thu Dec 1 15:01:23 2011 (r228181) +++ stable/9/sys/contrib/pf/net/pf.c Thu Dec 1 15:15:12 2011 (r228182) @@ -3770,8 +3770,8 @@ pf_test_rule(struct pf_rule **rm, struct * replies through it. */ #ifdef __FreeBSD__ - if (pfsync_defer_ptr != NULL) - pfsync_defer_ptr(*sm, m); + if (pfsync_defer_ptr != NULL && + pfsync_defer_ptr(*sm, m)) #else if (pfsync_defer(*sm, m)) #endif From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 15:59:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FCF41065670; Thu, 1 Dec 2011 15:59:57 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id CF5D18FC08; Thu, 1 Dec 2011 15:59:55 +0000 (UTC) Received: by faak28 with SMTP id k28so2021914faa.13 for ; Thu, 01 Dec 2011 07:59:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.128.77 with SMTP id j13mr8118911bks.124.1322755194655; Thu, 01 Dec 2011 07:59:54 -0800 (PST) Received: by 10.223.111.75 with HTTP; Thu, 1 Dec 2011 07:59:54 -0800 (PST) X-Originating-IP: [209.66.78.50] In-Reply-To: <4ED6B7CA.7050108@FreeBSD.org> References: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> <4ED6B7CA.7050108@FreeBSD.org> Date: Thu, 1 Dec 2011 10:59:54 -0500 Message-ID: From: Mark Saad To: Doug Barton Content-Type: text/plain; charset=UTF-8 Cc: svn-src-stable-7@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Rick Macklem , Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 15:59:57 -0000 On Wed, Nov 30, 2011 at 6:10 PM, Doug Barton wrote: > On 11/30/2011 14:52, Rick Macklem wrote: >> I'm relatively new to FreeBSD, but I've never heard of an MFC to a >> Release branch. (As far as I know, if it ever happens, it's for a >> serious errata or security issue.) > > You are correct sir. :) > So how would I ever see this in an official release as an errata fix ? -- mark saad | nonesuch@longcount.org From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 20:38:52 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA81E106564A; Thu, 1 Dec 2011 20:38:52 +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 BF9A28FC17; Thu, 1 Dec 2011 20:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB1Kcqnr061042; Thu, 1 Dec 2011 20:38:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB1Kcqk4061040; Thu, 1 Dec 2011 20:38:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201112012038.pB1Kcqk4061040@svn.freebsd.org> From: John Baldwin Date: Thu, 1 Dec 2011 20:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228187 - stable/9/sys/boot/i386/libi386 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 20:38:53 -0000 Author: jhb Date: Thu Dec 1 20:38:52 2011 New Revision: 228187 URL: http://svn.freebsd.org/changeset/base/228187 Log: MFC 227389: Remove some debugging printfs. Approved by: re (bz) Modified: stable/9/sys/boot/i386/libi386/bioscd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/boot/i386/libi386/bioscd.c ============================================================================== --- stable/9/sys/boot/i386/libi386/bioscd.c Thu Dec 1 19:57:13 2011 (r228186) +++ stable/9/sys/boot/i386/libi386/bioscd.c Thu Dec 1 20:38:52 2011 (r228187) @@ -118,7 +118,6 @@ bc_bios2unit(int biosdev) int i; DEBUG("looking for bios device 0x%x", biosdev); - printf("looking for bios device 0x%x, nbcinfo=%d\n", biosdev, nbcinfo); for (i = 0; i < nbcinfo; i++) { DEBUG("bc unit %d is BIOS device 0x%x", i, bcinfo[i].bc_unit); if (bcinfo[i].bc_unit == biosdev) @@ -150,7 +149,6 @@ bc_init(void) int bc_add(int biosdev) { - printf("bc_add(%d)\n", biosdev); if (nbcinfo >= MAXBCDEV) return (-1); @@ -162,10 +160,8 @@ bc_add(int biosdev) v86.ds = VTOPSEG(&bcinfo[nbcinfo].bc_sp); v86.esi = VTOPOFF(&bcinfo[nbcinfo].bc_sp); v86int(); - if ((v86.eax & 0xff00) != 0) { - printf("CD probe failed, eax=0x%08x\n", v86.eax); + if ((v86.eax & 0xff00) != 0) return (-1); - } printf("BIOS CD is cd%d\n", nbcinfo); nbcinfo++; From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 21:13:41 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1750106566C; Thu, 1 Dec 2011 21:13:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF0848FC17; Thu, 1 Dec 2011 21:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB1LDfVk062187; Thu, 1 Dec 2011 21:13:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB1LDfVm062182; Thu, 1 Dec 2011 21:13:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201112012113.pB1LDfVm062182@svn.freebsd.org> From: Doug Barton Date: Thu, 1 Dec 2011 21:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228189 - in stable/9/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 21:13:42 -0000 Author: dougb Date: Thu Dec 1 21:13:41 2011 New Revision: 228189 URL: http://svn.freebsd.org/changeset/base/228189 Log: Upgrade to BIND 9.8.1-P1 to address the following DDOS bug: Recursive name servers are failing with an assertion: INSIST(! dns_rdataset_isassociated(sigrdataset)) At this time it is not thought that authoritative-only servers are affected, but information about this bug is evolving rapidly. Because it may be possible to trigger this bug even on networks that do not allow untrusted users to access the recursive name servers (perhaps via specially crafted e-mail messages, and/or malicious web sites) it is recommended that ALL operators of recursive name servers upgrade immediately. For more information see: https://www.isc.org/software/bind/advisories/cve-2011-4313 which will be updated as more information becomes available. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313 Approved by: re (kib) Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/bin/named/query.c stable/9/contrib/bind9/lib/dns/rbtdb.c stable/9/contrib/bind9/version Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Thu Dec 1 20:39:18 2011 (r228188) +++ stable/9/contrib/bind9/CHANGES Thu Dec 1 21:13:41 2011 (r228189) @@ -1,3 +1,9 @@ + --- 9.8.1-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.8.1 released --- --- 9.8.1rc1 released --- Modified: stable/9/contrib/bind9/bin/named/query.c ============================================================================== --- stable/9/contrib/bind9/bin/named/query.c Thu Dec 1 20:39:18 2011 (r228188) +++ stable/9/contrib/bind9/bin/named/query.c Thu Dec 1 21:13:41 2011 (r228189) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.353.8.11 2011-06-09 03:14:03 marka Exp $ */ +/* $Id: query.c,v 1.353.8.11.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -1393,11 +1393,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1438,8 +1436,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1889,10 +1888,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: stable/9/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/rbtdb.c Thu Dec 1 20:39:18 2011 (r228188) +++ stable/9/contrib/bind9/lib/dns/rbtdb.c Thu Dec 1 21:13:41 2011 (r228189) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.310.8.5 2011-06-08 23:02:42 each Exp $ */ +/* $Id: rbtdb.c,v 1.310.8.5.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -5053,7 +5053,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5685,7 +5685,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: stable/9/contrib/bind9/version ============================================================================== --- stable/9/contrib/bind9/version Thu Dec 1 20:39:18 2011 (r228188) +++ stable/9/contrib/bind9/version Thu Dec 1 21:13:41 2011 (r228189) @@ -1,4 +1,4 @@ -# $Id: version,v 1.53.8.9 2011-08-24 02:08:26 marka Exp $ +# $Id: version,v 1.53.8.9.6.1 2011-11-16 09:32:07 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=1 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 21:42:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E49F106567E; Thu, 1 Dec 2011 21:42: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 401E18FC0A; Thu, 1 Dec 2011 21:42:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E6C6546B0D; Thu, 1 Dec 2011 16:42:54 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7A00DB941; Thu, 1 Dec 2011 16:42:54 -0500 (EST) From: John Baldwin To: Mark Saad Date: Thu, 1 Dec 2011 16:42:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> <4ED6B7CA.7050108@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201112011642.53968.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 01 Dec 2011 16:42:54 -0500 (EST) Cc: svn-src-stable-7@freebsd.org, src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Doug Barton , Rick Macklem , Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 21:42:55 -0000 On Thursday, December 01, 2011 10:59:54 am Mark Saad wrote: > On Wed, Nov 30, 2011 at 6:10 PM, Doug Barton wrote: > > On 11/30/2011 14:52, Rick Macklem wrote: > >> I'm relatively new to FreeBSD, but I've never heard of an MFC to a > >> Release branch. (As far as I know, if it ever happens, it's for a > >> serious errata or security issue.) > > > > You are correct sir. :) > > > So how would I ever see this in an official release as an errata fix ? At this point you likely won't. The vast majority of patches to releases are only for security advisories. Very few errata are merged back to releases currently. It may be that we are too hesitant to do so, but the manpower overhead of actually getting the changes merged back and getting appropriate folks to sign off on everything is extremely high (and the exact process for getting an EN approved is not very clear or really even documented to my knowledge). -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Thu Dec 1 22:23:49 2011 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4DCC1065673; Thu, 1 Dec 2011 22:23:49 +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 487198FC1C; Thu, 1 Dec 2011 22:23:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA19456; Fri, 02 Dec 2011 00:23:33 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RWF2T-0007nd-E7; Fri, 02 Dec 2011 00:23:33 +0200 Message-ID: <4ED7FE64.9010909@FreeBSD.org> Date: Fri, 02 Dec 2011 00:23:32 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: Mark Saad References: <1769030615.700252.1322693541806.JavaMail.root@erie.cs.uoguelph.ca> <4ED6B7CA.7050108@FreeBSD.org> <201112011642.53968.jhb@freebsd.org> In-Reply-To: <201112011642.53968.jhb@freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 01 Dec 2011 23:17:29 +0000 Cc: Rick Macklem , John Baldwin , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , Doug Barton , src-committers@FreeBSD.org, Rick Macklem , svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 22:23:50 -0000 on 01/12/2011 23:42 John Baldwin said the following: > On Thursday, December 01, 2011 10:59:54 am Mark Saad wrote: >> On Wed, Nov 30, 2011 at 6:10 PM, Doug Barton wrote: >>> On 11/30/2011 14:52, Rick Macklem wrote: >>>> I'm relatively new to FreeBSD, but I've never heard of an MFC to a >>>> Release branch. (As far as I know, if it ever happens, it's for a >>>> serious errata or security issue.) >>> >>> You are correct sir. :) >>> >> So how would I ever see this in an official release as an errata fix ? > > At this point you likely won't. The vast majority of patches to releases are > only for security advisories. Very few errata are merged back to releases > currently. It may be that we are too hesitant to do so, but the manpower > overhead of actually getting the changes merged back and getting appropriate > folks to sign off on everything is extremely high (and the exact process for > getting an EN approved is not very clear or really even documented to my > knowledge). > Just to clarify - the fix will be in the future (official) releases from 8, 9 and so on branches. -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 13:54:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7B8106564A; Sat, 3 Dec 2011 13:54:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28D428FC08; Sat, 3 Dec 2011 13:54:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3Dst6d041954; Sat, 3 Dec 2011 13:54:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3Dssua041947; Sat, 3 Dec 2011 13:54:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031354.pB3Dssua041947@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 13:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228223 - stable/8/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 13:54:55 -0000 Author: hselasky Date: Sat Dec 3 13:54:54 2011 New Revision: 228223 URL: http://svn.freebsd.org/changeset/base/228223 Log: MFC r227404: Add USB 3.0 descriptor support. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb.h stable/8/lib/libusb/libusb10_desc.c stable/8/lib/libusb/libusb20_desc.c stable/8/lib/libusb/libusb20_desc.h Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/Makefile Sat Dec 3 13:54:54 2011 (r228223) @@ -72,6 +72,10 @@ MLINKS += libusb.3 libusb_get_config_des MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 MLINKS += libusb.3 libusb_free_config_descriptor.3 MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 +MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_parse_bos_descriptor.3 +MLINKS += libusb.3 libusb_free_bos_descriptor.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 MLINKS += libusb.3 libusb_submit_transfer.3 Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/libusb.3 Sat Dec 3 13:54:54 2011 (r228223) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2011 +.Dd November 9, 2011 .Dt LIBUSB 3 .Os .Sh NAME @@ -316,6 +316,40 @@ Retrieve a string descriptor in C style Returns the positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure. .Pp +.Ft int +.Fn libusb_parse_ss_endpoint_comp "const void *buf" "int len" "libusb_ss_endpoint_companion_descriptor **ep_comp" +This function parses the USB 3.0 endpoint companion descriptor in host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +Typically these arguments are the extra and extra_length fields of the +endpoint descriptor. +On success the pointer to resulting descriptor is stored at the location given by +.Fa ep_comp. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed USB 3.0 endpoint companion descriptor must be +freed using the libusb_free_ss_endpoint_comp function. +.Pp +.Ft void +.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp" +This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor. +.Pp +.Ft int +.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos" +This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +On success the pointer to resulting descriptor is stored at the location given by +.Fa bos. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed BOS descriptor must be freed using the +libusb_free_bos_descriptor function. +.Pp +.Ft void +.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" +This function is NULL safe and frees a parsed BOS descriptor. +.Pp .Sh USB ASYNCHRONOUS I/O .Pp .Ft struct libusb_transfer * Modified: stable/8/lib/libusb/libusb.h ============================================================================== --- stable/8/lib/libusb/libusb.h Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/libusb.h Sat Dec 3 13:54:54 2011 (r228223) @@ -63,6 +63,16 @@ enum libusb_descriptor_type { LIBUSB_DT_REPORT = 0x22, LIBUSB_DT_PHYSICAL = 0x23, LIBUSB_DT_HUB = 0x29, + LIBUSB_DT_BOS = 0x0f, + LIBUSB_DT_DEVICE_CAPABILITY = 0x10, + LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +enum libusb_device_capability_type { + LIBUSB_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; #define LIBUSB_DT_DEVICE_SIZE 18 @@ -71,6 +81,10 @@ enum libusb_descriptor_type { #define LIBUSB_DT_ENDPOINT_SIZE 7 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 #define LIBUSB_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB_DT_BOS_SIZE 5 +#define LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f #define LIBUSB_ENDPOINT_DIR_MASK 0x80 @@ -230,6 +244,14 @@ typedef struct libusb_endpoint_descripto int extra_length; } libusb_endpoint_descriptor __aligned(sizeof(void *)); +typedef struct libusb_ss_endpoint_companion_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bMaxBurst; + uint8_t bmAttributes; + uint16_t wBytesPerInterval; +} libusb_ss_endpoint_companion_descriptor __aligned(sizeof(void *)); + typedef struct libusb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; @@ -264,6 +286,39 @@ typedef struct libusb_config_descriptor int extra_length; } libusb_config_descriptor __aligned(sizeof(void *)); +typedef struct libusb_usb_2_0_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint32_t bmAttributes; +#define LIBUSB_USB_2_0_CAPABILITY_LPM_SUPPORT (1 << 1) +} libusb_usb_2_0_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_ss_usb_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bmAttributes; +#define LIBUSB_SS_USB_CAPABILITY_LPM_SUPPORT (1 << 1) + uint16_t wSpeedSupported; +#define LIBUSB_CAPABILITY_LOW_SPEED_OPERATION (1) +#define LIBUSB_CAPABILITY_FULL_SPEED_OPERATION (1 << 1) +#define LIBUSB_CAPABILITY_HIGH_SPEED_OPERATION (1 << 2) +#define LIBUSB_CAPABILITY_5GBPS_OPERATION (1 << 3) + uint8_t bFunctionalitySupport; + uint8_t bU1DevExitLat; + uint16_t wU2DevExitLat; +} libusb_ss_usb_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_bos_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumDeviceCapabilities; + struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; + struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; +} libusb_bos_descriptor __aligned(sizeof(void *)); + typedef struct libusb_control_setup { uint8_t bmRequestType; uint8_t bRequest; @@ -345,6 +400,10 @@ int libusb_get_config_descriptor_by_valu void libusb_free_config_descriptor(struct libusb_config_descriptor *config); int libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length); int libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length); +int libusb_parse_ss_endpoint_comp(const void *buf, int len, struct libusb_ss_endpoint_companion_descriptor **ep_comp); +void libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp); +int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos); +void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); /* Asynchronous device I/O */ Modified: stable/8/lib/libusb/libusb10_desc.c ============================================================================== --- stable/8/lib/libusb/libusb10_desc.c Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/libusb10_desc.c Sat Dec 3 13:54:54 2011 (r228223) @@ -298,7 +298,7 @@ libusb_get_string_descriptor_ascii(libus uint8_t desc_index, unsigned char *data, int length) { if (pdev == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -318,7 +318,7 @@ libusb_get_descriptor(libusb_device_hand uint8_t desc_index, uint8_t *data, int length) { if (devh == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -327,3 +327,172 @@ libusb_get_descriptor(libusb_device_hand LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, length, 1000)); } + +int +libusb_parse_ss_endpoint_comp(const void *buf, int len, + struct libusb_ss_endpoint_companion_descriptor **ep_comp) +{ + if (buf == NULL || ep_comp == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *ep_comp = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE && + dtype == LIBUSB_DT_SS_ENDPOINT_COMPANION) { + struct libusb_ss_endpoint_companion_descriptor *ptr; + + ptr = malloc(sizeof(*ptr)); + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + ptr->bLength = LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE; + ptr->bDescriptorType = dtype; + ptr->bMaxBurst = ((const uint8_t *)buf)[2]; + ptr->bmAttributes = ((const uint8_t *)buf)[3]; + ptr->wBytesPerInterval = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + + *ep_comp = ptr; + + return (0); /* success */ + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp) +{ + if (ep_comp == NULL) + return; + + free(ep_comp); +} + +int +libusb_parse_bos_descriptor(const void *buf, int len, + struct libusb_bos_descriptor **bos) +{ + struct libusb_bos_descriptor *ptr; + struct libusb_usb_2_0_device_capability_descriptor *dcap_20; + struct libusb_ss_usb_device_capability_descriptor *ss_cap; + + if (buf == NULL || bos == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *bos = ptr = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_BOS_SIZE && + dtype == LIBUSB_DT_BOS) { + + ptr = malloc(sizeof(*ptr) + sizeof(*dcap_20) + + sizeof(*ss_cap)); + + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + *bos = ptr; + + ptr->bLength = LIBUSB_DT_BOS_SIZE; + ptr->bDescriptorType = dtype; + ptr->wTotalLength = ((const uint8_t *)buf)[2] | + (((const uint8_t *)buf)[3] << 8); + ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4]; + ptr->usb_2_0_ext_cap = NULL; + ptr->ss_usb_cap = NULL; + + dcap_20 = (void *)(ptr + 1); + ss_cap = (void *)(dcap_20 + 1); + } + if (dlen >= 3 && + ptr != NULL && + dtype == LIBUSB_DT_DEVICE_CAPABILITY) { + switch (((const uint8_t *)buf)[2]) { + case LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY: + if (ptr->usb_2_0_ext_cap != NULL) + break; + if (dlen < LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE) + break; + + ptr->usb_2_0_ext_cap = dcap_20; + + dcap_20->bLength = LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE; + dcap_20->bDescriptorType = dtype; + dcap_20->bDevCapabilityType = ((const uint8_t *)buf)[2]; + dcap_20->bmAttributes = ((const uint8_t *)buf)[3] | + (((const uint8_t *)buf)[4] << 8) | + (((const uint8_t *)buf)[5] << 16) | + (((const uint8_t *)buf)[6] << 24); + break; + + case LIBUSB_SS_USB_DEVICE_CAPABILITY: + if (ptr->ss_usb_cap != NULL) + break; + if (dlen < LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE) + break; + + ptr->ss_usb_cap = ss_cap; + + ss_cap->bLength = LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE; + ss_cap->bDescriptorType = dtype; + ss_cap->bDevCapabilityType = ((const uint8_t *)buf)[2]; + ss_cap->bmAttributes = ((const uint8_t *)buf)[3]; + ss_cap->wSpeedSupported = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + ss_cap->bFunctionalitySupport = ((const uint8_t *)buf)[6]; + ss_cap->bU1DevExitLat = ((const uint8_t *)buf)[7]; + ss_cap->wU2DevExitLat = ((const uint8_t *)buf)[8] | + (((const uint8_t *)buf)[9] << 8); + break; + + default: + break; + } + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + if (ptr != NULL) + return (0); /* success */ + + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) +{ + if (bos == NULL) + return; + + free(bos); +} Modified: stable/8/lib/libusb/libusb20_desc.c ============================================================================== --- stable/8/lib/libusb/libusb20_desc.c Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/libusb20_desc.c Sat Dec 3 13:54:54 2011 (r228223) @@ -41,6 +41,10 @@ LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_END LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_INTERFACE_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONFIG_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONTROL_SETUP); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_ENDPT_COMP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_USB_20_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_USB_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_BOS_DESCRIPTOR); /*------------------------------------------------------------------------* * libusb20_parse_config_desc Modified: stable/8/lib/libusb/libusb20_desc.h ============================================================================== --- stable/8/lib/libusb/libusb20_desc.h Sat Dec 3 13:51:57 2011 (r228222) +++ stable/8/lib/libusb/libusb20_desc.h Sat Dec 3 13:54:54 2011 (r228223) @@ -264,6 +264,43 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_CONFIG_DES LIBUSB20_MAKE_STRUCT(LIBUSB20_CONTROL_SETUP); +#define LIBUSB20_SS_ENDPT_COMP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bMaxBurst, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wBytesPerInterval, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_ENDPT_COMP_DESC); + +#define LIBUSB20_USB_20_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT32_T, bmAttributes, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); + +#define LIBUSB20_SS_USB_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wSpeedSupported, ) \ + m(n, UINT8_T, bFunctionalitySupport, ) \ + m(n, UINT8_T, bU1DevExitLat, ) \ + m(n, UINT16_T, wU2DevExitLat, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); + +#define LIBUSB20_BOS_DESCRIPTOR(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT16_T, wTotalLength, ) \ + m(n, UINT8_T, bNumDeviceCapabilities, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); + /* standard USB stuff */ /** \ingroup desc @@ -333,6 +370,24 @@ enum libusb20_descriptor_type { /** Hub descriptor */ LIBUSB20_DT_HUB = 0x29, + + /** Binary Object Store, BOS */ + LIBUSB20_DT_BOS = 0x0f, + + /** Device Capability */ + LIBUSB20_DT_DEVICE_CAPABILITY = 0x10, + + /** SuperSpeed endpoint companion */ + LIBUSB20_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +/** \ingroup desc + * Device capability types as defined by the USB specification. */ +enum libusb20_device_capability_type { + LIBUSB20_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB20_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB20_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; /* Descriptor sizes per descriptor type */ @@ -342,6 +397,10 @@ enum libusb20_descriptor_type { #define LIBUSB20_DT_ENDPOINT_SIZE 7 #define LIBUSB20_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ #define LIBUSB20_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB20_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB20_DT_BOS_SIZE 5 +#define LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB20_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB20_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ #define LIBUSB20_ENDPOINT_DIR_MASK 0x80 From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:02:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6391065672; Sat, 3 Dec 2011 14:02:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4C578FC13; Sat, 3 Dec 2011 14:02:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3E2PVT042256; Sat, 3 Dec 2011 14:02:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3E2POa042251; Sat, 3 Dec 2011 14:02:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031402.pB3E2POa042251@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228224 - in stable/8/sys/dev/usb: . quirk wlan X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:02:26 -0000 Author: hselasky Date: Sat Dec 3 14:02:25 2011 New Revision: 228224 URL: http://svn.freebsd.org/changeset/base/228224 Log: MFC r227610 and r227781: Add new USB IDs. PR: usb/162712 Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs stable/8/sys/dev/usb/wlan/if_run.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Sat Dec 3 13:54:54 2011 (r228223) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Sat Dec 3 14:02:25 2011 (r228224) @@ -148,10 +148,6 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(AIPTEK, POCKETCAM3M, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), - USB_QUIRK(ALCOR, SDCR_6335, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(ALCOR, SDCR_6362, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, @@ -462,6 +458,7 @@ static struct usb_quirk_entry usb_quirks * Quirks for manufacturers which USB devices does not respond * after issuing non-supported commands: */ + USB_QUIRK(ALCOR, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sat Dec 3 13:54:54 2011 (r228223) +++ stable/8/sys/dev/usb/usbdevs Sat Dec 3 14:02:25 2011 (r228224) @@ -913,8 +913,10 @@ product ALCATEL OT535 0x02df One Touch /* Alcor Micro, Inc. products */ product ALCOR2 KBD_HUB 0x2802 Kbd Hub +product ALCOR DUMMY 0x0000 Dummy product product ALCOR SDCR_6335 0x6335 SD/MMC Card Reader product ALCOR SDCR_6362 0x6362 SD/MMC Card Reader +product ALCOR SDCR_6366 0x6366 SD/MMC Card Reader product ALCOR TRANSCEND 0x6387 Transcend JetFlash Drive product ALCOR MA_KBD_HUB 0x9213 MacAlly Kbd Hub product ALCOR AU9814 0x9215 AU9814 Hub @@ -2082,6 +2084,7 @@ product LINKSYS4 RT3070 0x0078 RT3070 product LINKSYS4 WUSB600NV2 0x0079 WUSB600N v2 /* Logitech products */ +product LOGITECH LANW300NU2 0x0166 LAN-W300N/U2 product LOGITECH M2452 0x0203 M2452 keyboard product LOGITECH M4848 0x0301 M4848 mouse product LOGITECH PAGESCAN 0x040f PageScan @@ -2177,6 +2180,7 @@ product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN product MELCO WLIUCG301N 0x016f WLI-UC-G301N +product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Sat Dec 3 13:54:54 2011 (r228223) +++ stable/8/sys/dev/usb/wlan/if_run.c Sat Dec 3 14:02:25 2011 (r228224) @@ -208,12 +208,14 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_1), RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), + RUN_DEV(LOGITECH, LANW300NU2), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), RUN_DEV(MELCO, WLIUCG300N), RUN_DEV(MELCO, WLIUCG301N), RUN_DEV(MELCO, WLIUCGN), + RUN_DEV(MELCO, WLIUCGNM), RUN_DEV(MOTOROLA4, RT2770), RUN_DEV(MOTOROLA4, RT3070), RUN_DEV(MSI, RT3070_1), From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:11:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C158F1065670; Sat, 3 Dec 2011 14:11:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46DD8FC0A; Sat, 3 Dec 2011 14:11:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3EBl8s042616; Sat, 3 Dec 2011 14:11:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3EBlRp042613; Sat, 3 Dec 2011 14:11:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031411.pB3EBlRp042613@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228226 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:11:48 -0000 Author: hselasky Date: Sat Dec 3 14:11:47 2011 New Revision: 228226 URL: http://svn.freebsd.org/changeset/base/228226 Log: MFC r227108, r227383 and r227463: Add support for modem control lines and GPIO pins to USLCOM driver. PR: usb/162307 Modified: stable/8/sys/dev/usb/serial/uslcom.c stable/8/sys/dev/usb/usb_ioctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Sat Dec 3 14:03:53 2011 (r228225) +++ stable/8/sys/dev/usb/serial/uslcom.c Sat Dec 3 14:11:47 2011 (r228226) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR uslcom_debug @@ -63,49 +64,72 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_SET_DATA_BITS(x) ((x) << 8) +/* Request types */ #define USLCOM_WRITE 0x41 #define USLCOM_READ 0xc1 +/* Request codes */ #define USLCOM_UART 0x00 #define USLCOM_BAUD_RATE 0x01 #define USLCOM_DATA 0x03 #define USLCOM_BREAK 0x05 #define USLCOM_CTRL 0x07 +#define USLCOM_RCTRL 0x08 +#define USLCOM_SET_FLOWCTRL 0x13 +#define USLCOM_VENDOR_SPECIFIC 0xff +/* USLCOM_UART values */ #define USLCOM_UART_DISABLE 0x00 #define USLCOM_UART_ENABLE 0x01 +/* USLCOM_CTRL/USLCOM_RCTRL values */ #define USLCOM_CTRL_DTR_ON 0x0001 #define USLCOM_CTRL_DTR_SET 0x0100 #define USLCOM_CTRL_RTS_ON 0x0002 #define USLCOM_CTRL_RTS_SET 0x0200 #define USLCOM_CTRL_CTS 0x0010 #define USLCOM_CTRL_DSR 0x0020 +#define USLCOM_CTRL_RI 0x0040 #define USLCOM_CTRL_DCD 0x0080 +/* USLCOM_BAUD_RATE values */ #define USLCOM_BAUD_REF 0x384000 +/* USLCOM_DATA values */ #define USLCOM_STOP_BITS_1 0x00 #define USLCOM_STOP_BITS_2 0x02 - #define USLCOM_PARITY_NONE 0x00 #define USLCOM_PARITY_ODD 0x10 #define USLCOM_PARITY_EVEN 0x20 -#define USLCOM_PORT_NO 0xFFFF /* XXX think this should be 0 --hps */ +#define USLCOM_PORT_NO 0x0000 +/* USLCOM_BREAK values */ #define USLCOM_BREAK_OFF 0x00 #define USLCOM_BREAK_ON 0x01 +/* USLCOM_SET_FLOWCTRL values - 1st word */ +#define USLCOM_FLOW_DTR_ON 0x00000001 /* DTR static active */ +#define USLCOM_FLOW_CTS_HS 0x00000008 /* CTS handshake */ +/* USLCOM_SET_FLOWCTRL values - 2nd word */ +#define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ +#define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ + +/* USLCOM_VENDOR_SPECIFIC values */ +#define USLCOM_WRITE_LATCH 0x37E1 +#define USLCOM_READ_LATCH 0x00C2 + enum { USLCOM_BULK_DT_WR, USLCOM_BULK_DT_RD, + USLCOM_CTRL_DT_RD, USLCOM_N_TRANSFER, }; struct uslcom_softc { struct ucom_super_softc sc_super_ucom; struct ucom_softc sc_ucom; + struct usb_callout sc_watchdog; struct usb_xfer *sc_xfer[USLCOM_N_TRANSFER]; struct usb_device *sc_udev; @@ -121,12 +145,15 @@ static device_detach_t uslcom_detach; static usb_callback_t uslcom_write_callback; static usb_callback_t uslcom_read_callback; +static usb_callback_t uslcom_control_callback; static void uslcom_open(struct ucom_softc *); static void uslcom_close(struct ucom_softc *); static void uslcom_set_dtr(struct ucom_softc *, uint8_t); static void uslcom_set_rts(struct ucom_softc *, uint8_t); static void uslcom_set_break(struct ucom_softc *, uint8_t); +static int uslcom_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, + struct thread *); static int uslcom_pre_param(struct ucom_softc *, struct termios *); static void uslcom_param(struct ucom_softc *, struct termios *); static void uslcom_get_status(struct ucom_softc *, uint8_t *, uint8_t *); @@ -143,7 +170,7 @@ static const struct usb_config uslcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = USLCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = &uslcom_write_callback, }, @@ -155,6 +182,15 @@ static const struct usb_config uslcom_co .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &uslcom_read_callback, }, + [USLCOM_CTRL_DT_RD] = { + .type = UE_CONTROL, + .endpoint = 0x00, + .direction = UE_DIR_ANY, + .bufsize = sizeof(struct usb_device_request) + 8, + .flags = {.pipe_bof = 1,}, + .callback = &uslcom_control_callback, + .timeout = 1000, /* 1 second timeout */ + }, }; static struct ucom_callback uslcom_callback = { @@ -164,6 +200,7 @@ static struct ucom_callback uslcom_callb .ucom_cfg_set_dtr = &uslcom_set_dtr, .ucom_cfg_set_rts = &uslcom_set_rts, .ucom_cfg_set_break = &uslcom_set_break, + .ucom_ioctl = &uslcom_ioctl, .ucom_cfg_param = &uslcom_param, .ucom_pre_param = &uslcom_pre_param, .ucom_start_read = &uslcom_start_read, @@ -280,6 +317,19 @@ MODULE_DEPEND(uslcom, ucom, 1, 1, 1); MODULE_DEPEND(uslcom, usb, 1, 1, 1); MODULE_VERSION(uslcom, 1); +static void +uslcom_watchdog(void *arg) +{ + struct uslcom_softc *sc = arg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + + usbd_transfer_start(sc->sc_xfer[USLCOM_CTRL_DT_RD]); + + usb_callout_reset(&sc->sc_watchdog, + hz / 4, &uslcom_watchdog, sc); +} + static int uslcom_probe(device_t dev) { @@ -310,6 +360,7 @@ uslcom_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uslcom", NULL, MTX_DEF); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_udev = uaa->device; @@ -350,6 +401,8 @@ uslcom_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, USLCOM_N_TRANSFER); + + usb_callout_drain(&sc->sc_watchdog); mtx_destroy(&sc->sc_mtx); return (0); @@ -371,6 +424,9 @@ uslcom_open(struct ucom_softc *ucom) &req, NULL, 0, 1000)) { DPRINTF("UART enable failed (ignored)\n"); } + + /* start polling status */ + uslcom_watchdog(sc); } static void @@ -379,13 +435,16 @@ uslcom_close(struct ucom_softc *ucom) struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; + /* stop polling status */ + usb_callout_stop(&sc->sc_watchdog); + req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; USETW(req.wValue, USLCOM_UART_DISABLE); USETW(req.wIndex, USLCOM_PORT_NO); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("UART disable failed (ignored)\n"); } @@ -452,6 +511,7 @@ uslcom_param(struct ucom_softc *ucom, st { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; + uint32_t flowctrl[4]; uint16_t data; DPRINTF("\n"); @@ -503,7 +563,28 @@ uslcom_param(struct ucom_softc *ucom, st &req, NULL, 0, 1000)) { DPRINTF("Set format failed (ignored)\n"); } - return; + + if (t->c_cflag & CRTSCTS) { + flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS); + flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS); + flowctrl[2] = 0; + flowctrl[3] = 0; + } else { + flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON); + flowctrl[1] = htole32(USLCOM_FLOW_RTS_ON); + flowctrl[2] = 0; + flowctrl[3] = 0; + } + req.bmRequestType = USLCOM_WRITE; + req.bRequest = USLCOM_SET_FLOWCTRL; + USETW(req.wValue, 0); + USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wLength, sizeof(flowctrl)); + + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, flowctrl, 0, 1000)) { + DPRINTF("Set flowcontrol failed (ignored)\n"); + } } static void @@ -536,6 +617,55 @@ uslcom_set_break(struct ucom_softc *ucom } } +static int +uslcom_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, + int flag, struct thread *td) +{ + struct uslcom_softc *sc = ucom->sc_parent; + struct usb_device_request req; + int error = 0; + uint8_t latch; + + DPRINTF("cmd=0x%08x\n", cmd); + + switch (cmd) { + case USB_GET_GPIO: + req.bmRequestType = USLCOM_READ; + req.bRequest = USLCOM_VENDOR_SPECIFIC; + USETW(req.wValue, USLCOM_READ_LATCH); + USETW(req.wIndex, 0); + USETW(req.wLength, sizeof(latch)); + + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, &latch, 0, 1000)) { + DPRINTF("Get LATCH failed\n"); + error = EIO; + } + *(int *)data = latch; + break; + + case USB_SET_GPIO: + req.bmRequestType = USLCOM_WRITE; + req.bRequest = USLCOM_VENDOR_SPECIFIC; + USETW(req.wValue, USLCOM_WRITE_LATCH); + USETW(req.wIndex, (*(int *)data)); + USETW(req.wLength, 0); + + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, NULL, 0, 1000)) { + DPRINTF("Set LATCH failed\n"); + error = EIO; + } + break; + + default: + DPRINTF("Unknown IOCTL\n"); + error = ENOIOCTL; + break; + } + return (error); +} + static void uslcom_write_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -599,6 +729,59 @@ tr_setup: } static void +uslcom_control_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uslcom_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + struct usb_device_request req; + uint8_t msr = 0; + uint8_t buf; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 1); + usbd_copy_out(pc, 0, &buf, sizeof(buf)); + if (buf & USLCOM_CTRL_CTS) + msr |= SER_CTS; + if (buf & USLCOM_CTRL_DSR) + msr |= SER_DSR; + if (buf & USLCOM_CTRL_RI) + msr |= SER_RI; + if (buf & USLCOM_CTRL_DCD) + msr |= SER_DCD; + + if (msr != sc->sc_msr) { + DPRINTF("status change msr=0x%02x " + "(was 0x%02x)\n", msr, sc->sc_msr); + sc->sc_msr = msr; + ucom_status_change(&sc->sc_ucom); + } + break; + + case USB_ST_SETUP: + req.bmRequestType = USLCOM_READ; + req.bRequest = USLCOM_RCTRL; + USETW(req.wValue, 0); + USETW(req.wIndex, USLCOM_PORT_NO); + USETW(req.wLength, sizeof(buf)); + + usbd_xfer_set_frames(xfer, 2); + usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); + usbd_xfer_set_frame_len(xfer, 1, sizeof(buf)); + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_in(pc, 0, &req, sizeof(req)); + usbd_transfer_submit(xfer); + break; + + default: /* error */ + if (error != USB_ERR_CANCELLED) + DPRINTF("error=%s\n", usbd_errstr(error)); + break; + } +} + +static void uslcom_start_read(struct ucom_softc *ucom) { struct uslcom_softc *sc = ucom->sc_parent; Modified: stable/8/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/8/sys/dev/usb/usb_ioctl.h Sat Dec 3 14:03:53 2011 (r228225) +++ stable/8/sys/dev/usb/usb_ioctl.h Sat Dec 3 14:11:47 2011 (r228226) @@ -289,6 +289,10 @@ struct usb_gen_quirk { #define USB_GET_CM_OVER_DATA _IOR ('U', 180, int) #define USB_SET_CM_OVER_DATA _IOW ('U', 181, int) +/* GPIO control */ +#define USB_GET_GPIO _IOR ('U', 182, int) +#define USB_SET_GPIO _IOW ('U', 183, int) + /* USB file system interface */ #define USB_FS_START _IOW ('U', 192, struct usb_fs_start) #define USB_FS_STOP _IOW ('U', 193, struct usb_fs_stop) From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:29:15 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97EAC106564A; Sat, 3 Dec 2011 14:29:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85B078FC08; Sat, 3 Dec 2011 14:29:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3ETFXc043188; Sat, 3 Dec 2011 14:29:15 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3ETFae043183; Sat, 3 Dec 2011 14:29:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031429.pB3ETFae043183@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228227 - in stable/8/sys/dev/usb: . controller X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:29:15 -0000 Author: hselasky Date: Sat Dec 3 14:29:14 2011 New Revision: 228227 URL: http://svn.freebsd.org/changeset/base/228227 Log: MFC r227541, r227654, r226803, r227396 and r227401: Fix for XHCI attach failure and some USB 3.0 descriptor corrections. Modified: stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/controller/xhcireg.h stable/8/sys/dev/usb/usb.h stable/8/sys/dev/usb/usb_hub.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Sat Dec 3 14:11:47 2011 (r228226) +++ stable/8/sys/dev/usb/controller/xhci.c Sat Dec 3 14:29:14 2011 (r228227) @@ -292,7 +292,7 @@ xhci_start_controller(struct xhci_softc XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBCMD) & (XHCI_CMD_HCRST | XHCI_STS_CNR); if (!temp) @@ -453,7 +453,7 @@ xhci_start_controller(struct xhci_softc XHCI_CMD_INTE | XHCI_CMD_HSEE); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (!temp) break; @@ -487,7 +487,7 @@ xhci_halt_controller(struct xhci_softc * XWRITE4(sc, oper, XHCI_USBCMD, 0); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (temp) break; @@ -1110,7 +1110,7 @@ xhci_cmd_nop(struct xhci_softc *sc) trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } #endif @@ -1127,7 +1127,7 @@ xhci_cmd_enable_slot(struct xhci_softc * trb.dwTrb2 = 0; trb.dwTrb3 = htole32(XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ENABLE_SLOT)); - err = xhci_do_command(sc, &trb, 50 /* ms */); + err = xhci_do_command(sc, &trb, 100 /* ms */); if (err) goto done; @@ -1154,7 +1154,7 @@ xhci_cmd_disable_slot(struct xhci_softc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1310,7 +1310,7 @@ xhci_cmd_configure_ep(struct xhci_softc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1328,7 +1328,7 @@ xhci_cmd_evaluate_ctx(struct xhci_softc XHCI_TRB_3_SLOT_SET(slot_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1351,7 +1351,7 @@ xhci_cmd_reset_ep(struct xhci_softc *sc, trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1373,7 +1373,7 @@ xhci_cmd_set_tr_dequeue_ptr(struct xhci_ XHCI_TRB_3_EP_SET(ep_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1396,7 +1396,7 @@ xhci_cmd_stop_ep(struct xhci_softc *sc, trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1414,7 +1414,7 @@ xhci_cmd_reset_dev(struct xhci_softc *sc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } /*------------------------------------------------------------------------* @@ -2831,7 +2831,7 @@ struct xhci_bos_desc xhci_bosd = { .bLength = sizeof(xhci_bosd.usb2extd), .bDescriptorType = 1, .bDevCapabilityType = 2, - .bmAttributes = 2, + .bmAttributes[0] = 2, }, .usbdcd = { .bLength = sizeof(xhci_bosd.usbdcd), @@ -2841,7 +2841,8 @@ struct xhci_bos_desc xhci_bosd = { HSETW(.wSpeedsSupported, 0x000C), .bFunctionalitySupport = 8, .bU1DevExitLat = 255, /* dummy - not used */ - .bU2DevExitLat = 255, /* dummy - not used */ + .wU2DevExitLat[0] = 0x00, + .wU2DevExitLat[1] = 0x08, }, .cidd = { .bLength = sizeof(xhci_bosd.cidd), @@ -3048,7 +3049,9 @@ xhci_roothub_exec(struct usb_device *ude } port = XHCI_PORTSC(index); - v = XREAD4(sc, oper, port) & ~XHCI_PS_CLEAR; + v = XREAD4(sc, oper, port); + i = XHCI_PS_PLS_GET(v); + v &= ~XHCI_PS_CLEAR; switch (value) { case UHF_C_BH_PORT_RESET: @@ -3082,6 +3085,17 @@ xhci_roothub_exec(struct usb_device *ude XWRITE4(sc, oper, port, v & ~XHCI_PS_PIC_SET(3)); break; case UHF_PORT_SUSPEND: + + /* U3 -> U15 */ + if (i == 3) { + XWRITE4(sc, oper, port, v | + XHCI_PS_PLS_SET(0xF) | XHCI_PS_LWS); + } + + /* wait 20ms for resume sequence to complete */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); + + /* U0 */ XWRITE4(sc, oper, port, v | XHCI_PS_PLS_SET(0) | XHCI_PS_LWS); break; Modified: stable/8/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhcireg.h Sat Dec 3 14:11:47 2011 (r228226) +++ stable/8/sys/dev/usb/controller/xhcireg.h Sat Dec 3 14:29:14 2011 (r228227) @@ -133,7 +133,7 @@ #define XHCI_PS_WOE 0x08000000 /* RW - wake on over-current enable */ #define XHCI_PS_DR 0x40000000 /* RO - device removable */ #define XHCI_PS_WPR 0x80000000U /* RW - warm port reset */ -#define XHCI_PS_CLEAR 0x80FF00F7U /* command bits */ +#define XHCI_PS_CLEAR 0x80FF01FFU /* command bits */ #define XHCI_PORTPMSC(n) (0x3F4 + (0x10 * (n))) /* XHCI status and control */ #define XHCI_PM3_U1TO_GET(x) (((x) >> 0) & 0xFF) /* RW - U1 timeout */ Modified: stable/8/sys/dev/usb/usb.h ============================================================================== --- stable/8/sys/dev/usb/usb.h Sat Dec 3 14:11:47 2011 (r228226) +++ stable/8/sys/dev/usb/usb.h Sat Dec 3 14:29:14 2011 (r228227) @@ -323,7 +323,7 @@ struct usb_devcap_usb2ext_descriptor { uByte bLength; uByte bDescriptorType; uByte bDevCapabilityType; - uByte bmAttributes; + uDWord bmAttributes; #define USB_V2EXT_LPM 0x02 } __packed; typedef struct usb_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; @@ -336,7 +336,7 @@ struct usb_devcap_ss_descriptor { uWord wSpeedsSupported; uByte bFunctionalitySupport; uByte bU1DevExitLat; - uByte bU2DevExitLat; + uWord wU2DevExitLat; } __packed; typedef struct usb_devcap_ss_descriptor usb_devcap_ss_descriptor_t; @@ -686,6 +686,7 @@ struct usb_port_status { #define UPS_PORT_LS_HOT_RST 0x09 #define UPS_PORT_LS_COMP_MODE 0x0A #define UPS_PORT_LS_LOOPBACK 0x0B +#define UPS_PORT_LS_RESUME 0x0F #define UPS_PORT_POWER 0x0100 #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Sat Dec 3 14:11:47 2011 (r228226) +++ stable/8/sys/dev/usb/usb_hub.c Sat Dec 3 14:29:14 2011 (r228227) @@ -611,6 +611,7 @@ uhub_suspend_resume_port(struct uhub_sof switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) { case UPS_PORT_LS_U0: case UPS_PORT_LS_U1: + case UPS_PORT_LS_RESUME: is_suspend = 0; break; default: From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:32:11 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 247C8106564A; Sat, 3 Dec 2011 14:32:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135F78FC13; Sat, 3 Dec 2011 14:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3EWASi043327; Sat, 3 Dec 2011 14:32:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3EWAfR043325; Sat, 3 Dec 2011 14:32:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031432.pB3EWAfR043325@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228228 - stable/8/sys/dev/usb/wlan X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:32:11 -0000 Author: hselasky Date: Sat Dec 3 14:32:10 2011 New Revision: 228228 URL: http://svn.freebsd.org/changeset/base/228228 Log: MFC r228195: Fix checks for error return from urtw_alloc_rx_data_list() and urtw_alloc_tx_data_list(). Modified: stable/8/sys/dev/usb/wlan/if_urtw.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_urtw.c Sat Dec 3 14:29:14 2011 (r228227) +++ stable/8/sys/dev/usb/wlan/if_urtw.c Sat Dec 3 14:32:10 2011 (r228228) @@ -1053,10 +1053,10 @@ urtw_init_locked(void *arg) if (!(sc->sc_flags & URTW_INIT_ONCE)) { ret = urtw_alloc_rx_data_list(sc); - if (error != 0) + if (ret != 0) goto fail; ret = urtw_alloc_tx_data_list(sc); - if (error != 0) + if (ret != 0) goto fail; sc->sc_flags |= URTW_INIT_ONCE; } From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:38:55 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1324B1065670; Sat, 3 Dec 2011 14:38:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3D758FC08; Sat, 3 Dec 2011 14:38:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3Ecsfj043595; Sat, 3 Dec 2011 14:38:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3Ecsm6043567; Sat, 3 Dec 2011 14:38:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031438.pB3Ecsm6043567@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228229 - in stable/8/sys/dev/usb: . controller net serial storage template wlan X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:38:55 -0000 Author: hselasky Date: Sat Dec 3 14:38:54 2011 New Revision: 228229 URL: http://svn.freebsd.org/changeset/base/228229 Log: MFC r227461: Style change. - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. Modified: stable/8/sys/dev/usb/controller/at91dci.c stable/8/sys/dev/usb/controller/avr32dci.c stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/controller/ohci.c stable/8/sys/dev/usb/controller/uhci.c stable/8/sys/dev/usb/net/if_kue.c stable/8/sys/dev/usb/net/uhso.c stable/8/sys/dev/usb/serial/ufoma.c stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/umodem.c stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/serial/uvisor.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/storage/urio.c stable/8/sys/dev/usb/storage/ustorage_fs.c stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/usb_busdma.c stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_msctest.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/wlan/if_uath.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_urtw.c stable/8/sys/dev/usb/wlan/if_zyd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/at91dci.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/controller/at91dci.c Sat Dec 3 14:38:54 2011 (r228229) @@ -2123,7 +2123,7 @@ tr_handle_get_port_status: if (sc->sc_flags.status_vbus && sc->sc_flags.status_bus_reset) { /* reset endpoint flags */ - bzero(sc->sc_ep_flags, sizeof(sc->sc_ep_flags)); + memset(sc->sc_ep_flags, 0, sizeof(sc->sc_ep_flags)); } } if (sc->sc_flags.change_suspend) { Modified: stable/8/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/avr32dci.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/controller/avr32dci.c Sat Dec 3 14:38:54 2011 (r228229) @@ -415,12 +415,11 @@ repeat: buf_res.length = count; } /* receive data */ - bcopy(sc->physdata + + memcpy(buf_res.buffer, sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + - (td->ep_no << 16) + (td->offset % td->max_packet_size), - buf_res.buffer, buf_res.length) + (td->ep_no << 16) + (td->offset % td->max_packet_size), buf_res.length); /* update counters */ - count -= buf_res.length; + count -= buf_res.length; td->offset += buf_res.length; td->remainder -= buf_res.length; } @@ -491,12 +490,12 @@ repeat: buf_res.length = count; } /* transmit data */ - bcopy(buf_res.buffer, sc->physdata + + memcpy(sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + (td->ep_no << 16) + (td->offset % td->max_packet_size), - buf_res.length) + buf_res.buffer, buf_res.length); /* update counters */ - count -= buf_res.length; + count -= buf_res.length; td->offset += buf_res.length; td->remainder -= buf_res.length; } Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/controller/ehci.c Sat Dec 3 14:38:54 2011 (r228229) @@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude break; case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): DPRINTFN(9, "get port status i=%d\n", Modified: stable/8/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ohci.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/controller/ohci.c Sat Dec 3 14:38:54 2011 (r228229) @@ -2347,7 +2347,7 @@ ohci_roothub_exec(struct usb_device *ude case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): DPRINTFN(9, "get port status i=%d\n", Modified: stable/8/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/controller/uhci.c Sat Dec 3 14:38:54 2011 (r228229) @@ -2702,7 +2702,7 @@ uhci_roothub_exec(struct usb_device *ude break; case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): if (index == 1) Modified: stable/8/sys/dev/usb/net/if_kue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_kue.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/net/if_kue.c Sat Dec 3 14:38:54 2011 (r228229) @@ -380,8 +380,9 @@ kue_setmulti(struct usb_ether *ue) */ if (i == KUE_MCFILTCNT(sc)) break; - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - KUE_MCFILT(sc, i), ETHER_ADDR_LEN); + memcpy(KUE_MCFILT(sc, i), + LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + ETHER_ADDR_LEN); i++; } if_maddr_runlock(ifp); Modified: stable/8/sys/dev/usb/net/uhso.c ============================================================================== --- stable/8/sys/dev/usb/net/uhso.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/net/uhso.c Sat Dec 3 14:38:54 2011 (r228229) @@ -1153,7 +1153,7 @@ uhso_mux_read_callback(struct usb_xfer * /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - bzero(&req, sizeof(struct usb_device_request)); + memset(&req, 0, sizeof(struct usb_device_request)); req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UCDC_GET_ENCAPSULATED_RESPONSE; USETW(req.wValue, 0); @@ -1206,7 +1206,7 @@ uhso_mux_write_callback(struct usb_xfer usbd_get_page(pc, 0, &res); - bzero(&req, sizeof(struct usb_device_request)); + memset(&req, 0, sizeof(struct usb_device_request)); req.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.bRequest = UCDC_SEND_ENCAPSULATED_COMMAND; USETW(req.wValue, 0); @@ -1731,7 +1731,7 @@ uhso_if_rxflush(void *arg) * copy the IP-packet into it. */ m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - bcopy(mtod(m0, uint8_t *), mtod(m, uint8_t *), iplen); + memcpy(mtod(m, uint8_t *), mtod(m0, uint8_t *), iplen); m->m_pkthdr.len = m->m_len = iplen; /* Adjust the size of the original mbuf */ Modified: stable/8/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/8/sys/dev/usb/serial/ufoma.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/serial/ufoma.c Sat Dec 3 14:38:54 2011 (r228229) @@ -438,7 +438,7 @@ ufoma_attach(device_t dev) goto detach; } sc->sc_modetable[0] = (elements + 1); - bcopy(mad->bMode, &sc->sc_modetable[1], elements); + memcpy(&sc->sc_modetable[1], mad->bMode, elements); sc->sc_currentmode = UMCPC_ACM_MODE_UNLINKED; sc->sc_modetoactivate = mad->bMode[0]; @@ -968,7 +968,7 @@ ufoma_cfg_param(struct ucom_softc *ucom, } DPRINTF("\n"); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/serial/uftdi.c Sat Dec 3 14:38:54 2011 (r228229) @@ -560,7 +560,7 @@ static int uftdi_set_parm_soft(struct termios *t, struct uftdi_param_config *cfg, uint8_t type) { - bzero(cfg, sizeof(*cfg)); + memset(cfg, 0, sizeof(*cfg)); switch (type) { case UFTDI_TYPE_SIO: Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/serial/umodem.c Sat Dec 3 14:38:54 2011 (r228229) @@ -536,7 +536,7 @@ umodem_cfg_param(struct ucom_softc *ucom DPRINTF("sc=%p\n", sc); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/serial/uplcom.c Sat Dec 3 14:38:54 2011 (r228229) @@ -659,7 +659,7 @@ uplcom_cfg_param(struct ucom_softc *ucom DPRINTF("sc = %p\n", sc); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: stable/8/sys/dev/usb/serial/uvisor.c ============================================================================== --- stable/8/sys/dev/usb/serial/uvisor.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/serial/uvisor.c Sat Dec 3 14:38:54 2011 (r228229) @@ -311,8 +311,9 @@ uvisor_attach(device_t dev) int error; DPRINTF("sc=%p\n", sc); - bcopy(uvisor_config, uvisor_config_copy, + memcpy(uvisor_config_copy, uvisor_config, sizeof(uvisor_config_copy)); + device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uvisor", NULL, MTX_DEF); Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/storage/umass.c Sat Dec 3 14:38:54 2011 (r228229) @@ -891,7 +891,7 @@ umass_attach(device_t dev) int32_t err; /* - * NOTE: the softc struct is bzero-ed in device_set_driver. + * NOTE: the softc struct is cleared in device_set_driver. * We can safely call umass_detach without specifically * initializing the struct. */ @@ -1305,11 +1305,13 @@ umass_t_bbb_command_callback(struct usb_ } sc->cbw.bCDBLength = sc->sc_transfer.cmd_len; - bcopy(sc->sc_transfer.cmd_data, sc->cbw.CBWCDB, + memcpy(sc->cbw.CBWCDB, sc->sc_transfer.cmd_data, sc->sc_transfer.cmd_len); - bzero(sc->sc_transfer.cmd_data + sc->sc_transfer.cmd_len, - sizeof(sc->cbw.CBWCDB) - sc->sc_transfer.cmd_len); + memset(sc->sc_transfer.cmd_data + + sc->sc_transfer.cmd_len, 0, + sizeof(sc->cbw.CBWCDB) - + sc->sc_transfer.cmd_len); DIF(UDMASS_BBB, umass_bbb_dump_cbw(sc, &sc->cbw)); @@ -1480,9 +1482,9 @@ umass_t_bbb_status_callback(struct usb_x /* Zero missing parts of the CSW: */ - if (actlen < sizeof(sc->csw)) { - bzero(&sc->csw, sizeof(sc->csw)); - } + if (actlen < sizeof(sc->csw)) + memset(&sc->csw, 0, sizeof(sc->csw)); + pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, &sc->csw, actlen); @@ -2752,7 +2754,7 @@ umass_scsi_transform(struct umass_softc if (sc->sc_quirks & NO_TEST_UNIT_READY) { DPRINTF(sc, UDMASS_SCSI, "Converted TEST_UNIT_READY " "to START_UNIT\n"); - bzero(sc->sc_transfer.cmd_data, cmd_len); + memset(sc->sc_transfer.cmd_data, 0, cmd_len); sc->sc_transfer.cmd_data[0] = START_STOP_UNIT; sc->sc_transfer.cmd_data[4] = SSS_START; return (1); @@ -2765,14 +2767,14 @@ umass_scsi_transform(struct umass_softc * information. */ if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); sc->sc_transfer.cmd_data[4] = SHORT_INQUIRY_LENGTH; return (1); } break; } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); } @@ -2807,10 +2809,11 @@ umass_rbc_transform(struct umass_softc * case REQUEST_SENSE: case PREVENT_ALLOW: - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); if ((sc->sc_quirks & RBC_PAD_TO_12) && (cmd_len < 12)) { - bzero(sc->sc_transfer.cmd_data + cmd_len, 12 - cmd_len); + memset(sc->sc_transfer.cmd_data + cmd_len, + 0, 12 - cmd_len); cmd_len = 12; } sc->sc_transfer.cmd_len = cmd_len; @@ -2838,7 +2841,7 @@ umass_ufi_transform(struct umass_softc * sc->sc_transfer.cmd_len = UFI_COMMAND_LENGTH; /* Zero the command data */ - bzero(sc->sc_transfer.cmd_data, UFI_COMMAND_LENGTH); + memset(sc->sc_transfer.cmd_data, 0, UFI_COMMAND_LENGTH); switch (cmd_ptr[0]) { /* @@ -2895,7 +2898,7 @@ umass_ufi_transform(struct umass_softc * return (0); /* failure */ } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); /* success */ } @@ -2916,7 +2919,7 @@ umass_atapi_transform(struct umass_softc sc->sc_transfer.cmd_len = ATAPI_COMMAND_LENGTH; /* Zero the command data */ - bzero(sc->sc_transfer.cmd_data, ATAPI_COMMAND_LENGTH); + memset(sc->sc_transfer.cmd_data, 0, ATAPI_COMMAND_LENGTH); switch (cmd_ptr[0]) { /* @@ -2930,7 +2933,7 @@ umass_atapi_transform(struct umass_softc * information. */ if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); sc->sc_transfer.cmd_data[4] = SHORT_INQUIRY_LENGTH; return (1); @@ -2991,7 +2994,7 @@ umass_atapi_transform(struct umass_softc break; } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); /* success */ } Modified: stable/8/sys/dev/usb/storage/urio.c ============================================================================== --- stable/8/sys/dev/usb/storage/urio.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/storage/urio.c Sat Dec 3 14:38:54 2011 (r228229) @@ -440,7 +440,7 @@ urio_ioctl(struct usb_fifo *fifo, u_long error = EPERM; goto done; } - bzero(&ur, sizeof(ur)); + memset(&ur, 0, sizeof(ur)); rio_cmd = addr; ur.ucr_request.bmRequestType = rio_cmd->requesttype | UT_READ_VENDOR_DEVICE; @@ -451,7 +451,7 @@ urio_ioctl(struct usb_fifo *fifo, u_long error = EPERM; goto done; } - bzero(&ur, sizeof(ur)); + memset(&ur, 0, sizeof(ur)); rio_cmd = addr; ur.ucr_request.bmRequestType = rio_cmd->requesttype | UT_WRITE_VENDOR_DEVICE; Modified: stable/8/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- stable/8/sys/dev/usb/storage/ustorage_fs.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/storage/ustorage_fs.c Sat Dec 3 14:38:54 2011 (r228229) @@ -355,7 +355,7 @@ ustorage_fs_attach(device_t dev) int unit; /* - * NOTE: the softc struct is bzero-ed in device_set_driver. + * NOTE: the softc struct is cleared in device_set_driver. * We can safely call ustorage_fs_detach without specifically * initializing the struct. */ @@ -371,7 +371,9 @@ ustorage_fs_attach(device_t dev) * further */ ustorage_fs_ramdisk = - malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, M_ZERO | M_WAITOK); + malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, + M_ZERO | M_WAITOK); + if (ustorage_fs_ramdisk == NULL) { return (ENOMEM); } Modified: stable/8/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/template/usb_template.c Sat Dec 3 14:38:54 2011 (r228229) @@ -913,7 +913,7 @@ usb_hw_ep_resolve(struct usb_device *ude } ues = udev->bus->scratch[0].hw_ep_scratch; - bzero(ues, sizeof(*ues)); + memset(ues, 0, sizeof(*ues)); ues->ep_max = ues->ep; ues->cd = (void *)desc; @@ -1240,7 +1240,7 @@ usb_temp_setup(struct usb_device *udev, } uts = udev->bus->scratch[0].temp_setup; - bzero(uts, sizeof(*uts)); + memset(uts, 0, sizeof(*uts)); uts->usb_speed = udev->speed; uts->self_powered = udev->flags.self_powered; Modified: stable/8/sys/dev/usb/usb_busdma.c ============================================================================== --- stable/8/sys/dev/usb/usb_busdma.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_busdma.c Sat Dec 3 14:38:54 2011 (r228229) @@ -80,9 +80,9 @@ void usbd_get_page(struct usb_page_cache *pc, usb_frlength_t offset, struct usb_page_search *res) { +#if USB_HAVE_BUSDMA struct usb_page *page; -#if USB_HAVE_BUSDMA if (pc->page_start) { /* Case 1 - something has been loaded into DMA */ @@ -145,7 +145,7 @@ usbd_copy_in(struct usb_page_cache *cach if (buf_res.length > len) { buf_res.length = len; } - bcopy(ptr, buf_res.buffer, buf_res.length); + memcpy(buf_res.buffer, ptr, buf_res.length); offset += buf_res.length; len -= buf_res.length; @@ -267,7 +267,7 @@ usbd_copy_out(struct usb_page_cache *cac if (res.length > len) { res.length = len; } - bcopy(res.buffer, ptr, res.length); + memcpy(ptr, res.buffer, res.length); offset += res.length; len -= res.length; @@ -325,7 +325,7 @@ usbd_frame_zero(struct usb_page_cache *c if (res.length > len) { res.length = len; } - bzero(res.buffer, res.length); + memset(res.buffer, 0, res.length); offset += res.length; len -= res.length; @@ -560,7 +560,7 @@ usb_pc_alloc_mem(struct usb_page_cache * bus_dmamem_free(utag->tag, ptr, map); goto error; } - bzero(ptr, size); + memset(ptr, 0, size); usb_pc_cpu_flush(pc); @@ -797,7 +797,7 @@ usb_dma_tag_setup(struct usb_dma_parent_ struct mtx *mtx, usb_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt) { - bzero(udpt, sizeof(*udpt)); + memset(udpt, 0, sizeof(*udpt)); /* sanity checking */ if ((nudt == 0) || @@ -818,7 +818,7 @@ usb_dma_tag_setup(struct usb_dma_parent_ udpt->dma_bits = ndmabits; while (nudt--) { - bzero(udt, sizeof(*udt)); + memset(udt, 0, sizeof(*udt)); udt->tag_parent = udpt; udt++; } Modified: stable/8/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_compat_linux.c Sat Dec 3 14:38:54 2011 (r228229) @@ -564,7 +564,7 @@ usb_clear_halt(struct usb_device *dev, s type = uhe->desc.bmAttributes & UE_XFERTYPE; addr = uhe->desc.bEndpointAddress; - bzero(cfg, sizeof(cfg)); + memset(cfg, 0, sizeof(cfg)); cfg[0].type = type; cfg[0].endpoint = addr & UE_ADDR; @@ -709,12 +709,12 @@ usb_control_msg(struct usb_device *dev, urb->dev = dev; urb->endpoint = uhe; - bcopy(&req, urb->setup_packet, sizeof(req)); + memcpy(urb->setup_packet, &req, sizeof(req)); if (size && (!(req.bmRequestType & UT_READ))) { /* move the data to a real buffer */ - bcopy(data, USB_ADD_BYTES(urb->setup_packet, - sizeof(req)), size); + memcpy(USB_ADD_BYTES(urb->setup_packet, sizeof(req)), + data, size); } err = usb_start_wait_urb(urb, timeout, &actlen); @@ -789,7 +789,7 @@ usb_setup_endpoint(struct usb_device *de if (bufsize == 0) { return (0); } - bzero(cfg, sizeof(cfg)); + memset(cfg, 0, sizeof(cfg)); if (type == UE_ISOCHRONOUS) { @@ -1251,7 +1251,7 @@ usb_init_urb(struct urb *urb) if (urb == NULL) { return; } - bzero(urb, sizeof(*urb)); + memset(urb, 0, sizeof(*urb)); } /*------------------------------------------------------------------------* Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_dev.c Sat Dec 3 14:38:54 2011 (r228229) @@ -1809,8 +1809,8 @@ usb_fifo_free_buffer(struct usb_fifo *f) } /* reset queues */ - bzero(&f->free_q, sizeof(f->free_q)); - bzero(&f->used_q, sizeof(f->used_q)); + memset(&f->free_q, 0, sizeof(f->free_q)); + memset(&f->used_q, 0, sizeof(f->used_q)); } void @@ -1909,7 +1909,7 @@ usb_fifo_put_data_linear(struct usb_fifo io_len = MIN(len, m->cur_data_len); - bcopy(ptr, m->cur_data_ptr, io_len); + memcpy(m->cur_data_ptr, ptr, io_len); m->cur_data_len = io_len; ptr = USB_ADD_BYTES(ptr, io_len); @@ -2052,7 +2052,7 @@ usb_fifo_get_data_linear(struct usb_fifo io_len = MIN(len, m->cur_data_len); - bcopy(m->cur_data_ptr, ptr, io_len); + memcpy(ptr, m->cur_data_ptr, io_len); len -= io_len; ptr = USB_ADD_BYTES(ptr, io_len); Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_generic.c Sat Dec 3 14:38:54 2011 (r228229) @@ -240,7 +240,7 @@ ugen_open_pipe_write(struct usb_fifo *f) /* transfers are already opened */ return (0); } - bzero(usb_config, sizeof(usb_config)); + memset(usb_config, 0, sizeof(usb_config)); usb_config[1].type = UE_CONTROL; usb_config[1].endpoint = 0; @@ -308,7 +308,7 @@ ugen_open_pipe_read(struct usb_fifo *f) /* transfers are already opened */ return (0); } - bzero(usb_config, sizeof(usb_config)); + memset(usb_config, 0, sizeof(usb_config)); usb_config[1].type = UE_CONTROL; usb_config[1].endpoint = 0; Modified: stable/8/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_msctest.c Sat Dec 3 14:38:54 2011 (r228229) @@ -476,8 +476,8 @@ bbb_command_start(struct bbb_transfer *s sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; sc->cmd_len = cmd_len; - bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); - bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); + memset(&sc->cbw.CBWCDB, 0, sizeof(sc->cbw.CBWCDB)); + memcpy(&sc->cbw.CBWCDB, cmd_ptr, cmd_len); DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, &sc->cbw.CBWCDB, ":"); mtx_lock(&sc->mtx); Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_request.c Sat Dec 3 14:38:54 2011 (r228229) @@ -517,7 +517,7 @@ usbd_do_request_flags(struct usb_device } } else #endif - bcopy(desc, data, length); + memcpy(data, desc, length); } goto done; /* success */ } Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/usb_transfer.c Sat Dec 3 14:38:54 2011 (r228229) @@ -858,7 +858,7 @@ usbd_transfer_setup(struct usb_device *u if (parm.err) { goto done; } - bzero(&parm, sizeof(parm)); + memset(&parm, 0, sizeof(parm)); parm.udev = udev; parm.speed = usbd_get_speed(udev); @@ -982,7 +982,7 @@ usbd_transfer_setup(struct usb_device *u * memory: */ xfer = &dummy; - bzero(&dummy, sizeof(dummy)); + memset(&dummy, 0, sizeof(dummy)); refcount++; } Modified: stable/8/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_uath.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/wlan/if_uath.c Sat Dec 3 14:38:54 2011 (r228229) @@ -710,12 +710,12 @@ uath_cmdsend(struct uath_softc *sc, uint cmd->buflen = roundup2(sizeof(struct uath_cmd_hdr) + ilen, 4); hdr = (struct uath_cmd_hdr *)cmd->buf; - bzero(hdr, sizeof (struct uath_cmd_hdr)); /* XXX not needed */ + memset(hdr, 0, sizeof(struct uath_cmd_hdr)); hdr->len = htobe32(cmd->buflen); hdr->code = htobe32(code); hdr->msgid = cmd->msgid; /* don't care about endianness */ hdr->magic = htobe32((cmd->flags & UATH_CMD_FLAG_MAGIC) ? 1 << 24 : 0); - bcopy(idata, (uint8_t *)(hdr + 1), ilen); + memcpy((uint8_t *)(hdr + 1), idata, ilen); #ifdef UATH_DEBUG if (sc->sc_debug & UATH_DEBUG_CMDS) { @@ -1403,7 +1403,7 @@ uath_dataflush(struct uath_softc *sc) chunk->flags = UATH_CFLAGS_FINAL; chunk->length = htobe16(sizeof (struct uath_tx_desc)); - bzero(desc, sizeof(struct uath_tx_desc)); + memset(desc, 0, sizeof(struct uath_tx_desc)); desc->msglen = htobe32(sizeof(struct uath_tx_desc)); desc->msgid = (sc->sc_msgid++) + 1; /* don't care about endianness */ desc->type = htobe32(WDCMSG_FLUSH); @@ -1482,7 +1482,7 @@ uath_set_chan(struct uath_softc *sc, str #endif struct uath_cmd_reset reset; - bzero(&reset, sizeof reset); + memset(&reset, 0, sizeof(reset)); if (IEEE80211_IS_CHAN_2GHZ(c)) reset.flags |= htobe32(UATH_CHAN_2GHZ); if (IEEE80211_IS_CHAN_5GHZ(c)) @@ -1971,7 +1971,7 @@ uath_create_connection(struct uath_softc struct uath_cmd_create_connection create; ni = ieee80211_ref_node(vap->iv_bss); - bzero(&create, sizeof create); + memset(&create, 0, sizeof(create)); create.connid = htobe32(connid); create.bssid = htobe32(0); /* XXX packed or not? */ @@ -2000,7 +2000,7 @@ uath_set_rates(struct uath_softc *sc, co { struct uath_cmd_rates rates; - bzero(&rates, sizeof rates); + memset(&rates, 0, sizeof(rates)); rates.connid = htobe32(UATH_ID_BSS); /* XXX */ rates.size = htobe32(sizeof(struct uath_cmd_rateset)); /* XXX bounds check rs->rs_nrates */ @@ -2022,7 +2022,7 @@ uath_write_associd(struct uath_softc *sc struct uath_cmd_set_associd associd; ni = ieee80211_ref_node(vap->iv_bss); - bzero(&associd, sizeof associd); + memset(&associd, 0, sizeof(associd)); associd.defaultrateix = htobe32(1); /* XXX */ associd.associd = htobe32(ni->ni_associd); associd.timoffset = htobe32(0x3b); /* XXX */ @@ -2168,7 +2168,7 @@ uath_set_key(struct uath_softc *sc, cons struct uath_cmd_crypto crypto; int i; - bzero(&crypto, sizeof crypto); + memset(&crypto, 0, sizeof(crypto)); crypto.keyidx = htobe32(index); crypto.magic1 = htobe32(1); crypto.size = htobe32(368); @@ -2176,7 +2176,7 @@ uath_set_key(struct uath_softc *sc, cons crypto.flags = htobe32(0x80000068); if (index != UATH_DEFAULT_KEY) crypto.flags |= htobe32(index << 16); - memset(crypto.magic2, 0xff, sizeof crypto.magic2); + memset(crypto.magic2, 0xff, sizeof(crypto.magic2)); /* * Each byte of the key must be XOR'ed with 10101010 before being Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Sat Dec 3 14:38:54 2011 (r228229) @@ -432,7 +432,7 @@ upgt_get_stats(struct upgt_softc *sc) /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -540,7 +540,7 @@ upgt_set_led(struct upgt_softc *sc, int /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -670,7 +670,7 @@ upgt_set_macfilter(struct upgt_softc *sc /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -785,11 +785,11 @@ upgt_setup_rates(struct ieee80211vap *va * will pickup a rate. */ if (ic->ic_curmode == IEEE80211_MODE_11B) - bcopy(rateset_auto_11b, sc->sc_cur_rateset, + memcpy(sc->sc_cur_rateset, rateset_auto_11b, sizeof(sc->sc_cur_rateset)); if (ic->ic_curmode == IEEE80211_MODE_11G || ic->ic_curmode == IEEE80211_MODE_AUTO) - bcopy(rateset_auto_11g, sc->sc_cur_rateset, + memcpy(sc->sc_cur_rateset, rateset_auto_11g, sizeof(sc->sc_cur_rateset)); } else { /* set a fixed rate */ @@ -975,7 +975,7 @@ upgt_set_chan(struct upgt_softc *sc, str /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -998,11 +998,11 @@ upgt_set_chan(struct upgt_softc *sc, str chan->settings = sc->sc_eeprom_freq6_settings; chan->unknown3 = UPGT_CHANNEL_UNKNOWN3; - bcopy(&sc->sc_eeprom_freq3[channel].data, chan->freq3_1, + memcpy(chan->freq3_1, &sc->sc_eeprom_freq3[channel].data, sizeof(chan->freq3_1)); - bcopy(&sc->sc_eeprom_freq4[channel], chan->freq4, + memcpy(chan->freq4, &sc->sc_eeprom_freq4[channel], sizeof(sc->sc_eeprom_freq4[channel])); - bcopy(&sc->sc_eeprom_freq3[channel].data, chan->freq3_2, + memcpy(chan->freq3_2, &sc->sc_eeprom_freq3[channel].data, sizeof(chan->freq3_2)); data_cmd->buflen = sizeof(*mem) + sizeof(*chan); @@ -1331,7 +1331,7 @@ upgt_eeprom_read(struct upgt_softc *sc) /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -1423,8 +1423,9 @@ upgt_rxeof(struct usb_xfer *xfer, struct "received EEPROM block (offset=%d, len=%d)\n", eeprom_offset, eeprom_len); - bcopy(data->buf + sizeof(struct upgt_lmac_eeprom) + 4, - sc->sc_eeprom + eeprom_offset, eeprom_len); + memcpy(sc->sc_eeprom + eeprom_offset, + data->buf + sizeof(struct upgt_lmac_eeprom) + 4, + eeprom_len); /* EEPROM data has arrived in time, wakeup. */ wakeup(sc); @@ -1498,7 +1499,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t * return (NULL); } m_adj(m, ETHER_ALIGN); - bcopy(rxdesc->data, mtod(m, char *), pkglen); + memcpy(mtod(m, char *), rxdesc->data, pkglen); /* trim FCS */ m->m_len = m->m_pkthdr.len = pkglen - IEEE80211_CRC_LEN; m->m_pkthdr.rcvif = ifp; @@ -1620,7 +1621,7 @@ upgt_fw_load(struct upgt_softc *sc) goto fail; } data_cmd->buflen = sizeof(start_fwload_cmd); - bcopy(start_fwload_cmd, data_cmd->buf, data_cmd->buflen); + memcpy(data_cmd->buf, start_fwload_cmd, data_cmd->buflen); upgt_bulk_tx(sc, data_cmd); /* send X2 header */ @@ -1631,7 +1632,7 @@ upgt_fw_load(struct upgt_softc *sc) } data_cmd->buflen = sizeof(struct upgt_fw_x2_header); x2 = (struct upgt_fw_x2_header *)data_cmd->buf; - bcopy(UPGT_X2_SIGNATURE, x2->signature, UPGT_X2_SIGNATURE_SIZE); + memcpy(x2->signature, UPGT_X2_SIGNATURE, UPGT_X2_SIGNATURE_SIZE); x2->startaddr = htole32(UPGT_MEMADDR_FIRMWARE_START); x2->len = htole32(fw->datasize); x2->crc = upgt_crc32_le((uint8_t *)data_cmd->buf + @@ -1925,7 +1926,7 @@ upgt_device_reset(struct upgt_softc *sc) UPGT_UNLOCK(sc); return (ENOBUFS); } - bcopy(init_cmd, data->buf, sizeof(init_cmd)); + memcpy(data->buf, init_cmd, sizeof(init_cmd)); data->buflen = sizeof(init_cmd); upgt_bulk_tx(sc, data); usb_pause_mtx(&sc->sc_mtx, 100); @@ -2178,7 +2179,7 @@ upgt_tx_start(struct upgt_softc *sc, str } /* Transmit the URB containing the TX data. */ - bzero(data->buf, MCLBYTES); + memset(data->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data->buf; mem->addr = htole32(data->addr); txdesc = (struct upgt_lmac_tx_desc *)(mem + 1); @@ -2192,7 +2193,7 @@ upgt_tx_start(struct upgt_softc *sc, str } else { /* data frames */ txdesc->header1.flags = UPGT_H1_FLAGS_TX_DATA; - bcopy(sc->sc_cur_rateset, txdesc->rates, sizeof(txdesc->rates)); + memcpy(txdesc->rates, sc->sc_cur_rateset, sizeof(txdesc->rates)); } txdesc->header1.type = UPGT_H1_TYPE_TX_DATA; txdesc->header1.len = htole16(m->m_pkthdr.len); Modified: stable/8/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_urtw.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/wlan/if_urtw.c Sat Dec 3 14:38:54 2011 (r228229) @@ -1745,7 +1745,7 @@ urtw_tx_start(struct urtw_softc *sc, str if ((0 == xferlen % 64) || (0 == xferlen % 512)) xferlen += 1; - bzero(data->buf, URTW_TX_MAXSIZE); + memset(data->buf, 0, URTW_TX_MAXSIZE); flags = m0->m_pkthdr.len & 0xfff; flags |= URTW_TX_FLAG_NO_ENC; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && Modified: stable/8/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zyd.c Sat Dec 3 14:32:10 2011 (r228228) +++ stable/8/sys/dev/usb/wlan/if_zyd.c Sat Dec 3 14:38:54 2011 (r228229) @@ -683,7 +683,7 @@ zyd_intr_read_callback(struct usb_xfer * if (i != cnt) continue; /* copy answer into caller-supplied buffer */ - bcopy(cmd->data, rqp->odata, rqp->olen); + memcpy(rqp->odata, cmd->data, rqp->olen); DPRINTF(sc, ZYD_DEBUG_CMD, "command %p complete, data = %*D \n", rqp, rqp->olen, rqp->odata, ":"); @@ -783,7 +783,7 @@ zyd_cmd(struct zyd_softc *sc, uint16_t c return (EINVAL); cmd.code = htole16(code); - bcopy(idata, cmd.data, ilen); + memcpy(cmd.data, idata, ilen); DPRINTF(sc, ZYD_DEBUG_CMD, "sending cmd %p = %*D\n", &rq, ilen, idata, ":"); From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:40:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB72106564A; Sat, 3 Dec 2011 14:40:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DABE48FC0C; Sat, 3 Dec 2011 14:40:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3Eeu07043707; Sat, 3 Dec 2011 14:40:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3EeuhD043705; Sat, 3 Dec 2011 14:40:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031440.pB3EeuhD043705@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228230 - stable/8/sys/dev/usb/input X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:40:57 -0000 Author: hselasky Date: Sat Dec 3 14:40:56 2011 New Revision: 228230 URL: http://svn.freebsd.org/changeset/base/228230 Log: MFC r215254: Fix compiler warnings. Modified: stable/8/sys/dev/usb/input/uhid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Sat Dec 3 14:38:54 2011 (r228229) +++ stable/8/sys/dev/usb/input/uhid.c Sat Dec 3 14:40:56 2011 (r228230) @@ -683,7 +683,7 @@ uhid_attach(device_t dev) if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE) { sc->sc_repdesc_size = sizeof(uhid_graphire_report_descr); - sc->sc_repdesc_ptr = &uhid_graphire_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_graphire_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } else if (uaa->info.idProduct == USB_PRODUCT_WACOM_GRAPHIRE3_4X5) { @@ -704,7 +704,7 @@ uhid_attach(device_t dev) usbd_errstr(error)); } sc->sc_repdesc_size = sizeof(uhid_graphire3_4x5_report_descr); - sc->sc_repdesc_ptr = &uhid_graphire3_4x5_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_graphire3_4x5_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } } else if ((uaa->info.bInterfaceClass == UICLASS_VENDOR) && @@ -713,7 +713,7 @@ uhid_attach(device_t dev) /* the Xbox 360 gamepad has no report descriptor */ sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr); - sc->sc_repdesc_ptr = &uhid_xb360gp_report_descr; + sc->sc_repdesc_ptr = (void *)&uhid_xb360gp_report_descr; sc->sc_flags |= UHID_FLAG_STATIC_DESC; } if (sc->sc_repdesc_ptr == NULL) { From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 14:44:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A88911065673; Sat, 3 Dec 2011 14:44:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1028FC14; Sat, 3 Dec 2011 14:44:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3EiZYn043926; Sat, 3 Dec 2011 14:44:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3EiZAl043921; Sat, 3 Dec 2011 14:44:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201112031444.pB3EiZAl043921@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 3 Dec 2011 14:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228231 - stable/8/sys/dev/usb/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 14:44:35 -0000 Author: hselasky Date: Sat Dec 3 14:44:34 2011 New Revision: 228231 URL: http://svn.freebsd.org/changeset/base/228231 Log: MFC 226479: Close a race where SIOCGIFMEDIA ioctl get inconsistent link status. Modified: stable/8/sys/dev/usb/net/if_aue.c stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_rue.c stable/8/sys/dev/usb/net/if_udav.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_aue.c Sat Dec 3 14:40:56 2011 (r228230) +++ stable/8/sys/dev/usb/net/if_aue.c Sat Dec 3 14:44:34 2011 (r228231) @@ -1032,9 +1032,9 @@ aue_ifmedia_sts(struct ifnet *ifp, struc AUE_LOCK(sc); mii_pollstat(mii); - AUE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + AUE_UNLOCK(sc); } /* Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Sat Dec 3 14:40:56 2011 (r228230) +++ stable/8/sys/dev/usb/net/if_axe.c Sat Dec 3 14:44:34 2011 (r228231) @@ -452,9 +452,9 @@ axe_ifmedia_sts(struct ifnet *ifp, struc AXE_LOCK(sc); mii_pollstat(mii); - AXE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + AXE_UNLOCK(sc); } static void Modified: stable/8/sys/dev/usb/net/if_rue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_rue.c Sat Dec 3 14:40:56 2011 (r228230) +++ stable/8/sys/dev/usb/net/if_rue.c Sat Dec 3 14:44:34 2011 (r228231) @@ -889,9 +889,9 @@ rue_ifmedia_sts(struct ifnet *ifp, struc RUE_LOCK(sc); mii_pollstat(mii); - RUE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + RUE_UNLOCK(sc); } static void Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Sat Dec 3 14:40:56 2011 (r228230) +++ stable/8/sys/dev/usb/net/if_udav.c Sat Dec 3 14:44:34 2011 (r228231) @@ -751,9 +751,9 @@ udav_ifmedia_status(struct ifnet *ifp, s UDAV_LOCK(sc); mii_pollstat(mii); - UDAV_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; + UDAV_UNLOCK(sc); } static void From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 16:58:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 559E21065670; Sat, 3 Dec 2011 16:58:56 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443988FC1B; Sat, 3 Dec 2011 16:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3GwuVQ048411; Sat, 3 Dec 2011 16:58:56 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3Gwud9048409; Sat, 3 Dec 2011 16:58:56 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201112031658.pB3Gwud9048409@svn.freebsd.org> From: Ken Smith Date: Sat, 3 Dec 2011 16:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228237 - stable/9/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 16:58:56 -0000 Author: kensmith Date: Sat Dec 3 16:58:55 2011 New Revision: 228237 URL: http://svn.freebsd.org/changeset/base/228237 Log: MFC r228192: > Add a screen that asks if the user would like to enable crash dumps, > giving them a very brief description of the trade-offs. Whether the > user opts in or out add an entry to what will become /etc/rc.conf > explaining what dumpdev is and how to turn on/off crash dumps. The folks > who handle interacting with users submitting PRs have asked for this. > > Reviewed by: nwhitehorn Approved by: re (kib) Modified: stable/9/usr.sbin/bsdinstall/scripts/services Directory Properties: stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/scripts/services ============================================================================== --- stable/9/usr.sbin/bsdinstall/scripts/services Sat Dec 3 16:30:47 2011 (r228236) +++ stable/9/usr.sbin/bsdinstall/scripts/services Sat Dec 3 16:58:55 2011 (r228237) @@ -26,6 +26,8 @@ # # $FreeBSD$ +: ${DIALOG_OK=0} + if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then eval `sed -e s/YES/on/I -e s/NO/off/I $BSDINSTALL_TMPETC/rc.conf.services` else @@ -51,3 +53,15 @@ for daemon in $DAEMONS; do echo ${daemon}_enable=\"YES\" >> $BSDINSTALL_TMPETC/rc.conf.services done +echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \"NO\" to disable >> \ + $BSDINSTALL_TMPETC/rc.conf.services + +dialog --backtitle "FreeBSD Installer" --title "Dumpdev Configuration" \ + --nocancel --yesno \ + "Would you like to enable crash dumps? If you start having problems with the system it can help the FreeBSD developers debug the problem. But the crash dumps can take up a lot of disk space in /var." 0 0 + +if [ $? -eq $DIALOG_OK ]; then + echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services +else + echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services +fi From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 17:15:17 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21CC8106566C; Sat, 3 Dec 2011 17:15:17 +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 06EB98FC0C; Sat, 3 Dec 2011 17:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3HFG4i049072; Sat, 3 Dec 2011 17:15:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3HFGMS049070; Sat, 3 Dec 2011 17:15:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201112031715.pB3HFGMS049070@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 3 Dec 2011 17:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228240 - stable/9/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 17:15:17 -0000 Author: nwhitehorn Date: Sat Dec 3 17:15:16 2011 New Revision: 228240 URL: http://svn.freebsd.org/changeset/base/228240 Log: MFC r228194: Prevent user astonishment by providing the shell option at the end, after any installer-provided configuration files have been copied. This allows users to edit their fstab, if desired, and to see what the installer has placed in rc.conf. Requested by: phk Approved by: re (kensmith) Modified: stable/9/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/9/usr.sbin/bsdinstall/scripts/auto Sat Dec 3 17:03:48 2011 (r228239) +++ stable/9/usr.sbin/bsdinstall/scripts/auto Sat Dec 3 17:15:16 2011 (r228240) @@ -157,7 +157,7 @@ finalconfig() { exec 3>&1 REVISIT=$(dialog --backtitle "FreeBSD Installer" \ --title "Final Configuration" --no-cancel --menu \ - "Setup of your FreeBSD system is nearly complete. You can now modify your configuration choices or apply more complex changes using a shell." 0 0 0 \ + "Setup of your FreeBSD system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ "Exit" "Apply configuration and exit installer" \ "Add User" "Add a user to the system" \ "Root Password" "Change root password" \ @@ -165,8 +165,7 @@ finalconfig() { "Network" "Networking configuration" \ "Services" "Set daemons to run on startup" \ "Time Zone" "Set system timezone" \ - "Handbook" "Install FreeBSD Handbook (requires network)" \ - "Shell" "Open a shell in the new system" 2>&1 1>&3) + "Handbook" "Install FreeBSD Handbook (requires network)" 2>&1 1>&3) exec 3>&- case "$REVISIT" in @@ -198,15 +197,6 @@ finalconfig() { bsdinstall docsinstall finalconfig ;; - "Shell") - clear - echo This shell is operating in a chroot in the new system. \ - When finished making configuration changes, type \"exit\". - chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 - # Don't hose local rc.conf changes - cp $BSDINSTALL_CHROOT/etc/rc.conf $BSDINSTALL_TMPETC/rc.conf.manual - finalconfig - ;; esac } @@ -222,5 +212,14 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; the rm -rf "$BSDINSTALL_FETCHDEST" fi +dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \ + --yesno "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 +if [ $? -eq 0 ]; then + clear + echo This shell is operating in a chroot in the new system. \ + When finished making configuration changes, type \"exit\". + chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 +fi + echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 17:29:39 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55A37106564A; Sat, 3 Dec 2011 17:29:39 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7E38FC15; Sat, 3 Dec 2011 17:29:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3HTdGZ049592; Sat, 3 Dec 2011 17:29:39 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3HTdiN049590; Sat, 3 Dec 2011 17:29:39 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201112031729.pB3HTdiN049590@svn.freebsd.org> From: Alan Cox Date: Sat, 3 Dec 2011 17:29: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: r228242 - stable/7/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 17:29:39 -0000 Author: alc Date: Sat Dec 3 17:29:38 2011 New Revision: 228242 URL: http://svn.freebsd.org/changeset/base/228242 Log: MFC r226740 Speed up vm_page_cache() and vm_page_remove() by checking for a few common cases that can be handled in constant time. Modified: stable/7/sys/vm/vm_page.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Sat Dec 3 17:17:32 2011 (r228241) +++ stable/7/sys/vm/vm_page.c Sat Dec 3 17:29:38 2011 (r228242) @@ -708,7 +708,7 @@ void vm_page_remove(vm_page_t m) { vm_object_t object; - vm_page_t root; + vm_page_t next, prev, root; if ((object = m->object) == NULL) return; @@ -722,15 +722,42 @@ vm_page_remove(vm_page_t m) /* * Now remove from the object's list of backed pages. */ - if (m != object->root) - vm_page_splay(m->pindex, object->root); - if (m->left == NULL) - root = m->right; - else { - root = vm_page_splay(m->pindex, m->left); - root->right = m->right; + if ((next = TAILQ_NEXT(m, listq)) != NULL && next->left == m) { + /* + * Since the page's successor in the list is also its parent + * in the tree, its right subtree must be empty. + */ + next->left = m->left; + KASSERT(m->right == NULL, + ("vm_page_remove: page %p has right child", m)); + } else if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && + prev->right == m) { + /* + * Since the page's predecessor in the list is also its parent + * in the tree, its left subtree must be empty. + */ + KASSERT(m->left == NULL, + ("vm_page_remove: page %p has left child", m)); + prev->right = m->right; + } else { + if (m != object->root) + vm_page_splay(m->pindex, object->root); + if (m->left == NULL) + root = m->right; + else if (m->right == NULL) + root = m->left; + else { + /* + * Move the page's successor to the root, because + * pages are usually removed in ascending order. + */ + if (m->right != next) + vm_page_splay(m->pindex, m->right); + next->left = m->left; + root = next; + } + object->root = root; } - object->root = root; TAILQ_REMOVE(&object->memq, m, listq); /* @@ -1664,7 +1691,7 @@ void vm_page_cache(vm_page_t m) { vm_object_t object; - vm_page_t root; + vm_page_t next, prev, root; mtx_assert(&vm_page_queue_mtx, MA_OWNED); object = m->object; @@ -1700,15 +1727,42 @@ vm_page_cache(vm_page_t m) * Remove the page from the object's collection of resident * pages. */ - if (m != object->root) - vm_page_splay(m->pindex, object->root); - if (m->left == NULL) - root = m->right; - else { - root = vm_page_splay(m->pindex, m->left); - root->right = m->right; + if ((next = TAILQ_NEXT(m, listq)) != NULL && next->left == m) { + /* + * Since the page's successor in the list is also its parent + * in the tree, its right subtree must be empty. + */ + next->left = m->left; + KASSERT(m->right == NULL, + ("vm_page_cache: page %p has right child", m)); + } else if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && + prev->right == m) { + /* + * Since the page's predecessor in the list is also its parent + * in the tree, its left subtree must be empty. + */ + KASSERT(m->left == NULL, + ("vm_page_cache: page %p has left child", m)); + prev->right = m->right; + } else { + if (m != object->root) + vm_page_splay(m->pindex, object->root); + if (m->left == NULL) + root = m->right; + else if (m->right == NULL) + root = m->left; + else { + /* + * Move the page's successor to the root, because + * pages are usually removed in ascending order. + */ + if (m->right != next) + vm_page_splay(m->pindex, m->right); + next->left = m->left; + root = next; + } + object->root = root; } - object->root = root; TAILQ_REMOVE(&object->memq, m, listq); object->resident_page_count--; object->generation++; From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 22:12:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42B79106564A; Sat, 3 Dec 2011 22:12:58 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31FB28FC08; Sat, 3 Dec 2011 22:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3MCwra058507; Sat, 3 Dec 2011 22:12:58 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3MCwGF058505; Sat, 3 Dec 2011 22:12:58 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201112032212.pB3MCwGF058505@svn.freebsd.org> From: Hiroki Sato Date: Sat, 3 Dec 2011 22:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228244 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 22:12:58 -0000 Author: hrs Date: Sat Dec 3 22:12:57 2011 New Revision: 228244 URL: http://svn.freebsd.org/changeset/base/228244 Log: MFC r226446: Fix a problem that an interface unexpectedly becomes IFF_UP by just doing "ifconfing inet6 -ifdisabled" when the interface has ND6_IFF_AUTO_LINKLOCAL flag and no link-local address. Approved by: re (bz) Modified: stable/9/sys/netinet6/nd6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Sat Dec 3 19:56:52 2011 (r228243) +++ stable/9/sys/netinet6/nd6.c Sat Dec 3 22:12:57 2011 (r228244) @@ -1364,7 +1364,8 @@ nd6_ioctl(u_long cmd, caddr_t data, stru " duplicate.\n"); } else { ND_IFINFO(ifp)->flags &= ~ND6_IFF_IFDISABLED; - in6_if_up(ifp); + if (ifp->if_flags & IFF_UP) + in6_if_up(ifp); } } else if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) && (ND.flags & ND6_IFF_IFDISABLED)) { @@ -1382,35 +1383,37 @@ nd6_ioctl(u_long cmd, caddr_t data, stru IF_ADDR_UNLOCK(ifp); } - if (!(ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) && - (ND.flags & ND6_IFF_AUTO_LINKLOCAL)) { - /* auto_linklocal 0->1 transision */ - - /* If no link-local address on ifp, configure */ - ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; - in6_ifattach(ifp, NULL); - } else if ((ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) && - !(ND.flags & ND6_IFF_IFDISABLED)) { - /* - * When the IF already has - * ND6_IFF_AUTO_LINKLOCAL and no link-local - * address is assigned, try to assign one. - */ - int haslinklocal = 0; + if (ND.flags & ND6_IFF_AUTO_LINKLOCAL) { + if (!(ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL)) { + /* auto_linklocal 0->1 transision */ + + /* If no link-local address on ifp, configure */ + ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL; + in6_ifattach(ifp, NULL); + } else if (!(ND.flags & ND6_IFF_IFDISABLED) && + ifp->if_flags & IFF_UP) { + /* + * When the IF already has + * ND6_IFF_AUTO_LINKLOCAL, no link-local + * address is assigned, and IFF_UP, try to + * assign one. + */ + int haslinklocal = 0; - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - ia = (struct in6_ifaddr *)ifa; - if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) { - haslinklocal = 1; - break; + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + ia = (struct in6_ifaddr *)ifa; + if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) { + haslinklocal = 1; + break; + } } + IF_ADDR_UNLOCK(ifp); + if (!haslinklocal) + in6_ifattach(ifp, NULL); } - IF_ADDR_UNLOCK(ifp); - if (!haslinklocal) - in6_ifattach(ifp, NULL); } } ND_IFINFO(ifp)->flags = ND.flags; From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 22:14:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602C91065673; Sat, 3 Dec 2011 22:14:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F93D8FC13; Sat, 3 Dec 2011 22:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3MEGJZ058577; Sat, 3 Dec 2011 22:14:16 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3MEG1H058574; Sat, 3 Dec 2011 22:14:16 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201112032214.pB3MEG1H058574@svn.freebsd.org> From: Hiroki Sato Date: Sat, 3 Dec 2011 22:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228245 - in stable/9: etc share/man/man5 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 22:14:16 -0000 Author: hrs Date: Sat Dec 3 22:14:15 2011 New Revision: 228245 URL: http://svn.freebsd.org/changeset/base/228245 Log: MFC r226649, 226651, 226652, 226653: - Fix an issue that 127/8 is not configured when $ifconfig_DEFAULT is not empty. - Add description that IPv6 configuration will be ignored if $ifconfig_IF_ipv6 is empty. - Move a configuration example "inet6 accept_rtadv" to just after the manual GUA configuration. - Add an example of $ipv6_prefix_IF. - Add support for removing addresses added by ipv6_prefix_hostid_addr_up() upon rc.d/netif stop. Approved by: re (bz) Modified: stable/9/etc/network.subr stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Sat Dec 3 22:12:57 2011 (r228244) +++ stable/9/etc/network.subr Sat Dec 3 22:14:15 2011 (r228245) @@ -532,7 +532,7 @@ ipv4_up() # Add 127.0.0.1/8 to lo0 unless otherwise specified. if [ "${_if}" = "lo0" ]; then - ifconfig_args=`ifconfig_getargs ${_if}` + ifconfig_args=`get_if_var ${_if} ifconfig_IF` if [ -z "${ifconfig_args}" ]; then ifconfig ${_if} inet 127.0.0.1/8 alias fi @@ -556,7 +556,7 @@ ipv6_up() fi ifalias_up ${_if} inet6 && _ret=0 - ipv6_prefix_hostid_addr_up ${_if} && _ret=0 + ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 ipv6_accept_rtadv_up ${_if} && _ret=0 # wait for DAD @@ -612,6 +612,7 @@ ipv6_down() fi ipv6_accept_rtadv_down ${_if} && _ret=0 + ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0 ifalias_down ${_if} inet6 && _ret=0 inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`" @@ -859,12 +860,14 @@ ifalias_ipv6_down() return $_ret } -# ipv6_prefix_hostid_addr_up if -# add IPv6 prefix + hostid addr to the interface $if -ipv6_prefix_hostid_addr_up() +# ipv6_prefix_hostid_addr_common if action +# Add or remove IPv6 prefix + hostid addr on the interface $if +# +ipv6_prefix_hostid_addr_common() { - local _if prefix laddr hostid j address + local _if _action prefix laddr hostid j address _if=$1 + _action=$2 prefix=`get_if_var ${_if} ipv6_prefix_IF` if [ -n "${prefix}" ]; then @@ -874,13 +877,13 @@ ipv6_prefix_hostid_addr_up() for j in ${prefix}; do address=$j\:${hostid} - ifconfig ${_if} inet6 ${address} prefixlen 64 alias + ifconfig ${_if} inet6 ${address} prefixlen 64 ${_action} # if I am a router, add subnet router # anycast address (RFC 2373). if checkyesno ipv6_gateway_enable; then ifconfig ${_if} inet6 $j:: prefixlen 64 \ - alias anycast + ${_action} anycast fi done fi Modified: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Sat Dec 3 22:12:57 2011 (r228244) +++ stable/9/share/man/man5/rc.conf.5 Sat Dec 3 22:14:15 2011 (r228245) @@ -1423,6 +1423,11 @@ IPv6 functionality on an interface shoul .Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 , instead of setting ifconfig parameters in .Va ifconfig_ Ns Aq Ar interface . +If this variable is empty, all of IPv6 configurations on the +specified interface by other variables such as +.Va ipv6_prefix_ Ns Ao Ar interface Ac +will be ignored. +.Pp Aliases should be set by .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n with @@ -1433,6 +1438,17 @@ ifconfig_ed0_ipv6="inet6 2001:db8:1::1 p ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp +Interfaces that have an +.Dq Li inet6 accept_rtadv +keyword in +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +setting will be automatically configured by SLAAC +.Pq StateLess Address AutoConfiguration +described in +.Rs +.%T "RFC 4862" +.Re +.Pp Note that a link-local address will be automatically configured in addition to the configured global-scope addresses because the IPv6 specifications require it on each link. @@ -1457,19 +1473,32 @@ For example: .Bd -literal ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" .Ed -.Pp -Interfaces that have an -.Dq Li inet6 accept_rtadv -keyword in -.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 -setting will be automatically configured by -.Xr rtsol 8 . .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str If one or more prefixes are defined in .Va ipv6_prefix_ Ns Aq Ar interface addresses based on each prefix and the EUI-64 interface index will be configured on that interface. +Note that this variable will be ignored when +.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 +is empty. +.Pp +For example, the following configuration +.Bd -literal +ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0" +.Ed +.Pp +is equivalent to the following: +.Bd -literal +ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" +ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" +ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" +ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" +.Ed +.Pp +These Subnet-Router anycast addresses will be added only when +.Va ipv6_gateway_enable +is YES. .It Va ipv6_default_interface .Pq Vt str If not set to From owner-svn-src-stable@FreeBSD.ORG Sat Dec 3 23:36:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C728106566B; Sat, 3 Dec 2011 23:36:36 +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 6274D8FC12; Sat, 3 Dec 2011 23:36:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pB3Naam8061201; Sat, 3 Dec 2011 23:36:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pB3Naamo061199; Sat, 3 Dec 2011 23:36:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201112032336.pB3Naamo061199@svn.freebsd.org> From: Alan Cox Date: Sat, 3 Dec 2011 23:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228248 - stable/8/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 23:36:36 -0000 Author: alc Date: Sat Dec 3 23:36:36 2011 New Revision: 228248 URL: http://svn.freebsd.org/changeset/base/228248 Log: MFC r215597 Optimize vm_object_terminate(). Modified: stable/8/sys/vm/vm_object.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Sat Dec 3 22:16:36 2011 (r228247) +++ stable/8/sys/vm/vm_object.c Sat Dec 3 23:36:36 2011 (r228248) @@ -679,7 +679,7 @@ vm_object_destroy(vm_object_t object) void vm_object_terminate(vm_object_t object) { - vm_page_t p; + vm_page_t p, p_next; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); @@ -719,23 +719,41 @@ vm_object_terminate(vm_object_t object) object->ref_count)); /* - * Now free any remaining pages. For internal objects, this also - * removes them from paging queues. Don't free wired pages, just - * remove them from the object. + * Free any remaining pageable pages. This also removes them from the + * paging queues. However, don't free wired pages, just remove them + * from the object. Rather than incrementally removing each page from + * the object, the page and object are reset to any empty state. */ vm_page_lock_queues(); - while ((p = TAILQ_FIRST(&object->memq)) != NULL) { + TAILQ_FOREACH_SAFE(p, &object->memq, listq, p_next) { KASSERT(!p->busy && (p->oflags & VPO_BUSY) == 0, - ("vm_object_terminate: freeing busy page %p " - "p->busy = %d, p->oflags %x\n", p, p->busy, p->oflags)); + ("vm_object_terminate: freeing busy page %p", p)); + /* + * Optimize the page's removal from the object by resetting + * its "object" field. Specifically, if the page is not + * wired, then the effect of this assignment is that + * vm_page_free()'s call to vm_page_remove() will return + * immediately without modifying the page or the object. + */ + p->object = NULL; if (p->wire_count == 0) { vm_page_free(p); cnt.v_pfree++; - } else { - vm_page_remove(p); } } vm_page_unlock_queues(); + /* + * If the object contained any pages, then reset it to an empty state. + * None of the object's fields, including "resident_page_count", were + * modified by the preceding loop. + */ + if (object->resident_page_count != 0) { + object->root = NULL; + TAILQ_INIT(&object->memq); + object->resident_page_count = 0; + if (object->type == OBJT_VNODE) + vdrop(object->handle); + } #if VM_NRESERVLEVEL > 0 if (__predict_false(!LIST_EMPTY(&object->rvq)))