From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 00:51:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675321065674; Sun, 8 Jul 2012 00:51:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 394CB8FC17; Sun, 8 Jul 2012 00:51: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 q680pdF2005985; Sun, 8 Jul 2012 00:51:39 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q680pcYO005980; Sun, 8 Jul 2012 00:51:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201207080051.q680pcYO005980@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 8 Jul 2012 00:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238220 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 00:51:39 -0000 Author: mjg Date: Sun Jul 8 00:51:38 2012 New Revision: 238220 URL: http://svn.freebsd.org/changeset/base/238220 Log: Unbreak handling of descriptors opened with O_EXEC by fexecve(2). While here return EBADF for descriptors opened for writing (previously it was ETXTBSY). Add fgetvp_exec function which performs appropriate checks. PR: kern/169651 In collaboration with: kib Approved by: trasz (mentor) MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_exec.c head/sys/sys/file.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Jul 7 22:22:13 2012 (r238219) +++ head/sys/kern/kern_descrip.c Sun Jul 8 00:51:38 2012 (r238220) @@ -2340,11 +2340,11 @@ _fget(struct thread *td, int fd, struct /* * FREAD and FWRITE failure return EBADF as per POSIX. - * - * Only one flag, or 0, may be specified. */ if ((flags == FREAD && (fp->f_flag & FREAD) == 0) || - (flags == FWRITE && (fp->f_flag & FWRITE) == 0)) { + (flags == FWRITE && (fp->f_flag & FWRITE) == 0) || + (flags == (FREAD | FEXEC) && + (((fp->f_flag & flags) == 0) || ((fp->f_flag & FWRITE) != 0)))) { fdrop(fp, td); return (EBADF); } @@ -2444,6 +2444,13 @@ fgetvp_read(struct thread *td, int fd, c return (_fgetvp(td, fd, FREAD, rights, NULL, vpp)); } +int +fgetvp_exec(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp) +{ + + return (_fgetvp(td, fd, FREAD | FEXEC, rights, NULL, vpp)); +} + #ifdef notyet int fgetvp_write(struct thread *td, int fd, cap_rights_t rights, Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Jul 7 22:22:13 2012 (r238219) +++ head/sys/kern/kern_exec.c Sun Jul 8 00:51:38 2012 (r238220) @@ -443,8 +443,10 @@ interpret: /* * Some might argue that CAP_READ and/or CAP_MMAP should also * be required here; such arguments will be entertained. + * + * Descriptors opened only with O_EXEC or O_RDONLY are allowed. */ - error = fgetvp_read(td, args->fd, CAP_FEXECVE, &binvp); + error = fgetvp_exec(td, args->fd, CAP_FEXECVE, &binvp); if (error) goto exec_fail; vfslocked = VFS_LOCK_GIANT(binvp->v_mount); Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Sat Jul 7 22:22:13 2012 (r238219) +++ head/sys/sys/file.h Sun Jul 8 00:51:38 2012 (r238220) @@ -238,6 +238,8 @@ fo_chown_t invfo_chown; void finit(struct file *, u_int, short, void *, struct fileops *); int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp); +int fgetvp_exec(struct thread *td, int fd, cap_rights_t rights, + struct vnode **vpp); int fgetvp_rights(struct thread *td, int fd, cap_rights_t need, cap_rights_t *have, struct vnode **vpp); int fgetvp_read(struct thread *td, int fd, cap_rights_t rights, From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 00:52:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45FD81065670; Sun, 8 Jul 2012 00:52:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 315958FC15; Sun, 8 Jul 2012 00:52: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 q680qt5e006122; Sun, 8 Jul 2012 00:52:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q680qsQo006120; Sun, 8 Jul 2012 00:52:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207080052.q680qsQo006120@svn.freebsd.org> From: Eitan Adler Date: Sun, 8 Jul 2012 00:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238221 - head/usr.sbin/ancontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 00:52:55 -0000 Author: eadler Date: Sun Jul 8 00:52:54 2012 New Revision: 238221 URL: http://svn.freebsd.org/changeset/base/238221 Log: Fix always 0 tautologly revealed by gcc46 Approved by: cperciva MFC after: 1 week Modified: head/usr.sbin/ancontrol/ancontrol.c Modified: head/usr.sbin/ancontrol/ancontrol.c ============================================================================== --- head/usr.sbin/ancontrol/ancontrol.c Sun Jul 8 00:51:38 2012 (r238220) +++ head/usr.sbin/ancontrol/ancontrol.c Sun Jul 8 00:52:54 2012 (r238221) @@ -1443,7 +1443,7 @@ an_enable_leap_mode(const char *iface, c caps = (struct an_ltv_caps *)&areq; - if (!caps->an_softcaps & AN_AUTHTYPE_LEAP) { + if (!(caps->an_softcaps & AN_AUTHTYPE_LEAP)) { fprintf(stderr, "Firmware does not support LEAP\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 08:49:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437601065672; Sun, 8 Jul 2012 08:49:38 +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 2DEFE8FC18; Sun, 8 Jul 2012 08:49: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 q688nckH039714; Sun, 8 Jul 2012 08:49:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q688nbdC039712; Sun, 8 Jul 2012 08:49:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207080849.q688nbdC039712@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 08:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238222 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 08:49:38 -0000 Author: bz Date: Sun Jul 8 08:49:37 2012 New Revision: 238222 URL: http://svn.freebsd.org/changeset/base/238222 Log: As mentioned in the commit message of r237571 (copied from a prototype patch of mine) also check if the 2nd in6_setscope() failed and return the error in that case. MFC after: 5 days Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Jul 8 00:52:54 2012 (r238221) +++ head/sys/netinet6/in6.c Sun Jul 8 08:49:37 2012 (r238222) @@ -1367,7 +1367,9 @@ in6_purgeaddr_mc(struct ifnet *ifp, stru sin6.sin6_family = AF_INET6; memcpy(&sin6.sin6_addr, &satosin6(ifa0->ifa_addr)->sin6_addr, sizeof(sin6.sin6_addr)); - in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + error = in6_setscope(&sin6.sin6_addr, ifa0->ifa_ifp, NULL); + if (error != 0) + return (error); } rt = in6_rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL, RT_DEFAULT_FIB); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 09:06:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B39F106564A; Sun, 8 Jul 2012 09:06:26 +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 E09D88FC14; Sun, 8 Jul 2012 09:06: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 q6896PCW040451; Sun, 8 Jul 2012 09:06:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6896PwF040448; Sun, 8 Jul 2012 09:06:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207080906.q6896PwF040448@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 09:06: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: r238223 - stable/9/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 09:06:26 -0000 Author: bz Date: Sun Jul 8 09:06:25 2012 New Revision: 238223 URL: http://svn.freebsd.org/changeset/base/238223 Log: MFC r235671: Allow tso4 and tso6 be set individually given we have the bits. This will help with drivers not working as expected during the transition time and later. Approved by: re Modified: stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ifconfig/ifconfig.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Sun Jul 8 08:49:37 2012 (r238222) +++ stable/9/sbin/ifconfig/ifconfig.8 Sun Jul 8 09:06:25 2012 (r238223) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 7, 2012 +.Dd May 19, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -400,6 +400,22 @@ It will always disable TSO for .Xr ip 4 and .Xr ip6 4 . +.It Cm tso6 , tso4 +If the driver supports +.Xr tcp 4 +segmentation offloading for +.Xr ip6 4 +or +.Xr ip 4 +use one of these to selectively enabled it only for one protocol family. +.It Fl tso6 , tso4 +If the driver supports +.Xr tcp 4 +segmentation offloading for +.Xr ip6 4 +or +.Xr ip 4 +use one of these to selectively disable it only for one protocol family. .It Cm lro If the driver supports .Xr tcp 4 Modified: stable/9/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.c Sun Jul 8 08:49:37 2012 (r238222) +++ stable/9/sbin/ifconfig/ifconfig.c Sun Jul 8 09:06:25 2012 (r238223) @@ -1178,6 +1178,10 @@ static struct cmd basic_cmds[] = { DEF_CMD("-netcons", -IFCAP_NETCONS, setifcap), DEF_CMD("polling", IFCAP_POLLING, setifcap), DEF_CMD("-polling", -IFCAP_POLLING, setifcap), + DEF_CMD("tso6", IFCAP_TSO6, setifcap), + DEF_CMD("-tso6", -IFCAP_TSO6, setifcap), + DEF_CMD("tso4", IFCAP_TSO4, setifcap), + DEF_CMD("-tso4", -IFCAP_TSO4, setifcap), DEF_CMD("tso", IFCAP_TSO, setifcap), DEF_CMD("-tso", -IFCAP_TSO, setifcap), DEF_CMD("lro", IFCAP_LRO, setifcap), From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 09:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EDBA1065694; Sun, 8 Jul 2012 09:49:02 +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 5F0618FC16; Sun, 8 Jul 2012 09:49:02 +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 q689n2Ys042219; Sun, 8 Jul 2012 09:49:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q689n2Zm042216; Sun, 8 Jul 2012 09:49:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207080949.q689n2Zm042216@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 09:49:02 +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: r238224 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 09:49:03 -0000 Author: bz Date: Sun Jul 8 09:49:01 2012 New Revision: 238224 URL: http://svn.freebsd.org/changeset/base/238224 Log: MFC r235916: Introduce in6_getscope() to allow more effective checksum computations without the need to copy the address to clear the scope. Approved by: re Modified: stable/9/sys/netinet6/scope6.c stable/9/sys/netinet6/scope6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/scope6.c ============================================================================== --- stable/9/sys/netinet6/scope6.c Sun Jul 8 09:06:25 2012 (r238223) +++ stable/9/sys/netinet6/scope6.c Sun Jul 8 09:49:01 2012 (r238224) @@ -494,3 +494,16 @@ in6_clearscope(struct in6_addr *in6) return (modified); } + +/* + * Return the scope identifier or zero. + */ +uint16_t +in6_getscope(struct in6_addr *in6) +{ + + if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) + return (in6->s6_addr16[1]); + + return (0); +} Modified: stable/9/sys/netinet6/scope6_var.h ============================================================================== --- stable/9/sys/netinet6/scope6_var.h Sun Jul 8 09:06:25 2012 (r238223) +++ stable/9/sys/netinet6/scope6_var.h Sun Jul 8 09:49:01 2012 (r238224) @@ -54,6 +54,7 @@ int sa6_embedscope __P((struct sockaddr_ int sa6_recoverscope __P((struct sockaddr_in6 *)); int in6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *)); int in6_clearscope __P((struct in6_addr *)); +uint16_t in6_getscope(struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_SCOPE6_VAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 10:04:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEC4A106566B; Sun, 8 Jul 2012 10:04:30 +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 9956C8FC0C; Sun, 8 Jul 2012 10:04: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 q68A4UEo042970; Sun, 8 Jul 2012 10:04:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68A4Um1042968; Sun, 8 Jul 2012 10:04:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081004.q68A4Um1042968@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 10:04: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: r238226 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 10:04:30 -0000 Author: bz Date: Sun Jul 8 10:04:30 2012 New Revision: 238226 URL: http://svn.freebsd.org/changeset/base/238226 Log: MFC r235921: Optimize in6_cksum(), re-ordering work and limiting variable initialization, removing a bzero() for mostly re-initialized struct values, making use of the newly introduced in6_getscope(), as well as converting an if/panic to a KASSERT(). Approved by: re Modified: stable/9/sys/netinet6/in6_cksum.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_cksum.c ============================================================================== --- stable/9/sys/netinet6/in6_cksum.c Sun Jul 8 09:55:00 2012 (r238225) +++ stable/9/sys/netinet6/in6_cksum.c Sun Jul 8 10:04:30 2012 (r238226) @@ -89,12 +89,10 @@ __FBSDID("$FreeBSD$"); int in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) { - u_int16_t *w; - int sum = 0; - int mlen = 0; - int byte_swapped = 0; struct ip6_hdr *ip6; - struct in6_addr in6; + u_int16_t *w, scope; + int byte_swapped, mlen; + int sum; union { u_int16_t phs[4]; struct { @@ -112,42 +110,38 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t l; } l_util; - /* sanity check */ - if (m->m_pkthdr.len < off + len) { - panic("in6_cksum: mbuf len (%d) < off+len (%d+%d)", - m->m_pkthdr.len, off, len); - } - - bzero(&uph, sizeof(uph)); + /* Sanity check. */ + KASSERT(m->m_pkthdr.len >= off + len, ("%s: mbuf len (%d) < off(%d)+" + "len(%d)", __func__, m->m_pkthdr.len, off, len)); /* * First create IP6 pseudo header and calculate a summary. */ - ip6 = mtod(m, struct ip6_hdr *); uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; uph.ph.ph_nxt = nxt; - /* - * IPv6 source address. - * XXX: we'd like to avoid copying the address, but we can't due to - * the possibly embedded scope zone ID. - */ - in6 = ip6->ip6_src; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* Payload length and upper layer identifier. */ + sum = uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + ip6 = mtod(m, struct ip6_hdr *); + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; - /* IPv6 destination address */ - in6 = ip6->ip6_dst; - in6_clearscope(&in6); - w = (u_int16_t *)&in6; + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; - - /* Payload length and upper layer identifier */ - sum += uph.phs[0]; sum += uph.phs[1]; - sum += uph.phs[2]; sum += uph.phs[3]; + if (scope != 0) + sum -= scope; /* * Secondly calculate a summary of the first mbuf excluding offset. @@ -167,14 +161,16 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, /* * Force to even boundary. */ - if ((1 & (long) w) && (mlen > 0)) { + if ((1 & (long)w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(u_char *)w; w = (u_int16_t *)((char *)w + 1); mlen--; byte_swapped = 1; - } + } else + byte_swapped = 0; + /* * Unroll the loop to make overhead from * branches &c small. From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 10:29:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5945D1065688; Sun, 8 Jul 2012 10:29:02 +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 3A2188FC12; Sun, 8 Jul 2012 10:29:02 +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 q68AT2dS043978; Sun, 8 Jul 2012 10:29:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68AT24u043975; Sun, 8 Jul 2012 10:29:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081029.q68AT24u043975@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 10:29:02 +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: r238227 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 10:29:02 -0000 Author: bz Date: Sun Jul 8 10:29:01 2012 New Revision: 238227 URL: http://svn.freebsd.org/changeset/base/238227 Log: MFC r235924: Introduce a (for now copied stripped down) in6_cksum_pseudo() function. We should be able to use this from in6_cksum() but we should also ponder possible MD specific improvements. It takes an extra csum argument to allow for easy checks as will be done by the upper layer protocol input paths. Approved by: re Modified: stable/9/sys/netinet6/in6.h stable/9/sys/netinet6/in6_cksum.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6.h ============================================================================== --- stable/9/sys/netinet6/in6.h Sun Jul 8 10:04:30 2012 (r238226) +++ stable/9/sys/netinet6/in6.h Sun Jul 8 10:29:01 2012 (r238227) @@ -632,7 +632,9 @@ struct ip6_mtuinfo { #ifdef _KERNEL struct cmsghdr; +struct ip6_hdr; +int in6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t); int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t)); int in6_localaddr __P((struct in6_addr *)); int in6_localip(struct in6_addr *); Modified: stable/9/sys/netinet6/in6_cksum.c ============================================================================== --- stable/9/sys/netinet6/in6_cksum.c Sun Jul 8 10:04:30 2012 (r238226) +++ stable/9/sys/netinet6/in6_cksum.c Sun Jul 8 10:29:01 2012 (r238227) @@ -80,6 +80,66 @@ __FBSDID("$FreeBSD$"); #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; (void)ADDCARRY(sum);} +static int +_in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + uint16_t scope, *w; + union { + u_int16_t phs[4]; + struct { + u_int32_t ph_len; + u_int8_t ph_zero[3]; + u_int8_t ph_nxt; + } __packed ph; + } uph; + + sum = csum; + + /* + * First create IP6 pseudo header and calculate a summary. + */ + uph.ph.ph_len = htonl(len); + uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0; + uph.ph.ph_nxt = nxt; + + /* Payload length and upper layer identifier. */ + sum += uph.phs[0]; sum += uph.phs[1]; + sum += uph.phs[2]; sum += uph.phs[3]; + + /* IPv6 source address. */ + scope = in6_getscope(&ip6->ip6_src); + w = (u_int16_t *)&ip6->ip6_src; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + /* IPv6 destination address. */ + scope = in6_getscope(&ip6->ip6_dst); + w = (u_int16_t *)&ip6->ip6_dst; + sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; + sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; + if (scope != 0) + sum -= scope; + + return (sum); +} + +int +in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum) +{ + int sum; + union { + u_int16_t s[2]; + u_int32_t l; + } l_util; + + sum = _in6_cksum_pseudo(ip6, len, nxt, csum); + REDUCE; + return (sum); +} + /* * m MUST contain a contiguous IP6 header. * off is an offset where TCP/UDP/ICMP6 header starts. From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 10:46:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4F6E106566C; Sun, 8 Jul 2012 10:46:55 +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 9CEB28FC0A; Sun, 8 Jul 2012 10:46: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 q68AktK2044824; Sun, 8 Jul 2012 10:46:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68AktaF044816; Sun, 8 Jul 2012 10:46:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081046.q68AktaF044816@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 10:46:55 +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: r238228 - in stable/9/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 10:46:55 -0000 Author: bz Date: Sun Jul 8 10:46:55 2012 New Revision: 238228 URL: http://svn.freebsd.org/changeset/base/238228 Log: MFC r235941: in_cksum.h required ip.h to be included for struct ip. To be able to use some general checksum functions like in_addword() in a non-IPv4 context, limit the (also exported to user space) IPv4 specific functions to the times, when the ip.h header is present and IPVERSION is defined (to 4). Approved by: re Modified: stable/9/sys/amd64/include/in_cksum.h stable/9/sys/arm/include/in_cksum.h stable/9/sys/i386/include/in_cksum.h stable/9/sys/ia64/include/in_cksum.h stable/9/sys/mips/include/in_cksum.h stable/9/sys/powerpc/include/in_cksum.h stable/9/sys/sparc64/include/in_cksum.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/in_cksum.h ============================================================================== --- stable/9/sys/amd64/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/amd64/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -43,6 +43,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -69,9 +70,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: stable/9/sys/arm/include/in_cksum.h ============================================================================== --- stable/9/sys/arm/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/arm/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -46,7 +46,9 @@ u_short in_cksum(struct mbuf *m, int len u_short in_addword(u_short sum, u_short b); u_short in_cksum_skip(struct mbuf *m, int len, int skip); u_int do_cksum(const void *, int); +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *); +#endif static __inline u_short in_pseudo(u_int sum, u_int b, u_int c) Modified: stable/9/sys/i386/include/in_cksum.h ============================================================================== --- stable/9/sys/i386/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/i386/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -54,6 +54,7 @@ * therefore always exactly five 32-bit words. */ #if defined(__GNUCLIKE_ASM) && !defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(const struct ip *ip) { @@ -88,6 +89,7 @@ in_cksum_update(struct ip *ip) __tmpsum = (int)ntohs(ip->ip_sum) + 256; ip->ip_sum = htons(__tmpsum + (__tmpsum >> 16)); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -121,6 +123,7 @@ in_pseudo(u_int sum, u_int b, u_int c) } #else +#if defined(IPVERSION) && (IPVERSION == 4) #define in_cksum_update(ip) \ do { \ int __tmpsum; \ @@ -129,10 +132,13 @@ in_pseudo(u_int sum, u_int b, u_int c) } while(0) #endif +#endif #ifdef _KERNEL #if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER) +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); #endif Modified: stable/9/sys/ia64/include/in_cksum.h ============================================================================== --- stable/9/sys/ia64/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/ia64/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: stable/9/sys/mips/include/in_cksum.h ============================================================================== --- stable/9/sys/mips/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/mips/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -40,6 +40,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -66,9 +67,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: stable/9/sys/powerpc/include/in_cksum.h ============================================================================== --- stable/9/sys/powerpc/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/powerpc/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -39,6 +39,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) /* * It it useful to have an Internet checksum routine which is inlineable * and optimized specifically for the task of computing IP header checksums @@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip) } while(0) #endif +#endif #ifdef _KERNEL +#if defined(IPVERSION) && (IPVERSION == 4) u_int in_cksum_hdr(const struct ip *ip); +#endif u_short in_addword(u_short sum, u_short b); u_short in_pseudo(u_int sum, u_int b, u_int c); u_short in_cksum_skip(struct mbuf *m, int len, int skip); Modified: stable/9/sys/sparc64/include/in_cksum.h ============================================================================== --- stable/9/sys/sparc64/include/in_cksum.h Sun Jul 8 10:29:01 2012 (r238227) +++ stable/9/sys/sparc64/include/in_cksum.h Sun Jul 8 10:46:55 2012 (r238228) @@ -65,6 +65,7 @@ #define in_cksum(m, len) in_cksum_skip(m, len, 0) +#if defined(IPVERSION) && (IPVERSION == 4) static __inline void in_cksum_update(struct ip *ip) { @@ -73,6 +74,7 @@ in_cksum_update(struct ip *ip) __tmp = (int)ip->ip_sum + 1; ip->ip_sum = __tmp + (__tmp >> 16); } +#endif static __inline u_short in_addword(u_short sum, u_short b) @@ -106,6 +108,7 @@ in_pseudo(u_int sum, u_int b, u_int c) return (sum); } +#if defined(IPVERSION) && (IPVERSION == 4) static __inline u_int in_cksum_hdr(struct ip *ip) { @@ -163,6 +166,7 @@ in_cksum_hdr(struct ip *ip) #undef __LD_ADD return (__ret); } +#endif #ifdef _KERNEL u_short in_cksum_skip(struct mbuf *m, int len, int skip); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 10:57:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 065DC106566C; Sun, 8 Jul 2012 10:57:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52588FC08; Sun, 8 Jul 2012 10:57:49 +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 q68AvnFf046799; Sun, 8 Jul 2012 10:57:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68Avn40046797; Sun, 8 Jul 2012 10:57:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207081057.q68Avn40046797@svn.freebsd.org> From: Andriy Gapon Date: Sun, 8 Jul 2012 10:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238229 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 10:57:50 -0000 Author: avg Date: Sun Jul 8 10:57:49 2012 New Revision: 238229 URL: http://svn.freebsd.org/changeset/base/238229 Log: acpi_cpu: we are able to handle _CST change notifications... so un-ifdef code that is supposed to tell ACPI platform about that Tested by: Taku YAMAMOTO MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sun Jul 8 10:46:55 2012 (r238228) +++ head/sys/dev/acpica/acpi_cpu.c Sun Jul 8 10:57:49 2012 (r238229) @@ -918,14 +918,12 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft (void *)sc, 0, acpi_cpu_usage_sysctl, "A", "percent usage for each Cx state"); -#ifdef notyet /* Signal platform that we can handle _CST notification. */ if (!cpu_cx_generic && cpu_cst_cnt != 0) { ACPI_LOCK(acpi); AcpiOsWritePort(cpu_smi_cmd, cpu_cst_cnt, 8); ACPI_UNLOCK(acpi); } -#endif } /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 10:59:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE7C61065672; Sun, 8 Jul 2012 10:59:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id 870318FC12; Sun, 8 Jul 2012 10:59:21 +0000 (UTC) Received: from dhcp-128-232-132-170.eduroam.csx.cam.ac.uk (dhcp-128-232-132-170.eduroam.csx.cam.ac.uk [128.232.132.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPSA id 0D2E225D39FF; Sun, 8 Jul 2012 10:59:19 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201207081046.q68AktaF044816@svn.freebsd.org> Date: Sun, 8 Jul 2012 10:59:19 +0000 Content-Transfer-Encoding: 7bit Message-Id: <0F573FEB-F9CD-4AAD-B48A-CD16D3D75311@FreeBSD.org> References: <201207081046.q68AktaF044816@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r238228 - in stable/9/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 10:59:21 -0000 On 8. Jul 2012, at 10:46 , Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Jul 8 10:46:55 2012 > New Revision: 238228 > URL: http://svn.freebsd.org/changeset/base/238228 > > Log: > MFC r235941: > > in_cksum.h required ip.h to be included for struct ip. To be > able to use some general checksum functions like in_addword() > in a non-IPv4 context, limit the (also exported to user space) > IPv4 specific functions to the times, when the ip.h header is > present and IPVERSION is defined (to 4). > > Approved by: re > > Modified: > stable/9/sys/amd64/include/in_cksum.h > stable/9/sys/arm/include/in_cksum.h > stable/9/sys/i386/include/in_cksum.h > stable/9/sys/ia64/include/in_cksum.h > stable/9/sys/mips/include/in_cksum.h > stable/9/sys/powerpc/include/in_cksum.h > stable/9/sys/sparc64/include/in_cksum.h There still is cleanup to follow in HEAD as discussed with bde (general cleanup on these files) but for the time being it was not possible to address it anymore. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:24:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 247D01065670; Sun, 8 Jul 2012 11:24:23 +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 0D8EB8FC14; Sun, 8 Jul 2012 11:24:23 +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 q68BOMKB047945; Sun, 8 Jul 2012 11:24:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BOMEZ047940; Sun, 8 Jul 2012 11:24:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081124.q68BOMEZ047940@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:24:22 +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: r238230 - in stable/9/sys: dev/cxgb dev/cxgbe netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:24:23 -0000 Author: bz Date: Sun Jul 8 11:24:22 2012 New Revision: 238230 URL: http://svn.freebsd.org/changeset/base/238230 Log: MFC r235944: Significantly update tcp_lro for mostly two things: 1) introduce basic support for IPv6 without extension headers. 2) try hard to also get the incremental checksum updates right, especially also in the IPv4 case for the IP and TCP header. Move variables around for better locality, factor things out into functions, allow checksum updates to be compiled out, ... Leave a few comments on further things to look at in the future, though that is not the full list. Update drivers with appropriate #includes as needed for IPv6 data type in LRO. Approved by: re Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/netinet/tcp_lro.c stable/9/sys/netinet/tcp_lro.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_adapter.h Sun Jul 8 10:57:49 2012 (r238229) +++ stable/9/sys/dev/cxgb/cxgb_adapter.h Sun Jul 8 11:24:22 2012 (r238230) @@ -46,6 +46,7 @@ $FreeBSD$ #include #include #include +#include #include #include Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Sun Jul 8 10:57:49 2012 (r238229) +++ stable/9/sys/dev/cxgbe/adapter.h Sun Jul 8 11:24:22 2012 (r238230) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "offload.h" Modified: stable/9/sys/netinet/tcp_lro.c ============================================================================== --- stable/9/sys/netinet/tcp_lro.c Sun Jul 8 10:57:49 2012 (r238229) +++ stable/9/sys/netinet/tcp_lro.c Sun Jul 8 11:24:22 2012 (r238230) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2007, Myricom Inc. * Copyright (c) 2008, Intel Corporation. + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Bjoern Zeeb + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,365 +31,565 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include -#include #include #include #include #include +#include #include -#include #include #include +#include #include #include #include -#include #include +#ifndef LRO_ENTRIES +#define LRO_ENTRIES 8 /* # of LRO entries per RX queue. */ +#endif + +#define TCP_LRO_UPDATE_CSUM 1 +#ifndef TCP_LRO_UPDATE_CSUM +#define TCP_LRO_INVALID_CSUM 0x0000 +#endif -static uint16_t do_csum_data(uint16_t *raw, int len) -{ - uint32_t csum; - csum = 0; - while (len > 0) { - csum += *raw; - raw++; - csum += *raw; - raw++; - len -= 4; - } - csum = (csum >> 16) + (csum & 0xffff); - csum = (csum >> 16) + (csum & 0xffff); - return (uint16_t)csum; -} - -/* - * Allocate and init the LRO data structures - */ int -tcp_lro_init(struct lro_ctrl *cntl) +tcp_lro_init(struct lro_ctrl *lc) { - struct lro_entry *lro; - int i, error = 0; - - SLIST_INIT(&cntl->lro_free); - SLIST_INIT(&cntl->lro_active); + struct lro_entry *le; + int error, i; - cntl->lro_bad_csum = 0; - cntl->lro_queued = 0; - cntl->lro_flushed = 0; + lc->lro_bad_csum = 0; + lc->lro_queued = 0; + lc->lro_flushed = 0; + lc->lro_cnt = 0; + SLIST_INIT(&lc->lro_free); + SLIST_INIT(&lc->lro_active); + error = 0; for (i = 0; i < LRO_ENTRIES; i++) { - lro = (struct lro_entry *) malloc(sizeof (struct lro_entry), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (lro == NULL) { + le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (le == NULL) { if (i == 0) error = ENOMEM; break; } - cntl->lro_cnt = i; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + lc->lro_cnt = i + 1; + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } return (error); } void -tcp_lro_free(struct lro_ctrl *cntl) +tcp_lro_free(struct lro_ctrl *lc) { - struct lro_entry *entry; + struct lro_entry *le; + + while (!SLIST_EMPTY(&lc->lro_free)) { + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + free(le, M_DEVBUF); + } +} - while (!SLIST_EMPTY(&cntl->lro_free)) { - entry = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - free(entry, M_DEVBUF); +#ifdef TCP_LRO_UPDATE_CSUM +static uint16_t +tcp_lro_csum_th(struct tcphdr *th) +{ + uint32_t ch; + uint16_t *p, l; + + ch = th->th_sum = 0x0000; + l = th->th_off; + p = (uint16_t *)th; + while (l > 0) { + ch += *p; + p++; + ch += *p; + p++; + l--; + } + while (ch > 0xffff) + ch = (ch >> 16) + (ch & 0xffff); + + return (ch & 0xffff); +} + +static uint16_t +tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th, + uint16_t tcp_data_len, uint16_t csum) +{ + uint32_t c; + uint16_t cs; + + c = csum; + + /* Remove length from checksum. */ + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = (struct ip6_hdr *)l3hdr; + if (le->append_cnt == 0) + cs = ip6->ip6_plen; + else { + uint32_t cx; + + cx = ntohs(ip6->ip6_plen); + cs = in6_cksum_pseudo(ip6, cx, ip6->ip6_nxt, 0); + } + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; + + ip4 = (struct ip *)l3hdr; + if (le->append_cnt == 0) + cs = ip4->ip_len; + else { + cs = in_addword(ntohs(ip4->ip_len) - sizeof(*ip4), + IPPROTO_TCP); + cs = in_pseudo(ip4->ip_src.s_addr, ip4->ip_dst.s_addr, + htons(cs)); + } + break; + } +#endif + default: + cs = 0; /* Keep compiler happy. */ } + + cs = ~cs; + c += cs; + + /* Remove TCP header csum. */ + cs = ~tcp_lro_csum_th(th); + c += cs; + while (c > 0xffff) + c = (c >> 16) + (c & 0xffff); + + return (c & 0xffff); } +#endif void -tcp_lro_flush(struct lro_ctrl *cntl, struct lro_entry *lro) +tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) { - struct ifnet *ifp; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - uint32_t tcplen, tcp_csum; + if (le->append_cnt > 0) { + struct tcphdr *th; + uint16_t p_len; + + p_len = htons(le->p_len); + switch (le->eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + { + struct ip6_hdr *ip6; + + ip6 = le->le_ip6; + ip6->ip6_plen = p_len; + th = (struct tcphdr *)(ip6 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + le->p_len += ETHER_HDR_LEN + sizeof(*ip6); + break; + } +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip4; +#ifdef TCP_LRO_UPDATE_CSUM + uint32_t cl; + uint16_t c; +#endif + + ip4 = le->le_ip4; +#ifdef TCP_LRO_UPDATE_CSUM + /* Fix IP header checksum for new length. */ + c = ~ip4->ip_sum; + cl = c; + c = ~ip4->ip_len; + cl += c + p_len; + while (cl > 0xffff) + cl = (cl >> 16) + (cl & 0xffff); + c = cl; + ip4->ip_sum = ~c; +#else + ip4->ip_sum = TCP_LRO_INVALID_CSUM; +#endif + ip4->ip_len = p_len; + th = (struct tcphdr *)(ip4 + 1); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->p_len += ETHER_HDR_LEN; + break; + } +#endif + default: + th = NULL; /* Keep compiler happy. */ + } + le->m_head->m_pkthdr.csum_data = 0xffff; + le->m_head->m_pkthdr.len = le->p_len; - if (lro->append_cnt) { - /* incorporate the new len into the ip header and - * re-calculate the checksum */ - ip = lro->ip; - ip->ip_len = htons(lro->len - ETHER_HDR_LEN); - ip->ip_sum = 0; - ip->ip_sum = 0xffff ^ - do_csum_data((uint16_t*)ip, - sizeof (*ip)); - - lro->m_head->m_pkthdr.csum_flags = CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - lro->m_head->m_pkthdr.csum_data = 0xffff; - lro->m_head->m_pkthdr.len = lro->len; - - /* incorporate the latest ack into the tcp header */ - tcp = (struct tcphdr *) (ip + 1); - tcp->th_ack = lro->ack_seq; - tcp->th_win = lro->window; - /* incorporate latest timestamp into the tcp header */ - if (lro->timestamp) { - ts_ptr = (uint32_t *)(tcp + 1); - ts_ptr[1] = htonl(lro->tsval); - ts_ptr[2] = lro->tsecr; - } - /* - * update checksum in tcp header by re-calculating the - * tcp pseudoheader checksum, and adding it to the checksum - * of the tcp payload data - */ - tcp->th_sum = 0; - tcplen = lro->len - sizeof(*ip) - ETHER_HDR_LEN; - tcp_csum = lro->data_csum; - tcp_csum += in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(tcplen + IPPROTO_TCP)); - tcp_csum += do_csum_data((uint16_t*)tcp, - tcp->th_off << 2); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp_csum = (tcp_csum & 0xffff) + (tcp_csum >> 16); - tcp->th_sum = 0xffff ^ tcp_csum; - } - ifp = cntl->ifp; - (*ifp->if_input)(cntl->ifp, lro->m_head); - cntl->lro_queued += lro->append_cnt + 1; - cntl->lro_flushed++; - lro->m_head = NULL; - lro->timestamp = 0; - lro->append_cnt = 0; - SLIST_INSERT_HEAD(&cntl->lro_free, lro, next); + /* Incorporate the latest ACK into the TCP header. */ + th->th_ack = le->ack_seq; + th->th_win = le->window; + /* Incorporate latest timestamp into the TCP header. */ + if (le->timestamp != 0) { + uint32_t *ts_ptr; + + ts_ptr = (uint32_t *)(th + 1); + ts_ptr[1] = htonl(le->tsval); + ts_ptr[2] = le->tsecr; + } +#ifdef TCP_LRO_UPDATE_CSUM + /* Update the TCP header checksum. */ + le->ulp_csum += p_len; + le->ulp_csum += tcp_lro_csum_th(th); + while (le->ulp_csum > 0xffff) + le->ulp_csum = (le->ulp_csum >> 16) + + (le->ulp_csum & 0xffff); + th->th_sum = (le->ulp_csum & 0xffff); + th->th_sum = ~th->th_sum; +#else + th->th_sum = TCP_LRO_INVALID_CSUM; +#endif + } + + (*lc->ifp->if_input)(lc->ifp, le->m_head); + lc->lro_queued += le->append_cnt + 1; + lc->lro_flushed++; + bzero(le, sizeof(*le)); + SLIST_INSERT_HEAD(&lc->lro_free, le, next); } -int -tcp_lro_rx(struct lro_ctrl *cntl, struct mbuf *m_head, uint32_t csum) +#ifdef INET6 +static int +tcp_lro_rx_ipv6(struct lro_ctrl *lc, struct mbuf *m, struct ip6_hdr *ip6, + struct tcphdr **th) { - struct ether_header *eh; - struct ip *ip; - struct tcphdr *tcp; - uint32_t *ts_ptr; - struct mbuf *m_nxt, *m_tail; - struct lro_entry *lro; - int hlen, ip_len, tcp_hdr_len, tcp_data_len, tot_len; - int opt_bytes, trim, csum_flags; - uint32_t seq, tmp_csum, device_mtu; - - - eh = mtod(m_head, struct ether_header *); - if (eh->ether_type != htons(ETHERTYPE_IP)) - return 1; - ip = (struct ip *) (eh + 1); - if (ip->ip_p != IPPROTO_TCP) - return 1; - - /* ensure there are no options */ - if ((ip->ip_hl << 2) != sizeof (*ip)) - return -1; - - /* .. and the packet is not fragmented */ - if (ip->ip_off & htons(IP_MF|IP_OFFMASK)) - return -1; - /* verify that the IP header checksum is correct */ - csum_flags = m_head->m_pkthdr.csum_flags; + /* XXX-BZ we should check the flow-label. */ + + /* XXX-BZ We do not yet support ext. hdrs. */ + if (ip6->ip6_nxt != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Find the TCP header. */ + *th = (struct tcphdr *)(ip6 + 1); + + return (0); +} +#endif + +#ifdef INET +static int +tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4, + struct tcphdr **th) +{ + int csum_flags; + uint16_t csum; + + if (ip4->ip_p != IPPROTO_TCP) + return (TCP_LRO_NOT_SUPPORTED); + + /* Ensure there are no options. */ + if ((ip4->ip_hl << 2) != sizeof (*ip4)) + return (TCP_LRO_CANNOT); + + /* .. and the packet is not fragmented. */ + if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) + return (TCP_LRO_CANNOT); + + /* Legacy IP has a header checksum that needs to be correct. */ + csum_flags = m->m_pkthdr.csum_flags; if (csum_flags & CSUM_IP_CHECKED) { if (__predict_false((csum_flags & CSUM_IP_VALID) == 0)) { - cntl->lro_bad_csum++; - return -1; + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); } } else { - tmp_csum = do_csum_data((uint16_t *)ip, sizeof (*ip)); - if (__predict_false((tmp_csum ^ 0xffff) != 0)) { - cntl->lro_bad_csum++; - return -1; - } - } - - /* find the TCP header */ - tcp = (struct tcphdr *) (ip + 1); - - /* Get the TCP checksum if we dont have it */ - if (!csum) - csum = tcp->th_sum; - - /* ensure no bits set besides ack or psh */ - if ((tcp->th_flags & ~(TH_ACK | TH_PUSH)) != 0) - return -1; - - /* check for timestamps. Since the only option we handle are - timestamps, we only have to handle the simple case of - aligned timestamps */ - - opt_bytes = (tcp->th_off << 2) - sizeof (*tcp); - tcp_hdr_len = sizeof (*tcp) + opt_bytes; - ts_ptr = (uint32_t *)(tcp + 1); - if (opt_bytes != 0) { - if (__predict_false(opt_bytes != TCPOLEN_TSTAMP_APPA) || - (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| - TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP))) - return -1; - } - - ip_len = ntohs(ip->ip_len); - tcp_data_len = ip_len - (tcp->th_off << 2) - sizeof (*ip); - - - /* - * If frame is padded beyond the end of the IP packet, - * then we must trim the extra bytes off the end. + csum = in_cksum_hdr(ip4); + if (__predict_false((csum ^ 0xffff) != 0)) { + lc->lro_bad_csum++; + return (TCP_LRO_CANNOT); + } + } + + /* Find the TCP header (we assured there are no IP options). */ + *th = (struct tcphdr *)(ip4 + 1); + + return (0); +} +#endif + +int +tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) +{ + struct lro_entry *le; + struct ether_header *eh; +#ifdef INET6 + struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ +#endif +#ifdef INET + struct ip *ip4 = NULL; /* Keep compiler happy. */ +#endif + struct tcphdr *th; + void *l3hdr = NULL; /* Keep compiler happy. */ + uint32_t *ts_ptr; + tcp_seq seq; + int error, ip_len, l; + uint16_t eh_type, tcp_data_len; + + /* We expect a contiguous header [eh, ip, tcp]. */ + + eh = mtod(m, struct ether_header *); + eh_type = ntohs(eh->ether_type); + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); + error = tcp_lro_rx_ipv6(lc, m, ip6, &th); + if (error != 0) + return (error); + tcp_data_len = ntohs(ip6->ip6_plen); + ip_len = sizeof(*ip6) + tcp_data_len; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + l3hdr = ip4 = (struct ip *)(eh + 1); + error = tcp_lro_rx_ipv4(lc, m, ip4, &th); + if (error != 0) + return (error); + ip_len = ntohs(ip4->ip_len); + tcp_data_len = ip_len - sizeof(*ip4); + break; +#endif + /* XXX-BZ what happens in case of VLAN(s)? */ + default: + return (TCP_LRO_NOT_SUPPORTED); + } + + /* + * If the frame is padded beyond the end of the IP packet, then we must + * trim the extra bytes off. + */ + l = m->m_pkthdr.len - (ETHER_HDR_LEN + ip_len); + if (l != 0) { + if (l < 0) + /* Truncated packet. */ + return (TCP_LRO_CANNOT); + + m_adj(m, -l); + } + + /* + * Check TCP header constraints. */ - tot_len = m_head->m_pkthdr.len; - trim = tot_len - (ip_len + ETHER_HDR_LEN); - if (trim != 0) { - if (trim < 0) { - /* truncated packet */ - return -1; - } - m_adj(m_head, -trim); - tot_len = m_head->m_pkthdr.len; - } - - m_nxt = m_head; - m_tail = NULL; /* -Wuninitialized */ - while (m_nxt != NULL) { - m_tail = m_nxt; - m_nxt = m_tail->m_next; - } - - hlen = ip_len + ETHER_HDR_LEN - tcp_data_len; - seq = ntohl(tcp->th_seq); - - SLIST_FOREACH(lro, &cntl->lro_active, next) { - if (lro->source_port == tcp->th_sport && - lro->dest_port == tcp->th_dport && - lro->source_ip == ip->ip_src.s_addr && - lro->dest_ip == ip->ip_dst.s_addr) { - /* Flush now if appending will result in overflow. */ - if (lro->len > (65535 - tcp_data_len)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - break; - } - - /* Try to append it */ - - if (__predict_false(seq != lro->next_seq || - (tcp_data_len == 0 && - lro->ack_seq == tcp->th_ack))) { - /* out of order packet or dup ack */ - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - return -1; - } - - if (opt_bytes) { - uint32_t tsval = ntohl(*(ts_ptr + 1)); - /* make sure timestamp values are increasing */ - if (__predict_false(lro->tsval > tsval || - *(ts_ptr + 2) == 0)) { - return -1; - } - lro->tsval = tsval; - lro->tsecr = *(ts_ptr + 2); - } - - lro->next_seq += tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - lro->append_cnt++; - if (tcp_data_len == 0) { - m_freem(m_head); - return 0; - } - /* subtract off the checksum of the tcp header - * from the hardware checksum, and add it to the - * stored tcp data checksum. Byteswap the checksum - * if the total length so far is odd - */ - tmp_csum = do_csum_data((uint16_t*)tcp, - tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - if (lro->len & 0x1) { - /* Odd number of bytes so far, flip bytes */ - csum = ((csum << 8) | (csum >> 8)) & 0xffff; - } - csum = csum + lro->data_csum; - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->len += tcp_data_len; - - /* adjust mbuf so that m->m_data points to - the first byte of the payload */ - m_adj(m_head, hlen); - /* append mbuf chain */ - lro->m_tail->m_next = m_head; - /* advance the last pointer */ - lro->m_tail = m_tail; - /* flush packet if required */ - device_mtu = cntl->ifp->if_mtu; - if (lro->len > (65535 - device_mtu)) { - SLIST_REMOVE(&cntl->lro_active, lro, - lro_entry, next); - tcp_lro_flush(cntl, lro); - } - return 0; - } - } - - if (SLIST_EMPTY(&cntl->lro_free)) - return -1; - - /* start a new chain */ - lro = SLIST_FIRST(&cntl->lro_free); - SLIST_REMOVE_HEAD(&cntl->lro_free, next); - SLIST_INSERT_HEAD(&cntl->lro_active, lro, next); - lro->source_port = tcp->th_sport; - lro->dest_port = tcp->th_dport; - lro->source_ip = ip->ip_src.s_addr; - lro->dest_ip = ip->ip_dst.s_addr; - lro->next_seq = seq + tcp_data_len; - lro->mss = tcp_data_len; - lro->ack_seq = tcp->th_ack; - lro->window = tcp->th_win; - - /* save the checksum of just the TCP payload by - * subtracting off the checksum of the TCP header from - * the entire hardware checksum - * Since IP header checksum is correct, checksum over - * the IP header is -0. Substracting -0 is unnecessary. + /* Ensure no bits set besides ACK or PSH. */ + if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) + return (TCP_LRO_CANNOT); + + /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ + /* XXX-BZ Ideally we'd flush on PUSH? */ + + /* + * Check for timestamps. + * Since the only option we handle are timestamps, we only have to + * handle the simple case of aligned timestamps. + */ + l = (th->th_off << 2); + tcp_data_len -= l; + l -= sizeof(*th); + ts_ptr = (uint32_t *)(th + 1); + if (l != 0 && (__predict_false(l != TCPOLEN_TSTAMP_APPA) || + (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| + TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)))) + return (TCP_LRO_CANNOT); + + /* If the driver did not pass in the checksum, set it now. */ + if (csum == 0x0000) + csum = th->th_sum; + + seq = ntohl(th->th_seq); + + /* Try to find a matching previous segment. */ + SLIST_FOREACH(le, &lc->lro_active, next) { + if (le->eh_type != eh_type) + continue; + if (le->source_port != th->th_sport || + le->dest_port != th->th_dport) + continue; + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + if (bcmp(&le->source_ip6, &ip6->ip6_src, + sizeof(struct in6_addr)) != 0 || + bcmp(&le->dest_ip6, &ip6->ip6_dst, + sizeof(struct in6_addr)) != 0) + continue; + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + if (le->source_ip4 != ip4->ip_src.s_addr || + le->dest_ip4 != ip4->ip_dst.s_addr) + continue; + break; +#endif + } + + /* Flush now if appending will result in overflow. */ + if (le->p_len > (65535 - tcp_data_len)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + break; + } + + /* Try to append the new segment. */ + if (__predict_false(seq != le->next_seq || + (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { + /* Out of order packet or duplicate ACK. */ + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + return (TCP_LRO_CANNOT); + } + + if (l != 0) { + uint32_t tsval = ntohl(*(ts_ptr + 1)); + /* Make sure timestamp values are increasing. */ + /* XXX-BZ flip and use TSTMP_GEQ macro for this? */ + if (__predict_false(le->tsval > tsval || + *(ts_ptr + 2) == 0)) + return (TCP_LRO_CANNOT); + le->tsval = tsval; + le->tsecr = *(ts_ptr + 2); + } + + le->next_seq += tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + le->append_cnt++; + +#ifdef TCP_LRO_UPDATE_CSUM + le->ulp_csum += tcp_lro_rx_csum_fixup(le, l3hdr, th, + tcp_data_len, ~csum); +#endif + + if (tcp_data_len == 0) { + m_freem(m); + return (0); + } + + le->p_len += tcp_data_len; + + /* + * Adjust the mbuf so that m_data points to the first byte of + * the ULP payload. Adjust the mbuf to avoid complications and + * append new segment to existing mbuf chain. + */ + m_adj(m, m->m_pkthdr.len - tcp_data_len); + m->m_flags &= ~M_PKTHDR; + + le->m_tail->m_next = m; + le->m_tail = m_last(m); + + /* + * If a possible next full length packet would cause an + * overflow, pro-actively flush now. + */ + if (le->p_len > (65535 - lc->ifp->if_mtu)) { + SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); + tcp_lro_flush(lc, le); + } + + return (0); + } + + /* Try to find an empty slot. */ + if (SLIST_EMPTY(&lc->lro_free)) + return (TCP_LRO_CANNOT); + + /* Start a new segment chain. */ + le = SLIST_FIRST(&lc->lro_free); + SLIST_REMOVE_HEAD(&lc->lro_free, next); + SLIST_INSERT_HEAD(&lc->lro_active, le, next); + + /* Start filling in details. */ + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + le->le_ip6 = ip6; + le->source_ip6 = ip6->ip6_src; + le->dest_ip6 = ip6->ip6_dst; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN - sizeof(*ip6); + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + le->le_ip4 = ip4; + le->source_ip4 = ip4->ip_src.s_addr; + le->dest_ip4 = ip4->ip_dst.s_addr; + le->eh_type = eh_type; + le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN; + break; +#endif + } + le->source_port = th->th_sport; + le->dest_port = th->th_dport; + + le->next_seq = seq + tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + if (l != 0) { + le->timestamp = 1; + le->tsval = ntohl(*(ts_ptr + 1)); + le->tsecr = *(ts_ptr + 2); + } + +#ifdef TCP_LRO_UPDATE_CSUM + /* + * Do not touch the csum of the first packet. However save the + * "adjusted" checksum of just the source and destination addresses, + * the next header and the TCP payload. The length and TCP header + * parts may change, so we remove those from the saved checksum and + * re-add with final values on tcp_lro_flush() if needed. */ - tmp_csum = do_csum_data((uint16_t*)tcp, tcp_hdr_len); - csum = csum + (tmp_csum ^ 0xffff); - csum = (csum & 0xffff) + (csum >> 16); - csum = (csum & 0xffff) + (csum >> 16); - lro->data_csum = csum; - - lro->ip = ip; - /* record timestamp if it is present */ - if (opt_bytes) { - lro->timestamp = 1; - lro->tsval = ntohl(*(ts_ptr + 1)); - lro->tsecr = *(ts_ptr + 2); - } - lro->len = tot_len; - lro->m_head = m_head; - lro->m_tail = m_tail; - return 0; + KASSERT(le->ulp_csum == 0, ("%s: le=%p le->ulp_csum=0x%04x\n", + __func__, le, le->ulp_csum)); + + le->ulp_csum = tcp_lro_rx_csum_fixup(le, l3hdr, th, tcp_data_len, + ~csum); + th->th_sum = csum; /* Restore checksum on first packet. */ +#endif + + le->m_head = m; + le->m_tail = m_last(m); + + return (0); } + +/* end */ Modified: stable/9/sys/netinet/tcp_lro.h ============================================================================== --- stable/9/sys/netinet/tcp_lro.h Sun Jul 8 10:57:49 2012 (r238229) +++ stable/9/sys/netinet/tcp_lro.h Sun Jul 8 11:24:22 2012 (r238230) @@ -30,31 +30,46 @@ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ -struct lro_entry; struct lro_entry { - SLIST_ENTRY(lro_entry) next; - struct mbuf *m_head; - struct mbuf *m_tail; - int timestamp; - struct ip *ip; - uint32_t tsval; - uint32_t tsecr; - uint32_t source_ip; - uint32_t dest_ip; - uint32_t next_seq; - uint32_t ack_seq; - uint32_t len; - uint32_t data_csum; - uint16_t window; - uint16_t source_port; - uint16_t dest_port; - uint16_t append_cnt; - uint16_t mss; - + SLIST_ENTRY(lro_entry) next; + struct mbuf *m_head; + struct mbuf *m_tail; + union { + struct ip *ip4; + struct ip6_hdr *ip6; + } leip; + union { + in_addr_t s_ip4; + struct in6_addr s_ip6; + } lesource; + union { + in_addr_t d_ip4; + struct in6_addr d_ip6; + } ledest; + uint16_t source_port; + uint16_t dest_port; + uint16_t eh_type; /* EthernetHeader type. */ + uint16_t append_cnt; + uint32_t p_len; /* IP header payload length. */ + uint32_t ulp_csum; /* TCP, etc. checksum. */ + uint32_t next_seq; /* tcp_seq */ + uint32_t ack_seq; /* tcp_seq */ + uint32_t tsval; + uint32_t tsecr; + uint16_t window; + uint16_t timestamp; /* flag, not a TCP hdr field. */ }; SLIST_HEAD(lro_head, lro_entry); +#define le_ip4 leip.ip4 +#define le_ip6 leip.ip6 +#define source_ip4 lesource.s_ip4 +#define dest_ip4 ledest.d_ip4 +#define source_ip6 lesource.s_ip6 +#define dest_ip6 ledest.d_ip6 + +/* NB: This is part of driver structs. */ struct lro_ctrl { struct ifnet *ifp; int lro_queued; @@ -66,13 +81,12 @@ struct lro_ctrl { struct lro_head lro_free; }; - int tcp_lro_init(struct lro_ctrl *); void tcp_lro_free(struct lro_ctrl *); void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); -/* Number of LRO entries - these are per rx queue */ -#define LRO_ENTRIES 8 +#define TCP_LRO_CANNOT -1 +#define TCP_LRO_NOT_SUPPORTED 1 #endif /* _TCP_LRO_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:28:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65A45106564A; Sun, 8 Jul 2012 11:28:34 +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 502918FC0C; Sun, 8 Jul 2012 11:28:34 +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 q68BSYO5048165; Sun, 8 Jul 2012 11:28:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BSYs9048163; Sun, 8 Jul 2012 11:28:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081128.q68BSYs9048163@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:28:34 +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: r238231 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:28:34 -0000 Author: bz Date: Sun Jul 8 11:28:33 2012 New Revision: 238231 URL: http://svn.freebsd.org/changeset/base/238231 Log: MFC r235954: We currently nowhere set IP6A_SWAP making the entire check useless with the current code. Keep around but do not compile in. Approved by: re Modified: stable/9/sys/netinet6/route6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/route6.c ============================================================================== --- stable/9/sys/netinet6/route6.c Sun Jul 8 11:24:22 2012 (r238230) +++ stable/9/sys/netinet6/route6.c Sun Jul 8 11:28:33 2012 (r238231) @@ -62,6 +62,7 @@ route6_input(struct mbuf **mp, int *offp struct mbuf *m = *mp; struct ip6_rthdr *rh; int off = *offp, rhlen; +#ifdef __notyet__ struct ip6aux *ip6a; ip6a = ip6_findaux(m); @@ -73,6 +74,7 @@ route6_input(struct mbuf **mp, int *offp return IPPROTO_DONE; } } +#endif #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(*rh), IPPROTO_DONE); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:33:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBE46106566C; Sun, 8 Jul 2012 11:33:49 +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 C70838FC08; Sun, 8 Jul 2012 11:33:49 +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 q68BXnNO048440; Sun, 8 Jul 2012 11:33:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BXnNM048438; Sun, 8 Jul 2012 11:33:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081133.q68BXnNM048438@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:33:49 +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: r238232 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:33:50 -0000 Author: bz Date: Sun Jul 8 11:33:49 2012 New Revision: 238232 URL: http://svn.freebsd.org/changeset/base/238232 Log: MFC r235955: Simplify the code removing a return from an earlier else case, not differing from the default function return called now. Approved by: re Modified: stable/9/sys/netinet6/in6_src.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_src.c ============================================================================== --- stable/9/sys/netinet6/in6_src.c Sun Jul 8 11:28:33 2012 (r238231) +++ stable/9/sys/netinet6/in6_src.c Sun Jul 8 11:33:49 2012 (r238232) @@ -873,8 +873,7 @@ in6_selecthlim(struct inpcb *in6p, struc RTFREE(ro6.ro_rt); if (lifp) return (ND_IFINFO(lifp)->chlim); - } else - return (V_ip6_defhlim); + } } return (V_ip6_defhlim); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:42:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 571DF1065713; Sun, 8 Jul 2012 11:42:22 +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 27C4B8FC0C; Sun, 8 Jul 2012 11:42: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 q68BgM4D048833; Sun, 8 Jul 2012 11:42:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BgLQf048830; Sun, 8 Jul 2012 11:42:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081142.q68BgLQf048830@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:42:21 +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: r238233 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:42:22 -0000 Author: bz Date: Sun Jul 8 11:42:21 2012 New Revision: 238233 URL: http://svn.freebsd.org/changeset/base/238233 Log: MFC r235956: Hide the ip6aux functions. The only one referenced outside ip6_input.c is not compiled in yet (__notyet__) in route6.c (r235954, r238231). We do have accessor functions that should be used. Approved by: re Modified: stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/ip6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Sun Jul 8 11:33:49 2012 (r238232) +++ stable/9/sys/netinet6/ip6_input.c Sun Jul 8 11:42:21 2012 (r238233) @@ -146,6 +146,9 @@ RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_ static void ip6_init2(void *); static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); +static struct ip6aux *ip6_addaux(struct mbuf *); +static struct ip6aux *ip6_findaux(struct mbuf *m); +static void ip6_delaux (struct mbuf *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -1814,7 +1817,7 @@ ip6_lasthdr(struct mbuf *m, int off, int } } -struct ip6aux * +static struct ip6aux * ip6_addaux(struct mbuf *m) { struct m_tag *mtag; @@ -1831,7 +1834,7 @@ ip6_addaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -struct ip6aux * +static struct ip6aux * ip6_findaux(struct mbuf *m) { struct m_tag *mtag; @@ -1840,7 +1843,7 @@ ip6_findaux(struct mbuf *m) return mtag ? (struct ip6aux *)(mtag + 1) : NULL; } -void +static void ip6_delaux(struct mbuf *m) { struct m_tag *mtag; Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Sun Jul 8 11:33:49 2012 (r238232) +++ stable/9/sys/netinet6/ip6_var.h Sun Jul 8 11:42:21 2012 (r238233) @@ -388,9 +388,9 @@ char * ip6_get_prevhdr __P((struct mbuf int ip6_nexthdr __P((struct mbuf *, int, int, int *)); int ip6_lasthdr __P((struct mbuf *, int, int, int *)); -struct ip6aux *ip6_addaux __P((struct mbuf *)); +#ifdef __notyet__ struct ip6aux *ip6_findaux __P((struct mbuf *)); -void ip6_delaux __P((struct mbuf *)); +#endif extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:53:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCBD106564A; Sun, 8 Jul 2012 11:53:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D01B8FC0A; Sun, 8 Jul 2012 11:53: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 q68BrEhk049334; Sun, 8 Jul 2012 11:53:14 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BrEGj049331; Sun, 8 Jul 2012 11:53:14 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081153.q68BrEGj049331@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:53: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: r238234 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:53:14 -0000 Author: bz Date: Sun Jul 8 11:53:13 2012 New Revision: 238234 URL: http://svn.freebsd.org/changeset/base/238234 Log: MFC r235958,236130: Add support for delayed checksum calculations in the IPv6 output path. We currently cannot offload to the card if we add extension headers (which incl. fragmentation). Fix two SCTP offload support copy&paste bugs: calculate checksums if fragmenting and no need to flag IPv4 header checksums in the IPv6 forwarding path. Correctly get the payload length in host byte order. While we already plan to support >64k payload here, the IPv6 header payload length obviously is only 16 bit and the calculations need to be right. Approved by: re Modified: stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 11:42:21 2012 (r238233) +++ stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 11:53:13 2012 (r238234) @@ -586,8 +586,6 @@ skip_routing: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Sun Jul 8 11:42:21 2012 (r238233) +++ stable/9/sys/netinet6/ip6_output.c Sun Jul 8 11:53:13 2012 (r238234) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -182,6 +184,29 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) +static void +in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) +{ + u_short csum; + + csum = in_cksum_skip(m, offset + plen, offset); + if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) + csum = 0xffff; + offset += m->m_pkthdr.csum_data; /* checksum offset */ + + if (offset + sizeof(u_short) > m->m_len) { + printf("%s: delayed m_pullup, m->len: %d off: %d\n", + __func__, m->m_len, offset); + /* + * XXX this should not happen, but if it does, the correct + * behavior may be to insert the checksum in the appropriate + * next mbuf in the chain. + */ + return; + } + *(u_short *)(m->m_data + offset) = csum; +} + /* * IP6 output. The packet in mbuf chain m contains a skeletal IP6 * header (with pri, len, nxt, hlim, src, dst). @@ -221,9 +246,7 @@ ip6_output(struct mbuf *m0, struct ip6_p int flevalid = 0; int hdrsplit = 0; int needipsec = 0; -#ifdef SCTP - int sw_csum; -#endif + int sw_csum, tso; #ifdef IPSEC struct ipsec_output_state state; struct ip6_rthdr *rh = NULL; @@ -867,8 +890,6 @@ again: CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } - m->m_pkthdr.csum_flags |= - CSUM_IP_CHECKED | CSUM_IP_VALID; #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; @@ -891,7 +912,7 @@ again: } #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; + m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif error = netisr_queue(NETISR_IPV6, m); goto done; @@ -927,16 +948,32 @@ passout: * 4: if dontfrag == 1 && alwaysfrag == 1 * error, as we cannot handle this conflicting request */ + sw_csum = m->m_pkthdr.csum_flags; + if (!hdrsplit) { + tso = ((sw_csum & ifp->if_hwassist & CSUM_TSO) != 0) ? 1 : 0; + sw_csum &= ~ifp->if_hwassist; + } else + tso = 0; + /* + * If we added extension headers, we will not do TSO and calculate the + * checksums ourselves for now. + * XXX-BZ Need a framework to know when the NIC can handle it, even + * with ext. hdrs. + */ + if (sw_csum & CSUM_DELAY_DATA) { + sw_csum &= ~CSUM_DELAY_DATA; + in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); + } #ifdef SCTP - sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_hwassist; if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); sw_csum &= ~CSUM_SCTP; + sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); } #endif + m->m_pkthdr.csum_flags &= ifp->if_hwassist; tlen = m->m_pkthdr.len; - if (opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) + if ((opt && (opt->ip6po_flags & IP6PO_DONTFRAG)) || tso) dontfrag = 1; else dontfrag = 0; @@ -945,7 +982,7 @@ passout: error = EMSGSIZE; goto bad; } - if (dontfrag && tlen > IN6_LINKMTU(ifp)) { /* case 2-b */ + if (dontfrag && tlen > IN6_LINKMTU(ifp) && !tso) { /* case 2-b */ /* * Even if the DONTFRAG option is specified, we cannot send the * packet when the data length is larger than the MTU of the @@ -1033,6 +1070,22 @@ passout: goto bad; } + + /* + * If the interface will not calculate checksums on + * fragmented packets, then do it here. + * XXX-BZ handle the hw offloading case. Need flags. + */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + in6_delayed_cksum(m, plen, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } +#ifdef SCTP + if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + sctp_delayed_cksum(m, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_SCTP; + } +#endif mnext = &m->m_nextpkt; /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 11:57:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D5E8106568B; Sun, 8 Jul 2012 11:57:12 +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 47EF28FC0C; Sun, 8 Jul 2012 11:57: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 q68BvC1i049555; Sun, 8 Jul 2012 11:57:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68BvCGX049553; Sun, 8 Jul 2012 11:57:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081157.q68BvCGX049553@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 11:57: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: r238235 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 11:57:12 -0000 Author: bz Date: Sun Jul 8 11:57:11 2012 New Revision: 238235 URL: http://svn.freebsd.org/changeset/base/238235 Log: MFC r235959: Defer checksum calulations on UDP6 output and respect the mbuf flags set by NICs having done checksum validation for us already, thus saving the computing time in the input path as well. Approved by: re Modified: stable/9/sys/netinet6/udp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Sun Jul 8 11:53:13 2012 (r238234) +++ stable/9/sys/netinet6/udp6_usrreq.c Sun Jul 8 11:57:11 2012 (r238235) @@ -185,6 +185,7 @@ udp6_input(struct mbuf **mp, int *offp, #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; #endif + uint16_t uh_sum; ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); @@ -228,7 +229,18 @@ udp6_input(struct mbuf **mp, int *offp, UDPSTAT_INC(udps_nosum); goto badunlocked; } - if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { + + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + uh_sum = m->m_pkthdr.csum_data; + else + uh_sum = in6_cksum_pseudo(ip6, ulen, + IPPROTO_UDP, m->m_pkthdr.csum_data); + uh_sum ^= 0xffff; + } else + uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); + + if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); goto badunlocked; } @@ -771,10 +783,9 @@ udp6_output(struct inpcb *inp, struct mb ip6->ip6_src = *laddr; ip6->ip6_dst = *faddr; - if ((udp6->uh_sum = in6_cksum(m, IPPROTO_UDP, - sizeof(struct ip6_hdr), plen)) == 0) { - udp6->uh_sum = 0xffff; - } + udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); + m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); flags = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:01:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FE7A1065673; Sun, 8 Jul 2012 12:01:12 +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 17D618FC1D; Sun, 8 Jul 2012 12:01: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 q68C1BPK049787; Sun, 8 Jul 2012 12:01:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68C1B5M049785; Sun, 8 Jul 2012 12:01:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081201.q68C1B5M049785@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:01:11 +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: r238236 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:01:12 -0000 Author: bz Date: Sun Jul 8 12:01:11 2012 New Revision: 238236 URL: http://svn.freebsd.org/changeset/base/238236 Log: MFC r235960: Simple yet effective change enabling checksum "offload" on loopback for IPv6 to avoid expensive computations. Approved by: re Modified: stable/9/sys/net/if_loop.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_loop.c ============================================================================== --- stable/9/sys/net/if_loop.c Sun Jul 8 11:57:11 2012 (r238235) +++ stable/9/sys/net/if_loop.c Sun Jul 8 12:01:11 2012 (r238236) @@ -247,12 +247,12 @@ looutput(struct ifnet *ifp, struct mbuf #if 1 /* XXX */ switch (dst->sa_family) { case AF_INET: + case AF_INET6: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; - case AF_INET6: case AF_IPX: case AF_APPLETALK: break; From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:12:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D385A106566C; Sun, 8 Jul 2012 12:12:34 +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 BDB3A8FC12; Sun, 8 Jul 2012 12:12:34 +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 q68CCYGu050288; Sun, 8 Jul 2012 12:12:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CCYMN050281; Sun, 8 Jul 2012 12:12:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081212.q68CCYMN050281@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:12:34 +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: r238237 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:12:35 -0000 Author: bz Date: Sun Jul 8 12:12:34 2012 New Revision: 238237 URL: http://svn.freebsd.org/changeset/base/238237 Log: MFC r235961: Add code to handle pre-checked TCP checksums as indicated by mbuf flags to save the entire computation for validation if not needed. In the IPv6 TCP output path only compute the pseudo-header checksum, set the checksum offset in the mbuf field along the appropriate flag as done in IPv4. In tcp_respond() just initialize the IPv6 payload length to 0 as ip6_output() will properly set it. Approved by: re Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_timewait.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sun Jul 8 12:01:11 2012 (r238236) +++ stable/9/sys/netinet/tcp_input.c Sun Jul 8 12:12:34 2012 (r238237) @@ -610,13 +610,31 @@ tcp_input(struct mbuf *m, int off0) #ifdef INET6 if (isipv6) { /* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */ + + if (m->m_len < (sizeof(*ip6) + sizeof(*th))) { + m = m_pullup(m, sizeof(*ip6) + sizeof(*th)); + if (m == NULL) { + TCPSTAT_INC(tcps_rcvshort); + return; + } + } + ip6 = mtod(m, struct ip6_hdr *); + th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; - if (in6_cksum(m, IPPROTO_TCP, off0, tlen)) { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) + th->th_sum = m->m_pkthdr.csum_data; + else + th->th_sum = in6_cksum_pseudo(ip6, tlen, + IPPROTO_TCP, m->m_pkthdr.csum_data); + th->th_sum ^= 0xffff; + } else + th->th_sum = in6_cksum(m, IPPROTO_TCP, off0, tlen); + if (th->th_sum) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - th = (struct tcphdr *)((caddr_t)ip6 + off0); /* * Be proactive about unspecified IPv6 address in source. Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Sun Jul 8 12:01:11 2012 (r238236) +++ stable/9/sys/netinet/tcp_output.c Sun Jul 8 12:12:34 2012 (r238237) @@ -1052,19 +1052,23 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 - if (isipv6) + if (isipv6) { /* * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen + len); + th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + + optlen + len, IPPROTO_TCP, 0); + } +#endif +#if defined(INET6) && defined(INET) else -#endif /* INET6 */ +#endif +#ifdef INET { - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); @@ -1072,6 +1076,7 @@ send: KASSERT(ip->ip_v == IPVERSION, ("%s: IP version incorrect: %d", __func__, ip->ip_v)); } +#endif /* * Enable TSO and specify the size of the segments. Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Sun Jul 8 12:01:11 2012 (r238236) +++ stable/9/sys/netinet/tcp_subr.c Sun Jul 8 12:12:34 2012 (r238237) @@ -573,8 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipge ip6->ip6_flow = 0; ip6->ip6_vfc = IPV6_VERSION; ip6->ip6_nxt = IPPROTO_TCP; - ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) + - tlen)); + ip6->ip6_plen = 0; /* Set in ip6_output(). */ tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr); } #endif @@ -619,12 +618,13 @@ tcp_respond(struct tcpcb *tp, void *ipge else nth->th_win = htons((u_short)win); nth->th_urp = 0; + + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - nth->th_sum = 0; - nth->th_sum = in6_cksum(m, IPPROTO_TCP, - sizeof(struct ip6_hdr), - tlen - sizeof(struct ip6_hdr)); + nth->th_sum = in6_cksum_pseudo(ip6, + tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : NULL, NULL); } @@ -636,8 +636,6 @@ tcp_respond(struct tcpcb *tp, void *ipge { nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); } #endif /* INET */ #ifdef TCPDEBUG Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Sun Jul 8 12:01:11 2012 (r238236) +++ stable/9/sys/netinet/tcp_syncache.c Sun Jul 8 12:12:34 2012 (r238237) @@ -1472,11 +1472,12 @@ syncache_respond(struct syncache *sc) optlen = 0; M_SETFIB(m, sc->sc_inc.inc_fibnum); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { - th->th_sum = 0; - th->th_sum = in6_cksum(m, IPPROTO_TCP, hlen, - tlen + optlen - hlen); + th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, + IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(NULL, NULL); error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); } @@ -1488,8 +1489,6 @@ syncache_respond(struct syncache *sc) { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(tlen + optlen - hlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL); } #endif Modified: stable/9/sys/netinet/tcp_timewait.c ============================================================================== --- stable/9/sys/netinet/tcp_timewait.c Sun Jul 8 12:01:11 2012 (r238236) +++ stable/9/sys/netinet/tcp_timewait.c Sun Jul 8 12:12:34 2012 (r238237) @@ -574,10 +574,12 @@ tcp_twrespond(struct tcptw *tw, int flag th->th_flags = flags; th->th_win = htons(tw->last_win); + m->m_pkthdr.csum_flags = CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr), - sizeof(struct tcphdr) + optlen); + th->th_sum = in6_cksum_pseudo(ip6, + sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(inp, NULL); error = ip6_output(m, inp->in6p_outputopts, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); @@ -590,8 +592,6 @@ tcp_twrespond(struct tcptw *tw, int flag { th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); - m->m_pkthdr.csum_flags = CSUM_TCP; - m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); ip->ip_len = m->m_pkthdr.len; if (V_path_mtu_discovery) ip->ip_off |= IP_DF; From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:17:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27EDA1065698; Sun, 8 Jul 2012 12:17:57 +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 085338FC17; Sun, 8 Jul 2012 12:17:57 +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 q68CHu0M050553; Sun, 8 Jul 2012 12:17:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CHukI050551; Sun, 8 Jul 2012 12:17:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081217.q68CHukI050551@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:17: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: r238238 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:17:57 -0000 Author: bz Date: Sun Jul 8 12:17:56 2012 New Revision: 238238 URL: http://svn.freebsd.org/changeset/base/238238 Log: MFC r235962: Factor out Hop-By-Hop option processing. It's still not heavily used, it reduces the footprint of ip6_input() and makes ip6_input() more readable. Approved by: re Modified: stable/9/sys/netinet6/ip6_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Sun Jul 8 12:12:34 2012 (r238237) +++ stable/9/sys/netinet6/ip6_input.c Sun Jul 8 12:17:56 2012 (r238238) @@ -329,6 +329,83 @@ ip6_init2(void *dummy) /* This must be after route_init(), which is now SI_ORDER_THIRD */ SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); +static int +ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off, + int *nxt, int *ours) +{ + struct ip6_hdr *ip6; + struct ip6_hbh *hbh; + + if (ip6_hopopts_input(plen, rtalert, &m, off)) { +#if 0 /*touches NULL pointer*/ + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); +#endif + goto out; /* m have already been freed */ + } + + /* adjust pointer */ + ip6 = mtod(m, struct ip6_hdr *); + + /* + * if the payload length field is 0 and the next header field + * indicates Hop-by-Hop Options header, then a Jumbo Payload + * option MUST be included. + */ + if (ip6->ip6_plen == 0 && *plen == 0) { + /* + * Note that if a valid jumbo payload option is + * contained, ip6_hopopts_input() must set a valid + * (non-zero) payload length to the variable plen. + */ + V_ip6stat.ip6s_badoptions++; + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); + icmp6_error(m, ICMP6_PARAM_PROB, + ICMP6_PARAMPROB_HEADER, + (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + goto out; + } +#ifndef PULLDOWN_TEST + /* ip6_hopopts_input() ensures that mbuf is contiguous */ + hbh = (struct ip6_hbh *)(ip6 + 1); +#else + IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), + sizeof(struct ip6_hbh)); + if (hbh == NULL) { + V_ip6stat.ip6s_tooshort++; + goto out; + } +#endif + *nxt = hbh->ip6h_nxt; + + /* + * If we are acting as a router and the packet contains a + * router alert option, see if we know the option value. + * Currently, we only support the option value for MLD, in which + * case we should pass the packet to the multicast routing + * daemon. + */ + if (*rtalert != ~0) { + switch (*rtalert) { + case IP6OPT_RTALERT_MLD: + if (V_ip6_forwarding) + *ours = 1; + break; + default: + /* + * RFC2711 requires unrecognized values must be + * silently ignored. + */ + break; + } + } + + return (0); + +out: + return (1); +} + void ip6_input(struct mbuf *m) { @@ -827,71 +904,11 @@ passin: */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - struct ip6_hbh *hbh; + int error; - if (ip6_hopopts_input(&plen, &rtalert, &m, &off)) { -#if 0 /*touches NULL pointer*/ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); -#endif - goto out; /* m have already been freed */ - } - - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - - /* - * if the payload length field is 0 and the next header field - * indicates Hop-by-Hop Options header, then a Jumbo Payload - * option MUST be included. - */ - if (ip6->ip6_plen == 0 && plen == 0) { - /* - * Note that if a valid jumbo payload option is - * contained, ip6_hopopts_input() must set a valid - * (non-zero) payload length to the variable plen. - */ - V_ip6stat.ip6s_badoptions++; - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_discard); - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_hdrerr); - icmp6_error(m, ICMP6_PARAM_PROB, - ICMP6_PARAMPROB_HEADER, - (caddr_t)&ip6->ip6_plen - (caddr_t)ip6); + error = ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours); + if (error != 0) goto out; - } -#ifndef PULLDOWN_TEST - /* ip6_hopopts_input() ensures that mbuf is contiguous */ - hbh = (struct ip6_hbh *)(ip6 + 1); -#else - IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr), - sizeof(struct ip6_hbh)); - if (hbh == NULL) { - V_ip6stat.ip6s_tooshort++; - goto out; - } -#endif - nxt = hbh->ip6h_nxt; - - /* - * If we are acting as a router and the packet contains a - * router alert option, see if we know the option value. - * Currently, we only support the option value for MLD, in which - * case we should pass the packet to the multicast routing - * daemon. - */ - if (rtalert != ~0) { - switch (rtalert) { - case IP6OPT_RTALERT_MLD: - if (V_ip6_forwarding) - ours = 1; - break; - default: - /* - * RFC2711 requires unrecognized values must be - * silently ignored. - */ - break; - } - } } else nxt = ip6->ip6_nxt; From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:23:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D41621065673; Sun, 8 Jul 2012 12:23:27 +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 A2EE98FC08; Sun, 8 Jul 2012 12:23:27 +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 q68CNRVI050936; Sun, 8 Jul 2012 12:23:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CNROC050934; Sun, 8 Jul 2012 12:23:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081223.q68CNROC050934@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:23:27 +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: r238239 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:23:28 -0000 Author: bz Date: Sun Jul 8 12:23:27 2012 New Revision: 238239 URL: http://svn.freebsd.org/changeset/base/238239 Log: MFC r235981,236394 In case forwarding is turned on for a given address family, refuse to queue the packet for LRO and tell the driver to directly pass it on. This avoids re-assembly and later re-fragmentation problems when forwarding. It's not the best solution but the simplest and most effective for the moment. Make TCP LRO work properly with VIMAGE kernels rather than just panicing. There's no VIMAGE context set there yet as this is before if_ethersubr.c. Approved by: re Modified: stable/9/sys/netinet/tcp_lro.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_lro.c ============================================================================== --- stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:17:56 2012 (r238238) +++ stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:23:27 2012 (r238239) @@ -46,14 +46,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include +#include + #include #ifndef LRO_ENTRIES @@ -369,6 +373,14 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: + { + CURVNET_SET(lc->ifp->if_vnet); + if (V_ip6_forwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + CURVNET_RESTORE(); + return (TCP_LRO_CANNOT); + } + CURVNET_RESTORE(); l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); error = tcp_lro_rx_ipv6(lc, m, ip6, &th); if (error != 0) @@ -376,9 +388,18 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m tcp_data_len = ntohs(ip6->ip6_plen); ip_len = sizeof(*ip6) + tcp_data_len; break; + } #endif #ifdef INET case ETHERTYPE_IP: + { + CURVNET_SET(lc->ifp->if_vnet); + if (V_ipforwarding != 0) { + /* XXX-BZ stats but changing lro_ctrl is a problem. */ + CURVNET_RESTORE(); + return (TCP_LRO_CANNOT); + } + CURVNET_RESTORE(); l3hdr = ip4 = (struct ip *)(eh + 1); error = tcp_lro_rx_ipv4(lc, m, ip4, &th); if (error != 0) @@ -386,6 +407,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m ip_len = ntohs(ip4->ip_len); tcp_data_len = ip_len - sizeof(*ip4); break; + } #endif /* XXX-BZ what happens in case of VLAN(s)? */ default: From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:26:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 817441065670; Sun, 8 Jul 2012 12:26:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CAE78FC12; Sun, 8 Jul 2012 12:26:33 +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 q68CQXhJ051243; Sun, 8 Jul 2012 12:26:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CQXnY051241; Sun, 8 Jul 2012 12:26:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081226.q68CQXnY051241@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:26:33 +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: r238240 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:26:33 -0000 Author: bz Date: Sun Jul 8 12:26:32 2012 New Revision: 238240 URL: http://svn.freebsd.org/changeset/base/238240 Log: MFC r235985: Properly protect the inp read access when handling the control code. In the past this was expensive but given the rlock it's not so much anymore. Approved by: re Modified: stable/9/sys/netinet/udp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/udp_usrreq.c ============================================================================== --- stable/9/sys/netinet/udp_usrreq.c Sun Jul 8 12:23:27 2012 (r238239) +++ stable/9/sys/netinet/udp_usrreq.c Sun Jul 8 12:26:32 2012 (r238240) @@ -972,6 +972,7 @@ udp_output(struct inpcb *inp, struct mbu } src.sin_family = 0; + INP_RLOCK(inp); tos = inp->inp_ip_tos; if (control != NULL) { /* @@ -979,6 +980,7 @@ udp_output(struct inpcb *inp, struct mbu * stored in a single mbuf. */ if (control->m_next) { + INP_RUNLOCK(inp); m_freem(control); m_freem(m); return (EINVAL); @@ -1028,6 +1030,7 @@ udp_output(struct inpcb *inp, struct mbu m_freem(control); } if (error) { + INP_RUNLOCK(inp); m_freem(m); return (error); } @@ -1049,7 +1052,6 @@ udp_output(struct inpcb *inp, struct mbu * XXXRW: Check that hash locking update here is correct. */ sin = (struct sockaddr_in *)addr; - INP_RLOCK(inp); if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_RUNLOCK(inp); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:30:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE75E106566C; Sun, 8 Jul 2012 12:30:25 +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 A92ED8FC20; Sun, 8 Jul 2012 12:30: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 q68CUPAj051449; Sun, 8 Jul 2012 12:30:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CUP0v051447; Sun, 8 Jul 2012 12:30:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081230.q68CUP0v051447@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:30: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: r238241 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:30:26 -0000 Author: bz Date: Sun Jul 8 12:30:25 2012 New Revision: 238241 URL: http://svn.freebsd.org/changeset/base/238241 Log: MFC r235986: Use M_ZERO with malloc rather than calling bzero() ourselves. Change if () panic() checks to KASSERT()s as they are only catching invariants in code flow but not dependent on network input/output. Move initial assigments indirecting pointers after the lock has been aquired. Passing layer boundries, reset M_PROTOFLAGS. Remove a NULL assignment before free. Approved by: re Modified: stable/9/sys/netinet6/nd6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Sun Jul 8 12:26:32 2012 (r238240) +++ stable/9/sys/netinet6/nd6.c Sun Jul 8 12:30:25 2012 (r238241) @@ -174,9 +174,7 @@ nd6_ifattach(struct ifnet *ifp) { struct nd_ifinfo *nd; - nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK); - bzero(nd, sizeof(*nd)); - + nd = (struct nd_ifinfo *)malloc(sizeof(*nd), M_IP6NDP, M_WAITOK|M_ZERO); nd->initialized = 1; nd->chlim = IPV6_DEFHLIM; @@ -284,10 +282,9 @@ nd6_option(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int olen; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_option"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_option"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return NULL; if (ndopts->nd_opts_done) @@ -335,10 +332,9 @@ nd6_options(union nd_opts *ndopts) struct nd_opt_hdr *nd_opt; int i = 0; - if (ndopts == NULL) - panic("ndopts == NULL in nd6_options"); - if (ndopts->nd_opts_last == NULL) - panic("uninitialized ndopts in nd6_options"); + KASSERT(ndopts != NULL, ("%s: ndopts == NULL", __func__)); + KASSERT(ndopts->nd_opts_last != NULL, ("%s: uninitialized ndopts", + __func__)); if (ndopts->nd_opts_search == NULL) return 0; @@ -1174,11 +1170,13 @@ done: void nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) { - struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct sockaddr_in6 *gateway; struct nd_defrouter *dr; - struct ifnet *ifp = rt->rt_ifp; + struct ifnet *ifp; RT_LOCK_ASSERT(rt); + gateway = (struct sockaddr_in6 *)rt->rt_gateway; + ifp = rt->rt_ifp; switch (req) { case RTM_ADD: @@ -1557,10 +1555,8 @@ nd6_cache_lladdr(struct ifnet *ifp, stru IF_AFDATA_UNLOCK_ASSERT(ifp); - if (ifp == NULL) - panic("ifp == NULL in nd6_cache_lladdr"); - if (from == NULL) - panic("from == NULL in nd6_cache_lladdr"); + KASSERT(ifp != NULL, ("%s: ifp == NULL", __func__)); + KASSERT(from != NULL, ("%s: from == NULL", __func__)); /* nothing must be updated for unspecified address */ if (IN6_IS_ADDR_UNSPECIFIED(from)) @@ -2084,6 +2080,8 @@ nd6_output_lle(struct ifnet *ifp, struct } return (error); } + /* Reset layer specific mbuf flags to avoid confusing lower layers. */ + m->m_flags &= ~(M_PROTOFLAGS); if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL)); @@ -2252,7 +2250,6 @@ clear_llinfo_pqueue(struct llentry *ln) for (m_hold = ln->la_hold; m_hold; m_hold = m_hold_next) { m_hold_next = m_hold->m_nextpkt; - m_hold->m_nextpkt = NULL; m_freem(m_hold); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:34:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE53E106566C; Sun, 8 Jul 2012 12:34:12 +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 98EDD8FC08; Sun, 8 Jul 2012 12:34: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 q68CYCxp051724; Sun, 8 Jul 2012 12:34:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68CYC98051722; Sun, 8 Jul 2012 12:34:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081234.q68CYC98051722@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:34: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: r238242 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:34:12 -0000 Author: bz Date: Sun Jul 8 12:34:12 2012 New Revision: 238242 URL: http://svn.freebsd.org/changeset/base/238242 Log: MFC r235953: No need to hold the (expensive) rt lock over (expensive) logging. Approved by: re Modified: stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Sun Jul 8 12:30:25 2012 (r238241) +++ stable/9/sys/netinet6/icmp6.c Sun Jul 8 12:34:12 2012 (r238242) @@ -2418,23 +2418,23 @@ icmp6_redirect_input(struct mbuf *m, int if (rt) { if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; no route " "with inet6 gateway found for redirect dst: %s\n", icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { + RTFREE_LOCKED(rt); nd6log((LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): " "%s\n", ip6_sprintf(ip6buf, gw6), icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); - RTFREE_LOCKED(rt); goto bad; } } else { From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:36:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D7E51065670; Sun, 8 Jul 2012 12:36:45 +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 87F9B8FC0A; Sun, 8 Jul 2012 12:36:45 +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 q68CajrA051881; Sun, 8 Jul 2012 12:36:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68Cajb7051879; Sun, 8 Jul 2012 12:36:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081236.q68Cajb7051879@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:36:45 +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: r238243 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:36:45 -0000 Author: bz Date: Sun Jul 8 12:36:44 2012 New Revision: 238243 URL: http://svn.freebsd.org/changeset/base/238243 Log: MFC r235950: Factor out the tcp_hc_getmtu() call. As the comments say it applies to both v4 and v6, so only write it once making it easier to read the protocol family specifc code. Approved by: re Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sun Jul 8 12:34:12 2012 (r238242) +++ stable/9/sys/netinet/tcp_input.c Sun Jul 8 12:36:44 2012 (r238243) @@ -3594,7 +3594,6 @@ tcp_mssopt(struct in_conninfo *inc) if (inc->inc_flags & INC_ISIPV6) { mss = V_tcp_v6mssdflt; maxmtu = tcp_maxmtu6(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); } #endif @@ -3605,10 +3604,13 @@ tcp_mssopt(struct in_conninfo *inc) { mss = V_tcp_mssdflt; maxmtu = tcp_maxmtu(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct tcpiphdr); } #endif +#if defined(INET6) || defined(INET) + thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ +#endif + if (maxmtu && thcmtu) mss = min(maxmtu, thcmtu) - min_protoh; else if (maxmtu || thcmtu) From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 12:39:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 974D51065672; Sun, 8 Jul 2012 12:39:02 +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 82A4B8FC0A; Sun, 8 Jul 2012 12:39:02 +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 q68Cd2RP052019; Sun, 8 Jul 2012 12:39:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68Cd2UO052017; Sun, 8 Jul 2012 12:39:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081239.q68Cd2UO052017@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 12:39:02 +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: r238244 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 12:39:02 -0000 Author: bz Date: Sun Jul 8 12:39:02 2012 New Revision: 238244 URL: http://svn.freebsd.org/changeset/base/238244 Log: MFC r236093: Trim the extra $FreeBSD$ from the comment below the license. We use the __FBSDID() macro on the file now instead. Approved by: re Modified: stable/9/sys/netinet/tcp_lro.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_lro.c ============================================================================== --- stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:36:44 2012 (r238243) +++ stable/9/sys/netinet/tcp_lro.c Sun Jul 8 12:39:02 2012 (r238244) @@ -27,8 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #include From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 14:21:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACD3B106566B; Sun, 8 Jul 2012 14:21: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 950018FC1C; Sun, 8 Jul 2012 14:21: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 q68ELbGM056546; Sun, 8 Jul 2012 14:21:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68ELbB3056531; Sun, 8 Jul 2012 14:21:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081421.q68ELbB3056531@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 14:21:37 +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: r238247 - in stable/9: sbin/ifconfig sys/net sys/netinet sys/netinet6 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 14:21:37 -0000 Author: bz Date: Sun Jul 8 14:21:36 2012 New Revision: 238247 URL: http://svn.freebsd.org/changeset/base/238247 Log: MFC r236170,236176: It turns out that too many drivers are not only parsing the L2/3/4 headers for TSO but also for generic checksum offloading. Ideally we would only have one common function shared amongst all drivers, and perhaps when updating them for IPv6 we should introduce that. Eventually we should provide the meta information along with mbufs to avoid (re-)parsing entirely. To not break IPv6 (checksums and offload) and to be able to MFC the changes without risking to hurt 3rd party drivers, duplicate the v4 framework, as other OSes have done as well. Introduce interface capability flags for TX/RX checksum offload with IPv6, to allow independent toggling (where possible). Add CSUM_*_IPV6 flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6 fragmentation. Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and add an alias for CSUM_DATA_VALID_IPV6. This pretty much brings IPv6 handling in line with IPv4. TSO is still handled in a different way and not via if_hwassist. Update ifconfig to allow (un)setting of the new capability flags. Update loopback to announce the new capabilities and if_hwassist flags. Individual driver updates will have to follow, as will SCTP. Removed the IFCAP_ prefix when printing the IPv6 checksum capabilities. Approved by: re Modified: stable/9/sbin/ifconfig/ifconfig.8 stable/9/sbin/ifconfig/ifconfig.c stable/9/sys/net/if.h stable/9/sys/net/if_loop.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_timewait.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_ipsec.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/udp6_usrreq.c stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sbin/ifconfig/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.8 Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sbin/ifconfig/ifconfig.8 Sun Jul 8 14:21:36 2012 (r238247) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 19, 2012 +.Dd May 27, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -372,16 +372,32 @@ This is useful for devices which have mu .It Cm name Ar name Set the interface name to .Ar name . -.It Cm rxcsum , txcsum +.It Cm rxcsum , txcsum , rxcsum6 , txcsum6 If the driver supports user-configurable checksum offloading, enable receive (or transmit) checksum offloading on the interface. +The feature can be turned on selectively per protocol family. +Use +.Cm rxcsum6 , txcsum6 +for +.Xr ip6 4 +or +.Cm rxcsum , txcsum +otherwise. Some drivers may not be able to enable these flags independently of each other, so setting one may also set the other. The driver will offload as much checksum work as it can reliably support, the exact level of offloading varies between drivers. -.It Fl rxcsum , txcsum +.It Fl rxcsum , txcsum , rxcsum6 , txcsum6 If the driver supports user-configurable checksum offloading, disable receive (or transmit) checksum offloading on the interface. +The feature can be turned off selectively per protocol family. +Use +.Fl rxcsum6 , txcsum6 +for +.Xr ip6 4 +or +.Fl rxcsum , txcsum +otherwise. These settings may not always be independent of each other. .It Cm tso If the driver supports Modified: stable/9/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sbin/ifconfig/ifconfig.c Sun Jul 8 14:21:36 2012 (r238247) @@ -910,7 +910,8 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" +"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ +"\26RXCSUM_IPV6\27TXCSUM_IPV6" /* * Print the status of the interface. If an address family was @@ -1170,6 +1171,10 @@ static struct cmd basic_cmds[] = { DEF_CMD("-monitor", -IFF_MONITOR, setifflags), DEF_CMD("staticarp", IFF_STATICARP, setifflags), DEF_CMD("-staticarp", -IFF_STATICARP, setifflags), + DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap), + DEF_CMD("-rxcsum6", -IFCAP_RXCSUM_IPV6, setifcap), + DEF_CMD("txcsum6", IFCAP_TXCSUM_IPV6, setifcap), + DEF_CMD("-txcsum6", -IFCAP_TXCSUM_IPV6, setifcap), DEF_CMD("rxcsum", IFCAP_RXCSUM, setifcap), DEF_CMD("-rxcsum", -IFCAP_RXCSUM, setifcap), DEF_CMD("txcsum", IFCAP_TXCSUM, setifcap), Modified: stable/9/sys/net/if.h ============================================================================== --- stable/9/sys/net/if.h Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/net/if.h Sun Jul 8 14:21:36 2012 (r238247) @@ -230,6 +230,10 @@ struct if_data { #define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */ #define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */ #define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */ +#define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */ +#define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */ + +#define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) Modified: stable/9/sys/net/if_loop.c ============================================================================== --- stable/9/sys/net/if_loop.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/net/if_loop.c Sun Jul 8 14:21:36 2012 (r238247) @@ -92,7 +92,9 @@ #endif #define LO_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP) -#define LO_CSUM_SET (CSUM_DATA_VALID | CSUM_PSEUDO_HDR | \ +#define LO_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP) +#define LO_CSUM_SET (CSUM_DATA_VALID | CSUM_DATA_VALID_IPV6 | \ + CSUM_PSEUDO_HDR | \ CSUM_IP_CHECKED | CSUM_IP_VALID | \ CSUM_SCTP_VALID) @@ -143,8 +145,9 @@ lo_clone_create(struct if_clone *ifc, in ifp->if_ioctl = loioctl; ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_capabilities = ifp->if_capenable = IFCAP_HWCSUM; - ifp->if_hwassist = LO_CSUM_FEATURES; + ifp->if_capabilities = ifp->if_capenable = + IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; + ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); if (V_loif == NULL) @@ -247,12 +250,19 @@ looutput(struct ifnet *ifp, struct mbuf #if 1 /* XXX */ switch (dst->sa_family) { case AF_INET: - case AF_INET6: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; + break; + case AF_INET6: + if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = LO_CSUM_SET; + } + m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6; + break; case AF_IPX: case AF_APPLETALK: break; @@ -436,10 +446,15 @@ loioctl(struct ifnet *ifp, u_long cmd, c ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_TXCSUM) != 0) ifp->if_capenable ^= IFCAP_TXCSUM; + if ((mask & IFCAP_RXCSUM_IPV6) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + if ((mask & IFCAP_TXCSUM_IPV6) != 0) + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist = LO_CSUM_FEATURES; - else - ifp->if_hwassist = 0; + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= LO_CSUM_FEATURES6; break; default: Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet/tcp_input.c Sun Jul 8 14:21:36 2012 (r238247) @@ -622,7 +622,7 @@ tcp_input(struct mbuf *m, int off0) ip6 = mtod(m, struct ip6_hdr *); th = (struct tcphdr *)((caddr_t)ip6 + off0); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; else Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet/tcp_output.c Sun Jul 8 14:21:36 2012 (r238247) @@ -1052,7 +1052,6 @@ send: * checksum extended header and data. */ m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */ - m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { @@ -1060,6 +1059,7 @@ send: * ip6_plen is not need to be filled now, and will be filled * in ip6_output. */ + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + optlen + len, IPPROTO_TCP, 0); } @@ -1069,6 +1069,7 @@ send: #endif #ifdef INET { + m->m_pkthdr.csum_flags = CSUM_TCP; th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen)); Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet/tcp_subr.c Sun Jul 8 14:21:36 2012 (r238247) @@ -619,10 +619,10 @@ tcp_respond(struct tcpcb *tp, void *ipge nth->th_win = htons((u_short)win); nth->th_urp = 0; - m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; nth->th_sum = in6_cksum_pseudo(ip6, tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : @@ -634,6 +634,7 @@ tcp_respond(struct tcpcb *tp, void *ipge #endif #ifdef INET { + m->m_pkthdr.csum_flags = CSUM_TCP; nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); } Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet/tcp_syncache.c Sun Jul 8 14:21:36 2012 (r238247) @@ -1472,10 +1472,10 @@ syncache_respond(struct syncache *sc) optlen = 0; M_SETFIB(m, sc->sc_inc.inc_fibnum); - m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(NULL, NULL); @@ -1487,6 +1487,7 @@ syncache_respond(struct syncache *sc) #endif #ifdef INET { + m->m_pkthdr.csum_flags = CSUM_TCP; th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(tlen + optlen - hlen + IPPROTO_TCP)); error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL); Modified: stable/9/sys/netinet/tcp_timewait.c ============================================================================== --- stable/9/sys/netinet/tcp_timewait.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet/tcp_timewait.c Sun Jul 8 14:21:36 2012 (r238247) @@ -574,10 +574,10 @@ tcp_twrespond(struct tcptw *tw, int flag th->th_flags = flags; th->th_win = htons(tw->last_win); - m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); #ifdef INET6 if (isipv6) { + m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(inp, NULL); @@ -590,6 +590,7 @@ tcp_twrespond(struct tcptw *tw, int flag #endif #ifdef INET { + m->m_pkthdr.csum_flags = CSUM_TCP; th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); ip->ip_len = m->m_pkthdr.len; Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 14:21:36 2012 (r238247) @@ -581,9 +581,9 @@ skip_routing: m->m_flags |= M_FASTFWD_OURS; if (m->m_pkthdr.rcvif == NULL) m->m_pkthdr.rcvif = V_loif; - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP @@ -601,9 +601,9 @@ skip_routing: if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) m->m_pkthdr.rcvif = V_loif; - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP Modified: stable/9/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/9/sys/netinet6/ip6_ipsec.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet6/ip6_ipsec.c Sun Jul 8 14:21:36 2012 (r238247) @@ -291,6 +291,7 @@ ip6_ipsec_output(struct mbuf **m, struct /* * Do delayed checksums now because we send before * this is done in the normal processing path. + * XXX-BZ CSUM_DELAY_DATA_IPV6? */ if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { ipseclog((LOG_DEBUG, Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet6/ip6_output.c Sun Jul 8 14:21:36 2012 (r238247) @@ -190,7 +190,7 @@ in6_delayed_cksum(struct mbuf *m, uint32 u_short csum; csum = in_cksum_skip(m, offset + plen, offset); - if (m->m_pkthdr.csum_flags & CSUM_UDP && csum == 0) + if (m->m_pkthdr.csum_flags & CSUM_UDP_IPV6 && csum == 0) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ @@ -885,9 +885,9 @@ again: m->m_flags |= M_FASTFWD_OURS; if (m->m_pkthdr.rcvif == NULL) m->m_pkthdr.rcvif = V_loif; - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP @@ -905,9 +905,9 @@ again: if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) m->m_pkthdr.rcvif = V_loif; - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP @@ -960,8 +960,8 @@ passout: * XXX-BZ Need a framework to know when the NIC can handle it, even * with ext. hdrs. */ - if (sw_csum & CSUM_DELAY_DATA) { - sw_csum &= ~CSUM_DELAY_DATA; + if (sw_csum & CSUM_DELAY_DATA_IPV6) { + sw_csum &= ~CSUM_DELAY_DATA_IPV6; in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); } #ifdef SCTP @@ -1076,9 +1076,9 @@ passout: * fragmented packets, then do it here. * XXX-BZ handle the hw offloading case. Need flags. */ - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { in6_delayed_cksum(m, plen, hlen); - m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } #ifdef SCTP if (m->m_pkthdr.csum_flags & CSUM_SCTP) { Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/netinet6/udp6_usrreq.c Sun Jul 8 14:21:36 2012 (r238247) @@ -230,7 +230,7 @@ udp6_input(struct mbuf **mp, int *offp, goto badunlocked; } - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) uh_sum = m->m_pkthdr.csum_data; else @@ -784,7 +784,7 @@ udp6_output(struct inpcb *inp, struct mb ip6->ip6_dst = *faddr; udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); - m->m_pkthdr.csum_flags = CSUM_UDP; + m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); flags = 0; Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Sun Jul 8 14:06:26 2012 (r238246) +++ stable/9/sys/sys/mbuf.h Sun Jul 8 14:21:36 2012 (r238247) @@ -283,15 +283,24 @@ struct mbuf { #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ +/* CSUM_SCTP_IPV6 0x0080 will csum IPv6/SCTP */ #define CSUM_IP_CHECKED 0x0100 /* did csum IP */ #define CSUM_IP_VALID 0x0200 /* ... the csum is valid */ #define CSUM_DATA_VALID 0x0400 /* csum_data field is valid */ #define CSUM_PSEUDO_HDR 0x0800 /* csum_data has pseudo hdr */ #define CSUM_SCTP_VALID 0x1000 /* SCTP checksum is valid */ +#define CSUM_UDP_IPV6 0x2000 /* will csum IPv6/UDP */ +#define CSUM_TCP_IPV6 0x4000 /* will csum IPv6/TCP */ +/* CSUM_TSO_IPV6 0x8000 will do IPv6/TSO */ + +/* CSUM_FRAGMENT_IPV6 0x10000 will do IPv6 fragementation */ + +#define CSUM_DELAY_DATA_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) +#define CSUM_DATA_VALID_IPV6 CSUM_DATA_VALID #define CSUM_DELAY_DATA (CSUM_TCP | CSUM_UDP) -#define CSUM_DELAY_IP (CSUM_IP) /* XXX add ipv6 here too? */ +#define CSUM_DELAY_IP (CSUM_IP) /* Only v4, no v6 IP hdr csum */ /* * mbuf types. From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 15:30:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27FCE106566B; Sun, 8 Jul 2012 15:30:25 +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 131448FC08; Sun, 8 Jul 2012 15:30: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 q68FUOqY059443; Sun, 8 Jul 2012 15:30:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68FUOsd059441; Sun, 8 Jul 2012 15:30:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207081530.q68FUOsd059441@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 8 Jul 2012 15:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238248 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 15:30:25 -0000 Author: bz Date: Sun Jul 8 15:30:24 2012 New Revision: 238248 URL: http://svn.freebsd.org/changeset/base/238248 Log: Implement handling of "atomic fragements" as outlined in draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. MFC after: 5 days Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Sun Jul 8 14:21:36 2012 (r238247) +++ head/sys/netinet6/frag6.c Sun Jul 8 15:30:24 2012 (r238248) @@ -221,6 +221,19 @@ frag6_input(struct mbuf **mp, int *offp, /* offset now points to data portion */ offset += sizeof(struct ip6_frag); + /* + * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments) + * Handle "atomic" fragments (offset and m bit set to 0) upfront, + * unrelated to any reassembly. Just skip the fragment header. + */ + if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { + /* XXX-BZ we want dedicated counters for this. */ + V_ip6stat.ip6s_reassembled++; + in6_ifstat_inc(dstifp, ifs6_reass_ok); + *offp = offset; + return (ip6f->ip6f_nxt); + } + IP6Q_LOCK(); /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 15:37:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66C9106564A; Sun, 8 Jul 2012 15:37:58 +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 B69B18FC0A; Sun, 8 Jul 2012 15:37: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 q68Fbweh059787; Sun, 8 Jul 2012 15:37:58 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68FbwWQ059782; Sun, 8 Jul 2012 15:37:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207081537.q68FbwWQ059782@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 Jul 2012 15:37: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: r238249 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 15:37:59 -0000 Author: tuexen Date: Sun Jul 8 15:37:58 2012 New Revision: 238249 URL: http://svn.freebsd.org/changeset/base/238249 Log: MFC r236087: Get rid of SCTP specific code to avoid CRC32C computations on loopback. Just use offloading. Approved by: re Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 8 15:30:24 2012 (r238248) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 8 15:37:58 2012 (r238249) @@ -4116,14 +4116,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); @@ -4474,14 +4468,8 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Jul 8 15:30:24 2012 (r238248) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Jul 8 15:37:58 2012 (r238249) @@ -55,9 +55,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; -#if !defined(SCTP_WITH_NO_CSUM) - SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; -#endif SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -604,9 +601,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); -#if !defined(SCTP_WITH_NO_CSUM) - RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -870,11 +864,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); -#if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOOPBACK_NOCSUM_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Jul 8 15:30:24 2012 (r238248) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Jul 8 15:37:58 2012 (r238249) @@ -47,9 +47,6 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; -#if !defined(SCTP_WITH_NO_CSUM) - uint32_t sctp_no_csum_on_loopback; -#endif uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 8 15:30:24 2012 (r238248) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 8 15:37:58 2012 (r238249) @@ -150,11 +150,6 @@ sctp6_input(struct mbuf **i_pak, int *of goto sctp_skip_csum; } check = sh->checksum; /* save incoming checksum */ - if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) && - (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) { - SCTP_STAT_INCR(sctps_recvnocrc); - goto sctp_skip_csum; - } sh->checksum = 0; /* prepare for calc */ calc_check = sctp_calculate_cksum(m, iphlen); SCTP_STAT_INCR(sctps_recvswcrc); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 16:00:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89BA11065672; Sun, 8 Jul 2012 16:00:46 +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 727E38FC08; Sun, 8 Jul 2012 16:00:46 +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 q68G0kmV060791; Sun, 8 Jul 2012 16:00:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68G0kUl060785; Sun, 8 Jul 2012 16:00:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207081600.q68G0kUl060785@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 Jul 2012 16:00:46 +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: r238250 - in stable/9/sys: net netinet netinet6 sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 16:00:46 -0000 Author: tuexen Date: Sun Jul 8 16:00:45 2012 New Revision: 238250 URL: http://svn.freebsd.org/changeset/base/238250 Log: MFC r236332: Seperate SCTP checksum offloading for IPv4 and IPv6. While there: remove some trainling whitespaces. Approved by: re@ Modified: stable/9/sys/net/if_loop.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_loop.c ============================================================================== --- stable/9/sys/net/if_loop.c Sun Jul 8 15:37:58 2012 (r238249) +++ stable/9/sys/net/if_loop.c Sun Jul 8 16:00:45 2012 (r238250) @@ -92,7 +92,7 @@ #endif #define LO_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP) -#define LO_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP) +#define LO_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6) #define LO_CSUM_SET (CSUM_DATA_VALID | CSUM_DATA_VALID_IPV6 | \ CSUM_PSEUDO_HDR | \ CSUM_IP_CHECKED | CSUM_IP_VALID | \ Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 8 15:37:58 2012 (r238249) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:00:45 2012 (r238250) @@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - m->m_pkthdr.csum_flags = CSUM_SCTP; + m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; m->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -11069,7 +11069,7 @@ sctp_send_shutdown_complete2(struct mbuf #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP; + mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -12168,7 +12168,7 @@ sctp_send_abort(struct mbuf *m, int iphl #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP; + mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -12424,7 +12424,7 @@ sctp_send_operr_to(struct mbuf *m, int i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP; + mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 15:37:58 2012 (r238249) +++ stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 16:00:45 2012 (r238250) @@ -587,7 +587,7 @@ skip_routing: m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP) + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif error = netisr_queue(NETISR_IPV6, m); @@ -607,9 +607,9 @@ skip_routing: m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP) - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; -#endif + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) + m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; +#endif error = netisr_queue(NETISR_IPV6, m); goto out; } Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Sun Jul 8 15:37:58 2012 (r238249) +++ stable/9/sys/netinet6/ip6_output.c Sun Jul 8 16:00:45 2012 (r238250) @@ -508,7 +508,7 @@ skip_ipsec2:; #ifdef FLOWTABLE if (ro == &ip6route) { struct flentry *fle; - + /* * The flow table returns route entries valid for up to 30 * seconds; we rely on the remainder of ip_output() taking no @@ -521,7 +521,7 @@ skip_ipsec2:; flevalid = 1; } } -#endif +#endif again: /* * if specified, try to fill in the traffic class field. @@ -667,7 +667,7 @@ again: /* * The outgoing interface must be in the zone of source and - * destination addresses. + * destination addresses. */ origifp = ifp; @@ -693,7 +693,7 @@ again: goto badscope; } - /* We should use ia_ifp to support the case of + /* We should use ia_ifp to support the case of * sending packets to an address of our own. */ if (ia != NULL && ia->ia_ifp) @@ -891,7 +891,7 @@ again: m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP) + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; #endif error = netisr_queue(NETISR_IPV6, m); @@ -911,9 +911,9 @@ again: m->m_pkthdr.csum_data = 0xffff; } #ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP) + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; -#endif +#endif error = netisr_queue(NETISR_IPV6, m); goto done; } @@ -965,8 +965,8 @@ passout: in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); } #ifdef SCTP - if (sw_csum & CSUM_SCTP) { - sw_csum &= ~CSUM_SCTP; + if (sw_csum & CSUM_SCTP_IPV6) { + sw_csum &= ~CSUM_SCTP_IPV6; sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); } #endif @@ -1081,9 +1081,9 @@ passout: m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } #ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { sctp_delayed_cksum(m, hlen); - m->m_pkthdr.csum_flags &= ~CSUM_SCTP; + m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; } #endif mnext = &m->m_nextpkt; Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Sun Jul 8 15:37:58 2012 (r238249) +++ stable/9/sys/sys/mbuf.h Sun Jul 8 16:00:45 2012 (r238250) @@ -115,7 +115,7 @@ struct pkthdr { /* variables for ip and tcp reassembly */ void *header; /* pointer to packet header */ int len; /* total packet length */ - uint32_t flowid; /* packet's 4-tuple system + uint32_t flowid; /* packet's 4-tuple system * flow identifier */ /* variables for hardware checksum */ @@ -283,7 +283,7 @@ struct mbuf { #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ -/* CSUM_SCTP_IPV6 0x0080 will csum IPv6/SCTP */ +#define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ #define CSUM_IP_CHECKED 0x0100 /* did csum IP */ #define CSUM_IP_VALID 0x0200 /* ... the csum is valid */ @@ -425,7 +425,7 @@ static __inline int m_gettype(int size) { int type; - + switch (size) { case MSIZE: type = EXT_MBUF; @@ -455,7 +455,7 @@ static __inline uma_zone_t m_getzone(int size) { uma_zone_t zone; - + switch (size) { case MSIZE: zone = zone_mbuf; @@ -594,7 +594,7 @@ m_free_fast(struct mbuf *m) if (m->m_flags & M_PKTHDR) KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags")); #endif - + uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS); } @@ -654,7 +654,7 @@ m_cljset(struct mbuf *m, void *cl, int t { uma_zone_t zone; int size; - + switch (type) { case EXT_CLUSTER: size = MCLBYTES; @@ -706,7 +706,7 @@ m_last(struct mbuf *m) extern void (*m_addr_chg_pf_p)(struct mbuf *m); -static __inline void +static __inline void m_addr_changed(struct mbuf *m) { @@ -1074,7 +1074,7 @@ m_tag_find(struct mbuf *m, int type, str #define M_SETFIB(_m, _fib) do { \ _m->m_flags &= ~M_FIB; \ _m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB); \ -} while (0) +} while (0) #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 16:11:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44D45106564A; Sun, 8 Jul 2012 16:11:17 +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 2D4FF8FC0C; Sun, 8 Jul 2012 16:11: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 q68GBH57061265; Sun, 8 Jul 2012 16:11:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68GBHq1061261; Sun, 8 Jul 2012 16:11:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207081611.q68GBHq1061261@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 Jul 2012 16:11: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: r238251 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 16:11:17 -0000 Author: tuexen Date: Sun Jul 8 16:11:16 2012 New Revision: 238251 URL: http://svn.freebsd.org/changeset/base/238251 Log: MFC r236956: Unify the sending of ABORT, SHUTDOWN-COMPLETE and ERROR chunks. While there: Fix also some minor bugs and prepare for SCTP/DTLS. Approved by: re@ Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 8 16:00:45 2012 (r238250) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 8 16:11:16 2012 (r238251) @@ -1442,7 +1442,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, iphlen, op_err, cookie->peers_vtag, + sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; @@ -2570,7 +2570,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, iphlen, op_err, cookie->peers_vtag, + sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, vrf_id, port); return (NULL); } Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:00:45 2012 (r238250) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:11:16 2012 (r238251) @@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; + m->m_pkthdr.csum_flags = CSUM_SCTP; m->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -10854,19 +10854,20 @@ sctp_send_shutdown_complete(struct sctp_ return; } -void -sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, - uint32_t vrf_id, uint16_t port) +static void +sctp_send_resp_msg(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, + uint8_t type, struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - /* formulate and SEND a SHUTDOWN-COMPLETE */ struct mbuf *o_pak; struct mbuf *mout; + struct sctphdr *shout; + struct sctp_chunkhdr *ch; struct ip *iph; - struct udphdr *udp = NULL; - int offset_out, len, mlen; - struct sctp_shutdown_complete_msg *comp_cp; + struct udphdr *udp; + int len, cause_len, padding_len, ret; #ifdef INET + sctp_route_t ro; struct ip *iph_out; #endif @@ -10875,31 +10876,59 @@ sctp_send_shutdown_complete2(struct mbuf #endif + /* Compute the length of the cause and add final padding. */ + cause_len = 0; + if (cause != NULL) { + struct mbuf *m_at, *m_last = NULL; + + for (m_at = cause; m_at; m_at = SCTP_BUF_NEXT(m_at)) { + if (SCTP_BUF_NEXT(m_at) == NULL) + m_last = m_at; + cause_len += SCTP_BUF_LEN(m_at); + } + padding_len = cause_len % 4; + if (padding_len != 0) { + padding_len = 4 - padding_len; + } + if (padding_len != 0) { + if (sctp_add_pad_tombuf(m_last, padding_len)) { + sctp_m_freem(cause); + return; + } + } + } else { + padding_len = 0; + } + /* Get an mbuf for the header. */ + len = sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); iph = mtod(m, struct ip *); switch (iph->ip_v) { #ifdef INET case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctp_shutdown_complete_msg)); + len += sizeof(struct ip); break; #endif #ifdef INET6 case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctp_shutdown_complete_msg)); + len += sizeof(struct ip6_hdr); break; #endif default: - return; + break; } if (port) { len += sizeof(struct udphdr); } mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); if (mout == NULL) { + if (cause) { + sctp_m_freem(cause); + } return; } SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = NULL; + SCTP_BUF_NEXT(mout) = cause; if (m->m_flags & M_FLOWID) { mout->m_pkthdr.flowid = m->m_pkthdr.flowid; mout->m_flags |= M_FLOWID; @@ -10910,18 +10939,14 @@ sctp_send_shutdown_complete2(struct mbuf #ifdef INET6 ip6_out = NULL; #endif - offset_out = 0; - switch (iph->ip_v) { #ifdef INET case IPVERSION: iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; + iph_out->ip_hl = (sizeof(struct ip) >> 2); + iph_out->ip_tos = 0; + iph_out->ip_id = ip_newid(); iph_out->ip_off = 0; iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); if (port) { @@ -10931,21 +10956,19 @@ sctp_send_shutdown_complete2(struct mbuf } iph_out->ip_src.s_addr = iph->ip_dst.s_addr; iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - - /* let IP layer calculate this */ iph_out->ip_sum = 0; - offset_out += sizeof(*iph_out); - comp_cp = (struct sctp_shutdown_complete_msg *)( - (caddr_t)iph_out + offset_out); + len = sizeof(struct ip); + shout = (struct sctphdr *)((caddr_t)iph_out + len); break; #endif #ifdef INET6 case IPV6_VERSION >> 4: ip6 = (struct ip6_hdr *)iph; ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IPv6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; + ip6_out->ip6_flow = htonl(0x60000000); + if (V_ip6_auto_flowlabel) { + ip6_out->ip6_flow |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); + } ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; @@ -10954,78 +10977,84 @@ sctp_send_shutdown_complete2(struct mbuf } ip6_out->ip6_src = ip6->ip6_dst; ip6_out->ip6_dst = ip6->ip6_src; - /* - * ?? The old code had both the iph len + payload, I think - * this is wrong and would never have worked - */ - ip6_out->ip6_plen = sizeof(struct sctp_shutdown_complete_msg); - offset_out += sizeof(*ip6_out); - comp_cp = (struct sctp_shutdown_complete_msg *)( - (caddr_t)ip6_out + offset_out); + len = sizeof(struct ip6_hdr); + shout = (struct sctphdr *)((caddr_t)ip6_out + len); break; -#endif /* INET6 */ +#endif default: - /* Currently not supported. */ - sctp_m_freem(mout); - return; + len = 0; + shout = mtod(mout, struct sctphdr *); + break; } if (port) { if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { sctp_m_freem(mout); return; } - udp = (struct udphdr *)comp_cp; + udp = (struct udphdr *)shout; udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); udp->uh_dport = port; - udp->uh_ulen = htons(sizeof(struct sctp_shutdown_complete_msg) + sizeof(struct udphdr)); -#ifdef INET - if (iph_out) { - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } -#endif - offset_out += sizeof(struct udphdr); - comp_cp = (struct sctp_shutdown_complete_msg *)((caddr_t)comp_cp + sizeof(struct udphdr)); + udp->uh_sum = 0; + udp->uh_ulen = htons(sizeof(struct udphdr) + + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + cause_len + padding_len); + len += sizeof(struct udphdr); + shout = (struct sctphdr *)((caddr_t)shout + sizeof(struct udphdr)); + } else { + udp = NULL; + } + shout->src_port = sh->dest_port; + shout->dest_port = sh->src_port; + shout->checksum = 0; + if (vtag) { + shout->v_tag = htonl(vtag); + } else { + shout->v_tag = sh->v_tag; } + len += sizeof(struct sctphdr); + ch = (struct sctp_chunkhdr *)((caddr_t)shout + sizeof(struct sctphdr)); + ch->chunk_type = type; + if (vtag) { + ch->chunk_flags = 0; + } else { + ch->chunk_flags = SCTP_HAD_NO_TCB; + } + ch->chunk_length = htons(sizeof(struct sctp_chunkhdr) + cause_len); + len += sizeof(struct sctp_chunkhdr); + len += cause_len + padding_len; + if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ sctp_m_freem(mout); return; } - /* Now copy in and fill in the ABORT tags etc. */ - comp_cp->sh.src_port = sh->dest_port; - comp_cp->sh.dest_port = sh->src_port; - comp_cp->sh.checksum = 0; - comp_cp->sh.v_tag = sh->v_tag; - comp_cp->shut_cmp.ch.chunk_flags = SCTP_HAD_NO_TCB; - comp_cp->shut_cmp.ch.chunk_type = SCTP_SHUTDOWN_COMPLETE; - comp_cp->shut_cmp.ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk)); - + SCTP_ATTACH_CHAIN(o_pak, mout, len); #ifdef INET if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - mlen = SCTP_BUF_LEN(mout); - bzero(&ro, sizeof ro); - /* set IPv4 length */ - iph_out->ip_len = mlen; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, mlen); + /* zap the stack pointer to the route */ + bzero(&ro, sizeof(sctp_route_t)); + if (port) { + if (V_udp_cksum) { + udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); + } else { + udp->uh_sum = 0; + } + } + iph_out->ip_len = len; +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(mout, len); + } #endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - comp_cp->sh.checksum = sctp_calculate_cksum(mout, offset_out); + shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(mout); + SCTP_ENABLE_UDP_CSUM(o_pak); } } else { #if defined(SCTP_WITH_NO_CSUM) @@ -11036,40 +11065,36 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_STAT_INCR(sctps_sendhwcrc); #endif } - SCTP_ATTACH_CHAIN(o_pak, mout, mlen); - /* out it goes */ SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - /* Free the route if we got one back */ - if (ro.ro_rt) + if (ro.ro_rt) { RTFREE(ro.ro_rt); + } } #endif #ifdef INET6 if (ip6_out != NULL) { - int ret; - - mlen = SCTP_BUF_LEN(mout); + ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, mlen); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(mout, len); + } #endif - SCTP_ATTACH_CHAIN(o_pak, mout, mlen); if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - comp_cp->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); #endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), mlen - sizeof(struct ip6_hdr))) == 0) { + if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; } } else { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; + mout->m_pkthdr.csum_flags = CSUM_SCTP; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -11081,7 +11106,13 @@ sctp_send_shutdown_complete2(struct mbuf SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; +} +void +sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, + uint32_t vrf_id, uint16_t port) +{ + sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, vrf_id, port); } void @@ -11913,528 +11944,24 @@ skip_stuff: void sctp_send_abort(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vtag, - struct mbuf *err_cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - /*- - * Formulate the abort message, and send it back down. - */ - struct mbuf *o_pak; - struct mbuf *mout; - struct sctp_abort_msg *abm; - struct ip *iph; - struct udphdr *udp; - int iphlen_out, len; - -#ifdef INET - struct ip *iph_out; - -#endif -#ifdef INET6 - struct ip6_hdr *ip6, *ip6_out; - -#endif - - /* don't respond to ABORT with ABORT */ + /* Don't respond to an ABORT with an ABORT. */ if (sctp_is_there_an_abort_here(m, iphlen, &vtag)) { - if (err_cause) - sctp_m_freem(err_cause); + if (cause) + sctp_m_freem(cause); return; } - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctp_abort_msg)); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctp_abort_msg)); - break; -#endif - default: - if (err_cause) { - sctp_m_freem(err_cause); - } - return; - } - if (port) { - len += sizeof(struct udphdr); - } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); - if (mout == NULL) { - if (err_cause) { - sctp_m_freem(err_cause); - } - return; - } - SCTP_BUF_RESV_UF(mout, max_linkhdr); - SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = err_cause; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; - mout->m_flags |= M_FLOWID; - } -#ifdef INET - iph_out = NULL; -#endif -#ifdef INET6 - ip6_out = NULL; -#endif - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ - iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; - iph_out->ip_off = 0; - iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); - if (port) { - iph_out->ip_p = IPPROTO_UDP; - } else { - iph_out->ip_p = IPPROTO_SCTP; - } - iph_out->ip_src.s_addr = iph->ip_dst.s_addr; - iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - /* let IP layer calculate this */ - iph_out->ip_sum = 0; - - iphlen_out = sizeof(*iph_out); - abm = (struct sctp_abort_msg *)((caddr_t)iph_out + iphlen_out); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - ip6 = (struct ip6_hdr *)iph; - ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IP6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); - if (port) { - ip6_out->ip6_nxt = IPPROTO_UDP; - } else { - ip6_out->ip6_nxt = IPPROTO_SCTP; - } - ip6_out->ip6_src = ip6->ip6_dst; - ip6_out->ip6_dst = ip6->ip6_src; - - iphlen_out = sizeof(*ip6_out); - abm = (struct sctp_abort_msg *)((caddr_t)ip6_out + iphlen_out); - break; -#endif /* INET6 */ - default: - /* Currently not supported */ - sctp_m_freem(mout); - return; - } - - udp = (struct udphdr *)abm; - if (port) { - if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { - sctp_m_freem(mout); - return; - } - udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - udp->uh_dport = port; - /* set udp->uh_ulen later */ - udp->uh_sum = 0; - iphlen_out += sizeof(struct udphdr); - abm = (struct sctp_abort_msg *)((caddr_t)abm + sizeof(struct udphdr)); - } - abm->sh.src_port = sh->dest_port; - abm->sh.dest_port = sh->src_port; - abm->sh.checksum = 0; - if (vtag == 0) { - abm->sh.v_tag = sh->v_tag; - abm->msg.ch.chunk_flags = SCTP_HAD_NO_TCB; - } else { - abm->sh.v_tag = htonl(vtag); - abm->msg.ch.chunk_flags = 0; - } - abm->msg.ch.chunk_type = SCTP_ABORT_ASSOCIATION; - - if (err_cause) { - struct mbuf *m_tmp = err_cause; - int err_len = 0; - - /* get length of the err_cause chain */ - while (m_tmp != NULL) { - err_len += SCTP_BUF_LEN(m_tmp); - m_tmp = SCTP_BUF_NEXT(m_tmp); - } - len = SCTP_BUF_LEN(mout) + err_len; - if (err_len % 4) { - /* need pad at end of chunk */ - uint32_t cpthis = 0; - int padlen; - - padlen = 4 - (len % 4); - m_copyback(mout, len, padlen, (caddr_t)&cpthis); - len += padlen; - } - abm->msg.ch.chunk_length = htons(sizeof(abm->msg.ch) + err_len); - } else { - len = SCTP_BUF_LEN(mout); - abm->msg.ch.chunk_length = htons(sizeof(abm->msg.ch)); - } - - if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ - sctp_m_freem(mout); - return; - } -#ifdef INET - if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - /* zap the stack pointer to the route */ - bzero(&ro, sizeof ro); - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip)); - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } - SCTPDBG(SCTP_DEBUG_OUTPUT2, "sctp_send_abort calling ip_output:\n"); - SCTPDBG_PKT(SCTP_DEBUG_OUTPUT2, iph_out, &abm->sh); - /* set IPv4 length */ - iph_out->ip_len = len; - /* out it goes */ -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - abm->sh.checksum = sctp_calculate_cksum(mout, iphlen_out); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(o_pak); - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); - } -#endif -#ifdef INET6 - if (ip6_out != NULL) { - int ret; - - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); - } - SCTPDBG(SCTP_DEBUG_OUTPUT2, "sctp_send_abort calling ip6_output:\n"); - SCTPDBG_PKT(SCTP_DEBUG_OUTPUT2, (struct ip *)ip6_out, &abm->sh); - ip6_out->ip6_plen = len - sizeof(*ip6_out); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - abm->sh.checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { - udp->uh_sum = 0xffff; - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } -#endif - SCTP_STAT_INCR(sctps_sendpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, vrf_id, port); + return; } void -sctp_send_operr_to(struct mbuf *m, int iphlen, struct mbuf *scm, uint32_t vtag, - uint32_t vrf_id, uint16_t port) +sctp_send_operr_to(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, + struct mbuf *cause, uint32_t vrf_id, uint16_t port) { - struct mbuf *o_pak; - struct sctphdr *sh, *sh_out; - struct sctp_chunkhdr *ch; - struct ip *iph; - struct udphdr *udp = NULL; - struct mbuf *mout; - int iphlen_out, len; - -#ifdef INET - struct ip *iph_out; - -#endif -#ifdef INET6 - struct ip6_hdr *ip6, *ip6_out; - -#endif - - iph = mtod(m, struct ip *); - sh = (struct sctphdr *)((caddr_t)iph + iphlen); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - len = (sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr)); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - len = (sizeof(struct ip6_hdr) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr)); - break; -#endif - default: - if (scm) { - sctp_m_freem(scm); - } - return; - } - if (port) { - len += sizeof(struct udphdr); - } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); - if (mout == NULL) { - if (scm) { - sctp_m_freem(scm); - } - return; - } - SCTP_BUF_RESV_UF(mout, max_linkhdr); - SCTP_BUF_LEN(mout) = len; - SCTP_BUF_NEXT(mout) = scm; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; - mout->m_flags |= M_FLOWID; - } -#ifdef INET - iph_out = NULL; -#endif -#ifdef INET6 - ip6_out = NULL; -#endif - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - iph_out = mtod(mout, struct ip *); - - /* Fill in the IP header for the ABORT */ - iph_out->ip_v = IPVERSION; - iph_out->ip_hl = (sizeof(struct ip) / 4); - iph_out->ip_tos = (u_char)0; - iph_out->ip_id = 0; - iph_out->ip_off = 0; - iph_out->ip_ttl = MODULE_GLOBAL(ip_defttl); - if (port) { - iph_out->ip_p = IPPROTO_UDP; - } else { - iph_out->ip_p = IPPROTO_SCTP; - } - iph_out->ip_src.s_addr = iph->ip_dst.s_addr; - iph_out->ip_dst.s_addr = iph->ip_src.s_addr; - /* let IP layer calculate this */ - iph_out->ip_sum = 0; - - iphlen_out = sizeof(struct ip); - sh_out = (struct sctphdr *)((caddr_t)iph_out + iphlen_out); - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - ip6 = (struct ip6_hdr *)iph; - ip6_out = mtod(mout, struct ip6_hdr *); - - /* Fill in the IP6 header for the ABORT */ - ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); - if (port) { - ip6_out->ip6_nxt = IPPROTO_UDP; - } else { - ip6_out->ip6_nxt = IPPROTO_SCTP; - } - ip6_out->ip6_src = ip6->ip6_dst; - ip6_out->ip6_dst = ip6->ip6_src; - - iphlen_out = sizeof(struct ip6_hdr); - sh_out = (struct sctphdr *)((caddr_t)ip6_out + iphlen_out); - break; -#endif /* INET6 */ - default: - /* Currently not supported */ - sctp_m_freem(mout); - return; - } - - udp = (struct udphdr *)sh_out; - if (port) { - if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { - sctp_m_freem(mout); - return; - } - udp->uh_sport = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); - udp->uh_dport = port; - /* set udp->uh_ulen later */ - udp->uh_sum = 0; - iphlen_out += sizeof(struct udphdr); - sh_out = (struct sctphdr *)((caddr_t)udp + sizeof(struct udphdr)); - } - sh_out->src_port = sh->dest_port; - sh_out->dest_port = sh->src_port; - sh_out->v_tag = vtag; - sh_out->checksum = 0; - - ch = (struct sctp_chunkhdr *)((caddr_t)sh_out + sizeof(struct sctphdr)); - ch->chunk_type = SCTP_OPERATION_ERROR; - ch->chunk_flags = 0; - - if (scm) { - struct mbuf *m_tmp = scm; - int cause_len = 0; - - /* get length of the err_cause chain */ - while (m_tmp != NULL) { - cause_len += SCTP_BUF_LEN(m_tmp); - m_tmp = SCTP_BUF_NEXT(m_tmp); - } - len = SCTP_BUF_LEN(mout) + cause_len; - if (cause_len % 4) { - /* need pad at end of chunk */ - uint32_t cpthis = 0; - int padlen; - - padlen = 4 - (len % 4); - m_copyback(mout, len, padlen, (caddr_t)&cpthis); - len += padlen; - } - ch->chunk_length = htons(sizeof(struct sctp_chunkhdr) + cause_len); - } else { - len = SCTP_BUF_LEN(mout); - ch->chunk_length = htons(sizeof(struct sctp_chunkhdr)); - } - - if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { - /* no mbuf's */ - sctp_m_freem(mout); - return; - } -#ifdef INET - if (iph_out != NULL) { - sctp_route_t ro; - int ret; - - /* zap the stack pointer to the route */ - bzero(&ro, sizeof ro); - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip)); - if (V_udp_cksum) { - udp->uh_sum = in_pseudo(iph_out->ip_src.s_addr, iph_out->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); - } else { - udp->uh_sum = 0; - } - } - /* set IPv4 length */ - iph_out->ip_len = len; - /* out it goes */ -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - sh_out->checksum = sctp_calculate_cksum(mout, iphlen_out); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if (V_udp_cksum) { - SCTP_ENABLE_UDP_CSUM(o_pak); - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP_OUTPUT(ret, o_pak, &ro, NULL, vrf_id); - - /* Free the route if we got one back */ - if (ro.ro_rt) - RTFREE(ro.ro_rt); - } -#endif -#ifdef INET6 - if (ip6_out != NULL) { - int ret; - - if (port) { - udp->uh_ulen = htons(len - sizeof(struct ip6_hdr)); - } - ip6_out->ip6_plen = len - sizeof(*ip6_out); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(mout, len); -#endif - SCTP_ATTACH_CHAIN(o_pak, mout, len); - if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - sh_out->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); -#endif - if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), len - sizeof(struct ip6_hdr))) == 0) { - udp->uh_sum = 0xffff; - } - } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else - mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - mout->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); -#endif - } - SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } -#endif - SCTP_STAT_INCR(sctps_sendpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outpackets); - SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, vrf_id, port); + return; } static struct mbuf * Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sun Jul 8 16:00:45 2012 (r238250) +++ stable/9/sys/netinet/sctp_output.h Sun Jul 8 16:11:16 2012 (r238251) @@ -204,7 +204,9 @@ void sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, struct mbuf *, uint32_t, uint16_t); -void sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t, uint32_t, uint16_t); +void +sctp_send_operr_to(struct mbuf *, struct sctphdr *, uint32_t, + struct mbuf *, uint32_t, uint16_t); #endif /* _KERNEL || __Userspace__ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 16:14:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D19E8106566C; Sun, 8 Jul 2012 16:14:42 +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 BA1738FC0C; Sun, 8 Jul 2012 16:14:42 +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 q68GEggK061484; Sun, 8 Jul 2012 16:14:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68GEgST061474; Sun, 8 Jul 2012 16:14:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207081614.q68GEgST061474@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 Jul 2012 16:14:42 +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: r238253 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 16:14:43 -0000 Author: tuexen Date: Sun Jul 8 16:14:42 2012 New Revision: 238253 URL: http://svn.freebsd.org/changeset/base/238253 Log: MFC r237049: Pass flowid explicitly through the stack instead of taking it from the mbuf chain at different places. While there: Fix several bugs related to VRFs. Approved by: re@ Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 8 16:14:42 2012 (r238253) @@ -2516,8 +2516,10 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, - struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint32_t * high_tsn) + struct sctphdr *sh, struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_data_chunk *ch, chunk_buf; struct sctp_association *asoc; @@ -2625,7 +2627,9 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, port); return (2); } #ifdef SCTP_AUDITING_ENABLED @@ -2689,7 +2693,11 @@ sctp_process_data(struct mbuf **mm, int struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, 0, net->port); + sctp_abort_association(inp, stcb, + m, iphlen, + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); return (2); } break; Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_indata.h Sun Jul 8 16:14:42 2012 (r238253) @@ -113,7 +113,9 @@ void int sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint32_t *); + struct sctp_nets *, uint32_t *, + uint8_t, uint32_t, + uint32_t, uint16_t); void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 8 16:14:42 2012 (r238253) @@ -81,8 +81,10 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, - struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, - int *abort_no_unlock, uint32_t vrf_id, uint16_t port) + struct sctp_init_chunk *cp, struct sctp_inpcb *inp, + struct sctp_tcb *stcb, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_init *init; struct mbuf *op_err; @@ -96,6 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -107,6 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -116,6 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -125,6 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -134,6 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + use_mflowid, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -142,7 +149,9 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, vrf_id, port); + sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, port); if (stcb) *abort_no_unlock = 1; goto outnow; @@ -169,7 +178,9 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } goto outnow; } @@ -180,7 +191,9 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, vrf_id, port, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + use_mflowid, mflowid, + vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); } outnow: @@ -406,9 +419,11 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, - struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id) +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, + struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, + struct sctp_nets *net, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id) { struct sctp_association *asoc; struct mbuf *op_err; @@ -445,8 +460,9 @@ sctp_process_init_ack(struct mbuf *m, in SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - NULL, 0, net->port); + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -520,7 +536,9 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, vrf_id, net->port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; } return (retval); @@ -1260,9 +1278,11 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, - struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, - struct sctp_nets *net, int *abort_no_unlock, uint32_t vrf_id) +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, + struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, + struct sctp_nets *net, int *abort_no_unlock, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id) { struct sctp_init_ack *init_ack; struct mbuf *op_err; @@ -1279,7 +1299,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1289,7 +1311,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1297,7 +1321,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1305,7 +1331,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1313,7 +1341,9 @@ sctp_handle_init_ack(struct mbuf *m, int /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, 0, net->port); + op_err, + use_mflowid, mflowid, + vrf_id, net->port); *abort_no_unlock = 1; return (-1); } @@ -1336,7 +1366,9 @@ sctp_handle_init_ack(struct mbuf *m, int stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, - net, abort_no_unlock, vrf_id) < 0) { + net, abort_no_unlock, + use_mflowid, mflowid, + vrf_id) < 0) { /* error in parsing parameters */ return (-1); } @@ -1391,6 +1423,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port); @@ -1405,7 +1438,9 @@ sctp_process_cookie_existing(struct mbuf struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, - uint32_t vrf_id, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, uint16_t port) + int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; struct sctp_init_chunk *init_cp, init_buf; @@ -1443,6 +1478,7 @@ sctp_process_cookie_existing(struct mbuf ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; @@ -1667,7 +1703,9 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, op_err, + use_mflowid, mflowid, + vrf_id, port); return (NULL); } if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && @@ -1832,6 +1870,7 @@ sctp_process_cookie_existing(struct mbuf return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, vrf_id, port)); } /* @@ -1962,12 +2001,13 @@ sctp_process_cookie_existing(struct mbuf * cookie-echo chunk length: length of the cookie chunk to: where the init * was from returns a new TCB */ -struct sctp_tcb * +static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_tcb *stcb; @@ -2062,7 +2102,9 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); return (NULL); } /* get the correct sctp_nets */ @@ -2088,7 +2130,9 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2335,7 +2379,9 @@ sctp_handle_cookie_echo(struct mbuf *m, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, - struct sctp_tcb **locked_tcb, uint32_t vrf_id, uint16_t port) + struct sctp_tcb **locked_tcb, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_state_cookie *cookie; struct sctp_tcb *l_stcb = *stcb; @@ -2571,6 +2617,7 @@ sctp_handle_cookie_echo(struct mbuf *m, tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + use_mflowid, mflowid, vrf_id, port); return (NULL); } @@ -2658,21 +2705,25 @@ sctp_handle_cookie_echo(struct mbuf *m, /* this is the "normal" case... get a new TCB */ *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, *inp_p, netp, to, ¬ification, - auth_skipped, auth_offset, auth_len, vrf_id, port); + auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, + vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, - ¬ification, vrf_id, auth_skipped, auth_offset, auth_len, port); + ¬ification, auth_skipped, auth_offset, auth_len, + use_mflowid, mflowid, + vrf_id, port); } if (*stcb == NULL) { /* still no TCB... must be bad cookie-echo */ return (NULL); } - if ((*netp != NULL) && (m->m_flags & M_FLOWID)) { - (*netp)->flowid = m->m_pkthdr.flowid; + if ((*netp != NULL) && (use_mflowid != 0)) { + (*netp)->flowid = mflowid; #ifdef INVARIANTS (*netp)->flowidset = 1; #endif @@ -2745,7 +2796,9 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, vrf_id, port); + sh, op_err, + use_mflowid, mflowid, + vrf_id, port); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); @@ -4361,6 +4414,7 @@ __attribute__((noinline)) sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; @@ -4517,6 +4571,7 @@ __attribute__((noinline)) if (stcb == NULL) { /* no association, so it's out of the blue... */ sctp_handle_ootb(m, iphlen, *offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); *offset = length; if (locked_tcb) { @@ -4554,6 +4609,7 @@ __attribute__((noinline)) SCTP_TCB_UNLOCK(locked_tcb); } sctp_handle_ootb(m, iphlen, *offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); return (NULL); } @@ -4695,7 +4751,9 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, vrf_id, port); + iphlen, sh, NULL, + use_mflowid, mflowid, + vrf_id, port); *offset = length; return (NULL); } @@ -4705,13 +4763,17 @@ process_control_chunks: op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, vrf_id, port); + iphlen, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); *offset = length; return (NULL); } sctp_handle_init(m, iphlen, *offset, sh, (struct sctp_init_chunk *)ch, inp, - stcb, &abort_no_unlock, vrf_id, port); + stcb, &abort_no_unlock, + use_mflowid, mflowid, + vrf_id, port); *offset = length; if ((!abort_no_unlock) && (locked_tcb)) { SCTP_TCB_UNLOCK(locked_tcb); @@ -4760,7 +4822,11 @@ process_control_chunks: } if ((netp) && (*netp)) { ret = sctp_handle_init_ack(m, iphlen, *offset, sh, - (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, vrf_id); + (struct sctp_init_ack_chunk *)ch, + stcb, *netp, + &abort_no_unlock, + use_mflowid, mflowid, + vrf_id); } else { ret = -1; } @@ -5066,7 +5132,9 @@ process_control_chunks: op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, vrf_id, port); + iphlen, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); } *offset = length; return (NULL); @@ -5098,6 +5166,8 @@ process_control_chunks: auth_offset, auth_len, &locked_tcb, + use_mflowid, + mflowid, vrf_id, port); } else { @@ -5550,8 +5620,10 @@ __attribute__((noinline)) void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, - uint8_t ecn_bits, uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_nets *net, uint8_t ecn_bits, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { /* * Control chunk processing @@ -5587,6 +5659,7 @@ sctp_common_input_processing(struct mbuf */ SCTP_TCB_UNLOCK(stcb); sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); goto out_now; } @@ -5595,7 +5668,9 @@ sctp_common_input_processing(struct mbuf /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, - inp, stcb, &net, &fwd_tsn_seen, vrf_id, port); + inp, stcb, &net, &fwd_tsn_seen, + use_mflowid, mflowid, + vrf_id, port); if (stcb) { /* * This covers us if the cookie-echo was there and @@ -5631,6 +5706,7 @@ sctp_common_input_processing(struct mbuf if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); goto out_now; } @@ -5700,6 +5776,7 @@ sctp_common_input_processing(struct mbuf * We consider OOTB any data sent during asoc setup. */ sctp_handle_ootb(m, iphlen, offset, sh, inp, + use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); goto out_now; @@ -5720,7 +5797,9 @@ sctp_common_input_processing(struct mbuf } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, sh, - inp, stcb, net, &high_tsn); + inp, stcb, net, &high_tsn, + use_mflowid, mflowid, + vrf_id, port); if (retval == 2) { /* * The association aborted, NO UNLOCK needed since @@ -5820,6 +5899,8 @@ sctp_input_with_port(struct mbuf *i_pak, struct sctp_chunkhdr *ch; int refcount_up = 0; int length, mlen, offset; + uint32_t mflowid; + uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) uint32_t check, calc_check; @@ -5855,6 +5936,13 @@ sctp_input_with_port(struct mbuf *i_pak, if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) sctp_packet_log(m, mlen); #endif + if (m->m_flags & M_FLOWID) { + mflowid = m->m_pkthdr.flowid; + use_mflowid = 1; + } else { + mflowid = 0; + use_mflowid = 0; + } /* * Must take out the iphlen, since mlen expects this (only effect lb * case) @@ -5926,8 +6014,8 @@ sctp_input_with_port(struct mbuf *i_pak, } net->port = port; } - if ((net != NULL) && (m->m_flags & M_FLOWID)) { - net->flowid = m->m_pkthdr.flowid; + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; #ifdef INVARIANTS net->flowidset = 1; #endif @@ -5961,8 +6049,8 @@ sctp_skip_csum_4: } net->port = port; } - if ((net != NULL) && (m->m_flags & M_FLOWID)) { - net->flowid = m->m_pkthdr.flowid; + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; #ifdef INVARIANTS net->flowidset = 1; #endif @@ -5989,7 +6077,9 @@ sctp_skip_csum_4: sh->v_tag = init_chk->init.initiate_tag; } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, vrf_id, port); + sctp_send_shutdown_complete2(m, sh, + use_mflowid, mflowid, + vrf_id, port); goto bad; } if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { @@ -5999,7 +6089,9 @@ sctp_skip_csum_4: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } } goto bad; @@ -6028,7 +6120,9 @@ sctp_skip_csum_4: /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, vrf_id, port); + inp, stcb, net, ecn_bits, + use_mflowid, mflowid, + vrf_id, port); /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_input.h Sun Jul 8 16:14:42 2012 (r238253) @@ -39,8 +39,11 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, - struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, - struct sctp_tcb *, struct sctp_nets *, uint8_t, uint32_t, uint16_t); + struct sctphdr *, struct sctp_chunkhdr *, + struct sctp_inpcb *, struct sctp_tcb *, + struct sctp_nets *, uint8_t, + uint8_t, uint32_t, + uint32_t, uint16_t); struct sctp_stream_reset_out_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:14:42 2012 (r238253) @@ -3859,13 +3859,13 @@ sctp_lowlevel_chunk_output(struct sctp_i uint16_t dest_port, uint32_t v_tag, uint16_t port, + union sctp_sockstore *over_addr, + uint8_t use_mflowid, uint32_t mflowid, #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) - int so_locked SCTP_UNUSED, + int so_locked SCTP_UNUSED #else - int so_locked, + int so_locked #endif - union sctp_sockstore *over_addr, - struct mbuf *init ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { @@ -3951,8 +3951,8 @@ sctp_lowlevel_chunk_output(struct sctp_i m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { - if ((init != NULL) && (init->m_flags & M_FLOWID)) { - m->m_pkthdr.flowid = init->m_pkthdr.flowid; + if (use_mflowid != 0) { + m->m_pkthdr.flowid = mflowid; m->m_flags |= M_FLOWID; } } @@ -4243,8 +4243,8 @@ sctp_lowlevel_chunk_output(struct sctp_i m->m_pkthdr.flowid = net->flowid; m->m_flags |= M_FLOWID; } else { - if ((init != NULL) && (init->m_flags & M_FLOWID)) { - m->m_pkthdr.flowid = init->m_pkthdr.flowid; + if (use_mflowid != 0) { + m->m_pkthdr.flowid = mflowid; m->m_flags |= M_FLOWID; } } @@ -4841,7 +4841,9 @@ sctp_send_initiate(struct sctp_inpcb *in (struct sockaddr *)&net->ro._l_addr, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, stcb->rport, htonl(0), - net->port, so_locked, NULL, NULL); + net->port, NULL, + 0, 0, + so_locked); SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); @@ -5370,8 +5372,10 @@ sctp_are_there_new_addresses(struct sctp */ void sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct mbuf *init_pkt, int iphlen, int offset, struct sctphdr *sh, - struct sctp_init_chunk *init_chk, uint32_t vrf_id, uint16_t port, int hold_inp_lock) + struct mbuf *init_pkt, int iphlen, int offset, + struct sctphdr *sh, struct sctp_init_chunk *init_chk, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port, int hold_inp_lock) { struct sctp_association *asoc; struct mbuf *m, *m_at, *m_tmp, *m_cookie, *op_err, *mp_last; @@ -5422,7 +5426,9 @@ sctp_send_initiate_ack(struct sctp_inpcb * though we even set the T bit and copy in the 0 tag.. this * looks no different than if no listener was present. */ - sctp_send_abort(init_pkt, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(init_pkt, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); return; } abort_flag = 0; @@ -5432,7 +5438,9 @@ sctp_send_initiate_ack(struct sctp_inpcb if (abort_flag) { do_a_abort: sctp_send_abort(init_pkt, iphlen, sh, - init_chk->init.initiate_tag, op_err, vrf_id, port); + init_chk->init.initiate_tag, op_err, + use_mflowid, mflowid, + vrf_id, port); return; } m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); @@ -6034,7 +6042,9 @@ do_a_abort: (void)sctp_lowlevel_chunk_output(inp, NULL, NULL, to, m, 0, NULL, 0, 0, 0, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, - port, SCTP_SO_NOT_LOCKED, over_addr, init_pkt); + port, over_addr, + use_mflowid, mflowid, + SCTP_SO_NOT_LOCKED); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -8116,7 +8126,9 @@ again_one_more_time: no_fragmentflg, 0, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8388,7 +8400,9 @@ again_one_more_time: no_fragmentflg, 0, asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { if (error == ENOBUFS) { asoc->ifp_had_enobuf = 1; SCTP_STAT_INCR(sctps_lowlevelerr); @@ -8727,7 +8741,9 @@ no_data_fill: asconf, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { /* error, we could not output */ if (error == ENOBUFS) { SCTP_STAT_INCR(sctps_lowlevelerr); @@ -9429,7 +9445,9 @@ sctp_chunk_retransmission(struct sctp_in auth_offset, auth, stcb->asoc.authinfo.active_keyid, no_fragmentflg, 0, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - chk->whoTo->port, so_locked, NULL, NULL))) { + chk->whoTo->port, NULL, + 0, 0, + so_locked))) { SCTP_STAT_INCR(sctps_lowlevelerr); return (error); } @@ -9694,7 +9712,9 @@ one_chunk_around: auth_offset, auth, auth_keyid, no_fragmentflg, 0, 0, inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - net->port, so_locked, NULL, NULL))) { + net->port, NULL, + 0, 0, + so_locked))) { /* error, we could not output */ SCTP_STAT_INCR(sctps_lowlevelerr); return (error); @@ -10812,7 +10832,9 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), - stcb->asoc.primary_destination->port, so_locked, NULL, NULL); + stcb->asoc.primary_destination->port, NULL, + 0, 0, + so_locked); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10849,14 +10871,18 @@ sctp_send_shutdown_complete(struct sctp_ m_shutdown_comp, 0, NULL, 0, 1, 0, 0, stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), - net->port, SCTP_SO_NOT_LOCKED, NULL, NULL); + net->port, NULL, + 0, 0, + SCTP_SO_NOT_LOCKED); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; } static void sctp_send_resp_msg(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, - uint8_t type, struct mbuf *cause, uint32_t vrf_id, uint16_t port) + uint8_t type, struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct mbuf *o_pak; struct mbuf *mout; @@ -10929,8 +10955,8 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = cause; - if (m->m_flags & M_FLOWID) { - mout->m_pkthdr.flowid = m->m_pkthdr.flowid; + if (use_mflowid != 0) { + mout->m_pkthdr.flowid = mflowid; mout->m_flags |= M_FLOWID; } #ifdef INET @@ -11110,9 +11136,12 @@ sctp_send_resp_msg(struct mbuf *m, struc void sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, vrf_id, port); + sctp_send_resp_msg(m, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, + use_mflowid, mflowid, + vrf_id, port); } void @@ -11944,7 +11973,9 @@ skip_stuff: void sctp_send_abort(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vtag, - struct mbuf *cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { /* Don't respond to an ABORT with an ABORT. */ if (sctp_is_there_an_abort_here(m, iphlen, &vtag)) { @@ -11952,15 +11983,21 @@ sctp_send_abort(struct mbuf *m, int iphl sctp_m_freem(cause); return; } - sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, vrf_id, port); + sctp_send_resp_msg(m, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, + use_mflowid, mflowid, + vrf_id, port); return; } void sctp_send_operr_to(struct mbuf *m, struct sctphdr *sh, uint32_t vtag, - struct mbuf *cause, uint32_t vrf_id, uint16_t port) + struct mbuf *cause, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { - sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, vrf_id, port); + sctp_send_resp_msg(m, sh, vtag, SCTP_OPERATION_ERROR, cause, + use_mflowid, mflowid, + vrf_id, port); return; } Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctp_output.h Sun Jul 8 16:14:42 2012 (r238253) @@ -83,8 +83,9 @@ sctp_send_initiate(struct sctp_inpcb *, ); void -sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, - struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *, +sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, + int, int, struct sctphdr *, struct sctp_init_chunk *, + uint8_t, uint32_t, uint32_t, uint16_t, int); struct mbuf * @@ -116,6 +117,7 @@ void sctp_send_shutdown_complete(struct void sctp_send_shutdown_complete2(struct mbuf *, struct sctphdr *, + uint8_t, uint32_t, uint32_t, uint16_t); void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked); @@ -202,15 +204,19 @@ sctp_send_str_reset_req(struct sctp_tcb void sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, - struct mbuf *, uint32_t, uint16_t); + struct mbuf *, + uint8_t, uint32_t, + uint32_t, uint16_t); void sctp_send_operr_to(struct mbuf *, struct sctphdr *, uint32_t, - struct mbuf *, uint32_t, uint16_t); + struct mbuf *, + uint8_t, uint32_t, + uint32_t, uint16_t); #endif /* _KERNEL || __Userspace__ */ -#if defined(_KERNEL) || defined (__Userspace__) +#if defined(_KERNEL) || defined(__Userspace__) int sctp_sosend(struct socket *so, struct sockaddr *addr, Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctputil.c Sun Jul 8 16:14:42 2012 (r238253) @@ -3823,7 +3823,9 @@ sctp_abort_notification(struct sctp_tcb void sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct mbuf *m, int iphlen, struct sctphdr *sh, struct mbuf *op_err, + struct mbuf *m, int iphlen, struct sctphdr *sh, + struct mbuf *op_err, + uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { uint32_t vtag; @@ -3842,7 +3844,9 @@ sctp_abort_association(struct sctp_inpcb vrf_id = stcb->asoc.vrf_id; stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } - sctp_send_abort(m, iphlen, sh, vtag, op_err, vrf_id, port); + sctp_send_abort(m, iphlen, sh, vtag, op_err, + use_mflowid, mflowid, + vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -3992,7 +3996,9 @@ sctp_abort_an_association(struct sctp_in void sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, - struct sctp_inpcb *inp, uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, + uint8_t use_mflowid, uint32_t mflowid, + uint32_t vrf_id, uint16_t port) { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; @@ -4035,7 +4041,9 @@ sctp_handle_ootb(struct mbuf *m, int iph */ return; case SCTP_SHUTDOWN_ACK: - sctp_send_shutdown_complete2(m, sh, vrf_id, port); + sctp_send_shutdown_complete2(m, sh, + use_mflowid, mflowid, + vrf_id, port); return; default: break; @@ -4047,7 +4055,9 @@ sctp_handle_ootb(struct mbuf *m, int iph if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (contains_init_chunk == 0))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + sctp_send_abort(m, iphlen, sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); } } Modified: stable/9/sys/netinet/sctputil.h ============================================================================== --- stable/9/sys/netinet/sctputil.h Sun Jul 8 16:12:59 2012 (r238252) +++ stable/9/sys/netinet/sctputil.h Sun Jul 8 16:14:42 2012 (r238253) @@ -185,8 +185,10 @@ sctp_abort_notification(struct sctp_tcb /* We abort responding to an IP packet for some reason */ void -sctp_abort_association(struct sctp_inpcb *, struct sctp_tcb *, - struct mbuf *, int, struct sctphdr *, struct mbuf *, uint32_t, uint16_t); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 17:02:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97AA3106566B; Sun, 8 Jul 2012 17:02:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 821FF8FC1E; Sun, 8 Jul 2012 17:02: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 q68H2Few063553; Sun, 8 Jul 2012 17:02:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68H2Flg063551; Sun, 8 Jul 2012 17:02:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201207081702.q68H2Flg063551@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 8 Jul 2012 17:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238255 - head/gnu/usr.bin/cc/cc_tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 17:02:15 -0000 Author: nwhitehorn Date: Sun Jul 8 17:02:14 2012 New Revision: 238255 URL: http://svn.freebsd.org/changeset/base/238255 Log: After the binutils 2.17.50 import, the assembler supports AS_REL16 relocations. Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/auto-host.h Sun Jul 8 17:01:57 2012 (r238254) +++ head/gnu/usr.bin/cc/cc_tools/auto-host.h Sun Jul 8 17:02:14 2012 (r238255) @@ -261,7 +261,7 @@ /* Define if your assembler supports R_PPC_REL16 relocs. */ #ifndef USED_FOR_TARGET -/* #undef HAVE_AS_REL16 */ +#define HAVE_AS_REL16 #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 17:43:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38E861065674; Sun, 8 Jul 2012 17:43:26 +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 245358FC14; Sun, 8 Jul 2012 17:43: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 q68HhP2M065650; Sun, 8 Jul 2012 17:43:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68HhPFN065648; Sun, 8 Jul 2012 17:43:25 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207081743.q68HhPFN065648@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Jul 2012 17:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238256 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 17:43:26 -0000 Author: marcel Date: Sun Jul 8 17:43:25 2012 New Revision: 238256 URL: http://svn.freebsd.org/changeset/base/238256 Log: Unleash the APs at SI_SUB_KICK_SCHEDULER so that we have them all up and running to service interrupts. This is especially important when the firmware has bound interrupts to CPUs, like for the SGI Altix 350. We wake up APs at SI_SUB_CPU time and they sit and spin until we unleash them, so there's nothing fundamentally different from a MD perspective. Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sun Jul 8 17:02:14 2012 (r238255) +++ head/sys/ia64/ia64/mp_machdep.c Sun Jul 8 17:43:25 2012 (r238256) @@ -466,6 +466,7 @@ cpu_mp_unleash(void *dummy) */ ia64_bind_intr(); } +SYSINIT(start_aps, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, cpu_mp_unleash, NULL); /* * send an IPI to a set of cpus. @@ -522,5 +523,3 @@ ipi_send(struct pcpu *cpu, int xiv) ia64_mf_a(); CTR3(KTR_SMP, "ipi_send(%p, %d): cpuid=%d", cpu, xiv, PCPU_GET(cpuid)); } - -SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 18:00:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB9E106564A; Sun, 8 Jul 2012 18:00:23 +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 10D0E8FC0A; Sun, 8 Jul 2012 18:00:23 +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 q68I0Mf1066413; Sun, 8 Jul 2012 18:00:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68I0Mq8066409; Sun, 8 Jul 2012 18:00:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207081800.q68I0Mq8066409@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 8 Jul 2012 18:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238257 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 18:00:23 -0000 Author: marcel Date: Sun Jul 8 18:00:22 2012 New Revision: 238257 URL: http://svn.freebsd.org/changeset/base/238257 Log: Move PCPU initialization to a new function called cpu_pcpu_setup(). This makes it easier to add additional CPU or platform information to the per-CPU structure without duplicated code. Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/include/md_var.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sun Jul 8 17:43:25 2012 (r238256) +++ head/sys/ia64/ia64/machdep.c Sun Jul 8 18:00:22 2012 (r238257) @@ -506,6 +506,14 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu } void +cpu_pcpu_setup(struct pcpu *pc, u_int acpi_id, u_int sapic_id) +{ + + pc->pc_acpi_id = acpi_id; + pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id); +} + +void spinlock_enter(void) { struct thread *td; @@ -791,7 +799,7 @@ ia64_init(void) ia64_set_k4((u_int64_t)pcpup); pcpu_init(pcpup, 0, sizeof(pcpu0)); dpcpu_init(ia64_physmem_alloc(DPCPU_SIZE, PAGE_SIZE), 0); - PCPU_SET(md.lid, ia64_get_lid()); + cpu_pcpu_setup(pcpup, ~0U, ia64_get_lid()); PCPU_SET(curthread, &thread0); /* Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sun Jul 8 17:43:25 2012 (r238256) +++ head/sys/ia64/ia64/mp_machdep.c Sun Jul 8 18:00:22 2012 (r238257) @@ -309,9 +309,8 @@ cpu_mp_add(u_int acpi_id, u_int id, u_in } else pc = pcpup; - pc->pc_acpi_id = acpi_id; - pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id); - + cpu_pcpu_setup(pc, acpi_id, sapic_id); + CPU_SET(pc->pc_cpuid, &all_cpus); } Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Sun Jul 8 17:43:25 2012 (r238256) +++ head/sys/ia64/include/md_var.h Sun Jul 8 18:00:22 2012 (r238257) @@ -61,6 +61,7 @@ ia64_bsp_adjust(uint64_t bsp, int nslots #ifdef _KERNEL struct _special; +struct pcpu; struct thread; struct trapframe; @@ -80,6 +81,7 @@ void *acpi_find_table(const char *sig); void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *); void cpu_mp_add(u_int, u_int, u_int); +void cpu_pcpu_setup(struct pcpu *, u_int, u_int); int do_ast(struct trapframe *); void ia32_trap(int, struct trapframe *); int ia64_count_cpus(void); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 18:04:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543711065678; Sun, 8 Jul 2012 18:04:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7B58FC17; Sun, 8 Jul 2012 18:04:27 +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 q68I4QgW066625; Sun, 8 Jul 2012 18:04:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68I4QFO066623; Sun, 8 Jul 2012 18:04:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207081804.q68I4QFO066623@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jul 2012 18:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238258 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 18:04:27 -0000 Author: kib Date: Sun Jul 8 18:04:26 2012 New Revision: 238258 URL: http://svn.freebsd.org/changeset/base/238258 Log: Avoid vm page queues lock leak after r238212. Reported and tested by: Michael Butler Reviewed by: alc Pointy hat to: kib MFC after: 20 days Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Jul 8 18:00:22 2012 (r238257) +++ head/sys/vm/vm_pageout.c Sun Jul 8 18:04:26 2012 (r238258) @@ -1030,7 +1030,6 @@ rescan0: ++pageout_lock_miss; if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; - vm_page_lock_queues(); goto unlock_and_continue; } KASSERT(mp != NULL, @@ -1041,7 +1040,6 @@ rescan0: if (vget(vp, LK_EXCLUSIVE | LK_TIMELOCK, curthread)) { VM_OBJECT_LOCK(object); - vm_page_lock_queues(); ++pageout_lock_miss; if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; @@ -1083,14 +1081,14 @@ rescan0: * be undergoing I/O, so skip it */ if (m->hold_count) { - vm_page_lock_queues(); - queues_locked = TRUE; vm_page_unlock(m); vm_page_requeue(m); if (object->flags & OBJ_MIGHTBEDIRTY) vnodes_skipped++; goto unlock_and_continue; } + vm_page_unlock_queues(); + queues_locked = FALSE; } /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 19:29:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 492291065670; Sun, 8 Jul 2012 19:29:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 333258FC12; Sun, 8 Jul 2012 19:29: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 q68JT98P070212; Sun, 8 Jul 2012 19:29:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68JT8It070210; Sun, 8 Jul 2012 19:29:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207081929.q68JT8It070210@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 8 Jul 2012 19:29: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: r238259 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 19:29:09 -0000 Author: trociny Date: Sun Jul 8 19:29:08 2012 New Revision: 238259 URL: http://svn.freebsd.org/changeset/base/238259 Log: Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl. Reviewed by: andre Approved by: re (kib) Modified: stable/9/sys/netinet/tcp_hostcache.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/9/sys/netinet/tcp_hostcache.c Sun Jul 8 18:04:26 2012 (r238258) +++ stable/9/sys/netinet/tcp_hostcache.c Sun Jul 8 19:29:08 2012 (r238259) @@ -624,7 +624,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) msec(hc_entry->rmx_rtt * (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), msec(hc_entry->rmx_rttvar * - (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), + (RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))), hc_entry->rmx_bandwidth * 8, hc_entry->rmx_cwnd, hc_entry->rmx_sendpipe, From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 19:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6CD3106564A; Sun, 8 Jul 2012 19:31:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B13908FC19; Sun, 8 Jul 2012 19:31: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 q68JVbow070358; Sun, 8 Jul 2012 19:31:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68JVbJa070356; Sun, 8 Jul 2012 19:31:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207081931.q68JVbJa070356@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 8 Jul 2012 19:31:37 +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: r238260 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 19:31:37 -0000 Author: trociny Date: Sun Jul 8 19:31:37 2012 New Revision: 238260 URL: http://svn.freebsd.org/changeset/base/238260 Log: MFC r238083: Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl. Reviewed by: andre Modified: stable/8/sys/netinet/tcp_hostcache.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/8/sys/netinet/tcp_hostcache.c Sun Jul 8 19:29:08 2012 (r238259) +++ stable/8/sys/netinet/tcp_hostcache.c Sun Jul 8 19:31:37 2012 (r238260) @@ -624,7 +624,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) msec(hc_entry->rmx_rtt * (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), msec(hc_entry->rmx_rttvar * - (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), + (RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))), hc_entry->rmx_bandwidth * 8, hc_entry->rmx_cwnd, hc_entry->rmx_sendpipe, From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 19:33:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82755106566B; Sun, 8 Jul 2012 19:33:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CF688FC12; Sun, 8 Jul 2012 19:33:21 +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 q68JXL5u070475; Sun, 8 Jul 2012 19:33:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68JXLH0070473; Sun, 8 Jul 2012 19:33:21 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207081933.q68JXLH0070473@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 8 Jul 2012 19:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238261 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 19:33:21 -0000 Author: trociny Date: Sun Jul 8 19:33:20 2012 New Revision: 238261 URL: http://svn.freebsd.org/changeset/base/238261 Log: MFC r238083: Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl. Reviewed by: andre Modified: stable/7/sys/netinet/tcp_hostcache.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/7/sys/netinet/tcp_hostcache.c Sun Jul 8 19:31:37 2012 (r238260) +++ stable/7/sys/netinet/tcp_hostcache.c Sun Jul 8 19:33:20 2012 (r238261) @@ -630,7 +630,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) msec(hc_entry->rmx_rtt * (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), msec(hc_entry->rmx_rttvar * - (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), + (RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))), hc_entry->rmx_bandwidth * 8, hc_entry->rmx_cwnd, hc_entry->rmx_sendpipe, From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 19:36:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCBAE1065670; Sun, 8 Jul 2012 19:36:47 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C52348FC14; Sun, 8 Jul 2012 19:36:46 +0000 (UTC) Received: by werp13 with SMTP id p13so7279158wer.13 for ; Sun, 08 Jul 2012 12:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=s8CWv8V2oGvpVzZUcS19WF2O1SwlAjkLEwxMs1fx/Ig=; b=anpcQ0WJsjqRvJqCBPKusJ6qKJLcmGfYjdWMwCQixoNpRmt0MkcoxCVFqSoH4VAe0D VkdAZEYvwzoa0KJ9HvtitVuCavgi96AaQSYQ0V9TmBupbYyLTp3DRzbuWNXIN5dHhRpT GFPkAg12SazelQYYg3UMz7ybnyEP0MWmA/qx+9P1e968u7YuObjWY8O5J/Zsx22j3y1z JkVVLiLf7ipJLbBB8/txEFoXl1ybMbJV1fQtiGvM986uBuOaiIRA7M9g7fpcHMNTYmqL t+KB0+c0seSNVGwbjdapf97qAiN2yXDzcTTi1Bbr4XiEcjg6tJsV1Rmmx4QC21PmgPdU A+Pg== Received: by 10.180.98.200 with SMTP id ek8mr23854864wib.0.1341776205744; Sun, 08 Jul 2012 12:36:45 -0700 (PDT) Received: from localhost ([95.69.175.25]) by mx.google.com with ESMTPS id l5sm28843403wix.5.2012.07.08.12.36.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jul 2012 12:36:44 -0700 (PDT) From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org References: <201207081929.q68JT8It070210@svn.freebsd.org> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Sun, 08 Jul 2012 22:36:41 +0300 In-Reply-To: <201207081929.q68JT8It070210@svn.freebsd.org> (Mikolaj Golub's message of "Sun, 8 Jul 2012 19:29:08 +0000 (UTC)") Message-ID: <86sjd2qc3a.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: Re: svn commit: r238259 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 19:36:47 -0000 On Sun, 8 Jul 2012 19:29:08 +0000 (UTC) Mikolaj Golub wrote: MG> Author: trociny MG> Date: Sun Jul 8 19:29:08 2012 MG> New Revision: 238259 MG> URL: http://svn.freebsd.org/changeset/base/238259 MG> Log: MG> Fix RTTVAR scale in net.inet.tcp.hostcache.list sysctl. MG> MG> Reviewed by: andre MG> Approved by: re (kib) Forgot to add to the log message that it was MFC r238083. Sorry. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 20:35:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7604E106566B; Sun, 8 Jul 2012 20:35:57 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0568FC1D; Sun, 8 Jul 2012 20:35:57 +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 q68KZvCc073216; Sun, 8 Jul 2012 20:35:57 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68KZvZu073204; Sun, 8 Jul 2012 20:35:57 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207082035.q68KZvZu073204@svn.freebsd.org> From: Jack F Vogel Date: Sun, 8 Jul 2012 20:35:57 +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: r238262 - in stable/9/sys: conf dev/e1000 modules/em modules/igb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 20:35:57 -0000 Author: jfv Date: Sun Jul 8 20:35:56 2012 New Revision: 238262 URL: http://svn.freebsd.org/changeset/base/238262 Log: MFC of the e1000 drivers: 236406,238148,238151,238181, and 238214 Approved by:re Added: stable/9/sys/dev/e1000/e1000_i210.c - copied unchanged from r238148, head/sys/dev/e1000/e1000_i210.c stable/9/sys/dev/e1000/e1000_i210.h - copied unchanged from r238148, head/sys/dev/e1000/e1000_i210.h Modified: stable/9/sys/conf/files stable/9/sys/dev/e1000/e1000_82541.c stable/9/sys/dev/e1000/e1000_82543.c stable/9/sys/dev/e1000/e1000_82571.c stable/9/sys/dev/e1000/e1000_82575.c stable/9/sys/dev/e1000/e1000_api.c stable/9/sys/dev/e1000/e1000_api.h stable/9/sys/dev/e1000/e1000_defines.h stable/9/sys/dev/e1000/e1000_hw.h stable/9/sys/dev/e1000/e1000_ich8lan.c stable/9/sys/dev/e1000/e1000_mac.c stable/9/sys/dev/e1000/e1000_mac.h stable/9/sys/dev/e1000/e1000_manage.c stable/9/sys/dev/e1000/e1000_manage.h stable/9/sys/dev/e1000/e1000_phy.c stable/9/sys/dev/e1000/e1000_phy.h stable/9/sys/dev/e1000/e1000_regs.h stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/modules/em/Makefile stable/9/sys/modules/igb/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/conf/files Sun Jul 8 20:35:56 2012 (r238262) @@ -1042,6 +1042,8 @@ dev/e1000/e1000_82575.c optional em | i compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_ich8lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_i210.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em | igb \ Modified: stable/9/sys/dev/e1000/e1000_82541.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_82541.c Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_82541.c Sun Jul 8 20:35:56 2012 (r238262) @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st * of MAC speed/duplex configuration. So we only need to * configure Collision Distance in the MAC. */ - e1000_config_collision_dist_generic(hw); + mac->ops.config_collision_dist(hw); /* * Configure Flow Control now that Auto-Neg has completed. Modified: stable/9/sys/dev/e1000/e1000_82543.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_82543.c Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_82543.c Sun Jul 8 20:35:56 2012 (r238262) @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543 DEBUGOUT("Valid link established!!!\n"); /* Config the MAC and PHY after link is up */ if (hw->mac.type == e1000_82544) { - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); } else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543( /* Take the link out of reset */ ctrl &= ~E1000_CTRL_LRST; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); ret_val = e1000_commit_fc_settings_generic(hw); if (ret_val) @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8 * settings. */ if (mac->type == e1000_82544) - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); else { ret_val = e1000_config_mac_to_phy_82543(hw); if (ret_val) { @@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543 if (phy_data & M88E1000_PSSR_DPLX) ctrl |= E1000_CTRL_FD; - e1000_config_collision_dist_generic(hw); + hw->mac.ops.config_collision_dist(hw); /* * Set up speed in the Device Control register depending on Modified: stable/9/sys/dev/e1000/e1000_82571.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_82571.c Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_82571.c Sun Jul 8 20:35:56 2012 (r238262) @@ -1907,7 +1907,7 @@ void e1000_set_laa_state_82571(struct e1 * incoming packets directed to this port are dropped. * Eventually the LAA will be in RAR[0] and RAR[14]. */ - e1000_rar_set_generic(hw, hw->mac.addr, + hw->mac.ops.rar_set(hw, hw->mac.addr, hw->mac.rar_entry_count - 1); return; } Modified: stable/9/sys/dev/e1000/e1000_82575.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_82575.c Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_82575.c Sun Jul 8 20:35:56 2012 (r238262) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -38,9 +38,12 @@ * 82575GB Gigabit Network Connection * 82576 Gigabit Network Connection * 82576 Quad Port Gigabit Mezzanine Adapter + * 82580 Gigabit Network Connection + * I350 Gigabit Network Connection */ #include "e1000_api.h" +#include "e1000_i210.h" static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); @@ -162,6 +165,9 @@ static s32 e1000_init_phy_params_82575(s DEBUGFUNC("e1000_init_phy_params_82575"); + phy->ops.read_i2c_byte = e1000_read_i2c_byte_generic; + phy->ops.write_i2c_byte = e1000_write_i2c_byte_generic; + if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; goto out; @@ -195,12 +201,22 @@ static s32 e1000_init_phy_params_82575(s if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) { phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575; phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575; - } else if (hw->mac.type >= e1000_82580) { - phy->ops.read_reg = e1000_read_phy_reg_82580; - phy->ops.write_reg = e1000_write_phy_reg_82580; } else { - phy->ops.read_reg = e1000_read_phy_reg_igp; - phy->ops.write_reg = e1000_write_phy_reg_igp; + switch (hw->mac.type) { + case e1000_82580: + case e1000_i350: + phy->ops.read_reg = e1000_read_phy_reg_82580; + phy->ops.write_reg = e1000_write_phy_reg_82580; + break; + case e1000_i210: + case e1000_i211: + phy->ops.read_reg = e1000_read_phy_reg_gs40g; + phy->ops.write_reg = e1000_write_phy_reg_gs40g; + break; + default: + phy->ops.read_reg = e1000_read_phy_reg_igp; + phy->ops.write_reg = e1000_write_phy_reg_igp; + } } /* Set phy->phy_addr and phy->id. */ @@ -245,6 +261,15 @@ static s32 e1000_init_phy_params_82575(s phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; break; + case I210_I_PHY_ID: + phy->type = e1000_phy_i210; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2; + phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + break; default: ret_val = -E1000_ERR_PHY; goto out; @@ -281,28 +306,32 @@ s32 e1000_init_nvm_params_82575(struct e size = 15; nvm->word_size = 1 << size; - nvm->opcode_bits = 8; - nvm->delay_usec = 1; - switch (nvm->override) { - case e1000_nvm_override_spi_large: - nvm->page_size = 32; - nvm->address_bits = 16; - break; - case e1000_nvm_override_spi_small: - nvm->page_size = 8; - nvm->address_bits = 8; - break; - default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; - nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; - break; - } - - nvm->type = e1000_nvm_eeprom_spi; - - if (nvm->word_size == (1 << 15)) - nvm->page_size = 128; + if (hw->mac.type < e1000_i210) { + nvm->opcode_bits = 8; + nvm->delay_usec = 1; + + switch (nvm->override) { + case e1000_nvm_override_spi_large: + nvm->page_size = 32; + nvm->address_bits = 16; + break; + case e1000_nvm_override_spi_small: + nvm->page_size = 8; + nvm->address_bits = 8; + break; + default: + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? + 16 : 8; + break; + } + if (nvm->word_size == (1 << 15)) + nvm->page_size = 128; + nvm->type = e1000_nvm_eeprom_spi; + } else { + nvm->type = e1000_nvm_flash_hw; + } /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_82575; nvm->ops.release = e1000_release_nvm_82575; @@ -316,7 +345,7 @@ s32 e1000_init_nvm_params_82575(struct e nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_82575; - /* override genric family function pointers for specific descendants */ + /* override generic family function pointers for specific descendants */ switch (hw->mac.type) { case e1000_82580: nvm->ops.validate = e1000_validate_nvm_checksum_82580; @@ -368,8 +397,7 @@ static s32 e1000_init_mac_params_82575(s mac->has_fwsm = TRUE; /* ARC supported; valid only if manageability features are enabled. */ mac->arc_subsystem_valid = - (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) - ? TRUE : FALSE; + !!(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK); /* Function pointers */ @@ -394,8 +422,6 @@ static s32 e1000_init_mac_params_82575(s mac->ops.power_up_serdes = e1000_power_up_serdes_link_82575; /* check for link */ mac->ops.check_for_link = e1000_check_for_link_82575; - /* receive address register setting */ - mac->ops.rar_set = e1000_rar_set_generic; /* read mac address */ mac->ops.read_mac_addr = e1000_read_mac_addr_82575; /* configure collision distance */ @@ -428,6 +454,13 @@ static s32 e1000_init_mac_params_82575(s mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82575; /* link info */ mac->ops.get_link_up_info = e1000_get_link_up_info_82575; + /* acquire SW_FW sync */ + mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_82575; + mac->ops.release_swfw_sync = e1000_release_swfw_sync_82575; + if (mac->type >= e1000_i210) { + mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_i210; + mac->ops.release_swfw_sync = e1000_release_swfw_sync_i210; + } /* set lan id for port to determine which phy lock to use */ hw->mac.ops.set_lan_id(hw); @@ -470,7 +503,7 @@ static s32 e1000_acquire_phy_82575(struc else if (hw->bus.func == E1000_FUNC_3) mask = E1000_SWFW_PHY3_SM; - return e1000_acquire_swfw_sync_82575(hw, mask); + return hw->mac.ops.acquire_swfw_sync(hw, mask); } /** @@ -492,7 +525,7 @@ static void e1000_release_phy_82575(stru else if (hw->bus.func == E1000_FUNC_3) mask = E1000_SWFW_PHY3_SM; - e1000_release_swfw_sync_82575(hw, mask); + hw->mac.ops.release_swfw_sync(hw, mask); } /** @@ -796,7 +829,7 @@ static s32 e1000_set_d0_lplu_state_82580 { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; - u16 data; + u32 data; DEBUGFUNC("e1000_set_d0_lplu_state_82580"); @@ -844,7 +877,7 @@ s32 e1000_set_d3_lplu_state_82580(struct { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; - u16 data; + u32 data; DEBUGFUNC("e1000_set_d3_lplu_state_82580"); @@ -918,11 +951,7 @@ static s32 e1000_acquire_nvm_82575(struc } - switch (hw->mac.type) { - default: - ret_val = e1000_acquire_nvm_generic(hw); - } - + ret_val = e1000_acquire_nvm_generic(hw); if (ret_val) e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); @@ -941,10 +970,8 @@ static void e1000_release_nvm_82575(stru { DEBUGFUNC("e1000_release_nvm_82575"); - switch (hw->mac.type) { - default: - e1000_release_nvm_generic(hw); - } + e1000_release_nvm_generic(hw); + e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); } @@ -1058,7 +1085,7 @@ static s32 e1000_get_cfg_done_82575(stru DEBUGOUT("MNG configuration cycle has not completed.\n"); /* If EEPROM is not marked present, init the PHY manually */ - if (((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) && + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) && (hw->phy.type == e1000_phy_igp_3)) e1000_phy_init_script_igp3(hw); @@ -1115,6 +1142,7 @@ static s32 e1000_check_for_link_82575(st * continue to check for link. */ hw->mac.get_link_status = !hw->mac.serdes_has_link; + } else { ret_val = e1000_check_for_copper_link_generic(hw); } @@ -1168,11 +1196,6 @@ static s32 e1000_get_pcs_speed_and_duple DEBUGFUNC("e1000_get_pcs_speed_and_duplex_82575"); - /* Set up defaults for the return values of this function */ - mac->serdes_has_link = FALSE; - *speed = 0; - *duplex = 0; - /* * Read the PCS Status register for link state. For non-copper mode, * the status register is not accurate. The PCS status register is @@ -1181,11 +1204,9 @@ static s32 e1000_get_pcs_speed_and_duple pcs = E1000_READ_REG(hw, E1000_PCS_LSTAT); /* - * The link up bit determines when link is up on autoneg. The sync ok - * gets set once both sides sync up and agree upon link. Stable link - * can be determined by checking for both link up and link sync ok + * The link up bit determines when link is up on autoneg. */ - if ((pcs & E1000_PCS_LSTS_LINK_OK) && (pcs & E1000_PCS_LSTS_SYNK_OK)) { + if (pcs & E1000_PCS_LSTS_LINK_OK) { mac->serdes_has_link = TRUE; /* Detect and store PCS speed */ @@ -1201,6 +1222,10 @@ static s32 e1000_get_pcs_speed_and_duple *duplex = FULL_DUPLEX; else *duplex = HALF_DUPLEX; + } else { + mac->serdes_has_link = FALSE; + *speed = 0; + *duplex = 0; } return E1000_SUCCESS; @@ -1293,7 +1318,7 @@ static s32 e1000_reset_hw_82575(struct e } /* If EEPROM is not present, run manual init scripts */ - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES)) e1000_reset_init_script_82575(hw); /* Clear any pending interrupt events. */ @@ -1396,6 +1421,7 @@ static s32 e1000_setup_copper_link_82575 } } switch (hw->phy.type) { + case e1000_phy_i210: case e1000_phy_m88: if (hw->phy.id == I347AT4_E_PHY_ID || hw->phy.id == M88E1112_E_PHY_ID || @@ -1605,31 +1631,28 @@ static s32 e1000_get_media_type_82575(st } /* Read Init Control Word #3*/ hw->nvm.ops.read(hw, init_ctrl_wd_3_offset, 1, &init_ctrl_wd_3); + + /* + * Align link mode bits to + * their CTRL_EXT location. + */ current_link_mode = init_ctrl_wd_3; + current_link_mode <<= (E1000_CTRL_EXT_LINK_MODE_OFFSET - + init_ctrl_wd_3_bit_offset); + current_link_mode &= E1000_CTRL_EXT_LINK_MODE_MASK; + /* * Switch to CSR for all but internal PHY. */ - if ((init_ctrl_wd_3 << (E1000_CTRL_EXT_LINK_MODE_OFFSET - - init_ctrl_wd_3_bit_offset)) != - E1000_CTRL_EXT_LINK_MODE_GMII) { - current_link_mode = ctrl_ext; - init_ctrl_wd_3_bit_offset = - E1000_CTRL_EXT_LINK_MODE_OFFSET; - } + if (current_link_mode != E1000_CTRL_EXT_LINK_MODE_GMII) + /* Take link mode from CSR */ + current_link_mode = ctrl_ext & + E1000_CTRL_EXT_LINK_MODE_MASK; } else { /* Take link mode from CSR */ - current_link_mode = ctrl_ext; - init_ctrl_wd_3_bit_offset = E1000_CTRL_EXT_LINK_MODE_OFFSET; + current_link_mode = ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK; } - /* - * Align link mode bits to - * their CTRL_EXT location. - */ - current_link_mode <<= (E1000_CTRL_EXT_LINK_MODE_OFFSET - - init_ctrl_wd_3_bit_offset); - current_link_mode &= E1000_CTRL_EXT_LINK_MODE_MASK; - switch (current_link_mode) { case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: @@ -2331,7 +2354,7 @@ static s32 e1000_reset_hw_82580(struct e msec_delay(10); /* Determine whether or not a global dev reset is requested */ - if (global_device_reset && e1000_acquire_swfw_sync_82575(hw, + if (global_device_reset && hw->mac.ops.acquire_swfw_sync(hw, swmbsw_mask)) global_device_reset = FALSE; @@ -2359,7 +2382,7 @@ static s32 e1000_reset_hw_82580(struct e } /* If EEPROM is not present, run manual init scripts */ - if ((E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES) == 0) + if (!(E1000_READ_REG(hw, E1000_EECD) & E1000_EECD_PRES)) e1000_reset_init_script_82575(hw); /* clear global device reset status bit */ @@ -2378,7 +2401,7 @@ static s32 e1000_reset_hw_82580(struct e /* Release semaphore */ if (global_device_reset) - e1000_release_swfw_sync_82575(hw, swmbsw_mask); + hw->mac.ops.release_swfw_sync(hw, swmbsw_mask); return ret_val; } @@ -2538,7 +2561,7 @@ static s32 e1000_update_nvm_checksum_825 goto out; } - if ((nvm_data & NVM_COMPATIBILITY_BIT_MASK) == 0) { + if (!(nvm_data & NVM_COMPATIBILITY_BIT_MASK)) { /* set compatibility bit to validate checksums appropriately */ nvm_data = nvm_data | NVM_COMPATIBILITY_BIT_MASK; ret_val = hw->nvm.ops.write(hw, NVM_COMPATIBILITY_REG_3, 1, @@ -2737,6 +2760,7 @@ s32 e1000_set_i2c_bb(struct e1000_hw *hw * e1000_read_i2c_byte_generic - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: device address * @data: value read * * Performs byte read operation over I2C interface at @@ -2750,14 +2774,14 @@ s32 e1000_read_i2c_byte_generic(struct e u32 retry = 1; u16 swfw_mask = 0; - bool nack = 1; + bool nack = TRUE; DEBUGFUNC("e1000_read_i2c_byte_generic"); swfw_mask = E1000_SWFW_PHY0_SM; do { - if (e1000_acquire_swfw_sync_82575(hw, swfw_mask) + if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask) != E1000_SUCCESS) { status = E1000_ERR_SWFW_SYNC; goto read_byte_out; @@ -2805,7 +2829,7 @@ s32 e1000_read_i2c_byte_generic(struct e break; fail: - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); msec_delay(100); e1000_i2c_bus_clear(hw); retry++; @@ -2816,7 +2840,7 @@ fail: } while (retry < max_retry); - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); read_byte_out: @@ -2827,6 +2851,7 @@ read_byte_out: * e1000_write_i2c_byte_generic - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: device address * @data: value to write * * Performs byte write operation over I2C interface at @@ -2844,7 +2869,7 @@ s32 e1000_write_i2c_byte_generic(struct swfw_mask = E1000_SWFW_PHY0_SM; - if (e1000_acquire_swfw_sync_82575(hw, swfw_mask) != E1000_SUCCESS) { + if (hw->mac.ops.acquire_swfw_sync(hw, swfw_mask) != E1000_SUCCESS) { status = E1000_ERR_SWFW_SYNC; goto write_byte_out; } @@ -2888,7 +2913,7 @@ fail: DEBUGOUT("I2C byte write error.\n"); } while (retry < max_retry); - e1000_release_swfw_sync_82575(hw, swfw_mask); + hw->mac.ops.release_swfw_sync(hw, swfw_mask); write_byte_out: @@ -3020,7 +3045,7 @@ static s32 e1000_get_i2c_ack(struct e100 u32 i = 0; u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); u32 timeout = 10; - bool ack = 1; + bool ack = TRUE; DEBUGFUNC("e1000_get_i2c_ack"); @@ -3040,7 +3065,7 @@ static s32 e1000_get_i2c_ack(struct e100 return E1000_ERR_I2C; ack = e1000_get_i2c_data(&i2cctl); - if (ack == 1) { + if (ack) { DEBUGOUT("I2C ack was not received.\n"); status = E1000_ERR_I2C; } Modified: stable/9/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/9/sys/dev/e1000/e1000_api.c Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_api.c Sun Jul 8 20:35:56 2012 (r238262) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -323,6 +323,17 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_I350_DA4: mac->type = e1000_i350; break; + case E1000_DEV_ID_I210_COPPER: + case E1000_DEV_ID_I210_COPPER_OEM1: + case E1000_DEV_ID_I210_COPPER_IT: + case E1000_DEV_ID_I210_FIBER: + case E1000_DEV_ID_I210_SERDES: + case E1000_DEV_ID_I210_SGMII: + mac->type = e1000_i210; + break; + case E1000_DEV_ID_I211_COPPER: + mac->type = e1000_i211; + break; case E1000_DEV_ID_82576_VF: mac->type = e1000_vfadapt; break; @@ -425,6 +436,10 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_i350: e1000_init_function_pointers_82575(hw); break; + case e1000_i210: + case e1000_i211: + e1000_init_function_pointers_i210(hw); + break; case e1000_vfadapt: e1000_init_function_pointers_vf(hw); break; Modified: stable/9/sys/dev/e1000/e1000_api.h ============================================================================== --- stable/9/sys/dev/e1000/e1000_api.h Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_api.h Sun Jul 8 20:35:56 2012 (r238262) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ extern void e1000_rx_fifo_flush_82575(st extern void e1000_init_function_pointers_vf(struct e1000_hw *hw); extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw); extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw); +extern void e1000_init_function_pointers_i210(struct e1000_hw *hw); s32 e1000_set_mac_type(struct e1000_hw *hw); s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device); @@ -118,6 +119,7 @@ s32 e1000_mng_write_dhcp_info(struct e10 u32 e1000_translate_register_82542(u32 reg); + /* * TBI_ACCEPT macro definition: * Modified: stable/9/sys/dev/e1000/e1000_defines.h ============================================================================== --- stable/9/sys/dev/e1000/e1000_defines.h Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_defines.h Sun Jul 8 20:35:56 2012 (r238262) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1344,6 +1344,16 @@ #define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */ #define E1000_EECD_SECVAL_SHIFT 22 #define E1000_EECD_SEC1VAL_VALID_MASK (E1000_EECD_AUTO_RD | E1000_EECD_PRES) +#define E1000_EECD_FLUPD_I210 0x00800000 /* Update FLASH */ +#define E1000_EECD_FLUDONE_I210 0x04000000 /* Update FLASH done */ +#define E1000_EECD_FLASH_DETECTED_I210 0x00080000 /* FLASH detected */ +#define E1000_FLUDONE_ATTEMPTS 20000 +#define E1000_EERD_EEWR_MAX_COUNT 512 /* buffered EEPROM words rw */ +#define E1000_I210_FIFO_SEL_RX 0x00 +#define E1000_I210_FIFO_SEL_TX_QAV(_i) (0x02 + (_i)) +#define E1000_I210_FIFO_SEL_TX_LEGACY E1000_I210_FIFO_SEL_TX_QAV(0) +#define E1000_I210_FIFO_SEL_BMC2OS_TX 0x06 +#define E1000_I210_FIFO_SEL_BMC2OS_RX 0x01 #define E1000_NVM_SWDPIN0 0x0001 /* SWDPIN 0 NVM Value */ #define E1000_NVM_LED_LOGIC 0x0020 /* Led Logic Word */ @@ -1361,6 +1371,20 @@ #define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +#define NVM_MAC_ADDR 0x0000 +#define NVM_SUB_DEV_ID 0x000B +#define NVM_SUB_VEN_ID 0x000C +#define NVM_DEV_ID 0x000D +#define NVM_VEN_ID 0x000E +#define NVM_INIT_CTRL_2 0x000F +#define NVM_INIT_CTRL_4 0x0013 +#define NVM_LED_1_CFG 0x001C +#define NVM_LED_0_2_CFG 0x001F + #define NVM_INIT_CONTROL1_REG 0x000A #define NVM_INIT_CONTROL2_REG 0x000F #define NVM_SWDEF_PINS_CTRL_PORT_1 0x0010 @@ -1380,12 +1404,12 @@ #define E1000_NVM_CFG_DONE_PORT_2 0x100000 /* ...for third port */ #define E1000_NVM_CFG_DONE_PORT_3 0x200000 /* ...for fourth port */ -#define NVM_82580_LAN_FUNC_OFFSET(a) (a ? (0x40 + (0x40 * a)) : 0) +#define NVM_82580_LAN_FUNC_OFFSET(a) ((a) ? (0x40 + (0x40 * (a))) : 0) /* Mask bits for fields in Word 0x24 of the NVM */ #define NVM_WORD24_COM_MDIO 0x0008 /* MDIO interface shared */ #define NVM_WORD24_EXT_MDIO 0x0004 /* MDIO accesses routed extrnl */ -/* Offset of Link Mode bits for 82575 up to Kawela */ +/* Offset of Link Mode bits for 82575/82576 */ #define NVM_WORD24_LNK_MODE_OFFSET 8 /* Offset of Link Mode bits for 82580 up */ #define NVM_WORD24_82580_LNK_MODE_OFFSET 4 @@ -1525,6 +1549,7 @@ #define I82579_E_PHY_ID 0x01540090 #define I82580_I_PHY_ID 0x015403A0 #define I350_I_PHY_ID 0x015403B0 +#define I210_I_PHY_ID 0x01410C00 #define IGP04E1000_E_PHY_ID 0x02A80391 #define M88_VENDOR 0x0141 @@ -1787,6 +1812,8 @@ #define E1000_DMACR_DMAC_LX_MASK 0x30000000 #define E1000_DMACR_DMAC_LX_SHIFT 28 #define E1000_DMACR_DMAC_EN 0x80000000 /* Enable DMA Coalescing */ +/* DMA Coalescing BMC-to-OS Watchdog Enable */ +#define E1000_DMACR_DC_BMC2OSW_EN 0x00008000 /* DMA Coalescing Transmit Threshold */ #define E1000_DMCTXTH_DMCTTHR_MASK 0x00000FFF @@ -1807,8 +1834,9 @@ /* Lx power decision based on DMA coal */ #define E1000_PCIEMISC_LX_DECISION 0x00000080 -#define E1000_LTRC_EEEMS_EN 0x00000005 /* Enable EEE LTR max send */ #define E1000_RXPBS_SIZE_I210_MASK 0x0000003F /* Rx packet buffer size */ +#define E1000_TXPB0S_SIZE_I210_MASK 0x0000003F /* Tx packet buffer 0 size */ +#define E1000_LTRC_EEEMS_EN 0x00000020 /* Enable EEE LTR max send */ /* Minimum time for 1000BASE-T where no data will be transmit following move out * of EEE LPI Tx state */ @@ -1826,12 +1854,14 @@ #define E1000_LTRMINV_SCALE_1024 2 /* Reg val to set scale to 32768 nsec */ #define E1000_LTRMINV_SCALE_32768 3 +#define E1000_LTRMINV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ #define E1000_LTRMAXV_SCALE_MASK 0x00001C00 /* LTR maximum scale */ #define E1000_LTRMAXV_SCALE_SHIFT 10 /* Reg val to set scale to 1024 nsec */ #define E1000_LTRMAXV_SCALE_1024 2 /* Reg val to set scale to 32768 nsec */ #define E1000_LTRMAXV_SCALE_32768 3 +#define E1000_LTRMAXV_LSNP_REQ 0x00008000 /* LTR Snoop Requirement */ #define E1000_DOBFFCTL_OBFFTHR_MASK 0x000000FF /* OBFF threshold */ #define E1000_DOBFFCTL_EXIT_ACT_MASK 0x01000000 /* Exit active CB */ Modified: stable/9/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/9/sys/dev/e1000/e1000_hw.h Sun Jul 8 19:33:20 2012 (r238261) +++ stable/9/sys/dev/e1000/e1000_hw.h Sun Jul 8 20:35:56 2012 (r238262) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -154,6 +154,13 @@ struct e1000_hw; #define E1000_DEV_ID_I350_SERDES 0x1523 #define E1000_DEV_ID_I350_SGMII 0x1524 #define E1000_DEV_ID_I350_DA4 0x1546 +#define E1000_DEV_ID_I210_COPPER 0x1533 +#define E1000_DEV_ID_I210_COPPER_OEM1 0x1534 +#define E1000_DEV_ID_I210_COPPER_IT 0x1535 +#define E1000_DEV_ID_I210_FIBER 0x1536 +#define E1000_DEV_ID_I210_SERDES 0x1537 +#define E1000_DEV_ID_I210_SGMII 0x1538 +#define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_DH89XXCC_SGMII 0x0438 #define E1000_DEV_ID_DH89XXCC_SERDES 0x043A #define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C @@ -203,6 +210,8 @@ enum e1000_mac_type { e1000_82576, e1000_82580, e1000_i350, + e1000_i210, + e1000_i211, e1000_vfadapt, e1000_vfadapt_i350, e1000_num_macs /* List is 1-based, so subtract 1 for TRUE count. */ @@ -248,6 +257,7 @@ enum e1000_phy_type { e1000_phy_82579, e1000_phy_82580, e1000_phy_vf, + e1000_phy_i210, }; enum e1000_bus_type { @@ -674,6 +684,8 @@ struct e1000_mac_operations { struct e1000_host_mng_command_header*); s32 (*mng_enable_host_if)(struct e1000_hw *); s32 (*wait_autoneg)(struct e1000_hw *); + s32 (*acquire_swfw_sync)(struct e1000_hw *, u16); + void (*release_swfw_sync)(struct e1000_hw *, u16); }; /* @@ -911,13 +923,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; - int eee_disable; + bool eee_disable; }; struct e1000_dev_spec_82575 { bool sgmii_active; bool global_device_reset; - int eee_disable; + bool eee_disable; bool module_plugged; u32 mtu; }; @@ -967,6 +979,7 @@ struct e1000_hw { #include "e1000_80003es2lan.h" #include "e1000_ich8lan.h" #include "e1000_82575.h" +#include "e1000_i210.h" /* These functions must be implemented by drivers */ void e1000_pci_clear_mwi(struct e1000_hw *hw); Copied: stable/9/sys/dev/e1000/e1000_i210.c (from r238148, head/sys/dev/e1000/e1000_i210.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/e1000/e1000_i210.c Sun Jul 8 20:35:56 2012 (r238262, copy of r238148, head/sys/dev/e1000/e1000_i210.c) @@ -0,0 +1,740 @@ +/****************************************************************************** + + Copyright (c) 2001-2012, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_api.h" + + +static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw); +static void e1000_release_nvm_i210(struct e1000_hw *hw); +static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw); +static void e1000_put_hw_semaphore_i210(struct e1000_hw *hw); +static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, + u16 *data); +static s32 e1000_pool_flash_update_done_i210(struct e1000_hw *hw); +static s32 e1000_valid_led_default_i210(struct e1000_hw *hw, u16 *data); +static s32 e1000_read_nvm_i211(struct e1000_hw *hw, u16 offset, u16 words, + u16 *data); + +/** + * e1000_acquire_nvm_i210 - Request for access to EEPROM + * @hw: pointer to the HW structure + * + * Acquire the necessary semaphores for exclusive access to the EEPROM. + * Set the EEPROM access request bit and wait for EEPROM access grant bit. + * Return successful if access grant bit set, else clear the request for + * EEPROM access and return -E1000_ERR_NVM (-1). + **/ +static s32 e1000_acquire_nvm_i210(struct e1000_hw *hw) +{ + s32 ret_val; + + DEBUGFUNC("e1000_acquire_nvm_i210"); + + ret_val = e1000_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); + + return ret_val; +} + +/** + * e1000_release_nvm_i210 - Release exclusive access to EEPROM + * @hw: pointer to the HW structure + * + * Stop any current commands to the EEPROM and clear the EEPROM request bit, + * then release the semaphores acquired. + **/ +static void e1000_release_nvm_i210(struct e1000_hw *hw) +{ + DEBUGFUNC("e1000_release_nvm_i210"); + + e1000_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); +} + +/** + * e1000_acquire_swfw_sync_i210 - Acquire SW/FW semaphore + * @hw: pointer to the HW structure + * @mask: specifies which semaphore to acquire + * + * Acquire the SW/FW semaphore to access the PHY or NVM. The mask + * will also specify which port we're acquiring the lock for. + **/ +s32 e1000_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask) +{ + u32 swfw_sync; + u32 swmask = mask; + u32 fwmask = mask << 16; + s32 ret_val = E1000_SUCCESS; + s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ + + DEBUGFUNC("e1000_acquire_swfw_sync_i210"); + + while (i < timeout) { + if (e1000_get_hw_semaphore_i210(hw)) { + ret_val = -E1000_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); + if (!(swfw_sync & fwmask)) + break; + + /* + * Firmware currently using resource (fwmask) + */ + e1000_put_hw_semaphore_i210(hw); + msec_delay_irq(5); + i++; + } + + if (i == timeout) { + DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n"); + ret_val = -E1000_ERR_SWFW_SYNC; + goto out; + } + + swfw_sync |= swmask; + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); + + e1000_put_hw_semaphore_i210(hw); + +out: + return ret_val; +} + +/** + * e1000_release_swfw_sync_i210 - Release SW/FW semaphore + * @hw: pointer to the HW structure + * @mask: specifies which semaphore to acquire + * + * Release the SW/FW semaphore used to access the PHY or NVM. The mask + * will also specify which port we're releasing the lock for. + **/ +void e1000_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask) +{ + u32 swfw_sync; + + DEBUGFUNC("e1000_release_swfw_sync_i210"); + + while (e1000_get_hw_semaphore_i210(hw) != E1000_SUCCESS) + ; /* Empty */ + + swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); + swfw_sync &= ~mask; + E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); + + e1000_put_hw_semaphore_i210(hw); +} + +/** + * e1000_get_hw_semaphore_i210 - Acquire hardware semaphore + * @hw: pointer to the HW structure + * + * Acquire the HW semaphore to access the PHY or NVM + **/ +static s32 e1000_get_hw_semaphore_i210(struct e1000_hw *hw) +{ + u32 swsm; + s32 ret_val = E1000_SUCCESS; + s32 timeout = hw->nvm.word_size + 1; + s32 i = 0; + + DEBUGFUNC("e1000_get_hw_semaphore_i210"); + + /* Get the FW semaphore. */ + for (i = 0; i < timeout; i++) { + swsm = E1000_READ_REG(hw, E1000_SWSM); + E1000_WRITE_REG(hw, E1000_SWSM, swsm | E1000_SWSM_SWESMBI); + + /* Semaphore acquired if bit latched */ + if (E1000_READ_REG(hw, E1000_SWSM) & E1000_SWSM_SWESMBI) + break; + + usec_delay(50); + } + + if (i == timeout) { + /* Release semaphores */ + e1000_put_hw_semaphore_generic(hw); + DEBUGOUT("Driver can't access the NVM\n"); + ret_val = -E1000_ERR_NVM; + goto out; + } + +out: + return ret_val; +} + +/** + * e1000_put_hw_semaphore_i210 - Release hardware semaphore + * @hw: pointer to the HW structure + * + * Release hardware semaphore used to access the PHY or NVM + **/ +static void e1000_put_hw_semaphore_i210(struct e1000_hw *hw) +{ + u32 swsm; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 20:39:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46401106566B; Sun, 8 Jul 2012 20:39:01 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F02B8FC0A; Sun, 8 Jul 2012 20:39:01 +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 q68Kd1Kb073380; Sun, 8 Jul 2012 20:39:01 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68Kd07A073371; Sun, 8 Jul 2012 20:39:00 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201207082039.q68Kd07A073371@svn.freebsd.org> From: Jack F Vogel Date: Sun, 8 Jul 2012 20:39:00 +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: r238263 - stable/9/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 20:39:01 -0000 Author: jfv Date: Sun Jul 8 20:39:00 2012 New Revision: 238263 URL: http://svn.freebsd.org/changeset/base/238263 Log: MFC of 238149 Approved by:re Modified: stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixgbe_82598.c stable/9/sys/dev/ixgbe/ixgbe_82598.h stable/9/sys/dev/ixgbe/ixgbe_82599.c stable/9/sys/dev/ixgbe/ixgbe_api.c stable/9/sys/dev/ixgbe/ixgbe_api.h stable/9/sys/dev/ixgbe/ixgbe_common.c stable/9/sys/dev/ixgbe/ixgbe_common.h stable/9/sys/dev/ixgbe/ixgbe_osdep.h stable/9/sys/dev/ixgbe/ixgbe_phy.c stable/9/sys/dev/ixgbe/ixgbe_type.h stable/9/sys/dev/ixgbe/ixgbe_vf.c stable/9/sys/dev/ixgbe/ixgbe_x540.c stable/9/sys/dev/ixgbe/ixv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe.c Sun Jul 8 20:39:00 2012 (r238263) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.4.5"; +char ixgbe_driver_version[] = "2.4.8"; /********************************************************************* * PCI Device ID Table @@ -80,8 +80,10 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} @@ -242,10 +244,6 @@ TUNABLE_INT("hw.ixgbe.max_interrupt_rate static int ixgbe_rx_process_limit = 128; TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit); -/* Flow control setting, default to full */ -static int ixgbe_flow_control = ixgbe_fc_full; -TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); - /* ** Smart speed setting, default to on ** this only works as a compile option @@ -526,28 +524,25 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Get Hardware Flow Control setting */ - hw->fc.requested_mode = ixgbe_fc_full; - adapter->fc = hw->fc.requested_mode; - hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.low_water = IXGBE_FC_LO; - hw->fc.high_water[0] = IXGBE_FC_HI; - hw->fc.send_xon = TRUE; - error = ixgbe_init_hw(hw); - if (error == IXGBE_ERR_EEPROM_VERSION) { + switch (error) { + case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " "with your hardware.\n If you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); - } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) + break; + case IXGBE_ERR_SFP_NOT_SUPPORTED: device_printf(dev,"Unsupported SFP+ Module\n"); - - if (error) { error = EIO; device_printf(dev,"Hardware Initialization Failure\n"); goto err_late; + case IXGBE_ERR_SFP_NOT_PRESENT: + device_printf(dev,"No SFP+ Module found\n"); + /* falls thru */ + default: + break; } /* Detect and set physical type */ @@ -1234,7 +1229,7 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ if (hw->mac.type != ixgbe_mac_82598EB) { - u32 hdrm = 64 << fdir_pballoc; + u32 hdrm = 32 << fdir_pballoc; hw->mac.ops.setup_rxpba(hw, 0, hdrm, PBA_STRATEGY_EQUAL); ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); @@ -1260,6 +1255,35 @@ ixgbe_init_locked(struct adapter *adapte /* Config/Enable Link */ ixgbe_config_link(adapter); + /* Hardware Packet Buffer & Flow Control setup */ + { + u32 rxpb, frame, size, tmp; + + frame = adapter->max_frame_size; + + /* Calculate High Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_DV_X540(frame, frame); + else + tmp = IXGBE_DV(frame, frame); + size = IXGBE_BT2KB(tmp); + rxpb = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) >> 10; + hw->fc.high_water[0] = rxpb - size; + + /* Now calculate Low Water */ + if (hw->mac.type == ixgbe_mac_X540) + tmp = IXGBE_LOW_DV_X540(frame); + else + tmp = IXGBE_LOW_DV(frame); + hw->fc.low_water[0] = IXGBE_BT2KB(tmp); + + adapter->fc = hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.send_xon = TRUE; + } + /* Initialize the FC settings */ + ixgbe_start_hw(hw); + /* And now turn on interrupts */ ixgbe_enable_intr(adapter); @@ -1549,10 +1573,8 @@ ixgbe_msix_link(void *arg) /* This is probably overkill :) */ if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1)) return; - /* Clear the interrupt */ - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_FLOW_DIR); - /* Turn off the interface */ - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + /* Disable the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR); taskqueue_enqueue(adapter->tq, &adapter->fdir_task); } else #endif @@ -2055,6 +2077,8 @@ ixgbe_update_link_status(struct adapter ((adapter->link_speed == 128)? 10:1), "Full Duplex"); adapter->link_active = TRUE; + /* Update any Flow Control changes */ + ixgbe_fc_enable(&adapter->hw); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -3062,7 +3086,7 @@ ixgbe_initialize_transmit_units(struct a txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); break; } - txctrl &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); @@ -5057,6 +5081,8 @@ ixgbe_reinit_fdir(void *context, int pen return; ixgbe_reinit_fdir_tables_82599(&adapter->hw); adapter->fdir_reinit = 0; + /* re-enable flow director interrupts */ + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR); /* Restart the interface */ ifp->if_drv_flags |= IFF_DRV_RUNNING; return; @@ -5614,8 +5640,9 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) default: adapter->hw.fc.requested_mode = ixgbe_fc_none; } - - ixgbe_fc_enable(&adapter->hw, 0); + /* Don't autoneg if forcing a value */ + adapter->hw.fc.disable_fc_autoneg = TRUE; + ixgbe_fc_enable(&adapter->hw); return error; } @@ -5631,9 +5658,9 @@ ixgbe_add_rx_process_limit(struct adapte /* ** Control link advertise speed: -** 0 - normal ** 1 - advertise only 1G ** 2 - advertise 100Mb +** 3 - advertise normal */ static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) @@ -5647,13 +5674,15 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) adapter = (struct adapter *) arg1; dev = adapter->dev; hw = &adapter->hw; - last = hw->phy.autoneg_advertised; + last = adapter->advertise; error = sysctl_handle_int(oidp, &adapter->advertise, 0, req); - if ((error) || (adapter->advertise == -1)) return (error); + if (adapter->advertise == last) /* no change */ + return (0); + if (!((hw->phy.media_type == ixgbe_media_type_copper) || (hw->phy.multispeed_fiber))) return (error); @@ -5667,11 +5696,10 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) speed = IXGBE_LINK_SPEED_1GB_FULL; else if (adapter->advertise == 2) speed = IXGBE_LINK_SPEED_100_FULL; - else + else if (adapter->advertise == 3) speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; - - if (speed == last) /* no change */ + else /* bogus value */ return (error); hw->mac.autotry_restart = TRUE; Modified: stable/9/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82598.c Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_82598.c Sun Jul 8 20:39:00 2012 (r238263) @@ -104,31 +104,6 @@ out: } /** - * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count - * @hw: pointer to hardware structure - * - * Read PCIe configuration space, and get the MSI-X vector count from - * the capabilities table. - **/ -u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw) -{ - u32 msix_count = 18; - - DEBUGFUNC("ixgbe_get_pcie_msix_count_82598"); - - if (hw->mac.msix_vectors_from_pcie) { - msix_count = IXGBE_READ_PCIE_WORD(hw, - IXGBE_PCIE_MSIX_82598_CAPS); - msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK; - - /* MSI-X count is zero-based in HW, so increment to give - * proper value */ - msix_count++; - } - return msix_count; -} - -/** * ixgbe_init_ops_82598 - Inits func ptrs and MAC type * @hw: pointer to hardware structure * @@ -176,7 +151,7 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw mac->rx_pb_size = 512; mac->max_tx_queues = 32; mac->max_rx_queues = 64; - mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82598(hw); + mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); /* SFP+ Module */ phy->ops.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598; @@ -280,15 +255,15 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw for (i = 0; ((i < hw->mac.max_tx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); - regval &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval); } for (i = 0; ((i < hw->mac.max_rx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } @@ -416,21 +391,41 @@ out: /** * ixgbe_fc_enable_82598 - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Enable flow control according to the current settings. **/ -s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; u32 fctrl_reg; u32 rmcs_reg; u32 reg; + u32 fcrtl, fcrth; u32 link_speed = 0; + int i; bool link_up; DEBUGFUNC("ixgbe_fc_enable_82598"); + /* Validate the water mark configuration */ + if (!hw->fc.pause_time) { + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + + /* Low water mark of zero causes XOFF floods */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + if (!hw->fc.low_water[i] || + hw->fc.low_water[i] >= hw->fc.high_water[i]) { + DEBUGOUT("Invalid water mark configuration\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + } + } + /* * On 82598 having Rx FC on causes resets while doing 1G * so if it's on turn it off once we know link_speed. For @@ -452,9 +447,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h } /* Negotiate the fc mode to use */ - ret_val = ixgbe_fc_autoneg(hw); - if (ret_val == IXGBE_ERR_FLOW_CONTROL) - goto out; + ixgbe_fc_autoneg(hw); /* Disable any previous flow control settings */ fctrl_reg = IXGBE_READ_REG(hw, IXGBE_FCTRL); @@ -516,28 +509,27 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_h IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg); /* Set up and enable Rx high/low water mark thresholds, enable XON. */ - if (hw->fc.current_mode & ixgbe_fc_tx_pause) { - reg = hw->fc.low_water << 6; - if (hw->fc.send_xon) - reg |= IXGBE_FCRTL_XONE; - - IXGBE_WRITE_REG(hw, IXGBE_FCRTL(packetbuf_num), reg); - - reg = hw->fc.high_water[packetbuf_num] << 6; - reg |= IXGBE_FCRTH_FCEN; + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; + fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; + IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), fcrth); + } else { + IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), 0); + } - IXGBE_WRITE_REG(hw, IXGBE_FCRTH(packetbuf_num), reg); } /* Configure pause time (2 TCs per register) */ - reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2)); - if ((packetbuf_num & 1) == 0) - reg = (reg & 0xFFFF0000) | hw->fc.pause_time; - else - reg = (reg & 0x0000FFFF) | (hw->fc.pause_time << 16); - IXGBE_WRITE_REG(hw, IXGBE_FCTTV(packetbuf_num / 2), reg); + reg = hw->fc.pause_time * 0x00010001; + for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) + IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); - IXGBE_WRITE_REG(hw, IXGBE_FCRTV, (hw->fc.pause_time >> 1)); + /* Configure flow control refresh threshold value */ + IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); out: return ret_val; @@ -1325,15 +1317,15 @@ void ixgbe_enable_relaxed_ordering_82598 for (i = 0; ((i < hw->mac.max_tx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); - regval |= IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval |= IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), regval); } for (i = 0; ((i < hw->mac.max_rx_queues) && (i < IXGBE_DCA_MAX_QUEUES_82598)); i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval |= (IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval |= IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } Modified: stable/9/sys/dev/ixgbe/ixgbe_82598.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82598.h Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_82598.h Sun Jul 8 20:39:00 2012 (r238263) @@ -36,7 +36,7 @@ #define _IXGBE_82598_H_ u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw); -s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num); +s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw); s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw); void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw); s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq); Modified: stable/9/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82599.c Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_82599.c Sun Jul 8 20:39:00 2012 (r238263) @@ -243,6 +243,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* RAR, Multicast, VLAN */ mac->ops.set_vmdq = &ixgbe_set_vmdq_generic; + mac->ops.set_vmdq_san_mac = &ixgbe_set_vmdq_san_mac_generic; mac->ops.clear_vmdq = &ixgbe_clear_vmdq_generic; mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_generic; mac->rar_highwater = 1; @@ -304,7 +305,9 @@ s32 ixgbe_get_link_capabilities_82599(st /* Check if 1G SFP module. */ if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || - hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) { + hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; *negotiation = TRUE; goto out; @@ -420,6 +423,7 @@ enum ixgbe_media_type ixgbe_get_media_ty case IXGBE_DEV_ID_82599_SFP: case IXGBE_DEV_ID_82599_SFP_FCOE: case IXGBE_DEV_ID_82599_SFP_EM: + case IXGBE_DEV_ID_82599_SFP_SF2: case IXGBE_DEV_ID_82599EN_SFP: media_type = ixgbe_media_type_fiber; break; @@ -1088,6 +1092,9 @@ mac_reset_top: hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1, hw->mac.san_addr, 0, IXGBE_RAH_AV); + /* Save the SAN MAC RAR index */ + hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; + /* Reserve the last RAR for the SAN MAC address */ hw->mac.num_rar_entries--; } @@ -2037,6 +2044,8 @@ sfp_check: physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE) physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T; + else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) + physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_SX; break; default: break; @@ -2233,3 +2242,4 @@ static s32 ixgbe_read_eeprom_82599(struc return ret_val; } + Modified: stable/9/sys/dev/ixgbe/ixgbe_api.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_api.c Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_api.c Sun Jul 8 20:39:00 2012 (r238263) @@ -118,6 +118,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw * case IXGBE_DEV_ID_82599_BACKPLANE_FCOE: case IXGBE_DEV_ID_82599_SFP_FCOE: case IXGBE_DEV_ID_82599_SFP_EM: + case IXGBE_DEV_ID_82599_SFP_SF2: case IXGBE_DEV_ID_82599EN_SFP: case IXGBE_DEV_ID_82599_CX4: case IXGBE_DEV_ID_82599_T3_LOM: @@ -130,6 +131,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw * hw->mac.type = ixgbe_mac_X540_vf; break; case IXGBE_DEV_ID_X540T: + case IXGBE_DEV_ID_X540T1: hw->mac.type = ixgbe_mac_X540; break; default: @@ -811,6 +813,18 @@ s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, { return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq), IXGBE_NOT_IMPLEMENTED); + +} + +/** + * ixgbe_set_vmdq_san_mac - Associate VMDq index 127 with a receive address + * @hw: pointer to hardware structure + * @vmdq: VMDq default pool index + **/ +s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq) +{ + return ixgbe_call_func(hw, hw->mac.ops.set_vmdq_san_mac, + (hw, vmdq), IXGBE_NOT_IMPLEMENTED); } /** @@ -960,13 +974,12 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, /** * ixgbe_fc_enable - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Configures the flow control settings based on SW configuration. **/ -s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable(struct ixgbe_hw *hw) { - return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num), + return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw), IXGBE_NOT_IMPLEMENTED); } @@ -1102,7 +1115,7 @@ u32 ixgbe_get_supported_physical_layer(s } /** - * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics + * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependent on device specifics * @hw: pointer to hardware structure * @regval: bitfield to write to the Rx DMA register * Modified: stable/9/sys/dev/ixgbe/ixgbe_api.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_api.h Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_api.h Sun Jul 8 20:39:00 2012 (r238263) @@ -104,6 +104,7 @@ s32 ixgbe_set_rar(struct ixgbe_hw *hw, u u32 enable_addr); s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index); s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); +s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq); s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq); s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw); u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw); @@ -120,7 +121,7 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vind, bool vlan_on); s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool *vfta_changed); -s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num); +s32 ixgbe_fc_enable(struct ixgbe_hw *hw); s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, u8 ver); void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr); Modified: stable/9/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_common.c Sun Jul 8 20:35:56 2012 (r238262) +++ stable/9/sys/dev/ixgbe/ixgbe_common.c Sun Jul 8 20:39:00 2012 (r238263) @@ -51,13 +51,6 @@ static void ixgbe_release_eeprom(struct static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr); static s32 ixgbe_get_san_mac_addr_offset(struct ixgbe_hw *hw, u16 *san_mac_offset); -static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw); -static s32 ixgbe_fc_autoneg_backplane(struct ixgbe_hw *hw); -static s32 ixgbe_fc_autoneg_copper(struct ixgbe_hw *hw); -static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw); -static s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, - u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); -static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num); static s32 ixgbe_read_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, u16 words, u16 *data); static s32 ixgbe_write_eeprom_buffer_bit_bang(struct ixgbe_hw *hw, u16 offset, @@ -146,6 +139,177 @@ s32 ixgbe_init_ops_generic(struct ixgbe_ } /** + * ixgbe_device_supports_autoneg_fc - Check if phy supports autoneg flow + * control + * @hw: pointer to hardware structure + * + * There are several phys that do not support autoneg flow control. This + * function check the device id to see if the associated phy supports + * autoneg flow control. + **/ +static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw) +{ + + DEBUGFUNC("ixgbe_device_supports_autoneg_fc"); + + switch (hw->device_id) { + case IXGBE_DEV_ID_X540T: + case IXGBE_DEV_ID_X540T1: + return IXGBE_SUCCESS; + case IXGBE_DEV_ID_82599_T3_LOM: + return IXGBE_SUCCESS; + default: + return IXGBE_ERR_FC_NOT_SUPPORTED; + } +} + +/** + * ixgbe_setup_fc - Set up flow control + * @hw: pointer to hardware structure + * + * Called at init time to set up flow control. + **/ +static s32 ixgbe_setup_fc(struct ixgbe_hw *hw) +{ + s32 ret_val = IXGBE_SUCCESS; + u32 reg = 0, reg_bp = 0; + u16 reg_cu = 0; + + DEBUGFUNC("ixgbe_setup_fc"); + + /* + * Validate the requested mode. Strict IEEE mode does not allow + * ixgbe_fc_rx_pause because it will cause us to fail at UNH. + */ + if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { + DEBUGOUT("ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + + /* + * 10gig parts do not have a word in the EEPROM to determine the + * default flow control setting, so we explicitly set it to full. + */ + if (hw->fc.requested_mode == ixgbe_fc_default) + hw->fc.requested_mode = ixgbe_fc_full; + + /* + * Set up the 1G and 10G flow control advertisement registers so the + * HW will be able to do fc autoneg once the cable is plugged in. If + * we link at 10G, the 1G advertisement is harmless and vice versa. + */ + switch (hw->phy.media_type) { + case ixgbe_media_type_fiber: + case ixgbe_media_type_backplane: + reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA); + reg_bp = IXGBE_READ_REG(hw, IXGBE_AUTOC); + break; + case ixgbe_media_type_copper: + hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, ®_cu); + break; + default: + break; + } + + /* + * The possible values of fc.requested_mode are: + * 0: Flow control is completely disabled + * 1: Rx flow control is enabled (we can receive pause frames, + * but not send pause frames). + * 2: Tx flow control is enabled (we can send pause frames but + * we do not support receiving pause frames). + * 3: Both Rx and Tx flow control (symmetric) are enabled. + * other: Invalid. + */ + switch (hw->fc.requested_mode) { + case ixgbe_fc_none: + /* Flow control completely disabled by software override. */ + reg &= ~(IXGBE_PCS1GANA_SYM_PAUSE | IXGBE_PCS1GANA_ASM_PAUSE); + if (hw->phy.media_type == ixgbe_media_type_backplane) + reg_bp &= ~(IXGBE_AUTOC_SYM_PAUSE | + IXGBE_AUTOC_ASM_PAUSE); + else if (hw->phy.media_type == ixgbe_media_type_copper) + reg_cu &= ~(IXGBE_TAF_SYM_PAUSE | IXGBE_TAF_ASM_PAUSE); + break; + case ixgbe_fc_tx_pause: + /* + * Tx Flow control is enabled, and Rx Flow control is + * disabled by software override. + */ + reg |= IXGBE_PCS1GANA_ASM_PAUSE; + reg &= ~IXGBE_PCS1GANA_SYM_PAUSE; + if (hw->phy.media_type == ixgbe_media_type_backplane) { + reg_bp |= IXGBE_AUTOC_ASM_PAUSE; + reg_bp &= ~IXGBE_AUTOC_SYM_PAUSE; + } else if (hw->phy.media_type == ixgbe_media_type_copper) { + reg_cu |= IXGBE_TAF_ASM_PAUSE; + reg_cu &= ~IXGBE_TAF_SYM_PAUSE; + } + break; + case ixgbe_fc_rx_pause: + /* + * Rx Flow control is enabled and Tx Flow control is + * disabled by software override. Since there really + * isn't a way to advertise that we are capable of RX + * Pause ONLY, we will advertise that we support both + * symmetric and asymmetric Rx PAUSE, as such we fall + * through to the fc_full statement. Later, we will + * disable the adapter's ability to send PAUSE frames. + */ + case ixgbe_fc_full: + /* Flow control (both Rx and Tx) is enabled by SW override. */ + reg |= IXGBE_PCS1GANA_SYM_PAUSE | IXGBE_PCS1GANA_ASM_PAUSE; + if (hw->phy.media_type == ixgbe_media_type_backplane) + reg_bp |= IXGBE_AUTOC_SYM_PAUSE | + IXGBE_AUTOC_ASM_PAUSE; + else if (hw->phy.media_type == ixgbe_media_type_copper) + reg_cu |= IXGBE_TAF_SYM_PAUSE | IXGBE_TAF_ASM_PAUSE; + break; + default: + DEBUGOUT("Flow control param set incorrectly\n"); + ret_val = IXGBE_ERR_CONFIG; + goto out; + break; + } + + if (hw->mac.type != ixgbe_mac_X540) { + /* + * Enable auto-negotiation between the MAC & PHY; + * the MAC will advertise clause 37 flow control. + */ + IXGBE_WRITE_REG(hw, IXGBE_PCS1GANA, reg); + reg = IXGBE_READ_REG(hw, IXGBE_PCS1GLCTL); + + /* Disable AN timeout */ + if (hw->fc.strict_ieee) + reg &= ~IXGBE_PCS1GLCTL_AN_1G_TIMEOUT_EN; + + IXGBE_WRITE_REG(hw, IXGBE_PCS1GLCTL, reg); + DEBUGOUT1("Set up FC; PCS1GLCTL = 0x%08X\n", reg); + } + + /* + * AUTOC restart handles negotiation of 1G and 10G on backplane + * and copper. There is no need to set the PCS1GCTL register. + * + */ + if (hw->phy.media_type == ixgbe_media_type_backplane) { + reg_bp |= IXGBE_AUTOC_AN_RESTART; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC, reg_bp); + } else if ((hw->phy.media_type == ixgbe_media_type_copper) && + (ixgbe_device_supports_autoneg_fc(hw) == IXGBE_SUCCESS)) { + hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg_cu); + } + + DEBUGOUT1("Set up FC; IXGBE_AUTOC = 0x%08X\n", reg); +out: + return ret_val; +} + +/** * ixgbe_start_hw_generic - Prepare hardware for Tx/Rx * @hw: pointer to hardware structure * @@ -156,6 +320,7 @@ s32 ixgbe_init_ops_generic(struct ixgbe_ **/ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) { + s32 ret_val; u32 ctrl_ext; DEBUGFUNC("ixgbe_start_hw_generic"); @@ -178,12 +343,15 @@ s32 ixgbe_start_hw_generic(struct ixgbe_ IXGBE_WRITE_FLUSH(hw); /* Setup flow control */ - ixgbe_setup_fc(hw, 0); + ret_val = ixgbe_setup_fc(hw); + if (ret_val != IXGBE_SUCCESS) + goto out; /* Clear adapter stopped flag */ hw->adapter_stopped = FALSE; - return IXGBE_SUCCESS; +out: + return ret_val; } /** @@ -211,14 +379,14 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw /* Disable relaxed ordering */ for (i = 0; i < hw->mac.max_tx_queues; i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); - regval &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + regval &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), regval); } for (i = 0; i < hw->mac.max_rx_queues; i++) { regval = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); - regval &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | - IXGBE_DCA_RXCTRL_DESC_HSRO_EN); + regval &= ~(IXGBE_DCA_RXCTRL_DATA_WRO_EN | + IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } @@ -583,6 +751,9 @@ s32 ixgbe_get_bus_info_generic(struct ix case IXGBE_PCI_LINK_SPEED_5000: hw->bus.speed = ixgbe_bus_speed_5000; break; + case IXGBE_PCI_LINK_SPEED_8000: + hw->bus.speed = ixgbe_bus_speed_8000; + break; default: hw->bus.speed = ixgbe_bus_speed_unknown; break; @@ -2242,27 +2413,44 @@ s32 ixgbe_disable_mc_generic(struct ixgb /** * ixgbe_fc_enable_generic - Enable flow control * @hw: pointer to hardware structure - * @packetbuf_num: packet buffer number (0-7) * * Enable flow control according to the current settings. **/ -s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packetbuf_num) +s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw) { s32 ret_val = IXGBE_SUCCESS; u32 mflcn_reg, fccfg_reg; u32 reg; u32 fcrtl, fcrth; + int i; DEBUGFUNC("ixgbe_fc_enable_generic"); - /* Negotiate the fc mode to use */ - ret_val = ixgbe_fc_autoneg(hw); - if (ret_val == IXGBE_ERR_FLOW_CONTROL) + /* Validate the water mark configuration */ + if (!hw->fc.pause_time) { + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; goto out; + } + + /* Low water mark of zero causes XOFF floods */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + if (!hw->fc.low_water[i] || + hw->fc.low_water[i] >= hw->fc.high_water[i]) { + DEBUGOUT("Invalid water mark configuration\n"); + ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS; + goto out; + } + } + } + + /* Negotiate the fc mode to use */ + ixgbe_fc_autoneg(hw); /* Disable any previous flow control settings */ mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN); - mflcn_reg &= ~(IXGBE_MFLCN_RFCE | IXGBE_MFLCN_RPFCE); + mflcn_reg &= ~(IXGBE_MFLCN_RPFCE_MASK | IXGBE_MFLCN_RFCE); fccfg_reg = IXGBE_READ_REG(hw, IXGBE_FCCFG); fccfg_reg &= ~(IXGBE_FCCFG_TFCE_802_3X | IXGBE_FCCFG_TFCE_PRIORITY); @@ -2319,120 +2507,110 @@ s32 ixgbe_fc_enable_generic(struct ixgbe IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn_reg); IXGBE_WRITE_REG(hw, IXGBE_FCCFG, fccfg_reg); - fcrth = hw->fc.high_water[packetbuf_num] << 10; - fcrtl = hw->fc.low_water << 10; - if (hw->fc.current_mode & ixgbe_fc_tx_pause) { - fcrth |= IXGBE_FCRTH_FCEN; - if (hw->fc.send_xon) - fcrtl |= IXGBE_FCRTL_XONE; - } + /* Set up and enable Rx high/low water mark thresholds, enable XON. */ + for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { + if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && + hw->fc.high_water[i]) { + fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; + IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), fcrtl); + fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; + } else { + IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(i), 0); + /* + * In order to prevent Tx hangs when the internal Tx + * switch is enabled we must set the high water mark + * to the maximum FCRTH value. This allows the Tx + * switch to function even under heavy Rx workloads. + */ + fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 32; + } - IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(packetbuf_num), fcrth); - IXGBE_WRITE_REG(hw, IXGBE_FCRTL_82599(packetbuf_num), fcrtl); + IXGBE_WRITE_REG(hw, IXGBE_FCRTH_82599(i), fcrth); + } /* Configure pause time (2 TCs per register) */ - reg = IXGBE_READ_REG(hw, IXGBE_FCTTV(packetbuf_num / 2)); - if ((packetbuf_num & 1) == 0) - reg = (reg & 0xFFFF0000) | hw->fc.pause_time; - else - reg = (reg & 0x0000FFFF) | (hw->fc.pause_time << 16); - IXGBE_WRITE_REG(hw, IXGBE_FCTTV(packetbuf_num / 2), reg); + reg = hw->fc.pause_time * 0x00010001; + for (i = 0; i < (IXGBE_DCB_MAX_TRAFFIC_CLASS / 2); i++) + IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); - IXGBE_WRITE_REG(hw, IXGBE_FCRTV, (hw->fc.pause_time >> 1)); + /* Configure flow control refresh threshold value */ + IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); out: return ret_val; } /** - * ixgbe_fc_autoneg - Configure flow control + * ixgbe_negotiate_fc - Negotiate flow control * @hw: pointer to hardware structure + * @adv_reg: flow control advertised settings + * @lp_reg: link partner's flow control settings + * @adv_sym: symmetric pause bit in advertisement + * @adv_asm: asymmetric pause bit in advertisement + * @lp_sym: symmetric pause bit in link partner advertisement + * @lp_asm: asymmetric pause bit in link partner advertisement * - * Compares our advertised flow control capabilities to those advertised by - * our link partner, and determines the proper flow control mode to use. + * Find the intersection between advertised settings and link partner's + * advertised settings **/ -s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw) +static s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, + u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm) { - s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED; - ixgbe_link_speed speed; - bool link_up; + if ((!(adv_reg)) || (!(lp_reg))) + return IXGBE_ERR_FC_NOT_NEGOTIATED; - DEBUGFUNC("ixgbe_fc_autoneg"); + if ((adv_reg & adv_sym) && (lp_reg & lp_sym)) { + /* + * Now we need to check if the user selected Rx ONLY + * of pause frames. In this case, we had to advertise + * FULL flow control because we could not advertise RX + * ONLY. Hence, we must now check to see if we need to + * turn OFF the TRANSMISSION of PAUSE frames. + */ + if (hw->fc.requested_mode == ixgbe_fc_full) { + hw->fc.current_mode = ixgbe_fc_full; + DEBUGOUT("Flow Control = FULL.\n"); + } else { + hw->fc.current_mode = ixgbe_fc_rx_pause; + DEBUGOUT("Flow Control=RX PAUSE frames only\n"); + } + } else if (!(adv_reg & adv_sym) && (adv_reg & adv_asm) && + (lp_reg & lp_sym) && (lp_reg & lp_asm)) { + hw->fc.current_mode = ixgbe_fc_tx_pause; + DEBUGOUT("Flow Control = TX PAUSE frames only.\n"); + } else if ((adv_reg & adv_sym) && (adv_reg & adv_asm) && + !(lp_reg & lp_sym) && (lp_reg & lp_asm)) { + hw->fc.current_mode = ixgbe_fc_rx_pause; + DEBUGOUT("Flow Control = RX PAUSE frames only.\n"); + } else { + hw->fc.current_mode = ixgbe_fc_none; + DEBUGOUT("Flow Control = NONE.\n"); + } + return IXGBE_SUCCESS; +} - if (hw->fc.disable_fc_autoneg) - goto out; +/** + * ixgbe_fc_autoneg_fiber - Enable flow control on 1 gig fiber + * @hw: pointer to hardware structure + * + * Enable flow control according on 1 gig fiber. + **/ +static s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) +{ + u32 pcs_anadv_reg, pcs_lpab_reg, linkstat; + s32 ret_val = IXGBE_ERR_FC_NOT_NEGOTIATED; /* - * AN should have completed when the cable was plugged in. - * Look for reasons to bail out. Bail out if: - * - FC autoneg is disabled, or if - * - link is not up. - * - * Since we're being called from an LSC, link is already known to be up. - * So use link_up_wait_to_complete=FALSE. - */ - hw->mac.ops.check_link(hw, &speed, &link_up, FALSE); - if (!link_up) { - ret_val = IXGBE_ERR_FLOW_CONTROL; - goto out; - } - - switch (hw->phy.media_type) { - /* Autoneg flow control on fiber adapters */ - case ixgbe_media_type_fiber: - if (speed == IXGBE_LINK_SPEED_1GB_FULL) - ret_val = ixgbe_fc_autoneg_fiber(hw); - break; - - /* Autoneg flow control on backplane adapters */ - case ixgbe_media_type_backplane: - ret_val = ixgbe_fc_autoneg_backplane(hw); - break; - - /* Autoneg flow control on copper adapters */ - case ixgbe_media_type_copper: - if (ixgbe_device_supports_autoneg_fc(hw) == IXGBE_SUCCESS) - ret_val = ixgbe_fc_autoneg_copper(hw); - break; - - default: - break; - } - -out: - if (ret_val == IXGBE_SUCCESS) { - hw->fc.fc_was_autonegged = TRUE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 20:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3D5106566B; Sun, 8 Jul 2012 20:41:55 +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 685BD8FC12; Sun, 8 Jul 2012 20:41: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 q68KftrW073533; Sun, 8 Jul 2012 20:41:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68Kftoa073531; Sun, 8 Jul 2012 20:41:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207082041.q68Kftoa073531@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Jul 2012 20:41:55 +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: r238264 - stable/9/contrib/openbsm/libauditd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 20:41:55 -0000 Author: rwatson Date: Sun Jul 8 20:41:54 2012 New Revision: 238264 URL: http://svn.freebsd.org/changeset/base/238264 Log: Merge r234034 from head to stable/9: Merge a local fix to OpenBSM's libauditd to avoid a directory descriptor leak when iterating over possible audit trail directories. This fix will be merged upstream in an identical form, but hasn't yet appeared in an OpenBSM release. Submitted by: guido Obtained from: TrustedBSD Project Approved by: re (kib) Modified: stable/9/contrib/openbsm/libauditd/auditd_lib.c Directory Properties: stable/9/contrib/openbsm/ (props changed) Modified: stable/9/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- stable/9/contrib/openbsm/libauditd/auditd_lib.c Sun Jul 8 20:39:00 2012 (r238263) +++ stable/9/contrib/openbsm/libauditd/auditd_lib.c Sun Jul 8 20:41:54 2012 (r238264) @@ -520,6 +520,7 @@ auditd_expire_trails(int (*warn_expired) } } + closedir(dirp); } oldest_time = current_time - expire_age; From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 21:13:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D73411065686; Sun, 8 Jul 2012 21:13:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C21D58FC08; Sun, 8 Jul 2012 21:13: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 q68LD4No074824; Sun, 8 Jul 2012 21:13:04 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68LD4c1074821; Sun, 8 Jul 2012 21:13:04 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207082113.q68LD4c1074821@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 8 Jul 2012 21:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238265 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 21:13:04 -0000 Author: melifaro Date: Sun Jul 8 21:13:04 2012 New Revision: 238265 URL: http://svn.freebsd.org/changeset/base/238265 Log: Finally fix lookup (account remaining '\0') and deletion (provide valid key length for radix lookup). Submitted by: Ihor Kaharlichenko (prev version) Approved by: kib(mentor) MFC after: 3 days Sponsored by: Shtorm ISP Modified: head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Sun Jul 8 20:41:54 2012 (r238264) +++ head/sys/netinet/ipfw/ip_fw_table.c Sun Jul 8 21:13:04 2012 (r238265) @@ -344,9 +344,12 @@ ipfw_del_table_entry(struct ip_fw_chain struct xaddr_iface ifname, ifmask; memset(&ifname, 0, sizeof(ifname)); + /* Include last \0 into comparison */ + mlen++; + /* Set 'total' structure length */ - KEY_LEN(ifname) = mlen; - KEY_LEN(ifmask) = mlen; + KEY_LEN(ifname) = KEY_LEN_IFACE + mlen; + KEY_LEN(ifmask) = KEY_LEN_IFACE + mlen; /* Assume direct match */ /* FIXME: Add interface pattern matching */ #if 0 @@ -569,7 +572,7 @@ ipfw_lookup_table_extended(struct ip_fw_ case IPFW_TABLE_INTERFACE: KEY_LEN(iface) = KEY_LEN_IFACE + - strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE); + strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE) + 1; /* Assume direct match */ /* FIXME: Add interface pattern matching */ xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh)); From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 21:21:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D619F1065674; Sun, 8 Jul 2012 21:21:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C04948FC0A; Sun, 8 Jul 2012 21:21:45 +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 q68LLjbX075271; Sun, 8 Jul 2012 21:21:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q68LLjZq075268; Sun, 8 Jul 2012 21:21:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207082121.q68LLjZq075268@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Jul 2012 21:21:45 +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: r238266 - stable/9/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 21:21:46 -0000 Author: rwatson Date: Sun Jul 8 21:21:45 2012 New Revision: 238266 URL: http://svn.freebsd.org/changeset/base/238266 Log: Merge r231712 from head to stable/9: When initialising the CP0 status register during boot on 64-bit MIPS, set all three of the kernel, supervisor, and user-mode 64-bit mode flags. While FreeBSD does not currently use the supervisor ring (and hence this is effectively a NOP on most systems), doing this avoids triggering an exception on 64-bit MIPS CPUs that don't support 32-bit compatibility mode, and therefore don't allow clearing the SX bit. Reviewed by: gonzo Sponsored by: DARPA, SRI International Approved by: re (kib) Modified: stable/9/sys/mips/mips/locore.S Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/mips/mips/locore.S ============================================================================== --- stable/9/sys/mips/mips/locore.S Sun Jul 8 21:13:04 2012 (r238265) +++ stable/9/sys/mips/mips/locore.S Sun Jul 8 21:21:45 2012 (r238266) @@ -118,7 +118,7 @@ VECTOR(_locore, unknown) */ li t1, MIPS_SR_COP_1_BIT #ifdef __mips_n64 - or t1, MIPS_SR_KX | MIPS_SR_UX + or t1, MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX #endif #endif /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 8 21:41:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D8FF1065675; Sun, 8 Jul 2012 21:41:14 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 011D78FC24; Sun, 8 Jul 2012 21:41:13 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 65F7B86E; Sun, 8 Jul 2012 23:41:05 +0200 (CEST) Date: Sun, 8 Jul 2012 23:38:46 +0200 From: Pawel Jakub Dawidek To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= Message-ID: <20120708213846.GF1437@garage.freebsd.pl> References: <201207072013.q67KDfHN082943@svn.freebsd.org> <20120707215424.GE1437@garage.freebsd.pl> <280C8AEE-F7E8-4AAE-87BF-E59D0249B74F@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tmoQ0UElFV5VgXgH" Content-Disposition: inline In-Reply-To: <280C8AEE-F7E8-4AAE-87BF-E59D0249B74F@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238213 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 21:41:14 -0000 --tmoQ0UElFV5VgXgH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 08, 2012 at 12:53:37AM +0200, Edward Tomasz Napiera=C5=82a wrot= e: > Wiadomo=C5=9B=C4=87 napisana przez Pawel Jakub Dawidek w dniu 7 lip 2012,= o godz. 23:54: > > You will also notice that one of those fields were left for more > > universal method to handle various provider's property changes (ie. > > provider's name, apart from its mediasize). The initial patch was even > > published a year ago: > >=20 > > http://people.freebsd.org/~pjd/patches/geom_property_change.patch > >=20 > > Even if it was somehow totally not reusable it would at least give you a > > hint that mediasize is not the only thing that can change and if we are > > making that change it should be done right. >=20 > I was not aware of that patch. [...] I'm afraid that's a lie. From IRC logs: rwatson: http://people.freebsd.org/~pjd/patches/geom_property_change.= patch rwatson: Not tested. pjd: shouldn't there also be a flag for geom to veto resizing? pjd: for classes that can't handle their consumers changing size? [the discussion was pretty long] > [...] What I've considered was to use attributes > instead, but that would complicate notifying consumers about resizing > and would require some special-casing in the attribute code. What attributes? The ones handled by BIO_GETATTR? They are about something totally different. > >> + G_VALID_PROVIDER(pp); > >=20 > > Is this your protection from a provider going away? >=20 > Can you suggest a way to do it in a safe way that doesn't involve > rewriting most of GEOM? I can only suggest not to rewrite GEOM because you didn't take the time to understand it. > > Why is this safe to call the orphan method directly and not use > > g_orphan_provider()? I don't know if using g_orphan_provider() is safe > > to use here either, but I'm under impression that you assume no orphan > > method will ever drop the topology lock? We have tools to assert that, > > no need to introduce such weak assumptions. >=20 > It's not that using g_orphan_provider() would be safer here - it simply > wouldn't work. The way it works is by adding providers to a queue > (g_doorstep). _Providers_, and we need to orphan individual consumers. > So, this would involve rewriting the orphanisation mechanism. Also, > most of the classes were fixed by mav@ to handle this correctly, IIRC. By introducing such hacks you make the code unpredictable. The way g_orphan_provider() works is more than just calling geom's orphan method. Also, until now, when orphan method was called it meant that provider is going away, which is not true anymore. I'd like to believe that you carefully analysed what you changed here is safe, but based on your understanding of GEOM, I doubt that. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --tmoQ0UElFV5VgXgH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/5/eUACgkQForvXbEpPzT2gACePu160ufHCMEiKK4LZhCEzXxn yeUAoJew55E5dRqOuPa0bhnBDVIteXPz =zkP9 -----END PGP SIGNATURE----- --tmoQ0UElFV5VgXgH-- From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 05:23:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2D81065679; Mon, 9 Jul 2012 05:23:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 655588FC1A; Mon, 9 Jul 2012 05:23:03 +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 q695N3W5096986; Mon, 9 Jul 2012 05:23:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q695N3Lq096984; Mon, 9 Jul 2012 05:23:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090523.q695N3Lq096984@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 05:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238271 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 05:23:03 -0000 Author: adrian Date: Mon Jul 9 05:23:02 2012 New Revision: 238271 URL: http://svn.freebsd.org/changeset/base/238271 Log: Add a debug category for RX EDMA. Modified: head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Mon Jul 9 04:00:25 2012 (r238270) +++ head/sys/dev/ath/if_ath_debug.h Mon Jul 9 05:23:02 2012 (r238271) @@ -64,6 +64,8 @@ enum { ATH_DEBUG_SW_TX_RETRIES = 0x040000000ULL, /* software TX retries */ ATH_DEBUG_FATAL = 0x080000000ULL, /* fatal errors */ ATH_DEBUG_SW_TX_BAR = 0x100000000ULL, /* BAR TX */ + ATH_DEBUG_EDMA_RX = 0x200000000ULL, /* RX EDMA state */ + ATH_DEBUG_ANY = 0xffffffffffffffffULL }; From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 05:39:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09844106566B; Mon, 9 Jul 2012 05:39:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3AD8FC08; Mon, 9 Jul 2012 05:39: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 q695dVEl097680; Mon, 9 Jul 2012 05:39:31 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q695dV3I097678; Mon, 9 Jul 2012 05:39:31 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201207090539.q695dV3I097678@svn.freebsd.org> From: Mateusz Guzik Date: Mon, 9 Jul 2012 05:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238272 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 05:39:32 -0000 Author: mjg Date: Mon Jul 9 05:39:31 2012 New Revision: 238272 URL: http://svn.freebsd.org/changeset/base/238272 Log: Follow-up commit to r238220: Pass only FEXEC (instead of FREAD|FEXEC) in fgetvp_exec. _fget has to check for !FWRITE anyway and may as well know about FREAD. Make _fget code a bit more readable by converting permission checking from if() to switch(). Assert that correct permission flags are passed. In collaboration with: kib Approved by: trasz (mentor) MFC after: 6 days X-MFC: with r238220 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Jul 9 05:23:02 2012 (r238271) +++ head/sys/kern/kern_descrip.c Mon Jul 9 05:39:31 2012 (r238272) @@ -2275,8 +2275,8 @@ _fget(struct thread *td, int fd, struct struct file *fp; #ifdef CAPABILITIES struct file *fp_fromcap; - int error; #endif + int error; *fpp = NULL; if (td == NULL || (fdp = td->td_proc->p_fd) == NULL) @@ -2315,7 +2315,7 @@ _fget(struct thread *td, int fd, struct else error = cap_funwrap_mmap(fp, needrights, maxprotp, &fp_fromcap); - if (error) { + if (error != 0) { fdrop(fp, td); return (error); } @@ -2341,13 +2341,29 @@ _fget(struct thread *td, int fd, struct /* * FREAD and FWRITE failure return EBADF as per POSIX. */ - if ((flags == FREAD && (fp->f_flag & FREAD) == 0) || - (flags == FWRITE && (fp->f_flag & FWRITE) == 0) || - (flags == (FREAD | FEXEC) && - (((fp->f_flag & flags) == 0) || ((fp->f_flag & FWRITE) != 0)))) { + error = 0; + switch (flags) { + case FREAD: + case FWRITE: + if ((fp->f_flag & flags) == 0) + error = EBADF; + break; + case FEXEC: + if ((fp->f_flag & (FREAD | FEXEC)) == 0 || + ((fp->f_flag & FWRITE) != 0)) + error = EBADF; + break; + case 0: + break; + default: + KASSERT(0, ("wrong flags")); + } + + if (error != 0) { fdrop(fp, td); - return (EBADF); + return (error); } + *fpp = fp; return (0); } @@ -2448,7 +2464,7 @@ int fgetvp_exec(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp) { - return (_fgetvp(td, fd, FREAD | FEXEC, rights, NULL, vpp)); + return (_fgetvp(td, fd, FEXEC, rights, NULL, vpp)); } #ifdef notyet From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 06:21:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16609106566B; Mon, 9 Jul 2012 06:21:47 +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 00C6C8FC12; Mon, 9 Jul 2012 06:21: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 q696LkuS099494; Mon, 9 Jul 2012 06:21:46 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q696Lksj099488; Mon, 9 Jul 2012 06:21:46 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207090621.q696Lksj099488@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 06:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238273 - in head: sbin/ifconfig sys/netinet6 usr.sbin/ndp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 06:21:47 -0000 Author: hrs Date: Mon Jul 9 06:21:46 2012 New Revision: 238273 URL: http://svn.freebsd.org/changeset/base/238273 Log: Remove "prefer_source" address selection option. FreeBSD has had an implementation of RFC 3484 for this purpose for a long time and "prefer_source" was never implemented actually. ND6_IFF_PREFER_SOURCE macro is left intact. Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifconfig.8 head/sys/netinet6/nd6.h head/usr.sbin/ndp/ndp.8 head/usr.sbin/ndp/ndp.c Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Mon Jul 9 05:39:31 2012 (r238272) +++ head/sbin/ifconfig/af_inet6.c Mon Jul 9 06:21:46 2012 (r238273) @@ -509,8 +509,6 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-ifdisabled", -ND6_IFF_IFDISABLED, setnd6flags), DEF_CMD("nud", ND6_IFF_PERFORMNUD, setnd6flags), DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags), - DEF_CMD("prefer_source",ND6_IFF_PREFER_SOURCE, setnd6flags), - DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags), DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Jul 9 05:39:31 2012 (r238272) +++ head/sbin/ifconfig/ifconfig.8 Mon Jul 9 06:21:46 2012 (r238273) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 27, 2012 +.Dd July 9, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -716,12 +716,6 @@ Set a flag to enable Neighbor Unreachabi .It Cm -nud Clear a flag .Cm nud . -.It Cm prefer_source -Set a flag to prefer addresses on the interface as candidates of the -source address for outgoing packets. -.It Cm -prefer_source -Clear a flag -.Cm prefer_source . .El .Pp The following parameters are specific to cloning Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Mon Jul 9 05:39:31 2012 (r238272) +++ head/sys/netinet6/nd6.h Mon Jul 9 06:21:46 2012 (r238273) @@ -79,7 +79,7 @@ struct nd_ifinfo { #define ND6_IFF_PERFORMNUD 0x1 #define ND6_IFF_ACCEPT_RTADV 0x2 -#define ND6_IFF_PREFER_SOURCE 0x4 /* XXX: not related to ND. */ +#define ND6_IFF_PREFER_SOURCE 0x4 /* Not used in FreeBSD. */ #define ND6_IFF_IFDISABLED 0x8 /* IPv6 operation is disabled due to * DAD failure. (XXX: not ND-specific) */ Modified: head/usr.sbin/ndp/ndp.8 ============================================================================== --- head/usr.sbin/ndp/ndp.8 Mon Jul 9 05:39:31 2012 (r238272) +++ head/usr.sbin/ndp/ndp.8 Mon Jul 9 06:21:46 2012 (r238273) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2009 +.Dd July 9, 2012 .Dt NDP 8 .Os .\" @@ -192,15 +192,6 @@ on This flag is set by .Va net.inet6.ip6.auto_linklocal sysctl variable. -.It Ic prefer_source -Prefer addresses on the -.Ar interface -as candidates of the source address for outgoing packets. -The default value of this flag is off. -For more details about the entire algorithm of source address -selection, see the -.Pa IMPLEMENTATION -file supplied with the KAME kit. .It Ic disabled Disable IPv6 operation on the interface. When disabled, the interface discards any IPv6 packets Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Mon Jul 9 05:39:31 2012 (r238272) +++ head/usr.sbin/ndp/ndp.c Mon Jul 9 06:21:46 2012 (r238273) @@ -1008,9 +1008,6 @@ ifinfo(ifname, argc, argv) #ifdef ND6_IFF_AUTO_LINKLOCAL SETFLAG("auto_linklocal", ND6_IFF_AUTO_LINKLOCAL); #endif -#ifdef ND6_IFF_PREFER_SOURCE - SETFLAG("prefer_source", ND6_IFF_PREFER_SOURCE); -#endif SETVALUE("basereachable", ND.basereachable); SETVALUE("retrans", ND.retrans); SETVALUE("curhlim", ND.chlim); @@ -1084,10 +1081,6 @@ ifinfo(ifname, argc, argv) if ((ND.flags & ND6_IFF_AUTO_LINKLOCAL)) printf("auto_linklocal "); #endif -#ifdef ND6_IFF_PREFER_SOURCE - if ((ND.flags & ND6_IFF_PREFER_SOURCE)) - printf("prefer_source "); -#endif } putc('\n', stdout); #undef ND From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 06:34:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32BB71065678; Mon, 9 Jul 2012 06:34: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 1CFB08FC17; Mon, 9 Jul 2012 06:34: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 q696YFsB000140; Mon, 9 Jul 2012 06:34:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q696YFNG000136; Mon, 9 Jul 2012 06:34:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207090634.q696YFNG000136@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 06:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238274 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 06:34:16 -0000 Author: hrs Date: Mon Jul 9 06:34:15 2012 New Revision: 238274 URL: http://svn.freebsd.org/changeset/base/238274 Log: - Add support of the following USB devices to run(4): * Logitec LAN-W150N/U2 * Buffalo WLI-UC-GNM2 - Add device id of Planex GW-USValue-EZ. Modified: head/share/man/man4/run.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/share/man/man4/run.4 ============================================================================== --- head/share/man/man4/run.4 Mon Jul 9 06:21:46 2012 (r238273) +++ head/share/man/man4/run.4 Mon Jul 9 06:34:15 2012 (r238274) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2012 +.Dd July 9, 2012 .Dt RUN 4 .Os .Sh NAME @@ -122,6 +122,8 @@ driver supports the following wireless a .It Buffalo WLI-UC-G300N .It Buffalo WLI-UC-G301N .It Buffalo WLI-UC-GN +.It Buffalo WLI-UC-GNM +.It Buffalo WLI-UC-GNM2 .It Corega CG-WLUSB2GNL .It Corega CG-WLUSB2GNR .It Corega CG-WLUSB300AGN @@ -142,6 +144,7 @@ driver supports the following wireless a .It Hercules HWNU-300 .It Linksys WUSB54GC v3 .It Linksys WUSB600N +.It Logitec LAN-W150N/U2 .It Mvix Nubbin MS-811N .It Planex GW-USMicroN .It Planex GW-US300MiniS Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 9 06:21:46 2012 (r238273) +++ head/sys/dev/usb/usbdevs Mon Jul 9 06:34:15 2012 (r238274) @@ -2140,6 +2140,7 @@ product LOGITEC RT2870_1 0x0162 RT2870 product LOGITEC RT2870_2 0x0163 RT2870 product LOGITEC RT2870_3 0x0164 RT2870 product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2 +product LOGITEC LANW150NU2 0x0168 LAN-W150N/U2 /* Longcheer Holdings, Ltd. products */ product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA @@ -2204,7 +2205,8 @@ 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 +product MELCO WLIUCGNM 0x01a2 WLI-UC-GNM +product MELCO WLIUCGNM2 0x01ee WLI-UC-GNM2 /* Merlin products */ product MERLIN V620 0x1110 Merlin V620 @@ -2618,6 +2620,7 @@ product PLANEX2 GWUS54GD 0xed01 GW-US54G product PLANEX2 GWUSMM 0xed02 GW-USMM product PLANEX2 RT2870 0xed06 RT2870 product PLANEX2 GWUSMICRON 0xed14 GW-USMicroN +product PLANEX2 GWUSVALUEEZ 0xed17 GW-USValue-EZ product PLANEX3 GWUS54GZ 0xab10 GW-US54GZ product PLANEX3 GU1000T 0xab11 GU-1000T product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Jul 9 06:21:46 2012 (r238273) +++ head/sys/dev/usb/wlan/if_run.c Mon Jul 9 06:34:15 2012 (r238274) @@ -209,6 +209,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(LOGITEC, RT2870_2), RUN_DEV(LOGITEC, RT2870_3), RUN_DEV(LOGITEC, LANW300NU2), + RUN_DEV(LOGITEC, LANW150NU2), RUN_DEV(MELCO, RT2870_1), RUN_DEV(MELCO, RT2870_2), RUN_DEV(MELCO, WLIUCAG300N), @@ -216,6 +217,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(MELCO, WLIUCG301N), RUN_DEV(MELCO, WLIUCGN), RUN_DEV(MELCO, WLIUCGNM), + RUN_DEV(MELCO, WLIUCGNM2), RUN_DEV(MOTOROLA4, RT2770), RUN_DEV(MOTOROLA4, RT3070), RUN_DEV(MSI, RT3070_1), From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 06:39:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D062106564A; Mon, 9 Jul 2012 06:39:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB968FC0C; Mon, 9 Jul 2012 06:39:46 +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 q696dk3i000382; Mon, 9 Jul 2012 06:39:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q696dk20000380; Mon, 9 Jul 2012 06:39:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090639.q696dk20000380@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 06:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238275 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 06:39:47 -0000 Author: adrian Date: Mon Jul 9 06:39:46 2012 New Revision: 238275 URL: http://svn.freebsd.org/changeset/base/238275 Log: Extend the RX descriptor completion debugging to log the larger AR93xx receive descriptors. This isn't entirely complete - the AR93xx and later descriptors don't have a link/buffer pointer; the descriptor contents just start. Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Mon Jul 9 06:34:15 2012 (r238274) +++ head/sys/dev/ath/if_ath_debug.c Mon Jul 9 06:39:46 2012 (r238275) @@ -118,6 +118,16 @@ ath_printrxbuf(struct ath_softc *sc, con ds->ds_hw[2], ds->ds_hw[3], ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], ds->ds_hw[8]); + } else if (ah->ah_magic == 0x19741014) { + printf(" %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[2], ds->ds_hw[3], ds->ds_hw[4], + ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], + ds->ds_hw[8]); + + printf(" %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[9], ds->ds_hw[10], ds->ds_hw[11], + ds->ds_hw[12], ds->ds_hw[13], ds->ds_hw[14], + ds->ds_hw[15]); } } } From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 06:41:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37B08106566B; Mon, 9 Jul 2012 06:41:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 225698FC08; Mon, 9 Jul 2012 06:41:19 +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 q696fIwg000493; Mon, 9 Jul 2012 06:41:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q696fIvh000491; Mon, 9 Jul 2012 06:41:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090641.q696fIvh000491@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 06:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238276 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 06:41:21 -0000 Author: adrian Date: Mon Jul 9 06:41:18 2012 New Revision: 238276 URL: http://svn.freebsd.org/changeset/base/238276 Log: Extend the debugging flags to include some AR9300 HAL related options. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_debug.h Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Mon Jul 9 06:39:46 2012 (r238275) +++ head/sys/dev/ath/ath_hal/ah_debug.h Mon Jul 9 06:41:18 2012 (r238276) @@ -47,6 +47,11 @@ enum { HAL_DEBUG_DIVERSITY = 0x00100000, /* diversity debugging */ HAL_DEBUG_DFS = 0x00200000, /* DFS debugging */ HAL_DEBUG_HANG = 0x00400000, /* BB/MAC hang debugging */ + HAL_DEBUG_CALIBRATE = 0x00800000, /* setup calibration */ + HAL_DEBUG_POWER_MGMT = 0x01000000, /* power calibration */ + HAL_DEBUG_CHANNEL = 0x02000000, + HAL_DEBUG_QUEUE = 0x04000000, + HAL_DEBUG_PRINT_REG = 0x08000000, HAL_DEBUG_UNMASKABLE = 0x80000000, /* always printed */ HAL_DEBUG_ANY = 0xffffffff From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:16:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 408321065670; Mon, 9 Jul 2012 07:16:20 +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 29E5F8FC17; Mon, 9 Jul 2012 07:16:20 +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 q697GKWb001979; Mon, 9 Jul 2012 07:16:20 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q697GJ7A001973; Mon, 9 Jul 2012 07:16:19 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207090716.q697GJ7A001973@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 07:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:16:20 -0000 Author: hrs Date: Mon Jul 9 07:16:19 2012 New Revision: 238277 URL: http://svn.freebsd.org/changeset/base/238277 Log: Make ipfw0 logging pseudo-interface clonable. It can be created automatically by $firewall_logif rc.conf(5) variable at boot time or manually by ifconfig(8) after a boot. Discussed on: freebsd-ipfw@ Modified: head/etc/defaults/rc.conf head/etc/rc.d/ipfw head/sbin/ipfw/ipfw.8 head/share/man/man5/rc.conf.5 head/sys/netinet/ipfw/ip_fw_log.c Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Jul 9 06:41:18 2012 (r238276) +++ head/etc/defaults/rc.conf Mon Jul 9 07:16:19 2012 (r238277) @@ -123,6 +123,7 @@ firewall_script="/etc/rc.firewall" # Whi firewall_type="UNKNOWN" # Firewall type (see /etc/rc.firewall) firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="NO" # Set to YES to enable events logging +firewall_logif="NO" # Set to YES to create logging-pseudo interface firewall_flags="" # Flags passed to ipfw when type is a file firewall_coscripts="" # List of executables/scripts to run after # firewall starts/stops Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Jul 9 06:41:18 2012 (r238276) +++ head/etc/rc.d/ipfw Mon Jul 9 07:16:19 2012 (r238277) @@ -57,6 +57,10 @@ ipfw_start() echo 'Firewall logging enabled.' sysctl net.inet.ip.fw.verbose=1 >/dev/null fi + if checkyesno firewall_logif; then + ifconfig ipfw0 create + echo 'Firewall logging pseudo-interface (ipfw0) created.' + fi } ipfw_poststart() Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Jul 9 06:41:18 2012 (r238276) +++ head/sbin/ipfw/ipfw.8 Mon Jul 9 07:16:19 2012 (r238277) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2012 +.Dd July 9, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -560,7 +560,22 @@ is set to 0 (default), one can use .Xr bpf 4 attached to the .Li ipfw0 -pseudo interface. There is no overhead if no +pseudo interface. +This pseudo interface can be created after a boot +manually by using the following command: +.Bd -literal -offset indent +# ifconfig ipfw0 create +.Ed +.Pp +Or, automatically at boot time by adding the following +line to the +.Xr rc.conf 5 +file: +.Bd -literal -offset indent +firewall_logif="YES" +.Ed +.Pp +There is no overhead if no .Xr bpf 4 is attached to the pseudo interface. .Pp Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Jul 9 06:41:18 2012 (r238276) +++ head/share/man/man5/rc.conf.5 Mon Jul 9 07:16:19 2012 (r238277) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2012 +.Dd July 9, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -501,6 +501,16 @@ to enable firewall event logging. This is equivalent to the .Dv IPFIREWALL_VERBOSE kernel option. +.It Va firewall_logif +.Pq Vt bool +Set to +.Dq Li YES +to create pseudo interface +.Li ipfw0 +for logging. +For more details, see +.Xr ipfw 8 +manual page. .It Va firewall_flags .Pq Vt str Flags passed to Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Mon Jul 9 06:41:18 2012 (r238276) +++ head/sys/netinet/ipfw/ip_fw_log.c Mon Jul 9 07:16:19 2012 (r238277) @@ -44,8 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include /* for ETHERTYPE_IP */ #include +#include #include #include /* for IFT_ETHER */ #include /* for BPF */ @@ -90,6 +93,15 @@ ipfw_log_bpf(int onoff) } #else /* !WITHOUT_BPF */ static struct ifnet *log_if; /* hook to attach to bpf */ +static struct rwlock log_if_lock; +#define LOGIF_LOCK_INIT(x) rw_init(&log_if_lock, "ipfw log_if lock") +#define LOGIF_LOCK_DESTROY(x) rw_destroy(&log_if_lock) +#define LOGIF_RLOCK(x) rw_rlock(&log_if_lock) +#define LOGIF_RUNLOCK(x) rw_runlock(&log_if_lock) +#define LOGIF_WLOCK(x) rw_wlock(&log_if_lock) +#define LOGIF_WUNLOCK(x) rw_wunlock(&log_if_lock) + +#define IPFWNAME "ipfw" /* we use this dummy function for all ifnet callbacks */ static int @@ -116,37 +128,105 @@ ipfw_log_start(struct ifnet* ifp) static const u_char ipfwbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +static int +ipfw_log_clone_match(struct if_clone *ifc, const char *name) +{ + + return (strncmp(name, IPFWNAME, sizeof(IPFWNAME) - 1) == 0); +} + +static int +ipfw_log_clone_create(struct if_clone *ifc, char *name, size_t len, + caddr_t params) +{ + int error; + int unit; + struct ifnet *ifp; + + error = ifc_name2unit(name, &unit); + if (error) + return (error); + + error = ifc_alloc_unit(ifc, &unit); + if (error) + return (error); + + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + ifc_free_unit(ifc, unit); + return (ENOSPC); + } + ifp->if_dname = IPFWNAME; + ifp->if_dunit = unit; + snprintf(ifp->if_xname, IFNAMSIZ, "%s%d", IPFWNAME, unit); + strlcpy(name, ifp->if_xname, len); + ifp->if_mtu = 65536; + ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = (void *)log_dummy; + ifp->if_ioctl = log_dummy; + ifp->if_start = ipfw_log_start; + ifp->if_output = ipfw_log_output; + ifp->if_addrlen = 6; + ifp->if_hdrlen = 14; + ifp->if_broadcastaddr = ipfwbroadcastaddr; + ifp->if_baudrate = IF_Mbps(10); + + LOGIF_WLOCK(); + if (log_if == NULL) + log_if = ifp; + else { + LOGIF_WUNLOCK(); + if_free(ifp); + ifc_free_unit(ifc, unit); + return (EEXIST); + } + LOGIF_WUNLOCK(); + if_attach(ifp); + bpfattach(ifp, DLT_EN10MB, 14); + + return (0); +} + +static int +ipfw_log_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) +{ + int unit; + + if (ifp == NULL) + return (0); + + LOGIF_WLOCK(); + if (log_if != NULL && ifp == log_if) + log_if = NULL; + else { + LOGIF_WUNLOCK(); + return (EINVAL); + } + LOGIF_WUNLOCK(); + + unit = ifp->if_dunit; + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); + ifc_free_unit(ifc, unit); + + return (0); +} + +static struct if_clone ipfw_log_cloner = IFC_CLONE_INITIALIZER( + IPFWNAME, NULL, IF_MAXUNIT, + NULL, ipfw_log_clone_match, ipfw_log_clone_create, ipfw_log_clone_destroy); + void ipfw_log_bpf(int onoff) { - struct ifnet *ifp; if (onoff) { - if (log_if) - return; - ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return; - if_initname(ifp, "ipfw", 0); - ifp->if_mtu = 65536; - ifp->if_flags = IFF_UP | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_init = (void *)log_dummy; - ifp->if_ioctl = log_dummy; - ifp->if_start = ipfw_log_start; - ifp->if_output = ipfw_log_output; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; - if_attach(ifp); - ifp->if_broadcastaddr = ipfwbroadcastaddr; - ifp->if_baudrate = IF_Mbps(10); - bpfattach(ifp, DLT_EN10MB, 14); - log_if = ifp; + LOGIF_LOCK_INIT(); + if_clone_attach(&ipfw_log_cloner); } else { - if (log_if) { - ether_ifdetach(log_if); - if_free(log_if); - } - log_if = NULL; + if_clone_detach(&ipfw_log_cloner); + LOGIF_LOCK_DESTROY(); } } #endif /* !WITHOUT_BPF */ @@ -166,9 +246,11 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (V_fw_verbose == 0) { #ifndef WITHOUT_BPF - - if (log_if == NULL || log_if->if_bpf == NULL) + LOGIF_RLOCK(); + if (log_if == NULL || log_if->if_bpf == NULL) { + LOGIF_RUNLOCK(); return; + } if (args->eh) /* layer2, use orig hdr */ BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m); @@ -177,6 +259,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st * more info in the header. */ BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); + LOGIF_RUNLOCK(); #endif /* !WITHOUT_BPF */ return; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:19:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2FF911065673; Mon, 9 Jul 2012 07:19:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19A7F8FC14; Mon, 9 Jul 2012 07:19: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 q697JBiS002136; Mon, 9 Jul 2012 07:19:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q697JBn0002126; Mon, 9 Jul 2012 07:19:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090719.q697JBn0002126@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 07:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238278 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:19:12 -0000 Author: adrian Date: Mon Jul 9 07:19:11 2012 New Revision: 238278 URL: http://svn.freebsd.org/changeset/base/238278 Log: Extend the RX HAL API to include the RX queue identifier. The AR93xx and later chips support two RX FIFO queues - a high and low priority queue. For legacy chips, just assume the queues are high priority. This is inspired by the reference driver but is a reimplementation of the API and code. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 9 07:19:11 2012 (r238278) @@ -1078,8 +1078,8 @@ struct ath_hal { const struct ath_desc *ds, int *rates, int *tries); /* Receive Functions */ - uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*); - void __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp); + uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE); + void __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp, HAL_RX_QUEUE); void __ahdecl(*ah_enableReceive)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_stopDmaReceive)(struct ath_hal*); void __ahdecl(*ah_startPcuReceive)(struct ath_hal*); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Jul 9 07:19:11 2012 (r238278) @@ -180,8 +180,8 @@ extern void ar5210IntrReqTxDesc(struct extern HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *, int *rates, int *tries); -extern uint32_t ar5210GetRxDP(struct ath_hal *); -extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp); +extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE); +extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5210EnableReceive(struct ath_hal *); extern HAL_BOOL ar5210StopDmaReceive(struct ath_hal *); extern void ar5210StartPcuReceive(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c Mon Jul 9 07:19:11 2012 (r238278) @@ -30,8 +30,10 @@ * Get the RXDP. */ uint32_t -ar5210GetRxDP(struct ath_hal *ah) +ar5210GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); return OS_REG_READ(ah, AR_RXDP); } @@ -39,8 +41,10 @@ ar5210GetRxDP(struct ath_hal *ah) * Set the RxDP. */ void -ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp) +ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); OS_REG_WRITE(ah, AR_RXDP, rxdp); } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Jul 9 07:19:11 2012 (r238278) @@ -205,8 +205,8 @@ extern void ar5211IntrReqTxDesc(struct extern HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries); -extern uint32_t ar5211GetRxDP(struct ath_hal *); -extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp); +extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX_QUEUE); +extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5211EnableReceive(struct ath_hal *); extern HAL_BOOL ar5211StopDmaReceive(struct ath_hal *); extern void ar5211StartPcuReceive(struct ath_hal *); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c Mon Jul 9 07:19:11 2012 (r238278) @@ -30,8 +30,10 @@ * Get the RXDP. */ uint32_t -ar5211GetRxDP(struct ath_hal *ah) +ar5211GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); return OS_REG_READ(ah, AR_RXDP); } @@ -39,8 +41,10 @@ ar5211GetRxDP(struct ath_hal *ah) * Set the RxDP. */ void -ar5211SetRxDP(struct ath_hal *ah, uint32_t rxdp) +ar5211SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); OS_REG_WRITE(ah, AR_RXDP, rxdp); HALASSERT(OS_REG_READ(ah, AR_RXDP) == rxdp); } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Jul 9 07:19:11 2012 (r238278) @@ -519,8 +519,8 @@ extern HAL_BOOL ar5212SetPowerMode(struc extern HAL_POWER_MODE ar5212GetPowerMode(struct ath_hal *ah); extern HAL_BOOL ar5212GetPowerStatus(struct ath_hal *ah); -extern uint32_t ar5212GetRxDP(struct ath_hal *ath); -extern void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp); +extern uint32_t ar5212GetRxDP(struct ath_hal *ath, HAL_RX_QUEUE); +extern void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE); extern void ar5212EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar5212StopDmaReceive(struct ath_hal *ah); extern void ar5212StartPcuReceive(struct ath_hal *ah); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c Mon Jul 9 07:19:11 2012 (r238278) @@ -29,8 +29,10 @@ * Get the RXDP. */ uint32_t -ar5212GetRxDP(struct ath_hal *ath) +ar5212GetRxDP(struct ath_hal *ath, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); return OS_REG_READ(ath, AR_RXDP); } @@ -38,8 +40,10 @@ ar5212GetRxDP(struct ath_hal *ath) * Set the RxDP. */ void -ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp) +ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype) { + + HALASSERT(qtype == HAL_RX_QUEUE_HP); OS_REG_WRITE(ah, AR_RXDP, rxdp); HALASSERT(OS_REG_READ(ah, AR_RXDP) == rxdp); } Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/if_ath_rx.c Mon Jul 9 07:19:11 2012 (r238278) @@ -916,7 +916,7 @@ rx_proc_next: * Are there any net80211 buffer calls involved? */ bf = TAILQ_FIRST(&sc->sc_rxbuf); - ath_hal_putrxbuf(ah, bf->bf_daddr); + ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ @@ -1002,7 +1002,7 @@ ath_legacy_stoprecv(struct ath_softc *sc device_printf(sc->sc_dev, "%s: rx queue %p, link %p\n", __func__, - (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), + (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah, HAL_RX_QUEUE_HP), sc->sc_rxlink); ix = 0; TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { @@ -1046,7 +1046,7 @@ ath_legacy_startrecv(struct ath_softc *s } bf = TAILQ_FIRST(&sc->sc_rxbuf); - ath_hal_putrxbuf(ah, bf->bf_daddr); + ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 9 07:16:19 2012 (r238277) +++ head/sys/dev/ath/if_athvar.h Mon Jul 9 07:19:11 2012 (r238278) @@ -745,8 +745,8 @@ void ath_intr(void *); ((*(_ah)->ah_setMulticastFilter)((_ah), (_mfilt0), (_mfilt1))) #define ath_hal_waitforbeacon(_ah, _bf) \ ((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr)) -#define ath_hal_putrxbuf(_ah, _bufaddr) \ - ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr))) +#define ath_hal_putrxbuf(_ah, _bufaddr, _rxq) \ + ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr), (_rxq))) /* NB: common across all chips */ #define AR_TSF_L32 0x804c /* MAC local clock lower 32 bits */ #define ath_hal_gettsf32(_ah) \ @@ -763,8 +763,8 @@ void ath_intr(void *); ((*(_ah)->ah_getTxDP)((_ah), (_q))) #define ath_hal_numtxpending(_ah, _q) \ ((*(_ah)->ah_numTxPending)((_ah), (_q))) -#define ath_hal_getrxbuf(_ah) \ - ((*(_ah)->ah_getRxDP)((_ah))) +#define ath_hal_getrxbuf(_ah, _rxq) \ + ((*(_ah)->ah_getRxDP)((_ah), (_rxq))) #define ath_hal_txstart(_ah, _q) \ ((*(_ah)->ah_startTxDma)((_ah), (_q))) #define ath_hal_setchannel(_ah, _chan) \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8920106564A; Mon, 9 Jul 2012 07:23:55 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id C6DB88FC19; Mon, 9 Jul 2012 07:23:54 +0000 (UTC) Received: by eabm6 with SMTP id m6so4375689eab.13 for ; Mon, 09 Jul 2012 00:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=pSoSM/RnlWUSHZRFb261v9rB5GbUVUc4z4DAmfag3Pk=; b=zEDgAMeZ9OIzchn5aNX3eAM0NzxYsTpCwMYMFZjozxDWOaNlIyqNpZnKd0cczrWjAT 4k3I8a489CkxtrIWEy1obtJZz1O//VXeLh8NUEHvYcDMUftVyl25ZadGc4N2AwRQTnJ1 +fTkYzq7mLWHfa3ivKVlrCLnpIEz9AZYpZqe0S9cRr6ZOvFuIT/nvEAxc5XkOCYstWi+ /iUC7CzVu5hfFc+tfRrrbR87A6RiZwUIvdSRRB2Lo0bAOO0Dy6sJJzS/G9iNnpom3twc wT7rflCCv/J2m6Rhsz2iVm09Q3r6exYnqwE2hdJmtNJP5GYSgKOF4eMch5itTXcNO4WQ lRaw== Received: by 10.14.188.4 with SMTP id z4mr9403275eem.228.1341818628197; Mon, 09 Jul 2012 00:23:48 -0700 (PDT) Received: from apn-77-113-49-165.dynamic.gprs.plus.pl (apn-77-113-49-165.dynamic.gprs.plus.pl. [77.113.49.165]) by mx.google.com with ESMTPS id e48sm91189803eea.12.2012.07.09.00.23.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 00:23:47 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20120708213846.GF1437@garage.freebsd.pl> Date: Mon, 9 Jul 2012 09:19:29 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <739062A0-4339-46A3-AF8E-193BC57758BA@FreeBSD.org> References: <201207072013.q67KDfHN082943@svn.freebsd.org> <20120707215424.GE1437@garage.freebsd.pl> <280C8AEE-F7E8-4AAE-87BF-E59D0249B74F@FreeBSD.org> <20120708213846.GF1437@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238213 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:23:55 -0000 Wiadomo=B6=E6 napisana przez Pawel Jakub Dawidek w dniu 8 lip 2012, o = godz. 23:38: > On Sun, Jul 08, 2012 at 12:53:37AM +0200, Edward Tomasz Napiera=B3a = wrote: >> Wiadomo=B6=E6 napisana przez Pawel Jakub Dawidek w dniu 7 lip 2012, o = godz. 23:54: >>> You will also notice that one of those fields were left for more >>> universal method to handle various provider's property changes (ie. >>> provider's name, apart from its mediasize). The initial patch was = even >>> published a year ago: >>>=20 >>> = http://people.freebsd.org/~pjd/patches/geom_property_change.patch >>>=20 >>> Even if it was somehow totally not reusable it would at least give = you a >>> hint that mediasize is not the only thing that can change and if we = are >>> making that change it should be done right. >>=20 >> I was not aware of that patch. [...] >=20 > I'm afraid that's a lie. =46rom IRC logs: >=20 > rwatson: = http://people.freebsd.org/~pjd/patches/geom_property_change.patch > rwatson: Not tested. > pjd: shouldn't there also be a flag for geom to veto resizing? > pjd: for classes that can't handle their consumers changing = size? > [the discussion was pretty long] And when exactly was that? A year ago? >> [...] What I've considered was to use attributes >> instead, but that would complicate notifying consumers about resizing >> and would require some special-casing in the attribute code. >=20 > What attributes? The ones handled by BIO_GETATTR? They are about > something totally different. Yes, but they could be used to notify about mediasize change. Now, I'm not sure if I like your approach. You're trying to generalize from a single case. And even for that single case your approach would require a special case to retaste the provider after updating mediasize, and perhaps do the orphanisation stuff before. Also, why would we want this generalisation? Resize handling is = completely different from e.g. rename handling; why should we have a single method to do both? It's not that geom structures are like mbufs or vnodes, = where every byte counts. >>>> + G_VALID_PROVIDER(pp); >>>=20 >>> Is this your protection from a provider going away? >>=20 >> Can you suggest a way to do it in a safe way that doesn't involve >> rewriting most of GEOM? >=20 > I can only suggest not to rewrite GEOM because you didn't take the = time > to understand it. Let me quote a comment from the top of geom_event.c: /* * XXX: How do we in general know that objects referenced in events * have not been destroyed before we get around to handle the event ? */ So, can you suggest a way to do it in a safe way that doesn't involve rewriting most of GEOM? >>> Why is this safe to call the orphan method directly and not use >>> g_orphan_provider()? I don't know if using g_orphan_provider() is = safe >>> to use here either, but I'm under impression that you assume no = orphan >>> method will ever drop the topology lock? We have tools to assert = that, >>> no need to introduce such weak assumptions. >>=20 >> It's not that using g_orphan_provider() would be safer here - it = simply >> wouldn't work. The way it works is by adding providers to a queue >> (g_doorstep). _Providers_, and we need to orphan individual = consumers. >> So, this would involve rewriting the orphanisation mechanism. Also, >> most of the classes were fixed by mav@ to handle this correctly, = IIRC. >=20 > By introducing such hacks you make the code unpredictable. The way > g_orphan_provider() works is more than just calling geom's orphan > method. Also, until now, when orphan method was called it meant that > provider is going away, which is not true anymore. I'd like to believe > that you carefully analysed what you changed here is safe, but based = on > your understanding of GEOM, I doubt that. Look, I really appreciate you're looking at this just six months after explicitly refusing to talk to me about the design, but it would be = great if it was a _technical_ discussion. Now, the only reason for the orphaning during resizing is backward compatibility with classes that don't know anything about the resize() method, to make sure the provider doesn't get shrunk without them = knowing.=20 Your patch didn't do that, and perhaps we could just get rid of it. I think the current approach is safer, though. --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:25:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24D461065674; Mon, 9 Jul 2012 07:25:10 +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 0E8698FC12; Mon, 9 Jul 2012 07:25:10 +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 q697P9lD002536; Mon, 9 Jul 2012 07:25:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q697P9uQ002533; Mon, 9 Jul 2012 07:25:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207090725.q697P9uQ002533@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 07:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238279 - in head: sys/dev/usb usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:25:10 -0000 Author: hrs Date: Mon Jul 9 07:25:09 2012 New Revision: 238279 URL: http://svn.freebsd.org/changeset/base/238279 Log: Make usbusN logging pseudo-interface used by usbdump(8) clonable. One is now created/destroyed automatically by usbdump(8). Note that "hw.usb.no_pf" loader tunable is now obsolete. Reviewed by: hselasky Modified: head/sys/dev/usb/usb_pf.c head/usr.sbin/usbdump/usbdump.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Mon Jul 9 07:19:11 2012 (r238278) +++ head/sys/dev/usb/usb_pf.c Mon Jul 9 07:25:09 2012 (r238279) @@ -44,8 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -58,35 +60,144 @@ __FBSDID("$FreeBSD$"); #include #include -static int usb_no_pf; +#define USBUSNAME "usbus" -SYSCTL_INT(_hw_usb, OID_AUTO, no_pf, CTLFLAG_RW, - &usb_no_pf, 0, "Set to disable USB packet filtering"); +static void usbpf_init(void); +static void usbpf_uninit(void); +static int usbpf_ioctl(struct ifnet *, u_long, caddr_t); +static int usbpf_clone_match(struct if_clone *, const char *); +static int usbpf_clone_create(struct if_clone *, char *, size_t, caddr_t); +static int usbpf_clone_destroy(struct if_clone *, struct ifnet *); +static struct usb_bus *usbpf_ifname2ubus(const char *); +static uint32_t usbpf_aggregate_xferflags(struct usb_xfer_flags *); +static uint32_t usbpf_aggregate_status(struct usb_xfer_flags_int *); +static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t); +static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int); + +static struct if_clone usbpf_cloner = IFC_CLONE_INITIALIZER( + USBUSNAME, NULL, IF_MAXUNIT, + NULL, usbpf_clone_match, usbpf_clone_create, usbpf_clone_destroy); -TUNABLE_INT("hw.usb.no_pf", &usb_no_pf); +SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL); +SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL); -void -usbpf_attach(struct usb_bus *ubus) +static void +usbpf_init(void) { - struct ifnet *ifp; - if (usb_no_pf != 0) { - ubus->ifp = NULL; + if_clone_attach(&usbpf_cloner); +} + +static void +usbpf_uninit(void) +{ + int devlcnt; + device_t *devlp; + devclass_t dc; + struct usb_bus *ubus; + int error; + int i; + + if_clone_detach(&usbpf_cloner); + + dc = devclass_find(USBUSNAME); + if (dc == NULL) return; + error = devclass_get_devices(dc, &devlp, &devlcnt); + if (error) + return; + for (i = 0; i < devlcnt; i++) { + ubus = device_get_softc(devlp[i]); + if (ubus != NULL && ubus->ifp != NULL) + usbpf_clone_destroy(&usbpf_cloner, ubus->ifp); } +} + +static int +usbpf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + + /* No configuration allowed. */ + return (EINVAL); +} + +static struct usb_bus * +usbpf_ifname2ubus(const char *ifname) +{ + device_t dev; + devclass_t dc; + int unit; + int error; + + if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME)) <= 0) + return (NULL); + error = ifc_name2unit(ifname, &unit); + if (error || unit < 0) + return (NULL); + dc = devclass_find(USBUSNAME); + if (dc == NULL) + return (NULL); + dev = devclass_get_device(dc, unit); + if (dev == NULL) + return (NULL); + + return (device_get_softc(dev)); +} + +static int +usbpf_clone_match(struct if_clone *ifc, const char *name) +{ + struct usb_bus *ubus; + + ubus = usbpf_ifname2ubus(name); + if (ubus == NULL) + return (0); + if (ubus->ifp != NULL) + return (0); + + return (1); +} + +static int +usbpf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) +{ + int error; + int unit; + struct ifnet *ifp; + struct usb_bus *ubus; + error = ifc_name2unit(name, &unit); + if (error || unit < 0) + return (error); + + ubus = usbpf_ifname2ubus(name); + if (ubus == NULL) + return (1); + if (ubus->ifp != NULL) + return (1); + + error = ifc_alloc_unit(ifc, &unit); + if (error) { + ifc_free_unit(ifc, unit); + device_printf(ubus->parent, "usbpf: Could not allocate " + "instance\n"); + return (error); + } ifp = ubus->ifp = if_alloc(IFT_USB); if (ifp == NULL) { + ifc_free_unit(ifc, unit); device_printf(ubus->parent, "usbpf: Could not allocate " "instance\n"); - return; + return (ENOSPC); } - - if_initname(ifp, "usbus", device_get_unit(ubus->bdev)); - ifp->if_flags = IFF_CANTCONFIG; + strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); + ifp->if_softc = ubus; + ifp->if_dname = ifc->ifc_name; + ifp->if_dunit = unit; + ifp->if_ioctl = usbpf_ioctl; if_attach(ifp); - if_up(ifp); - + ifp->if_flags |= IFF_UP; + rt_ifmsg(ifp); /* * XXX According to the specification of DLT_USB, it indicates * packets beginning with USB setup header. But not sure all @@ -94,6 +205,31 @@ usbpf_attach(struct usb_bus *ubus) */ bpfattach(ifp, DLT_USB, USBPF_HDR_LEN); + return (0); +} + +static int +usbpf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) +{ + struct usb_bus *ubus; + int unit; + + ubus = ifp->if_softc; + unit = ifp->if_dunit; + + ubus->ifp = NULL; + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); + ifc_free_unit(ifc, unit); + + return (0); +} + +void +usbpf_attach(struct usb_bus *ubus) +{ + if (bootverbose) device_printf(ubus->parent, "usbpf: Attached\n"); } @@ -101,15 +237,11 @@ usbpf_attach(struct usb_bus *ubus) void usbpf_detach(struct usb_bus *ubus) { - struct ifnet *ifp = ubus->ifp; - if (ifp != NULL) { - bpfdetach(ifp); - if_down(ifp); - if_detach(ifp); - if_free(ifp); - } - ubus->ifp = NULL; + if (ubus->ifp != NULL) + usbpf_clone_destroy(&usbpf_cloner, ubus->ifp); + if (bootverbose) + device_printf(ubus->parent, "usbpf: Detached\n"); } static uint32_t @@ -259,8 +391,6 @@ usbpf_xfertap(struct usb_xfer *xfer, int bus = xfer->xroot->bus; /* sanity checks */ - if (usb_no_pf != 0) - return; if (bus->ifp == NULL) return; if (!bpf_peers_present(bus->ifp->if_bpf)) Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Mon Jul 9 07:19:11 2012 (r238278) +++ head/usr.sbin/usbdump/usbdump.c Mon Jul 9 07:25:09 2012 (r238279) @@ -795,6 +795,8 @@ main(int argc, char *argv[]) int o; int filt_unit; int filt_ep; + int s; + int ifindex; const char *optstring; char *pp; @@ -887,9 +889,20 @@ main(int argc, char *argv[]) /* clear ifr structure */ memset(&ifr, 0, sizeof(ifr)); + /* Try to create usbusN interface if it is not available. */ + s = socket(AF_LOCAL, SOCK_DGRAM, 0); + if (s < 0) + errx(EXIT_FAILURE, "Could not open a socket"); + ifindex = if_nametoindex(i_arg); + if (ifindex == 0) { + (void)strlcpy(ifr.ifr_name, i_arg, sizeof(ifr.ifr_name)); + if (ioctl(s, SIOCIFCREATE2, &ifr) < 0) + errx(EXIT_FAILURE, "Invalid bus interface: %s", i_arg); + } + for ( ; v >= USBPF_HDR_LEN; v >>= 1) { (void)ioctl(fd, BIOCSBLEN, (caddr_t)&v); - (void)strncpy(ifr.ifr_name, i_arg, sizeof(ifr.ifr_name)); + (void)strlcpy(ifr.ifr_name, i_arg, sizeof(ifr.ifr_name)); if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) >= 0) break; } @@ -930,6 +943,17 @@ main(int argc, char *argv[]) printf("%d packets received by filter\n", us.bs_recv); printf("%d packets dropped by kernel\n", us.bs_drop); + /* + * Destroy the usbusN interface only if it was created by + * usbdump(8). Ignore when it was already destroyed. + */ + if (ifindex == 0 && if_nametoindex(i_arg) > 0) { + (void)strlcpy(ifr.ifr_name, i_arg, sizeof(ifr.ifr_name)); + if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) + warn("SIOCIFDESTROY ioctl failed"); + } + close(s); + if (p->fd > 0) close(p->fd); if (p->rfd > 0) From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:31:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73C20106566B; Mon, 9 Jul 2012 07:31:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54AC28FC16; Mon, 9 Jul 2012 07:31:27 +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 q697VRNa002840; Mon, 9 Jul 2012 07:31:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q697VRQ6002836; Mon, 9 Jul 2012 07:31:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090731.q697VRQ6002836@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 07:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238280 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:31:27 -0000 Author: adrian Date: Mon Jul 9 07:31:26 2012 New Revision: 238280 URL: http://svn.freebsd.org/changeset/base/238280 Log: Introduce the EDMA related HAL capabilities. Whilst here, fix a typo in a previous commit. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Jul 9 07:25:09 2012 (r238279) +++ head/sys/dev/ath/ath_hal/ah.c Mon Jul 9 07:31:26 2012 (r238280) @@ -619,6 +619,33 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_EXT_CHAN_DFS: return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_NUM_TXMAPS: + *result = pCap->halNumTxMaps; + return HAL_OK; + case HAL_CAP_TXDESCLEN: + *result = pCap->halTxDescLen; + return HAL_OK; + case HAL_CAP_TXSTATUSLEN: + *result = pCap->halTxStatusLen; + return HAL_OK; + case HAL_CAP_RXSTATUSLEN: + *result = pCap->halRxStatusLen; + return HAL_OK; + case HAL_CAP_RXFIFODEPTH: + switch (capability) { + case HAL_RX_QUEUE_HP: + *result = pCap->halRxHpFifoDepth; + return HAL_OK; + case HAL_RX_QUEUE_LP: + *result = pCap->halRxLpFifoDepth; + return HAL_OK; + default: + return HAL_ENOTSUPP; + } + case HAL_CAP_RXBUFSIZE: + case HAL_CAP_NUM_MR_RETRIES: + return HAL_EINVAL; /* XXX not yet */ + case HAL_CAP_COMBINED_RADAR_RSSI: return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_AUTO_SLEEP: @@ -667,6 +694,8 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halHasBBReadWar? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */ return pCap->halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_ENHANCED_DMA_SUPPORT: + return pCap->halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP; default: return HAL_EINVAL; } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Jul 9 07:25:09 2012 (r238279) +++ head/sys/dev/ath/ath_hal/ah.h Mon Jul 9 07:31:26 2012 (r238280) @@ -149,9 +149,14 @@ typedef enum { HAL_CAP_TS = 72, /* 3 stream */ HAL_CAP_ENHANCED_DMA_SUPPORT = 75, /* DMA FIFO support */ + HAL_CAP_NUM_TXMAPS = 76, /* Number of buffers in a transmit descriptor */ + HAL_CAP_TXDESCLEN = 77, /* Length of transmit descriptor */ + HAL_CAP_TXSTATUSLEN = 78, /* Length of transmit status descriptor */ + HAL_CAP_RXSTATUSLEN = 79, /* Length of transmit status descriptor */ + HAL_CAP_RXFIFODEPTH = 80, /* Receive hardware FIFO depth */ + HAL_CAP_RXBUFSIZE = 81, /* Receive Buffer Length */ + HAL_CAP_NUM_MR_RETRIES = 82, /* limit on multirate retries */ - HAL_CAP_RXBUFSIZE = 81, - HAL_CAP_NUM_MR_RETRIES = 82, HAL_CAP_OL_PWRCTRL = 84, /* Open loop TX power control */ HAL_CAP_BB_PANIC_WATCHDOG = 92, @@ -210,7 +215,7 @@ typedef enum { typedef enum { HAL_RX_QUEUE_HP = 0, /* high priority recv queue */ - HAL_RX_QUEUE_LP = 0, /* low priority recv queue */ + HAL_RX_QUEUE_LP = 1, /* low priority recv queue */ } HAL_RX_QUEUE; #define HAL_NUM_RX_QUEUES 2 /* max possible # of queues */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 9 07:25:09 2012 (r238279) +++ head/sys/dev/ath/if_athvar.h Mon Jul 9 07:31:26 2012 (r238280) @@ -953,11 +953,34 @@ void ath_intr(void *); #define ath_hal_setintmit(_ah, _v) \ ath_hal_setcapability(_ah, HAL_CAP_INTMIT, \ HAL_CAP_INTMIT_ENABLE, _v, NULL) + +/* EDMA definitions */ #define ath_hal_hasedma(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_ENHANCED_DMA_SUPPORT, \ 0, NULL) == HAL_OK) +#define ath_hal_getrxfifodepth(_ah, _qtype, _req) \ + (ath_hal_getcapability(_ah, HAL_CAP_RXFIFODEPTH, _qtype, _req) \ + == HAL_OK) +#define ath_hal_getntxmaps(_ah, _req) \ + (ath_hal_getcapability(_ah, HAL_CAP_NUM_TXMAPS, 0, _req) \ + == HAL_OK) +#define ath_hal_gettxdesclen(_ah, _req) \ + (ath_hal_getcapability(_ah, HAL_CAP_TXDESCLEN, 0, _req) \ + == HAL_OK) +#define ath_hal_gettxstatuslen(_ah, _req) \ + (ath_hal_getcapability(_ah, HAL_CAP_TXSTATUSLEN, 0, _req) \ + == HAL_OK) +#define ath_hal_getrxstatuslen(_ah, _req) \ + (ath_hal_getcapability(_ah, HAL_CAP_RXSTATUSLEN, 0, _req) \ + == HAL_OK) +#define ath_hal_setrxbufsize(_ah, _req) \ + (ath_hal_setcapability(_ah, HAL_CAP_RXBUFSIZE, 0, _req, NULL) \ + == HAL_OK) + #define ath_hal_getchannoise(_ah, _c) \ ((*(_ah)->ah_getChanNoise)((_ah), (_c))) + +/* 802.11n HAL methods */ #define ath_hal_getrxchainmask(_ah, _prxchainmask) \ (ath_hal_getcapability(_ah, HAL_CAP_RX_CHAINMASK, 0, _prxchainmask)) #define ath_hal_gettxchainmask(_ah, _ptxchainmask) \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:33:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E44E106564A; Mon, 9 Jul 2012 07:33:39 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2482B8FC12; Mon, 9 Jul 2012 07:33:39 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1So8W8-0007cb-NK; Mon, 09 Jul 2012 11:36:24 +0400 Message-ID: <4FFA894D.9050104@FreeBSD.org> Date: Mon, 09 Jul 2012 11:33:33 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120121 Thunderbird/9.0 MIME-Version: 1.0 To: Hiroki Sato References: <201207090716.q697GJ7A001973@svn.freebsd.org> In-Reply-To: <201207090716.q697GJ7A001973@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:33:39 -0000 On 09.07.2012 11:16, Hiroki Sato wrote: > Author: hrs > Date: Mon Jul 9 07:16:19 2012 > New Revision: 238277 > URL: http://svn.freebsd.org/changeset/base/238277 > > Log: > Make ipfw0 logging pseudo-interface clonable. It can be created automatically > by $firewall_logif rc.conf(5) variable at boot time or manually by ifconfig(8) > after a boot. > > Discussed on: freebsd-ipfw@ Em, well, I thought "discussed" means some kind of consensus? There was an alternative implementation proposed in -ipfw with no comments from you side. Additionally, there can be other (still not discussed) solutions like making this interface as loadable module (like pf do). > From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 07:37:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EFE6106566B; Mon, 9 Jul 2012 07:37:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4F88FC1C; Mon, 9 Jul 2012 07:37:10 +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 q697bAjw003122; Mon, 9 Jul 2012 07:37:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q697bA1d003120; Mon, 9 Jul 2012 07:37:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201207090737.q697bA1d003120@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 9 Jul 2012 07:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238281 - head/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 07:37:10 -0000 Author: ae Date: Mon Jul 9 07:37:10 2012 New Revision: 238281 URL: http://svn.freebsd.org/changeset/base/238281 Log: We don't need to check the result of sending signal when -R option is specified. Submitted by: Ilya A. Arkhipov MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Mon Jul 9 07:31:26 2012 (r238280) +++ head/usr.sbin/newsyslog/newsyslog.c Mon Jul 9 07:37:10 2012 (r238281) @@ -1972,7 +1972,8 @@ do_zipwork(struct zipwork_entry *zwork) else pgm_name++; - if (zwork->zw_swork != NULL && zwork->zw_swork->sw_pidok <= 0) { + if (zwork->zw_swork != NULL && zwork->zw_swork->run_cmd == 0 && + zwork->zw_swork->sw_pidok <= 0) { warnx( "log %s not compressed because daemon(s) not notified", zwork->zw_fname); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:09:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06B261065670; Mon, 9 Jul 2012 08:09:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9038FC12; Mon, 9 Jul 2012 08:09:46 +0000 (UTC) Received: from alph.allbsd.org (p2214-ipbf2707funabasi.chiba.ocn.ne.jp [123.225.119.214]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id q6989Lfn035646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Jul 2012 17:09:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id q6989J8u070102; Mon, 9 Jul 2012 17:09:20 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 09 Jul 2012 17:08:13 +0900 (JST) Message-Id: <20120709.170813.339720376082380726.hrs@allbsd.org> To: melifaro@FreeBSD.org From: Hiroki Sato In-Reply-To: <4FFA894D.9050104@FreeBSD.org> References: <201207090716.q697GJ7A001973@svn.freebsd.org> <4FFA894D.9050104@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jul__9_17_08_13_2012_866)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 09 Jul 2012 17:09:36 +0900 (JST) X-Spam-Status: No, score=-96.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT, RCVD_IN_RP_RNBL, SAMEHELOBY2HOP, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:09:49 -0000 ----Security_Multipart(Mon_Jul__9_17_08_13_2012_866)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Alexander V. Chernikov" wrote in <4FFA894D.9050104@FreeBSD.org>: me> On 09.07.2012 11:16, Hiroki Sato wrote: me> > Author: hrs me> > Date: Mon Jul 9 07:16:19 2012 me> > New Revision: 238277 me> > URL: http://svn.freebsd.org/changeset/base/238277 me> > me> > Log: me> > Make ipfw0 logging pseudo-interface clonable. It can be created me> > automatically me> > by $firewall_logif rc.conf(5) variable at boot time or manually by me> > ifconfig(8) me> > after a boot. me> > me> > Discussed on: freebsd-ipfw@ me> Em, well, I thought "discussed" means some kind of consensus? me> There was an alternative implementation proposed in -ipfw with no me> comments from you side. Additionally, there can be other (still not me> discussed) solutions like making this interface as loadable module me> (like pf do). I meant there was no strong objection. I am sorry for not commenting your implementation, but at least for ipfw0 it is difficult to decouple ifnet and bpf because the primary consumer is tcpdump(8), which depends on NET_RT_IFLIST to find the target. Probably your solution can be used for usbdump(8). The reason why I committed the patch now is there are reports that these pseudo interfaces made some applications confused and/or caused some performance degradation on 9.0R, and wanted to fix it in some way. I am still open for more sophisticated implementation and have no objection to replace mine with it. Do you have an idea about converting it with a loadable module? -- Hiroki ----Security_Multipart(Mon_Jul__9_17_08_13_2012_866)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk/6kW0ACgkQTyzT2CeTzy2FygCgkA6HqiidVRcLOgXBA+Aipi3H Vp4AoNE4Tfbhmi4xE3n/IzPe1+K9jr65 =Qzyy -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jul__9_17_08_13_2012_866)---- From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:11:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F0F11065672; Mon, 9 Jul 2012 08:11:17 +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 78AD68FC08; Mon, 9 Jul 2012 08:11: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 q698BHFP004557; Mon, 9 Jul 2012 08:11:17 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q698BHEt004552; Mon, 9 Jul 2012 08:11:17 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207090811.q698BHEt004552@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 08:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238282 - in head: etc/rc.d usr.sbin/rarpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:11:17 -0000 Author: hrs Date: Mon Jul 9 08:11:16 2012 New Revision: 238282 URL: http://svn.freebsd.org/changeset/base/238282 Log: - Add IFT_L2VLAN (vlan(4)) support. - Add -P option to support PID file. When -a is specified /var/run/rarpd.pid is used, and when an interface is specified /var/run/rarpd..pid is used by default. Modified: head/etc/rc.d/rarpd head/usr.sbin/rarpd/Makefile head/usr.sbin/rarpd/rarpd.8 head/usr.sbin/rarpd/rarpd.c Modified: head/etc/rc.d/rarpd ============================================================================== --- head/etc/rc.d/rarpd Mon Jul 9 07:37:10 2012 (r238281) +++ head/etc/rc.d/rarpd Mon Jul 9 08:11:16 2012 (r238282) @@ -13,8 +13,9 @@ name="rarpd" rcvar="rarpd_enable" command="/usr/sbin/${name}" -pidfile="/var/run/${name}.pid" required_files="/etc/ethers" load_rc_config $name +pidfile="${rarpd_pidfile:-/var/run/${name}.pid}" + run_rc_command "$1" Modified: head/usr.sbin/rarpd/Makefile ============================================================================== --- head/usr.sbin/rarpd/Makefile Mon Jul 9 07:37:10 2012 (r238281) +++ head/usr.sbin/rarpd/Makefile Mon Jul 9 08:11:16 2012 (r238282) @@ -4,6 +4,9 @@ PROG= rarpd MAN= rarpd.8 +DPADD= ${LIBUTIL} +LDADD= -lutil + WARNS?= 3 # This breaks with format strings returned by expand_syslog_m().. argh! #FORMAT_AUDIT?= 1 Modified: head/usr.sbin/rarpd/rarpd.8 ============================================================================== --- head/usr.sbin/rarpd/rarpd.8 Mon Jul 9 07:37:10 2012 (r238281) +++ head/usr.sbin/rarpd/rarpd.8 Mon Jul 9 08:11:16 2012 (r238282) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2001 +.Dd July 9, 2012 .Dt RARPD 8 .Os .Sh NAME @@ -27,9 +27,11 @@ .Fl a .Op Fl dfsv .Op Fl t Ar directory +.Op Fl P Ar pidfile .Nm .Op Fl dfsv .Op Fl t Ar directory +.Op Fl P Ar pidfile .Ar interface .Sh DESCRIPTION The @@ -92,6 +94,15 @@ instead of via .Xr syslog 3 . .It Fl f Run in the foreground. +.It Fl P +Specify the pathname of the PID file. +If not specified, +.Pa /var/run/rarpd.pid +or +.Pa /var/run/rarpd.ifname.pid +will be used depending on the +.Fl a +flag or the specified interface name. .It Fl s Supply a response to any RARP request for which an ethernet to IP address mapping exists; do not depend on the existence of @@ -115,6 +126,7 @@ Enable verbose syslogging. .It Pa /etc/ethers .It Pa /etc/hosts .It Pa /tftpboot +.It Pa /var/run/rarpd.pid .El .Sh SEE ALSO .Xr bpf 4 Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Mon Jul 9 07:37:10 2012 (r238281) +++ head/usr.sbin/rarpd/rarpd.c Mon Jul 9 08:11:16 2012 (r238282) @@ -27,8 +27,8 @@ __FBSDID("$FreeBSD$"); /* * rarpd - Reverse ARP Daemon * - * Usage: rarpd -a [-dfsv] [-t directory] [hostname] - * rarpd [-dfsv] [-t directory] interface [hostname] + * Usage: rarpd -a [-dfsv] [-t directory] [-P pidfile] [hostname] + * rarpd [-dfsv] [-t directory] [-P pidfile] interface [hostname] * * 'hostname' is optional solely for backwards compatibility with Sun's rarpd. * Currently, the argument is ignored. @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* Cast a struct sockaddr to a struct sockaddr_in */ #define SATOSIN(sa) ((struct sockaddr_in *)(sa)) @@ -99,6 +100,11 @@ int sflag; /* ignore /tftpboot */ static u_char zero[6]; +static char pidfile_buf[PATH_MAX]; +static char *pidfile; +#define RARPD_PIDFILE "/var/run/rarpd.%s.pid" +static struct pidfh *pidfile_fh; + static int bpf_open(void); static in_addr_t choose_ipaddr(in_addr_t **, in_addr_t, in_addr_t); static char *eatoa(u_char *); @@ -140,7 +146,7 @@ main(int argc, char *argv[]) openlog(name, LOG_PID | LOG_CONS, LOG_DAEMON); opterr = 0; - while ((op = getopt(argc, argv, "adfst:v")) != -1) + while ((op = getopt(argc, argv, "adfsP:t:v")) != -1) switch (op) { case 'a': ++aflag; @@ -158,6 +164,12 @@ main(int argc, char *argv[]) ++sflag; break; + case 'P': + strncpy(pidfile_buf, optarg, sizeof(pidfile_buf) - 1); + pidfile_buf[sizeof(pidfile_buf) - 1] = '\0'; + pidfile = pidfile_buf; + break; + case 't': tftp_dir = optarg; break; @@ -181,10 +193,23 @@ main(int argc, char *argv[]) init(ifname); if (!fflag) { + if (pidfile == NULL && ifname != NULL && aflag == 0) { + snprintf(pidfile_buf, sizeof(pidfile_buf) - 1, + RARPD_PIDFILE, ifname); + pidfile_buf[sizeof(pidfile_buf) - 1] = '\0'; + pidfile = pidfile_buf; + } + /* If pidfile == NULL, /var/run/.pid will be used. */ + pidfile_fh = pidfile_open(pidfile, 0600, NULL); + if (pidfile_fh == NULL) + logmsg(LOG_ERR, "Cannot open or create pidfile: %s", + (pidfile == NULL) ? "/var/run/rarpd.pid" : pidfile); if (daemon(0,0)) { logmsg(LOG_ERR, "cannot fork"); + pidfile_remove(pidfile_fh); exit(1); } + pidfile_write(pidfile_fh); } rarp_loop(); return(0); @@ -234,6 +259,7 @@ init_one(struct ifaddrs *ifa, char *targ ii = (struct if_info *)malloc(sizeof(*ii)); if (ii == NULL) { logmsg(LOG_ERR, "malloc: %m"); + pidfile_remove(pidfile_fh); exit(1); } bzero(ii, sizeof(*ii)); @@ -251,6 +277,7 @@ init_one(struct ifaddrs *ifa, char *targ ii2 = (struct if_info *)malloc(sizeof(*ii2)); if (ii2 == NULL) { logmsg(LOG_ERR, "malloc: %m"); + pidfile_remove(pidfile_fh); exit(1); } memcpy(ii2, ii, sizeof(*ii2)); @@ -273,8 +300,11 @@ init_one(struct ifaddrs *ifa, char *targ case AF_LINK: ll = (struct sockaddr_dl *)ifa->ifa_addr; - if (ll->sdl_type == IFT_ETHER) + switch (ll->sdl_type) { + case IFT_ETHER: + case IFT_L2VLAN: bcopy(LLADDR(ll), ii->ii_eaddr, 6); + } break; } } @@ -293,6 +323,7 @@ init(char *target) error = getifaddrs(&ifhead); if (error) { logmsg(LOG_ERR, "getifaddrs: %m"); + pidfile_remove(pidfile_fh); exit(1); } /* @@ -339,8 +370,8 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: rarpd -a [-dfsv] [-t directory]", - " rarpd [-dfsv] [-t directory] interface"); + "usage: rarpd -a [-dfsv] [-t directory] [-P pidfile]", + " rarpd [-dfsv] [-t directory] [-P pidfile] interface"); exit(1); } @@ -361,6 +392,7 @@ bpf_open(void) if (fd == -1) { logmsg(LOG_ERR, "%s: %m", device); + pidfile_remove(pidfile_fh); exit(1); } return fd; @@ -399,12 +431,12 @@ rarp_open(char *device) immediate = 1; if (ioctl(fd, BIOCIMMEDIATE, &immediate) == -1) { logmsg(LOG_ERR, "BIOCIMMEDIATE: %m"); - exit(1); + goto rarp_open_err; } strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); if (ioctl(fd, BIOCSETIF, (caddr_t)&ifr) == -1) { logmsg(LOG_ERR, "BIOCSETIF: %m"); - exit(1); + goto rarp_open_err; } /* * Check that the data link layer is an Ethernet; this code won't @@ -412,20 +444,24 @@ rarp_open(char *device) */ if (ioctl(fd, BIOCGDLT, (caddr_t)&dlt) == -1) { logmsg(LOG_ERR, "BIOCGDLT: %m"); - exit(1); + goto rarp_open_err; } if (dlt != DLT_EN10MB) { logmsg(LOG_ERR, "%s is not an ethernet", device); - exit(1); + goto rarp_open_err; } /* * Set filter program. */ if (ioctl(fd, BIOCSETF, (caddr_t)&filter) == -1) { logmsg(LOG_ERR, "BIOCSETF: %m"); - exit(1); + goto rarp_open_err; } return fd; + +rarp_open_err: + pidfile_remove(pidfile_fh); + exit(1); } /* @@ -480,16 +516,16 @@ rarp_loop(void) if (iflist == NULL) { logmsg(LOG_ERR, "no interfaces"); - exit(1); + goto rarpd_loop_err; } if (ioctl(iflist->ii_fd, BIOCGBLEN, (caddr_t)&bufsize) == -1) { logmsg(LOG_ERR, "BIOCGBLEN: %m"); - exit(1); + goto rarpd_loop_err; } buf = malloc(bufsize); if (buf == NULL) { logmsg(LOG_ERR, "malloc: %m"); - exit(1); + goto rarpd_loop_err; } while (1) { @@ -509,7 +545,7 @@ rarp_loop(void) if (errno == EINTR) continue; logmsg(LOG_ERR, "select: %m"); - exit(1); + goto rarpd_loop_err; } for (ii = iflist; ii != NULL; ii = ii->ii_next) { fd = ii->ii_fd; @@ -537,6 +573,11 @@ rarp_loop(void) } } #undef bhp + return; + +rarpd_loop_err: + pidfile_remove(pidfile_fh); + exit(1); } /* @@ -562,12 +603,12 @@ rarp_bootable(in_addr_t addr) else { if (chdir(tftp_dir) == -1) { logmsg(LOG_ERR, "chdir: %s: %m", tftp_dir); - exit(1); + goto rarp_bootable_err; } d = opendir("."); if (d == NULL) { logmsg(LOG_ERR, "opendir: %m"); - exit(1); + goto rarp_bootable_err; } dd = d; } @@ -575,6 +616,10 @@ rarp_bootable(in_addr_t addr) if (strncmp(dent->d_name, ipname, 8) == 0) return 1; return 0; + +rarp_bootable_err: + pidfile_remove(pidfile_fh); + exit(1); } /* @@ -678,6 +723,7 @@ update_arptab(u_char *ep, in_addr_t ipad r = socket(PF_ROUTE, SOCK_RAW, 0); if (r == -1) { logmsg(LOG_ERR, "raw route socket: %m"); + pidfile_remove(pidfile_fh); exit(1); } pid = getpid(); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:27:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFADE106564A; Mon, 9 Jul 2012 08:27:05 +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 6AD378FC12; Mon, 9 Jul 2012 08:27:05 +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 q698R5TP005283; Mon, 9 Jul 2012 08:27:05 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q698R5Yt005281; Mon, 9 Jul 2012 08:27:05 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207090827.q698R5Yt005281@svn.freebsd.org> From: Robert Watson Date: Mon, 9 Jul 2012 08:27: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: r238283 - stable/9/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:27:05 -0000 Author: rwatson Date: Mon Jul 9 08:27:04 2012 New Revision: 238283 URL: http://svn.freebsd.org/changeset/base/238283 Log: Merge r229521 from head to stable/9: Add missing -w to kgdb(1)'s usage(). Sponsored by: Adara Networks, Inc. Approved by: re (kib) Modified: stable/9/gnu/usr.bin/gdb/kgdb/main.c Directory Properties: stable/9/gnu/usr.bin/gdb/kgdb/ (props changed) Modified: stable/9/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- stable/9/gnu/usr.bin/gdb/kgdb/main.c Mon Jul 9 08:11:16 2012 (r238282) +++ stable/9/gnu/usr.bin/gdb/kgdb/main.c Mon Jul 9 08:27:04 2012 (r238283) @@ -83,7 +83,7 @@ usage(void) { fprintf(stderr, - "usage: %s [-afqv] [-d crashdir] [-c core | -n dumpnr | -r device]\n" + "usage: %s [-afqvw] [-d crashdir] [-c core | -n dumpnr | -r device]\n" "\t[kernel [core]]\n", getprogname()); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:32:41 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B64106566B; Mon, 9 Jul 2012 08:32:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id B240B8FC12; Mon, 9 Jul 2012 08:32:40 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1So9RG-00080m-FK; Mon, 09 Jul 2012 12:35:26 +0400 Message-ID: <4FFA9723.5000301@FreeBSD.org> Date: Mon, 09 Jul 2012 12:32:35 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120121 Thunderbird/9.0 MIME-Version: 1.0 To: Hiroki Sato References: <201207090716.q697GJ7A001973@svn.freebsd.org> <4FFA894D.9050104@FreeBSD.org> <20120709.170813.339720376082380726.hrs@allbsd.org> In-Reply-To: <20120709.170813.339720376082380726.hrs@allbsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:32:41 -0000 On 09.07.2012 12:08, Hiroki Sato wrote: > "Alexander V. Chernikov" wrote > in<4FFA894D.9050104@FreeBSD.org>: > > I meant there was no strong objection. I am sorry for not commenting > your implementation, but at least for ipfw0 it is difficult to > decouple ifnet and bpf because the primary consumer is tcpdump(8), > which depends on NET_RT_IFLIST to find the target. Probably your tcpdump -i still works with interface name supplied. > solution can be used for usbdump(8). The reason why I committed the > patch now is there are reports that these pseudo interfaces made some > applications confused and/or caused some performance degradation on > 9.0R, and wanted to fix it in some way. Do you plan to take this to 9.1 ? > > I am still open for more sophisticated implementation and have no > objection to replace mine with it. Do you have an idea about > converting it with a loadable module? Personally I think that the right way is to add user<>kernel interface for requesting interface list since this is the most major stopper for doing BPF-only providers. However this should be discussed with rpaulo@ and delphij@ (so most probably this skips 9.1). And, as fallback solution we can probably add separate ipfwlog module which is quite easy but much less clean. > > -- Hiroki From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:38:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8F35106566C; Mon, 9 Jul 2012 08:37:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C368F8FC12; Mon, 9 Jul 2012 08:37:59 +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 q698bxCm005769; Mon, 9 Jul 2012 08:37:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q698bxRY005763; Mon, 9 Jul 2012 08:37:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207090837.q698bxRY005763@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 08:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238284 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:38:00 -0000 Author: adrian Date: Mon Jul 9 08:37:59 2012 New Revision: 238284 URL: http://svn.freebsd.org/changeset/base/238284 Log: Further preparations for the RX EDMA support. Break out the DMA descriptor setup/teardown code into a method. The EDMA RX code doesn't allocate descriptors, just ath_buf entries. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Jul 9 08:27:04 2012 (r238283) +++ head/sys/dev/ath/if_ath.c Mon Jul 9 08:37:59 2012 (r238284) @@ -157,8 +157,6 @@ static void ath_update_promisc(struct if static void ath_updateslot(struct ifnet *); static void ath_bstuck_proc(void *, int); static void ath_reset_proc(void *, int); -static void ath_descdma_cleanup(struct ath_softc *sc, - struct ath_descdma *, ath_bufhead *); static int ath_desc_alloc(struct ath_softc *); static void ath_desc_free(struct ath_softc *); static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *, @@ -239,15 +237,15 @@ static int ath_anicalinterval = 100; /* SYSCTL_INT(_hw_ath, OID_AUTO, anical, CTLFLAG_RW, &ath_anicalinterval, 0, "ANI calibration (msecs)"); -static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ +int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf, 0, "rx buffers allocated"); TUNABLE_INT("hw.ath.rxbuf", &ath_rxbuf); -static int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */ +int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RW, &ath_txbuf, 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); -static int ath_txbuf_mgmt = ATH_MGMT_TXBUF; /* # mgmt tx buffers to allocate */ +int ath_txbuf_mgmt = ATH_MGMT_TXBUF; /* # mgmt tx buffers to allocate */ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf_mgmt, CTLFLAG_RW, &ath_txbuf_mgmt, 0, "tx (mgmt) buffers allocated"); TUNABLE_INT("hw.ath.txbuf_mgmt", &ath_txbuf_mgmt); @@ -308,9 +306,10 @@ ath_attach(u_int16_t devid, struct ath_s * * This is required before the descriptors are allocated. */ - if (ath_hal_hasedma(sc->sc_ah)) + if (ath_hal_hasedma(sc->sc_ah)) { + sc->sc_isedma = 1; ath_recv_setup_edma(sc); - else + } else ath_recv_setup_legacy(sc); /* @@ -378,6 +377,14 @@ ath_attach(u_int16_t devid, struct ath_s if_printf(ifp, "failed to allocate descriptors: %d\n", error); goto bad; } + + error = ath_rxdma_setup(sc); + if (error != 0) { + if_printf(ifp, "failed to allocate RX descriptors: %d\n", + error); + goto bad; + } + callout_init_mtx(&sc->sc_cal_ch, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_wd_ch, &sc->sc_mtx, 0); @@ -854,6 +861,7 @@ ath_attach(u_int16_t devid, struct ath_s bad2: ath_tx_cleanup(sc); ath_desc_free(sc); + ath_rxdma_teardown(sc); bad: if (ah) ath_hal_detach(ah); @@ -896,6 +904,7 @@ ath_detach(struct ath_softc *sc) ath_dfs_detach(sc); ath_desc_free(sc); + ath_rxdma_teardown(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ if_free(ifp); @@ -2594,6 +2603,13 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); + DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_MODE, + "%s: ah=%p, ifp=%p, if_addr=%p\n", + __func__, + ah, + ifp, + (ifp == NULL) ? NULL : ifp->if_addr); + /* handle any link-level address change */ ath_hal_setmac(ah, IF_LLADDR(ifp)); @@ -2724,7 +2740,7 @@ ath_load_cb(void *arg, bus_dma_segment_t *paddr = segs->ds_addr; } -static int +int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int nbuf, int ndesc) @@ -2863,7 +2879,7 @@ fail0: #undef ATH_DESC_4KB_BOUND_CHECK } -static void +void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head) { @@ -2904,15 +2920,9 @@ ath_desc_alloc(struct ath_softc *sc) { int error; - error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, - "rx", ath_rxbuf, 1); - if (error != 0) - return error; - error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf, "tx", ath_txbuf, ATH_TXDESC); if (error != 0) { - ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); return error; } sc->sc_txbuf_cnt = ath_txbuf; @@ -2920,7 +2930,6 @@ ath_desc_alloc(struct ath_softc *sc) error = ath_descdma_setup(sc, &sc->sc_txdma_mgmt, &sc->sc_txbuf_mgmt, "tx_mgmt", ath_txbuf_mgmt, ATH_TXDESC); if (error != 0) { - ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf); return error; } @@ -2933,7 +2942,6 @@ ath_desc_alloc(struct ath_softc *sc) error = ath_descdma_setup(sc, &sc->sc_bdma, &sc->sc_bbuf, "beacon", ATH_BCBUF, 1); if (error != 0) { - ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf); ath_descdma_cleanup(sc, &sc->sc_txdma_mgmt, &sc->sc_txbuf_mgmt); @@ -2950,8 +2958,6 @@ ath_desc_free(struct ath_softc *sc) ath_descdma_cleanup(sc, &sc->sc_bdma, &sc->sc_bbuf); if (sc->sc_txdma.dd_desc_len != 0) ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf); - if (sc->sc_rxdma.dd_desc_len != 0) - ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); if (sc->sc_txdma_mgmt.dd_desc_len != 0) ath_descdma_cleanup(sc, &sc->sc_txdma_mgmt, &sc->sc_txbuf_mgmt); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Mon Jul 9 08:27:04 2012 (r238283) +++ head/sys/dev/ath/if_ath_misc.h Mon Jul 9 08:37:59 2012 (r238284) @@ -48,6 +48,10 @@ ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) +extern int ath_rxbuf; +extern int ath_txbuf; +extern int ath_txbuf_mgmt; + extern int ath_tx_findrix(const struct ath_softc *sc, uint8_t rate); extern struct ath_buf * ath_getbuf(struct ath_softc *sc, @@ -80,6 +84,11 @@ extern void ath_setdefantenna(struct ath extern void ath_setslottime(struct ath_softc *sc); +extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, + ath_bufhead *head, const char *name, int nbuf, int ndesc); +extern void ath_descdma_cleanup(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head); + /* * This is only here so that the RX proc function can call it. * It's very likely that the "start TX after RX" call should be Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon Jul 9 08:27:04 2012 (r238283) +++ head/sys/dev/ath/if_ath_rx.c Mon Jul 9 08:37:59 2012 (r238284) @@ -1053,6 +1053,31 @@ ath_legacy_startrecv(struct ath_softc *s return 0; } +static int +ath_legacy_dma_rxsetup(struct ath_softc *sc) +{ + int error; + + device_printf(sc->sc_dev, "%s: called\n", __func__); + + error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + "rx", ath_rxbuf, 1); + if (error != 0) + return (error); + + return (0); +} + +static int +ath_legacy_dma_rxteardown(struct ath_softc *sc) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); + + if (sc->sc_rxdma.dd_desc_len != 0) + ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); + return (0); +} void ath_recv_setup_legacy(struct ath_softc *sc) @@ -1065,4 +1090,7 @@ ath_recv_setup_legacy(struct ath_softc * sc->sc_rx.recv_flush = ath_legacy_flushrecv; sc->sc_rx.recv_tasklet = ath_legacy_rx_tasklet; sc->sc_rx.recv_rxbuf_init = ath_legacy_rxbuf_init; + + sc->sc_rx.recv_setup = ath_legacy_dma_rxsetup; + sc->sc_rx.recv_teardown = ath_legacy_dma_rxteardown; } Modified: head/sys/dev/ath/if_ath_rx.h ============================================================================== --- head/sys/dev/ath/if_ath_rx.h Mon Jul 9 08:27:04 2012 (r238283) +++ head/sys/dev/ath/if_ath_rx.h Mon Jul 9 08:37:59 2012 (r238284) @@ -43,6 +43,10 @@ extern void ath_recv_mgmt(struct ieee802 (_sc)->sc_rx.recv_flush((_sc)) #define ath_rxbuf_init(_sc, _bf) \ (_sc)->sc_rx.recv_rxbuf_init((_sc), (_bf)) +#define ath_rxdma_setup(_sc) \ + (_sc)->sc_rx.recv_setup(_sc) +#define ath_rxdma_teardown(_sc) \ + (_sc)->sc_rx.recv_teardown(_sc) #if 0 extern int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 9 08:27:04 2012 (r238283) +++ head/sys/dev/ath/if_athvar.h Mon Jul 9 08:37:59 2012 (r238284) @@ -379,6 +379,20 @@ struct ath_rx_methods { void (*recv_tasklet)(void *arg, int npending); int (*recv_rxbuf_init)(struct ath_softc *sc, struct ath_buf *bf); + int (*recv_setup)(struct ath_softc *sc); + int (*recv_teardown)(struct ath_softc *sc); +}; + +/* + * Represent the current state of the RX FIFO. + */ +struct ath_rx_edma { + struct ath_buf **m_fifo; + int m_fifolen; + int m_fifo_head; + int m_fifo_tail; + int m_fifo_depth; + struct mbuf *m_rxpending; }; struct ath_softc { @@ -395,6 +409,12 @@ struct ath_softc { uint32_t sc_bssidmask; /* bssid mask */ struct ath_rx_methods sc_rx; + struct ath_rx_edma sc_rxedma[2]; /* HP/LP queues */ + int sc_rx_statuslen; + int sc_tx_desclen; + int sc_tx_statuslen; + int sc_tx_nmaps; /* Number of TX maps */ + int sc_edma_bufsize; void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); @@ -439,7 +459,8 @@ struct ath_softc { sc_setcca : 1,/* set/clr CCA with TDMA */ sc_resetcal : 1,/* reset cal state next trip */ sc_rxslink : 1,/* do self-linked final descriptor */ - sc_rxtsf32 : 1;/* RX dec TSF is 32 bits */ + sc_rxtsf32 : 1,/* RX dec TSF is 32 bits */ + sc_isedma : 1;/* supports EDMA */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:42:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8606106566B; Mon, 9 Jul 2012 08:42:54 +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 B1F838FC0C; Mon, 9 Jul 2012 08:42: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 q698gs3d005999; Mon, 9 Jul 2012 08:42:54 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q698gs4g005997; Mon, 9 Jul 2012 08:42:54 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207090842.q698gs4g005997@svn.freebsd.org> From: Robert Watson Date: Mon, 9 Jul 2012 08:42:54 +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: r238285 - stable/9/sys/security/mac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:42:54 -0000 Author: rwatson Date: Mon Jul 9 08:42:54 2012 New Revision: 238285 URL: http://svn.freebsd.org/changeset/base/238285 Log: Merge r234032 from head to stable/9: When allocation of labels on files is implicitly disabled due to MAC policy configuration, avoid leaking resources following failed calls to get and set MAC labels by file descriptor. Reported by: Mateusz Guzik + clang scan-build Approved by: re (kib) Modified: stable/9/sys/security/mac/mac_syscalls.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/security/mac/mac_syscalls.c ============================================================================== --- stable/9/sys/security/mac/mac_syscalls.c Mon Jul 9 08:37:59 2012 (r238284) +++ stable/9/sys/security/mac/mac_syscalls.c Mon Jul 9 08:42:54 2012 (r238285) @@ -256,8 +256,10 @@ sys___mac_get_fd(struct thread *td, stru switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } vp = fp->f_vnode; intlabel = mac_vnode_label_alloc(); vfslocked = VFS_LOCK_GIANT(vp->v_mount); @@ -271,8 +273,10 @@ sys___mac_get_fd(struct thread *td, stru break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } pipe = fp->f_data; intlabel = mac_pipe_label_alloc(); PIPE_LOCK(pipe); @@ -284,8 +288,10 @@ sys___mac_get_fd(struct thread *td, stru break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } so = fp->f_data; intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); @@ -299,10 +305,10 @@ sys___mac_get_fd(struct thread *td, stru default: error = EINVAL; } - fdrop(fp, td); if (error == 0) error = copyout(buffer, mac.m_string, strlen(buffer)+1); - +out_fdrop: + fdrop(fp, td); out: free(buffer, M_MACTEMP); free(elements, M_MACTEMP); @@ -450,8 +456,10 @@ sys___mac_set_fd(struct thread *td, stru switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_vnode_label_alloc(); error = mac_vnode_internalize_label(intlabel, buffer); if (error) { @@ -475,8 +483,10 @@ sys___mac_set_fd(struct thread *td, stru break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_pipe_label_alloc(); error = mac_pipe_internalize_label(intlabel, buffer); if (error == 0) { @@ -490,8 +500,10 @@ sys___mac_set_fd(struct thread *td, stru break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_socket_label_alloc(M_WAITOK); error = mac_socket_internalize_label(intlabel, buffer); if (error == 0) { @@ -505,6 +517,7 @@ sys___mac_set_fd(struct thread *td, stru default: error = EINVAL; } +out_fdrop: fdrop(fp, td); out: free(buffer, M_MACTEMP); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 08:57:36 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0546D106566C; Mon, 9 Jul 2012 08:57:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0868FC08; Mon, 9 Jul 2012 08:57:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q698vYMh085328; Mon, 9 Jul 2012 12:57:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q698vYgO085327; Mon, 9 Jul 2012 12:57:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 9 Jul 2012 12:57:34 +0400 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Message-ID: <20120709085734.GM21957@FreeBSD.org> References: <201207040737.q647br5k096035@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238092 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 08:57:36 -0000 On Sat, Jul 07, 2012 at 09:36:11PM +0000, Bjoern A. Zeeb wrote: B> > Author: glebius B> > Date: Wed Jul 4 07:37:53 2012 B> > New Revision: 238092 B> > URL: http://svn.freebsd.org/changeset/base/238092 B> > B> > Log: B> > When ip_output()/ip6_output() is supplied a struct route *ro argument, B> > it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning B> > here: it may be supplied to provide route, and it may be supplied to B> > store and return to caller the route that ip_output()/ip6_output() B> > finds. In the latter case skipping FLOWTABLE lookup is pessimisation. B> > B> > The difference between struct route filled by FLOWTABLE and filled B> > by rtalloc() family is that the former doesn't hold a reference on B> > its rtentry. Reference is hold by flow entry, and it is about to B> > be released in future. Thus, route filled by FLOWTABLE shouldn't B> > be passed to RTFREE() macro. B> > B> > - Introduce new flag for struct route/route_in6, that marks route B> > not holding a reference on rtentry. B> > - Introduce new macro RO_RTFREE() that cleans up a struct route B> > depending on its kind. B> > - All callers to ip_output()/ip6_output() that do supply non-NULL B> > but empty route should use RO_RTFREE() to free results of B> > lookup. B> > - ip_output()/ip6_output() now do FLOWTABLE lookup always when B> > ro->ro_rt == NULL. B> B> B> Just read the description but you realize that the proper fix is to B> make flowtable code a bit slower and do proper reference counting? B> B> Currently a cache flowtable entry might still be releases while a packet B> in being processed using it, right? I think we should connect Kip to the discussion. Flowtable is designed to be fast and lockless, and not refcounting rtentries per packet. Yes, it is theoretically racy. But my patch didn't bring in anything new to this pecularity of flowtable. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 09:11:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976471065670; Mon, 9 Jul 2012 09:11:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8073A8FC16; Mon, 9 Jul 2012 09:11: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 q699B7uJ007206; Mon, 9 Jul 2012 09:11:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q699B7aN007200; Mon, 9 Jul 2012 09:11:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207090911.q699B7aN007200@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 9 Jul 2012 09:11:07 +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: r238286 - stable/9/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 09:11:07 -0000 Author: pfg Date: Mon Jul 9 09:11:07 2012 New Revision: 238286 URL: http://svn.freebsd.org/changeset/base/238286 Log: MFC r238173: Fix issue resizing bin/sh This partially reverts some changes from r237448 that are causing breakage when resizing under bin/sh . Reverted changes from NetBSD are: Mar 10 20:46:15 2009 - editline.3 read.c make el_gets set the count to -1 on error to distinguish between EOF and error. Feb 19 15:20:22 2009 - read.c sig.c sig.h reset and redraw on sigcont. From Anon Ymous. Feb 15 21:24:13 2009 don't restart on EINTR, instead return NULL immediately. From Anon Ymous PR: 169603 Reported by: Peter Jeremy, David Shao MFC after: 3 days Approved by: re Modified: stable/9/lib/libedit/editline.3 stable/9/lib/libedit/el.h stable/9/lib/libedit/read.c stable/9/lib/libedit/sig.c stable/9/lib/libedit/sig.h Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/editline.3 ============================================================================== --- stable/9/lib/libedit/editline.3 Mon Jul 9 08:42:54 2012 (r238285) +++ stable/9/lib/libedit/editline.3 Mon Jul 9 09:11:07 2012 (r238286) @@ -162,11 +162,6 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. -If an error occurred, -.Fa count -is set to \-1 and -.Dv errno -contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: stable/9/lib/libedit/el.h ============================================================================== --- stable/9/lib/libedit/el.h Mon Jul 9 08:42:54 2012 (r238285) +++ stable/9/lib/libedit/el.h Mon Jul 9 09:11:07 2012 (r238286) @@ -115,7 +115,6 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ - int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/9/lib/libedit/read.c ============================================================================== --- stable/9/lib/libedit/read.c Mon Jul 9 08:42:54 2012 (r238285) +++ stable/9/lib/libedit/read.c Mon Jul 9 09:11:07 2012 (r238286) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include "el.h" -#define OKCMD -1 /* must be -1! */ +#define OKCMD -1 private int read__fixio(int, int); private int read_preread(EditLine *); @@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e) return (e ? 0 : -1); case EINTR: - return (-1); + return (0); default: return (-1); @@ -235,12 +235,9 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; - el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ - el->el_errno = num == 0 ? 0 : errno; + if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ return (num); - } #ifdef KANJI if ((*ch & 0200)) { @@ -292,21 +289,14 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - again: - el->el_signal->sig_no = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) { - if (el->el_signal->sig_no == SIGCONT) { - sig_set(el); - el_set(el, EL_REFRESH); - goto again; - } + while ((num_read = read(el->el_infd, cp, 1)) == -1) if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - } + return (int)num_read; } @@ -413,20 +403,17 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; - int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ - if (nread == NULL) - nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { char *cp = el->el_line.buffer; size_t idx; - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -440,16 +427,12 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } @@ -460,8 +443,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - errno = 0; - *nread = 0; + if (nread) + *nread = 0; return (NULL); } } @@ -474,7 +457,6 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; - if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -482,7 +464,7 @@ el_gets(EditLine *el, int *nread) term__flush(el); - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -498,15 +480,11 @@ el_gets(EditLine *el, int *nread) break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } - el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -522,12 +500,6 @@ el_gets(EditLine *el, int *nread) #endif /* DEBUG_READ */ break; } - if (el->el_errno == EINTR) { - el->el_line.buffer[0] = '\0'; - el->el_line.lastchar = - el->el_line.cursor = el->el_line.buffer; - break; - } if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */ #ifdef DEBUG_EDIT (void) fprintf(el->el_errfile, @@ -645,17 +617,12 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - *nread = num != -1 ? num : 0; + if (nread) + *nread = num; } else { - *nread = (int)(el->el_line.lastchar - el->el_line.buffer); + if (nread) + *nread = + (int)(el->el_line.lastchar - el->el_line.buffer); } -done: - if (*nread == 0) { - if (num == -1) { - *nread = -1; - errno = el->el_errno; - } - return NULL; - } else - return el->el_line.buffer; + return (num ? el->el_line.buffer : NULL); } Modified: stable/9/lib/libedit/sig.c ============================================================================== --- stable/9/lib/libedit/sig.c Mon Jul 9 08:42:54 2012 (r238285) +++ stable/9/lib/libedit/sig.c Mon Jul 9 09:11:07 2012 (r238286) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ + * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,8 +73,6 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); - sel->el_signal->sig_no = signo; - switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -160,12 +158,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; - nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { + nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: stable/9/lib/libedit/sig.h ============================================================================== --- stable/9/lib/libedit/sig.h Mon Jul 9 08:42:54 2012 (r238285) +++ stable/9/lib/libedit/sig.h Mon Jul 9 09:11:07 2012 (r238286) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp $ + * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ * $FreeBSD$ */ @@ -61,7 +61,6 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; - volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 09:24:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D32AF106564A; Mon, 9 Jul 2012 09:24:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDCFB8FC15; Mon, 9 Jul 2012 09:24:46 +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 q699OktK007791; Mon, 9 Jul 2012 09:24:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q699OkB0007789; Mon, 9 Jul 2012 09:24:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207090924.q699OkB0007789@svn.freebsd.org> From: David Xu Date: Mon, 9 Jul 2012 09:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238287 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 09:24:47 -0000 Author: davidxu Date: Mon Jul 9 09:24:46 2012 New Revision: 238287 URL: http://svn.freebsd.org/changeset/base/238287 Log: If you have pressed CTRL+Z and a process is suspended, then you use gdb to attach to the process, it is surprising that the process is resumed without inputting any gdb commands, however ptrace manual said: The tracing process will see the newly-traced process stop and may then control it as if it had been traced all along. But the current code does not work in this way, unless traced process received a signal later, it will continue to run as a background task. To fix this problem, just send signal SIGSTOP to the traced process after we resumed it, this works like that you are attaching to a running process, it is not perfect but better than nothing. Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jul 9 09:11:07 2012 (r238286) +++ head/sys/kern/sys_process.c Mon Jul 9 09:24:46 2012 (r238287) @@ -635,7 +635,7 @@ kern_ptrace(struct thread *td, int req, struct iovec iov; struct uio uio; struct proc *curp, *p, *pp; - struct thread *td2 = NULL; + struct thread *td2 = NULL, *td3; struct ptrace_io_desc *piod = NULL; struct ptrace_lwpinfo *pl; int error, write, tmp, num; @@ -953,10 +953,8 @@ kern_ptrace(struct thread *td, int req, td2->td_xsig = data; if (req == PT_DETACH) { - struct thread *td3; - FOREACH_THREAD_IN_PROC(p, td3) { + FOREACH_THREAD_IN_PROC(p, td3) td3->td_dbgflags &= ~TDB_SUSPEND; - } } /* * unsuspend all threads, to not let a thread run, @@ -967,6 +965,8 @@ kern_ptrace(struct thread *td, int req, p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); thread_unsuspend(p); PROC_SUNLOCK(p); + if (req == PT_ATTACH) + kern_psignal(p, data); } else { if (data) kern_psignal(p, data); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 09:38:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6C31065672; Mon, 9 Jul 2012 09:38:54 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECC578FC08; Mon, 9 Jul 2012 09:38:53 +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 q699crC5008393; Mon, 9 Jul 2012 09:38:53 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q699cra0008391; Mon, 9 Jul 2012 09:38:53 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201207090938.q699cra0008391@svn.freebsd.org> From: Takanori Watanabe Date: Mon, 9 Jul 2012 09:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238288 - head/usr.sbin/acpi/acpidump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 09:38:54 -0000 Author: takawata Date: Mon Jul 9 09:38:53 2012 New Revision: 238288 URL: http://svn.freebsd.org/changeset/base/238288 Log: Add range and table revision checking to avoid abend. PR:bin/169707 Submitted by:Dan Lukes MFC after:3 days. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Mon Jul 9 09:24:46 2012 (r238287) +++ head/usr.sbin/acpi/acpidump/acpi.c Mon Jul 9 09:38:53 2012 (r238288) @@ -654,16 +654,24 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); return; } + if(sdp->Revision == 1){ + printf("\tOLD TCPA spec log found. Dumping not supported.\n"); + printf(END_COMMENT); + return; + } vaddr = (unsigned char *)acpi_map_physical(paddr, len); vend = vaddr + len; while (vaddr != NULL) { - if (vaddr + sizeof(struct TCPAevent) >= vend) + if ((vaddr + sizeof(struct TCPAevent) >= vend)|| + (vaddr + sizeof(struct TCPAevent) < vaddr)) break; event = (struct TCPAevent *)(void *)vaddr; if (vaddr + event->event_size >= vend) break; + if (vaddr + event->event_size < vaddr) + break; if (event->event_type == 0 && event->event_size == 0) break; #if 0 From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:17:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32EBD106566C; Mon, 9 Jul 2012 10:17:07 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D99B8FC1A; Mon, 9 Jul 2012 10:17: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 q69AH6lH010032; Mon, 9 Jul 2012 10:17:06 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AH61P010030; Mon, 9 Jul 2012 10:17:06 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201207091017.q69AH61P010030@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 9 Jul 2012 10:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238289 - head/sys/mips/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:17:07 -0000 Author: jchandra Date: Mon Jul 9 10:17:06 2012 New Revision: 238289 URL: http://svn.freebsd.org/changeset/base/238289 Log: Fix PCIe hardware swap configuration for Netlogic XLP The last 12 bits of the limit registers have to be set to 1. These bits are not significant in bridge BARs and are 0 on read, but the bits are valid in the swap limit register and needs to be set. Modified: head/sys/mips/nlm/xlp_pci.c Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Mon Jul 9 09:38:53 2012 (r238288) +++ head/sys/mips/nlm/xlp_pci.c Mon Jul 9 10:17:06 2012 (r238289) @@ -507,13 +507,13 @@ xlp_pcib_hardware_swap_enable(int node, nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_BASE, bar); bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEMEM_LIMIT0 + link); - nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_LIM, bar); + nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_MEM_LIM, bar | 0xFFF); bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEIO_BASE0 + link); nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_BASE, bar); bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEIO_LIMIT0 + link); - nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_LIM, bar); + nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_LIM, bar | 0xFFF); } static int From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:24:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1732106564A; Mon, 9 Jul 2012 10:24:45 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C35358FC14; Mon, 9 Jul 2012 10:24:45 +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 q69AOjl8010384; Mon, 9 Jul 2012 10:24:45 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AOjmc010381; Mon, 9 Jul 2012 10:24:45 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201207091024.q69AOjmc010381@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 9 Jul 2012 10:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238290 - head/sys/mips/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:24:46 -0000 Author: jchandra Date: Mon Jul 9 10:24:45 2012 New Revision: 238290 URL: http://svn.freebsd.org/changeset/base/238290 Log: Identify Netlogic XLP 8xx B1 chip revisions Add functions to check for 8xx B0 and 3xx Ax revisions which will be used in network block initialization. Modified: head/sys/mips/nlm/board.c head/sys/mips/nlm/xlp.h Modified: head/sys/mips/nlm/board.c ============================================================================== --- head/sys/mips/nlm/board.c Mon Jul 9 10:17:06 2012 (r238289) +++ head/sys/mips/nlm/board.c Mon Jul 9 10:24:45 2012 (r238290) @@ -362,6 +362,8 @@ nlm_print_processor_info(void) revstr = "A2"; break; case 3: revstr = "B0"; break; + case 4: + revstr = "B1"; break; default: revstr = "??"; break; } Modified: head/sys/mips/nlm/xlp.h ============================================================================== --- head/sys/mips/nlm/xlp.h Mon Jul 9 10:17:06 2012 (r238289) +++ head/sys/mips/nlm/xlp.h Mon Jul 9 10:24:45 2012 (r238290) @@ -57,6 +57,7 @@ #define XLP_REVISION_A1 0x01 #define XLP_REVISION_A2 0x02 #define XLP_REVISION_B0 0x03 +#define XLP_REVISION_B1 0x04 #ifndef LOCORE /* @@ -87,6 +88,16 @@ static __inline int nlm_is_xlp3xx(void) return (nlm_processor_id() == CHIP_PROCESSOR_ID_XLP_3XX); } +static __inline int nlm_is_xlp3xx_ax(void) +{ + uint32_t procid = mips_rd_prid(); + int prid = (procid >> 8) & 0xff; + int rev = procid & 0xff; + + return (prid == CHIP_PROCESSOR_ID_XLP_3XX && + rev < XLP_REVISION_B0); +} + static __inline int nlm_is_xlp4xx(void) { int prid = nlm_processor_id(); @@ -116,5 +127,17 @@ static __inline int nlm_is_xlp8xx_ax(voi (rev < XLP_REVISION_B0)); } +static __inline int nlm_is_xlp8xx_b0(void) +{ + uint32_t procid = mips_rd_prid(); + int prid = (procid >> 8) & 0xff; + int rev = procid & 0xff; + + return ((prid == CHIP_PROCESSOR_ID_XLP_8XX || + prid == CHIP_PROCESSOR_ID_XLP_432 || + prid == CHIP_PROCESSOR_ID_XLP_416) && + rev == XLP_REVISION_B0); +} + #endif /* LOCORE */ #endif /* __NLM_XLP_H__ */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56A5C106566C; Mon, 9 Jul 2012 10:33:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279B48FC12; Mon, 9 Jul 2012 10:33: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 q69AXsAZ010892; Mon, 9 Jul 2012 10:33:54 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AXrii010888; Mon, 9 Jul 2012 10:33:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207091033.q69AXrii010888@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Jul 2012 10:33:53 +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: r238291 - stable/9/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:33:54 -0000 Author: kib Date: Mon Jul 9 10:33:53 2012 New Revision: 238291 URL: http://svn.freebsd.org/changeset/base/238291 Log: MFC r237988: Issue proper diagnostic on the short writes, also consider the case of write reporting 0 bytes as short write. Approved by: re (hrs) Modified: stable/9/usr.bin/xinstall/xinstall.c Directory Properties: stable/9/usr.bin/xinstall/ (props changed) Modified: stable/9/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/9/usr.bin/xinstall/xinstall.c Mon Jul 9 10:24:45 2012 (r238290) +++ stable/9/usr.bin/xinstall/xinstall.c Mon Jul 9 10:33:53 2012 (r238291) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -670,11 +671,18 @@ copy(int from_fd, const char *from_name, if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != (char *)MAP_FAILED) { - if ((nw = write(to_fd, p, size)) != size) { + nw = write(to_fd, p, size); + if (nw != size) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } done_copy = 1; } @@ -683,8 +691,15 @@ copy(int from_fd, const char *from_name, if ((nw = write(to_fd, buf, nr)) != nr) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, + (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } if (nr != 0) { serrno = errno; From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:36:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1887106566B; Mon, 9 Jul 2012 10:36:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A252B8FC19; Mon, 9 Jul 2012 10:36:43 +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 q69Aah7s011355; Mon, 9 Jul 2012 10:36:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AahaJ011353; Mon, 9 Jul 2012 10:36:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207091036.q69AahaJ011353@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Jul 2012 10:36:43 +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: r238292 - stable/8/usr.bin/xinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:36:43 -0000 Author: kib Date: Mon Jul 9 10:36:43 2012 New Revision: 238292 URL: http://svn.freebsd.org/changeset/base/238292 Log: MFC r237988: Issue proper diagnostic on the short writes, also consider the case of write reporting 0 bytes as short write. Modified: stable/8/usr.bin/xinstall/xinstall.c Directory Properties: stable/8/usr.bin/xinstall/ (props changed) Modified: stable/8/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/8/usr.bin/xinstall/xinstall.c Mon Jul 9 10:33:53 2012 (r238291) +++ stable/8/usr.bin/xinstall/xinstall.c Mon Jul 9 10:36:43 2012 (r238292) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -675,11 +676,18 @@ copy(int from_fd, const char *from_name, if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != (char *)MAP_FAILED) { - if ((nw = write(to_fd, p, size)) != size) { + nw = write(to_fd, p, size); + if (nw != size) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } done_copy = 1; } @@ -688,8 +696,15 @@ copy(int from_fd, const char *from_name, if ((nw = write(to_fd, buf, nr)) != nr) { serrno = errno; (void)unlink(to_name); - errno = nw > 0 ? EIO : serrno; - err(EX_OSERR, "%s", to_name); + if (nw >= 0) { + errx(EX_OSERR, + "short write to %s: %jd bytes written, %jd bytes asked to write", + to_name, (uintmax_t)nw, + (uintmax_t)size); + } else { + errno = serrno; + err(EX_OSERR, "%s", to_name); + } } if (nr != 0) { serrno = errno; From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:39:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D046710657FF; Mon, 9 Jul 2012 10:39:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0A888FC16; Mon, 9 Jul 2012 10:39:57 +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 q69Advef011523; Mon, 9 Jul 2012 10:39:57 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AdvJn011520; Mon, 9 Jul 2012 10:39:57 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201207091039.q69AdvJn011520@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 9 Jul 2012 10:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238293 - in head/sys/mips/nlm: dev/net hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:39:57 -0000 Author: jchandra Date: Mon Jul 9 10:39:57 2012 New Revision: 238293 URL: http://svn.freebsd.org/changeset/base/238293 Log: Support Netlogic XLP 8xx B1 revisions in xlpge. Updates to the MDIO access code for the new revision of the XLP chip. Modified: head/sys/mips/nlm/dev/net/mdio.c head/sys/mips/nlm/hal/mdio.h Modified: head/sys/mips/nlm/dev/net/mdio.c ============================================================================== --- head/sys/mips/nlm/dev/net/mdio.c Mon Jul 9 10:36:43 2012 (r238292) +++ head/sys/mips/nlm/dev/net/mdio.c Mon Jul 9 10:39:57 2012 (r238293) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* Internal MDIO READ/WRITE Routines */ int nlm_int_gmac_mdio_read(uint64_t nae_base, int bus, int block, @@ -176,12 +178,7 @@ nlm_gmac_mdio_read(uint64_t nae_base, in int intf_type, int phyaddr, int regidx) { uint32_t mdio_ld_cmd; - uint32_t val; - - val = EXT_G_MDIO_CMD_SP | - (phyaddr << EXT_G_MDIO_PHYADDR_POS) | - (regidx << EXT_G_MDIO_REGADDR_POS) | - EXT_G_MDIO_DIV; + uint32_t ctrlval; mdio_ld_cmd = nlm_read_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4))); @@ -195,14 +192,22 @@ nlm_gmac_mdio_read(uint64_t nae_base, in EXT_G_MDIO_STAT_MBSY); } - nlm_write_nae_reg(nae_base, + ctrlval = EXT_G_MDIO_CMD_SP | + (phyaddr << EXT_G_MDIO_PHYADDR_POS) | + (regidx << EXT_G_MDIO_REGADDR_POS); + if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax()) + ctrlval |= EXT_G_MDIO_DIV; + else + ctrlval |= EXT_G_MDIO_DIV_WITH_HW_DIV64; + + nlm_write_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), - val); + ctrlval); nlm_write_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), - val | (1<<18)); - + ctrlval | (1<<18)); + DELAY(1000); /* poll master busy bit until it is not busy */ while(nlm_read_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_RD_STAT + bus * 4))) & @@ -210,7 +215,7 @@ nlm_gmac_mdio_read(uint64_t nae_base, in nlm_write_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), - val); + ctrlval); /* Read the data back */ return nlm_read_nae_reg(nae_base, @@ -236,11 +241,6 @@ nlm_gmac_mdio_write(uint64_t nae_base, i uint32_t mdio_ld_cmd; uint32_t ctrlval; - ctrlval = EXT_G_MDIO_CMD_SP | - (phyaddr << EXT_G_MDIO_PHYADDR_POS) | - (regidx << EXT_G_MDIO_REGADDR_POS) | - EXT_G_MDIO_DIV; - mdio_ld_cmd = nlm_read_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4))); if (mdio_ld_cmd & EXT_G_MDIO_CMD_LCD) { @@ -258,6 +258,14 @@ nlm_gmac_mdio_write(uint64_t nae_base, i NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL_DATA+bus*4)), val); + ctrlval = EXT_G_MDIO_CMD_SP | + (phyaddr << EXT_G_MDIO_PHYADDR_POS) | + (regidx << EXT_G_MDIO_REGADDR_POS); + if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax()) + ctrlval |= EXT_G_MDIO_DIV; + else + ctrlval |= EXT_G_MDIO_DIV_WITH_HW_DIV64; + nlm_write_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), ctrlval); @@ -265,6 +273,7 @@ nlm_gmac_mdio_write(uint64_t nae_base, i nlm_write_nae_reg(nae_base, NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), ctrlval | EXT_G_MDIO_CMD_LCD); + DELAY(1000); /* poll master busy bit until it is not busy */ while(nlm_read_nae_reg(nae_base, @@ -291,11 +300,17 @@ int nlm_gmac_mdio_reset(uint64_t nae_base, int bus, int block, int intf_type) { + uint32_t ctrlval; + + if (nlm_is_xlp8xx_ax() || nlm_is_xlp8xx_b0() || nlm_is_xlp3xx_ax()) + ctrlval = EXT_G_MDIO_DIV; + else + ctrlval = EXT_G_MDIO_DIV_WITH_HW_DIV64; + nlm_write_nae_reg(nae_base, - NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), - EXT_G_MDIO_MMRST | EXT_G_MDIO_DIV); + NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4)), + EXT_G_MDIO_MMRST | ctrlval); nlm_write_nae_reg(nae_base, - NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL+bus*4)), - EXT_G_MDIO_DIV); + NAE_REG(block, intf_type, (EXT_G0_MDIO_CTRL + bus * 4)), ctrlval); return (0); } Modified: head/sys/mips/nlm/hal/mdio.h ============================================================================== --- head/sys/mips/nlm/hal/mdio.h Mon Jul 9 10:36:43 2012 (r238292) +++ head/sys/mips/nlm/hal/mdio.h Mon Jul 9 10:39:57 2012 (r238293) @@ -81,6 +81,7 @@ #define EXT_G_MDIO_CMD_SC 0x00080000 #define EXT_G_MDIO_MMRST 0x00100000 #define EXT_G_MDIO_DIV 0x0000001E +#define EXT_G_MDIO_DIV_WITH_HW_DIV64 0x00000010 #define EXT_G_MDIO_RD_STAT_MASK 0x0000FFFF #define EXT_G_MDIO_STAT_LFV 0x00010000 From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 10:59:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C85106564A; Mon, 9 Jul 2012 10:59:40 +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 718848FC24; Mon, 9 Jul 2012 10:59:40 +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 q69AxeVJ013985; Mon, 9 Jul 2012 10:59:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AxeX2013983; Mon, 9 Jul 2012 10:59:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207091059.q69AxeX2013983@svn.freebsd.org> From: Michael Tuexen Date: Mon, 9 Jul 2012 10:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238294 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:59:40 -0000 Author: tuexen Date: Mon Jul 9 10:59:39 2012 New Revision: 238294 URL: http://svn.freebsd.org/changeset/base/238294 Log: Fix a bug introduced in r237715. MFC after:i 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Jul 9 10:39:57 2012 (r238293) +++ head/sys/netinet/sctp_output.c Mon Jul 9 10:59:39 2012 (r238294) @@ -5520,6 +5520,7 @@ do_a_abort: case AF_INET6: { stc.addr_type = SCTP_IPV6_ADDRESS; + memcpy(&stc.address, &src6->sin6_addr, sizeof(struct in6_addr)); stc.scope_id = in6_getscope(&src6->sin6_addr); if (sctp_is_address_on_local_host(src, vrf_id)) { stc.loopback_scope = 1; From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 11:53:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E689106566B; Mon, 9 Jul 2012 11:53:07 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F55C8FC14; Mon, 9 Jul 2012 11:53: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 q69Br6KR016437; Mon, 9 Jul 2012 11:53:06 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69Br6hJ016434; Mon, 9 Jul 2012 11:53:06 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201207091153.q69Br6hJ016434@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 9 Jul 2012 11:53: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: r238295 - stable/9/sys/netgraph/netflow X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 11:53:07 -0000 Author: melifaro Date: Mon Jul 9 11:53:06 2012 New Revision: 238295 URL: http://svn.freebsd.org/changeset/base/238295 Log: Merge r237162, r237163, r237164, r237226. Fix improper L4 header handling for IPv6 packets passed via DLT_RAW. Set netflow v9 observation domain value to fib number instead of node id. This fixes multi-fib netflow v9 export. Use time_uptime instead of getnanotime for accouting integer number of seconds. Simplify IP pointer recovery in case of mbuf reallocation. Approved by: ae(mentor) Approved by: re Modified: stable/9/sys/netgraph/netflow/netflow_v9.c stable/9/sys/netgraph/netflow/ng_netflow.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/netflow/netflow_v9.c ============================================================================== --- stable/9/sys/netgraph/netflow/netflow_v9.c Mon Jul 9 10:59:39 2012 (r238294) +++ stable/9/sys/netgraph/netflow/netflow_v9.c Mon Jul 9 11:53:06 2012 (r238295) @@ -222,7 +222,7 @@ export9_send(priv_p priv, fib_export_p f header->unix_secs = htonl(ts.tv_sec); header->seq_num = htonl(atomic_fetchadd_32(&fe->flow9_seq, 1)); header->count = htons(t->count); - header->source_id = htonl(NG_NODE_ID(priv->node)); + header->source_id = htonl(fe->domain_id); if (priv->export9 != NULL) NG_FWD_ITEM_HOOK_FLAGS(error, item, priv->export9, flags); @@ -416,16 +416,14 @@ get_export9_dgram(priv_p priv, fib_expor * Check if we need to insert templates into packet */ - struct timespec ts; struct netflow_v9_flowset_header *fl; - getnanotime(&ts); - if ((ts.tv_sec >= priv->templ_time + fe->templ_last_ts) || + if ((time_uptime >= priv->templ_time + fe->templ_last_ts) || (fe->sent_packets >= priv->templ_packets + fe->templ_last_pkt)) { - atomic_store_rel_32(&fe->templ_last_ts, ts.tv_sec); - atomic_store_rel_32(&fe->templ_last_pkt, fe->sent_packets); - + fe->templ_last_ts = time_uptime; + fe->templ_last_pkt = fe->sent_packets; + fl = priv->v9_flowsets[0]; m_append(m, ntohs(fl->length), (void *)fl); t->flow_header = m->m_len; Modified: stable/9/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- stable/9/sys/netgraph/netflow/ng_netflow.c Mon Jul 9 10:59:39 2012 (r238294) +++ stable/9/sys/netgraph/netflow/ng_netflow.c Mon Jul 9 11:53:06 2012 (r238295) @@ -560,8 +560,8 @@ ng_netflow_rcvdata (hook_p hook, item_p struct ip6_hdr *ip6 = NULL; struct m_tag *mtag; int pullup_len = 0, off; - uint8_t upper_proto = 0, is_frag = 0; - int error = 0, bypass = 0, acct = 0; + uint8_t acct = 0, bypass = 0, is_frag = 0, upper_proto = 0; + int error = 0, l3_off = 0; unsigned int src_if_index; caddr_t upper_ptr = NULL; fib_export_p fe; @@ -666,6 +666,7 @@ ng_netflow_rcvdata (hook_p hook, item_p M_CHECK(sizeof(struct ip)); eh = mtod(m, struct ether_header *); ip = (struct ip *)(eh + 1); + l3_off = sizeof(struct ether_header); break; #ifdef INET6 case ETHERTYPE_IPV6: @@ -676,6 +677,7 @@ ng_netflow_rcvdata (hook_p hook, item_p M_CHECK(sizeof(struct ip6_hdr)); eh = mtod(m, struct ether_header *); ip6 = (struct ip6_hdr *)(eh + 1); + l3_off = sizeof(struct ether_header); break; #endif case ETHERTYPE_VLAN: @@ -686,6 +688,7 @@ ng_netflow_rcvdata (hook_p hook, item_p sizeof(struct ether_header)); evh = mtod(m, struct ether_vlan_header *); etype = ntohs(evh->evl_proto); + l3_off = sizeof(struct ether_vlan_header); if (etype == ETHERTYPE_IP) { M_CHECK(sizeof(struct ip)); @@ -707,12 +710,13 @@ ng_netflow_rcvdata (hook_p hook, item_p case DLT_RAW: /* IP packets */ M_CHECK(sizeof(struct ip)); ip = mtod(m, struct ip *); + /* l3_off is already zero */ #ifdef INET6 /* If INET6 is not defined IPv6 packets will be discarded in ng_netflow_flow_add() */ if (ip->ip_v == IP6VERSION) { /* IPv6 packet */ ip = NULL; - M_CHECK(sizeof(struct ip6_hdr)); + M_CHECK(sizeof(struct ip6_hdr) - sizeof(struct ip)); ip6 = mtod(m, struct ip6_hdr *); } #endif @@ -824,7 +828,10 @@ ng_netflow_rcvdata (hook_p hook, item_p case IPPROTO_NONE: goto loopend; #endif - /* Any unknow header (new extension or IPv6/IPv4 header for tunnels) */ + /* + * Any unknow header (new extension or IPv6/IPv4 + * header for tunnels) ends loop. + */ default: goto loopend; } @@ -842,56 +849,11 @@ loopend: /* Just in case of real reallocation in M_CHECK() / m_pullup() */ if (m != m_old) { atomic_fetchadd_32(&priv->info.nfinfo_realloc_mbuf, 1); - ip = NULL; - ip6 = NULL; - switch (iface->info.ifinfo_dlt) { - case DLT_EN10MB: /* Ethernet */ - { - struct ether_header *eh; - - eh = mtod(m, struct ether_header *); - switch (ntohs(eh->ether_type)) { - case ETHERTYPE_IP: - ip = (struct ip *)(eh + 1); - break; -#ifdef INET6 - case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(eh + 1); - break; -#endif - case ETHERTYPE_VLAN: - { - struct ether_vlan_header *evh; - - evh = mtod(m, struct ether_vlan_header *); - if (ntohs(evh->evl_proto) == ETHERTYPE_IP) { - ip = (struct ip *)(evh + 1); - break; -#ifdef INET6 - } else if (ntohs(evh->evl_proto) == ETHERTYPE_IPV6) { - ip6 = (struct ip6_hdr *)(evh + 1); - break; -#endif - } - } - default: - panic("ng_netflow entered deadcode"); - } - break; - } - case DLT_RAW: /* IP packets */ - ip = mtod(m, struct ip *); -#ifdef INET6 - if (ip->ip_v == IP6VERSION) { - /* IPv6 packet */ - ip = NULL; - ip6 = mtod(m, struct ip6_hdr *); - } -#endif - break; - default: - panic("ng_netflow entered deadcode"); - } + /* Restore ip/ipv6 pointer */ + if (ip != NULL) + ip = (struct ip *)(mtod(m, caddr_t) + l3_off); + else if (ip6 != NULL) + ip6 = (struct ip6_hdr *)(mtod(m, caddr_t) + l3_off); } upper_ptr = (caddr_t)(mtod(m, caddr_t) + off); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 13:21:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A503106566C; Mon, 9 Jul 2012 13:21:50 +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 258118FC19; Mon, 9 Jul 2012 13:21: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 q69DLoFQ020295; Mon, 9 Jul 2012 13:21:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69DLnPY020293; Mon, 9 Jul 2012 13:21:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207091321.q69DLnPY020293@svn.freebsd.org> From: Michael Tuexen Date: Mon, 9 Jul 2012 13:21:49 +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: r238296 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 13:21:50 -0000 Author: tuexen Date: Mon Jul 9 13:21:49 2012 New Revision: 238296 URL: http://svn.freebsd.org/changeset/base/238296 Log: MFC r238121: Use CSUM_SCTP_IPV6 for IPv6. Approved by: re@ Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Mon Jul 9 11:53:06 2012 (r238295) +++ stable/9/sys/netinet/sctp_output.c Mon Jul 9 13:21:49 2012 (r238296) @@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - m->m_pkthdr.csum_flags = CSUM_SCTP; + m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; m->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif @@ -11120,7 +11120,7 @@ sctp_send_resp_msg(struct mbuf *m, struc #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - mout->m_pkthdr.csum_flags = CSUM_SCTP; + mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = 0; SCTP_STAT_INCR(sctps_sendhwcrc); #endif From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 14:16:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5600C1065673; Mon, 9 Jul 2012 14:16:50 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4255F8FC1D; Mon, 9 Jul 2012 14:16: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 q69EGoP7022710; Mon, 9 Jul 2012 14:16:50 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69EGopt022708; Mon, 9 Jul 2012 14:16:50 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207091416.q69EGopt022708@svn.freebsd.org> From: Ed Maste Date: Mon, 9 Jul 2012 14:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238298 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 14:16:50 -0000 Author: emaste Date: Mon Jul 9 14:16:49 2012 New Revision: 238298 URL: http://svn.freebsd.org/changeset/base/238298 Log: Restore error handling lost in r191603 This was missed in the change from IFQ_ENQUEUE to if_transmit. Sponsored by: ADARA Networks Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Mon Jul 9 13:56:59 2012 (r238297) +++ head/sys/net/if_bridge.c Mon Jul 9 14:16:49 2012 (r238298) @@ -1812,7 +1812,7 @@ bridge_enqueue(struct bridge_softc *sc, } if (err == 0) - dst_ifp->if_transmit(dst_ifp, m); + err = dst_ifp->if_transmit(dst_ifp, m); } if (err == 0) { From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 15:06:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A28E0106566C; Mon, 9 Jul 2012 15:06:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 740438FC0C; Mon, 9 Jul 2012 15:06:18 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C9CC2B9AC; Mon, 9 Jul 2012 11:06:17 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Mon, 9 Jul 2012 09:45:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207061557.q66Fv45N069464@svn.freebsd.org> <20120707083535.GR2338@deviant.kiev.zoral.com.ua> <2B1DDEF4-A048-45BD-9A7A-8CB148282475@xcllnt.net> In-Reply-To: <2B1DDEF4-A048-45BD-9A7A-8CB148282475@xcllnt.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207090945.52985.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jul 2012 11:06:17 -0400 (EDT) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r238172 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 15:06:18 -0000 On Saturday, July 07, 2012 10:44:14 am Marcel Moolenaar wrote: > The commit log states the motivation: developers tend to copy-n-paste without > truly understanding the subtle differences and may use the Maxmem use in > agp_i810.c as the wrong precedence. Secondly, also mentioned in the commit > log, is the use of realmem in agp.c and then Maxmem in agp_i810.c which is > likely to be confusing. So the change from Maxmem to realmem in agp_i810.c > prioritizes the avoidance of confusion over pedantic correctness, which we > all know isn't achievable anyway. Since agp_i810.c is only for amd64, i386 > and pc98, also stated in the commit log, and all of those have dense phys. > memory, the discrepancy is still within the margin of error. 1GB is a rather large margin IMO. If agp_i810.c actually cares about the maximum PA and not the size of RAM, then it should use the correct variable for this purpose. The copy-n-paste thing works both ways. You don't want someone to use realmem instead of Maxmem elsewhere because they copy-n-paste the wrong thing from agp_i810.c. I think the solution is to fix things to use what the actually need. In the case of agp_i810.c it sounds like that is Maxmem. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 15:31:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B29B11065673; Mon, 9 Jul 2012 15:31:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9EB8FC12; Mon, 9 Jul 2012 15:31: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 q69FV6uI025813; Mon, 9 Jul 2012 15:31:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69FV6La025807; Mon, 9 Jul 2012 15:31:06 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207091531.q69FV6La025807@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 9 Jul 2012 15:31:06 +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: r238299 - stable/8/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 15:31:06 -0000 Author: pfg Date: Mon Jul 9 15:31:05 2012 New Revision: 238299 URL: http://svn.freebsd.org/changeset/base/238299 Log: MFC r238173: Fix issue resizing bin/sh This partially reverts some changes from r237448 that are causing breakage when resizing under bin/sh . Reverted changes from NetBSD are: Mar 10 20:46:15 2009 - editline.3 read.c make el_gets set the count to -1 on error to distinguish between EOF and error. Feb 19 15:20:22 2009 - read.c sig.c sig.h reset and redraw on sigcont. From Anon Ymous. Feb 15 21:24:13 2009 don't restart on EINTR, instead return NULL immediately. From Anon Ymous Approved by: re Modified: stable/8/lib/libedit/editline.3 stable/8/lib/libedit/el.h stable/8/lib/libedit/read.c stable/8/lib/libedit/sig.c stable/8/lib/libedit/sig.h Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/8/lib/libedit/editline.3 ============================================================================== --- stable/8/lib/libedit/editline.3 Mon Jul 9 14:16:49 2012 (r238298) +++ stable/8/lib/libedit/editline.3 Mon Jul 9 15:31:05 2012 (r238299) @@ -165,11 +165,6 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. -If an error occurred, -.Fa count -is set to \-1 and -.Dv errno -contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: stable/8/lib/libedit/el.h ============================================================================== --- stable/8/lib/libedit/el.h Mon Jul 9 14:16:49 2012 (r238298) +++ stable/8/lib/libedit/el.h Mon Jul 9 15:31:05 2012 (r238299) @@ -115,7 +115,6 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ - int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: stable/8/lib/libedit/read.c ============================================================================== --- stable/8/lib/libedit/read.c Mon Jul 9 14:16:49 2012 (r238298) +++ stable/8/lib/libedit/read.c Mon Jul 9 15:31:05 2012 (r238299) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include "el.h" -#define OKCMD -1 /* must be -1! */ +#define OKCMD -1 private int read__fixio(int, int); private int read_preread(EditLine *); @@ -170,7 +170,7 @@ read__fixio(int fd __unused, int e) return (e ? 0 : -1); case EINTR: - return (-1); + return (0); default: return (-1); @@ -235,12 +235,9 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; - el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ - el->el_errno = num == 0 ? 0 : errno; + if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ return (num); - } #ifdef KANJI if ((*ch & 0200)) { @@ -292,21 +289,14 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - again: - el->el_signal->sig_no = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) { - if (el->el_signal->sig_no == SIGCONT) { - sig_set(el); - el_set(el, EL_REFRESH); - goto again; - } + while ((num_read = read(el->el_infd, cp, 1)) == -1) if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - } + return (int)num_read; } @@ -413,20 +403,17 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; - int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ - if (nread == NULL) - nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { char *cp = el->el_line.buffer; size_t idx; - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space for next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -440,16 +427,12 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } @@ -460,8 +443,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - errno = 0; - *nread = 0; + if (nread) + *nread = 0; return (NULL); } } @@ -474,7 +457,6 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; - if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -482,7 +464,7 @@ el_gets(EditLine *el, int *nread) term__flush(el); - while ((num = (*el->el_read.read_char)(el, cp)) == 1) { + while ((*el->el_read.read_char)(el, cp) == 1) { /* make sure there is space next character */ if (cp + 1 >= el->el_line.limit) { idx = (cp - el->el_line.buffer); @@ -498,15 +480,11 @@ el_gets(EditLine *el, int *nread) break; } - if (num == -1) { - if (errno == EINTR) - cp = el->el_line.buffer; - el->el_errno = errno; - } - el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - goto done; + if (nread) + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + return (*nread ? el->el_line.buffer : NULL); } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -522,12 +500,6 @@ el_gets(EditLine *el, int *nread) #endif /* DEBUG_READ */ break; } - if (el->el_errno == EINTR) { - el->el_line.buffer[0] = '\0'; - el->el_line.lastchar = - el->el_line.cursor = el->el_line.buffer; - break; - } if ((unsigned int)cmdnum >= (unsigned int)el->el_map.nfunc) { /* BUG CHECK command */ #ifdef DEBUG_EDIT (void) fprintf(el->el_errfile, @@ -645,17 +617,12 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - *nread = num != -1 ? num : 0; + if (nread) + *nread = num; } else { - *nread = (int)(el->el_line.lastchar - el->el_line.buffer); + if (nread) + *nread = + (int)(el->el_line.lastchar - el->el_line.buffer); } -done: - if (*nread == 0) { - if (num == -1) { - *nread = -1; - errno = el->el_errno; - } - return NULL; - } else - return el->el_line.buffer; + return (num ? el->el_line.buffer : NULL); } Modified: stable/8/lib/libedit/sig.c ============================================================================== --- stable/8/lib/libedit/sig.c Mon Jul 9 14:16:49 2012 (r238298) +++ stable/8/lib/libedit/sig.c Mon Jul 9 15:31:05 2012 (r238299) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ + * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,8 +73,6 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); - sel->el_signal->sig_no = signo; - switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -160,12 +158,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; - nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { + nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: stable/8/lib/libedit/sig.h ============================================================================== --- stable/8/lib/libedit/sig.h Mon Jul 9 14:16:49 2012 (r238298) +++ stable/8/lib/libedit/sig.h Mon Jul 9 15:31:05 2012 (r238299) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp $ + * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ * $FreeBSD$ */ @@ -61,7 +61,6 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; - volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 15:44:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC787106566C; Mon, 9 Jul 2012 15:44:35 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9797C8FC18; Mon, 9 Jul 2012 15: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 q69FiZ9h026396; Mon, 9 Jul 2012 15:44:35 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69FiZMY026394; Mon, 9 Jul 2012 15:44:35 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207091544.q69FiZMY026394@svn.freebsd.org> From: Joel Dahl Date: Mon, 9 Jul 2012 15:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238300 - head/usr.sbin/rarpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 15:44:35 -0000 Author: joel (doc committer) Date: Mon Jul 9 15:44:35 2012 New Revision: 238300 URL: http://svn.freebsd.org/changeset/base/238300 Log: Remove end of line whitespace. Modified: head/usr.sbin/rarpd/rarpd.8 Modified: head/usr.sbin/rarpd/rarpd.8 ============================================================================== --- head/usr.sbin/rarpd/rarpd.8 Mon Jul 9 15:31:05 2012 (r238299) +++ head/usr.sbin/rarpd/rarpd.8 Mon Jul 9 15:44:35 2012 (r238300) @@ -96,7 +96,7 @@ instead of via Run in the foreground. .It Fl P Specify the pathname of the PID file. -If not specified, +If not specified, .Pa /var/run/rarpd.pid or .Pa /var/run/rarpd.ifname.pid From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 16:24:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C40C106564A; Mon, 9 Jul 2012 16:24:00 +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 EB8458FC08; Mon, 9 Jul 2012 16:23:59 +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 q69GNxh5028129; Mon, 9 Jul 2012 16:23:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69GNxhf028127; Mon, 9 Jul 2012 16:23:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207091623.q69GNxhf028127@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 9 Jul 2012 16:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238301 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 16:24:00 -0000 Author: marcel Date: Mon Jul 9 16:23:59 2012 New Revision: 238301 URL: http://svn.freebsd.org/changeset/base/238301 Log: Revert revision 238172 of agp_i810.c. Correctness is considered more important than avoiding confusion. Feedback from: kib, jhb Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Mon Jul 9 15:44:35 2012 (r238300) +++ head/sys/dev/agp/agp_i810.c Mon Jul 9 16:23:59 2012 (r238301) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include MALLOC_DECLARE(M_AGP); @@ -1438,7 +1439,7 @@ agp_i810_attach(device_t dev) if (error) return (error); - if (ptoa((vm_paddr_t)realmem) > + if (ptoa((vm_paddr_t)Maxmem) > (1ULL << sc->match->driver->busdma_addr_mask_sz) - 1) { device_printf(dev, "agp_i810 does not support physical " "memory above %ju.\n", (uintmax_t)(1ULL << From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 17:25:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1E7106564A; Mon, 9 Jul 2012 17:25:57 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB708FC08; Mon, 9 Jul 2012 17:25:57 +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 q69HPvB5030676; Mon, 9 Jul 2012 17:25:57 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69HPvO0030671; Mon, 9 Jul 2012 17:25:57 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201207091725.q69HPvO0030671@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 9 Jul 2012 17:25:57 +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: r238302 - in stable/9/sys/dev: cxgb cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 17:25:57 -0000 Author: np Date: Mon Jul 9 17:25:56 2012 New Revision: 238302 URL: http://svn.freebsd.org/changeset/base/238302 Log: Re-enable IFCAP_TSO6 in cxgb(4) and cxgbe(4) in stable/9. The kernel changes needed for all this to work have now been MFC'd to 9 by bz@. This is a direct commit to stable/9 that removes earlier changes made to drivers in this branch only. Approved by: re (kib) Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/t4_main.c Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_adapter.h Mon Jul 9 16:23:59 2012 (r238301) +++ stable/9/sys/dev/cxgb/cxgb_adapter.h Mon Jul 9 17:25:56 2012 (r238302) @@ -81,15 +81,6 @@ extern int cxgb_debug; #define MTX_DESTROY mtx_destroy #endif -#ifndef IFCAP_HWCSUM_IPV6 -#define IFCAP_HWCSUM_IPV6 0 -#define CSUM_TCP_IPV6 0 -#define CSUM_UDP_IPV6 0 -#define IFCAP_TXCSUM_IPV6 0 -#define IFCAP_RXCSUM_IPV6 0 -#define CSUM_DATA_VALID_IPV6 0 -#endif - enum { LF_NO = 0, LF_MAYBE, Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Mon Jul 9 16:23:59 2012 (r238301) +++ stable/9/sys/dev/cxgb/cxgb_main.c Mon Jul 9 17:25:56 2012 (r238302) @@ -987,7 +987,7 @@ cxgb_makedev(struct port_info *pi) #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6) -#define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6) +#define CXGB_CAP_ENABLE (CXGB_CAP) static int cxgb_port_attach(device_t dev) Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Mon Jul 9 16:23:59 2012 (r238301) +++ stable/9/sys/dev/cxgbe/adapter.h Mon Jul 9 17:25:56 2012 (r238302) @@ -57,15 +57,6 @@ MALLOC_DECLARE(M_CXGBE); #define CXGBE_UNIMPLEMENTED(s) \ panic("%s (%s, line %d) not implemented yet.", s, __FILE__, __LINE__) -#ifndef IFCAP_HWCSUM_IPV6 -#define IFCAP_HWCSUM_IPV6 0 -#define CSUM_TCP_IPV6 0 -#define CSUM_UDP_IPV6 0 -#define IFCAP_TXCSUM_IPV6 0 -#define IFCAP_RXCSUM_IPV6 0 -#define CSUM_DATA_VALID_IPV6 0 -#endif - #if defined(__i386__) || defined(__amd64__) static __inline void prefetch(void *x) Modified: stable/9/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_main.c Mon Jul 9 16:23:59 2012 (r238301) +++ stable/9/sys/dev/cxgbe/t4_main.c Mon Jul 9 17:25:56 2012 (r238302) @@ -824,7 +824,7 @@ cxgbe_probe(device_t dev) #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6) -#define T4_CAP_ENABLE (T4_CAP & ~IFCAP_TSO6) +#define T4_CAP_ENABLE (T4_CAP) static int cxgbe_attach(device_t dev) From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 19:50:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C509106566B; Mon, 9 Jul 2012 19:50:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3328FC0A; Mon, 9 Jul 2012 19:50:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C4368DCC; Mon, 9 Jul 2012 21:50:55 +0200 (CEST) Date: Mon, 9 Jul 2012 21:48:45 +0200 From: Pawel Jakub Dawidek To: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= Message-ID: <20120709194844.GD4003@garage.freebsd.pl> References: <201207072013.q67KDfHN082943@svn.freebsd.org> <20120707215424.GE1437@garage.freebsd.pl> <280C8AEE-F7E8-4AAE-87BF-E59D0249B74F@FreeBSD.org> <20120708213846.GF1437@garage.freebsd.pl> <739062A0-4339-46A3-AF8E-193BC57758BA@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="llIrKcgUOe3dCx0c" Content-Disposition: inline In-Reply-To: <739062A0-4339-46A3-AF8E-193BC57758BA@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238213 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 19:50:58 -0000 --llIrKcgUOe3dCx0c Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 09, 2012 at 09:19:29AM +0200, Edward Tomasz Napiera=C5=82a wrot= e: > Look, I really appreciate you're looking at this just six months after > explicitly refusing to talk to me about the design, but it would be great > if it was a _technical_ discussion. As you know I'm not going to be neither nice nor helpful to you. Just wanted to point out your changes are wrong. That's all I can do. This is my last e-mail on the subject. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --llIrKcgUOe3dCx0c Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/7NZwACgkQForvXbEpPzRfcwCg6w/hqPlck/nXkFOun8LrznQg EO8AoKt1M/uV25KdY/CNhN0Lx1flXnY4 =zGvQ -----END PGP SIGNATURE----- --llIrKcgUOe3dCx0c-- From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:11:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F0EB1065673; Mon, 9 Jul 2012 20:11:32 +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 B4CE58FC18; Mon, 9 Jul 2012 20:11: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 q69KBWjA037685; Mon, 9 Jul 2012 20:11:32 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69KBW5d037683; Mon, 9 Jul 2012 20:11:32 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207092011.q69KBW5d037683@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jul 2012 20:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238308 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:11:33 -0000 Author: hrs Date: Mon Jul 9 20:11:32 2012 New Revision: 238308 URL: http://svn.freebsd.org/changeset/base/238308 Log: Fix a missing ";". Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Mon Jul 9 19:27:48 2012 (r238307) +++ head/etc/devd.conf Mon Jul 9 20:11:32 2012 (r238308) @@ -320,7 +320,7 @@ notify 10 { notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; - action "/usr/local/etc/rc.d/postgresql restart" + action "/usr/local/etc/rc.d/postgresql restart"; }; */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:30:31 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00982106566B; Mon, 9 Jul 2012 20:30:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 4926E8FC08; Mon, 9 Jul 2012 20:30:30 +0000 (UTC) Received: from alph.allbsd.org (p2214-ipbf2707funabasi.chiba.ocn.ne.jp [123.225.119.214]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id q69KUBMe014546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Jul 2012 05:30:21 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id q69KUAf4075857; Tue, 10 Jul 2012 05:30:11 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 10 Jul 2012 05:30:02 +0900 (JST) Message-Id: <20120710.053002.914215153752773154.hrs@allbsd.org> To: melifaro@FreeBSD.org, net@FreeBSD.org From: Hiroki Sato In-Reply-To: <4FFA9723.5000301@FreeBSD.org> References: <4FFA894D.9050104@FreeBSD.org> <20120709.170813.339720376082380726.hrs@allbsd.org> <4FFA9723.5000301@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Jul_10_05_30_02_2012_869)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 10 Jul 2012 05:30:22 +0900 (JST) X-Spam-Status: No, score=-96.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT, RCVD_IN_RP_RNBL, SAMEHELOBY2HOP, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: net@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:30:31 -0000 ----Security_Multipart(Tue_Jul_10_05_30_02_2012_869)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Alexander V. Chernikov" wrote in <4FFA9723.5000301@FreeBSD.org>: me> On 09.07.2012 12:08, Hiroki Sato wrote: me> > "Alexander V. Chernikov" wrote me> > in<4FFA894D.9050104@FreeBSD.org>: me> > me> > I meant there was no strong objection. I am sorry for not commenting me> > your implementation, but at least for ipfw0 it is difficult to me> > decouple ifnet and bpf because the primary consumer is tcpdump(8), me> > which depends on NET_RT_IFLIST to find the target. Probably your me> tcpdump -i still works with interface name supplied. me> > solution can be used for usbdump(8). The reason why I committed the me> > patch now is there are reports that these pseudo interfaces made some me> > applications confused and/or caused some performance degradation on me> > 9.0R, and wanted to fix it in some way. me> Do you plan to take this to 9.1 ? Originally I thought of it but I think it was too late. It should be polished in -CURRENT for a while also in terms of how to hide the interfaces. me> > I am still open for more sophisticated implementation and have no me> > objection to replace mine with it. Do you have an idea about me> > converting it with a loadable module? me> Personally I think that the right way is to add user<>kernel interface me> for requesting interface list since this is the most major stopper for me> doing BPF-only providers. However this should be discussed with me> rpaulo@ and delphij@ (so most probably this skips 9.1). Adding a sysctl to list all of the struct bpf_if including ones with a fake ifp? Hm, my goal was just to hide usbusN and ipfw0 *by default* but there was no problem with having ipfw0 with an ifnet. I thought having ifnet was tolerable if its consumer was tcpdump-like one because there are a lot of packet dump utilities which obtain interface names from the system's network interface list. Hiding the interface is rather confusing from user's perspective. I do not stick to the committed code and have no objection about adding a new API if it is useful. Well, please let me check if I understand your idea correctly. Given that we add a new API to enumerate the interfaces including bpf-only providers with fake ifnets, which providers/utilities should be converted to use it? IMO usbusN would be a reasonable target but others still need a real ifnet. In my understanding, the advantage of using a fake ifnet is just to prevent it from appearing as an interface. Is it correct? me> And, as fallback solution we can probably add separate ipfwlog module me> which is quite easy but much less clean. I think whether having it as a kernel module or not is orthogonal to hiding the interface. If we support multiple instances of the pseudo interface (typical in a system with vnet), cloning capability is needed in any way. -- Hiroki ----Security_Multipart(Tue_Jul_10_05_30_02_2012_869)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk/7P0oACgkQTyzT2CeTzy3nFgCgi4rHRHX7M2iRk+1Fex+xjvuY uzQAnRZ5OgQKnlB+CkF2fnZOYae/SuVF =oK8F -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Jul_10_05_30_02_2012_869)---- From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:38:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 330B8106564A; Mon, 9 Jul 2012 20:38:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04B7F8FC0A; Mon, 9 Jul 2012 20:38:19 +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 q69KcINp038789; Mon, 9 Jul 2012 20:38:18 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69KcIi1038787; Mon, 9 Jul 2012 20:38:18 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207092038.q69KcIi1038787@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 9 Jul 2012 20:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238309 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:38:19 -0000 Author: trociny Date: Mon Jul 9 20:38:18 2012 New Revision: 238309 URL: http://svn.freebsd.org/changeset/base/238309 Log: In epair_clone_destroy(), when destroying the second half, we have to switch to its vnet before calling ether_ifdetach(). Otherwise if the second half resides in a different vnet, if_detach() silently fails leaving a stale pointer in V_ifnet list, and the system crashes trying to access this pointer later. Another solution could be not to allow to destroy epair unless both ends are in the home vnet. Discussed with: bz Tested by: delphij Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Mon Jul 9 20:11:32 2012 (r238308) +++ head/sys/net/if_epair.c Mon Jul 9 20:38:18 2012 (r238309) @@ -904,39 +904,41 @@ epair_clone_destroy(struct if_clone *ifc if_link_state_change(oifp, LINK_STATE_DOWN); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; oifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + /* + * Get rid of our second half. As the other of the two + * interfaces may reside in a different vnet, we need to + * switch before freeing them. + */ + CURVNET_SET_QUIET(oifp->if_vnet); ether_ifdetach(oifp); - ether_ifdetach(ifp); /* * Wait for all packets to be dispatched to if_input. - * The numbers can only go down as the interfaces are + * The numbers can only go down as the interface is * detached so there is no need to use atomics. */ - DPRINTF("sca refcnt=%u scb refcnt=%u\n", sca->refcount, scb->refcount); - EPAIR_REFCOUNT_ASSERT(sca->refcount == 1 && scb->refcount == 1, - ("%s: ifp=%p sca->refcount!=1: %d || ifp=%p scb->refcount!=1: %d", - __func__, ifp, sca->refcount, oifp, scb->refcount)); - - /* - * Get rid of our second half. - */ + DPRINTF("scb refcnt=%u\n", scb->refcount); + EPAIR_REFCOUNT_ASSERT(scb->refcount == 1, + ("%s: ifp=%p scb->refcount!=1: %d", __func__, oifp, scb->refcount)); oifp->if_softc = NULL; error = if_clone_destroyif(ifc, oifp); if (error) panic("%s: if_clone_destroyif() for our 2nd iface failed: %d", __func__, error); + if_free(oifp); + ifmedia_removeall(&scb->media); + free(scb, M_EPAIR); + CURVNET_RESTORE(); + ether_ifdetach(ifp); /* - * Finish cleaning up. Free them and release the unit. - * As the other of the two interfaces my reside in a different vnet, - * we need to switch before freeing them. + * Wait for all packets to be dispatched to if_input. */ - CURVNET_SET_QUIET(oifp->if_vnet); - if_free(oifp); - CURVNET_RESTORE(); + DPRINTF("sca refcnt=%u\n", sca->refcount); + EPAIR_REFCOUNT_ASSERT(sca->refcount == 1, + ("%s: ifp=%p sca->refcount!=1: %d", __func__, ifp, sca->refcount)); if_free(ifp); ifmedia_removeall(&sca->media); - ifmedia_removeall(&scb->media); - free(scb, M_EPAIR); free(sca, M_EPAIR); ifc_free_unit(ifc, unit); From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:42:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CFB2106564A; Mon, 9 Jul 2012 20:42:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3B58FC16; Mon, 9 Jul 2012 20:42: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 q69Kg9JM039043; Mon, 9 Jul 2012 20:42:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69Kg9uA039037; Mon, 9 Jul 2012 20:42:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207092042.q69Kg9uA039037@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jul 2012 20:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238310 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:42:09 -0000 Author: jhb Date: Mon Jul 9 20:42:08 2012 New Revision: 238310 URL: http://svn.freebsd.org/changeset/base/238310 Log: Partially revert r217515 so that the mem_range_softc variable is always present on x86 kernels. This fixes the build of kernels that include 'device acpi' but do not include 'device mem'. MFC after: 1 month Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mem.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mem.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Jul 9 20:38:18 2012 (r238309) +++ head/sys/amd64/amd64/machdep.c Mon Jul 9 20:42:08 2012 (r238310) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -206,6 +207,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + struct mtx dt_lock; /* lock for GDT and LDT */ static void Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Mon Jul 9 20:38:18 2012 (r238309) +++ head/sys/amd64/amd64/mem.c Mon Jul 9 20:42:08 2012 (r238310) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Jul 9 20:38:18 2012 (r238309) +++ head/sys/i386/i386/machdep.c Mon Jul 9 20:42:08 2012 (r238310) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -247,6 +248,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; Modified: head/sys/i386/i386/mem.c ============================================================================== --- head/sys/i386/i386/mem.c Mon Jul 9 20:38:18 2012 (r238309) +++ head/sys/i386/i386/mem.c Mon Jul 9 20:42:08 2012 (r238310) @@ -72,8 +72,6 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); -struct mem_range_softc mem_range_softc; - static struct sx memsxlock; SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock"); Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Mon Jul 9 20:38:18 2012 (r238309) +++ head/sys/pc98/pc98/machdep.c Mon Jul 9 20:42:08 2012 (r238310) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -216,6 +217,8 @@ struct pcpu __pcpu[MAXCPU]; struct mtx icu_lock; +struct mem_range_softc mem_range_softc; + static void cpu_startup(dummy) void *dummy; From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:49:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42DE21065670; Mon, 9 Jul 2012 20:49:23 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id 254A48FC17; Mon, 9 Jul 2012 20:49:23 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 7069511CBF; Mon, 9 Jul 2012 13:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1341866957; bh=zvtrKkjbYaJVTkq8RHhu1OT8zJM6ZtHItH9s2OBjBBk=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=1F21nhUHNbOCILw1hRtOFtc+ZAkuq/rwU8+6YhtIfVBw/P+l9XQc+OFetK2eB4yM/ Ut984cyV/XjhK3Vby/leIc2Va81swqxMTa7JhzliLCd0QaSKQ/s3O9CSsitGc9VJAt X1l6NMZiVDMazkJr6YjWsPiWIqUrhMydTcJEEafo= Message-ID: <4FFB43CD.4070802@delphij.net> Date: Mon, 09 Jul 2012 13:49:17 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Mikolaj Golub References: <201207092038.q69KcIi1038787@svn.freebsd.org> In-Reply-To: <201207092038.q69KcIi1038787@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, d@delphij.net Subject: Re: svn commit: r238309 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:49:23 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 07/09/12 13:38, Mikolaj Golub wrote: > Author: trociny Date: Mon Jul 9 20:38:18 2012 New Revision: > 238309 URL: http://svn.freebsd.org/changeset/base/238309 > > Log: In epair_clone_destroy(), when destroying the second half, we > have to switch to its vnet before calling ether_ifdetach(). > Otherwise if the second half resides in a different vnet, > if_detach() silently fails leaving a stale pointer in V_ifnet list, > and the system crashes trying to access this pointer later. > > Another solution could be not to allow to destroy epair unless > both ends are in the home vnet. > > Discussed with: bz Tested by: delphij Thanks! Since this affects RELENG_9 and RELENG_8, could you please also MFC after a settle period? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJP+0PMAAoJEG80Jeu8UPuz/ugH/2RmmdfCapeP9eQkIPkaImpm D5ghJ0fS6dOM87i5QY6c0rJU2TrcLZHkZGnuYv+BSMqCz5de8dw9s7UMM6sHLL92 i4tgpDE2DQxM4b5skR7yCBRES6IAiY6kDIgVskaS95PxA9wuJA4ohqS8pQ5Tp6h4 lM2urad7+FpYGLZRTWY2yOzgS/g2JZNEGSX6tPIAhg8xX1hryP869zjjHJGd4932 X6pPyRtNdTHB69t00UiVMbJPzcSLtue4ECTms0xCPKC7t0+VZXgiYWOJlNnPQYzy lUkcYy8ZIyUUTD0duOdyun4oQ7xNEdZgZxcRI0Ids68AQs2xUoddL0IyX1ZMe9w= =kSZl -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 20:55:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CAE9F106564A; Mon, 9 Jul 2012 20:55:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5418FC0C; Mon, 9 Jul 2012 20:55: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 q69KtdV8039638; Mon, 9 Jul 2012 20:55:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69KtdvE039633; Mon, 9 Jul 2012 20:55:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207092055.q69KtdvE039633@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jul 2012 20:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238311 - in head/sys: amd64/amd64 amd64/include i386/include i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 20:55:39 -0000 Author: jhb Date: Mon Jul 9 20:55:39 2012 New Revision: 238311 URL: http://svn.freebsd.org/changeset/base/238311 Log: Add a clts() wrapper around the 'clts' instruction to on x86 and use that to implement stop_emulating() in the fpu/npx code. Reimplement start_emulating() in the non-XEN case by using load_cr0() and rcr0() instead of the 'lmsw' and 'smsw' instructions. Intel explicitly discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in the description of these instructions in Volume 2 of the ADM. Reviewed by: kib MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h head/sys/i386/isa/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Mon Jul 9 20:42:08 2012 (r238310) +++ head/sys/amd64/amd64/fpu.c Mon Jul 9 20:55:39 2012 (r238311) @@ -73,10 +73,6 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) -#define start_emulating() __asm __volatile( \ - "smsw %%ax; orb %0,%%al; lmsw %%ax" \ - : : "n" (CR0_TS) : "ax") -#define stop_emulating() __asm __volatile("clts") static __inline void xrstor(char *addr, uint64_t mask) @@ -109,13 +105,14 @@ void fnstsw(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); void ldmxcsr(u_int csr); -void start_emulating(void); -void stop_emulating(void); void xrstor(char *addr, uint64_t mask); void xsave(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && !lint */ +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() + #define GET_FPU_CW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_cw) #define GET_FPU_SW(thread) ((thread)->td_pcb->pcb_save->sv_env.en_sw) Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Mon Jul 9 20:42:08 2012 (r238310) +++ head/sys/amd64/include/cpufunc.h Mon Jul 9 20:55:39 2012 (r238311) @@ -107,6 +107,13 @@ clflush(u_long addr) } static __inline void +clts(void) +{ + + __asm __volatile("clts"); +} + +static __inline void disable_intr(void) { __asm __volatile("cli" : : : "memory"); @@ -702,6 +709,9 @@ intr_restore(register_t rflags) int breakpoint(void); u_int bsfl(u_int mask); u_int bsrl(u_int mask); +void clflush(u_long addr); +void clts(void); +void cpuid_count(u_int ax, u_int cx, u_int *p); void disable_intr(void); void do_cpuid(u_int ax, u_int *p); void enable_intr(void); Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Mon Jul 9 20:42:08 2012 (r238310) +++ head/sys/i386/include/cpufunc.h Mon Jul 9 20:55:39 2012 (r238311) @@ -97,6 +97,13 @@ clflush(u_long addr) } static __inline void +clts(void) +{ + + __asm __volatile("clts"); +} + +static __inline void disable_intr(void) { #ifdef XEN @@ -688,6 +695,9 @@ intr_restore(register_t eflags) int breakpoint(void); u_int bsfl(u_int mask); u_int bsrl(u_int mask); +void clflush(u_long addr); +void clts(void); +void cpuid_count(u_int ax, u_int cx, u_int *p); void disable_intr(void); void do_cpuid(u_int ax, u_int *p); void enable_intr(void); Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Jul 9 20:42:08 2012 (r238310) +++ head/sys/i386/isa/npx.c Mon Jul 9 20:55:39 2012 (r238311) @@ -100,15 +100,6 @@ __FBSDID("$FreeBSD$"); #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #endif -#ifdef XEN -#define start_emulating() (HYPERVISOR_fpu_taskswitch(1)) -#define stop_emulating() (HYPERVISOR_fpu_taskswitch(0)) -#else -#define start_emulating() __asm __volatile( \ - "smsw %%ax; orb %0,%%al; lmsw %%ax" \ - : : "n" (CR0_TS) : "ax") -#define stop_emulating() __asm __volatile("clts") -#endif #else /* !(__GNUCLIKE_ASM && !lint) */ void fldcw(u_short cw); @@ -123,11 +114,17 @@ void frstor(caddr_t addr); void fxsave(caddr_t addr); void fxrstor(caddr_t addr); #endif -void start_emulating(void); -void stop_emulating(void); #endif /* __GNUCLIKE_ASM && !lint */ +#ifdef XEN +#define start_emulating() (HYPERVISOR_fpu_taskswitch(1)) +#define stop_emulating() (HYPERVISOR_fpu_taskswitch(0)) +#else +#define start_emulating() load_cr0(rcr0() | CR0_TS) +#define stop_emulating() clts() +#endif + #ifdef CPU_ENABLE_SSE #define GET_FPU_CW(thread) \ (cpu_fxsr ? \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 21:15:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E422106566C; Mon, 9 Jul 2012 21:15:29 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 882CE8FC12; Mon, 9 Jul 2012 21:15:28 +0000 (UTC) Received: by weyx56 with SMTP id x56so495775wey.13 for ; Mon, 09 Jul 2012 14:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=f7HNDWpqw3RSN6G8pf5Tadwciu6Lw6ppvuNyUgZbjFw=; b=odZhgPuzmCCAGI2nibiM7XKoyBZdmVKKkceOhRja/bNix+wMGm/9oLKEjqp81EFwV4 rpbu0aktKlPJbanbGA2UQz6TCNRsfiBRKI5cru2UT+gTLGkX4mg88iYVJcV0WDXrxhkB xz5Wu+df9Biw8nHiehKjgDAjapgeBOSzLPGsKTrFZf2rT6/HOR4GR+so3n9AKN+VIMbV FpiVI/dwVKfrfFCLfkEJdwRDUtV7VplRzKZVrKkb+r/OQkbydZvBAuny+ffO1y8LPvOK Ij0b6oRxlp2/FN41VTB7ciV3jKBiah/9v4LxwUPrlfd4TP3N22drXfjTJVk0tIx4q6Tu 9KiQ== Received: by 10.180.84.104 with SMTP id x8mr32488764wiy.20.1341868527665; Mon, 09 Jul 2012 14:15:27 -0700 (PDT) Received: from localhost ([95.69.175.25]) by mx.google.com with ESMTPS id w7sm18839599wiz.0.2012.07.09.14.15.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 14:15:26 -0700 (PDT) From: Mikolaj Golub To: d@delphij.net References: <201207092038.q69KcIi1038787@svn.freebsd.org> <4FFB43CD.4070802@delphij.net> X-Comment-To: Xin Li Sender: Mikolaj Golub Date: Tue, 10 Jul 2012 00:15:24 +0300 In-Reply-To: <4FFB43CD.4070802@delphij.net> (Xin Li's message of "Mon, 09 Jul 2012 13:49:17 -0700") Message-ID: <86sjd0vdoz.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238309 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 21:15:29 -0000 On Mon, 09 Jul 2012 13:49:17 -0700 Xin Li wrote: XL> On 07/09/12 13:38, Mikolaj Golub wrote: >> Author: trociny Date: Mon Jul 9 20:38:18 2012 New Revision: >> 238309 URL: http://svn.freebsd.org/changeset/base/238309 >> >> Log: In epair_clone_destroy(), when destroying the second half, we >> have to switch to its vnet before calling ether_ifdetach(). >> Otherwise if the second half resides in a different vnet, >> if_detach() silently fails leaving a stale pointer in V_ifnet list, >> and the system crashes trying to access this pointer later. >> >> Another solution could be not to allow to destroy epair unless >> both ends are in the home vnet. >> >> Discussed with: bz Tested by: delphij XL> Thanks! XL> Since this affects RELENG_9 and RELENG_8, could you please also MFC XL> after a settle period? Sure. Just forgot to add the 'MFC after' reminder. I am going to MFC it after stable/9 unfreeze unless someone really wants it in 9.1 and tests it a little. This does not look like a critical issue because of the existing workaround (which can be considered as a best practice): move both ends to the home vnet before destroying the epair. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 21:53:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1DB81065672; Mon, 9 Jul 2012 21:53:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6EA8FC12; Mon, 9 Jul 2012 21:53: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 q69LroYd042089; Mon, 9 Jul 2012 21:53:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69LroMC042087; Mon, 9 Jul 2012 21:53:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201207092153.q69LroMC042087@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 9 Jul 2012 21:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238313 - head/sys/dev/cxgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 21:53:50 -0000 Author: np Date: Mon Jul 9 21:53:50 2012 New Revision: 238313 URL: http://svn.freebsd.org/changeset/base/238313 Log: Fix a bug in code that calculates the number of the first interrupt vector for a port. This affected the gigabit ports of T422 cards (the ones with 2x10G ports and 2x1G ports). MFC after: will check with re@ Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Jul 9 21:46:07 2012 (r238312) +++ head/sys/dev/cxgbe/t4_sge.c Mon Jul 9 21:53:50 2012 (r238313) @@ -401,14 +401,16 @@ first_vector(struct port_info *pi) return (0); for_each_port(sc, i) { + struct port_info *p = sc->port[i]; + if (i == pi->port_id) break; #ifdef TCP_OFFLOAD if (sc->flags & INTR_DIRECT) - rc += pi->nrxq + pi->nofldrxq; + rc += p->nrxq + p->nofldrxq; else - rc += max(pi->nrxq, pi->nofldrxq); + rc += max(p->nrxq, p->nofldrxq); #else /* * Not compiled with offload support and intr_count > 1. Only @@ -419,7 +421,7 @@ first_vector(struct port_info *pi) ("%s: intr_count %d, !INTR_DIRECT", __func__, sc->intr_count)); - rc += pi->nrxq; + rc += p->nrxq; #endif } From owner-svn-src-all@FreeBSD.ORG Mon Jul 9 23:58:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A052A106566C; Mon, 9 Jul 2012 23:58:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72BD18FC0A; Mon, 9 Jul 2012 23:58:23 +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 q69NwNTm047237; Mon, 9 Jul 2012 23:58:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69NwNoi047235; Mon, 9 Jul 2012 23:58:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207092358.q69NwNoi047235@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Jul 2012 23:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238314 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 23:58:23 -0000 Author: adrian Date: Mon Jul 9 23:58:22 2012 New Revision: 238314 URL: http://svn.freebsd.org/changeset/base/238314 Log: Add some AR9300 HAL descriptor definition changes. * Add a couple of RX errors; * Add the spectral scan PHY error code; * extend the RX flags to be a 16 bit field, rather than an 8 bit field; * Add a new RX flag. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_desc.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Mon Jul 9 21:53:50 2012 (r238313) +++ head/sys/dev/ath/ath_hal/ah_desc.h Mon Jul 9 23:58:22 2012 (r238314) @@ -122,11 +122,12 @@ struct ath_rx_status { int8_t rs_rssi_ext[3]; /* rx frame RSSI [ext, chain 0-2] */ uint8_t rs_isaggr; /* is part of the aggregate */ uint8_t rs_moreaggr; /* more frames in aggr to follow */ + uint16_t rs_flags; /* misc flags */ uint8_t rs_num_delims; /* number of delims in aggr */ - uint8_t rs_flags; /* misc flags */ + uint8_t rs_spare0; /* padding */ uint32_t rs_evm0; /* evm bytes */ uint32_t rs_evm1; - uint32_t rs_evm2; + uint32_t rs_evm2; uint32_t rs_evm3; /* needed for ar9300 and later */ uint32_t rs_evm4; /* needed for ar9300 and later */ #endif /* AH_SUPPORT_AR5416 */ @@ -138,16 +139,19 @@ struct ath_rx_status { #define HAL_RXERR_FIFO 0x04 /* fifo overrun */ #define HAL_RXERR_DECRYPT 0x08 /* non-Michael decrypt error */ #define HAL_RXERR_MIC 0x10 /* Michael MIC decrypt error */ +#define HAL_RXERR_INCOMP 0x20 /* Rx Desc processing is incomplete */ +#define HAL_RXERR_KEYMISS 0x40 /* Key not found in keycache */ /* bits found in rs_flags */ -#define HAL_RX_MORE 0x01 /* more descriptors follow */ -#define HAL_RX_MORE_AGGR 0x02 /* more frames in aggr */ -#define HAL_RX_GI 0x04 /* full gi */ -#define HAL_RX_2040 0x08 /* 40 Mhz */ -#define HAL_RX_DELIM_CRC_PRE 0x10 /* crc error in delimiter pre */ -#define HAL_RX_DELIM_CRC_POST 0x20 /* crc error in delim after */ -#define HAL_RX_DECRYPT_BUSY 0x40 /* decrypt was too slow */ -#define HAL_RX_HI_RX_CHAIN 0x80 /* SM power save: hi Rx chain control */ +#define HAL_RX_MORE 0x0001 /* more descriptors follow */ +#define HAL_RX_MORE_AGGR 0x0002 /* more frames in aggr */ +#define HAL_RX_GI 0x0004 /* full gi */ +#define HAL_RX_2040 0x0008 /* 40 Mhz */ +#define HAL_RX_DELIM_CRC_PRE 0x0010 /* crc error in delimiter pre */ +#define HAL_RX_DELIM_CRC_POST 0x0020 /* crc error in delim after */ +#define HAL_RX_DECRYPT_BUSY 0x0040 /* decrypt was too slow */ +#define HAL_RX_HI_RX_CHAIN 0x0080 /* SM power save: hi Rx chain control */ +#define HAL_RX_IS_APSD 0x0100 /* Is ASPD trigger frame */ enum { HAL_PHYERR_UNDERRUN = 0, /* Transmit underrun */ @@ -178,6 +182,8 @@ enum { HAL_PHYERR_HT_CRC_ERROR = 34, /* */ HAL_PHYERR_HT_LENGTH_ILLEGAL = 35, /* */ HAL_PHYERR_HT_RATE_ILLEGAL = 36, /* */ + + HAL_PHYERR_SPECTRAL = 38, }; /* value found in rs_keyix to mark invalid entries */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 00:01:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF9E71065670; Tue, 10 Jul 2012 00:01:00 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B843E8FC08; Tue, 10 Jul 2012 00:01: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 q6A010Sm047403; Tue, 10 Jul 2012 00:01:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A010HT047396; Tue, 10 Jul 2012 00:01:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201207100001.q6A010HT047396@svn.freebsd.org> From: Attilio Rao Date: Tue, 10 Jul 2012 00:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238315 - head/sys/fs/ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 00:01:00 -0000 Author: attilio Date: Tue Jul 10 00:01:00 2012 New Revision: 238315 URL: http://svn.freebsd.org/changeset/base/238315 Log: - Remove the unused and not completed write support for NTFS. - Fix a bug where vfs_mountedfrom() is called also when the filesystem is not mounted successfully. Tested by: pho Modified: head/sys/fs/ntfs/ntfs_subr.c head/sys/fs/ntfs/ntfs_subr.h head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/ntfs/ntfs_vnops.c Modified: head/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.c Mon Jul 9 23:58:22 2012 (r238314) +++ head/sys/fs/ntfs/ntfs_subr.c Tue Jul 10 00:01:00 2012 (r238315) @@ -1353,174 +1353,6 @@ ntfs_filesize( } /* - * This is one of write routine. - */ -int -ntfs_writeattr_plain( - struct ntfsmount * ntmp, - struct ntnode * ip, - u_int32_t attrnum, - char *attrname, - off_t roff, - size_t rsize, - void *rdata, - size_t * initp, - struct uio *uio) -{ - size_t init; - int error = 0; - off_t off = roff, left = rsize, towrite; - caddr_t data = rdata; - struct ntvattr *vap; - *initp = 0; - - while (left) { - error = ntfs_ntvattrget(ntmp, ip, attrnum, attrname, - ntfs_btocn(off), &vap); - if (error) - return (error); - towrite = MIN(left, ntfs_cntob(vap->va_vcnend + 1) - off); - ddprintf(("ntfs_writeattr_plain: o: %d, s: %d (%d - %d)\n", - (u_int32_t) off, (u_int32_t) towrite, - (u_int32_t) vap->va_vcnstart, - (u_int32_t) vap->va_vcnend)); - error = ntfs_writentvattr_plain(ntmp, ip, vap, - off - ntfs_cntob(vap->va_vcnstart), - towrite, data, &init, uio); - if (error) { - printf("ntfs_writeattr_plain: " \ - "ntfs_writentvattr_plain failed: o: %d, s: %d\n", - (u_int32_t) off, (u_int32_t) towrite); - printf("ntfs_writeattr_plain: attrib: %d - %d\n", - (u_int32_t) vap->va_vcnstart, - (u_int32_t) vap->va_vcnend); - ntfs_ntvattrrele(vap); - break; - } - ntfs_ntvattrrele(vap); - left -= towrite; - off += towrite; - data = data + towrite; - *initp += init; - } - - return (error); -} - -/* - * This is one of write routine. - * - * ntnode should be locked. - */ -int -ntfs_writentvattr_plain( - struct ntfsmount * ntmp, - struct ntnode * ip, - struct ntvattr * vap, - off_t roff, - size_t rsize, - void *rdata, - size_t * initp, - struct uio *uio) -{ - int error = 0; - off_t off; - int cnt; - cn_t ccn, ccl, cn, left, cl; - caddr_t data = rdata; - struct buf *bp; - size_t tocopy; - - *initp = 0; - - if ((vap->va_flag & NTFS_AF_INRUN) == 0) { - printf("ntfs_writevattr_plain: CAN'T WRITE RES. ATTRIBUTE\n"); - return ENOTTY; - } - - ddprintf(("ntfs_writentvattr_plain: data in run: %ld chains\n", - vap->va_vruncnt)); - - off = roff; - left = rsize; - ccl = 0; - ccn = 0; - cnt = 0; - for (; left && (cnt < vap->va_vruncnt); cnt++) { - ccn = vap->va_vruncn[cnt]; - ccl = vap->va_vruncl[cnt]; - - ddprintf(("ntfs_writentvattr_plain: " \ - "left %d, cn: 0x%x, cl: %d, off: %d\n", \ - (u_int32_t) left, (u_int32_t) ccn, \ - (u_int32_t) ccl, (u_int32_t) off)); - - if (ntfs_cntob(ccl) < off) { - off -= ntfs_cntob(ccl); - cnt++; - continue; - } - if (!ccn && ip->i_number != NTFS_BOOTINO) - continue; /* XXX */ - - ccl -= ntfs_btocn(off); - cn = ccn + ntfs_btocn(off); - off = ntfs_btocnoff(off); - - while (left && ccl) { - /* - * Always read and write single clusters at a time - - * we need to avoid requesting differently-sized - * blocks at the same disk offsets to avoid - * confusing the buffer cache. - */ - tocopy = MIN(left, ntfs_cntob(1) - off); - cl = ntfs_btocl(tocopy + off); - KASSERT(cl == 1 && tocopy <= ntfs_cntob(1), - ("single cluster limit mistake")); - ddprintf(("ntfs_writentvattr_plain: write: " \ - "cn: 0x%x cl: %d, off: %d len: %d, left: %d\n", - (u_int32_t) cn, (u_int32_t) cl, - (u_int32_t) off, (u_int32_t) tocopy, - (u_int32_t) left)); - if ((off == 0) && (tocopy == ntfs_cntob(cl))) - { - bp = getblk(ntmp->ntm_devvp, ntfs_cntobn(cn) - * ntmp->ntm_multiplier, - ntfs_cntob(cl), 0, 0, 0); - clrbuf(bp); - } else { - error = bread(ntmp->ntm_devvp, ntfs_cntobn(cn) - * ntmp->ntm_multiplier, - ntfs_cntob(cl), NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } - } - if (uio) - uiomove(bp->b_data + off, tocopy, uio); - else - memcpy(bp->b_data + off, data, tocopy); - bawrite(bp); - data = data + tocopy; - *initp += tocopy; - off = 0; - left -= tocopy; - cn += cl; - ccl -= cl; - } - } - - if (left) { - printf("ntfs_writentvattr_plain: POSSIBLE RUN ERROR\n"); - error = EINVAL; - } - - return (error); -} - -/* * This is one of read routines. * * ntnode should be locked. Modified: head/sys/fs/ntfs/ntfs_subr.h ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.h Mon Jul 9 23:58:22 2012 (r238314) +++ head/sys/fs/ntfs/ntfs_subr.h Tue Jul 10 00:01:00 2012 (r238315) @@ -99,8 +99,6 @@ void ntfs_ntref(struct ntnode *); void ntfs_ntrele(struct ntnode *); void ntfs_ntput(struct ntnode *); int ntfs_loadntnode( struct ntfsmount *, struct ntnode * ); -int ntfs_writentvattr_plain(struct ntfsmount *, struct ntnode *, struct ntvattr *, off_t, size_t, void *, size_t *, struct uio *); -int ntfs_writeattr_plain(struct ntfsmount *, struct ntnode *, u_int32_t, char *, off_t, size_t, void *, size_t *, struct uio *); void ntfs_toupper_init(void); void ntfs_toupper_destroy(void); int ntfs_toupper_use(struct mount *, struct ntfsmount *); Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Mon Jul 9 23:58:22 2012 (r238314) +++ head/sys/fs/ntfs/ntfs_vfsops.c Tue Jul 10 00:01:00 2012 (r238315) @@ -152,7 +152,6 @@ static int ntfs_mount(struct mount *mp) { int err = 0, error; - accmode_t accmode; struct vnode *devvp; struct nameidata ndp; struct thread *td; @@ -162,6 +161,11 @@ ntfs_mount(struct mount *mp) if (vfs_filteropt(mp->mnt_optnew, ntfs_opts)) return (EINVAL); + /* Force mount as read-only. */ + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_RDONLY; + MNT_IUNLOCK(mp); + from = vfs_getopts(mp->mnt_optnew, "from", &error); if (error) return (error); @@ -173,11 +177,10 @@ ntfs_mount(struct mount *mp) if (mp->mnt_flag & MNT_UPDATE) { if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) { /* Process export requests in vfs_mount.c */ - goto success; + return (0); } else { printf("ntfs_mount(): MNT_UPDATE not supported\n"); - err = EINVAL; - goto error_1; + return (EINVAL); } } @@ -187,10 +190,8 @@ ntfs_mount(struct mount *mp) */ NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, from, td); err = namei(&ndp); - if (err) { - /* can't get devvp!*/ - goto error_1; - } + if (err) + return (err); NDFREE(&ndp, NDF_ONLY_PNBUF); devvp = ndp.ni_vp; @@ -203,10 +204,7 @@ ntfs_mount(struct mount *mp) * If mount by non-root, then verify that user has necessary * permissions on the device. */ - accmode = VREAD; - if ((mp->mnt_flag & MNT_RDONLY) == 0) - accmode |= VWRITE; - err = VOP_ACCESS(devvp, accmode, td->td_ucred, td); + err = VOP_ACCESS(devvp, VREAD, td->td_ucred, td); if (err) err = priv_check(td, PRIV_VFS_MOUNT_PERM); if (err) { @@ -244,22 +242,16 @@ ntfs_mount(struct mount *mp) * don't have to do it here unless we want to set it * to something other than "path" for some rason. */ - /* Save "mounted from" info for mount point (NULL pad)*/ - vfs_mountedfrom(mp, from); err = ntfs_mountfs(devvp, mp, td); + if (err == 0) { + + /* Save "mounted from" info for mount point. */ + vfs_mountedfrom(mp, from); + } } - if (err) { + if (err) vrele(devvp); - return (err); - } - - goto success; - -error_1: /* no state to back out*/ - /* XXX: missing NDFREE(&ndp, ...) */ - -success: return (err); } @@ -275,13 +267,12 @@ ntfs_mountfs(devvp, mp, td) struct buf *bp; struct ntfsmount *ntmp; struct cdev *dev = devvp->v_rdev; - int error, ronly, i, v; + int error, i, v; struct vnode *vp; struct g_consumer *cp; struct g_provider *pp; char *cs_ntfs, *cs_local; - ronly = (mp->mnt_flag & MNT_RDONLY) != 0; DROP_GIANT(); g_topology_lock(); @@ -296,7 +287,7 @@ ntfs_mountfs(devvp, mp, td) if ((pp != NULL) && ((pp->acr | pp->acw | pp->ace ) != 0)) error = EPERM; else - error = g_vfs_open(devvp, &cp, "ntfs", ronly ? 0 : 1); + error = g_vfs_open(devvp, &cp, "ntfs", 0); g_topology_unlock(); PICKUP_GIANT(); Modified: head/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vnops.c Mon Jul 9 23:58:22 2012 (r238314) +++ head/sys/fs/ntfs/ntfs_vnops.c Tue Jul 10 00:01:00 2012 (r238315) @@ -67,7 +67,6 @@ #include /* for pathconf(2) constants */ static vop_read_t ntfs_read; -static vop_write_t ntfs_write; static vop_getattr_t ntfs_getattr; static vop_inactive_t ntfs_inactive; static vop_reclaim_t ntfs_reclaim; @@ -78,7 +77,6 @@ static vop_open_t ntfs_open; static vop_close_t ntfs_close; static vop_readdir_t ntfs_readdir; static vop_cachedlookup_t ntfs_lookup; -static vop_fsync_t ntfs_fsync; static vop_pathconf_t ntfs_pathconf; static vop_vptofh_t ntfs_vptofh; @@ -272,6 +270,7 @@ ntfs_strategy(ap) register struct fnode *fp = VTOF(vp); register struct ntnode *ip = FTONT(fp); struct ntfsmount *ntmp = ip->i_mp; + u_int32_t toread; int error; dprintf(("ntfs_strategy: offset: %d, blkno: %d, lblkno: %d\n", @@ -281,99 +280,33 @@ ntfs_strategy(ap) dprintf(("strategy: bcount: %d flags: 0x%x\n", (u_int32_t)bp->b_bcount,bp->b_flags)); - if (bp->b_iocmd == BIO_READ) { - u_int32_t toread; + KASSERT(bp->b_iocmd == BIO_READ, ("Invalid buffer\n")); - if (ntfs_cntob(bp->b_blkno) >= fp->f_size) { - clrbuf(bp); - error = 0; - } else { - toread = MIN(bp->b_bcount, - fp->f_size-ntfs_cntob(bp->b_blkno)); - dprintf(("ntfs_strategy: toread: %d, fsize: %d\n", - toread,(u_int32_t)fp->f_size)); - - error = ntfs_readattr(ntmp, ip, fp->f_attrtype, - fp->f_attrname, ntfs_cntob(bp->b_blkno), - toread, bp->b_data, NULL); - - if (error) { - printf("ntfs_strategy: ntfs_readattr failed\n"); - bp->b_error = error; - bp->b_ioflags |= BIO_ERROR; - } - - bzero(bp->b_data + toread, bp->b_bcount - toread); - } + if (ntfs_cntob(bp->b_blkno) >= fp->f_size) { + clrbuf(bp); + error = 0; } else { - size_t tmp; - u_int32_t towrite; + toread = MIN(bp->b_bcount, + fp->f_size-ntfs_cntob(bp->b_blkno)); + dprintf(("ntfs_strategy: toread: %d, fsize: %d\n", + toread,(u_int32_t)fp->f_size)); + + error = ntfs_readattr(ntmp, ip, fp->f_attrtype, + fp->f_attrname, ntfs_cntob(bp->b_blkno), + toread, bp->b_data, NULL); - if (ntfs_cntob(bp->b_blkno) + bp->b_bcount >= fp->f_size) { - printf("ntfs_strategy: CAN'T EXTEND FILE\n"); - bp->b_error = error = EFBIG; + if (error) { + printf("ntfs_strategy: ntfs_readattr failed\n"); + bp->b_error = error; bp->b_ioflags |= BIO_ERROR; - } else { - towrite = MIN(bp->b_bcount, - fp->f_size-ntfs_cntob(bp->b_blkno)); - dprintf(("ntfs_strategy: towrite: %d, fsize: %d\n", - towrite,(u_int32_t)fp->f_size)); - - error = ntfs_writeattr_plain(ntmp, ip, fp->f_attrtype, - fp->f_attrname, ntfs_cntob(bp->b_blkno),towrite, - bp->b_data, &tmp, NULL); - - if (error) { - printf("ntfs_strategy: ntfs_writeattr fail\n"); - bp->b_error = error; - bp->b_ioflags |= BIO_ERROR; - } } + + bzero(bp->b_data + toread, bp->b_bcount - toread); } bufdone(bp); return (0); } -static int -ntfs_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; -{ - register struct vnode *vp = ap->a_vp; - register struct fnode *fp = VTOF(vp); - register struct ntnode *ip = FTONT(fp); - struct uio *uio = ap->a_uio; - struct ntfsmount *ntmp = ip->i_mp; - u_int64_t towrite; - size_t written; - int error; - - dprintf(("ntfs_write: ino: %d, off: %d resid: %d, segflg: %d\n",ip->i_number,(u_int32_t)uio->uio_offset,uio->uio_resid,uio->uio_segflg)); - dprintf(("ntfs_write: filesize: %d",(u_int32_t)fp->f_size)); - - if (uio->uio_resid + uio->uio_offset > fp->f_size) { - printf("ntfs_write: CAN'T WRITE BEYOND END OF FILE\n"); - return (EFBIG); - } - - towrite = MIN(uio->uio_resid, fp->f_size - uio->uio_offset); - - dprintf((", towrite: %d\n",(u_int32_t)towrite)); - - error = ntfs_writeattr_plain(ntmp, ip, fp->f_attrtype, - fp->f_attrname, uio->uio_offset, towrite, NULL, &written, uio); -#ifdef NTFS_DEBUG - if (error) - printf("ntfs_write: ntfs_writeattr failed: %d\n", error); -#endif - - return (error); -} - int ntfs_access(ap) struct vop_access_args /* { @@ -390,7 +323,7 @@ ntfs_access(ap) dprintf(("ntfs_access: %d\n",ip->i_number)); /* - * Disallow write attempts on read-only filesystems; + * Disallow write attempts as we assume read-only filesystems; * unless the file is a socket, fifo, or a block or * character device resident on the filesystem. */ @@ -399,8 +332,8 @@ ntfs_access(ap) case VDIR: case VLNK: case VREG: - if (vp->v_mount->mnt_flag & MNT_RDONLY) - return (EROFS); + return (EROFS); + default: break; } } @@ -630,7 +563,6 @@ ntfs_lookup(ap) return (error); if ((cnp->cn_flags & ISLASTCN) && - (dvp->v_mount->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) return (EROFS); @@ -679,24 +611,6 @@ ntfs_lookup(ap) } /* - * Flush the blocks of a file to disk. - * - * This function is worthless for vnodes that represent directories. Maybe we - * could just do a sync if they try an fsync on a directory file. - */ -static int -ntfs_fsync(ap) - struct vop_fsync_args /* { - struct vnode *a_vp; - struct ucred *a_cred; - int a_waitfor; - struct thread *a_td; - } */ *ap; -{ - return (0); -} - -/* * Return POSIX pathconf information applicable to NTFS filesystem */ int @@ -756,7 +670,6 @@ struct vop_vector ntfs_vnodeops = { .vop_bmap = ntfs_bmap, .vop_cachedlookup = ntfs_lookup, .vop_close = ntfs_close, - .vop_fsync = ntfs_fsync, .vop_getattr = ntfs_getattr, .vop_inactive = ntfs_inactive, .vop_lookup = vfs_cache_lookup, @@ -766,6 +679,5 @@ struct vop_vector ntfs_vnodeops = { .vop_readdir = ntfs_readdir, .vop_reclaim = ntfs_reclaim, .vop_strategy = ntfs_strategy, - .vop_write = ntfs_write, .vop_vptofh = ntfs_vptofh, }; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 00:02:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3DA31065672; Tue, 10 Jul 2012 00:02:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59938FC1B; Tue, 10 Jul 2012 00:02:19 +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 q6A02JUw047494; Tue, 10 Jul 2012 00:02:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A02JoB047490; Tue, 10 Jul 2012 00:02:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100002.q6A02JoB047490@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 00:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238316 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 00:02:19 -0000 Author: adrian Date: Tue Jul 10 00:02:19 2012 New Revision: 238316 URL: http://svn.freebsd.org/changeset/base/238316 Log: Convert sc_rxpending to a per-EDMA queue, and use that for the legacy code. Prepare ath_rx_pkt() to handle multiple RX queues, and default the legacy RX queue to use the HP queue. Modified: head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jul 10 00:01:00 2012 (r238315) +++ head/sys/dev/ath/if_ath_rx.c Tue Jul 10 00:02:19 2012 (r238316) @@ -463,9 +463,9 @@ ath_handle_micerror(struct ieee80211com } } -static int +int ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status, - uint64_t tsf, int nf, struct ath_buf *bf) + uint64_t tsf, int nf, HAL_RX_QUEUE qtype, struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; struct mbuf *m = bf->bf_m; @@ -475,6 +475,7 @@ ath_rx_pkt(struct ath_softc *sc, struct struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni; int is_good = 0; + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; /* * Calculate the correct 64 bit TSF given @@ -559,9 +560,9 @@ rx_error: /* * Cleanup any pending partial frame. */ - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; + if (re->m_rxpending != NULL) { + m_freem(re->m_rxpending); + re->m_rxpending = NULL; } /* * When a tap is present pass error frames @@ -608,25 +609,25 @@ rx_accept: * it for the next completed descriptor, it * will be used to construct a jumbogram. */ - if (sc->sc_rxpending != NULL) { + if (re->m_rxpending != NULL) { /* NB: max frame size is currently 2 clusters */ sc->sc_stats.ast_rx_toobig++; - m_freem(sc->sc_rxpending); + m_freem(re->m_rxpending); } m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = len; - sc->sc_rxpending = m; + re->m_rxpending = m; goto rx_next; - } else if (sc->sc_rxpending != NULL) { + } else if (re->m_rxpending != NULL) { /* * This is the second part of a jumbogram, * chain it to the first mbuf, adjust the * frame length, and clear the rxpending state. */ - sc->sc_rxpending->m_next = m; - sc->sc_rxpending->m_pkthdr.len += len; - m = sc->sc_rxpending; - sc->sc_rxpending = NULL; + re->m_rxpending->m_next = m; + re->m_rxpending->m_pkthdr.len += len; + m = re->m_rxpending; + re->m_rxpending = NULL; } else { /* * Normal single-descriptor receive; setup @@ -883,7 +884,7 @@ ath_rx_proc(struct ath_softc *sc, int re /* * Process a single frame. */ - if (ath_rx_pkt(sc, rs, status, tsf, nf, bf)) + if (ath_rx_pkt(sc, rs, status, tsf, nf, HAL_RX_QUEUE_HP, bf)) ngood++; rx_proc_next: TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); @@ -1016,9 +1017,16 @@ ath_legacy_stoprecv(struct ath_softc *sc } } #endif - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; + /* + * Free both high/low RX pending, just in case. + */ + if (sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending != NULL) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; + } + if (sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending != NULL) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; } sc->sc_rxlink = NULL; /* just in case */ #undef PA2DESC @@ -1034,7 +1042,8 @@ ath_legacy_startrecv(struct ath_softc *s struct ath_buf *bf; sc->sc_rxlink = NULL; - sc->sc_rxpending = NULL; + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { int error = ath_rxbuf_init(sc, bf); if (error != 0) { Modified: head/sys/dev/ath/if_ath_rx.h ============================================================================== --- head/sys/dev/ath/if_ath_rx.h Tue Jul 10 00:01:00 2012 (r238315) +++ head/sys/dev/ath/if_ath_rx.h Tue Jul 10 00:02:19 2012 (r238316) @@ -56,6 +56,10 @@ extern void ath_stoprecv(struct ath_soft extern int ath_startrecv(struct ath_softc *sc); #endif +extern int ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, + HAL_STATUS status, uint64_t tsf, int nf, HAL_RX_QUEUE qtype, + struct ath_buf *bf); + extern void ath_recv_setup_legacy(struct ath_softc *sc); #endif Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jul 10 00:01:00 2012 (r238315) +++ head/sys/dev/ath/if_athvar.h Tue Jul 10 00:02:19 2012 (r238316) @@ -531,7 +531,6 @@ struct ath_softc { struct ath_descdma sc_rxdma; /* RX descriptors */ ath_bufhead sc_rxbuf; /* receive buffer */ - struct mbuf *sc_rxpending; /* pending receive data */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct task sc_rxtask; /* rx int processing */ u_int8_t sc_defant; /* current default antenna */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 00:08:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65C5A1065670; Tue, 10 Jul 2012 00:08:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED7B8FC0A; Tue, 10 Jul 2012 00:08:40 +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 q6A08eP9047784; Tue, 10 Jul 2012 00:08:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A08eiq047782; Tue, 10 Jul 2012 00:08:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100008.q6A08eiq047782@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 00:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238317 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 00:08:40 -0000 Author: adrian Date: Tue Jul 10 00:08:39 2012 New Revision: 238317 URL: http://svn.freebsd.org/changeset/base/238317 Log: Implement EDMA RX for AR93xx and later chips. This is inspired by ath9k and the reference driver, but it's a new implementation of the RX FIFO handling. This has some issues - notably the FIFO needs to be reprogrammed when the chip is reset. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 00:02:19 2012 (r238316) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 00:08:39 2012 (r238317) @@ -117,6 +117,38 @@ __FBSDID("$FreeBSD$"); #include +/* + * some general macros + */ +#define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1) +#define DECR(_l, _sz) (_l) --; (_l) &= ((_sz) - 1) + +MALLOC_DECLARE(M_ATHDEV); + +/* + * XXX TODO: + * + * + Add an RX lock, just to ensure we don't have things clash; + * + Make sure the FIFO is correctly flushed and reinitialised + * through a reset; + * + Handle the "kickpcu" state where the FIFO overflows. + * + Implement a "flush" routine, which doesn't push any + * new frames into the FIFO. + * + Verify multi-descriptor frames work! + * + There's a "memory use after free" which needs to be tracked down + * and fixed ASAP. I've seen this in the legacy path too, so it + * may be a generic RX path issue. + */ + +/* + * XXX shuffle the function orders so these pre-declarations aren't + * required! + */ +static int ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUEUE qtype, + int nbufs); +static int ath_edma_rxfifo_flush(struct ath_softc *sc, HAL_RX_QUEUE qtype); +static void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf); + static void ath_edma_stoprecv(struct ath_softc *sc, int dodelay) { @@ -128,25 +160,51 @@ ath_edma_stoprecv(struct ath_softc *sc, DELAY(3000); - if (sc->sc_rxpending != NULL) { - m_freem(sc->sc_rxpending); - sc->sc_rxpending = NULL; + /* Flush RX pending for each queue */ + /* XXX should generic-ify this */ + if (sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; } - sc->sc_rxlink = NULL; + if (sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; + } } +/* + * Start receive. + * + * XXX TODO: this needs to reallocate the FIFO entries when a reset + * occurs, in case the FIFO is filled up and no new descriptors get + * thrown into the FIFO. + */ static int ath_edma_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; - sc->sc_rxlink = NULL; - sc->sc_rxpending = NULL; + /* Enable RX FIFO */ + ath_hal_rxena(ah); + + /* + * XXX write out a complete set of FIFO entries based on + * what's currently available. + */ + + /* Add up to m_fifolen entries in each queue */ + /* + * These must occur after the above write so the FIFO buffers + * are pushed/tracked in the same order as the hardware will + * process them. + */ + ath_edma_rxfifo_alloc(sc, HAL_RX_QUEUE_HP, + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_fifolen); + + ath_edma_rxfifo_alloc(sc, HAL_RX_QUEUE_LP, + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_fifolen); - /* XXX setup HP RX queue FIFO pointer */ - /* XXX setup LP RX queue FIFO pointer */ - /* XXX ath_hal_rxena() */ ath_mode_init(sc); ath_hal_startpcurecv(ah); return (0); @@ -157,6 +215,113 @@ ath_edma_recv_flush(struct ath_softc *sc { device_printf(sc->sc_dev, "%s: called\n", __func__); + + /* + * XXX for now, free all descriptors. Later on, complete + * what can be completed! + */ +#if 0 + ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_HP); + ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_LP); +#endif +} + +/* + * Process frames from the current queue. + * + * TODO: + * + * + Add a "dosched" flag, so we don't reschedule any FIFO frames + * to the hardware or re-kick the PCU after 'kickpcu' is set. + * + * + Perhaps split "check FIFO contents" and "handle frames", so + * we can run the "check FIFO contents" in ath_intr(), but + * "handle frames" in the RX tasklet. + */ +static int +ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + struct ath_rx_status *rs; + struct ath_desc *ds; + struct ath_buf *bf; + int n = 0; + struct mbuf *m; + HAL_STATUS status; + struct ath_hal *ah = sc->sc_ah; + uint64_t tsf; + int16_t nf; + + tsf = ath_hal_gettsf64(ah); + nf = ath_hal_getchannoise(ah, sc->sc_curchan); + sc->sc_stats.ast_rx_noise = nf; + + do { + bf = re->m_fifo[re->m_fifo_head]; + /* This shouldn't occur! */ + if (bf == NULL) { + device_printf(sc->sc_dev, "%s: Q%d: NULL bf?\n", + __func__, + qtype); + break; + } + m = bf->bf_m; + ds = bf->bf_desc; + + /* + * Sync descriptor memory - this also syncs the buffer for us. + * + * EDMA descriptors are in cached memory. + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_POSTREAD); + rs = &bf->bf_status.ds_rxstat; + status = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, NULL, rs); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_RECV_DESC) + ath_printrxbuf(sc, bf, 0, status == HAL_OK); +#endif + if (status == HAL_EINPROGRESS) + break; + + /* + * Completed descriptor. + * + * In the future we'll call ath_rx_pkt(), but it first + * has to be taught about EDMA RX queues (so it can + * access sc_rxpending correctly.) + */ + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: Q%d: completed!\n", __func__, qtype); + + /* + * Remove the FIFO entry! + */ + re->m_fifo[re->m_fifo_head] = NULL; + + /* + * Skip the RX descriptor status - start at the data offset + */ + m_adj(m, sc->sc_rx_statuslen); + + /* Handle the frame */ + (void) ath_rx_pkt(sc, rs, status, tsf, nf, qtype, bf); + + /* Free the buffer/mbuf */ + ath_edma_rxbuf_free(sc, bf); + + /* Bump the descriptor FIFO stats */ + INCR(re->m_fifo_head, re->m_fifolen); + re->m_fifo_depth--; + /* XXX check it doesn't fall below 0 */ + } while (re->m_fifo_depth > 0); + + /* Handle resched and kickpcu appropriately */ + + /* Append some more fresh frames to the FIFO */ + ath_edma_rxfifo_alloc(sc, qtype, re->m_fifolen); + + return (n); } static void @@ -164,18 +329,326 @@ ath_edma_recv_tasklet(void *arg, int npe { struct ath_softc *sc = (struct ath_softc *) arg; - device_printf(sc->sc_dev, "%s: called; npending=%d\n", + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; npending=%d\n", __func__, npending); - /* XXX TODO */ + + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP); + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP); } +/* + * Allocate an RX mbuf for the given ath_buf and initialise + * it for EDMA. + * + * + Allocate a 4KB mbuf; + * + Setup the DMA map for the given buffer; + * + Keep a pointer to the start of the mbuf - that's where the + * descriptor lies; + * + Take a pointer to the start of the RX buffer, set the + * mbuf "start" to be there; + * + Return that. + */ static int ath_edma_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) { - device_printf(sc->sc_dev, "%s: called; bf=%p\n", __func__, bf); - return (EIO); + struct mbuf *m; + int error; + int len; + +// device_printf(sc->sc_dev, "%s: called; bf=%p\n", __func__, bf); + + m = m_getm(NULL, sc->sc_edma_bufsize, M_DONTWAIT, MT_DATA); + if (! m) + return (ENOBUFS); /* XXX ?*/ + + /* XXX warn/enforce alignment */ + + len = m->m_ext.ext_size; +#if 0 + device_printf(sc->sc_dev, "%s: called: m=%p, size=%d, mtod=%p\n", + __func__, + m, + len, + mtod(m, char *)); +#endif + + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + + /* + * Create DMA mapping. + */ + error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, + bf->bf_dmamap, m, bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sc_dev, "%s: failed; error=%d\n", + __func__, + error); + m_freem(m); + return (error); + } + + /* + * Populate ath_buf fields. + */ + + bf->bf_desc = mtod(m, struct ath_desc *); + bf->bf_daddr = bf->bf_segs[0].ds_addr; + bf->bf_lastds = bf->bf_desc; /* XXX only really for TX? */ + bf->bf_m = m; + + /* Zero the descriptor */ + memset(bf->bf_desc, '\0', sc->sc_rx_statuslen); + +#if 0 + /* + * Adjust mbuf header and length/size to compensate for the + * descriptor size. + */ + m_adj(m, sc->sc_rx_statuslen); +#endif + + /* Finish! */ + + return (0); +} + +static struct ath_buf * +ath_edma_rxbuf_alloc(struct ath_softc *sc) +{ + struct ath_buf *bf; + int error; + + /* Allocate buffer */ + bf = TAILQ_FIRST(&sc->sc_rxbuf); + /* XXX shouldn't happen upon startup? */ + if (bf == NULL) + return (NULL); + + /* Remove it from the free list */ + TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); + + /* Assign RX mbuf to it */ + error = ath_edma_rxbuf_init(sc, bf); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: bf=%p, rxbuf alloc failed! error=%d\n", + __func__, + bf, + error); + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + return (NULL); + } + + return (bf); +} + +static void +ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf) +{ + + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + + if (bf->bf_m) { + m_freem(bf->bf_m); + bf->bf_m = NULL; + } + + /* XXX lock? */ + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); +} + +/* + * Allocate up to 'n' entries and push them onto the hardware FIFO. + * + * Return how many entries were successfully pushed onto the + * FIFO. + */ +static int +ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUEUE qtype, int nbufs) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + struct ath_buf *bf; + int i; + + /* + * Allocate buffers until the FIFO is full or nbufs is reached. + */ + for (i = 0; i < nbufs && re->m_fifo_depth < re->m_fifolen; i++) { + /* Ensure the FIFO is already blank, complain loudly! */ + if (re->m_fifo[re->m_fifo_tail] != NULL) { + device_printf(sc->sc_dev, + "%s: Q%d: fifo[%d] != NULL (%p)\n", + __func__, + qtype, + re->m_fifo_tail, + re->m_fifo[re->m_fifo_tail]); + + /* Free the slot */ + ath_edma_rxbuf_free(sc, re->m_fifo[re->m_fifo_tail]); + re->m_fifo_depth--; + /* XXX check it's not < 0 */ + re->m_fifo[re->m_fifo_tail] = NULL; + } + + bf = ath_edma_rxbuf_alloc(sc); + /* XXX should ensure the FIFO is not NULL? */ + if (bf == NULL) { + device_printf(sc->sc_dev, "%s: Q%d: alloc failed?\n", + __func__, + qtype); + break; + } + + re->m_fifo[re->m_fifo_tail] = bf; + + /* + * Flush the descriptor contents before it's handed to the + * hardware. + */ + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_PREREAD); + + /* Write to the RX FIFO */ + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: putrxbuf=%p\n", + __func__, + qtype, + bf->bf_desc); + ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); + + re->m_fifo_depth++; + INCR(re->m_fifo_tail, re->m_fifolen); + } + + /* + * Return how many were allocated. + */ + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: nbufs=%d, nalloced=%d\n", + __func__, + qtype, + nbufs, + i); + return (i); +} + +static int +ath_edma_rxfifo_flush(struct ath_softc *sc, HAL_RX_QUEUE qtype) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + int i; + + for (i = 0; i < re->m_fifolen; i++) { + if (re->m_fifo[i] != NULL) { + struct ath_buf *bf = re->m_fifo[i]; +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_RECV_DESC) + ath_printrxbuf(sc, bf, 0, HAL_OK); +#endif + ath_edma_rxbuf_free(sc, re->m_fifo[i]); + re->m_fifo[i] = NULL; + re->m_fifo_depth--; + } + } + + if (re->m_rxpending != NULL) { + m_freem(re->m_rxpending); + re->m_rxpending = NULL; + } + re->m_fifo_head = re->m_fifo_tail = re->m_fifo_depth = 0; + + return (0); +} + +/* + * Setup the initial RX FIFO structure. + */ +static int +ath_edma_setup_rxfifo(struct ath_softc *sc, HAL_RX_QUEUE qtype) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + + if (! ath_hal_getrxfifodepth(sc->sc_ah, qtype, &re->m_fifolen)) { + device_printf(sc->sc_dev, "%s: qtype=%d, failed\n", + __func__, + qtype); + return (-EINVAL); + } + device_printf(sc->sc_dev, "%s: type=%d, FIFO depth = %d entries\n", + __func__, + qtype, + re->m_fifolen); + + /* Allocate ath_buf FIFO array, pre-zero'ed */ + re->m_fifo = malloc(sizeof(struct ath_buf *) * re->m_fifolen, + M_ATHDEV, + M_NOWAIT | M_ZERO); + if (re->m_fifo == NULL) { + device_printf(sc->sc_dev, "%s: malloc failed\n", + __func__); + return (-ENOMEM); + } + + /* + * Set initial "empty" state. + */ + re->m_rxpending = NULL; + re->m_fifo_head = re->m_fifo_tail = re->m_fifo_depth = 0; + + return (0); +} + +static int +ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEUE qtype) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + + device_printf(sc->sc_dev, "%s: called; qtype=%d\n", + __func__, + qtype); + + free(re->m_fifo, M_ATHDEV); + + return (0); +} + +static int +ath_edma_dma_rxsetup(struct ath_softc *sc) +{ + int error; + + /* Create RX DMA tag */ + /* Create RX ath_buf array */ + + error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + "rx", ath_rxbuf, 1); + if (error != 0) + return error; + + (void) ath_edma_setup_rxfifo(sc, HAL_RX_QUEUE_HP); + (void) ath_edma_setup_rxfifo(sc, HAL_RX_QUEUE_LP); + + return (0); +} + +static int +ath_edma_dma_rxteardown(struct ath_softc *sc) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); + + ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_HP); + ath_edma_rxfifo_free(sc, HAL_RX_QUEUE_HP); + + ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_LP); + ath_edma_rxfifo_free(sc, HAL_RX_QUEUE_LP); + + /* Free RX ath_buf */ + /* Free RX DMA tag */ + if (sc->sc_rxdma.dd_desc_len != 0) + ath_descdma_cleanup(sc, &sc->sc_rxdma, &sc->sc_rxbuf); + + return (0); } void @@ -184,9 +657,35 @@ ath_recv_setup_edma(struct ath_softc *sc device_printf(sc->sc_dev, "DMA setup: EDMA\n"); + /* Set buffer size to 4k */ + sc->sc_edma_bufsize = 4096; + + /* Configure the hardware with this */ + (void) ath_hal_setrxbufsize(sc->sc_ah, sc->sc_edma_bufsize); + + /* Fetch EDMA field and buffer sizes */ + (void) ath_hal_getrxstatuslen(sc->sc_ah, &sc->sc_rx_statuslen); + (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); + (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); + (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); + + device_printf(sc->sc_dev, "RX status length: %d\n", + sc->sc_rx_statuslen); + device_printf(sc->sc_dev, "TX descriptor length: %d\n", + sc->sc_tx_desclen); + device_printf(sc->sc_dev, "TX status length: %d\n", + sc->sc_tx_statuslen); + device_printf(sc->sc_dev, "TX/RX buffer size: %d\n", + sc->sc_edma_bufsize); + device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", + sc->sc_tx_nmaps); + sc->sc_rx.recv_stop = ath_edma_stoprecv; sc->sc_rx.recv_start = ath_edma_startrecv; sc->sc_rx.recv_flush = ath_edma_recv_flush; sc->sc_rx.recv_tasklet = ath_edma_recv_tasklet; sc->sc_rx.recv_rxbuf_init = ath_edma_rxbuf_init; + + sc->sc_rx.recv_setup = ath_edma_dma_rxsetup; + sc->sc_rx.recv_teardown = ath_edma_dma_rxteardown; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 00:23:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49336106566B; Tue, 10 Jul 2012 00:23:26 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC9C8FC08; Tue, 10 Jul 2012 00:23: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 q6A0NPw9048497; Tue, 10 Jul 2012 00:23:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A0NPbb048495; Tue, 10 Jul 2012 00:23:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201207100023.q6A0NPbb048495@svn.freebsd.org> From: Attilio Rao Date: Tue, 10 Jul 2012 00:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238320 - head/sys/fs/ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 00:23:26 -0000 Author: attilio Date: Tue Jul 10 00:23:25 2012 New Revision: 238320 URL: http://svn.freebsd.org/changeset/base/238320 Log: Remove a check on MNTK_UPDATE that is not really necessary as it is handled in a code snippet above. Modified: head/sys/fs/ntfs/ntfs_vfsops.c Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Tue Jul 10 00:14:42 2012 (r238319) +++ head/sys/fs/ntfs/ntfs_vfsops.c Tue Jul 10 00:23:25 2012 (r238320) @@ -212,45 +212,22 @@ ntfs_mount(struct mount *mp) return (err); } - if (mp->mnt_flag & MNT_UPDATE) { -#if 0 - /* - ******************** - * UPDATE - ******************** - */ - - if (devvp != ntmp->um_devvp) - err = EINVAL; /* needs translation */ - vput(devvp); - if (err) - return (err); -#endif - } else { - /* - ******************** - * NEW MOUNT - ******************** - */ - - /* - * Since this is a new mount, we want the names for - * the device and the mount point copied in. If an - * error occurs, the mountpoint is discarded by the - * upper level code. Note that vfs_mount() handles - * copying the mountpoint f_mntonname for us, so we - * don't have to do it here unless we want to set it - * to something other than "path" for some rason. - */ - err = ntfs_mountfs(devvp, mp, td); - if (err == 0) { + /* + * Since this is a new mount, we want the names for the device and + * the mount point copied in. If an error occurs, the mountpoint is + * discarded by the upper level code. Note that vfs_mount() handles + * copying the mountpoint f_mntonname for us, so we don't have to do + * it here unless we want to set it to something other than "path" + * for some rason. + */ - /* Save "mounted from" info for mount point. */ - vfs_mountedfrom(mp, from); - } - } - if (err) + err = ntfs_mountfs(devvp, mp, td); + if (err == 0) { + + /* Save "mounted from" info for mount point. */ + vfs_mountedfrom(mp, from); + } else vrele(devvp); return (err); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 01:13:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E363C106567A; Tue, 10 Jul 2012 01:13:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3708FC18; Tue, 10 Jul 2012 01:13: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 q6A1D0F6050796; Tue, 10 Jul 2012 01:13:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A1D0lN050794; Tue, 10 Jul 2012 01:13:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100113.q6A1D0lN050794@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 01:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238325 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 01:13:01 -0000 Author: imp Date: Tue Jul 10 01:13:00 2012 New Revision: 238325 URL: http://svn.freebsd.org/changeset/base/238325 Log: There's nothing AT91RM9200 specific about this file at all. Modified: head/sys/arm/at91/uart_bus_at91usart.c Modified: head/sys/arm/at91/uart_bus_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_bus_at91usart.c Tue Jul 10 00:58:40 2012 (r238324) +++ head/sys/arm/at91/uart_bus_at91usart.c Tue Jul 10 01:13:00 2012 (r238325) @@ -42,33 +42,32 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "uart_if.h" -static int usart_at91rm92_probe(device_t dev); +static int usart_at91_probe(device_t dev); extern struct uart_class at91_usart_class; -static device_method_t usart_at91rm92_methods[] = { +static device_method_t usart_at91_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, usart_at91rm92_probe), + DEVMETHOD(device_probe, usart_at91_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), { 0, 0 } }; -static driver_t usart_at91rm92_driver = { +static driver_t usart_at91_driver = { uart_driver_name, - usart_at91rm92_methods, + usart_at91_methods, sizeof(struct uart_softc), }; extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; static int -usart_at91rm92_probe(device_t dev) +usart_at91_probe(device_t dev) { struct uart_softc *sc; @@ -104,4 +103,4 @@ usart_at91rm92_probe(device_t dev) } -DRIVER_MODULE(uart, atmelarm, usart_at91rm92_driver, uart_devclass, 0, 0); +DRIVER_MODULE(uart, atmelarm, usart_at91_driver, uart_devclass, 0, 0); From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 01:32:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4D41106566B; Tue, 10 Jul 2012 01:32:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965998FC14; Tue, 10 Jul 2012 01:32: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 q6A1WqRD051720; Tue, 10 Jul 2012 01:32:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A1WqDX051718; Tue, 10 Jul 2012 01:32:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100132.q6A1WqDX051718@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 01:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238327 - head/sys/arm/xscale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 01:32:52 -0000 Author: imp Date: Tue Jul 10 01:32:52 2012 New Revision: 238327 URL: http://svn.freebsd.org/changeset/base/238327 Log: Not quite ready for this yet, so comment it out. Modified: head/sys/arm/xscale/std.xscale Modified: head/sys/arm/xscale/std.xscale ============================================================================== --- head/sys/arm/xscale/std.xscale Tue Jul 10 01:25:25 2012 (r238326) +++ head/sys/arm/xscale/std.xscale Tue Jul 10 01:32:52 2012 (r238327) @@ -1,3 +1,3 @@ # $FreeBSD$ -machine arm armeb +# machine arm armeb options ARM_CACHE_LOCK_ENABLE From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 01:47:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C9F106566B; Tue, 10 Jul 2012 01:47:12 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BDC98FC08; Tue, 10 Jul 2012 01:47: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 q6A1lCd2052339; Tue, 10 Jul 2012 01:47:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A1lCPE052337; Tue, 10 Jul 2012 01:47:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207100147.q6A1lCPE052337@svn.freebsd.org> From: David Xu Date: Tue, 10 Jul 2012 01:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238328 - head/lib/libc/i386/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 01:47:12 -0000 Author: davidxu Date: Tue Jul 10 01:47:11 2012 New Revision: 238328 URL: http://svn.freebsd.org/changeset/base/238328 Log: Executing CPUID with EAX set to 1 to actually get feature flags. PR: 169730 Modified: head/lib/libc/i386/gen/getcontextx.c Modified: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- head/lib/libc/i386/gen/getcontextx.c Tue Jul 10 01:32:52 2012 (r238327) +++ head/lib/libc/i386/gen/getcontextx.c Tue Jul 10 01:47:11 2012 (r238328) @@ -68,7 +68,7 @@ __getcontextx_size(void) " movl %%ebx,%1\n" " popl %%ebx\n" : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (0x0)); + : "0" (0x1)); if ((p[2] & CPUID2_OSXSAVE) != 0) { __asm __volatile( " pushl %%ebx\n" From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 01:49:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D17F3106566B; Tue, 10 Jul 2012 01:49:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAA268FC18; Tue, 10 Jul 2012 01:49: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 q6A1noAH052486; Tue, 10 Jul 2012 01:49:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A1no0Q052473; Tue, 10 Jul 2012 01:49:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100149.q6A1no0Q052473@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 01:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238329 - in head/sys/arm: at91 conf econa include mv s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 01:49:51 -0000 Author: imp Date: Tue Jul 10 01:49:50 2012 New Revision: 238329 URL: http://svn.freebsd.org/changeset/base/238329 Log: Remove some unused variables/externs that have been copied too many times... Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/conf/KB920X head/sys/arm/econa/econa_machdep.c head/sys/arm/include/atomic.h head/sys/arm/mv/mv_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/at91/at91_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -115,10 +115,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +122,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/conf/KB920X Tue Jul 10 01:49:50 2012 (r238329) @@ -21,10 +21,16 @@ ident KB920X include "../at91/std.kb920x" +# bring in the sam specific timers and such +#include "../at91/std.at91sam9" +nodevice at91rm9200 +device at91sam9 +device at91sam9x25 # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "KB920X.hints" -#makeoptions MODULES_OVERRIDE="" +makeoptions MODULES_OVERRIDE="" +options LINUX_BOOT_ABI makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB @@ -81,7 +87,7 @@ device lxtphy #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed device md -device at91_twi # TWI: Two Wire Interface +#device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: device spibus # MMC/SD @@ -137,6 +143,8 @@ device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm + +#device cfi options IEEE80211_SUPPORT_MESH options AH_SUPPORT_AR5416 Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/econa/econa_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -103,10 +103,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -114,7 +110,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/include/atomic.h Tue Jul 10 01:49:50 2012 (r238329) @@ -347,7 +347,9 @@ atomic_readandclear_32(volatile u_int32_ #define atomic_cmpset_ptr(dst, old, new) \ atomic_cmpset_32((volatile u_int *)(dst), (u_int)(old), (u_int)(new)) #define atomic_cmpset_rel_ptr atomic_cmpset_ptr -#define atomic_cmpset_acq_ptr atomic_cmpset_ptr +#define atomic_cmpset_acq_ptr(dst, old, new) \ + atomic_cmpset_ptr((volatile uint32_t *)(dst), (volatile uint32_t)(old), \ + (volatile uint32_t)(new)) #define atomic_store_ptr atomic_store_32 #define atomic_store_rel_ptr atomic_store_ptr Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/mv/mv_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -115,16 +115,11 @@ extern unsigned char _edata[]; extern unsigned char __bss_start[]; extern unsigned char _end[]; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; extern vm_offset_t pmap_bootstrap_lastaddr; -extern int *end; struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; struct pcpu __pcpu; @@ -134,7 +129,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; vm_offset_t pmap_bootstrap_lastaddr; const struct pmap_devmap *pmap_devmap_bootstrap_table; Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -118,10 +118,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -129,7 +125,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; @@ -203,10 +198,6 @@ static const struct pmap_devmap s3c24x0_ #define ioreg_read32(a) (*(volatile uint32_t *)(a)) #define ioreg_write32(a,v) (*(volatile uint32_t *)(a)=(v)) -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - struct arm32_dma_range s3c24x0_range = { .dr_sysbase = 0, .dr_busbase = 0, Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/sa11x0/assabet_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -119,14 +119,10 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - extern vm_offset_t sa1110_uart_vaddr; extern vm_offset_t sa1_cache_clean_addr; -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -140,7 +136,6 @@ vm_paddr_t dump_avail[4]; vm_paddr_t physical_start; vm_paddr_t physical_end; vm_paddr_t physical_freestart; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr irqstack; Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -115,10 +115,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +122,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -115,10 +115,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +122,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -117,7 +117,6 @@ extern u_int prefetch_abort_handler_addr extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern int *end; struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +125,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -119,10 +119,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -130,7 +126,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Tue Jul 10 01:47:11 2012 (r238328) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Tue Jul 10 01:49:50 2012 (r238329) @@ -115,10 +115,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; -extern void *_end; - -extern int *end; - struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; @@ -126,7 +122,6 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[PXA2X0_SDRAM_BANKS * 2 + 4]; vm_paddr_t dump_avail[PXA2X0_SDRAM_BANKS * 2 + 4]; -vm_offset_t physical_pages; struct pv_addr systempage; struct pv_addr msgbufpv; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 02:14:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C0F7106564A; Tue, 10 Jul 2012 02:14:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC638FC0C; Tue, 10 Jul 2012 02:14:51 +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 q6A2Eo9O053730; Tue, 10 Jul 2012 02:14:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A2EoWF053721; Tue, 10 Jul 2012 02:14:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100214.q6A2EoWF053721@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 02:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238330 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 02:14:51 -0000 Author: imp Date: Tue Jul 10 02:14:50 2012 New Revision: 238330 URL: http://svn.freebsd.org/changeset/base/238330 Log: Eliminate the AT91XXXX_BASE for each SoC. AT91_BASE is the right way to spell this since we only have one AT91_BASE for all Atmel arm9 SoCs. Modified: head/sys/arm/at91/at91_reset.S head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91rm92reg.h head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9g20reg.h head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91sam9x25reg.h head/sys/arm/at91/uart_cpu_at91rm9200usart.c Modified: head/sys/arm/at91/at91_reset.S ============================================================================== --- head/sys/arm/at91/at91_reset.S Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91_reset.S Tue Jul 10 02:14:50 2012 (r238330) @@ -1,13 +1,14 @@ #include #include +#include #include __FBSDID("$FreeBSD$"); -#define SDRAM_TR (AT91SAM9G20_BASE + \ +#define SDRAM_TR (AT91_BASE + \ AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_TR) -#define SDRAM_LPR (AT91SAM9G20_BASE + \ +#define SDRAM_LPR (AT91_BASE + \ AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_LPR) -#define RSTC_RCR (AT91SAM9G20_BASE + \ +#define RSTC_RCR (AT91_BASE + \ AT91SAM9G20_RSTC_BASE + RST_CR) /* Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 02:14:50 2012 (r238330) @@ -164,8 +164,8 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91RM92_BASE) - addr += AT91RM92_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } Modified: head/sys/arm/at91/at91rm92reg.h ============================================================================== --- head/sys/arm/at91/at91rm92reg.h Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91rm92reg.h Tue Jul 10 02:14:50 2012 (r238330) @@ -70,7 +70,6 @@ * 0xf0000000 - 0xfffffffff : Peripherals */ -#define AT91RM92_BASE 0xd0000000 /* Usart */ #define AT91RM92_USART_SIZE 0x4000 Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:14:50 2012 (r238330) @@ -157,8 +157,8 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9G20_BASE) - addr += AT91SAM9G20_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } Modified: head/sys/arm/at91/at91sam9g20reg.h ============================================================================== --- head/sys/arm/at91/at91sam9g20reg.h Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91sam9g20reg.h Tue Jul 10 02:14:50 2012 (r238330) @@ -73,8 +73,6 @@ #define AT91_CHIPSELECT_7 0x80000000 -#define AT91SAM9G20_BASE 0xd0000000 - #define AT91SAM9G20_EMAC_BASE 0xffc4000 #define AT91SAM9G20_EMAC_SIZE 0x4000 Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:14:50 2012 (r238330) @@ -160,8 +160,8 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9X25_BASE) - addr += AT91SAM9X25_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } Modified: head/sys/arm/at91/at91sam9x25reg.h ============================================================================== --- head/sys/arm/at91/at91sam9x25reg.h Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/at91sam9x25reg.h Tue Jul 10 02:14:50 2012 (r238330) @@ -73,8 +73,6 @@ #define AT91_CHIPSELECT_4 0x50000000 #define AT91_CHIPSELECT_5 0x60000000 -#define AT91SAM9X25_BASE 0xd0000000 - #define AT91SAM9X25_EMAC_SIZE 0x4000 #define AT91SAM9X25_EMAC0_BASE 0x802c000 #define AT91SAM9X25_EMAC0_SIZE AT91SAM9X25_EMAC_SIZE Modified: head/sys/arm/at91/uart_cpu_at91rm9200usart.c ============================================================================== --- head/sys/arm/at91/uart_cpu_at91rm9200usart.c Tue Jul 10 01:49:50 2012 (r238329) +++ head/sys/arm/at91/uart_cpu_at91rm9200usart.c Tue Jul 10 02:14:50 2012 (r238330) @@ -73,7 +73,7 @@ uart_cpu_getdev(int devtype, struct uart * XXX: Not pretty, but will work because we map the needed addresses * early. */ - di->bas.bsh = AT91RM92_BASE + AT91RM92_DBGU_BASE; + di->bas.bsh = AT91_BASE + AT91RM92_DBGU_BASE; di->baudrate = 115200; di->bas.regshft = 0; di->bas.rclk = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 02:39:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77E701065670; Tue, 10 Jul 2012 02:39:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 587F98FC08; Tue, 10 Jul 2012 02:39: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 q6A2d4mj054715; Tue, 10 Jul 2012 02:39:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A2d4ee054709; Tue, 10 Jul 2012 02:39:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100239.q6A2d4ee054709@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 02:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238331 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 02:39:04 -0000 Author: imp Date: Tue Jul 10 02:39:03 2012 New Revision: 238331 URL: http://svn.freebsd.org/changeset/base/238331 Log: The system IRQ is always IRQ 1. Make it so. Modified: head/sys/arm/at91/at91reg.h head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Tue Jul 10 02:14:50 2012 (r238330) +++ head/sys/arm/at91/at91reg.h Tue Jul 10 02:39:03 2012 (r238331) @@ -85,4 +85,6 @@ #define AT91_EXID_SAM9G25 0x00000003 #define AT91_EXID_SAM9X25 0x00000004 +#define AT91_IRQ_SYSTEM 1 + #endif /* _AT91REG_H_ */ Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 02:14:50 2012 (r238330) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 02:39:03 2012 (r238331) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -157,7 +158,7 @@ at91_add_child(device_t dev, int prio, c resource_list_init(&ivar->resources); if (irq0 != -1) { bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91RM92_IRQ_SYSTEM) + if (irq0 != AT91_IRQ_SYSTEM) at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); } if (irq1 != 0) @@ -238,7 +239,7 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91RM92_IRQ_SYSTEM; + at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:14:50 2012 (r238330) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:39:03 2012 (r238331) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -150,7 +151,7 @@ at91_add_child(device_t dev, int prio, c resource_list_init(&ivar->resources); if (irq0 != -1) { bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91SAM9260_IRQ_SYSTEM) + if (irq0 != AT91_IRQ_SYSTEM) at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); } if (irq1 != 0) @@ -238,7 +239,7 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91SAM9260_IRQ_SYSTEM; + at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:14:50 2012 (r238330) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 02:39:03 2012 (r238331) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -150,7 +151,7 @@ at91_add_child(device_t dev, int prio, c resource_list_init(&ivar->resources); if (irq0 != -1) { bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91SAM9G20_IRQ_SYSTEM) + if (irq0 != AT91_IRQ_SYSTEM) at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); } if (irq1 != 0) @@ -249,7 +250,7 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91SAM9G20_IRQ_SYSTEM; + at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:14:50 2012 (r238330) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 02:39:03 2012 (r238331) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -153,7 +154,7 @@ at91_add_child(device_t dev, int prio, c resource_list_init(&ivar->resources); if (irq0 != -1) { bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91SAM9X25_IRQ_SYSTEM) + if (irq0 != AT91_IRQ_SYSTEM) at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); } if (irq1 != 0) @@ -252,7 +253,7 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91SAM9X25_IRQ_SYSTEM; + at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 02:44:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6293A106566C; Tue, 10 Jul 2012 02:44:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D99B8FC14; Tue, 10 Jul 2012 02:44: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 q6A2iGrM054960; Tue, 10 Jul 2012 02:44:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A2iGXv054957; Tue, 10 Jul 2012 02:44:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100244.q6A2iGXv054957@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 02:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238332 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 02:44:16 -0000 Author: imp Date: Tue Jul 10 02:44:15 2012 New Revision: 238332 URL: http://svn.freebsd.org/changeset/base/238332 Log: Missed one of the special AT91SAM9xxx_BASE defines. This should be AT91_BASE. Modified: head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9260reg.h Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:39:03 2012 (r238331) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 02:44:15 2012 (r238332) @@ -158,8 +158,8 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9260_BASE) - addr += AT91SAM9260_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } Modified: head/sys/arm/at91/at91sam9260reg.h ============================================================================== --- head/sys/arm/at91/at91sam9260reg.h Tue Jul 10 02:39:03 2012 (r238331) +++ head/sys/arm/at91/at91sam9260reg.h Tue Jul 10 02:44:15 2012 (r238332) @@ -72,8 +72,6 @@ #define AT91_CHIPSELECT_7 0x80000000 -#define AT91SAM9260_BASE 0xd0000000 - #define AT91SAM9260_EMAC_BASE 0xffc4000 #define AT91SAM9260_EMAC_SIZE 0x4000 From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 03:48:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 643FD106566B; Tue, 10 Jul 2012 03:48:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35F738FC17; Tue, 10 Jul 2012 03:48:08 +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 q6A3m8GU057835; Tue, 10 Jul 2012 03:48:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A3m83a057833; Tue, 10 Jul 2012 03:48:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100348.q6A3m83a057833@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 03:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238333 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 03:48:08 -0000 Author: adrian Date: Tue Jul 10 03:48:07 2012 New Revision: 238333 URL: http://svn.freebsd.org/changeset/base/238333 Log: Reorder these so they match the capability enum order. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Tue Jul 10 02:44:15 2012 (r238332) +++ head/sys/dev/ath/ath_hal/ah.c Tue Jul 10 03:48:07 2012 (r238333) @@ -619,6 +619,19 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_EXT_CHAN_DFS: return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_COMBINED_RADAR_RSSI: + return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_AUTO_SLEEP: + return pCap->halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_MBSSID_AGGR_SUPPORT: + return pCap->halMbssidAggrSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_SPLIT_4KB_TRANS: /* hardware handles descriptors straddling 4k page boundary */ + return pCap->hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_REG_FLAG: + *result = AH_PRIVATE(ah)->ah_currentRDext; + return HAL_OK; + case HAL_CAP_ENHANCED_DMA_SUPPORT: + return pCap->halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_NUM_TXMAPS: *result = pCap->halNumTxMaps; return HAL_OK; @@ -645,18 +658,6 @@ ath_hal_getcapability(struct ath_hal *ah case HAL_CAP_RXBUFSIZE: case HAL_CAP_NUM_MR_RETRIES: return HAL_EINVAL; /* XXX not yet */ - - case HAL_CAP_COMBINED_RADAR_RSSI: - return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_AUTO_SLEEP: - return pCap->halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_MBSSID_AGGR_SUPPORT: - return pCap->halMbssidAggrSupport ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_SPLIT_4KB_TRANS: /* hardware handles descriptors straddling 4k page boundary */ - return pCap->hal4kbSplitTransSupport ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_REG_FLAG: - *result = AH_PRIVATE(ah)->ah_currentRDext; - return HAL_OK; case HAL_CAP_BT_COEX: return pCap->halBtCoexSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_HT20_SGI: @@ -694,8 +695,7 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halHasBBReadWar? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */ return pCap->halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP; - case HAL_CAP_ENHANCED_DMA_SUPPORT: - return pCap->halEnhancedDmaSupport ? HAL_OK : HAL_ENOTSUPP; + default: return HAL_EINVAL; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 04:17:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148881065670; Tue, 10 Jul 2012 04:17:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2EB78FC0A; Tue, 10 Jul 2012 04:17:49 +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 q6A4HnLB059072; Tue, 10 Jul 2012 04:17:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A4HnV9059065; Tue, 10 Jul 2012 04:17:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100417.q6A4HnV9059065@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 04:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238334 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 04:17:50 -0000 Author: imp Date: Tue Jul 10 04:17:49 2012 New Revision: 238334 URL: http://svn.freebsd.org/changeset/base/238334 Log: Collapse all copies of at91_add_child into at91.c. They were logically identical before today, and actually identical after today's changes. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91.c Tue Jul 10 04:17:49 2012 (r238334) @@ -270,10 +270,12 @@ at91_attach(device_t dev) } - /* Our device list will be added automatically by the cpu device + /* + * Our device list will be added automatically by the cpu device * e.g. at91rm9200.c when it is identified. To ensure that the * CPU and PMC are attached first any other "identified" devices - * call BUS_ADD_CHILD(9) with an "order" of at least 2. */ + * call BUS_ADD_CHILD(9) with an "order" of at least 2. + */ bus_generic_probe(dev); bus_generic_attach(dev); @@ -471,6 +473,41 @@ at91_eoi(void *unused) IC_EOICR, 0); } +void +at91_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) +{ + device_t kid; + struct at91_ivar *ivar; + + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + printf("Can't add alloc ivar\n"); + return; + } + device_set_ivars(kid, ivar); + resource_list_init(&ivar->resources); + if (irq0 != -1) { + bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); + if (irq0 != AT91_IRQ_SYSTEM) + at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); + } + if (irq1 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); + if (irq2 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; + if (addr != 0) + bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); +} + static device_method_t at91_methods[] = { DEVMETHOD(device_probe, at91_probe), DEVMETHOD(device_attach, at91_attach), Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 04:17:49 2012 (r238334) @@ -137,41 +137,6 @@ static const struct cpu_devs at91_devs[] }; static void -at91_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) -{ - device_t kid; - struct at91_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (irq0 != -1) { - bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91_IRQ_SYSTEM) - at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); - } - if (irq1 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); - if (irq2 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91_BASE) - addr += AT91_BASE; - if (addr != 0) - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); -} - -static void at91_cpu_add_builtin_children(device_t dev) { int i; Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 04:17:49 2012 (r238334) @@ -130,41 +130,6 @@ static const struct cpu_devs at91_devs[] }; static void -at91_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) -{ - device_t kid; - struct at91_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (irq0 != -1) { - bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91_IRQ_SYSTEM) - at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); - } - if (irq1 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); - if (irq2 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91_BASE) - addr += AT91_BASE; - if (addr != 0) - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); -} - -static void at91_cpu_add_builtin_children(device_t dev) { int i; Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 04:17:49 2012 (r238334) @@ -130,41 +130,6 @@ static const struct cpu_devs at91_devs[] }; static void -at91_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) -{ - device_t kid; - struct at91_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (irq0 != -1) { - bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91_IRQ_SYSTEM) - at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); - } - if (irq1 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); - if (irq2 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91_BASE) - addr += AT91_BASE; - if (addr != 0) - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); -} - -static void at91_cpu_add_builtin_children(device_t dev) { int i; Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 04:17:49 2012 (r238334) @@ -133,41 +133,6 @@ static const struct cpu_devs at91_devs[] }; static void -at91_add_child(device_t dev, int prio, const char *name, int unit, - bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2) -{ - device_t kid; - struct at91_ivar *ivar; - - kid = device_add_child_ordered(dev, prio, name, unit); - if (kid == NULL) { - printf("Can't add child %s%d ordered\n", name, unit); - return; - } - ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); - if (ivar == NULL) { - device_delete_child(dev, kid); - printf("Can't add alloc ivar\n"); - return; - } - device_set_ivars(kid, ivar); - resource_list_init(&ivar->resources); - if (irq0 != -1) { - bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); - if (irq0 != AT91_IRQ_SYSTEM) - at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); - } - if (irq1 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); - if (irq2 != 0) - bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91_BASE) - addr += AT91_BASE; - if (addr != 0) - bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); -} - -static void at91_cpu_add_builtin_children(device_t dev) { int i; Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Tue Jul 10 03:48:07 2012 (r238333) +++ head/sys/arm/at91/at91var.h Tue Jul 10 04:17:49 2012 (r238334) @@ -151,6 +151,9 @@ at91_cpu_is(u_int cpu) return (soc_data.type == cpu); } +void at91_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, int irq0, int irq1, int irq2); + extern uint32_t at91_irq_system; extern uint32_t at91_master_clock; void at91_pmc_init_clock(void); From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 05:39:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2C401065672; Tue, 10 Jul 2012 05:39:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF0658FC16; Tue, 10 Jul 2012 05:39: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 q6A5d6HQ062438; Tue, 10 Jul 2012 05:39:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A5d6I8062436; Tue, 10 Jul 2012 05:39:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100539.q6A5d6I8062436@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 05:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238335 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 05:39:06 -0000 Author: imp Date: Tue Jul 10 05:39:06 2012 New Revision: 238335 URL: http://svn.freebsd.org/changeset/base/238335 Log: Revert last change. It was accidental. Modified: head/sys/arm/conf/KB920X Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue Jul 10 04:17:49 2012 (r238334) +++ head/sys/arm/conf/KB920X Tue Jul 10 05:39:06 2012 (r238335) @@ -21,16 +21,10 @@ ident KB920X include "../at91/std.kb920x" -# bring in the sam specific timers and such -#include "../at91/std.at91sam9" -nodevice at91rm9200 -device at91sam9 -device at91sam9x25 # The AT91 platform doesn't use /boot/loader, so we have to statically wire # hints. hints "KB920X.hints" makeoptions MODULES_OVERRIDE="" -options LINUX_BOOT_ABI makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options DDB @@ -87,7 +81,7 @@ device lxtphy #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed device md -#device at91_twi # TWI: Two Wire Interface +device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: device spibus # MMC/SD @@ -144,7 +138,6 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm -#device cfi options IEEE80211_SUPPORT_MESH options AH_SUPPORT_AR5416 From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 05:45:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C964F106564A; Tue, 10 Jul 2012 05:45:13 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B46BA8FC08; Tue, 10 Jul 2012 05:45: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 q6A5jDw8062730; Tue, 10 Jul 2012 05:45:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A5jDV5062728; Tue, 10 Jul 2012 05:45:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207100545.q6A5jDV5062728@svn.freebsd.org> From: David Xu Date: Tue, 10 Jul 2012 05:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238336 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 05:45:13 -0000 Author: davidxu Date: Tue Jul 10 05:45:13 2012 New Revision: 238336 URL: http://svn.freebsd.org/changeset/base/238336 Log: Always clear p_xthread if current thread no longer needs it, in theory, if debugger exited without calling ptrace(PT_DETACH), there is a time window that the p_xthread may be pointing to non-existing thread, in practical, this is not a problem because child process soon will be killed by parent process. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Jul 10 05:39:06 2012 (r238335) +++ head/sys/kern/kern_sig.c Tue Jul 10 05:45:13 2012 (r238336) @@ -2436,9 +2436,10 @@ ptracestop(struct thread *td, int sig) } stopme: thread_suspend_switch(td); - if (!(p->p_flag & P_TRACED)) { + if (p->p_xthread == td) + p->p_xthread = NULL; + if (!(p->p_flag & P_TRACED)) break; - } if (td->td_dbgflags & TDB_SUSPEND) { if (p->p_flag & P_SINGLE_EXIT) break; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 06:05:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C299106566B; Tue, 10 Jul 2012 06:05:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB868FC12; Tue, 10 Jul 2012 06:05:43 +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 q6A65g6L063599; Tue, 10 Jul 2012 06:05:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A65gWh063597; Tue, 10 Jul 2012 06:05:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100605.q6A65gWh063597@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 06:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238337 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 06:05:43 -0000 Author: adrian Date: Tue Jul 10 06:05:42 2012 New Revision: 238337 URL: http://svn.freebsd.org/changeset/base/238337 Log: Add/fix EDMA RX behaviour. * For now, kickpcu should hopefully just do nothing - the PCU doesn't need 'kicking' for Osprey and later NICs. The PCU will just restart once the next FIFO entry is pushed in. * Teach "proc" about "dosched", so it can be used to just flush the FIFO contents without adding new FIFO entries. * .. and now, implement the RX "flush" routine. * Re-initialise the FIFO contents if the FIFO is empty (the DP is NULL.) When PCU RX is disabled (ie, writing RX_D to the RX configuration register) then the FIFO will be completely emptied. If the software FIFO is full, then no further descriptors are pushed into the FIFO and things stall. This all requires much, much more thorough stress testing. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 05:45:13 2012 (r238336) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 06:05:42 2012 (r238337) @@ -148,6 +148,8 @@ static int ath_edma_rxfifo_alloc(struct int nbufs); static int ath_edma_rxfifo_flush(struct ath_softc *sc, HAL_RX_QUEUE qtype); static void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf); +static int ath_edma_recv_proc_queue(struct ath_softc *sc, + HAL_RX_QUEUE qtype, int dosched); static void ath_edma_stoprecv(struct ath_softc *sc, int dodelay) @@ -174,6 +176,34 @@ ath_edma_stoprecv(struct ath_softc *sc, } /* + * Re-initialise the FIFO given the current buffer contents. + * Specifically, walk from head -> tail, pushing the FIFO contents + * back into the FIFO. + */ +static void +ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEUE qtype) +{ + struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + struct ath_buf *bf; + int i, j; + + i = re->m_fifo_head; + for (j = 0; j < re->m_fifo_depth; j++) { + bf = re->m_fifo[i]; + ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); + INCR(i, re->m_fifolen); + } + + /* Ensure this worked out right */ + if (i != re->m_fifo_tail) { + device_printf(sc->sc_dev, "%s: i (%d) != tail! (%d)\n", + __func__, + i, + re->m_fifo_tail); + } +} + +/* * Start receive. * * XXX TODO: this needs to reallocate the FIFO entries when a reset @@ -189,9 +219,19 @@ ath_edma_startrecv(struct ath_softc *sc) ath_hal_rxena(ah); /* - * XXX write out a complete set of FIFO entries based on - * what's currently available. + * Entries should only be written out if the + * FIFO is empty. */ + if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_HP) == 0){ + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: Re-initing HP FIFO\n", __func__); + ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_HP); + } + if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_LP) == 0) { + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: Re-initing LP FIFO\n", __func__); + ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_LP); + } /* Add up to m_fifolen entries in each queue */ /* @@ -216,14 +256,8 @@ ath_edma_recv_flush(struct ath_softc *sc device_printf(sc->sc_dev, "%s: called\n", __func__); - /* - * XXX for now, free all descriptors. Later on, complete - * what can be completed! - */ -#if 0 - ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_HP); - ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_LP); -#endif + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 0); + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 0); } /* @@ -239,18 +273,19 @@ ath_edma_recv_flush(struct ath_softc *sc * "handle frames" in the RX tasklet. */ static int -ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype) +ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype, + int dosched) { struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; struct ath_rx_status *rs; struct ath_desc *ds; struct ath_buf *bf; - int n = 0; struct mbuf *m; HAL_STATUS status; struct ath_hal *ah = sc->sc_ah; uint64_t tsf; int16_t nf; + int ngood = 0; tsf = ath_hal_gettsf64(ah); nf = ath_hal_getchannoise(ah, sc->sc_curchan); @@ -305,7 +340,8 @@ ath_edma_recv_proc_queue(struct ath_soft m_adj(m, sc->sc_rx_statuslen); /* Handle the frame */ - (void) ath_rx_pkt(sc, rs, status, tsf, nf, qtype, bf); + if (ath_rx_pkt(sc, rs, status, tsf, nf, qtype, bf)) + ngood++; /* Free the buffer/mbuf */ ath_edma_rxbuf_free(sc, bf); @@ -317,11 +353,25 @@ ath_edma_recv_proc_queue(struct ath_soft } while (re->m_fifo_depth > 0); /* Handle resched and kickpcu appropriately */ + ATH_PCU_LOCK(sc); + if (dosched && sc->sc_kickpcu) { + CTR0(ATH_KTR_ERR, "ath_edma_recv_proc_queue(): kickpcu"); + device_printf(sc->sc_dev, "%s: handled %d descriptors\n", + __func__, ngood); + + /* + * XXX TODO: what should occur here? Just re-poke and + * re-enable the RX FIFO? + */ + sc->sc_kickpcu = 0; + } + ATH_PCU_UNLOCK(sc); /* Append some more fresh frames to the FIFO */ - ath_edma_rxfifo_alloc(sc, qtype, re->m_fifolen); + if (dosched) + ath_edma_rxfifo_alloc(sc, qtype, re->m_fifolen); - return (n); + return (ngood); } static void @@ -333,8 +383,17 @@ ath_edma_recv_tasklet(void *arg, int npe __func__, npending); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP); + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, "%s: sc_inreset_cnt > 0; skipping\n", + __func__); + ATH_PCU_UNLOCK(sc); + return; + } + ATH_PCU_UNLOCK(sc); + + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 1); + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 1); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 06:10:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEA421065670; Tue, 10 Jul 2012 06:10:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA7FB8FC0A; Tue, 10 Jul 2012 06:10:49 +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 q6A6AnfI063838; Tue, 10 Jul 2012 06:10:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A6AnLq063836; Tue, 10 Jul 2012 06:10:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100610.q6A6AnLq063836@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 06:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238338 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 06:10:50 -0000 Author: adrian Date: Tue Jul 10 06:10:49 2012 New Revision: 238338 URL: http://svn.freebsd.org/changeset/base/238338 Log: Print the TX buffer if this error condition is asserted. I need to figure out why this is occuring. Hopefully I can get enough descriptor dumps to figure it out. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jul 10 06:05:42 2012 (r238337) +++ head/sys/dev/ath/if_ath_tx.c Tue Jul 10 06:10:49 2012 (r238338) @@ -3583,6 +3583,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); /* XXX TODO: schedule an interface reset */ + ath_printtxbuf(sc, bf_first, + sc->sc_ac2q[atid->ac]->axq_qnum, 0, 0); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 06:11:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88EDD1065673; Tue, 10 Jul 2012 06:11:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74A098FC19; Tue, 10 Jul 2012 06:11:40 +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 q6A6Be3M063922; Tue, 10 Jul 2012 06:11:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A6BeOD063918; Tue, 10 Jul 2012 06:11:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100611.q6A6BeOD063918@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 06:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238339 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 06:11:40 -0000 Author: adrian Date: Tue Jul 10 06:11:39 2012 New Revision: 238339 URL: http://svn.freebsd.org/changeset/base/238339 Log: Migrate the ATH_KTR_* fields out to if_ath_debug.h . Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jul 10 06:10:49 2012 (r238338) +++ head/sys/dev/ath/if_ath.c Tue Jul 10 06:11:39 2012 (r238339) @@ -116,9 +116,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#define ATH_KTR_INTR KTR_SPARE4 -#define ATH_KTR_ERR KTR_SPARE3 - /* * ATH_BCBUF determines the number of vap's that can transmit * beacons and also (currently) the number of vap's that can Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Tue Jul 10 06:10:49 2012 (r238338) +++ head/sys/dev/ath/if_ath_debug.h Tue Jul 10 06:11:39 2012 (r238339) @@ -69,6 +69,9 @@ enum { ATH_DEBUG_ANY = 0xffffffffffffffffULL }; +#define ATH_KTR_INTR KTR_SPARE4 +#define ATH_KTR_ERR KTR_SPARE3 + extern uint64_t ath_debug; #define IFF_DUMPPKTS(sc, m) \ Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jul 10 06:10:49 2012 (r238338) +++ head/sys/dev/ath/if_ath_rx.c Tue Jul 10 06:11:39 2012 (r238339) @@ -115,9 +115,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#define ATH_KTR_INTR KTR_SPARE4 -#define ATH_KTR_ERR KTR_SPARE3 - /* * Calculate the receive filter according to the * operating mode and state: From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 06:18:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC1C106566C; Tue, 10 Jul 2012 06:18:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFA4E8FC0A; Tue, 10 Jul 2012 06:18:53 +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 q6A6IrNL064243; Tue, 10 Jul 2012 06:18:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A6Ir3A064241; Tue, 10 Jul 2012 06:18:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100618.q6A6Ir3A064241@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 06:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238340 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 06:18:53 -0000 Author: imp Date: Tue Jul 10 06:18:53 2012 New Revision: 238340 URL: http://svn.freebsd.org/changeset/base/238340 Log: Minor rework to eliminate at91rm9200reg.h dependency and possibly set the stage for a detach routine (unlikely to be useful, but while I was here..) Modified: head/sys/arm/at91/at91_st.c Modified: head/sys/arm/at91/at91_st.c ============================================================================== --- head/sys/arm/at91/at91_st.c Tue Jul 10 06:11:39 2012 (r238339) +++ head/sys/arm/at91/at91_st.c Tue Jul 10 06:18:53 2012 (r238340) @@ -43,24 +43,32 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include static struct at91st_softc { - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - device_t sc_dev; + struct resource * sc_irq_res; + struct resource * sc_mem_res; + void * sc_intrhand; eventhandler_tag sc_wet; /* watchdog event handler tag */ } *timer_softc; -#define RD4(off) \ - bus_space_read_4(timer_softc->sc_st, timer_softc->sc_sh, (off)) -#define WR4(off, val) \ - bus_space_write_4(timer_softc->sc_st, timer_softc->sc_sh, (off), (val)) +static inline uint32_t +RD4(bus_size_t off) +{ + + return (bus_read_4(timer_softc->sc_mem_res, off)); +} + +static inline void +WR4(bus_size_t off, uint32_t val) +{ + + bus_write_4(timer_softc->sc_mem_res, off, val); +} static void at91st_watchdog(void *, u_int, int *); -static void at91st_initclocks(struct at91st_softc *); +static void at91st_initclocks(device_t , struct at91st_softc *); static inline int st_crtr(void) @@ -84,6 +92,19 @@ static struct timecounter at91st_timecou 1000 /* quality */ }; +static int +clock_intr(void *arg) +{ + struct trapframe *fp = arg; + + /* The interrupt is shared, so we have to make sure it's for us. */ + if (RD4(ST_SR) & ST_SR_PITS) { + hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp)); + return (FILTER_HANDLED); + } + return (FILTER_STRAY); +} + static void at91st_delay(int n) { @@ -126,26 +147,68 @@ at91st_probe(device_t dev) return (0); } +static void +at91st_deactivate(device_t dev) +{ + struct at91st_softc *sc = timer_softc; + + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + sc->sc_intrhand = NULL; + + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->sc_irq_res), sc->sc_irq_res); + sc->sc_irq_res = NULL; + + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->sc_mem_res), sc->sc_mem_res); + sc->sc_mem_res = NULL; +} + +static int +at91st_activate(device_t dev) +{ + int rid; + int err; + struct at91st_softc *sc = timer_softc; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + err = ENOMEM; + if (sc->sc_mem_res == NULL) + goto out; + /* Disable all interrupts */ + WR4(ST_IDR, 0xffffffff); + + /* The system timer shares the system irq (1) */ + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_irq_res == NULL) { + printf("Unable to allocate irq for the system timer"); + goto out; + } + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_CLK, clock_intr, + NULL, NULL, &sc->sc_intrhand); +out: + if (err != 0) + at91st_deactivate(dev); + return (err); +} + static int at91st_attach(device_t dev) { - struct at91_softc *sc = device_get_softc(device_get_parent(dev)); + int err; timer_softc = device_get_softc(dev); - timer_softc->sc_st = sc->sc_st; - timer_softc->sc_dev = dev; - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_ST_BASE, - AT91RM92_ST_SIZE, &timer_softc->sc_sh) != 0) - panic("couldn't subregion timer registers"); - /* - * Real time counter increments every clock cycle, need to set before - * initializing clocks so that DELAY works. - */ - WR4(ST_RTMR, 1); - /* Disable all interrupts */ - WR4(ST_IDR, 0xffffffff); - /* disable watchdog timer */ - WR4(ST_WDMR, 0); + err = at91st_activate(dev); + if (err) + return err; + soc_data.delay = at91st_delay; soc_data.reset = at91st_cpu_reset; // XXX kinda late to be setting this... @@ -155,7 +218,7 @@ at91st_attach(device_t dev) device_printf(dev, "watchdog registered, timeout intervall max. 64 sec\n"); - at91st_initclocks(timer_softc); + at91st_initclocks(dev, timer_softc); return (0); } @@ -210,47 +273,28 @@ at91st_watchdog(void *argp, u_int cmd, i WR4(ST_CR, ST_CR_WDRST); } -static int -clock_intr(void *arg) -{ - struct trapframe *fp = arg; - - /* The interrupt is shared, so we have to make sure it's for us. */ - if (RD4(ST_SR) & ST_SR_PITS) { - hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp)); - return (FILTER_HANDLED); - } - return (FILTER_STRAY); -} - static void -at91st_initclocks(struct at91st_softc *sc) +at91st_initclocks(device_t dev, struct at91st_softc *sc) { int rel_value; - struct resource *irq; - int rid = 0; - void *ih; - device_t dev = sc->sc_dev; + + /* + * Real time counter increments every clock cycle, need to set before + * initializing clocks so that DELAY works. + */ + WR4(ST_RTMR, 1); + /* disable watchdog timer */ + WR4(ST_WDMR, 0); rel_value = 32768 / hz; if (rel_value < 1) rel_value = 1; if (32768 % hz) { - printf("Cannot get %d Hz clock; using %dHz\n", hz, 32768 / rel_value); + device_printf(dev, "Cannot get %d Hz clock; using %dHz\n", hz, + 32768 / rel_value); hz = 32768 / rel_value; tick = 1000000 / hz; } - /* Disable all interrupts. */ - WR4(ST_IDR, 0xffffffff); - /* The system timer shares the system irq (1) */ - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 1, 1, 1, - RF_ACTIVE | RF_SHAREABLE); - if (!irq) - panic("Unable to allocate irq for the system timer"); - else - bus_setup_intr(dev, irq, INTR_TYPE_CLK, - clock_intr, NULL, NULL, &ih); - WR4(ST_PIMR, rel_value); /* Enable PITS interrupts. */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 06:21:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2F9C1065670; Tue, 10 Jul 2012 06:21:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8284E8FC0C; Tue, 10 Jul 2012 06:21:43 +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 q6A6Lh6R064392; Tue, 10 Jul 2012 06:21:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A6LhJM064390; Tue, 10 Jul 2012 06:21:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207100621.q6A6LhJM064390@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 06:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238341 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 06:21:43 -0000 Author: imp Date: Tue Jul 10 06:21:42 2012 New Revision: 238341 URL: http://svn.freebsd.org/changeset/base/238341 Log: Pure style mischief. at91_$DEV_ rather than at91$DEV_ to match others. Modified: head/sys/arm/at91/at91_st.c Modified: head/sys/arm/at91/at91_st.c ============================================================================== --- head/sys/arm/at91/at91_st.c Tue Jul 10 06:18:53 2012 (r238340) +++ head/sys/arm/at91/at91_st.c Tue Jul 10 06:21:42 2012 (r238341) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -static struct at91st_softc { +static struct at91_st_softc { struct resource * sc_irq_res; struct resource * sc_mem_res; void * sc_intrhand; @@ -67,8 +67,8 @@ WR4(bus_size_t off, uint32_t val) bus_write_4(timer_softc->sc_mem_res, off, val); } -static void at91st_watchdog(void *, u_int, int *); -static void at91st_initclocks(device_t , struct at91st_softc *); +static void at91_st_watchdog(void *, u_int, int *); +static void at91_st_initclocks(device_t , struct at91_st_softc *); static inline int st_crtr(void) @@ -81,10 +81,10 @@ st_crtr(void) return (cur1); } -static unsigned at91st_get_timecount(struct timecounter *tc); +static unsigned at91_st_get_timecount(struct timecounter *tc); -static struct timecounter at91st_timecounter = { - at91st_get_timecount, /* get_timecount */ +static struct timecounter at91_st_timecounter = { + at91_st_get_timecount, /* get_timecount */ NULL, /* no poll_pps */ 0xfffffu, /* counter_mask */ 32768, /* frequency */ @@ -106,7 +106,7 @@ clock_intr(void *arg) } static void -at91st_delay(int n) +at91_st_delay(int n) { uint32_t start, end, cur; @@ -126,7 +126,7 @@ at91st_delay(int n) } static void -at91st_cpu_reset(void) +at91_st_cpu_reset(void) { /* * Reset the CPU by programmig the watchdog timer to reset the @@ -140,7 +140,7 @@ at91st_cpu_reset(void) } static int -at91st_probe(device_t dev) +at91_st_probe(device_t dev) { device_set_desc(dev, "ST"); @@ -148,9 +148,9 @@ at91st_probe(device_t dev) } static void -at91st_deactivate(device_t dev) +at91_st_deactivate(device_t dev) { - struct at91st_softc *sc = timer_softc; + struct at91_st_softc *sc = timer_softc; if (sc->sc_intrhand) bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); @@ -168,11 +168,11 @@ at91st_deactivate(device_t dev) } static int -at91st_activate(device_t dev) +at91_st_activate(device_t dev) { int rid; int err; - struct at91st_softc *sc = timer_softc; + struct at91_st_softc *sc = timer_softc; rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -195,50 +195,50 @@ at91st_activate(device_t dev) NULL, NULL, &sc->sc_intrhand); out: if (err != 0) - at91st_deactivate(dev); + at91_st_deactivate(dev); return (err); } static int -at91st_attach(device_t dev) +at91_st_attach(device_t dev) { int err; timer_softc = device_get_softc(dev); - err = at91st_activate(dev); + err = at91_st_activate(dev); if (err) return err; - soc_data.delay = at91st_delay; - soc_data.reset = at91st_cpu_reset; // XXX kinda late to be setting this... + soc_data.delay = at91_st_delay; + soc_data.reset = at91_st_cpu_reset; // XXX kinda late to be setting this... timer_softc->sc_wet = EVENTHANDLER_REGISTER(watchdog_list, - at91st_watchdog, dev, 0); + at91_st_watchdog, dev, 0); device_printf(dev, "watchdog registered, timeout intervall max. 64 sec\n"); - at91st_initclocks(dev, timer_softc); + at91_st_initclocks(dev, timer_softc); return (0); } -static device_method_t at91st_methods[] = { - DEVMETHOD(device_probe, at91st_probe), - DEVMETHOD(device_attach, at91st_attach), +static device_method_t at91_st_methods[] = { + DEVMETHOD(device_probe, at91_st_probe), + DEVMETHOD(device_attach, at91_st_attach), {0, 0}, }; -static driver_t at91st_driver = { +static driver_t at91_st_driver = { "at91_st", - at91st_methods, - sizeof(struct at91st_softc), + at91_st_methods, + sizeof(struct at91_st_softc), }; -static devclass_t at91st_devclass; +static devclass_t at91_st_devclass; -DRIVER_MODULE(at91_st, atmelarm, at91st_driver, at91st_devclass, 0, 0); +DRIVER_MODULE(at91_st, atmelarm, at91_st_driver, at91_st_devclass, 0, 0); static unsigned -at91st_get_timecount(struct timecounter *tc) +at91_st_get_timecount(struct timecounter *tc) { return (st_crtr()); } @@ -257,7 +257,7 @@ at91st_get_timecount(struct timecounter * interval, I think this is the best solution. */ static void -at91st_watchdog(void *argp, u_int cmd, int *error) +at91_st_watchdog(void *argp, u_int cmd, int *error) { uint32_t wdog; int t; @@ -274,7 +274,7 @@ at91st_watchdog(void *argp, u_int cmd, i } static void -at91st_initclocks(device_t dev, struct at91st_softc *sc) +at91_st_initclocks(device_t dev, struct at91_st_softc *sc) { int rel_value; @@ -299,5 +299,5 @@ at91st_initclocks(device_t dev, struct a /* Enable PITS interrupts. */ WR4(ST_IER, ST_SR_PITS); - tc_init(&at91st_timecounter); + tc_init(&at91_st_timecounter); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 07:43:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8350C106564A; Tue, 10 Jul 2012 07:43:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EA848FC14; Tue, 10 Jul 2012 07:43: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 q6A7hWrA067814; Tue, 10 Jul 2012 07:43:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A7hWBI067812; Tue, 10 Jul 2012 07:43:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100743.q6A7hWBI067812@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 07:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238343 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 07:43:32 -0000 Author: adrian Date: Tue Jul 10 07:43:31 2012 New Revision: 238343 URL: http://svn.freebsd.org/changeset/base/238343 Log: Flip on EDMA RX of both HP and LP queue frames. Yes, this is in the legacy interrupt path. The NIC does support MSI but I haven't yet sat down and written that code. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jul 10 06:50:19 2012 (r238342) +++ head/sys/dev/ath/if_ath.c Tue Jul 10 07:43:31 2012 (r238343) @@ -1621,7 +1621,11 @@ ath_intr(void *arg) /* bump tx trigger level */ ath_hal_updatetxtriglevel(ah, AH_TRUE); } - if (status & HAL_INT_RX) { + /* + * Handle both the legacy and RX EDMA interrupt bits. + * Note that HAL_INT_RXLP is also HAL_INT_RXDESC. + */ + if (status & (HAL_INT_RX | HAL_INT_RXHP | HAL_INT_RXLP)) { sc->sc_stats.ast_rx_intr++; taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); } @@ -1867,6 +1871,14 @@ ath_init(void *arg) sc->sc_imask = HAL_INT_RX | HAL_INT_TX | HAL_INT_RXEOL | HAL_INT_RXORN | HAL_INT_FATAL | HAL_INT_GLOBAL; + + /* + * Enable RX EDMA bits. Note these overlap with + * HAL_INT_RX and HAL_INT_RXDESC respectively. + */ + if (sc->sc_isedma) + sc->sc_imask |= (HAL_INT_RXHP | HAL_INT_RXLP); + /* * Enable MIB interrupts when there are hardware phy counters. * Note we only do this (at the moment) for station mode. From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 07:43:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B3DA1065781; Tue, 10 Jul 2012 07:43:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 89AD88FC14; Tue, 10 Jul 2012 07:43:53 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6A7hwV8086666; Tue, 10 Jul 2012 10:43:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6A7hjZv082299; Tue, 10 Jul 2012 10:43:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6A7hjdH082298; Tue, 10 Jul 2012 10:43:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jul 2012 10:43:45 +0300 From: Konstantin Belousov To: David Xu Message-ID: <20120710074345.GX2338@deviant.kiev.zoral.com.ua> References: <201207100147.q6A1lCPE052337@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Z1EIi0fvCUyWUKja" Content-Disposition: inline In-Reply-To: <201207100147.q6A1lCPE052337@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238328 - head/lib/libc/i386/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 07:43:54 -0000 --Z1EIi0fvCUyWUKja Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 10, 2012 at 01:47:12AM +0000, David Xu wrote: > Author: davidxu > Date: Tue Jul 10 01:47:11 2012 > New Revision: 238328 > URL: http://svn.freebsd.org/changeset/base/238328 >=20 > Log: > Executing CPUID with EAX set to 1 to actually get feature flags. > PR: 169730 >=20 > Modified: > head/lib/libc/i386/gen/getcontextx.c Please, merge this before next 9.1 RC is out. --Z1EIi0fvCUyWUKja Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/73TEACgkQC3+MBN1Mb4iM3ACg3lwDi0n22h/izF54q45pLfEs y1kAoPAG+DQ2ltkmTupALYfQvHiowYjY =nBsu -----END PGP SIGNATURE----- --Z1EIi0fvCUyWUKja-- From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 07:45:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5998106564A; Tue, 10 Jul 2012 07:45:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B77A28FC1A; Tue, 10 Jul 2012 07:45: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 q6A7jlL7067960; Tue, 10 Jul 2012 07:45:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A7jla7067958; Tue, 10 Jul 2012 07:45:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207100745.q6A7jla7067958@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 07:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238344 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 07:45:48 -0000 Author: adrian Date: Tue Jul 10 07:45:47 2012 New Revision: 238344 URL: http://svn.freebsd.org/changeset/base/238344 Log: Add some debugging and comments about what's going on when reinitialising the FIFO. I still see some corner cases where no RX occurs when it should be occuring. It's quite possible that there's a subtle race condition somewhere; or maybe I'm not programming the RX queues right. There's also no locking here yet, so any reset/configuration path state change (ie, enabling/disabling receive from the ioctl, net80211 taskqueue, etc) could quite possibly confuse things. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 07:43:31 2012 (r238343) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 07:45:47 2012 (r238344) @@ -190,6 +190,12 @@ ath_edma_reinit_fifo(struct ath_softc *s i = re->m_fifo_head; for (j = 0; j < re->m_fifo_depth; j++) { bf = re->m_fifo[i]; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: Q%d: pos=%i, addr=0x%x\n", + __func__, + qtype, + i, + bf->bf_daddr); ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); INCR(i, re->m_fifolen); } @@ -221,8 +227,21 @@ ath_edma_startrecv(struct ath_softc *sc) /* * Entries should only be written out if the * FIFO is empty. + * + * XXX This isn't correct. I should be looking + * at the value of AR_RXDP_SIZE (0x0070) to determine + * how many entries are in here. + * + * A warm reset will clear the registers but not the FIFO. + * + * And I believe this is actually the address of the last + * handled buffer rather than the current FIFO pointer. + * So if no frames have been (yet) seen, we'll reinit the + * FIFO. + * + * I'll chase that up at some point. */ - if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_HP) == 0){ + if (ath_hal_getrxbuf(sc->sc_ah, HAL_RX_QUEUE_HP) == 0) { DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Re-initing HP FIFO\n", __func__); ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_HP); From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 08:31:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3AC71065676; Tue, 10 Jul 2012 08:31:28 +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 AE7058FC16; Tue, 10 Jul 2012 08:31:28 +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 q6A8VSsq069910; Tue, 10 Jul 2012 08:31:28 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A8VSbu069908; Tue, 10 Jul 2012 08:31:28 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201207100831.q6A8VSbu069908@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 10 Jul 2012 08:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238345 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 08:31:28 -0000 Author: lstewart Date: Tue Jul 10 08:31:28 2012 New Revision: 238345 URL: http://svn.freebsd.org/changeset/base/238345 Log: Move the ffclock symbols from FBSD_1.2 to FBSD_1.3 where they should have been put initially. They were added to head during development of 10-CURRENT, not 9-CURRENT. Submitted by: glebius Reviewed by: kib Modified: head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Tue Jul 10 07:45:47 2012 (r238344) +++ head/lib/libc/sys/Symbol.map Tue Jul 10 08:31:28 2012 (r238345) @@ -365,9 +365,6 @@ FBSD_1.2 { cap_getmode; cap_new; cap_getrights; - ffclock_getcounter; - ffclock_getestimate; - ffclock_setestimate; getloginclass; pdfork; pdgetpid; @@ -382,6 +379,9 @@ FBSD_1.2 { }; FBSD_1.3 { + ffclock_getcounter; + ffclock_getestimate; + ffclock_setestimate; posix_fadvise; }; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 13:17:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F01511065672; Tue, 10 Jul 2012 13:17:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB7DF8FC18; Tue, 10 Jul 2012 13:17: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 q6ADHW21083736; Tue, 10 Jul 2012 13:17:32 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ADHWhE083734; Tue, 10 Jul 2012 13:17:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207101317.q6ADHWhE083734@svn.freebsd.org> From: Ed Maste Date: Tue, 10 Jul 2012 13:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238346 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 13:17:33 -0000 Author: emaste Date: Tue Jul 10 13:17:32 2012 New Revision: 238346 URL: http://svn.freebsd.org/changeset/base/238346 Log: Plug potential mbuf leak when bridging fragments If an error occurs when transmitting one mbuf in a chain of fragments, free the subsequent fragments instead of leaking them. Sponsored by: ADARA Networks Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Jul 10 08:31:28 2012 (r238345) +++ head/sys/net/if_bridge.c Tue Jul 10 13:17:32 2012 (r238346) @@ -1813,6 +1813,8 @@ bridge_enqueue(struct bridge_softc *sc, if (err == 0) err = dst_ifp->if_transmit(dst_ifp, m); + else + m_freem(m); } if (err == 0) { From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 13:40:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0218106566B; Tue, 10 Jul 2012 13:40:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 739ED8FC08; Tue, 10 Jul 2012 13:40:05 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6ADe44I098633; Tue, 10 Jul 2012 17:40:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6ADe438098632; Tue, 10 Jul 2012 17:40:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Jul 2012 17:40:04 +0400 From: Gleb Smirnoff To: net@FreeBSD.org Message-ID: <20120710134004.GE21957@FreeBSD.org> References: <4FFA894D.9050104@FreeBSD.org> <20120709.170813.339720376082380726.hrs@allbsd.org> <4FFA9723.5000301@FreeBSD.org> <20120710.053002.914215153752773154.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120710.053002.914215153752773154.hrs@allbsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, melifaro@FreeBSD.org Subject: Re: svn commit: r238277 - in head: etc/defaults etc/rc.d sbin/ipfw share/man/man5 sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 13:40:06 -0000 Hiroki, On Tue, Jul 10, 2012 at 05:30:02AM +0900, Hiroki Sato wrote: H> Given that we add a new API to H> enumerate the interfaces including bpf-only providers with fake H> ifnets, which providers/utilities should be converted to use it? IMO H> usbusN would be a reasonable target but others still need a real H> ifnet. In my understanding, the advantage of using a fake ifnet is H> just to prevent it from appearing as an interface. Is it correct? IMO, neither ipfwlog0 nor pflog0 nor pfsync0 need 'struct ifnet'. They are pure providers for tcpdump only. (pfsync0 also consumes if_ioctl to configure itself, but this can be axed and configuring should be done via /dev/pf as all other parts of pf.) As soon as Alexander comes with API that makes it possible to create BPF "dumping points" in kernel that aren't tied to 'struct ifnet', I'd be happy to remove pfsync/pflog/ipfwlog as interfaces. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 14:21:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FB8A106566B; Tue, 10 Jul 2012 14:21:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9528FC17; Tue, 10 Jul 2012 14:21: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 q6AELQx0086364; Tue, 10 Jul 2012 14:21:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AELPDJ086362; Tue, 10 Jul 2012 14:21:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207101421.q6AELPDJ086362@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 14:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238347 - head/sys/arm/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 14:21:26 -0000 Author: imp Date: Tue Jul 10 14:21:25 2012 New Revision: 238347 URL: http://svn.freebsd.org/changeset/base/238347 Log: Revert committal of local change accidentally swept up in r238329. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Tue Jul 10 13:17:32 2012 (r238346) +++ head/sys/arm/include/atomic.h Tue Jul 10 14:21:25 2012 (r238347) @@ -347,9 +347,7 @@ atomic_readandclear_32(volatile u_int32_ #define atomic_cmpset_ptr(dst, old, new) \ atomic_cmpset_32((volatile u_int *)(dst), (u_int)(old), (u_int)(new)) #define atomic_cmpset_rel_ptr atomic_cmpset_ptr -#define atomic_cmpset_acq_ptr(dst, old, new) \ - atomic_cmpset_ptr((volatile uint32_t *)(dst), (volatile uint32_t)(old), \ - (volatile uint32_t)(new)) +#define atomic_cmpset_acq_ptr atomic_cmpset_ptr #define atomic_store_ptr atomic_store_32 #define atomic_store_rel_ptr atomic_store_ptr From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 15:02:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A10D1065676; Tue, 10 Jul 2012 15:02:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54C038FC1D; Tue, 10 Jul 2012 15:02: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 q6AF2U2K088094; Tue, 10 Jul 2012 15:02:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AF2UJk088087; Tue, 10 Jul 2012 15:02:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207101502.q6AF2UJk088087@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 15:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238348 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 15:02:30 -0000 Author: imp Date: Tue Jul 10 15:02:29 2012 New Revision: 238348 URL: http://svn.freebsd.org/changeset/base/238348 Log: Remove a useless bit of indirection. On all Atmel ARM products, irq 1 is the system IRQ, so use the define for it and get on with life. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91.c Tue Jul 10 15:02:29 2012 (r238348) @@ -365,7 +365,7 @@ at91_setup_intr(device_t dev, device_t c struct at91_softc *sc = device_get_softc(dev); int error; - if (rman_get_start(ires) == sc->sc_irq_system && filt == NULL) + if (rman_get_start(ires) == AT91_IRQ_SYSTEM && filt == NULL) panic("All system interrupt ISRs must be FILTER"); error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, arg, cookiep); Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 15:02:29 2012 (r238348) @@ -204,7 +204,6 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 15:02:29 2012 (r238348) @@ -204,7 +204,6 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 15:02:29 2012 (r238348) @@ -215,7 +215,6 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 15:02:29 2012 (r238348) @@ -218,7 +218,6 @@ at91_attach(device_t dev) /* XXX Hack to tell atmelarm about the AIC */ at91sc->sc_aic_sh = sc->sc_aic_sh; - at91sc->sc_irq_system = AT91_IRQ_SYSTEM; for (i = 0; i < 32; i++) { bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Tue Jul 10 14:21:25 2012 (r238347) +++ head/sys/arm/at91/at91var.h Tue Jul 10 15:02:29 2012 (r238348) @@ -40,7 +40,6 @@ struct at91_softc { bus_space_handle_t sc_aic_sh; struct rman sc_irq_rman; struct rman sc_mem_rman; - uint32_t sc_irq_system; }; struct at91_ivar { From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 18:17:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 640E7106566C; Tue, 10 Jul 2012 18:17:04 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id DABF78FC08; Tue, 10 Jul 2012 18:17:03 +0000 (UTC) Received: by qaat11 with SMTP id t11so457942qaa.13 for ; Tue, 10 Jul 2012 11:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hO3B7buQ6CXfY9etA7Ams7IwOG+8NoXr5CsFo/Lxxg0=; b=zd2TXy894kN50Min1GXtGcMCxcN0SsB3KDLr4svtOLEqB+cnKJMqQOY9iYwYCzoidk 6AHx5bKE1Yw58oJypu6N3b68T7p8ZfK0XBeZ33XTJhFyF1YKRs9Jp/e96UJYHv4LCYch e8DRQONUCnu3emuVesXCvL/1OzuRBx0jAtNeem5MqJ9g9Yn8BKmDx1MNZYiBmLvXJn3c Ay+KLykA6vxKxoI+UJAHH1+llxwCEstWYq574lMz1XoMsXb1tsUQDkU53+Rib1cCIyad +x7czKeTlwWaCtpNuW2jtLlUdTN4CEWTxqfaP9rktxUioyQPOLOvPgJikMXMXGR6e8iE lmzA== MIME-Version: 1.0 Received: by 10.229.137.145 with SMTP id w17mr23972353qct.27.1341944222898; Tue, 10 Jul 2012 11:17:02 -0700 (PDT) Received: by 10.229.247.19 with HTTP; Tue, 10 Jul 2012 11:17:02 -0700 (PDT) In-Reply-To: <201207100743.q6A7hWBI067812@svn.freebsd.org> References: <201207100743.q6A7hWBI067812@svn.freebsd.org> Date: Wed, 11 Jul 2012 02:17:02 +0800 Message-ID: From: Buganini To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238343 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 18:17:04 -0000 /usr/src/sys/dev/ath/if_ath.c: In function 'ath_intr': /usr/src/sys/dev/ath/if_ath.c:1628: error: 'HAL_INT_RXHP' undeclared (first use in this function) /usr/src/sys/dev/ath/if_ath.c:1628: error: (Each undeclared identifier is reported only once /usr/src/sys/dev/ath/if_ath.c:1628: error: for each function it appears in.) /usr/src/sys/dev/ath/if_ath.c:1628: error: 'HAL_INT_RXLP' undeclared (first use in this function) /usr/src/sys/dev/ath/if_ath.c: In function 'ath_init': /usr/src/sys/dev/ath/if_ath.c:1880: error: 'HAL_INT_RXHP' undeclared (first use in this function) /usr/src/sys/dev/ath/if_ath.c:1880: error: 'HAL_INT_RXLP' undeclared (first use in this function) 2012/7/10 Adrian Chadd : > Author: adrian > Date: Tue Jul 10 07:43:31 2012 > New Revision: 238343 > URL: http://svn.freebsd.org/changeset/base/238343 > > Log: > Flip on EDMA RX of both HP and LP queue frames. > > Yes, this is in the legacy interrupt path. The NIC does support > MSI but I haven't yet sat down and written that code. > > Modified: > head/sys/dev/ath/if_ath.c > > Modified: head/sys/dev/ath/if_ath.c > ============================================================================== > --- head/sys/dev/ath/if_ath.c Tue Jul 10 06:50:19 2012 (r238342) > +++ head/sys/dev/ath/if_ath.c Tue Jul 10 07:43:31 2012 (r238343) > @@ -1621,7 +1621,11 @@ ath_intr(void *arg) > /* bump tx trigger level */ > ath_hal_updatetxtriglevel(ah, AH_TRUE); > } > - if (status & HAL_INT_RX) { > + /* > + * Handle both the legacy and RX EDMA interrupt bits. > + * Note that HAL_INT_RXLP is also HAL_INT_RXDESC. > + */ > + if (status & (HAL_INT_RX | HAL_INT_RXHP | HAL_INT_RXLP)) { > sc->sc_stats.ast_rx_intr++; > taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); > } > @@ -1867,6 +1871,14 @@ ath_init(void *arg) > sc->sc_imask = HAL_INT_RX | HAL_INT_TX > | HAL_INT_RXEOL | HAL_INT_RXORN > | HAL_INT_FATAL | HAL_INT_GLOBAL; > + > + /* > + * Enable RX EDMA bits. Note these overlap with > + * HAL_INT_RX and HAL_INT_RXDESC respectively. > + */ > + if (sc->sc_isedma) > + sc->sc_imask |= (HAL_INT_RXHP | HAL_INT_RXLP); > + > /* > * Enable MIB interrupts when there are hardware phy counters. > * Note we only do this (at the moment) for station mode. > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 18:30:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33B271065673; Tue, 10 Jul 2012 18:30:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F2578FC14; Tue, 10 Jul 2012 18:30:21 +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 q6AIUKdM096682; Tue, 10 Jul 2012 18:30:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AIUKDm096680; Tue, 10 Jul 2012 18:30:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207101830.q6AIUKDm096680@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jul 2012 18:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238349 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 18:30:21 -0000 Author: adrian Date: Tue Jul 10 18:30:20 2012 New Revision: 238349 URL: http://svn.freebsd.org/changeset/base/238349 Log: Commit missing flags for the high/low priority (HP/LP) RX queues. Noticed by: everyone Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Jul 10 15:02:29 2012 (r238348) +++ head/sys/dev/ath/ath_hal/ah.h Tue Jul 10 18:30:20 2012 (r238349) @@ -409,7 +409,10 @@ typedef enum { */ typedef enum { HAL_INT_RX = 0x00000001, /* Non-common mapping */ - HAL_INT_RXDESC = 0x00000002, + HAL_INT_RXDESC = 0x00000002, /* Legacy mapping */ + HAL_INT_RXHP = 0x00000001, /* EDMA */ + HAL_INT_RXLP = 0x00000002, /* EDMA */ + HAL_INT_RXERR = 0x00000004, HAL_INT_RXNOFRM = 0x00000008, HAL_INT_RXEOL = 0x00000010, HAL_INT_RXORN = 0x00000020, From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 18:57:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D44C106566C; Tue, 10 Jul 2012 18:57:06 +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 493288FC08; Tue, 10 Jul 2012 18:57: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 q6AIv6gk097832; Tue, 10 Jul 2012 18:57:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AIv61d097828; Tue, 10 Jul 2012 18:57:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207101857.q6AIv61d097828@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Jul 2012 18:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238350 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 18:57:06 -0000 Author: jhb Date: Tue Jul 10 18:57:05 2012 New Revision: 238350 URL: http://svn.freebsd.org/changeset/base/238350 Log: Fix build when ATH_DEBUG is not defined. Modified: head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 18:30:20 2012 (r238349) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Jul 10 18:57:05 2012 (r238350) @@ -618,8 +618,9 @@ ath_edma_rxfifo_flush(struct ath_softc * for (i = 0; i < re->m_fifolen; i++) { if (re->m_fifo[i] != NULL) { - struct ath_buf *bf = re->m_fifo[i]; #ifdef ATH_DEBUG + struct ath_buf *bf = re->m_fifo[i]; + if (sc->sc_debug & ATH_DEBUG_RECV_DESC) ath_printrxbuf(sc, bf, 0, HAL_OK); #endif Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jul 10 18:30:20 2012 (r238349) +++ head/sys/dev/ath/if_ath_tx.c Tue Jul 10 18:57:05 2012 (r238350) @@ -3583,8 +3583,10 @@ ath_tx_aggr_comp_aggr(struct ath_softc * "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); /* XXX TODO: schedule an interface reset */ +#ifdef ATH_DEBUG ath_printtxbuf(sc, bf_first, sc->sc_ac2q[atid->ac]->axq_qnum, 0, 0); +#endif } /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 19:05:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0025D106566C; Tue, 10 Jul 2012 19:05:27 +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 DECF08FC16; Tue, 10 Jul 2012 19:05:27 +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 q6AJ5RR3098210; Tue, 10 Jul 2012 19:05:27 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AJ5Rp6098208; Tue, 10 Jul 2012 19:05:27 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201207101905.q6AJ5Rp6098208@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Jul 2012 19:05:27 +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: r238351 - stable/9/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 19:05:28 -0000 Author: kensmith Date: Tue Jul 10 19:05:27 2012 New Revision: 238351 URL: http://svn.freebsd.org/changeset/base/238351 Log: Shift to "FreeBSD 9.1" for what gets printed in manual pages. Approved by: re (implicit) Modified: stable/9/gnu/usr.bin/groff/tmac/mdoc.local Modified: stable/9/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/9/gnu/usr.bin/groff/tmac/mdoc.local Tue Jul 10 18:57:05 2012 (r238350) +++ stable/9/gnu/usr.bin/groff/tmac/mdoc.local Tue Jul 10 19:05:27 2012 (r238351) @@ -71,12 +71,13 @@ .ds doc-volume-as-arm arm . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~9.0 +.ds doc-default-operating-system FreeBSD\~9.1 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.3 8.3 .ds doc-operating-system-FreeBSD-9.0 9.0 +.ds doc-operating-system-FreeBSD-9.1 9.1 . .\" Definitions not (yet) in doc-syms . From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 19:08:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAF55106564A; Tue, 10 Jul 2012 19:08: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 D64088FC0A; Tue, 10 Jul 2012 19:08: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 q6AJ8ub1098381; Tue, 10 Jul 2012 19:08:56 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AJ8uhJ098379; Tue, 10 Jul 2012 19:08:56 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201207101908.q6AJ8uhJ098379@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Jul 2012 19:08: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: r238352 - stable/9/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 19:08:57 -0000 Author: kensmith Date: Tue Jul 10 19:08:56 2012 New Revision: 238352 URL: http://svn.freebsd.org/changeset/base/238352 Log: Adjustments for 9.0 -> 9.1. Approved by: re (implicit) Modified: stable/9/release/Makefile.sysinstall Modified: stable/9/release/Makefile.sysinstall ============================================================================== --- stable/9/release/Makefile.sysinstall Tue Jul 10 19:05:27 2012 (r238351) +++ stable/9/release/Makefile.sysinstall Tue Jul 10 19:08:56 2012 (r238352) @@ -24,11 +24,11 @@ # Set these, release builder! # # Fixed version: -#BUILDNAME=9.0-CURRENT +#BUILDNAME=9.1-STABLE # # Automatic SNAP versioning: DATE != date +%Y%m%d -BASE = 9.0 +BASE = 9.1 BUILDNAME?=${BASE}-${DATE}-SNAP # #CHROOTDIR=/junk/release @@ -72,7 +72,7 @@ BUILDNAME?=${BASE}-${DATE}-SNAP # # Subversion branch to build for src. If this is not set then it is # automatically computed from RELEASETAG. -#SVNBRANCH=stable/8 +#SVNBRANCH=stable/9 # # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we # are building an official release. Otherwise, we are building for From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 19:10:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC0FF106564A; Tue, 10 Jul 2012 19:10:39 +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 B600E8FC0C; Tue, 10 Jul 2012 19:10: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 q6AJAdvq098488; Tue, 10 Jul 2012 19:10:39 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AJAduP098485; Tue, 10 Jul 2012 19:10:39 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201207101910.q6AJAduP098485@svn.freebsd.org> From: Ken Smith Date: Tue, 10 Jul 2012 19:10:39 +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: r238353 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 19:10:39 -0000 Author: kensmith Date: Tue Jul 10 19:10:39 2012 New Revision: 238353 URL: http://svn.freebsd.org/changeset/base/238353 Log: Ready for 9.1-BETA1 builds. Approved by: re (implicit) Modified: stable/9/sys/conf/newvers.sh Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Tue Jul 10 19:08:56 2012 (r238352) +++ stable/9/sys/conf/newvers.sh Tue Jul 10 19:10:39 2012 (r238353) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="9.0" -BRANCH="STABLE" +REVISION="9.1" +BRANCH="BETA1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 19:48:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BC52106566B; Tue, 10 Jul 2012 19:48:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67A948FC14; Tue, 10 Jul 2012 19:48:43 +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 q6AJmhQL000197; Tue, 10 Jul 2012 19:48:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AJmhUk000191; Tue, 10 Jul 2012 19:48:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207101948.q6AJmhUk000191@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 19:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238354 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 19:48:43 -0000 Author: imp Date: Tue Jul 10 19:48:42 2012 New Revision: 238354 URL: http://svn.freebsd.org/changeset/base/238354 Log: Go ahead and disable the interrupts for the DBGU the boot loader may have left enabled after we detect the CPU, and remove the multiplely copied code from the SoC modules. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91_machdep.c Tue Jul 10 19:48:42 2012 (r238354) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -382,6 +383,14 @@ at91_try_id(uint32_t dbgu_base) default: break; } + /* + * Disable interrupts + */ + *(volatile uint32_t *)(AT91_BASE + dbgu_base + USART_IDR) = 0xffffffff; + + /* + * Save the name for later... + */ snprintf(soc_data.name, sizeof(soc_data.name), "%s%s%s", soc_type_name[soc_data.type], soc_data.subtype == AT91_ST_NONE ? "" : " subtype ", Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91rm92_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; /* @@ -194,10 +193,6 @@ at91_attach(device_t dev) AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_DBGU_BASE, - AT91RM92_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE, AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -229,9 +224,6 @@ at91_attach(device_t dev) /* Disable all interrupts for the SDRAM controller */ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP; Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9260.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -194,10 +193,6 @@ at91_attach(device_t dev) AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_DBGU_BASE, - AT91SAM9260_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE, AT91SAM9260_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -223,9 +218,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9g20.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -205,10 +204,6 @@ at91_attach(device_t dev) AT91SAM9G20_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_DBGU_BASE, - AT91SAM9G20_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -234,9 +229,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 19:10:39 2012 (r238353) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 19:48:42 2012 (r238354) @@ -50,7 +50,6 @@ struct at91sam9x25_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_dbg_sh; bus_space_handle_t sc_matrix_sh; }; @@ -208,10 +207,6 @@ at91_attach(device_t dev) AT91SAM9X25_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_DBGU_BASE, - AT91SAM9X25_DBGU_SIZE, &sc->sc_dbg_sh) != 0) - panic("Enable to map DBGU registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE, AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0) panic("Enable to map system registers"); @@ -237,9 +232,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for DBGU */ - bus_space_write_4(sc->sc_st, sc->sc_dbg_sh, 0x0c, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_MATRIX_BASE, AT91SAM9X25_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 20:59:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C0CF106564A; Tue, 10 Jul 2012 20:59:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86F0B8FC08; Tue, 10 Jul 2012 20:59: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 q6AKxao6003161; Tue, 10 Jul 2012 20:59:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AKxaJr003159; Tue, 10 Jul 2012 20:59:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207102059.q6AKxaJr003159@svn.freebsd.org> From: Ed Maste Date: Tue, 10 Jul 2012 20:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238355 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 20:59:36 -0000 Author: emaste Date: Tue Jul 10 20:59:35 2012 New Revision: 238355 URL: http://svn.freebsd.org/changeset/base/238355 Log: Simplify error case Submitted by: thompsa@ Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Jul 10 19:48:42 2012 (r238354) +++ head/sys/net/if_bridge.c Tue Jul 10 20:59:35 2012 (r238355) @@ -1811,10 +1811,10 @@ bridge_enqueue(struct bridge_softc *sc, m->m_flags &= ~M_VLANTAG; } - if (err == 0) - err = dst_ifp->if_transmit(dst_ifp, m); - else - m_freem(m); + if ((err = dst_ifp->if_transmit(dst_ifp, m))) { + m_freem(m0); + break; + } } if (err == 0) { From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 21:03:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E215106566B; Tue, 10 Jul 2012 21:03:00 +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 485108FC08; Tue, 10 Jul 2012 21:03: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 q6AL30Mk003352; Tue, 10 Jul 2012 21:03:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AL3081003349; Tue, 10 Jul 2012 21:03:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207102103.q6AL3081003349@svn.freebsd.org> From: Christian Brueffer Date: Tue, 10 Jul 2012 21:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238356 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 21:03:00 -0000 Author: brueffer Date: Tue Jul 10 21:02:59 2012 New Revision: 238356 URL: http://svn.freebsd.org/changeset/base/238356 Log: Change a duplicated check to clarify that we really want to set a reasonable default timeout. PR: 163135 Submitted by: Sascha Wildner Suggested by: bp Reviewed by: bp Modified: head/sys/netsmb/smb_trantcp.c Modified: head/sys/netsmb/smb_trantcp.c ============================================================================== --- head/sys/netsmb/smb_trantcp.c Tue Jul 10 20:59:35 2012 (r238355) +++ head/sys/netsmb/smb_trantcp.c Tue Jul 10 21:02:59 2012 (r238356) @@ -523,8 +523,10 @@ smb_nbst_connect(struct smb_vc *vcp, str return error; getnanotime(&ts2); timespecsub(&ts2, &ts1); - if (ts2.tv_sec == 0 && ts2.tv_sec == 0) + if (ts2.tv_sec == 0) { ts2.tv_sec = 1; + ts2.tv_nsec = 0; + } nbp->nbp_timo = ts2; timespecadd(&nbp->nbp_timo, &ts2); timespecadd(&nbp->nbp_timo, &ts2); From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 22:10:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9796106567C; Tue, 10 Jul 2012 22:10:21 +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 C3E298FC0A; Tue, 10 Jul 2012 22:10:21 +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 q6AMALMU006120; Tue, 10 Jul 2012 22:10:21 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6AMALrJ006115; Tue, 10 Jul 2012 22:10:21 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207102210.q6AMALrJ006115@svn.freebsd.org> From: Alan Cox Date: Tue, 10 Jul 2012 22:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238357 - in head/sys/powerpc: aim booke powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 22:10:22 -0000 Author: alc Date: Tue Jul 10 22:10:21 2012 New Revision: 238357 URL: http://svn.freebsd.org/changeset/base/238357 Log: Avoid recursion on the pvh global lock in the aim oea pmap. Correct the return type of the pmap_ts_referenced() implementations. Reported by: jhibbits [1] Tested by: andreast Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Jul 10 21:02:59 2012 (r238356) +++ head/sys/powerpc/aim/mmu_oea.c Tue Jul 10 22:10:21 2012 (r238357) @@ -300,7 +300,7 @@ void moea_init(mmu_t); boolean_t moea_is_modified(mmu_t, vm_page_t); boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); -boolean_t moea_ts_referenced(mmu_t, vm_page_t); +int moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); @@ -1269,15 +1269,20 @@ moea_init(mmu_t mmu) boolean_t moea_is_referenced(mmu_t mmu, vm_page_t m) { + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_referenced: page %p is not managed", m)); - return (moea_query_bit(m, PTE_REF)); + rw_wlock(&pvh_global_lock); + rv = moea_query_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); + return (rv); } boolean_t moea_is_modified(mmu_t mmu, vm_page_t m) { + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_modified: page %p is not managed", m)); @@ -1291,7 +1296,10 @@ moea_is_modified(mmu_t mmu, vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); - return (moea_query_bit(m, PTE_CHG)); + rw_wlock(&pvh_global_lock); + rv = moea_query_bit(m, PTE_CHG); + rw_wunlock(&pvh_global_lock); + return (rv); } boolean_t @@ -1313,7 +1321,9 @@ moea_clear_reference(mmu_t mmu, vm_page_ KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_clear_reference: page %p is not managed", m)); + rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); } void @@ -1333,7 +1343,9 @@ moea_clear_modify(mmu_t mmu, vm_page_t m */ if ((m->aflags & PGA_WRITEABLE) == 0) return; + rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_CHG); + rw_wunlock(&pvh_global_lock); } /* @@ -1400,13 +1412,17 @@ moea_remove_write(mmu_t mmu, vm_page_t m * should be tested and standardized at some point in the future for * optimal aging of shared pages. */ -boolean_t +int moea_ts_referenced(mmu_t mmu, vm_page_t m) { + int count; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_ts_referenced: page %p is not managed", m)); - return (moea_clear_bit(m, PTE_REF)); + rw_wlock(&pvh_global_lock); + count = moea_clear_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); + return (count); } /* @@ -1816,7 +1832,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } - if ((m->aflags & PGA_WRITEABLE) && moea_is_modified(mmu, m)) { + if ((m->aflags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } @@ -2293,10 +2309,10 @@ moea_query_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; + rw_assert(&pvh_global_lock, RA_WLOCKED); if (moea_attr_fetch(m) & ptebit) return (TRUE); - rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { /* @@ -2305,7 +2321,6 @@ moea_query_bit(vm_page_t m, int ptebit) */ if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - rw_wunlock(&pvh_global_lock); return (TRUE); } } @@ -2329,13 +2344,11 @@ moea_query_bit(vm_page_t m, int ptebit) mtx_unlock(&moea_table_mutex); if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - rw_wunlock(&pvh_global_lock); return (TRUE); } } } - rw_wunlock(&pvh_global_lock); return (FALSE); } @@ -2346,7 +2359,7 @@ moea_clear_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; - rw_wlock(&pvh_global_lock); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* * Clear the cached value. @@ -2380,7 +2393,6 @@ moea_clear_bit(vm_page_t m, int ptebit) pvo->pvo_pte.pte.pte_lo &= ~ptebit; } - rw_wunlock(&pvh_global_lock); return (count); } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Jul 10 21:02:59 2012 (r238356) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Jul 10 22:10:21 2012 (r238357) @@ -305,7 +305,7 @@ void moea64_init(mmu_t); boolean_t moea64_is_modified(mmu_t, vm_page_t); boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); -boolean_t moea64_ts_referenced(mmu_t, vm_page_t); +int moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); @@ -1570,7 +1570,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t * should be tested and standardized at some point in the future for * optimal aging of shared pages. */ -boolean_t +int moea64_ts_referenced(mmu_t mmu, vm_page_t m) { Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Jul 10 21:02:59 2012 (r238356) +++ head/sys/powerpc/booke/pmap.c Tue Jul 10 22:10:21 2012 (r238357) @@ -286,7 +286,7 @@ static void mmu_booke_init(mmu_t); static boolean_t mmu_booke_is_modified(mmu_t, vm_page_t); static boolean_t mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t); static boolean_t mmu_booke_is_referenced(mmu_t, vm_page_t); -static boolean_t mmu_booke_ts_referenced(mmu_t, vm_page_t); +static int mmu_booke_ts_referenced(mmu_t, vm_page_t); static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t, Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Tue Jul 10 21:02:59 2012 (r238356) +++ head/sys/powerpc/powerpc/mmu_if.m Tue Jul 10 22:10:21 2012 (r238357) @@ -387,7 +387,7 @@ METHOD boolean_t is_referenced { * * @retval int count of referenced bits */ -METHOD boolean_t ts_referenced { +METHOD int ts_referenced { mmu_t _mmu; vm_page_t _pg; }; From owner-svn-src-all@FreeBSD.ORG Tue Jul 10 23:11:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 067DF1065673; Tue, 10 Jul 2012 23:11:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E64568FC08; Tue, 10 Jul 2012 23:11: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 q6ANBqxU008959; Tue, 10 Jul 2012 23:11:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ANBqN8008956; Tue, 10 Jul 2012 23:11:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207102311.q6ANBqN8008956@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Jul 2012 23:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238358 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 23:11:53 -0000 Author: imp Date: Tue Jul 10 23:11:52 2012 New Revision: 238358 URL: http://svn.freebsd.org/changeset/base/238358 Log: Remove some more unused code. Modified: head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9x25.c Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Tue Jul 10 22:10:21 2012 (r238357) +++ head/sys/arm/at91/at91rm9200.c Tue Jul 10 23:11:52 2012 (r238358) @@ -50,7 +50,6 @@ struct at91rm92_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_matrix_sh; }; /* * Standard priority levels for the system. 0 is lowest and 7 is highest. Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Tue Jul 10 22:10:21 2012 (r238357) +++ head/sys/arm/at91/at91sam9x25.c Tue Jul 10 23:11:52 2012 (r238358) @@ -50,7 +50,6 @@ struct at91sam9x25_softc { bus_space_handle_t sc_sh; bus_space_handle_t sc_sys_sh; bus_space_handle_t sc_aic_sh; - bus_space_handle_t sc_matrix_sh; }; /* @@ -232,20 +231,6 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, - AT91SAM9X25_MATRIX_BASE, AT91SAM9X25_MATRIX_SIZE, - &sc->sc_matrix_sh) != 0) - panic("Enable to map matrix registers"); - -#if 0 /* wrong, placeholder */ - /* activate NAND*/ - i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9X25_EBICSA); - bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9X25_EBICSA, - i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); -#endif - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP_SAM9; From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 01:04:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA0B7106566C; Wed, 11 Jul 2012 01:04:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D59D68FC08; Wed, 11 Jul 2012 01:04:59 +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 q6B14xBV013538; Wed, 11 Jul 2012 01:04:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6B14xTq013535; Wed, 11 Jul 2012 01:04:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201207110104.q6B14xTq013535@svn.freebsd.org> From: Attilio Rao Date: Wed, 11 Jul 2012 01:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238359 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 01:05:00 -0000 Author: attilio Date: Wed Jul 11 01:04:59 2012 New Revision: 238359 URL: http://svn.freebsd.org/changeset/base/238359 Log: Document the object type movements, related to swp_pager_copy(), in vm_object_collapse() and vm_object_split(). In collabouration with: alc MFC after: 3 days Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Jul 10 23:11:52 2012 (r238358) +++ head/sys/vm/vm_object.c Wed Jul 11 01:04:59 2012 (r238359) @@ -1381,6 +1381,12 @@ retry: /* * Transfer any cached pages from orig_object to new_object. + * If swap_pager_copy() found swapped out pages within the + * specified range of orig_object, then it changed + * new_object's type to OBJT_SWAP when it transferred those + * pages to new_object. Otherwise, new_object's type + * should still be OBJT_DEFAULT and orig_object should not + * contain any cached pages within the specified range. */ if (__predict_false(orig_object->cache != NULL)) vm_page_cache_transfer(orig_object, offidxstart, @@ -1719,6 +1725,9 @@ vm_object_collapse(vm_object_t object) * swap_pager_copy() can sleep, in which case * the backing_object's and object's locks are * released and reacquired. + * Since swap_pager_copy() is being asked to + * destroy the source, it will change the + * backing_object's type to OBJT_DEFAULT. */ swap_pager_copy( backing_object, From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 02:57:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D236C1065670; Wed, 11 Jul 2012 02:57:19 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA9108FC15; Wed, 11 Jul 2012 02:57:19 +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 q6B2vJFr018102; Wed, 11 Jul 2012 02:57:19 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6B2vJvf018096; Wed, 11 Jul 2012 02:57:19 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201207110257.q6B2vJvf018096@svn.freebsd.org> From: Peter Grehan Date: Wed, 11 Jul 2012 02:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238360 - in head/sys/dev/virtio: . balloon block network pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 02:57:19 -0000 Author: grehan Date: Wed Jul 11 02:57:19 2012 New Revision: 238360 URL: http://svn.freebsd.org/changeset/base/238360 Log: Various VirtIO improvements PCI: - Properly handle interrupt fallback from MSIX to MSI to legacy. The host may not have sufficient resources to support MSIX, so we must be able to fallback to legacy interrupts. - Add interface to get the (sub) vendor and device IDs. - Rename flags to VTPCI_FLAG_* like other VirtIO drivers. Block: - No longer allocate vtblk_requests from separate UMA zone. malloc(9) from M_DEVBUF is sufficient. Assert segment counts at allocation. - More verbose error and debug messages. Network: - Remove stray write once variable. Virtqueue: - Shuffle code around in preparation of converting the mb()s to the appropriate atomic(9) operations. - Only walk the descriptor chain when freeing if INVARIANTS is defined since the result is only KASSERT()ed. Submitted by: Bryan Venteicher (bryanv@daemoninthecloset.org) Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/pci/virtio_pci.h head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_ring.h head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Wed Jul 11 01:04:59 2012 (r238359) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Wed Jul 11 02:57:19 2012 (r238360) @@ -412,7 +412,6 @@ vtballoon_send_page_frames(struct vtball * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); VTBALLOON_UNLOCK(sc); Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Wed Jul 11 01:04:59 2012 (r238359) +++ head/sys/dev/virtio/block/virtio_blk.c Wed Jul 11 02:57:19 2012 (r238360) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -119,7 +118,7 @@ static int vtblk_shutdown(device_t); static int vtblk_open(struct disk *); static int vtblk_close(struct disk *); static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); + struct thread *); static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); static void vtblk_strategy(struct bio *); @@ -193,7 +192,7 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) #define VTBLK_DISK_NAME "vtbd" -#define VTBLK_QUIESCE_TIMEOUT (30 * hz) +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -201,8 +200,6 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ */ #define VTBLK_MIN_SEGMENTS 2 -static uma_zone_t vtblk_req_zone; - static device_method_t vtblk_methods[] = { /* Device methods. */ DEVMETHOD(device_probe, vtblk_probe), @@ -236,19 +233,8 @@ vtblk_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: - vtblk_req_zone = uma_zcreate("vtblk_request", - sizeof(struct vtblk_request), - NULL, NULL, NULL, NULL, 0, 0); - break; case MOD_QUIESCE: case MOD_UNLOAD: - if (uma_zone_get_cur(vtblk_req_zone) > 0) - error = EBUSY; - else if (type == MOD_UNLOAD) { - uma_zdestroy(vtblk_req_zone); - vtblk_req_zone = NULL; - } - break; case MOD_SHUTDOWN: break; default: @@ -316,7 +302,7 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); - if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { error = EINVAL; device_printf(dev, "fewer than minimum number of segments " "allowed: %d\n", sc->vtblk_max_nsegs); @@ -493,7 +479,6 @@ vtblk_dump(void *arg, void *virtual, vm_ int error; dp = arg; - error = 0; if ((sc = dp->d_drv1) == NULL) return (ENXIO); @@ -539,7 +524,7 @@ vtblk_strategy(struct bio *bp) return; } -#ifdef INVARIANTS +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize @@ -547,13 +532,13 @@ vtblk_strategy(struct bio *bp) */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { int nsegs, max_nsegs; - + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; KASSERT(nsegs <= max_nsegs, - ("bio spanned too many segments: %d, max: %d", - nsegs, max_nsegs)); + ("bio %p spanned too many segments: %d, max: %d", + bp, nsegs, max_nsegs)); } #endif @@ -800,27 +785,22 @@ vtblk_execute_request(struct vtblk_softc VTBLK_LOCK_ASSERT(sc); sglist_reset(sg); - error = sglist_append(sg, &req->vbr_hdr, - sizeof(struct virtio_blk_outhdr)); - KASSERT(error == 0, ("error adding header to sglist")); - KASSERT(sg->sg_nseg == 1, - ("header spanned multiple segments: %d", sg->sg_nseg)); + + sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append(sg, bp->bio_data, bp->bio_bcount); - KASSERT(error == 0, ("error adding buffer to sglist")); + if (error || sg->sg_nseg == sg->sg_maxseg) + panic("%s: data buffer too big bio:%p error:%d", + __FUNCTION__, bp, error); /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) - writable += sg->sg_nseg - 1; + writable = sg->sg_nseg - 1; } - error = sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - KASSERT(error == 0, ("error adding ack to sglist")); writable++; - - KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, - ("fewer than min segments: %d", sg->sg_nseg)); + sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); readable = sg->sg_nseg - writable; @@ -995,12 +975,10 @@ vtblk_flush_dump(struct vtblk_softc *sc) static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { - device_t dev; struct virtqueue *vq; struct vtblk_request *r; int error; - dev = sc->vtblk_dev; vq = sc->vtblk_vq; if (!virtqueue_empty(vq)) @@ -1013,12 +991,12 @@ vtblk_poll_request(struct vtblk_softc *s virtqueue_notify(vq); r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response")); + KASSERT(r == req, ("unexpected request response: %p/%p", r, req)); error = vtblk_request_error(req); if (error && bootverbose) { - device_printf(dev, "vtblk_poll_request: IO error: %d\n", - error); + device_printf(sc->vtblk_dev, + "%s: IO error: %d\n", __FUNCTION__, error); } return (error); @@ -1090,6 +1068,20 @@ vtblk_drain(struct vtblk_softc *sc) vtblk_free_requests(sc); } +#ifdef INVARIANTS +static void +vtblk_request_invariants(struct vtblk_request *req) +{ + int hdr_nsegs, ack_nsegs; + + hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); + ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); + + KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); + KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); +} +#endif + static int vtblk_alloc_requests(struct vtblk_softc *sc) { @@ -1107,10 +1099,14 @@ vtblk_alloc_requests(struct vtblk_softc nreqs /= VTBLK_MIN_SEGMENTS; for (i = 0; i < nreqs; i++) { - req = uma_zalloc(vtblk_req_zone, M_NOWAIT); + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); if (req == NULL) return (ENOMEM); +#ifdef INVARIANTS + vtblk_request_invariants(req); +#endif + sc->vtblk_request_count++; vtblk_enqueue_request(sc, req); } @@ -1128,10 +1124,11 @@ vtblk_free_requests(struct vtblk_softc * while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; - uma_zfree(vtblk_req_zone, req); + free(req, M_DEVBUF); } - KASSERT(sc->vtblk_request_count == 0, ("leaked requests")); + KASSERT(sc->vtblk_request_count == 0, + ("leaked requests: %d", sc->vtblk_request_count)); } static struct vtblk_request * Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Wed Jul 11 01:04:59 2012 (r238359) +++ head/sys/dev/virtio/network/if_vtnet.c Wed Jul 11 02:57:19 2012 (r238360) @@ -748,11 +748,9 @@ vtnet_is_link_up(struct vtnet_softc *sc) static void vtnet_update_link_status(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int link; - dev = sc->vtnet_dev; ifp = sc->vtnet_ifp; link = vtnet_is_link_up(sc); Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Wed Jul 11 01:04:59 2012 (r238359) +++ head/sys/dev/virtio/pci/virtio_pci.c Wed Jul 11 02:57:19 2012 (r238360) @@ -57,12 +57,15 @@ struct vtpci_softc { struct resource *vtpci_msix_res; uint64_t vtpci_features; uint32_t vtpci_flags; -#define VIRTIO_PCI_FLAG_NO_MSI 0x0001 -#define VIRTIO_PCI_FLAG_MSI 0x0002 -#define VIRTIO_PCI_FLAG_NO_MSIX 0x0010 -#define VIRTIO_PCI_FLAG_MSIX 0x0020 -#define VIRTIO_PCI_FLAG_SHARED_MSIX 0x0040 +#define VTPCI_FLAG_NO_MSI 0x0001 +#define VTPCI_FLAG_NO_MSIX 0x0002 +#define VTPCI_FLAG_LEGACY 0x1000 +#define VTPCI_FLAG_MSI 0x2000 +#define VTPCI_FLAG_MSIX 0x4000 +#define VTPCI_FLAG_SHARED_MSIX 0x8000 +#define VTPCI_FLAG_ITYPE_MASK 0xF000 + /* This "bus" will only ever have one child. */ device_t vtpci_child_dev; struct virtio_feature_desc *vtpci_child_feat_desc; @@ -80,7 +83,8 @@ struct vtpci_softc { int vtpci_nvqs; struct vtpci_virtqueue { struct virtqueue *vq; - + /* Device did not provide a callback for this virtqueue. */ + int no_intr; /* Index into vtpci_intr_res[] below. Unused, then -1. */ int ires_idx; } vtpci_vqx[VIRTIO_MAX_VIRTQUEUES]; @@ -130,24 +134,39 @@ static void vtpci_describe_features(stru uint64_t); static void vtpci_probe_and_attach_child(struct vtpci_softc *); -static int vtpci_alloc_interrupts(struct vtpci_softc *, int, int, - struct vq_alloc_info *); -static int vtpci_alloc_intr_resources(struct vtpci_softc *, int, - struct vq_alloc_info *); -static int vtpci_alloc_msi(struct vtpci_softc *); -static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); +static int vtpci_alloc_intr_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_intr_resources(struct vtpci_softc *); + +static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_msix_interrupts(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); + static int vtpci_register_msix_vector(struct vtpci_softc *, int, int); +static int vtpci_set_host_msix_vectors(struct vtpci_softc *); +static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); static void vtpci_free_interrupts(struct vtpci_softc *); static void vtpci_free_virtqueues(struct vtpci_softc *); +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_release_child_resources(struct vtpci_softc *); static void vtpci_reset(struct vtpci_softc *); +static void vtpci_select_virtqueue(struct vtpci_softc *, int); + static int vtpci_legacy_intr(void *); static int vtpci_vq_shared_intr(void *); static int vtpci_vq_intr(void *); static int vtpci_config_intr(void *); +#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt + /* * I/O port read/write wrappers. */ @@ -252,7 +271,7 @@ vtpci_attach(device_t dev) } if (pci_find_cap(dev, PCIY_MSI, NULL) != 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSI; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) { rid = PCIR_BAR(1); @@ -261,7 +280,7 @@ vtpci_attach(device_t dev) } if (sc->vtpci_msix_res == NULL) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSIX; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; vtpci_reset(sc); @@ -372,6 +391,16 @@ vtpci_read_ivar(device_t dev, device_t c switch (index) { case VIRTIO_IVAR_DEVTYPE: + case VIRTIO_IVAR_SUBDEVICE: + *result = pci_get_subdevice(dev); + break; + case VIRTIO_IVAR_VENDOR: + *result = pci_get_vendor(dev); + break; + case VIRTIO_IVAR_DEVICE: + *result = pci_get_device(dev); + break; + case VIRTIO_IVAR_SUBVENDOR: *result = pci_get_subdevice(dev); break; default: @@ -442,102 +471,97 @@ vtpci_alloc_virtqueues(device_t dev, int struct vq_alloc_info *vq_info) { struct vtpci_softc *sc; + struct virtqueue *vq; struct vtpci_virtqueue *vqx; struct vq_alloc_info *info; - int queue, error; - uint16_t vq_size; + int idx, error; + uint16_t size; sc = device_get_softc(dev); + error = 0; - if (sc->vtpci_nvqs != 0 || nvqs <= 0 || - nvqs > VIRTIO_MAX_VIRTQUEUES) + if (sc->vtpci_nvqs != 0) + return (EALREADY); + if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - error = vtpci_alloc_interrupts(sc, flags, nvqs, vq_info); - if (error) { - device_printf(dev, "cannot allocate interrupts\n"); - return (error); - } - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); - if (error) - return (error); - } + if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (queue = 0; queue < nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - info = &vq_info[queue]; - - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_alloc(dev, queue, vq_size, - VIRTIO_PCI_VRING_ALIGN, 0xFFFFFFFFUL, info, &vqx->vq); - if (error) - return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); + for (idx = 0; idx < nvqs; idx++) { + vqx = &sc->vtpci_vqx[idx]; + info = &vq_info[idx]; + + vtpci_select_virtqueue(sc, idx); + size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + + error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, + 0xFFFFFFFFUL, info, &vq); + if (error) { + device_printf(dev, + "cannot allocate virtqueue %d: %d\n", idx, error); + break; } vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + + vqx->vq = *info->vqai_vq = vq; + vqx->no_intr = info->vqai_intr == NULL; - *info->vqai_vq = vqx->vq; sc->vtpci_nvqs++; } - return (0); + return (error); } static int vtpci_setup_intr(device_t dev, enum intr_type type) { struct vtpci_softc *sc; - struct vtpci_intr_resource *ires; - struct vtpci_virtqueue *vqx; - int i, flags, error; + int attempt, error; sc = device_get_softc(dev); - flags = type | INTR_MPSAFE; - ires = &sc->vtpci_intr_res[0]; - - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) == 0) { - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_legacy_intr, NULL, sc, &ires->intrhand); - return (error); - } - - error = bus_setup_intr(dev, ires->irq, flags, vtpci_config_intr, - NULL, sc, &ires->intrhand); - if (error) - return (error); + for (attempt = 0; attempt < 5; attempt++) { + /* + * Start with the most desirable interrupt configuration and + * fallback towards less desirable ones. + */ + switch (attempt) { + case 0: + error = vtpci_alloc_intr_msix_pervq(sc); + break; + case 1: + error = vtpci_alloc_intr_msix_shared(sc); + break; + case 2: + error = vtpci_alloc_intr_msi(sc); + break; + case 3: + error = vtpci_alloc_intr_legacy(sc); + break; + default: + device_printf(dev, + "exhausted all interrupt allocation attempts\n"); + return (ENXIO); + } - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) { - ires = &sc->vtpci_intr_res[1]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error == 0 && vtpci_setup_interrupts(sc, type) == 0) + break; - return (error); + vtpci_cleanup_setup_intr_attempt(sc); } - /* Setup an interrupt handler for each virtqueue. */ - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; - if (vqx->ires_idx < 1) - continue; - - ires = &sc->vtpci_intr_res[vqx->ires_idx]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); - if (error) - return (error); + if (bootverbose) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + device_printf(dev, "using legacy interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + device_printf(dev, "using MSI interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) + device_printf(dev, "using shared MSIX interrupts\n"); + else + device_printf(dev, "using per VQ MSIX interrupts\n"); } return (0); @@ -554,20 +578,19 @@ static int vtpci_reinit(device_t dev, uint64_t features) { struct vtpci_softc *sc; - struct vtpci_virtqueue *vqx; - struct virtqueue *vq; - int queue, error; - uint16_t vq_size; + int idx, error; sc = device_get_softc(dev); /* - * Redrive the device initialization. This is a bit of an abuse - * of the specification, but both VirtualBox and QEMU/KVM seem - * to play nice. We do not allow the host device to change from - * what was originally negotiated beyond what the guest driver - * changed (MSIX state should not change, number of virtqueues - * and their size remain the same, etc). + * Redrive the device initialization. This is a bit of an abuse of + * the specification, but VirtualBox, QEMU/KVM, and BHyVe seem to + * play nice. + * + * We do not allow the host device to change from what was originally + * negotiated beyond what the guest driver changed. MSIX state should + * not change, number of virtqueues and their size remain the same, etc. + * This will need to be rethought when we want to support migration. */ if (vtpci_get_status(dev) != VIRTIO_CONFIG_STATUS_RESET) @@ -582,34 +605,16 @@ vtpci_reinit(device_t dev, uint64_t feat vtpci_negotiate_features(dev, features); - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + error = vtpci_reinit_virtqueue(sc, idx); if (error) return (error); } - for (queue = 0; queue < sc->vtpci_nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - vq = vqx->vq; - - KASSERT(vq != NULL, ("vq %d not allocated", queue)); - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_reinit(vq, vq_size); + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + error = vtpci_set_host_msix_vectors(sc); if (error) return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); - } - - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); } return (0); @@ -744,7 +749,6 @@ vtpci_probe_and_attach_child(struct vtpc vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); vtpci_reset(sc); vtpci_release_child_resources(sc); - /* Reset status for future attempt. */ vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); } else @@ -752,42 +756,126 @@ vtpci_probe_and_attach_child(struct vtpc } static int -vtpci_alloc_interrupts(struct vtpci_softc *sc, int flags, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +{ + device_t dev; + int nmsix, cnt, required; + + dev = sc->vtpci_dev; + + /* Allocate an additional vector for the config changes. */ + required = nvectors + 1; + + nmsix = pci_msix_count(dev); + if (nmsix < required) + return (1); + + cnt = required; + if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_msi(struct vtpci_softc *sc) +{ + device_t dev; + int nmsi, cnt, required; + + dev = sc->vtpci_dev; + required = 1; + + nmsi = pci_msi_count(dev); + if (nmsi < required) + return (1); + + cnt = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_intr_msix_pervq(struct vtpci_softc *sc) { int i, nvectors, error; - /* - * Only allocate a vector for virtqueues that are actually - * expecting an interrupt. - */ - for (nvectors = 0, i = 0; i < nvqs; i++) - if (vq_info[i].vqai_intr != NULL) + if (vtpci_disable_msix != 0 || + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); + + for (nvectors = 0, i = 0; i < sc->vtpci_nvqs; i++) { + if (sc->vtpci_vqx[i].no_intr == 0) nvectors++; + } + + error = vtpci_alloc_msix(sc, nvectors); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSIX; + + return (0); +} + +static int +vtpci_alloc_intr_msix_shared(struct vtpci_softc *sc) +{ + int error; if (vtpci_disable_msix != 0 || - sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSIX || - flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX || - vtpci_alloc_msix(sc, nvectors) != 0) { - /* - * Use MSI interrupts if available. Otherwise, we fallback - * to legacy interrupts. - */ - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSI) == 0 && - vtpci_alloc_msi(sc) == 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSI; + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); - sc->vtpci_nintr_res = 1; - } + error = vtpci_alloc_msix(sc, 1); + if (error) + return (error); - error = vtpci_alloc_intr_resources(sc, nvqs, vq_info); + sc->vtpci_flags |= VTPCI_FLAG_MSIX | VTPCI_FLAG_SHARED_MSIX; - return (error); + return (0); } static int -vtpci_alloc_intr_resources(struct vtpci_softc *sc, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_intr_msi(struct vtpci_softc *sc) +{ + int error; + + /* Only BHyVe supports MSI. */ + if (sc->vtpci_flags & VTPCI_FLAG_NO_MSI) + return (ENOTSUP); + + error = vtpci_alloc_msi(sc); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSI; + + return (0); +} + +static int +vtpci_alloc_intr_legacy(struct vtpci_softc *sc) +{ + + sc->vtpci_flags |= VTPCI_FLAG_LEGACY; + sc->vtpci_nintr_res = 1; + + return (0); +} + +static int +vtpci_alloc_intr_resources(struct vtpci_softc *sc) { device_t dev; struct resource *irq; @@ -795,14 +883,14 @@ vtpci_alloc_intr_resources(struct vtpci_ int i, rid, flags, res_idx; dev = sc->vtpci_dev; - flags = RF_ACTIVE; - if ((sc->vtpci_flags & - (VIRTIO_PCI_FLAG_MSI | VIRTIO_PCI_FLAG_MSIX)) == 0) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) { rid = 0; - flags |= RF_SHAREABLE; - } else + flags = RF_ACTIVE | RF_SHAREABLE; + } else { rid = 1; + flags = RF_ACTIVE; + } for (i = 0; i < sc->vtpci_nintr_res; i++) { irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); @@ -814,16 +902,16 @@ vtpci_alloc_intr_resources(struct vtpci_ } /* - * Map the virtqueue into the correct index in vq_intr_res[]. Note the - * first index is reserved for configuration changes notifications. + * Map the virtqueue into the correct index in vq_intr_res[]. The + * first index is reserved for configuration changed notifications. */ - for (i = 0, res_idx = 1; i < nvqs; i++) { + for (i = 0, res_idx = 1; i < sc->vtpci_nvqs; i++) { vqx = &sc->vtpci_vqx[i]; - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - if (vq_info[i].vqai_intr == NULL) + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + if (vqx->no_intr != 0) vqx->ires_idx = -1; - else if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) vqx->ires_idx = res_idx; else vqx->ires_idx = res_idx++; @@ -835,110 +923,180 @@ vtpci_alloc_intr_resources(struct vtpci_ } static int -vtpci_alloc_msi(struct vtpci_softc *sc) +vtpci_setup_legacy_interrupt(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsi, cnt; + struct vtpci_intr_resource *ires; + int error; dev = sc->vtpci_dev; - nmsi = pci_msi_count(dev); - - if (nmsi < 1) - return (1); - cnt = 1; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt == 1) - return (0); + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_legacy_intr, NULL, + sc, &ires->intrhand); - return (1); + return (error); } static int -vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsix, cnt, required; + struct vtpci_intr_resource *ires; + struct vtpci_virtqueue *vqx; + int i, error; dev = sc->vtpci_dev; - nmsix = pci_msix_count(dev); - if (nmsix < 1) - return (1); + /* + * The first resource is used for configuration changed interrupts. + */ + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_config_intr, + NULL, sc, &ires->intrhand); + if (error) + return (error); - /* An additional vector is needed for the config changes. */ - required = nvectors + 1; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) - goto out; + if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) { + ires = &sc->vtpci_intr_res[1]; - pci_release_msi(dev); + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error) + return (error); + } else { + /* + * Each remaining resource is assigned to a specific virtqueue. + */ + for (i = 0; i < sc->vtpci_nvqs; i++) { + vqx = &sc->vtpci_vqx[i]; + if (vqx->ires_idx < 1) + continue; + + ires = &sc->vtpci_intr_res[vqx->ires_idx]; + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); + if (error) + return (error); + } } - /* Attempt shared MSIX configuration. */ - required = 2; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_flags |= VIRTIO_PCI_FLAG_SHARED_MSIX; - goto out; - } + error = vtpci_set_host_msix_vectors(sc); + if (error) + return (error); - pci_release_msi(dev); - } + return (0); +} - return (1); +static int +vtpci_setup_interrupts(struct vtpci_softc *sc, enum intr_type type) +{ + int error; -out: - sc->vtpci_nintr_res = required; - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSIX; + type |= INTR_MPSAFE; + KASSERT(sc->vtpci_flags & VTPCI_FLAG_ITYPE_MASK, + ("no interrupt type selected: %#x", sc->vtpci_flags)); - if (bootverbose) { - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) - device_printf(dev, "using shared virtqueue MSIX\n"); - else - device_printf(dev, "using per virtqueue MSIX\n"); - } + error = vtpci_alloc_intr_resources(sc); + if (error) + return (error); - return (0); + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + error = vtpci_setup_legacy_interrupt(sc, type); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + error = vtpci_setup_msi_interrupt(sc, type); + else + error = vtpci_setup_msix_interrupts(sc, type); + + return (error); } static int vtpci_register_msix_vector(struct vtpci_softc *sc, int offset, int res_idx) { device_t dev; - uint16_t vector; + uint16_t vector, rdvector; dev = sc->vtpci_dev; - if (offset != VIRTIO_MSI_CONFIG_VECTOR && - offset != VIRTIO_MSI_QUEUE_VECTOR) - return (EINVAL); - if (res_idx != -1) { - /* Map from rid to host vector. */ + /* Map from guest rid to host vector. */ vector = sc->vtpci_intr_res[res_idx].rid - 1; } else vector = VIRTIO_MSI_NO_VECTOR; - /* The first resource is special; make sure it is used correctly. */ + /* + * Assert the first resource is always used for the configuration + * changed interrupts. + */ if (res_idx == 0) { - KASSERT(vector == 0, ("unexpected config vector")); - KASSERT(offset == VIRTIO_MSI_CONFIG_VECTOR, - ("unexpected config offset")); - } + KASSERT(vector == 0 && offset == VIRTIO_MSI_CONFIG_VECTOR, + ("bad first res use vector:%d offset:%d", vector, offset)); + } else + KASSERT(offset == VIRTIO_MSI_QUEUE_VECTOR, ("bad offset")); vtpci_write_config_2(sc, offset, vector); - if (vtpci_read_config_2(sc, offset) != vector) { - device_printf(dev, "insufficient host resources for " - "MSIX interrupts\n"); + /* Read vector to determine if the host had sufficient resources. */ + rdvector = vtpci_read_config_2(sc, offset); + if (rdvector != vector) { + device_printf(dev, + "insufficient host resources for MSIX interrupts\n"); return (ENODEV); } return (0); } +static int +vtpci_set_host_msix_vectors(struct vtpci_softc *sc) +{ + struct vtpci_virtqueue *vqx; + int idx, error; + + error = vtpci_register_msix_vector(sc, VIRTIO_MSI_CONFIG_VECTOR, 0); + if (error) + return (error); + + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + vqx = &sc->vtpci_vqx[idx]; + + vtpci_select_virtqueue(sc, idx); + error = vtpci_register_msix_vector(sc, VIRTIO_MSI_QUEUE_VECTOR, + vqx->ires_idx); + if (error) + return (error); + } + + return (0); +} + +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 02:57:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6A021065691; Wed, 11 Jul 2012 02:57:33 +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 A1E5F8FC14; Wed, 11 Jul 2012 02:57:33 +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 q6B2vX5q018147; Wed, 11 Jul 2012 02:57:33 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6B2vXeW018145; Wed, 11 Jul 2012 02:57:33 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207110257.q6B2vXeW018145@svn.freebsd.org> From: Hiroki Sato Date: Wed, 11 Jul 2012 02:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 02:57:34 -0000 Author: hrs Date: Wed Jul 11 02:57:32 2012 New Revision: 238361 URL: http://svn.freebsd.org/changeset/base/238361 Log: Merge from r234532: - Fix an ifname matching issue which prevented "ifconfig wlan0 create" from working. - Return non-zero status when unit < 0. Spotted by: dhw Modified: head/sys/dev/usb/usb_pf.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Wed Jul 11 02:57:19 2012 (r238360) +++ head/sys/dev/usb/usb_pf.c Wed Jul 11 02:57:32 2012 (r238361) @@ -129,7 +129,7 @@ usbpf_ifname2ubus(const char *ifname) int unit; int error; - if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME)) <= 0) + if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME) - 1) != 0) return (NULL); error = ifc_name2unit(ifname, &unit); if (error || unit < 0) @@ -167,8 +167,10 @@ usbpf_clone_create(struct if_clone *ifc, struct usb_bus *ubus; error = ifc_name2unit(name, &unit); - if (error || unit < 0) + if (error) return (error); + if (unit < 0) + return (EINVAL); ubus = usbpf_ifname2ubus(name); if (ubus == NULL) From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 08:24:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3CD9106564A; Wed, 11 Jul 2012 08:24:30 +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 BF07F8FC0C; Wed, 11 Jul 2012 08:24: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 q6B8OUfU031836; Wed, 11 Jul 2012 08:24:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6B8OUlV031834; Wed, 11 Jul 2012 08:24:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207110824.q6B8OUlV031834@svn.freebsd.org> From: Christian Brueffer Date: Wed, 11 Jul 2012 08:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238363 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 08:24:30 -0000 Author: brueffer Date: Wed Jul 11 08:24:30 2012 New Revision: 238363 URL: http://svn.freebsd.org/changeset/base/238363 Log: - fix description of SECURITY_FREEZE_LOCK (1) - add missing underscores to SECURITY_DISABLE_PASSWORD PR: 169763 (1) Submitted by: Steven Hartland Reviewed by: mav MFC after: 1 week Modified: head/sys/cam/ata/ata_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Wed Jul 11 03:49:05 2012 (r238362) +++ head/sys/cam/ata/ata_all.c Wed Jul 11 08:24:30 2012 (r238363) @@ -171,8 +171,8 @@ ata_op_string(struct ata_cmd *cmd) case 0xf2: return ("SECURITY_UNLOCK"); case 0xf3: return ("SECURITY_ERASE_PREPARE"); case 0xf4: return ("SECURITY_ERASE_UNIT"); - case 0xf5: return ("SECURITY_FREE_LOCK"); - case 0xf6: return ("SECURITY DISABLE PASSWORD"); + case 0xf5: return ("SECURITY_FREEZE_LOCK"); + case 0xf6: return ("SECURITY_DISABLE_PASSWORD"); case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); case 0xf9: return ("SET_MAX_ADDRESS"); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 12:10:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5C81065674; Wed, 11 Jul 2012 12:10:14 +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 4696B8FC1B; Wed, 11 Jul 2012 12:10: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 q6BCAEJH042564; Wed, 11 Jul 2012 12:10:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BCAEFk042562; Wed, 11 Jul 2012 12:10:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207111210.q6BCAEFk042562@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jul 2012 12:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238364 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 12:10:14 -0000 Author: jhb Date: Wed Jul 11 12:10:13 2012 New Revision: 238364 URL: http://svn.freebsd.org/changeset/base/238364 Log: Map ATH_KTR_* to 0 when ATH_DEBUG is not defined. This effectively NOPs out their use in that case. Modified: head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Wed Jul 11 08:24:30 2012 (r238363) +++ head/sys/dev/ath/if_ath_debug.h Wed Jul 11 12:10:13 2012 (r238364) @@ -91,6 +91,9 @@ extern void ath_printrxbuf(struct ath_so extern void ath_printtxbuf(struct ath_softc *, const struct ath_buf *bf, u_int qnum, u_int ix, int done); #else /* ATH_DEBUG */ +#define ATH_KTR_INTR 0 +#define ATH_KTR_ERR 0 + #define IFF_DUMPPKTS(sc, m) \ ((sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) #define DPRINTF(sc, m, fmt, ...) do { \ From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 15:04:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F26A61065670; Wed, 11 Jul 2012 15:04:20 +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 DDB268FC08; Wed, 11 Jul 2012 15:04:20 +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 q6BF4KMm049816; Wed, 11 Jul 2012 15:04:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BF4KIM049814; Wed, 11 Jul 2012 15:04:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207111504.q6BF4KIM049814@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jul 2012 15:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238365 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 15:04:21 -0000 Author: jhb Date: Wed Jul 11 15:04:20 2012 New Revision: 238365 URL: http://svn.freebsd.org/changeset/base/238365 Log: Cast a bus address to a uintmax_t for a debug printf to fix the build on arm. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Wed Jul 11 12:10:13 2012 (r238364) +++ head/sys/dev/ath/if_ath_rx_edma.c Wed Jul 11 15:04:20 2012 (r238365) @@ -191,11 +191,11 @@ ath_edma_reinit_fifo(struct ath_softc *s for (j = 0; j < re->m_fifo_depth; j++) { bf = re->m_fifo[i]; DPRINTF(sc, ATH_DEBUG_EDMA_RX, - "%s: Q%d: pos=%i, addr=0x%x\n", + "%s: Q%d: pos=%i, addr=0x%jx\n", __func__, qtype, i, - bf->bf_daddr); + (uintmax_t)bf->bf_daddr); ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); INCR(i, re->m_fifolen); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 16:27:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45920106566B; Wed, 11 Jul 2012 16:27:03 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB608FC18; Wed, 11 Jul 2012 16:27:03 +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 q6BGR3SU053296; Wed, 11 Jul 2012 16:27:03 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BGR2Gn053287; Wed, 11 Jul 2012 16:27:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207111627.q6BGR2Gn053287@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 11 Jul 2012 16:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238366 - in head: cddl/lib/libdtrace sys/kern sys/modules/dtrace sys/modules/dtrace/dtio sys/modules/dtrace/dtraceall sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 16:27:03 -0000 Author: gnn Date: Wed Jul 11 16:27:02 2012 New Revision: 238366 URL: http://svn.freebsd.org/changeset/base/238366 Log: Initial commit of an I/O provider for DTrace on FreeBSD. These probes are most useful when looking into the structures they provide, which are listed in io.d. For example: dtrace -n 'io:genunix::start { printf("%d\n", args[0]->bio_bcount); }' Note that the I/O systems in FreeBSD and Solaris/Illumos are sufficiently different that there is not a 1:1 mapping from scripts that work with one to the other. MFC after: 1 month Added: head/sys/kern/dtio_kdtrace.c (contents, props changed) head/sys/modules/dtrace/dtio/ head/sys/modules/dtrace/dtio/Makefile (contents, props changed) Modified: head/cddl/lib/libdtrace/Makefile head/cddl/lib/libdtrace/io.d head/sys/kern/subr_devstat.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c head/sys/sys/dtrace_bsd.h Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Wed Jul 11 15:04:20 2012 (r238365) +++ head/cddl/lib/libdtrace/Makefile Wed Jul 11 16:27:02 2012 (r238366) @@ -45,6 +45,7 @@ SRCS= dt_aggregate.c \ gmatch.c DSRCS= errno.d \ + io.d \ psinfo.d \ signal.d \ unistd.d Modified: head/cddl/lib/libdtrace/io.d ============================================================================== --- head/cddl/lib/libdtrace/io.d Wed Jul 11 15:04:20 2012 (r238365) +++ head/cddl/lib/libdtrace/io.d Wed Jul 11 16:27:02 2012 (r238366) @@ -27,114 +27,50 @@ #pragma ident "%Z%%M% %I% %E% SMI" -#pragma D depends_on module unix #pragma D depends_on provider io -inline int B_BUSY = B_BUSY; -#pragma D binding "1.0" B_BUSY -inline int B_DONE = 0x00000200; -#pragma D binding "1.0" B_DONE -inline int B_ERROR = B_ERROR; -#pragma D binding "1.0" B_ERROR -inline int B_PAGEIO = B_PAGEIO; -#pragma D binding "1.0" B_PAGEIO -inline int B_PHYS = B_PHYS; -#pragma D binding "1.0" B_PHYS -inline int B_READ = B_READ; -#pragma D binding "1.0" B_READ -inline int B_WRITE = B_WRITE; -#pragma D binding "1.0" B_WRITE -inline int B_ASYNC = 0x00000004; -#pragma D binding "1.0" B_ASYNC - -typedef struct bufinfo { - int b_flags; /* buffer status */ - size_t b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_lblkno; /* block # on device */ - uint64_t b_blkno; /* expanded block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ - caddr_t b_iodone; /* I/O completion routine */ - int b_error; /* expanded error field */ - dev_t b_edev; /* extended device */ -} bufinfo_t; - -#pragma D binding "1.0" translator -translator bufinfo_t < struct buf *B > { - b_flags = B->b_flags; - b_addr = B->b_un.b_addr; - b_bcount = B->b_bcount; - b_lblkno = B->_b_blkno._f; - b_blkno = sizeof (long) == 8 ? B->_b_blkno._f : B->_b_blkno._p._l; - b_resid = B->b_resid; - b_bufsize = B->b_bufsize; - b_iodone = (caddr_t)B->b_iodone; - b_error = B->b_error; - b_edev = B->b_edev; -}; - typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator -translator devinfo_t < struct buf *B > { - dev_major = B->b_dip != NULL ? getmajor(B->b_edev) : - getmajor(B->b_file->v_vfsp->vfs_dev); - dev_minor = B->b_dip != NULL ? getminor(B->b_edev) : - getminor(B->b_file->v_vfsp->vfs_dev); - dev_instance = B->b_dip == NULL ? - getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance; - dev_name = B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name); - dev_statname = strjoin(B->b_dip == NULL ? "nfs" : - stringof(`devnamesp[getmajor(B->b_edev)].dn_name), - lltostr(B->b_dip == NULL ? getminor(B->b_file->v_vfsp->vfs_dev) : - ((struct dev_info *)B->b_dip)->devi_instance == 0 && - ((struct dev_info *)B->b_dip)->devi_parent != NULL && - ((struct dev_info *)B->b_dip)->devi_parent->devi_node_name == - "pseudo" ? getminor(B->b_edev) : - ((struct dev_info *)B->b_dip)->devi_instance)); - dev_pathname = B->b_dip == NULL ? "" : - ddi_pathname(B->b_dip, getminor(B->b_edev)); +translator devinfo_t < struct devstat *D > { + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; -typedef struct fileinfo { - string fi_name; /* name (basename of fi_pathname) */ - string fi_dirname; /* directory (dirname of fi_pathname) */ - string fi_pathname; /* full pathname */ - offset_t fi_offset; /* offset within file */ - string fi_fs; /* filesystem */ - string fi_mount; /* mount point of file system */ - int fi_oflags; /* open(2) flags for file descriptor */ -} fileinfo_t; +typedef struct bufinfo { + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ +} bufinfo_t; #pragma D binding "1.0" translator -translator fileinfo_t < struct buf *B > { - fi_name = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - basename(cleanpath(B->b_file->v_path)); - fi_dirname = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - dirname(cleanpath(B->b_file->v_path)); - fi_pathname = B->b_file == NULL ? "" : - B->b_file->v_path == NULL ? "" : - cleanpath(B->b_file->v_path); - fi_offset = B->b_offset; - fi_fs = B->b_file == NULL ? "" : - stringof(B->b_file->v_op->vnop_name); - fi_mount = B->b_file == NULL ? "" : - B->b_file->v_vfsp->vfs_vnodecovered == NULL ? "/" : - B->b_file->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(B->b_file->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = 0; +translator bufinfo_t < struct bio *B > { + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -158,63 +94,17 @@ inline int O_APPEND = 0x0008; #pragma D binding "1.1" O_APPEND inline int O_CREAT = 0x0200; #pragma D binding "1.1" O_CREAT -inline int O_DSYNC = O_DSYNC; -#pragma D binding "1.1" O_DSYNC inline int O_EXCL = 0x0800; #pragma D binding "1.1" O_EXCL -inline int O_LARGEFILE = O_LARGEFILE; -#pragma D binding "1.1" O_LARGEFILE inline int O_NOCTTY = 0x8000; #pragma D binding "1.1" O_NOCTTY inline int O_NONBLOCK = 0x0004; #pragma D binding "1.1" O_NONBLOCK inline int O_NDELAY = 0x0004; #pragma D binding "1.1" O_NDELAY -inline int O_RSYNC = O_RSYNC; -#pragma D binding "1.1" O_RSYNC inline int O_SYNC = 0x0080; #pragma D binding "1.1" O_SYNC inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC -inline int O_XATTR = O_XATTR; -#pragma D binding "1.1" O_XATTR -#pragma D binding "1.1" translator -translator fileinfo_t < struct file *F > { - fi_name = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - basename(cleanpath(F->f_vnode->v_path)); - fi_dirname = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - dirname(cleanpath(F->f_vnode->v_path)); - fi_pathname = F == NULL ? "" : - F->f_vnode->v_path == NULL ? "" : - cleanpath(F->f_vnode->v_path); - fi_offset = F == NULL ? 0 : F->f_offset; - fi_fs = F == NULL ? "" : stringof(F->f_vnode->v_op->vnop_name); - fi_mount = F == NULL ? "" : - F->f_vnode->v_vfsp->vfs_vnodecovered == NULL ? "/" : - F->f_vnode->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(F->f_vnode->v_vfsp->vfs_vnodecovered->v_path); - fi_oflags = F == NULL ? 0 : F->f_flag + (int)FOPEN; -}; -inline fileinfo_t fds[int fd] = xlate ( - fd >= 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ? - curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL); - -#pragma D attributes Stable/Stable/Common fds -#pragma D binding "1.1" fds - -#pragma D binding "1.2" translator -translator fileinfo_t < struct vnode *V > { - fi_name = V->v_path == NULL ? "" : - basename(cleanpath(V->v_path)); - fi_dirname = V->v_path == NULL ? "" : - dirname(cleanpath(V->v_path)); - fi_pathname = V->v_path == NULL ? "" : cleanpath(V->v_path); - fi_fs = stringof(V->v_op->vnop_name); - fi_mount = V->v_vfsp->vfs_vnodecovered == NULL ? "/" : - V->v_vfsp->vfs_vnodecovered->v_path == NULL ? "" : - cleanpath(V->v_vfsp->vfs_vnodecovered->v_path); -}; Added: head/sys/kern/dtio_kdtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/dtio_kdtrace.c Wed Jul 11 16:27:02 2012 (r238366) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2012 Advanced Computing Technologies LLC + * Written by George Neville-Neil gnn@freebsd.org + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include "../sys/dtrace_bsd.h" + + +static int dtio_unload(void); +static void dtio_getargdesc(void *, dtrace_id_t, void *, + dtrace_argdesc_t *); +static void dtio_provide(void *, dtrace_probedesc_t *); +static void dtio_destroy(void *, dtrace_id_t, void *); +static void dtio_enable(void *, dtrace_id_t, void *); +static void dtio_disable(void *, dtrace_id_t, void *); +static void dtio_load(void *); + +static dtrace_pattr_t dtio_attr = { +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +}; + +static char *genunix = "genunix"; + +/* + * Name strings. + */ +static char *dtio_start_str = "start"; +static char *dtio_done_str = "done"; +static char *dtio_wait_start_str = "wait-start"; +static char *dtio_wait_done_str = "wait-done"; + +static dtrace_pops_t dtio_pops = { + dtio_provide, + NULL, + dtio_enable, + dtio_disable, + NULL, + NULL, + dtio_getargdesc, + NULL, + NULL, + dtio_destroy +}; + +static dtrace_provider_id_t dtio_id; + +extern uint32_t dtio_start_id; +extern uint32_t dtio_done_id; +extern uint32_t dtio_wait_start_id; +extern uint32_t dtio_wait_done_id; + +static void +dtio_getargdesc(void *arg, dtrace_id_t id, void *parg, + dtrace_argdesc_t *desc) +{ + const char *p = NULL; + + switch (desc->dtargd_ndx) { + case 0: + p = "struct bio *"; + break; + case 1: + p = "struct devstat *"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + } + + if (p != NULL) + strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native)); +} + +static void +dtio_provide(void *arg, dtrace_probedesc_t *desc) +{ + if (desc != NULL) + return; + + if (dtrace_probe_lookup(dtio_id, genunix, NULL, + dtio_start_str) == 0) { + dtio_start_id = dtrace_probe_create(dtio_id, genunix, NULL, + dtio_start_str, 0, NULL); + } + if (dtrace_probe_lookup(dtio_id, genunix, NULL, dtio_done_str) == 0) { + dtio_done_id = dtrace_probe_create(dtio_id, genunix, NULL, + dtio_done_str, 0, NULL); + } + if (dtrace_probe_lookup(dtio_id, genunix, NULL, + dtio_wait_start_str) == 0) { + dtio_wait_start_id = dtrace_probe_create(dtio_id, genunix, + NULL, + dtio_wait_start_str, + 0, NULL); + } + if (dtrace_probe_lookup(dtio_id, genunix, NULL, + dtio_wait_done_str) == 0) { + dtio_wait_done_id = dtrace_probe_create(dtio_id, genunix, NULL, + dtio_wait_done_str, 0, NULL); + } + +} + +static void +dtio_destroy(void *arg, dtrace_id_t id, void *parg) +{ +} + +static void +dtio_enable(void *arg, dtrace_id_t id, void *parg) +{ + if (id == dtio_start_id) + dtrace_io_start_probe = + (dtrace_io_start_probe_func_t)dtrace_probe; + else if (id == dtio_done_id) + dtrace_io_done_probe = + (dtrace_io_done_probe_func_t)dtrace_probe; + else if (id == dtio_wait_start_id) + dtrace_io_wait_start_probe = + (dtrace_io_wait_start_probe_func_t)dtrace_probe; + else if (id == dtio_wait_done_id) + dtrace_io_wait_done_probe = + (dtrace_io_wait_done_probe_func_t)dtrace_probe; + else + printf("dtrace io provider: unknown ID\n"); + +} + +static void +dtio_disable(void *arg, dtrace_id_t id, void *parg) +{ + if (id == dtio_start_id) + dtrace_io_start_probe = NULL; + else if (id == dtio_done_id) + dtrace_io_done_probe = NULL; + else if (id == dtio_wait_start_id) + dtrace_io_wait_start_probe = NULL; + else if (id == dtio_wait_done_id) + dtrace_io_wait_done_probe = NULL; + else + printf("dtrace io provider: unknown ID\n"); + +} + +static void +dtio_load(void *dummy) +{ + if (dtrace_register("io", &dtio_attr, DTRACE_PRIV_USER, NULL, + &dtio_pops, NULL, &dtio_id) != 0) + return; +} + + +static int +dtio_unload() +{ + dtrace_io_start_probe = NULL; + dtrace_io_done_probe = NULL; + dtrace_io_wait_start_probe = NULL; + dtrace_io_wait_done_probe = NULL; + + return (dtrace_unregister(dtio_id)); +} + +static int +dtio_modevent(module_t mod __unused, int type, void *data __unused) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + break; + + case MOD_UNLOAD: + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +SYSINIT(dtio_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtio_load, NULL); +SYSUNINIT(dtio_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtio_unload, NULL); + +DEV_MODULE(dtio, dtio_modevent, NULL); +MODULE_VERSION(dtio, 1); +MODULE_DEPEND(dtio, dtrace, 1, 1, 1); +MODULE_DEPEND(dtio, opensolaris, 1, 1, 1); Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Wed Jul 11 15:04:20 2012 (r238365) +++ head/sys/kern/subr_devstat.c Wed Jul 11 16:27:02 2012 (r238366) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include @@ -44,6 +46,54 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KDTRACE_HOOKS +#include + +dtrace_io_start_probe_func_t dtrace_io_start_probe; +dtrace_io_done_probe_func_t dtrace_io_done_probe; +dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; +dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; + +uint32_t dtio_start_id; +uint32_t dtio_done_id; +uint32_t dtio_wait_start_id; +uint32_t dtio_wait_done_id; + +#define DTRACE_DEVSTAT_START() \ + if (dtrace_io_start_probe != NULL) \ + (*dtrace_io_start_probe)(dtio_start_id, NULL, ds); + +#define DTRACE_DEVSTAT_BIO_START() \ + if (dtrace_io_start_probe != NULL) \ + (*dtrace_io_start_probe)(dtio_start_id, bp, ds); + +#define DTRACE_DEVSTAT_DONE() \ + if (dtrace_io_done_probe != NULL) \ + (*dtrace_io_done_probe)(dtio_done_id, NULL, ds); + +#define DTRACE_DEVSTAT_BIO_DONE() \ + if (dtrace_io_done_probe != NULL) \ + (*dtrace_io_done_probe)(dtio_done_id, bp, ds); + +#define DTRACE_DEVSTAT_WAIT_START() \ + if (dtrace_io_wait_start_probe != NULL) \ + (*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, ds); + +#define DTRACE_DEVSTAT_WAIT_DONE() \ + if (dtrace_io_wait_done_probe != NULL) \ + (*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, ds); + +#else /* ! KDTRACE_HOOKS */ + +#define DTRACE_DEVSTAT_START() + +#define DTRACE_DEVSTAT_DONE() + +#define DTRACE_DEVSTAT_WAIT_START() + +#define DTRACE_DEVSTAT_WAIT_DONE() +#endif /* KDTRACE_HOOKS */ + static int devstat_num_devs; static long devstat_generation = 1; static int devstat_version = DEVSTAT_VERSION; @@ -227,6 +277,7 @@ devstat_start_transaction(struct devstat } ds->start_count++; atomic_add_rel_int(&ds->sequence0, 1); + DTRACE_DEVSTAT_START(); } void @@ -241,6 +292,7 @@ devstat_start_transaction_bio(struct dev binuptime(&bp->bio_t0); devstat_start_transaction(ds, &bp->bio_t0); + DTRACE_DEVSTAT_BIO_START(); } /* @@ -312,6 +364,7 @@ devstat_end_transaction(struct devstat * ds->end_count++; atomic_add_rel_int(&ds->sequence0, 1); + DTRACE_DEVSTAT_DONE(); } void @@ -334,6 +387,7 @@ devstat_end_transaction_bio(struct devst devstat_end_transaction(ds, bp->bio_bcount - bp->bio_resid, DEVSTAT_TAG_SIMPLE, flg, NULL, &bp->bio_t0); + DTRACE_DEVSTAT_BIO_DONE(); } /* Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Wed Jul 11 15:04:20 2012 (r238365) +++ head/sys/modules/dtrace/Makefile Wed Jul 11 16:27:02 2012 (r238366) @@ -9,6 +9,7 @@ SUBDIR= dtmalloc \ dtrace \ dtraceall \ dtrace_test \ + dtio \ prototype \ sdt \ systrace Added: head/sys/modules/dtrace/dtio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtrace/dtio/Makefile Wed Jul 11 16:27:02 2012 (r238366) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../kern + +KMOD= dtio +SRCS= dtio_kdtrace.c \ + vnode_if.h + +CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ + -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ + -I${.CURDIR}/../../.. + +.include Modified: head/sys/modules/dtrace/dtraceall/dtraceall.c ============================================================================== --- head/sys/modules/dtrace/dtraceall/dtraceall.c Wed Jul 11 15:04:20 2012 (r238365) +++ head/sys/modules/dtrace/dtraceall/dtraceall.c Wed Jul 11 16:27:02 2012 (r238366) @@ -65,6 +65,7 @@ MODULE_VERSION(dtraceall, 1); MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1); MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1); MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1); +MODULE_DEPEND(dtraceall, dtio, 1, 1, 1); MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1); Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Wed Jul 11 15:04:20 2012 (r238365) +++ head/sys/sys/dtrace_bsd.h Wed Jul 11 16:27:02 2012 (r238366) @@ -38,6 +38,8 @@ struct thread; struct vattr; struct vnode; struct reg; +struct devstat; +struct bio; /* * Cyclic clock function type definition used to hook the cyclic @@ -168,6 +170,23 @@ extern dtrace_nfsclient_nfs23_done_probe extern dtrace_nfsclient_nfs23_done_probe_func_t dtrace_nfscl_nfs234_done_probe; +/* IO Provider hooks, really hook into devstat */ +typedef void (*dtrace_io_start_probe_func_t)(uint32_t, struct bio *, + struct devstat *); +extern dtrace_io_start_probe_func_t dtrace_io_start_probe; + +typedef void (*dtrace_io_done_probe_func_t)(uint32_t, struct bio *, + struct devstat *); +extern dtrace_io_done_probe_func_t dtrace_io_done_probe; + +typedef void (*dtrace_io_wait_start_probe_func_t)(uint32_t, uintptr_t *, + struct devstat *); +extern dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe; + +typedef void (*dtrace_io_wait_done_probe_func_t)(uint32_t, uintptr_t *, + struct devstat *); +extern dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe; + /* * Functions which allow the dtrace module to check that the kernel * hooks have been compiled with sufficient space for it's private From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 16:51:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DA561065670; Wed, 11 Jul 2012 16:51:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84A8A8FC17; Wed, 11 Jul 2012 16:51:48 +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 q6BGpmF7054346; Wed, 11 Jul 2012 16:51:48 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BGplbI054315; Wed, 11 Jul 2012 16:51:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207111651.q6BGplbI054315@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 16:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238367 - in vendor-sys/acpica/dist: . generate/release generate/unix generate/unix/acpibin generate/unix/acpiexec generate/unix/acpihelp generate/unix/acpinames generate/unix/iasl sour... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 16:51:48 -0000 Author: jkim Date: Wed Jul 11 16:51:47 2012 New Revision: 238367 URL: http://svn.freebsd.org/changeset/base/238367 Log: Import ACPICA 20120711. Added: vendor-sys/acpica/dist/Makefile (contents, props changed) vendor-sys/acpica/dist/generate/unix/Makefile.common (contents, props changed) vendor-sys/acpica/dist/source/components/tables/tbxfload.c (contents, props changed) vendor-sys/acpica/dist/source/components/utilities/utexcep.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/release/build.sh vendor-sys/acpica/dist/generate/unix/Makefile vendor-sys/acpica/dist/generate/unix/acpibin/Makefile vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile vendor-sys/acpica/dist/generate/unix/acpinames/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/compiler/Makefile vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/events/evxfgpe.c vendor-sys/acpica/dist/source/components/executer/exprep.c vendor-sys/acpica/dist/source/components/executer/exresolv.c vendor-sys/acpica/dist/source/components/executer/exstore.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/hardware/hwsleep.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nspredef.c vendor-sys/acpica/dist/source/components/parser/psxface.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfroot.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utobject.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/tools/acpibin/Makefile vendor-sys/acpica/dist/source/tools/acpiexec/Makefile vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.h vendor-sys/acpica/dist/source/tools/acpihelp/Makefile vendor-sys/acpica/dist/source/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpinames/Makefile vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c Added: vendor-sys/acpica/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -0,0 +1,16 @@ +# +# Common make for acpica tools and utilities +# + +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under top level acpica directory. +# It specifically places all the object files for each tool in separate +# generate/unix subdirectories, not within the various ACPICA source +# code directories. This prevents collisions between different +# compilations of the same source file with different compile options. +# +BUILD_DIRECTORY_PATH = "generate/unix" + +include generate/unix/Makefile.config +include generate/unix/Makefile.common Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/changes.txt Wed Jul 11 16:51:47 2012 (r238367) @@ -1,4 +1,82 @@ ---------------------------------------- +11 July 2012. Summary of changes for version 20120711: + +This release is available at https://www.acpica.org/downloads The ACPI 5.0 +specification is available at www.acpi.info + +1) ACPICA Kernel-resident Subsystem: + +Fixed a possible fault in the return package object repair code. Fixes a +problem that can occur when a lone package object is wrapped with an outer +package object in order to force conformance to the ACPI specification. Can +affect these predefined names: _ALR, _MLS, _PSS, _TRT, _TSS, _PRT, _HPX, _DLM, +_CSD, _PSD, _TSD. + +Removed code to disable/enable bus master arbitration (ARB_DIS bit in the +PM2_CNT register) in the ACPICA sleep/wake interfaces. Management of the +ARB_DIS bit must be implemented in the host-dependent C3 processor power state +support. Note, ARB_DIS is obsolete and only applies to older chipsets, both +Intel and other vendors. (for Intel: ICH4-M and earlier) + +This change removes the code to disable/enable bus master arbitration during +suspend/resume. Use of the ARB_DIS bit in the optional PM2_CNT register causes +resume problems on some machines. The change has been in use for over seven +years within Linux. + +Implemented two new external interfaces to support host-directed dynamic ACPI +table load and unload. They are intended to simplify the host implementation +of hot-plug support: + AcpiLoadTable: Load an SSDT from a buffer into the namespace. + AcpiUnloadParentTable: Unload an SSDT via a named object owned by the table. +See the ACPICA reference for additional details. Adds one new file, +components/tables/tbxfload.c + +Implemented and deployed two new interfaces for errors and warnings that are +known to be caused by BIOS/firmware issues: + AcpiBiosError: Prints "ACPI Firmware Error" message. + AcpiBiosWarning: Prints "ACPI Firmware Warning" message. +Deployed these new interfaces in the ACPICA Table Manager code for ACPI table +and FADT errors. Additional deployment to be completed as appropriate in the +future. The associated conditional macros are ACPI_BIOS_ERROR and +ACPI_BIOS_WARNING. See the ACPICA reference for additional details. ACPICA BZ +843. + +Implicit notify support: ensure that no memory allocation occurs within a +critical region. This fix moves a memory allocation outside of the time that a +spinlock is held. Fixes issues on systems that do not allow this behavior. +Jung-uk Kim. + +Split exception code utilities and tables into a new file, utilities/utexcep.c + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.1K Code, 25.1K Data, 118.2K Total + Debug Version: 172.9K Code, 73.6K Data, 246.5K Total + Current Release: + Non-Debug Version: 93.5K Code, 25.3K Data, 118.8K Total + Debug Version: 173.7K Code, 74.0K Data, 247.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a parser problem for hosts where EOF is defined as -1 instead of +0. Jung-uk Kim. + +Debugger: Enhanced the "tables" command to emit additional information about +the current set of ACPI tables, including the owner ID and flags decode. + +Debugger: Reimplemented the "unload" command to use the new +AcpiUnloadParentTable external interface. This command was disable previously +due to need for an unload interface. + +AcpiHelp: Added a new option to decode ACPICA exception codes. The -e option +will decode 16-bit hex status codes (ACPI_STATUS) to name strings. + +---------------------------------------- 20 June 2012. Summary of changes for version 20120620: This release is available at https://www.acpica.org/downloads Modified: vendor-sys/acpica/dist/generate/release/build.sh ============================================================================== --- vendor-sys/acpica/dist/generate/release/build.sh Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/release/build.sh Wed Jul 11 16:51:47 2012 (r238367) @@ -254,6 +254,7 @@ generate_source_package () # # Copy generic UNIX makefiles # + cp Makefile $TEMP_DIR cp generate/unix/readme.txt $TEMP_DIR/generate/unix/readme.txt cp generate/unix/Makefile* $TEMP_DIR/generate/unix cp generate/unix/acpibin/Makefile $TEMP_DIR/generate/unix/acpibin Modified: vendor-sys/acpica/dist/generate/unix/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -4,107 +4,13 @@ # # Note: This makefile is intended to be used from within the native -# ACPICA directory structure, from under generate/unix. It specifically -# places all object files in a generate/unix subdirectory, not within -# the various ACPICA source directories. This prevents collisions -# between different compilations of the same source file with different -# compile options, and prevents pollution of the source code. +# ACPICA directory structure, from under the generate/unix directory. +# It specifically places all the object files for each tool in separate +# generate/unix subdirectories, not within the various ACPICA source +# code directories. This prevents collisions between different +# compilations of the same source file with different compile options. # -include Makefile.config - -# -# Get the OS machine architecture. Anything with a "64" in the returned -# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit. -# -HARDWARE_NAME := $(shell uname -m) - -# -# Main rule will only generate versions that are appropriate for the running -# OS, either 64-bit or 32-bit. -# -all: ${PROGS} -${PROGS}: FORCE - @cd $@; \ - if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ - mkdir -p obj64; \ - make BITS=64; \ - echo "64-bit version of $@:"; \ - ls -al obj64/$@; \ - else \ - mkdir -p obj32; \ - make BITS=32; \ - echo "32-bit version of $@:"; \ - ls -al obj32/$@; \ - fi; - -# -# Make 32-bit and 64-bit versions of all the tools -# -both: 32 64 - -# -# Make only 32-bit versions of all the tools -# -32: FORCE - @for toolname in ${PROGS}; do \ - (cd $$toolname; \ - pwd; \ - mkdir -p obj32; \ - make BITS=32; \ - echo "32-bit version of $$toolname:"; \ - ls -al obj32/$$toolname \ - ); \ - done; - -# -# Make only 64-bit versions of all the tools -# -64: FORCE - @for toolname in ${PROGS}; do \ - (cd $$toolname; \ - pwd; \ - mkdir -p obj64; \ - make BITS=64; \ - echo "64-bit version of $$toolname:"; \ - ls -al obj64/$$toolname \ - ); \ - done; - -clean: FORCE - @for toolname in ${PROGS}; do \ - (cd $$toolname; \ - pwd; \ - if [ -d "obj32" ] ; then \ - make BITS=32 clean; \ - rmdir obj32; \ - fi; \ - if [ -d "obj64" ] ; then \ - make BITS=64 clean; \ - rmdir obj64; \ - fi; \ - ); \ - done; - -# -# Install all tools, either 32-bit or 64-bit as appropriate for the host OS -# -install: FORCE - @for toolname in ${PROGS}; do \ - (cd $$toolname; \ - pwd; \ - if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ - make BITS=64 install; \ - echo "Installed 64-bit version of $$toolname"; \ - else \ - make BITS=32 install; \ - echo "Installed 32-bit version of $$toolname"; \ - fi; \ - ); \ - done; - -machine: FORCE - @echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)"; - @echo "Findstring: $(findstring 64, $(HARDWARE_NAME))"; - -FORCE: +BUILD_DIRECTORY_PATH = "." +include Makefile.config +include Makefile.common Added: vendor-sys/acpica/dist/generate/unix/Makefile.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/generate/unix/Makefile.common Wed Jul 11 16:51:47 2012 (r238367) @@ -0,0 +1,100 @@ +# +# Common make for acpica tools and utilities +# + +# +# Get the OS machine architecture. Anything with a "64" in the returned +# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit. +# +HARDWARE_NAME := $(shell uname -m) + +# +# Main rule will only generate versions that are appropriate for the running +# OS, either 64-bit or 32-bit. +# +all: ${PROGS} +${PROGS}: FORCE + @cd $(BUILD_DIRECTORY_PATH)/$@; \ + if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ + mkdir -p obj64; \ + make BITS=64; \ + echo "64-bit version of $@:"; \ + ls -al obj64/$@; \ + else \ + mkdir -p obj32; \ + make BITS=32; \ + echo "32-bit version of $@:"; \ + ls -al obj32/$@; \ + fi; + +# +# Make 32-bit and 64-bit versions of all the tools +# +both: 32 64 + +# +# Make only 32-bit versions of all the tools +# +32: FORCE + @for toolname in ${PROGS}; do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + mkdir -p obj32; \ + make BITS=32; \ + echo "32-bit version of $$toolname:"; \ + ls -al obj32/$$toolname \ + ); \ + done; + +# +# Make only 64-bit versions of all the tools +# +64: FORCE + @for toolname in ${PROGS}; do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + mkdir -p obj64; \ + make BITS=64; \ + echo "64-bit version of $$toolname:"; \ + ls -al obj64/$$toolname \ + ); \ + done; + +clean: FORCE + @for toolname in ${PROGS}; do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + if [ -d "obj32" ] ; then \ + make BITS=32 clean; \ + rmdir obj32; \ + fi; \ + if [ -d "obj64" ] ; then \ + make BITS=64 clean; \ + rmdir obj64; \ + fi; \ + ); \ + done; + +# +# Install all tools, either 32-bit or 64-bit as appropriate for the host OS +# +install: FORCE + @for toolname in ${PROGS}; do \ + (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ + pwd; \ + if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ + make BITS=64 install; \ + echo "Installed 64-bit version of $$toolname"; \ + else \ + make BITS=32 install; \ + echo "Installed 32-bit version of $$toolname"; \ + fi; \ + ); \ + done; + +machine: FORCE + @echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)"; + @echo "Findstring: $(findstring 64, $(HARDWARE_NAME))"; + +FORCE: + Modified: vendor-sys/acpica/dist/generate/unix/acpibin/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpibin/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/acpibin/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -32,6 +32,7 @@ OBJECTS = \ $(OBJDIR)/utcache.o \ $(OBJDIR)/utdebug.o \ $(OBJDIR)/utdecode.o \ + $(OBJDIR)/utexcep.o \ $(OBJDIR)/utglobal.o \ $(OBJDIR)/utlock.o \ $(OBJDIR)/utmath.o \ Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -172,6 +172,7 @@ OBJECTS = \ $(OBJDIR)/tbinstal.o \ $(OBJDIR)/tbutils.o \ $(OBJDIR)/tbxface.o \ + $(OBJDIR)/tbxfload.o \ $(OBJDIR)/tbxfroot.o \ $(OBJDIR)/utaddress.o \ $(OBJDIR)/utalloc.o \ @@ -181,6 +182,7 @@ OBJECTS = \ $(OBJDIR)/utdecode.o \ $(OBJDIR)/utdelete.o \ $(OBJDIR)/uteval.o \ + $(OBJDIR)/utexcep.o \ $(OBJDIR)/utglobal.o \ $(OBJDIR)/utids.o \ $(OBJDIR)/utinit.o \ Modified: vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -19,7 +19,8 @@ PROG = $(OBJDIR)/acpihelp # vpath %.c \ $(ACPIHELP) \ - $(ACPICA_COMMON) + $(ACPICA_COMMON) \ + $(ACPICA_UTILITIES) HEADERS = \ $(wildcard $(ACPIHELP)/*.h) @@ -31,7 +32,8 @@ OBJECTS = \ $(OBJDIR)/ahdecode.o \ $(OBJDIR)/ahpredef.o \ $(OBJDIR)/ahmain.o \ - $(OBJDIR)/getopt.o + $(OBJDIR)/getopt.o \ + $(OBJDIR)/utexcep.o # # Flags specific to acpihelp Modified: vendor-sys/acpica/dist/generate/unix/acpinames/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -81,6 +81,7 @@ OBJECTS = \ $(OBJDIR)/tbinstal.o \ $(OBJDIR)/tbutils.o \ $(OBJDIR)/tbxface.o \ + $(OBJDIR)/tbxfload.o \ $(OBJDIR)/tbxfroot.o \ $(OBJDIR)/utaddress.o \ $(OBJDIR)/utalloc.o \ @@ -88,6 +89,7 @@ OBJECTS = \ $(OBJDIR)/utdebug.o \ $(OBJDIR)/utdecode.o \ $(OBJDIR)/utdelete.o \ + $(OBJDIR)/utexcep.o \ $(OBJDIR)/utglobal.o \ $(OBJDIR)/utlock.o \ $(OBJDIR)/utmath.o \ Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -169,6 +169,7 @@ OBJECTS = \ $(OBJDIR)/utdebug.o \ $(OBJDIR)/utdecode.o \ $(OBJDIR)/utdelete.o \ + $(OBJDIR)/utexcep.o \ $(OBJDIR)/utglobal.o \ $(OBJDIR)/utinit.o \ $(OBJDIR)/utlock.o \ Modified: vendor-sys/acpica/dist/source/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/source/compiler/Makefile Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/compiler/Makefile Wed Jul 11 16:51:47 2012 (r238367) @@ -201,6 +201,7 @@ OBJECTS = \ utdebug.o \ utdecode.o \ utdelete.o \ + utexcep.o \ utglobal.o \ utinit.o \ utlock.o \ Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Wed Jul 11 16:51:47 2012 (r238367) @@ -96,7 +96,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v|w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z" /******************************************************************************* @@ -119,6 +119,7 @@ Options ( printf ("\nGlobal:\n"); ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); + ACPI_OPTION ("-v", "Display compiler version"); printf ("\nPreprocessor:\n"); ACPI_OPTION ("-D ", "Define symbol for preprocessor use"); @@ -751,9 +752,13 @@ AslDoOptions ( break; - case 'v': /* Verbosity settings */ + case 'v': /* Version and verbosity settings */ switch (AcpiGbl_Optarg[0]) { + case '^': + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); + exit (0); + case 'a': /* Disable All error/warning messages */ Modified: vendor-sys/acpica/dist/source/components/debugger/dbcmds.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbcmds.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/debugger/dbcmds.c Wed Jul 11 16:51:47 2012 (r238367) @@ -254,12 +254,53 @@ AcpiDbDisplayTableInfo ( ACPI_STATUS Status; + /* Header */ + + AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n"); + /* Walk the entire root table list */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { TableDesc = &AcpiGbl_RootTableList.Tables[i]; - AcpiOsPrintf ("%u ", i); + + /* Index and Table ID */ + + AcpiOsPrintf ("%3u %.2u ", i, TableDesc->OwnerId); + + /* Decode the table flags */ + + if (!(TableDesc->Flags & ACPI_TABLE_IS_LOADED)) + { + AcpiOsPrintf ("NotLoaded "); + } + else + { + AcpiOsPrintf (" Loaded "); + } + + switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) + { + case ACPI_TABLE_ORIGIN_UNKNOWN: + AcpiOsPrintf ("Unknown "); + break; + + case ACPI_TABLE_ORIGIN_MAPPED: + AcpiOsPrintf ("Mapped "); + break; + + case ACPI_TABLE_ORIGIN_ALLOCATED: + AcpiOsPrintf ("Allocated "); + break; + + case ACPI_TABLE_ORIGIN_OVERRIDE: + AcpiOsPrintf ("Override "); + break; + + default: + AcpiOsPrintf ("INVALID "); + break; + } /* Make sure that the table is mapped */ @@ -290,55 +331,45 @@ AcpiDbDisplayTableInfo ( * * FUNCTION: AcpiDbUnloadAcpiTable * - * PARAMETERS: TableArg - Name of the table to be unloaded - * InstanceArg - Which instance of the table to unload (if - * there are multiple tables of the same type) + * PARAMETERS: ObjectName - Namespace pathname for an object that + * is owned by the table to be unloaded * - * RETURN: Nonde + * RETURN: None * - * DESCRIPTION: Unload an ACPI table. - * Instance is not implemented + * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned + * by the table. * ******************************************************************************/ void AcpiDbUnloadAcpiTable ( - char *TableArg, - char *InstanceArg) + char *ObjectName) { -/* TBD: Need to reimplement for new data structures */ - -#if 0 - UINT32 i; + ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; - /* Search all tables for the target type */ + /* Translate name to an Named object */ - for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++) + Node = AcpiDbConvertToNode (ObjectName); + if (!Node) { - if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature, - AcpiGbl_TableData[i].SigLength)) - { - /* Found the table, unload it */ - - Status = AcpiUnloadTable (i); - if (ACPI_SUCCESS (Status)) - { - AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg); - } - else - { - AcpiOsPrintf ("%s, while unloading [%s]\n", - AcpiFormatException (Status), TableArg); - } - - return; - } + AcpiOsPrintf ("Could not find [%s] in namespace\n", + ObjectName); + return; } - AcpiOsPrintf ("Unknown table type [%s]\n", TableArg); -#endif + Status = AcpiUnloadParentTable (ACPI_CAST_PTR (ACPI_HANDLE, Node)); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("Parent of [%s] (%p) unloaded and uninstalled\n", + ObjectName, Node); + } + else + { + AcpiOsPrintf ("%s, while unloading parent table of [%s]\n", + AcpiFormatException (Status), ObjectName); + } } Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Wed Jul 11 16:51:47 2012 (r238367) @@ -250,7 +250,7 @@ AcpiDbDisplayHelp ( AcpiOsPrintf (" Stack Display CPU stack usage\n"); AcpiOsPrintf (" Tables Info about current ACPI table(s)\n"); AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n"); - AcpiOsPrintf (" Unload [Instance] Unload an ACPI table\n"); + AcpiOsPrintf (" Unload Unload an ACPI table via namespace object\n"); AcpiOsPrintf (" ! Execute command from history buffer\n"); AcpiOsPrintf (" !! Execute last command again\n"); @@ -894,7 +894,7 @@ AcpiDbCommandDispatch ( break; case CMD_UNLOAD: - AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); + AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]); break; case CMD_EXIT: Modified: vendor-sys/acpica/dist/source/components/events/evxfgpe.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/events/evxfgpe.c Wed Jul 11 16:51:47 2012 (r238367) @@ -83,7 +83,7 @@ AcpiUpdateAllGpes ( ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (AcpiUpdateGpes); + ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes); Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); @@ -298,7 +298,8 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify; ACPI_CPU_FLAGS Flags; @@ -334,6 +335,11 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* + * Allocate a new notify object up front, in case it is needed. + * Memory allocation while holding a spinlock is a big no-no + * on some hosts. + */ NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); if (!NewNotify) { @@ -401,8 +407,12 @@ AcpiSetupGpeForWake ( GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; Status = AE_OK; + UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + + /* Delete the notify object if it was not used above */ + if (NewNotify) { ACPI_FREE (NewNotify); Modified: vendor-sys/acpica/dist/source/components/executer/exprep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exprep.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/executer/exprep.c Wed Jul 11 16:51:47 2012 (r238367) @@ -418,8 +418,8 @@ AcpiExPrepCommonFieldObject ( * * RETURN: Status * - * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and - * connect it to the parent Node. + * DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a + * subtype of DefField and connect it to the parent Node. * ******************************************************************************/ Modified: vendor-sys/acpica/dist/source/components/executer/exresolv.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exresolv.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/executer/exresolv.c Wed Jul 11 16:51:47 2012 (r238367) @@ -165,7 +165,7 @@ AcpiExResolveObjectToValue ( StackDesc = *StackPtr; - /* This is an ACPI_OPERAND_OBJECT */ + /* This is an object of type ACPI_OPERAND_OBJECT */ switch (StackDesc->Common.Type) { Modified: vendor-sys/acpica/dist/source/components/executer/exstore.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exstore.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/executer/exstore.c Wed Jul 11 16:51:47 2012 (r238367) @@ -68,15 +68,15 @@ AcpiExStoreObjectToIndex ( * FUNCTION: AcpiExStore * * PARAMETERS: *SourceDesc - Value to be stored - * *DestDesc - Where to store it. Must be an NS node - * or an ACPI_OPERAND_OBJECT of type + * *DestDesc - Where to store it. Must be an NS node + * or ACPI_OPERAND_OBJECT of type * Reference; * WalkState - Current walk state * * RETURN: Status * * DESCRIPTION: Store the value described by SourceDesc into the location - * described by DestDesc. Called by various interpreter + * described by DestDesc. Called by various interpreter * functions to store the result of an operation into * the destination operand -- not just simply the actual "Store" * ASL operator. Modified: vendor-sys/acpica/dist/source/components/executer/exutils.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exutils.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/executer/exutils.c Wed Jul 11 16:51:47 2012 (r238367) @@ -121,7 +121,7 @@ AcpiExEnterInterpreter ( * * DESCRIPTION: Reacquire the interpreter execution region from within the * interpreter code. Failure to enter the interpreter region is a - * fatal system error. Used in conjuction with + * fatal system error. Used in conjunction with * RelinquishInterpreter * ******************************************************************************/ Modified: vendor-sys/acpica/dist/source/components/hardware/hwsleep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwsleep.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/hardware/hwsleep.c Wed Jul 11 16:51:47 2012 (r238367) @@ -99,20 +99,6 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - if (SleepState != ACPI_STATE_S5) - { - /* - * Disable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - } - /* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs @@ -380,17 +366,6 @@ AcpiHwLegacyWake ( AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - /* - * Enable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } Modified: vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Wed Jul 11 16:51:47 2012 (r238367) @@ -101,6 +101,14 @@ AcpiSetFirmwareWakingVector ( ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); + /* + * According to the ACPI specification 2.0c and later, the 64-bit + * waking vector should be cleared and the 32-bit waking vector should + * be used, unless we want the wake-up code to be called by the BIOS in + * Protected Mode. Some systems (for example HP dv5-1004nr) are known + * to fail to resume if the 64-bit vector is used. + */ + /* Set the 32-bit vector */ AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; Modified: vendor-sys/acpica/dist/source/components/namespace/nspredef.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nspredef.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/namespace/nspredef.c Wed Jul 11 16:51:47 2012 (r238367) @@ -681,7 +681,7 @@ AcpiNsCheckPackage ( { /* Create the new outer package and populate it */ - Status = AcpiNsWrapWithPackage (Data, *Elements, ReturnObjectPtr); + Status = AcpiNsWrapWithPackage (Data, ReturnObject, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { return (Status); Modified: vendor-sys/acpica/dist/source/components/parser/psxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/parser/psxface.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/parser/psxface.c Wed Jul 11 16:51:47 2012 (r238367) @@ -348,8 +348,8 @@ AcpiPsExecuteMethod ( } /* - * Start method evaluation with an implicit return of zero. This is done - * for Windows compatibility. + * Start method evaluation with an implicit return of zero. + * This is done for Windows compatibility. */ if (AcpiGbl_EnableInterpreterSlack) { Modified: vendor-sys/acpica/dist/source/components/resources/rscreate.c ============================================================================== --- vendor-sys/acpica/dist/source/components/resources/rscreate.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/resources/rscreate.c Wed Jul 11 16:51:47 2012 (r238367) @@ -209,8 +209,8 @@ AcpiRsCreateResourceList ( * * FUNCTION: AcpiRsCreatePciRoutingTable * - * PARAMETERS: PackageObject - Pointer to an ACPI_OPERAND_OBJECT - * package + * PARAMETERS: PackageObject - Pointer to a package containing one + * of more ACPI_OPERAND_OBJECTs * OutputBuffer - Pointer to the user's buffer * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. @@ -218,7 +218,7 @@ AcpiRsCreateResourceList ( * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a + * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a * linked list of PCI interrupt descriptions * * NOTE: It is the caller's responsibility to ensure that the start of the Modified: vendor-sys/acpica/dist/source/components/resources/rsutils.c ============================================================================== --- vendor-sys/acpica/dist/source/components/resources/rsutils.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/resources/rsutils.c Wed Jul 11 16:51:47 2012 (r238367) @@ -181,7 +181,7 @@ AcpiRsMoveData ( /* * 16-, 32-, and 64-bit cases must use the move macros that perform - * endian conversion and/or accomodate hardware that cannot perform + * endian conversion and/or accommodate hardware that cannot perform * misaligned memory transfers */ case ACPI_RSC_MOVE16: Modified: vendor-sys/acpica/dist/source/components/tables/tbfadt.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbfadt.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/tables/tbfadt.c Wed Jul 11 16:51:47 2012 (r238367) @@ -192,7 +192,7 @@ static ACPI_FADT_PM_INFO FadtPmInfoTa * * PARAMETERS: GenericAddress - GAS struct to be initialized * SpaceId - ACPI Space ID for this register - * ByteWidth - Width of this register, in bytes + * ByteWidth - Width of this register * Address - Address of the register * * RETURN: None @@ -338,7 +338,7 @@ AcpiTbCreateLocalFadt ( */ if (Length > sizeof (ACPI_TABLE_FADT)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "FADT (revision %u) is longer than ACPI 5.0 version, " "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); @@ -486,8 +486,9 @@ AcpiTbConvertFadt ( if (Address64->Address && Address32 && (Address64->Address != (UINT64) Address32)) { - ACPI_ERROR ((AE_INFO, - "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", + ACPI_BIOS_ERROR ((AE_INFO, + "32/64X address mismatch in FADT/%s: " + "0x%8.8X/0x%8.8X%8.8X, using 32", FadtInfoTable[i].Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address))); } @@ -546,7 +547,7 @@ AcpiTbValidateFadt ( if (AcpiGbl_FADT.Facs && (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "32/64X FACS address mismatch in FADT - " "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs))); @@ -557,7 +558,7 @@ AcpiTbValidateFadt ( if (AcpiGbl_FADT.Dsdt && (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "32/64X DSDT address mismatch in FADT - " "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt))); @@ -593,8 +594,8 @@ AcpiTbValidateFadt ( if (Address64->Address && (Address64->BitWidth != ACPI_MUL_8 (Length))) { - ACPI_WARNING ((AE_INFO, - "32/64X length mismatch in %s: %u/%u", + ACPI_BIOS_WARNING ((AE_INFO, + "32/64X length mismatch in FADT/%s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } @@ -606,9 +607,9 @@ AcpiTbValidateFadt ( */ if (!Address64->Address || !Length) { - ACPI_ERROR ((AE_INFO, - "Required field %s has zero address and/or length:" - " 0x%8.8X%8.8X/0x%X", + ACPI_BIOS_ERROR ((AE_INFO, + "Required FADT field %s has zero address and/or length: " + "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } @@ -622,8 +623,8 @@ AcpiTbValidateFadt ( if ((Address64->Address && !Length) || (!Address64->Address && Length)) { - ACPI_WARNING ((AE_INFO, - "Optional field %s has zero address or length: " + ACPI_BIOS_WARNING ((AE_INFO, + "Optional FADT field %s has zero address or length: " "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } @@ -674,8 +675,8 @@ AcpiTbSetupFadtRegisters ( (FadtInfoTable[i].DefaultLength > 0) && (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { - ACPI_WARNING ((AE_INFO, - "Invalid length for %s: %u, using default %u", + ACPI_BIOS_WARNING ((AE_INFO, + "Invalid length for FADT/%s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); Modified: vendor-sys/acpica/dist/source/components/tables/tbinstal.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbinstal.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/tables/tbinstal.c Wed Jul 11 16:51:47 2012 (r238367) @@ -157,8 +157,9 @@ AcpiTbAddTable ( (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) && (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3))) { - ACPI_ERROR ((AE_INFO, - "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", + ACPI_BIOS_ERROR ((AE_INFO, + "Table has invalid signature [%4.4s] (0x%8.8X), " + "must be SSDT or OEMx", AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ? TableDesc->Pointer->Signature : "????", *(UINT32 *) TableDesc->Pointer->Signature)); Modified: vendor-sys/acpica/dist/source/components/tables/tbutils.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbutils.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/tables/tbutils.c Wed Jul 11 16:51:47 2012 (r238367) @@ -287,8 +287,9 @@ AcpiTbVerifyChecksum ( if (Checksum) { - ACPI_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", Table->Signature, Table->Checksum, (UINT8) (Table->Checksum - Checksum))); @@ -356,8 +357,9 @@ AcpiTbCheckDsdtHeader ( if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length || AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum) { - ACPI_ERROR ((AE_INFO, - "The DSDT has been corrupted or replaced - old, new headers below")); + ACPI_BIOS_ERROR ((AE_INFO, + "The DSDT has been corrupted or replaced - " + "old, new headers below")); AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader); AcpiTbPrintTableHeader (0, AcpiGbl_DSDT); @@ -465,7 +467,7 @@ AcpiTbInstallTable ( if (Signature && !ACPI_COMPARE_NAME (Table->Signature, Signature)) { - ACPI_ERROR ((AE_INFO, + ACPI_BIOS_ERROR ((AE_INFO, "Invalid signature 0x%X for ACPI table, expected [%s]", *ACPI_CAST_PTR (UINT32, Table->Signature), Signature)); goto UnmapAndExit; @@ -584,7 +586,7 @@ AcpiTbGetRootTableEntry ( { /* Will truncate 64-bit address to 32 bits, issue warning */ - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," " truncating", ACPI_FORMAT_UINT64 (Address64))); @@ -686,7 +688,8 @@ AcpiTbParseRootTable ( if (Length < sizeof (ACPI_TABLE_HEADER)) { - ACPI_ERROR ((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", Length)); + ACPI_BIOS_ERROR ((AE_INFO, + "Invalid table length 0x%X in RSDT/XSDT", Length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } Modified: vendor-sys/acpica/dist/source/components/tables/tbxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbxface.c Wed Jul 11 16:27:02 2012 (r238366) +++ vendor-sys/acpica/dist/source/components/tables/tbxface.c Wed Jul 11 16:51:47 2012 (r238367) @@ -1,7 +1,6 @@ /****************************************************************************** * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 16:52:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AD051065680; Wed, 11 Jul 2012 16:52:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06A78FC14; Wed, 11 Jul 2012 16:52: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 q6BGqPhd054408; Wed, 11 Jul 2012 16:52:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BGqPXp054407; Wed, 11 Jul 2012 16:52:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207111652.q6BGqPXp054407@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 16:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238368 - vendor-sys/acpica/20120711 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 16:52:26 -0000 Author: jkim Date: Wed Jul 11 16:52:25 2012 New Revision: 238368 URL: http://svn.freebsd.org/changeset/base/238368 Log: Tag ACPICA 20120711. Added: vendor-sys/acpica/20120711/ - copied from r238367, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 17:11:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28DB6106564A; Wed, 11 Jul 2012 17:11:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A9618FC0C; Wed, 11 Jul 2012 17:11:08 +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 q6BHB7Le055269; Wed, 11 Jul 2012 17:11:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BHB7fs055266; Wed, 11 Jul 2012 17:11:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207111711.q6BHB7fs055266@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Jul 2012 17:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238369 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 17:11:08 -0000 Author: imp Date: Wed Jul 11 17:11:07 2012 New Revision: 238369 URL: http://svn.freebsd.org/changeset/base/238369 Log: at91$DEV->at91_$DEV to match other Atmel drivers. Also, export at91_rst_cpu_reset. Modified: head/sys/arm/at91/at91_rst.c head/sys/arm/at91/at91_rstreg.h Modified: head/sys/arm/at91/at91_rst.c ============================================================================== --- head/sys/arm/at91/at91_rst.c Wed Jul 11 16:52:25 2012 (r238368) +++ head/sys/arm/at91/at91_rst.c Wed Jul 11 17:11:07 2012 (r238369) @@ -42,26 +42,26 @@ __FBSDID("$FreeBSD$"); #define RST_TIMEOUT (5) /* Seconds to hold NRST for hard reset */ #define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ -static int at91rst_intr(void *arg); +static int at91_rst_intr(void *arg); -static struct at91rst_softc { +static struct at91_rst_softc { struct resource *mem_res; /* Memory resource */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ struct callout tick_ch; /* Tick callout */ device_t sc_dev; u_int shutdown; /* Shutdown in progress */ -} *at91rst_sc; +} *at91_rst_sc; static inline uint32_t -RD4(struct at91rst_softc *sc, bus_size_t off) +RD4(struct at91_rst_softc *sc, bus_size_t off) { return (bus_read_4(sc->mem_res, off)); } static inline void -WR4(struct at91rst_softc *sc, bus_size_t off, uint32_t val) +WR4(struct at91_rst_softc *sc, bus_size_t off, uint32_t val) { bus_write_4(sc->mem_res, off, val); @@ -70,17 +70,17 @@ WR4(struct at91rst_softc *sc, bus_size_t void cpu_reset_sam9g20(void) __attribute__((weak)); void cpu_reset_sam9g20(void) {} -static void -at91rst_cpu_reset(void) +void +at91_rst_cpu_reset(void) { - if (at91rst_sc) { + if (at91_rst_sc) { cpu_reset_sam9g20(); /* May be null */ - WR4(at91rst_sc, RST_MR, + WR4(at91_rst_sc, RST_MR, RST_MR_ERSTL(0xd) | RST_MR_URSTEN | RST_MR_KEY); - WR4(at91rst_sc, RST_CR, + WR4(at91_rst_sc, RST_CR, RST_CR_PROCRST | RST_CR_PERRST | RST_CR_EXTRST | @@ -91,7 +91,7 @@ at91rst_cpu_reset(void) } static int -at91rst_probe(device_t dev) +at91_rst_probe(device_t dev) { device_set_desc(dev, "AT91SAM9 Reset Controller"); @@ -99,13 +99,13 @@ at91rst_probe(device_t dev) } static int -at91rst_attach(device_t dev) +at91_rst_attach(device_t dev) { - struct at91rst_softc *sc; + struct at91_rst_softc *sc; const char *cause; int rid, err; - at91rst_sc = sc = device_get_softc(dev); + at91_rst_sc = sc = device_get_softc(dev); sc->sc_dev = dev; callout_init(&sc->tick_ch, 0); @@ -129,11 +129,11 @@ at91rst_attach(device_t dev) /* Activate the interrupt. */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - at91rst_intr, NULL, sc, &sc->intrhand); + at91_rst_intr, NULL, sc, &sc->intrhand); if (err) device_printf(dev, "could not establish interrupt handler.\n"); - WR4(at91rst_sc, RST_MR, RST_MR_ERSTL(0xd) | RST_MR_URSIEN | RST_MR_KEY); + WR4(at91_rst_sc, RST_MR, RST_MR_ERSTL(0xd) | RST_MR_URSIEN | RST_MR_KEY); switch (RD4(sc, RST_SR) & RST_SR_RST_MASK) { case RST_SR_RST_POW: @@ -157,15 +157,14 @@ at91rst_attach(device_t dev) } device_printf(dev, "Reset cause: %s.\n", cause); - soc_data.reset = at91rst_cpu_reset; out: return (err); } static void -at91rst_tick(void *argp) +at91_rst_tick(void *argp) { - struct at91rst_softc *sc = argp; + struct at91_rst_softc *sc = argp; if (sc->shutdown++ >= RST_TIMEOUT * RST_TICK) { /* User released the button in morre than RST_TIMEOUT */ @@ -176,36 +175,36 @@ at91rst_tick(void *argp) device_printf(sc->sc_dev, "shutting down...\n"); shutdown_nice(0); } else { - callout_reset(&sc->tick_ch, hz/RST_TICK, at91rst_tick, sc); + callout_reset(&sc->tick_ch, hz/RST_TICK, at91_rst_tick, sc); } } static int -at91rst_intr(void *argp) +at91_rst_intr(void *argp) { - struct at91rst_softc *sc = argp; + struct at91_rst_softc *sc = argp; if (RD4(sc, RST_SR) & RST_SR_URSTS) { if (sc->shutdown == 0) - callout_reset(&sc->tick_ch, hz/RST_TICK, at91rst_tick, sc); + callout_reset(&sc->tick_ch, hz/RST_TICK, at91_rst_tick, sc); return (FILTER_HANDLED); } return (FILTER_STRAY); } -static device_method_t at91rst_methods[] = { - DEVMETHOD(device_probe, at91rst_probe), - DEVMETHOD(device_attach, at91rst_attach), +static device_method_t at91_rst_methods[] = { + DEVMETHOD(device_probe, at91_rst_probe), + DEVMETHOD(device_attach, at91_rst_attach), DEVMETHOD_END }; -static driver_t at91rst_driver = { +static driver_t at91_rst_driver = { "at91_rst", - at91rst_methods, - sizeof(struct at91rst_softc), + at91_rst_methods, + sizeof(struct at91_rst_softc), }; -static devclass_t at91rst_devclass; +static devclass_t at91_rst_devclass; -DRIVER_MODULE(at91_rst, atmelarm, at91rst_driver, at91rst_devclass, NULL, +DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, NULL, NULL); Modified: head/sys/arm/at91/at91_rstreg.h ============================================================================== --- head/sys/arm/at91/at91_rstreg.h Wed Jul 11 16:52:25 2012 (r238368) +++ head/sys/arm/at91/at91_rstreg.h Wed Jul 11 17:11:07 2012 (r238369) @@ -25,8 +25,8 @@ /* $FreeBSD$ */ -#ifndef ARM_AT91_AT91RSTREG_H -#define ARM_AT91_AT91RSTREG_H +#ifndef ARM_AT91_AT91_RSTREG_H +#define ARM_AT91_AT91_RSTREG_H #define RST_CR 0x0 /* Control Register */ #define RST_SR 0x4 /* Status Register */ @@ -56,4 +56,8 @@ #define RST_MR_ERSTL(x) ((x)<<8) /* External reset length */ #define RST_MR_KEY (0xa5<<24) -#endif /* ARM_AT91_AT91RSTREG_H */ +#ifndef __ASSEMBLER__ +void at91_rst_cpu_reset(void); +#endif + +#endif /* ARM_AT91_AT91_RSTREG_H */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 17:11:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EACC106566B; Wed, 11 Jul 2012 17:11:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8788FC14; Wed, 11 Jul 2012 17:11: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 q6BHBsaF055334; Wed, 11 Jul 2012 17:11:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BHBsYN055331; Wed, 11 Jul 2012 17:11:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207111711.q6BHBsYN055331@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Jul 2012 17:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238370 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 17:11:55 -0000 Author: imp Date: Wed Jul 11 17:11:54 2012 New Revision: 238370 URL: http://svn.freebsd.org/changeset/base/238370 Log: at91pit->at91_pit for consistnecy with other drivers. Modified: head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_pitreg.h Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Wed Jul 11 17:11:07 2012 (r238369) +++ head/sys/arm/at91/at91_pit.c Wed Jul 11 17:11:54 2012 (r238370) @@ -59,7 +59,7 @@ static struct pit_softc { } *sc; static uint32_t timecount = 0; -static unsigned at91pit_get_timecount(struct timecounter *tc); +static unsigned at91_pit_get_timecount(struct timecounter *tc); static int pit_intr(void *arg); static inline uint32_t @@ -76,8 +76,8 @@ WR4(struct pit_softc *sc, bus_size_t off bus_write_4(sc->mem_res, off, val); } -static void -at91pit_delay(int us) +void +at91_pit_delay(int us) { int32_t cnt, last, piv; uint64_t pit_freq; @@ -99,8 +99,8 @@ at91pit_delay(int us) } } -static struct timecounter at91pit_timecounter = { - at91pit_get_timecount, /* get_timecount */ +static struct timecounter at91_pit_timecounter = { + at91_pit_get_timecount, /* get_timecount */ NULL, /* no poll_pps */ 0xffffffff, /* counter mask */ 0 / PIT_PRESCALE, /* frequency */ @@ -109,7 +109,7 @@ static struct timecounter at91pit_timeco }; static int -at91pit_probe(device_t dev) +at91_pit_probe(device_t dev) { device_set_desc(dev, "AT91SAM9 PIT"); @@ -117,7 +117,7 @@ at91pit_probe(device_t dev) } static int -at91pit_attach(device_t dev) +at91_pit_attach(device_t dev) { void *ih; int rid, err = 0; @@ -148,32 +148,31 @@ at91pit_attach(device_t dev) err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, pit_intr, NULL, NULL, &ih); - at91pit_timecounter.tc_frequency = at91_master_clock / PIT_PRESCALE; - tc_init(&at91pit_timecounter); + at91_pit_timecounter.tc_frequency = at91_master_clock / PIT_PRESCALE; + tc_init(&at91_pit_timecounter); /* Enable the PIT here. */ WR4(sc, PIT_MR, PIT_PIV(at91_master_clock / PIT_PRESCALE / hz) | PIT_EN | PIT_IEN); - soc_data.delay = at91pit_delay; out: return (err); } -static device_method_t at91pit_methods[] = { - DEVMETHOD(device_probe, at91pit_probe), - DEVMETHOD(device_attach, at91pit_attach), +static device_method_t at91_pit_methods[] = { + DEVMETHOD(device_probe, at91_pit_probe), + DEVMETHOD(device_attach, at91_pit_attach), DEVMETHOD_END }; -static driver_t at91pit_driver = { +static driver_t at91_pit_driver = { "at91_pit", - at91pit_methods, + at91_pit_methods, sizeof(struct pit_softc), }; -static devclass_t at91pit_devclass; +static devclass_t at91_pit_devclass; -DRIVER_MODULE(at91_pit, atmelarm, at91pit_driver, at91pit_devclass, NULL, +DRIVER_MODULE(at91_pit, atmelarm, at91_pit_driver, at91_pit_devclass, NULL, NULL); static int @@ -195,7 +194,7 @@ pit_intr(void *arg) } static unsigned -at91pit_get_timecount(struct timecounter *tc) +at91_pit_get_timecount(struct timecounter *tc) { uint32_t piir, icnt; Modified: head/sys/arm/at91/at91_pitreg.h ============================================================================== --- head/sys/arm/at91/at91_pitreg.h Wed Jul 11 17:11:07 2012 (r238369) +++ head/sys/arm/at91/at91_pitreg.h Wed Jul 11 17:11:54 2012 (r238370) @@ -25,8 +25,8 @@ /* $FreeBSD$ */ -#ifndef ARM_AT91_AT91PITREG_H -#define ARM_AT91_AT91PITREG_H +#ifndef ARM_AT91_AT91_PITREG_H +#define ARM_AT91_AT91_PITREG_H #define PIT_MR 0x0 #define PIT_SR 0x4 @@ -42,4 +42,6 @@ /* PIT_SR */ #define PIT_PITS_DONE 1 /* interrupt done */ -#endif /* ARM_AT91_AT91PITREG_H */ +void at91_pit_delay(int us); + +#endif /* ARM_AT91_AT91_PITREG_H */ From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 18:16:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B11D4106566B; Wed, 11 Jul 2012 18:16:54 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CA0A8FC08; Wed, 11 Jul 2012 18:16: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 q6BIGscV058072; Wed, 11 Jul 2012 18:16:54 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BIGscc058070; Wed, 11 Jul 2012 18:16:54 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201207111816.q6BIGscc058070@svn.freebsd.org> From: Sean Bruno Date: Wed, 11 Jul 2012 18:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238371 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 18:16:54 -0000 Author: sbruno Date: Wed Jul 11 18:16:54 2012 New Revision: 238371 URL: http://svn.freebsd.org/changeset/base/238371 Log: When an MFI command fails, the driver needs to set bio->bio_resid so that the upper levels notice. Otherwise we see commands silently failing leading to data corruption. This mirrors dadone() Submitted by: Andrew Boyer aboyer@averesystems.com Reviewed by: scottl@freebsd.org MFC after: 2 weeks Modified: head/sys/dev/mfi/mfi_disk.c Modified: head/sys/dev/mfi/mfi_disk.c ============================================================================== --- head/sys/dev/mfi/mfi_disk.c Wed Jul 11 17:11:54 2012 (r238370) +++ head/sys/dev/mfi/mfi_disk.c Wed Jul 11 18:16:54 2012 (r238371) @@ -298,6 +298,7 @@ mfi_disk_complete(struct bio *bio) hdr = bio->bio_driver1; if (bio->bio_flags & BIO_ERROR) { + bio->bio_resid = bio->bio_bcount; if (bio->bio_error == 0) bio->bio_error = EIO; disk_err(bio, "hard error", -1, 1); From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 18:50:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47AB4106566C; Wed, 11 Jul 2012 18:50:51 +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 33AC68FC1A; Wed, 11 Jul 2012 18:50:51 +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 q6BIopPp059446; Wed, 11 Jul 2012 18:50:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BIop61059444; Wed, 11 Jul 2012 18:50:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207111850.q6BIop61059444@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Jul 2012 18:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238372 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 18:50:51 -0000 Author: kib Date: Wed Jul 11 18:50:50 2012 New Revision: 238372 URL: http://svn.freebsd.org/changeset/base/238372 Log: Fix build for kernels with dtrace hooks. MFC after: 1 month Modified: head/sys/kern/subr_devstat.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Wed Jul 11 18:16:54 2012 (r238371) +++ head/sys/kern/subr_devstat.c Wed Jul 11 18:50:50 2012 (r238372) @@ -87,8 +87,12 @@ uint32_t dtio_wait_done_id; #define DTRACE_DEVSTAT_START() +#define DTRACE_DEVSTAT_BIO_START() + #define DTRACE_DEVSTAT_DONE() +#define DTRACE_DEVSTAT_BIO_DONE() + #define DTRACE_DEVSTAT_WAIT_START() #define DTRACE_DEVSTAT_WAIT_DONE() From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 18:54:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16337106564A; Wed, 11 Jul 2012 18:54:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 873878FC0A; Wed, 11 Jul 2012 18:54:21 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6BIsRuG091689; Wed, 11 Jul 2012 21:54:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6BIsFCk062181; Wed, 11 Jul 2012 21:54:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6BIsFHB062180; Wed, 11 Jul 2012 21:54:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Jul 2012 21:54:15 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120711185415.GI2338@deviant.kiev.zoral.com.ua> References: <201207111850.q6BIop61059444@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h3Z7hgQQ7qPTU8Su" Content-Disposition: inline In-Reply-To: <201207111850.q6BIop61059444@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r238372 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 18:54:22 -0000 --h3Z7hgQQ7qPTU8Su Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 11, 2012 at 06:50:50PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Jul 11 18:50:50 2012 > New Revision: 238372 > URL: http://svn.freebsd.org/changeset/base/238372 >=20 > Log: > Fix build for kernels with dtrace hooks. Obviously, this should be read as 'without'. --h3Z7hgQQ7qPTU8Su Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/9y9YACgkQC3+MBN1Mb4jRjgCfZGXaBElf62XA/96fv/I5bSWK X98AoIM45ShDyremaGYeIUXqsptD9ezr =GhVh -----END PGP SIGNATURE----- --h3Z7hgQQ7qPTU8Su-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 19:08:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4855B106564A; Wed, 11 Jul 2012 19:08:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346888FC0A; Wed, 11 Jul 2012 19:08: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 q6BJ8ONN060313; Wed, 11 Jul 2012 19:08:24 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BJ8O04060311; Wed, 11 Jul 2012 19:08:24 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201207111908.q6BJ8O04060311@svn.freebsd.org> From: Sean Bruno Date: Wed, 11 Jul 2012 19:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238373 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 19:08:24 -0000 Author: sbruno Date: Wed Jul 11 19:08:23 2012 New Revision: 238373 URL: http://svn.freebsd.org/changeset/base/238373 Log: sys/dev/mfivar.h contains references to MFI_DEBUG, but it never gets turned on unless the file also includes opt_mfi.h. Submitted by: Andrew Boyer aboyer@averesystems.com MFC after: 2 weeks Modified: head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Wed Jul 11 18:50:50 2012 (r238372) +++ head/sys/dev/mfi/mfivar.h Wed Jul 11 19:08:23 2012 (r238373) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_mfi.h" /* * SCSI structures and definitions are used from here, but no linking From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 19:12:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 366031065675; Wed, 11 Jul 2012 19:12:11 +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 174AF8FC1A; Wed, 11 Jul 2012 19:12: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 q6BJCASC060516; Wed, 11 Jul 2012 19:12:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BJCAUT060514; Wed, 11 Jul 2012 19:12:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207111912.q6BJCAUT060514@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Jul 2012 19:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238374 - head/tools/test/upsdl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 19:12:11 -0000 Author: kib Date: Wed Jul 11 19:12:10 2012 New Revision: 238374 URL: http://svn.freebsd.org/changeset/base/238374 Log: Add a test program, written by Stephan Uphoff, which demonstrates the deadlock due to i/o performed over the buffers backed by file mappings. MFC after: 2 weeks Approved by: ups Added: head/tools/test/upsdl/ head/tools/test/upsdl/Makefile (contents, props changed) head/tools/test/upsdl/upsdl.c (contents, props changed) Added: head/tools/test/upsdl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/upsdl/Makefile Wed Jul 11 19:12:10 2012 (r238374) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= upsdl +NO_MAN= + +.include Added: head/tools/test/upsdl/upsdl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/upsdl/upsdl.c Wed Jul 11 19:12:10 2012 (r238374) @@ -0,0 +1,175 @@ +/*- + * Copyright (c) 2006, Stephan Uphoff + * 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 unmodified, 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#include +#include +#include +#include +#include +#include + + +int prepareFile(char* filename,int* fdp); +int mapBuffer(char** bufferp,int fd1,int fd2); +int startIO(int fd,char *buffer); + +int pagesize; + +#define FILESIZE (32*1024) +char wbuffer[FILESIZE]; + +/* Create a FILESIZE sized file - then remove file data from the cache*/ +int prepareFile(char* filename,int* fdp) +{ + int fd; + int len; + int status; + void *addr; + + fd = open(filename,O_CREAT | O_TRUNC | O_RDWR,S_IRWXU); + if (fd == -1) + { + perror("Creating file"); + return fd; + } + + len = write(fd,wbuffer,FILESIZE); + if (len < 0) + { + perror("Write failed"); + return 1; + } + + status = fsync(fd); + if (status != 0) + { + perror("fsync failed"); + return 1; + } + + addr = mmap(NULL,FILESIZE, PROT_READ | PROT_WRITE , MAP_SHARED, fd, 0); + if (addr == MAP_FAILED) + { + perror("Mmap failed"); + return 1; + } + + status = msync(addr,FILESIZE,MS_INVALIDATE | MS_SYNC); + if (status != 0) + { + perror("Msync failed"); + return 1; + } + + munmap(addr,FILESIZE); + + *fdp = fd; + return 0; +} + + +/* mmap a 2 page buffer - first page is from fd1, second page from fd2 */ +int mapBuffer(char** bufferp,int fd1,int fd2) +{ + void* addr; + char *buffer; + + addr = mmap(NULL,pagesize*2, PROT_READ | PROT_WRITE , MAP_SHARED, fd1, 0); + if (addr == MAP_FAILED) + { + perror("Mmap failed"); + return 1; + } + + buffer = addr; + addr = mmap(buffer + pagesize,pagesize, PROT_READ | PROT_WRITE , MAP_FIXED | +MAP_SHARED, fd2, 0); + + if (addr == MAP_FAILED) + { + perror("Mmap2 failed"); + return 1; + } + *bufferp = buffer; + return 0; +} + + +int startIO(int fd,char *buffer) +{ + ssize_t len; + len = write(fd,buffer,2*pagesize); + if (len == -1) + { + perror("write failed"); + return 1; + } + return 0; +} + + +int main(int argc,char *argv[],char *envp[]) +{ + + int fdA,fdB,fdDelayA,fdDelayB; + int status; + char *bufferA,*bufferB; + pid_t pid; + + pagesize = getpagesize(); + + if ((prepareFile("A",&fdA)) + || (prepareFile("B",&fdB)) + || (prepareFile("DelayA",&fdDelayA)) + || (prepareFile("DelayB",&fdDelayB)) + || (mapBuffer(&bufferA,fdDelayA,fdB)) + || (mapBuffer(&bufferB,fdDelayB,fdA))) + exit(1); + + pid = fork(); + + if (pid == 0) + { + status = startIO(fdA,bufferA); + exit(status); + } + + if (pid == -1) + { + exit(1); + } + status = startIO(fdB,bufferB); + exit(status); + +} + + + + + From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 19:46:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5A3106566C; Wed, 11 Jul 2012 19:46:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4698B8FC12; Wed, 11 Jul 2012 19:46:40 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so2774369pbb.13 for ; Wed, 11 Jul 2012 12:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=M2LQtJCTXXtMh/hOLu8m1OZo7i7u7+33B+Zhye1zNEs=; b=RsrUmRvcMj70bk5epGU1cCOKl3v7FdfqKRn7EmM4k/j/04tECl2wFI6KIcpYT4VlzE m0UbESbFkWHTiXSKzov7aM6Gi2sxN8+WpCsM/G4k+2JsvaqUjhkwdbGGnXy49NcTVdCk BZLaVnwePN3Gkh/XRSfrRB2eRvu8WFjNOgPE+JlhPjNio2arBciQjMQYahWbFISzXRuK nfW6DbNzRLu01rlswzO5gAsbvQkB7ICVDct5fm3stxQFI3tpQ9USyznL/RS+kFAWl7z9 UKMqbQRgAHezIxToVUpp5yubk2FmgBatcQLlwwSeMKEI99fBn4n3FfQXclJ1GfWXSmdQ GnQg== MIME-Version: 1.0 Received: by 10.68.222.163 with SMTP id qn3mr81056287pbc.135.1342036000122; Wed, 11 Jul 2012 12:46:40 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.195.102 with HTTP; Wed, 11 Jul 2012 12:46:40 -0700 (PDT) In-Reply-To: <201207110257.q6B2vXeW018145@svn.freebsd.org> References: <201207110257.q6B2vXeW018145@svn.freebsd.org> Date: Wed, 11 Jul 2012 12:46:40 -0700 X-Google-Sender-Auth: sIBpp74Jfg0kgJUSnC3eJ0oWqSw Message-ID: From: Adrian Chadd To: Hiroki Sato Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, current@freebsd.org Subject: Re: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 19:46:40 -0000 Hi, What was the original commit which broke wlan name matching? I can't see how a commit to usb_pf.c would "fix" this. Adrian From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 19:53:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D691065672; Wed, 11 Jul 2012 19:53:42 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (m209-73.dsl.rawbw.com [198.144.209.73]) by mx1.freebsd.org (Postfix) with ESMTP id D7A0C8FC1E; Wed, 11 Jul 2012 19:53:41 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.5/8.14.5) with ESMTP id q6BJrfGK007318; Wed, 11 Jul 2012 12:53:41 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.5/8.14.5/Submit) id q6BJrflY007317; Wed, 11 Jul 2012 12:53:41 -0700 (PDT) (envelope-from david) Date: Wed, 11 Jul 2012 12:53:41 -0700 From: David Wolfskill To: Adrian Chadd Message-ID: <20120711195341.GK3599@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , Adrian Chadd , Hiroki Sato , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, current@freebsd.org References: <201207110257.q6B2vXeW018145@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YIleam+9adpUeYf+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org, current@freebsd.org Subject: Re: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 19:53:42 -0000 --YIleam+9adpUeYf+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 11, 2012 at 12:46:40PM -0700, Adrian Chadd wrote: > Hi, >=20 > What was the original commit which broke wlan name matching? >=20 > I can't see how a commit to usb_pf.c would "fix" this. > ... r238279 Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --YIleam+9adpUeYf+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/92cUACgkQmprOCmdXAD0pBwCfWs27KE/UsCDfbj2h2zdDzpHt 1tUAn1kn+aWmhtM0+ooueqbMG+Aj5GF8 =Y33G -----END PGP SIGNATURE----- --YIleam+9adpUeYf+-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 20:17:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA321065670; Wed, 11 Jul 2012 20:17:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4564C8FC1B; Wed, 11 Jul 2012 20:17: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 q6BKHF69063189; Wed, 11 Jul 2012 20:17:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BKHFZK063176; Wed, 11 Jul 2012 20:17:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207112017.q6BKHFZK063176@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Jul 2012 20:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238376 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 20:17:15 -0000 Author: imp Date: Wed Jul 11 20:17:14 2012 New Revision: 238376 URL: http://svn.freebsd.org/changeset/base/238376 Log: Make the SoC stuff a little more modular, and start to move away from having the CPU device that's a child of atmelarm that does stuff. o Create a linker_set for the support fucntions for the SoCs. o Rename soc_data to soc_info. o Move the delay and reset function pointers to new soc_data struct o Create elements for all known SoCs o Add lookup of the SoC we found, and print a warning if it isn't one we know about. Added: head/sys/arm/at91/at91soc.c (contents, props changed) head/sys/arm/at91/at91soc.h (contents, props changed) Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_st.c head/sys/arm/at91/at91_streg.h head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91_machdep.c Wed Jul 11 20:17:14 2012 (r238376) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -278,7 +279,7 @@ static const char *soc_subtype_name[] = [AT91_ST_SAM9X35] = "at91sam9x35", }; -struct at91_soc_info soc_data; +struct at91_soc_info soc_info; /* * Read the SoC ID from the CIDR register and try to match it against the @@ -291,92 +292,92 @@ at91_try_id(uint32_t dbgu_base) { uint32_t socid; - soc_data.cidr = *(volatile uint32_t *)(AT91_BASE + dbgu_base + + soc_info.cidr = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C1R); - socid = soc_data.cidr & ~AT91_CPU_VERSION_MASK; + socid = soc_info.cidr & ~AT91_CPU_VERSION_MASK; - soc_data.type = AT91_T_NONE; - soc_data.subtype = AT91_ST_NONE; - soc_data.family = (soc_data.cidr & AT91_CPU_FAMILY_MASK) >> 20; - soc_data.exid = *(volatile uint32_t *)(AT91_BASE + dbgu_base + + soc_info.type = AT91_T_NONE; + soc_info.subtype = AT91_ST_NONE; + soc_info.family = (soc_info.cidr & AT91_CPU_FAMILY_MASK) >> 20; + soc_info.exid = *(volatile uint32_t *)(AT91_BASE + dbgu_base + DBGU_C2R); switch (socid) { case AT91_CPU_CAP9: - soc_data.type = AT91_T_CAP9; + soc_info.type = AT91_T_CAP9; break; case AT91_CPU_RM9200: - soc_data.type = AT91_T_RM9200; + soc_info.type = AT91_T_RM9200; break; case AT91_CPU_SAM9XE128: case AT91_CPU_SAM9XE256: case AT91_CPU_SAM9XE512: case AT91_CPU_SAM9260: - soc_data.type = AT91_T_SAM9260; - if (soc_data.family == AT91_FAMILY_SAM9XE) - soc_data.subtype = AT91_ST_SAM9XE; + soc_info.type = AT91_T_SAM9260; + if (soc_info.family == AT91_FAMILY_SAM9XE) + soc_info.subtype = AT91_ST_SAM9XE; break; case AT91_CPU_SAM9261: - soc_data.type = AT91_T_SAM9261; + soc_info.type = AT91_T_SAM9261; break; case AT91_CPU_SAM9263: - soc_data.type = AT91_T_SAM9263; + soc_info.type = AT91_T_SAM9263; break; case AT91_CPU_SAM9G10: - soc_data.type = AT91_T_SAM9G10; + soc_info.type = AT91_T_SAM9G10; break; case AT91_CPU_SAM9G20: - soc_data.type = AT91_T_SAM9G20; + soc_info.type = AT91_T_SAM9G20; break; case AT91_CPU_SAM9G45: - soc_data.type = AT91_T_SAM9G45; + soc_info.type = AT91_T_SAM9G45; break; case AT91_CPU_SAM9N12: - soc_data.type = AT91_T_SAM9N12; + soc_info.type = AT91_T_SAM9N12; break; case AT91_CPU_SAM9RL64: - soc_data.type = AT91_T_SAM9RL; + soc_info.type = AT91_T_SAM9RL; break; case AT91_CPU_SAM9X5: - soc_data.type = AT91_T_SAM9X5; + soc_info.type = AT91_T_SAM9X5; break; default: return (0); } - switch (soc_data.type) { + switch (soc_info.type) { case AT91_T_SAM9G45: - switch (soc_data.exid) { + switch (soc_info.exid) { case AT91_EXID_SAM9G45: - soc_data.subtype = AT91_ST_SAM9G45; + soc_info.subtype = AT91_ST_SAM9G45; break; case AT91_EXID_SAM9G46: - soc_data.subtype = AT91_ST_SAM9G46; + soc_info.subtype = AT91_ST_SAM9G46; break; case AT91_EXID_SAM9M10: - soc_data.subtype = AT91_ST_SAM9M10; + soc_info.subtype = AT91_ST_SAM9M10; break; case AT91_EXID_SAM9M11: - soc_data.subtype = AT91_ST_SAM9M11; + soc_info.subtype = AT91_ST_SAM9M11; break; } break; case AT91_T_SAM9X5: - switch (soc_data.exid) { + switch (soc_info.exid) { case AT91_EXID_SAM9G15: - soc_data.subtype = AT91_ST_SAM9G15; + soc_info.subtype = AT91_ST_SAM9G15; break; case AT91_EXID_SAM9G25: - soc_data.subtype = AT91_ST_SAM9G25; + soc_info.subtype = AT91_ST_SAM9G25; break; case AT91_EXID_SAM9G35: - soc_data.subtype = AT91_ST_SAM9G35; + soc_info.subtype = AT91_ST_SAM9G35; break; case AT91_EXID_SAM9X25: - soc_data.subtype = AT91_ST_SAM9X25; + soc_info.subtype = AT91_ST_SAM9X25; break; case AT91_EXID_SAM9X35: - soc_data.subtype = AT91_ST_SAM9X35; + soc_info.subtype = AT91_ST_SAM9X35; break; } break; @@ -384,18 +385,24 @@ at91_try_id(uint32_t dbgu_base) break; } /* - * Disable interrupts + * Disable interrupts in the DBGU unit... */ *(volatile uint32_t *)(AT91_BASE + dbgu_base + USART_IDR) = 0xffffffff; /* * Save the name for later... */ - snprintf(soc_data.name, sizeof(soc_data.name), "%s%s%s", - soc_type_name[soc_data.type], - soc_data.subtype == AT91_ST_NONE ? "" : " subtype ", - soc_data.subtype == AT91_ST_NONE ? "" : - soc_subtype_name[soc_data.subtype]); + snprintf(soc_info.name, sizeof(soc_info.name), "%s%s%s", + soc_type_name[soc_info.type], + soc_info.subtype == AT91_ST_NONE ? "" : " subtype ", + soc_info.subtype == AT91_ST_NONE ? "" : + soc_subtype_name[soc_info.subtype]); + + /* + * try to get the matching CPU support. + */ + soc_info.soc_data = at91_match_soc(soc_info.type, soc_info.subtype); + return (1); } @@ -548,6 +555,9 @@ initarm(struct arm_boot_params *abp) cninit(); + if (soc_info.soc_data == NULL) + printf("Warning: No soc support for %s found.\n", soc_info.name); + memsize = board_init(); physmem = memsize / PAGE_SIZE; @@ -637,16 +647,16 @@ void DELAY(int n) { - if (soc_data.delay) - soc_data.delay(n); + if (soc_info.soc_data) + soc_info.soc_data->soc_delay(n); } void cpu_reset(void) { - if (soc_data.reset) - soc_data.reset(); + if (soc_info.soc_data) + soc_info.soc_data->soc_reset(); while (1) continue; } Modified: head/sys/arm/at91/at91_mci.c ============================================================================== --- head/sys/arm/at91/at91_mci.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91_mci.c Wed Jul 11 20:17:14 2012 (r238376) @@ -313,7 +313,7 @@ static int at91_mci_is_mci1rev2xx(void) { - switch (soc_data.type) { + switch (soc_info.type) { case AT91_T_SAM9260: case AT91_T_SAM9263: case AT91_T_CAP9: Modified: head/sys/arm/at91/at91_st.c ============================================================================== --- head/sys/arm/at91/at91_st.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91_st.c Wed Jul 11 20:17:14 2012 (r238376) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static struct at91_st_softc { struct resource * sc_irq_res; @@ -57,6 +58,12 @@ static inline uint32_t RD4(bus_size_t off) { + if (timer_softc == NULL) { + uint32_t *p = (uint32_t *)(AT91_BASE + AT91RM92_ST_BASE + off); + + return *p; + } + return (bus_read_4(timer_softc->sc_mem_res, off)); } @@ -64,7 +71,13 @@ static inline void WR4(bus_size_t off, uint32_t val) { - bus_write_4(timer_softc->sc_mem_res, off, val); + if (timer_softc == NULL) { + uint32_t *p = (uint32_t *)(AT91_BASE + AT91RM92_ST_BASE + off); + + *p = val; + } + else + bus_write_4(timer_softc->sc_mem_res, off, val); } static void at91_st_watchdog(void *, u_int, int *); @@ -105,7 +118,7 @@ clock_intr(void *arg) return (FILTER_STRAY); } -static void +void at91_st_delay(int n) { uint32_t start, end, cur; @@ -125,7 +138,7 @@ at91_st_delay(int n) } } -static void +void at91_st_cpu_reset(void) { /* @@ -209,9 +222,6 @@ at91_st_attach(device_t dev) if (err) return err; - soc_data.delay = at91_st_delay; - soc_data.reset = at91_st_cpu_reset; // XXX kinda late to be setting this... - timer_softc->sc_wet = EVENTHANDLER_REGISTER(watchdog_list, at91_st_watchdog, dev, 0); Modified: head/sys/arm/at91/at91_streg.h ============================================================================== --- head/sys/arm/at91/at91_streg.h Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91_streg.h Wed Jul 11 20:17:14 2012 (r238376) @@ -55,4 +55,7 @@ /* ST_CRTR */ #define ST_CRTR_MASK 0xfffff /* 20-bit counter */ +void at91_st_delay(int n); +void at91_st_cpu_reset(void); + #endif /* ARM_AT91_AT91STREG_H */ Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91rm9200.c Wed Jul 11 20:17:14 2012 (r238376) @@ -42,7 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + struct at91rm92_softc { device_t dev; @@ -171,7 +174,7 @@ static int at91_probe(device_t dev) { - device_set_desc(dev, soc_data.name); + device_set_desc(dev, soc_info.name); return (0); } @@ -277,3 +280,10 @@ static driver_t at91rm92_driver = { static devclass_t at91rm92_devclass; DRIVER_MODULE(at91rm920, atmelarm, at91rm92_driver, at91rm92_devclass, 0, 0); + +static struct at91_soc_data soc_data = { + .soc_delay = at91_st_delay, + .soc_reset = at91_st_cpu_reset +}; + +AT91_SOC(AT91_T_RM9200, &soc_data); Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91sam9260.c Wed Jul 11 20:17:14 2012 (r238376) @@ -39,10 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include +#include struct at91sam9_softc { device_t dev; @@ -162,7 +165,7 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (soc_data.type == AT91_T_SAM9260) { + if (soc_info.type == AT91_T_SAM9260) { at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); } @@ -172,7 +175,7 @@ static int at91_probe(device_t dev) { - device_set_desc(dev, soc_data.name); + device_set_desc(dev, soc_info.name); return (0); } @@ -293,3 +296,10 @@ static devclass_t at91sam9260_devclass; DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, NULL, NULL); + +static struct at91_soc_data soc_data = { + .soc_delay = at91_pit_delay, + .soc_reset = at91_rst_cpu_reset +}; + +AT91_SOC(AT91_T_SAM9260, &soc_data); Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91sam9g20.c Wed Jul 11 20:17:14 2012 (r238376) @@ -39,10 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include +#include struct at91sam9_softc { device_t dev; @@ -179,7 +182,7 @@ static int at91_probe(device_t dev) { - device_set_desc(dev, soc_data.name); + device_set_desc(dev, soc_info.name); return (0); } @@ -295,3 +298,10 @@ static driver_t at91sam9_driver = { static devclass_t at91sam9_devclass; DRIVER_MODULE(at91sam, atmelarm, at91sam9_driver, at91sam9_devclass, 0, 0); + +static struct at91_soc_data soc_data = { + .soc_delay = at91_pit_delay, + .soc_reset = at91_rst_cpu_reset +}; + +AT91_SOC(AT91_T_SAM9G20, &soc_data); Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91sam9x25.c Wed Jul 11 20:17:14 2012 (r238376) @@ -39,10 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include #include #include +#include struct at91sam9x25_softc { device_t dev; @@ -171,7 +174,7 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (soc_data.type == AT91_T_SAM9X5 && soc_data.subtype == AT91_ST_SAM9X25) { + if (soc_info.type == AT91_T_SAM9X5 && soc_info.subtype == AT91_ST_SAM9X25) { at91_add_child(parent, 0, "at91sam9x25", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); } @@ -284,3 +287,10 @@ static driver_t at91sam9x25_driver = { static devclass_t at91sam9x25_devclass; DRIVER_MODULE(at91sam9x25, atmelarm, at91sam9x25_driver, at91sam9x25_devclass, 0, 0); + +static struct at91_soc_data soc_data = { + .soc_delay = at91_pit_delay, + .soc_reset = at91_rst_cpu_reset +}; + +AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); Added: head/sys/arm/at91/at91soc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91soc.c Wed Jul 11 20:17:14 2012 (r238376) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2012 Warner Losh. 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 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +SET_DECLARE(at91_socs, const struct at91_soc); + +struct at91_soc_data * +at91_match_soc(enum at91_soc_type type, enum at91_soc_subtype subtype) +{ + const struct at91_soc **socp; + + SET_FOREACH(socp, at91_socs) { + if ((*socp)->soc_type != type) + continue; + if ((*socp)->soc_subtype != AT91_ST_ANY && + (*socp)->soc_subtype != subtype) + continue; + return (*socp)->soc_data; + } + return NULL; +} Added: head/sys/arm/at91/at91soc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91soc.h Wed Jul 11 20:17:14 2012 (r238376) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2012 Warner Losh. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _ARM_AT91_AT91SOC_H_ +#define _ARM_AT91_AT91SOC_H_ + +#include + +struct at91_soc { + enum at91_soc_type soc_type; /* Family of mail type of SoC */ + enum at91_soc_subtype soc_subtype; /* More specific soc, if any */ + struct at91_soc_data *soc_data; +}; + +// Make varadic +#define AT91_SOC(type, data) \ + static struct at91_soc this_soc = { \ + .soc_type = type, \ + .soc_subtype = AT91_ST_ANY, \ + .soc_data = data, \ + }; \ + DATA_SET(at91_socs, this_soc); + +#define AT91_SOC_SUB(type, subtype, data) \ + static struct at91_soc this_soc = { \ + .soc_type = type, \ + .soc_subtype = subtype, \ + .soc_data = data, \ + }; \ + DATA_SET(at91_socs, this_soc); + +struct at91_soc_data *at91_match_soc(enum at91_soc_type, enum at91_soc_subtype); + +#endif /* _ARM_AT91_AT91SOC_H_ */ Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/at91var.h Wed Jul 11 20:17:14 2012 (r238376) @@ -74,6 +74,7 @@ enum at91_soc_type { }; enum at91_soc_subtype { + AT91_ST_ANY = -1, /* Match any type */ AT91_ST_NONE = 0, /* AT91RM9200 */ AT91_ST_RM9200_BGA, @@ -104,6 +105,11 @@ enum at91_soc_family { typedef void (*DELAY_t)(int); typedef void (*cpu_reset_t)(void); +struct at91_soc_data { + DELAY_t soc_delay; + cpu_reset_t soc_reset; +}; + struct at91_soc_info { enum at91_soc_type type; enum at91_soc_subtype subtype; @@ -111,11 +117,10 @@ struct at91_soc_info { uint32_t cidr; uint32_t exid; char name[AT91_SOC_NAME_MAX]; - DELAY_t delay; - cpu_reset_t reset; + struct at91_soc_data *soc_data; }; -extern struct at91_soc_info soc_data; +extern struct at91_soc_info soc_info; static inline int at91_is_rm92(void); static inline int at91_is_sam9(void); @@ -126,28 +131,28 @@ static inline int at91_is_rm92(void) { - return (soc_data.type == AT91_T_RM9200); + return (soc_info.type == AT91_T_RM9200); } static inline int at91_is_sam9(void) { - return (soc_data.family == AT91_FAMILY_SAM9); + return (soc_info.family == AT91_FAMILY_SAM9); } static inline int at91_is_sam9xe(void) { - return (soc_data.family == AT91_FAMILY_SAM9XE); + return (soc_info.family == AT91_FAMILY_SAM9XE); } static inline int at91_cpu_is(u_int cpu) { - return (soc_data.type == cpu); + return (soc_info.type == cpu); } void at91_add_child(device_t dev, int prio, const char *name, int unit, Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Wed Jul 11 19:54:21 2012 (r238375) +++ head/sys/arm/at91/files.at91 Wed Jul 11 20:17:14 2012 (r238376) @@ -27,6 +27,7 @@ arm/at91/uart_dev_at91usart.c optional u # # All the "systems on a chip" we support # +arm/at91/at91soc.c standard arm/at91/at91rm9200.c optional at91rm9200 arm/at91/at91sam9260.c optional at91sam9260 arm/at91/at91sam9g20.c optional at91sam9g20 From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 22:16:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4762E10656B9; Wed, 11 Jul 2012 22:16:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id EB57B8FC08; Wed, 11 Jul 2012 22:15:59 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so2968446pbb.13 for ; Wed, 11 Jul 2012 15:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=2zJnKa7+mrPuwUwRiAzeb2DIvN63YMb+zpsBLeYZAwQ=; b=qAXMxSpmItzINMQVV33cbLXuLdhCvDqaGvd5NHGtoJw3+h9vDX28yjzdIRbO6TYKbh 26M4xq9eenM/OhxPCfxY+FWfL5OrRNLrmBEPfyXvW8peqJwcyprPpXvjjbzOpPONceb+ b02NcjWSkyd73MB7FLKxERMNuKV9YKV9vL/IvpyUFgADa5CJ1NG7tORAqDgy7vumCuk8 X7u4gGvPftaHQEIif3igSBntupOZoSPFeqNJ52jXXU5Vjju2zOXAeF/KyJb74yKz5xoK IwvqJp6Z+onJrDHCWyaMTZlqZLGFxADNhA/R1ilJqqwIW61W0423NtZUIEwSUfSEHXl5 /dew== MIME-Version: 1.0 Received: by 10.68.201.9 with SMTP id jw9mr81292849pbc.28.1342044959711; Wed, 11 Jul 2012 15:15:59 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.195.102 with HTTP; Wed, 11 Jul 2012 15:15:59 -0700 (PDT) In-Reply-To: <20120711195341.GK3599@albert.catwhisker.org> References: <201207110257.q6B2vXeW018145@svn.freebsd.org> <20120711195341.GK3599@albert.catwhisker.org> Date: Wed, 11 Jul 2012 15:15:59 -0700 X-Google-Sender-Auth: z6Z4KkGGoUO3dmKwFDeAaI5rCNE Message-ID: From: Adrian Chadd To: David Wolfskill , Adrian Chadd , Hiroki Sato , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 22:16:00 -0000 Again, that just touched usb. So, how'd that affect non-USB wifi cloning? Adiran From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 22:17:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34AD91065673; Wed, 11 Jul 2012 22:17:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A2B578FC15; Wed, 11 Jul 2012 22:17:07 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so2969904pbb.13 for ; Wed, 11 Jul 2012 15:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=IOa41/5lpawIsYG1S7oJqzMsDY5OPEvbXqECysz31O0=; b=AsHlYaok8m6Vuw6RUWHLzK4H0j/vkofdpPYVChfeYMD5Y9eWXF5Ra1R4/ZalqNGgWi zKTMgFi7h4tMhfM72Ao3sb50T5GugBtrDTS7zH199sjAcvflXR+O1KjQ5UoKw33EIQ+B +mI6B5xS90Ddc3mW2+zp6Kni26UfaHql+9SY6a4Cc4hp9XmnA65KJJmFPyo/a0e3z74T pda0oT+vb1N2lv/7gjY/3PzYZtr3kp3VDlDwltTbuY8Yht7Com25PYitoWsOr60aBFX9 UKMg3MtCDX5jA8gASqBmLVZ7RBZ/kT6hbcgdqmE2iMztnwM224M6VIWM7jxRUZ5bZ5ah HK3g== MIME-Version: 1.0 Received: by 10.68.195.198 with SMTP id ig6mr1400137pbc.92.1342045027419; Wed, 11 Jul 2012 15:17:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.195.102 with HTTP; Wed, 11 Jul 2012 15:17:07 -0700 (PDT) In-Reply-To: <201207111210.q6BCAEFk042562@svn.freebsd.org> References: <201207111210.q6BCAEFk042562@svn.freebsd.org> Date: Wed, 11 Jul 2012 15:17:07 -0700 X-Google-Sender-Auth: VUr7dHqwhcVTcwpwbf9IIrYkpBA Message-ID: From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238364 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 22:17:08 -0000 .. hm, interesting. I didn't catch this. Maybe I should whack the ATH_KTR_* things outside of the #ifdef ATH_DEBUG .. ? ADrian On 11 July 2012 05:10, John Baldwin wrote: > Author: jhb > Date: Wed Jul 11 12:10:13 2012 > New Revision: 238364 > URL: http://svn.freebsd.org/changeset/base/238364 > > Log: > Map ATH_KTR_* to 0 when ATH_DEBUG is not defined. This effectively NOPs > out their use in that case. > > Modified: > head/sys/dev/ath/if_ath_debug.h > > Modified: head/sys/dev/ath/if_ath_debug.h > ============================================================================== > --- head/sys/dev/ath/if_ath_debug.h Wed Jul 11 08:24:30 2012 (r238363) > +++ head/sys/dev/ath/if_ath_debug.h Wed Jul 11 12:10:13 2012 (r238364) > @@ -91,6 +91,9 @@ extern void ath_printrxbuf(struct ath_so > extern void ath_printtxbuf(struct ath_softc *, const struct ath_buf *bf, > u_int qnum, u_int ix, int done); > #else /* ATH_DEBUG */ > +#define ATH_KTR_INTR 0 > +#define ATH_KTR_ERR 0 > + > #define IFF_DUMPPKTS(sc, m) \ > ((sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) > #define DPRINTF(sc, m, fmt, ...) do { \ From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 22:17:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61E1D106575E; Wed, 11 Jul 2012 22:17:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE368FC16; Wed, 11 Jul 2012 22:17:59 +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 q6BMHxtF068095; Wed, 11 Jul 2012 22:17:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BMHxXn068093; Wed, 11 Jul 2012 22:17:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207112217.q6BMHxXn068093@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Jul 2012 22:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238377 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 22:17:59 -0000 Author: pfg Date: Wed Jul 11 22:17:58 2012 New Revision: 238377 URL: http://svn.freebsd.org/changeset/base/238377 Log: Merge libedit adjustment from NetBSD. On recent versions of NetBSD's libedit, el_gets now sets el_len to -1 on error so we can distinguish between a NULL string and an error. This fixes sh from exiting with newer versions of libedit now allowing EINTR to return. Obtained from: NetBSD Reviewed by: jilles MFC after: 3 weeks Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Wed Jul 11 20:17:14 2012 (r238376) +++ head/bin/sh/input.c Wed Jul 11 22:17:58 2012 (r238377) @@ -186,7 +186,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ) From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 22:20:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19EB8106568A; Wed, 11 Jul 2012 22:20:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040388FC1C; Wed, 11 Jul 2012 22:20:20 +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 q6BMKJCF068235; Wed, 11 Jul 2012 22:20:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BMKJtR068228; Wed, 11 Jul 2012 22:20:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207112220.q6BMKJtR068228@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Jul 2012 22:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238378 - head/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 22:20:20 -0000 Author: pfg Date: Wed Jul 11 22:20:19 2012 New Revision: 238378 URL: http://svn.freebsd.org/changeset/base/238378 Log: Re-merge a couple of changes from NetBSD's libedit. bin/sh has been taught about el_gets setting the count to -1 on error, so now we can partially revert r238173 to reduce differences with NetBSD's implementation. Unfortunately NetBSD's libedit handling of EINTR (Revision 1.44 in read.c + SIGWINCH fixes) still causes trouble in bin/sh and other utilities and has to be avoided. MFC after: 1 month Modified: head/lib/libedit/editline.3 head/lib/libedit/el.h head/lib/libedit/read.c head/lib/libedit/sig.c head/lib/libedit/sig.h Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Wed Jul 11 22:17:58 2012 (r238377) +++ head/lib/libedit/editline.3 Wed Jul 11 22:20:19 2012 (r238378) @@ -162,6 +162,11 @@ is modified to contain the number of cha Returns the line read if successful, or .Dv NULL if no characters were read or if an error occurred. +If an error occurred, +.Fa count +is set to \-1 and +.Dv errno +contains the error code that caused it. The return value may not remain valid across calls to .Fn el_gets and must be copied if the data is to be retained. Modified: head/lib/libedit/el.h ============================================================================== --- head/lib/libedit/el.h Wed Jul 11 22:17:58 2012 (r238377) +++ head/lib/libedit/el.h Wed Jul 11 22:20:19 2012 (r238378) @@ -115,6 +115,7 @@ struct editline { FILE *el_errfile; /* Stdio stuff */ int el_infd; /* Input file descriptor */ int el_flags; /* Various flags. */ + int el_errno; /* Local copy of errno */ coord_t el_cursor; /* Cursor location */ char **el_display; /* Real screen image = what is there */ char **el_vdisplay; /* Virtual screen image = what we see */ Modified: head/lib/libedit/read.c ============================================================================== --- head/lib/libedit/read.c Wed Jul 11 22:17:58 2012 (r238377) +++ head/lib/libedit/read.c Wed Jul 11 22:20:19 2012 (r238378) @@ -235,9 +235,12 @@ read_getcmd(EditLine *el, el_action_t *c el_action_t cmd; int num; + el->el_errno = 0; do { - if ((num = el_getc(el, ch)) != 1) /* if EOF or error */ + if ((num = el_getc(el, ch)) != 1) { /* if EOF or error */ + el->el_errno = num == 0 ? 0 : errno; return (num); + } #ifdef KANJI if ((*ch & 0200)) { @@ -289,14 +292,21 @@ read_char(EditLine *el, char *cp) ssize_t num_read; int tried = 0; - while ((num_read = read(el->el_infd, cp, 1)) == -1) + again: + el->el_signal->sig_no = 0; + while ((num_read = read(el->el_infd, cp, 1)) == -1) { + if (el->el_signal->sig_no == SIGCONT) { + sig_set(el); + el_set(el, EL_REFRESH); + goto again; + } if (!tried && read__fixio(el->el_infd, errno) == 0) tried = 1; else { *cp = '\0'; return (-1); } - + } return (int)num_read; } @@ -403,10 +413,13 @@ el_gets(EditLine *el, int *nread) int num; /* how many chars we have read at NL */ char ch; int crlf = 0; + int nrb; #ifdef FIONREAD c_macro_t *ma = &el->el_chared.c_macro; #endif /* FIONREAD */ + if (nread == NULL) + nread = &nrb; *nread = 0; if (el->el_flags & NO_TTY) { @@ -427,12 +440,13 @@ el_gets(EditLine *el, int *nread) if (cp[-1] == '\r' || cp[-1] == '\n') break; } + if (num == -1) + el->el_errno = errno; el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + *nread = (int)(el->el_line.cursor - el->el_line.buffer); + goto done; } @@ -443,8 +457,8 @@ el_gets(EditLine *el, int *nread) (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) & chrs); if (chrs == 0) { if (tty_rawmode(el) < 0) { - if (nread) - *nread = 0; + errno = 0; + *nread = 0; return (NULL); } } @@ -457,6 +471,7 @@ el_gets(EditLine *el, int *nread) if (el->el_flags & EDIT_DISABLED) { char *cp; size_t idx; + if ((el->el_flags & UNBUFFERED) == 0) cp = el->el_line.buffer; else @@ -480,11 +495,13 @@ el_gets(EditLine *el, int *nread) break; } + if (num == -1) { + el->el_errno = errno; + } + el->el_line.cursor = el->el_line.lastchar = cp; *cp = '\0'; - if (nread) - *nread = (int)(el->el_line.cursor - el->el_line.buffer); - return (*nread ? el->el_line.buffer : NULL); + goto done; } for (num = OKCMD; num == OKCMD;) { /* while still editing this @@ -617,12 +634,17 @@ el_gets(EditLine *el, int *nread) /* make sure the tty is set up correctly */ if ((el->el_flags & UNBUFFERED) == 0) { read_finish(el); - if (nread) - *nread = num; + *nread = num != -1 ? num : 0; } else { - if (nread) - *nread = - (int)(el->el_line.lastchar - el->el_line.buffer); + *nread = (int)(el->el_line.lastchar - el->el_line.buffer); } - return (num ? el->el_line.buffer : NULL); +done: + if (*nread == 0) { + if (num == -1) { + *nread = -1; + errno = el->el_errno; + } + return NULL; + } else + return el->el_line.buffer; } Modified: head/lib/libedit/sig.c ============================================================================== --- head/lib/libedit/sig.c Wed Jul 11 22:17:58 2012 (r238377) +++ head/lib/libedit/sig.c Wed Jul 11 22:20:19 2012 (r238378) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: sig.c,v 1.14 2009/02/18 15:04:40 christos Exp $ + * $NetBSD: sig.c,v 1.15 2009/02/19 15:20:22 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -73,6 +73,8 @@ sig_handler(int signo) (void) sigaddset(&nset, signo); (void) sigprocmask(SIG_BLOCK, &nset, &oset); + sel->el_signal->sig_no = signo; + switch (signo) { case SIGCONT: tty_rawmode(sel); @@ -158,12 +160,12 @@ sig_set(EditLine *el) struct sigaction osa, nsa; nsa.sa_handler = sig_handler; + nsa.sa_flags = 0; sigemptyset(&nsa.sa_mask); (void) sigprocmask(SIG_BLOCK, &el->el_signal->sig_set, &oset); for (i = 0; sighdl[i] != -1; i++) { - nsa.sa_flags = SIGINT ? 0 : SA_RESTART; /* This could happen if we get interrupted */ if (sigaction(sighdl[i], &nsa, &osa) != -1 && osa.sa_handler != sig_handler) Modified: head/lib/libedit/sig.h ============================================================================== --- head/lib/libedit/sig.h Wed Jul 11 22:17:58 2012 (r238377) +++ head/lib/libedit/sig.h Wed Jul 11 22:20:19 2012 (r238378) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sig.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ + * $NetBSD: sig.h,v 1.8 2009/02/19 15:20:22 christos Exp $ * $FreeBSD$ */ @@ -61,6 +61,7 @@ typedef struct { struct sigaction sig_action[ALLSIGSNO]; sigset_t sig_set; + volatile sig_atomic_t sig_no; } *el_signal_t; protected void sig_end(EditLine*); From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 22:44:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17E611065676 for ; Wed, 11 Jul 2012 22:44:58 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B0FFD8FC1A for ; Wed, 11 Jul 2012 22:44:57 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so3004958pbb.13 for ; Wed, 11 Jul 2012 15:44:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=qbfCTV6dbN8UnqvrR5PykniwBVg3o2Z1lMeuUokwF2s=; b=Kn8MlfhI7edvMyqSQTPnYda3YvRG+dg6lXtNhbkoaN7Y3lmQhCos1e1+Yj1Ps0jht1 UmTh82h+I16gYiMTIGIZ2slsco2ltxBlFYOIOzyEh2wczZ8ShM02ScCOsagUcq2oxVCU ewFlgINM7YTHMMFvZl/k88fwiXdIEoHc9JQvSVprc+5XlpEE5ru4M8QqySY4lVw1CIY7 G4mahNbjSeYop2Tk1buLKIvxlTSgnnpB5bJMOx4q85mwI5vd/250V4jTtXv38dahcCfY npqykHym6jTbP/2Npep/+1KflX0HQu36rvK1R966V8oNesqiCWwpdYVCtSwJpIk1eLVL v9SQ== MIME-Version: 1.0 Received: by 10.68.240.73 with SMTP id vy9mr81201045pbc.102.1342046697258; Wed, 11 Jul 2012 15:44:57 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.68.20.71 with HTTP; Wed, 11 Jul 2012 15:44:57 -0700 (PDT) In-Reply-To: References: <201207110257.q6B2vXeW018145@svn.freebsd.org> <20120711195341.GK3599@albert.catwhisker.org> Date: Thu, 12 Jul 2012 10:44:57 +1200 X-Google-Sender-Auth: d6fBxc-ixwnJQu7VPfezUCaz6Nc Message-ID: From: Andrew Thompson To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQl3xnhWU97ImPDvChthXOPnWWYNUc9o6g0kKREQHFPo+YMyFatqox5hespwV/d6KtFw5Wko Cc: src-committers@freebsd.org, current@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , svn-src-head@freebsd.org, David Wolfskill Subject: Re: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 22:44:58 -0000 On 12 July 2012 10:15, Adrian Chadd wrote: > Again, that just touched usb. So, how'd that affect non-USB wifi cloning? I guess cloning is first match wins and usb was incorrectly matching wlan* Andrew From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:00:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7CF106566C; Wed, 11 Jul 2012 23:00:27 +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 36B138FC12; Wed, 11 Jul 2012 23:00:27 +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 q6BN0R42070000; Wed, 11 Jul 2012 23:00:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BN0RLk069998; Wed, 11 Jul 2012 23:00:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207112300.q6BN0RLk069998@svn.freebsd.org> From: Christian Brueffer Date: Wed, 11 Jul 2012 23:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238379 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:00:27 -0000 Author: brueffer Date: Wed Jul 11 23:00:26 2012 New Revision: 238379 URL: http://svn.freebsd.org/changeset/base/238379 Log: Renamed the kern.cam.da.da_send_ordered sysctl and tunable to kern.cam.da.send_ordered, more in line with the other da sysctls/tunables. PR: 169765 Submitted by: Steven Hartland Reviewed by: mav Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Jul 11 22:20:19 2012 (r238378) +++ head/sys/cam/scsi/scsi_da.c Wed Jul 11 23:00:26 2012 (r238379) @@ -883,9 +883,9 @@ TUNABLE_INT("kern.cam.da.retry_count", & SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW, &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout); -SYSCTL_INT(_kern_cam_da, OID_AUTO, da_send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW, &da_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.da.da_send_ordered", &da_send_ordered); +TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered); /* * DA_ORDEREDTAG_INTERVAL determines how often, relative From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:18:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1AE1106564A; Wed, 11 Jul 2012 23:18:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97D2D8FC08; Wed, 11 Jul 2012 23:18: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 q6BNIa2L070829; Wed, 11 Jul 2012 23:18:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BNIa8Z070803; Wed, 11 Jul 2012 23:18:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207112318.q6BNIa8Z070803@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 23:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238381 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/events sys/contrib/dev/ac... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:18:36 -0000 Author: jkim Date: Wed Jul 11 23:18:35 2012 New Revision: 238381 URL: http://svn.freebsd.org/changeset/base/238381 Log: Merge ACPICA 20120711. Added: head/sys/contrib/dev/acpica/components/tables/tbxfload.c - copied, changed from r238368, vendor-sys/acpica/dist/source/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c - copied, changed from r238368, vendor-sys/acpica/dist/source/components/utilities/utexcep.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/conf/files Wed Jul 11 23:18:35 2012 (r238381) @@ -412,6 +412,7 @@ contrib/dev/acpica/components/tables/tbf contrib/dev/acpica/components/tables/tbinstal.c optional acpi contrib/dev/acpica/components/tables/tbutils.c optional acpi contrib/dev/acpica/components/tables/tbxface.c optional acpi +contrib/dev/acpica/components/tables/tbxfload.c optional acpi contrib/dev/acpica/components/tables/tbxfroot.c optional acpi contrib/dev/acpica/components/utilities/utaddress.c optional acpi contrib/dev/acpica/components/utilities/utalloc.c optional acpi @@ -421,6 +422,7 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utdecode.c optional acpi contrib/dev/acpica/components/utilities/utdelete.c optional acpi contrib/dev/acpica/components/utilities/uteval.c optional acpi +contrib/dev/acpica/components/utilities/utexcep.c optional acpi contrib/dev/acpica/components/utilities/utglobal.c optional acpi contrib/dev/acpica/components/utilities/utids.c optional acpi contrib/dev/acpica/components/utilities/utinit.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/changes.txt Wed Jul 11 23:18:35 2012 (r238381) @@ -1,4 +1,82 @@ ---------------------------------------- +11 July 2012. Summary of changes for version 20120711: + +This release is available at https://www.acpica.org/downloads The ACPI 5.0 +specification is available at www.acpi.info + +1) ACPICA Kernel-resident Subsystem: + +Fixed a possible fault in the return package object repair code. Fixes a +problem that can occur when a lone package object is wrapped with an outer +package object in order to force conformance to the ACPI specification. Can +affect these predefined names: _ALR, _MLS, _PSS, _TRT, _TSS, _PRT, _HPX, _DLM, +_CSD, _PSD, _TSD. + +Removed code to disable/enable bus master arbitration (ARB_DIS bit in the +PM2_CNT register) in the ACPICA sleep/wake interfaces. Management of the +ARB_DIS bit must be implemented in the host-dependent C3 processor power state +support. Note, ARB_DIS is obsolete and only applies to older chipsets, both +Intel and other vendors. (for Intel: ICH4-M and earlier) + +This change removes the code to disable/enable bus master arbitration during +suspend/resume. Use of the ARB_DIS bit in the optional PM2_CNT register causes +resume problems on some machines. The change has been in use for over seven +years within Linux. + +Implemented two new external interfaces to support host-directed dynamic ACPI +table load and unload. They are intended to simplify the host implementation +of hot-plug support: + AcpiLoadTable: Load an SSDT from a buffer into the namespace. + AcpiUnloadParentTable: Unload an SSDT via a named object owned by the table. +See the ACPICA reference for additional details. Adds one new file, +components/tables/tbxfload.c + +Implemented and deployed two new interfaces for errors and warnings that are +known to be caused by BIOS/firmware issues: + AcpiBiosError: Prints "ACPI Firmware Error" message. + AcpiBiosWarning: Prints "ACPI Firmware Warning" message. +Deployed these new interfaces in the ACPICA Table Manager code for ACPI table +and FADT errors. Additional deployment to be completed as appropriate in the +future. The associated conditional macros are ACPI_BIOS_ERROR and +ACPI_BIOS_WARNING. See the ACPICA reference for additional details. ACPICA BZ +843. + +Implicit notify support: ensure that no memory allocation occurs within a +critical region. This fix moves a memory allocation outside of the time that a +spinlock is held. Fixes issues on systems that do not allow this behavior. +Jung-uk Kim. + +Split exception code utilities and tables into a new file, utilities/utexcep.c + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.1K Code, 25.1K Data, 118.2K Total + Debug Version: 172.9K Code, 73.6K Data, 246.5K Total + Current Release: + Non-Debug Version: 93.5K Code, 25.3K Data, 118.8K Total + Debug Version: 173.7K Code, 74.0K Data, 247.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a parser problem for hosts where EOF is defined as -1 instead of +0. Jung-uk Kim. + +Debugger: Enhanced the "tables" command to emit additional information about +the current set of ACPI tables, including the owner ID and flags decode. + +Debugger: Reimplemented the "unload" command to use the new +AcpiUnloadParentTable external interface. This command was disable previously +due to need for an unload interface. + +AcpiHelp: Added a new option to decode ACPICA exception codes. The -e option +will decode 16-bit hex status codes (ACPI_STATUS) to name strings. + +---------------------------------------- 20 June 2012. Summary of changes for version 20120620: This release is available at https://www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Jul 11 23:18:35 2012 (r238381) @@ -96,7 +96,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v|w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z" /******************************************************************************* @@ -119,6 +119,7 @@ Options ( printf ("\nGlobal:\n"); ACPI_OPTION ("-@ ", "Specify command file"); ACPI_OPTION ("-I ", "Specify additional include directory"); + ACPI_OPTION ("-v", "Display compiler version"); printf ("\nPreprocessor:\n"); ACPI_OPTION ("-D ", "Define symbol for preprocessor use"); @@ -751,9 +752,13 @@ AslDoOptions ( break; - case 'v': /* Verbosity settings */ + case 'v': /* Version and verbosity settings */ switch (AcpiGbl_Optarg[0]) { + case '^': + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); + exit (0); + case 'a': /* Disable All error/warning messages */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Wed Jul 11 23:18:35 2012 (r238381) @@ -254,12 +254,53 @@ AcpiDbDisplayTableInfo ( ACPI_STATUS Status; + /* Header */ + + AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n"); + /* Walk the entire root table list */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) { TableDesc = &AcpiGbl_RootTableList.Tables[i]; - AcpiOsPrintf ("%u ", i); + + /* Index and Table ID */ + + AcpiOsPrintf ("%3u %.2u ", i, TableDesc->OwnerId); + + /* Decode the table flags */ + + if (!(TableDesc->Flags & ACPI_TABLE_IS_LOADED)) + { + AcpiOsPrintf ("NotLoaded "); + } + else + { + AcpiOsPrintf (" Loaded "); + } + + switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) + { + case ACPI_TABLE_ORIGIN_UNKNOWN: + AcpiOsPrintf ("Unknown "); + break; + + case ACPI_TABLE_ORIGIN_MAPPED: + AcpiOsPrintf ("Mapped "); + break; + + case ACPI_TABLE_ORIGIN_ALLOCATED: + AcpiOsPrintf ("Allocated "); + break; + + case ACPI_TABLE_ORIGIN_OVERRIDE: + AcpiOsPrintf ("Override "); + break; + + default: + AcpiOsPrintf ("INVALID "); + break; + } /* Make sure that the table is mapped */ @@ -290,55 +331,45 @@ AcpiDbDisplayTableInfo ( * * FUNCTION: AcpiDbUnloadAcpiTable * - * PARAMETERS: TableArg - Name of the table to be unloaded - * InstanceArg - Which instance of the table to unload (if - * there are multiple tables of the same type) + * PARAMETERS: ObjectName - Namespace pathname for an object that + * is owned by the table to be unloaded * - * RETURN: Nonde + * RETURN: None * - * DESCRIPTION: Unload an ACPI table. - * Instance is not implemented + * DESCRIPTION: Unload an ACPI table, via any namespace node that is owned + * by the table. * ******************************************************************************/ void AcpiDbUnloadAcpiTable ( - char *TableArg, - char *InstanceArg) + char *ObjectName) { -/* TBD: Need to reimplement for new data structures */ - -#if 0 - UINT32 i; + ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; - /* Search all tables for the target type */ + /* Translate name to an Named object */ - for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++) + Node = AcpiDbConvertToNode (ObjectName); + if (!Node) { - if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature, - AcpiGbl_TableData[i].SigLength)) - { - /* Found the table, unload it */ - - Status = AcpiUnloadTable (i); - if (ACPI_SUCCESS (Status)) - { - AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg); - } - else - { - AcpiOsPrintf ("%s, while unloading [%s]\n", - AcpiFormatException (Status), TableArg); - } - - return; - } + AcpiOsPrintf ("Could not find [%s] in namespace\n", + ObjectName); + return; } - AcpiOsPrintf ("Unknown table type [%s]\n", TableArg); -#endif + Status = AcpiUnloadParentTable (ACPI_CAST_PTR (ACPI_HANDLE, Node)); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("Parent of [%s] (%p) unloaded and uninstalled\n", + ObjectName, Node); + } + else + { + AcpiOsPrintf ("%s, while unloading parent table of [%s]\n", + AcpiFormatException (Status), ObjectName); + } } Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Wed Jul 11 23:18:35 2012 (r238381) @@ -250,7 +250,7 @@ AcpiDbDisplayHelp ( AcpiOsPrintf (" Stack Display CPU stack usage\n"); AcpiOsPrintf (" Tables Info about current ACPI table(s)\n"); AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n"); - AcpiOsPrintf (" Unload [Instance] Unload an ACPI table\n"); + AcpiOsPrintf (" Unload Unload an ACPI table via namespace object\n"); AcpiOsPrintf (" ! Execute command from history buffer\n"); AcpiOsPrintf (" !! Execute last command again\n"); @@ -894,7 +894,7 @@ AcpiDbCommandDispatch ( break; case CMD_UNLOAD: - AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); + AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]); break; case CMD_EXIT: Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/events/evxfgpe.c Wed Jul 11 23:18:35 2012 (r238381) @@ -83,7 +83,7 @@ AcpiUpdateAllGpes ( ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (AcpiUpdateGpes); + ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes); Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); @@ -298,7 +298,8 @@ AcpiSetupGpeForWake ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; - ACPI_GPE_NOTIFY_INFO *NewNotify, *Notify; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify; ACPI_CPU_FLAGS Flags; @@ -334,6 +335,11 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* + * Allocate a new notify object up front, in case it is needed. + * Memory allocation while holding a spinlock is a big no-no + * on some hosts. + */ NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); if (!NewNotify) { @@ -401,8 +407,12 @@ AcpiSetupGpeForWake ( GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; Status = AE_OK; + UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + + /* Delete the notify object if it was not used above */ + if (NewNotify) { ACPI_FREE (NewNotify); Modified: head/sys/contrib/dev/acpica/components/executer/exprep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exprep.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/executer/exprep.c Wed Jul 11 23:18:35 2012 (r238381) @@ -418,8 +418,8 @@ AcpiExPrepCommonFieldObject ( * * RETURN: Status * - * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and - * connect it to the parent Node. + * DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a + * subtype of DefField and connect it to the parent Node. * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/components/executer/exresolv.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exresolv.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/executer/exresolv.c Wed Jul 11 23:18:35 2012 (r238381) @@ -165,7 +165,7 @@ AcpiExResolveObjectToValue ( StackDesc = *StackPtr; - /* This is an ACPI_OPERAND_OBJECT */ + /* This is an object of type ACPI_OPERAND_OBJECT */ switch (StackDesc->Common.Type) { Modified: head/sys/contrib/dev/acpica/components/executer/exstore.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exstore.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/executer/exstore.c Wed Jul 11 23:18:35 2012 (r238381) @@ -68,15 +68,15 @@ AcpiExStoreObjectToIndex ( * FUNCTION: AcpiExStore * * PARAMETERS: *SourceDesc - Value to be stored - * *DestDesc - Where to store it. Must be an NS node - * or an ACPI_OPERAND_OBJECT of type + * *DestDesc - Where to store it. Must be an NS node + * or ACPI_OPERAND_OBJECT of type * Reference; * WalkState - Current walk state * * RETURN: Status * * DESCRIPTION: Store the value described by SourceDesc into the location - * described by DestDesc. Called by various interpreter + * described by DestDesc. Called by various interpreter * functions to store the result of an operation into * the destination operand -- not just simply the actual "Store" * ASL operator. Modified: head/sys/contrib/dev/acpica/components/executer/exutils.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exutils.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/executer/exutils.c Wed Jul 11 23:18:35 2012 (r238381) @@ -121,7 +121,7 @@ AcpiExEnterInterpreter ( * * DESCRIPTION: Reacquire the interpreter execution region from within the * interpreter code. Failure to enter the interpreter region is a - * fatal system error. Used in conjuction with + * fatal system error. Used in conjunction with * RelinquishInterpreter * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/components/hardware/hwsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/hardware/hwsleep.c Wed Jul 11 23:18:35 2012 (r238381) @@ -100,20 +100,6 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - if (SleepState != ACPI_STATE_S5) - { - /* - * Disable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - } - /* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs @@ -394,17 +380,6 @@ AcpiHwLegacyWake ( AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - /* - * Enable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c Wed Jul 11 23:18:35 2012 (r238381) @@ -101,6 +101,14 @@ AcpiSetFirmwareWakingVector ( ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); + /* + * According to the ACPI specification 2.0c and later, the 64-bit + * waking vector should be cleared and the 32-bit waking vector should + * be used, unless we want the wake-up code to be called by the BIOS in + * Protected Mode. Some systems (for example HP dv5-1004nr) are known + * to fail to resume if the 64-bit vector is used. + */ + /* Set the 32-bit vector */ AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; Modified: head/sys/contrib/dev/acpica/components/namespace/nspredef.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nspredef.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/namespace/nspredef.c Wed Jul 11 23:18:35 2012 (r238381) @@ -681,7 +681,7 @@ AcpiNsCheckPackage ( { /* Create the new outer package and populate it */ - Status = AcpiNsWrapWithPackage (Data, *Elements, ReturnObjectPtr); + Status = AcpiNsWrapWithPackage (Data, ReturnObject, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { return (Status); Modified: head/sys/contrib/dev/acpica/components/parser/psxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psxface.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/parser/psxface.c Wed Jul 11 23:18:35 2012 (r238381) @@ -348,8 +348,8 @@ AcpiPsExecuteMethod ( } /* - * Start method evaluation with an implicit return of zero. This is done - * for Windows compatibility. + * Start method evaluation with an implicit return of zero. + * This is done for Windows compatibility. */ if (AcpiGbl_EnableInterpreterSlack) { Modified: head/sys/contrib/dev/acpica/components/resources/rscreate.c ============================================================================== --- head/sys/contrib/dev/acpica/components/resources/rscreate.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/resources/rscreate.c Wed Jul 11 23:18:35 2012 (r238381) @@ -209,8 +209,8 @@ AcpiRsCreateResourceList ( * * FUNCTION: AcpiRsCreatePciRoutingTable * - * PARAMETERS: PackageObject - Pointer to an ACPI_OPERAND_OBJECT - * package + * PARAMETERS: PackageObject - Pointer to a package containing one + * of more ACPI_OPERAND_OBJECTs * OutputBuffer - Pointer to the user's buffer * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. @@ -218,7 +218,7 @@ AcpiRsCreateResourceList ( * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a + * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a * linked list of PCI interrupt descriptions * * NOTE: It is the caller's responsibility to ensure that the start of the Modified: head/sys/contrib/dev/acpica/components/resources/rsutils.c ============================================================================== --- head/sys/contrib/dev/acpica/components/resources/rsutils.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/resources/rsutils.c Wed Jul 11 23:18:35 2012 (r238381) @@ -181,7 +181,7 @@ AcpiRsMoveData ( /* * 16-, 32-, and 64-bit cases must use the move macros that perform - * endian conversion and/or accomodate hardware that cannot perform + * endian conversion and/or accommodate hardware that cannot perform * misaligned memory transfers */ case ACPI_RSC_MOVE16: Modified: head/sys/contrib/dev/acpica/components/tables/tbfadt.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbfadt.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/tables/tbfadt.c Wed Jul 11 23:18:35 2012 (r238381) @@ -192,7 +192,7 @@ static ACPI_FADT_PM_INFO FadtPmInfoTa * * PARAMETERS: GenericAddress - GAS struct to be initialized * SpaceId - ACPI Space ID for this register - * ByteWidth - Width of this register, in bytes + * ByteWidth - Width of this register * Address - Address of the register * * RETURN: None @@ -338,7 +338,7 @@ AcpiTbCreateLocalFadt ( */ if (Length > sizeof (ACPI_TABLE_FADT)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "FADT (revision %u) is longer than ACPI 5.0 version, " "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); @@ -486,8 +486,9 @@ AcpiTbConvertFadt ( if (Address64->Address && Address32 && (Address64->Address != (UINT64) Address32)) { - ACPI_ERROR ((AE_INFO, - "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", + ACPI_BIOS_ERROR ((AE_INFO, + "32/64X address mismatch in FADT/%s: " + "0x%8.8X/0x%8.8X%8.8X, using 32", FadtInfoTable[i].Name, Address32, ACPI_FORMAT_UINT64 (Address64->Address))); } @@ -546,7 +547,7 @@ AcpiTbValidateFadt ( if (AcpiGbl_FADT.Facs && (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "32/64X FACS address mismatch in FADT - " "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs))); @@ -557,7 +558,7 @@ AcpiTbValidateFadt ( if (AcpiGbl_FADT.Dsdt && (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt)) { - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "32/64X DSDT address mismatch in FADT - " "0x%8.8X/0x%8.8X%8.8X, using 32", AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt))); @@ -593,8 +594,8 @@ AcpiTbValidateFadt ( if (Address64->Address && (Address64->BitWidth != ACPI_MUL_8 (Length))) { - ACPI_WARNING ((AE_INFO, - "32/64X length mismatch in %s: %u/%u", + ACPI_BIOS_WARNING ((AE_INFO, + "32/64X length mismatch in FADT/%s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } @@ -606,9 +607,9 @@ AcpiTbValidateFadt ( */ if (!Address64->Address || !Length) { - ACPI_ERROR ((AE_INFO, - "Required field %s has zero address and/or length:" - " 0x%8.8X%8.8X/0x%X", + ACPI_BIOS_ERROR ((AE_INFO, + "Required FADT field %s has zero address and/or length: " + "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } @@ -622,8 +623,8 @@ AcpiTbValidateFadt ( if ((Address64->Address && !Length) || (!Address64->Address && Length)) { - ACPI_WARNING ((AE_INFO, - "Optional field %s has zero address or length: " + ACPI_BIOS_WARNING ((AE_INFO, + "Optional FADT field %s has zero address or length: " "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } @@ -674,8 +675,8 @@ AcpiTbSetupFadtRegisters ( (FadtInfoTable[i].DefaultLength > 0) && (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { - ACPI_WARNING ((AE_INFO, - "Invalid length for %s: %u, using default %u", + ACPI_BIOS_WARNING ((AE_INFO, + "Invalid length for FADT/%s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); Modified: head/sys/contrib/dev/acpica/components/tables/tbinstal.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbinstal.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/tables/tbinstal.c Wed Jul 11 23:18:35 2012 (r238381) @@ -157,8 +157,9 @@ AcpiTbAddTable ( (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) && (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3))) { - ACPI_ERROR ((AE_INFO, - "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", + ACPI_BIOS_ERROR ((AE_INFO, + "Table has invalid signature [%4.4s] (0x%8.8X), " + "must be SSDT or OEMx", AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ? TableDesc->Pointer->Signature : "????", *(UINT32 *) TableDesc->Pointer->Signature)); Modified: head/sys/contrib/dev/acpica/components/tables/tbutils.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbutils.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/tables/tbutils.c Wed Jul 11 23:18:35 2012 (r238381) @@ -287,8 +287,9 @@ AcpiTbVerifyChecksum ( if (Checksum) { - ACPI_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", Table->Signature, Table->Checksum, (UINT8) (Table->Checksum - Checksum))); @@ -356,8 +357,9 @@ AcpiTbCheckDsdtHeader ( if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length || AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum) { - ACPI_ERROR ((AE_INFO, - "The DSDT has been corrupted or replaced - old, new headers below")); + ACPI_BIOS_ERROR ((AE_INFO, + "The DSDT has been corrupted or replaced - " + "old, new headers below")); AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader); AcpiTbPrintTableHeader (0, AcpiGbl_DSDT); @@ -460,27 +462,12 @@ AcpiTbInstallTable ( return; } - /* Skip SSDT when DSDT is overriden */ - - if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) && - (AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags & - ACPI_TABLE_ORIGIN_OVERRIDE)) - { - ACPI_INFO ((AE_INFO, - "%4.4s @ 0x%p Table override, replaced with:", ACPI_SIG_SSDT, - ACPI_CAST_PTR (void, Address))); - AcpiTbPrintTableHeader ( - AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Address, - AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer); - goto UnmapAndExit; - } - /* If a particular signature is expected (DSDT/FACS), it must match */ if (Signature && !ACPI_COMPARE_NAME (Table->Signature, Signature)) { - ACPI_ERROR ((AE_INFO, + ACPI_BIOS_ERROR ((AE_INFO, "Invalid signature 0x%X for ACPI table, expected [%s]", *ACPI_CAST_PTR (UINT32, Table->Signature), Signature)); goto UnmapAndExit; @@ -498,6 +485,19 @@ AcpiTbInstallTable ( TableDesc->Flags = ACPI_TABLE_ORIGIN_MAPPED; ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature); + /* When DSDT is overriden, assume SSDT is also overriden with it */ + + if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) && + (AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags & + ACPI_TABLE_ORIGIN_OVERRIDE)) + { + TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE; + ACPI_INFO ((AE_INFO, + "%4.4s %p Logical table override, replaced with %4.4s", + ACPI_SIG_SSDT, ACPI_CAST_PTR (void, Address), ACPI_SIG_DSDT)); + goto UnmapAndExit; + } + /* * ACPI Table Override: * @@ -599,7 +599,7 @@ AcpiTbGetRootTableEntry ( { /* Will truncate 64-bit address to 32 bits, issue warning */ - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," " truncating", ACPI_FORMAT_UINT64 (Address64))); @@ -701,7 +701,8 @@ AcpiTbParseRootTable ( if (Length < sizeof (ACPI_TABLE_HEADER)) { - ACPI_ERROR ((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", Length)); + ACPI_BIOS_ERROR ((AE_INFO, + "Invalid table length 0x%X in RSDT/XSDT", Length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxface.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Wed Jul 11 23:18:35 2012 (r238381) @@ -1,7 +1,6 @@ /****************************************************************************** * - * Module Name: tbxface - Public interfaces to the ACPI subsystem - * ACPI table oriented interfaces + * Module Name: tbxface - ACPI table oriented external interfaces * *****************************************************************************/ @@ -46,18 +45,11 @@ #include #include -#include #include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxface") -/* Local prototypes */ - -static ACPI_STATUS -AcpiTbLoadNamespace ( - void); - /******************************************************************************* * @@ -458,165 +450,6 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex) /******************************************************************************* * - * FUNCTION: AcpiTbLoadNamespace - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in - * the RSDT/XSDT. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiTbLoadNamespace ( - void) -{ - ACPI_STATUS Status; - UINT32 i; - ACPI_TABLE_HEADER *NewDsdt; - - - ACPI_FUNCTION_TRACE (TbLoadNamespace); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - - /* - * Load the namespace. The DSDT is required, but any SSDT and - * PSDT tables are optional. Verify the DSDT. - */ - if (!AcpiGbl_RootTableList.CurrentTableCount || - !ACPI_COMPARE_NAME ( - &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature), - ACPI_SIG_DSDT) || - ACPI_FAILURE (AcpiTbVerifyTable ( - &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT]))) - { - Status = AE_NO_ACPI_TABLES; - goto UnlockAndExit; - } - - /* - * Save the DSDT pointer for simple access. This is the mapped memory - * address. We must take care here because the address of the .Tables - * array can change dynamically as tables are loaded at run-time. Note: - * .Pointer field is not validated until after call to AcpiTbVerifyTable. - */ - AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer; - - /* - * Optionally copy the entire DSDT to local memory (instead of simply - * mapping it.) There are some BIOSs that corrupt or replace the original - * DSDT, creating the need for this option. Default is FALSE, do not copy - * the DSDT. - */ - if (AcpiGbl_CopyDsdtLocally) - { - NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT); - if (NewDsdt) - { - AcpiGbl_DSDT = NewDsdt; - } - } - - /* - * Save the original DSDT header for detection of table corruption - * and/or replacement of the DSDT from outside the OS. - */ - ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, - sizeof (ACPI_TABLE_HEADER)); - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - - /* Load and parse tables */ - - Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) - { - if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_SSDT) && - !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_PSDT)) || - ACPI_FAILURE (AcpiTbVerifyTable ( - &AcpiGbl_RootTableList.Tables[i]))) - { - continue; - } - - /* Skip SSDT when DSDT is overriden */ - - if (ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_SSDT) && - (AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Flags & - ACPI_TABLE_ORIGIN_OVERRIDE)) - { - continue; - } - - /* Ignore errors while loading tables, get as many as possible */ - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - (void) AcpiNsLoadTable (i, AcpiGbl_RootNode); - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); - -UnlockAndExit: - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiLoadTables - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT - * - ******************************************************************************/ - -ACPI_STATUS -AcpiLoadTables ( - void) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiLoadTables); - - - /* Load the namespace from the tables */ - - Status = AcpiTbLoadNamespace (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While loading namespace from ACPI tables")); - } - - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiLoadTables) - - -/******************************************************************************* - * * FUNCTION: AcpiInstallTableHandler * * PARAMETERS: Handler - Table event handler Copied and modified: head/sys/contrib/dev/acpica/components/tables/tbxfload.c (from r238368, vendor-sys/acpica/dist/source/components/tables/tbxfload.c) ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbxfload.c Wed Jul 11 16:52:25 2012 (r238368, copy source) +++ head/sys/contrib/dev/acpica/components/tables/tbxfload.c Wed Jul 11 23:18:35 2012 (r238381) @@ -43,10 +43,10 @@ #define __TBXFLOAD_C__ -#include "acpi.h" -#include "accommon.h" -#include "acnamesp.h" -#include "actables.h" +#include +#include +#include +#include #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfload") @@ -180,7 +180,7 @@ AcpiTbLoadNamespace ( /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), ACPI_SIG_SSDT) && @@ -192,6 +192,15 @@ AcpiTbLoadNamespace ( continue; } + /* Skip SSDT when it is overriden with DSDT */ + if (ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), + ACPI_SIG_SSDT) && + (AcpiGbl_RootTableList.Tables[i].Flags & + ACPI_TABLE_ORIGIN_OVERRIDE)) + { + continue; + } + /* Ignore errors while loading tables, get as many as possible */ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); Modified: head/sys/contrib/dev/acpica/components/tables/tbxfroot.c ============================================================================== --- head/sys/contrib/dev/acpica/components/tables/tbxfroot.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/tables/tbxfroot.c Wed Jul 11 23:18:35 2012 (r238381) @@ -234,7 +234,7 @@ AcpiFindRootPointer ( /* A valid RSDP was not found */ - ACPI_ERROR ((AE_INFO, "A valid RSDP was not found")); + ACPI_BIOS_ERROR ((AE_INFO, "A valid RSDP was not found")); return_ACPI_STATUS (AE_NOT_FOUND); } Modified: head/sys/contrib/dev/acpica/components/utilities/utdecode.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utdecode.c Wed Jul 11 23:12:17 2012 (r238380) +++ head/sys/contrib/dev/acpica/components/utilities/utdecode.c Wed Jul 11 23:18:35 2012 (r238381) @@ -51,47 +51,6 @@ ACPI_MODULE_NAME ("utdecode") -/******************************************************************************* - * - * FUNCTION: AcpiFormatException - * - * PARAMETERS: Status - The ACPI_STATUS code to be formatted - * - * RETURN: A string containing the exception text. A valid pointer is - * always returned. - * - * DESCRIPTION: This function translates an ACPI exception into an ASCII string - * It is here instead of utxface.c so it is always present. - * - ******************************************************************************/ - -const char * -AcpiFormatException ( - ACPI_STATUS Status) -{ - const char *Exception = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - Exception = AcpiUtValidateException (Status); - if (!Exception) - { - /* Exception code was not recognized */ - - ACPI_ERROR ((AE_INFO, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:22:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2F67106564A; Wed, 11 Jul 2012 23:22:09 +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 DE0718FC0A; Wed, 11 Jul 2012 23:22: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 q6BNM9Ce071022; Wed, 11 Jul 2012 23:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BNM95G071020; Wed, 11 Jul 2012 23:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207112322.q6BNM95G071020@svn.freebsd.org> From: Christian Brueffer Date: Wed, 11 Jul 2012 23:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238382 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:22:10 -0000 Author: brueffer Date: Wed Jul 11 23:22:09 2012 New Revision: 238382 URL: http://svn.freebsd.org/changeset/base/238382 Log: Apply similar same change as in r238379: Renamed the kern.cam.ada.ada_send_ordered sysctl and tunable to kern.cam.ada.send_ordered, more in line with the other da sysctls/tunables. Suggested by: kib Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Jul 11 23:18:35 2012 (r238381) +++ head/sys/cam/ata/ata_da.c Wed Jul 11 23:22:09 2012 (r238382) @@ -368,9 +368,9 @@ TUNABLE_INT("kern.cam.ada.retry_count", SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW, &ada_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout); -SYSCTL_INT(_kern_cam_ada, OID_AUTO, ada_send_ordered, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW, &ada_send_ordered, 0, "Send Ordered Tags"); -TUNABLE_INT("kern.cam.ada.ada_send_ordered", &ada_send_ordered); +TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered); SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, &ada_spindown_shutdown, 0, "Spin down upon shutdown"); TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:30:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E742106564A; Wed, 11 Jul 2012 23:30:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF568FC08; Wed, 11 Jul 2012 23:30: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 q6BNUaFo071422; Wed, 11 Jul 2012 23:30:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BNUaf4071420; Wed, 11 Jul 2012 23:30:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207112330.q6BNUaf4071420@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 23:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238383 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:30:36 -0000 Author: jkim Date: Wed Jul 11 23:30:35 2012 New Revision: 238383 URL: http://svn.freebsd.org/changeset/base/238383 Log: Add myself for OpenSSL 1.0.1c import. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Jul 11 23:22:09 2012 (r238382) +++ svnadmin/conf/sizelimit.conf Wed Jul 11 23:30:35 2012 (r238383) @@ -27,6 +27,7 @@ gonzo imp jb jeff +jkim kmacy lstewart obrien From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:31:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5760E1065688; Wed, 11 Jul 2012 23:31:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1DD8FC08; Wed, 11 Jul 2012 23:31: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 q6BNVdli071505; Wed, 11 Jul 2012 23:31:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BNVdrW071502; Wed, 11 Jul 2012 23:31:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207112331.q6BNVdrW071502@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 23:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238384 - in vendor-crypto/openssl/dist: . apps apps/demoCA bugs certs/demo crypto crypto/aes crypto/aes/asm crypto/asn1 crypto/bf crypto/bf/asm crypto/bio crypto/bn crypto/bn/asm crypt... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:31:39 -0000 Author: jkim Date: Wed Jul 11 23:31:36 2012 New Revision: 238384 URL: http://svn.freebsd.org/changeset/base/238384 Log: Import OpenSSL 1.0.1c. Approved by: benl (maintainer) Added: vendor-crypto/openssl/dist/apps/genpkey.c (contents, props changed) vendor-crypto/openssl/dist/apps/pkey.c (contents, props changed) vendor-crypto/openssl/dist/apps/pkeyparam.c (contents, props changed) vendor-crypto/openssl/dist/apps/pkeyutl.c (contents, props changed) vendor-crypto/openssl/dist/apps/srp.c (contents, props changed) vendor-crypto/openssl/dist/apps/ts.c (contents, props changed) vendor-crypto/openssl/dist/apps/tsget vendor-crypto/openssl/dist/crypto/aes/aes_x86core.c (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-armv4.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-mips.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-parisc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aes-sparcv9.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aesni-sha1-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aesni-x86.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/aesni-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-x86.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/arm_arch.h (contents, props changed) vendor-crypto/openssl/dist/crypto/armcap.c (contents, props changed) vendor-crypto/openssl/dist/crypto/armv4cpuid.S (contents, props changed) vendor-crypto/openssl/dist/crypto/asn1/ameth_lib.c (contents, props changed) vendor-crypto/openssl/dist/crypto/asn1/asn1_locl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/asn1/bio_asn1.c (contents, props changed) vendor-crypto/openssl/dist/crypto/asn1/bio_ndef.c (contents, props changed) vendor-crypto/openssl/dist/crypto/asn1/x_nx509.c (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/armv4-gf2m.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/armv4-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/ia64-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/mips-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/mips.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/mips3-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/modexp512-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/parisc-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/s390x-gf2m.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/s390x-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/s390x.S (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9a-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/via-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/x86-gf2m.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gf2m.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/camellia/asm/cmll-x86.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/camellia/asm/cmll-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/camellia/cmll_utl.c (contents, props changed) vendor-crypto/openssl/dist/crypto/cmac/ vendor-crypto/openssl/dist/crypto/cmac/Makefile (contents, props changed) vendor-crypto/openssl/dist/crypto/cmac/cm_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/cmac/cm_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/cmac/cmac.c (contents, props changed) vendor-crypto/openssl/dist/crypto/cmac/cmac.h (contents, props changed) vendor-crypto/openssl/dist/crypto/cms/cms_pwri.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dh/dh_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dh/dh_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dh/dh_prn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dsa/dsa_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dsa/dsa_locl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/dsa/dsa_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dsa/dsa_prn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/dso/dso_beos.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ec2_oct.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ec_oct.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/eck_prn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ecp_nistp224.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ecp_nistp256.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ecp_nistp521.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ecp_nistputil.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ec/ecp_oct.c (contents, props changed) vendor-crypto/openssl/dist/crypto/engine/eng_rdrand.c (contents, props changed) vendor-crypto/openssl/dist/crypto/engine/eng_rsax.c (contents, props changed) vendor-crypto/openssl/dist/crypto/engine/tb_asnmth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/engine/tb_pkmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/e_rc4_hmac_md5.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/evp_fips.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/m_sigver.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/m_wp.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/pmeth_fn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/pmeth_gn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/evp/pmeth_lib.c (contents, props changed) vendor-crypto/openssl/dist/crypto/fips_ers.c (contents, props changed) vendor-crypto/openssl/dist/crypto/hmac/hm_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/hmac/hm_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/md5/asm/md5-ia64.S (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/ vendor-crypto/openssl/dist/crypto/modes/Makefile (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ vendor-crypto/openssl/dist/crypto/modes/asm/ghash-armv4.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-ia64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-parisc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-s390x.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-sparcv9.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-x86.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/asm/ghash-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/cbc128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/ccm128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/cfb128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/ctr128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/cts128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/gcm128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/modes.h (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/modes_lcl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/ofb128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/modes/xts128.c (contents, props changed) vendor-crypto/openssl/dist/crypto/o_fips.c (contents, props changed) vendor-crypto/openssl/dist/crypto/objects/obj_xref.c (contents, props changed) vendor-crypto/openssl/dist/crypto/objects/obj_xref.h (contents, props changed) vendor-crypto/openssl/dist/crypto/objects/obj_xref.txt (contents, props changed) vendor-crypto/openssl/dist/crypto/objects/objxref.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/pariscid.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/pem/pvkfmt.c (contents, props changed) vendor-crypto/openssl/dist/crypto/perlasm/ppc-xlate.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/perlasm/x86gas.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/perlasm/x86masm.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/pkcs7/bio_pk7.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ppccap.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ppccpuid.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-ia64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-md5-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-parisc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-s390x.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/rc4/rc4_utl.c (contents, props changed) vendor-crypto/openssl/dist/crypto/rsa/rsa_ameth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/rsa/rsa_crpt.c (contents, props changed) vendor-crypto/openssl/dist/crypto/rsa/rsa_locl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/rsa/rsa_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/crypto/rsa/rsa_prn.c (contents, props changed) vendor-crypto/openssl/dist/crypto/s390xcap.c (contents, props changed) vendor-crypto/openssl/dist/crypto/s390xcpuid.S (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-armv4-large.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-mips.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-parisc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-ppc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-s390x.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-sparcv9.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-sparcv9a.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha1-thumb.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha256-586.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha256-armv4.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-586.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-armv4.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-mips.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-parisc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-ppc.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-s390x.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sha/asm/sha512-sparcv9.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/sparcv9cap.c (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/ vendor-crypto/openssl/dist/crypto/srp/Makefile (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srp.h (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srp_grps.h (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srp_lcl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srp_lib.c (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srp_vfy.c (contents, props changed) vendor-crypto/openssl/dist/crypto/srp/srptest.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ vendor-crypto/openssl/dist/crypto/ts/Makefile (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts.h (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_asn1.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_conf.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_err.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_lib.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_req_print.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_req_utils.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_rsp_print.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_rsp_sign.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_rsp_utils.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_rsp_verify.c (contents, props changed) vendor-crypto/openssl/dist/crypto/ts/ts_verify_ctx.c (contents, props changed) vendor-crypto/openssl/dist/crypto/vms_rms.h (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/ vendor-crypto/openssl/dist/crypto/whrlpool/Makefile (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/asm/ vendor-crypto/openssl/dist/crypto/whrlpool/asm/wp-mmx.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/asm/wp-x86_64.pl (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/whrlpool.h (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/wp_block.c (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/wp_dgst.c (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/wp_locl.h (contents, props changed) vendor-crypto/openssl/dist/crypto/whrlpool/wp_test.c (contents, props changed) vendor-crypto/openssl/dist/doc/apps/cms.pod vendor-crypto/openssl/dist/doc/apps/genpkey.pod vendor-crypto/openssl/dist/doc/apps/pkey.pod vendor-crypto/openssl/dist/doc/apps/pkeyparam.pod vendor-crypto/openssl/dist/doc/apps/pkeyutl.pod vendor-crypto/openssl/dist/doc/apps/ts.pod vendor-crypto/openssl/dist/doc/apps/tsget.pod vendor-crypto/openssl/dist/doc/crypto/BIO_new_CMS.pod vendor-crypto/openssl/dist/doc/crypto/CMS_add0_cert.pod vendor-crypto/openssl/dist/doc/crypto/CMS_add1_recipient_cert.pod vendor-crypto/openssl/dist/doc/crypto/CMS_compress.pod vendor-crypto/openssl/dist/doc/crypto/CMS_decrypt.pod vendor-crypto/openssl/dist/doc/crypto/CMS_encrypt.pod vendor-crypto/openssl/dist/doc/crypto/CMS_final.pod vendor-crypto/openssl/dist/doc/crypto/CMS_get0_RecipientInfos.pod vendor-crypto/openssl/dist/doc/crypto/CMS_get0_SignerInfos.pod vendor-crypto/openssl/dist/doc/crypto/CMS_get0_type.pod vendor-crypto/openssl/dist/doc/crypto/CMS_get1_ReceiptRequest.pod vendor-crypto/openssl/dist/doc/crypto/CMS_sign.pod vendor-crypto/openssl/dist/doc/crypto/CMS_sign_add1_signer.pod vendor-crypto/openssl/dist/doc/crypto/CMS_sign_receipt.pod vendor-crypto/openssl/dist/doc/crypto/CMS_uncompress.pod vendor-crypto/openssl/dist/doc/crypto/CMS_verify.pod vendor-crypto/openssl/dist/doc/crypto/CMS_verify_receipt.pod vendor-crypto/openssl/dist/doc/crypto/EVP_DigestSignInit.pod vendor-crypto/openssl/dist/doc/crypto/EVP_DigestVerifyInit.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_CTX_ctrl.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_CTX_new.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_cmp.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_decrypt.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_derive.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_encrypt.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_get_default_digest.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_keygen.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_print_private.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_sign.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verify.pod vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verifyrecover.pod vendor-crypto/openssl/dist/doc/crypto/PEM_write_bio_CMS_stream.pod vendor-crypto/openssl/dist/doc/crypto/PEM_write_bio_PKCS7_stream.pod vendor-crypto/openssl/dist/doc/crypto/PKCS7_sign_add_signer.pod vendor-crypto/openssl/dist/doc/crypto/SMIME_read_CMS.pod vendor-crypto/openssl/dist/doc/crypto/SMIME_write_CMS.pod vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_get_error.pod vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_new.pod vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_set_verify_cb.pod vendor-crypto/openssl/dist/doc/crypto/X509_STORE_set_verify_cb_func.pod vendor-crypto/openssl/dist/doc/crypto/X509_VERIFY_PARAM_set_flags.pod vendor-crypto/openssl/dist/doc/crypto/X509_verify_cert.pod vendor-crypto/openssl/dist/doc/crypto/i2d_CMS_bio_stream.pod vendor-crypto/openssl/dist/doc/crypto/i2d_PKCS7_bio_stream.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_psk_client_callback.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_use_psk_identity_hint.pod vendor-crypto/openssl/dist/doc/ssl/SSL_get_psk_identity.pod vendor-crypto/openssl/dist/engines/ccgost/ vendor-crypto/openssl/dist/engines/ccgost/Makefile (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/README.gost vendor-crypto/openssl/dist/engines/ccgost/e_gost_err.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/e_gost_err.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost2001.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost2001_keyx.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost2001_keyx.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost89.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost89.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost94_keyx.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_ameth.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_asn1.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_crypt.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_ctl.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_eng.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_keywrap.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_keywrap.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_lcl.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_md.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_params.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_params.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_pmeth.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gost_sign.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gosthash.c (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gosthash.h (contents, props changed) vendor-crypto/openssl/dist/engines/ccgost/gostsum.c (contents, props changed) vendor-crypto/openssl/dist/engines/e_padlock.c (contents, props changed) vendor-crypto/openssl/dist/ssl/d1_srtp.c (contents, props changed) vendor-crypto/openssl/dist/ssl/srtp.h (contents, props changed) vendor-crypto/openssl/dist/ssl/tls_srp.c (contents, props changed) vendor-crypto/openssl/dist/util/cygwin.sh (contents, props changed) vendor-crypto/openssl/dist/util/mkrc.pl (contents, props changed) Deleted: vendor-crypto/openssl/dist/apps/demoCA/ vendor-crypto/openssl/dist/apps/md4.c vendor-crypto/openssl/dist/apps/winrand.c vendor-crypto/openssl/dist/bugs/ vendor-crypto/openssl/dist/certs/demo/ vendor-crypto/openssl/dist/crypto/LPdir_nyi.c vendor-crypto/openssl/dist/crypto/LPdir_vms.c vendor-crypto/openssl/dist/crypto/LPdir_win.c vendor-crypto/openssl/dist/crypto/LPdir_win32.c vendor-crypto/openssl/dist/crypto/LPdir_wince.c vendor-crypto/openssl/dist/crypto/asn1/a_hdr.c vendor-crypto/openssl/dist/crypto/asn1/a_meth.c vendor-crypto/openssl/dist/crypto/asn1/p8_key.c vendor-crypto/openssl/dist/crypto/bf/bfs.cpp vendor-crypto/openssl/dist/crypto/bn/asm/mo-586.pl vendor-crypto/openssl/dist/crypto/bn/bn_opt.c vendor-crypto/openssl/dist/crypto/cast/casts.cpp vendor-crypto/openssl/dist/crypto/des/asm/des686.pl vendor-crypto/openssl/dist/crypto/des/des3s.cpp vendor-crypto/openssl/dist/crypto/des/des_lib.c vendor-crypto/openssl/dist/crypto/des/dess.cpp vendor-crypto/openssl/dist/crypto/des/t/ vendor-crypto/openssl/dist/crypto/des/times/ vendor-crypto/openssl/dist/crypto/dsa/dsa_utl.c vendor-crypto/openssl/dist/crypto/dyn_lck.c vendor-crypto/openssl/dist/crypto/ec/ec2_smpt.c vendor-crypto/openssl/dist/crypto/engine/eng_padlock.c vendor-crypto/openssl/dist/crypto/err/err_bio.c vendor-crypto/openssl/dist/crypto/err/err_def.c vendor-crypto/openssl/dist/crypto/err/err_str.c vendor-crypto/openssl/dist/crypto/err/openssl.ec vendor-crypto/openssl/dist/crypto/evp/dig_eng.c vendor-crypto/openssl/dist/crypto/evp/enc_min.c vendor-crypto/openssl/dist/crypto/evp/evp_cnf.c vendor-crypto/openssl/dist/crypto/fips_err.c vendor-crypto/openssl/dist/crypto/md4/md4s.cpp vendor-crypto/openssl/dist/crypto/md5/md5s.cpp vendor-crypto/openssl/dist/crypto/perlasm/x86ms.pl vendor-crypto/openssl/dist/crypto/perlasm/x86unix.pl vendor-crypto/openssl/dist/crypto/pqueue/pq_compat.h vendor-crypto/openssl/dist/crypto/rand/rand_eng.c vendor-crypto/openssl/dist/crypto/rand/rand_nw.c vendor-crypto/openssl/dist/crypto/rand/rand_os2.c vendor-crypto/openssl/dist/crypto/rand/rand_vms.c vendor-crypto/openssl/dist/crypto/rand/rand_win.c vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-ia64.S vendor-crypto/openssl/dist/crypto/rc4/rc4_fblk.c vendor-crypto/openssl/dist/crypto/rc4/rc4s.cpp vendor-crypto/openssl/dist/crypto/rc5/rc5s.cpp vendor-crypto/openssl/dist/crypto/ripemd/asm/rips.cpp vendor-crypto/openssl/dist/crypto/rsa/rsa_eng.c vendor-crypto/openssl/dist/crypto/rsa/rsa_x931g.c vendor-crypto/openssl/dist/crypto/sha/asm/sha512-sse2.pl vendor-crypto/openssl/dist/crypto/sha/sha1s.cpp vendor-crypto/openssl/dist/crypto/tmdiff.c vendor-crypto/openssl/dist/crypto/tmdiff.h vendor-crypto/openssl/dist/demos/ vendor-crypto/openssl/dist/engines/alpha.opt vendor-crypto/openssl/dist/engines/e_4758cca.ec vendor-crypto/openssl/dist/engines/e_aep.ec vendor-crypto/openssl/dist/engines/e_atalla.ec vendor-crypto/openssl/dist/engines/e_capi.ec vendor-crypto/openssl/dist/engines/e_chil.ec vendor-crypto/openssl/dist/engines/e_cswift.ec vendor-crypto/openssl/dist/engines/e_gmp.ec vendor-crypto/openssl/dist/engines/e_nuron.ec vendor-crypto/openssl/dist/engines/e_sureware.ec vendor-crypto/openssl/dist/engines/e_ubsec.ec vendor-crypto/openssl/dist/engines/ia64.opt vendor-crypto/openssl/dist/engines/vax.opt vendor-crypto/openssl/dist/fips/ vendor-crypto/openssl/dist/openssl.doxy vendor-crypto/openssl/dist/openssl.spec vendor-crypto/openssl/dist/test/ vendor-crypto/openssl/dist/times/ vendor-crypto/openssl/dist/tools/ vendor-crypto/openssl/dist/util/arx.pl vendor-crypto/openssl/dist/util/fipslink.pl vendor-crypto/openssl/dist/util/mksdef.pl Modified: vendor-crypto/openssl/dist/CHANGES vendor-crypto/openssl/dist/CHANGES.SSLeay vendor-crypto/openssl/dist/Configure vendor-crypto/openssl/dist/FREEBSD-Xlist vendor-crypto/openssl/dist/FREEBSD-upgrade vendor-crypto/openssl/dist/INSTALL vendor-crypto/openssl/dist/Makefile vendor-crypto/openssl/dist/Makefile.org vendor-crypto/openssl/dist/Makefile.shared vendor-crypto/openssl/dist/NEWS vendor-crypto/openssl/dist/README vendor-crypto/openssl/dist/apps/Makefile vendor-crypto/openssl/dist/apps/apps.c vendor-crypto/openssl/dist/apps/apps.h vendor-crypto/openssl/dist/apps/asn1pars.c vendor-crypto/openssl/dist/apps/ca.c vendor-crypto/openssl/dist/apps/ciphers.c vendor-crypto/openssl/dist/apps/client.pem vendor-crypto/openssl/dist/apps/cms.c vendor-crypto/openssl/dist/apps/crl2p7.c vendor-crypto/openssl/dist/apps/dgst.c vendor-crypto/openssl/dist/apps/dh.c vendor-crypto/openssl/dist/apps/dhparam.c vendor-crypto/openssl/dist/apps/dsa.c vendor-crypto/openssl/dist/apps/ec.c vendor-crypto/openssl/dist/apps/ecparam.c vendor-crypto/openssl/dist/apps/enc.c vendor-crypto/openssl/dist/apps/engine.c vendor-crypto/openssl/dist/apps/errstr.c vendor-crypto/openssl/dist/apps/gendh.c vendor-crypto/openssl/dist/apps/genrsa.c vendor-crypto/openssl/dist/apps/ocsp.c vendor-crypto/openssl/dist/apps/openssl.c vendor-crypto/openssl/dist/apps/openssl.cnf vendor-crypto/openssl/dist/apps/pkcs12.c vendor-crypto/openssl/dist/apps/pkcs7.c vendor-crypto/openssl/dist/apps/pkcs8.c vendor-crypto/openssl/dist/apps/prime.c vendor-crypto/openssl/dist/apps/progs.h vendor-crypto/openssl/dist/apps/progs.pl vendor-crypto/openssl/dist/apps/req.c vendor-crypto/openssl/dist/apps/rsa.c vendor-crypto/openssl/dist/apps/rsautl.c vendor-crypto/openssl/dist/apps/s_apps.h vendor-crypto/openssl/dist/apps/s_cb.c vendor-crypto/openssl/dist/apps/s_client.c vendor-crypto/openssl/dist/apps/s_server.c vendor-crypto/openssl/dist/apps/s_socket.c vendor-crypto/openssl/dist/apps/s_time.c vendor-crypto/openssl/dist/apps/server.pem vendor-crypto/openssl/dist/apps/server2.pem vendor-crypto/openssl/dist/apps/sess_id.c vendor-crypto/openssl/dist/apps/smime.c vendor-crypto/openssl/dist/apps/speed.c vendor-crypto/openssl/dist/apps/verify.c vendor-crypto/openssl/dist/apps/x509.c vendor-crypto/openssl/dist/config vendor-crypto/openssl/dist/crypto/Makefile vendor-crypto/openssl/dist/crypto/aes/Makefile vendor-crypto/openssl/dist/crypto/aes/aes.h vendor-crypto/openssl/dist/crypto/aes/aes_cbc.c vendor-crypto/openssl/dist/crypto/aes/aes_cfb.c vendor-crypto/openssl/dist/crypto/aes/aes_core.c vendor-crypto/openssl/dist/crypto/aes/aes_ctr.c vendor-crypto/openssl/dist/crypto/aes/aes_ige.c vendor-crypto/openssl/dist/crypto/aes/aes_misc.c vendor-crypto/openssl/dist/crypto/aes/aes_ofb.c vendor-crypto/openssl/dist/crypto/aes/asm/aes-586.pl vendor-crypto/openssl/dist/crypto/aes/asm/aes-x86_64.pl vendor-crypto/openssl/dist/crypto/asn1/Makefile vendor-crypto/openssl/dist/crypto/asn1/a_bitstr.c vendor-crypto/openssl/dist/crypto/asn1/a_digest.c vendor-crypto/openssl/dist/crypto/asn1/a_dup.c vendor-crypto/openssl/dist/crypto/asn1/a_gentm.c vendor-crypto/openssl/dist/crypto/asn1/a_int.c vendor-crypto/openssl/dist/crypto/asn1/a_object.c vendor-crypto/openssl/dist/crypto/asn1/a_octet.c vendor-crypto/openssl/dist/crypto/asn1/a_set.c vendor-crypto/openssl/dist/crypto/asn1/a_sign.c vendor-crypto/openssl/dist/crypto/asn1/a_strnid.c vendor-crypto/openssl/dist/crypto/asn1/a_time.c vendor-crypto/openssl/dist/crypto/asn1/a_type.c vendor-crypto/openssl/dist/crypto/asn1/a_utctm.c vendor-crypto/openssl/dist/crypto/asn1/a_verify.c vendor-crypto/openssl/dist/crypto/asn1/asn1.h vendor-crypto/openssl/dist/crypto/asn1/asn1_err.c vendor-crypto/openssl/dist/crypto/asn1/asn1_gen.c vendor-crypto/openssl/dist/crypto/asn1/asn1_lib.c vendor-crypto/openssl/dist/crypto/asn1/asn1_mac.h vendor-crypto/openssl/dist/crypto/asn1/asn1_par.c vendor-crypto/openssl/dist/crypto/asn1/asn1t.h vendor-crypto/openssl/dist/crypto/asn1/asn_mime.c vendor-crypto/openssl/dist/crypto/asn1/asn_pack.c vendor-crypto/openssl/dist/crypto/asn1/charmap.h vendor-crypto/openssl/dist/crypto/asn1/d2i_pr.c vendor-crypto/openssl/dist/crypto/asn1/d2i_pu.c vendor-crypto/openssl/dist/crypto/asn1/i2d_pr.c vendor-crypto/openssl/dist/crypto/asn1/n_pkey.c vendor-crypto/openssl/dist/crypto/asn1/nsseq.c vendor-crypto/openssl/dist/crypto/asn1/p5_pbe.c vendor-crypto/openssl/dist/crypto/asn1/p5_pbev2.c vendor-crypto/openssl/dist/crypto/asn1/p8_pkey.c vendor-crypto/openssl/dist/crypto/asn1/t_crl.c vendor-crypto/openssl/dist/crypto/asn1/t_pkey.c vendor-crypto/openssl/dist/crypto/asn1/t_req.c vendor-crypto/openssl/dist/crypto/asn1/t_spki.c vendor-crypto/openssl/dist/crypto/asn1/t_x509.c vendor-crypto/openssl/dist/crypto/asn1/tasn_dec.c vendor-crypto/openssl/dist/crypto/asn1/tasn_enc.c vendor-crypto/openssl/dist/crypto/asn1/tasn_fre.c vendor-crypto/openssl/dist/crypto/asn1/tasn_new.c vendor-crypto/openssl/dist/crypto/asn1/tasn_prn.c vendor-crypto/openssl/dist/crypto/asn1/tasn_typ.c vendor-crypto/openssl/dist/crypto/asn1/x_algor.c vendor-crypto/openssl/dist/crypto/asn1/x_crl.c vendor-crypto/openssl/dist/crypto/asn1/x_long.c vendor-crypto/openssl/dist/crypto/asn1/x_name.c vendor-crypto/openssl/dist/crypto/asn1/x_pubkey.c vendor-crypto/openssl/dist/crypto/asn1/x_req.c vendor-crypto/openssl/dist/crypto/asn1/x_x509.c vendor-crypto/openssl/dist/crypto/bf/Makefile vendor-crypto/openssl/dist/crypto/bf/asm/bf-586.pl vendor-crypto/openssl/dist/crypto/bf/bf_skey.c vendor-crypto/openssl/dist/crypto/bf/blowfish.h vendor-crypto/openssl/dist/crypto/bio/Makefile vendor-crypto/openssl/dist/crypto/bio/b_print.c vendor-crypto/openssl/dist/crypto/bio/b_sock.c vendor-crypto/openssl/dist/crypto/bio/bio.h vendor-crypto/openssl/dist/crypto/bio/bio_cb.c vendor-crypto/openssl/dist/crypto/bio/bio_err.c vendor-crypto/openssl/dist/crypto/bio/bio_lcl.h vendor-crypto/openssl/dist/crypto/bio/bio_lib.c vendor-crypto/openssl/dist/crypto/bio/bss_acpt.c vendor-crypto/openssl/dist/crypto/bio/bss_bio.c vendor-crypto/openssl/dist/crypto/bio/bss_dgram.c vendor-crypto/openssl/dist/crypto/bio/bss_fd.c vendor-crypto/openssl/dist/crypto/bio/bss_file.c vendor-crypto/openssl/dist/crypto/bio/bss_log.c vendor-crypto/openssl/dist/crypto/bio/bss_mem.c vendor-crypto/openssl/dist/crypto/bn/Makefile vendor-crypto/openssl/dist/crypto/bn/asm/bn-586.pl vendor-crypto/openssl/dist/crypto/bn/asm/co-586.pl vendor-crypto/openssl/dist/crypto/bn/asm/ppc.pl vendor-crypto/openssl/dist/crypto/bn/asm/sparcv8plus.S vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gcc.c vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl vendor-crypto/openssl/dist/crypto/bn/bn.h vendor-crypto/openssl/dist/crypto/bn/bn_asm.c vendor-crypto/openssl/dist/crypto/bn/bn_blind.c vendor-crypto/openssl/dist/crypto/bn/bn_ctx.c vendor-crypto/openssl/dist/crypto/bn/bn_div.c vendor-crypto/openssl/dist/crypto/bn/bn_exp.c vendor-crypto/openssl/dist/crypto/bn/bn_gf2m.c vendor-crypto/openssl/dist/crypto/bn/bn_lcl.h vendor-crypto/openssl/dist/crypto/bn/bn_lib.c vendor-crypto/openssl/dist/crypto/bn/bn_mont.c vendor-crypto/openssl/dist/crypto/bn/bn_nist.c vendor-crypto/openssl/dist/crypto/bn/bn_print.c vendor-crypto/openssl/dist/crypto/bn/bn_shift.c vendor-crypto/openssl/dist/crypto/bn/bntest.c vendor-crypto/openssl/dist/crypto/bn/exptest.c vendor-crypto/openssl/dist/crypto/buffer/Makefile vendor-crypto/openssl/dist/crypto/buffer/buf_err.c vendor-crypto/openssl/dist/crypto/buffer/buf_str.c vendor-crypto/openssl/dist/crypto/buffer/buffer.c vendor-crypto/openssl/dist/crypto/buffer/buffer.h vendor-crypto/openssl/dist/crypto/camellia/Makefile vendor-crypto/openssl/dist/crypto/camellia/camellia.c vendor-crypto/openssl/dist/crypto/camellia/camellia.h vendor-crypto/openssl/dist/crypto/camellia/cmll_cbc.c vendor-crypto/openssl/dist/crypto/camellia/cmll_cfb.c vendor-crypto/openssl/dist/crypto/camellia/cmll_ctr.c vendor-crypto/openssl/dist/crypto/camellia/cmll_locl.h vendor-crypto/openssl/dist/crypto/camellia/cmll_misc.c vendor-crypto/openssl/dist/crypto/camellia/cmll_ofb.c vendor-crypto/openssl/dist/crypto/cast/Makefile vendor-crypto/openssl/dist/crypto/cast/asm/cast-586.pl vendor-crypto/openssl/dist/crypto/cast/c_skey.c vendor-crypto/openssl/dist/crypto/cast/cast.h vendor-crypto/openssl/dist/crypto/cms/Makefile vendor-crypto/openssl/dist/crypto/cms/cms.h vendor-crypto/openssl/dist/crypto/cms/cms_asn1.c vendor-crypto/openssl/dist/crypto/cms/cms_env.c vendor-crypto/openssl/dist/crypto/cms/cms_err.c vendor-crypto/openssl/dist/crypto/cms/cms_ess.c vendor-crypto/openssl/dist/crypto/cms/cms_io.c vendor-crypto/openssl/dist/crypto/cms/cms_lcl.h vendor-crypto/openssl/dist/crypto/cms/cms_lib.c vendor-crypto/openssl/dist/crypto/cms/cms_sd.c vendor-crypto/openssl/dist/crypto/cms/cms_smime.c vendor-crypto/openssl/dist/crypto/comp/Makefile vendor-crypto/openssl/dist/crypto/comp/c_rle.c vendor-crypto/openssl/dist/crypto/comp/c_zlib.c vendor-crypto/openssl/dist/crypto/comp/comp_err.c vendor-crypto/openssl/dist/crypto/conf/Makefile vendor-crypto/openssl/dist/crypto/conf/README vendor-crypto/openssl/dist/crypto/conf/conf.h vendor-crypto/openssl/dist/crypto/conf/conf_api.c vendor-crypto/openssl/dist/crypto/conf/conf_def.c vendor-crypto/openssl/dist/crypto/conf/conf_err.c vendor-crypto/openssl/dist/crypto/conf/conf_lib.c vendor-crypto/openssl/dist/crypto/conf/conf_mall.c vendor-crypto/openssl/dist/crypto/conf/conf_mod.c vendor-crypto/openssl/dist/crypto/cpt_err.c vendor-crypto/openssl/dist/crypto/cryptlib.c vendor-crypto/openssl/dist/crypto/cryptlib.h vendor-crypto/openssl/dist/crypto/crypto.h vendor-crypto/openssl/dist/crypto/des/Makefile vendor-crypto/openssl/dist/crypto/des/asm/crypt586.pl vendor-crypto/openssl/dist/crypto/des/asm/des-586.pl vendor-crypto/openssl/dist/crypto/des/asm/des_enc.m4 vendor-crypto/openssl/dist/crypto/des/des.h vendor-crypto/openssl/dist/crypto/des/des_enc.c vendor-crypto/openssl/dist/crypto/des/des_locl.h vendor-crypto/openssl/dist/crypto/des/ecb_enc.c vendor-crypto/openssl/dist/crypto/des/enc_read.c vendor-crypto/openssl/dist/crypto/des/enc_writ.c vendor-crypto/openssl/dist/crypto/des/fcrypt_b.c vendor-crypto/openssl/dist/crypto/des/set_key.c vendor-crypto/openssl/dist/crypto/des/xcbc_enc.c vendor-crypto/openssl/dist/crypto/dh/Makefile vendor-crypto/openssl/dist/crypto/dh/dh.h vendor-crypto/openssl/dist/crypto/dh/dh_asn1.c vendor-crypto/openssl/dist/crypto/dh/dh_check.c vendor-crypto/openssl/dist/crypto/dh/dh_err.c vendor-crypto/openssl/dist/crypto/dh/dh_gen.c vendor-crypto/openssl/dist/crypto/dh/dh_key.c vendor-crypto/openssl/dist/crypto/dh/dh_lib.c vendor-crypto/openssl/dist/crypto/dsa/Makefile vendor-crypto/openssl/dist/crypto/dsa/dsa.h vendor-crypto/openssl/dist/crypto/dsa/dsa_asn1.c vendor-crypto/openssl/dist/crypto/dsa/dsa_err.c vendor-crypto/openssl/dist/crypto/dsa/dsa_gen.c vendor-crypto/openssl/dist/crypto/dsa/dsa_key.c vendor-crypto/openssl/dist/crypto/dsa/dsa_lib.c vendor-crypto/openssl/dist/crypto/dsa/dsa_ossl.c vendor-crypto/openssl/dist/crypto/dsa/dsa_sign.c vendor-crypto/openssl/dist/crypto/dsa/dsa_vrf.c vendor-crypto/openssl/dist/crypto/dsa/dsatest.c vendor-crypto/openssl/dist/crypto/dso/Makefile vendor-crypto/openssl/dist/crypto/dso/dso.h vendor-crypto/openssl/dist/crypto/dso/dso_dl.c vendor-crypto/openssl/dist/crypto/dso/dso_dlfcn.c vendor-crypto/openssl/dist/crypto/dso/dso_err.c vendor-crypto/openssl/dist/crypto/dso/dso_lib.c vendor-crypto/openssl/dist/crypto/dso/dso_null.c vendor-crypto/openssl/dist/crypto/dso/dso_openssl.c vendor-crypto/openssl/dist/crypto/ec/Makefile vendor-crypto/openssl/dist/crypto/ec/ec.h vendor-crypto/openssl/dist/crypto/ec/ec2_mult.c vendor-crypto/openssl/dist/crypto/ec/ec2_smpl.c vendor-crypto/openssl/dist/crypto/ec/ec_asn1.c vendor-crypto/openssl/dist/crypto/ec/ec_curve.c vendor-crypto/openssl/dist/crypto/ec/ec_cvt.c vendor-crypto/openssl/dist/crypto/ec/ec_err.c vendor-crypto/openssl/dist/crypto/ec/ec_key.c vendor-crypto/openssl/dist/crypto/ec/ec_lcl.h vendor-crypto/openssl/dist/crypto/ec/ec_lib.c vendor-crypto/openssl/dist/crypto/ec/ec_mult.c vendor-crypto/openssl/dist/crypto/ec/ecp_mont.c vendor-crypto/openssl/dist/crypto/ec/ecp_nist.c vendor-crypto/openssl/dist/crypto/ec/ecp_smpl.c vendor-crypto/openssl/dist/crypto/ec/ectest.c vendor-crypto/openssl/dist/crypto/ecdh/Makefile vendor-crypto/openssl/dist/crypto/ecdh/ecdh.h vendor-crypto/openssl/dist/crypto/ecdh/ecdhtest.c vendor-crypto/openssl/dist/crypto/ecdh/ech_err.c vendor-crypto/openssl/dist/crypto/ecdh/ech_lib.c vendor-crypto/openssl/dist/crypto/ecdh/ech_locl.h vendor-crypto/openssl/dist/crypto/ecdh/ech_ossl.c vendor-crypto/openssl/dist/crypto/ecdsa/Makefile vendor-crypto/openssl/dist/crypto/ecdsa/ecdsa.h vendor-crypto/openssl/dist/crypto/ecdsa/ecdsatest.c vendor-crypto/openssl/dist/crypto/ecdsa/ecs_err.c vendor-crypto/openssl/dist/crypto/ecdsa/ecs_lib.c vendor-crypto/openssl/dist/crypto/ecdsa/ecs_locl.h vendor-crypto/openssl/dist/crypto/ecdsa/ecs_ossl.c vendor-crypto/openssl/dist/crypto/engine/Makefile vendor-crypto/openssl/dist/crypto/engine/eng_all.c vendor-crypto/openssl/dist/crypto/engine/eng_cryptodev.c vendor-crypto/openssl/dist/crypto/engine/eng_dyn.c vendor-crypto/openssl/dist/crypto/engine/eng_err.c vendor-crypto/openssl/dist/crypto/engine/eng_fat.c vendor-crypto/openssl/dist/crypto/engine/eng_int.h vendor-crypto/openssl/dist/crypto/engine/eng_lib.c vendor-crypto/openssl/dist/crypto/engine/eng_list.c vendor-crypto/openssl/dist/crypto/engine/eng_openssl.c vendor-crypto/openssl/dist/crypto/engine/eng_table.c vendor-crypto/openssl/dist/crypto/engine/engine.h vendor-crypto/openssl/dist/crypto/engine/enginetest.c vendor-crypto/openssl/dist/crypto/err/Makefile vendor-crypto/openssl/dist/crypto/err/err.c vendor-crypto/openssl/dist/crypto/err/err.h vendor-crypto/openssl/dist/crypto/err/err_all.c vendor-crypto/openssl/dist/crypto/err/err_prn.c vendor-crypto/openssl/dist/crypto/evp/Makefile vendor-crypto/openssl/dist/crypto/evp/bio_enc.c vendor-crypto/openssl/dist/crypto/evp/bio_md.c vendor-crypto/openssl/dist/crypto/evp/bio_ok.c vendor-crypto/openssl/dist/crypto/evp/c_all.c vendor-crypto/openssl/dist/crypto/evp/c_allc.c vendor-crypto/openssl/dist/crypto/evp/c_alld.c vendor-crypto/openssl/dist/crypto/evp/digest.c vendor-crypto/openssl/dist/crypto/evp/e_aes.c vendor-crypto/openssl/dist/crypto/evp/e_camellia.c vendor-crypto/openssl/dist/crypto/evp/e_des.c vendor-crypto/openssl/dist/crypto/evp/e_des3.c vendor-crypto/openssl/dist/crypto/evp/e_idea.c vendor-crypto/openssl/dist/crypto/evp/e_null.c vendor-crypto/openssl/dist/crypto/evp/e_rc2.c vendor-crypto/openssl/dist/crypto/evp/e_rc4.c vendor-crypto/openssl/dist/crypto/evp/e_seed.c vendor-crypto/openssl/dist/crypto/evp/e_xcbc_d.c vendor-crypto/openssl/dist/crypto/evp/encode.c vendor-crypto/openssl/dist/crypto/evp/evp.h vendor-crypto/openssl/dist/crypto/evp/evp_enc.c vendor-crypto/openssl/dist/crypto/evp/evp_err.c vendor-crypto/openssl/dist/crypto/evp/evp_key.c vendor-crypto/openssl/dist/crypto/evp/evp_lib.c vendor-crypto/openssl/dist/crypto/evp/evp_locl.h vendor-crypto/openssl/dist/crypto/evp/evp_pbe.c vendor-crypto/openssl/dist/crypto/evp/evp_pkey.c vendor-crypto/openssl/dist/crypto/evp/evp_test.c vendor-crypto/openssl/dist/crypto/evp/evptests.txt vendor-crypto/openssl/dist/crypto/evp/m_dss.c vendor-crypto/openssl/dist/crypto/evp/m_dss1.c vendor-crypto/openssl/dist/crypto/evp/m_ecdsa.c vendor-crypto/openssl/dist/crypto/evp/m_md2.c vendor-crypto/openssl/dist/crypto/evp/m_md4.c vendor-crypto/openssl/dist/crypto/evp/m_md5.c vendor-crypto/openssl/dist/crypto/evp/m_mdc2.c vendor-crypto/openssl/dist/crypto/evp/m_ripemd.c vendor-crypto/openssl/dist/crypto/evp/m_sha.c vendor-crypto/openssl/dist/crypto/evp/m_sha1.c vendor-crypto/openssl/dist/crypto/evp/names.c vendor-crypto/openssl/dist/crypto/evp/p5_crpt.c vendor-crypto/openssl/dist/crypto/evp/p5_crpt2.c vendor-crypto/openssl/dist/crypto/evp/p_dec.c vendor-crypto/openssl/dist/crypto/evp/p_enc.c vendor-crypto/openssl/dist/crypto/evp/p_lib.c vendor-crypto/openssl/dist/crypto/evp/p_open.c vendor-crypto/openssl/dist/crypto/evp/p_seal.c vendor-crypto/openssl/dist/crypto/evp/p_sign.c vendor-crypto/openssl/dist/crypto/evp/p_verify.c vendor-crypto/openssl/dist/crypto/ex_data.c vendor-crypto/openssl/dist/crypto/fips_err.h vendor-crypto/openssl/dist/crypto/hmac/Makefile vendor-crypto/openssl/dist/crypto/hmac/hmac.c vendor-crypto/openssl/dist/crypto/hmac/hmac.h vendor-crypto/openssl/dist/crypto/ia64cpuid.S vendor-crypto/openssl/dist/crypto/idea/Makefile vendor-crypto/openssl/dist/crypto/idea/i_skey.c vendor-crypto/openssl/dist/crypto/idea/idea.h vendor-crypto/openssl/dist/crypto/jpake/Makefile vendor-crypto/openssl/dist/crypto/jpake/jpake.c vendor-crypto/openssl/dist/crypto/jpake/jpaketest.c vendor-crypto/openssl/dist/crypto/krb5/Makefile vendor-crypto/openssl/dist/crypto/lhash/Makefile vendor-crypto/openssl/dist/crypto/lhash/lh_stats.c vendor-crypto/openssl/dist/crypto/lhash/lhash.c vendor-crypto/openssl/dist/crypto/lhash/lhash.h vendor-crypto/openssl/dist/crypto/md2/Makefile vendor-crypto/openssl/dist/crypto/md2/md2_dgst.c vendor-crypto/openssl/dist/crypto/md32_common.h vendor-crypto/openssl/dist/crypto/md4/Makefile vendor-crypto/openssl/dist/crypto/md4/md4.h vendor-crypto/openssl/dist/crypto/md4/md4_dgst.c vendor-crypto/openssl/dist/crypto/md5/Makefile vendor-crypto/openssl/dist/crypto/md5/asm/md5-586.pl vendor-crypto/openssl/dist/crypto/md5/asm/md5-x86_64.pl vendor-crypto/openssl/dist/crypto/md5/md5.h vendor-crypto/openssl/dist/crypto/md5/md5_dgst.c vendor-crypto/openssl/dist/crypto/md5/md5_locl.h vendor-crypto/openssl/dist/crypto/mdc2/Makefile vendor-crypto/openssl/dist/crypto/mdc2/mdc2.h vendor-crypto/openssl/dist/crypto/mdc2/mdc2dgst.c vendor-crypto/openssl/dist/crypto/mem.c vendor-crypto/openssl/dist/crypto/mem_dbg.c vendor-crypto/openssl/dist/crypto/o_init.c vendor-crypto/openssl/dist/crypto/o_time.c vendor-crypto/openssl/dist/crypto/o_time.h vendor-crypto/openssl/dist/crypto/objects/Makefile vendor-crypto/openssl/dist/crypto/objects/o_names.c vendor-crypto/openssl/dist/crypto/objects/obj_dat.c vendor-crypto/openssl/dist/crypto/objects/obj_dat.h vendor-crypto/openssl/dist/crypto/objects/obj_dat.pl vendor-crypto/openssl/dist/crypto/objects/obj_err.c vendor-crypto/openssl/dist/crypto/objects/obj_lib.c vendor-crypto/openssl/dist/crypto/objects/obj_mac.h vendor-crypto/openssl/dist/crypto/objects/obj_mac.num vendor-crypto/openssl/dist/crypto/objects/objects.h vendor-crypto/openssl/dist/crypto/objects/objects.pl vendor-crypto/openssl/dist/crypto/objects/objects.txt vendor-crypto/openssl/dist/crypto/ocsp/Makefile vendor-crypto/openssl/dist/crypto/ocsp/ocsp.h vendor-crypto/openssl/dist/crypto/ocsp/ocsp_cl.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_err.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_ext.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_ht.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_lib.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_prn.c vendor-crypto/openssl/dist/crypto/ocsp/ocsp_vfy.c vendor-crypto/openssl/dist/crypto/opensslconf.h vendor-crypto/openssl/dist/crypto/opensslconf.h.in vendor-crypto/openssl/dist/crypto/opensslv.h vendor-crypto/openssl/dist/crypto/ossl_typ.h vendor-crypto/openssl/dist/crypto/pem/Makefile vendor-crypto/openssl/dist/crypto/pem/pem.h vendor-crypto/openssl/dist/crypto/pem/pem_all.c vendor-crypto/openssl/dist/crypto/pem/pem_err.c vendor-crypto/openssl/dist/crypto/pem/pem_info.c vendor-crypto/openssl/dist/crypto/pem/pem_lib.c vendor-crypto/openssl/dist/crypto/pem/pem_pkey.c vendor-crypto/openssl/dist/crypto/pem/pem_x509.c vendor-crypto/openssl/dist/crypto/pem/pem_xaux.c vendor-crypto/openssl/dist/crypto/perlasm/x86_64-xlate.pl vendor-crypto/openssl/dist/crypto/perlasm/x86asm.pl vendor-crypto/openssl/dist/crypto/perlasm/x86nasm.pl vendor-crypto/openssl/dist/crypto/pkcs12/Makefile vendor-crypto/openssl/dist/crypto/pkcs12/p12_add.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_attr.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_crpt.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_crt.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_decr.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_key.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_kiss.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_mutl.c vendor-crypto/openssl/dist/crypto/pkcs12/p12_utl.c vendor-crypto/openssl/dist/crypto/pkcs12/pk12err.c vendor-crypto/openssl/dist/crypto/pkcs12/pkcs12.h vendor-crypto/openssl/dist/crypto/pkcs7/Makefile vendor-crypto/openssl/dist/crypto/pkcs7/pk7_asn1.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_attr.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_doit.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_lib.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_mime.c vendor-crypto/openssl/dist/crypto/pkcs7/pk7_smime.c vendor-crypto/openssl/dist/crypto/pkcs7/pkcs7.h vendor-crypto/openssl/dist/crypto/pkcs7/pkcs7err.c vendor-crypto/openssl/dist/crypto/pqueue/Makefile vendor-crypto/openssl/dist/crypto/pqueue/pqueue.c vendor-crypto/openssl/dist/crypto/pqueue/pqueue.h vendor-crypto/openssl/dist/crypto/rand/Makefile vendor-crypto/openssl/dist/crypto/rand/md_rand.c vendor-crypto/openssl/dist/crypto/rand/rand.h vendor-crypto/openssl/dist/crypto/rand/rand_egd.c vendor-crypto/openssl/dist/crypto/rand/rand_err.c vendor-crypto/openssl/dist/crypto/rand/rand_lcl.h vendor-crypto/openssl/dist/crypto/rand/rand_lib.c vendor-crypto/openssl/dist/crypto/rand/rand_unix.c vendor-crypto/openssl/dist/crypto/rand/randfile.c vendor-crypto/openssl/dist/crypto/rc2/Makefile vendor-crypto/openssl/dist/crypto/rc2/rc2_skey.c vendor-crypto/openssl/dist/crypto/rc4/Makefile vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-586.pl vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-x86_64.pl vendor-crypto/openssl/dist/crypto/rc4/rc4.h vendor-crypto/openssl/dist/crypto/rc4/rc4_enc.c vendor-crypto/openssl/dist/crypto/rc4/rc4_skey.c vendor-crypto/openssl/dist/crypto/rc4/rc4test.c vendor-crypto/openssl/dist/crypto/rc5/Makefile vendor-crypto/openssl/dist/crypto/rc5/asm/rc5-586.pl vendor-crypto/openssl/dist/crypto/rc5/rc5.h vendor-crypto/openssl/dist/crypto/rc5/rc5_locl.h vendor-crypto/openssl/dist/crypto/rc5/rc5_skey.c vendor-crypto/openssl/dist/crypto/ripemd/Makefile vendor-crypto/openssl/dist/crypto/ripemd/asm/rmd-586.pl vendor-crypto/openssl/dist/crypto/ripemd/ripemd.h vendor-crypto/openssl/dist/crypto/ripemd/rmd_dgst.c vendor-crypto/openssl/dist/crypto/ripemd/rmd_locl.h vendor-crypto/openssl/dist/crypto/rsa/Makefile vendor-crypto/openssl/dist/crypto/rsa/rsa.h vendor-crypto/openssl/dist/crypto/rsa/rsa_asn1.c vendor-crypto/openssl/dist/crypto/rsa/rsa_eay.c vendor-crypto/openssl/dist/crypto/rsa/rsa_err.c vendor-crypto/openssl/dist/crypto/rsa/rsa_gen.c vendor-crypto/openssl/dist/crypto/rsa/rsa_lib.c vendor-crypto/openssl/dist/crypto/rsa/rsa_oaep.c vendor-crypto/openssl/dist/crypto/rsa/rsa_pss.c vendor-crypto/openssl/dist/crypto/rsa/rsa_sign.c vendor-crypto/openssl/dist/crypto/rsa/rsa_test.c vendor-crypto/openssl/dist/crypto/seed/Makefile vendor-crypto/openssl/dist/crypto/seed/seed.c vendor-crypto/openssl/dist/crypto/seed/seed.h vendor-crypto/openssl/dist/crypto/seed/seed_cbc.c vendor-crypto/openssl/dist/crypto/seed/seed_cfb.c vendor-crypto/openssl/dist/crypto/seed/seed_ofb.c vendor-crypto/openssl/dist/crypto/sha/Makefile vendor-crypto/openssl/dist/crypto/sha/asm/sha1-586.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha1-ia64.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha1-x86_64.pl vendor-crypto/openssl/dist/crypto/sha/asm/sha512-x86_64.pl vendor-crypto/openssl/dist/crypto/sha/sha.h vendor-crypto/openssl/dist/crypto/sha/sha1_one.c vendor-crypto/openssl/dist/crypto/sha/sha1dgst.c vendor-crypto/openssl/dist/crypto/sha/sha256.c vendor-crypto/openssl/dist/crypto/sha/sha512.c vendor-crypto/openssl/dist/crypto/sha/sha_dgst.c vendor-crypto/openssl/dist/crypto/sha/sha_locl.h vendor-crypto/openssl/dist/crypto/sha/shatest.c vendor-crypto/openssl/dist/crypto/sparccpuid.S vendor-crypto/openssl/dist/crypto/stack/Makefile vendor-crypto/openssl/dist/crypto/stack/safestack.h vendor-crypto/openssl/dist/crypto/stack/stack.c vendor-crypto/openssl/dist/crypto/stack/stack.h vendor-crypto/openssl/dist/crypto/store/Makefile vendor-crypto/openssl/dist/crypto/store/store.h vendor-crypto/openssl/dist/crypto/store/str_err.c vendor-crypto/openssl/dist/crypto/store/str_lib.c vendor-crypto/openssl/dist/crypto/store/str_mem.c vendor-crypto/openssl/dist/crypto/symhacks.h vendor-crypto/openssl/dist/crypto/threads/mttest.c vendor-crypto/openssl/dist/crypto/txt_db/Makefile vendor-crypto/openssl/dist/crypto/txt_db/txt_db.c vendor-crypto/openssl/dist/crypto/txt_db/txt_db.h vendor-crypto/openssl/dist/crypto/ui/Makefile vendor-crypto/openssl/dist/crypto/ui/ui.h vendor-crypto/openssl/dist/crypto/ui/ui_err.c vendor-crypto/openssl/dist/crypto/ui/ui_lib.c vendor-crypto/openssl/dist/crypto/ui/ui_openssl.c vendor-crypto/openssl/dist/crypto/x509/Makefile vendor-crypto/openssl/dist/crypto/x509/by_dir.c vendor-crypto/openssl/dist/crypto/x509/by_file.c vendor-crypto/openssl/dist/crypto/x509/x509.h vendor-crypto/openssl/dist/crypto/x509/x509_cmp.c vendor-crypto/openssl/dist/crypto/x509/x509_err.c vendor-crypto/openssl/dist/crypto/x509/x509_lu.c vendor-crypto/openssl/dist/crypto/x509/x509_obj.c vendor-crypto/openssl/dist/crypto/x509/x509_req.c vendor-crypto/openssl/dist/crypto/x509/x509_set.c vendor-crypto/openssl/dist/crypto/x509/x509_trs.c vendor-crypto/openssl/dist/crypto/x509/x509_txt.c vendor-crypto/openssl/dist/crypto/x509/x509_vfy.c vendor-crypto/openssl/dist/crypto/x509/x509_vfy.h vendor-crypto/openssl/dist/crypto/x509/x509_vpm.c vendor-crypto/openssl/dist/crypto/x509/x509cset.c vendor-crypto/openssl/dist/crypto/x509/x509name.c vendor-crypto/openssl/dist/crypto/x509/x509type.c vendor-crypto/openssl/dist/crypto/x509/x_all.c vendor-crypto/openssl/dist/crypto/x509v3/Makefile vendor-crypto/openssl/dist/crypto/x509v3/ext_dat.h vendor-crypto/openssl/dist/crypto/x509v3/pcy_cache.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_data.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_int.h vendor-crypto/openssl/dist/crypto/x509v3/pcy_map.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_node.c vendor-crypto/openssl/dist/crypto/x509v3/pcy_tree.c vendor-crypto/openssl/dist/crypto/x509v3/v3_addr.c vendor-crypto/openssl/dist/crypto/x509v3/v3_alt.c vendor-crypto/openssl/dist/crypto/x509v3/v3_asid.c vendor-crypto/openssl/dist/crypto/x509v3/v3_conf.c vendor-crypto/openssl/dist/crypto/x509v3/v3_cpols.c vendor-crypto/openssl/dist/crypto/x509v3/v3_crld.c vendor-crypto/openssl/dist/crypto/x509v3/v3_enum.c vendor-crypto/openssl/dist/crypto/x509v3/v3_extku.c vendor-crypto/openssl/dist/crypto/x509v3/v3_genn.c vendor-crypto/openssl/dist/crypto/x509v3/v3_lib.c vendor-crypto/openssl/dist/crypto/x509v3/v3_ncons.c vendor-crypto/openssl/dist/crypto/x509v3/v3_ocsp.c vendor-crypto/openssl/dist/crypto/x509v3/v3_pci.c vendor-crypto/openssl/dist/crypto/x509v3/v3_pcons.c vendor-crypto/openssl/dist/crypto/x509v3/v3_pmaps.c vendor-crypto/openssl/dist/crypto/x509v3/v3_prn.c vendor-crypto/openssl/dist/crypto/x509v3/v3_purp.c vendor-crypto/openssl/dist/crypto/x509v3/v3_skey.c vendor-crypto/openssl/dist/crypto/x509v3/v3_utl.c vendor-crypto/openssl/dist/crypto/x509v3/v3err.c vendor-crypto/openssl/dist/crypto/x509v3/x509v3.h vendor-crypto/openssl/dist/crypto/x86_64cpuid.pl vendor-crypto/openssl/dist/crypto/x86cpuid.pl vendor-crypto/openssl/dist/doc/apps/asn1parse.pod vendor-crypto/openssl/dist/doc/apps/ca.pod vendor-crypto/openssl/dist/doc/apps/ciphers.pod vendor-crypto/openssl/dist/doc/apps/dgst.pod vendor-crypto/openssl/dist/doc/apps/dhparam.pod vendor-crypto/openssl/dist/doc/apps/dsa.pod vendor-crypto/openssl/dist/doc/apps/dsaparam.pod vendor-crypto/openssl/dist/doc/apps/ec.pod vendor-crypto/openssl/dist/doc/apps/ecparam.pod vendor-crypto/openssl/dist/doc/apps/enc.pod vendor-crypto/openssl/dist/doc/apps/gendsa.pod vendor-crypto/openssl/dist/doc/apps/genrsa.pod vendor-crypto/openssl/dist/doc/apps/ocsp.pod vendor-crypto/openssl/dist/doc/apps/openssl.pod vendor-crypto/openssl/dist/doc/apps/pkcs12.pod vendor-crypto/openssl/dist/doc/apps/pkcs7.pod vendor-crypto/openssl/dist/doc/apps/pkcs8.pod vendor-crypto/openssl/dist/doc/apps/req.pod vendor-crypto/openssl/dist/doc/apps/rsa.pod vendor-crypto/openssl/dist/doc/apps/s_client.pod vendor-crypto/openssl/dist/doc/apps/s_server.pod vendor-crypto/openssl/dist/doc/apps/smime.pod vendor-crypto/openssl/dist/doc/apps/speed.pod vendor-crypto/openssl/dist/doc/apps/spkac.pod vendor-crypto/openssl/dist/doc/apps/verify.pod vendor-crypto/openssl/dist/doc/apps/x509.pod vendor-crypto/openssl/dist/doc/apps/x509v3_config.pod vendor-crypto/openssl/dist/doc/crypto/ASN1_generate_nconf.pod vendor-crypto/openssl/dist/doc/crypto/BIO_f_md.pod vendor-crypto/openssl/dist/doc/crypto/BIO_f_ssl.pod vendor-crypto/openssl/dist/doc/crypto/BIO_s_file.pod vendor-crypto/openssl/dist/doc/crypto/BIO_s_mem.pod vendor-crypto/openssl/dist/doc/crypto/BN_BLINDING_new.pod vendor-crypto/openssl/dist/doc/crypto/DSA_get_ex_new_index.pod vendor-crypto/openssl/dist/doc/crypto/EVP_DigestInit.pod vendor-crypto/openssl/dist/doc/crypto/EVP_SignInit.pod vendor-crypto/openssl/dist/doc/crypto/EVP_VerifyInit.pod vendor-crypto/openssl/dist/doc/crypto/PKCS7_encrypt.pod vendor-crypto/openssl/dist/doc/crypto/PKCS7_sign.pod vendor-crypto/openssl/dist/doc/crypto/SMIME_write_PKCS7.pod vendor-crypto/openssl/dist/doc/crypto/d2i_RSAPublicKey.pod vendor-crypto/openssl/dist/doc/crypto/ecdsa.pod vendor-crypto/openssl/dist/doc/crypto/evp.pod vendor-crypto/openssl/dist/doc/crypto/hmac.pod vendor-crypto/openssl/dist/doc/crypto/lhash.pod vendor-crypto/openssl/dist/doc/crypto/threads.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_new.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_mode.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_options.pod vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_ssl_version.pod vendor-crypto/openssl/dist/doc/ssl/SSL_alert_type_string.pod vendor-crypto/openssl/dist/doc/ssl/SSL_library_init.pod vendor-crypto/openssl/dist/doc/ssl/ssl.pod vendor-crypto/openssl/dist/doc/ssleay.txt vendor-crypto/openssl/dist/doc/standards.txt vendor-crypto/openssl/dist/e_os.h vendor-crypto/openssl/dist/e_os2.h vendor-crypto/openssl/dist/engines/Makefile vendor-crypto/openssl/dist/engines/e_4758cca.c vendor-crypto/openssl/dist/engines/e_aep.c vendor-crypto/openssl/dist/engines/e_capi.c vendor-crypto/openssl/dist/engines/e_capi_err.c vendor-crypto/openssl/dist/engines/e_chil.c vendor-crypto/openssl/dist/engines/e_gmp.c vendor-crypto/openssl/dist/engines/e_sureware.c vendor-crypto/openssl/dist/engines/e_ubsec.c vendor-crypto/openssl/dist/ssl/Makefile vendor-crypto/openssl/dist/ssl/bio_ssl.c vendor-crypto/openssl/dist/ssl/d1_both.c vendor-crypto/openssl/dist/ssl/d1_clnt.c vendor-crypto/openssl/dist/ssl/d1_enc.c vendor-crypto/openssl/dist/ssl/d1_lib.c vendor-crypto/openssl/dist/ssl/d1_meth.c vendor-crypto/openssl/dist/ssl/d1_pkt.c vendor-crypto/openssl/dist/ssl/d1_srvr.c vendor-crypto/openssl/dist/ssl/dtls1.h vendor-crypto/openssl/dist/ssl/kssl.c vendor-crypto/openssl/dist/ssl/kssl.h vendor-crypto/openssl/dist/ssl/kssl_lcl.h vendor-crypto/openssl/dist/ssl/s23_clnt.c vendor-crypto/openssl/dist/ssl/s23_lib.c vendor-crypto/openssl/dist/ssl/s23_meth.c vendor-crypto/openssl/dist/ssl/s23_srvr.c vendor-crypto/openssl/dist/ssl/s2_clnt.c vendor-crypto/openssl/dist/ssl/s2_enc.c vendor-crypto/openssl/dist/ssl/s2_lib.c vendor-crypto/openssl/dist/ssl/s2_meth.c vendor-crypto/openssl/dist/ssl/s2_pkt.c vendor-crypto/openssl/dist/ssl/s2_srvr.c vendor-crypto/openssl/dist/ssl/s3_both.c vendor-crypto/openssl/dist/ssl/s3_clnt.c vendor-crypto/openssl/dist/ssl/s3_enc.c vendor-crypto/openssl/dist/ssl/s3_lib.c vendor-crypto/openssl/dist/ssl/s3_meth.c vendor-crypto/openssl/dist/ssl/s3_pkt.c vendor-crypto/openssl/dist/ssl/s3_srvr.c vendor-crypto/openssl/dist/ssl/ssl.h vendor-crypto/openssl/dist/ssl/ssl2.h vendor-crypto/openssl/dist/ssl/ssl3.h vendor-crypto/openssl/dist/ssl/ssl_algs.c vendor-crypto/openssl/dist/ssl/ssl_asn1.c vendor-crypto/openssl/dist/ssl/ssl_cert.c vendor-crypto/openssl/dist/ssl/ssl_ciph.c vendor-crypto/openssl/dist/ssl/ssl_err.c vendor-crypto/openssl/dist/ssl/ssl_lib.c vendor-crypto/openssl/dist/ssl/ssl_locl.h vendor-crypto/openssl/dist/ssl/ssl_sess.c vendor-crypto/openssl/dist/ssl/ssl_stat.c vendor-crypto/openssl/dist/ssl/ssl_txt.c vendor-crypto/openssl/dist/ssl/ssltest.c vendor-crypto/openssl/dist/ssl/t1_clnt.c vendor-crypto/openssl/dist/ssl/t1_enc.c vendor-crypto/openssl/dist/ssl/t1_lib.c vendor-crypto/openssl/dist/ssl/t1_meth.c vendor-crypto/openssl/dist/ssl/t1_srvr.c vendor-crypto/openssl/dist/ssl/tls1.h vendor-crypto/openssl/dist/util/ck_errf.pl vendor-crypto/openssl/dist/util/clean-depend.pl vendor-crypto/openssl/dist/util/domd vendor-crypto/openssl/dist/util/libeay.num vendor-crypto/openssl/dist/util/mk1mf.pl vendor-crypto/openssl/dist/util/mkdef.pl vendor-crypto/openssl/dist/util/mkerr.pl vendor-crypto/openssl/dist/util/mkfiles.pl vendor-crypto/openssl/dist/util/mklink.pl vendor-crypto/openssl/dist/util/mkstack.pl vendor-crypto/openssl/dist/util/pl/BC-32.pl vendor-crypto/openssl/dist/util/pl/Mingw32.pl vendor-crypto/openssl/dist/util/pl/VC-32.pl vendor-crypto/openssl/dist/util/pl/netware.pl vendor-crypto/openssl/dist/util/point.sh vendor-crypto/openssl/dist/util/selftest.pl vendor-crypto/openssl/dist/util/shlib_wrap.sh vendor-crypto/openssl/dist/util/ssleay.num Modified: vendor-crypto/openssl/dist/CHANGES ============================================================================== --- vendor-crypto/openssl/dist/CHANGES Wed Jul 11 23:30:35 2012 (r238383) +++ vendor-crypto/openssl/dist/CHANGES Wed Jul 11 23:31:36 2012 (r238384) @@ -2,10 +2,10 @@ OpenSSL CHANGES _______________ - Changes between 0.9.8w and 0.9.8x [10 May 2012] + Changes between 1.0.1b and 1.0.1c [10 May 2012] - *) Sanity check record length before skipping explicit IV in DTLS - to fix DoS attack. + *) Sanity check record length before skipping explicit IV in TLS + 1.2, 1.1 and DTLS to fix DoS attack. Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic fuzzing as a service testing platform. @@ -16,15 +16,34 @@ Thanks to Solar Designer of Openwall for reporting this issue. [Steve Henson] - Changes between 0.9.8v and 0.9.8w [23 Apr 2012] + *) In FIPS mode don't try to use composite ciphers as they are not + approved. + [Steve Henson] - *) The fix for CVE-2012-2110 did not take into account that the - 'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an - int in OpenSSL 0.9.8, making it still vulnerable. Fix by - rejecting negative len parameter. (CVE-2012-2131) - [Tomas Hoger ] + Changes between 1.0.1a and 1.0.1b [26 Apr 2012] + + *) OpenSSL 1.0.0 sets SSL_OP_ALL to 0x80000FFFL and OpenSSL 1.0.1 and + 1.0.1a set SSL_OP_NO_TLSv1_1 to 0x00000400L which would unfortunately + mean any application compiled against OpenSSL 1.0.0 headers setting + SSL_OP_ALL would also set SSL_OP_NO_TLSv1_1, unintentionally disablng + TLS 1.1 also. Fix this by changing the value of SSL_OP_NO_TLSv1_1 to + 0x10000000L Any application which was previously compiled against + OpenSSL 1.0.1 or 1.0.1a headers and which cares about SSL_OP_NO_TLSv1_1 + will need to be recompiled as a result. Letting be results in + inability to disable specifically TLS 1.1 and in client context, + in unlike event, limit maximum offered version to TLS 1.0 [see below]. + [Steve Henson] + + *) In order to ensure interoperabilty SSL_OP_NO_protocolX does not + disable just protocol X, but all protocols above X *if* there are + protocols *below* X still enabled. In more practical terms it means + that if application wants to disable TLS1.0 in favor of TLS1.1 and + above, it's not sufficient to pass SSL_OP_NO_TLSv1, one has to pass + SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. This applies to + client side. + [Andy Polyakov] - Changes between 0.9.8u and 0.9.8v [19 Apr 2012] + Changes between 1.0.1 and 1.0.1a [19 Apr 2012] *) Check for potentially exploitable overflows in asn1_d2i_read_bio BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer @@ -35,7 +54,310 @@ (CVE-2012-2110) [Adam Langley (Google), Tavis Ormandy, Google Security Team] - Changes between 0.9.8t and 0.9.8u [12 Mar 2012] + *) Don't allow TLS 1.2 SHA-256 ciphersuites in TLS 1.0, 1.1 connections. + [Adam Langley] + + *) Workarounds for some broken servers that "hang" if a client hello + record length exceeds 255 bytes. + + 1. Do not use record version number > TLS 1.0 in initial client + hello: some (but not all) hanging servers will now work. + 2. If we set OPENSSL_MAX_TLS1_2_CIPHER_LENGTH this will truncate + the number of ciphers sent in the client hello. This should be + set to an even number, such as 50, for example by passing: + -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 to config or Configure. + Most broken servers should now work. + 3. If all else fails setting OPENSSL_NO_TLS1_2_CLIENT will disable + TLS 1.2 client support entirely. + [Steve Henson] + + *) Fix SEGV in Vector Permutation AES module observed in OpenSSH. + [Andy Polyakov] + + Changes between 1.0.0h and 1.0.1 [14 Mar 2012] + + *) Add compatibility with old MDC2 signatures which use an ASN1 OCTET + STRING form instead of a DigestInfo. + [Steve Henson] + + *) The format used for MDC2 RSA signatures is inconsistent between EVP + and the RSA_sign/RSA_verify functions. This was made more apparent when + OpenSSL used RSA_sign/RSA_verify for some RSA signatures in particular + those which went through EVP_PKEY_METHOD in 1.0.0 and later. Detect + the correct format in RSA_verify so both forms transparently work. + [Steve Henson] + + *) Some servers which support TLS 1.0 can choke if we initially indicate + support for TLS 1.2 and later renegotiate using TLS 1.0 in the RSA + encrypted premaster secret. As a workaround use the maximum pemitted + client version in client hello, this should keep such servers happy + and still work with previous versions of OpenSSL. + [Steve Henson] + + *) Add support for TLS/DTLS heartbeats. + [Robin Seggelmann ] + + *) Add support for SCTP. + [Robin Seggelmann ] + + *) Improved PRNG seeding for VOS. + [Paul Green ] + + *) Extensive assembler packs updates, most notably: + + - x86[_64]: AES-NI, PCLMULQDQ, RDRAND support; + - x86[_64]: SSSE3 support (SHA1, vector-permutation AES); + - x86_64: bit-sliced AES implementation; + - ARM: NEON support, contemporary platforms optimizations; + - s390x: z196 support; + - *: GHASH and GF(2^m) multiplication implementations; + + [Andy Polyakov] + + *) Make TLS-SRP code conformant with RFC 5054 API cleanup + (removal of unnecessary code) + [Peter Sylvester ] + + *) Add TLS key material exporter from RFC 5705. + [Eric Rescorla] + + *) Add DTLS-SRTP negotiation from RFC 5764. + [Eric Rescorla] + + *) Add Next Protocol Negotiation, + http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00. Can be + disabled with a no-npn flag to config or Configure. Code donated + by Google. + [Adam Langley and Ben Laurie] + + *) Add optional 64-bit optimized implementations of elliptic curves NIST-P224, + NIST-P256, NIST-P521, with constant-time single point multiplication on + typical inputs. Compiler support for the nonstandard type __uint128_t is + required to use this (present in gcc 4.4 and later, for 64-bit builds). + Code made available under Apache License version 2.0. + + Specify "enable-ec_nistp_64_gcc_128" on the Configure (or config) command + line to include this in your build of OpenSSL, and run "make depend" (or + "make update"). This enables the following EC_METHODs: + + EC_GFp_nistp224_method() + EC_GFp_nistp256_method() + EC_GFp_nistp521_method() + + EC_GROUP_new_by_curve_name() will automatically use these (while + EC_GROUP_new_curve_GFp() currently prefers the more flexible + implementations). + [Emilia Käsper, Adam Langley, Bodo Moeller (Google)] + + *) Use type ossl_ssize_t instad of ssize_t which isn't available on + all platforms. Move ssize_t definition from e_os.h to the public + header file e_os2.h as it now appears in public header file cms.h + [Steve Henson] + + *) New -sigopt option to the ca, req and x509 utilities. Additional + signature parameters can be passed using this option and in + particular PSS. + [Steve Henson] + + *) Add RSA PSS signing function. This will generate and set the + appropriate AlgorithmIdentifiers for PSS based on those in the + corresponding EVP_MD_CTX structure. No application support yet. + [Steve Henson] + + *) Support for companion algorithm specific ASN1 signing routines. + New function ASN1_item_sign_ctx() signs a pre-initialised + EVP_MD_CTX structure and sets AlgorithmIdentifiers based on + the appropriate parameters. + [Steve Henson] + + *) Add new algorithm specific ASN1 verification initialisation function + to EVP_PKEY_ASN1_METHOD: this is not in EVP_PKEY_METHOD since the ASN1 + handling will be the same no matter what EVP_PKEY_METHOD is used. + Add a PSS handler to support verification of PSS signatures: checked + against a number of sample certificates. + [Steve Henson] + + *) Add signature printing for PSS. Add PSS OIDs. + [Steve Henson, Martin Kaiser ] + + *) Add algorithm specific signature printing. An individual ASN1 method + can now print out signatures instead of the standard hex dump. + + More complex signatures (e.g. PSS) can print out more meaningful + information. Include DSA version that prints out the signature + parameters r, s. + [Steve Henson] + + *) Password based recipient info support for CMS library: implementing + RFC3211. + [Steve Henson] + + *) Split password based encryption into PBES2 and PBKDF2 functions. This + neatly separates the code into cipher and PBE sections and is required + for some algorithms that split PBES2 into separate pieces (such as + password based CMS). + [Steve Henson] + + *) Session-handling fixes: + - Fix handling of connections that are resuming with a session ID, + but also support Session Tickets. + - Fix a bug that suppressed issuing of a new ticket if the client + presented a ticket with an expired session. + - Try to set the ticket lifetime hint to something reasonable. + - Make tickets shorter by excluding irrelevant information. + - On the client side, don't ignore renewed tickets. + [Adam Langley, Bodo Moeller (Google)] + + *) Fix PSK session representation. + [Bodo Moeller] + + *) Add RC4-MD5 and AESNI-SHA1 "stitched" implementations. + + This work was sponsored by Intel. + [Andy Polyakov] + + *) Add GCM support to TLS library. Some custom code is needed to split + the IV between the fixed (from PRF) and explicit (from TLS record) + portions. This adds all GCM ciphersuites supported by RFC5288 and + RFC5289. Generalise some AES* cipherstrings to inlclude GCM and + add a special AESGCM string for GCM only. + [Steve Henson] + + *) Expand range of ctrls for AES GCM. Permit setting invocation + field on decrypt and retrieval of invocation field only on encrypt. + [Steve Henson] + + *) Add HMAC ECC ciphersuites from RFC5289. Include SHA384 PRF support. + As required by RFC5289 these ciphersuites cannot be used if for + versions of TLS earlier than 1.2. + [Steve Henson] + + *) For FIPS capable OpenSSL interpret a NULL default public key method + as unset and return the appopriate default but do *not* set the default. + This means we can return the appopriate method in applications that + swicth between FIPS and non-FIPS modes. + [Steve Henson] + + *) Redirect HMAC and CMAC operations to FIPS module in FIPS mode. If an + ENGINE is used then we cannot handle that in the FIPS module so we + keep original code iff non-FIPS operations are allowed. + [Steve Henson] + + *) Add -attime option to openssl utilities. + [Peter Eckersley , Ben Laurie and Steve Henson] + + *) Redirect DSA and DH operations to FIPS module in FIPS mode. + [Steve Henson] + + *) Redirect ECDSA and ECDH operations to FIPS module in FIPS mode. Also use + FIPS EC methods unconditionally for now. + [Steve Henson] + + *) New build option no-ec2m to disable characteristic 2 code. + [Steve Henson] + + *) Backport libcrypto audit of return value checking from 1.1.0-dev; not + all cases can be covered as some introduce binary incompatibilities. + [Steve Henson] + + *) Redirect RSA operations to FIPS module including keygen, + encrypt, decrypt, sign and verify. Block use of non FIPS RSA methods. + [Steve Henson] + + *) Add similar low level API blocking to ciphers. + [Steve Henson] + + *) Low level digest APIs are not approved in FIPS mode: any attempt + to use these will cause a fatal error. Applications that *really* want + to use them can use the private_* version instead. + [Steve Henson] + + *) Redirect cipher operations to FIPS module for FIPS builds. + [Steve Henson] + + *) Redirect digest operations to FIPS module for FIPS builds. + [Steve Henson] + + *) Update build system to add "fips" flag which will link in fipscanister.o + for static and shared library builds embedding a signature if needed. + [Steve Henson] + + *) Output TLS supported curves in preference order instead of numerical + order. This is currently hardcoded for the highest order curves first. + This should be configurable so applications can judge speed vs strength. + [Steve Henson] + + *) Add TLS v1.2 server support for client authentication. + [Steve Henson] + + *) Add support for FIPS mode in ssl library: disable SSLv3, non-FIPS ciphers + and enable MD5. + [Steve Henson] + + *) Functions FIPS_mode_set() and FIPS_mode() which call the underlying + FIPS modules versions. + [Steve Henson] + + *) Add TLS v1.2 client side support for client authentication. Keep cache + of handshake records longer as we don't know the hash algorithm to use + until after the certificate request message is received. + [Steve Henson] + + *) Initial TLS v1.2 client support. Add a default signature algorithms + extension including all the algorithms we support. Parse new signature + format in client key exchange. Relax some ECC signing restrictions for + TLS v1.2 as indicated in RFC5246. + [Steve Henson] + + *) Add server support for TLS v1.2 signature algorithms extension. Switch + to new signature format when needed using client digest preference. + All server ciphersuites should now work correctly in TLS v1.2. No client + support yet and no support for client certificates. + [Steve Henson] + + *) Initial TLS v1.2 support. Add new SHA256 digest to ssl code, switch + to SHA256 for PRF when using TLS v1.2 and later. Add new SHA256 based + ciphersuites. At present only RSA key exchange ciphersuites work with + TLS v1.2. Add new option for TLS v1.2 replacing the old and obsolete + SSL_OP_PKCS1_CHECK flags with SSL_OP_NO_TLSv1_2. New TLSv1.2 methods + and version checking. + [Steve Henson] + + *) New option OPENSSL_NO_SSL_INTERN. If an application can be compiled + with this defined it will not be affected by any changes to ssl internal + structures. Add several utility functions to allow openssl application + to work with OPENSSL_NO_SSL_INTERN defined. + [Steve Henson] + + *) Add SRP support. + [Tom Wu and Ben Laurie] + + *) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id. + [Steve Henson] + + *) Permit abbreviated handshakes when renegotiating using the function + SSL_renegotiate_abbreviated(). + [Robin Seggelmann ] + + *) Add call to ENGINE_register_all_complete() to + ENGINE_load_builtin_engines(), so some implementations get used + automatically instead of needing explicit application support. + [Steve Henson] + + *) Add support for TLS key exporter as described in RFC5705. + [Robin Seggelmann , Steve Henson] + + *) Initial TLSv1.1 support. Since TLSv1.1 is very similar to TLS v1.0 only + a few changes are required: + + Add SSL_OP_NO_TLSv1_1 flag. + Add TLSv1_1 methods. + Update version checking logic to handle version 1.1. + Add explicit IV handling (ported from DTLS code). + Add command line options to s_client/s_server. + [Steve Henson] + + Changes between 1.0.0g and 1.0.0h [12 Mar 2012] *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness in CMS and PKCS7 code. When RSA decryption fails use a random key for @@ -53,7 +375,7 @@ Ivan Nestlerode for discovering this bug. [Steve Henson] - Changes between 0.9.8s and 0.9.8t [18 Jan 2012] + Changes between 1.0.0f and 1.0.0g [18 Jan 2012] *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. Thanks to Antonio Martin, Enterprise Secure Access Research and @@ -61,6 +383,978 @@ preparing a fix. (CVE-2012-0050) [Antonio Martin] + Changes between 1.0.0e and 1.0.0f [4 Jan 2012] + + *) Nadhem Alfardan and Kenny Paterson have discovered an extension + of the Vaudenay padding oracle attack on CBC mode encryption + which enables an efficient plaintext recovery attack against + the OpenSSL implementation of DTLS. Their attack exploits timing + differences arising during decryption processing. A research + paper describing this attack can be found at: + http://www.isg.rhul.ac.uk/~kp/dtls.pdf + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann + and Michael Tuexen + for preparing the fix. (CVE-2011-4108) + [Robin Seggelmann, Michael Tuexen] + + *) Clear bytes used for block padding of SSL 3.0 records. + (CVE-2011-4576) + [Adam Langley (Google)] + + *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George + Kadianakis for discovering this issue and + Adam Langley for preparing the fix. (CVE-2011-4619) + [Adam Langley (Google)] + + *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027) + [Andrey Kulikov ] + + *) Prevent malformed RFC3779 data triggering an assertion failure. + Thanks to Andrew Chi, BBN Technologies, for discovering the flaw + and Rob Austein for fixing it. (CVE-2011-4577) + [Rob Austein ] + + *) Improved PRNG seeding for VOS. + [Paul Green ] + + *) Fix ssl_ciph.c set-up race. + [Adam Langley (Google)] + + *) Fix spurious failures in ecdsatest.c. + [Emilia Käsper (Google)] + + *) Fix the BIO_f_buffer() implementation (which was mixing different + interpretations of the '..._len' fields). + [Adam Langley (Google)] + + *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than + BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent + threads won't reuse the same blinding coefficients. + + This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING + lock to call BN_BLINDING_invert_ex, and avoids one use of + BN_BLINDING_update for each BN_BLINDING structure (previously, + the last update always remained unused). + [Emilia Käsper (Google)] + + *) In ssl3_clear, preserve s3->init_extra along with s3->rbuf. + [Bob Buckholz (Google)] + + Changes between 1.0.0d and 1.0.0e [6 Sep 2011] + + *) Fix bug where CRLs with nextUpdate in the past are sometimes accepted + by initialising X509_STORE_CTX properly. (CVE-2011-3207) + [Kaspar Brand ] + + *) Fix SSL memory handling for (EC)DH ciphersuites, in particular + for multi-threaded use of ECDH. (CVE-2011-3210) + [Adam Langley (Google)] + + *) Fix x509_name_ex_d2i memory leak on bad inputs. + [Bodo Moeller] + + *) Remove hard coded ecdsaWithSHA1 signature tests in ssl code and check + signature public key algorithm by using OID xref utilities instead. + Before this you could only use some ECC ciphersuites with SHA1 only. + [Steve Henson] + + *) Add protection against ECDSA timing attacks as mentioned in the paper + by Billy Bob Brumley and Nicola Tuveri, see: + + http://eprint.iacr.org/2011/232.pdf + + [Billy Bob Brumley and Nicola Tuveri] + + Changes between 1.0.0c and 1.0.0d [8 Feb 2011] + + *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014 + [Neel Mehta, Adam Langley, Bodo Moeller (Google)] + + *) Fix bug in string printing code: if *any* escaping is enabled we must + escape the escape character (backslash) or the resulting string is + ambiguous. + [Steve Henson] + + Changes between 1.0.0b and 1.0.0c [2 Dec 2010] + + *) Disable code workaround for ancient and obsolete Netscape browsers + and servers: an attacker can use it in a ciphersuite downgrade attack. + Thanks to Martin Rex for discovering this bug. CVE-2010-4180 + [Steve Henson] + + *) Fixed J-PAKE implementation error, originally discovered by + Sebastien Martini, further info and confirmation from Stefan + Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252 + [Ben Laurie] + + Changes between 1.0.0a and 1.0.0b [16 Nov 2010] + + *) Fix extension code to avoid race conditions which can result in a buffer + overrun vulnerability: resumed sessions must not be modified as they can + be shared by multiple threads. CVE-2010-3864 + [Steve Henson] + + *) Fix WIN32 build system to correctly link an ENGINE directory into + a DLL. + [Steve Henson] + + Changes between 1.0.0 and 1.0.0a [01 Jun 2010] + + *) Check return value of int_rsa_verify in pkey_rsa_verifyrecover + (CVE-2010-1633) + [Steve Henson, Peter-Michael Hager ] + + Changes between 0.9.8n and 1.0.0 [29 Mar 2010] + + *) Add "missing" function EVP_CIPHER_CTX_copy(). This copies a cipher + context. The operation can be customised via the ctrl mechanism in + case ENGINEs want to include additional functionality. + [Steve Henson] + + *) Tolerate yet another broken PKCS#8 key format: private key value negative. + [Steve Henson] + + *) Add new -subject_hash_old and -issuer_hash_old options to x509 utility to + output hashes compatible with older versions of OpenSSL. + [Willy Weisz ] + + *) Fix compression algorithm handling: if resuming a session use the + compression algorithm of the resumed session instead of determining + it from client hello again. Don't allow server to change algorithm. + [Steve Henson] + + *) Add load_crls() function to apps tidying load_certs() too. Add option + to verify utility to allow additional CRLs to be included. + [Steve Henson] + + *) Update OCSP request code to permit adding custom headers to the request: + some responders need this. + [Steve Henson] + + *) The function EVP_PKEY_sign() returns <=0 on error: check return code + correctly. + [Julia Lawall ] + + *) Update verify callback code in apps/s_cb.c and apps/verify.c, it + needlessly dereferenced structures, used obsolete functions and + didn't handle all updated verify codes correctly. + [Steve Henson] + + *) Disable MD2 in the default configuration. + [Steve Henson] + + *) In BIO_pop() and BIO_push() use the ctrl argument (which was NULL) to + indicate the initial BIO being pushed or popped. This makes it possible + to determine whether the BIO is the one explicitly called or as a result + of the ctrl being passed down the chain. Fix BIO_pop() and SSL BIOs so + it handles reference counts correctly and doesn't zero out the I/O bio + when it is not being explicitly popped. WARNING: applications which + included workarounds for the old buggy behaviour will need to be modified + or they could free up already freed BIOs. + [Steve Henson] + + *) Extend the uni2asc/asc2uni => OPENSSL_uni2asc/OPENSSL_asc2uni + renaming to all platforms (within the 0.9.8 branch, this was + done conditionally on Netware platforms to avoid a name clash). + [Guenter ] + + *) Add ECDHE and PSK support to DTLS. + [Michael Tuexen ] + + *) Add CHECKED_STACK_OF macro to safestack.h, otherwise safestack can't + be used on C++. + [Steve Henson] + + *) Add "missing" function EVP_MD_flags() (without this the only way to + retrieve a digest flags is by accessing the structure directly. Update + EVP_MD_do_all*() and EVP_CIPHER_do_all*() to include the name a digest + or cipher is registered as in the "from" argument. Print out all + registered digests in the dgst usage message instead of manually + attempting to work them out. + [Steve Henson] + + *) If no SSLv2 ciphers are used don't use an SSLv2 compatible client hello: + this allows the use of compression and extensions. Change default cipher + string to remove SSLv2 ciphersuites. This effectively avoids ancient SSLv2 + by default unless an application cipher string requests it. + [Steve Henson] + + *) Alter match criteria in PKCS12_parse(). It used to try to use local + key ids to find matching certificates and keys but some PKCS#12 files + don't follow the (somewhat unwritten) rules and this strategy fails. + Now just gather all certificates together and the first private key + then look for the first certificate that matches the key. + [Steve Henson] + + *) Support use of registered digest and cipher names for dgst and cipher + commands instead of having to add each one as a special case. So now + you can do: + + openssl sha256 foo + + as well as: + + openssl dgst -sha256 foo + + and this works for ENGINE based algorithms too. + + [Steve Henson] + + *) Update Gost ENGINE to support parameter files. + [Victor B. Wagner ] + + *) Support GeneralizedTime in ca utility. + [Oliver Martin , Steve Henson] + + *) Enhance the hash format used for certificate directory links. The new + form uses the canonical encoding (meaning equivalent names will work + even if they aren't identical) and uses SHA1 instead of MD5. This form + is incompatible with the older format and as a result c_rehash should + be used to rebuild symbolic links. + [Steve Henson] + + *) Make PKCS#8 the default write format for private keys, replacing the + traditional format. This form is standardised, more secure and doesn't + include an implicit MD5 dependency. + [Steve Henson] + + *) Add a $gcc_devteam_warn option to Configure. The idea is that any code + committed to OpenSSL should pass this lot as a minimum. + [Steve Henson] + + *) Add session ticket override functionality for use by EAP-FAST. + [Jouni Malinen ] + + *) Modify HMAC functions to return a value. Since these can be implemented + in an ENGINE errors can occur. + [Steve Henson] + + *) Type-checked OBJ_bsearch_ex. + [Ben Laurie] + + *) Type-checked OBJ_bsearch. Also some constification necessitated + by type-checking. Still to come: TXT_DB, bsearch(?), + OBJ_bsearch_ex, qsort, CRYPTO_EX_DATA, ASN1_VALUE, ASN1_STRING, + CONF_VALUE. + [Ben Laurie] + + *) New function OPENSSL_gmtime_adj() to add a specific number of days and + seconds to a tm structure directly, instead of going through OS + specific date routines. This avoids any issues with OS routines such + as the year 2038 bug. New *_adj() functions for ASN1 time structures + and X509_time_adj_ex() to cover the extended range. The existing + X509_time_adj() is still usable and will no longer have any date issues. + [Steve Henson] + + *) Delta CRL support. New use deltas option which will attempt to locate + and search any appropriate delta CRLs available. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for CRLs partitioned by reason code. Reorganise CRL processing + code and add additional score elements. Validate alternate CRL paths + as part of the CRL checking and indicate a new error "CRL path validation + error" in this case. Applications wanting additional details can use + the verify callback and check the new "parent" field. If this is not + NULL CRL path validation is taking place. Existing applications wont + see this because it requires extended CRL support which is off by + default. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for freshest CRL extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Initial indirect CRL support. Currently only supported in the CRLs + passed directly and not via lookup. Process certificate issuer + CRL entry extension and lookup CRL entries by bother issuer name + and serial number. Check and process CRL issuer entry in IDP extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Add support for distinct certificate and CRL paths. The CRL issuer + certificate is validated separately in this case. Only enabled if + an extended CRL support flag is set: this flag will enable additional + CRL functionality in future. + + This work was sponsored by Google. + [Steve Henson] + + *) Add support for policy mappings extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Fixes to pathlength constraint, self issued certificate handling, + policy processing to align with RFC3280 and PKITS tests. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for name constraints certificate extension. DN, email, DNS + and URI types are currently supported. + + This work was sponsored by Google. + [Steve Henson] + + *) To cater for systems that provide a pointer-based thread ID rather + than numeric, deprecate the current numeric thread ID mechanism and + replace it with a structure and associated callback type. This + mechanism allows a numeric "hash" to be extracted from a thread ID in + either case, and on platforms where pointers are larger than 'long', + mixing is done to help ensure the numeric 'hash' is usable even if it + can't be guaranteed unique. The default mechanism is to use "&errno" + as a pointer-based thread ID to distinguish between threads. + + Applications that want to provide their own thread IDs should now use + CRYPTO_THREADID_set_callback() to register a callback that will call + either CRYPTO_THREADID_set_numeric() or CRYPTO_THREADID_set_pointer(). + + Note that ERR_remove_state() is now deprecated, because it is tied + to the assumption that thread IDs are numeric. ERR_remove_state(0) + to free the current thread's error state should be replaced by + ERR_remove_thread_state(NULL). + + (This new approach replaces the functions CRYPTO_set_idptr_callback(), + CRYPTO_get_idptr_callback(), and CRYPTO_thread_idptr() that existed in + OpenSSL 0.9.9-dev between June 2006 and August 2008. Also, if an + application was previously providing a numeric thread callback that + was inappropriate for distinguishing threads, then uniqueness might + have been obtained with &errno that happened immediately in the + intermediate development versions of OpenSSL; this is no longer the + case, the numeric thread callback will now override the automatic use + of &errno.) + [Geoff Thorpe, with help from Bodo Moeller] + + *) Initial support for different CRL issuing certificates. This covers a + simple case where the self issued certificates in the chain exist and + the real CRL issuer is higher in the existing chain. + + This work was sponsored by Google. + [Steve Henson] + + *) Removed effectively defunct crypto/store from the build. + [Ben Laurie] + + *) Revamp of STACK to provide stronger type-checking. Still to come: + TXT_DB, bsearch(?), OBJ_bsearch, qsort, CRYPTO_EX_DATA, ASN1_VALUE, + ASN1_STRING, CONF_VALUE. + [Ben Laurie] + + *) Add a new SSL_MODE_RELEASE_BUFFERS mode flag to release unused buffer + RAM on SSL connections. This option can save about 34k per idle SSL. + [Nick Mathewson] + + *) Revamp of LHASH to provide stronger type-checking. Still to come: + STACK, TXT_DB, bsearch, qsort. + [Ben Laurie] + + *) Initial support for Cryptographic Message Syntax (aka CMS) based + on RFC3850, RFC3851 and RFC3852. New cms directory and cms utility, + support for data, signedData, compressedData, digestedData and + encryptedData, envelopedData types included. Scripts to check against + RFC4134 examples draft and interop and consistency checks of many + content types and variants. + [Steve Henson] + + *) Add options to enc utility to support use of zlib compression BIO. + [Steve Henson] + + *) Extend mk1mf to support importing of options and assembly language + files from Configure script, currently only included in VC-WIN32. + The assembly language rules can now optionally generate the source + files from the associated perl scripts. + [Steve Henson] + + *) Implement remaining functionality needed to support GOST ciphersuites. + Interop testing has been performed using CryptoPro implementations. + [Victor B. Wagner ] + + *) s390x assembler pack. + [Andy Polyakov] + + *) ARMv4 assembler pack. ARMv4 refers to v4 and later ISA, not CPU + "family." + [Andy Polyakov] + + *) Implement Opaque PRF Input TLS extension as specified in + draft-rescorla-tls-opaque-prf-input-00.txt. Since this is not an + official specification yet and no extension type assignment by + IANA exists, this extension (for now) will have to be explicitly + enabled when building OpenSSL by providing the extension number + to use. For example, specify an option + + -DTLSEXT_TYPE_opaque_prf_input=0x9527 + + to the "config" or "Configure" script to enable the extension, + assuming extension number 0x9527 (which is a completely arbitrary + and unofficial assignment based on the MD5 hash of the Internet + Draft). Note that by doing so, you potentially lose + interoperability with other TLS implementations since these might + be using the same extension number for other purposes. + + SSL_set_tlsext_opaque_prf_input(ssl, src, len) is used to set the + opaque PRF input value to use in the handshake. This will create + an interal copy of the length-'len' string at 'src', and will + return non-zero for success. + + To get more control and flexibility, provide a callback function + by using + + SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) + SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) + + where + + int (*cb)(SSL *, void *peerinput, size_t len, void *arg); + void *arg; + + Callback function 'cb' will be called in handshakes, and is + expected to use SSL_set_tlsext_opaque_prf_input() as appropriate. + Argument 'arg' is for application purposes (the value as given to + SSL_CTX_set_tlsext_opaque_prf_input_callback_arg() will directly + be provided to the callback function). The callback function + has to return non-zero to report success: usually 1 to use opaque + PRF input just if possible, or 2 to enforce use of the opaque PRF + input. In the latter case, the library will abort the handshake + if opaque PRF input is not successfully negotiated. + + Arguments 'peerinput' and 'len' given to the callback function + will always be NULL and 0 in the case of a client. A server will + see the client's opaque PRF input through these variables if + available (NULL and 0 otherwise). Note that if the server + provides an opaque PRF input, the length must be the same as the + length of the client's opaque PRF input. + + Note that the callback function will only be called when creating + a new session (session resumption can resume whatever was + previously negotiated), and will not be called in SSL 2.0 + handshakes; thus, SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) or + SSL_set_options(ssl, SSL_OP_NO_SSLv2) is especially recommended + for applications that need to enforce opaque PRF input. + + [Bodo Moeller] + + *) Update ssl code to support digests other than SHA1+MD5 for handshake + MAC. + + [Victor B. Wagner ] + + *) Add RFC4507 support to OpenSSL. This includes the corrections in + RFC4507bis. The encrypted ticket format is an encrypted encoded + SSL_SESSION structure, that way new session features are automatically + supported. + + If a client application caches session in an SSL_SESSION structure + support is transparent because tickets are now stored in the encoded + SSL_SESSION. + + The SSL_CTX structure automatically generates keys for ticket + protection in servers so again support should be possible + with no application modification. + + If a client or server wishes to disable RFC4507 support then the option + SSL_OP_NO_TICKET can be set. + + Add a TLS extension debugging callback to allow the contents of any client + or server extensions to be examined. + + This work was sponsored by Google. + [Steve Henson] + + *) Final changes to avoid use of pointer pointer casts in OpenSSL. + OpenSSL should now compile cleanly on gcc 4.2 + [Peter Hartley , Steve Henson] + + *) Update SSL library to use new EVP_PKEY MAC API. Include generic MAC + support including streaming MAC support: this is required for GOST + ciphersuite support. + [Victor B. Wagner , Steve Henson] + + *) Add option -stream to use PKCS#7 streaming in smime utility. New + function i2d_PKCS7_bio_stream() and PEM_write_PKCS7_bio_stream() + to output in BER and PEM format. + [Steve Henson] + + *) Experimental support for use of HMAC via EVP_PKEY interface. This + allows HMAC to be handled via the EVP_DigestSign*() interface. The + EVP_PKEY "key" in this case is the HMAC key, potentially allowing + ENGINE support for HMAC keys which are unextractable. New -mac and + -macopt options to dgst utility. + [Steve Henson] + + *) New option -sigopt to dgst utility. Update dgst to use + EVP_Digest{Sign,Verify}*. These two changes make it possible to use + alternative signing paramaters such as X9.31 or PSS in the dgst + utility. + [Steve Henson] + + *) Change ssl_cipher_apply_rule(), the internal function that does + the work each time a ciphersuite string requests enabling + ("foo+bar"), moving ("+foo+bar"), disabling ("-foo+bar", or + removing ("!foo+bar") a class of ciphersuites: Now it maintains + the order of disabled ciphersuites such that those ciphersuites + that most recently went from enabled to disabled not only stay + in order with respect to each other, but also have higher priority + than other disabled ciphersuites the next time ciphersuites are + enabled again. + + This means that you can now say, e.g., "PSK:-PSK:HIGH" to enable + the same ciphersuites as with "HIGH" alone, but in a specific + order where the PSK ciphersuites come first (since they are the + most recently disabled ciphersuites when "HIGH" is parsed). + + Also, change ssl_create_cipher_list() (using this new + funcionality) such that between otherwise identical + cihpersuites, ephemeral ECDH is preferred over ephemeral DH in + the default order. + [Bodo Moeller] + + *) Change ssl_create_cipher_list() so that it automatically + arranges the ciphersuites in reasonable order before starting + to process the rule string. Thus, the definition for "DEFAULT" + (SSL_DEFAULT_CIPHER_LIST) now is just "ALL:!aNULL:!eNULL", but + remains equivalent to "AES:ALL:!aNULL:!eNULL:+aECDH:+kRSA:+RC4:@STRENGTH". + This makes it much easier to arrive at a reasonable default order + in applications for which anonymous ciphers are OK (meaning + that you can't actually use DEFAULT). + [Bodo Moeller; suggested by Victor Duchovni] + + *) Split the SSL/TLS algorithm mask (as used for ciphersuite string + processing) into multiple integers instead of setting + "SSL_MKEY_MASK" bits, "SSL_AUTH_MASK" bits, "SSL_ENC_MASK", + "SSL_MAC_MASK", and "SSL_SSL_MASK" bits all in a single integer. + (These masks as well as the individual bit definitions are hidden + away into the non-exported interface ssl/ssl_locl.h, so this + change to the definition of the SSL_CIPHER structure shouldn't + affect applications.) This give us more bits for each of these + categories, so there is no longer a need to coagulate AES128 and + AES256 into a single algorithm bit, and to coagulate Camellia128 + and Camellia256 into a single algorithm bit, which has led to all + kinds of kludges. + + Thus, among other things, the kludge introduced in 0.9.7m and + 0.9.8e for masking out AES256 independently of AES128 or masking + out Camellia256 independently of AES256 is not needed here in 0.9.9. + + With the change, we also introduce new ciphersuite aliases that + so far were missing: "AES128", "AES256", "CAMELLIA128", and + "CAMELLIA256". + [Bodo Moeller] + + *) Add support for dsa-with-SHA224 and dsa-with-SHA256. + Use the leftmost N bytes of the signature input if the input is + larger than the prime q (with N being the size in bytes of q). + [Nils Larsch] + + *) Very *very* experimental PKCS#7 streaming encoder support. Nothing uses + it yet and it is largely untested. + [Steve Henson] + + *) Add support for the ecdsa-with-SHA224/256/384/512 signature types. + [Nils Larsch] + + *) Initial incomplete changes to avoid need for function casts in OpenSSL + some compilers (gcc 4.2 and later) reject their use. Safestack is + reimplemented. Update ASN1 to avoid use of legacy functions. + [Steve Henson] + + *) Win32/64 targets are linked with Winsock2. + [Andy Polyakov] + + *) Add an X509_CRL_METHOD structure to allow CRL processing to be redirected + to external functions. This can be used to increase CRL handling + efficiency especially when CRLs are very large by (for example) storing + the CRL revoked certificates in a database. + [Steve Henson] + + *) Overhaul of by_dir code. Add support for dynamic loading of CRLs so + new CRLs added to a directory can be used. New command line option + -verify_return_error to s_client and s_server. This causes real errors + to be returned by the verify callback instead of carrying on no matter + what. This reflects the way a "real world" verify callback would behave. + [Steve Henson] + + *) GOST engine, supporting several GOST algorithms and public key formats. + Kindly donated by Cryptocom. + [Cryptocom] + + *) Partial support for Issuing Distribution Point CRL extension. CRLs + partitioned by DP are handled but no indirect CRL or reason partitioning + (yet). Complete overhaul of CRL handling: now the most suitable CRL is + selected via a scoring technique which handles IDP and AKID in CRLs. + [Steve Henson] + + *) New X509_STORE_CTX callbacks lookup_crls() and lookup_certs() which + will ultimately be used for all verify operations: this will remove the + X509_STORE dependency on certificate verification and allow alternative + lookup methods. X509_STORE based implementations of these two callbacks. + [Steve Henson] + + *) Allow multiple CRLs to exist in an X509_STORE with matching issuer names. + Modify get_crl() to find a valid (unexpired) CRL if possible. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jul 11 23:32:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2D8E1065670; Wed, 11 Jul 2012 23:32:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39CE8FC12; Wed, 11 Jul 2012 23:32: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 q6BNWUOC071574; Wed, 11 Jul 2012 23:32:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6BNWUe8071573; Wed, 11 Jul 2012 23:32:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207112332.q6BNWUe8071573@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jul 2012 23:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238385 - vendor-crypto/openssl/1.0.1c X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 23:32:31 -0000 Author: jkim Date: Wed Jul 11 23:32:30 2012 New Revision: 238385 URL: http://svn.freebsd.org/changeset/base/238385 Log: Tag OpenSSL 1.0.1c. Added: vendor-crypto/openssl/1.0.1c/ - copied from r238384, vendor-crypto/openssl/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 02:58:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5962B106564A; Thu, 12 Jul 2012 02:58:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F768FC08; Thu, 12 Jul 2012 02:58:46 +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 q6C2wkZp080642; Thu, 12 Jul 2012 02:58:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6C2wjZA080635; Thu, 12 Jul 2012 02:58:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207120258.q6C2wjZA080635@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 02:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238389 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 02:58:46 -0000 Author: imp Date: Thu Jul 12 02:58:45 2012 New Revision: 238389 URL: http://svn.freebsd.org/changeset/base/238389 Log: Export the interrupt status vector via soc_data. Set the interrupt priorities in the AIC in the atmelarm driver before attaching the children. Delete redunant copies of the code. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91.c Thu Jul 12 02:58:45 2012 (r238389) @@ -247,10 +247,12 @@ at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); const struct pmap_devmap *pdevmap; + int i; at91_softc = sc; sc->sc_st = &at91_bs_tag; sc->sc_sh = AT91_BASE; + sc->sc_aic_sh = AT91_BASE + AT91_SYS_BASE; sc->dev = dev; sc->sc_irq_rman.rm_type = RMAN_ARRAY; @@ -269,13 +271,35 @@ at91_attach(device_t dev) panic("at91_attach: failed to set up memory rman"); } + /* + * Setup the interrupt table. + */ + if (soc_info.soc_data == NULL || soc_info.soc_data->soc_irq_prio == NULL) + panic("Interrupt priority table missing\n"); + for (i = 0; i < 32; i++) { + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + + i * 4, i); + /* Priority. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, + soc_info.soc_data->soc_irq_prio[i]); + if (i < 8) + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, + 1); + } + + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); + /* No debug. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); + /* Disable and clear all interrupts. */ + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); /* - * Our device list will be added automatically by the cpu device + * Our device list will be added automatically by the cpu device * e.g. at91rm9200.c when it is identified. To ensure that the * CPU and PMC are attached first any other "identified" devices * call BUS_ADD_CHILD(9) with an "order" of at least 2. - */ + */ bus_generic_probe(dev); bus_generic_attach(dev); Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91rm9200.c Thu Jul 12 02:58:45 2012 (r238389) @@ -183,8 +183,6 @@ at91_attach(device_t dev) { struct at91_pmc_clock *clk; struct at91rm92_softc *sc = device_get_softc(dev); - int i; - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); sc->sc_st = at91sc->sc_st; @@ -195,31 +193,6 @@ at91_attach(device_t dev) AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE, - AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0) - panic("Enable to map system registers"); - - /* XXX Hack to tell atmelarm about the AIC */ - at91sc->sc_aic_sh = sc->sc_aic_sh; - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - at91_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Disable all interrupts for RTC (0xe24 == RTC_IDR) */ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff); @@ -283,7 +256,8 @@ DRIVER_MODULE(at91rm920, atmelarm, at91r static struct at91_soc_data soc_data = { .soc_delay = at91_st_delay, - .soc_reset = at91_st_cpu_reset + .soc_reset = at91_st_cpu_reset, + .soc_irq_prio = at91_irq_prio, }; AT91_SOC(AT91_T_RM9200, &soc_data); Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91sam9260.c Thu Jul 12 02:58:45 2012 (r238389) @@ -51,8 +51,6 @@ struct at91sam9_softc { device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; - bus_space_handle_t sc_sys_sh; - bus_space_handle_t sc_aic_sh; bus_space_handle_t sc_matrix_sh; }; @@ -184,43 +182,13 @@ at91_attach(device_t dev) { struct at91_pmc_clock *clk; struct at91sam9_softc *sc = device_get_softc(dev); - int i; - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); + uint32_t i; sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_SYS_BASE, - AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map system registers"); - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE, - AT91SAM9260_AIC_SIZE, &sc->sc_aic_sh) != 0) - panic("Enable to map system registers"); - - /* XXX Hack to tell atmelarm about the AIC */ - at91sc->sc_aic_sh = sc->sc_aic_sh; - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - at91_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) @@ -299,7 +267,8 @@ DRIVER_MODULE(at91sam9260, atmelarm, at9 static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, - .soc_reset = at91_rst_cpu_reset + .soc_reset = at91_rst_cpu_reset, + .soc_irq_prio = at91_irq_prio, }; AT91_SOC(AT91_T_SAM9260, &soc_data); Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91sam9g20.c Thu Jul 12 02:58:45 2012 (r238389) @@ -51,8 +51,6 @@ struct at91sam9_softc { device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; - bus_space_handle_t sc_sys_sh; - bus_space_handle_t sc_aic_sh; bus_space_handle_t sc_matrix_sh; }; @@ -191,47 +189,13 @@ at91_attach(device_t dev) { struct at91_pmc_clock *clk; struct at91sam9_softc *sc = device_get_softc(dev); - int i; - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); + uint32_t i; sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* - * XXX These values work for the RM9200, SAM926[01], and SAM9G20 - * will have to fix this when we want to support anything else. XXX - */ - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_SYS_BASE, - AT91SAM9G20_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map system registers"); - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, - AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) - panic("Enable to map system registers"); - - /* XXX Hack to tell atmelarm about the AIC */ - at91sc->sc_aic_sh = sc->sc_aic_sh; - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - at91_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, &sc->sc_matrix_sh) != 0) @@ -301,7 +265,8 @@ DRIVER_MODULE(at91sam, atmelarm, at91sam static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, - .soc_reset = at91_rst_cpu_reset + .soc_reset = at91_rst_cpu_reset, + .soc_irq_prio = at91_irq_prio, }; AT91_SOC(AT91_T_SAM9G20, &soc_data); Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91sam9x25.c Thu Jul 12 02:58:45 2012 (r238389) @@ -51,8 +51,6 @@ struct at91sam9x25_softc { device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; - bus_space_handle_t sc_sys_sh; - bus_space_handle_t sc_aic_sh; }; /* @@ -193,47 +191,12 @@ at91_attach(device_t dev) { struct at91_pmc_clock *clk; struct at91sam9x25_softc *sc = device_get_softc(dev); - int i; - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* - * XXX These values work for the RM9200, SAM926[01], and SAM9X25 - * will have to fix this when we want to support anything else. XXX - */ - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_SYS_BASE, - AT91SAM9X25_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map system registers"); - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE, - AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0) - panic("Enable to map system registers"); - - /* XXX Hack to tell atmelarm about the AIC */ - at91sc->sc_aic_sh = sc->sc_aic_sh; - - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - at91_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP_SAM9; @@ -290,7 +253,8 @@ DRIVER_MODULE(at91sam9x25, atmelarm, at9 static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, - .soc_reset = at91_rst_cpu_reset + .soc_reset = at91_rst_cpu_reset, + .soc_irq_prio = at91_irq_prio, }; AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Thu Jul 12 02:15:06 2012 (r238388) +++ head/sys/arm/at91/at91var.h Thu Jul 12 02:58:45 2012 (r238389) @@ -108,6 +108,7 @@ typedef void (*cpu_reset_t)(void); struct at91_soc_data { DELAY_t soc_delay; cpu_reset_t soc_reset; + const int *soc_irq_prio; }; struct at91_soc_info { From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 04:23:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B09C41065670; Thu, 12 Jul 2012 04:23:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999258FC0A; Thu, 12 Jul 2012 04:23: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 q6C4NCc6084400; Thu, 12 Jul 2012 04:23:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6C4NCRB084393; Thu, 12 Jul 2012 04:23:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207120423.q6C4NCRB084393@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 04:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238390 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 04:23:12 -0000 Author: imp Date: Thu Jul 12 04:23:11 2012 New Revision: 238390 URL: http://svn.freebsd.org/changeset/base/238390 Log: Create the children devices for the SoC in atmelarm bus node, not in the identify routine of the CPU. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91.c Thu Jul 12 04:23:11 2012 (r238390) @@ -242,6 +242,18 @@ at91_identify(driver_t *drv, device_t pa BUS_ADD_CHILD(parent, 0, "atmelarm", 0); } +static void +at91_cpu_add_builtin_children(device_t dev, const struct cpu_devs *walker) +{ + int i; + + for (i = 1; walker->name; i++, walker++) { + at91_add_child(dev, i, walker->name, walker->unit, + walker->mem_base, walker->mem_len, walker->irq0, + walker->irq1, walker->irq2); + } +} + static int at91_attach(device_t dev) { @@ -294,12 +306,10 @@ at91_attach(device_t dev) bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* - * Our device list will be added automatically by the cpu device - * e.g. at91rm9200.c when it is identified. To ensure that the - * CPU and PMC are attached first any other "identified" devices - * call BUS_ADD_CHILD(9) with an "order" of at least 2. - */ + /* + * Add this device's children... + */ + at91_cpu_add_builtin_children(dev, soc_info.soc_data->soc_children); bus_generic_probe(dev); bus_generic_attach(dev); Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91rm9200.c Thu Jul 12 04:23:11 2012 (r238390) @@ -137,19 +137,6 @@ static const struct cpu_devs at91_devs[] { 0, 0, 0, 0, 0 } }; -static void -at91_cpu_add_builtin_children(device_t dev) -{ - int i; - const struct cpu_devs *walker; - - for (i = 1, walker = at91_devs; walker->name; i++, walker++) { - at91_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq0, - walker->irq1, walker->irq2); - } -} - static uint32_t at91_pll_outb(int freq) { @@ -164,10 +151,8 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_T_RM9200)) { + if (at91_cpu_is(AT91_T_RM9200)) at91_add_child(parent, 0, "at91rm920", 0, 0, 0, -1, 0, 0); - at91_cpu_add_builtin_children(parent); - } } static int @@ -258,6 +243,7 @@ static struct at91_soc_data soc_data = { .soc_delay = at91_st_delay, .soc_reset = at91_st_cpu_reset, .soc_irq_prio = at91_irq_prio, + .soc_children = at91_devs, }; AT91_SOC(AT91_T_RM9200, &soc_data); Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91sam9260.c Thu Jul 12 04:23:11 2012 (r238390) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include struct at91sam9_softc { - device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; bus_space_handle_t sc_matrix_sh; @@ -129,19 +128,6 @@ static const struct cpu_devs at91_devs[] { 0, 0, 0, 0, 0 } }; -static void -at91_cpu_add_builtin_children(device_t dev) -{ - int i; - const struct cpu_devs *walker; - - for (i = 1, walker = at91_devs; walker->name; i++, walker++) { - at91_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq0, - walker->irq1, walker->irq2); - } -} - static uint32_t at91_pll_outa(int freq) { @@ -163,10 +149,8 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (soc_info.type == AT91_T_SAM9260) { + if (soc_info.type == AT91_T_SAM9260) at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); - at91_cpu_add_builtin_children(parent); - } } static int @@ -187,7 +171,6 @@ at91_attach(device_t dev) sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; - sc->dev = dev; if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, @@ -269,6 +252,7 @@ static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, .soc_irq_prio = at91_irq_prio, + .soc_children = at91_devs, }; AT91_SOC(AT91_T_SAM9260, &soc_data); Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91sam9g20.c Thu Jul 12 04:23:11 2012 (r238390) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include struct at91sam9_softc { - device_t dev; bus_space_tag_t sc_st; bus_space_handle_t sc_sh; bus_space_handle_t sc_matrix_sh; @@ -129,19 +128,6 @@ static const struct cpu_devs at91_devs[] { 0, 0, 0, 0, 0 } }; -static void -at91_cpu_add_builtin_children(device_t dev) -{ - int i; - const struct cpu_devs *walker; - - for (i = 1, walker = at91_devs; walker->name; i++, walker++) { - at91_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq0, - walker->irq1, walker->irq2); - } -} - static uint32_t at91_pll_outa(int freq) { @@ -170,10 +156,8 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_T_SAM9G20)) { + if (at91_cpu_is(AT91_T_SAM9G20)) at91_add_child(parent, 0, "at91sam", 9, 0, 0, -1, 0, 0); - at91_cpu_add_builtin_children(parent); - } } static int @@ -194,7 +178,6 @@ at91_attach(device_t dev) sc->sc_st = at91sc->sc_st; sc->sc_sh = at91sc->sc_sh; - sc->dev = dev; if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, @@ -267,6 +250,7 @@ static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, .soc_irq_prio = at91_irq_prio, + .soc_childpren = at91_devs, }; AT91_SOC(AT91_T_SAM9G20, &soc_data); Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91sam9x25.c Thu Jul 12 04:23:11 2012 (r238390) @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); #include struct at91sam9x25_softc { - device_t dev; - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; + int filler; }; /* @@ -131,19 +129,6 @@ static const struct cpu_devs at91_devs[] { 0, 0, 0, 0, 0 } }; -static void -at91_cpu_add_builtin_children(device_t dev) -{ - int i; - const struct cpu_devs *walker; - - for (i = 1, walker = at91_devs; walker->name; i++, walker++) { - at91_add_child(dev, i, walker->name, walker->unit, - walker->mem_base, walker->mem_len, walker->irq0, - walker->irq1, walker->irq2); - } -} - static uint32_t at91_pll_outa(int freq) { @@ -172,10 +157,8 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (soc_info.type == AT91_T_SAM9X5 && soc_info.subtype == AT91_ST_SAM9X25) { + if (soc_info.type == AT91_T_SAM9X5 && soc_info.subtype == AT91_ST_SAM9X25) at91_add_child(parent, 0, "at91sam9x25", 0, 0, 0, -1, 0, 0); - at91_cpu_add_builtin_children(parent); - } } static int @@ -190,12 +173,6 @@ static int at91_attach(device_t dev) { struct at91_pmc_clock *clk; - struct at91sam9x25_softc *sc = device_get_softc(dev); - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); - - sc->sc_st = at91sc->sc_st; - sc->sc_sh = at91sc->sc_sh; - sc->dev = dev; /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); @@ -255,6 +232,7 @@ static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, .soc_irq_prio = at91_irq_prio, + .soc_childpren = at91_devs, }; AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Thu Jul 12 02:58:45 2012 (r238389) +++ head/sys/arm/at91/at91var.h Thu Jul 12 04:23:11 2012 (r238390) @@ -109,6 +109,7 @@ struct at91_soc_data { DELAY_t soc_delay; cpu_reset_t soc_reset; const int *soc_irq_prio; + const struct cpu_devs *soc_children; }; struct at91_soc_info { From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 06:29:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E68106564A; Thu, 12 Jul 2012 06:29:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 539908FC16; Thu, 12 Jul 2012 06:29: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 q6C6TtvW090339; Thu, 12 Jul 2012 06:29:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6C6TtOa090337; Thu, 12 Jul 2012 06:29:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207120629.q6C6TtOa090337@svn.freebsd.org> From: Martin Matuska Date: Thu, 12 Jul 2012 06:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238391 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 06:29:55 -0000 Author: mm Date: Thu Jul 12 06:29:54 2012 New Revision: 238391 URL: http://svn.freebsd.org/changeset/base/238391 Log: Change behavior introduced in r237119 to vendor solution References: https://www.illumos.org/issues/2883 PR: 167905 Obtained from: illumos (issue #2883) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Jul 12 04:23:11 2012 (r238390) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Jul 12 06:29:54 2012 (r238391) @@ -1484,14 +1484,17 @@ zfs_prop_set(zfs_handle_t *zhp, const ch } /* - * If the dataset's canmount property is being set to noauto, - * or being set to on and the dataset is already mounted, - * then we want to prevent unmounting & remounting it. - */ - do_prefix = !((prop == ZFS_PROP_CANMOUNT) && - (zprop_string_to_index(prop, propval, &idx, - ZFS_TYPE_DATASET) == 0) && (idx == ZFS_CANMOUNT_NOAUTO || - (idx == ZFS_CANMOUNT_ON && zfs_is_mounted(zhp, NULL)))); + * We don't want to unmount & remount the dataset when changing + * its canmount property to 'on' or 'noauto'. We only use + * the changelist logic to unmount when setting canmount=off. + */ + if (prop == ZFS_PROP_CANMOUNT) { + uint64_t idx; + int err = zprop_string_to_index(prop, propval, &idx, + ZFS_TYPE_DATASET); + if (err == 0 && idx != ZFS_CANMOUNT_OFF) + do_prefix = B_FALSE; + } if (do_prefix && (ret = changelist_prefix(cl)) != 0) goto error; From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 06:43:42 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1A2F106566B; Thu, 12 Jul 2012 06:43:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 845838FC0A; Thu, 12 Jul 2012 06:43:41 +0000 (UTC) Received: from alph.allbsd.org (p2214-ipbf2707funabasi.chiba.ocn.ne.jp [123.225.119.214]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id q6C6hIr8051633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jul 2012 15:43:31 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id q6C6hFbj007308; Thu, 12 Jul 2012 15:43:16 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 12 Jul 2012 15:43:09 +0900 (JST) Message-Id: <20120712.154309.1565855047300110662.hrs@allbsd.org> To: thompsa@FreeBSD.org From: Hiroki Sato In-Reply-To: References: <20120711195341.GK3599@albert.catwhisker.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Thu_Jul_12_15_43_09_2012_012)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Thu, 12 Jul 2012 15:43:33 +0900 (JST) X-Spam-Status: No, score=-96.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT, RCVD_IN_RP_RNBL, SAMEHELOBY2HOP, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: adrian@FreeBSD.org, src-committers@FreeBSD.org, current@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, david@catwhisker.org Subject: Re: svn commit: r238361 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 06:43:42 -0000 ----Security_Multipart(Thu_Jul_12_15_43_09_2012_012)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Andrew Thompson wrote in : th> On 12 July 2012 10:15, Adrian Chadd wrote: th> > Again, that just touched usb. So, how'd that affect non-USB wifi cloning? th> th> I guess cloning is first match wins and usb was incorrectly matching wlan* Yes, a greedier ifname matching rule can unintentionally win regardless of the interface type. -- Hiroki ----Security_Multipart(Thu_Jul_12_15_43_09_2012_012)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk/+cf0ACgkQTyzT2CeTzy2LDwCgozmSWQ9KbUr/eh78FBazNZRt d4oAn0jGZuXDJn2kAGqYzdPPSSPHIz3G =PXUn -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Jul_12_15_43_09_2012_012)---- From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 07:34:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC4FE106564A; Thu, 12 Jul 2012 07:34:09 +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 A86088FC0A; Thu, 12 Jul 2012 07:34: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 q6C7Y9cR093040; Thu, 12 Jul 2012 07:34:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6C7Y9FN093038; Thu, 12 Jul 2012 07:34:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207120734.q6C7Y9FN093038@svn.freebsd.org> From: Christian Brueffer Date: Thu, 12 Jul 2012 07:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238392 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 07:34:09 -0000 Author: brueffer Date: Thu Jul 12 07:34:09 2012 New Revision: 238392 URL: http://svn.freebsd.org/changeset/base/238392 Log: Document the sysctl/tunable changes in r238379 and r238382. Suggested by: mjacob Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jul 12 06:29:54 2012 (r238391) +++ head/UPDATING Thu Jul 12 07:34:09 2012 (r238392) @@ -24,6 +24,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120712: + The following sysctls and tunables have been renamed for consistency + with other variables: + kern.cam.da.da_send_ordered -> kern.cam.da.send_ordered + kern.cam.ada.ada_send_ordered -> kern.cam.ada.send_ordered + 20120628: The sort utility has been replaced with BSD sort. For now, GNU sort is also available as "gnusort" or the default can be set back to From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 07:34:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD42106566C; Thu, 12 Jul 2012 07:34:59 +0000 (UTC) (envelope-from SRS0=T1ve=FN=FreeBSD.org=brueffer@srs.kundenserver.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id F23778FC0A; Thu, 12 Jul 2012 07:34:58 +0000 (UTC) Received: from hd948344f.sedadby.dyn.perspektivbredband.net (hd948344f.sedadby.dyn.perspektivbredband.net [217.72.52.79]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MKMjK-1SnZEV2eAA-001fsT; Thu, 12 Jul 2012 09:34:58 +0200 Message-ID: <4FFE7E24.9060603@FreeBSD.org> Date: Thu, 12 Jul 2012 09:35:00 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201207112322.q6BNM95G071020@svn.freebsd.org> In-Reply-To: <201207112322.q6BNM95G071020@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:KOzRvOJX8YlrzpsSnFC5DDiJReuVIqliStW0tI77j1P 3OSueC/YU5zIlm5cWdK5S968r1uRlpHtw+IRxhwu/7taLuCkrX SlWsbGEo2ISFj24qrzmt84W9cyawIGyWMEBZhJ1NOA8/lrUt2y u9NLDL6F59zWM7PZbHoID5r8se4i+b9fVNsT4O6QJx7Oi7Jj4m tWpa5e9MAY9ICVTApk4W6uNmwVr4xFdspkV0CmdZpDJRd1mxGQ 6LFdHE1UQX11vmpdjr61eJYPJoZ1rh6FCvpJxA+h3xw65uoVXJ FDwDHHrMJVYYODHP/AUMuC1Z23eZfqN8Yobc7mxZTSSEicm/8x 9gyr+UcOUT5ESTr99rmlGzhVHdFKV8hSbuxz1kGofXsP+Dp1hN 3xXmylV+ClYKg== Cc: Subject: Re: svn commit: r238382 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 07:34:59 -0000 On 7/12/12 1:22 , Christian Brueffer wrote: > Author: brueffer > Date: Wed Jul 11 23:22:09 2012 > New Revision: 238382 > URL: http://svn.freebsd.org/changeset/base/238382 > > Log: > Apply similar same change as in r238379: > > Renamed the kern.cam.ada.ada_send_ordered sysctl and tunable to > kern.cam.ada.send_ordered, more in line with the other da sysctls/tunables. > > Suggested by: kib Sorry, this should have said mav, not kib. Chris From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 10:09:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EA931065672; Thu, 12 Jul 2012 10:09:35 +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 F3D858FC1E; Thu, 12 Jul 2012 10:09:34 +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 q6CA9Yhi099451; Thu, 12 Jul 2012 10:09:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CA9YaN099448; Thu, 12 Jul 2012 10:09:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207121009.q6CA9YaN099448@svn.freebsd.org> From: Christian Brueffer Date: Thu, 12 Jul 2012 10:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238393 - in head/sys: cam/ata sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 10:09:35 -0000 Author: brueffer Date: Thu Jul 12 10:09:34 2012 New Revision: 238393 URL: http://svn.freebsd.org/changeset/base/238393 Log: Add and utilize defines for the ATA device register. PR: 169764 Submitted by: Steven Hartland Reviewed by: mav MFC after: 2 weeks Modified: head/sys/cam/ata/ata_all.c head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Thu Jul 12 07:34:09 2012 (r238392) +++ head/sys/cam/ata/ata_all.c Thu Jul 12 10:09:34 2012 (r238393) @@ -359,7 +359,7 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40 | ((lba >> 24) & 0x0f); + ataio->cmd.device = ATA_DEV_LBA | ((lba >> 24) & 0x0f); ataio->cmd.sector_count = sector_count; } @@ -384,7 +384,7 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; @@ -404,7 +404,7 @@ ata_ncq_cmd(struct ccb_ataio *ataio, uin ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Jul 12 07:34:09 2012 (r238392) +++ head/sys/sys/ata.h Thu Jul 12 10:09:34 2012 (r238393) @@ -261,6 +261,20 @@ struct ata_params { /*255*/ u_int16_t integrity; } __packed; +/* + * ATA Device Register + * + * bit 7 Obsolete (was 1 in early ATA specs) + * bit 6 Sets LBA/CHS mode. 1=LBA, 0=CHS + * bit 5 Obsolete (was 1 in early ATA specs) + * bit 4 1 = Slave Drive, 0 = Master Drive + * bit 3-0 In LBA mode, 27-24 of address. In CHS mode, head number +*/ + +#define ATA_DEV_MASTER 0x00 +#define ATA_DEV_SLAVE 0x10 +#define ATA_DEV_LBA 0x40 + /* ATA transfer modes */ #define ATA_MODE_MASK 0x0f From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 12:11:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B16EE1065675; Thu, 12 Jul 2012 12:11:32 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C56C8FC0C; Thu, 12 Jul 2012 12:11: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 q6CCBWlh006486; Thu, 12 Jul 2012 12:11:32 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CCBWTD006484; Thu, 12 Jul 2012 12:11:32 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207121211.q6CCBWTD006484@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 12 Jul 2012 12:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238396 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 12:11:32 -0000 Author: gavin Date: Thu Jul 12 12:11:32 2012 New Revision: 238396 URL: http://svn.freebsd.org/changeset/base/238396 Log: Update for new core team. Looks like this file was not updated two years ago for the last core team. MFC after: 3 days Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Jul 12 11:02:57 2012 (r238395) +++ head/share/misc/organization.dot Thu Jul 12 12:11:32 2012 (r238396) @@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted -core [label="Core Team\ncore@FreeBSD.org\nwilko, brooks, keramida, imp,\ngnn, wes, hrs, murray,\nrwatson"] +core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, attilio, hrs,\npeter, miwi"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\ngavin"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 12:35:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2503106566B; Thu, 12 Jul 2012 12:35:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 90B538FC17; Thu, 12 Jul 2012 12:35:04 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E2510B926; Thu, 12 Jul 2012 08:35:03 -0400 (EDT) From: John Baldwin To: Adrian Chadd Date: Thu, 12 Jul 2012 07:42:58 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207111210.q6BCAEFk042562@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207120742.58379.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 Jul 2012 08:35:04 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238364 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 12:35:04 -0000 On Wednesday, July 11, 2012 6:17:07 pm Adrian Chadd wrote: > .. hm, interesting. I didn't catch this. The tinderbox was complaining for over a day. A make tinderbox showed these errors as well. > Maybe I should whack the ATH_KTR_* things outside of the #ifdef ATH_DEBUG .. ? Feel free to fix it that way if you wish. I had guessed as to what you wanted to happen since you had moved them inside ATH_DEBUG. My goal was to get universe building again. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 13:45:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7925E1065792; Thu, 12 Jul 2012 13:45:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592D68FC1C; Thu, 12 Jul 2012 13:45:59 +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 q6CDjxpk010391; Thu, 12 Jul 2012 13:45:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CDjxQK010384; Thu, 12 Jul 2012 13:45:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207121345.q6CDjxQK010384@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 13:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238397 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 13:45:59 -0000 Author: imp Date: Thu Jul 12 13:45:58 2012 New Revision: 238397 URL: http://svn.freebsd.org/changeset/base/238397 Log: Complete the transition away from newbus to populate the children to the linker set of CPU modules. The newbus method, although clever, had many flaws: it didn't really support multiple SoC, many of the comments about order were just wrong, and it did a few things far too late to be useful. delay and cpu_reset now work much earlier in the boot process. Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9x25.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91.c Thu Jul 12 13:45:58 2012 (r238397) @@ -310,6 +310,7 @@ at91_attach(device_t dev) * Add this device's children... */ at91_cpu_add_builtin_children(dev, soc_info.soc_data->soc_children); + soc_info.soc_data->soc_clock_init(); bus_generic_probe(dev); bus_generic_attach(dev); Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91rm9200.c Thu Jul 12 13:45:58 2012 (r238397) @@ -46,14 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include - -struct at91rm92_softc { - device_t dev; - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - bus_space_handle_t sc_sys_sh; - bus_space_handle_t sc_aic_sh; -}; /* * Standard priority levels for the system. 0 is lowest and 7 is highest. * These values are the ones Atmel uses for its Linux port, which differ @@ -147,42 +139,19 @@ at91_pll_outb(int freq) return (0x8000); } -static void -at91_identify(driver_t *drv, device_t parent) -{ - - if (at91_cpu_is(AT91_T_RM9200)) - at91_add_child(parent, 0, "at91rm920", 0, 0, 0, -1, 0, 0); -} - -static int -at91_probe(device_t dev) -{ - - device_set_desc(dev, soc_info.name); - return (0); -} - -static int -at91_attach(device_t dev) -{ - struct at91_pmc_clock *clk; - struct at91rm92_softc *sc = device_get_softc(dev); - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); - - sc->sc_st = at91sc->sc_st; - sc->sc_sh = at91sc->sc_sh; - sc->dev = dev; - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE, - AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) - panic("Enable to map system registers"); - +#if 0 +/* -- XXX are these needed? */ /* Disable all interrupts for RTC (0xe24 == RTC_IDR) */ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff); /* Disable all interrupts for the SDRAM controller */ bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); +#endif + +static void +at91_clock_init(void) +{ + struct at91_pmc_clock *clk; /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); @@ -218,30 +187,12 @@ at91_attach(device_t dev) clk->pll_div_mask = RM9200_PLL_B_DIV_MASK; clk->set_outb = at91_pll_outb; at91_pmc_clock_deref(clk); - - return (0); } -static device_method_t at91_methods[] = { - DEVMETHOD(device_probe, at91_probe), - DEVMETHOD(device_attach, at91_attach), - DEVMETHOD(device_identify, at91_identify), - {0, 0}, -}; - -static driver_t at91rm92_driver = { - "at91rm920", - at91_methods, - sizeof(struct at91rm92_softc), -}; - -static devclass_t at91rm92_devclass; - -DRIVER_MODULE(at91rm920, atmelarm, at91rm92_driver, at91rm92_devclass, 0, 0); - static struct at91_soc_data soc_data = { .soc_delay = at91_st_delay, .soc_reset = at91_st_cpu_reset, + .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, }; Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91sam9260.c Thu Jul 12 13:45:58 2012 (r238397) @@ -47,12 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct at91sam9_softc { - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - bus_space_handle_t sc_matrix_sh; -}; - /* * Standard priority levels for the system. 0 is lowest and 7 is highest. * These values are the ones Atmel uses for its Linux port @@ -146,43 +140,9 @@ at91_pll_outb(int freq) } static void -at91_identify(driver_t *drv, device_t parent) -{ - - if (soc_info.type == AT91_T_SAM9260) - at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); -} - -static int -at91_probe(device_t dev) -{ - - device_set_desc(dev, soc_info.name); - return (0); -} - -static int -at91_attach(device_t dev) +at91_clock_init(void) { struct at91_pmc_clock *clk; - struct at91sam9_softc *sc = device_get_softc(dev); - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); - uint32_t i; - - sc->sc_st = at91sc->sc_st; - sc->sc_sh = at91sc->sc_sh; - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, - AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, - &sc->sc_matrix_sh) != 0) - panic("Enable to map matrix registers"); - - /* activate NAND */ - i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9260_EBICSA); - bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9260_EBICSA, - i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); @@ -227,30 +187,12 @@ at91_attach(device_t dev) clk->pll_div_mask = SAM9260_PLL_B_DIV_MASK; clk->set_outb = at91_pll_outb; at91_pmc_clock_deref(clk); - return (0); } -static device_method_t at91sam9260_methods[] = { - DEVMETHOD(device_probe, at91_probe), - DEVMETHOD(device_attach, at91_attach), - DEVMETHOD(device_identify, at91_identify), - DEVMETHOD_END -}; - -static driver_t at91sam9260_driver = { - "at91sam9260", - at91sam9260_methods, - sizeof(struct at91sam9_softc), -}; - -static devclass_t at91sam9260_devclass; - -DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, - NULL, NULL); - static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, + .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, .soc_children = at91_devs, }; Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91sam9g20.c Thu Jul 12 13:45:58 2012 (r238397) @@ -47,12 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct at91sam9_softc { - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - bus_space_handle_t sc_matrix_sh; -}; - /* * Standard priority levels for the system. 0 is lowest and 7 is highest. * These values are the ones Atmel uses for its Linux port @@ -153,44 +147,9 @@ at91_pll_outb(int freq) } static void -at91_identify(driver_t *drv, device_t parent) -{ - - if (at91_cpu_is(AT91_T_SAM9G20)) - at91_add_child(parent, 0, "at91sam", 9, 0, 0, -1, 0, 0); -} - -static int -at91_probe(device_t dev) -{ - - device_set_desc(dev, soc_info.name); - return (0); -} - -static int -at91_attach(device_t dev) +at91_clock_init(void) { struct at91_pmc_clock *clk; - struct at91sam9_softc *sc = device_get_softc(dev); - struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); - uint32_t i; - - sc->sc_st = at91sc->sc_st; - sc->sc_sh = at91sc->sc_sh; - - if (bus_space_subregion(sc->sc_st, sc->sc_sh, - AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE, - &sc->sc_matrix_sh) != 0) - panic("Enable to map matrix registers"); - - /* activate NAND*/ - i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9G20_EBICSA); - bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9G20_EBICSA, - i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); @@ -226,31 +185,14 @@ at91_attach(device_t dev) clk->pll_div_mask = SAM9G20_PLL_B_DIV_MASK; clk->set_outb = at91_pll_outb; at91_pmc_clock_deref(clk); - return (0); } -static device_method_t at91_methods[] = { - DEVMETHOD(device_probe, at91_probe), - DEVMETHOD(device_attach, at91_attach), - DEVMETHOD(device_identify, at91_identify), - {0, 0}, -}; - -static driver_t at91sam9_driver = { - "at91sam", - at91_methods, - sizeof(struct at91sam9_softc), -}; - -static devclass_t at91sam9_devclass; - -DRIVER_MODULE(at91sam, atmelarm, at91sam9_driver, at91sam9_devclass, 0, 0); - static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, + .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, - .soc_childpren = at91_devs, + .soc_children = at91_devs, }; AT91_SOC(AT91_T_SAM9G20, &soc_data); Modified: head/sys/arm/at91/at91sam9x25.c ============================================================================== --- head/sys/arm/at91/at91sam9x25.c Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91sam9x25.c Thu Jul 12 13:45:58 2012 (r238397) @@ -47,10 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct at91sam9x25_softc { - int filler; -}; - /* * Standard priority levels for the system. 0 is lowest and 7 is highest. * These values are the ones Atmel uses for its Linux port @@ -154,23 +150,7 @@ at91_pll_outb(int freq) } static void -at91_identify(driver_t *drv, device_t parent) -{ - - if (soc_info.type == AT91_T_SAM9X5 && soc_info.subtype == AT91_ST_SAM9X25) - at91_add_child(parent, 0, "at91sam9x25", 0, 0, 0, -1, 0, 0); -} - -static int -at91_probe(device_t dev) -{ - - device_set_desc(dev, "AT91SAM9X25"); - return (0); -} - -static int -at91_attach(device_t dev) +at91_clock_init(void) { struct at91_pmc_clock *clk; @@ -208,31 +188,14 @@ at91_attach(device_t dev) clk->pll_div_mask = SAM9X25_PLL_B_DIV_MASK; clk->set_outb = at91_pll_outb; at91_pmc_clock_deref(clk); - return (0); } -static device_method_t at91sam9x25_methods[] = { - DEVMETHOD(device_probe, at91_probe), - DEVMETHOD(device_attach, at91_attach), - DEVMETHOD(device_identify, at91_identify), - {0, 0}, -}; - -static driver_t at91sam9x25_driver = { - "at91sam9x25", - at91sam9x25_methods, - sizeof(struct at91sam9x25_softc), -}; - -static devclass_t at91sam9x25_devclass; - -DRIVER_MODULE(at91sam9x25, atmelarm, at91sam9x25_driver, at91sam9x25_devclass, 0, 0); - static struct at91_soc_data soc_data = { .soc_delay = at91_pit_delay, .soc_reset = at91_rst_cpu_reset, + .soc_clock_init = at91_clock_init, .soc_irq_prio = at91_irq_prio, - .soc_childpren = at91_devs, + .soc_children = at91_devs, }; AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Thu Jul 12 12:11:32 2012 (r238396) +++ head/sys/arm/at91/at91var.h Thu Jul 12 13:45:58 2012 (r238397) @@ -104,10 +104,12 @@ enum at91_soc_family { typedef void (*DELAY_t)(int); typedef void (*cpu_reset_t)(void); +typedef void (*clk_init_t)(void); struct at91_soc_data { DELAY_t soc_delay; cpu_reset_t soc_reset; + clk_init_t soc_clock_init; const int *soc_irq_prio; const struct cpu_devs *soc_children; }; From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 13:54:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58829106566C; Thu, 12 Jul 2012 13:54:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443F28FC0C; Thu, 12 Jul 2012 13:54: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 q6CDsPxR010765; Thu, 12 Jul 2012 13:54:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CDsPme010763; Thu, 12 Jul 2012 13:54:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207121354.q6CDsPme010763@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 13:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238398 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 13:54:25 -0000 Author: imp Date: Thu Jul 12 13:54:24 2012 New Revision: 238398 URL: http://svn.freebsd.org/changeset/base/238398 Log: Fix whitespace divot. Modified: head/sys/arm/at91/at91.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Thu Jul 12 13:45:58 2012 (r238397) +++ head/sys/arm/at91/at91.c Thu Jul 12 13:54:24 2012 (r238398) @@ -310,7 +310,7 @@ at91_attach(device_t dev) * Add this device's children... */ at91_cpu_add_builtin_children(dev, soc_info.soc_data->soc_children); - soc_info.soc_data->soc_clock_init(); + soc_info.soc_data->soc_clock_init(); bus_generic_probe(dev); bus_generic_attach(dev); From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 15:20:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9F3B1065672; Thu, 12 Jul 2012 15:20:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B61F88FC08; Thu, 12 Jul 2012 15:20:20 +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 q6CFKKF9014455; Thu, 12 Jul 2012 15:20:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CFKKPe014453; Thu, 12 Jul 2012 15:20:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207121520.q6CFKKPe014453@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Jul 2012 15:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238399 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 15:20:20 -0000 Author: eadler Date: Thu Jul 12 15:20:20 2012 New Revision: 238399 URL: http://svn.freebsd.org/changeset/base/238399 Log: Document the behavior of mount with failok specified. PR: docs/163742 Submitted by: gcooper Discussion by: gcooper Discussion by: bjk Approved by: gabor MFC after: 3 days Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Thu Jul 12 13:54:24 2012 (r238398) +++ head/sbin/mount/mount.8 Thu Jul 12 15:20:20 2012 (r238399) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd June 6, 2011 +.Dd July 12, 2012 .Dt MOUNT 8 .Os .Sh NAME @@ -145,6 +145,11 @@ When used with the .Fl u flag, this is the same as specifying the options currently in effect for the mounted file system. +.It Cm failok +If this option is specified, +.Nm +will return 0 even if an error occurs +during the mount of the filesystem. .It Cm force The same as .Fl f ; From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:11:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B441106566C; Thu, 12 Jul 2012 19:11:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76EAF8FC18; Thu, 12 Jul 2012 19:11: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 q6CJBcDA024173; Thu, 12 Jul 2012 19:11:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CJBcnL024169; Thu, 12 Jul 2012 19:11:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207121911.q6CJBcnL024169@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 19:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238403 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:11:38 -0000 Author: imp Date: Thu Jul 12 19:11:37 2012 New Revision: 238403 URL: http://svn.freebsd.org/changeset/base/238403 Log: Remember where we found the DBGU and use that for our console. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91var.h head/sys/arm/at91/uart_cpu_at91rm9200usart.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Jul 12 16:47:18 2012 (r238402) +++ head/sys/arm/at91/at91_machdep.c Thu Jul 12 19:11:37 2012 (r238403) @@ -402,6 +402,7 @@ at91_try_id(uint32_t dbgu_base) * try to get the matching CPU support. */ soc_info.soc_data = at91_match_soc(soc_info.type, soc_info.subtype); + soc_info.dbgu_base = AT91_BASE + dbgu_base; return (1); } Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Thu Jul 12 16:47:18 2012 (r238402) +++ head/sys/arm/at91/at91var.h Thu Jul 12 19:11:37 2012 (r238403) @@ -121,6 +121,7 @@ struct at91_soc_info { uint32_t cidr; uint32_t exid; char name[AT91_SOC_NAME_MAX]; + uint32_t dbgu_base; struct at91_soc_data *soc_data; }; Modified: head/sys/arm/at91/uart_cpu_at91rm9200usart.c ============================================================================== --- head/sys/arm/at91/uart_cpu_at91rm9200usart.c Thu Jul 12 16:47:18 2012 (r238402) +++ head/sys/arm/at91/uart_cpu_at91rm9200usart.c Thu Jul 12 19:11:37 2012 (r238403) @@ -71,9 +71,10 @@ uart_cpu_getdev(int devtype, struct uart di->bas.bst = &at91_bs_tag; /* * XXX: Not pretty, but will work because we map the needed addresses - * early. + * early. At least we probed this so that the console will work on + * all flavors of Atmel we can detect. */ - di->bas.bsh = AT91_BASE + AT91RM92_DBGU_BASE; + di->bas.bsh = soc_info.dbgu_base; di->baudrate = 115200; di->bas.regshft = 0; di->bas.rclk = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:15:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AF4A1065670; Thu, 12 Jul 2012 19:15:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F008FC12; Thu, 12 Jul 2012 19:15: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 q6CJFcv4024387; Thu, 12 Jul 2012 19:15:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CJFcNc024384; Thu, 12 Jul 2012 19:15:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207121915.q6CJFcNc024384@svn.freebsd.org> From: Warner Losh Date: Thu, 12 Jul 2012 19:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238404 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:15:39 -0000 Author: imp Date: Thu Jul 12 19:15:38 2012 New Revision: 238404 URL: http://svn.freebsd.org/changeset/base/238404 Log: This file is no longer AT91RM9200 specific, but now is generic to all Atmel AT91 SoC's we support. Rename to reflect that. Added: head/sys/arm/at91/uart_cpu_at91usart.c - copied, changed from r238403, head/sys/arm/at91/uart_cpu_at91rm9200usart.c Deleted: head/sys/arm/at91/uart_cpu_at91rm9200usart.c Modified: head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Thu Jul 12 19:11:37 2012 (r238403) +++ head/sys/arm/at91/files.at91 Thu Jul 12 19:15:38 2012 (r238404) @@ -22,7 +22,7 @@ arm/at91/at91_wdt.c optional at91_wdt arm/at91/if_ate.c optional ate arm/at91/if_macb.c optional macb arm/at91/uart_bus_at91usart.c optional uart -arm/at91/uart_cpu_at91rm9200usart.c optional uart +arm/at91/uart_cpu_at91usart.c optional uart arm/at91/uart_dev_at91usart.c optional uart # # All the "systems on a chip" we support Copied and modified: head/sys/arm/at91/uart_cpu_at91usart.c (from r238403, head/sys/arm/at91/uart_cpu_at91rm9200usart.c) ============================================================================== --- head/sys/arm/at91/uart_cpu_at91rm9200usart.c Thu Jul 12 19:11:37 2012 (r238403, copy source) +++ head/sys/arm/at91/uart_cpu_at91usart.c Thu Jul 12 19:15:38 2012 (r238404) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include bus_space_tag_t uart_bus_space_io; From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:30:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D923106566C; Thu, 12 Jul 2012 19:30:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FCCA8FC08; Thu, 12 Jul 2012 19:30: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 q6CJUu26025040; Thu, 12 Jul 2012 19:30:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CJUu97025034; Thu, 12 Jul 2012 19:30:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207121930.q6CJUu97025034@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 12 Jul 2012 19:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238405 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/apps/demoCA crypto/openssl/bugs crypto/openssl/certs/demo crypto/openssl/crypto crypto/openssl/crypto/aes crypto/o... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:30:56 -0000 Author: jkim Date: Thu Jul 12 19:30:53 2012 New Revision: 238405 URL: http://svn.freebsd.org/changeset/base/238405 Log: Merge OpenSSL 1.0.1c. Approved by: benl (maintainer) Added: head/crypto/openssl/apps/genpkey.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/genpkey.c head/crypto/openssl/apps/pkey.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/pkey.c head/crypto/openssl/apps/pkeyparam.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/pkeyparam.c head/crypto/openssl/apps/pkeyutl.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/pkeyutl.c head/crypto/openssl/apps/srp.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/srp.c head/crypto/openssl/apps/ts.c - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/ts.c head/crypto/openssl/apps/tsget - copied unchanged from r238402, vendor-crypto/openssl/dist/apps/tsget head/crypto/openssl/crypto/aes/aes_x86core.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/aes_x86core.c head/crypto/openssl/crypto/aes/asm/aes-armv4.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-armv4.pl head/crypto/openssl/crypto/aes/asm/aes-mips.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-mips.pl head/crypto/openssl/crypto/aes/asm/aes-parisc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-parisc.pl head/crypto/openssl/crypto/aes/asm/aes-ppc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl head/crypto/openssl/crypto/aes/asm/aes-s390x.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl head/crypto/openssl/crypto/aes/asm/aes-sparcv9.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aes-sparcv9.pl head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aesni-sha1-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-x86.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aesni-x86.pl head/crypto/openssl/crypto/aes/asm/aesni-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/aesni-x86_64.pl head/crypto/openssl/crypto/aes/asm/bsaes-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/bsaes-x86_64.pl head/crypto/openssl/crypto/aes/asm/vpaes-x86.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-x86.pl head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/aes/asm/vpaes-x86_64.pl head/crypto/openssl/crypto/arm_arch.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/arm_arch.h head/crypto/openssl/crypto/armcap.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/armcap.c head/crypto/openssl/crypto/armv4cpuid.S - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/armv4cpuid.S head/crypto/openssl/crypto/asn1/ameth_lib.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/asn1_locl.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/asn1/asn1_locl.h head/crypto/openssl/crypto/asn1/bio_asn1.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/asn1/bio_asn1.c head/crypto/openssl/crypto/asn1/bio_ndef.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/asn1/bio_ndef.c head/crypto/openssl/crypto/asn1/x_nx509.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/asn1/x_nx509.c head/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/armv4-gf2m.pl head/crypto/openssl/crypto/bn/asm/armv4-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/armv4-mont.pl head/crypto/openssl/crypto/bn/asm/ia64-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/ia64-mont.pl head/crypto/openssl/crypto/bn/asm/mips-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/mips-mont.pl head/crypto/openssl/crypto/bn/asm/mips.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/mips.pl head/crypto/openssl/crypto/bn/asm/mips3-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/mips3-mont.pl head/crypto/openssl/crypto/bn/asm/modexp512-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/modexp512-x86_64.pl head/crypto/openssl/crypto/bn/asm/parisc-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/parisc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl head/crypto/openssl/crypto/bn/asm/s390x-gf2m.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/s390x-gf2m.pl head/crypto/openssl/crypto/bn/asm/s390x-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/s390x-mont.pl head/crypto/openssl/crypto/bn/asm/s390x.S - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/s390x.S head/crypto/openssl/crypto/bn/asm/sparcv9-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9-mont.pl head/crypto/openssl/crypto/bn/asm/sparcv9a-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9a-mont.pl head/crypto/openssl/crypto/bn/asm/via-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/via-mont.pl head/crypto/openssl/crypto/bn/asm/x86-gf2m.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/x86-gf2m.pl head/crypto/openssl/crypto/bn/asm/x86-mont.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-gf2m.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/camellia/asm/ - copied from r238402, vendor-crypto/openssl/dist/crypto/camellia/asm/ head/crypto/openssl/crypto/camellia/cmll_utl.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/camellia/cmll_utl.c head/crypto/openssl/crypto/cmac/ - copied from r238402, vendor-crypto/openssl/dist/crypto/cmac/ head/crypto/openssl/crypto/cms/cms_pwri.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/cms/cms_pwri.c head/crypto/openssl/crypto/dh/dh_ameth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dh/dh_ameth.c head/crypto/openssl/crypto/dh/dh_pmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dh/dh_pmeth.c head/crypto/openssl/crypto/dh/dh_prn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dh/dh_prn.c head/crypto/openssl/crypto/dsa/dsa_ameth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dsa/dsa_ameth.c head/crypto/openssl/crypto/dsa/dsa_locl.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dsa/dsa_locl.h head/crypto/openssl/crypto/dsa/dsa_pmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dsa/dsa_pmeth.c head/crypto/openssl/crypto/dsa/dsa_prn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dsa/dsa_prn.c head/crypto/openssl/crypto/dso/dso_beos.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/dso/dso_beos.c head/crypto/openssl/crypto/ec/ec2_oct.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ec2_oct.c head/crypto/openssl/crypto/ec/ec_ameth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_oct.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ec_oct.c head/crypto/openssl/crypto/ec/ec_pmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ec_pmeth.c head/crypto/openssl/crypto/ec/eck_prn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/eck_prn.c head/crypto/openssl/crypto/ec/ecp_nistp224.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ecp_nistp224.c head/crypto/openssl/crypto/ec/ecp_nistp256.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ecp_nistp256.c head/crypto/openssl/crypto/ec/ecp_nistp521.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ecp_nistp521.c head/crypto/openssl/crypto/ec/ecp_nistputil.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ecp_nistputil.c head/crypto/openssl/crypto/ec/ecp_oct.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ec/ecp_oct.c head/crypto/openssl/crypto/engine/eng_rdrand.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/engine/eng_rdrand.c head/crypto/openssl/crypto/engine/eng_rsax.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/engine/eng_rsax.c head/crypto/openssl/crypto/engine/tb_asnmth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/engine/tb_asnmth.c head/crypto/openssl/crypto/engine/tb_pkmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/engine/tb_pkmeth.c head/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha1.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/e_aes_cbc_hmac_sha1.c head/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/e_rc4_hmac_md5.c head/crypto/openssl/crypto/evp/evp_fips.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/evp_fips.c head/crypto/openssl/crypto/evp/m_sigver.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/m_sigver.c head/crypto/openssl/crypto/evp/m_wp.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/m_wp.c head/crypto/openssl/crypto/evp/pmeth_fn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/pmeth_fn.c head/crypto/openssl/crypto/evp/pmeth_gn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/pmeth_gn.c head/crypto/openssl/crypto/evp/pmeth_lib.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/evp/pmeth_lib.c head/crypto/openssl/crypto/fips_ers.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/fips_ers.c head/crypto/openssl/crypto/hmac/hm_ameth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/hmac/hm_ameth.c head/crypto/openssl/crypto/hmac/hm_pmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/hmac/hm_pmeth.c head/crypto/openssl/crypto/md5/asm/md5-ia64.S - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/md5/asm/md5-ia64.S head/crypto/openssl/crypto/modes/ - copied from r238402, vendor-crypto/openssl/dist/crypto/modes/ head/crypto/openssl/crypto/o_fips.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/o_fips.c head/crypto/openssl/crypto/objects/obj_xref.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/objects/obj_xref.c head/crypto/openssl/crypto/objects/obj_xref.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/objects/obj_xref.h head/crypto/openssl/crypto/objects/obj_xref.txt - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/objects/obj_xref.txt head/crypto/openssl/crypto/objects/objxref.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/objects/objxref.pl head/crypto/openssl/crypto/pariscid.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/pariscid.pl head/crypto/openssl/crypto/pem/pvkfmt.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/pem/pvkfmt.c head/crypto/openssl/crypto/perlasm/ppc-xlate.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/perlasm/ppc-xlate.pl head/crypto/openssl/crypto/perlasm/x86gas.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/perlasm/x86gas.pl head/crypto/openssl/crypto/perlasm/x86masm.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/perlasm/x86masm.pl head/crypto/openssl/crypto/pkcs7/bio_pk7.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/pkcs7/bio_pk7.c head/crypto/openssl/crypto/ppccap.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ppccap.c head/crypto/openssl/crypto/ppccpuid.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/ppccpuid.pl head/crypto/openssl/crypto/rc4/asm/rc4-ia64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-ia64.pl head/crypto/openssl/crypto/rc4/asm/rc4-md5-x86_64.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-md5-x86_64.pl head/crypto/openssl/crypto/rc4/asm/rc4-parisc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-parisc.pl head/crypto/openssl/crypto/rc4/asm/rc4-s390x.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rc4/asm/rc4-s390x.pl head/crypto/openssl/crypto/rc4/rc4_utl.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rc4/rc4_utl.c head/crypto/openssl/crypto/rsa/rsa_ameth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/rsa/rsa_crpt.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rsa/rsa_crpt.c head/crypto/openssl/crypto/rsa/rsa_locl.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rsa/rsa_locl.h head/crypto/openssl/crypto/rsa/rsa_pmeth.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rsa/rsa_pmeth.c head/crypto/openssl/crypto/rsa/rsa_prn.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/rsa/rsa_prn.c head/crypto/openssl/crypto/s390xcap.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/s390xcap.c head/crypto/openssl/crypto/s390xcpuid.S - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/s390xcpuid.S head/crypto/openssl/crypto/sha/asm/sha1-armv4-large.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-armv4-large.pl head/crypto/openssl/crypto/sha/asm/sha1-mips.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-mips.pl head/crypto/openssl/crypto/sha/asm/sha1-parisc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-parisc.pl head/crypto/openssl/crypto/sha/asm/sha1-ppc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-ppc.pl head/crypto/openssl/crypto/sha/asm/sha1-s390x.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-s390x.pl head/crypto/openssl/crypto/sha/asm/sha1-sparcv9.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-sparcv9.pl head/crypto/openssl/crypto/sha/asm/sha1-sparcv9a.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-sparcv9a.pl head/crypto/openssl/crypto/sha/asm/sha1-thumb.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-thumb.pl head/crypto/openssl/crypto/sha/asm/sha256-586.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha256-586.pl head/crypto/openssl/crypto/sha/asm/sha256-armv4.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha256-armv4.pl head/crypto/openssl/crypto/sha/asm/sha512-586.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-586.pl head/crypto/openssl/crypto/sha/asm/sha512-armv4.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-armv4.pl head/crypto/openssl/crypto/sha/asm/sha512-mips.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-mips.pl head/crypto/openssl/crypto/sha/asm/sha512-parisc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-parisc.pl head/crypto/openssl/crypto/sha/asm/sha512-ppc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-ppc.pl head/crypto/openssl/crypto/sha/asm/sha512-s390x.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-s390x.pl head/crypto/openssl/crypto/sha/asm/sha512-sparcv9.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-sparcv9.pl head/crypto/openssl/crypto/sparcv9cap.c - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/sparcv9cap.c head/crypto/openssl/crypto/srp/ - copied from r238402, vendor-crypto/openssl/dist/crypto/srp/ head/crypto/openssl/crypto/ts/ - copied from r238402, vendor-crypto/openssl/dist/crypto/ts/ head/crypto/openssl/crypto/vms_rms.h - copied unchanged from r238402, vendor-crypto/openssl/dist/crypto/vms_rms.h head/crypto/openssl/crypto/whrlpool/ - copied from r238402, vendor-crypto/openssl/dist/crypto/whrlpool/ head/crypto/openssl/doc/apps/cms.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/cms.pod head/crypto/openssl/doc/apps/genpkey.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/genpkey.pod head/crypto/openssl/doc/apps/pkey.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/pkey.pod head/crypto/openssl/doc/apps/pkeyparam.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/pkeyparam.pod head/crypto/openssl/doc/apps/pkeyutl.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/pkeyutl.pod head/crypto/openssl/doc/apps/ts.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/ts.pod head/crypto/openssl/doc/apps/tsget.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/apps/tsget.pod head/crypto/openssl/doc/crypto/BIO_new_CMS.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/BIO_new_CMS.pod head/crypto/openssl/doc/crypto/CMS_add0_cert.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_add0_cert.pod head/crypto/openssl/doc/crypto/CMS_add1_recipient_cert.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_add1_recipient_cert.pod head/crypto/openssl/doc/crypto/CMS_compress.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_compress.pod head/crypto/openssl/doc/crypto/CMS_decrypt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_decrypt.pod head/crypto/openssl/doc/crypto/CMS_encrypt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_encrypt.pod head/crypto/openssl/doc/crypto/CMS_final.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_final.pod head/crypto/openssl/doc/crypto/CMS_get0_RecipientInfos.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_get0_RecipientInfos.pod head/crypto/openssl/doc/crypto/CMS_get0_SignerInfos.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_get0_SignerInfos.pod head/crypto/openssl/doc/crypto/CMS_get0_type.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_get0_type.pod head/crypto/openssl/doc/crypto/CMS_get1_ReceiptRequest.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_get1_ReceiptRequest.pod head/crypto/openssl/doc/crypto/CMS_sign.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_sign.pod head/crypto/openssl/doc/crypto/CMS_sign_add1_signer.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_sign_add1_signer.pod head/crypto/openssl/doc/crypto/CMS_sign_receipt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_sign_receipt.pod head/crypto/openssl/doc/crypto/CMS_uncompress.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_uncompress.pod head/crypto/openssl/doc/crypto/CMS_verify.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_verify.pod head/crypto/openssl/doc/crypto/CMS_verify_receipt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/CMS_verify_receipt.pod head/crypto/openssl/doc/crypto/EVP_DigestSignInit.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_DigestSignInit.pod head/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_DigestVerifyInit.pod head/crypto/openssl/doc/crypto/EVP_PKEY_CTX_ctrl.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_CTX_ctrl.pod head/crypto/openssl/doc/crypto/EVP_PKEY_CTX_new.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_CTX_new.pod head/crypto/openssl/doc/crypto/EVP_PKEY_cmp.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_cmp.pod head/crypto/openssl/doc/crypto/EVP_PKEY_decrypt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_decrypt.pod head/crypto/openssl/doc/crypto/EVP_PKEY_derive.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_derive.pod head/crypto/openssl/doc/crypto/EVP_PKEY_encrypt.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_encrypt.pod head/crypto/openssl/doc/crypto/EVP_PKEY_get_default_digest.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_get_default_digest.pod head/crypto/openssl/doc/crypto/EVP_PKEY_keygen.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_keygen.pod head/crypto/openssl/doc/crypto/EVP_PKEY_print_private.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_print_private.pod head/crypto/openssl/doc/crypto/EVP_PKEY_sign.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_sign.pod head/crypto/openssl/doc/crypto/EVP_PKEY_verify.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verify.pod head/crypto/openssl/doc/crypto/EVP_PKEY_verifyrecover.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/EVP_PKEY_verifyrecover.pod head/crypto/openssl/doc/crypto/PEM_write_bio_CMS_stream.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/PEM_write_bio_CMS_stream.pod head/crypto/openssl/doc/crypto/PEM_write_bio_PKCS7_stream.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/PEM_write_bio_PKCS7_stream.pod head/crypto/openssl/doc/crypto/PKCS7_sign_add_signer.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/PKCS7_sign_add_signer.pod head/crypto/openssl/doc/crypto/SMIME_read_CMS.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/SMIME_read_CMS.pod head/crypto/openssl/doc/crypto/SMIME_write_CMS.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/SMIME_write_CMS.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_error.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_get_error.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_new.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_new.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_set_verify_cb.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_STORE_CTX_set_verify_cb.pod head/crypto/openssl/doc/crypto/X509_STORE_set_verify_cb_func.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_STORE_set_verify_cb_func.pod head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_VERIFY_PARAM_set_flags.pod head/crypto/openssl/doc/crypto/X509_verify_cert.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/X509_verify_cert.pod head/crypto/openssl/doc/crypto/i2d_CMS_bio_stream.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/i2d_CMS_bio_stream.pod head/crypto/openssl/doc/crypto/i2d_PKCS7_bio_stream.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/crypto/i2d_PKCS7_bio_stream.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_psk_client_callback.pod - copied, changed from r238402, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_psk_client_callback.pod head/crypto/openssl/doc/ssl/SSL_CTX_use_psk_identity_hint.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_use_psk_identity_hint.pod head/crypto/openssl/doc/ssl/SSL_get_psk_identity.pod - copied unchanged from r238402, vendor-crypto/openssl/dist/doc/ssl/SSL_get_psk_identity.pod head/crypto/openssl/engines/ccgost/ - copied from r238402, vendor-crypto/openssl/dist/engines/ccgost/ head/crypto/openssl/engines/e_padlock.c - copied unchanged from r238402, vendor-crypto/openssl/dist/engines/e_padlock.c head/crypto/openssl/ssl/d1_srtp.c - copied unchanged from r238402, vendor-crypto/openssl/dist/ssl/d1_srtp.c head/crypto/openssl/ssl/srtp.h - copied, changed from r238402, vendor-crypto/openssl/dist/ssl/srtp.h head/crypto/openssl/ssl/tls_srp.c - copied unchanged from r238402, vendor-crypto/openssl/dist/ssl/tls_srp.c head/crypto/openssl/util/cygwin.sh - copied unchanged from r238402, vendor-crypto/openssl/dist/util/cygwin.sh head/crypto/openssl/util/mkrc.pl - copied unchanged from r238402, vendor-crypto/openssl/dist/util/mkrc.pl head/secure/lib/libcrypto/amd64/ head/secure/lib/libcrypto/amd64/aes-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/aesni-sha1-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/aesni-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/bsaes-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/cmll-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/ghash-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/md5-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/modexp512-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/rc4-md5-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/rc4-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/sha1-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/sha256-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/sha512-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/vpaes-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/wp-x86_64.S (contents, props changed) head/secure/lib/libcrypto/amd64/x86_64-gf2m.S (contents, props changed) head/secure/lib/libcrypto/amd64/x86_64-mont.S (contents, props changed) head/secure/lib/libcrypto/amd64/x86_64-mont5.S (contents, props changed) head/secure/lib/libcrypto/amd64/x86_64cpuid.S (contents, props changed) head/secure/lib/libcrypto/engines/libgost/ head/secure/lib/libcrypto/engines/libgost/Makefile (contents, props changed) head/secure/lib/libcrypto/i386/aes-586.s (contents, props changed) head/secure/lib/libcrypto/i386/aesni-x86.s (contents, props changed) head/secure/lib/libcrypto/i386/cmll-x86.s (contents, props changed) head/secure/lib/libcrypto/i386/ghash-x86.s (contents, props changed) head/secure/lib/libcrypto/i386/sha256-586.s (contents, props changed) head/secure/lib/libcrypto/i386/sha512-586.s (contents, props changed) head/secure/lib/libcrypto/i386/vpaes-x86.s (contents, props changed) head/secure/lib/libcrypto/i386/wp-mmx.s (contents, props changed) head/secure/lib/libcrypto/i386/x86-gf2m.s (contents, props changed) head/secure/lib/libcrypto/i386/x86-mont.s (contents, props changed) head/secure/lib/libcrypto/i386/x86cpuid.s (contents, props changed) head/secure/lib/libcrypto/man/BIO_new_CMS.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_add0_cert.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_compress.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_decrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_encrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_final.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_get0_type.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_sign_receipt.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_uncompress.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_verify.3 (contents, props changed) head/secure/lib/libcrypto/man/CMS_verify_receipt.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_verifyrecover.3 (contents, props changed) head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 (contents, props changed) head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 (contents, props changed) head/secure/lib/libcrypto/man/SMIME_read_CMS.3 (contents, props changed) head/secure/lib/libcrypto/man/SMIME_write_CMS.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_verify_cert.3 (contents, props changed) head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 (contents, props changed) head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 (contents, props changed) head/secure/lib/libcrypto/opensslconf-x86.h (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_psk_identity.3 (contents, props changed) head/secure/usr.bin/openssl/man/cms.1 (contents, props changed) head/secure/usr.bin/openssl/man/genpkey.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkey.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkeyparam.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkeyutl.1 (contents, props changed) head/secure/usr.bin/openssl/man/ts.1 (contents, props changed) head/secure/usr.bin/openssl/man/tsget.1 (contents, props changed) Deleted: head/crypto/openssl/apps/demoCA/ head/crypto/openssl/apps/winrand.c head/crypto/openssl/bugs/ head/crypto/openssl/certs/demo/ head/crypto/openssl/crypto/LPdir_nyi.c head/crypto/openssl/crypto/LPdir_vms.c head/crypto/openssl/crypto/LPdir_win.c head/crypto/openssl/crypto/LPdir_win32.c head/crypto/openssl/crypto/LPdir_wince.c head/crypto/openssl/crypto/asn1/a_hdr.c head/crypto/openssl/crypto/asn1/a_meth.c head/crypto/openssl/crypto/asn1/p8_key.c head/crypto/openssl/crypto/bf/bfs.cpp head/crypto/openssl/crypto/bn/asm/mo-586.pl head/crypto/openssl/crypto/bn/bn_opt.c head/crypto/openssl/crypto/cast/casts.cpp head/crypto/openssl/crypto/des/asm/des686.pl head/crypto/openssl/crypto/des/des3s.cpp head/crypto/openssl/crypto/des/des_lib.c head/crypto/openssl/crypto/des/dess.cpp head/crypto/openssl/crypto/des/t/ head/crypto/openssl/crypto/des/times/ head/crypto/openssl/crypto/dsa/dsa_utl.c head/crypto/openssl/crypto/dyn_lck.c head/crypto/openssl/crypto/ec/ec2_smpt.c head/crypto/openssl/crypto/engine/eng_padlock.c head/crypto/openssl/crypto/err/err_bio.c head/crypto/openssl/crypto/err/err_def.c head/crypto/openssl/crypto/err/err_str.c head/crypto/openssl/crypto/err/openssl.ec head/crypto/openssl/crypto/evp/dig_eng.c head/crypto/openssl/crypto/evp/enc_min.c head/crypto/openssl/crypto/evp/evp_cnf.c head/crypto/openssl/crypto/fips_err.c head/crypto/openssl/crypto/md4/md4s.cpp head/crypto/openssl/crypto/md5/md5s.cpp head/crypto/openssl/crypto/perlasm/x86ms.pl head/crypto/openssl/crypto/perlasm/x86unix.pl head/crypto/openssl/crypto/pqueue/pq_compat.h head/crypto/openssl/crypto/rand/rand_eng.c head/crypto/openssl/crypto/rand/rand_nw.c head/crypto/openssl/crypto/rand/rand_os2.c head/crypto/openssl/crypto/rand/rand_vms.c head/crypto/openssl/crypto/rand/rand_win.c head/crypto/openssl/crypto/rc4/asm/rc4-ia64.S head/crypto/openssl/crypto/rc4/rc4_fblk.c head/crypto/openssl/crypto/rc4/rc4s.cpp head/crypto/openssl/crypto/rc5/rc5s.cpp head/crypto/openssl/crypto/ripemd/asm/rips.cpp head/crypto/openssl/crypto/rsa/rsa_eng.c head/crypto/openssl/crypto/rsa/rsa_x931g.c head/crypto/openssl/crypto/sha/asm/sha512-sse2.pl head/crypto/openssl/crypto/sha/sha1s.cpp head/crypto/openssl/crypto/tmdiff.c head/crypto/openssl/crypto/tmdiff.h head/crypto/openssl/demos/ head/crypto/openssl/engines/alpha.opt head/crypto/openssl/engines/e_4758cca.ec head/crypto/openssl/engines/e_aep.ec head/crypto/openssl/engines/e_atalla.ec head/crypto/openssl/engines/e_capi.ec head/crypto/openssl/engines/e_chil.ec head/crypto/openssl/engines/e_cswift.ec head/crypto/openssl/engines/e_gmp.ec head/crypto/openssl/engines/e_nuron.ec head/crypto/openssl/engines/e_sureware.ec head/crypto/openssl/engines/e_ubsec.ec head/crypto/openssl/engines/ia64.opt head/crypto/openssl/engines/vax.opt head/crypto/openssl/fips/ head/crypto/openssl/openssl.doxy head/crypto/openssl/openssl.spec head/crypto/openssl/test/ head/crypto/openssl/times/ head/crypto/openssl/tools/ head/crypto/openssl/util/arx.pl head/crypto/openssl/util/fipslink.pl head/crypto/openssl/util/mksdef.pl head/secure/lib/libcrypto/man/des_modes.3 head/secure/lib/libcrypto/opensslconf-amd64.h head/secure/lib/libcrypto/opensslconf-i386.h head/secure/usr.bin/openssl/man/config.1 Modified: head/ObsoleteFiles.inc head/UPDATING head/crypto/openssl/CHANGES head/crypto/openssl/CHANGES.SSLeay head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/Makefile.shared head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/Makefile head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/asn1pars.c head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/ciphers.c head/crypto/openssl/apps/client.pem head/crypto/openssl/apps/cms.c head/crypto/openssl/apps/crl2p7.c head/crypto/openssl/apps/dgst.c head/crypto/openssl/apps/dh.c head/crypto/openssl/apps/dhparam.c head/crypto/openssl/apps/dsa.c head/crypto/openssl/apps/ec.c head/crypto/openssl/apps/ecparam.c head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/engine.c head/crypto/openssl/apps/errstr.c head/crypto/openssl/apps/gendh.c head/crypto/openssl/apps/genrsa.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.c head/crypto/openssl/apps/openssl.cnf head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/pkcs7.c head/crypto/openssl/apps/pkcs8.c head/crypto/openssl/apps/prime.c head/crypto/openssl/apps/progs.h head/crypto/openssl/apps/progs.pl head/crypto/openssl/apps/req.c head/crypto/openssl/apps/rsa.c head/crypto/openssl/apps/rsautl.c head/crypto/openssl/apps/s_apps.h head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/s_socket.c head/crypto/openssl/apps/s_time.c head/crypto/openssl/apps/server.pem head/crypto/openssl/apps/server2.pem head/crypto/openssl/apps/sess_id.c head/crypto/openssl/apps/smime.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/verify.c head/crypto/openssl/apps/x509.c head/crypto/openssl/config head/crypto/openssl/crypto/Makefile head/crypto/openssl/crypto/aes/Makefile head/crypto/openssl/crypto/aes/aes.h head/crypto/openssl/crypto/aes/aes_cbc.c head/crypto/openssl/crypto/aes/aes_cfb.c head/crypto/openssl/crypto/aes/aes_core.c head/crypto/openssl/crypto/aes/aes_ctr.c head/crypto/openssl/crypto/aes/aes_ige.c head/crypto/openssl/crypto/aes/aes_misc.c head/crypto/openssl/crypto/aes/aes_ofb.c head/crypto/openssl/crypto/aes/asm/aes-586.pl head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl head/crypto/openssl/crypto/asn1/Makefile head/crypto/openssl/crypto/asn1/a_bitstr.c head/crypto/openssl/crypto/asn1/a_digest.c head/crypto/openssl/crypto/asn1/a_dup.c head/crypto/openssl/crypto/asn1/a_gentm.c head/crypto/openssl/crypto/asn1/a_int.c head/crypto/openssl/crypto/asn1/a_object.c head/crypto/openssl/crypto/asn1/a_octet.c head/crypto/openssl/crypto/asn1/a_set.c head/crypto/openssl/crypto/asn1/a_sign.c head/crypto/openssl/crypto/asn1/a_strnid.c head/crypto/openssl/crypto/asn1/a_time.c head/crypto/openssl/crypto/asn1/a_type.c head/crypto/openssl/crypto/asn1/a_utctm.c head/crypto/openssl/crypto/asn1/a_verify.c head/crypto/openssl/crypto/asn1/asn1.h head/crypto/openssl/crypto/asn1/asn1_err.c head/crypto/openssl/crypto/asn1/asn1_gen.c head/crypto/openssl/crypto/asn1/asn1_lib.c head/crypto/openssl/crypto/asn1/asn1_mac.h head/crypto/openssl/crypto/asn1/asn1_par.c head/crypto/openssl/crypto/asn1/asn1t.h head/crypto/openssl/crypto/asn1/asn_mime.c head/crypto/openssl/crypto/asn1/asn_pack.c head/crypto/openssl/crypto/asn1/charmap.h head/crypto/openssl/crypto/asn1/d2i_pr.c head/crypto/openssl/crypto/asn1/d2i_pu.c head/crypto/openssl/crypto/asn1/i2d_pr.c head/crypto/openssl/crypto/asn1/n_pkey.c head/crypto/openssl/crypto/asn1/nsseq.c head/crypto/openssl/crypto/asn1/p5_pbe.c head/crypto/openssl/crypto/asn1/p5_pbev2.c head/crypto/openssl/crypto/asn1/p8_pkey.c head/crypto/openssl/crypto/asn1/t_crl.c head/crypto/openssl/crypto/asn1/t_pkey.c head/crypto/openssl/crypto/asn1/t_req.c head/crypto/openssl/crypto/asn1/t_spki.c head/crypto/openssl/crypto/asn1/t_x509.c head/crypto/openssl/crypto/asn1/tasn_dec.c head/crypto/openssl/crypto/asn1/tasn_enc.c head/crypto/openssl/crypto/asn1/tasn_fre.c head/crypto/openssl/crypto/asn1/tasn_new.c head/crypto/openssl/crypto/asn1/tasn_prn.c head/crypto/openssl/crypto/asn1/tasn_typ.c head/crypto/openssl/crypto/asn1/x_algor.c head/crypto/openssl/crypto/asn1/x_crl.c head/crypto/openssl/crypto/asn1/x_long.c head/crypto/openssl/crypto/asn1/x_name.c head/crypto/openssl/crypto/asn1/x_pubkey.c head/crypto/openssl/crypto/asn1/x_req.c head/crypto/openssl/crypto/asn1/x_x509.c head/crypto/openssl/crypto/bf/Makefile head/crypto/openssl/crypto/bf/asm/bf-586.pl head/crypto/openssl/crypto/bf/bf_skey.c head/crypto/openssl/crypto/bf/blowfish.h head/crypto/openssl/crypto/bio/Makefile head/crypto/openssl/crypto/bio/b_print.c head/crypto/openssl/crypto/bio/b_sock.c head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bio_cb.c head/crypto/openssl/crypto/bio/bio_err.c head/crypto/openssl/crypto/bio/bio_lcl.h head/crypto/openssl/crypto/bio/bio_lib.c head/crypto/openssl/crypto/bio/bss_acpt.c head/crypto/openssl/crypto/bio/bss_bio.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bio/bss_fd.c head/crypto/openssl/crypto/bio/bss_file.c head/crypto/openssl/crypto/bio/bss_log.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/bn/Makefile head/crypto/openssl/crypto/bn/asm/bn-586.pl head/crypto/openssl/crypto/bn/asm/co-586.pl head/crypto/openssl/crypto/bn/asm/ppc.pl head/crypto/openssl/crypto/bn/asm/sparcv8plus.S head/crypto/openssl/crypto/bn/asm/x86_64-gcc.c head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/bn.h head/crypto/openssl/crypto/bn/bn_asm.c head/crypto/openssl/crypto/bn/bn_blind.c head/crypto/openssl/crypto/bn/bn_ctx.c head/crypto/openssl/crypto/bn/bn_div.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_gf2m.c head/crypto/openssl/crypto/bn/bn_lcl.h head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_mont.c head/crypto/openssl/crypto/bn/bn_nist.c head/crypto/openssl/crypto/bn/bn_print.c head/crypto/openssl/crypto/bn/bn_shift.c head/crypto/openssl/crypto/bn/bntest.c head/crypto/openssl/crypto/bn/exptest.c head/crypto/openssl/crypto/buffer/Makefile head/crypto/openssl/crypto/buffer/buf_err.c head/crypto/openssl/crypto/buffer/buf_str.c head/crypto/openssl/crypto/buffer/buffer.c head/crypto/openssl/crypto/buffer/buffer.h head/crypto/openssl/crypto/camellia/Makefile head/crypto/openssl/crypto/camellia/camellia.c head/crypto/openssl/crypto/camellia/camellia.h head/crypto/openssl/crypto/camellia/cmll_cbc.c head/crypto/openssl/crypto/camellia/cmll_cfb.c head/crypto/openssl/crypto/camellia/cmll_ctr.c head/crypto/openssl/crypto/camellia/cmll_locl.h head/crypto/openssl/crypto/camellia/cmll_misc.c head/crypto/openssl/crypto/camellia/cmll_ofb.c head/crypto/openssl/crypto/cast/Makefile head/crypto/openssl/crypto/cast/asm/cast-586.pl head/crypto/openssl/crypto/cast/c_skey.c head/crypto/openssl/crypto/cast/cast.h head/crypto/openssl/crypto/cms/Makefile head/crypto/openssl/crypto/cms/cms.h head/crypto/openssl/crypto/cms/cms_asn1.c head/crypto/openssl/crypto/cms/cms_env.c head/crypto/openssl/crypto/cms/cms_err.c head/crypto/openssl/crypto/cms/cms_ess.c head/crypto/openssl/crypto/cms/cms_io.c head/crypto/openssl/crypto/cms/cms_lcl.h head/crypto/openssl/crypto/cms/cms_lib.c head/crypto/openssl/crypto/cms/cms_sd.c head/crypto/openssl/crypto/cms/cms_smime.c head/crypto/openssl/crypto/comp/Makefile head/crypto/openssl/crypto/comp/c_rle.c head/crypto/openssl/crypto/comp/c_zlib.c head/crypto/openssl/crypto/comp/comp_err.c head/crypto/openssl/crypto/conf/Makefile head/crypto/openssl/crypto/conf/README head/crypto/openssl/crypto/conf/conf.h head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/conf/conf_def.c head/crypto/openssl/crypto/conf/conf_err.c head/crypto/openssl/crypto/conf/conf_lib.c head/crypto/openssl/crypto/conf/conf_mall.c head/crypto/openssl/crypto/conf/conf_mod.c head/crypto/openssl/crypto/cpt_err.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/cryptlib.h head/crypto/openssl/crypto/crypto.h head/crypto/openssl/crypto/des/Makefile head/crypto/openssl/crypto/des/asm/crypt586.pl head/crypto/openssl/crypto/des/asm/des-586.pl head/crypto/openssl/crypto/des/asm/des_enc.m4 head/crypto/openssl/crypto/des/des.h head/crypto/openssl/crypto/des/des_enc.c head/crypto/openssl/crypto/des/des_locl.h head/crypto/openssl/crypto/des/ecb_enc.c head/crypto/openssl/crypto/des/enc_read.c head/crypto/openssl/crypto/des/enc_writ.c head/crypto/openssl/crypto/des/fcrypt_b.c head/crypto/openssl/crypto/des/set_key.c head/crypto/openssl/crypto/des/xcbc_enc.c head/crypto/openssl/crypto/dh/Makefile head/crypto/openssl/crypto/dh/dh.h head/crypto/openssl/crypto/dh/dh_asn1.c head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dh_err.c head/crypto/openssl/crypto/dh/dh_gen.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dh/dh_lib.c head/crypto/openssl/crypto/dsa/Makefile head/crypto/openssl/crypto/dsa/dsa.h head/crypto/openssl/crypto/dsa/dsa_asn1.c head/crypto/openssl/crypto/dsa/dsa_err.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_key.c head/crypto/openssl/crypto/dsa/dsa_lib.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dsa/dsa_sign.c head/crypto/openssl/crypto/dsa/dsa_vrf.c head/crypto/openssl/crypto/dsa/dsatest.c head/crypto/openssl/crypto/dso/Makefile head/crypto/openssl/crypto/dso/dso.h head/crypto/openssl/crypto/dso/dso_dl.c head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/dso/dso_err.c head/crypto/openssl/crypto/dso/dso_lib.c head/crypto/openssl/crypto/dso/dso_null.c head/crypto/openssl/crypto/dso/dso_openssl.c head/crypto/openssl/crypto/ec/Makefile head/crypto/openssl/crypto/ec/ec.h head/crypto/openssl/crypto/ec/ec2_mult.c head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_asn1.c head/crypto/openssl/crypto/ec/ec_curve.c head/crypto/openssl/crypto/ec/ec_cvt.c head/crypto/openssl/crypto/ec/ec_err.c head/crypto/openssl/crypto/ec/ec_key.c head/crypto/openssl/crypto/ec/ec_lcl.h head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ec_mult.c head/crypto/openssl/crypto/ec/ecp_mont.c head/crypto/openssl/crypto/ec/ecp_nist.c head/crypto/openssl/crypto/ec/ecp_smpl.c head/crypto/openssl/crypto/ec/ectest.c head/crypto/openssl/crypto/ecdh/Makefile head/crypto/openssl/crypto/ecdh/ecdh.h head/crypto/openssl/crypto/ecdh/ecdhtest.c head/crypto/openssl/crypto/ecdh/ech_err.c head/crypto/openssl/crypto/ecdh/ech_lib.c head/crypto/openssl/crypto/ecdh/ech_locl.h head/crypto/openssl/crypto/ecdh/ech_ossl.c head/crypto/openssl/crypto/ecdsa/Makefile head/crypto/openssl/crypto/ecdsa/ecdsa.h head/crypto/openssl/crypto/ecdsa/ecdsatest.c head/crypto/openssl/crypto/ecdsa/ecs_err.c head/crypto/openssl/crypto/ecdsa/ecs_lib.c head/crypto/openssl/crypto/ecdsa/ecs_locl.h head/crypto/openssl/crypto/ecdsa/ecs_ossl.c head/crypto/openssl/crypto/engine/Makefile head/crypto/openssl/crypto/engine/eng_all.c head/crypto/openssl/crypto/engine/eng_cryptodev.c head/crypto/openssl/crypto/engine/eng_dyn.c head/crypto/openssl/crypto/engine/eng_err.c head/crypto/openssl/crypto/engine/eng_fat.c head/crypto/openssl/crypto/engine/eng_int.h head/crypto/openssl/crypto/engine/eng_lib.c head/crypto/openssl/crypto/engine/eng_list.c head/crypto/openssl/crypto/engine/eng_openssl.c head/crypto/openssl/crypto/engine/eng_table.c head/crypto/openssl/crypto/engine/engine.h head/crypto/openssl/crypto/engine/enginetest.c head/crypto/openssl/crypto/err/Makefile head/crypto/openssl/crypto/err/err.c head/crypto/openssl/crypto/err/err.h head/crypto/openssl/crypto/err/err_all.c head/crypto/openssl/crypto/err/err_prn.c head/crypto/openssl/crypto/evp/Makefile head/crypto/openssl/crypto/evp/bio_enc.c head/crypto/openssl/crypto/evp/bio_md.c head/crypto/openssl/crypto/evp/bio_ok.c head/crypto/openssl/crypto/evp/c_all.c head/crypto/openssl/crypto/evp/c_allc.c head/crypto/openssl/crypto/evp/c_alld.c head/crypto/openssl/crypto/evp/digest.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_camellia.c head/crypto/openssl/crypto/evp/e_des.c head/crypto/openssl/crypto/evp/e_des3.c head/crypto/openssl/crypto/evp/e_idea.c head/crypto/openssl/crypto/evp/e_null.c head/crypto/openssl/crypto/evp/e_rc2.c head/crypto/openssl/crypto/evp/e_rc4.c head/crypto/openssl/crypto/evp/e_seed.c head/crypto/openssl/crypto/evp/e_xcbc_d.c head/crypto/openssl/crypto/evp/encode.c head/crypto/openssl/crypto/evp/evp.h head/crypto/openssl/crypto/evp/evp_enc.c head/crypto/openssl/crypto/evp/evp_err.c head/crypto/openssl/crypto/evp/evp_key.c head/crypto/openssl/crypto/evp/evp_lib.c head/crypto/openssl/crypto/evp/evp_locl.h head/crypto/openssl/crypto/evp/evp_pbe.c head/crypto/openssl/crypto/evp/evp_pkey.c head/crypto/openssl/crypto/evp/evp_test.c head/crypto/openssl/crypto/evp/evptests.txt head/crypto/openssl/crypto/evp/m_dss.c head/crypto/openssl/crypto/evp/m_dss1.c head/crypto/openssl/crypto/evp/m_ecdsa.c head/crypto/openssl/crypto/evp/m_md2.c head/crypto/openssl/crypto/evp/m_md4.c head/crypto/openssl/crypto/evp/m_md5.c head/crypto/openssl/crypto/evp/m_mdc2.c head/crypto/openssl/crypto/evp/m_ripemd.c head/crypto/openssl/crypto/evp/m_sha.c head/crypto/openssl/crypto/evp/m_sha1.c head/crypto/openssl/crypto/evp/names.c head/crypto/openssl/crypto/evp/p5_crpt.c head/crypto/openssl/crypto/evp/p5_crpt2.c head/crypto/openssl/crypto/evp/p_dec.c head/crypto/openssl/crypto/evp/p_enc.c head/crypto/openssl/crypto/evp/p_lib.c head/crypto/openssl/crypto/evp/p_open.c head/crypto/openssl/crypto/evp/p_seal.c head/crypto/openssl/crypto/evp/p_sign.c head/crypto/openssl/crypto/evp/p_verify.c head/crypto/openssl/crypto/ex_data.c head/crypto/openssl/crypto/fips_err.h head/crypto/openssl/crypto/hmac/Makefile head/crypto/openssl/crypto/hmac/hmac.c head/crypto/openssl/crypto/hmac/hmac.h head/crypto/openssl/crypto/ia64cpuid.S head/crypto/openssl/crypto/idea/Makefile head/crypto/openssl/crypto/idea/i_skey.c head/crypto/openssl/crypto/idea/idea.h head/crypto/openssl/crypto/jpake/Makefile head/crypto/openssl/crypto/jpake/jpake.c head/crypto/openssl/crypto/jpake/jpaketest.c head/crypto/openssl/crypto/krb5/Makefile head/crypto/openssl/crypto/lhash/Makefile head/crypto/openssl/crypto/lhash/lh_stats.c head/crypto/openssl/crypto/lhash/lhash.c head/crypto/openssl/crypto/lhash/lhash.h head/crypto/openssl/crypto/md2/Makefile head/crypto/openssl/crypto/md2/md2_dgst.c head/crypto/openssl/crypto/md32_common.h head/crypto/openssl/crypto/md4/Makefile head/crypto/openssl/crypto/md4/md4.h head/crypto/openssl/crypto/md4/md4_dgst.c head/crypto/openssl/crypto/md5/Makefile head/crypto/openssl/crypto/md5/asm/md5-586.pl head/crypto/openssl/crypto/md5/asm/md5-x86_64.pl head/crypto/openssl/crypto/md5/md5.h head/crypto/openssl/crypto/md5/md5_dgst.c head/crypto/openssl/crypto/md5/md5_locl.h head/crypto/openssl/crypto/mdc2/Makefile head/crypto/openssl/crypto/mdc2/mdc2.h head/crypto/openssl/crypto/mdc2/mdc2dgst.c head/crypto/openssl/crypto/mem.c head/crypto/openssl/crypto/mem_dbg.c head/crypto/openssl/crypto/o_init.c head/crypto/openssl/crypto/o_time.c head/crypto/openssl/crypto/o_time.h head/crypto/openssl/crypto/objects/Makefile head/crypto/openssl/crypto/objects/o_names.c head/crypto/openssl/crypto/objects/obj_dat.c head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/obj_dat.pl head/crypto/openssl/crypto/objects/obj_err.c head/crypto/openssl/crypto/objects/obj_lib.c head/crypto/openssl/crypto/objects/obj_mac.h head/crypto/openssl/crypto/objects/obj_mac.num head/crypto/openssl/crypto/objects/objects.h head/crypto/openssl/crypto/objects/objects.pl head/crypto/openssl/crypto/objects/objects.txt head/crypto/openssl/crypto/ocsp/Makefile head/crypto/openssl/crypto/ocsp/ocsp.h head/crypto/openssl/crypto/ocsp/ocsp_cl.c head/crypto/openssl/crypto/ocsp/ocsp_err.c head/crypto/openssl/crypto/ocsp/ocsp_ext.c head/crypto/openssl/crypto/ocsp/ocsp_ht.c head/crypto/openssl/crypto/ocsp/ocsp_lib.c head/crypto/openssl/crypto/ocsp/ocsp_prn.c head/crypto/openssl/crypto/ocsp/ocsp_vfy.c head/crypto/openssl/crypto/opensslconf.h head/crypto/openssl/crypto/opensslconf.h.in head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/ossl_typ.h head/crypto/openssl/crypto/pem/Makefile head/crypto/openssl/crypto/pem/pem.h head/crypto/openssl/crypto/pem/pem_all.c head/crypto/openssl/crypto/pem/pem_err.c head/crypto/openssl/crypto/pem/pem_info.c head/crypto/openssl/crypto/pem/pem_lib.c head/crypto/openssl/crypto/pem/pem_pkey.c head/crypto/openssl/crypto/pem/pem_x509.c head/crypto/openssl/crypto/pem/pem_xaux.c head/crypto/openssl/crypto/perlasm/x86_64-xlate.pl head/crypto/openssl/crypto/perlasm/x86asm.pl head/crypto/openssl/crypto/perlasm/x86nasm.pl head/crypto/openssl/crypto/pkcs12/Makefile head/crypto/openssl/crypto/pkcs12/p12_add.c head/crypto/openssl/crypto/pkcs12/p12_attr.c head/crypto/openssl/crypto/pkcs12/p12_crpt.c head/crypto/openssl/crypto/pkcs12/p12_crt.c head/crypto/openssl/crypto/pkcs12/p12_decr.c head/crypto/openssl/crypto/pkcs12/p12_key.c head/crypto/openssl/crypto/pkcs12/p12_kiss.c head/crypto/openssl/crypto/pkcs12/p12_mutl.c head/crypto/openssl/crypto/pkcs12/p12_utl.c head/crypto/openssl/crypto/pkcs12/pk12err.c head/crypto/openssl/crypto/pkcs12/pkcs12.h head/crypto/openssl/crypto/pkcs7/Makefile head/crypto/openssl/crypto/pkcs7/pk7_asn1.c head/crypto/openssl/crypto/pkcs7/pk7_attr.c head/crypto/openssl/crypto/pkcs7/pk7_doit.c head/crypto/openssl/crypto/pkcs7/pk7_lib.c head/crypto/openssl/crypto/pkcs7/pk7_mime.c head/crypto/openssl/crypto/pkcs7/pk7_smime.c head/crypto/openssl/crypto/pkcs7/pkcs7.h head/crypto/openssl/crypto/pkcs7/pkcs7err.c head/crypto/openssl/crypto/pqueue/Makefile head/crypto/openssl/crypto/pqueue/pqueue.c head/crypto/openssl/crypto/pqueue/pqueue.h head/crypto/openssl/crypto/rand/Makefile head/crypto/openssl/crypto/rand/md_rand.c head/crypto/openssl/crypto/rand/rand.h head/crypto/openssl/crypto/rand/rand_egd.c head/crypto/openssl/crypto/rand/rand_err.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rc2/Makefile head/crypto/openssl/crypto/rc2/rc2_skey.c head/crypto/openssl/crypto/rc4/Makefile head/crypto/openssl/crypto/rc4/asm/rc4-586.pl head/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl head/crypto/openssl/crypto/rc4/rc4.h head/crypto/openssl/crypto/rc4/rc4_enc.c head/crypto/openssl/crypto/rc4/rc4_skey.c head/crypto/openssl/crypto/rc4/rc4test.c head/crypto/openssl/crypto/rc5/Makefile head/crypto/openssl/crypto/rc5/asm/rc5-586.pl head/crypto/openssl/crypto/rc5/rc5.h head/crypto/openssl/crypto/rc5/rc5_skey.c head/crypto/openssl/crypto/ripemd/Makefile head/crypto/openssl/crypto/ripemd/asm/rmd-586.pl head/crypto/openssl/crypto/ripemd/ripemd.h head/crypto/openssl/crypto/ripemd/rmd_dgst.c head/crypto/openssl/crypto/ripemd/rmd_locl.h head/crypto/openssl/crypto/rsa/Makefile head/crypto/openssl/crypto/rsa/rsa.h head/crypto/openssl/crypto/rsa/rsa_asn1.c head/crypto/openssl/crypto/rsa/rsa_eay.c head/crypto/openssl/crypto/rsa/rsa_err.c head/crypto/openssl/crypto/rsa/rsa_gen.c head/crypto/openssl/crypto/rsa/rsa_lib.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_pss.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/rsa/rsa_test.c head/crypto/openssl/crypto/seed/Makefile head/crypto/openssl/crypto/seed/seed.c head/crypto/openssl/crypto/seed/seed.h head/crypto/openssl/crypto/seed/seed_cbc.c head/crypto/openssl/crypto/seed/seed_cfb.c head/crypto/openssl/crypto/seed/seed_ofb.c head/crypto/openssl/crypto/sha/Makefile head/crypto/openssl/crypto/sha/asm/sha1-586.pl head/crypto/openssl/crypto/sha/asm/sha1-ia64.pl head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl head/crypto/openssl/crypto/sha/sha.h head/crypto/openssl/crypto/sha/sha1_one.c head/crypto/openssl/crypto/sha/sha1dgst.c head/crypto/openssl/crypto/sha/sha256.c head/crypto/openssl/crypto/sha/sha512.c head/crypto/openssl/crypto/sha/sha_dgst.c head/crypto/openssl/crypto/sha/sha_locl.h head/crypto/openssl/crypto/sha/shatest.c head/crypto/openssl/crypto/sparccpuid.S head/crypto/openssl/crypto/stack/Makefile head/crypto/openssl/crypto/stack/safestack.h head/crypto/openssl/crypto/stack/stack.c head/crypto/openssl/crypto/stack/stack.h head/crypto/openssl/crypto/store/Makefile head/crypto/openssl/crypto/store/store.h head/crypto/openssl/crypto/store/str_err.c head/crypto/openssl/crypto/store/str_lib.c head/crypto/openssl/crypto/store/str_mem.c head/crypto/openssl/crypto/symhacks.h head/crypto/openssl/crypto/threads/mttest.c head/crypto/openssl/crypto/txt_db/Makefile head/crypto/openssl/crypto/txt_db/txt_db.c head/crypto/openssl/crypto/txt_db/txt_db.h head/crypto/openssl/crypto/ui/Makefile head/crypto/openssl/crypto/ui/ui.h head/crypto/openssl/crypto/ui/ui_err.c head/crypto/openssl/crypto/ui/ui_lib.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/x509/Makefile head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/by_file.c head/crypto/openssl/crypto/x509/x509.h head/crypto/openssl/crypto/x509/x509_cmp.c head/crypto/openssl/crypto/x509/x509_err.c head/crypto/openssl/crypto/x509/x509_lu.c head/crypto/openssl/crypto/x509/x509_obj.c head/crypto/openssl/crypto/x509/x509_req.c head/crypto/openssl/crypto/x509/x509_set.c head/crypto/openssl/crypto/x509/x509_trs.c head/crypto/openssl/crypto/x509/x509_txt.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509/x509_vfy.h head/crypto/openssl/crypto/x509/x509_vpm.c head/crypto/openssl/crypto/x509/x509cset.c head/crypto/openssl/crypto/x509/x509name.c head/crypto/openssl/crypto/x509/x509type.c head/crypto/openssl/crypto/x509/x_all.c head/crypto/openssl/crypto/x509v3/Makefile head/crypto/openssl/crypto/x509v3/ext_dat.h head/crypto/openssl/crypto/x509v3/pcy_cache.c head/crypto/openssl/crypto/x509v3/pcy_data.c head/crypto/openssl/crypto/x509v3/pcy_int.h head/crypto/openssl/crypto/x509v3/pcy_map.c head/crypto/openssl/crypto/x509v3/pcy_node.c head/crypto/openssl/crypto/x509v3/pcy_tree.c head/crypto/openssl/crypto/x509v3/v3_addr.c head/crypto/openssl/crypto/x509v3/v3_alt.c head/crypto/openssl/crypto/x509v3/v3_asid.c head/crypto/openssl/crypto/x509v3/v3_conf.c head/crypto/openssl/crypto/x509v3/v3_cpols.c head/crypto/openssl/crypto/x509v3/v3_crld.c head/crypto/openssl/crypto/x509v3/v3_enum.c head/crypto/openssl/crypto/x509v3/v3_extku.c head/crypto/openssl/crypto/x509v3/v3_genn.c head/crypto/openssl/crypto/x509v3/v3_lib.c head/crypto/openssl/crypto/x509v3/v3_ncons.c head/crypto/openssl/crypto/x509v3/v3_ocsp.c head/crypto/openssl/crypto/x509v3/v3_pci.c head/crypto/openssl/crypto/x509v3/v3_pcons.c head/crypto/openssl/crypto/x509v3/v3_pmaps.c head/crypto/openssl/crypto/x509v3/v3_prn.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/crypto/x509v3/v3_skey.c head/crypto/openssl/crypto/x509v3/v3_utl.c head/crypto/openssl/crypto/x509v3/v3err.c head/crypto/openssl/crypto/x509v3/x509v3.h head/crypto/openssl/crypto/x86_64cpuid.pl head/crypto/openssl/crypto/x86cpuid.pl head/crypto/openssl/doc/apps/asn1parse.pod head/crypto/openssl/doc/apps/ca.pod head/crypto/openssl/doc/apps/ciphers.pod head/crypto/openssl/doc/apps/config.pod head/crypto/openssl/doc/apps/dgst.pod head/crypto/openssl/doc/apps/dhparam.pod head/crypto/openssl/doc/apps/dsa.pod head/crypto/openssl/doc/apps/dsaparam.pod head/crypto/openssl/doc/apps/ec.pod head/crypto/openssl/doc/apps/ecparam.pod head/crypto/openssl/doc/apps/enc.pod head/crypto/openssl/doc/apps/gendsa.pod head/crypto/openssl/doc/apps/genrsa.pod head/crypto/openssl/doc/apps/ocsp.pod head/crypto/openssl/doc/apps/openssl.pod head/crypto/openssl/doc/apps/pkcs12.pod head/crypto/openssl/doc/apps/pkcs7.pod head/crypto/openssl/doc/apps/pkcs8.pod head/crypto/openssl/doc/apps/req.pod head/crypto/openssl/doc/apps/rsa.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/smime.pod head/crypto/openssl/doc/apps/speed.pod head/crypto/openssl/doc/apps/spkac.pod head/crypto/openssl/doc/apps/verify.pod head/crypto/openssl/doc/apps/x509.pod head/crypto/openssl/doc/apps/x509v3_config.pod head/crypto/openssl/doc/crypto/ASN1_generate_nconf.pod head/crypto/openssl/doc/crypto/BIO_f_md.pod head/crypto/openssl/doc/crypto/BIO_f_ssl.pod head/crypto/openssl/doc/crypto/BIO_s_file.pod head/crypto/openssl/doc/crypto/BIO_s_mem.pod head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod head/crypto/openssl/doc/crypto/DSA_get_ex_new_index.pod head/crypto/openssl/doc/crypto/EVP_DigestInit.pod head/crypto/openssl/doc/crypto/EVP_SignInit.pod head/crypto/openssl/doc/crypto/EVP_VerifyInit.pod head/crypto/openssl/doc/crypto/PKCS7_encrypt.pod head/crypto/openssl/doc/crypto/PKCS7_sign.pod head/crypto/openssl/doc/crypto/SMIME_write_PKCS7.pod head/crypto/openssl/doc/crypto/d2i_RSAPublicKey.pod head/crypto/openssl/doc/crypto/ecdsa.pod head/crypto/openssl/doc/crypto/evp.pod head/crypto/openssl/doc/crypto/hmac.pod head/crypto/openssl/doc/crypto/lhash.pod head/crypto/openssl/doc/crypto/threads.pod head/crypto/openssl/doc/ssl/SSL_CTX_new.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_mode.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_ssl_version.pod head/crypto/openssl/doc/ssl/SSL_alert_type_string.pod head/crypto/openssl/doc/ssl/SSL_library_init.pod head/crypto/openssl/doc/ssl/ssl.pod head/crypto/openssl/doc/ssleay.txt head/crypto/openssl/doc/standards.txt head/crypto/openssl/e_os.h head/crypto/openssl/e_os2.h head/crypto/openssl/engines/Makefile head/crypto/openssl/engines/e_4758cca.c head/crypto/openssl/engines/e_aep.c head/crypto/openssl/engines/e_capi.c head/crypto/openssl/engines/e_capi_err.c head/crypto/openssl/engines/e_chil.c head/crypto/openssl/engines/e_gmp.c head/crypto/openssl/engines/e_sureware.c head/crypto/openssl/engines/e_ubsec.c head/crypto/openssl/ssl/Makefile head/crypto/openssl/ssl/bio_ssl.c head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_clnt.c head/crypto/openssl/ssl/d1_enc.c head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/d1_meth.c head/crypto/openssl/ssl/d1_pkt.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/dtls1.h head/crypto/openssl/ssl/kssl.c head/crypto/openssl/ssl/kssl.h head/crypto/openssl/ssl/kssl_lcl.h head/crypto/openssl/ssl/s23_clnt.c head/crypto/openssl/ssl/s23_lib.c head/crypto/openssl/ssl/s23_meth.c head/crypto/openssl/ssl/s23_srvr.c head/crypto/openssl/ssl/s2_clnt.c head/crypto/openssl/ssl/s2_enc.c head/crypto/openssl/ssl/s2_lib.c head/crypto/openssl/ssl/s2_meth.c head/crypto/openssl/ssl/s2_pkt.c head/crypto/openssl/ssl/s2_srvr.c head/crypto/openssl/ssl/s3_both.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_meth.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl2.h head/crypto/openssl/ssl/ssl3.h head/crypto/openssl/ssl/ssl_algs.c head/crypto/openssl/ssl/ssl_asn1.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_sess.c head/crypto/openssl/ssl/ssl_stat.c head/crypto/openssl/ssl/ssl_txt.c head/crypto/openssl/ssl/ssltest.c head/crypto/openssl/ssl/t1_clnt.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/t1_meth.c head/crypto/openssl/ssl/t1_srvr.c head/crypto/openssl/ssl/tls1.h head/crypto/openssl/util/ck_errf.pl head/crypto/openssl/util/clean-depend.pl head/crypto/openssl/util/domd head/crypto/openssl/util/libeay.num head/crypto/openssl/util/mk1mf.pl head/crypto/openssl/util/mkdef.pl head/crypto/openssl/util/mkerr.pl head/crypto/openssl/util/mkfiles.pl head/crypto/openssl/util/mklink.pl head/crypto/openssl/util/mkstack.pl head/crypto/openssl/util/pl/BC-32.pl head/crypto/openssl/util/pl/Mingw32.pl head/crypto/openssl/util/pl/VC-32.pl head/crypto/openssl/util/pl/netware.pl head/crypto/openssl/util/point.sh head/crypto/openssl/util/selftest.pl head/crypto/openssl/util/shlib_wrap.sh head/crypto/openssl/util/ssleay.num head/lib/libfetch/common.h head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/engines/Makefile head/secure/lib/libcrypto/engines/Makefile.inc head/secure/lib/libcrypto/i386/bf-586.s head/secure/lib/libcrypto/i386/bf-686.s head/secure/lib/libcrypto/i386/bn-586.s head/secure/lib/libcrypto/i386/cast-586.s head/secure/lib/libcrypto/i386/co-586.s head/secure/lib/libcrypto/i386/crypt586.s head/secure/lib/libcrypto/i386/des-586.s head/secure/lib/libcrypto/i386/md5-586.s head/secure/lib/libcrypto/i386/rc4-586.s head/secure/lib/libcrypto/i386/rc5-586.s head/secure/lib/libcrypto/i386/rmd-586.s head/secure/lib/libcrypto/i386/sha1-586.s head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 (contents, props changed) head/secure/lib/libcrypto/man/ASN1_STRING_length.3 (contents, props changed) head/secure/lib/libcrypto/man/ASN1_STRING_new.3 (contents, props changed) head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 (contents, props changed) head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_ctrl.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_base64.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_buffer.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_cipher.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_md.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_null.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_f_ssl.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_find_type.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_new.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_push.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_read.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_accept.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_bio.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_connect.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_fd.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_file.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_mem.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_null.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_s_socket.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_set_callback.3 (contents, props changed) head/secure/lib/libcrypto/man/BIO_should_retry.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_BLINDING_new.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_CTX_new.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_CTX_start.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_add.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_add_word.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_bn2bin.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_cmp.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_copy.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_generate_prime.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_mod_inverse.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_new.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_num_bytes.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_rand.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_set_bit.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_swap.3 (contents, props changed) head/secure/lib/libcrypto/man/BN_zero.3 (contents, props changed) head/secure/lib/libcrypto/man/CONF_modules_free.3 (contents, props changed) head/secure/lib/libcrypto/man/CONF_modules_load_file.3 (contents, props changed) head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_generate_key.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_generate_parameters.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_new.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_set_method.3 (contents, props changed) head/secure/lib/libcrypto/man/DH_size.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_SIG_new.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_do_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_dup_DH.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_generate_key.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_generate_parameters.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_new.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_set_method.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/DSA_size.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_GET_LIB.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_clear_error.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_error_string.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_get_error.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_load_strings.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_print_errors.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_put_error.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_remove_state.3 (contents, props changed) head/secure/lib/libcrypto/man/ERR_set_mark.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_BytesToKey.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_DigestInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_EncryptInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_OpenInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_new.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_SealInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_SignInit.3 (contents, props changed) head/secure/lib/libcrypto/man/EVP_VerifyInit.3 (contents, props changed) head/secure/lib/libcrypto/man/OBJ_nid2obj.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_Applink.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_config.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 (contents, props changed) head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 (contents, props changed) head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS12_create.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS12_parse.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS7_decrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS7_encrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS7_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/PKCS7_verify.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_add.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_bytes.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_cleanup.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_egd.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_load_file.3 (contents, props changed) head/secure/lib/libcrypto/man/RAND_set_rand_method.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_blinding_on.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_check_key.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_generate_key.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_new.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_print.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_private_encrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_public_encrypt.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_set_method.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_sign.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 (contents, props changed) head/secure/lib/libcrypto/man/RSA_size.3 (contents, props changed) head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 (contents, props changed) head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 (contents, props changed) head/secure/lib/libcrypto/man/X509_new.3 (contents, props changed) head/secure/lib/libcrypto/man/bio.3 (contents, props changed) head/secure/lib/libcrypto/man/blowfish.3 (contents, props changed) head/secure/lib/libcrypto/man/bn.3 (contents, props changed) head/secure/lib/libcrypto/man/bn_internal.3 (contents, props changed) head/secure/lib/libcrypto/man/buffer.3 (contents, props changed) head/secure/lib/libcrypto/man/crypto.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_DHparams.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509_CRL.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509_NAME.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509_REQ.3 (contents, props changed) head/secure/lib/libcrypto/man/d2i_X509_SIG.3 (contents, props changed) head/secure/lib/libcrypto/man/des.3 (contents, props changed) head/secure/lib/libcrypto/man/dh.3 (contents, props changed) head/secure/lib/libcrypto/man/dsa.3 (contents, props changed) head/secure/lib/libcrypto/man/ecdsa.3 (contents, props changed) head/secure/lib/libcrypto/man/engine.3 (contents, props changed) head/secure/lib/libcrypto/man/err.3 (contents, props changed) head/secure/lib/libcrypto/man/evp.3 (contents, props changed) head/secure/lib/libcrypto/man/hmac.3 (contents, props changed) head/secure/lib/libcrypto/man/lh_stats.3 (contents, props changed) head/secure/lib/libcrypto/man/lhash.3 (contents, props changed) head/secure/lib/libcrypto/man/md5.3 (contents, props changed) head/secure/lib/libcrypto/man/mdc2.3 (contents, props changed) head/secure/lib/libcrypto/man/pem.3 (contents, props changed) head/secure/lib/libcrypto/man/rand.3 (contents, props changed) head/secure/lib/libcrypto/man/rc4.3 (contents, props changed) head/secure/lib/libcrypto/man/ripemd.3 (contents, props changed) head/secure/lib/libcrypto/man/rsa.3 (contents, props changed) head/secure/lib/libcrypto/man/sha.3 (contents, props changed) head/secure/lib/libcrypto/man/threads.3 (contents, props changed) head/secure/lib/libcrypto/man/ui.3 (contents, props changed) head/secure/lib/libcrypto/man/ui_compat.3 (contents, props changed) head/secure/lib/libcrypto/man/x509.3 (contents, props changed) head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-ia64.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libssl/Makefile head/secure/lib/libssl/Makefile.man head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 (contents, props changed) head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_add_session.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_ctrl.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_free.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_new.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_sess_number.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_sessions.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_mode.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_options.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_set_verify.3 (contents, props changed) head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 (contents, props changed) head/secure/lib/libssl/man/SSL_SESSION_free.3 (contents, props changed) head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 (contents, props changed) head/secure/lib/libssl/man/SSL_SESSION_get_time.3 (contents, props changed) head/secure/lib/libssl/man/SSL_accept.3 (contents, props changed) head/secure/lib/libssl/man/SSL_alert_type_string.3 (contents, props changed) head/secure/lib/libssl/man/SSL_clear.3 (contents, props changed) head/secure/lib/libssl/man/SSL_connect.3 (contents, props changed) head/secure/lib/libssl/man/SSL_do_handshake.3 (contents, props changed) head/secure/lib/libssl/man/SSL_free.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_ciphers.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_client_CA_list.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_current_cipher.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_default_timeout.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_error.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_ex_new_index.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_fd.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_peer_certificate.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_rbio.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_session.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_verify_result.3 (contents, props changed) head/secure/lib/libssl/man/SSL_get_version.3 (contents, props changed) head/secure/lib/libssl/man/SSL_library_init.3 (contents, props changed) head/secure/lib/libssl/man/SSL_load_client_CA_file.3 (contents, props changed) head/secure/lib/libssl/man/SSL_new.3 (contents, props changed) head/secure/lib/libssl/man/SSL_pending.3 (contents, props changed) head/secure/lib/libssl/man/SSL_read.3 (contents, props changed) head/secure/lib/libssl/man/SSL_rstate_string.3 (contents, props changed) head/secure/lib/libssl/man/SSL_session_reused.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_bio.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_connect_state.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_fd.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_session.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_shutdown.3 (contents, props changed) head/secure/lib/libssl/man/SSL_set_verify_result.3 (contents, props changed) head/secure/lib/libssl/man/SSL_shutdown.3 (contents, props changed) head/secure/lib/libssl/man/SSL_state_string.3 (contents, props changed) head/secure/lib/libssl/man/SSL_want.3 (contents, props changed) head/secure/lib/libssl/man/SSL_write.3 (contents, props changed) head/secure/lib/libssl/man/d2i_SSL_SESSION.3 (contents, props changed) head/secure/lib/libssl/man/ssl.3 (contents, props changed) head/secure/usr.bin/openssl/Makefile head/secure/usr.bin/openssl/Makefile.man head/secure/usr.bin/openssl/man/CA.pl.1 (contents, props changed) head/secure/usr.bin/openssl/man/asn1parse.1 (contents, props changed) head/secure/usr.bin/openssl/man/ca.1 (contents, props changed) head/secure/usr.bin/openssl/man/ciphers.1 (contents, props changed) head/secure/usr.bin/openssl/man/crl.1 (contents, props changed) head/secure/usr.bin/openssl/man/crl2pkcs7.1 (contents, props changed) head/secure/usr.bin/openssl/man/dgst.1 (contents, props changed) head/secure/usr.bin/openssl/man/dhparam.1 (contents, props changed) head/secure/usr.bin/openssl/man/dsa.1 (contents, props changed) head/secure/usr.bin/openssl/man/dsaparam.1 (contents, props changed) head/secure/usr.bin/openssl/man/ec.1 (contents, props changed) head/secure/usr.bin/openssl/man/ecparam.1 (contents, props changed) head/secure/usr.bin/openssl/man/enc.1 (contents, props changed) head/secure/usr.bin/openssl/man/errstr.1 (contents, props changed) head/secure/usr.bin/openssl/man/gendsa.1 (contents, props changed) head/secure/usr.bin/openssl/man/genrsa.1 (contents, props changed) head/secure/usr.bin/openssl/man/nseq.1 (contents, props changed) head/secure/usr.bin/openssl/man/ocsp.1 (contents, props changed) head/secure/usr.bin/openssl/man/openssl.1 (contents, props changed) head/secure/usr.bin/openssl/man/passwd.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkcs12.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkcs7.1 (contents, props changed) head/secure/usr.bin/openssl/man/pkcs8.1 (contents, props changed) head/secure/usr.bin/openssl/man/rand.1 (contents, props changed) head/secure/usr.bin/openssl/man/req.1 (contents, props changed) head/secure/usr.bin/openssl/man/rsa.1 (contents, props changed) head/secure/usr.bin/openssl/man/rsautl.1 (contents, props changed) head/secure/usr.bin/openssl/man/s_client.1 (contents, props changed) head/secure/usr.bin/openssl/man/s_server.1 (contents, props changed) head/secure/usr.bin/openssl/man/s_time.1 (contents, props changed) head/secure/usr.bin/openssl/man/sess_id.1 (contents, props changed) head/secure/usr.bin/openssl/man/smime.1 (contents, props changed) head/secure/usr.bin/openssl/man/speed.1 (contents, props changed) head/secure/usr.bin/openssl/man/spkac.1 (contents, props changed) head/secure/usr.bin/openssl/man/verify.1 (contents, props changed) head/secure/usr.bin/openssl/man/version.1 (contents, props changed) head/secure/usr.bin/openssl/man/x509.1 (contents, props changed) head/secure/usr.bin/openssl/man/x509v3_config.1 (contents, props changed) head/sys/sys/param.h Directory Properties: head/crypto/openssl/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 12 19:15:38 2012 (r238404) +++ head/ObsoleteFiles.inc Thu Jul 12 19:30:53 2012 (r238405) @@ -38,6 +38,22 @@ # xargs -n1 | sort | uniq -d; # done +# 20120712: OpenSSL 1.0.1c import +OLD_FILES+=lib/libcrypto.so.6 +OLD_FILES+=usr/include/openssl/aes_locl.h +OLD_FILES+=usr/include/openssl/bio_lcl.h +OLD_FILES+=usr/include/openssl/e_os.h +OLD_FILES+=usr/include/openssl/fips.h +OLD_FILES+=usr/include/openssl/fips_rand.h +OLD_FILES+=usr/include/openssl/md2.h +OLD_FILES+=usr/include/openssl/pq_compat.h +OLD_FILES+=usr/include/openssl/store.h +OLD_FILES+=usr/include/openssl/tmdiff.h +OLD_FILES+=usr/include/openssl/ui_locl.h +OLD_FILES+=usr/lib/libssl.so.6 +OLD_FILES+=usr/lib32/libcrypto.so.6 +OLD_FILES+=usr/lib32/libssl.so.6 +OLD_FILES+=usr/share/openssl/man/man3/CRYPTO_set_id_callback.3.gz # 20120621: remove old man page OLD_FILES+=usr/share/man/man8/vnconfig.8.gz # 20120613: auth.conf removed Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jul 12 19:15:38 2012 (r238404) +++ head/UPDATING Thu Jul 12 19:30:53 2012 (r238405) @@ -25,6 +25,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20120712: + The OpenSSL has been upgraded to 1.0.1c. Any binaries requiring + libcrypto.so.6 or libssl.so.6 must be recompiled. Also, there are + configuration changes. Make sure to merge /etc/ssl/openssl.cnf. + +20120712: The following sysctls and tunables have been renamed for consistency with other variables: kern.cam.da.da_send_ordered -> kern.cam.da.send_ordered Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Thu Jul 12 19:15:38 2012 (r238404) +++ head/crypto/openssl/CHANGES Thu Jul 12 19:30:53 2012 (r238405) @@ -2,10 +2,10 @@ OpenSSL CHANGES _______________ - Changes between 0.9.8w and 0.9.8x [10 May 2012] + Changes between 1.0.1b and 1.0.1c [10 May 2012] - *) Sanity check record length before skipping explicit IV in DTLS - to fix DoS attack. + *) Sanity check record length before skipping explicit IV in TLS + 1.2, 1.1 and DTLS to fix DoS attack. Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic fuzzing as a service testing platform. @@ -16,15 +16,34 @@ Thanks to Solar Designer of Openwall for reporting this issue. [Steve Henson] - Changes between 0.9.8v and 0.9.8w [23 Apr 2012] + *) In FIPS mode don't try to use composite ciphers as they are not + approved. + [Steve Henson] - *) The fix for CVE-2012-2110 did not take into account that the - 'len' argument to BUF_MEM_grow and BUF_MEM_grow_clean is an - int in OpenSSL 0.9.8, making it still vulnerable. Fix by - rejecting negative len parameter. (CVE-2012-2131) - [Tomas Hoger ] + Changes between 1.0.1a and 1.0.1b [26 Apr 2012] + + *) OpenSSL 1.0.0 sets SSL_OP_ALL to 0x80000FFFL and OpenSSL 1.0.1 and + 1.0.1a set SSL_OP_NO_TLSv1_1 to 0x00000400L which would unfortunately + mean any application compiled against OpenSSL 1.0.0 headers setting + SSL_OP_ALL would also set SSL_OP_NO_TLSv1_1, unintentionally disablng + TLS 1.1 also. Fix this by changing the value of SSL_OP_NO_TLSv1_1 to + 0x10000000L Any application which was previously compiled against + OpenSSL 1.0.1 or 1.0.1a headers and which cares about SSL_OP_NO_TLSv1_1 + will need to be recompiled as a result. Letting be results in + inability to disable specifically TLS 1.1 and in client context, + in unlike event, limit maximum offered version to TLS 1.0 [see below]. + [Steve Henson] + + *) In order to ensure interoperabilty SSL_OP_NO_protocolX does not + disable just protocol X, but all protocols above X *if* there are + protocols *below* X still enabled. In more practical terms it means + that if application wants to disable TLS1.0 in favor of TLS1.1 and + above, it's not sufficient to pass SSL_OP_NO_TLSv1, one has to pass + SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. This applies to + client side. + [Andy Polyakov] - Changes between 0.9.8u and 0.9.8v [19 Apr 2012] + Changes between 1.0.1 and 1.0.1a [19 Apr 2012] *) Check for potentially exploitable overflows in asn1_d2i_read_bio BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer @@ -35,7 +54,310 @@ (CVE-2012-2110) [Adam Langley (Google), Tavis Ormandy, Google Security Team] - Changes between 0.9.8t and 0.9.8u [12 Mar 2012] + *) Don't allow TLS 1.2 SHA-256 ciphersuites in TLS 1.0, 1.1 connections. + [Adam Langley] + + *) Workarounds for some broken servers that "hang" if a client hello + record length exceeds 255 bytes. + + 1. Do not use record version number > TLS 1.0 in initial client + hello: some (but not all) hanging servers will now work. + 2. If we set OPENSSL_MAX_TLS1_2_CIPHER_LENGTH this will truncate + the number of ciphers sent in the client hello. This should be + set to an even number, such as 50, for example by passing: + -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 to config or Configure. + Most broken servers should now work. + 3. If all else fails setting OPENSSL_NO_TLS1_2_CLIENT will disable + TLS 1.2 client support entirely. + [Steve Henson] + + *) Fix SEGV in Vector Permutation AES module observed in OpenSSH. + [Andy Polyakov] + + Changes between 1.0.0h and 1.0.1 [14 Mar 2012] + + *) Add compatibility with old MDC2 signatures which use an ASN1 OCTET + STRING form instead of a DigestInfo. + [Steve Henson] + + *) The format used for MDC2 RSA signatures is inconsistent between EVP + and the RSA_sign/RSA_verify functions. This was made more apparent when + OpenSSL used RSA_sign/RSA_verify for some RSA signatures in particular + those which went through EVP_PKEY_METHOD in 1.0.0 and later. Detect + the correct format in RSA_verify so both forms transparently work. + [Steve Henson] + + *) Some servers which support TLS 1.0 can choke if we initially indicate + support for TLS 1.2 and later renegotiate using TLS 1.0 in the RSA + encrypted premaster secret. As a workaround use the maximum pemitted + client version in client hello, this should keep such servers happy + and still work with previous versions of OpenSSL. + [Steve Henson] + + *) Add support for TLS/DTLS heartbeats. + [Robin Seggelmann ] + + *) Add support for SCTP. + [Robin Seggelmann ] + + *) Improved PRNG seeding for VOS. + [Paul Green ] + + *) Extensive assembler packs updates, most notably: + + - x86[_64]: AES-NI, PCLMULQDQ, RDRAND support; + - x86[_64]: SSSE3 support (SHA1, vector-permutation AES); + - x86_64: bit-sliced AES implementation; + - ARM: NEON support, contemporary platforms optimizations; + - s390x: z196 support; + - *: GHASH and GF(2^m) multiplication implementations; + + [Andy Polyakov] + + *) Make TLS-SRP code conformant with RFC 5054 API cleanup + (removal of unnecessary code) + [Peter Sylvester ] + + *) Add TLS key material exporter from RFC 5705. + [Eric Rescorla] + + *) Add DTLS-SRTP negotiation from RFC 5764. + [Eric Rescorla] + + *) Add Next Protocol Negotiation, + http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00. Can be + disabled with a no-npn flag to config or Configure. Code donated + by Google. + [Adam Langley and Ben Laurie] + + *) Add optional 64-bit optimized implementations of elliptic curves NIST-P224, + NIST-P256, NIST-P521, with constant-time single point multiplication on + typical inputs. Compiler support for the nonstandard type __uint128_t is + required to use this (present in gcc 4.4 and later, for 64-bit builds). + Code made available under Apache License version 2.0. + + Specify "enable-ec_nistp_64_gcc_128" on the Configure (or config) command + line to include this in your build of OpenSSL, and run "make depend" (or + "make update"). This enables the following EC_METHODs: + + EC_GFp_nistp224_method() + EC_GFp_nistp256_method() + EC_GFp_nistp521_method() + + EC_GROUP_new_by_curve_name() will automatically use these (while + EC_GROUP_new_curve_GFp() currently prefers the more flexible + implementations). + [Emilia Käsper, Adam Langley, Bodo Moeller (Google)] + + *) Use type ossl_ssize_t instad of ssize_t which isn't available on + all platforms. Move ssize_t definition from e_os.h to the public + header file e_os2.h as it now appears in public header file cms.h + [Steve Henson] + + *) New -sigopt option to the ca, req and x509 utilities. Additional + signature parameters can be passed using this option and in + particular PSS. + [Steve Henson] + + *) Add RSA PSS signing function. This will generate and set the + appropriate AlgorithmIdentifiers for PSS based on those in the + corresponding EVP_MD_CTX structure. No application support yet. + [Steve Henson] + + *) Support for companion algorithm specific ASN1 signing routines. + New function ASN1_item_sign_ctx() signs a pre-initialised + EVP_MD_CTX structure and sets AlgorithmIdentifiers based on + the appropriate parameters. + [Steve Henson] + + *) Add new algorithm specific ASN1 verification initialisation function + to EVP_PKEY_ASN1_METHOD: this is not in EVP_PKEY_METHOD since the ASN1 + handling will be the same no matter what EVP_PKEY_METHOD is used. + Add a PSS handler to support verification of PSS signatures: checked + against a number of sample certificates. + [Steve Henson] + + *) Add signature printing for PSS. Add PSS OIDs. + [Steve Henson, Martin Kaiser ] + + *) Add algorithm specific signature printing. An individual ASN1 method + can now print out signatures instead of the standard hex dump. + + More complex signatures (e.g. PSS) can print out more meaningful + information. Include DSA version that prints out the signature + parameters r, s. + [Steve Henson] + + *) Password based recipient info support for CMS library: implementing + RFC3211. + [Steve Henson] + + *) Split password based encryption into PBES2 and PBKDF2 functions. This + neatly separates the code into cipher and PBE sections and is required + for some algorithms that split PBES2 into separate pieces (such as + password based CMS). + [Steve Henson] + + *) Session-handling fixes: + - Fix handling of connections that are resuming with a session ID, + but also support Session Tickets. + - Fix a bug that suppressed issuing of a new ticket if the client + presented a ticket with an expired session. + - Try to set the ticket lifetime hint to something reasonable. + - Make tickets shorter by excluding irrelevant information. + - On the client side, don't ignore renewed tickets. + [Adam Langley, Bodo Moeller (Google)] + + *) Fix PSK session representation. + [Bodo Moeller] + + *) Add RC4-MD5 and AESNI-SHA1 "stitched" implementations. + + This work was sponsored by Intel. + [Andy Polyakov] + + *) Add GCM support to TLS library. Some custom code is needed to split + the IV between the fixed (from PRF) and explicit (from TLS record) + portions. This adds all GCM ciphersuites supported by RFC5288 and + RFC5289. Generalise some AES* cipherstrings to inlclude GCM and + add a special AESGCM string for GCM only. + [Steve Henson] + + *) Expand range of ctrls for AES GCM. Permit setting invocation + field on decrypt and retrieval of invocation field only on encrypt. + [Steve Henson] + + *) Add HMAC ECC ciphersuites from RFC5289. Include SHA384 PRF support. + As required by RFC5289 these ciphersuites cannot be used if for + versions of TLS earlier than 1.2. + [Steve Henson] + + *) For FIPS capable OpenSSL interpret a NULL default public key method + as unset and return the appopriate default but do *not* set the default. + This means we can return the appopriate method in applications that + swicth between FIPS and non-FIPS modes. + [Steve Henson] + + *) Redirect HMAC and CMAC operations to FIPS module in FIPS mode. If an + ENGINE is used then we cannot handle that in the FIPS module so we + keep original code iff non-FIPS operations are allowed. + [Steve Henson] + + *) Add -attime option to openssl utilities. + [Peter Eckersley , Ben Laurie and Steve Henson] + + *) Redirect DSA and DH operations to FIPS module in FIPS mode. + [Steve Henson] + + *) Redirect ECDSA and ECDH operations to FIPS module in FIPS mode. Also use + FIPS EC methods unconditionally for now. + [Steve Henson] + + *) New build option no-ec2m to disable characteristic 2 code. + [Steve Henson] + + *) Backport libcrypto audit of return value checking from 1.1.0-dev; not + all cases can be covered as some introduce binary incompatibilities. + [Steve Henson] + + *) Redirect RSA operations to FIPS module including keygen, + encrypt, decrypt, sign and verify. Block use of non FIPS RSA methods. + [Steve Henson] + + *) Add similar low level API blocking to ciphers. + [Steve Henson] + + *) Low level digest APIs are not approved in FIPS mode: any attempt + to use these will cause a fatal error. Applications that *really* want + to use them can use the private_* version instead. + [Steve Henson] + + *) Redirect cipher operations to FIPS module for FIPS builds. + [Steve Henson] + + *) Redirect digest operations to FIPS module for FIPS builds. + [Steve Henson] + + *) Update build system to add "fips" flag which will link in fipscanister.o + for static and shared library builds embedding a signature if needed. + [Steve Henson] + + *) Output TLS supported curves in preference order instead of numerical + order. This is currently hardcoded for the highest order curves first. + This should be configurable so applications can judge speed vs strength. + [Steve Henson] + + *) Add TLS v1.2 server support for client authentication. + [Steve Henson] + + *) Add support for FIPS mode in ssl library: disable SSLv3, non-FIPS ciphers + and enable MD5. + [Steve Henson] + + *) Functions FIPS_mode_set() and FIPS_mode() which call the underlying + FIPS modules versions. + [Steve Henson] + + *) Add TLS v1.2 client side support for client authentication. Keep cache + of handshake records longer as we don't know the hash algorithm to use + until after the certificate request message is received. + [Steve Henson] + + *) Initial TLS v1.2 client support. Add a default signature algorithms + extension including all the algorithms we support. Parse new signature + format in client key exchange. Relax some ECC signing restrictions for + TLS v1.2 as indicated in RFC5246. + [Steve Henson] + + *) Add server support for TLS v1.2 signature algorithms extension. Switch + to new signature format when needed using client digest preference. + All server ciphersuites should now work correctly in TLS v1.2. No client + support yet and no support for client certificates. + [Steve Henson] + + *) Initial TLS v1.2 support. Add new SHA256 digest to ssl code, switch + to SHA256 for PRF when using TLS v1.2 and later. Add new SHA256 based + ciphersuites. At present only RSA key exchange ciphersuites work with + TLS v1.2. Add new option for TLS v1.2 replacing the old and obsolete + SSL_OP_PKCS1_CHECK flags with SSL_OP_NO_TLSv1_2. New TLSv1.2 methods + and version checking. + [Steve Henson] + + *) New option OPENSSL_NO_SSL_INTERN. If an application can be compiled + with this defined it will not be affected by any changes to ssl internal + structures. Add several utility functions to allow openssl application + to work with OPENSSL_NO_SSL_INTERN defined. + [Steve Henson] + + *) Add SRP support. + [Tom Wu and Ben Laurie] + + *) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id. + [Steve Henson] + + *) Permit abbreviated handshakes when renegotiating using the function + SSL_renegotiate_abbreviated(). + [Robin Seggelmann ] + + *) Add call to ENGINE_register_all_complete() to + ENGINE_load_builtin_engines(), so some implementations get used + automatically instead of needing explicit application support. + [Steve Henson] + + *) Add support for TLS key exporter as described in RFC5705. + [Robin Seggelmann , Steve Henson] + + *) Initial TLSv1.1 support. Since TLSv1.1 is very similar to TLS v1.0 only + a few changes are required: + + Add SSL_OP_NO_TLSv1_1 flag. + Add TLSv1_1 methods. + Update version checking logic to handle version 1.1. + Add explicit IV handling (ported from DTLS code). + Add command line options to s_client/s_server. + [Steve Henson] + + Changes between 1.0.0g and 1.0.0h [12 Mar 2012] *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness in CMS and PKCS7 code. When RSA decryption fails use a random key for @@ -53,7 +375,7 @@ Ivan Nestlerode for discovering this bug. [Steve Henson] - Changes between 0.9.8s and 0.9.8t [18 Jan 2012] + Changes between 1.0.0f and 1.0.0g [18 Jan 2012] *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. Thanks to Antonio Martin, Enterprise Secure Access Research and @@ -61,6 +383,978 @@ preparing a fix. (CVE-2012-0050) [Antonio Martin] + Changes between 1.0.0e and 1.0.0f [4 Jan 2012] + + *) Nadhem Alfardan and Kenny Paterson have discovered an extension + of the Vaudenay padding oracle attack on CBC mode encryption + which enables an efficient plaintext recovery attack against + the OpenSSL implementation of DTLS. Their attack exploits timing + differences arising during decryption processing. A research + paper describing this attack can be found at: + http://www.isg.rhul.ac.uk/~kp/dtls.pdf + Thanks go to Nadhem Alfardan and Kenny Paterson of the Information + Security Group at Royal Holloway, University of London + (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann + and Michael Tuexen + for preparing the fix. (CVE-2011-4108) + [Robin Seggelmann, Michael Tuexen] + + *) Clear bytes used for block padding of SSL 3.0 records. + (CVE-2011-4576) + [Adam Langley (Google)] + + *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George + Kadianakis for discovering this issue and + Adam Langley for preparing the fix. (CVE-2011-4619) + [Adam Langley (Google)] + + *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027) + [Andrey Kulikov ] + + *) Prevent malformed RFC3779 data triggering an assertion failure. + Thanks to Andrew Chi, BBN Technologies, for discovering the flaw + and Rob Austein for fixing it. (CVE-2011-4577) + [Rob Austein ] + + *) Improved PRNG seeding for VOS. + [Paul Green ] + + *) Fix ssl_ciph.c set-up race. + [Adam Langley (Google)] + + *) Fix spurious failures in ecdsatest.c. + [Emilia Käsper (Google)] + + *) Fix the BIO_f_buffer() implementation (which was mixing different + interpretations of the '..._len' fields). + [Adam Langley (Google)] + + *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than + BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent + threads won't reuse the same blinding coefficients. + + This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING + lock to call BN_BLINDING_invert_ex, and avoids one use of + BN_BLINDING_update for each BN_BLINDING structure (previously, + the last update always remained unused). + [Emilia Käsper (Google)] + + *) In ssl3_clear, preserve s3->init_extra along with s3->rbuf. + [Bob Buckholz (Google)] + + Changes between 1.0.0d and 1.0.0e [6 Sep 2011] + + *) Fix bug where CRLs with nextUpdate in the past are sometimes accepted + by initialising X509_STORE_CTX properly. (CVE-2011-3207) + [Kaspar Brand ] + + *) Fix SSL memory handling for (EC)DH ciphersuites, in particular + for multi-threaded use of ECDH. (CVE-2011-3210) + [Adam Langley (Google)] + + *) Fix x509_name_ex_d2i memory leak on bad inputs. + [Bodo Moeller] + + *) Remove hard coded ecdsaWithSHA1 signature tests in ssl code and check + signature public key algorithm by using OID xref utilities instead. + Before this you could only use some ECC ciphersuites with SHA1 only. + [Steve Henson] + + *) Add protection against ECDSA timing attacks as mentioned in the paper + by Billy Bob Brumley and Nicola Tuveri, see: + + http://eprint.iacr.org/2011/232.pdf + + [Billy Bob Brumley and Nicola Tuveri] + + Changes between 1.0.0c and 1.0.0d [8 Feb 2011] + + *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014 + [Neel Mehta, Adam Langley, Bodo Moeller (Google)] + + *) Fix bug in string printing code: if *any* escaping is enabled we must + escape the escape character (backslash) or the resulting string is + ambiguous. + [Steve Henson] + + Changes between 1.0.0b and 1.0.0c [2 Dec 2010] + + *) Disable code workaround for ancient and obsolete Netscape browsers + and servers: an attacker can use it in a ciphersuite downgrade attack. + Thanks to Martin Rex for discovering this bug. CVE-2010-4180 + [Steve Henson] + + *) Fixed J-PAKE implementation error, originally discovered by + Sebastien Martini, further info and confirmation from Stefan + Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252 + [Ben Laurie] + + Changes between 1.0.0a and 1.0.0b [16 Nov 2010] + + *) Fix extension code to avoid race conditions which can result in a buffer + overrun vulnerability: resumed sessions must not be modified as they can + be shared by multiple threads. CVE-2010-3864 + [Steve Henson] + + *) Fix WIN32 build system to correctly link an ENGINE directory into + a DLL. + [Steve Henson] + + Changes between 1.0.0 and 1.0.0a [01 Jun 2010] + + *) Check return value of int_rsa_verify in pkey_rsa_verifyrecover + (CVE-2010-1633) + [Steve Henson, Peter-Michael Hager ] + + Changes between 0.9.8n and 1.0.0 [29 Mar 2010] + + *) Add "missing" function EVP_CIPHER_CTX_copy(). This copies a cipher + context. The operation can be customised via the ctrl mechanism in + case ENGINEs want to include additional functionality. + [Steve Henson] + + *) Tolerate yet another broken PKCS#8 key format: private key value negative. + [Steve Henson] + + *) Add new -subject_hash_old and -issuer_hash_old options to x509 utility to + output hashes compatible with older versions of OpenSSL. + [Willy Weisz ] + + *) Fix compression algorithm handling: if resuming a session use the + compression algorithm of the resumed session instead of determining + it from client hello again. Don't allow server to change algorithm. + [Steve Henson] + + *) Add load_crls() function to apps tidying load_certs() too. Add option + to verify utility to allow additional CRLs to be included. + [Steve Henson] + + *) Update OCSP request code to permit adding custom headers to the request: + some responders need this. + [Steve Henson] + + *) The function EVP_PKEY_sign() returns <=0 on error: check return code + correctly. + [Julia Lawall ] + + *) Update verify callback code in apps/s_cb.c and apps/verify.c, it + needlessly dereferenced structures, used obsolete functions and + didn't handle all updated verify codes correctly. + [Steve Henson] + + *) Disable MD2 in the default configuration. + [Steve Henson] + + *) In BIO_pop() and BIO_push() use the ctrl argument (which was NULL) to + indicate the initial BIO being pushed or popped. This makes it possible + to determine whether the BIO is the one explicitly called or as a result + of the ctrl being passed down the chain. Fix BIO_pop() and SSL BIOs so + it handles reference counts correctly and doesn't zero out the I/O bio + when it is not being explicitly popped. WARNING: applications which + included workarounds for the old buggy behaviour will need to be modified + or they could free up already freed BIOs. + [Steve Henson] + + *) Extend the uni2asc/asc2uni => OPENSSL_uni2asc/OPENSSL_asc2uni + renaming to all platforms (within the 0.9.8 branch, this was + done conditionally on Netware platforms to avoid a name clash). + [Guenter ] + + *) Add ECDHE and PSK support to DTLS. + [Michael Tuexen ] + + *) Add CHECKED_STACK_OF macro to safestack.h, otherwise safestack can't + be used on C++. + [Steve Henson] + + *) Add "missing" function EVP_MD_flags() (without this the only way to + retrieve a digest flags is by accessing the structure directly. Update + EVP_MD_do_all*() and EVP_CIPHER_do_all*() to include the name a digest + or cipher is registered as in the "from" argument. Print out all + registered digests in the dgst usage message instead of manually + attempting to work them out. + [Steve Henson] + + *) If no SSLv2 ciphers are used don't use an SSLv2 compatible client hello: + this allows the use of compression and extensions. Change default cipher + string to remove SSLv2 ciphersuites. This effectively avoids ancient SSLv2 + by default unless an application cipher string requests it. + [Steve Henson] + + *) Alter match criteria in PKCS12_parse(). It used to try to use local + key ids to find matching certificates and keys but some PKCS#12 files + don't follow the (somewhat unwritten) rules and this strategy fails. + Now just gather all certificates together and the first private key + then look for the first certificate that matches the key. + [Steve Henson] + + *) Support use of registered digest and cipher names for dgst and cipher + commands instead of having to add each one as a special case. So now + you can do: + + openssl sha256 foo + + as well as: + + openssl dgst -sha256 foo + + and this works for ENGINE based algorithms too. + + [Steve Henson] + + *) Update Gost ENGINE to support parameter files. + [Victor B. Wagner ] + + *) Support GeneralizedTime in ca utility. + [Oliver Martin , Steve Henson] + + *) Enhance the hash format used for certificate directory links. The new + form uses the canonical encoding (meaning equivalent names will work + even if they aren't identical) and uses SHA1 instead of MD5. This form + is incompatible with the older format and as a result c_rehash should + be used to rebuild symbolic links. + [Steve Henson] + + *) Make PKCS#8 the default write format for private keys, replacing the + traditional format. This form is standardised, more secure and doesn't + include an implicit MD5 dependency. + [Steve Henson] + + *) Add a $gcc_devteam_warn option to Configure. The idea is that any code + committed to OpenSSL should pass this lot as a minimum. + [Steve Henson] + + *) Add session ticket override functionality for use by EAP-FAST. + [Jouni Malinen ] + + *) Modify HMAC functions to return a value. Since these can be implemented + in an ENGINE errors can occur. + [Steve Henson] + + *) Type-checked OBJ_bsearch_ex. + [Ben Laurie] + + *) Type-checked OBJ_bsearch. Also some constification necessitated + by type-checking. Still to come: TXT_DB, bsearch(?), + OBJ_bsearch_ex, qsort, CRYPTO_EX_DATA, ASN1_VALUE, ASN1_STRING, + CONF_VALUE. + [Ben Laurie] + + *) New function OPENSSL_gmtime_adj() to add a specific number of days and + seconds to a tm structure directly, instead of going through OS + specific date routines. This avoids any issues with OS routines such + as the year 2038 bug. New *_adj() functions for ASN1 time structures + and X509_time_adj_ex() to cover the extended range. The existing + X509_time_adj() is still usable and will no longer have any date issues. + [Steve Henson] + + *) Delta CRL support. New use deltas option which will attempt to locate + and search any appropriate delta CRLs available. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for CRLs partitioned by reason code. Reorganise CRL processing + code and add additional score elements. Validate alternate CRL paths + as part of the CRL checking and indicate a new error "CRL path validation + error" in this case. Applications wanting additional details can use + the verify callback and check the new "parent" field. If this is not + NULL CRL path validation is taking place. Existing applications wont + see this because it requires extended CRL support which is off by + default. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for freshest CRL extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Initial indirect CRL support. Currently only supported in the CRLs + passed directly and not via lookup. Process certificate issuer + CRL entry extension and lookup CRL entries by bother issuer name + and serial number. Check and process CRL issuer entry in IDP extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Add support for distinct certificate and CRL paths. The CRL issuer + certificate is validated separately in this case. Only enabled if + an extended CRL support flag is set: this flag will enable additional + CRL functionality in future. + + This work was sponsored by Google. + [Steve Henson] + + *) Add support for policy mappings extension. + + This work was sponsored by Google. + [Steve Henson] + + *) Fixes to pathlength constraint, self issued certificate handling, + policy processing to align with RFC3280 and PKITS tests. + + This work was sponsored by Google. + [Steve Henson] + + *) Support for name constraints certificate extension. DN, email, DNS + and URI types are currently supported. + + This work was sponsored by Google. + [Steve Henson] + + *) To cater for systems that provide a pointer-based thread ID rather + than numeric, deprecate the current numeric thread ID mechanism and + replace it with a structure and associated callback type. This + mechanism allows a numeric "hash" to be extracted from a thread ID in + either case, and on platforms where pointers are larger than 'long', + mixing is done to help ensure the numeric 'hash' is usable even if it + can't be guaranteed unique. The default mechanism is to use "&errno" + as a pointer-based thread ID to distinguish between threads. + + Applications that want to provide their own thread IDs should now use + CRYPTO_THREADID_set_callback() to register a callback that will call + either CRYPTO_THREADID_set_numeric() or CRYPTO_THREADID_set_pointer(). + + Note that ERR_remove_state() is now deprecated, because it is tied + to the assumption that thread IDs are numeric. ERR_remove_state(0) + to free the current thread's error state should be replaced by + ERR_remove_thread_state(NULL). + + (This new approach replaces the functions CRYPTO_set_idptr_callback(), + CRYPTO_get_idptr_callback(), and CRYPTO_thread_idptr() that existed in + OpenSSL 0.9.9-dev between June 2006 and August 2008. Also, if an + application was previously providing a numeric thread callback that + was inappropriate for distinguishing threads, then uniqueness might + have been obtained with &errno that happened immediately in the + intermediate development versions of OpenSSL; this is no longer the + case, the numeric thread callback will now override the automatic use + of &errno.) + [Geoff Thorpe, with help from Bodo Moeller] + + *) Initial support for different CRL issuing certificates. This covers a + simple case where the self issued certificates in the chain exist and + the real CRL issuer is higher in the existing chain. + + This work was sponsored by Google. + [Steve Henson] + + *) Removed effectively defunct crypto/store from the build. + [Ben Laurie] + + *) Revamp of STACK to provide stronger type-checking. Still to come: + TXT_DB, bsearch(?), OBJ_bsearch, qsort, CRYPTO_EX_DATA, ASN1_VALUE, + ASN1_STRING, CONF_VALUE. + [Ben Laurie] + + *) Add a new SSL_MODE_RELEASE_BUFFERS mode flag to release unused buffer + RAM on SSL connections. This option can save about 34k per idle SSL. + [Nick Mathewson] + + *) Revamp of LHASH to provide stronger type-checking. Still to come: + STACK, TXT_DB, bsearch, qsort. + [Ben Laurie] + + *) Initial support for Cryptographic Message Syntax (aka CMS) based + on RFC3850, RFC3851 and RFC3852. New cms directory and cms utility, + support for data, signedData, compressedData, digestedData and + encryptedData, envelopedData types included. Scripts to check against + RFC4134 examples draft and interop and consistency checks of many + content types and variants. + [Steve Henson] + + *) Add options to enc utility to support use of zlib compression BIO. + [Steve Henson] + + *) Extend mk1mf to support importing of options and assembly language + files from Configure script, currently only included in VC-WIN32. + The assembly language rules can now optionally generate the source + files from the associated perl scripts. + [Steve Henson] + + *) Implement remaining functionality needed to support GOST ciphersuites. + Interop testing has been performed using CryptoPro implementations. + [Victor B. Wagner ] + + *) s390x assembler pack. + [Andy Polyakov] + + *) ARMv4 assembler pack. ARMv4 refers to v4 and later ISA, not CPU + "family." + [Andy Polyakov] + + *) Implement Opaque PRF Input TLS extension as specified in + draft-rescorla-tls-opaque-prf-input-00.txt. Since this is not an + official specification yet and no extension type assignment by + IANA exists, this extension (for now) will have to be explicitly + enabled when building OpenSSL by providing the extension number + to use. For example, specify an option + + -DTLSEXT_TYPE_opaque_prf_input=0x9527 + + to the "config" or "Configure" script to enable the extension, + assuming extension number 0x9527 (which is a completely arbitrary + and unofficial assignment based on the MD5 hash of the Internet + Draft). Note that by doing so, you potentially lose + interoperability with other TLS implementations since these might + be using the same extension number for other purposes. + + SSL_set_tlsext_opaque_prf_input(ssl, src, len) is used to set the + opaque PRF input value to use in the handshake. This will create + an interal copy of the length-'len' string at 'src', and will + return non-zero for success. + + To get more control and flexibility, provide a callback function + by using + + SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) + SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) + + where + + int (*cb)(SSL *, void *peerinput, size_t len, void *arg); + void *arg; + + Callback function 'cb' will be called in handshakes, and is + expected to use SSL_set_tlsext_opaque_prf_input() as appropriate. + Argument 'arg' is for application purposes (the value as given to + SSL_CTX_set_tlsext_opaque_prf_input_callback_arg() will directly + be provided to the callback function). The callback function + has to return non-zero to report success: usually 1 to use opaque + PRF input just if possible, or 2 to enforce use of the opaque PRF + input. In the latter case, the library will abort the handshake + if opaque PRF input is not successfully negotiated. + + Arguments 'peerinput' and 'len' given to the callback function + will always be NULL and 0 in the case of a client. A server will + see the client's opaque PRF input through these variables if + available (NULL and 0 otherwise). Note that if the server + provides an opaque PRF input, the length must be the same as the + length of the client's opaque PRF input. + + Note that the callback function will only be called when creating + a new session (session resumption can resume whatever was + previously negotiated), and will not be called in SSL 2.0 + handshakes; thus, SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) or + SSL_set_options(ssl, SSL_OP_NO_SSLv2) is especially recommended + for applications that need to enforce opaque PRF input. + + [Bodo Moeller] + + *) Update ssl code to support digests other than SHA1+MD5 for handshake + MAC. + + [Victor B. Wagner ] + + *) Add RFC4507 support to OpenSSL. This includes the corrections in + RFC4507bis. The encrypted ticket format is an encrypted encoded + SSL_SESSION structure, that way new session features are automatically + supported. + + If a client application caches session in an SSL_SESSION structure + support is transparent because tickets are now stored in the encoded + SSL_SESSION. + + The SSL_CTX structure automatically generates keys for ticket + protection in servers so again support should be possible + with no application modification. + + If a client or server wishes to disable RFC4507 support then the option + SSL_OP_NO_TICKET can be set. + + Add a TLS extension debugging callback to allow the contents of any client + or server extensions to be examined. + + This work was sponsored by Google. + [Steve Henson] + + *) Final changes to avoid use of pointer pointer casts in OpenSSL. + OpenSSL should now compile cleanly on gcc 4.2 + [Peter Hartley , Steve Henson] + + *) Update SSL library to use new EVP_PKEY MAC API. Include generic MAC + support including streaming MAC support: this is required for GOST + ciphersuite support. + [Victor B. Wagner , Steve Henson] + + *) Add option -stream to use PKCS#7 streaming in smime utility. New + function i2d_PKCS7_bio_stream() and PEM_write_PKCS7_bio_stream() + to output in BER and PEM format. + [Steve Henson] + + *) Experimental support for use of HMAC via EVP_PKEY interface. This + allows HMAC to be handled via the EVP_DigestSign*() interface. The + EVP_PKEY "key" in this case is the HMAC key, potentially allowing + ENGINE support for HMAC keys which are unextractable. New -mac and + -macopt options to dgst utility. + [Steve Henson] + + *) New option -sigopt to dgst utility. Update dgst to use + EVP_Digest{Sign,Verify}*. These two changes make it possible to use + alternative signing paramaters such as X9.31 or PSS in the dgst + utility. + [Steve Henson] + + *) Change ssl_cipher_apply_rule(), the internal function that does + the work each time a ciphersuite string requests enabling + ("foo+bar"), moving ("+foo+bar"), disabling ("-foo+bar", or + removing ("!foo+bar") a class of ciphersuites: Now it maintains + the order of disabled ciphersuites such that those ciphersuites + that most recently went from enabled to disabled not only stay + in order with respect to each other, but also have higher priority + than other disabled ciphersuites the next time ciphersuites are + enabled again. + + This means that you can now say, e.g., "PSK:-PSK:HIGH" to enable + the same ciphersuites as with "HIGH" alone, but in a specific + order where the PSK ciphersuites come first (since they are the + most recently disabled ciphersuites when "HIGH" is parsed). + + Also, change ssl_create_cipher_list() (using this new + funcionality) such that between otherwise identical + cihpersuites, ephemeral ECDH is preferred over ephemeral DH in + the default order. + [Bodo Moeller] + + *) Change ssl_create_cipher_list() so that it automatically + arranges the ciphersuites in reasonable order before starting + to process the rule string. Thus, the definition for "DEFAULT" + (SSL_DEFAULT_CIPHER_LIST) now is just "ALL:!aNULL:!eNULL", but + remains equivalent to "AES:ALL:!aNULL:!eNULL:+aECDH:+kRSA:+RC4:@STRENGTH". + This makes it much easier to arrive at a reasonable default order + in applications for which anonymous ciphers are OK (meaning + that you can't actually use DEFAULT). + [Bodo Moeller; suggested by Victor Duchovni] + + *) Split the SSL/TLS algorithm mask (as used for ciphersuite string + processing) into multiple integers instead of setting + "SSL_MKEY_MASK" bits, "SSL_AUTH_MASK" bits, "SSL_ENC_MASK", + "SSL_MAC_MASK", and "SSL_SSL_MASK" bits all in a single integer. + (These masks as well as the individual bit definitions are hidden + away into the non-exported interface ssl/ssl_locl.h, so this + change to the definition of the SSL_CIPHER structure shouldn't + affect applications.) This give us more bits for each of these + categories, so there is no longer a need to coagulate AES128 and + AES256 into a single algorithm bit, and to coagulate Camellia128 + and Camellia256 into a single algorithm bit, which has led to all + kinds of kludges. + + Thus, among other things, the kludge introduced in 0.9.7m and + 0.9.8e for masking out AES256 independently of AES128 or masking + out Camellia256 independently of AES256 is not needed here in 0.9.9. + + With the change, we also introduce new ciphersuite aliases that + so far were missing: "AES128", "AES256", "CAMELLIA128", and + "CAMELLIA256". + [Bodo Moeller] + + *) Add support for dsa-with-SHA224 and dsa-with-SHA256. + Use the leftmost N bytes of the signature input if the input is + larger than the prime q (with N being the size in bytes of q). + [Nils Larsch] + + *) Very *very* experimental PKCS#7 streaming encoder support. Nothing uses + it yet and it is largely untested. + [Steve Henson] + + *) Add support for the ecdsa-with-SHA224/256/384/512 signature types. + [Nils Larsch] + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:34:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CF941065672; Thu, 12 Jul 2012 19:34:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECD48FC16; Thu, 12 Jul 2012 19:34: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 q6CJYVFW025227; Thu, 12 Jul 2012 19:34:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CJYVKg025225; Thu, 12 Jul 2012 19:34:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207121934.q6CJYVKg025225@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 12 Jul 2012 19:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238406 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:34:31 -0000 Author: jkim Date: Thu Jul 12 19:34:30 2012 New Revision: 238406 URL: http://svn.freebsd.org/changeset/base/238406 Log: Remove myself after OpenSSL import. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Thu Jul 12 19:30:53 2012 (r238405) +++ svnadmin/conf/sizelimit.conf Thu Jul 12 19:34:30 2012 (r238406) @@ -27,7 +27,6 @@ gonzo imp jb jeff -jkim kmacy lstewart obrien From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:44:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F981065675 for ; Thu, 12 Jul 2012 19:44:42 +0000 (UTC) (envelope-from dougb@dougbarton.us) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 0E85C8FC15 for ; Thu, 12 Jul 2012 19:44:42 +0000 (UTC) Received: (qmail 11446 invoked by uid 399); 12 Jul 2012 19:44:27 -0000 Received: from unknown (HELO ?172.17.194.139?) (dougb@dougbarton.us@12.207.105.210) by mail2.fluidhosting.com with ESMTPAM; 12 Jul 2012 19:44:27 -0000 X-Originating-IP: 12.207.105.210 X-Sender: dougb@dougbarton.us Message-ID: <4FFF291E.4040104@dougbarton.us> Date: Thu, 12 Jul 2012 12:44:30 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jung-uk Kim References: <201207121930.q6CJUu97025034@svn.freebsd.org> In-Reply-To: <201207121930.q6CJUu97025034@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238405 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/apps/demoCA crypto/openssl/bugs crypto/openssl/certs/demo crypto/openssl/crypto crypto/openssl/crypto/aes crypto/o... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:44:42 -0000 On 07/12/2012 12:30 PM, Jung-uk Kim wrote: > Log: > Merge OpenSSL 1.0.1c. Can you describe how you did the merge? There are numerous red flags in the log. From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 19:52:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BF711065676; Thu, 12 Jul 2012 19:52:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EF7B78FC19; Thu, 12 Jul 2012 19:52:44 +0000 (UTC) Message-ID: <4FFF2B0C.3040400@FreeBSD.org> Date: Thu, 12 Jul 2012 15:52:44 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120626 Thunderbird/13.0.1 MIME-Version: 1.0 To: Doug Barton References: <201207121930.q6CJUu97025034@svn.freebsd.org> <4FFF291E.4040104@dougbarton.us> In-Reply-To: <4FFF291E.4040104@dougbarton.us> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238405 - in head: . crypto/openssl crypto/openssl/apps crypto/openssl/apps/demoCA crypto/openssl/bugs crypto/openssl/certs/demo crypto/openssl/crypto crypto/openssl/crypto/aes crypto/o... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 19:52:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-07-12 15:44:30 -0400, Doug Barton wrote: > On 07/12/2012 12:30 PM, Jung-uk Kim wrote: >> Log: Merge OpenSSL 1.0.1c. > > Can you describe how you did the merge? There are numerous red > flags in the log. It is mostly described here: http://svnweb.freebsd.org/base/vendor-crypto/openssl/dist/FREEBSD-upgrade?view=markup&pathrev=238384 Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk//KwwACgkQmlay1b9qnVMBaQCgwDGmJZoYob4uZQnvAZtI+fS2 xLUAnRcALk3ncpdZcOoktkuSikiKFgx4 =bm/l -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 21:31:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 552F6106566B; Thu, 12 Jul 2012 21:31:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB628FC16; Thu, 12 Jul 2012 21:31: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 q6CLVs9j030191; Thu, 12 Jul 2012 21:31:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CLVsij030189; Thu, 12 Jul 2012 21:31:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207122131.q6CLVsij030189@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 12 Jul 2012 21:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238407 - head/secure/lib/libcrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 21:31:54 -0000 Author: jkim Date: Thu Jul 12 21:31:53 2012 New Revision: 238407 URL: http://svn.freebsd.org/changeset/base/238407 Log: Sort ASM definitions by crypto module for slightly easier maintenance. Specifically, GHASH_ASM belongs to crypto/modes. Modified: head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Thu Jul 12 19:34:30 2012 (r238406) +++ head/secure/lib/libcrypto/Makefile.inc Thu Jul 12 21:31:53 2012 (r238407) @@ -22,16 +22,18 @@ CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m CFLAGS+=-DMD5_ASM +CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -CFLAGS+=-DWHIRLPOOL_ASM -DGHASH_ASM +CFLAGS+=-DWHIRLPOOL_ASM .elif ${MACHINE_CPUARCH} == "i386" CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m CFLAGS+=-DMD5_ASM +CFLAGS+=-DGHASH_ASM CFLAGS+=-DRMD160_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -CFLAGS+=-DWHIRLPOOL_ASM -DGHASH_ASM +CFLAGS+=-DWHIRLPOOL_ASM .endif MANDIR= ${SHAREDIR}/openssl/man/man From owner-svn-src-all@FreeBSD.ORG Thu Jul 12 23:11:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A67A01065673; Thu, 12 Jul 2012 23:11:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 926AB8FC20; Thu, 12 Jul 2012 23:11: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 q6CNBUSa034371; Thu, 12 Jul 2012 23:11:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6CNBUUS034369; Thu, 12 Jul 2012 23:11:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201207122311.q6CNBUUS034369@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 12 Jul 2012 23:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238412 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 23:11:30 -0000 Author: jkim Date: Thu Jul 12 23:11:30 2012 New Revision: 238412 URL: http://svn.freebsd.org/changeset/base/238412 Log: Fix the previous commit. Obsolete libraries must be added to OLD_LIBS. Pointyhat to: me Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 12 23:00:35 2012 (r238411) +++ head/ObsoleteFiles.inc Thu Jul 12 23:11:30 2012 (r238412) @@ -39,7 +39,10 @@ # done # 20120712: OpenSSL 1.0.1c import -OLD_FILES+=lib/libcrypto.so.6 +OLD_LIBS+=lib/libcrypto.so.6 +OLD_LIBS+=usr/lib/libssl.so.6 +OLD_LIBS+=usr/lib32/libcrypto.so.6 +OLD_LIBS+=usr/lib32/libssl.so.6 OLD_FILES+=usr/include/openssl/aes_locl.h OLD_FILES+=usr/include/openssl/bio_lcl.h OLD_FILES+=usr/include/openssl/e_os.h @@ -50,9 +53,6 @@ OLD_FILES+=usr/include/openssl/pq_compat OLD_FILES+=usr/include/openssl/store.h OLD_FILES+=usr/include/openssl/tmdiff.h OLD_FILES+=usr/include/openssl/ui_locl.h -OLD_FILES+=usr/lib/libssl.so.6 -OLD_FILES+=usr/lib32/libcrypto.so.6 -OLD_FILES+=usr/lib32/libssl.so.6 OLD_FILES+=usr/share/openssl/man/man3/CRYPTO_set_id_callback.3.gz # 20120621: remove old man page OLD_FILES+=usr/share/man/man8/vnconfig.8.gz From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 04:10:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0DC11065670; Fri, 13 Jul 2012 04:10:41 +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 DBC448FC0A; Fri, 13 Jul 2012 04:10: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 q6D4AfNh046498; Fri, 13 Jul 2012 04:10:41 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6D4AfFa046496; Fri, 13 Jul 2012 04:10:41 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207130410.q6D4AfFa046496@svn.freebsd.org> From: Alan Cox Date: Fri, 13 Jul 2012 04:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238414 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 04:10:42 -0000 Author: alc Date: Fri Jul 13 04:10:41 2012 New Revision: 238414 URL: http://svn.freebsd.org/changeset/base/238414 Log: Wring a few cycles out of pmap_enter(). In particular, on a user-space pmap, avoid walking the page table twice. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jul 13 01:25:11 2012 (r238413) +++ head/sys/amd64/amd64/pmap.c Fri Jul 13 04:10:41 2012 (r238414) @@ -3454,8 +3454,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, ("pmap_enter: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); - if ((m->oflags & VPO_UNMANAGED) == 0) - newpte |= PG_MANAGED; if ((prot & VM_PROT_WRITE) != 0) newpte |= PG_RW; if ((prot & VM_PROT_EXECUTE) == 0) @@ -3477,14 +3475,22 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * In the case that a page table page is not * resident, we are creating it here. */ - if (va < VM_MAXUSER_ADDRESS) - mpte = pmap_allocpte(pmap, va, &lock); - +retry: pde = pmap_pde(pmap, va); - if (pde != NULL && (*pde & PG_V) != 0) { - if ((*pde & PG_PS) != 0) - panic("pmap_enter: attempted pmap_enter on 2MB page"); + if (pde != NULL && (*pde & PG_V) != 0 && ((*pde & PG_PS) == 0 || + pmap_demote_pde_locked(pmap, pde, va, &lock))) { pte = pmap_pde_to_pte(pde, va); + if (va < VM_MAXUSER_ADDRESS && mpte == NULL) { + mpte = PHYS_TO_VM_PAGE(*pde & PG_FRAME); + mpte->wire_count++; + } + } else if (va < VM_MAXUSER_ADDRESS) { + /* + * Here if the pte page isn't mapped, or if it has been + * deallocated. + */ + mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va), &lock); + goto retry; } else panic("pmap_enter: invalid page directory va=%#lx", va); @@ -3492,59 +3498,65 @@ pmap_enter(pmap_t pmap, vm_offset_t va, opa = origpte & PG_FRAME; /* - * Mapping has not changed, must be protection or wiring change. + * Is the specified virtual address already mapped? */ - if (origpte && (opa == pa)) { + if ((origpte & PG_V) != 0) { /* * Wiring change, just update stats. We don't worry about * wiring PT pages as they remain resident as long as there * are valid mappings in them. Hence, if a user page is wired, * the PT page will be also. */ - if (wired && ((origpte & PG_W) == 0)) + if (wired && (origpte & PG_W) == 0) pmap->pm_stats.wired_count++; else if (!wired && (origpte & PG_W)) pmap->pm_stats.wired_count--; /* - * Remove extra pte reference + * Remove the extra PT page reference. */ - if (mpte) - mpte->wire_count--; - - if ((origpte & PG_MANAGED) != 0) - om = m; - goto validate; - } - - /* - * Mapping has changed, invalidate old range and fall through to - * handle validating new mapping. - */ - if (opa) { - if (origpte & PG_W) - pmap->pm_stats.wired_count--; - if ((origpte & PG_MANAGED) != 0) - om = PHYS_TO_VM_PAGE(opa); if (mpte != NULL) { mpte->wire_count--; KASSERT(mpte->wire_count > 0, ("pmap_enter: missing reference to page table page," " va: 0x%lx", va)); } - } else - pmap_resident_count_inc(pmap, 1); - /* - * Increment the counters. - */ - if (wired) - pmap->pm_stats.wired_count++; + /* + * Has the mapping changed? + */ + if (opa == pa) { + /* + * No, might be a protection or wiring change. + */ + if ((origpte & PG_MANAGED) != 0) { + newpte |= PG_MANAGED; + om = m; + } + if ((origpte & ~(PG_M | PG_A)) == newpte) + goto unchanged; + goto validate; + } else { + /* + * Yes, fall through to validate the new mapping. + */ + if ((origpte & PG_MANAGED) != 0) + om = PHYS_TO_VM_PAGE(opa); + } + } else { + /* + * Increment the counters. + */ + if (wired) + pmap->pm_stats.wired_count++; + pmap_resident_count_inc(pmap, 1); + } /* * Enter on the PV list if part of our managed memory. */ - if ((newpte & PG_MANAGED) != 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { + newpte |= PG_MANAGED; pv = get_pv_entry(pmap, &lock); pv->pv_va = va; CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa); @@ -3554,45 +3566,44 @@ pmap_enter(pmap_t pmap, vm_offset_t va, validate: /* - * Update the PTE only if the mapping or protection/wiring bits are - * different. + * Update the PTE. */ - if ((origpte & ~(PG_M | PG_A)) != newpte) { - newpte |= PG_A; - if ((access & VM_PROT_WRITE) != 0) - newpte |= PG_M; - if ((newpte & (PG_MANAGED | PG_RW)) == (PG_MANAGED | PG_RW)) - vm_page_aflag_set(m, PGA_WRITEABLE); - if (origpte & PG_V) { - invlva = FALSE; - origpte = pte_load_store(pte, newpte); - if (origpte & PG_A) { - if (origpte & PG_MANAGED) - vm_page_aflag_set(om, PGA_REFERENCED); - if (opa != pa || ((origpte & PG_NX) == 0 && - (newpte & PG_NX) != 0)) - invlva = TRUE; - } - if ((origpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { - if ((origpte & PG_MANAGED) != 0) - vm_page_dirty(om); - if ((newpte & PG_RW) == 0) - invlva = TRUE; - } - if (opa != pa && (origpte & PG_MANAGED) != 0) { - CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); - pmap_pvh_free(&om->md, pmap, va); - if ((om->aflags & PGA_WRITEABLE) != 0 && - TAILQ_EMPTY(&om->md.pv_list) && - ((om->flags & PG_FICTITIOUS) != 0 || - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) - vm_page_aflag_clear(om, PGA_WRITEABLE); - } - if (invlva) - pmap_invalidate_page(pmap, va); - } else - pte_store(pte, newpte); - } + newpte |= PG_A; + if ((access & VM_PROT_WRITE) != 0) + newpte |= PG_M; + if ((newpte & (PG_MANAGED | PG_RW)) == (PG_MANAGED | PG_RW)) + vm_page_aflag_set(m, PGA_WRITEABLE); + if ((origpte & PG_V) != 0) { + invlva = FALSE; + origpte = pte_load_store(pte, newpte); + if ((origpte & PG_A) != 0) { + if ((origpte & PG_MANAGED) != 0) + vm_page_aflag_set(om, PGA_REFERENCED); + if (opa != pa || ((origpte & PG_NX) == 0 && + (newpte & PG_NX) != 0)) + invlva = TRUE; + } + if ((origpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) { + if ((origpte & PG_MANAGED) != 0) + vm_page_dirty(om); + if ((newpte & PG_RW) == 0) + invlva = TRUE; + } + if (opa != pa && (origpte & PG_MANAGED) != 0) { + CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, opa); + pmap_pvh_free(&om->md, pmap, va); + if ((om->aflags & PGA_WRITEABLE) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); + } + if (invlva) + pmap_invalidate_page(pmap, va); + } else + pte_store(pte, newpte); + +unchanged: /* * If both the page table page and the reservation are fully From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 04:22:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B31A51065679; Fri, 13 Jul 2012 04:22:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C20B8FC1A; Fri, 13 Jul 2012 04:22:08 +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 q6D4M8LD046993; Fri, 13 Jul 2012 04:22:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6D4M8nC046986; Fri, 13 Jul 2012 04:22:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207130422.q6D4M8nC046986@svn.freebsd.org> From: Warner Losh Date: Fri, 13 Jul 2012 04:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238415 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 04:22:08 -0000 Author: imp Date: Fri Jul 13 04:22:08 2012 New Revision: 238415 URL: http://svn.freebsd.org/changeset/base/238415 Log: For our at91rm9200 boards, register which subtype of SoC is on the board. We'll use this later to control the differences between these two variants' pins. Added: head/sys/arm/at91/at91rm9200_devices.c (contents, props changed) head/sys/arm/at91/at91rm9200var.h (contents, props changed) Modified: head/sys/arm/at91/board_bwct.c head/sys/arm/at91/board_hl200.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/board_tsc4370.c head/sys/arm/at91/files.at91 Added: head/sys/arm/at91/at91rm9200_devices.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91rm9200_devices.c Fri Jul 13 04:22:08 2012 (r238415) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2012 M. Warner Losh. 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 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define _ARM32_BUS_DMA_PRIVATE +#include + +#include +#include + +/* + * The AT91RM9200 uses the same silicon for both the BGA and PQFP + * packages. There's no documented way to detect this at runtime, + * so we require the board code to register what type of SoC is on the + * board in question. The pinouts are not quite compatible, and we + * use this information to cope with the slight differences. + */ +void +at91rm9200_set_subtype(enum at91_soc_subtype st) +{ + + switch (st) { + case AT91_ST_RM9200_BGA: + case AT91_ST_RM9200_PQFP: + soc_info.subtype = st; + break; + default: + panic("Bad SoC subtype %d for at91rm9200_set_subtype.", st); + break; + } +} Added: head/sys/arm/at91/at91rm9200var.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91rm9200var.h Fri Jul 13 04:22:08 2012 (r238415) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2012 M. Warner Losh. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef ARM_AT91_AT91RM9200VAR_H +#define ARM_AT91_AT91RM9200VAR_H + +void at91rm9200_set_subtype(enum at91_soc_subtype st); + +#endif /* ARM_AT91_AT91RM9200VAR_H */ Modified: head/sys/arm/at91/board_bwct.c ============================================================================== --- head/sys/arm/at91/board_bwct.c Fri Jul 13 04:10:41 2012 (r238414) +++ head/sys/arm/at91/board_bwct.c Fri Jul 13 04:22:08 2012 (r238415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. - * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * Copyright (c) 2005-2012 Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,13 +31,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include BOARD_INIT long board_init(void) { + + at91rm9200_set_subtype(AT91_ST_RM9200_BGA); + /* * Since the USART supports RS-485 multidrop mode, it allows the * TX pins to float. However, for RS-232 operations, we don't want Modified: head/sys/arm/at91/board_hl200.c ============================================================================== --- head/sys/arm/at91/board_hl200.c Fri Jul 13 04:10:41 2012 (r238414) +++ head/sys/arm/at91/board_hl200.c Fri Jul 13 04:22:08 2012 (r238415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. - * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * Copyright (c) 2005-2012 Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,13 +31,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include BOARD_INIT long board_init(void) { + + at91rm9200_set_subtype(AT91_ST_RM9200_BGA); + /* * Since the USART supports RS-485 multidrop mode, it allows the * TX pins to float. However, for RS-232 operations, we don't want Modified: head/sys/arm/at91/board_kb920x.c ============================================================================== --- head/sys/arm/at91/board_kb920x.c Fri Jul 13 04:10:41 2012 (r238414) +++ head/sys/arm/at91/board_kb920x.c Fri Jul 13 04:22:08 2012 (r238415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. - * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * Copyright (c) 2005-2012 Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,15 +30,19 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include +#include #include #include BOARD_INIT long board_init(void) { + + at91rm9200_set_subtype(AT91_ST_RM9200_PQFP); + /* * Since the USART supports RS-485 multidrop mode, it allows the * TX pins to float. However, for RS-232 operations, we don't want Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Fri Jul 13 04:10:41 2012 (r238414) +++ head/sys/arm/at91/board_tsc4370.c Fri Jul 13 04:22:08 2012 (r238415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2005-2008 Olivier Houchard. All rights reserved. - * Copyright (c) 2005-2008 Warner Losh. All rights reserved. + * Copyright (c) 2005-2012 Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,13 +31,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include BOARD_INIT long board_init(void) { + + at91rm9200_set_subtype(AT91_ST_RM9200_PQFP); + /* * Since the USART supports RS-485 multidrop mode, it allows the * TX pins to float. However, for RS-232 operations, we don't want Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Fri Jul 13 04:10:41 2012 (r238414) +++ head/sys/arm/at91/files.at91 Fri Jul 13 04:22:08 2012 (r238415) @@ -29,6 +29,7 @@ arm/at91/uart_dev_at91usart.c optional u # arm/at91/at91soc.c standard arm/at91/at91rm9200.c optional at91rm9200 +arm/at91/at91rm9200_devices.c optional at91rm9200 arm/at91/at91sam9260.c optional at91sam9260 arm/at91/at91sam9g20.c optional at91sam9g20 arm/at91/at91sam9x25.c optional at91sam9x25 From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 04:39:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EAE981065670 for ; Fri, 13 Jul 2012 04:39:58 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id A6E358FC15 for ; Fri, 13 Jul 2012 04:39:58 +0000 (UTC) Received: by obbun3 with SMTP id un3so5258226obb.13 for ; Thu, 12 Jul 2012 21:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=rpgd5nlmd29XoKTdf7e8rUkyOVcr0M0sX3lpG5JwkQM=; b=rw60Knt+4RkYKeT8KQC73bO4iz8sFpoUw9Gnx1jYqqDIRO+OVEN8lHLtKrmXkezdA/ jf2OJH9W5S5z82p/sExZpLmJXcBdYTVLvksbeIZoDaYOqlVTiGnl9/BJZVuaoVmmOYaM Byvnoqbf4J29rFwXvUFa/hdHIT1DdT7mx+0/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=rpgd5nlmd29XoKTdf7e8rUkyOVcr0M0sX3lpG5JwkQM=; b=NRIasuWRvr8fpDz8lqfvP4+UsKma85xNKL8miatW0fd3R0nC7K+hHpbuN8xkkK2XXJ 4hPnGnGcdNJxYmLK7sL0Vlad0CV9SccrhenO25ghJQtMVuOaPBn49fZbHFlLJPHbMB0Z k2D4Fi/hlssXWJBzFkA4v3/MvcEfUeXgj6vgEuvrXp5CBQJhfL7wqXMPFLkqWzKo3ksn I98rMmrKOm94pxeWJBfbeFnm6QH7XV3NvQ2nilPoPqtkhOI+RB6bLQk1dYNoSXEN+eif MXWUv1712YkqOI+IVeIpbGIEekvVIwrGKwt2IxP+PHSYiMHZRqzytLA8b6SFyNY1NtO8 KhCw== Received: by 10.60.22.71 with SMTP id b7mr1103088oef.44.1342154397922; Thu, 12 Jul 2012 21:39:57 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.182.125.70 with HTTP; Thu, 12 Jul 2012 21:39:27 -0700 (PDT) In-Reply-To: <201207121211.q6CCBWTD006484@svn.freebsd.org> References: <201207121211.q6CCBWTD006484@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Jul 2012 21:39:27 -0700 X-Google-Sender-Auth: 0NzyCZgcaqZs_xVAqO7Emuu5Wjo Message-ID: To: Gavin Atkinson Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlPFVNOQsnwnQx5deI7xegYr7NdhURlFyAALJO6BpJHEgFnHh9hrLB92L7o93sM1GweOEXB Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238396 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 04:39:59 -0000 On 12 July 2012 05:11, Gavin Atkinson wrote: > Author: gavin > Date: Thu Jul 12 12:11:32 2012 > New Revision: 238396 > URL: http://svn.freebsd.org/changeset/base/238396 > > Log: > Update for new core team. Looks like this file was not updated two years > ago for the last core team. Perhaps we can make a wiki page of "pages that need to change on core team change?" ? -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 06:46:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F38A106566B; Fri, 13 Jul 2012 06:46:10 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39F528FC0C; Fri, 13 Jul 2012 06:46:10 +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 q6D6kAIW052786; Fri, 13 Jul 2012 06:46:10 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6D6k9n6052773; Fri, 13 Jul 2012 06:46:09 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201207130646.q6D6k9n6052773@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Jul 2012 06:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238416 - in head/etc: . defaults rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 06:46:10 -0000 Author: kevlo Date: Fri Jul 13 06:46:09 2012 New Revision: 238416 URL: http://svn.freebsd.org/changeset/base/238416 Log: Whitespace nit Modified: head/etc/defaults/periodic.conf head/etc/defaults/rc.conf head/etc/rc.d/bgfsck head/etc/rc.d/bridge head/etc/rc.d/cleanvar head/etc/rc.d/devd head/etc/rc.d/kldxref head/etc/rc.d/named head/etc/rc.d/power_profile head/etc/rc.d/tmp head/etc/rc.firewall head/etc/rc.subr Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/defaults/periodic.conf Fri Jul 13 06:46:09 2012 (r238416) @@ -275,7 +275,7 @@ monthly_local="/etc/monthly.local" # L if [ -z "${source_periodic_confs_defined}" ]; then source_periodic_confs_defined=yes - source_periodic_confs () { + source_periodic_confs() { local i sourced_files for i in ${periodic_conf_files}; do Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/defaults/rc.conf Fri Jul 13 06:46:09 2012 (r238416) @@ -713,7 +713,7 @@ jail_sysvipc_allow="NO" # Allow SystemV if [ -z "${source_rc_confs_defined}" ]; then source_rc_confs_defined=yes - source_rc_confs () { + source_rc_confs() { local i sourced_files for i in ${rc_conf_files}; do case ${sourced_files} in Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/bgfsck Fri Jul 13 06:46:09 2012 (r238416) @@ -14,7 +14,7 @@ rcvar="background_fsck" start_cmd="bgfsck_start" stop_cmd=":" -bgfsck_start () +bgfsck_start() { if [ -z "${rc_force}" ]; then background_fsck_delay=${background_fsck_delay:=0} Modified: head/etc/rc.d/bridge ============================================================================== --- head/etc/rc.d/bridge Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/bridge Fri Jul 13 06:46:09 2012 (r238416) @@ -37,14 +37,14 @@ start_cmd="bridge_start" stop_cmd="bridge_stop" cmd="" -glob_int () { +glob_int() { case "$1" in $2 ) true ;; * ) false ;; esac } -bridge_test () { +bridge_test() { bridge=$1 iface=$2 Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/cleanvar Fri Jul 13 06:46:09 2012 (r238416) @@ -54,7 +54,7 @@ cleanvar_prestart() rm -f /var/run/clean_var /var/spool/lock/clean_var } -cleanvar_start () +cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then purgedir /var/run Modified: head/etc/rc.d/devd ============================================================================== --- head/etc/rc.d/devd Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/devd Fri Jul 13 06:46:09 2012 (r238416) @@ -26,7 +26,7 @@ find_pidfile() fi } -devd_prestart () +devd_prestart() { find_pidfile Modified: head/etc/rc.d/kldxref ============================================================================== --- head/etc/rc.d/kldxref Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/kldxref Fri Jul 13 06:46:09 2012 (r238416) @@ -15,7 +15,7 @@ name="kldxref" stop_cmd=":" start_cmd="kldxref_start" -kldxref_start () { +kldxref_start() { if [ -n "$kldxref_module_path" ]; then MODULE_PATHS="$kldxref_module_path" else Modified: head/etc/rc.d/named ============================================================================== --- head/etc/rc.d/named Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/named Fri Jul 13 06:46:09 2012 (r238416) @@ -96,7 +96,7 @@ make_symlinks() ln -fs "${named_chrootdir}${pidfile}" ${pidfile} } -named_poststart () { +named_poststart() { make_symlinks if checkyesno named_wait; then @@ -156,7 +156,7 @@ named_poststop() fi } -create_file () { +create_file() { if [ -e "$1" ]; then unlink $1 fi Modified: head/etc/rc.d/power_profile ============================================================================== --- head/etc/rc.d/power_profile Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/power_profile Fri Jul 13 06:46:09 2012 (r238416) @@ -27,7 +27,7 @@ LOGGER="logger -t power_profile -p daemo # $highest_value: maximum value for this sysctl, when $value is "HIGH" # $lowest_value: minimum value for this sysctl, when $value is "LOW" # -sysctl_set () +sysctl_set() { # Check if the node exists if [ -z "$(sysctl -n ${node} 2> /dev/null)" ]; then Modified: head/etc/rc.d/tmp ============================================================================== --- head/etc/rc.d/tmp Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.d/tmp Fri Jul 13 06:46:09 2012 (r238416) @@ -37,7 +37,7 @@ stop_cmd=':' load_rc_config $name -mount_tmpmfs () +mount_tmpmfs() { if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then mount_md ${tmpsize} /tmp "${tmpmfs_flags}" Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.firewall Fri Jul 13 06:46:09 2012 (r238416) @@ -78,7 +78,7 @@ fi # http://www.pearsonhighered.com/educator/academic/product/0,3110,020163466X,00.html # -setup_loopback () { +setup_loopback() { ############ # Only in rare cases do you want to change these rules # @@ -91,7 +91,7 @@ setup_loopback () { fi } -setup_ipv6_mandatory () { +setup_ipv6_mandatory() { [ $ipv6_available -eq 0 ] || return 0 ############ Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Fri Jul 13 04:22:08 2012 (r238415) +++ head/etc/rc.subr Fri Jul 13 06:46:09 2012 (r238416) @@ -1593,7 +1593,7 @@ geli_make_list() # Find scripts in local_startup directories that use the old syntax # -find_local_scripts_old () { +find_local_scripts_old() { zlist='' slist='' for dir in ${local_startup}; do @@ -1612,7 +1612,7 @@ find_local_scripts_old () { done } -find_local_scripts_new () { +find_local_scripts_new() { local_rc='' for dir in ${local_startup}; do if [ -d "${dir}" ]; then From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 08:02:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD0E106566B; Fri, 13 Jul 2012 08:02:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88888FC21; Fri, 13 Jul 2012 08:02: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 q6D82wm2056003; Fri, 13 Jul 2012 08:02:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6D82w6E055999; Fri, 13 Jul 2012 08:02:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207130802.q6D82w6E055999@svn.freebsd.org> From: Martin Matuska Date: Fri, 13 Jul 2012 08:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238417 - in vendor/illumos/dist: cmd/sgs/include cmd/sgs/messages cmd/sgs/tools/common cmd/zfs lib/libzfs/common tools/ctf/cvt uts/common/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 08:02:59 -0000 Author: mm Date: Fri Jul 13 08:02:58 2012 New Revision: 238417 URL: http://svn.freebsd.org/changeset/base/238417 Log: Update vendor/illumos to illumos-gate revision 13750:6c5d0718e821 Source URL: ssh://anonhg@hg.illumos.org/illumos-gate Obtained from: illumos Modified: vendor/illumos/dist/cmd/sgs/include/alist.h vendor/illumos/dist/cmd/sgs/include/debug.h vendor/illumos/dist/cmd/sgs/include/sgs.h vendor/illumos/dist/cmd/sgs/messages/sgs.ident vendor/illumos/dist/cmd/sgs/tools/common/sgsmsg.c vendor/illumos/dist/cmd/sgs/tools/common/string_table.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_config.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/tools/ctf/cvt/dwarf.c vendor/illumos/dist/uts/common/sys/feature_tests.h Modified: vendor/illumos/dist/cmd/sgs/include/alist.h ============================================================================== --- vendor/illumos/dist/cmd/sgs/include/alist.h Fri Jul 13 06:46:09 2012 (r238416) +++ vendor/illumos/dist/cmd/sgs/include/alist.h Fri Jul 13 08:02:58 2012 (r238417) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * Define an Alist, a list maintained as a reallocable array, and a for() loop @@ -32,8 +32,6 @@ #ifndef _ALIST_H #define _ALIST_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -138,6 +136,13 @@ typedef struct { void *apl_data[1]; /* data area: (arrcnt * size) bytes */ } APlist; +#ifdef _SYSCALL32 /* required by librtld_db */ +typedef struct { + Elf32_Word apl_arritems; + Elf32_Word apl_nitems; + Elf32_Addr apl_data[1]; +} APlist32; +#endif /* _SYSCALL32 */ /* * The ALIST_OFF_DATA and APLIST_OFF_DATA macros give the byte offset @@ -224,7 +229,7 @@ typedef struct { * Possible values returned by aplist_test() */ typedef enum { - ALE_ALLOCFAIL = 0, /* Memory allocation error */ + ALE_ALLOCFAIL = 0, /* memory allocation error */ ALE_EXISTS = 1, /* alist entry already exists */ ALE_NOTFND = 2, /* item not found and insert not required */ ALE_CREATE = 3 /* alist entry created */ @@ -244,11 +249,14 @@ typedef enum { ((void *)((_off) + (char *)(_lp))) /* - * # of items currently found in a list. These macros handle the case - * where the list has not been allocated yet. - */ -#define alist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_nitems) -#define aplist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_nitems) + * The number of items currently found in a list (nitems), and the total number + * of slots in the current data allocation (arritems). These macros handle the + * case where the list has not been allocated yet. + */ +#define alist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_nitems) +#define aplist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_nitems) +#define alist_arritems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_arritems) +#define aplist_arritems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_arritems) extern void *alist_append(Alist **, const void *, size_t, Aliste); Modified: vendor/illumos/dist/cmd/sgs/include/debug.h ============================================================================== --- vendor/illumos/dist/cmd/sgs/include/debug.h Fri Jul 13 06:46:09 2012 (r238416) +++ vendor/illumos/dist/cmd/sgs/include/debug.h Fri Jul 13 08:02:58 2012 (r238417) @@ -20,15 +20,12 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _DEBUG_H #define _DEBUG_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Global include file for lddbg debugging. * @@ -45,6 +42,7 @@ * start with the `Elf_' prefix. These latter routines are the only * routines used by the elfdump(1) utility. */ +#include #include #include #include @@ -55,13 +53,12 @@ extern "C" { #endif /* - * Define Dbg_*() interface flags. These flags direct the debugging routine to - * generate different diagnostics, thus the strings themselves are maintained + * Define Dbg_*() interface values. These values direct the debugging routine + * to generate different diagnostics, thus the strings themselves are maintained * in the debugging library. */ #define DBG_SUP_ENVIRON 1 #define DBG_SUP_CMDLINE 2 -#define DBG_SUP_DEFAULT 3 #define DBG_CONF_IGNORE 1 /* configuration processing errors */ #define DBG_CONF_VERSION 2 @@ -87,18 +84,22 @@ extern "C" { #define DBG_DLSYM_SELF 3 #define DBG_DLSYM_PROBE 4 #define DBG_DLSYM_SINGLETON 5 +#define DBG_DLSYM_NUM DBG_DLSYM_SINGLETON + 1 #define DBG_DLCLOSE_NULL 0 #define DBG_DLCLOSE_IGNORE 1 #define DBG_DLCLOSE_RESCAN 2 -#define DBG_WAIT_INIT 1 -#define DBG_WAIT_FINI 2 -#define DBG_WAIT_SYMBOL 3 - #define DBG_SYM_REDUCE_GLOBAL 1 /* reporting global symbols to local */ #define DBG_SYM_REDUCE_RETAIN 2 /* reporting non reduced local syms */ +#define DBG_AUD_CALL 1 /* original call to auditor */ +#define DBG_AUD_RET 2 /* return from auditor diagnostic */ + +#define DBG_AUD_LOCAL 0 /* auditor is local */ +#define DBG_AUD_GLOBAL 1 /* auditor is global */ +#define DBG_AUD_PRELOAD 2 /* auditor is preloaded */ + /* * Group handle operations - passed to Dbg_file_hdl_title(). Indicate why * handle dependencies are being manipulated. @@ -139,12 +140,18 @@ extern "C" { #define DBG_BINFO_REF_PARENT 0x2000 /* reference to PARENT */ #define DBG_BINFO_REF_MSK 0xf000 - -#define DBG_CAP_INITIAL 0 -#define DBG_CAP_IGNORE 1 -#define DBG_CAP_OLD 2 -#define DBG_CAP_NEW 3 -#define DBG_CAP_RESOLVED 4 +/* + * ld.so.1(1) symbol capabilities processing. + */ +#define DBG_CAP_DEFAULT 0 +#define DBG_CAP_USED 1 +#define DBG_CAP_CANDIDATE 2 +#define DBG_CAP_REJECTED 3 +#define DBG_CAP_HW_1 4 +#define DBG_CAP_SF_1 5 +#define DBG_CAP_HW_2 6 +#define DBG_CAP_PLAT 7 +#define DBG_CAP_MACH 8 #define DBG_REL_START 1 #define DBG_REL_FINISH 2 @@ -153,23 +160,53 @@ extern "C" { #define DBG_NL_STD 0 /* newline controllers - standard and */ #define DBG_NL_FRC 2 /* forced. */ -#define DBG_BNDREJ_NODIR 0 /* bind rejected, direct to nodirect */ -#define DBG_BNDREJ_SINGLE 1 /* bind rejected, singleton without */ +#define DBG_BNDREJ_DIRECT 0 /* bind rejected, direct to nodirect */ +#define DBG_BNDREJ_GROUP 1 /* bind rejected, group to nodirect */ +#define DBG_BNDREJ_SINGLE 2 /* bind rejected, singleton without */ /* default search model */ #define DBG_BNDREJ_NUM DBG_BNDREJ_SINGLE /* + * Dbg_state_str() is used to obtain commonly used "state transition" + * strings used in various debugging output. + */ +#define DBG_STATE_ADD 0 /* add */ +#define DBG_STATE_CURRENT 1 /* current */ +#define DBG_STATE_EXCLUDE 2 /* exclude */ +#define DBG_STATE_IGNORED 3 /* ignored */ +#define DBG_STATE_MOD_BEFORE 4 /* modify (before) */ +#define DBG_STATE_MOD_AFTER 5 /* modify (after) */ +#define DBG_STATE_NEW 6 /* new */ +#define DBG_STATE_NEW_IMPLICIT 7 /* new (implicit) */ +#define DBG_STATE_RESET 8 /* reset */ +#define DBG_STATE_ORIGINAL 9 /* original */ +#define DBG_STATE_RESOLVED 10 /* resolved */ + +#define DBG_STATE_NUM 11 +typedef uint_t dbg_state_t; +extern const char *Dbg_state_str(dbg_state_t); + +/* * Define a debug descriptor, and a user macro that inspects the descriptor as * a means of triggering a class of diagnostic output. */ typedef struct { uint_t d_class; /* debugging classes */ - uint_t d_extra; /* extra information for classes */ - APlist *d_list; /* associated strings */ + uint_t d_extra; /* extra public information */ + APlist *d_list; /* accepted link-map list names */ + struct timeval d_totaltime; /* total time since entry - */ + /* gettimeofday(3c) */ + struct timeval d_deltatime; /* delta time since last diagnostic - */ + /* gettimeofday(3c) */ } Dbg_desc; extern Dbg_desc *dbg_desc; +/* + * Macros used to avoid calls to liblddbg unless debugging is enabled. + * liblddbg is lazy loaded --- this prevents it from happening unless + * it will actually be used. + */ #define DBG_ENABLED (dbg_desc->d_class) #define DBG_CALL(func) if (DBG_ENABLED) func @@ -180,26 +217,51 @@ extern Dbg_desc *dbg_desc; * may be interpreted by the debugging library itself or from the callers * dbg_print() routine. */ -#define DBG_E_DETAIL 0x0001 /* add detail to a class */ -#define DBG_E_LONG 0x0002 /* use long names (ie. no truncation) */ - -#define DBG_E_STDNL 0x0010 /* standard newline indicator */ +#define DBG_E_DETAIL 0x00000001 /* add detail to a class */ +#define DBG_E_LONG 0x00000002 /* use long names (ie. no truncation) */ +#define DBG_E_DEMANGLE 0x00000004 /* demangle symbol names */ +#define DBG_E_STDNL 0x00000008 /* standard newline indicator */ +#define DBG_E_HELP 0x00000010 /* help requested */ +#define DBG_E_HELP_EXIT 0x00000020 /* hint: user should exit after help */ +#define DBG_E_TTIME 0x00000040 /* prepend total time */ +#define DBG_E_DTIME 0x00000080 /* prepend delta time */ +#define DBG_E_RESET 0x00000100 /* reset times */ + +/* ld only */ +#define DBG_E_SNAME 0x00001000 /* prepend simple name */ +#define DBG_E_FNAME 0x00002000 /* prepend full name */ +#define DBG_E_CLASS 0x00004000 /* prepend ELF class */ + +/* ld.so.1 only */ +#define DBG_E_LMID 0x00100000 /* prepend link-map id */ +#define DBG_E_LMID_LDSO 0x00200000 /* show ldso link-map list */ +#define DBG_E_LMID_ALL 0x00400000 /* show all non-ldso link-map lists */ +#define DBG_E_LMID_ALT 0x00800000 /* show all ALT link-map lists */ +#define DBG_E_LMID_BASE 0x01000000 /* show BASE link-map list */ -#define DBG_E_SNAME 0x0100 /* prepend simple name (ld only) */ -#define DBG_E_FNAME 0x0200 /* prepend full name (ld only) */ -#define DBG_E_CLASS 0x0400 /* prepend ELF class (ld only) */ -#define DBG_E_LMID 0x0800 /* prepend link-map id (ld.so.1 only) */ -#define DBG_E_DEMANGLE 0x1000 /* demangle symbol names */ #define DBG_NOTDETAIL() !(dbg_desc->d_extra & DBG_E_DETAIL) #define DBG_NOTLONG() !(dbg_desc->d_extra & DBG_E_LONG) +#define DBG_ISDEMANGLE() \ + (dbg_desc->d_extra & DBG_E_DEMANGLE) + +#define DBG_TOTALTIME (dbg_desc->d_totaltime) +#define DBG_DELTATIME (dbg_desc->d_deltatime) + +#define DBG_ISTTIME() (dbg_desc->d_extra & DBG_E_TTIME) +#define DBG_ISDTIME() (dbg_desc->d_extra & DBG_E_DTIME) +#define DBG_ISTIME() (dbg_desc->d_extra & (DBG_E_TTIME | DBG_E_DTIME)) +#define DBG_NOTTIME() !(dbg_desc->d_extra & (DBG_E_TTIME | DBG_E_DTIME)) + +#define DBG_ISRESET() (dbg_desc->d_extra & DBG_E_RESET) +#define DBG_ONRESET() (dbg_desc->d_extra |= DBG_E_RESET) +#define DBG_OFFRESET() (dbg_desc->d_extra &= ~DBG_E_RESET) + #define DBG_ISSNAME() (dbg_desc->d_extra & DBG_E_SNAME) #define DBG_ISFNAME() (dbg_desc->d_extra & DBG_E_FNAME) #define DBG_ISCLASS() (dbg_desc->d_extra & DBG_E_CLASS) #define DBG_ISLMID() (dbg_desc->d_extra & DBG_E_LMID) -#define DBG_ISDEMANGLE() \ - (dbg_desc->d_extra & DBG_E_DEMANGLE) /* * Print routine, this must be supplied by the application. The initial @@ -209,7 +271,19 @@ extern Dbg_desc *dbg_desc; /* PRINTFLIKE2 */ extern void dbg_print(Lm_list *, const char *, ...); -extern uintptr_t Dbg_setup(const char *, Dbg_desc *); +/* + * Initialization routine, called before any other Dbg routines to + * establish the necessary state. + */ +typedef enum { DBG_CALLER_LD, DBG_CALLER_RTLD } dbg_setup_caller_t; +extern int Dbg_setup(dbg_setup_caller_t, const char *, + Dbg_desc *, const char **); + +/* Call dbg_print() to produce linker version output */ +extern void Dbg_version(void); + +/* Call dbg_print() to produce help output */ +extern void Dbg_help(void); /* * Establish ELF32 and ELF64 class Dbg_*() interfaces. @@ -225,12 +299,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_bind_reject Dbg64_bind_reject #define Dbg_bind_weak Dbg64_bind_weak -#define Dbg_cap_val_hw1 Dbg64_cap_val_hw1 -#define Dbg_cap_hw_candidate Dbg64_cap_hw_candidate -#define Dbg_cap_hw_filter Dbg64_cap_hw_filter -#define Dbg_cap_mapfile Dbg64_cap_mapfile -#define Dbg_cap_sec_entry Dbg64_cap_sec_entry +#define Dbg_cap_candidate Dbg64_cap_candidate +#define Dbg_cap_filter Dbg64_cap_filter +#define Dbg_cap_id Dbg64_cap_id +#define Dbg_cap_identical Dbg64_cap_identical +#define Dbg_cap_mapfile_title Dbg64_cap_mapfile_title +#define Dbg_cap_post_title Dbg64_cap_post_title #define Dbg_cap_sec_title Dbg64_cap_sec_title +#define Dbg_cap_val Dbg64_cap_val +#define Dbg_cap_ptr_entry Dbg64_cap_ptr_entry +#define Dbg_cap_val_entry Dbg64_cap_val_entry + +#define Dbg_dl_dladdr Dbg64_dl_dladdr +#define Dbg_dl_dlclose Dbg64_dl_dlclose +#define Dbg_dl_dldump Dbg64_dl_dldump +#define Dbg_dl_dlerror Dbg64_dl_dlerror +#define Dbg_dl_dlinfo Dbg64_dl_dlinfo +#define Dbg_dl_dlopen Dbg64_dl_dlopen +#define Dbg_dl_dlsym Dbg64_dl_dlsym +#define Dbg_dl_iphdr_enter Dbg64_dl_iphdr_enter +#define Dbg_dl_iphdr_callback Dbg64_dl_iphdr_callback +#define Dbg_dl_iphdr_mapchange Dbg64_dl_iphdr_mapchange +#define Dbg_dl_iphdr_unmap_ret Dbg64_dl_iphdr_unmap_ret #define Dbg_ent_entry Dbg64_ent_entry #define Dbg_ent_print Dbg64_ent_print @@ -241,15 +331,14 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_ar_rescan Dbg64_file_ar_rescan #define Dbg_file_bind_entry Dbg64_file_bind_entry #define Dbg_file_bindings Dbg64_file_bindings +#define Dbg_file_bindings_done Dbg64_file_bindings_done #define Dbg_file_cleanup Dbg64_file_cleanup #define Dbg_file_cntl Dbg64_file_cntl #define Dbg_file_config_dis Dbg64_file_config_dis #define Dbg_file_config_obj Dbg64_file_config_obj #define Dbg_file_del_rescan Dbg64_file_del_rescan #define Dbg_file_delete Dbg64_file_delete -#define Dbg_file_dlclose Dbg64_file_dlclose -#define Dbg_file_dldump Dbg64_file_dldump -#define Dbg_file_dlopen Dbg64_file_dlopen +#define Dbg_file_deferred Dbg64_file_deferred #define Dbg_file_elf Dbg64_file_elf #define Dbg_file_filtee Dbg64_file_filtee #define Dbg_file_filter Dbg64_file_filter @@ -260,6 +349,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_hdl_title Dbg64_file_hdl_title #define Dbg_file_lazyload Dbg64_file_lazyload #define Dbg_file_ldso Dbg64_file_ldso +#define Dbg_file_mmapobj Dbg64_file_mmapobj #define Dbg_file_mode_promote Dbg64_file_mode_promote #define Dbg_file_modified Dbg64_file_modified #define Dbg_file_needed Dbg64_file_needed @@ -275,7 +365,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_audit Dbg64_libs_audit #define Dbg_libs_find Dbg64_libs_find #define Dbg_libs_found Dbg64_libs_found -#define Dbg_libs_ignore Dbg64_libs_ignore +#define Dbg_libs_insecure Dbg64_libs_insecure #define Dbg_libs_init Dbg64_libs_init #define Dbg_libs_l Dbg64_libs_l #define Dbg_libs_path Dbg64_libs_path @@ -284,22 +374,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_yp Dbg64_libs_yp #define Dbg_libs_ylu Dbg64_libs_ylu -#define Dbg_map_dash Dbg64_map_dash +#define Dbg_map_cexp_id Dbg64_map_cexp_id +#define Dbg_map_dv Dbg64_map_dv +#define Dbg_map_dv_entry Dbg64_map_dv_entry #define Dbg_map_ent Dbg64_map_ent +#define Dbg_map_ent_ord_title Dbg64_map_ent_ord_title +#define Dbg_map_hdr_noalloc Dbg64_map_hdr_noalloc #define Dbg_map_parse Dbg64_map_parse -#define Dbg_map_pipe Dbg64_map_pipe +#define Dbg_map_pass Dbg64_map_pass +#define Dbg_map_post_title Dbg64_map_post_title #define Dbg_map_seg Dbg64_map_seg -#define Dbg_map_set_atsign Dbg64_map_set_atsign -#define Dbg_map_set_equal Dbg64_map_set_equal +#define Dbg_map_seg_order Dbg64_map_seg_order +#define Dbg_map_seg_os_order Dbg64_map_seg_os_order #define Dbg_map_size_new Dbg64_map_size_new #define Dbg_map_size_old Dbg64_map_size_old -#define Dbg_map_sort_fini Dbg64_map_sort_fini -#define Dbg_map_sort_orig Dbg64_map_sort_orig +#define Dbg_map_sort_seg Dbg64_map_sort_seg +#define Dbg_map_sort_title Dbg64_map_sort_title #define Dbg_map_symbol Dbg64_map_symbol #define Dbg_map_version Dbg64_map_version #define Dbg_move_adjexpandreloc Dbg64_move_adjexpandreloc #define Dbg_move_adjmovereloc Dbg64_move_adjmovereloc +#define Dbg_move_bad Dbg64_move_bad #define Dbg_move_data Dbg64_move_data #define Dbg_move_entry1 Dbg64_move_entry1 #define Dbg_move_entry2 Dbg64_move_entry2 @@ -329,13 +425,16 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_reloc_sloppycomdat Dbg64_reloc_sloppycomdat #define Dbg_sec_added Dbg64_sec_added +#define Dbg_sec_backing Dbg64_sec_backing #define Dbg_sec_created Dbg64_sec_created #define Dbg_sec_discarded Dbg64_sec_discarded #define Dbg_sec_genstr_compress Dbg64_sec_genstr_compress #define Dbg_sec_group Dbg64_sec_group +#define Dbg_sec_gnu_comdat Dbg64_sec_gnu_comdat #define Dbg_sec_in Dbg64_sec_in #define Dbg_sec_order_error Dbg64_sec_order_error #define Dbg_sec_order_list Dbg64_sec_order_list +#define Dbg_sec_redirected Dbg64_sec_redirected #define Dbg_sec_strtab Dbg64_sec_strtab #define Dbg_sec_unsup_strmerge Dbg64_sec_unsup_strmerge @@ -353,17 +452,24 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_support_action Dbg64_support_action #define Dbg_support_load Dbg64_support_load #define Dbg_support_req Dbg64_support_req +#define Dbg_support_vnone Dbg64_support_vnone #define Dbg_syminfo_entry Dbg64_syminfo_entry #define Dbg_syminfo_title Dbg64_syminfo_title #define Dbg_syms_ar_checking Dbg64_syms_ar_checking -#define Dbg_syms_ar_entry Dbg64_syms_ar_entry +#define Dbg_syms_ar_force Dbg64_syms_ar_force #define Dbg_syms_ar_resolve Dbg64_syms_ar_resolve +#define Dbg_syms_ar_skip Dbg64_syms_ar_skip #define Dbg_syms_ar_title Dbg64_syms_ar_title +#define Dbg_syms_cap_convert Dbg64_syms_cap_convert +#define Dbg_syms_cap_local Dbg64_syms_cap_local +#define Dbg_syms_cap_lookup Dbg64_syms_cap_lookup +#define Dbg_syms_cap_title Dbg64_syms_cap_title +#define Dbg_syms_copy_reloc Dbg64_syms_copy_reloc #define Dbg_syms_created Dbg64_syms_created #define Dbg_syms_discarded Dbg64_syms_discarded -#define Dbg_syms_dlsym Dbg64_syms_dlsym +#define Dbg_syms_dup_discarded Dbg64_syms_dup_discarded #define Dbg_syms_dup_sort_addr Dbg64_syms_dup_sort_addr #define Dbg_syms_entered Dbg64_syms_entered #define Dbg_syms_entry Dbg64_syms_entry @@ -376,7 +482,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_old Dbg64_syms_old #define Dbg_syms_process Dbg64_syms_process #define Dbg_syms_reduce Dbg64_syms_reduce -#define Dbg_syms_reloc Dbg64_syms_reloc #define Dbg_syms_resolved Dbg64_syms_resolved #define Dbg_syms_resolving Dbg64_syms_resolving #define Dbg_syms_sec_entry Dbg64_syms_sec_entry @@ -384,8 +489,8 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_spec_title Dbg64_syms_spec_title #define Dbg_syms_updated Dbg64_syms_updated #define Dbg_syms_up_title Dbg64_syms_up_title +#define Dbg_syms_wrap Dbg64_syms_wrap -#define Dbg_util_broadcast Dbg64_util_broadcast #define Dbg_util_call_array Dbg64_util_call_array #define Dbg_util_call_fini Dbg64_util_call_fini #define Dbg_util_call_init Dbg64_util_call_init @@ -401,7 +506,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_util_scc_entry Dbg64_util_scc_entry #define Dbg_util_scc_title Dbg64_util_scc_title #define Dbg_util_str Dbg64_util_str -#define Dbg_util_wait Dbg64_util_wait #define Dbg_unused_file Dbg64_unused_file #define Dbg_unused_lcinterface Dbg64_unused_lcinterface @@ -413,6 +517,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_ver_avail_title Dbg64_ver_avail_title #define Dbg_ver_def_title Dbg64_ver_def_title #define Dbg_ver_desc_entry Dbg64_ver_desc_entry +#define Dbg_ver_need_done Dbg64_ver_need_done #define Dbg_ver_need_entry Dbg64_ver_need_entry #define Dbg_ver_need_title Dbg64_ver_need_title #define Dbg_ver_nointerface Dbg64_ver_nointerface @@ -427,12 +532,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_bind_reject Dbg32_bind_reject #define Dbg_bind_weak Dbg32_bind_weak -#define Dbg_cap_val_hw1 Dbg32_cap_val_hw1 -#define Dbg_cap_hw_candidate Dbg32_cap_hw_candidate -#define Dbg_cap_hw_filter Dbg32_cap_hw_filter -#define Dbg_cap_mapfile Dbg32_cap_mapfile -#define Dbg_cap_sec_entry Dbg32_cap_sec_entry +#define Dbg_cap_candidate Dbg32_cap_candidate +#define Dbg_cap_filter Dbg32_cap_filter +#define Dbg_cap_id Dbg32_cap_id +#define Dbg_cap_identical Dbg32_cap_identical +#define Dbg_cap_mapfile_title Dbg32_cap_mapfile_title +#define Dbg_cap_post_title Dbg32_cap_post_title #define Dbg_cap_sec_title Dbg32_cap_sec_title +#define Dbg_cap_val Dbg32_cap_val +#define Dbg_cap_ptr_entry Dbg32_cap_ptr_entry +#define Dbg_cap_val_entry Dbg32_cap_val_entry + +#define Dbg_dl_dladdr Dbg32_dl_dladdr +#define Dbg_dl_dlclose Dbg32_dl_dlclose +#define Dbg_dl_dldump Dbg32_dl_dldump +#define Dbg_dl_dlerror Dbg32_dl_dlerror +#define Dbg_dl_dlinfo Dbg32_dl_dlinfo +#define Dbg_dl_dlopen Dbg32_dl_dlopen +#define Dbg_dl_dlsym Dbg32_dl_dlsym +#define Dbg_dl_iphdr_enter Dbg32_dl_iphdr_enter +#define Dbg_dl_iphdr_callback Dbg32_dl_iphdr_callback +#define Dbg_dl_iphdr_mapchange Dbg32_dl_iphdr_mapchange +#define Dbg_dl_iphdr_unmap_ret Dbg32_dl_iphdr_unmap_ret #define Dbg_ent_entry Dbg32_ent_entry #define Dbg_ent_print Dbg32_ent_print @@ -443,15 +564,14 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_ar_rescan Dbg32_file_ar_rescan #define Dbg_file_bind_entry Dbg32_file_bind_entry #define Dbg_file_bindings Dbg32_file_bindings +#define Dbg_file_bindings_done Dbg32_file_bindings_done #define Dbg_file_cleanup Dbg32_file_cleanup #define Dbg_file_cntl Dbg32_file_cntl #define Dbg_file_config_dis Dbg32_file_config_dis #define Dbg_file_config_obj Dbg32_file_config_obj #define Dbg_file_del_rescan Dbg32_file_del_rescan #define Dbg_file_delete Dbg32_file_delete -#define Dbg_file_dlclose Dbg32_file_dlclose -#define Dbg_file_dldump Dbg32_file_dldump -#define Dbg_file_dlopen Dbg32_file_dlopen +#define Dbg_file_deferred Dbg32_file_deferred #define Dbg_file_elf Dbg32_file_elf #define Dbg_file_filtee Dbg32_file_filtee #define Dbg_file_filter Dbg32_file_filter @@ -462,6 +582,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_file_hdl_title Dbg32_file_hdl_title #define Dbg_file_lazyload Dbg32_file_lazyload #define Dbg_file_ldso Dbg32_file_ldso +#define Dbg_file_mmapobj Dbg32_file_mmapobj #define Dbg_file_mode_promote Dbg32_file_mode_promote #define Dbg_file_modified Dbg32_file_modified #define Dbg_file_needed Dbg32_file_needed @@ -477,7 +598,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_audit Dbg32_libs_audit #define Dbg_libs_find Dbg32_libs_find #define Dbg_libs_found Dbg32_libs_found -#define Dbg_libs_ignore Dbg32_libs_ignore +#define Dbg_libs_insecure Dbg32_libs_insecure #define Dbg_libs_init Dbg32_libs_init #define Dbg_libs_l Dbg32_libs_l #define Dbg_libs_path Dbg32_libs_path @@ -486,22 +607,28 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_libs_yp Dbg32_libs_yp #define Dbg_libs_ylu Dbg32_libs_ylu -#define Dbg_map_dash Dbg32_map_dash +#define Dbg_map_cexp_id Dbg32_map_cexp_id +#define Dbg_map_dv Dbg32_map_dv +#define Dbg_map_dv_entry Dbg32_map_dv_entry #define Dbg_map_ent Dbg32_map_ent +#define Dbg_map_ent_ord_title Dbg32_map_ent_ord_title +#define Dbg_map_hdr_noalloc Dbg32_map_hdr_noalloc #define Dbg_map_parse Dbg32_map_parse -#define Dbg_map_pipe Dbg32_map_pipe +#define Dbg_map_pass Dbg32_map_pass +#define Dbg_map_post_title Dbg32_map_post_title #define Dbg_map_seg Dbg32_map_seg -#define Dbg_map_set_atsign Dbg32_map_set_atsign -#define Dbg_map_set_equal Dbg32_map_set_equal +#define Dbg_map_seg_order Dbg32_map_seg_order +#define Dbg_map_seg_os_order Dbg32_map_seg_os_order #define Dbg_map_size_new Dbg32_map_size_new #define Dbg_map_size_old Dbg32_map_size_old -#define Dbg_map_sort_fini Dbg32_map_sort_fini -#define Dbg_map_sort_orig Dbg32_map_sort_orig +#define Dbg_map_sort_seg Dbg32_map_sort_seg +#define Dbg_map_sort_title Dbg32_map_sort_title #define Dbg_map_symbol Dbg32_map_symbol #define Dbg_map_version Dbg32_map_version #define Dbg_move_adjexpandreloc Dbg32_move_adjexpandreloc #define Dbg_move_adjmovereloc Dbg32_move_adjmovereloc +#define Dbg_move_bad Dbg32_move_bad #define Dbg_move_data Dbg32_move_data #define Dbg_move_entry1 Dbg32_move_entry1 #define Dbg_move_entry2 Dbg32_move_entry2 @@ -531,13 +658,16 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_reloc_sloppycomdat Dbg32_reloc_sloppycomdat #define Dbg_sec_added Dbg32_sec_added +#define Dbg_sec_backing Dbg32_sec_backing #define Dbg_sec_created Dbg32_sec_created #define Dbg_sec_discarded Dbg32_sec_discarded #define Dbg_sec_genstr_compress Dbg32_sec_genstr_compress #define Dbg_sec_group Dbg32_sec_group +#define Dbg_sec_gnu_comdat Dbg32_sec_gnu_comdat #define Dbg_sec_in Dbg32_sec_in #define Dbg_sec_order_error Dbg32_sec_order_error #define Dbg_sec_order_list Dbg32_sec_order_list +#define Dbg_sec_redirected Dbg32_sec_redirected #define Dbg_sec_strtab Dbg32_sec_strtab #define Dbg_sec_unsup_strmerge Dbg32_sec_unsup_strmerge @@ -555,17 +685,24 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_support_action Dbg32_support_action #define Dbg_support_load Dbg32_support_load #define Dbg_support_req Dbg32_support_req +#define Dbg_support_vnone Dbg32_support_vnone #define Dbg_syminfo_entry Dbg32_syminfo_entry #define Dbg_syminfo_title Dbg32_syminfo_title #define Dbg_syms_ar_checking Dbg32_syms_ar_checking -#define Dbg_syms_ar_entry Dbg32_syms_ar_entry +#define Dbg_syms_ar_force Dbg32_syms_ar_force #define Dbg_syms_ar_resolve Dbg32_syms_ar_resolve +#define Dbg_syms_ar_skip Dbg32_syms_ar_skip #define Dbg_syms_ar_title Dbg32_syms_ar_title +#define Dbg_syms_cap_convert Dbg32_syms_cap_convert +#define Dbg_syms_cap_local Dbg32_syms_cap_local +#define Dbg_syms_cap_lookup Dbg32_syms_cap_lookup +#define Dbg_syms_cap_title Dbg32_syms_cap_title +#define Dbg_syms_copy_reloc Dbg32_syms_copy_reloc #define Dbg_syms_created Dbg32_syms_created #define Dbg_syms_discarded Dbg32_syms_discarded -#define Dbg_syms_dlsym Dbg32_syms_dlsym +#define Dbg_syms_dup_discarded Dbg32_syms_dup_discarded #define Dbg_syms_dup_sort_addr Dbg32_syms_dup_sort_addr #define Dbg_syms_entered Dbg32_syms_entered #define Dbg_syms_entry Dbg32_syms_entry @@ -579,7 +716,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_old Dbg32_syms_old #define Dbg_syms_process Dbg32_syms_process #define Dbg_syms_reduce Dbg32_syms_reduce -#define Dbg_syms_reloc Dbg32_syms_reloc #define Dbg_syms_resolved Dbg32_syms_resolved #define Dbg_syms_resolving Dbg32_syms_resolving #define Dbg_syms_sec_entry Dbg32_syms_sec_entry @@ -587,8 +723,8 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_syms_spec_title Dbg32_syms_spec_title #define Dbg_syms_updated Dbg32_syms_updated #define Dbg_syms_up_title Dbg32_syms_up_title +#define Dbg_syms_wrap Dbg32_syms_wrap -#define Dbg_util_broadcast Dbg32_util_broadcast #define Dbg_util_call_array Dbg32_util_call_array #define Dbg_util_call_fini Dbg32_util_call_fini #define Dbg_util_call_init Dbg32_util_call_init @@ -604,7 +740,6 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_util_scc_entry Dbg32_util_scc_entry #define Dbg_util_scc_title Dbg32_util_scc_title #define Dbg_util_str Dbg32_util_str -#define Dbg_util_wait Dbg32_util_wait #define Dbg_unused_file Dbg32_unused_file #define Dbg_unused_lcinterface Dbg32_unused_lcinterface @@ -616,6 +751,7 @@ extern uintptr_t Dbg_setup(const char *, #define Dbg_ver_avail_title Dbg32_ver_avail_title #define Dbg_ver_def_title Dbg32_ver_def_title #define Dbg_ver_desc_entry Dbg32_ver_desc_entry +#define Dbg_ver_need_done Dbg32_ver_need_done #define Dbg_ver_need_entry Dbg32_ver_need_entry #define Dbg_ver_need_title Dbg32_ver_need_title #define Dbg_ver_nointerface Dbg32_ver_nointerface @@ -626,17 +762,40 @@ extern uintptr_t Dbg_setup(const char *, /* * External Dbg_*() interface routines. */ -extern void Dbg_args_files(Lm_list *, int, char *); -extern void Dbg_args_flags(Lm_list *, int, int); +extern void Dbg_args_file(Lm_list *, int, char *); +extern void Dbg_args_guidance_unknown(Lm_list *, const char *); +extern void Dbg_args_option(Lm_list *, int, int, char *); +extern void Dbg_args_str2chr(Lm_list *, int, const char *, int); +extern void Dbg_args_Wldel(Lm_list *, int, const char *); +extern void Dbg_audit_activity(Lm_list *, const char *, const char *, + uint_t); extern void Dbg_audit_ignore(Rt_map *); extern void Dbg_audit_interface(Lm_list *, const char *, const char *); -extern void Dbg_audit_lib(Lm_list *, const char *); -extern void Dbg_audit_object(Lm_list *, const char *, const char *); -extern void Dbg_audit_symval(Lm_list *, const char *, const char *, - const char *, Addr, Addr); +extern void Dbg_audit_lib(Rt_map *, const char *, int); +extern void Dbg_audit_objclose(Lm_list *, const char *, const char *); +extern void Dbg_audit_objopen(Lm_list *, int, const char *, const char *, + uint_t, Boolean); +extern void Dbg_audit_objfilter(Lm_list *, int, const char *, const char *, + const char *, const char *); +extern void Dbg_audit_objsearch(Lm_list *, int, const char *, const char *, + uint_t, const char *); +extern void Dbg_audit_pltenter(Lm_list *, int, const char *, const char *, + Addr); +extern void Dbg_audit_pltexit(Lm_list *, const char *, const char *); +extern void Dbg_audit_preinit(Lm_list *, const char *, const char *); +extern void Dbg_audit_symbind(Lm_list *, int, const char *, const char *, + Addr, uint_t); extern void Dbg_audit_skip(Lm_list *, const char *, const char *); extern void Dbg_audit_terminate(Lm_list *, const char *); -extern void Dbg_audit_version(Lm_list *, const char *, ulong_t); +extern void Dbg_audit_version(Lm_list *, const char *, uint_t, uint_t); + +extern void Dbg_basic_collect(Lm_list *); +extern void Dbg_basic_create(Lm_list *); +extern void Dbg_basic_finish(Lm_list *); +extern void Dbg_basic_files(Lm_list *); +extern void Dbg_basic_options(Lm_list *); +extern void Dbg_basic_relocate(Lm_list *); +extern void Dbg_basic_validate(Lm_list *); extern void Dbg_bind_global(Rt_map *, Addr, Off, Xword, Pltbindtype, Rt_map *, Addr, Off, const char *, uint_t); @@ -649,26 +808,43 @@ extern void Dbg_bind_pltpad_to(Rt_map *, extern void Dbg_bind_reject(Rt_map *, Rt_map *, const char *, int); extern void Dbg_bind_weak(Rt_map *, Addr, Addr, const char *); -extern void Dbg_cap_hw_candidate(Lm_list *, const char *); -extern void Dbg_cap_hw_filter(Lm_list *, const char *, Rt_map *); -extern void Dbg_cap_mapfile(Lm_list *, Xword, Xword, Half); -extern void Dbg_cap_sec_entry(Lm_list *, uint_t, Xword, Xword, Half); -extern void Dbg_cap_sec_title(Ofl_desc *); -extern void Dbg_cap_val_hw1(Lm_list *, Xword, Half); +extern void Dbg_cap_candidate(Lm_list *, const char *); +extern void Dbg_cap_filter(Lm_list *, const char *, Rt_map *); +extern void Dbg_cap_id(Lm_list *, Lineno, const char *, const char *); +extern void Dbg_cap_identical(Lm_list *, const char *, const char *); +extern void Dbg_cap_mapfile_title(Lm_list *, Lineno); +extern void Dbg_cap_post_title(Lm_list *, int *); +extern void Dbg_cap_sec_title(Lm_list *, const char *); +extern void Dbg_cap_val(Lm_list *, Syscapset *, Syscapset *, Half); +extern void Dbg_cap_ptr_entry(Lm_list *, dbg_state_t, Xword, const char *); +extern void Dbg_cap_val_entry(Lm_list *, dbg_state_t, Xword, Xword, Half); + +extern void Dbg_dl_dladdr(Rt_map *, void *); +extern void Dbg_dl_dlclose(Rt_map *, const char *, int); +extern void Dbg_dl_dldump(Rt_map *, const char *, const char *, int); +extern void Dbg_dl_dlerror(Rt_map *, const char *); +extern void Dbg_dl_dlinfo(Rt_map *, const char *, int, void *); +extern void Dbg_dl_dlopen(Rt_map *, const char *, int *, int); +extern void Dbg_dl_dlsym(Rt_map *, const char *, int *, const char *, int); +extern void Dbg_dl_iphdr_enter(Rt_map *, u_longlong_t, u_longlong_t); +extern void Dbg_dl_iphdr_callback(Lm_list *, struct dl_phdr_info *); +extern void Dbg_dl_iphdr_mapchange(Lm_list *, u_longlong_t, u_longlong_t); +extern void Dbg_dl_iphdr_unmap_ret(Lm_list *); extern const char * Dbg_demangle_name(const char *); -extern void Dbg_ent_entry(Lm_list *, Half, Ent_desc *); -extern void Dbg_ent_print(Lm_list *, Half, List *, Boolean); +extern void Dbg_ent_entry(Lm_list *, uchar_t, Half, Ent_desc *); +extern void Dbg_ent_print(Lm_list *, uchar_t, Half, APlist *); extern void Dbg_file_analyze(Rt_map *); -extern void Dbg_file_aout(Lm_list *, const char *, ulong_t, ulong_t, - ulong_t, const char *, Aliste); -extern void Dbg_file_ar(Lm_list *, const char *, int); -extern void Dbg_file_ar_rescan(Lm_list *); +extern void Dbg_file_aout(Lm_list *, const char *, Addr, size_t, + const char *, Aliste); +extern void Dbg_file_ar(Lm_list *, const char *, Boolean); +extern void Dbg_file_ar_rescan(Lm_list *, int, int); extern void Dbg_file_bind_entry(Lm_list *, Bnd_desc *); extern void Dbg_file_bindings(Rt_map *, int); +extern void Dbg_file_bindings_done(Lm_list *); extern void Dbg_file_cleanup(Lm_list *, const char *, Aliste); extern void Dbg_file_cntl(Lm_list *, Aliste, Aliste); extern void Dbg_file_config_dis(Lm_list *, const char *, int); @@ -676,11 +852,9 @@ extern void Dbg_file_config_obj(Lm_list const char *); extern void Dbg_file_del_rescan(Lm_list *); extern void Dbg_file_delete(Rt_map *); -extern void Dbg_file_dlclose(Lm_list *, const char *, int); -extern void Dbg_file_dldump(Rt_map *, const char *, int); -extern void Dbg_file_dlopen(Rt_map *, const char *, int *, int); -extern void Dbg_file_elf(Lm_list *, const char *, ulong_t, ulong_t, - ulong_t, ulong_t, const char *, Aliste); +extern void Dbg_file_deferred(Lm_list *, const char *, const char *); +extern void Dbg_file_elf(Lm_list *, const char *, Addr, size_t, + const char *, Aliste); extern void Dbg_file_filtee(Lm_list *, const char *, const char *, int); extern void Dbg_file_filter(Lm_list *, const char *, const char *, int); extern void Dbg_file_fixname(Lm_list *, const char *, const char *); @@ -691,6 +865,8 @@ extern void Dbg_file_hdl_title(int); extern void Dbg_file_lazyload(Rt_map *, const char *, const char *); extern void Dbg_file_ldso(Rt_map *, char **, auxv_t *, const char *, Aliste); +extern void Dbg_file_mmapobj(Lm_list *, const char *, mmapobj_result_t *, + uint_t); extern void Dbg_file_mode_promote(Rt_map *, int); extern void Dbg_file_modified(Lm_list *, const char *, const char *, const char *, int, int, Elf *, Elf *); @@ -707,32 +883,42 @@ extern void Dbg_got_display(Ofl_desc *, extern void Dbg_libs_audit(Lm_list *, const char *, const char *); extern void Dbg_libs_find(Lm_list *, const char *); extern void Dbg_libs_found(Lm_list *, const char *, int); -extern void Dbg_libs_ignore(Lm_list *, const char *); -extern void Dbg_libs_init(Lm_list *, List *, List *); +extern void Dbg_libs_insecure(Lm_list *, const char *, int); +extern void Dbg_libs_init(Lm_list *, APlist *, APlist *); extern void Dbg_libs_l(Lm_list *, const char *, const char *); extern void Dbg_libs_path(Lm_list *, const char *, uint_t, const char *); extern void Dbg_libs_req(Lm_list *, const char *, const char *, const char *); -extern void Dbg_libs_update(Lm_list *, List *, List *); +extern void Dbg_libs_update(Lm_list *, APlist *, APlist *); extern void Dbg_libs_yp(Lm_list *, const char *); extern void Dbg_libs_ylu(Lm_list *, const char *, const char *, int); -extern void Dbg_map_dash(Lm_list *, const char *, Sdf_desc *); -extern void Dbg_map_ent(Lm_list *, Boolean, Ent_desc *, Ofl_desc *); -extern void Dbg_map_parse(Lm_list *, const char *); -extern void Dbg_map_pipe(Lm_list *, Sg_desc *, const char *, const Word); -extern void Dbg_map_seg(Ofl_desc *, int, Sg_desc *); -extern void Dbg_map_set_atsign(Boolean); -extern void Dbg_map_set_equal(Boolean); -extern void Dbg_map_size_new(Lm_list *, const char *); -extern void Dbg_map_size_old(Ofl_desc *, Sym_desc *); -extern void Dbg_map_sort_fini(Lm_list *, Sg_desc *); -extern void Dbg_map_sort_orig(Lm_list *, Sg_desc *); +extern void Dbg_map_cexp_id(Lm_list *, Boolean, const char *, Lineno, + const char *); +extern void Dbg_map_dv(Lm_list *, const char *, Lineno); +extern void Dbg_map_dv_entry(Lm_list *, Lineno, int, const char *); +extern void Dbg_map_ent(Lm_list *, Ent_desc *, Ofl_desc *, Lineno); +extern void Dbg_map_ent_ord_title(Lm_list *, const char *); +extern void Dbg_map_hdr_noalloc(Lm_list *, Lineno); +extern void Dbg_map_parse(Lm_list *, const char *, int); +extern void Dbg_map_pass(Lm_list *, Boolean, const char *, Lineno, + const char *); +extern void Dbg_map_post_title(Lm_list *); +extern void Dbg_map_seg(Ofl_desc *, dbg_state_t, int, Sg_desc *, Lineno); +extern void Dbg_map_seg_order(Ofl_desc *, uchar_t, Half, dbg_state_t, + Lineno); +extern void Dbg_map_seg_os_order(Lm_list *, Sg_desc *, const char *, + Word, Lineno); +extern void Dbg_map_size_new(Lm_list *, const char *, const char *, Lineno); +extern void Dbg_map_size_old(Ofl_desc *, Sym_desc *, const char *, Lineno); +extern void Dbg_map_sort_title(Lm_list *, Boolean); +extern void Dbg_map_sort_seg(Lm_list *, uchar_t, Half, Sg_desc *); extern void Dbg_map_symbol(Ofl_desc *, Sym_desc *); extern void Dbg_map_version(Lm_list *, const char *, const char *, int); extern void Dbg_move_adjexpandreloc(Lm_list *, Xword, const char *); extern void Dbg_move_adjmovereloc(Lm_list *, Xword, Xword, const char *); +extern void Dbg_move_bad(Lm_list *, ulong_t, const char *, Addr); extern void Dbg_move_data(Rt_map *); extern void Dbg_move_entry1(Lm_list *, int, Move *, Sym_desc *); extern void Dbg_move_entry2(Lm_list *, Move *, Word, const char *); @@ -747,8 +933,8 @@ extern void Dbg_reloc_apply_val(Lm_list extern void Dbg_reloc_ars_entry(Lm_list *, int, Word, Half, Rel_desc *); extern void Dbg_reloc_copy(Rt_map *, Rt_map *, const char *, int); extern void Dbg_reloc_discard(Lm_list *, Half, Rel_desc *); -extern void Dbg_reloc_doact(Lm_list *, int, Half, Word, Word, Xword, Xword, - const char *, Os_desc *); +extern void Dbg_reloc_doact(Lm_list *, int, Half, Word, Rel_desc *, + Xword, Xword, rel_desc_sname_func_t); extern void Dbg_reloc_doact_title(Lm_list *); extern void Dbg_reloc_dooutrel(Lm_list *, Word); extern void Dbg_reloc_entry(Lm_list *, const char *, Half, Word, void *, @@ -757,35 +943,40 @@ extern void Dbg_reloc_error(Lm_list *, i const char *); extern void Dbg_reloc_generate(Lm_list *, Os_desc *, Word); extern void Dbg_reloc_in(Lm_list *, int, Half, Word, void *, const char *, - const char *); + Word, const char *); extern void Dbg_reloc_ors_entry(Lm_list *, int, Word, Half, Rel_desc *); extern void Dbg_reloc_out(Ofl_desc *, int, Word, void *, const char *, const char *); extern void Dbg_reloc_proc(Lm_list *, Os_desc *, Is_desc *, Is_desc *); extern void Dbg_reloc_run(Rt_map *, uint_t, int, int); -extern void Dbg_reloc_transition(Lm_list *, Half, Word, Rel_desc *); -extern void Dbg_reloc_sloppycomdat(Lm_list *, const char *, Sym_desc *); +extern void Dbg_reloc_transition(Lm_list *, Half, Word, Rel_desc *, + rel_desc_sname_func_t); +extern void Dbg_reloc_sloppycomdat(Lm_list *, Sym_desc *); extern void Dbg_sec_added(Lm_list *, Os_desc *, Sg_desc *); +extern void Dbg_sec_backing(Lm_list *); extern void Dbg_sec_created(Lm_list *, Os_desc *, Sg_desc *); extern void Dbg_sec_discarded(Lm_list *, Is_desc *, Is_desc *); extern void Dbg_sec_genstr_compress(Lm_list *, const char *, Xword, Xword); extern void Dbg_sec_group(Lm_list *, Is_desc *, Group_desc *); +extern void Dbg_sec_gnu_comdat(Lm_list *, Is_desc *, Boolean, Boolean); extern void Dbg_sec_in(Lm_list *, Is_desc *); extern void Dbg_sec_order_error(Lm_list *, Ifl_desc *, Word, int); extern void Dbg_sec_order_list(Ofl_desc *, int); +extern void Dbg_sec_redirected(Lm_list *, Is_desc *, const char *); extern void Dbg_sec_strtab(Lm_list *, Os_desc *, Str_tbl *); extern void Dbg_sec_unsup_strmerge(Lm_list *, Is_desc *); -extern void Dbg_seg_desc_entry(Lm_list *, Half, int, Sg_desc *); +extern void Dbg_seg_desc_entry(Lm_list *, uchar_t, Half, int, Sg_desc *, + Boolean); extern void Dbg_seg_entry(Ofl_desc *, int, Sg_desc *); -extern void Dbg_seg_list(Lm_list *, Half, List *); +extern void Dbg_seg_list(Lm_list *, uchar_t, Half, APlist *); extern void Dbg_seg_os(Ofl_desc *, Os_desc *, int); extern void Dbg_seg_title(Lm_list *); -extern void Dbg_shdr_modified(Lm_list *, const char *, Half, Shdr *, Shdr *, - const char *); +extern void Dbg_shdr_modified(Lm_list *, const char *, uchar_t, Half, + Word, Shdr *, Shdr *, const char *); extern void Dbg_statistics_ar(Ofl_desc *); extern void Dbg_statistics_ld(Ofl_desc *); @@ -794,21 +985,29 @@ extern void Dbg_support_action(Lm_list * Support_ndx, const char *); extern void Dbg_support_load(Lm_list *, const char *, const char *); extern void Dbg_support_req(Lm_list *, const char *, int); +extern void Dbg_support_vnone(Lm_list *, const char *); extern void Dbg_syminfo_entry(Lm_list *, Word, Syminfo *, Sym *, const char *, Dyn *); extern void Dbg_syminfo_title(Lm_list *); -extern void Dbg_syms_ar_checking(Lm_list *, Xword, Elf_Arsym *, - const char *); -extern void Dbg_syms_ar_entry(Lm_list *, Xword, Elf_Arsym *); -extern void Dbg_syms_ar_resolve(Lm_list *, Xword, Elf_Arsym *, - const char *, int); -extern void Dbg_syms_ar_title(Lm_list *, const char *, int); +extern void Dbg_syms_ar_checking(Lm_list *, const char *, const char *, + Elf_Arsym *); +extern void Dbg_syms_ar_force(Lm_list *, const char *, const char *); +extern void Dbg_syms_ar_resolve(Lm_list *, const char *, const char *, + Elf_Arsym *); +extern void Dbg_syms_ar_skip(Lm_list *, const char *, Elf_Arsym *); +extern void Dbg_syms_ar_title(Lm_list *, const char *, Boolean); +extern void Dbg_syms_cap_convert(Ofl_desc *, Word, const char *, Sym *); +extern void Dbg_syms_cap_local(Ofl_desc *, Word, const char *, Sym *, + Sym_desc *); +extern void Dbg_syms_cap_lookup(Rt_map *, uint_t, const char *, uint_t, + Half, Syscapset *); +extern void Dbg_syms_cap_title(Ofl_desc *); +extern void Dbg_syms_copy_reloc(Ofl_desc *, Sym_desc *, Word); extern void Dbg_syms_created(Lm_list *, const char *); extern void Dbg_syms_discarded(Lm_list *, Sym_desc *); -extern void Dbg_syms_dlsym(Rt_map *, const char *, int *, const char *, - int); +extern void Dbg_syms_dup_discarded(Lm_list *, Word ndx, Sym_desc *); extern void Dbg_syms_dup_sort_addr(Lm_list *, const char *, const char *, const char *, Addr); extern void Dbg_syms_entered(Ofl_desc *, Sym *, Sym_desc *); @@ -826,7 +1025,6 @@ extern void Dbg_syms_old(Ofl_desc *, Sym extern void Dbg_syms_process(Lm_list *, Ifl_desc *); extern void Dbg_syms_reduce(Ofl_desc *, int, Sym_desc *, int, const char *); -extern void Dbg_syms_reloc(Ofl_desc *, Sym_desc *); extern void Dbg_syms_resolved(Ofl_desc *, Sym_desc *); extern void Dbg_syms_resolving(Ofl_desc *, Word, const char *, int, int, Sym *, Sym *, Sym_desc *, Ifl_desc *); @@ -835,12 +1033,12 @@ extern void Dbg_syms_sec_title(Lm_list * extern void Dbg_syms_spec_title(Lm_list *); extern void Dbg_syms_updated(Ofl_desc *, Sym_desc *, const char *); extern void Dbg_syms_up_title(Lm_list *); +extern void Dbg_syms_wrap(Lm_list *, Word, const char *, const char *); extern void Dbg_tls_modactivity(Lm_list *, void *, uint_t); extern void Dbg_tls_static_block(Lm_list *, void *, ulong_t, ulong_t); extern void Dbg_tls_static_resv(Rt_map *, ulong_t, ulong_t); -extern void Dbg_util_broadcast(Rt_map *); extern void Dbg_util_call_array(Rt_map *, void *, int, Word); extern void Dbg_util_call_fini(Rt_map *); extern void Dbg_util_call_init(Rt_map *, int); @@ -854,10 +1052,9 @@ extern void Dbg_util_intoolate(Rt_map *) extern void Dbg_util_lcinterface(Rt_map *, int, char *); extern void Dbg_util_nl(Lm_list *, int); extern void Dbg_util_no_init(Rt_map *); -extern void Dbg_util_str(Lm_list *, const char *); extern void Dbg_util_scc_entry(Rt_map *, uint_t); extern void Dbg_util_scc_title(Lm_list *, int); -extern void Dbg_util_wait(Rt_map *, Rt_map *, int); +extern void Dbg_util_str(Lm_list *, const char *); extern void Dbg_unused_file(Lm_list *, const char *, int, uint_t); extern void Dbg_unused_lcinterface(Rt_map *, Rt_map *, int); @@ -870,6 +1067,7 @@ extern void Dbg_ver_avail_entry(Lm_list extern void Dbg_ver_avail_title(Lm_list *, const char *); extern void Dbg_ver_def_title(Lm_list *, const char *); extern void Dbg_ver_desc_entry(Lm_list *, Ver_desc *); +extern void Dbg_ver_need_done(Lm_list *); extern void Dbg_ver_need_entry(Lm_list *, Half, const char *, const char *); extern void Dbg_ver_need_title(Lm_list *, const char *); @@ -882,6 +1080,7 @@ extern void Dbg_ver_symbol(Lm_list *, co #define ELF_DBG_ELFDUMP 1 #define ELF_DBG_RTLD 2 #define ELF_DBG_LD 3 +#define ELF_DBG_LD_ACT 4 /* * Define generic Elf_*() interfaces. @@ -967,12 +1166,14 @@ extern void Elf_syminfo_title(Lm_list *) #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 08:11:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F5F41065674; Fri, 13 Jul 2012 08:11:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85B748FC12; Fri, 13 Jul 2012 08:11: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 q6D8Bu4v056395; Fri, 13 Jul 2012 08:11:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6D8BuqI056393; Fri, 13 Jul 2012 08:11:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201207130811.q6D8BuqI056393@svn.freebsd.org> From: Andriy Gapon Date: Fri, 13 Jul 2012 08:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238418 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 08:11:56 -0000 Author: avg Date: Fri Jul 13 08:11:55 2012 New Revision: 238418 URL: http://svn.freebsd.org/changeset/base/238418 Log: acpi_cpu: separate a notion of current deepest allowed+available Cx level ... from a user-set persistent limit on the said level. Allow to set the user-imposed limit below current deepest available level as the available levels may be dynamically changed by ACPI platform in both directions. Allow "Cmax" as an input value for cx_lowest sysctls to mean that there is not limit and OS can use all available C-states. Retire global cpu_cx_count as it no longer serves any meaningful purpose. Reviewed by: jhb, gianni, sbruno Tested by: sbruno, Vitaly Magerya MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Fri Jul 13 08:02:58 2012 (r238417) +++ head/sys/dev/acpica/acpi_cpu.c Fri Jul 13 08:11:55 2012 (r238418) @@ -89,6 +89,7 @@ struct acpi_cpu_softc { struct sysctl_ctx_list cpu_sysctl_ctx; struct sysctl_oid *cpu_sysctl_tree; int cpu_cx_lowest; + int cpu_cx_lowest_lim; char cpu_cx_supported[64]; int cpu_rid; }; @@ -138,13 +139,12 @@ static int cpu_quirks; /* Indicate any /* Runtime state. */ static int cpu_disable_idle; /* Disable entry to idle function */ -static int cpu_cx_count; /* Number of valid Cx states */ /* Values for sysctl. */ static struct sysctl_ctx_list cpu_sysctl_ctx; static struct sysctl_oid *cpu_sysctl_tree; static int cpu_cx_generic; -static int cpu_cx_lowest; +static int cpu_cx_lowest_lim; static device_t *cpu_devices; static int cpu_ndevices; @@ -173,7 +173,7 @@ static void acpi_cpu_idle(void); static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); -static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val); +static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); @@ -590,6 +590,7 @@ acpi_cpu_cx_probe(struct acpi_cpu_softc /* Use initial sleep value of 1 sec. to start with lowest idle state. */ sc->cpu_prev_sleep = 1000000; sc->cpu_cx_lowest = 0; + sc->cpu_cx_lowest_lim = 0; /* * Check for the ACPI 2.0 _CST sleep states object. If we can't find @@ -820,7 +821,6 @@ acpi_cpu_startup(void *arg) */ acpi_cpu_quirks(); - cpu_cx_count = 0; if (cpu_cx_generic) { /* * We are using generic Cx mode, probe for available Cx states @@ -829,24 +829,10 @@ acpi_cpu_startup(void *arg) for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); acpi_cpu_generic_cx_probe(sc); - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; - } - - /* - * Find the highest Cx state common to all CPUs - * in the system, taking quirks into account. - */ - for (i = 0; i < cpu_ndevices; i++) { - sc = device_get_softc(cpu_devices[i]); - if (sc->cpu_cx_count < cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; } } else { /* * We are using _CST mode, remove C3 state if necessary. - * Update the largest Cx state supported in the global cpu_cx_count. - * It will be used in the global Cx sysctl handler. * As we now know for sure that we will be using _CST mode * install our notify handler. */ @@ -855,8 +841,6 @@ acpi_cpu_startup(void *arg) if (cpu_quirks & CPU_QUIRK_NO_C3) { sc->cpu_cx_count = sc->cpu_non_c3 + 1; } - if (sc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = sc->cpu_cx_count; AcpiInstallNotifyHandler(sc->cpu_handle, ACPI_DEVICE_NOTIFY, acpi_cpu_notify, sc); } @@ -875,7 +859,7 @@ acpi_cpu_startup(void *arg) "Global lowest Cx sleep state to use"); /* Take over idling from cpu_idle_default(). */ - cpu_cx_lowest = 0; + cpu_cx_lowest_lim = 0; cpu_disable_idle = FALSE; cpu_idle_hook = acpi_cpu_idle; } @@ -1058,8 +1042,6 @@ static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context; - struct acpi_cpu_softc *isc; - int i; if (notify != ACPI_NOTIFY_CX_STATES) return; @@ -1068,16 +1050,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no acpi_cpu_cx_cst(sc); acpi_cpu_cx_list(sc); - /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); - cpu_cx_count = 0; - for (i = 0; i < cpu_ndevices; i++) { - isc = device_get_softc(cpu_devices[i]); - if (isc->cpu_cx_count > cpu_cx_count) - cpu_cx_count = isc->cpu_cx_count; - } - if (sc->cpu_cx_lowest < cpu_cx_lowest) - acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); } @@ -1205,12 +1179,12 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG } static int -acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc, int val) +acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { int i; ACPI_SERIAL_ASSERT(cpu); - sc->cpu_cx_lowest = val; + sc->cpu_cx_lowest = min(sc->cpu_cx_lowest_lim, sc->cpu_cx_count - 1); /* If not disabling, cache the new lowest non-C3 state. */ sc->cpu_non_c3 = 0; @@ -1234,18 +1208,23 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER int val, error; sc = (struct acpi_cpu_softc *) arg1; - snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", sc->cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > sc->cpu_cx_count - 1) - return (EINVAL); + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } ACPI_SERIAL_BEGIN(cpu); - acpi_cpu_set_cx_lowest(sc, val); + sc->cpu_cx_lowest_lim = val - 1; + acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); return (0); @@ -1258,22 +1237,27 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ char state[8]; int val, error, i; - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + snprintf(state, sizeof(state), "C%d", cpu_cx_lowest_lim + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); if (strlen(state) < 2 || toupper(state[0]) != 'C') return (EINVAL); - val = (int) strtol(state + 1, NULL, 10) - 1; - if (val < 0 || val > cpu_cx_count - 1) - return (EINVAL); - cpu_cx_lowest = val; + if (strcasecmp(state, "Cmax") == 0) + val = MAX_CX_STATES; + else { + val = (int) strtol(state + 1, NULL, 10); + if (val < 1 || val > MAX_CX_STATES) + return (EINVAL); + } /* Update the new lowest useable Cx state for all CPUs. */ ACPI_SERIAL_BEGIN(cpu); + cpu_cx_lowest_lim = val - 1; for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); + sc->cpu_cx_lowest_lim = cpu_cx_lowest_lim; + acpi_cpu_set_cx_lowest(sc); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 12:37:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D8B9106564A; Fri, 13 Jul 2012 12:37:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16CC38FC0A; Fri, 13 Jul 2012 12:37: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 q6DCbYfg069233; Fri, 13 Jul 2012 12:37:34 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DCbYDt069228; Fri, 13 Jul 2012 12:37:34 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207131237.q6DCbYDt069228@svn.freebsd.org> From: Martin Matuska Date: Fri, 13 Jul 2012 12:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238422 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 12:37:35 -0000 Author: mm Date: Fri Jul 13 12:37:34 2012 New Revision: 238422 URL: http://svn.freebsd.org/changeset/base/238422 Log: Merge illumos commit 13749:df4cd82e2b60 1796 "ZFS HOLD" should not be used when doing "ZFS SEND" froma read-only pool 2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite 2903 zfs destroy -d does not work 2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot References: https://www.illumos.org/issues/1796 https://www.illumos.org/issues/2871 https://www.illumos.org/issues/2903 https://www.illumos.org/issues/2957 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 13 11:08:37 2012 (r238421) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 13 12:37:34 2012 (r238422) @@ -1092,7 +1092,7 @@ snapshot_to_nvl_cb(zfs_handle_t *zhp, vo int err = 0; /* Check for clones. */ - if (!cb->cb_doclones) { + if (!cb->cb_doclones && !cb->cb_defer_destroy) { cb->cb_target = zhp; cb->cb_first = B_TRUE; err = zfs_iter_dependents(zhp, B_TRUE, Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jul 13 11:08:37 2012 (r238421) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c Fri Jul 13 12:37:34 2012 (r238422) @@ -337,6 +337,48 @@ zpool_refresh_stats(zpool_handle_t *zhp, } /* + * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over + * pools it lists. + * + * This is an undocumented feature for use during testing only. + * + * This function returns B_TRUE if the pool should be skipped + * during iteration. + */ +static boolean_t +check_restricted(const char *poolname) +{ + static boolean_t initialized = B_FALSE; + static char *restricted = NULL; + + const char *cur, *end; + int len, namelen; + + if (!initialized) { + initialized = B_TRUE; + restricted = getenv("__ZFS_POOL_RESTRICT"); + } + + if (NULL == restricted) + return (B_FALSE); + + cur = restricted; + namelen = strlen(poolname); + do { + end = strchr(cur, ' '); + len = (NULL == end) ? strlen(cur) : (end - cur); + + if (len == namelen && 0 == strncmp(cur, poolname, len)) { + return (B_FALSE); + } + + cur += (len + 1); + } while (NULL != end); + + return (B_TRUE); +} + +/* * Iterate over all pools in the system. */ int @@ -359,6 +401,9 @@ zpool_iter(libzfs_handle_t *hdl, zpool_i for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { + if (check_restricted(cn->cn_name)) + continue; + if (zpool_open_silent(hdl, cn->cn_name, &zhp) != 0) { hdl->libzfs_pool_iter--; return (-1); @@ -394,6 +439,9 @@ zfs_iter_root(libzfs_handle_t *hdl, zfs_ for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL; cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) { + if (check_restricted(cn->cn_name)) + continue; + if ((zhp = make_dataset_handle(hdl, cn->cn_name)) == NULL) continue; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 13 11:08:37 2012 (r238421) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 13 12:37:34 2012 (r238422) @@ -3138,7 +3138,8 @@ zfs_create(libzfs_handle_t *hdl, const c /* * Destroys the given dataset. The caller must make sure that the filesystem - * isn't mounted, and that there are no active dependents. + * isn't mounted, and that there are no active dependents. If the file system + * does not exist this function does nothing. */ int zfs_destroy(zfs_handle_t *zhp, boolean_t defer) @@ -3154,7 +3155,8 @@ zfs_destroy(zfs_handle_t *zhp, boolean_t } zc.zc_defer_destroy = defer; - if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0) { + if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0 && + errno != ENOENT) { return (zfs_standard_error_fmt(zhp->zfs_hdl, errno, dgettext(TEXT_DOMAIN, "cannot destroy '%s'"), zhp->zfs_name)); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 13 11:08:37 2012 (r238421) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 13 12:37:34 2012 (r238422) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. @@ -1387,7 +1387,6 @@ zfs_send(zfs_handle_t *zhp, const char * avl_tree_t *fsavl = NULL; static uint64_t holdseq; int spa_version; - boolean_t holdsnaps = B_FALSE; pthread_t tid; int pipefd[2]; dedup_arg_t dda = { 0 }; @@ -1410,11 +1409,6 @@ zfs_send(zfs_handle_t *zhp, const char * } } - if (!flags->dryrun && zfs_spa_version(zhp, &spa_version) == 0 && - spa_version >= SPA_VERSION_USERREFS && - (flags->doall || flags->replicate)) - holdsnaps = B_TRUE; - if (flags->dedup && !flags->dryrun) { featureflags |= (DMU_BACKUP_FEATURE_DEDUP | DMU_BACKUP_FEATURE_DEDUPPROPS); @@ -1536,7 +1530,18 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.filter_cb_arg = cb_arg; if (debugnvp) sdd.debugnv = *debugnvp; - if (holdsnaps || flags->progress) { + + /* + * Some flags require that we place user holds on the datasets that are + * being sent so they don't get destroyed during the send. We can skip + * this step if the pool is imported read-only since the datasets cannot + * be destroyed. + */ + if (!flags->dryrun && !zpool_get_prop_int(zfs_get_pool_handle(zhp), + ZPOOL_PROP_READONLY, NULL) && + zfs_spa_version(zhp, &spa_version) == 0 && + spa_version >= SPA_VERSION_USERREFS && + (flags->doall || flags->replicate)) { ++holdseq; (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag), ".send-%d-%llu", getpid(), (u_longlong_t)holdseq); From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 13:23:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442A8106566C; Fri, 13 Jul 2012 13:23:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CF4A8FC18; Fri, 13 Jul 2012 13:23:49 +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 q6DDNnHb071130; Fri, 13 Jul 2012 13:23:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DDNnFK071126; Fri, 13 Jul 2012 13:23:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207131323.q6DDNnFK071126@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jul 2012 13:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238423 - in head: tools/regression/usr.sbin/etcupdate usr.sbin usr.sbin/etcupdate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 13:23:49 -0000 Author: jhb Date: Fri Jul 13 13:23:48 2012 New Revision: 238423 URL: http://svn.freebsd.org/changeset/base/238423 Log: The etcupdate utility is a tool for managing updates to files that are not updated as part of `make installworld' such as files in /etc. It manages updates by doing a three-way merge of changes made to these files against the local versions. It is also designed to minimize the amount of user intervention with the goal of simplifying upgrades for clusters of machines. The primary difference from mergemaster is that etcupdate requires less manual work. The primary difference from etcmerge is that etcupdate updates files in-place similar to mergemaster rather than building a separate /etc tree. Requested by: obrien, kib, theraven, joeld (among others) Added: head/tools/regression/usr.sbin/etcupdate/ head/tools/regression/usr.sbin/etcupdate/always.sh (contents, props changed) head/tools/regression/usr.sbin/etcupdate/conflicts.sh (contents, props changed) head/tools/regression/usr.sbin/etcupdate/fbsdid.sh (contents, props changed) head/tools/regression/usr.sbin/etcupdate/ignore.sh (contents, props changed) head/tools/regression/usr.sbin/etcupdate/tests.sh (contents, props changed) head/usr.sbin/etcupdate/ head/usr.sbin/etcupdate/Makefile (contents, props changed) head/usr.sbin/etcupdate/etcupdate.8 (contents, props changed) head/usr.sbin/etcupdate/etcupdate.sh (contents, props changed) Modified: head/usr.sbin/Makefile Added: head/tools/regression/usr.sbin/etcupdate/always.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.sbin/etcupdate/always.sh Fri Jul 13 13:23:48 2012 (r238423) @@ -0,0 +1,608 @@ +#!/bin/sh +# +# Copyright (c) 2010 Advanced Computing Technologies LLC +# Written by: John H. Baldwin +# 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$ + +# Various regression tests to test the -A flag to the 'update' command. + +WORKDIR=work + +usage() +{ + echo "Usage: always.sh [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory. +while getopts "w:" option; do + case $option in + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +# The various states of the comparison of a file between two trees. +states="equal first second difftype difflinks difffiles" + +# These tests deal with ignoring certain patterns of files. We run +# the test multiple times forcing the install of different patterns. +build_trees() +{ + local i + + rm -rf $OLD $NEW $TEST $CONFLICTS + + for i in $states; do + for j in $states; do + for k in $states; do + mkdir -p $OLD/$i/$j/$k $NEW/$i/$j/$k \ + $TEST/$i/$j/$k + done + done + done + + # What follows are the various warning/conflict cases from the + # larger regression tests. These results of many of these + # tests should be changed when installation is forced. The + # cases when these updates should still fail even when forced + # are: 1) it should not force the removal of a modified file + # and 2) it should not remove a subdirectory that contains a + # modified or added file. + + # /first/difftype/second: File with different local type + # removed. Should generate a warning. + mkfifo $OLD/first/difftype/second/fifo + mkdir $TEST/first/difftype/second/fifo + + # /first/difflinks/second: Modified link removed. Should + # generate a warning. + ln -s "old link" $OLD/first/difflinks/second/link + ln -s "test link" $TEST/first/difflinks/second/link + + # /first/difffiles/second: Modified file removed. Should + # generate a warning. + echo "foo" > $OLD/first/difffiles/second/file + echo "bar" > $TEST/first/difffiles/second/file + + # /second/second/difftype: Newly added file conflicts with + # existing file in test tree of a different type. Should + # generate a warning. + mkdir $NEW/second/second/difftype/dir + mkfifo $TEST/second/second/difftype/dir + + # /second/second/difflinks: Newly added link conflicts with + # existing link in test tree. Should generate a warning. + ln -s "new link" $NEW/second/second/difflinks/link + ln -s "test link" $TEST/second/second/difflinks/link + + # /second/second/difffiles: Newly added file conflicts with + # existing file in test tree. Should generate a warning. + echo "new" > $NEW/second/second/difffiles/file + echo "test" > $TEST/second/second/difffiles/file + + # /difftype/first/first: A removed file has changed type. + # This should generate a warning. + mkfifo $OLD/difftype/first/first/fifo + mkdir $NEW/difftype/first/first/fifo + + # /difftype/difftype/difftype: All three files (old, new, and + # test) are different types from each other. This should + # generate a warning. + mkfifo $OLD/difftype/difftype/difftype/one + mkdir $NEW/difftype/difftype/difftype/one + echo "foo" > $TEST/difftype/difftype/difftype/one + mkdir $OLD/difftype/difftype/difftype/two + echo "baz" > $NEW/difftype/difftype/difftype/two + ln -s "bar" $TEST/difftype/difftype/difftype/two + + # /difftype/difftype/difflinks: A file has changed from a + # non-link to a link in both the new and test trees, but the + # target of the new and test links differ. This should + # generate a new link conflict. + mkfifo $OLD/difftype/difftype/difflinks/link + ln -s "new" $NEW/difftype/difftype/difflinks/link + ln -s "test" $TEST/difftype/difftype/difflinks/link + + # /difftype/difftype/difffile: A file has changed from a + # non-regular file to a regular file in both the new and test + # trees, but the contents in the new and test files differ. + # This should generate a new file conflict. + ln -s "old" $OLD/difftype/difftype/difffiles/file + echo "foo" > $NEW/difftype/difftype/difffiles/file + echo "bar" > $TEST/difftype/difftype/difffiles/file + + # /difflinks/first/first: A modified link is missing in the + # test tree. This should generate a warning. + ln -s "old" $OLD/difflinks/first/first/link + ln -s "new" $NEW/difflinks/first/first/link + + # /difflinks/difftype/difftype: An updated link has been + # changed to a different file type in the test tree. This + # should generate a warning. + ln -s "old" $OLD/difflinks/difftype/difftype/link + ln -s "new" $NEW/difflinks/difftype/difftype/link + echo "test" > $TEST/difflinks/difftype/difftype/link + + # /difflinks/difflinks/difflinks: An updated link has been + # modified in the test tree and doesn't match either the old + # or new links. This should generate a warning. + ln -s "old" $OLD/difflinks/difflinks/difflinks/link + ln -s "new" $NEW/difflinks/difflinks/difflinks/link + ln -s "test" $TEST/difflinks/difflinks/difflinks/link + + # /difffiles/first/first: A removed file has been changed in + # the new tree. This should generate a warning. + echo "foo" > $OLD/difffiles/first/first/file + echo "bar" > $NEW/difffiles/first/first/file + + # /difffiles/difftype/difftype: An updated regular file has + # been changed to a different file type in the test tree. + # This should generate a warning. + echo "old" > $OLD/difffiles/difftype/difftype/file + echo "new" > $NEW/difffiles/difftype/difftype/file + mkfifo $TEST/difffiles/difftype/difftype/file + + # /difffiles/difffiles/difffiles: A modified regular file was + # updated in the new tree. The changes should be merged into + # to the new file if possible. If the merge fails, a conflict + # should be generated. For this test we just include the + # conflict case. + cat > $OLD/difffiles/difffiles/difffiles/conflict < $NEW/difffiles/difffiles/difffiles/conflict < $TEST/difffiles/difffiles/difffiles/conflict < $TEST/rmdir/extra/localfile.txt + + # /rmdir/conflict: Do not remove a directory with a conflicted + # remove file. This should generate a warning. + for i in $OLD $TEST; do + mkdir $i/rmdir/conflict + done + mkfifo $OLD/rmdir/conflict/difftype + mkdir $TEST/rmdir/conflict/difftype + + ## Tests for converting files to directories and vice versa + for i in $OLD $NEW $TEST; do + for j in already old fromdir todir; do + mkdir -p $i/dirchange/$j + done + done + + # /dirchange/fromdir/extradir: Convert a directory tree to a + # file. The test tree includes an extra file in the directory + # that is not present in the old tree. This should generate a + # warning. + for i in $OLD $TEST; do + mkdir $i/dirchange/fromdir/extradir + echo "foo" > $i/dirchange/fromdir/extradir/file + done + mkfifo $TEST/dirchange/fromdir/extradir/fifo + ln -s "bar" $NEW/dirchange/fromdir/extradir + + # /dirchange/fromdir/conflict: Convert a directory tree to a + # file. The test tree includes a local change that generates + # a warning and prevents the removal of the directory. + for i in $OLD $TEST; do + mkdir $i/dirchange/fromdir/conflict + done + echo "foo" > $OLD/dirchange/fromdir/conflict/somefile + echo "bar" > $TEST/dirchange/fromdir/conflict/somefile + mkfifo $NEW/dirchange/fromdir/conflict + + # /dirchange/todir/difffile: Convert a file to a directory + # tree. The test tree has a locally modified version of the + # file so that the conversion fails with a warning. + echo "foo" > $OLD/dirchange/todir/difffile + mkdir $NEW/dirchange/todir/difffile + echo "baz" > $NEW/dirchange/todir/difffile/file + echo "bar" > $TEST/dirchange/todir/difffile + + # /dirchange/todir/difftype: Similar to the previous test, but + # the conflict is due to a change in the file type. + echo "foo" > $OLD/dirchange/todir/difftype + mkdir $NEW/dirchange/todir/difftype + echo "baz" > $NEW/dirchange/todir/difftype/file + mkfifo $TEST/dirchange/todir/difftype +} + +# $1 - relative path to file that should be missing from TEST +missing() +{ + if [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be missing" + fi +} + +# $1 - relative path to file that should be present in TEST +present() +{ + if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be present" + fi +} + +# $1 - relative path to file that should be a fifo in TEST +fifo() +{ + if ! [ -p $TEST/$1 ]; then + echo "File $1 should be a FIFO" + fi +} + +# $1 - relative path to file that should be a directory in TEST +dir() +{ + if ! [ -d $TEST/$1 ]; then + echo "File $1 should be a directory" + fi +} + +# $1 - relative path to file that should be a symlink in TEST +# $2 - optional value of the link +link() +{ + local val + + if ! [ -L $TEST/$1 ]; then + echo "File $1 should be a link" + elif [ $# -gt 1 ]; then + val=`readlink $TEST/$1` + if [ "$val" != "$2" ]; then + echo "Link $1 should link to \"$2\"" + fi + fi +} + +# $1 - relative path to regular file that should be present in TEST +# $2 - optional string that should match file contents +# $3 - optional MD5 of the flie contents, overrides $2 if present +file() +{ + local contents sum + + if ! [ -f $TEST/$1 ]; then + echo "File $1 should be a regular file" + elif [ $# -eq 2 ]; then + contents=`cat $TEST/$1` + if [ "$contents" != "$2" ]; then + echo "File $1 has wrong contents" + fi + elif [ $# -eq 3 ]; then + sum=`md5 -q $TEST/$1` + if [ "$sum" != "$3" ]; then + echo "File $1 has wrong contents" + fi + fi +} + +# $1 - relative path to a regular file that should have a conflict +# $2 - optional MD5 of the conflict file contents +conflict() +{ + local sum + + if ! [ -f $CONFLICTS/$1 ]; then + echo "File $1 missing conflict" + elif [ $# -gt 1 ]; then + sum=`md5 -q $CONFLICTS/$1` + if [ "$sum" != "$2" ]; then + echo "Conflict $1 has wrong contents" + fi + fi +} + +# $1 - relative path to a regular file that should not have a conflict +noconflict() +{ + if [ -f $CONFLICTS/$1 ]; then + echo "File $1 should not have a conflict" + fi +} + +if [ `id -u` -ne 0 ]; then + echo "must be root" +fi + +if [ -r /etc/etcupdate.conf ]; then + echo "WARNING: /etc/etcupdate.conf settings may break some tests." +fi + +# First run the test ignoring no patterns. + +build_trees + +etcupdate -r -d $WORKDIR -D $TEST > $WORKDIR/test.out + +cat > $WORKDIR/correct.out < \ + $WORKDIR/test1.out + +cat > $WORKDIR/correct1.out < +# 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$ + +# Various regression tests to run for the 'resolve' command. + +WORKDIR=work + +usage() +{ + echo "Usage: tests.sh [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory. +while getopts "w:" option; do + case $option in + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +# These tests deal with conflicts to a single file. For each test, we +# generate a conflict in /etc/login.conf. Each resolve option is tested +# to ensure it DTRT. +build_login_conflict() +{ + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD/etc $NEW/etc $TEST/etc + + # Generate a conflict in /etc/login.conf. + cat > $OLD/etc/login.conf < $NEW/etc/login.conf < $TEST/etc/login.conf </dev/null +} + +# This is used to verify special handling for /etc/mail/aliases and +# the newaliases warning. +build_aliases_conflict() +{ + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD/etc/mail $NEW/etc/mail $TEST/etc/mail + + # Generate a conflict in /etc/mail/aliases + cat > $OLD/etc/mail/aliases < $NEW/etc/mail/aliases < $TEST/etc/mail/aliases </dev/null +} + +# $1 - relative path to file that should be missing from TEST +missing() +{ + if [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be missing" + fi +} + +# $1 - relative path to file that should be present in TEST +present() +{ + if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be present" + fi +} + +# $1 - relative path to regular file that should be present in TEST +# $2 - optional string that should match file contents +# $3 - optional MD5 of the flie contents, overrides $2 if present +file() +{ + local contents sum + + if ! [ -f $TEST/$1 ]; then + echo "File $1 should be a regular file" + elif [ $# -eq 2 ]; then + contents=`cat $TEST/$1` + if [ "$contents" != "$2" ]; then + echo "File $1 has wrong contents" + fi + elif [ $# -eq 3 ]; then + sum=`md5 -q $TEST/$1` + if [ "$sum" != "$3" ]; then + echo "File $1 has wrong contents" + fi + fi +} + +# $1 - relative path to a regular file that should have a conflict +# $2 - optional MD5 of the conflict file contents +conflict() +{ + local sum + + if ! [ -f $CONFLICTS/$1 ]; then + echo "File $1 missing conflict" + elif [ $# -gt 1 ]; then + sum=`md5 -q $CONFLICTS/$1` + if [ "$sum" != "$2" ]; then + echo "Conflict $1 has wrong contents" + fi + fi +} + +# $1 - relative path to a regular file that should no longer have a conflict +resolved() +{ + if [ -f $CONFLICTS/$1 ]; then + echo "Conflict $1 should be resolved" + fi +} + +if [ `id -u` -ne 0 ]; then + echo "must be root" +fi + +if [ -r /etc/etcupdate.conf ]; then + echo "WARNING: /etc/etcupdate.conf settings may break some tests." +fi + +# Test each of the following resolve options: 'p', 'mf', 'tf', 'r'. + +build_login_conflict + +# Verify that 'p' doesn't do anything. +echo "Checking 'p':" +echo 'p' | etcupdate resolve -d $WORKDIR -D $TEST >/dev/null + +file /etc/login.conf "" 95de92ea3f1bb1bf4f612a8b5908cddd +missing /etc/login.conf.db +conflict /etc/login.conf + +# Verify that 'mf' removes the conflict, but does nothing else. +echo "Checking 'mf':" +echo 'mf' | etcupdate resolve -d $WORKDIR -D $TEST >/dev/null + +file /etc/login.conf "" 95de92ea3f1bb1bf4f612a8b5908cddd +missing /etc/login.conf.db +resolved /etc/login.conf + +build_login_conflict + +# Verify that 'tf' installs the new version of the file. +echo "Checking 'tf':" +echo 'tf' | etcupdate resolve -d $WORKDIR -D $TEST >/dev/null + +file /etc/login.conf "" 7774a0f9a3a372c7c109c32fd31c4b6b +file /etc/login.conf.db +resolved /etc/login.conf + +build_login_conflict + +# Verify that 'r' installs the resolved version of the file. To +# simulate this, manually edit the merged file so that it doesn't +# contain conflict markers. +echo "Checking 'r':" +cat > $CONFLICTS/etc/login.conf </dev/null + +file /etc/login.conf "" 966e25984b9b63da8eaac8479dcb0d4d +file /etc/login.conf.db +resolved /etc/login.conf + +build_aliases_conflict + +# Verify that 'p' and 'mf' do not generate the newaliases warning. +echo "Checking newalias warning for 'p'": +echo 'p' | etcupdate resolve -d $WORKDIR -D $TEST | grep -q newalias +if [ $? -eq 0 ]; then + echo "+ Extra warning" +fi +echo "Checking newalias warning for 'mf'": +echo 'mf' | etcupdate resolve -d $WORKDIR -D $TEST | grep -q newalias +if [ $? -eq 0 ]; then + echo "+ Extra warning" +fi + +# Verify that 'tf' and 'r' do generate the newaliases warning. +build_aliases_conflict +echo "Checking newalias warning for 'tf'": +echo 'tf' | etcupdate resolve -d $WORKDIR -D $TEST | grep -q newalias +if [ $? -ne 0 ]; then + echo "- Missing warning" +fi + +build_aliases_conflict +cp $TEST/etc/mail/aliases $CONFLICTS/etc/mail/aliases +echo 'r' | etcupdate resolve -d $WORKDIR -D $TEST | grep -q newalias +if [ $? -ne 0 ]; then + echo "- Missing warning" +fi Added: head/tools/regression/usr.sbin/etcupdate/fbsdid.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.sbin/etcupdate/fbsdid.sh Fri Jul 13 13:23:48 2012 (r238423) @@ -0,0 +1,327 @@ +#!/bin/sh +# +# Copyright (c) 2010 Advanced Computing Technologies LLC +# Written by: John H. Baldwin +# 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$ + +# Various regression tests to test the -F flag to the 'update' command. + +WORKDIR=work + +usage() +{ + echo "Usage: fbsdid.sh [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory. +while getopts "w:" option; do + case $option in + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +# Store a FreeBSD ID string in a specified file. The first argument +# is the file, the remaining arguments are the comment to use. +store_id() +{ + local file + + file=$1 + shift + + echo -n '# $FreeBSD' >> $file + echo -n "$@" >> $file + echo '$' >> $file +} + +# These tests deal with FreeBSD ID string conflicts. We run the test +# twice, once without -F and once with -F. +build_trees() +{ + local i + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD $NEW $TEST + + # remove: Remove a file where the only local difference is a + # change in the FreeBSD ID string. + store_id $OLD/remove + store_id $TEST/remove ": head/remove 12345 jhb " + + # old: Modify a file where the only local difference between + # the old and test files is a change in the FreeBSD ID string. + store_id $OLD/old ": src/old,v 1.1 jhb Exp " + store_id $NEW/old ": head/old 12345 jhb " + store_id $TEST/old ": head/old 12000 jhb " + for i in $OLD $TEST; do + cat >> $i/old <> $NEW/old < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CB811065755; Fri, 13 Jul 2012 13:24:34 +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 6E73C8FC14; Fri, 13 Jul 2012 13:24:34 +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 q6DDOYQS071197; Fri, 13 Jul 2012 13:24:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DDOYeC071195; Fri, 13 Jul 2012 13:24:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201207131324.q6DDOYeC071195@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jul 2012 13:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238424 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 13:24:34 -0000 Author: jhb Date: Fri Jul 13 13:24:33 2012 New Revision: 238424 URL: http://svn.freebsd.org/changeset/base/238424 Log: Make the interval timings for EVFILT_TIMER more accurate. tvtohz() always adds an extra tick to account for the current partial clock tick. However, that is not appropriate for a repeating timer when the exact tvtohz() value should be used for subsequent intervals. Fix repeating callouts for EVFILT_TIMER by subtracting 1 tick from the tvtohz() result similar to the fix used in realitexpire() for interval timers. While here, update a few comments to note that if the EVFILT_TIMER code were to move out of kern_event.c, it should move to kern_time.c (where the interval timer code it mimics lives) rather than kern_timeout.c. MFC after: 1 month Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Jul 13 13:23:48 2012 (r238423) +++ head/sys/kern/kern_event.c Fri Jul 13 13:24:33 2012 (r238424) @@ -513,6 +513,10 @@ knote_fork(struct knlist *list, int pid) list->kl_unlock(list->kl_lockarg); } +/* + * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the + * interval timer support code. + */ static int timertoticks(intptr_t data) { @@ -526,7 +530,6 @@ timertoticks(intptr_t data) return tticks; } -/* XXX - move to kern_timeout.c? */ static void filt_timerexpire(void *knx) { @@ -536,9 +539,16 @@ filt_timerexpire(void *knx) kn->kn_data++; KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ + /* + * timertoticks() uses tvtohz() which always adds 1 to allow + * for the time until the next clock interrupt being strictly + * less than 1 clock tick. We don't want that here since we + * want to appear to be in sync with the clock interrupt even + * when we're delayed. + */ if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; - callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata), + callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata) - 1, filt_timerexpire, kn); } } @@ -546,7 +556,6 @@ filt_timerexpire(void *knx) /* * data contains amount of time to sleep, in milliseconds */ -/* XXX - move to kern_timeout.c? */ static int filt_timerattach(struct knote *kn) { @@ -570,7 +579,6 @@ filt_timerattach(struct knote *kn) return (0); } -/* XXX - move to kern_timeout.c? */ static void filt_timerdetach(struct knote *kn) { @@ -583,7 +591,6 @@ filt_timerdetach(struct knote *kn) kn->kn_status |= KN_DETACHED; /* knlist_remove usually clears it */ } -/* XXX - move to kern_timeout.c? */ static int filt_timer(struct knote *kn, long hint) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 13:33:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C071065675; Fri, 13 Jul 2012 13:33:23 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0D88FC15; Fri, 13 Jul 2012 13:33:23 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id AD376E3F07A; Fri, 13 Jul 2012 15:33:15 +0200 (CEST) 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 iuSW80ZK8OVR; Fri, 13 Jul 2012 15:33:10 +0200 (CEST) Received: from jd.benders.se (jd.benders.se [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 A4C1CE3F079; Fri, 13 Jul 2012 15:33:09 +0200 (CEST) Date: Fri, 13 Jul 2012 15:33:07 +0200 From: Joel Dahl To: John Baldwin Message-ID: <20120713133307.GG92334@jd.benders.se> References: <201207131323.q6DDNnFK071126@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207131323.q6DDNnFK071126@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238423 - in head: tools/regression/usr.sbin/etcupdate usr.sbin usr.sbin/etcupdate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 13:33:23 -0000 On 13-07-2012 13:23, John Baldwin wrote: > Author: jhb > Date: Fri Jul 13 13:23:48 2012 > New Revision: 238423 > URL: http://svn.freebsd.org/changeset/base/238423 > > Log: > The etcupdate utility is a tool for managing updates to files that are > not updated as part of `make installworld' such as files in /etc. It > manages updates by doing a three-way merge of changes made to these files > against the local versions. It is also designed to minimize the amount > of user intervention with the goal of simplifying upgrades for clusters > of machines. Thanks! -- Joel From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 14:42:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8EA106566B; Fri, 13 Jul 2012 14:42:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 82F9B8FC16; Fri, 13 Jul 2012 14:42:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 030D6B94A; Fri, 13 Jul 2012 10:42:08 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 13 Jul 2012 09:30:15 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201207131323.q6DDNnFK071126@svn.freebsd.org> In-Reply-To: <201207131323.q6DDNnFK071126@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201207130930.15964.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 Jul 2012 10:42:08 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238423 - in head: tools/regression/usr.sbin/etcupdate usr.sbin usr.sbin/etcupdate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 14:42:08 -0000 On Friday, July 13, 2012 9:23:48 am John Baldwin wrote: > Author: jhb > Date: Fri Jul 13 13:23:48 2012 > New Revision: 238423 > URL: http://svn.freebsd.org/changeset/base/238423 > > Log: > The etcupdate utility is a tool for managing updates to files that are > not updated as part of `make installworld' such as files in /etc. It > manages updates by doing a three-way merge of changes made to these files > against the local versions. It is also designed to minimize the amount > of user intervention with the goal of simplifying upgrades for clusters > of machines. > > The primary difference from mergemaster is that etcupdate requires less > manual work. The primary difference from etcmerge is that etcupdate > updates files in-place similar to mergemaster rather than building a > separate /etc tree. > > Requested by: obrien, kib, theraven, joeld (among others) A primary reason for importing this is to make it easier for folks to use out of the box. I have an (untested) patch to update the release build to include a bootstrap of etcupdate out-of-the-box. Once that is tested I'll commit it. I have been using a similar patch for old-style releases on 7 and 8 for many years now at work. Index: release/Makefile =================================================================== --- Makefile (revision 238365) +++ Makefile (working copy) @@ -71,6 +71,9 @@ base.txz: # Set up mergemaster root database sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" +# Bootstrap etcupdate + etcupdate extract -B -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \ + -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" # Package all components cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} mv ${DISTDIR}/*.txz . -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 15:25:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88CD5106564A; Fri, 13 Jul 2012 15:25:11 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 748DF8FC15; Fri, 13 Jul 2012 15:25: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 q6DFPBV8076139; Fri, 13 Jul 2012 15:25:11 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DFPBDD076137; Fri, 13 Jul 2012 15:25:11 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207131525.q6DFPBDD076137@svn.freebsd.org> From: Joel Dahl Date: Fri, 13 Jul 2012 15:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238426 - head/usr.sbin/etcupdate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 15:25:11 -0000 Author: joel (doc committer) Date: Fri Jul 13 15:25:10 2012 New Revision: 238426 URL: http://svn.freebsd.org/changeset/base/238426 Log: Minor mdoc, spelling and end of line whitespace fixes. Modified: head/usr.sbin/etcupdate/etcupdate.8 Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Fri Jul 13 14:02:05 2012 (r238425) +++ head/usr.sbin/etcupdate/etcupdate.8 Fri Jul 13 15:25:10 2012 (r238426) @@ -112,7 +112,6 @@ The utility will not perform a new merge until all conflicts from an earlier merge are resolved. .Sh MODES -.Pp The .Nm utility supports several modes of operation. @@ -150,7 +149,7 @@ tree. An older .Dq previous tree is removed if it exists. -By default the new +By default the new .Dq current tree is built from a source tree. However, @@ -349,7 +348,9 @@ Do not build generated files in a privat Instead, reuse the generated files from a previously built object tree that matches the source tree. -This can be useful to avoid gratuitous conflicts in sendmail configuration +This can be useful to avoid gratuitous conflicts in +.Xr sendmail 8 +configuration files when bootstrapping. It can also be useful for building a tarball that matches a specific world build. @@ -379,7 +380,7 @@ variable or the option will not be installed. .It Fl D Ar destdir Specify an alternate destination directory as the target of a merge. -This is analagous to the +This is analogous to the .Dv DESTDIR variable used with .Sq make installworld . @@ -739,12 +740,11 @@ but it has been removed in the destinati .El .Sh SEE ALSO .Xr cap_mkdb 1 , -.Xr diff 1 , +.Xr diff 1 , .Xr make 1 , .Xr newaliases 1 , .Xr sh 1 , .Xr pwd_mkdb 8 -.\".Sh HISTORY .Sh AUTHORS The .Nm From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 20:11:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AB881065676; Fri, 13 Jul 2012 20:11:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55C638FC17; Fri, 13 Jul 2012 20:11: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 q6DKB0ns087536; Fri, 13 Jul 2012 20:11:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DKB0El087534; Fri, 13 Jul 2012 20:11:00 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201207132011.q6DKB0El087534@svn.freebsd.org> From: Brooks Davis Date: Fri, 13 Jul 2012 20:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238427 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 20:11:00 -0000 Author: brooks Date: Fri Jul 13 20:10:59 2012 New Revision: 238427 URL: http://svn.freebsd.org/changeset/base/238427 Log: MFP4 214344: Tighten the regular expression that checks for an md /tmp such that no /tmp mount and an md / isn't improperly matched. Sponsored by: DARPA/AFRL Modified: head/etc/rc.d/tmp Modified: head/etc/rc.d/tmp ============================================================================== --- head/etc/rc.d/tmp Fri Jul 13 15:25:10 2012 (r238426) +++ head/etc/rc.d/tmp Fri Jul 13 20:10:59 2012 (r238427) @@ -39,7 +39,7 @@ load_rc_config $name mount_tmpmfs() { - if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then + if ! /bin/df /tmp | grep -q "^/dev/md[0-9].* /tmp"; then mount_md ${tmpsize} /tmp "${tmpmfs_flags}" chmod 01777 /tmp fi From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 21:27:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E76D106564A; Fri, 13 Jul 2012 21:27:19 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 297888FC08; Fri, 13 Jul 2012 21:27:19 +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 q6DLRJds090627; Fri, 13 Jul 2012 21:27:19 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DLRIXF090625; Fri, 13 Jul 2012 21:27:18 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207132127.q6DLRIXF090625@svn.freebsd.org> From: Joel Dahl Date: Fri, 13 Jul 2012 21:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238428 - head/usr.sbin/etcupdate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 21:27:19 -0000 Author: joel (doc committer) Date: Fri Jul 13 21:27:18 2012 New Revision: 238428 URL: http://svn.freebsd.org/changeset/base/238428 Log: Add HISTORY section. Modified: head/usr.sbin/etcupdate/etcupdate.8 Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Fri Jul 13 20:10:59 2012 (r238427) +++ head/usr.sbin/etcupdate/etcupdate.8 Fri Jul 13 21:27:18 2012 (r238428) @@ -745,6 +745,11 @@ but it has been removed in the destinati .Xr newaliases 1 , .Xr sh 1 , .Xr pwd_mkdb 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 10.0 . .Sh AUTHORS The .Nm From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 21:48:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CED15106566C; Fri, 13 Jul 2012 21:48:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648DC8FC12; Fri, 13 Jul 2012 21:48:02 +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 q6DLm2QQ091508; Fri, 13 Jul 2012 21:48:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DLm2Bl091505; Fri, 13 Jul 2012 21:48:02 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207132148.q6DLm2Bl091505@svn.freebsd.org> From: Dimitry Andric Date: Fri, 13 Jul 2012 21:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238429 - head/contrib/llvm/tools/clang/lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 21:48:02 -0000 Author: dim Date: Fri Jul 13 21:48:01 2012 New Revision: 238429 URL: http://svn.freebsd.org/changeset/base/238429 Log: Pull in r159895 from upstream clang trunk: When marking virtual functions as used for a class' vtable, mark all functions which will appear in the vtable as used, not just those ones which were declared within the class itself. Fixes an issue reported as comment#3 in PR12763 -- we sometimes assert in codegen if we try to emit a reference to a function declaration which we've not marked as referenced. This also matches gcc's observed behavior. This should fix clang assertions when building certain components of the LibreOffice port. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Fri Jul 13 21:27:18 2012 (r238428) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp Fri Jul 13 21:48:01 2012 (r238429) @@ -10937,14 +10937,23 @@ bool Sema::DefineUsedVTables() { void Sema::MarkVirtualMembersReferenced(SourceLocation Loc, const CXXRecordDecl *RD) { - for (CXXRecordDecl::method_iterator i = RD->method_begin(), - e = RD->method_end(); i != e; ++i) { - CXXMethodDecl *MD = *i; - - // C++ [basic.def.odr]p2: - // [...] A virtual member function is used if it is not pure. [...] - if (MD->isVirtual() && !MD->isPure()) - MarkFunctionReferenced(Loc, MD); + // Mark all functions which will appear in RD's vtable as used. + CXXFinalOverriderMap FinalOverriders; + RD->getFinalOverriders(FinalOverriders); + for (CXXFinalOverriderMap::const_iterator I = FinalOverriders.begin(), + E = FinalOverriders.end(); + I != E; ++I) { + for (OverridingMethods::const_iterator OI = I->second.begin(), + OE = I->second.end(); + OI != OE; ++OI) { + assert(OI->second.size() > 0 && "no final overrider"); + CXXMethodDecl *Overrider = OI->second.front().Method; + + // C++ [basic.def.odr]p2: + // [...] A virtual member function is used if it is not pure. [...] + if (!Overrider->isPure()) + MarkFunctionReferenced(Loc, Overrider); + } } // Only classes that have virtual bases need a VTT. From owner-svn-src-all@FreeBSD.ORG Fri Jul 13 22:29:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C269C106566B; Fri, 13 Jul 2012 22:29:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD43E8FC12; Fri, 13 Jul 2012 22:29:02 +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 q6DMT2kw093244; Fri, 13 Jul 2012 22:29:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6DMT2Qd093242; Fri, 13 Jul 2012 22:29:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207132229.q6DMT2Qd093242@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 13 Jul 2012 22:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238430 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 22:29:02 -0000 Author: jilles Date: Fri Jul 13 22:29:02 2012 New Revision: 238430 URL: http://svn.freebsd.org/changeset/base/238430 Log: sh: Add tests where "export" does not parse differently. It is planned to expand variable assignments as assignments (no word splitting, different tilde expansion) when they follow a "declaration utility" (export, readonly or local). However, a quoted character cannot be part of a "name" so things like \v=~ are not assignments, and the existing behaviour applies. Added: head/tools/regression/bin/sh/expansion/export1.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/export1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/export1.0 Fri Jul 13 22:29:02 2012 (r238430) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +w='@ vv=6' + +v=0 vv=0 +export \v=$w +[ "$v" = "@" ] || echo "Expected @ got $v" +[ "$vv" = "6" ] || echo "Expected 6 got $vv" + +HOME=/known/value + +export \v=~ +[ "$v" = \~ ] || echo "Expected ~ got $v" From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 01:45:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E00EA1065677; Sat, 14 Jul 2012 01:45:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C984E8FC08; Sat, 14 Jul 2012 01:45: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 q6E1jZgZ001309; Sat, 14 Jul 2012 01:45:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E1jZd4001292; Sat, 14 Jul 2012 01:45:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201207140145.q6E1jZd4001292@svn.freebsd.org> From: Devin Teske Date: Sat, 14 Jul 2012 01:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238431 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 01:45:36 -0000 Author: dteske Date: Sat Jul 14 01:45:35 2012 New Revision: 238431 URL: http://svn.freebsd.org/changeset/base/238431 Log: Fix domain. Approved by: emaste Modified: head/sys/boot/forth/beastie.4th head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/brand.4th head/sys/boot/forth/brand.4th.8 head/sys/boot/forth/check-password.4th head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/color.4th head/sys/boot/forth/color.4th.8 head/sys/boot/forth/delay.4th head/sys/boot/forth/delay.4th.8 head/sys/boot/forth/menu-commands.4th head/sys/boot/forth/menu.4th head/sys/boot/forth/menu.4th.8 head/sys/boot/forth/shortcuts.4th head/sys/boot/forth/version.4th head/sys/boot/forth/version.4th.8 Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/beastie.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/beastie.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -168,4 +168,4 @@ set of commands was written by .An Scott Long Aq scottl@FreeBSD.org , .An Aleksander Fafula Aq alex@fafula.com and -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/brand.4th ============================================================================== --- head/sys/boot/forth/brand.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/brand.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/brand.4th.8 ============================================================================== --- head/sys/boot/forth/brand.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/brand.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -122,4 +122,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/check-password.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/check-password.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -120,4 +120,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/color.4th ============================================================================== --- head/sys/boot/forth/color.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/color.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2011 Devin Teske +\ Copyright (c) 2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/color.4th.8 ============================================================================== --- head/sys/boot/forth/color.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/color.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -114,4 +114,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/delay.4th ============================================================================== --- head/sys/boot/forth/delay.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/delay.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2008-2011 Devin Teske +\ Copyright (c) 2008-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/delay.4th.8 ============================================================================== --- head/sys/boot/forth/delay.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/delay.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -123,4 +123,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/menu-commands.4th ============================================================================== --- head/sys/boot/forth/menu-commands.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/menu-commands.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/menu.4th ============================================================================== --- head/sys/boot/forth/menu.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/menu.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/menu.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -320,4 +320,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . Modified: head/sys/boot/forth/shortcuts.4th ============================================================================== --- head/sys/boot/forth/shortcuts.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/shortcuts.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2008-2011 Devin Teske +\ Copyright (c) 2008-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/version.4th ============================================================================== --- head/sys/boot/forth/version.4th Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/version.4th Sat Jul 14 01:45:35 2012 (r238431) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/version.4th.8 ============================================================================== --- head/sys/boot/forth/version.4th.8 Fri Jul 13 22:29:02 2012 (r238430) +++ head/sys/boot/forth/version.4th.8 Sat Jul 14 01:45:35 2012 (r238431) @@ -123,4 +123,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq dteske@freebsd.org . +.An Devin Teske Aq dteske@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 02:07:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67414106564A; Sat, 14 Jul 2012 02:07:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48D8F8FC14; Sat, 14 Jul 2012 02:07: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 q6E27qVf002238; Sat, 14 Jul 2012 02:07:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E27q80002234; Sat, 14 Jul 2012 02:07:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140207.q6E27q80002234@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 02:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238432 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 02:07:52 -0000 Author: adrian Date: Sat Jul 14 02:07:51 2012 New Revision: 238432 URL: http://svn.freebsd.org/changeset/base/238432 Log: Fix EDMA RX to actually work without panicing the machine. I was setting up the RX EDMA buffer to be 4096 bytes rather than the RX data buffer portion. The hardware was likely getting very confused and DMAing descriptor portions into places it shouldn't, leading to memory corruption and occasional panics. Whilst here, don't bother allocating descriptors for the RX EDMA case. We don't use those descriptors. Instead, just allocate ath_buf entries. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jul 14 01:45:35 2012 (r238431) +++ head/sys/dev/ath/if_ath.c Sat Jul 14 02:07:51 2012 (r238432) @@ -2888,6 +2888,67 @@ fail0: #undef ATH_DESC_4KB_BOUND_CHECK } +/* + * Allocate ath_buf entries but no descriptor contents. + * + * This is for RX EDMA where the descriptors are the header part of + * the RX buffer. + */ +int +ath_descdma_setup_rx_edma(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, + const char *name, int nbuf, int rx_status_len) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ath_buf *bf; + int i, bsize, error; + + DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA: %u buffers\n", + __func__, name, nbuf); + + dd->dd_name = name; + /* + * This is (mostly) purely for show. We're not allocating any actual + * descriptors here as EDMA RX has the descriptor be part + * of the RX buffer. + * + * However, dd_desc_len is used by ath_descdma_free() to determine + * whether we have already freed this DMA mapping. + */ + dd->dd_desc_len = rx_status_len; + + /* allocate rx buffers */ + bsize = sizeof(struct ath_buf) * nbuf; + bf = malloc(bsize, M_ATHDEV, M_NOWAIT | M_ZERO); + if (bf == NULL) { + if_printf(ifp, "malloc of %s buffers failed, size %u\n", + dd->dd_name, bsize); + goto fail3; + } + dd->dd_bufptr = bf; + + TAILQ_INIT(head); + for (i = 0; i < nbuf; i++, bf++) { + bf->bf_desc = NULL; + bf->bf_daddr = 0; + bf->bf_lastds = NULL; /* Just an initial value */ + + error = bus_dmamap_create(sc->sc_dmat, BUS_DMA_NOWAIT, + &bf->bf_dmamap); + if (error != 0) { + if_printf(ifp, "unable to create dmamap for %s " + "buffer %u, error %u\n", dd->dd_name, i, error); + ath_descdma_cleanup(sc, dd, head); + return error; + } + TAILQ_INSERT_TAIL(head, bf, bf_list); + } + return 0; +fail3: + memset(dd, 0, sizeof(*dd)); + return error; +} + void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head) Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sat Jul 14 01:45:35 2012 (r238431) +++ head/sys/dev/ath/if_ath_misc.h Sat Jul 14 02:07:51 2012 (r238432) @@ -86,6 +86,9 @@ extern void ath_setslottime(struct ath_s extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int nbuf, int ndesc); +extern int ath_descdma_setup_rx_edma(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, const char *name, + int nbuf, int desclen); extern void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head); Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 01:45:35 2012 (r238431) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 02:07:51 2012 (r238432) @@ -696,11 +696,11 @@ ath_edma_dma_rxsetup(struct ath_softc *s { int error; - /* Create RX DMA tag */ - /* Create RX ath_buf array */ - - error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, - "rx", ath_rxbuf, 1); + /* + * Create RX DMA tag and buffers. + */ + error = ath_descdma_setup_rx_edma(sc, &sc->sc_rxdma, &sc->sc_rxbuf, + "rx", ath_rxbuf, sc->sc_rx_statuslen); if (error != 0) return error; @@ -739,15 +739,16 @@ ath_recv_setup_edma(struct ath_softc *sc /* Set buffer size to 4k */ sc->sc_edma_bufsize = 4096; - /* Configure the hardware with this */ - (void) ath_hal_setrxbufsize(sc->sc_ah, sc->sc_edma_bufsize); - /* Fetch EDMA field and buffer sizes */ (void) ath_hal_getrxstatuslen(sc->sc_ah, &sc->sc_rx_statuslen); (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); + /* Configure the hardware with the RX buffer size */ + (void) ath_hal_setrxbufsize(sc->sc_ah, sc->sc_edma_bufsize - + sc->sc_rx_statuslen); + device_printf(sc->sc_dev, "RX status length: %d\n", sc->sc_rx_statuslen); device_printf(sc->sc_dev, "TX descriptor length: %d\n", From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 02:22:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACFC0106566B; Sat, 14 Jul 2012 02:22:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97DD28FC08; Sat, 14 Jul 2012 02:22: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 q6E2MHGw002879; Sat, 14 Jul 2012 02:22:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E2MHam002875; Sat, 14 Jul 2012 02:22:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140222.q6E2MHam002875@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 02:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238433 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 02:22:17 -0000 Author: adrian Date: Sat Jul 14 02:22:17 2012 New Revision: 238433 URL: http://svn.freebsd.org/changeset/base/238433 Log: Create an RX queue lock. Ideally these locks would go away and there'd be a single driver lock, like what iwn(4) does. I'll worry about that later. Modified: head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Sat Jul 14 02:07:51 2012 (r238432) +++ head/sys/dev/ath/if_ath_ahb.c Sat Jul 14 02:22:17 2012 (r238433) @@ -193,11 +193,13 @@ ath_ahb_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); + ATH_RX_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); if (error == 0) /* success */ return 0; + ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); @@ -238,6 +240,7 @@ ath_ahb_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Sat Jul 14 02:07:51 2012 (r238432) +++ head/sys/dev/ath/if_ath_pci.c Sat Jul 14 02:22:17 2012 (r238433) @@ -249,12 +249,14 @@ ath_pci_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); + ATH_RX_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); if (error == 0) /* success */ return 0; ATH_PCU_LOCK_DESTROY(sc); + ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); bad3: @@ -294,6 +296,7 @@ ath_pci_detach(device_t dev) free(sc->sc_eepromdata, M_TEMP); ATH_PCU_LOCK_DESTROY(sc); + ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); return (0); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jul 14 02:07:51 2012 (r238432) +++ head/sys/dev/ath/if_athvar.h Sat Jul 14 02:22:17 2012 (r238433) @@ -425,6 +425,8 @@ struct ath_softc { struct mtx sc_mtx; /* master lock (recursive) */ struct mtx sc_pcu_mtx; /* PCU access mutex */ char sc_pcu_mtx_name[32]; + struct mtx sc_rx_mtx; /* RX access mutex */ + char sc_rx_mtx_name[32]; struct taskqueue *sc_tq; /* private task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ @@ -696,6 +698,28 @@ struct ath_softc { #define ATH_PCU_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_pcu_mtx, \ MA_NOTOWNED) +/* + * The RX lock is primarily a(nother) workaround to ensure that the + * RX FIFO/list isn't modified by various execution paths. + * Even though RX occurs in a single context (the ath taskqueue), the + * RX path can be executed via various reset/channel change paths. + */ +#define ATH_RX_LOCK_INIT(_sc) do {\ + snprintf((_sc)->sc_rx_mtx_name, \ + sizeof((_sc)->sc_rx_mtx_name), \ + "%s RX lock", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_rx_mtx, (_sc)->sc_rx_mtx_name, \ + NULL, MTX_DEF); \ + } while (0) +#define ATH_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_rx_mtx) +#define ATH_RX_LOCK(_sc) mtx_lock(&(_sc)->sc_rx_mtx) +#define ATH_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_rx_mtx) +#define ATH_RX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_rx_mtx, \ + MA_OWNED) +#define ATH_RX_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_rx_mtx, \ + MA_NOTOWNED) + #define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FD4106566B; Sat, 14 Jul 2012 02:47:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE5AA8FC16; Sat, 14 Jul 2012 02:47: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 q6E2lG7D003936; Sat, 14 Jul 2012 02:47:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E2lGRd003934; Sat, 14 Jul 2012 02:47:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140247.q6E2lGRd003934@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 02:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238435 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 02:47:17 -0000 Author: adrian Date: Sat Jul 14 02:47:16 2012 New Revision: 238435 URL: http://svn.freebsd.org/changeset/base/238435 Log: Don't free the descriptor allocation/map if it doesn't exist. I missed this in my previous commit. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jul 14 02:45:44 2012 (r238434) +++ head/sys/dev/ath/if_ath.c Sat Jul 14 02:47:16 2012 (r238435) @@ -2956,10 +2956,12 @@ ath_descdma_cleanup(struct ath_softc *sc struct ath_buf *bf; struct ieee80211_node *ni; - bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); - bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); - bus_dma_tag_destroy(dd->dd_dmat); + if (dd->dd_dmamap != 0) { + bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); + bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); + bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); + bus_dma_tag_destroy(dd->dd_dmat); + } TAILQ_FOREACH(bf, head, bf_list) { if (bf->bf_m) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 02:52:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D861D106566B; Sat, 14 Jul 2012 02:52:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C340E8FC08; Sat, 14 Jul 2012 02:52:48 +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 q6E2qmjY004180; Sat, 14 Jul 2012 02:52:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E2qmqj004177; Sat, 14 Jul 2012 02:52:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140252.q6E2qmqj004177@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 02:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238436 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 02:52:48 -0000 Author: adrian Date: Sat Jul 14 02:52:48 2012 New Revision: 238436 URL: http://svn.freebsd.org/changeset/base/238436 Log: Change the RX EDMA path to first complete the FIFO, then re-populate it with fresh descriptors, before handling the frames. Wrap it all in the RX locks. Since the FIFO is very shallow (16 for HP, 128 for LP) it needs to be drained and replenished very quickly. Ideally, I'll eventually move this RX FIFO drain/fill into the interrupt handler, only deferring the actual frame completion. Modified: head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 02:47:16 2012 (r238435) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 02:52:48 2012 (r238436) @@ -156,6 +156,7 @@ ath_edma_stoprecv(struct ath_softc *sc, { struct ath_hal *ah = sc->sc_ah; + ATH_RX_LOCK(sc); ath_hal_stoppcurecv(ah); ath_hal_setrxfilter(ah, 0); ath_hal_stopdmarecv(ah); @@ -173,6 +174,7 @@ ath_edma_stoprecv(struct ath_softc *sc, m_freem(sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending); sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; } + ATH_RX_UNLOCK(sc); } /* @@ -187,6 +189,8 @@ ath_edma_reinit_fifo(struct ath_softc *s struct ath_buf *bf; int i, j; + ATH_RX_LOCK_ASSERT(sc); + i = re->m_fifo_head; for (j = 0; j < re->m_fifo_depth; j++) { bf = re->m_fifo[i]; @@ -221,6 +225,8 @@ ath_edma_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; + ATH_RX_LOCK(sc); + /* Enable RX FIFO */ ath_hal_rxena(ah); @@ -266,6 +272,9 @@ ath_edma_startrecv(struct ath_softc *sc) ath_mode_init(sc); ath_hal_startpcurecv(ah); + + ATH_RX_UNLOCK(sc); + return (0); } @@ -300,16 +309,21 @@ ath_edma_recv_proc_queue(struct ath_soft struct ath_desc *ds; struct ath_buf *bf; struct mbuf *m; - HAL_STATUS status; struct ath_hal *ah = sc->sc_ah; uint64_t tsf; int16_t nf; int ngood = 0; + ath_bufhead rxlist; + struct ath_buf *next; + + TAILQ_INIT(&rxlist); tsf = ath_hal_gettsf64(ah); nf = ath_hal_getchannoise(ah, sc->sc_curchan); sc->sc_stats.ast_rx_noise = nf; + ATH_RX_LOCK(sc); + do { bf = re->m_fifo[re->m_fifo_head]; /* This shouldn't occur! */ @@ -330,12 +344,13 @@ ath_edma_recv_proc_queue(struct ath_soft bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); rs = &bf->bf_status.ds_rxstat; - status = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, NULL, rs); + bf->bf_rxstatus = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, + NULL, rs); #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RECV_DESC) - ath_printrxbuf(sc, bf, 0, status == HAL_OK); + ath_printrxbuf(sc, bf, 0, bf->bf_rxstatus == HAL_OK); #endif - if (status == HAL_EINPROGRESS) + if (bf->bf_rxstatus == HAL_EINPROGRESS) break; /* @@ -349,27 +364,47 @@ ath_edma_recv_proc_queue(struct ath_soft "%s: Q%d: completed!\n", __func__, qtype); /* - * Remove the FIFO entry! + * Remove the FIFO entry and place it on the completion + * queue. */ re->m_fifo[re->m_fifo_head] = NULL; + TAILQ_INSERT_TAIL(&rxlist, bf, bf_list); + /* Bump the descriptor FIFO stats */ + INCR(re->m_fifo_head, re->m_fifolen); + re->m_fifo_depth--; + /* XXX check it doesn't fall below 0 */ + } while (re->m_fifo_depth > 0); + + /* Append some more fresh frames to the FIFO */ + if (dosched) + ath_edma_rxfifo_alloc(sc, qtype, re->m_fifolen); + + ATH_RX_UNLOCK(sc); + + /* Handle the completed descriptors */ + TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) { /* * Skip the RX descriptor status - start at the data offset */ - m_adj(m, sc->sc_rx_statuslen); + m_adj(bf->bf_m, sc->sc_rx_statuslen); /* Handle the frame */ - if (ath_rx_pkt(sc, rs, status, tsf, nf, qtype, bf)) + /* + * Note: this may or may not free bf->bf_m and sync/unmap + * the frame. + */ + if (ath_rx_pkt(sc, rs, bf->bf_rxstatus, tsf, nf, qtype, bf)) ngood++; + } + /* Free in one set, inside the lock */ + ATH_RX_LOCK(sc); + TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) { /* Free the buffer/mbuf */ ath_edma_rxbuf_free(sc, bf); - - /* Bump the descriptor FIFO stats */ - INCR(re->m_fifo_head, re->m_fifolen); - re->m_fifo_depth--; - /* XXX check it doesn't fall below 0 */ - } while (re->m_fifo_depth > 0); + } + ATH_RX_UNLOCK(sc); /* Handle resched and kickpcu appropriately */ ATH_PCU_LOCK(sc); @@ -386,10 +421,6 @@ ath_edma_recv_proc_queue(struct ath_soft } ATH_PCU_UNLOCK(sc); - /* Append some more fresh frames to the FIFO */ - if (dosched) - ath_edma_rxfifo_alloc(sc, qtype, re->m_fifolen); - return (ngood); } @@ -435,6 +466,8 @@ ath_edma_rxbuf_init(struct ath_softc *sc int error; int len; + ATH_RX_LOCK_ASSERT(sc); + // device_printf(sc->sc_dev, "%s: called; bf=%p\n", __func__, bf); m = m_getm(NULL, sc->sc_edma_bufsize, M_DONTWAIT, MT_DATA); @@ -498,6 +531,8 @@ ath_edma_rxbuf_alloc(struct ath_softc *s struct ath_buf *bf; int error; + ATH_RX_LOCK_ASSERT(sc); + /* Allocate buffer */ bf = TAILQ_FIRST(&sc->sc_rxbuf); /* XXX shouldn't happen upon startup? */ @@ -526,6 +561,9 @@ static void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf) { + ATH_RX_LOCK_ASSERT(sc); + + /* We're doing this multiple times? */ bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); if (bf->bf_m) { @@ -550,6 +588,8 @@ ath_edma_rxfifo_alloc(struct ath_softc * struct ath_buf *bf; int i; + ATH_RX_LOCK_ASSERT(sc); + /* * Allocate buffers until the FIFO is full or nbufs is reached. */ @@ -616,6 +656,8 @@ ath_edma_rxfifo_flush(struct ath_softc * struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; int i; + ATH_RX_LOCK_ASSERT(sc); + for (i = 0; i < re->m_fifolen; i++) { if (re->m_fifo[i] != NULL) { #ifdef ATH_DEBUG @@ -647,6 +689,8 @@ ath_edma_setup_rxfifo(struct ath_softc * { struct ath_rx_edma *re = &sc->sc_rxedma[qtype]; + ATH_RX_LOCK_ASSERT(sc); + if (! ath_hal_getrxfifodepth(sc->sc_ah, qtype, &re->m_fifolen)) { device_printf(sc->sc_dev, "%s: qtype=%d, failed\n", __func__, @@ -704,8 +748,10 @@ ath_edma_dma_rxsetup(struct ath_softc *s if (error != 0) return error; + ATH_RX_LOCK(sc); (void) ath_edma_setup_rxfifo(sc, HAL_RX_QUEUE_HP); (void) ath_edma_setup_rxfifo(sc, HAL_RX_QUEUE_LP); + ATH_RX_UNLOCK(sc); return (0); } @@ -716,11 +762,13 @@ ath_edma_dma_rxteardown(struct ath_softc device_printf(sc->sc_dev, "%s: called\n", __func__); + ATH_RX_LOCK(sc); ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_HP); ath_edma_rxfifo_free(sc, HAL_RX_QUEUE_HP); ath_edma_rxfifo_flush(sc, HAL_RX_QUEUE_LP); ath_edma_rxfifo_free(sc, HAL_RX_QUEUE_LP); + ATH_RX_UNLOCK(sc); /* Free RX ath_buf */ /* Free RX DMA tag */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jul 14 02:47:16 2012 (r238435) +++ head/sys/dev/ath/if_athvar.h Sat Jul 14 02:52:48 2012 (r238436) @@ -189,6 +189,7 @@ struct ath_buf { TAILQ_ENTRY(ath_buf) bf_list; struct ath_buf * bf_next; /* next buffer in the aggregate */ int bf_nseg; + HAL_STATUS bf_rxstatus; uint16_t bf_flags; /* status flags (below) */ struct ath_desc *bf_desc; /* virtual addr of desc */ struct ath_desc_status bf_status; /* tx/rx status */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 02:59:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AAE5106566B; Sat, 14 Jul 2012 02:59:12 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66A6E8FC08; Sat, 14 Jul 2012 02:59: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 q6E2xCuL004526; Sat, 14 Jul 2012 02:59:12 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E2xCX4004524; Sat, 14 Jul 2012 02:59:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201207140259.q6E2xCX4004524@svn.freebsd.org> From: Matt Jacob Date: Sat, 14 Jul 2012 02:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238437 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 02:59:12 -0000 Author: mjacob Date: Sat Jul 14 02:59:11 2012 New Revision: 238437 URL: http://svn.freebsd.org/changeset/base/238437 Log: The call to disk_resize causes a panic if DIAGNOSTIC is set. Coping with that while the finest minds of our generation figure out why. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Jul 14 02:52:48 2012 (r238436) +++ head/sys/cam/scsi/scsi_da.c Sat Jul 14 02:59:11 2012 (r238437) @@ -2645,7 +2645,10 @@ dasetgeom(struct cam_periph *periph, uin else softc->disk->d_flags &= ~DISKFLAG_CANDELETE; +/* Currently as of 6/13/2012, panics if DIAGNOSTIC is set */ +#ifndef DIAGNOSTIC disk_resize(softc->disk); +#endif } static void From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 03:16:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316F6106566C; Sat, 14 Jul 2012 03:16:59 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16B288FC14; Sat, 14 Jul 2012 03:16:59 +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 q6E3GwBX005631; Sat, 14 Jul 2012 03:16:58 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E3Gw7C005617; Sat, 14 Jul 2012 03:16:58 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201207140316.q6E3Gw7C005617@svn.freebsd.org> From: Devin Teske Date: Sat, 14 Jul 2012 03:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238438 - in head: share/mk tools/build/options usr.sbin usr.sbin/bsdconfig usr.sbin/bsdconfig/console usr.sbin/bsdconfig/console/include usr.sbin/bsdconfig/diskmgmt usr.sbin/bsdconfig/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 03:16:59 -0000 Author: dteske Date: Sat Jul 14 03:16:57 2012 New Revision: 238438 URL: http://svn.freebsd.org/changeset/base/238438 Log: Import bsdconfig(8) as a replacement for the post-install abilities of deprecated sysinstall(8). NOTE: WITH_BSDCONFIG is currently required. Submitted by: Devin Teske (dteske), Ron McDowell Reviewed by: Ron McDowell Approved by: Ed Maste (emaste) Added: head/tools/build/options/WITH_BSDCONFIG (contents, props changed) head/usr.sbin/bsdconfig/ head/usr.sbin/bsdconfig/Makefile (contents, props changed) head/usr.sbin/bsdconfig/USAGE (contents, props changed) head/usr.sbin/bsdconfig/bsdconfig (contents, props changed) head/usr.sbin/bsdconfig/bsdconfig.8 (contents, props changed) head/usr.sbin/bsdconfig/console/ head/usr.sbin/bsdconfig/console/INDEX (contents, props changed) head/usr.sbin/bsdconfig/console/Makefile (contents, props changed) head/usr.sbin/bsdconfig/console/USAGE (contents, props changed) head/usr.sbin/bsdconfig/console/console (contents, props changed) head/usr.sbin/bsdconfig/console/font (contents, props changed) head/usr.sbin/bsdconfig/console/include/ head/usr.sbin/bsdconfig/console/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/console/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/console/keymap (contents, props changed) head/usr.sbin/bsdconfig/console/repeat (contents, props changed) head/usr.sbin/bsdconfig/console/saver (contents, props changed) head/usr.sbin/bsdconfig/console/screenmap (contents, props changed) head/usr.sbin/bsdconfig/console/ttys (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/ head/usr.sbin/bsdconfig/diskmgmt/INDEX (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/Makefile (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/USAGE (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/diskmgmt (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/include/ head/usr.sbin/bsdconfig/diskmgmt/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/diskmgmt/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/ head/usr.sbin/bsdconfig/docsinstall/INDEX (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/Makefile (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/USAGE (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/docsinstall (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/include/ head/usr.sbin/bsdconfig/docsinstall/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/docsinstall/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/dot/ head/usr.sbin/bsdconfig/dot/INDEX (contents, props changed) head/usr.sbin/bsdconfig/dot/Makefile (contents, props changed) head/usr.sbin/bsdconfig/dot/USAGE (contents, props changed) head/usr.sbin/bsdconfig/dot/dot (contents, props changed) head/usr.sbin/bsdconfig/dot/include/ head/usr.sbin/bsdconfig/dot/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/dot/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/examples/ head/usr.sbin/bsdconfig/examples/Makefile (contents, props changed) head/usr.sbin/bsdconfig/examples/bsdconfigrc (contents, props changed) head/usr.sbin/bsdconfig/fdisk/ head/usr.sbin/bsdconfig/include/ head/usr.sbin/bsdconfig/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/include/common.subr (contents, props changed) head/usr.sbin/bsdconfig/include/dialog.subr (contents, props changed) head/usr.sbin/bsdconfig/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/include/mustberoot.subr (contents, props changed) head/usr.sbin/bsdconfig/include/strings.subr (contents, props changed) head/usr.sbin/bsdconfig/include/sysrc.subr (contents, props changed) head/usr.sbin/bsdconfig/mouse/ head/usr.sbin/bsdconfig/mouse/INDEX (contents, props changed) head/usr.sbin/bsdconfig/mouse/Makefile (contents, props changed) head/usr.sbin/bsdconfig/mouse/USAGE (contents, props changed) head/usr.sbin/bsdconfig/mouse/disable (contents, props changed) head/usr.sbin/bsdconfig/mouse/enable (contents, props changed) head/usr.sbin/bsdconfig/mouse/flags (contents, props changed) head/usr.sbin/bsdconfig/mouse/include/ head/usr.sbin/bsdconfig/mouse/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/mouse/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/mouse/mouse (contents, props changed) head/usr.sbin/bsdconfig/mouse/port (contents, props changed) head/usr.sbin/bsdconfig/mouse/type (contents, props changed) head/usr.sbin/bsdconfig/networking/ head/usr.sbin/bsdconfig/networking/INDEX (contents, props changed) head/usr.sbin/bsdconfig/networking/Makefile (contents, props changed) head/usr.sbin/bsdconfig/networking/USAGE (contents, props changed) head/usr.sbin/bsdconfig/networking/defaultrouter (contents, props changed) head/usr.sbin/bsdconfig/networking/devices (contents, props changed) head/usr.sbin/bsdconfig/networking/hostname (contents, props changed) head/usr.sbin/bsdconfig/networking/include/ head/usr.sbin/bsdconfig/networking/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/networking/include/common.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/device.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/hostname.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/ipaddr.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/media.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/netmask.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/resolv.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/include/routing.subr (contents, props changed) head/usr.sbin/bsdconfig/networking/nameservers (contents, props changed) head/usr.sbin/bsdconfig/networking/networking (contents, props changed) head/usr.sbin/bsdconfig/password/ head/usr.sbin/bsdconfig/password/INDEX (contents, props changed) head/usr.sbin/bsdconfig/password/Makefile (contents, props changed) head/usr.sbin/bsdconfig/password/USAGE (contents, props changed) head/usr.sbin/bsdconfig/password/include/ head/usr.sbin/bsdconfig/password/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/password/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/password/include/password.subr (contents, props changed) head/usr.sbin/bsdconfig/password/password (contents, props changed) head/usr.sbin/bsdconfig/security/ head/usr.sbin/bsdconfig/security/INDEX (contents, props changed) head/usr.sbin/bsdconfig/security/Makefile (contents, props changed) head/usr.sbin/bsdconfig/security/USAGE (contents, props changed) head/usr.sbin/bsdconfig/security/include/ head/usr.sbin/bsdconfig/security/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/security/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/security/kern_securelevel (contents, props changed) head/usr.sbin/bsdconfig/security/security (contents, props changed) head/usr.sbin/bsdconfig/startup/ head/usr.sbin/bsdconfig/startup/INDEX (contents, props changed) head/usr.sbin/bsdconfig/startup/Makefile (contents, props changed) head/usr.sbin/bsdconfig/startup/USAGE (contents, props changed) head/usr.sbin/bsdconfig/startup/include/ head/usr.sbin/bsdconfig/startup/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/startup/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/startup/include/rcconf.subr (contents, props changed) head/usr.sbin/bsdconfig/startup/include/rcedit.subr (contents, props changed) head/usr.sbin/bsdconfig/startup/include/rcvar.subr (contents, props changed) head/usr.sbin/bsdconfig/startup/misc (contents, props changed) head/usr.sbin/bsdconfig/startup/rcadd (contents, props changed) head/usr.sbin/bsdconfig/startup/rcconf (contents, props changed) head/usr.sbin/bsdconfig/startup/rcdelete (contents, props changed) head/usr.sbin/bsdconfig/startup/rcedit (contents, props changed) head/usr.sbin/bsdconfig/startup/rcvar (contents, props changed) head/usr.sbin/bsdconfig/startup/startup (contents, props changed) head/usr.sbin/bsdconfig/timezone/ head/usr.sbin/bsdconfig/timezone/INDEX (contents, props changed) head/usr.sbin/bsdconfig/timezone/Makefile (contents, props changed) head/usr.sbin/bsdconfig/timezone/USAGE (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/ head/usr.sbin/bsdconfig/timezone/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/continents.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/countries.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/iso3166.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/menus.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/include/zones.subr (contents, props changed) head/usr.sbin/bsdconfig/timezone/timezone (contents, props changed) head/usr.sbin/bsdconfig/ttys/ head/usr.sbin/bsdconfig/ttys/INDEX (contents, props changed) head/usr.sbin/bsdconfig/ttys/Makefile (contents, props changed) head/usr.sbin/bsdconfig/ttys/USAGE (contents, props changed) head/usr.sbin/bsdconfig/ttys/include/ head/usr.sbin/bsdconfig/ttys/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/ttys/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/ttys/ttys (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/ head/usr.sbin/bsdconfig/usermgmt/INDEX (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/Makefile (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/USAGE (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/groupadd (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/groupdel (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/groupedit (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/groupinput (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/include/ head/usr.sbin/bsdconfig/usermgmt/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/include/group_input.subr (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/include/user_input.subr (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/useradd (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/userdel (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/useredit (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/userinput (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/usermgmt (contents, props changed) Modified: head/share/mk/bsd.own.mk head/usr.sbin/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Jul 14 02:59:11 2012 (r238437) +++ head/share/mk/bsd.own.mk Sat Jul 14 03:16:57 2012 (r238438) @@ -421,6 +421,7 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + BSDCONFIG \ CLANG_EXTRAS \ CLANG_IS_CC \ CTF \ Added: head/tools/build/options/WITH_BSDCONFIG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_BSDCONFIG Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Install bsdconfig(8), a BSD-licensed configuration/management utility. Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Jul 14 02:59:11 2012 (r238437) +++ head/usr.sbin/Makefile Sat Jul 14 03:16:57 2012 (r238438) @@ -144,6 +144,10 @@ SUBDIR+= rndc-confgen SUBDIR+= bluetooth .endif +.if ${MK_BSDCONFIG} != "no" +SUBDIR+= bsdconfig +.endif + .if ${MK_BSNMP} != "no" SUBDIR+= bsnmpd .endif Added: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/Makefile Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +NO_OBJ= + +SUBDIR= console \ + diskmgmt \ + docsinstall \ + dot \ + examples \ + include \ + mouse \ + networking \ + password \ + security \ + startup \ + timezone \ + ttys \ + usermgmt + +FILESDIR= ${LIBEXECDIR}/bsdconfig +FILES= USAGE + +SCRIPTS= bsdconfig + +MAN= bsdconfig.8 + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + mkdir -p ${DESTDIR}${SCRIPTSDIR} + mkdir -p ${DESTDIR}${MANDIR}8 + +.include Added: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/USAGE Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,40 @@ +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +Usage: + @PROGRAM_NAME@ [-h] + @PROGRAM_NAME@ command [-h] + @PROGRAM_NAME@ [OPTIONS] [command [OPTIONS]] + +OPTIONS: + -h Print usage statement and exit. + -S Secure X11 mode (implies `-X'). As root, always prompt-for + and validate sudo(8) username/password before starting. + -X Use Xdialog(1) in place of dialog(1). + +COMMANDS: +@COMMAND_LIST@ Added: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/bsdconfig Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,313 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (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$ +# +############################################################ INCLUDES + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +. $BSDCFG_LIBE/include/common.subr || exit 1 +f_include $BSDCFG_LIBE/include/dialog.subr +f_include $BSDCFG_LIBE/include/mustberoot.subr +f_include $BSDCFG_LIBE/include/strings.subr +f_include_lang $BSDCFG_LIBE/include/messages.subr + +############################################################ FUNCTIONS + +# usage +# +# display usage and exit +# +usage() +{ + local index="INDEX" cmd_list="" + + cd $BSDCFG_LIBE + + # Test for language-specific indices + f_quietly ls */"$index.${LANG:-$LC_ALL}" && + index="$index.${LANG:-$LC_ALL}" + + cmd_list=$( + awk '/^menu_selection="/ { + sub(/\|.*/, "") + sub(/^menu_selection="/, "") + print + }' */$index | sort + ) + + # + # Determine the longest command-length (in characters) + # + local longest_cmd + longest_cmd=$( echo "$cmd_list" | f_longest_line_length ) + f_dprintf "longest_cmd=[$longest_cmd]" + + # + # Determine the maximum width of terminal/console + # + local max_size max_width + max_size=$( stty size 2> /dev/null ) + : ${max_size:="24 80"} + max_width="${max_size#*[$IFS]}" + f_dprintf "max_width=[$max_width]" + + # + # Using the longest command-length as the width of a single column, + # determine if we can use more than one column to display commands. + # + local x=$longest_cmd ncols=1 + x=$(( $x + 8 )) # Accomodate leading tab character + x=$(( $x + 3 + $longest_cmd )) # Preload end of next column + while [ $x -lt $max_width ]; do + ncols=$(( $ncols + 1 )) + x=$(( $x + 3 + $longest_cmd )) + done + f_dprintf "ncols=[$ncols] x=[$x]" + + # + # Re-format the command-list into multiple columns + # + cmd_list=$( eval "$( echo "$cmd_list" | + awk -v ncols=$ncols -v size=$longest_cmd ' + BEGIN { + n = 0 + row_item[1] = "" + } + function print_row() + { + fmt = "printf \"\\t%-" size "s" + for (i = 1; i < cur_col; i++) + fmt = fmt " %-" size "s" + fmt = fmt "\\n\"" + printf "%s", fmt + for (i = 1; i <= cur_col; i++) + printf " \"%s\"", row_item[i] + print "" + } + { + n++ + cur_col = (( n - 1 ) % ncols ) + 1 + printf "f_dprintf \"row_item[%u]=[%s]\"\n", cur_col, $0 + row_item[cur_col] = $0 + if ( cur_col == ncols ) print_row() + } + END { + if ( cur_col < ncols ) print_row() + }' )" + ) + + f_usage $BSDCFG_LIBE/USAGE \ + "PROGRAM_NAME" "$pgm" \ + "COMMAND_LIST" "$cmd_list" +} + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_menu_text" + local menu_list size + + menu_list=" + 'X' '$msg_exit' '$msg_exit_bsdconfig' + " # END-QUOTE + + local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }" + + local menuitem menu_title menu_help menu_selection index=1 + for menuitem in $( ls -d [0-9][0-9][0-9].* ); do + [ $index -lt ${#DIALOG_MENU_TAGS} ] || break + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + + menu_program= + menu_title= + menu_help= + f_include_lang $menuitem/INDEX + [ "$menu_program" ] || continue + + case "$menu_program" in + /*) : already fully qualified ;; + *) + menu_program="$menuitem/$menu_program" + esac + + menu_title=$( echo "$menu_title" | awk "$sanitize_awk" ) + menu_help=$( echo "$menu_help" | awk "$sanitize_awk" ) + setvar "menu_program$tag" "$menu_program" + menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" + + index=$(( $index + 1 )) + done + + size=$( eval f_dialog_menu_with_help_size \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\" \ + $menu_list ) + + eval $DIALOG \ + --clear \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --item-help \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_exit_bsdconfig\" \ + --menu \"\$prompt\" $size $menu_list \ + 2> "$DIALOG_TMPDIR/dialog.menu.$$" +} + +############################################################ MAIN + +# +# Process command-line arguments +# +while getopts hSX flag; do + case "$flag" in + h|\?) usage;; + esac +done +shift $(( $OPTIND -1 )) + +# +# Initialize +# +f_dialog_init +f_dialog_title "$msg_main_menu" + +[ "$SECURE" ] && f_mustberoot_init + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# +# Log our operating environment for debugging purposes +# +export UNAME_S="$(uname -s)" # Operating System (i.e. FreeBSD) +export UNAME_P="$(uname -p)" # Processor Architecture (i.e. i386) +export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) +f_dprintf "UNAME_S=[$UNAME_S] UNAME_P=[$UNAME_P] UNAME_R=[$UNAME_R]" + +cd $BSDCFG_LIBE || f_die 1 "$msg_directory_not_found" "$BSDCFG_LIBE" + +# +# If a non-option argument was passed, process it as a menuitem selection... +# +if [ "$1" ]; then + # + # ...unless it's a long-option for usage. + # + case "$1" in + -help|--help|-\?) usage;; + esac + + # + # Find the INDEX (possibly i18n) claiming this keyword + # + lang="${LANG:-$LC_ALL}" + if [ "$lang" ]; then + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ + 2> /dev/null | tail -1 ) + + # Fall-back to non-i18n sources if nothing was found + [ "$sel" ] || + sel=$( grep "^menu_selection=\"$1|" */INDEX | tail -1 ) + else + sel=$( grep "^menu_selection=\"$1|" */INDEX | tail -1 ) + fi + + # + # If no matches, display usage (which shows valid keywords) + # + if [ ! "$sel" ]; then + f_err "%s: %s: $msg_not_found\n" "$pgm" "$1" + usage + fi + + # + # The command to execute is after the pipe-character (|) in the + # menu_selection property of the INDEX file for the menuitem. + # + cmd="${sel#*|}" + cmd="${cmd%\"}" + if [ ! "$cmd" ]; then + echo "$pgm: $1: $msg_not_found" + usage + fi + shift + + # + # If the command pathname is not fully qualified fix-up/force to be + # relative to the menuitem directory. + # + case "$cmd" in + /*) : already fully qualified ;; + *) + dir="${sel%%/*}" + cmd="$dir/$cmd" + esac + + exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 +fi + +[ -f "$HOME/.bsdconfigrc" ] || f_dialog_msgbox "$msg_help_text" + +# +# Launch application main menu +# +while :; do + dialog_menu_main + retval=$? + mtag=$( f_dialog_menutag ) + f_dprintf "retval=$retval mtag=[$mtag]" + + [ $retval -eq 0 ] || f_die + + case "$mtag" in + X) # Exit + break + ;; + + *) # Dynamically loaded menuitem + cmd=$( eval echo \"\$menu_program$mtag\" ) + f_dprintf "cmd=[$cmd]" + $cmd ${USE_XDIALOG:+-X} + ;; + + esac +done + +exit $SUCCESS + +################################################################################ +# END +################################################################################ Added: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,240 @@ +.\" Copyright (c) 2012 Ron McDowell +.\" Copyright (c) 2012 Devin Teske +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" docsinstall +.\" password +.\" diskmgmt +.\" usermgmt +.\" useradd +.\" useredit +.\" userdel +.\" groupmgmt +.\" groupadd +.\" groupedit +.\" groupdel +.\" console +.\" syscons_font +.\" syscons_keymap +.\" syscons_repeat +.\" syscons_saver +.\" syscons_screenmap +.\" syscons_ttys +.\" timezone +.\" mouse +.\" mouse_enable +.\" mouse_type +.\" mouse_port +.\" mouse_flags +.\" mouse_disable +.\" networking +.\" defaultrouter +.\" hostname +.\" nameservers +.\" netdev +.\" security +.\" ttys +.\" [dot] +.\" +.\" $FreeBSD$ +.\" +.Dd Mar 20, 2012 +.Dt BSDCONFIG 8 +.Os +.Sh NAME +.Nm bsdconfig +.Nd system configuration utility +.Sh SYNOPSIS +.Nm +.Op Fl h +.Nm +.Ar command +.Op Fl h +.Nm +.Op OPTIONS +.Op command Op OPTIONS +.Sh DESCRIPTION +.Nm +is used to set up many system configuration settings, both for new systems, as +well as changing configuration settings of existing systems. +.Pp +.Nm +takes a command as an argument. If invoked with no arguments, it will bring up +a master menu listing the available commands. +.Pp +The following options are available: +.Bl -tag -width indent+ +.It Fl h +Print usage statement and exit. +.It Fl S +Secure X11 mode +.Pq implies Fl X . +As root, always prompt-for and validate +.Xr sudo 8 +username/password before starting. +.It Fl X +Use +.Xr Xdialog 1 +in place of +.Xr dialog 1 . + +.Sh COMMANDS +The following commands +.Pq sorted alphabetically +are currently included in the base +.Nm +program, with more to be added soon. Other commands can be added, as detailed +below in the +.Cm ADDING COMMANDS +section, and once added, will appear in the master menu as well as in the +.Cm -h +listing. +.Bl -tag -width ".Cm syscons_screenmap" +.It Cm console +Utilities to customize the behavior of the system console. +.It Cm defaultrouter +Shortcut to the Default Router/Gateway menu under networking. +.It Cm diskmgmt +Manage disk partitions and/or labels. Executes +.Xr sade 8 . +.It Cm docsinstall +Executes the +.Cm bsdinstall docsinstall +sub-utility to allow installation/re-installation of the FreeBSD Documentation +set(s). +.It Cm dot +Generate a graphviz +.Xr dot 1 +language file +.Pq printed on stdout +visualizing the +.Xr bsdconfig 8 +menu, include, and shortcut structure and relationships. See +.Dq bsdconfig dot -h +for more details. +.It Cm groupadd +Shortcut to the Add Groups menu under groupmgmt. +.It Cm groupdel +Shortcut to the Delete Groups menu under groupmgmt. +.It Cm groupedit +Shortcut to the Edit/View Groups menu under groupmgmt. +.It Cm groupmgmt +Utilities to Add/Change/View/Delete Group Accounts. +.It Cm hostname +Shortcut to the Hostname/Domain menu under networking. +.It Cm mouse +Utilities for configuring, exploring, and enabling console mouse support. +.It Cm mouse_disable +Shortcut to the Disable menu under mouse. +.It Cm mouse_enable +Shortcut to the Enable menu under mouse. +.It Cm mouse_flags +Shortcut to the Flags menu under mouse. +.It Cm mouse_port +Shortcut to the Port menu under mouse. +.It Cm mouse_type +Shortcut to the Type menu under mouse. +.It Cm nameservers +Shortcut to the DNS Nameservers menu under networking. +.It Cm netdev +Shortcut to the Network Interfaces menu under networking. +.It Cm networking +Utilities to set/change Hostname/Domain, Network Interfaces, Default +Router/Gateway, and DNS Nameservers. +.It Cm password +Set the system administrator +.Pq root +password. +.It Cm security +Configure various system security settings. +.It Cm syscons_font +Shortcut to the Font menu under console. +.It Cm syscons_keymap +Shortcut to the Keymap menu under console. +.It Cm syscons_repeat +Shortcut to the Repeat menu under console. +.It Cm syscons_saver +Shortcut to the Saver menu under console. +.It Cm syscons_screenmap +Shortcut to the Screenmap menu under console. +.It Cm syscons_ttys +Shortcut to the Ttys menu under console. +.It Cm timezone +Set the regional timezone of the local machine. +.It Cm useradd +Shortcut to the Add Users menu under usermgmt. +.It Cm userdel +Shortcut to the Delete Users menu under usermgmt. +.It Cm useredit +Shortcut to the Edit/View Users menu under usermgmt. +.It Cm usermgmt +Utilities to Add/Edit/View/Delete User Accounts. + +.Sh INTERNATIONALIZATION +i18n features are built into +.Nm +and language-specific translation files will be added as they become available. +In the absence of language-specific translation files, the default +.Pq en_US.ISO8859-1 +files will be used. + +.Sh ADDING COMMANDS +To be documented later. Document menu_selection="command|*" syntax of INDEX +files. + +.Sh ENVIRONMENT VARIABLES +The following environment variables affect the execution of +.Nm : +.Bl -tag -width ".Ev LC_ALL" +.It Ev LANG +If LANG is set, messages and index information will be read from files named +messages.$LANG and INDEX.$LANG and fall back to files named messages and INDEX if +messages.$LANG and INDEX.$LANG do not exist. LANG takes precedence over LC_ALL. +.It Ev LC_ALL +If LC_ALL is set, messages and index information will be read from files named +messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and INDEX if +messages.$LC_ALL and INDEX.$LC_ALL do not exist. + +.Sh FILES +/usr/share/examples/bsdconfig/bsdconfigrc can be copied to $HOME/.bsdconfigrc and +customized as needed. + +.Sh EXIT STATUS +.Ex -std + +.Sh SEE ALSO +.Xr host-setup 8 + +.Sh HISTORY +.Nm +first appeared in +.Fx 10.0 . + +.Sh AUTHORS +.\" An -nosplit +.An Ron McDowell Aq rcm@FuzzWad.ORG +.An Devin Teske Aq devinteske@hotmail.com + +.Sh BUGS +Undoubtedly. Added: head/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/console/INDEX Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,59 @@ +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (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$ + +# +# Title that will be shown on the bsdconfig menu +menu_title="Console" +# +# a short descriptive line shown at the bottom of the bsdconfig menu. +# keep it short because any line longer than the terminal width will +# be truncated. +menu_help="Customize system console behavior" +# +# two-part variable that defines an action to take when 'keyword' +# is passed on a bsdconfig command line. variable takes the form +# "keyword|command" and multiple occurrences of the variable +# (with different 'keyword's, or different 'keyword's AND 'command's) +# are allowed. If 'command' begins with a '/' then the full +# path to the program is needed. If 'command' begins with anything +# else it is a path relative to the directory this INDEX file is in. +# 'keyword' can be i18n'ed but 'command' is the name of a script. +menu_selection="console|console" +menu_selection="syscons_font|font" +menu_selection="syscons_keymap|keymap" +menu_selection="syscons_repeat|repeat" +menu_selection="syscons_saver|saver" +menu_selection="syscons_screenmap|screenmap" +menu_selection="syscons_ttys|ttys" +# +# Items below this line do NOT need i18n translation---------------------- +# +# Name of the program to be run when this menu choice is selected. +# if it begins with a '/' then the full path to the program is needed. +# if it begins with anything else it is a path relative to the directory +# this INDEX file is in. +menu_program="console" Added: head/usr.sbin/bsdconfig/console/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/console/Makefile Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +NO_OBJ= + +SUBDIR= include + +FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console +FILES= INDEX USAGE + +SCRIPTSDIR= ${FILESDIR} +SCRIPTS= console font keymap repeat saver screenmap ttys + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/console/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/console/USAGE Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,33 @@ +# Copyright (c) 2012 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] + +OPTIONS: + -h Print usage statement and exit. + -S Secure X11 mode (implies `-X'). As root, always prompt-for + and validate sudo(8) username/password before starting. + -X Use Xdialog(1) in place of dialog(1). Added: head/usr.sbin/bsdconfig/console/console ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/console/console Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,137 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +. $BSDCFG_LIBE/include/common.subr || exit 1 +f_include $BSDCFG_LIBE/include/dialog.subr +f_include $BSDCFG_LIBE/include/mustberoot.subr + +APP_DIR="080.console" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" + +############################################################ FUNCTIONS + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local menu_list size + local hline="$hline_configure_system_console_settings" + local prompt="$msg_console_menu_text" + + menu_list=" + 'X $msg_exit' '$msg_exit_this_menu' + '2 $msg_font' '$msg_choose_alternate_screen_font' + '3 $msg_keymap' '$msg_choose_alternate_keyboard_map' + '4 $msg_repeat' '$msg_set_repeat_rate' + '5 $msg_saver' '$msg_configure_screen_saver' + '6 $msg_screenmap' '$msg_choose_alternate_screenmap' + '7 $msg_ttys' '$msg_choose_console_terminal_type' + " # END-QUOTE + + size=$( eval f_dialog_menu_size \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list ) + + eval $DIALOG \ + --clear --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --menu \"\$prompt\" $size \ + $menu_list \ + 2> "$DIALOG_TMPDIR/dialog.menu.$$" +} + +############################################################ MAIN + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# +# Process command-line arguments +# +while getopts hSX flag; do + case "$flag" in + h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; + esac +done +shift $(( $OPTIND - 1 )) + +# +# Initialize +# +f_dialog_init +f_dialog_title "$msg_system_console_configuration" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init + +# +# Launch application main menu +# +while :; do + dialog_menu_main + retval=$? + mtag=$( f_dialog_menutag ) + + [ $retval -eq 0 ] || f_die + + case "$mtag" in + "X $msg_exit") break ;; + "2 $msg_font") # Choose an alternate screen font + $BSDCFG_LIBE/$APP_DIR/font ${USE_XDIALOG:+-X} ;; + "3 $msg_keymap") # Choose an alternate keyboard map + $BSDCFG_LIBE/$APP_DIR/keymap ${USE_XDIALOG:+-X} ;; + "4 $msg_repeat") # Set the rate at which keys repeat + $BSDCFG_LIBE/$APP_DIR/repeat ${USE_XDIALOG:+-X} ;; + "5 $msg_saver") # Configure the screen saver + $BSDCFG_LIBE/$APP_DIR/saver ${USE_XDIALOG:+-X} ;; + "6 $msg_screenmap") # Choose an alternate screenmap + $BSDCFG_LIBE/$APP_DIR/screenmap ${USE_XDIALOG:+-X} ;; + "7 $msg_ttys") # Choose console terminal type + $BSDCFG_LIBE/$APP_DIR/ttys ${USE_XDIALOG:+-X} ;; + esac + +done + +exit $SUCCESS + +################################################################################ +# END +################################################################################ Added: head/usr.sbin/bsdconfig/console/font ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/console/font Sat Jul 14 03:16:57 2012 (r238438) @@ -0,0 +1,205 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +. $BSDCFG_LIBE/include/common.subr || exit 1 +f_include $BSDCFG_LIBE/include/dialog.subr +f_include $BSDCFG_LIBE/include/mustberoot.subr +f_include $BSDCFG_LIBE/include/sysrc.subr + +APP_DIR="080.console" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" + +############################################################ FUNCTIONS + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local menu_list size + local hline="$hline_choose_a_font" + local prompt="$msg_font_menu_text" + + menu_list=" + '1 $msg_none' '$msg_use_hardware_default_font' + '2 $msg_ibm_437' '$msg_ibm_437_desc' + '3 $msg_ibm_850' '$msg_ibm_850_desc' + '4 $msg_ibm_865' '$msg_ibm_865_desc' + '5 $msg_ibm_866' '$msg_ibm_866_desc' + '6 $msg_ibm_866u' '$msg_ibm_866u_desc' + '7 $msg_ibm_1251' '$msg_ibm_1251_desc' + '8 $msg_iso_8859_1' '$msg_iso_8859_1_desc' + '9 $msg_iso_8859_2' '$msg_iso_8859_2_desc' + 'a $msg_iso_8859_4' '$msg_iso_8859_4_desc' + 'b $msg_iso_8859_7' '$msg_iso_8859_7_desc' + 'c $msg_iso_8859_8' '$msg_iso_8859_8_desc' + 'd $msg_iso_8859_15' '$msg_iso_8859_15_desc' + 'e $msg_swiss' '$msg_swiss_desc' + " # END-QUOTE + + size=$( eval f_dialog_menu_size \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 05:46:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DB0C1065673; Sat, 14 Jul 2012 05:46:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BE98FC0A; Sat, 14 Jul 2012 05:46:53 +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 q6E5krrx011678; Sat, 14 Jul 2012 05:46:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E5kqHC011671; Sat, 14 Jul 2012 05:46:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207140546.q6E5kqHC011671@svn.freebsd.org> From: Warner Losh Date: Sat, 14 Jul 2012 05:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238439 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 05:46:53 -0000 Author: imp Date: Sat Jul 14 05:46:52 2012 New Revision: 238439 URL: http://svn.freebsd.org/changeset/base/238439 Log: Create common routines for configuring the serial ports and use them on all the at91rm9200 boards. Modified: head/sys/arm/at91/at91rm9200_devices.c head/sys/arm/at91/at91rm9200var.h head/sys/arm/at91/board_bwct.c head/sys/arm/at91/board_hl200.c head/sys/arm/at91/board_kb920x.c head/sys/arm/at91/board_tsc4370.c Modified: head/sys/arm/at91/at91rm9200_devices.c ============================================================================== --- head/sys/arm/at91/at91rm9200_devices.c Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/at91rm9200_devices.c Sat Jul 14 05:46:52 2012 (r238439) @@ -37,7 +37,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include +#include /* * The AT91RM9200 uses the same silicon for both the BGA and PQFP @@ -60,3 +64,61 @@ at91rm9200_set_subtype(enum at91_soc_sub break; } } + +void +at91rm9200_config_uart(unsigned devid, unsigned unit, unsigned pinmask) +{ + + /* + * Since the USART supports RS-485 multidrop mode, it allows the + * TX pins to float. However, for RS-232 operations, we don't want + * these pins to float. Instead, they should be pulled up to avoid + * mismatches. Linux does something similar when it configures the + * TX lines. This implies that we also allow the RX lines to float + * rather than be in the state they are left in by the boot loader. + * Since they are input pins, I think that this is the right thing + * to do. + */ + + switch (devid) { + case AT91_ID_DBGU: + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA30, 0); /* DRXD */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA31, 1); /* DTXD */ + break; + + case AT91RM9200_ID_USART0: + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA17, 1); /* TXD0 */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA19, 0); /* RXD0 */ + /* CTS PA20 */ + /* RTS -- errata #39 PA21 */ + break; + + case AT91RM9200_ID_USART1: + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PIO_PB20, 1); /* TXD1 */ + at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PIO_PB21, 0); /* RXD1 */ + /* RI - PB18 */ + /* DTR - PB19 */ + /* DCD - PB23 */ + /* CTS - PB24 */ + /* DSR - PB25 */ + /* RTS - PB26 */ + break; + + case AT91RM9200_ID_USART2: + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA22, 0); /* RXD2 */ + at91_pio_use_periph_a(AT91RM92_PIOA_BASE, AT91C_PIO_PA23, 1); /* TXD2 */ + /* CTS - PA30 B periph */ + /* RTS - PA31 B periph */ + break; + + case AT91RM9200_ID_USART3: + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PIO_PA5, 1); /* TXD3 */ + at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PIO_PA6, 0); /* RXD3 */ + /* CTS - PB0 B periph */ + /* RTS - PB1 B periph */ + break; + + default: + break; + } +} Modified: head/sys/arm/at91/at91rm9200var.h ============================================================================== --- head/sys/arm/at91/at91rm9200var.h Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/at91rm9200var.h Sat Jul 14 05:46:52 2012 (r238439) @@ -30,4 +30,24 @@ void at91rm9200_set_subtype(enum at91_soc_subtype st); +#define AT91RM9200_ID_USART0 1 +#define AT91RM9200_ID_USART1 2 +#define AT91RM9200_ID_USART2 3 +#define AT91RM9200_ID_USART3 4 + +/* + * Serial port convenience routines + */ +/* uart pins that are wired... */ +#define AT91_UART_CTS 0x01 +#define AT91_UART_RTS 0x02 +#define AT91_UART_RI 0x04 +#define AT91_UART_DTR 0x08 +#define AT91_UART_DCD 0x10 +#define AT91_UART_DSR 0x20 + +#define AT91_ID_DBGU 0 + +void at91rm9200_config_uart(unsigned devid, unsigned unit, unsigned pinmask); + #endif /* ARM_AT91_AT91RM9200VAR_H */ Modified: head/sys/arm/at91/board_bwct.c ============================================================================== --- head/sys/arm/at91/board_bwct.c Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/board_bwct.c Sat Jul 14 05:46:52 2012 (r238439) @@ -32,10 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include BOARD_INIT long board_init(void) @@ -44,29 +41,9 @@ board_init(void) at91rm9200_set_subtype(AT91_ST_RM9200_BGA); /* - * Since the USART supports RS-485 multidrop mode, it allows the - * TX pins to float. However, for RS-232 operations, we don't want - * these pins to float. Instead, they should be pulled up to avoid - * mismatches. Linux does something similar when it configures the - * TX lines. This implies that we also allow the RX lines to float - * rather than be in the state they are left in by the boot loader. - * Since they are input pins, I think that this is the right thing - * to do. + * I don't know anything at all about this board. */ - - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); - /* PIOA's B periph: Turn USART 3's TX/RX pins */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); - /* PIOB's A periph: Turn USART 1's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); - - /* Pin assignment */ + at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ return (at91_ramsize()); } Modified: head/sys/arm/at91/board_hl200.c ============================================================================== --- head/sys/arm/at91/board_hl200.c Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/board_hl200.c Sat Jul 14 05:46:52 2012 (r238439) @@ -44,26 +44,12 @@ board_init(void) at91rm9200_set_subtype(AT91_ST_RM9200_BGA); /* - * Since the USART supports RS-485 multidrop mode, it allows the - * TX pins to float. However, for RS-232 operations, we don't want - * these pins to float. Instead, they should be pulled up to avoid - * mismatches. Linux does something similar when it configures the - * TX lines. This implies that we also allow the RX lines to float - * rather than be in the state they are left in by the boot loader. - * Since they are input pins, I think that this is the right thing - * to do. + * Unsure what all is in the HOTe HL200, but I do know there's + * one serial port that isn't DBGU. There's many other peripherals + * that need to be configured here. */ - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); - /* PIOA's B periph: Turn USART 3's TX/RX pins */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); - /* PIOB's A periph: Turn USART 1's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ return (at91_ramsize()); } Modified: head/sys/arm/at91/board_kb920x.c ============================================================================== --- head/sys/arm/at91/board_kb920x.c Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/board_kb920x.c Sat Jul 14 05:46:52 2012 (r238439) @@ -44,26 +44,15 @@ board_init(void) at91rm9200_set_subtype(AT91_ST_RM9200_PQFP); /* - * Since the USART supports RS-485 multidrop mode, it allows the - * TX pins to float. However, for RS-232 operations, we don't want - * these pins to float. Instead, they should be pulled up to avoid - * mismatches. Linux does something similar when it configures the - * TX lines. This implies that we also allow the RX lines to float - * rather than be in the state they are left in by the boot loader. - * Since they are input pins, I think that this is the right thing - * to do. + * Setup the serial ports. + * DBGU is the main one, although jumpers can make USART0 default. + * USART1 is IrDA, and USART3 is optional RS485. */ - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); - /* PIOA's B periph: Turn USART 3's TX/RX pins */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); - /* PIOB's A periph: Turn USART 1's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART1, 2, 0); /* Tx and Rx - IRDA */ + at91rm9200_config_uart(AT91RM9200_ID_USART3, 3, /* Tx, Rx, CTS, RTS - RS485 */ + AT91_UART_CTS | AT91_UART_RTS); /* MMC/SD Interface */ at91_pio_use_periph_a(AT91RM92_PIOA_BASE,AT91C_PA27_MCCK, 0); Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Sat Jul 14 03:16:57 2012 (r238438) +++ head/sys/arm/at91/board_tsc4370.c Sat Jul 14 05:46:52 2012 (r238439) @@ -43,31 +43,11 @@ board_init(void) at91rm9200_set_subtype(AT91_ST_RM9200_PQFP); - /* - * Since the USART supports RS-485 multidrop mode, it allows the - * TX pins to float. However, for RS-232 operations, we don't want - * these pins to float. Instead, they should be pulled up to avoid - * mismatches. Linux does something similar when it configures the - * TX lines. This implies that we also allow the RX lines to float - * rather than be in the state they are left in by the boot loader. - * Since they are input pins, I think that this is the right thing - * to do. - */ - - /* PIOA's A periph: Turn USART 0 and 2's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA18_RXD0 | AT91C_PA22_RXD2, 0); - at91_pio_use_periph_a(AT91RM92_PIOA_BASE, - AT91C_PA17_TXD0 | AT91C_PA23_TXD2, 1); - /* PIOA's B periph: Turn USART 3's TX/RX pins */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA6_RXD3, 0); - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, AT91C_PA5_TXD3, 1); - /* We're using TC0's A1 and A2 input */ - at91_pio_use_periph_b(AT91RM92_PIOA_BASE, - AT91C_PA19_TIOA1 | AT91C_PA21_TIOA2, 0); - /* PIOB's A periph: Turn USART 1's TX/RX pins */ - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB21_RXD1, 0); - at91_pio_use_periph_a(AT91RM92_PIOB_BASE, AT91C_PB20_TXD1, 1); + at91rm9200_config_uart(AT91_ID_DBGU, 0, 0); /* DBGU just Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART0, 1, 0); /* Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART1, 2, 0); /* Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART2, 3, 0); /* Tx and Rx */ + at91rm9200_config_uart(AT91RM9200_ID_USART3, 4, 0); /* Tx and Rx */ /* Pin assignment */ /* Assert PA24 low -- talk to rubidium */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 05:51:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECFBB106566B; Sat, 14 Jul 2012 05:51:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D81F78FC14; Sat, 14 Jul 2012 05:51: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 q6E5psGV011914; Sat, 14 Jul 2012 05:51:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E5ps1i011912; Sat, 14 Jul 2012 05:51:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140551.q6E5ps1i011912@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 05:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238440 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 05:51:55 -0000 Author: adrian Date: Sat Jul 14 05:51:54 2012 New Revision: 238440 URL: http://svn.freebsd.org/changeset/base/238440 Log: Ensure that error is set. Noticed by: rui Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jul 14 05:46:52 2012 (r238439) +++ head/sys/dev/ath/if_ath.c Sat Jul 14 05:51:54 2012 (r238440) @@ -2923,6 +2923,7 @@ ath_descdma_setup_rx_edma(struct ath_sof if (bf == NULL) { if_printf(ifp, "malloc of %s buffers failed, size %u\n", dd->dd_name, bsize); + error = ENOMEM; goto fail3; } dd->dd_bufptr = bf; From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 05:53:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88EF8106566B; Sat, 14 Jul 2012 05:53:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 742D38FC0A; Sat, 14 Jul 2012 05:53: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 q6E5r4tW011996; Sat, 14 Jul 2012 05:53:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E5r4EX011994; Sat, 14 Jul 2012 05:53:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140553.q6E5r4EX011994@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 05:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238441 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 05:53:04 -0000 Author: adrian Date: Sat Jul 14 05:53:03 2012 New Revision: 238441 URL: http://svn.freebsd.org/changeset/base/238441 Log: Make sure that 'rs' is pointing to the correct RX status. Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 05:51:54 2012 (r238440) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 05:53:03 2012 (r238441) @@ -394,6 +394,7 @@ ath_edma_recv_proc_queue(struct ath_soft * Note: this may or may not free bf->bf_m and sync/unmap * the frame. */ + rs = &bf->bf_status.ds_rxstat; if (ath_rx_pkt(sc, rs, bf->bf_rxstatus, tsf, nf, qtype, bf)) ngood++; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 06:00:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47BD21065672; Sat, 14 Jul 2012 06:00:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 334D98FC1D; Sat, 14 Jul 2012 06:00: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 q6E60c7K012345; Sat, 14 Jul 2012 06:00:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E60c9G012343; Sat, 14 Jul 2012 06:00:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207140600.q6E60c9G012343@svn.freebsd.org> From: Warner Losh Date: Sat, 14 Jul 2012 06:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238442 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 06:00:38 -0000 Author: imp Date: Sat Jul 14 06:00:37 2012 New Revision: 238442 URL: http://svn.freebsd.org/changeset/base/238442 Log: uboot should be telling us it is an ETHERNUT5 for this board. Tag it as such. Modified: head/sys/arm/at91/board_ethernut5.c Modified: head/sys/arm/at91/board_ethernut5.c ============================================================================== --- head/sys/arm/at91/board_ethernut5.c Sat Jul 14 05:53:03 2012 (r238441) +++ head/sys/arm/at91/board_ethernut5.c Sat Jul 14 06:00:37 2012 (r238442) @@ -146,4 +146,4 @@ board_init(void) return (at91_ramsize()); } -ARM_BOARD(NONE, "Ethernut 5") +ARM_BOARD(ETHERNUT5, "Ethernut 5") From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 06:13:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E245F106564A; Sat, 14 Jul 2012 06:13:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCF918FC08; Sat, 14 Jul 2012 06:13:23 +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 q6E6DN6R012895; Sat, 14 Jul 2012 06:13:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E6DNOb012888; Sat, 14 Jul 2012 06:13:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207140613.q6E6DNOb012888@svn.freebsd.org> From: Warner Losh Date: Sat, 14 Jul 2012 06:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238443 - in head/sys/arm: at91 conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 06:13:24 -0000 Author: imp Date: Sat Jul 14 06:13:23 2012 New Revision: 238443 URL: http://svn.freebsd.org/changeset/base/238443 Log: Add preliminary support for Atmel SAM9260-EK evaluation kit. Initially identical to the Ethernut5, but will diverge shortly before I refactor... Added: head/sys/arm/at91/board_sam9260ek.c - copied, changed from r238321, head/sys/arm/at91/board_ethernut5.c head/sys/arm/at91/std.sam9260ek - copied, changed from r238321, head/sys/arm/at91/std.ethernut5 head/sys/arm/conf/SAM9260EK - copied unchanged from r238321, head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/SAM9260EK.hints - copied unchanged from r238321, head/sys/arm/conf/ETHERNUT5.hints Modified: head/sys/arm/at91/files.at91 head/sys/arm/conf/ATMEL Copied and modified: head/sys/arm/at91/board_sam9260ek.c (from r238321, head/sys/arm/at91/board_ethernut5.c) ============================================================================== --- head/sys/arm/at91/board_ethernut5.c Tue Jul 10 00:31:06 2012 (r238321, copy source) +++ head/sys/arm/at91/board_sam9260ek.c Sat Jul 14 06:13:23 2012 (r238443) @@ -146,4 +146,4 @@ board_init(void) return (at91_ramsize()); } -ARM_BOARD(NONE, "Ethernut 5") +ARM_BOARD(AT91SAM9260EK, "Atmel SMA9260-EK") Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Sat Jul 14 06:00:37 2012 (r238442) +++ head/sys/arm/at91/files.at91 Sat Jul 14 06:13:23 2012 (r238443) @@ -42,6 +42,7 @@ arm/at91/board_hl200.c optional at91_bo arm/at91/board_hl201.c optional at91_board_hl201 arm/at91/board_kb920x.c optional at91_board_kb920x arm/at91/board_qila9g20.c optional at91_board_qila9g20 +arm/at91/board_sam9260ek.c optional at91_board_sam9260ek arm/at91/board_sam9g20ek.c optional at91_board_sam9g20ek arm/at91/board_sam9x25ek.c optional at91_board_sam9x25ek arm/at91/board_tsc4370.c optional at91_board_tsc4370 Copied and modified: head/sys/arm/at91/std.sam9260ek (from r238321, head/sys/arm/at91/std.ethernut5) ============================================================================== --- head/sys/arm/at91/std.ethernut5 Tue Jul 10 00:31:06 2012 (r238321, copy source) +++ head/sys/arm/at91/std.sam9260ek Sat Jul 14 06:13:23 2012 (r238443) @@ -7,5 +7,5 @@ makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 -device at91_board_ethernut5 +device at91_board_sam9260ek device at91sam9260 Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Sat Jul 14 06:00:37 2012 (r238442) +++ head/sys/arm/conf/ATMEL Sat Jul 14 06:13:23 2012 (r238443) @@ -25,6 +25,7 @@ device at91_board_hl200 device at91_board_hl201 device at91_board_kb920x device at91_board_qila9g20 +device at91_board_sam9260ek device at91_board_sam9g20ek device at91_board_sam9x25ek device at91_board_tsc4370 Copied: head/sys/arm/conf/SAM9260EK (from r238321, head/sys/arm/conf/ETHERNUT5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9260EK Sat Jul 14 06:13:23 2012 (r238443, copy of r238321, head/sys/arm/conf/ETHERNUT5) @@ -0,0 +1,158 @@ +# Kernel configuration for Ethernut 5 boards +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident ETHERNUT5 + +include "../at91/std.ethernut5" + +# To statically compile in device wiring instead of /boot/device.hints +hints "ETHERNUT5.hints" + +#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols + +options SCHED_4BSD # 4BSD scheduler +#options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +#options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +#options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +#options UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +#options MSDOSFS # MSDOS Filesystem +#options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +#options PSEUDOFS # Pseudo-filesystem framework +#options GEOM_PART_GPT # GUID Partition Tables. +#options GEOM_LABEL # Provides labelization +#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +#options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +#options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +#options AUDIT # Security event auditing +#options CAPABILITY_MODE # Capsicum capability mode +#options CAPABILITIES # Capsicum capabilities +#options MAC # TrustedBSD MAC Framework +#options INCLUDE_CONFIG_FILE # Include this file in kernel + +# required for netbooting +options BOOTP +options BOOTP_COMPAT +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 + +# alternatively, boot from a MMC/SD memory card +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0a\" + +# kernel/memory size reduction +options MUTEX_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING +options NO_SYSCTL_DESCR +options RWLOCK_NOINLINE + +# Debugging support. Always need this: +#options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: +#options DDB # Support DDB. +#options GDB # Support remote GDB. +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Ethernet +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet friver + +# I2C +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device pcf8563 # NXP PCF8563 clock/calendar + +# MMC/SD +device at91_mci # Atmel AT91 Multimedia Card Interface +options AT91_MCI_HAS_4WIRE +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card + +# DataFlash +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +#device vlan # 802.1Q VLAN support +#device tun # Packet tunnel. +#device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module + +# SCSI peripherals +#device scbus # SCSI bus (required for ATA/SCSI) +#device ch # SCSI media changers +#device da # Direct Access (disks) +#device sa # Sequential Access (tape etc) +#device cd # CD +#device pass # Passthrough device (direct ATA/SCSI access) +#device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer + +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + +# USB support +#options USB_DEBUG # enable debug msgs +device ohci # OHCI PCI->USB interface +device usb # USB Bus (required) +#device umass # Disks/Mass storage - Requires scbus and da + +# watchdog +device at91_wdt # Atmel AT91 Watchdog Timer Copied: head/sys/arm/conf/SAM9260EK.hints (from r238321, head/sys/arm/conf/ETHERNUT5.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SAM9260EK.hints Sat Jul 14 06:13:23 2012 (r238443, copy of r238321, head/sys/arm/conf/ETHERNUT5.hints) @@ -0,0 +1,51 @@ +# $FreeBSD$ + +# Atmel AT45DB21D +hint.at45d.0.at="spibus0" +hint.at45d.0.addr=0x00 +# user 132 kbytes +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00020fff +hint.map.0.name="user" +hint.map.0.readonly=1 +# setup 132 kbytes +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00021000 +hint.map.1.end=0x00041fff +hint.map.1.name="setup" +hint.map.1.readonly=1 +# uboot 528 kbytes +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00042000 +hint.map.2.end=0x000c5fff +hint.map.2.name="uboot" +hint.map.2.readonly=1 +# kernel 2640 kbytes +hint.map.3.at="flash/spi0" +hint.map.3.start=0x000c6000 +hint.map.3.end=0x00359fff +hint.map.3.name="kernel" +#hint.map.3.readonly=1 +# nutos 528 kbytes +hint.map.4.at="flash/spi0" +hint.map.4.start=0x0035a000 +hint.map.4.end=0x003ddfff +hint.map.4.name="nutos" +hint.map.4.readonly=1 +# env 132 kbytes +hint.map.5.at="flash/spi0" +hint.map.5.start=0x003de000 +hint.map.5.end=0x003fefff +hint.map.5.name="env" +hint.map.5.readonly=1 +# env 132 kbytes +hint.map.6.at="flash/spi0" +hint.map.6.start=0x003ff000 +hint.map.6.end=0x0041ffff +hint.map.6.name="nutoscfg" +hint.map.6.readonly=1 + +# NXP PCF8563 clock/calendar +hint.pcf8563_rtc.0.at="iicbus0" +hint.pcf8563_rtc.0.addr=0xa2 From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 06:17:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08F02106564A; Sat, 14 Jul 2012 06:17:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF7D18FC08; Sat, 14 Jul 2012 06:17: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 q6E6HHxZ013091; Sat, 14 Jul 2012 06:17:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E6HHa4013089; Sat, 14 Jul 2012 06:17:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207140617.q6E6HHa4013089@svn.freebsd.org> From: Joel Dahl Date: Sat, 14 Jul 2012 06:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238444 - head/usr.sbin/bsdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 06:17:18 -0000 Author: joel (doc committer) Date: Sat Jul 14 06:17:17 2012 New Revision: 238444 URL: http://svn.freebsd.org/changeset/base/238444 Log: Mdoc and whitespace fixes. Modified: head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Sat Jul 14 06:13:23 2012 (r238443) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Sat Jul 14 06:17:17 2012 (r238444) @@ -98,16 +98,16 @@ Use .Xr Xdialog 1 in place of .Xr dialog 1 . - +.El .Sh COMMANDS The following commands .Pq sorted alphabetically are currently included in the base .Nm program, with more to be added soon. Other commands can be added, as detailed -below in the +below in the .Cm ADDING COMMANDS -section, and once added, will appear in the master menu as well as in the +section, and once added, will appear in the master menu as well as in the .Cm -h listing. .Bl -tag -width ".Cm syscons_screenmap" @@ -119,7 +119,7 @@ Shortcut to the Default Router/Gateway m Manage disk partitions and/or labels. Executes .Xr sade 8 . .It Cm docsinstall -Executes the +Executes the .Cm bsdinstall docsinstall sub-utility to allow installation/re-installation of the FreeBSD Documentation set(s). @@ -190,19 +190,17 @@ Shortcut to the Delete Users menu under Shortcut to the Edit/View Users menu under usermgmt. .It Cm usermgmt Utilities to Add/Edit/View/Delete User Accounts. - +.El .Sh INTERNATIONALIZATION -i18n features are built into +i18n features are built into .Nm and language-specific translation files will be added as they become available. In the absence of language-specific translation files, the default .Pq en_US.ISO8859-1 files will be used. - .Sh ADDING COMMANDS To be documented later. Document menu_selection="command|*" syntax of INDEX files. - .Sh ENVIRONMENT VARIABLES The following environment variables affect the execution of .Nm : @@ -215,26 +213,21 @@ messages.$LANG and INDEX.$LANG do not ex If LC_ALL is set, messages and index information will be read from files named messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and INDEX if messages.$LC_ALL and INDEX.$LC_ALL do not exist. - +.El .Sh FILES /usr/share/examples/bsdconfig/bsdconfigrc can be copied to $HOME/.bsdconfigrc and customized as needed. - .Sh EXIT STATUS .Ex -std - .Sh SEE ALSO -.Xr host-setup 8 - +.Xr host-setup 8 , +.Xr sade 8 .Sh HISTORY .Nm first appeared in .Fx 10.0 . - .Sh AUTHORS -.\" An -nosplit .An Ron McDowell Aq rcm@FuzzWad.ORG .An Devin Teske Aq devinteske@hotmail.com - .Sh BUGS Undoubtedly. From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 07:56:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49EEE106566C; Sat, 14 Jul 2012 07:56:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4008FC08; Sat, 14 Jul 2012 07:56:48 +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 q6E7ulMF017062; Sat, 14 Jul 2012 07:56:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E7ulb2017060; Sat, 14 Jul 2012 07:56:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207140756.q6E7ulb2017060@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 07:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238445 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 07:56:48 -0000 Author: adrian Date: Sat Jul 14 07:56:47 2012 New Revision: 238445 URL: http://svn.freebsd.org/changeset/base/238445 Log: Merge in some other features from the legacy RX path: * wrap the RX proc calls in the RX refcount; * call the DFS checking, fast frames staging and TX rescheduling if required. TODO: * figure out if I can just make "do TX rescheduling" mean "schedule TX taskqueue" ? Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 06:17:17 2012 (r238444) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 07:56:47 2012 (r238445) @@ -284,8 +284,16 @@ ath_edma_recv_flush(struct ath_softc *sc device_printf(sc->sc_dev, "%s: called\n", __func__); + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt++; + ATH_PCU_UNLOCK(sc); + ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 0); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 0); + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt--; + ATH_PCU_UNLOCK(sc); } /* @@ -312,7 +320,7 @@ ath_edma_recv_proc_queue(struct ath_soft struct ath_hal *ah = sc->sc_ah; uint64_t tsf; int16_t nf; - int ngood = 0; + int ngood = 0, npkts = 0; ath_bufhead rxlist; struct ath_buf *next; @@ -362,6 +370,7 @@ ath_edma_recv_proc_queue(struct ath_soft */ DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: completed!\n", __func__, qtype); + npkts++; /* * Remove the FIFO entry and place it on the completion @@ -407,6 +416,14 @@ ath_edma_recv_proc_queue(struct ath_soft } ATH_RX_UNLOCK(sc); + /* rx signal state monitoring */ + ath_hal_rxmonitor(ah, &sc->sc_halstats, sc->sc_curchan); + if (ngood) + sc->sc_lastrx = tsf; + + CTR2(ATH_KTR_INTR, "ath edma rx proc: npkts=%d, ngood=%d", + npkts, ngood); + /* Handle resched and kickpcu appropriately */ ATH_PCU_LOCK(sc); if (dosched && sc->sc_kickpcu) { @@ -429,6 +446,8 @@ static void ath_edma_recv_tasklet(void *arg, int npending) { struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; npending=%d\n", __func__, @@ -441,10 +460,26 @@ ath_edma_recv_tasklet(void *arg, int npe ATH_PCU_UNLOCK(sc); return; } + sc->sc_rxproc_cnt++; ATH_PCU_UNLOCK(sc); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 1); ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 1); + + /* XXX inside IF_LOCK ? */ + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { +#ifdef IEEE80211_SUPPORT_SUPERG + ieee80211_ff_age_all(ic, 100); +#endif + if (! IFQ_IS_EMPTY(&ifp->if_snd)) + ath_tx_kick(sc); + } + if (ath_dfs_tasklet_needed(sc, sc->sc_curchan)) + taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt--; + ATH_PCU_UNLOCK(sc); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 08:40:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD3B0106566C; Sat, 14 Jul 2012 08:40:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AED6D8FC08; Sat, 14 Jul 2012 08:40: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 q6E8eQmA018872; Sat, 14 Jul 2012 08:40:26 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E8eQnq018871; Sat, 14 Jul 2012 08:40:26 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207140840.q6E8eQnq018871@svn.freebsd.org> From: Martin Matuska Date: Sat, 14 Jul 2012 08:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238446 - in vendor-sys/illumos: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 08:40:27 -0000 Author: mm Date: Sat Jul 14 08:40:26 2012 New Revision: 238446 URL: http://svn.freebsd.org/changeset/base/238446 Log: Copy vendor-sys/opensolaris/dist to vendor-sys/illumos/dist Added: vendor-sys/illumos/ vendor-sys/illumos/dist/ - copied from r238445, vendor-sys/opensolaris/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 08:54:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15411065672; Sat, 14 Jul 2012 08:54:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C191E8FC0A; Sat, 14 Jul 2012 08:54:42 +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 q6E8sgHC019519; Sat, 14 Jul 2012 08:54:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6E8sgpx019518; Sat, 14 Jul 2012 08:54:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207140854.q6E8sgpx019518@svn.freebsd.org> From: Martin Matuska Date: Sat, 14 Jul 2012 08:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238447 - in vendor/illumos/dist: common/acl common/atomic common/nvpair common/unicode common/zfs uts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 08:54:43 -0000 Author: mm Date: Sat Jul 14 08:54:42 2012 New Revision: 238447 URL: http://svn.freebsd.org/changeset/base/238447 Log: Revert r237927 and remove accidentially added kernel part This belongs to vendor-sys/illumos Deleted: vendor/illumos/dist/common/acl/ vendor/illumos/dist/common/atomic/ vendor/illumos/dist/common/nvpair/ vendor/illumos/dist/common/unicode/ vendor/illumos/dist/common/zfs/ vendor/illumos/dist/uts/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 10:17:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 838161065675; Sat, 14 Jul 2012 10:17:48 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD698FC15; Sat, 14 Jul 2012 10:17:48 +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 q6EAHmYZ022918; Sat, 14 Jul 2012 10:17:48 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EAHmsF022915; Sat, 14 Jul 2012 10:17:48 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201207141017.q6EAHmsF022915@svn.freebsd.org> From: Niclas Zeising Date: Sat, 14 Jul 2012 10:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238448 - in head: share/man/man5 tools/build/options X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 10:17:48 -0000 Author: zeising (ports committer) Date: Sat Jul 14 10:17:47 2012 New Revision: 238448 URL: http://svn.freebsd.org/changeset/base/238448 Log: Change language in WITH_BSDCONFIG to match other options, and regen src.conf(5), which was missed in r238438. Approved by: joel (mentor) Modified: head/share/man/man5/src.conf.5 head/tools/build/options/WITH_BSDCONFIG Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Jul 14 08:54:42 2012 (r238447) +++ head/share/man/man5/src.conf.5 Sat Jul 14 10:17:47 2012 (r238448) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd July 2, 2012 +.Dd July 14, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -220,6 +220,9 @@ Set to not build Bluetooth related kerne .It Va WITHOUT_BOOT .\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. +.It Va WITH_BSDCONFIG +.\" from FreeBSD: head/tools/build/options/WITH_BSDCONFIG 238438 2012-07-14 03:16:57Z dteske +Set to install bsdconfig(8), a BSD-licensed configuration/management utility. .It Va WITHOUT_BSD_CPIO .\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb Set to not build the BSD licensed version of cpio based on Modified: head/tools/build/options/WITH_BSDCONFIG ============================================================================== --- head/tools/build/options/WITH_BSDCONFIG Sat Jul 14 08:54:42 2012 (r238447) +++ head/tools/build/options/WITH_BSDCONFIG Sat Jul 14 10:17:47 2012 (r238448) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Install bsdconfig(8), a BSD-licensed configuration/management utility. +Set to install bsdconfig(8), a BSD-licensed configuration/management utility. From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 12:15:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3F421065672; Sat, 14 Jul 2012 12:15:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EFA78FC08; Sat, 14 Jul 2012 12:15:21 +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 q6ECFLE7032322; Sat, 14 Jul 2012 12:15:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ECFLeN032320; Sat, 14 Jul 2012 12:15:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207141215.q6ECFLeN032320@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Jul 2012 12:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238449 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 12:15:21 -0000 Author: adrian Date: Sat Jul 14 12:15:20 2012 New Revision: 238449 URL: http://svn.freebsd.org/changeset/base/238449 Log: Fix build breakage when one isn't building with IEEE80211_SUPPORT_SUPERG. Noticed by: mav Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 10:17:47 2012 (r238448) +++ head/sys/dev/ath/if_ath_rx_edma.c Sat Jul 14 12:15:20 2012 (r238449) @@ -447,7 +447,9 @@ ath_edma_recv_tasklet(void *arg, int npe { struct ath_softc *sc = (struct ath_softc *) arg; struct ifnet *ifp = sc->sc_ifp; +#ifdef IEEE80211_SUPPORT_SUPERG struct ieee80211com *ic = ifp->if_l2com; +#endif DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; npending=%d\n", __func__, From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 15:48:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 253B6106566B; Sat, 14 Jul 2012 15:48:31 +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 0E80F8FC08; Sat, 14 Jul 2012 15:48: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 q6EFmUUU093500; Sat, 14 Jul 2012 15:48:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EFmUIU093495; Sat, 14 Jul 2012 15:48:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207141548.q6EFmUIU093495@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 14 Jul 2012 15:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238450 - in head/sys: amd64/amd64 amd64/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 15:48:31 -0000 Author: kib Date: Sat Jul 14 15:48:30 2012 New Revision: 238450 URL: http://svn.freebsd.org/changeset/base/238450 Log: Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage mostly meets the guidelines set by the Intel SDM: 1. We use XRSTOR and XSAVE from the same CPL using the same linear address for the store area 2. Contrary to the recommendations, we cannot zero the FPU save area for a new thread, since fork semantic requires the copy of the previous state. This advice seemingly contradicts to the advice from the item 6. 3. We do use XSAVEOPT in the context switch code only, and the area for XSAVEOPT already always contains the data saved by XSAVE. 4. We do not modify the save area between XRSTOR, when the area is loaded into FPU context, and XSAVE. We always spit the fpu context into save area and start emulation when directly writing into FPU context. 5. We do not use segmented addressing to access save area, or rather, always address it using %ds basing. 6. XSAVEOPT can be only executed in the area which was previously loaded with XRSTOR, since context switch code checks for FPU use by outgoing thread before saving, and thread which stopped emulation forcibly get context loaded with XRSTOR. 7. The PCB cannot be paged out while FPU emulation is turned off, since stack of the executing thread is never swapped out. The context switch code is patched to issue XSAVEOPT instead of XSAVE if supported. This approach eliminates one conditional in the context switch code, which would be needed otherwise. For user-visible machine context to have proper data, fpugetregs() checks for unsaved extension blocks and manually copies pristine FPU state into them, according to the description provided by CPUID leaf 0xd. MFC after: 1 month Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c head/sys/amd64/include/md_var.h head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Sat Jul 14 12:15:20 2012 (r238449) +++ head/sys/amd64/amd64/cpu_switch.S Sat Jul 14 15:48:30 2012 (r238450) @@ -122,6 +122,9 @@ done_store_dr: 1: movq %rdx,%rcx movl xsave_mask,%eax movl xsave_mask+4,%edx + .globl ctx_switch_xsave +ctx_switch_xsave: + /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ xsave (%r8) movq %rcx,%rdx 2: smsw %ax Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sat Jul 14 12:15:20 2012 (r238449) +++ head/sys/amd64/amd64/fpu.c Sat Jul 14 15:48:30 2012 (r238450) @@ -132,10 +132,16 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); +static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static struct savefpu *fpu_initialstate; +struct xsave_area_elm_descr { + u_int offset; + u_int size; +} *xsave_area_desc; + void fpusave(void *addr) { @@ -182,6 +188,17 @@ fpuinit_bsp1(void) TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; xsave_mask &= xsave_mask_user; + + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { + /* + * Patch the XSAVE instruction in the cpu_switch code + * to XSAVEOPT. We assume that XSAVE encoding used + * REX byte, and set the bit 4 of the r/m byte. + */ + ctx_switch_xsave[3] |= 0x10; + use_xsaveopt = 1; + } } /* @@ -252,6 +269,7 @@ static void fpuinitstate(void *arg __unused) { register_t saveintr; + int cp[4], i, max_ext_n; fpu_initialstate = malloc(cpu_max_ext_state_size, M_DEVBUF, M_WAITOK | M_ZERO); @@ -273,6 +291,28 @@ fpuinitstate(void *arg __unused) */ bzero(&fpu_initialstate->sv_xmm[0], sizeof(struct xmmacc)); + /* + * Create a table describing the layout of the CPU Extended + * Save Area. + */ + if (use_xsaveopt) { + max_ext_n = flsl(xsave_mask); + xsave_area_desc = malloc(max_ext_n * sizeof(struct + xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); + /* x87 state */ + xsave_area_desc[0].offset = 0; + xsave_area_desc[0].size = 160; + /* XMM */ + xsave_area_desc[1].offset = 160; + xsave_area_desc[1].size = 288 - 160; + + for (i = 2; i < max_ext_n; i++) { + cpuid_count(0xd, i, cp); + xsave_area_desc[i].offset = cp[1]; + xsave_area_desc[i].size = cp[0]; + } + } + start_emulating(); intr_restore(saveintr); } @@ -560,8 +600,14 @@ fpudna(void) * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. */ - fpurestore(fpu_initialstate); + bcopy(fpu_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); if (PCB_USER_FPU(pcb)) @@ -596,6 +642,9 @@ int fpugetregs(struct thread *td) { struct pcb *pcb; + uint64_t *xstate_bv, bit; + char *sa; + int max_ext_n, i; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -613,6 +662,25 @@ fpugetregs(struct thread *td) return (_MC_FPOWNED_FPU); } else { critical_exit(); + if (use_xsaveopt) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1 << i; + if ((*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; + } + } return (_MC_FPOWNED_PCB); } } Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Sat Jul 14 12:15:20 2012 (r238449) +++ head/sys/amd64/include/md_var.h Sat Jul 14 15:48:30 2012 (r238450) @@ -57,6 +57,7 @@ extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; extern u_int cpu_vendor_id; +extern char ctx_switch_xsave[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Jul 14 12:15:20 2012 (r238449) +++ head/sys/x86/include/specialreg.h Sat Jul 14 15:48:30 2012 (r238450) @@ -247,6 +247,11 @@ #define CPUID_TYPE_CORE 2 /* + * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1 + */ +#define CPUID_EXTSTATE_XSAVEOPT 0x00000001 + +/* * AMD extended function 8000_0007h edx info */ #define AMDPM_TS 0x00000001 From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 18:10:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5F2106564A; Sat, 14 Jul 2012 18:10:45 +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 0812E8FC1B; Sat, 14 Jul 2012 18:10:45 +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 q6EIAiMu099902; Sat, 14 Jul 2012 18:10:44 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EIAipC099899; Sat, 14 Jul 2012 18:10:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207141810.q6EIAipC099899@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Jul 2012 18:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238452 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 18:10:45 -0000 Author: alc Date: Sat Jul 14 18:10:44 2012 New Revision: 238452 URL: http://svn.freebsd.org/changeset/base/238452 Log: Move kmem_alloc_{attr,contig}() to vm/vm_kern.c, where similarly named functions reside. Correct the comment describing kmem_alloc_contig(). Modified: head/sys/vm/vm_contig.c head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Sat Jul 14 16:34:17 2012 (r238451) +++ head/sys/vm/vm_contig.c Sat Jul 14 18:10:44 2012 (r238452) @@ -75,14 +75,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include #include #include #include #include -#include static int vm_contig_launder_page(vm_page_t m, vm_page_t *next) @@ -208,144 +205,3 @@ again: } vm_page_unlock_queues(); } - -/* - * Allocates a region from the kernel address map and pages within the - * specified physical address range to the kernel object, creates a wired - * mapping from the region to these pages, and returns the region's starting - * virtual address. The allocated pages are not necessarily physically - * contiguous. If M_ZERO is specified through the given flags, then the pages - * are zeroed before they are mapped. - */ -vm_offset_t -kmem_alloc_attr(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, vm_memattr_t memattr) -{ - vm_object_t object = kernel_object; - vm_offset_t addr; - vm_ooffset_t end_offset, offset; - vm_page_t m; - int pflags, tries; - - size = round_page(size); - vm_map_lock(map); - if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { - vm_map_unlock(map); - return (0); - } - offset = addr - VM_MIN_KERNEL_ADDRESS; - vm_object_reference(object); - vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, - VM_PROT_ALL, 0); - if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; - else - pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; - if (flags & M_ZERO) - pflags |= VM_ALLOC_ZERO; - VM_OBJECT_LOCK(object); - end_offset = offset + size; - for (; offset < end_offset; offset += PAGE_SIZE) { - tries = 0; -retry: - m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, 1, - low, high, PAGE_SIZE, 0, memattr); - if (m == NULL) { - VM_OBJECT_UNLOCK(object); - if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - vm_map_unlock(map); - vm_contig_grow_cache(tries, low, high); - vm_map_lock(map); - VM_OBJECT_LOCK(object); - tries++; - goto retry; - } - /* - * Since the pages that were allocated by any previous - * iterations of this loop are not busy, they can be - * freed by vm_object_page_remove(), which is called - * by vm_map_delete(). - */ - vm_map_delete(map, addr, addr + size); - vm_map_unlock(map); - return (0); - } - if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; - } - VM_OBJECT_UNLOCK(object); - vm_map_unlock(map); - vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | - VM_MAP_WIRE_NOHOLES); - return (addr); -} - -/* - * Allocates a region from the kernel address map, inserts the - * given physically contiguous pages into the kernel object, - * creates a wired mapping from the region to the pages, and - * returns the region's starting virtual address. If M_ZERO is - * specified through the given flags, then the pages are zeroed - * before they are mapped. - */ -vm_offset_t -kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, u_long alignment, vm_paddr_t boundary, - vm_memattr_t memattr) -{ - vm_object_t object = kernel_object; - vm_offset_t addr; - vm_ooffset_t offset; - vm_page_t end_m, m; - int pflags, tries; - - size = round_page(size); - vm_map_lock(map); - if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { - vm_map_unlock(map); - return (0); - } - offset = addr - VM_MIN_KERNEL_ADDRESS; - vm_object_reference(object); - vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, - VM_PROT_ALL, 0); - if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; - else - pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; - if (flags & M_ZERO) - pflags |= VM_ALLOC_ZERO; - if (flags & M_NODUMP) - pflags |= VM_ALLOC_NODUMP; - VM_OBJECT_LOCK(object); - tries = 0; -retry: - m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, - atop(size), low, high, alignment, boundary, memattr); - if (m == NULL) { - VM_OBJECT_UNLOCK(object); - if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { - vm_map_unlock(map); - vm_contig_grow_cache(tries, low, high); - vm_map_lock(map); - VM_OBJECT_LOCK(object); - tries++; - goto retry; - } - vm_map_delete(map, addr, addr + size); - vm_map_unlock(map); - return (0); - } - end_m = m + atop(size); - for (; m < end_m; m++) { - if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; - } - VM_OBJECT_UNLOCK(object); - vm_map_unlock(map); - vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | - VM_MAP_WIRE_NOHOLES); - return (addr); -} Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Sat Jul 14 16:34:17 2012 (r238451) +++ head/sys/vm/vm_kern.c Sat Jul 14 18:10:44 2012 (r238452) @@ -195,6 +195,148 @@ kmem_alloc(map, size) } /* + * Allocates a region from the kernel address map and physical pages + * within the specified address range to the kernel object. Creates a + * wired mapping from this region to these pages, and returns the + * region's starting virtual address. The allocated pages are not + * necessarily physically contiguous. If M_ZERO is specified through the + * given flags, then the pages are zeroed before they are mapped. + */ +vm_offset_t +kmem_alloc_attr(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, vm_memattr_t memattr) +{ + vm_object_t object = kernel_object; + vm_offset_t addr; + vm_ooffset_t end_offset, offset; + vm_page_t m; + int pflags, tries; + + size = round_page(size); + vm_map_lock(map); + if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { + vm_map_unlock(map); + return (0); + } + offset = addr - VM_MIN_KERNEL_ADDRESS; + vm_object_reference(object); + vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, + VM_PROT_ALL, 0); + if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; + if (flags & M_ZERO) + pflags |= VM_ALLOC_ZERO; + VM_OBJECT_LOCK(object); + end_offset = offset + size; + for (; offset < end_offset; offset += PAGE_SIZE) { + tries = 0; +retry: + m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, 1, + low, high, PAGE_SIZE, 0, memattr); + if (m == NULL) { + VM_OBJECT_UNLOCK(object); + if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { + vm_map_unlock(map); + vm_contig_grow_cache(tries, low, high); + vm_map_lock(map); + VM_OBJECT_LOCK(object); + tries++; + goto retry; + } + + /* + * Since the pages that were allocated by any previous + * iterations of this loop are not busy, they can be + * freed by vm_object_page_remove(), which is called + * by vm_map_delete(). + */ + vm_map_delete(map, addr, addr + size); + vm_map_unlock(map); + return (0); + } + if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; + } + VM_OBJECT_UNLOCK(object); + vm_map_unlock(map); + vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | + VM_MAP_WIRE_NOHOLES); + return (addr); +} + +/* + * Allocates a region from the kernel address map and physically + * contiguous pages within the specified address range to the kernel + * object. Creates a wired mapping from this region to these pages, and + * returns the region's starting virtual address. If M_ZERO is specified + * through the given flags, then the pages are zeroed before they are + * mapped. + */ +vm_offset_t +kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ + vm_object_t object = kernel_object; + vm_offset_t addr; + vm_ooffset_t offset; + vm_page_t end_m, m; + int pflags, tries; + + size = round_page(size); + vm_map_lock(map); + if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { + vm_map_unlock(map); + return (0); + } + offset = addr - VM_MIN_KERNEL_ADDRESS; + vm_object_reference(object); + vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, + VM_PROT_ALL, 0); + if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; + if (flags & M_ZERO) + pflags |= VM_ALLOC_ZERO; + if (flags & M_NODUMP) + pflags |= VM_ALLOC_NODUMP; + VM_OBJECT_LOCK(object); + tries = 0; +retry: + m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, + atop(size), low, high, alignment, boundary, memattr); + if (m == NULL) { + VM_OBJECT_UNLOCK(object); + if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { + vm_map_unlock(map); + vm_contig_grow_cache(tries, low, high); + vm_map_lock(map); + VM_OBJECT_LOCK(object); + tries++; + goto retry; + } + vm_map_delete(map, addr, addr + size); + vm_map_unlock(map); + return (0); + } + end_m = m + atop(size); + for (; m < end_m; m++) { + if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; + } + VM_OBJECT_UNLOCK(object); + vm_map_unlock(map); + vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | + VM_MAP_WIRE_NOHOLES); + return (addr); +} + +/* * kmem_free: * * Release a region of kernel virtual memory allocated From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 19:44:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD34C106566C; Sat, 14 Jul 2012 19:44:39 +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 C8B818FC0A; Sat, 14 Jul 2012 19:44: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 q6EJid8d003843; Sat, 14 Jul 2012 19:44:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EJidFx003841; Sat, 14 Jul 2012 19:44:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207141944.q6EJidFx003841@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Jul 2012 19:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238454 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 19:44:40 -0000 Author: tuexen Date: Sat Jul 14 19:44:39 2012 New Revision: 238454 URL: http://svn.freebsd.org/changeset/base/238454 Log: Use case for selecting the address family (as in other places). MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jul 14 19:39:53 2012 (r238453) +++ head/sys/netinet/sctp_input.c Sat Jul 14 19:44:39 2012 (r238454) @@ -2874,14 +2874,12 @@ sctp_handle_cookie_echo(struct mbuf *m, return (m); } } - if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - if (notification) { - sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - } - if (send_int_conf) { - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, - (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); - } + if (notification) { + sctp_ulp_notify(notification, *stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + } + if (send_int_conf) { + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); } return (m); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 20:08:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EFD01065676; Sat, 14 Jul 2012 20:08:04 +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 5A66D8FC12; Sat, 14 Jul 2012 20:08: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 q6EK83Jj004935; Sat, 14 Jul 2012 20:08:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EK83GG004933; Sat, 14 Jul 2012 20:08:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207142008.q6EK83GG004933@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Jul 2012 20:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238455 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 20:08:04 -0000 Author: tuexen Date: Sat Jul 14 20:08:03 2012 New Revision: 238455 URL: http://svn.freebsd.org/changeset/base/238455 Log: Use case for selecting the address family (as in other places). MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Jul 14 19:44:39 2012 (r238454) +++ head/sys/netinet/sctp_pcb.c Sat Jul 14 20:08:03 2012 (r238455) @@ -1203,11 +1203,18 @@ sctp_findassociation_ep_addr(struct sctp uint16_t rport; inp = *inp_p; - if (remote->sa_family == AF_INET) { + switch (remote->sa_family) { +#ifdef INET + case AF_INET: rport = (((struct sockaddr_in *)remote)->sin_port); - } else if (remote->sa_family == AF_INET6) { + break; +#endif +#ifdef INET6 + case AF_INET6: rport = (((struct sockaddr_in6 *)remote)->sin6_port); - } else { + break; +#endif + default: return (NULL); } if (locked_tcb) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 20:10:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3F9D106566C; Sat, 14 Jul 2012 20:10:06 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 76C928FC12; Sat, 14 Jul 2012 20:10:06 +0000 (UTC) Received: from [192.168.1.103] (p5481B529.dip.t-dialin.net [84.129.181.41]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id CDFD61C0C0BD8; Sat, 14 Jul 2012 22:10:04 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1278) From: Michael Tuexen In-Reply-To: <201207141944.q6EJidFx003841@svn.freebsd.org> Date: Sat, 14 Jul 2012 22:10:03 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201207141944.q6EJidFx003841@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1278) Cc: Subject: Re: svn commit: r238454 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 20:10:07 -0000 On Jul 14, 2012, at 9:44 PM, Michael Tuexen wrote: > Author: tuexen > Date: Sat Jul 14 19:44:39 2012 > New Revision: 238454 > URL: http://svn.freebsd.org/changeset/base/238454 >=20 > Log: > Use case for selecting the address family (as in other places). Wrong commit message. It should have been: Bugfix: Send up a COMM UP notification for active 1-to-1 style sockets also in the case where the assoc comes up due to a remotely started handshake (collision case). >=20 > MFC after: 3 days >=20 > Modified: > head/sys/netinet/sctp_input.c >=20 > Modified: head/sys/netinet/sctp_input.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet/sctp_input.c Sat Jul 14 19:39:53 2012 = (r238453) > +++ head/sys/netinet/sctp_input.c Sat Jul 14 19:44:39 2012 = (r238454) > @@ -2874,14 +2874,12 @@ sctp_handle_cookie_echo(struct mbuf *m,=20 > return (m); > } > } > - if ((*inp_p)->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { > - if (notification) { > - sctp_ulp_notify(notification, *stcb, 0, NULL, = SCTP_SO_NOT_LOCKED); > - } > - if (send_int_conf) { > - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, > - (*stcb), 0, (void *)netl, = SCTP_SO_NOT_LOCKED); > - } > + if (notification) { > + sctp_ulp_notify(notification, *stcb, 0, NULL, = SCTP_SO_NOT_LOCKED); > + } > + if (send_int_conf) { > + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, > + (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); > } > return (m); > } >=20 From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 20:14:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 674691065672; Sat, 14 Jul 2012 20:14:04 +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 524188FC12; Sat, 14 Jul 2012 20:14: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 q6EKE46e005214; Sat, 14 Jul 2012 20:14:04 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EKE44O005212; Sat, 14 Jul 2012 20:14:04 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207142014.q6EKE44O005212@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Jul 2012 20:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238456 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 20:14:04 -0000 Author: alc Date: Sat Jul 14 20:14:03 2012 New Revision: 238456 URL: http://svn.freebsd.org/changeset/base/238456 Log: If vm_contig_grow_cache() is allowed to sleep, then invoke the vm_lowmem handlers. Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Sat Jul 14 20:08:03 2012 (r238455) +++ head/sys/vm/vm_contig.c Sat Jul 14 20:14:03 2012 (r238456) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -189,6 +190,20 @@ vm_contig_grow_cache(int tries, vm_paddr { int actl, actmax, inactl, inactmax; + if (tries > 0) { + /* + * Decrease registered cache sizes. The vm_lowmem handlers + * may acquire locks and/or sleep, so they can only be invoked + * when "tries" is greater than zero. + */ + EVENTHANDLER_INVOKE(vm_lowmem, 0); + + /* + * We do this explicitly after the caches have been drained + * above. + */ + uma_reclaim(); + } vm_page_lock_queues(); inactl = 0; inactmax = tries < 1 ? 0 : cnt.v_inactive_count; From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 20:24:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67969106566B; Sat, 14 Jul 2012 20:24:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498158FC19; Sat, 14 Jul 2012 20:24:01 +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 q6EKO1B2005828; Sat, 14 Jul 2012 20:24:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EKO1Cu005826; Sat, 14 Jul 2012 20:24:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207142024.q6EKO1Cu005826@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 14 Jul 2012 20:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238457 - in head/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/sizeof lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 20:24:01 -0000 Author: pfg Date: Sat Jul 14 20:24:00 2012 New Revision: 238457 URL: http://svn.freebsd.org/changeset/base/238457 Log: Merge illumos commit 13455:7205f7794835 1458 D compiler fails to generate error on sizeof() an undefined struct Reference: https://www.illumos.org/issues/1458 Tested by: Fabian Keil MFC after: 3 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d - copied unchanged from r238456, vendor/illumos/dist/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d (from r238456, vendor/illumos/dist/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d Sat Jul 14 20:24:00 2012 (r238457, copy of r238456, vendor/illumos/dist/cmd/dtrace/test/tst/common/sizeof/err.D_SIZEOF_TYPE.badstruct.d) @@ -0,0 +1,30 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011, Joyent Inc. All rights reserved. + */ + +BEGIN +{ + trace(sizeof (struct suckitlarry)); + exit(0); +} Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Sat Jul 14 20:14:03 2012 (r238456) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Sat Jul 14 20:24:00 2012 (r238457) @@ -22,7 +22,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2011, Joyent Inc. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -725,12 +725,19 @@ dt_node_type_name(const dt_node_t *dnp, size_t dt_node_type_size(const dt_node_t *dnp) { + ctf_id_t base; + if (dnp->dn_kind == DT_NODE_STRING) return (strlen(dnp->dn_string) + 1); if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL) return (dt_ident_size(dnp->dn_ident)); + base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type); + + if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD) + return (0); + return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type)); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 21:25:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA6591065672; Sat, 14 Jul 2012 21:25:14 +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 C59F98FC12; Sat, 14 Jul 2012 21:25: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 q6ELPE1A008268; Sat, 14 Jul 2012 21:25:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ELPE4Q008266; Sat, 14 Jul 2012 21:25:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207142125.q6ELPE4Q008266@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Jul 2012 21:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238458 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jul 2012 21:25:15 -0000 Author: tuexen Date: Sat Jul 14 21:25:14 2012 New Revision: 238458 URL: http://svn.freebsd.org/changeset/base/238458 Log: Provide the correct notification type (SCTP_SEND_FAILED_EVENT) for unsent messages. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Jul 14 20:24:00 2012 (r238457) +++ head/sys/netinet/sctputil.c Sat Jul 14 21:25:14 2012 (r238458) @@ -2951,7 +2951,7 @@ sctp_notify_send_failed2(struct sctp_tcb SCTP_BUF_LEN(m_notify) = 0; if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); - ssfe->ssfe_type = SCTP_SEND_FAILED; + ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; ssfe->ssfe_flags = SCTP_DATA_UNSENT; ssfe->ssfe_length = length; ssfe->ssfe_error = error;