From owner-svn-src-all@FreeBSD.ORG Sun May 9 00:32:52 2010 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 E5E95106564A; Sun, 9 May 2010 00:32:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D626A8FC0C; Sun, 9 May 2010 00:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o490Wqm3074260; Sun, 9 May 2010 00:32:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o490Wqfp074258; Sun, 9 May 2010 00:32:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005090032.o490Wqfp074258@svn.freebsd.org> From: Alan Cox Date: Sun, 9 May 2010 00: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: r207806 - 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, 09 May 2010 00:32:53 -0000 Author: alc Date: Sun May 9 00:32:52 2010 New Revision: 207806 URL: http://svn.freebsd.org/changeset/base/207806 Log: Remove the page queues lock around a call to vm_page_activate(). Make the page dirty before adding it to the active queue. Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat May 8 23:01:47 2010 (r207805) +++ head/sys/vm/swap_pager.c Sun May 9 00:32:52 2010 (r207806) @@ -1707,11 +1707,9 @@ swp_pager_force_pagein(vm_object_t objec m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL|VM_ALLOC_RETRY); if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_subtract(object, 1); + vm_page_dirty(m); vm_page_lock(m); - vm_page_lock_queues(); vm_page_activate(m); - vm_page_dirty(m); - vm_page_unlock_queues(); vm_page_unlock(m); vm_page_wakeup(m); vm_pager_page_unswapped(m); From owner-svn-src-all@FreeBSD.ORG Sun May 9 02:04:21 2010 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 9AF0F1065759; Sun, 9 May 2010 02:04:21 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 715AD8FC17; Sun, 9 May 2010 02:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4924L7E094296; Sun, 9 May 2010 02:04:21 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4924Lep094295; Sun, 9 May 2010 02:04:21 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201005090204.o4924Lep094295@svn.freebsd.org> From: Jeff Roberson Date: Sun, 9 May 2010 02:04:21 +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: r207807 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2010 02:04:21 -0000 Author: jeff Date: Sun May 9 02:04:20 2010 New Revision: 207807 URL: http://svn.freebsd.org/changeset/base/207807 Log: - Temporarily raise my size limit so I can checkin ofed. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sun May 9 00:32:52 2010 (r207806) +++ svnadmin/conf/sizelimit.conf Sun May 9 02:04:20 2010 (r207807) @@ -31,3 +31,4 @@ rwatson gonzo kmacy jb +jeff From owner-svn-src-all@FreeBSD.ORG Sun May 9 08:22:33 2010 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 EA6B31065670; Sun, 9 May 2010 08:22:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D952A8FC12; Sun, 9 May 2010 08:22:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o498MXUC077397; Sun, 9 May 2010 08:22:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o498MXWF077394; Sun, 9 May 2010 08:22:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201005090822.o498MXWF077394@svn.freebsd.org> From: Doug Barton Date: Sun, 9 May 2010 08:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207811 - in stable/7/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: Sun, 09 May 2010 08:22:34 -0000 Author: dougb Date: Sun May 9 08:22:33 2010 New Revision: 207811 URL: http://svn.freebsd.org/changeset/base/207811 Log: rc_quiet does not exist in RELENG_7, so hand-merge the part of r179870 that I did not think was applicable here (namely bailing out of run_rc_command before printing the warning) but use rc_fast as the trigger instead of rc_quiet. The former exists in all supported branches, and is set at boot time so it does the job. The only remaining element that isn't already covered by 'faststart' is an instance of '/etc/rc.d/ipfilter resync' in rc.d/netif, so make that fastresync to also silence the warning there. This is similar to what was done in r175676, although that used quietresync (as described above). Pointed out by: jhell Modified: stable/7/etc/rc.d/netif stable/7/etc/rc.subr Modified: stable/7/etc/rc.d/netif ============================================================================== --- stable/7/etc/rc.d/netif Sun May 9 06:52:32 2010 (r207810) +++ stable/7/etc/rc.d/netif Sun May 9 08:22:33 2010 (r207811) @@ -72,7 +72,7 @@ network_start() if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter - /etc/rc.d/ipfilter resync + /etc/rc.d/ipfilter fastresync fi if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then /etc/rc.d/bridge start $cmdifn Modified: stable/7/etc/rc.subr ============================================================================== --- stable/7/etc/rc.subr Sun May 9 06:52:32 2010 (r207810) +++ stable/7/etc/rc.subr Sun May 9 08:22:33 2010 (r207811) @@ -616,6 +616,9 @@ run_rc_command() # if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then + if [ -n "$rc_fast" ]; then + return 0 + fi echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to " echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' " echo "instead of '${rc_arg}'." From owner-svn-src-all@FreeBSD.ORG Sun May 9 09:20:26 2010 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 1ED6F106564A; Sun, 9 May 2010 09:20:26 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4D78FC15; Sun, 9 May 2010 09:20:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o499KPph089988; Sun, 9 May 2010 09:20:25 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o499KPGD089986; Sun, 9 May 2010 09:20:25 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201005090920.o499KPGD089986@svn.freebsd.org> From: Kai Wang Date: Sun, 9 May 2010 09:20: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: r207812 - head/usr.sbin/bluetooth/bthidd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 09:20:26 -0000 Author: kaiw Date: Sun May 9 09:20:25 2010 New Revision: 207812 URL: http://svn.freebsd.org/changeset/base/207812 Log: Catch up with libusbhid merge (rev 205728). hid_get_data() now expects that the hid data passed in always contains the report ID byte. Thus we should not skip the the report ID byte in hid_interrupt(). Also, if HUP_KEYBOARD usage is an array, do not try to modify the 'data' pointer, instead, increase the hid_item_t field 'pos' by 'report_size' before calling hid_get_data() during each iteration. PR: usb/146367 Reported and tested by: Alex Deiter Pointy hat to: kaiw Reviewed by: emax Modified: head/usr.sbin/bluetooth/bthidd/hid.c Modified: head/usr.sbin/bluetooth/bthidd/hid.c ============================================================================== --- head/usr.sbin/bluetooth/bthidd/hid.c Sun May 9 08:22:33 2010 (r207811) +++ head/usr.sbin/bluetooth/bthidd/hid.c Sun May 9 09:20:25 2010 (r207812) @@ -130,7 +130,7 @@ hid_interrupt(bthid_session_p s, uint8_t hid_item_t h; int32_t report_id, usage, page, val, mouse_x, mouse_y, mouse_z, mouse_butt, - mevents, kevents; + mevents, kevents, i; assert(s != NULL); assert(s->srv != NULL); @@ -150,8 +150,8 @@ hid_interrupt(bthid_session_p s, uint8_t } report_id = data[1]; - data += 2; - len -= 2; + data ++; + len --; hid_device = get_hid_device(&s->bdaddr); assert(hid_device != NULL); @@ -202,17 +202,11 @@ hid_interrupt(bthid_session_p s, uint8_t if (val && val < kbd_maxkey()) bit_set(s->keys1, val); - data ++; - len --; - - len = min(len, h.report_size); - while (len > 0) { + for (i = 1; i < h.report_count; i++) { + h.pos += h.report_size; val = hid_get_data(data, &h); if (val && val < kbd_maxkey()) bit_set(s->keys1, val); - - data ++; - len --; } } break; From owner-svn-src-all@FreeBSD.ORG Sun May 9 12:32:11 2010 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 0C66E106566C; Sun, 9 May 2010 12:32:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id EF7728FC1A; Sun, 9 May 2010 12:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49CWAAt033265; Sun, 9 May 2010 12:32:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49CWAMI033263; Sun, 9 May 2010 12:32:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005091232.o49CWAMI033263@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 May 2010 12:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207813 - stable/8/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: Sun, 09 May 2010 12:32:11 -0000 Author: kib Date: Sun May 9 12:32:10 2010 New Revision: 207813 URL: http://svn.freebsd.org/changeset/base/207813 Log: MFC r207363: Remove caddr_t casts. Modified: stable/8/sys/kern/kern_proc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Sun May 9 09:20:25 2010 (r207812) +++ stable/8/sys/kern/kern_proc.c Sun May 9 12:32:10 2010 (r207813) @@ -1083,11 +1083,9 @@ sysctl_out_proc_copyout(struct kinfo_pro if (req->flags & SCTL_MASK32) { freebsd32_kinfo_proc_out(ki, &ki32); - error = SYSCTL_OUT(req, (caddr_t)&ki32, - sizeof(struct kinfo_proc32)); + error = SYSCTL_OUT(req, &ki32, sizeof(struct kinfo_proc32)); } else - error = SYSCTL_OUT(req, (caddr_t)ki, - sizeof(struct kinfo_proc)); + error = SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc)); return (error); } #else @@ -1095,7 +1093,7 @@ static int sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) { - return (SYSCTL_OUT(req, (caddr_t)ki, sizeof(struct kinfo_proc))); + return (SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc))); } #endif From owner-svn-src-all@FreeBSD.ORG Sun May 9 12:34:21 2010 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 3FCB91065676; Sun, 9 May 2010 12:34:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2557B8FC08; Sun, 9 May 2010 12:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49CYLfD033780; Sun, 9 May 2010 12:34:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49CYL6G033778; Sun, 9 May 2010 12:34:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005091234.o49CYL6G033778@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 May 2010 12:34:21 +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: r207814 - stable/8/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, 09 May 2010 12:34:21 -0000 Author: kib Date: Sun May 9 12:34:20 2010 New Revision: 207814 URL: http://svn.freebsd.org/changeset/base/207814 Log: MFC r207194: Provide 32bit compat shims for sysctl net.route NET_RT_IFLIST. Modified: stable/8/sys/net/rtsock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net/rtsock.c ============================================================================== --- stable/8/sys/net/rtsock.c Sun May 9 12:32:10 2010 (r207813) +++ stable/8/sys/net/rtsock.c Sun May 9 12:34:20 2010 (r207814) @@ -29,6 +29,7 @@ * @(#)rtsock.c 8.7 (Berkeley) 10/12/95 * $FreeBSD$ */ +#include "opt_compat.h" #include "opt_sctp.h" #include "opt_mpath.h" #include "opt_inet.h" @@ -71,6 +72,49 @@ extern void sctp_addr_change(struct ifad #endif /* SCTP */ #endif +#ifdef COMPAT_FREEBSD32 +#include +#include + +struct if_data32 { + uint8_t ifi_type; + uint8_t ifi_physical; + uint8_t ifi_addrlen; + uint8_t ifi_hdrlen; + uint8_t ifi_link_state; + uint8_t ifi_spare_char1; + uint8_t ifi_spare_char2; + uint8_t ifi_datalen; + uint32_t ifi_mtu; + uint32_t ifi_metric; + uint32_t ifi_baudrate; + uint32_t ifi_ipackets; + uint32_t ifi_ierrors; + uint32_t ifi_opackets; + uint32_t ifi_oerrors; + uint32_t ifi_collisions; + uint32_t ifi_ibytes; + uint32_t ifi_obytes; + uint32_t ifi_imcasts; + uint32_t ifi_omcasts; + uint32_t ifi_iqdrops; + uint32_t ifi_noproto; + uint32_t ifi_hwassist; + int32_t ifi_epoch; + struct timeval32 ifi_lastchange; +}; + +struct if_msghdr32 { + uint16_t ifm_msglen; + uint8_t ifm_version; + uint8_t ifm_type; + int32_t ifm_addrs; + int32_t ifm_flags; + uint16_t ifm_index; + struct if_data32 ifm_data; +}; +#endif + MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); /* NB: these are not modified */ @@ -1001,6 +1045,12 @@ again: break; case RTM_IFINFO: +#ifdef COMPAT_FREEBSD32 + if (w != NULL && w->w_req->flags & SCTL_MASK32) { + len = sizeof(struct if_msghdr32); + break; + } +#endif len = sizeof(struct if_msghdr); break; @@ -1367,6 +1417,38 @@ sysctl_dumpentry(struct radix_node *rn, return (error); } +#ifdef COMPAT_FREEBSD32 +static void +copy_ifdata32(struct if_data *src, struct if_data32 *dst) +{ + + bzero(dst, sizeof(*dst)); + CP(*src, *dst, ifi_type); + CP(*src, *dst, ifi_physical); + CP(*src, *dst, ifi_addrlen); + CP(*src, *dst, ifi_hdrlen); + CP(*src, *dst, ifi_link_state); + CP(*src, *dst, ifi_datalen); + CP(*src, *dst, ifi_mtu); + CP(*src, *dst, ifi_metric); + CP(*src, *dst, ifi_baudrate); + CP(*src, *dst, ifi_ipackets); + CP(*src, *dst, ifi_ierrors); + CP(*src, *dst, ifi_opackets); + CP(*src, *dst, ifi_oerrors); + CP(*src, *dst, ifi_collisions); + CP(*src, *dst, ifi_ibytes); + CP(*src, *dst, ifi_obytes); + CP(*src, *dst, ifi_imcasts); + CP(*src, *dst, ifi_omcasts); + CP(*src, *dst, ifi_iqdrops); + CP(*src, *dst, ifi_noproto); + CP(*src, *dst, ifi_hwassist); + CP(*src, *dst, ifi_epoch); + TV_CP(*src, *dst, ifi_lastchange); +} +#endif + static int sysctl_iflist(int af, struct walkarg *w) { @@ -1387,12 +1469,30 @@ sysctl_iflist(int af, struct walkarg *w) if (w->w_req && w->w_tmem) { struct if_msghdr *ifm; +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdr32 *ifm32; + + ifm32 = (struct if_msghdr32 *)w->w_tmem; + ifm32->ifm_index = ifp->if_index; + ifm32->ifm_flags = ifp->if_flags | + ifp->if_drv_flags; + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + ifm32->ifm_addrs = info.rti_addrs; + error = SYSCTL_OUT(w->w_req, (caddr_t)ifm32, + len); + goto sysctl_out; + } +#endif ifm = (struct if_msghdr *)w->w_tmem; ifm->ifm_index = ifp->if_index; ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req,(caddr_t)ifm, len); + error = SYSCTL_OUT(w->w_req, (caddr_t)ifm, len); +#ifdef COMPAT_FREEBSD32 + sysctl_out: +#endif if (error) goto done; } From owner-svn-src-all@FreeBSD.ORG Sun May 9 12:36:51 2010 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 B6C65106564A; Sun, 9 May 2010 12:36:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A4EF38FC1B; Sun, 9 May 2010 12:36:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49CapJk034381; Sun, 9 May 2010 12:36:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49Captw034378; Sun, 9 May 2010 12:36:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005091236.o49Captw034378@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 May 2010 12:36:51 +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: r207815 - stable/8/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, 09 May 2010 12:36:51 -0000 Author: kib Date: Sun May 9 12:36:51 2010 New Revision: 207815 URL: http://svn.freebsd.org/changeset/base/207815 Log: MFC r207195: Provide compat32 shims for bpf(4), except zero-copy facilities. Modified: stable/8/sys/net/bpf.c stable/8/sys/net/bpfdesc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Sun May 9 12:34:20 2010 (r207814) +++ stable/8/sys/net/bpf.c Sun May 9 12:36:51 2010 (r207815) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" +#include "opt_compat.h" #include "opt_netgraph.h" #include @@ -89,6 +90,43 @@ MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); #define PRINET 26 /* interruptible */ +#ifdef COMPAT_FREEBSD32 +#include +#include +#define BPF_ALIGNMENT32 sizeof(int32_t) +#define BPF_WORDALIGN32(x) (((x)+(BPF_ALIGNMENT32-1))&~(BPF_ALIGNMENT32-1)) + +/* + * 32-bit version of structure prepended to each packet. We use this header + * instead of the standard one for 32-bit streams. We mark the a stream as + * 32-bit the first time we see a 32-bit compat ioctl request. + */ +struct bpf_hdr32 { + struct timeval32 bh_tstamp; /* time stamp */ + uint32_t bh_caplen; /* length of captured portion */ + uint32_t bh_datalen; /* original length of packet */ + uint16_t bh_hdrlen; /* length of bpf header (this struct + plus alignment padding) */ +}; + +struct bpf_program32 { + u_int bf_len; + uint32_t bf_insns; +}; + +struct bpf_dltlist32 { + u_int bfl_len; + u_int bfl_list; +}; + +#define BIOCSETF32 _IOW('B', 103, struct bpf_program32) +#define BIOCSRTIMEOUT32 _IOW('B',109, struct timeval32) +#define BIOCGRTIMEOUT32 _IOR('B',110, struct timeval32) +#define BIOCGDLTLIST32 _IOWR('B',121, struct bpf_dltlist32) +#define BIOCSETWF32 _IOW('B',123, struct bpf_program32) +#define BIOCSETFNR32 _IOW('B',130, struct bpf_program32) +#endif + /* * bpf_iflist is a list of BPF interface structures, each corresponding to a * specific DLT. The same network interface might have several BPF interface @@ -1002,8 +1040,14 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCFLUSH: case BIOCGDLT: case BIOCGDLTLIST: +#ifdef COMPAT_FREEBSD32 + case BIOCGDLTLIST32: +#endif case BIOCGETIF: case BIOCGRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCGRTIMEOUT32: +#endif case BIOCGSTATS: case BIOCVERSION: case BIOCGRSIG: @@ -1012,6 +1056,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c case FIONREAD: case BIOCLOCK: case BIOCSRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCSRTIMEOUT32: +#endif case BIOCIMMEDIATE: case TIOCGPGRP: case BIOCROTZBUF: @@ -1020,6 +1067,22 @@ bpfioctl(struct cdev *dev, u_long cmd, c return (EPERM); } } +#ifdef COMPAT_FREEBSD32 + /* + * If we see a 32-bit compat ioctl, mark the stream as 32-bit so + * that it will get 32-bit packet headers. + */ + switch (cmd) { + case BIOCSETF32: + case BIOCSETFNR32: + case BIOCSETWF32: + case BIOCGDLTLIST32: + case BIOCGRTIMEOUT32: + case BIOCSRTIMEOUT32: + d->bd_compat32 = 1; + } +#endif + CURVNET_SET(TD_TO_VNET(td)); switch (cmd) { @@ -1077,6 +1140,11 @@ bpfioctl(struct cdev *dev, u_long cmd, c case BIOCSETF: case BIOCSETFNR: case BIOCSETWF: +#ifdef COMPAT_FREEBSD32 + case BIOCSETF32: + case BIOCSETFNR32: + case BIOCSETWF32: +#endif error = bpf_setf(d, (struct bpf_program *)addr, cmd); break; @@ -1120,6 +1188,26 @@ bpfioctl(struct cdev *dev, u_long cmd, c /* * Get a list of supported data link types. */ +#ifdef COMPAT_FREEBSD32 + case BIOCGDLTLIST32: + { + struct bpf_dltlist32 *list32; + struct bpf_dltlist dltlist; + + list32 = (struct bpf_dltlist32 *)addr; + dltlist.bfl_len = list32->bfl_len; + dltlist.bfl_list = PTRIN(list32->bfl_list); + if (d->bd_bif == NULL) + error = EINVAL; + else { + error = bpf_getdltlist(d, &dltlist); + if (error == 0) + list32->bfl_len = dltlist.bfl_len; + } + break; + } +#endif + case BIOCGDLTLIST: if (d->bd_bif == NULL) error = EINVAL; @@ -1163,8 +1251,23 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Set read timeout. */ case BIOCSRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCSRTIMEOUT32: +#endif { struct timeval *tv = (struct timeval *)addr; +#ifdef COMPAT_FREEBSD32 + struct timeval32 *tv32; + struct timeval tv64; + + if (cmd == BIOCSRTIMEOUT32) { + tv32 = (struct timeval32 *)addr; + tv = &tv64; + tv->tv_sec = tv32->tv_sec; + tv->tv_usec = tv32->tv_usec; + } else +#endif + tv = (struct timeval *)addr; /* * Subtract 1 tick from tvtohz() since this isn't @@ -1179,11 +1282,31 @@ bpfioctl(struct cdev *dev, u_long cmd, c * Get read timeout. */ case BIOCGRTIMEOUT: +#ifdef COMPAT_FREEBSD32 + case BIOCGRTIMEOUT32: +#endif { - struct timeval *tv = (struct timeval *)addr; + struct timeval *tv; +#ifdef COMPAT_FREEBSD32 + struct timeval32 *tv32; + struct timeval tv64; + + if (cmd == BIOCGRTIMEOUT32) + tv = &tv64; + else +#endif + tv = (struct timeval *)addr; tv->tv_sec = d->bd_rtout / hz; tv->tv_usec = (d->bd_rtout % hz) * tick; +#ifdef COMPAT_FREEBSD32 + if (cmd == BIOCGRTIMEOUT32) { + tv32 = (struct timeval32 *)addr; + tv32->tv_sec = tv->tv_sec; + tv32->tv_usec = tv->tv_usec; + } +#endif + break; } @@ -1371,7 +1494,19 @@ bpf_setf(struct bpf_d *d, struct bpf_pro #ifdef BPF_JITTER bpf_jit_filter *ofunc; #endif - +#ifdef COMPAT_FREEBSD32 + struct bpf_program32 *fp32; + struct bpf_program fp_swab; + + if (cmd == BIOCSETWF32 || cmd == BIOCSETF32 || cmd == BIOCSETFNR32) { + fp32 = (struct bpf_program32 *)fp; + fp_swab.bf_len = fp32->bf_len; + fp_swab.bf_insns = (struct bpf_insn *)(uintptr_t)fp32->bf_insns; + fp = &fp_swab; + if (cmd == BIOCSETWF32) + cmd = BIOCSETWF; + } +#endif if (cmd == BIOCSETWF) { old = d->bd_wfilter; wfilter = 1; @@ -1773,6 +1908,9 @@ catchpacket(struct bpf_d *d, u_char *pkt struct timeval *tv) { struct bpf_hdr hdr; +#ifdef COMPAT_FREEBSD32 + struct bpf_hdr32 hdr32; +#endif int totlen, curlen; int hdrlen = d->bd_bif->bif_hdrlen; int do_wakeup = 0; @@ -1811,7 +1949,12 @@ catchpacket(struct bpf_d *d, u_char *pkt * buffer is considered immutable by the buffer model, try to rotate * the buffer and wakeup pending processes. */ - curlen = BPF_WORDALIGN(d->bd_slen); +#ifdef COMPAT_FREEBSD32 + if (d->bd_compat32) + curlen = BPF_WORDALIGN32(d->bd_slen); + else +#endif + curlen = BPF_WORDALIGN(d->bd_slen); if (curlen + totlen > d->bd_bufsize || !bpf_canwritebuf(d)) { if (d->bd_fbuf == NULL) { /* @@ -1833,6 +1976,22 @@ catchpacket(struct bpf_d *d, u_char *pkt * reader should be woken up. */ do_wakeup = 1; +#ifdef COMPAT_FREEBSD32 + /* + * If this is a 32-bit stream, then stick a 32-bit header at the + * front and copy the data into the buffer. + */ + if (d->bd_compat32) { + bzero(&hdr32, sizeof(hdr32)); + hdr32.bh_tstamp.tv_sec = tv->tv_sec; + hdr32.bh_tstamp.tv_usec = tv->tv_usec; + hdr32.bh_datalen = pktlen; + hdr32.bh_hdrlen = hdrlen; + hdr.bh_caplen = hdr32.bh_caplen = totlen - hdrlen; + bpf_append_bytes(d, d->bd_sbuf, curlen, &hdr32, sizeof(hdr32)); + goto copy; + } +#endif /* * Append the bpf header. Note we append the actual header size, but @@ -1848,6 +2007,9 @@ catchpacket(struct bpf_d *d, u_char *pkt /* * Copy the packet data into the store buffer and update its length. */ +#ifdef COMPAT_FREEBSD32 + copy: +#endif (*cpfn)(d, d->bd_sbuf, curlen + hdrlen, pkt, hdr.bh_caplen); d->bd_slen = curlen + totlen; Modified: stable/8/sys/net/bpfdesc.h ============================================================================== --- stable/8/sys/net/bpfdesc.h Sun May 9 12:34:20 2010 (r207814) +++ stable/8/sys/net/bpfdesc.h Sun May 9 12:36:51 2010 (r207815) @@ -97,6 +97,7 @@ struct bpf_d { u_int64_t bd_wfcount; /* number of packets that matched write filter */ u_int64_t bd_wdcount; /* number of packets dropped during a write */ u_int64_t bd_zcopy; /* number of zero copy operations */ + u_char bd_compat32; /* 32-bit stream on LP64 system */ }; /* Values for bd_state */ From owner-svn-src-all@FreeBSD.ORG Sun May 9 14:21:35 2010 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 33C00106564A; Sun, 9 May 2010 14:21:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 22DF58FC27; Sun, 9 May 2010 14:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49ELZFx057259; Sun, 9 May 2010 14:21:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49ELZFC057255; Sun, 9 May 2010 14:21:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091421.o49ELZFC057255@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 14:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207816 - head/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 14:21:35 -0000 Author: jilles Date: Sun May 9 14:21:34 2010 New Revision: 207816 URL: http://svn.freebsd.org/changeset/base/207816 Log: Document clock and pshared condvar attributes. Note: clock accepts CLOCK_VIRTUAL and CLOCK_PROF too, but this seems broken as it simply waits for the difference of the current and given value of the clock as if it were CLOCK_MONOTONIC. So document only CLOCK_REALTIME and CLOCK_MONOTONIC as allowed. MFC after: 1 week Modified: head/share/man/man3/Makefile head/share/man/man3/pthread_cond_timedwait.3 head/share/man/man3/pthread_condattr.3 Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sun May 9 12:36:51 2010 (r207815) +++ head/share/man/man3/Makefile Sun May 9 14:21:34 2010 (r207816) @@ -251,7 +251,11 @@ PTHREAD_MLINKS+=pthread_barrierattr.3 pt PTHREAD_MLINKS+=pthread_barrier_destroy.3 pthread_barrier_init.3 \ pthread_barrier_destroy.3 pthread_barrier_wait.3 PTHREAD_MLINKS+=pthread_condattr.3 pthread_condattr_destroy.3 \ - pthread_condattr.3 pthread_condattr_init.3 + pthread_condattr.3 pthread_condattr_init.3 \ + pthread_condattr.3 pthread_condattr_getclock.3 \ + pthread_condattr.3 pthread_condattr_setclock.3 \ + pthread_condattr.3 pthread_condattr_getpshared.3 \ + pthread_condattr.3 pthread_condattr_setpshared.3 PTHREAD_MLINKS+=pthread_getconcurrency.3 pthread_setconcurrency.3 PTHREAD_MLINKS+=pthread_multi_np.3 pthread_single_np.3 PTHREAD_MLINKS+=pthread_mutexattr.3 pthread_mutexattr_destroy.3 \ Modified: head/share/man/man3/pthread_cond_timedwait.3 ============================================================================== --- head/share/man/man3/pthread_cond_timedwait.3 Sun May 9 12:36:51 2010 (r207815) +++ head/share/man/man3/pthread_cond_timedwait.3 Sun May 9 14:21:34 2010 (r207816) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 28, 1998 +.Dd May 9, 2010 .Dt PTHREAD_COND_TIMEDWAIT 3 .Os .Sh NAME @@ -56,6 +56,11 @@ time specified in .Fa abstime , and the current thread reacquires the lock on .Fa mutex . +.Pp +The clock used to measure +.Fa abstime +can be specified during creation of the condition variable using +.Xr pthread_condattr_setclock 3 . .Sh RETURN VALUES If successful, the .Fn pthread_cond_timedwait @@ -87,7 +92,8 @@ was not locked by the calling thread. .Xr pthread_cond_destroy 3 , .Xr pthread_cond_init 3 , .Xr pthread_cond_signal 3 , -.Xr pthread_cond_wait 3 +.Xr pthread_cond_wait 3 , +.Xr pthread_condattr_setclock 3 .Sh STANDARDS The .Fn pthread_cond_timedwait Modified: head/share/man/man3/pthread_condattr.3 ============================================================================== --- head/share/man/man3/pthread_condattr.3 Sun May 9 12:36:51 2010 (r207815) +++ head/share/man/man3/pthread_condattr.3 Sun May 9 14:21:34 2010 (r207816) @@ -26,12 +26,16 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 28, 2000 +.Dd May 9, 2010 .Dt PTHREAD_CONDATTR 3 .Os .Sh NAME .Nm pthread_condattr_init , -.Nm pthread_condattr_destroy +.Nm pthread_condattr_destroy , +.Nm pthread_condattr_getclock , +.Nm pthread_condattr_setclock , +.Nm pthread_condattr_getpshared , +.Nm pthread_condattr_setpshared , .Nd condition attribute operations .Sh LIBRARY .Lb libpthread @@ -41,14 +45,17 @@ .Fn pthread_condattr_init "pthread_condattr_t *attr" .Ft int .Fn pthread_condattr_destroy "pthread_condattr_t *attr" +.Ft int +.Fn pthread_condattr_getclock "pthread_condattr_t * restrict attr" "clock_t * restrict clock_id" +.Ft int +.Fn pthread_condattr_setclock "pthread_condattr_t *attr" "clock_t clock_id" +.Ft int +.Fn pthread_condattr_getpshared "pthread_condattr_t * restrict attr" "int * restrict pshared" +.Ft int +.Fn pthread_condattr_setpshared "pthread_condattr_t *attr" "int pshared" .Sh DESCRIPTION Condition attribute objects are used to specify parameters to .Fn pthread_cond_init . -.Fx Ns 's -implementation of conditions does not support any non-default -attributes, so these functions are not very useful, though they are required -to be present by -.Tn POSIX . .Pp The .Fn pthread_condattr_init @@ -57,6 +64,52 @@ function initializes a condition attribu The .Fn pthread_condattr_destroy function destroys a condition attribute object. +.Pp +The +.Fn pthread_condattr_getclock +function will put the value of the clock attribute from +.Fa attr +into the memory area pointed to by +.Fa clock_id . +The +.Fn pthread_condattr_setclock +function will set the clock attribute of +.Fa attr +to the value specified in +.Fa clock_id . +The clock attribute affects the interpretation of +.Fa abstime +in +.Xr pthread_cond_timedwait 3 +and may be set to +.Dv CLOCK_REALTIME +(default) +or +.Dv CLOCK_MONOTONIC . +.Pp +The +.Fn pthread_condattr_getpshared +function will put the value of the process-shared attribute from +.Fa attr +into the memory area pointed to by +.Fa pshared . +The +.Fn pthread_condattr_setpshared +function will set the process-shared attribute of +.Fa attr +to the value specified in +.Fa pshared . +The argument +.Fa pshared +may have one of the following values: +.Bl -tag -width ".Dv PTHREAD_PROCESS_PRIVATE" +.It Dv PTHREAD_PROCESS_PRIVATE +The condition variable it is attached to may only be accessed by +threads in the same process as the one that created the object. +.It Dv PTHREAD_PROCESS_SHARED +The condition variable it is attached to may be accessed by +threads in processes other than the one that created the object. +.El .Sh RETURN VALUES If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. @@ -77,8 +130,29 @@ function will fail if: Invalid value for .Fa attr . .El +.Pp +The +.Fn pthread_condattr_setclock +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified in +.Fa clock_id +is not one of the allowed values. +.El +.Pp +The +.Fn pthread_condattr_setpshared +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The value specified in +.Fa pshared +is not one of the allowed values. +.El .Sh SEE ALSO -.Xr pthread_cond_init 3 +.Xr pthread_cond_init 3 , +.Xr pthread_cond_timedwait 3 .Sh STANDARDS The .Fn pthread_condattr_init @@ -86,3 +160,15 @@ and .Fn pthread_condattr_destroy functions conform to .St -p1003.1-96 +.Sh BUGS +The implementation of +condition variables +does not fully conform to +.St -p1003.2 +because the process-shared attribute is ignored; +if any value other than +.Dv PTHREAD_PROCESSES_PRIVATE +is specified in a call to +.Fn pthread_condattr_setpshared , +it will return +.Er EINVAL . From owner-svn-src-all@FreeBSD.ORG Sun May 9 15:00:30 2010 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 A3A8E1065679; Sun, 9 May 2010 15:00:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9397F8FC17; Sun, 9 May 2010 15:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49F0UUb066007; Sun, 9 May 2010 15:00:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49F0U67066005; Sun, 9 May 2010 15:00:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091500.o49F0U67066005@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 15:00: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: r207817 - head/share/man/man1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 15:00:30 -0000 Author: jilles Date: Sun May 9 15:00:30 2010 New Revision: 207817 URL: http://svn.freebsd.org/changeset/base/207817 Log: builtin(1): sh has no @ builtin command. MFC after: 1 week Modified: head/share/man/man1/builtin.1 Modified: head/share/man/man1/builtin.1 ============================================================================== --- head/share/man/man1/builtin.1 Sun May 9 14:21:34 2010 (r207816) +++ head/share/man/man1/builtin.1 Sun May 9 15:00:30 2010 (r207817) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2010 +.Dd May 9, 2010 .Dt BUILTIN 1 .Os .Sh NAME @@ -200,7 +200,7 @@ but are implemented as scripts using a b .It Ic % Ta \&No Ta Yes Ta \&No .It Ic \&. Ta \&No Ta \&No Ta Yes .It Ic \&: Ta \&No Ta Yes Ta Yes -.It Ic @ Ta \&No Ta Yes Ta Yes +.It Ic @ Ta \&No Ta Yes Ta \&No .It Ic \&[ Ta Yes Ta \&No Ta Yes .It Ic { Ta \&No Ta \&No Ta Yes .It Ic } Ta \&No Ta \&No Ta Yes From owner-svn-src-all@FreeBSD.ORG Sun May 9 15:39:49 2010 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 A75AB1065673; Sun, 9 May 2010 15:39:49 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9649E8FC12; Sun, 9 May 2010 15:39:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49Fdnfc074597; Sun, 9 May 2010 15:39:49 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49FdntX074595; Sun, 9 May 2010 15:39:49 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201005091539.o49FdntX074595@svn.freebsd.org> From: Fabien Thomas Date: Sun, 9 May 2010 15:39:49 +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: r207818 - stable/8/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 15:39:49 -0000 Author: fabient Date: Sun May 9 15:39:49 2010 New Revision: 207818 URL: http://svn.freebsd.org/changeset/base/207818 Log: MFC r207731: Exclude undefined symbol from ELF file when doing function resolve. Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Sun May 9 15:00:30 2010 (r207817) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Sun May 9 15:39:49 2010 (r207818) @@ -539,6 +539,8 @@ pmcstat_image_add_symbols(struct pmcstat return; if (GELF_ST_TYPE(sym.st_info) != STT_FUNC) continue; + if (sym.st_shndx == STN_UNDEF) + continue; if (!firsttime && pmcstat_symbol_search(image, sym.st_value)) continue; /* We've seen this symbol already. */ From owner-svn-src-all@FreeBSD.ORG Sun May 9 15:41:27 2010 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 D55831065675; Sun, 9 May 2010 15:41:27 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C475D8FC1F; Sun, 9 May 2010 15:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49FfRhg074977; Sun, 9 May 2010 15:41:27 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49FfRCD074975; Sun, 9 May 2010 15:41:27 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201005091541.o49FfRCD074975@svn.freebsd.org> From: Fabien Thomas Date: Sun, 9 May 2010 15:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207819 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 15:41:27 -0000 Author: fabient Date: Sun May 9 15:41:27 2010 New Revision: 207819 URL: http://svn.freebsd.org/changeset/base/207819 Log: MFC r207731: Exclude undefined symbol from ELF file when doing function resolve. Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat_log.c Sun May 9 15:39:49 2010 (r207818) +++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Sun May 9 15:41:27 2010 (r207819) @@ -539,6 +539,8 @@ pmcstat_image_add_symbols(struct pmcstat return; if (GELF_ST_TYPE(sym.st_info) != STT_FUNC) continue; + if (sym.st_shndx == STN_UNDEF) + continue; if (!firsttime && pmcstat_symbol_search(image, sym.st_value)) continue; /* We've seen this symbol already. */ From owner-svn-src-all@FreeBSD.ORG Sun May 9 16:04:32 2010 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 706CD1065672; Sun, 9 May 2010 16:04:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 602638FC14; Sun, 9 May 2010 16:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49G4WD5080074; Sun, 9 May 2010 16:04:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49G4Wur080072; Sun, 9 May 2010 16:04:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091604.o49G4Wur080072@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 16:04: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: r207820 - head/tools/regression/bin/sh/errors X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 16:04:32 -0000 Author: jilles Date: Sun May 9 16:04:32 2010 New Revision: 207820 URL: http://svn.freebsd.org/changeset/base/207820 Log: sh: Fix bug in assignment error test. The test failed if the command returned nonzero exit status, and it really should return that. Modified: head/tools/regression/bin/sh/errors/assignment-error1.0 Modified: head/tools/regression/bin/sh/errors/assignment-error1.0 ============================================================================== --- head/tools/regression/bin/sh/errors/assignment-error1.0 Sun May 9 15:41:27 2010 (r207819) +++ head/tools/regression/bin/sh/errors/assignment-error1.0 Sun May 9 16:04:32 2010 (r207820) @@ -26,5 +26,5 @@ do done # Other utilities must not abort; we currently still execute them. -sh -c "readonly a=0; a=1 true; exit $a" 2>/dev/null || exit 1 -sh -c "readonly a=0; a=1 command :; exit $a" 2>/dev/null || exit 1 +sh -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1 +sh -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1 From owner-svn-src-all@FreeBSD.ORG Sun May 9 16:15:40 2010 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 5DC56106566C; Sun, 9 May 2010 16:15:40 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4778FC14; Sun, 9 May 2010 16:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49GFekh082543; Sun, 9 May 2010 16:15:40 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49GFeOd082538; Sun, 9 May 2010 16:15:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091615.o49GFeOd082538@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 16:15: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: r207821 - in head/tools/regression: bin/sh/builtins lib/libc/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: Sun, 09 May 2010 16:15:40 -0000 Author: jilles Date: Sun May 9 16:15:40 2010 New Revision: 207821 URL: http://svn.freebsd.org/changeset/base/207821 Log: Generate some tests for sh's case command from the fnmatch tests. I'm committing the generated files because I don't like a build dependency for the sh(1) tests, and they are small and will not change much. Added: head/tools/regression/bin/sh/builtins/case2.0 (contents, props changed) head/tools/regression/bin/sh/builtins/case3.0 (contents, props changed) Modified: head/tools/regression/lib/libc/gen/Makefile head/tools/regression/lib/libc/gen/test-fnmatch.c Added: head/tools/regression/bin/sh/builtins/case2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case2.0 Sun May 9 16:15:40 2010 (r207821) @@ -0,0 +1,106 @@ +# Generated by ./test-fnmatch -s 1, do not edit. +# $FreeBSD$ +failures= +failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; } +testmatch() { eval "case \$2 in ''$1) ;; *) failed testmatch \"\$@\";; esac"; } +testnomatch() { eval "case \$2 in ''$1) failed testnomatch \"\$@\";; esac"; } +testmatch '' '' +testmatch 'a' 'a' +testnomatch 'a' 'b' +testnomatch 'a' 'A' +testmatch '*' 'a' +testmatch '*' 'aa' +testmatch '*a' 'a' +testnomatch '*a' 'b' +testnomatch '*a*' 'b' +testmatch '*a*b*' 'ab' +testmatch '*a*b*' 'qaqbq' +testmatch '*a*bb*' 'qaqbqbbq' +testmatch '*a*bc*' 'qaqbqbcq' +testmatch '*a*bb*' 'qaqbqbb' +testmatch '*a*bc*' 'qaqbqbc' +testmatch '*a*bb' 'qaqbqbb' +testmatch '*a*bc' 'qaqbqbc' +testnomatch '*a*bb' 'qaqbqbbq' +testnomatch '*a*bc' 'qaqbqbcq' +testnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa' +testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa' +testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa' +testnomatch '.*.*.*.*.*.*.*.*.*.*' '.........' +testmatch '.*.*.*.*.*.*.*.*.*.*' '..........' +testmatch '.*.*.*.*.*.*.*.*.*.*' '...........' +testnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789' +testnomatch '??????????*' '123456789' +testnomatch '*??????????' '123456789' +testmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890' +testmatch '??????????*' '1234567890' +testmatch '*??????????' '1234567890' +testmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901' +testmatch '??????????*' '12345678901' +testmatch '*??????????' '12345678901' +testmatch '[x]' 'x' +testmatch '[*]' '*' +testmatch '[?]' '?' +testmatch '[' '[' +testmatch '[[]' '[' +testnomatch '[[]' 'x' +testnomatch '[*]' '' +testnomatch '[*]' 'x' +testnomatch '[?]' 'x' +testmatch '*[*]*' 'foo*foo' +testnomatch '*[*]*' 'foo' +testmatch '[0-9]' '0' +testmatch '[0-9]' '5' +testmatch '[0-9]' '9' +testnomatch '[0-9]' '/' +testnomatch '[0-9]' ':' +testnomatch '[0-9]' '*' +testnomatch '[!0-9]' '0' +testnomatch '[!0-9]' '5' +testnomatch '[!0-9]' '9' +testmatch '[!0-9]' '/' +testmatch '[!0-9]' ':' +testmatch '[!0-9]' '*' +testmatch '*[0-9]' 'a0' +testmatch '*[0-9]' 'a5' +testmatch '*[0-9]' 'a9' +testnomatch '*[0-9]' 'a/' +testnomatch '*[0-9]' 'a:' +testnomatch '*[0-9]' 'a*' +testnomatch '*[!0-9]' 'a0' +testnomatch '*[!0-9]' 'a5' +testnomatch '*[!0-9]' 'a9' +testmatch '*[!0-9]' 'a/' +testmatch '*[!0-9]' 'a:' +testmatch '*[!0-9]' 'a*' +testmatch '*[0-9]' 'a00' +testmatch '*[0-9]' 'a55' +testmatch '*[0-9]' 'a99' +testmatch '*[0-9]' 'a0a0' +testmatch '*[0-9]' 'a5a5' +testmatch '*[0-9]' 'a9a9' +testmatch '\*' '*' +testmatch '\?' '?' +testmatch '\[x]' '[x]' +testmatch '\[' '[' +testmatch '\\' '\' +testmatch '*\**' 'foo*foo' +testnomatch '*\**' 'foo' +testmatch '*\\*' 'foo\foo' +testnomatch '*\\*' 'foo' +testmatch '\(' '(' +testmatch '\a' 'a' +testnomatch '\*' 'a' +testnomatch '\?' 'a' +testnomatch '\*' '\*' +testnomatch '\?' '\?' +testnomatch '\[x]' '\[x]' +testnomatch '\[x]' '\x' +testnomatch '\[' '\[' +testnomatch '\(' '\(' +testnomatch '\a' '\a' +testmatch '.*' '.' +testmatch '.*' '..' +testmatch '.*' '.a' +testmatch 'a*' 'a.' +[ -z "$failures" ] Added: head/tools/regression/bin/sh/builtins/case3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case3.0 Sun May 9 16:15:40 2010 (r207821) @@ -0,0 +1,95 @@ +# Generated by ./test-fnmatch -s 2, do not edit. +# $FreeBSD$ +failures= +failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; } +# We do not treat a backslash specially in this case, +# but this is not the case in all shells. +netestmatch() { case $2 in $1) ;; *) failed netestmatch "$@";; esac; } +netestnomatch() { case $2 in $1) failed netestnomatch "$@";; esac; } +netestmatch '' '' +netestmatch 'a' 'a' +netestnomatch 'a' 'b' +netestnomatch 'a' 'A' +netestmatch '*' 'a' +netestmatch '*' 'aa' +netestmatch '*a' 'a' +netestnomatch '*a' 'b' +netestnomatch '*a*' 'b' +netestmatch '*a*b*' 'ab' +netestmatch '*a*b*' 'qaqbq' +netestmatch '*a*bb*' 'qaqbqbbq' +netestmatch '*a*bc*' 'qaqbqbcq' +netestmatch '*a*bb*' 'qaqbqbb' +netestmatch '*a*bc*' 'qaqbqbc' +netestmatch '*a*bb' 'qaqbqbb' +netestmatch '*a*bc' 'qaqbqbc' +netestnomatch '*a*bb' 'qaqbqbbq' +netestnomatch '*a*bc' 'qaqbqbcq' +netestnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa' +netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa' +netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa' +netestnomatch '.*.*.*.*.*.*.*.*.*.*' '.........' +netestmatch '.*.*.*.*.*.*.*.*.*.*' '..........' +netestmatch '.*.*.*.*.*.*.*.*.*.*' '...........' +netestnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789' +netestnomatch '??????????*' '123456789' +netestnomatch '*??????????' '123456789' +netestmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890' +netestmatch '??????????*' '1234567890' +netestmatch '*??????????' '1234567890' +netestmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901' +netestmatch '??????????*' '12345678901' +netestmatch '*??????????' '12345678901' +netestmatch '[x]' 'x' +netestmatch '[*]' '*' +netestmatch '[?]' '?' +netestmatch '[' '[' +netestmatch '[[]' '[' +netestnomatch '[[]' 'x' +netestnomatch '[*]' '' +netestnomatch '[*]' 'x' +netestnomatch '[?]' 'x' +netestmatch '*[*]*' 'foo*foo' +netestnomatch '*[*]*' 'foo' +netestmatch '[0-9]' '0' +netestmatch '[0-9]' '5' +netestmatch '[0-9]' '9' +netestnomatch '[0-9]' '/' +netestnomatch '[0-9]' ':' +netestnomatch '[0-9]' '*' +netestnomatch '[!0-9]' '0' +netestnomatch '[!0-9]' '5' +netestnomatch '[!0-9]' '9' +netestmatch '[!0-9]' '/' +netestmatch '[!0-9]' ':' +netestmatch '[!0-9]' '*' +netestmatch '*[0-9]' 'a0' +netestmatch '*[0-9]' 'a5' +netestmatch '*[0-9]' 'a9' +netestnomatch '*[0-9]' 'a/' +netestnomatch '*[0-9]' 'a:' +netestnomatch '*[0-9]' 'a*' +netestnomatch '*[!0-9]' 'a0' +netestnomatch '*[!0-9]' 'a5' +netestnomatch '*[!0-9]' 'a9' +netestmatch '*[!0-9]' 'a/' +netestmatch '*[!0-9]' 'a:' +netestmatch '*[!0-9]' 'a*' +netestmatch '*[0-9]' 'a00' +netestmatch '*[0-9]' 'a55' +netestmatch '*[0-9]' 'a99' +netestmatch '*[0-9]' 'a0a0' +netestmatch '*[0-9]' 'a5a5' +netestmatch '*[0-9]' 'a9a9' +netestmatch '\*' '\*' +netestmatch '\?' '\?' +netestmatch '\' '\' +netestnomatch '\\' '\' +netestmatch '\\' '\\' +netestmatch '*\*' 'foo\foo' +netestnomatch '*\*' 'foo' +netestmatch '.*' '.' +netestmatch '.*' '..' +netestmatch '.*' '.a' +netestmatch 'a*' 'a.' +[ -z "$failures" ] Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Sun May 9 16:04:32 2010 (r207820) +++ head/tools/regression/lib/libc/gen/Makefile Sun May 9 16:15:40 2010 (r207821) @@ -9,3 +9,7 @@ tests: ${TESTS} .PHONY: clean clean: -rm -f ${TESTS} + +sh-tests: test-fnmatch + ./test-fnmatch -s 1 >../../../bin/sh/builtins/case2.0 + ./test-fnmatch -s 2 >../../../bin/sh/builtins/case3.0 Modified: head/tools/regression/lib/libc/gen/test-fnmatch.c ============================================================================== --- head/tools/regression/lib/libc/gen/test-fnmatch.c Sun May 9 16:04:32 2010 (r207820) +++ head/tools/regression/lib/libc/gen/test-fnmatch.c Sun May 9 16:15:40 2010 (r207821) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include struct testcase { @@ -210,13 +211,62 @@ flags_to_string(int flags) return result; } +static int +write_sh_tests(const char *progname, int num) +{ + size_t i, n; + struct testcase *t; + + printf("# Generated by %s -s %d, do not edit.\n", progname, num); + printf("# $" "FreeBSD$\n"); + printf("failures=\n"); + printf("failed() { printf '%%s\\n' \"Failed: $1 '$2' '$3'\"; failures=x$failures; }\n"); + if (num == 1) { + printf("testmatch() { eval \"case \\$2 in ''$1) ;; *) failed testmatch \\\"\\$@\\\";; esac\"; }\n"); + printf("testnomatch() { eval \"case \\$2 in ''$1) failed testnomatch \\\"\\$@\\\";; esac\"; }\n"); + } else if (num == 2) { + printf("# We do not treat a backslash specially in this case,\n"); + printf("# but this is not the case in all shells.\n"); + printf("netestmatch() { case $2 in $1) ;; *) failed netestmatch \"$@\";; esac; }\n"); + printf("netestnomatch() { case $2 in $1) failed netestnomatch \"$@\";; esac; }\n"); + } + n = sizeof(testcases) / sizeof(testcases[0]); + for (i = 0; i < n; i++) { + t = &testcases[i]; + if (strchr(t->pattern, '\'') != NULL || + strchr(t->string, '\'') != NULL) + continue; + if (num == 1 && t->flags == 0) + printf("test%smatch '%s' '%s'\n", + t->result == FNM_NOMATCH ? "no" : "", + t->pattern, t->string); + if (num == 2 && (t->flags == FNM_NOESCAPE || + (t->flags == 0 && strchr(t->pattern, '\\') == NULL))) + printf("netest%smatch '%s' '%s'\n", + t->result == FNM_NOMATCH ? "no" : "", + t->pattern, t->string); + } + printf("[ -z \"$failures\" ]\n"); + return 0; +} + int main(int argc, char *argv[]) { size_t i, n; - int flags, result, extra, errors; + int opt, flags, result, extra, errors; struct testcase *t; + while ((opt = getopt(argc, argv, "s:")) != -1) { + switch (opt) { + case 's': + return (write_sh_tests(argv[0], atoi(optarg))); + default: + fprintf(stderr, "usage: %s [-s num]\n", argv[0]); + fprintf(stderr, "-s option writes tests for sh(1), num is 1 or 2\n"); + exit(1); + } + } n = sizeof(testcases) / sizeof(testcases[0]); errors = 0; printf("1..%zu\n", n); From owner-svn-src-all@FreeBSD.ORG Sun May 9 16:27:43 2010 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 39A54106566C; Sun, 9 May 2010 16:27:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 29B158FC12; Sun, 9 May 2010 16:27:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49GRghM085234; Sun, 9 May 2010 16:27:42 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49GRgGC085232; Sun, 9 May 2010 16:27:42 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005091627.o49GRgGC085232@svn.freebsd.org> From: Alan Cox Date: Sun, 9 May 2010 16:27: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: r207822 - 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, 09 May 2010 16:27:43 -0000 Author: alc Date: Sun May 9 16:27:42 2010 New Revision: 207822 URL: http://svn.freebsd.org/changeset/base/207822 Log: Call vm_page_deactivate() rather than vm_page_dontneed() in swp_pager_force_pagein(). By dirtying the page, swp_pager_force_pagein() forces vm_page_dontneed() to insert the page at the head of the inactive queue, just like vm_page_deactivate() does. Moreover, because the page was invalid, it can't have been mapped, and thus the other effect of vm_page_dontneed(), clearing the page's reference bits has no effect. In summary, there is no reason to call vm_page_dontneed() since its effect will be identical to calling the simpler vm_page_deactivate(). Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun May 9 16:15:40 2010 (r207821) +++ head/sys/vm/swap_pager.c Sun May 9 16:27:42 2010 (r207822) @@ -1719,11 +1719,9 @@ swp_pager_force_pagein(vm_object_t objec if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ vm_object_pip_subtract(object, 1); - vm_page_lock(m); - vm_page_lock_queues(); vm_page_dirty(m); - vm_page_dontneed(m); - vm_page_unlock_queues(); + vm_page_lock(m); + vm_page_deactivate(m); vm_page_unlock(m); vm_page_wakeup(m); vm_pager_page_unswapped(m); From owner-svn-src-all@FreeBSD.ORG Sun May 9 16:55:43 2010 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 4D287106566C; Sun, 9 May 2010 16:55:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3CE488FC08; Sun, 9 May 2010 16:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49Gthdf091352; Sun, 9 May 2010 16:55:43 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49GthC9091349; Sun, 9 May 2010 16:55:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005091655.o49GthC9091349@svn.freebsd.org> From: Alan Cox Date: Sun, 9 May 2010 16:55: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: r207823 - 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, 09 May 2010 16:55:43 -0000 Author: alc Date: Sun May 9 16:55:42 2010 New Revision: 207823 URL: http://svn.freebsd.org/changeset/base/207823 Log: Push down the acquisition of the page queues lock into vm_pageq_remove(). (This eliminates a surprising number of page queues lock acquisitions by vm_fault() because the page's queue is PQ_NONE and thus the page queues lock is not needed to remove the page from a queue.) Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun May 9 16:27:42 2010 (r207822) +++ head/sys/vm/vm_fault.c Sun May 9 16:55:42 2010 (r207823) @@ -363,9 +363,7 @@ RetryFault:; vm_object_deallocate(fs.first_object); goto RetryFault; } - vm_page_lock_queues(); vm_pageq_remove(fs.m); - vm_page_unlock_queues(); vm_page_unlock(fs.m); /* Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun May 9 16:27:42 2010 (r207822) +++ head/sys/vm/vm_page.c Sun May 9 16:55:42 2010 (r207823) @@ -169,6 +169,7 @@ TUNABLE_INT("vm.boot_pages", &boot_pages SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); +static void vm_page_queue_remove(int queue, vm_page_t m); static void vm_page_enqueue(int queue, vm_page_t m); /* Make sure that u_long is at least 64 bits when PAGE_SIZE is 32K. */ @@ -1328,24 +1329,43 @@ vm_page_requeue(vm_page_t m) } /* + * vm_page_queue_remove: + * + * Remove the given page from the specified queue. + * + * The page and page queues must be locked. + */ +static __inline void +vm_page_queue_remove(int queue, vm_page_t m) +{ + struct vpgqueues *pq; + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + vm_page_lock_assert(m, MA_OWNED); + pq = &vm_page_queues[queue]; + TAILQ_REMOVE(&pq->pl, m, pageq); + (*pq->cnt)--; +} + +/* * vm_pageq_remove: * * Remove a page from its queue. * - * The queue containing the given page must be locked. + * The given page must be locked. * This routine may not block. */ void vm_pageq_remove(vm_page_t m) { int queue = VM_PAGE_GETQUEUE(m); - struct vpgqueues *pq; + vm_page_lock_assert(m, MA_OWNED); if (queue != PQ_NONE) { + vm_page_lock_queues(); VM_PAGE_SETQUEUE2(m, PQ_NONE); - pq = &vm_page_queues[queue]; - TAILQ_REMOVE(&pq->pl, m, pageq); - (*pq->cnt)--; + vm_page_queue_remove(queue, m); + vm_page_unlock_queues(); } } @@ -1380,18 +1400,20 @@ vm_page_enqueue(int queue, vm_page_t m) void vm_page_activate(vm_page_t m) { + int queue; vm_page_lock_assert(m, MA_OWNED); - if (VM_PAGE_GETKNOWNQUEUE2(m) != PQ_ACTIVE) { + if ((queue = VM_PAGE_GETKNOWNQUEUE2(m)) != PQ_ACTIVE) { if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) { if (m->act_count < ACT_INIT) m->act_count = ACT_INIT; vm_page_lock_queues(); - vm_pageq_remove(m); + if (queue != PQ_NONE) + vm_page_queue_remove(queue, m); vm_page_enqueue(PQ_ACTIVE, m); vm_page_unlock_queues(); } else - KASSERT(m->queue == PQ_NONE, + KASSERT(queue == PQ_NONE, ("vm_page_activate: wired page %p is queued", m)); } else { if (m->act_count < ACT_INIT) @@ -1472,11 +1494,8 @@ vm_page_free_toq(vm_page_t m) * callback routine until after we've put the page on the * appropriate free queue. */ - if (VM_PAGE_GETQUEUE(m) != PQ_NONE) { - vm_page_lock_queues(); + if ((m->flags & PG_UNMANAGED) == 0) vm_pageq_remove(m); - vm_page_unlock_queues(); - } vm_page_remove(m); /* @@ -1554,11 +1573,8 @@ vm_page_wire(vm_page_t m) if (m->flags & PG_FICTITIOUS) return; if (m->wire_count == 0) { - if ((m->flags & PG_UNMANAGED) == 0) { - vm_page_lock_queues(); + if ((m->flags & PG_UNMANAGED) == 0) vm_pageq_remove(m); - vm_page_unlock_queues(); - } atomic_add_int(&cnt.v_wire_count, 1); } m->wire_count++; @@ -1633,22 +1649,26 @@ vm_page_unwire(vm_page_t m, int activate static inline void _vm_page_deactivate(vm_page_t m, int athead) { + int queue; vm_page_lock_assert(m, MA_OWNED); /* * Ignore if already inactive. */ - if (VM_PAGE_INQUEUE2(m, PQ_INACTIVE)) + if ((queue = VM_PAGE_GETKNOWNQUEUE2(m)) == PQ_INACTIVE) return; if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) { vm_page_lock_queues(); vm_page_flag_clear(m, PG_WINATCFLS); - vm_pageq_remove(m); + if (queue != PQ_NONE) + vm_page_queue_remove(queue, m); if (athead) - TAILQ_INSERT_HEAD(&vm_page_queues[PQ_INACTIVE].pl, m, pageq); + TAILQ_INSERT_HEAD(&vm_page_queues[PQ_INACTIVE].pl, m, + pageq); else - TAILQ_INSERT_TAIL(&vm_page_queues[PQ_INACTIVE].pl, m, pageq); + TAILQ_INSERT_TAIL(&vm_page_queues[PQ_INACTIVE].pl, m, + pageq); VM_PAGE_SETQUEUE2(m, PQ_INACTIVE); cnt.v_inactive_count++; vm_page_unlock_queues(); @@ -1751,11 +1771,7 @@ vm_page_cache(vm_page_t m) /* * Remove the page from the paging queues. */ - if (VM_PAGE_GETQUEUE(m) != PQ_NONE) { - vm_page_lock_queues(); - vm_pageq_remove(m); - vm_page_unlock_queues(); - } + vm_pageq_remove(m); /* * Remove the page from the object's collection of resident From owner-svn-src-all@FreeBSD.ORG Sun May 9 17:04:17 2010 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 60BE8106566B; Sun, 9 May 2010 17:04:17 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id C88D08FC08; Sun, 9 May 2010 17:04:16 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o49H4FKe022289; Sun, 9 May 2010 19:04:15 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o49H4FcP022288; Sun, 9 May 2010 19:04:15 +0200 (CEST) (envelope-from marius) Date: Sun, 9 May 2010 19:04:15 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20100509170414.GA35602@alchemy.franken.de> References: <201004192327.o3JNRsK4047856@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004192327.o3JNRsK4047856@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206878 - 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: Sun, 09 May 2010 17:04:17 -0000 On Mon, Apr 19, 2010 at 11:27:54PM +0000, Attilio Rao wrote: > Author: attilio > Date: Mon Apr 19 23:27:54 2010 > New Revision: 206878 > URL: http://svn.freebsd.org/changeset/base/206878 > > Log: > Fix a deadlock in the shutdown code: > When performing a smp_rendezvous() or more likely, on amd64 and i386, > a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx > spinlock held, busy-waiting for other CPUs to acknowledge the operation. > As long as CPUs are suspended (via cpu_reset()) between the active mask > read and IPI sending there can be a deadlock where the caller will wait > forever for a dead CPU to acknowledge the operation. > Please note that on CPU0 that is going to be someway heavier because of > the spinlocks being disabled earlier than quitting the machine. > > Fix this bug by calling cpu_reset() with the smp_ipi_mtx held. > Note that it is very likely that a saner offline/online CPUs mechanism > will help heavilly in fixing similar cases as it is likely more bugs > of this type may arise in the future. > This change causes a hang for me when running an SMP kernel on an UP machine or an MP machine with SMP disabled as in these cases smp_ipi_mtx isn't initialized (see mp_start()). The below patch fixes this for me. Marius Index: kern_shutdown.c =================================================================== --- kern_shutdown.c (revision 207463) +++ kern_shutdown.c (working copy) @@ -491,8 +491,8 @@ shutdown_reset(void *junk, int howto) /* * Acquiring smp_ipi_mtx here has a double effect: * - it disables interrupts avoiding CPU0 preemption - * by fast handlers (thus deadlocking against other CPUs) - * - it avoids deadlocks against smp_rendezvous() or, more + * by fast handlers (thus deadlocking against other CPUs) + * - it avoids deadlocks against smp_rendezvous() or, more * generally, threads busy-waiting, with this spinlock held, * and waiting for responses by threads on other CPUs * (ie. smp_tlb_shootdown()). @@ -500,9 +500,11 @@ shutdown_reset(void *junk, int howto) * For the !SMP case it just needs to handle the former problem. */ #ifdef SMP - mtx_lock_spin(&smp_ipi_mtx); + if (mtx_initialized(&smp_ipi_mtx) != 0) + mtx_lock_spin(&smp_ipi_mtx); + else #else - spinlock_enter(); + spinlock_enter(); #endif /* cpu_boot(howto); */ /* doesn't do anything at the moment */ From owner-svn-src-all@FreeBSD.ORG Sun May 9 17:10:51 2010 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 4C6231065672; Sun, 9 May 2010 17:10:51 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE7D8FC16; Sun, 9 May 2010 17:10:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49HAp8R094681; Sun, 9 May 2010 17:10:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49HApol094677; Sun, 9 May 2010 17:10:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091710.o49HApol094677@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 17:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207824 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 17:10:51 -0000 Author: jilles Date: Sun May 9 17:10:50 2010 New Revision: 207824 URL: http://svn.freebsd.org/changeset/base/207824 Log: sh: Add some parser tests. case1.0 tests POSIX requirements and one more for keywords in case statements. The others test very special cases of command substitution. These also work on stable/8. Added: head/tools/regression/bin/sh/parser/case1.0 (contents, props changed) head/tools/regression/bin/sh/parser/case2.0 (contents, props changed) head/tools/regression/bin/sh/parser/heredoc3.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/case1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/case1.0 Sun May 9 17:10:50 2010 (r207824) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +keywords='if then else elif fi while until for do done { } case esac ! in' + +# Keywords can be used unquoted in case statements, except the keyword +# esac as the first pattern of a '|' alternation without a starting '('. +# (POSIX doesn't seem to require (esac) to work.) +for k in $keywords; do + eval "case $k in (foo|$k) ;; *) echo bad ;; esac" + eval "case $k in ($k) ;; *) echo bad ;; esac" + eval "case $k in foo|$k) ;; *) echo bad ;; esac" + [ "$k" = esac ] && continue + eval "case $k in $k) ;; *) echo bad ;; esac" +done Added: head/tools/regression/bin/sh/parser/case2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/case2.0 Sun May 9 17:10:50 2010 (r207824) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +# Pretty much only ash derivatives can parse all of this. + +f1() { + x=$(case x in + (x|esac) ;; + (*) echo bad >&2 ;; + esac) +} +f1 +f2() { + x=$(case x in + (x|esac) ;; + (*) echo bad >&2 + esac) +} +f2 +f3() { + x=$(case x in + x|esac) ;; + *) echo bad >&2 ;; + esac) +} +f3 +f4() { + x=$(case x in + x|esac) ;; + *) echo bad >&2 + esac) +} +f4 Added: head/tools/regression/bin/sh/parser/heredoc3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/heredoc3.0 Sun May 9 17:10:50 2010 (r207824) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# This may be expected to work, but pretty much only ash derivatives allow it. + +test "$(cat < 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 48C2E1065700; Sun, 9 May 2010 17:15:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 380478FC13; Sun, 9 May 2010 17:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49HFRIc095736; Sun, 9 May 2010 17:15:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49HFR6h095734; Sun, 9 May 2010 17:15:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091715.o49HFR6h095734@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 17:15: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: r207825 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2010 17:15:27 -0000 Author: jilles Date: Sun May 9 17:15:26 2010 New Revision: 207825 URL: http://svn.freebsd.org/changeset/base/207825 Log: Fix error in comment. Modified: head/tools/regression/bin/sh/builtins/var-assign2.0 Modified: head/tools/regression/bin/sh/builtins/var-assign2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/var-assign2.0 Sun May 9 17:10:50 2010 (r207824) +++ head/tools/regression/bin/sh/builtins/var-assign2.0 Sun May 9 17:15:26 2010 (r207825) @@ -40,7 +40,7 @@ UTILS="alias,\ set -e -# With 'command', variable assignments affect the shell environment. +# With 'command', variable assignments do not affect the shell environment. set -- ${SPECIAL} for cmd in "$@" From owner-svn-src-all@FreeBSD.ORG Sun May 9 19:30:52 2010 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 CD3751065670; Sun, 9 May 2010 19:30:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BC0E78FC18; Sun, 9 May 2010 19:30:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49JUq7g025378; Sun, 9 May 2010 19:30:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49JUqoZ025375; Sun, 9 May 2010 19:30:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091930.o49JUqoZ025375@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 19:30:52 +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: r207826 - stable/8/usr.bin/pathchk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 19:30:52 -0000 Author: jilles Date: Sun May 9 19:30:52 2010 New Revision: 207826 URL: http://svn.freebsd.org/changeset/base/207826 Log: MFC r207483: pathchk: Add the new POSIX -P option. This option checks for empty pathnames and components starting with '-'. Our -p option also checks for the latter, which remains the case. Modified: stable/8/usr.bin/pathchk/pathchk.1 stable/8/usr.bin/pathchk/pathchk.c Directory Properties: stable/8/usr.bin/pathchk/ (props changed) Modified: stable/8/usr.bin/pathchk/pathchk.1 ============================================================================== --- stable/8/usr.bin/pathchk/pathchk.1 Sun May 9 17:15:26 2010 (r207825) +++ stable/8/usr.bin/pathchk/pathchk.1 Sun May 9 19:30:52 2010 (r207826) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2002 +.Dd May 1, 2010 .Dt PATHCHK 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd check pathnames .Sh SYNOPSIS .Nm -.Op Fl p +.Op Fl pP .Ar pathname ... .Sh DESCRIPTION The @@ -95,6 +95,16 @@ No component may start with the hyphen .Pq Ql \&- character. .El +.It Fl P +In addition to the default or +.Fl p +checks, write a diagnostic for each argument that: +.Bl -bullet +.It +Is empty. +.It +Contains a component that starts with a hyphen. +.El .El .Sh EXIT STATUS .Ex -std Modified: stable/8/usr.bin/pathchk/pathchk.c ============================================================================== --- stable/8/usr.bin/pathchk/pathchk.c Sun May 9 17:15:26 2010 (r207825) +++ stable/8/usr.bin/pathchk/pathchk.c Sun May 9 19:30:52 2010 (r207826) @@ -51,6 +51,7 @@ static int portable(const char *); static void usage(void); static int pflag; /* Perform portability checks */ +static int Pflag; /* Check for empty paths, leading '-' */ int main(int argc, char *argv[]) @@ -58,11 +59,14 @@ main(int argc, char *argv[]) int ch, rval; const char *arg; - while ((ch = getopt(argc, argv, "p")) > 0) { + while ((ch = getopt(argc, argv, "pP")) > 0) { switch (ch) { case 'p': pflag = 1; break; + case 'P': + Pflag = 1; + break; default: usage(); /*NOTREACHED*/ @@ -102,6 +106,15 @@ check(const char *path) p = pathd; + if (Pflag && *p == '\0') { + warnx("%s: empty pathname", path); + goto bad; + } + if ((Pflag || pflag) && (*p == '-' || strstr(p, "/-") != NULL)) { + warnx("%s: contains a component starting with '-'", path); + goto bad; + } + if (!pflag) { errno = 0; namemax = pathconf(*p == '/' ? "/" : ".", _PC_NAME_MAX); @@ -182,9 +195,6 @@ portable(const char *path) "0123456789._-"; long s; - if (*path == '-') - return (*path); - s = strspn(path, charset); if (path[s] != '\0') return (path[s]); From owner-svn-src-all@FreeBSD.ORG Sun May 9 19:32:37 2010 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 871CE1065672; Sun, 9 May 2010 19:32:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 763DB8FC0A; Sun, 9 May 2010 19:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49JWb8n025783; Sun, 9 May 2010 19:32:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49JWbC0025781; Sun, 9 May 2010 19:32:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005091932.o49JWbC0025781@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 19:32: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: r207827 - stable/8/usr.bin/pathchk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 19:32:37 -0000 Author: jilles Date: Sun May 9 19:32:37 2010 New Revision: 207827 URL: http://svn.freebsd.org/changeset/base/207827 Log: MFC r207485: pathchk(1): Fix the example so it allows arbitrary pathnames. Spaces and various other characters in pathnames are not passed through literally by xargs in its default mode. Instead, use find . -exec ... {} + Although the -- argument is not strictly required here, add it anyway to avoid surprises when modifying the code to find -f -somedir ... Modified: stable/8/usr.bin/pathchk/pathchk.1 Directory Properties: stable/8/usr.bin/pathchk/ (props changed) Modified: stable/8/usr.bin/pathchk/pathchk.1 ============================================================================== --- stable/8/usr.bin/pathchk/pathchk.1 Sun May 9 19:30:52 2010 (r207826) +++ stable/8/usr.bin/pathchk/pathchk.1 Sun May 9 19:32:37 2010 (r207827) @@ -114,7 +114,7 @@ other .Tn POSIX systems: .Pp -.Dl "find . -print | xargs pathchk -p" +.Dl "find . -exec pathchk -p -- {} +" .Sh SEE ALSO .Xr getconf 1 , .Xr pathconf 2 , From owner-svn-src-all@FreeBSD.ORG Sun May 9 20:32:00 2010 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 DA6451065670; Sun, 9 May 2010 20:32:00 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C9F738FC19; Sun, 9 May 2010 20:32:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49KW0qd038800; Sun, 9 May 2010 20:32:00 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49KW0Q4038795; Sun, 9 May 2010 20:32:00 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201005092032.o49KW0Q4038795@svn.freebsd.org> From: Kip Macy Date: Sun, 9 May 2010 20:32: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: r207828 - 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, 09 May 2010 20:32:01 -0000 Author: kmacy Date: Sun May 9 20:32:00 2010 New Revision: 207828 URL: http://svn.freebsd.org/changeset/base/207828 Log: Add flowtable support to IPv6 Tested by: qingli@ Reviewed by: qingli@ MFC after: 3 days Modified: head/sys/netinet6/in6_proto.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Sun May 9 19:32:37 2010 (r207827) +++ head/sys/netinet6/in6_proto.c Sun May 9 20:32:00 2010 (r207828) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include "opt_carp.h" #include "opt_sctp.h" #include "opt_mpath.h" +#include "opt_route.h" #include #include @@ -130,6 +131,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FLOWTABLE +#include +#endif + /* * TCP/IP protocol family: IP6, ICMP6, UDP, TCP. */ @@ -569,6 +574,16 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ &VNET_NAME(ip6stealth), 0, ""); #endif +#ifdef FLOWTABLE +VNET_DEFINE(int, ip6_output_flowtable_size) = 2048; +VNET_DEFINE(struct flowtable *, ip6_ft); +#define V_ip6_output_flowtable_size VNET(ip6_output_flowtable_size) + +SYSCTL_VNET_INT(_net_inet6_ip6, OID_AUTO, output_flowtable_size, CTLFLAG_RDTUN, + &VNET_NAME(ip6_output_flowtable_size), 2048, + "number of entries in the per-cpu output flow caches"); +#endif + /* net.inet6.icmp6 */ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, ""); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sun May 9 19:32:37 2010 (r207827) +++ head/sys/netinet6/ip6_input.c Sun May 9 20:32:00 2010 (r207828) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_route.h" #include #include @@ -113,6 +114,12 @@ __FBSDID("$FreeBSD$"); #include +#ifdef FLOWTABLE +#include +extern VNET_DEFINE(int, ip6_output_flowtable_size); +#define V_ip6_output_flowtable_size VNET(ip6_output_flowtable_size) +#endif + extern struct domain inet6domain; u_char ip6_protox[IPPROTO_MAX]; @@ -169,6 +176,12 @@ ip6_init(void) nd6_init(); frag6_init(); +#ifdef FLOWTABLE + TUNABLE_INT_FETCH("net.inet6.ip6.output_flowtable_size", + &V_ip6_output_flowtable_size); + V_ip6_ft = flowtable_alloc("ipv6", V_ip6_output_flowtable_size, FL_PCPU); +#endif + V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; /* Skip global initialization stuff for non-default instances. */ Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun May 9 19:32:37 2010 (r207827) +++ head/sys/netinet6/ip6_output.c Sun May 9 20:32:00 2010 (r207828) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipsec.h" #include "opt_sctp.h" +#include "opt_route.h" #include #include @@ -111,6 +112,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FLOWTABLE +#include +#endif + extern int in6_mcast_loop; struct ip6_exthdrs { @@ -211,6 +216,7 @@ ip6_output(struct mbuf *m0, struct ip6_p struct in6_addr finaldst, src0, dst0; u_int32_t zone; struct route_in6 *ro_pmtu = NULL; + int flevalid = 0; int hdrsplit = 0; int needipsec = 0; #ifdef SCTP @@ -231,9 +237,7 @@ ip6_output(struct mbuf *m0, struct ip6_p } finaldst = ip6->ip6_dst; - bzero(&exthdrs, sizeof(exthdrs)); - if (opt) { /* Hop-by-Hop options header */ MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh); @@ -470,7 +474,22 @@ skip_ipsec2:; if (opt && opt->ip6po_rthdr) ro = &opt->ip6po_route; dst = (struct sockaddr_in6 *)&ro->ro_dst; - +#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 + * longer than that long for the stability of ro_rt. The + * flow ID assignment must have happened before this point. + */ + if ((fle = flowtable_lookup_mbuf(V_ip6_ft, m, AF_INET6)) != NULL) { + flow_to_route_in6(fle, ro); + flevalid = 1; + } + } +#endif again: /* * if specified, try to fill in the traffic class field. @@ -576,7 +595,10 @@ again: dst_sa.sin6_family = AF_INET6; dst_sa.sin6_len = sizeof(dst_sa); dst_sa.sin6_addr = ip6->ip6_dst; - if ((error = in6_selectroute(&dst_sa, opt, im6o, ro, + if (flevalid) { + rt = ro->ro_rt; + ifp = ro->ro_rt->rt_ifp; + } else if ((error = in6_selectroute(&dst_sa, opt, im6o, ro, &ifp, &rt)) != 0) { switch (error) { case EHOSTUNREACH: @@ -1071,9 +1093,11 @@ sendorfree: V_ip6stat.ip6s_fragmented++; done: - if (ro == &ip6route && ro->ro_rt) { /* brace necessary for RTFREE */ + if (ro == &ip6route && ro->ro_rt && flevalid == 0) { + /* brace necessary for RTFREE */ RTFREE(ro->ro_rt); - } else if (ro_pmtu == &ip6route && ro_pmtu->ro_rt) { + } else if (ro_pmtu == &ip6route && ro_pmtu->ro_rt && + ((flevalid == 0) || (ro_pmtu != ro))) { RTFREE(ro_pmtu->ro_rt); } #ifdef IPSEC Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun May 9 19:32:37 2010 (r207827) +++ head/sys/netinet6/udp6_usrreq.c Sun May 9 20:32:00 2010 (r207828) @@ -1079,7 +1079,9 @@ udp6_send(struct socket *so, int flags, mac_inpcb_create_mbuf(inp, m); #endif error = udp6_output(inp, m, addr, control, td); +#ifdef INET out: +#endif INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_udbinfo); return (error); From owner-svn-src-all@FreeBSD.ORG Sun May 9 21:34:05 2010 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 A78911065670; Sun, 9 May 2010 21:34:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 970068FC08; Sun, 9 May 2010 21:34:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49LY5jN052425; Sun, 9 May 2010 21:34:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49LY5K4052423; Sun, 9 May 2010 21:34:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201005092134.o49LY5K4052423@svn.freebsd.org> From: Christian Brueffer Date: Sun, 9 May 2010 21:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207829 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2010 21:34:05 -0000 Author: brueffer Date: Sun May 9 21:34:05 2010 New Revision: 207829 URL: http://svn.freebsd.org/changeset/base/207829 Log: Various wording, spelling and markup fixes. PR: 145251 Submitted by: Hywel Mallett (partly) MFC after: 3 week Modified: head/share/man/man4/iscsi_initiator.4 Modified: head/share/man/man4/iscsi_initiator.4 ============================================================================== --- head/share/man/man4/iscsi_initiator.4 Sun May 9 20:32:00 2010 (r207828) +++ head/share/man/man4/iscsi_initiator.4 Sun May 9 21:34:05 2010 (r207829) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2007 +.Dd May 9, 2010 .Dt ISCSI_INITIATOR 4 .Os .Sh NAME @@ -48,34 +48,39 @@ iscsi_initiator_load="YES" The .Nm implements the kernel side of the Internet SCSI (iSCSI) network -protocol standard, the user land companion is +protocol standard. +The userland companion is .Xr iscontrol 8 , and permits access to remote .Em virtual SCSI devices via .Xr cam 4 . .Sh SYSCTL VARIABLES -.Bl -tag -width ".Va net.iscsi.n.targeaddress" +.Bl -tag -width "net.iscsi.n.targedaddress" .It Va debug.iscsi_initiator set the debug-level, 0 means no debugging, 9 for maximum. .It Va net.iscsi.isid the initiator part of the Session Identifier. -.It "the following are informative only:" +.El +.Pp +The following are informative only: +.Pp +.Bl -tag -width "net.iscsi.n.targedaddress" .It Va net.iscsi.driver_version the current version of the driver. .It Va net.iscsi.sessions the number of current active sessions. .It Va net.iscsi.n.targetname -is the targe name of session +the target name of session .Em n . -.It Va net.iscsi.n.targeaddress -is the IP address of the target of session +.It Va net.iscsi.n.targedaddress +the IP address of the target of session .Em n . .It Va net.iscsi.n.stats -are some statistics for session +statistics for session .Em n .It Va net.iscsi.n.pid -is the +the .Em "process id" of the userland side of session .Em n , From owner-svn-src-all@FreeBSD.ORG Sun May 9 22:01:36 2010 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 4490B1065672; Sun, 9 May 2010 22:01:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3459E8FC0C; Sun, 9 May 2010 22:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49M1aRp058524; Sun, 9 May 2010 22:01:36 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49M1a6F058522; Sun, 9 May 2010 22:01:36 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201005092201.o49M1a6F058522@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 9 May 2010 22:01: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: r207830 - head/lib/libc/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 22:01:36 -0000 Author: edwin Date: Sun May 9 22:01:35 2010 New Revision: 207830 URL: http://svn.freebsd.org/changeset/base/207830 Log: strptime(3) confused July with June with the fr_FR locale. When parsing the month "juillet" (abbr "jul"), %B recognized it as "juin" (abbr "jui") because the full name of the month names is checked at the same time as the abbrevation. The new behaviour checks the full names first before checking the abbrevation names. PR: kern/141939 Submitted by: Denis Chatelain MFC after: 1 week Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Sun May 9 21:34:05 2010 (r207829) +++ head/lib/libc/stdtime/strptime.c Sun May 9 22:01:35 2010 (r207830) @@ -408,6 +408,14 @@ label: if (strncasecmp(buf, tptr->month[i], len) == 0) break; + } + } + /* + * Try the abbreviated month name if the full name + * wasn't found and Oalternative was not requested. + */ + if (i == asizeof(tptr->month) && !Oalternative) { + for (i = 0; i < asizeof(tptr->month); i++) { len = strlen(tptr->mon[i]); if (strncasecmp(buf, tptr->mon[i], len) == 0) From owner-svn-src-all@FreeBSD.ORG Sun May 9 22:03:18 2010 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 6BCFE106566B; Sun, 9 May 2010 22:03:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6CC8FC0C; Sun, 9 May 2010 22:03:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49M3IOd058922; Sun, 9 May 2010 22:03:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49M3IpZ058920; Sun, 9 May 2010 22:03:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201005092203.o49M3IpZ058920@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 May 2010 22:03: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: r207831 - 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: Sun, 09 May 2010 22:03:18 -0000 Author: jilles Date: Sun May 9 22:03:18 2010 New Revision: 207831 URL: http://svn.freebsd.org/changeset/base/207831 Log: sh(1): Fix "reserved word" vs "keyword" inconsistency. Use "keyword" everywhere, like the output of the 'type' builtin, and only mention "reserved word" once to say it is the same thing. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 9 22:01:35 2010 (r207830) +++ head/bin/sh/sh.1 Sun May 9 22:03:18 2010 (r207831) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd April 5, 2010 +.Dd May 9, 2010 .Dt SH 1 .Os .Sh NAME @@ -415,11 +415,11 @@ character, with the exception of the new .Pq Ql \en . A backslash preceding a newline is treated as a line continuation. .El -.Ss Reserved Words -Reserved words are words that have special meaning to the +.Ss Keywords +Keywords or reserved words are words that have special meaning to the shell and are recognized at the beginning of a line and after a control operator. -The following are reserved words: +The following are keywords: .Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center .It Li \&! Ta { Ta } Ta Ic case Ta Ic do .It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi @@ -429,8 +429,8 @@ The following are reserved words: An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a reserved word may occur (see above), -and after checking for reserved words, the shell +Whenever a keyword may occur (see above), +and after checking for keywords, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called @@ -469,7 +469,7 @@ of this man page (refer to the BNF in th document). Essentially though, a line is read and if the first word of the line (or after a control operator) -is not a reserved word, then the shell has recognized a +is not a keyword, then the shell has recognized a simple command. Otherwise, a complex command or some other special construct may have been recognized. @@ -695,7 +695,7 @@ Signal numbers are defined in the header .In sys/signal.h . .Ss Complex Commands Complex commands are combinations of simple commands -with control operators or reserved words, together creating a larger complex +with control operators or keywords, together creating a larger complex command. More generally, a command is one of the following: .Bl -item -offset indent @@ -739,7 +739,7 @@ operators that are part of the command. If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp -If the reserved word +If the keyword .Ic !\& does not precede the pipeline, the exit status is the exit status of the last command specified From owner-svn-src-all@FreeBSD.ORG Sun May 9 22:16:15 2010 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 83C5E1065673; Sun, 9 May 2010 22:16:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 72B458FC0A; Sun, 9 May 2010 22:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o49MGFoh061881; Sun, 9 May 2010 22:16:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o49MGFdp061877; Sun, 9 May 2010 22:16:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005092216.o49MGFdp061877@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 9 May 2010 22:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207832 - head/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 May 2010 22:16:15 -0000 Author: yongari Date: Sun May 9 22:16:15 2010 New Revision: 207832 URL: http://svn.freebsd.org/changeset/base/207832 Log: Export hardware MAC statistics through sysctl node. Previously fxp(4) already used to extract most hardware MAC statistics but it didn't show them. With this change, all MAC statistics counters are exported. Because there are a couple of new counters for 82558 and 82559, enable extended MAC statistics functionality to get these counters. Accoring to public data sheet, 82559 MAC statistics return 24 DWORD counters(3 counters are unknown at this moment) so increase MAC counter structure to meet the MAC statistics block size. The completion of MAC counter dump is now checked against FXP_STATS_DR_COMPLETE status code which is appended at the end of status block. Previously fxp(4) ignored the status of the FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the completion of pending command before issuing FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try it next time. This scheme may show better performance but there is chance to loose updated counters after stopping controller. So make sure to update MAC statistics in fxp_stop(). While I'm here move sysctl node creation to fxp_sysctl_node(). Tested by: Larry Baird < lab <> gta dot com > Modified: head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/if_fxpreg.h head/sys/dev/fxp/if_fxpvar.h Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun May 9 22:03:18 2010 (r207831) +++ head/sys/dev/fxp/if_fxp.c Sun May 9 22:16:15 2010 (r207832) @@ -262,6 +262,8 @@ static int fxp_miibus_readreg(device_t static int fxp_miibus_writereg(device_t dev, int phy, int reg, int value); static void fxp_load_ucode(struct fxp_softc *sc); +static void fxp_update_stats(struct fxp_softc *sc); +static void fxp_sysctl_node(struct fxp_softc *sc); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high); static int sysctl_hw_fxp_bundle_max(SYSCTL_HANDLER_ARGS); @@ -537,39 +539,7 @@ fxp_attach(device_t dev) && (data & FXP_PHY_SERIAL_ONLY)) sc->flags |= FXP_FLAG_SERIAL_MEDIA; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "int_delay", CTLTYPE_INT | CTLFLAG_RW, - &sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I", - "FXP driver receive interrupt microcode bundling delay"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "bundle_max", CTLTYPE_INT | CTLFLAG_RW, - &sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I", - "FXP driver receive interrupt microcode bundle size limit"); - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, - "FXP RNR events"); - SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "noflow", CTLFLAG_RW, &sc->tunable_noflow, 0, - "FXP flow control disabled"); - - /* - * Pull in device tunables. - */ - sc->tunable_int_delay = TUNABLE_INT_DELAY; - sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX; - sc->tunable_noflow = 1; - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), - "int_delay", &sc->tunable_int_delay); - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), - "bundle_max", &sc->tunable_bundle_max); - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), - "noflow", &sc->tunable_noflow); - sc->rnr = 0; - + fxp_sysctl_node(sc); /* * Enable workarounds for certain chip revision deficiencies. * @@ -2020,6 +1990,81 @@ fxp_intr_body(struct fxp_softc *sc, stru return (rx_npkts); } +static void +fxp_update_stats(struct fxp_softc *sc) +{ + struct ifnet *ifp = sc->ifp; + struct fxp_stats *sp = sc->fxp_stats; + struct fxp_hwstats *hsp; + uint32_t *status; + + FXP_LOCK_ASSERT(sc, MA_OWNED); + + bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* Update statistical counters. */ + if (sc->revision >= FXP_REV_82559_A0) + status = &sp->completion_status; + else if (sc->revision >= FXP_REV_82558_A4) + status = (uint32_t *)&sp->tx_tco; + else + status = &sp->tx_pause; + if (*status == htole32(FXP_STATS_DR_COMPLETE)) { + hsp = &sc->fxp_hwstats; + hsp->tx_good += le32toh(sp->tx_good); + hsp->tx_maxcols += le32toh(sp->tx_maxcols); + hsp->tx_latecols += le32toh(sp->tx_latecols); + hsp->tx_underruns += le32toh(sp->tx_underruns); + hsp->tx_lostcrs += le32toh(sp->tx_lostcrs); + hsp->tx_deffered += le32toh(sp->tx_deffered); + hsp->tx_single_collisions += le32toh(sp->tx_single_collisions); + hsp->tx_multiple_collisions += + le32toh(sp->tx_multiple_collisions); + hsp->tx_total_collisions += le32toh(sp->tx_total_collisions); + hsp->rx_good += le32toh(sp->rx_good); + hsp->rx_crc_errors += le32toh(sp->rx_crc_errors); + hsp->rx_alignment_errors += le32toh(sp->rx_alignment_errors); + hsp->rx_rnr_errors += le32toh(sp->rx_rnr_errors); + hsp->rx_overrun_errors += le32toh(sp->rx_overrun_errors); + hsp->rx_cdt_errors += le32toh(sp->rx_cdt_errors); + hsp->rx_shortframes += le32toh(sp->rx_shortframes); + hsp->tx_pause += le32toh(sp->tx_pause); + hsp->rx_pause += le32toh(sp->rx_pause); + hsp->rx_controls += le32toh(sp->rx_controls); + hsp->tx_tco += le16toh(sp->tx_tco); + hsp->rx_tco += le16toh(sp->rx_tco); + + ifp->if_opackets += le32toh(sp->tx_good); + ifp->if_collisions += le32toh(sp->tx_total_collisions); + if (sp->rx_good) { + ifp->if_ipackets += le32toh(sp->rx_good); + sc->rx_idle_secs = 0; + } else if (sc->flags & FXP_FLAG_RXBUG) { + /* + * Receiver's been idle for another second. + */ + sc->rx_idle_secs++; + } + ifp->if_ierrors += + le32toh(sp->rx_crc_errors) + + le32toh(sp->rx_alignment_errors) + + le32toh(sp->rx_rnr_errors) + + le32toh(sp->rx_overrun_errors); + /* + * If any transmit underruns occured, bump up the transmit + * threshold by another 512 bytes (64 * 8). + */ + if (sp->tx_underruns) { + ifp->if_oerrors += le32toh(sp->tx_underruns); + if (tx_threshold < 192) + tx_threshold += 64; + } + *status = 0; + bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } +} + /* * Update packet in/out/collision statistics. The i82557 doesn't * allow you to access these counters without doing a fairly @@ -2036,35 +2081,11 @@ fxp_tick(void *xsc) { struct fxp_softc *sc = xsc; struct ifnet *ifp = sc->ifp; - struct fxp_stats *sp = sc->fxp_stats; FXP_LOCK_ASSERT(sc, MA_OWNED); - bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, BUS_DMASYNC_POSTREAD); - ifp->if_opackets += le32toh(sp->tx_good); - ifp->if_collisions += le32toh(sp->tx_total_collisions); - if (sp->rx_good) { - ifp->if_ipackets += le32toh(sp->rx_good); - sc->rx_idle_secs = 0; - } else if (sc->flags & FXP_FLAG_RXBUG) { - /* - * Receiver's been idle for another second. - */ - sc->rx_idle_secs++; - } - ifp->if_ierrors += - le32toh(sp->rx_crc_errors) + - le32toh(sp->rx_alignment_errors) + - le32toh(sp->rx_rnr_errors) + - le32toh(sp->rx_overrun_errors); - /* - * If any transmit underruns occured, bump up the transmit - * threshold by another 512 bytes (64 * 8). - */ - if (sp->tx_underruns) { - ifp->if_oerrors += le32toh(sp->tx_underruns); - if (tx_threshold < 192) - tx_threshold += 64; - } + + /* Update statistical counters. */ + fxp_update_stats(sc); /* * Release any xmit buffers that have completed DMA. This isn't @@ -2099,24 +2120,7 @@ fxp_tick(void *xsc) /* * Start another stats dump. */ - bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, - BUS_DMASYNC_PREREAD); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_DUMPRESET); - } else { - /* - * A previous command is still waiting to be accepted. - * Just zero our copy of the stats and wait for the - * next timer event to update them. - */ - sp->tx_good = 0; - sp->tx_underruns = 0; - sp->tx_total_collisions = 0; - - sp->rx_good = 0; - sp->rx_crc_errors = 0; - sp->rx_alignment_errors = 0; - sp->rx_rnr_errors = 0; - sp->rx_overrun_errors = 0; } if (sc->miibus != NULL) mii_tick(device_get_softc(sc->miibus)); @@ -2160,6 +2164,8 @@ fxp_stop(struct fxp_softc *sc) /* Disable interrupts. */ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); + fxp_update_stats(sc); + /* * Release any xmit buffers. */ @@ -2262,7 +2268,9 @@ fxp_init_body(struct fxp_softc *sc) * Initialize base of dump-stats buffer. */ fxp_scb_wait(sc); - bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, BUS_DMASYNC_PREREAD); + bzero(sc->fxp_stats, sizeof(struct fxp_stats)); + bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->stats_addr); fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_DUMP_ADR); @@ -2383,6 +2391,22 @@ fxp_init_body(struct fxp_softc *sc) cbp->pri_fc_loc = 1; /* FC pri location (byte31) */ } + /* Enable 82558 and 82559 extended statistics functionality. */ + if (sc->revision >= FXP_REV_82558_A4) { + if (sc->revision >= FXP_REV_82559_A0) { + /* + * Extend configuration table size to 32 + * to include TCO configuration. + */ + cbp->byte_count = 32; + cbp->ext_stats_dis = 1; + /* Enable TCO stats. */ + cbp->tno_int_or_tco_en = 1; + cbp->gamla_rx = 1; + } else + cbp->ext_stats_dis = 0; + } + /* * Start the config command/DMA. */ @@ -3004,6 +3028,113 @@ fxp_load_ucode(struct fxp_softc *sc) sc->flags |= FXP_FLAG_UCODE; } +#define FXP_SYSCTL_STAT_ADD(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +fxp_sysctl_node(struct fxp_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct fxp_hwstats *hsp; + + ctx = device_get_sysctl_ctx(sc->dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); + + SYSCTL_ADD_PROC(ctx, child, + OID_AUTO, "int_delay", CTLTYPE_INT | CTLFLAG_RW, + &sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I", + "FXP driver receive interrupt microcode bundling delay"); + SYSCTL_ADD_PROC(ctx, child, + OID_AUTO, "bundle_max", CTLTYPE_INT | CTLFLAG_RW, + &sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I", + "FXP driver receive interrupt microcode bundle size limit"); + SYSCTL_ADD_INT(ctx, child,OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, + "FXP RNR events"); + SYSCTL_ADD_INT(ctx, child, + OID_AUTO, "noflow", CTLFLAG_RW, &sc->tunable_noflow, 0, + "FXP flow control disabled"); + + /* + * Pull in device tunables. + */ + sc->tunable_int_delay = TUNABLE_INT_DELAY; + sc->tunable_bundle_max = TUNABLE_BUNDLE_MAX; + sc->tunable_noflow = 1; + (void) resource_int_value(device_get_name(sc->dev), + device_get_unit(sc->dev), "int_delay", &sc->tunable_int_delay); + (void) resource_int_value(device_get_name(sc->dev), + device_get_unit(sc->dev), "bundle_max", &sc->tunable_bundle_max); + (void) resource_int_value(device_get_name(sc->dev), + device_get_unit(sc->dev), "noflow", &sc->tunable_noflow); + sc->rnr = 0; + + hsp = &sc->fxp_hwstats; + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "FXP statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx MAC statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "Rx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", + &hsp->rx_good, "Good frames"); + FXP_SYSCTL_STAT_ADD(ctx, child, "crc_errors", + &hsp->rx_crc_errors, "CRC errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "alignment_errors", + &hsp->rx_alignment_errors, "Alignment errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "rnr_errors", + &hsp->rx_rnr_errors, "RNR errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "overrun_errors", + &hsp->rx_overrun_errors, "Overrun errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "cdt_errors", + &hsp->rx_cdt_errors, "Collision detect errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "shortframes", + &hsp->rx_shortframes, "Short frame errors"); + if (sc->revision >= FXP_REV_82558_A4) { + FXP_SYSCTL_STAT_ADD(ctx, child, "pause", + &hsp->rx_pause, "Pause frames"); + FXP_SYSCTL_STAT_ADD(ctx, child, "controls", + &hsp->rx_controls, "Unsupported control frames"); + } + if (sc->revision >= FXP_REV_82559_A0) + FXP_SYSCTL_STAT_ADD(ctx, child, "tco", + &hsp->rx_tco, "TCO frames"); + + /* Tx MAC statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "Tx MAC statistics"); + child = SYSCTL_CHILDREN(tree); + FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", + &hsp->tx_good, "Good frames"); + FXP_SYSCTL_STAT_ADD(ctx, child, "maxcols", + &hsp->tx_maxcols, "Maximum collisions errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "latecols", + &hsp->tx_latecols, "Late collisions errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "underruns", + &hsp->tx_underruns, "Underrun errors"); + FXP_SYSCTL_STAT_ADD(ctx, child, "lostcrs", + &hsp->tx_lostcrs, "Lost carrier sense"); + FXP_SYSCTL_STAT_ADD(ctx, child, "deffered", + &hsp->tx_deffered, "Deferred"); + FXP_SYSCTL_STAT_ADD(ctx, child, "single_collisions", + &hsp->tx_single_collisions, "Single collisions"); + FXP_SYSCTL_STAT_ADD(ctx, child, "multiple_collisions", + &hsp->tx_multiple_collisions, "Multiple collisions"); + FXP_SYSCTL_STAT_ADD(ctx, child, "total_collisions", + &hsp->tx_total_collisions, "Total collisions"); + if (sc->revision >= FXP_REV_82558_A4) + FXP_SYSCTL_STAT_ADD(ctx, child, "pause", + &hsp->tx_pause, "Pause frames"); + if (sc->revision >= FXP_REV_82559_A0) + FXP_SYSCTL_STAT_ADD(ctx, child, "tco", + &hsp->tx_tco, "TCO frames"); +} + +#undef FXP_SYSCTL_STAT_ADD + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: head/sys/dev/fxp/if_fxpreg.h ============================================================================== --- head/sys/dev/fxp/if_fxpreg.h Sun May 9 22:03:18 2010 (r207831) +++ head/sys/dev/fxp/if_fxpreg.h Sun May 9 22:16:15 2010 (r207832) @@ -418,7 +418,15 @@ struct fxp_stats { uint32_t rx_overrun_errors; uint32_t rx_cdt_errors; uint32_t rx_shortframes; + uint32_t tx_pause; + uint32_t rx_pause; + uint32_t rx_controls; + uint16_t tx_tco; + uint16_t rx_tco; uint32_t completion_status; + uint32_t reserved0; + uint32_t reserved1; + uint32_t reserved2; }; #define FXP_STATS_DUMP_COMPLETE 0xa005 #define FXP_STATS_DR_COMPLETE 0xa007 Modified: head/sys/dev/fxp/if_fxpvar.h ============================================================================== --- head/sys/dev/fxp/if_fxpvar.h Sun May 9 22:03:18 2010 (r207831) +++ head/sys/dev/fxp/if_fxpvar.h Sun May 9 22:16:15 2010 (r207832) @@ -149,6 +149,30 @@ struct fxp_ident { char *name; }; +struct fxp_hwstats { + uint32_t tx_good; + uint32_t tx_maxcols; + uint32_t tx_latecols; + uint32_t tx_underruns; + uint32_t tx_lostcrs; + uint32_t tx_deffered; + uint32_t tx_single_collisions; + uint32_t tx_multiple_collisions; + uint32_t tx_total_collisions; + uint32_t tx_pause; + uint32_t tx_tco; + uint32_t rx_good; + uint32_t rx_crc_errors; + uint32_t rx_alignment_errors; + uint32_t rx_rnr_errors; + uint32_t rx_overrun_errors; + uint32_t rx_cdt_errors; + uint32_t rx_shortframes; + uint32_t rx_pause; + uint32_t rx_controls; + uint32_t rx_tco; +}; + /* * NOTE: Elements are ordered for optimal cacheline behavior, and NOT * for functional grouping. @@ -175,6 +199,7 @@ struct fxp_softc { int tx_queued; /* # of active TxCB's */ struct fxp_stats *fxp_stats; /* Pointer to interface stats */ uint32_t stats_addr; /* DMA address of the stats structure */ + struct fxp_hwstats fxp_hwstats; int rx_idle_secs; /* # of seconds RX has been idle */ struct callout stat_ch; /* stat callout */ int watchdog_timer; /* seconds until chip reset */ From owner-svn-src-all@FreeBSD.ORG Sun May 9 22:27:42 2010 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 7730E1065672; Sun, 9 May 2010 22:27:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9999C8FC0C; Sun, 9 May 2010 22:27:41 +0000 (UTC) Received: by fxm15 with SMTP id 15so2333558fxm.13 for ; Sun, 09 May 2010 15:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=qoYqY+tv55oJAt/bH2ZQ+8Z8AVFfepbGGdkvp7Lfwns=; b=udQtucTxYDpe6zgf6MVMCa/00/YnGQnuNnH+wA0u8gZUsaTawdQLFk6yvhce8nFYEu EAzFcdzFOAzMQ5mOCeztL7WdYfvBqgU87+d14ZzqNiRO8hBH8q4oxm7UP9060rOk9+xi wVOSP3wYLmUAPZ5MMRjc+uoy96FEby9ZLJkb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ACy6MmbJhHLPUbiI0s3FyahbcteaX8zDQnE98VVm7aY+DyMkNWFNoEqbY3T2sjucry qdQai94qblDlMJ4HQCPXS5c0kssvarkstxEv8xf71y0/hPS06roGgCWO/IksE9a/It2r UGyfJvgfcARfZo3b6zOe1tTuU/9kF8cQuSupY= MIME-Version: 1.0 Received: by 10.239.136.133 with SMTP id h5mr339890hbh.47.1273444060348; Sun, 09 May 2010 15:27:40 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.239.129.207 with HTTP; Sun, 9 May 2010 15:27:40 -0700 (PDT) In-Reply-To: <20100509170414.GA35602@alchemy.franken.de> References: <201004192327.o3JNRsK4047856@svn.freebsd.org> <20100509170414.GA35602@alchemy.franken.de> Date: Mon, 10 May 2010 00:27:40 +0200 X-Google-Sender-Auth: 5de89d4bde43defc Message-ID: From: Attilio Rao To: Marius Strobl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206878 - 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: Sun, 09 May 2010 22:27:42 -0000 2010/5/9 Marius Strobl : > On Mon, Apr 19, 2010 at 11:27:54PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Mon Apr 19 23:27:54 2010 >> New Revision: 206878 >> URL: http://svn.freebsd.org/changeset/base/206878 >> >> Log: >> =C2=A0 Fix a deadlock in the shutdown code: >> =C2=A0 When performing a smp_rendezvous() or more likely, on amd64 and i= 386, >> =C2=A0 a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx >> =C2=A0 spinlock held, busy-waiting for other CPUs to acknowledge the ope= ration. >> =C2=A0 As long as CPUs are suspended (via cpu_reset()) between the activ= e mask >> =C2=A0 read and IPI sending there can be a deadlock where the caller wil= l wait >> =C2=A0 forever for a dead CPU to acknowledge the operation. >> =C2=A0 Please note that on CPU0 that is going to be someway heavier beca= use of >> =C2=A0 the spinlocks being disabled earlier than quitting the machine. >> >> =C2=A0 Fix this bug by calling cpu_reset() with the smp_ipi_mtx held. >> =C2=A0 Note that it is very likely that a saner offline/online CPUs mech= anism >> =C2=A0 will help heavilly in fixing similar cases as it is likely more b= ugs >> =C2=A0 of this type may arise in the future. >> > > This change causes a hang for me when running an SMP kernel on an > UP machine or an MP machine with SMP disabled as in these cases > smp_ipi_mtx isn't initialized (see mp_start()). The below patch > fixes this for me. Marius, thanks a lot for reporting this. However, I think that a better fix is to always initialize the mutex. Do you think the following patch is fine for you?: http://www.freebsd.org/~attilio/smpipi_fixup.diff Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon May 10 01:22:29 2010 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 D170F1065673; Mon, 10 May 2010 01:22:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 624668FC15; Mon, 10 May 2010 01:22:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A1MThn002606; Mon, 10 May 2010 01:22:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A1MTj4002604; Mon, 10 May 2010 01:22:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201005100122.o4A1MTj4002604@svn.freebsd.org> From: Ed Maste Date: Mon, 10 May 2010 01:22:29 +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: r207835 - stable/8/usr.sbin/zic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 01:22:29 -0000 Author: emaste Date: Mon May 10 01:22:29 2010 New Revision: 207835 URL: http://svn.freebsd.org/changeset/base/207835 Log: MFC r207590: Update GRANDPARENTED text to match the contents of tzdata/factory r19879. This eliminates "warning: time zone abbreviation differs from POSIX" on installworld. Modified: stable/8/usr.sbin/zic/private.h Directory Properties: stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/usr.sbin/zic/private.h ============================================================================== --- stable/8/usr.sbin/zic/private.h Mon May 10 01:07:59 2010 (r207834) +++ stable/8/usr.sbin/zic/private.h Mon May 10 01:22:29 2010 (r207835) @@ -34,7 +34,7 @@ static const char privatehid[] = "@(#)pr #endif /* !defined NOID */ #endif /* !defined lint */ -#define GRANDPARENTED "Local time zone must be set--see zic manual page" +#define GRANDPARENTED "Local time zone must be set--use tzsetup" /* ** Defaults for preprocessor symbols. From owner-svn-src-all@FreeBSD.ORG Mon May 10 01:23:31 2010 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 EAA251065679; Mon, 10 May 2010 01:23:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id DA4BA8FC25; Mon, 10 May 2010 01:23:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A1NVp4002887; Mon, 10 May 2010 01:23:31 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A1NVQh002885; Mon, 10 May 2010 01:23:31 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201005100123.o4A1NVQh002885@svn.freebsd.org> From: Ed Maste Date: Mon, 10 May 2010 01:23:31 +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: r207836 - stable/7/usr.sbin/zic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 01:23:32 -0000 Author: emaste Date: Mon May 10 01:23:31 2010 New Revision: 207836 URL: http://svn.freebsd.org/changeset/base/207836 Log: MFC r207590: Update GRANDPARENTED text to match the contents of tzdata/factory r19879. This eliminates "warning: time zone abbreviation differs from POSIX" on installworld. Modified: stable/7/usr.sbin/zic/private.h Directory Properties: stable/7/usr.sbin/zic/ (props changed) Modified: stable/7/usr.sbin/zic/private.h ============================================================================== --- stable/7/usr.sbin/zic/private.h Mon May 10 01:22:29 2010 (r207835) +++ stable/7/usr.sbin/zic/private.h Mon May 10 01:23:31 2010 (r207836) @@ -34,7 +34,7 @@ static const char privatehid[] = "@(#)pr #endif /* !defined NOID */ #endif /* !defined lint */ -#define GRANDPARENTED "Local time zone must be set--see zic manual page" +#define GRANDPARENTED "Local time zone must be set--use tzsetup" /* ** Defaults for preprocessor symbols. From owner-svn-src-all@FreeBSD.ORG Mon May 10 02:07:58 2010 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 452BF106564A; Mon, 10 May 2010 02:07:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E8BF78FC08; Mon, 10 May 2010 02:07:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A27vPb012653; Mon, 10 May 2010 02:07:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A27vUW012650; Mon, 10 May 2010 02:07:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005100207.o4A27vUW012650@svn.freebsd.org> From: Xin LI Date: Mon, 10 May 2010 02:07:57 +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: r207838 - stable/8/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 02:07:58 -0000 Author: delphij Date: Mon May 10 02:07:57 2010 New Revision: 207838 URL: http://svn.freebsd.org/changeset/base/207838 Log: MFC r207247,r207283,207284: - Add a signal handler for SIGINT which removes output file when necessary. - While I'm there, move unlink_input() slightly down to after closing the output file, in uncompression path. - Language improvements to make the BUGS section easier to read. Modified: stable/8/usr.bin/gzip/gzip.1 stable/8/usr.bin/gzip/gzip.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/gzip.1 ============================================================================== --- stable/8/usr.bin/gzip/gzip.1 Mon May 10 02:07:42 2010 (r207837) +++ stable/8/usr.bin/gzip/gzip.1 Mon May 10 02:07:57 2010 (r207838) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 7, 2010 +.Dd April 27, 2010 .Dt GZIP 1 .Os .Sh NAME @@ -218,8 +218,8 @@ with unpack support written by .An Xin LI Aq delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer and therefore it can not represent files that is bigger than -4GB in size. This limitation also applies to +integer, therefore, it can not represent files larger than 4GB. +This limitation also applies to .Fl l option of .Nm Modified: stable/8/usr.bin/gzip/gzip.c ============================================================================== --- stable/8/usr.bin/gzip/gzip.c Mon May 10 02:07:42 2010 (r207837) +++ stable/8/usr.bin/gzip/gzip.c Mon May 10 02:07:57 2010 (r207838) @@ -43,7 +43,6 @@ __RCSID("$FreeBSD$"); * * TODO: * - use mmap where possible - * - handle some signals better (remove outfile?) * - make bzip2/compress -v/-t/-l support work as well as possible */ @@ -194,6 +193,7 @@ static int qflag; /* quiet mode */ static int rflag; /* recursive mode */ static int tflag; /* test */ static int vflag; /* verbose mode */ +static const char *remove_file = NULL; /* file to be removed upon SIGINT */ #else #define qflag 0 #define tflag 0 @@ -231,6 +231,7 @@ static void usage(void); static void display_version(void); #ifndef SMALL static void display_license(void); +static void sigint_handler(int); #endif static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); @@ -300,11 +301,10 @@ main(int argc, char **argv) #endif int ch; - /* XXX set up signals */ - #ifndef SMALL if ((gzip = getenv("GZIP")) != NULL) prepend_gzip(gzip, &argc, &argv); + signal(SIGINT, sigint_handler); #endif /* @@ -1171,6 +1171,15 @@ unlink_input(const char *file, const str return; unlink(file); } + +static void +sigint_handler(int signo __unused) +{ + + if (remove_file != NULL) + unlink(remove_file); + _exit(2); +} #endif static const suffixes_t * @@ -1257,6 +1266,9 @@ file_compress(char *file, char *outfile, fclose(stdin); return -1; } +#ifndef SMALL + remove_file = outfile; +#endif } else out = STDOUT_FILENO; @@ -1288,6 +1300,7 @@ file_compress(char *file, char *outfile, } copymodes(out, &isb, outfile); + remove_file = NULL; #endif if (close(out) == -1) maybe_warn("couldn't close output"); @@ -1424,6 +1437,9 @@ file_uncompress(char *file, char *outfil maybe_warn("can't open %s", outfile); goto lose; } +#ifndef SMALL + remove_file = outfile; +#endif } else zfd = STDOUT_FILENO; @@ -1555,11 +1571,12 @@ file_uncompress(char *file, char *outfil unlink(outfile); return -1; } - unlink_input(file, &isb); #ifndef SMALL copymodes(ofd, &isb, outfile); + remove_file = NULL; #endif close(ofd); + unlink_input(file, &isb); return size; unexpected_EOF: From owner-svn-src-all@FreeBSD.ORG Mon May 10 02:09:53 2010 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 D3AD7106566B; Mon, 10 May 2010 02:09:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C220E8FC17; Mon, 10 May 2010 02:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A29rLo013210; Mon, 10 May 2010 02:09:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A29rEZ013206; Mon, 10 May 2010 02:09:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201005100209.o4A29rEZ013206@svn.freebsd.org> From: Xin LI Date: Mon, 10 May 2010 02:09:53 +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: r207839 - stable/7/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 02:09:53 -0000 Author: delphij Date: Mon May 10 02:09:53 2010 New Revision: 207839 URL: http://svn.freebsd.org/changeset/base/207839 Log: MFC most of the recent changes to gzip(1) back to RELENG_7. Modified: stable/7/usr.bin/gzip/gzip.1 stable/7/usr.bin/gzip/gzip.c stable/7/usr.bin/gzip/unbzip2.c Directory Properties: stable/7/usr.bin/gzip/ (props changed) Modified: stable/7/usr.bin/gzip/gzip.1 ============================================================================== --- stable/7/usr.bin/gzip/gzip.1 Mon May 10 02:07:57 2010 (r207838) +++ stable/7/usr.bin/gzip/gzip.1 Mon May 10 02:09:53 2010 (r207839) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 24, 2009 +.Dd April 27, 2010 .Dt GZIP 1 .Os .Sh NAME @@ -205,18 +205,21 @@ This implementation of .Nm was ported based on the .Nx -.Nm -20090412, and first appeared in +.Nm , +and first appeared in .Fx 7.0 . .Sh AUTHORS +.An -nosplit This implementation of .Nm was written by -.An Matthew R. Green Aq mrg@eterna.com.au . +.An Matthew R. Green Aq mrg@eterna.com.au +with unpack support written by +.An Xin LI Aq delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer and therefore it can not represent files that is bigger than -4GB in size. This limitation also applies to +integer, therefore, it can not represent files larger than 4GB. +This limitation also applies to .Fl l option of .Nm Modified: stable/7/usr.bin/gzip/gzip.c ============================================================================== --- stable/7/usr.bin/gzip/gzip.c Mon May 10 02:07:57 2010 (r207838) +++ stable/7/usr.bin/gzip/gzip.c Mon May 10 02:09:53 2010 (r207839) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $ */ +/* $NetBSD: gzip.c,v 1.97 2009/10/11 09:17:21 mrg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -43,7 +43,6 @@ __RCSID("$FreeBSD$"); * * TODO: * - use mmap where possible - * - handle some signals better (remove outfile?) * - make bzip2/compress -v/-t/-l support work as well as possible */ @@ -149,8 +148,9 @@ static suffixes_t suffixes[] = { #undef SUFFIX }; #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) +#define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20090621"; +static const char gzip_version[] = "FreeBSD gzip 20100407"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -193,6 +193,7 @@ static int qflag; /* quiet mode */ static int rflag; /* recursive mode */ static int tflag; /* test */ static int vflag; /* verbose mode */ +static const char *remove_file = NULL; /* file to be removed upon SIGINT */ #else #define qflag 0 #define tflag 0 @@ -204,7 +205,7 @@ static char *infile; /* name of file co static void maybe_err(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); -#ifndef NO_BZIP2_SUPPORT +#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) static void maybe_errx(const char *fmt, ...) __dead2 __attribute__((__format__(__printf__, 1, 2))); #endif @@ -230,6 +231,7 @@ static void usage(void); static void display_version(void); #ifndef SMALL static void display_license(void); +static void sigint_handler(int); #endif static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); @@ -299,11 +301,10 @@ main(int argc, char **argv) #endif int ch; - /* XXX set up signals */ - #ifndef SMALL if ((gzip = getenv("GZIP")) != NULL) prepend_gzip(gzip, &argc, &argv); + signal(SIGINT, sigint_handler); #endif /* @@ -372,6 +373,8 @@ main(int argc, char **argv) case 'S': len = strlen(optarg); if (len != 0) { + if (len > SUFFIX_MAXLEN) + errx(1, "incorrect suffix: '%s': too long", optarg); suffixes[0].zipped = optarg; suffixes[0].ziplen = len; } else { @@ -457,7 +460,7 @@ maybe_err(const char *fmt, ...) exit(2); } -#ifndef NO_BZIP2_SUPPORT +#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) /* ... without an errno. */ void maybe_errx(const char *fmt, ...) @@ -1168,6 +1171,15 @@ unlink_input(const char *file, const str return; unlink(file); } + +static void +sigint_handler(int signo __unused) +{ + + if (remove_file != NULL) + unlink(remove_file); + _exit(2); +} #endif static const suffixes_t * @@ -1236,7 +1248,7 @@ file_compress(char *file, char *outfile, /* Add (usually) .gz to filename */ if ((size_t)snprintf(outfile, outsize, "%s%s", file, suffixes[0].zipped) >= outsize) - memcpy(outfile - suffixes[0].ziplen - 1, + memcpy(outfile + outsize - suffixes[0].ziplen - 1, suffixes[0].zipped, suffixes[0].ziplen + 1); #ifndef SMALL @@ -1254,6 +1266,9 @@ file_compress(char *file, char *outfile, fclose(stdin); return -1; } +#ifndef SMALL + remove_file = outfile; +#endif } else out = STDOUT_FILENO; @@ -1285,6 +1300,7 @@ file_compress(char *file, char *outfile, } copymodes(out, &isb, outfile); + remove_file = NULL; #endif if (close(out) == -1) maybe_warn("couldn't close output"); @@ -1315,6 +1331,7 @@ file_uncompress(char *file, char *outfil enum filetype method; int fd, ofd, zfd = -1; #ifndef SMALL + ssize_t rv; time_t timestamp = 0; unsigned char name[PATH_MAX + 1]; #endif @@ -1360,7 +1377,6 @@ file_uncompress(char *file, char *outfil #ifndef SMALL if (method == FT_GZIP && Nflag) { unsigned char ts[4]; /* timestamp */ - ssize_t rv; rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP); if (rv >= 0 && rv < (ssize_t)(sizeof ts)) @@ -1421,6 +1437,9 @@ file_uncompress(char *file, char *outfil maybe_warn("can't open %s", outfile); goto lose; } +#ifndef SMALL + remove_file = outfile; +#endif } else zfd = STDOUT_FILENO; @@ -1552,11 +1571,12 @@ file_uncompress(char *file, char *outfil unlink(outfile); return -1; } - unlink_input(file, &isb); #ifndef SMALL copymodes(ofd, &isb, outfile); + remove_file = NULL; #endif close(ofd); + unlink_input(file, &isb); return size; unexpected_EOF: @@ -2050,7 +2070,7 @@ static void display_license(void) { - fprintf(stderr, "%s (based on NetBSD gzip 20060927)\n", gzip_version); + fprintf(stderr, "%s (based on NetBSD gzip 20091011)\n", gzip_version); fprintf(stderr, "%s\n", gzip_copyright); exit(0); } @@ -2096,4 +2116,3 @@ read_retry(int fd, void *buf, size_t sz) return sz - left; } - Modified: stable/7/usr.bin/gzip/unbzip2.c ============================================================================== --- stable/7/usr.bin/gzip/unbzip2.c Mon May 10 02:07:57 2010 (r207838) +++ stable/7/usr.bin/gzip/unbzip2.c Mon May 10 02:09:53 2010 (r207839) @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $ */ +/* $NetBSD: unbzip2.c,v 1.13 2009/12/05 03:23:37 mrg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. From owner-svn-src-all@FreeBSD.ORG Mon May 10 06:59:50 2010 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 7D0081065674; Mon, 10 May 2010 06:59:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 68DC58FC1F; Mon, 10 May 2010 06:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A6xoqa076716; Mon, 10 May 2010 06:59:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A6xoAt076701; Mon, 10 May 2010 06:59:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005100659.o4A6xoAt076701@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 May 2010 06:59: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: r207842 - in head: contrib/xz etc/mtree lib lib/liblzma share/mk sys/sys usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 06:59:50 -0000 Author: mm Date: Mon May 10 06:59:50 2010 New Revision: 207842 URL: http://svn.freebsd.org/changeset/base/207842 Log: Import of liblzma, xz, xzdec, lzmainfo from vendor branch Add support for xz and lzma to lesspipe.sh (xzless, lzless) Bump __FreeBSD_version Approved by: delphij (mentor) MFC after: 2 weeks Added: head/contrib/xz/ - copied from r207829, vendor/xz/dist/ head/contrib/xz/FREEBSD-Xlist (contents, props changed) head/contrib/xz/FREEBSD-upgrade (contents, props changed) head/lib/liblzma/ head/lib/liblzma/Makefile (contents, props changed) head/lib/liblzma/config.h (contents, props changed) head/usr.bin/lzmainfo/ head/usr.bin/lzmainfo/Makefile (contents, props changed) head/usr.bin/xz/ head/usr.bin/xz/Makefile (contents, props changed) head/usr.bin/xzdec/ head/usr.bin/xzdec/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/lib/Makefile head/share/mk/bsd.libnames.mk head/sys/sys/param.h head/usr.bin/Makefile head/usr.bin/less/Makefile head/usr.bin/less/lesspipe.sh Added: head/contrib/xz/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/xz/FREEBSD-Xlist Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,37 @@ +$FreeBSD$ +*/*/*/Makefile.* +*/*/Makefile.* +*/.gitignore +*/Makefile.* +.git +.gitignore +ABOUT-NLS +COPYING.GPLv2 +COPYING.GPLv3 +COPYING.LGPLv2.1 +Doxyfile.in +INSTALL +INSTALL.generic +Makefile +Makefile.* +NEWS +PACKAGERS +aclocal.m4 +autogen.sh +build-aux/ +config.h.in +configure +configure.ac +debug/ +doc/ +dos/ +extra/ +lib/ +m4/ +makefile.am +src/*/*.rc +src/liblzma/liblzma.pc.in +src/scripts/ +tests/ +version.sh +windows/ Added: head/contrib/xz/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/xz/FREEBSD-upgrade Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,28 @@ +$FreeBSD$ + +xz + +The source code is pulled with git: + + git clone git://ctrl.tukaani.org/xz.git xz + +ChangeLog is generated with: + + git log > ChangeLog + +For the import files and directories were pruned by: + +sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' + +You may check if there are any new files that we don't need. + +The instructions for importing new release and merging to HEAD can be found +at FreeBSD wiki: + + http://wiki.freebsd.org/SubversionPrimer/VendorImports + +To make local changes to xz, simply patch and commit to the trunk +branch (aka HEAD). Never make local changes on the vendor branch. + +mm@FreeBSD.org +10-May-2010 Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Mon May 10 06:59:07 2010 (r207841) +++ head/etc/mtree/BSD.include.dist Mon May 10 06:59:50 2010 (r207842) @@ -207,6 +207,8 @@ .. lwres .. + lzma + .. machine pc .. Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon May 10 06:59:07 2010 (r207841) +++ head/lib/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -76,6 +76,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libipx} \ libjail \ libkiconv \ + liblzma \ libmagic \ libmemstat \ ${_libmilter} \ Added: head/lib/liblzma/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/liblzma/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,135 @@ +# $FreeBSD$ + +LIB= lzma +SHLIB_MAJOR= 0 +LZMADIR= ${.CURDIR}/../../contrib/xz/src/liblzma + +.PATH: ${LZMADIR}/../common +SRCS+= tuklib_physmem.c + +.PATH: ${LZMADIR}/api/lzma + +MAININCS= ../lzma.h +MAININCSDIR= ${INCLUDEDIR} + +LZMAINCS+= base.h \ + bcj.h \ + block.h \ + check.h \ + container.h \ + delta.h \ + filter.h \ + index_hash.h \ + lzma.h \ + stream_flags.h \ + subblock.h \ + version.h \ + vli.h + +LZMAINCSDIR= ${INCLUDEDIR}/lzma + +INCSGROUPS= MAININCS LZMAINCS + +.PATH: ${LZMADIR}/common +SRCS+= common.c \ + block_util.c \ + easy_preset.c \ + filter_common.c \ + hardware_physmem.c \ + index.c \ + stream_flags_common.c \ + vli_size.c \ + alone_encoder.c \ + block_buffer_encoder.c \ + block_encoder.c \ + block_header_encoder.c \ + easy_buffer_encoder.c \ + easy_encoder.c \ + easy_encoder_memusage.c \ + filter_buffer_encoder.c \ + filter_encoder.c \ + filter_flags_encoder.c \ + index_encoder.c \ + stream_buffer_encoder.c \ + stream_encoder.c \ + stream_flags_encoder.c \ + vli_encoder.c \ + alone_decoder.c \ + auto_decoder.c \ + block_buffer_decoder.c \ + block_decoder.c \ + block_header_decoder.c \ + easy_decoder_memusage.c \ + filter_buffer_decoder.c \ + filter_decoder.c \ + filter_flags_decoder.c \ + index_decoder.c \ + index_hash.c \ + stream_buffer_decoder.c \ + stream_decoder.c \ + stream_flags_decoder.c \ + vli_decoder.c + +.PATH: ${LZMADIR}/check +SRCS+= check.c \ + crc32_table.c \ + crc64_table.c \ + sha256.c +.if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386" +SRCS+= crc32_x86.S \ + crc64_x86.S +.else +SRCS+= crc32_fast.c \ + crc64_fast.c +.endif + +.PATH: ${LZMADIR}/lz +SRCS+= lz_encoder.c \ + lz_encoder_mf.c \ + lz_decoder.c + +.PATH: ${LZMADIR}/lzma +SRCS+= lzma_encoder.c \ + lzma_encoder_presets.c \ + lzma_encoder_optimum_fast.c \ + lzma_encoder_optimum_normal.c \ + fastpos_table.c \ + lzma_decoder.c \ + lzma2_encoder.c \ + lzma2_decoder.c + +.PATH: ${LZMADIR}/rangecoder +SRCS+= price_table.c + +.PATH: ${LZMADIR}/delta +SRCS+= delta_common.c \ + delta_encoder.c \ + delta_decoder.c + +.PATH: ${LZMADIR}/simple +SRCS+= simple_coder.c \ + simple_encoder.c \ + simple_decoder.c \ + x86.c \ + powerpc.c \ + ia64.c \ + arm.c \ + armthumb.c \ + sparc.c + +WARNS?= 3 + +CFLAGS+= -DHAVE_CONFIG_H \ + -I${.CURDIR} \ + -I${LZMADIR}/api \ + -I${LZMADIR}/common \ + -I${LZMADIR}/check \ + -I${LZMADIR}/lz \ + -I${LZMADIR}/rangecoder \ + -I${LZMADIR}/lzma \ + -I${LZMADIR}/subblock \ + -I${LZMADIR}/delta \ + -I${LZMADIR}/simple \ + -I${LZMADIR}/../common + +.include Added: head/lib/liblzma/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/liblzma/config.h Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,95 @@ +// $FreeBSD$ +#define ASSUME_RAM 128 +#define HAVE_CHECK_CRC32 1 +#define HAVE_CHECK_CRC64 1 +#define HAVE_CHECK_SHA256 1 +#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0 +#define HAVE_DECODER 1 +#define HAVE_DECODER_ARM 1 +#define HAVE_DECODER_ARMTHUMB 1 +#define HAVE_DECODER_DELTA 1 +#define HAVE_DECODER_IA64 1 +#define HAVE_DECODER_LZMA1 1 +#define HAVE_DECODER_LZMA2 1 +#define HAVE_DECODER_POWERPC 1 +#define HAVE_DECODER_SPARC 1 +#define HAVE_DECODER_X86 1 +#define HAVE_DLFCN_H 1 +#define HAVE_ENCODER 1 +#define HAVE_ENCODER_ARM 1 +#define HAVE_ENCODER_ARMTHUMB 1 +#define HAVE_ENCODER_DELTA 1 +#define HAVE_ENCODER_IA64 1 +#define HAVE_ENCODER_LZMA1 1 +#define HAVE_ENCODER_LZMA2 1 +#define HAVE_ENCODER_POWERPC 1 +#define HAVE_ENCODER_SPARC 1 +#define HAVE_ENCODER_X86 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FUTIMES 1 +#define HAVE_GETOPT_H 1 +#define HAVE_GETOPT_LONG 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MF_BT2 1 +#define HAVE_MF_BT3 1 +#define HAVE_MF_BT4 1 +#define HAVE_MF_HC3 1 +#define HAVE_MF_HC4 1 +#define HAVE_OPTRESET 1 +#define HAVE_PTHREAD 1 +#define HAVE_STDBOOL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 +#define HAVE_SYS_ENDIAN_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UINTPTR_T 1 +#define HAVE_UNISTD_H 1 +#define HAVE_VISIBILITY 1 +#define HAVE__BOOL 1 +#define LT_OBJDIR ".libs/" +#define NDEBUG 1 +#define PACKAGE "xz" +#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org" +#define PACKAGE_NAME "XZ Utils" +#define PACKAGE_STRING "XZ Utils 4.999.9beta" +#define PACKAGE_TARNAME "xz" +#define PACKAGE_URL "http://tukaani.org/xz/" +#define PACKAGE_VERSION "4.999.9beta" +#define SIZEOF_SIZE_T 8 +#define STDC_HEADERS 1 +#define TUKLIB_CPUCORES_SYSCONF 1 +#define TUKLIB_FAST_UNALIGNED_ACCESS 1 +#define TUKLIB_PHYSMEM_SYSCONF 1 +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif +#define VERSION "4.999.9beta" +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon May 10 06:59:07 2010 (r207841) +++ head/share/mk/bsd.libnames.mk Mon May 10 06:59:50 2010 (r207842) @@ -82,6 +82,7 @@ LIBLN?= "don't use LIBLN, use LIBL" .if ${MK_BIND} != "no" LIBLWRES?= ${DESTDIR}${LIBDIR}/liblwres.a .endif +LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR}/libm.a LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 10 06:59:07 2010 (r207841) +++ head/sys/sys/param.h Mon May 10 06:59:50 2010 (r207842) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900011 /* Master, propagated to newvers */ +#define __FreeBSD_version 900012 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon May 10 06:59:07 2010 (r207841) +++ head/usr.bin/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -116,6 +116,7 @@ SUBDIR= alias \ look \ lorder \ lsvfs \ + lzmainfo \ m4 \ ${_mail} \ ${_make} \ @@ -233,6 +234,8 @@ SUBDIR= alias \ xinstall \ ${_xlint} \ ${_xstr} \ + xz \ + xzdec \ ${_yacc} \ yes \ ${_ypcat} \ Modified: head/usr.bin/less/Makefile ============================================================================== --- head/usr.bin/less/Makefile Mon May 10 06:59:07 2010 (r207841) +++ head/usr.bin/less/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -11,7 +11,9 @@ SCRIPTSNAME_lesspipe.sh=lesspipe.sh DPADD= ${LIBTERMCAP} LDADD= -ltermcap LINKS= ${BINDIR}/less ${BINDIR}/more \ - ${BINDIR}/zless ${BINDIR}/bzless + ${BINDIR}/zless ${BINDIR}/bzless \ + ${BINDIR}/zless ${BINDIR}/xzless \ + ${BINDIR}/zless ${BINDIR}/lzless MLINKS= less.1 more.1 CLEANFILES= less.1 Modified: head/usr.bin/less/lesspipe.sh ============================================================================== --- head/usr.bin/less/lesspipe.sh Mon May 10 06:59:07 2010 (r207841) +++ head/usr.bin/less/lesspipe.sh Mon May 10 06:59:50 2010 (r207842) @@ -13,4 +13,10 @@ case "$1" in *.bz2) exec bzip2 -d -c "$1" 2>/dev/null ;; + *.xz) + exec xz -d -c "$1" 2>/dev/null + ;; + *.lzma) + exec lzma -d -c "$1" 2>/dev/null + ;; esac Added: head/usr.bin/lzmainfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/lzmainfo/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +PROG= lzmainfo + +XZDIR= ${.CURDIR}/../../contrib/xz/src +LZMALIBDIR= ${.CURDIR}/../../lib/liblzma + +.PATH: ${XZDIR}/lzmainfo +SRCS+= lzmainfo.c + +.PATH: ${XZDIR}/common +SRCS+= tuklib_progname.c \ + tuklib_exit.c + +WARNS?= 3 + +CFLAGS+= -DHAVE_CONFIG_H \ + -I${LZMALIBDIR} \ + -I${XZDIR}/common \ + -I${XZDIR}/liblzma/api + +DPADD= ${LIBLZMA} +LDADD= -llzma + +.include Added: head/usr.bin/xz/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xz/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,47 @@ +# $FreeBSD$ + +PROG= xz + +LINKS= ${BINDIR}/xz ${BINDIR}/unxz +LINKS+= ${BINDIR}/xz ${BINDIR}/lzma +LINKS+= ${BINDIR}/xz ${BINDIR}/unlzma +LINKS+= ${BINDIR}/xz ${BINDIR}/xzcat +LINKS+= ${BINDIR}/xz ${BINDIR}/lzcat + +MLINKS= xz.1 unxz.1 xz.1 lzma.1 xz.1 unlzma.1 xz.1 xzcat.1 xz.1 lzcat.1 + +XZDIR= ${.CURDIR}/../../contrib/xz/src +LZMALIBDIR= ${.CURDIR}/../../lib/liblzma + +.PATH: ${XZDIR}/xz + +SRCS= args.c \ + coder.c \ + file_io.c \ + hardware.c \ + list.c \ + main.c \ + message.c \ + options.c \ + signals.c \ + suffix.c \ + util.c + +.PATH: ${XZDIR}/common + +SRCS+= tuklib_open_stdxxx.c \ + tuklib_progname.c \ + tuklib_exit.c \ + tuklib_cpucores.c + +WARNS?= 3 + +CFLAGS+= -DHAVE_CONFIG_H \ + -I${LZMALIBDIR} \ + -I${XZDIR}/common \ + -I${XZDIR}/liblzma/api + +DPADD= ${LIBLZMA} +LDADD= -llzma + +.include Added: head/usr.bin/xzdec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/xzdec/Makefile Mon May 10 06:59:50 2010 (r207842) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +PROG= xzdec + +LINKS= ${BINDIR}/xzdec ${BINDIR}/lzdec + +MLINKS= xzdec.1 lzmadec.1 + +XZDIR= ${.CURDIR}/../../contrib/xz/src +LZMALIBDIR= ${.CURDIR}/../../lib/liblzma + +.PATH: ${XZDIR}/xzdec + +SRCS= xzdec.c + +.PATH: ${XZDIR}/common + +SRCS+= tuklib_progname.c \ + tuklib_exit.c + +WARNS?= 3 + +CFLAGS+= -DHAVE_CONFIG_H \ + -I${LZMALIBDIR} \ + -I${XZDIR}/common \ + -I${XZDIR}/liblzma/api + +DPADD= ${LIBLZMA} +LDADD= -llzma + +.include From owner-svn-src-all@FreeBSD.ORG Mon May 10 07:47:32 2010 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 236AA106566C; Mon, 10 May 2010 07:47:32 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 11C8F8FC18; Mon, 10 May 2010 07:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4A7lVJn087170; Mon, 10 May 2010 07:47:31 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4A7lVQb087165; Mon, 10 May 2010 07:47:31 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005100747.o4A7lVQb087165@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 May 2010 07:47: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: r207844 - in head: lib/liblzma usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 07:47:32 -0000 Author: mm Date: Mon May 10 07:47:31 2010 New Revision: 207844 URL: http://svn.freebsd.org/changeset/base/207844 Log: Add two public headers missing in r207842 Adjust CFLAGS for lzmainfo, xz, xzdec Approved by: delphij (mentor) MFC after: 2 weeks Modified: head/lib/liblzma/Makefile head/usr.bin/lzmainfo/Makefile head/usr.bin/xz/Makefile head/usr.bin/xzdec/Makefile Modified: head/lib/liblzma/Makefile ============================================================================== --- head/lib/liblzma/Makefile Mon May 10 07:01:52 2010 (r207843) +++ head/lib/liblzma/Makefile Mon May 10 07:47:31 2010 (r207844) @@ -19,6 +19,8 @@ LZMAINCS+= base.h \ container.h \ delta.h \ filter.h \ + hardware.h \ + index.h \ index_hash.h \ lzma.h \ stream_flags.h \ Modified: head/usr.bin/lzmainfo/Makefile ============================================================================== --- head/usr.bin/lzmainfo/Makefile Mon May 10 07:01:52 2010 (r207843) +++ head/usr.bin/lzmainfo/Makefile Mon May 10 07:47:31 2010 (r207844) @@ -16,8 +16,7 @@ WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H \ -I${LZMALIBDIR} \ - -I${XZDIR}/common \ - -I${XZDIR}/liblzma/api + -I${XZDIR}/common DPADD= ${LIBLZMA} LDADD= -llzma Modified: head/usr.bin/xz/Makefile ============================================================================== --- head/usr.bin/xz/Makefile Mon May 10 07:01:52 2010 (r207843) +++ head/usr.bin/xz/Makefile Mon May 10 07:47:31 2010 (r207844) @@ -38,8 +38,7 @@ WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H \ -I${LZMALIBDIR} \ - -I${XZDIR}/common \ - -I${XZDIR}/liblzma/api + -I${XZDIR}/common DPADD= ${LIBLZMA} LDADD= -llzma Modified: head/usr.bin/xzdec/Makefile ============================================================================== --- head/usr.bin/xzdec/Makefile Mon May 10 07:01:52 2010 (r207843) +++ head/usr.bin/xzdec/Makefile Mon May 10 07:47:31 2010 (r207844) @@ -22,8 +22,7 @@ WARNS?= 3 CFLAGS+= -DHAVE_CONFIG_H \ -I${LZMALIBDIR} \ - -I${XZDIR}/common \ - -I${XZDIR}/liblzma/api + -I${XZDIR}/common DPADD= ${LIBLZMA} LDADD= -llzma From owner-svn-src-all@FreeBSD.ORG Mon May 10 11:50:26 2010 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 8D5D81065675; Mon, 10 May 2010 11:50:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6458FC1E; Mon, 10 May 2010 11:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ABoQBF043067; Mon, 10 May 2010 11:50:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ABoQoZ043065; Mon, 10 May 2010 11:50:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005101150.o4ABoQoZ043065@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 May 2010 11:50:26 +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: r207845 - stable/8/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: Mon, 10 May 2010 11:50:26 -0000 Author: kib Date: Mon May 10 11:50:26 2010 New Revision: 207845 URL: http://svn.freebsd.org/changeset/base/207845 Log: MFC r207580: Handle busy status of the page in a way expected for pager_getpage(). Flush requested page, unbusy other pages, do not clear m->busy. Modified: stable/8/sys/vm/phys_pager.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/vm/phys_pager.c ============================================================================== --- stable/8/sys/vm/phys_pager.c Mon May 10 07:47:31 2010 (r207844) +++ stable/8/sys/vm/phys_pager.c Mon May 10 11:50:26 2010 (r207845) @@ -152,10 +152,10 @@ phys_pager_getpages(vm_object_t object, KASSERT(m[i]->dirty == 0, ("phys_pager_getpages: dirty page %p", m[i])); /* The requested page must remain busy, the others not. */ - if (reqpage != i) { - m[i]->oflags &= ~VPO_BUSY; - m[i]->busy = 0; - } + if (i == reqpage) + vm_page_flash(m[i]); + else + vm_page_wakeup(m[i]); } return (VM_PAGER_OK); } From owner-svn-src-all@FreeBSD.ORG Mon May 10 11:53:40 2010 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 C050D106566B; Mon, 10 May 2010 11:53:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B02FF8FC1B; Mon, 10 May 2010 11:53:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ABre1R043977; Mon, 10 May 2010 11:53:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ABregP043975; Mon, 10 May 2010 11:53:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005101153.o4ABregP043975@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 May 2010 11:53: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: r207846 - 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: Mon, 10 May 2010 11:53:40 -0000 Author: kib Date: Mon May 10 11:53:40 2010 New Revision: 207846 URL: http://svn.freebsd.org/changeset/base/207846 Log: Continue cleaning the queue instead of moving to the next queue or bailing out if acquisition of page lock caused page position in the queue to change. Pointed out by: alc Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Mon May 10 11:50:26 2010 (r207845) +++ head/sys/vm/vm_contig.c Mon May 10 11:53:40 2010 (r207846) @@ -168,10 +168,8 @@ vm_contig_launder(int queue) if ((m->flags & PG_MARKER) != 0) continue; - if (!vm_pageout_page_lock(m, &next)) { - vm_page_unlock(m); - return (FALSE); - } + if (!vm_pageout_page_lock(m, &next)) + continue; KASSERT(VM_PAGE_INQUEUE2(m, queue), ("vm_contig_launder: page %p's queue is not %d", m, queue)); error = vm_contig_launder_page(m, &next); From owner-svn-src-all@FreeBSD.ORG Mon May 10 14:15:18 2010 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 67A2F106566C; Mon, 10 May 2010 14:15:18 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170]) by mx1.freebsd.org (Postfix) with ESMTP id 25A728FC0C; Mon, 10 May 2010 14:15:17 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 1F5FE2A28CF3; Mon, 10 May 2010 16:15:17 +0200 (CEST) Date: Mon, 10 May 2010 16:15:17 +0200 From: Ed Schouten To: Martin Matuska Message-ID: <20100510141517.GS56080@hoeg.nl> References: <201005100659.o4A6xoAt076701@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UHIpmL4a+UjiyldO" Content-Disposition: inline In-Reply-To: <201005100659.o4A6xoAt076701@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r207842 - in head: contrib/xz etc/mtree lib lib/liblzma share/mk sys/sys usr.bin usr.bin/less usr.bin/lzmainfo usr.bin/xz usr.bin/xzdec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 14:15:18 -0000 --UHIpmL4a+UjiyldO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Martin Matuska wrote: > Author: mm > Date: Mon May 10 06:59:50 2010 > New Revision: 207842 > URL: http://svn.freebsd.org/changeset/base/207842 >=20 > Log: > Import of liblzma, xz, xzdec, lzmainfo from vendor branch > Add support for xz and lzma to lesspipe.sh (xzless, lzless) > Bump __FreeBSD_version > =20 > Approved by: delphij (mentor) > MFC after: 2 weeks Woohoo! --=20 Ed Schouten WWW: http://80386.nl/ --UHIpmL4a+UjiyldO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvoFPUACgkQ52SDGA2eCwWa5gCfWMkYEsYQTwOLU5nL8HB4DAzN fmQAn1RK0p4PjkcI+4VdBm6Qk8nhWLm6 =buk8 -----END PGP SIGNATURE----- --UHIpmL4a+UjiyldO-- From owner-svn-src-all@FreeBSD.ORG Mon May 10 15:18:04 2010 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 131671065674; Mon, 10 May 2010 15:18:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 02A788FC19; Mon, 10 May 2010 15:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AFI3cA089509; Mon, 10 May 2010 15:18:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AFI3MP089507; Mon, 10 May 2010 15:18:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005101518.o4AFI3MP089507@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 May 2010 15:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207847 - head/sys/fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 15:18:04 -0000 Author: kib Date: Mon May 10 15:18:03 2010 New Revision: 207847 URL: http://svn.freebsd.org/changeset/base/207847 Log: For detach procfs ctl command, also clear P_STOPPED_TRACE process stop flag, and for each thread, TDB_SUSPEND debug flag, same as it is done by exit1() for orphaned debugee. Approved by: des (procfs maintainer) MFC after: 1 week Modified: head/sys/fs/procfs/procfs_ctl.c Modified: head/sys/fs/procfs/procfs_ctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ctl.c Mon May 10 11:53:40 2010 (r207846) +++ head/sys/fs/procfs/procfs_ctl.c Mon May 10 15:18:03 2010 (r207847) @@ -110,6 +110,7 @@ static int procfs_control(struct thread *td, struct proc *p, int op) { int error = 0; + struct thread *temp; /* * Attach - attaches the target process for debugging @@ -212,10 +213,12 @@ out: } /* not being traced any more */ - p->p_flag &= ~P_TRACED; + p->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); /* remove pending SIGTRAP, else the process will die */ sigqueue_delete_proc(p, SIGTRAP); + FOREACH_THREAD_IN_PROC(p, temp) + temp->td_dbgflags &= ~TDB_SUSPEND; PROC_UNLOCK(p); /* give process back to original parent */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 15:19:13 2010 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 02DC6106566B; Mon, 10 May 2010 15:19:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E6B048FC19; Mon, 10 May 2010 15:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AFJCAD089806; Mon, 10 May 2010 15:19:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AFJCeQ089804; Mon, 10 May 2010 15:19:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005101519.o4AFJCeQ089804@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 May 2010 15:19: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: r207848 - head/sys/fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 15:19:13 -0000 Author: kib Date: Mon May 10 15:19:12 2010 New Revision: 207848 URL: http://svn.freebsd.org/changeset/base/207848 Log: The thread_unsuspend() requires both process mutex and process spinlock locked. Postpone the process unlock till the thread_unsuspend() is called. Approved by: des (procfs maintainer) MFC after: 1 week Modified: head/sys/fs/procfs/procfs_ctl.c Modified: head/sys/fs/procfs/procfs_ctl.c ============================================================================== --- head/sys/fs/procfs/procfs_ctl.c Mon May 10 15:18:03 2010 (r207847) +++ head/sys/fs/procfs/procfs_ctl.c Mon May 10 15:19:12 2010 (r207848) @@ -236,7 +236,6 @@ out: PROC_LOCK(p); p->p_oppid = 0; p->p_flag &= ~P_WAITED; /* XXX ? */ - PROC_UNLOCK(p); sx_xunlock(&proctree_lock); wakeup(td->td_proc); /* XXX for CTL_WAIT below ? */ @@ -249,9 +248,10 @@ out: */ case PROCFS_CTL_STEP: error = proc_sstep(FIRST_THREAD_IN_PROC(p)); - PROC_UNLOCK(p); - if (error) + if (error) { + PROC_UNLOCK(p); return (error); + } break; /* @@ -260,7 +260,6 @@ out: */ case PROCFS_CTL_RUN: p->p_flag &= ~P_STOPPED_SIG; /* this uses SIGSTOP */ - PROC_UNLOCK(p); break; /* @@ -292,6 +291,7 @@ out: PROC_SLOCK(p); thread_unsuspend(p); /* If it can run, let it do so. */ PROC_SUNLOCK(p); + PROC_UNLOCK(p); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon May 10 15:28:45 2010 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 428DB106564A; Mon, 10 May 2010 15:28:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 304E78FC0C; Mon, 10 May 2010 15:28:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AFSjY3091922; Mon, 10 May 2010 15:28:45 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AFSiMx091913; Mon, 10 May 2010 15:28:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201005101528.o4AFSiMx091913@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 May 2010 15:28: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: r207849 - in head: . lib/libarchive rescue/rescue usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 15:28:45 -0000 Author: mm Date: Mon May 10 15:28:44 2010 New Revision: 207849 URL: http://svn.freebsd.org/changeset/base/207849 Log: Enable liblzma support in libarchive Adjust dependencies for programs using libarchive Add xz and linkage against liblzma to rescue system Approved by: kientzle, delphij (mentor) MFC after: 2 weeks Modified: head/Makefile.inc1 head/lib/libarchive/Makefile head/rescue/rescue/Makefile head/usr.bin/ar/Makefile head/usr.bin/cpio/Makefile head/usr.bin/cpio/test/Makefile head/usr.bin/tar/Makefile head/usr.bin/tar/test/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 10 15:19:12 2010 (r207848) +++ head/Makefile.inc1 Mon May 10 15:28:44 2010 (r207849) @@ -1113,7 +1113,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libbz2 lib/libcom_err lib/libcrypt \ lib/libexpat lib/libfetch \ ${_lib_libgssapi} ${_lib_libipx} \ - lib/libkiconv lib/libkvm lib/libmd \ + lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/lib/libarchive/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -2,8 +2,8 @@ .include LIB= archive -DPADD= ${LIBBZ2} ${LIBZ} ${LIBMD} -LDADD= -lbz2 -lz -lmd +DPADD= ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} +LDADD= -lbz2 -lz -lmd -llzma # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. @@ -11,10 +11,7 @@ SHLIB_MAJOR= 5 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.OBJDIR} -#Uncomment to build with full lzma/xz support via liblzma -#liblzma is not (yet?) part of the FreeBSD base system -#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -#LDADD+= -L/usr/local/lib -llzma +CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/rescue/rescue/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -208,6 +208,10 @@ CRUNCH_PROGS_usr.bin+= bzip2 CRUNCH_ALIAS_bzip2= bunzip2 bzcat CRUNCH_LIBS+= -lbz2 +CRUNCH_PROGS_usr.bin+= xz +CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat +CRUNCH_LIBS+= -llzma + CRUNCH_PROGS_usr.bin+= tar CRUNCH_LIBS+= -larchive -lmd .if ${MK_OPENSSL} != "no" Modified: head/usr.bin/ar/Makefile ============================================================================== --- head/usr.bin/ar/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/usr.bin/ar/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -3,8 +3,8 @@ PROG= ar SRCS= ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBELF} -LDADD= -larchive -lbz2 -lz -lelf +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} ${LIBELF} +LDADD= -larchive -lbz2 -lz -llzma -lelf CFLAGS+=-I. -I${.CURDIR} Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/usr.bin/cpio/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -12,8 +12,8 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"config_fr # statically linked, cannot use -lcrypto, and are size sensitive. CFLAGS+= -DSMALLER .endif -DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} -LDADD= -larchive -lz -lbz2 -lmd +DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} ${LIBLZMA} +LDADD= -larchive -lz -lbz2 -lmd -llzma .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: head/usr.bin/cpio/test/Makefile ============================================================================== --- head/usr.bin/cpio/test/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/usr.bin/cpio/test/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -42,10 +42,10 @@ CLEANFILES+= list.h bsdcpio_test NO_MAN=yes PROG=bsdcpio_test -DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} +DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I.. -LDADD= -larchive -lz -lbz2 +LDADD= -larchive -lz -lbz2 -llzma CFLAGS+= -static -g -O2 -Wall CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${CPIO_SRCDIR} Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/usr.bin/tar/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -15,8 +15,8 @@ SRCS= bsdtar.c \ tree.c \ util.c \ write.c -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} -LDADD= -larchive -lbz2 -lz -lmd +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} +LDADD= -larchive -lbz2 -lz -lmd -llzma .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: head/usr.bin/tar/test/Makefile ============================================================================== --- head/usr.bin/tar/test/Makefile Mon May 10 15:19:12 2010 (r207848) +++ head/usr.bin/tar/test/Makefile Mon May 10 15:28:44 2010 (r207849) @@ -34,10 +34,10 @@ CLEANFILES+= list.h NO_MAN=yes PROG=bsdtar_test -DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} +DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I.. -LDADD= -larchive -lz -lbz2 +LDADD= -larchive -lz -lbz2 -llzma CFLAGS+= -static -g -O2 -Wall CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${TAR_SRCDIR} From owner-svn-src-all@FreeBSD.ORG Mon May 10 17:14:15 2010 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 4F97B106566C; Mon, 10 May 2010 17:14:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1548FC18; Mon, 10 May 2010 17:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AHEFns015082; Mon, 10 May 2010 17:14:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AHEFuu015079; Mon, 10 May 2010 17:14:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101714.o4AHEFuu015079@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 17:14: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: r207851 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 17:14:15 -0000 Author: yongari Date: Mon May 10 17:14:14 2010 New Revision: 207851 URL: http://svn.freebsd.org/changeset/base/207851 Log: Implement TSO and TSO over VLAN. Increase number of allowed fragmentation of mbuf chain to 32 from 16 because TSO can send 64KB sized packet which in turn requires long list of mbuf chain. Due to lack of documentation, I'm not sure whether driver have to pull up ethernet/IP/TCP header with options to make controller work but driver have to parse TCP header to update pseudo TCP checksum anyway. The controller expects pseudo TCP checksum computed by upper stack and the checksum should follow the MS NDIS specification to make TSO work. Tested by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c head/sys/dev/sge/if_sgereg.h Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Mon May 10 16:35:13 2010 (r207850) +++ head/sys/dev/sge/if_sge.c Mon May 10 17:14:14 2010 (r207851) @@ -72,8 +72,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include + #include -#include +#include #include #include @@ -620,8 +625,8 @@ sge_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = SGE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); - ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM; - ifp->if_hwassist = SGE_CSUM_FEATURES; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM | IFCAP_TSO4; + ifp->if_hwassist = SGE_CSUM_FEATURES | CSUM_TSO; ifp->if_capenable = ifp->if_capabilities; /* * Do MII setup. @@ -641,7 +646,7 @@ sge_attach(device_t dev) /* VLAN setup. */ if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM; + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ @@ -851,8 +856,8 @@ sge_dma_alloc(struct sge_softc *sc) /* Create DMA tag for Tx buffers. */ error = bus_dma_tag_create(cd->sge_tag, 1, 0, BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * SGE_MAXTXSEGS, - SGE_MAXTXSEGS, MCLBYTES, 0, NULL, NULL, &cd->sge_txmbuf_tag); + BUS_SPACE_MAXADDR, NULL, NULL, SGE_TSO_MAXSIZE, SGE_MAXTXSEGS, + SGE_TSO_MAXSEGSIZE, 0, NULL, NULL, &cd->sge_txmbuf_tag); if (error != 0) { device_printf(sc->sge_dev, "could not create Tx mbuf DMA tag.\n"); @@ -1424,13 +1429,73 @@ sge_encap(struct sge_softc *sc, struct m struct sge_desc *desc; struct sge_txdesc *txd; bus_dma_segment_t txsegs[SGE_MAXTXSEGS]; - uint32_t cflags; + uint32_t cflags, mss; int error, i, nsegs, prod, si; SGE_LOCK_ASSERT(sc); si = prod = sc->sge_cdata.sge_tx_prod; txd = &sc->sge_cdata.sge_txdesc[prod]; + if (((*m_head)->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + struct ether_header *eh; + struct ip *ip; + struct tcphdr *tcp; + uint32_t ip_off, poff; + + if (M_WRITABLE(*m_head) == 0) { + /* Get a writable copy. */ + m = m_dup(*m_head, M_DONTWAIT); + m_freem(*m_head); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + ip_off = sizeof(struct ether_header); + m = m_pullup(*m_head, ip_off); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + eh = mtod(m, struct ether_header *); + /* Check the existence of VLAN tag. */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); + m = m_pullup(m, poff + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + /* + * Reset IP checksum and recompute TCP pseudo + * checksum that NDIS specification requires. + */ + ip->ip_sum = 0; + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htons(IPPROTO_TCP)); + *m_head = m; + } + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { @@ -1462,16 +1527,23 @@ sge_encap(struct sge_softc *sc, struct m m = *m_head; cflags = 0; - if (m->m_pkthdr.csum_flags & CSUM_IP) - cflags |= TDC_IP_CSUM; - if (m->m_pkthdr.csum_flags & CSUM_TCP) - cflags |= TDC_TCP_CSUM; - if (m->m_pkthdr.csum_flags & CSUM_UDP) - cflags |= TDC_UDP_CSUM; + mss = 0; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + cflags |= TDC_LS; + mss = (uint32_t)m->m_pkthdr.tso_segsz; + mss <<= 16; + } else { + if (m->m_pkthdr.csum_flags & CSUM_IP) + cflags |= TDC_IP_CSUM; + if (m->m_pkthdr.csum_flags & CSUM_TCP) + cflags |= TDC_TCP_CSUM; + if (m->m_pkthdr.csum_flags & CSUM_UDP) + cflags |= TDC_UDP_CSUM; + } for (i = 0; i < nsegs; i++) { desc = &sc->sge_ldata.sge_tx_ring[prod]; if (i == 0) { - desc->sge_sts_size = htole32(m->m_pkthdr.len); + desc->sge_sts_size = htole32(m->m_pkthdr.len | mss); desc->sge_cmdsts = 0; } else { desc->sge_sts_size = 0; @@ -1759,6 +1831,17 @@ sge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO4) != 0) { + ifp->if_capenable ^= IFCAP_TSO4; + if ((ifp->if_capenable & IFCAP_TSO4) != 0) + ifp->if_hwassist |= CSUM_TSO; + else + ifp->if_hwassist &= ~CSUM_TSO; + } + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { /* @@ -1766,6 +1849,9 @@ sge_ioctl(struct ifnet *ifp, u_long comm * tagging require interface reinitialization. */ ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= + ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); reinit = 1; } if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Mon May 10 16:35:13 2010 (r207850) +++ head/sys/dev/sge/if_sgereg.h Mon May 10 17:14:14 2010 (r207851) @@ -283,7 +283,9 @@ struct sge_desc { #define SGE_RX_RING_CNT 256 /* [8, 1024] */ #define SGE_TX_RING_CNT 256 /* [8, 8192] */ #define SGE_DESC_ALIGN 16 -#define SGE_MAXTXSEGS 16 +#define SGE_MAXTXSEGS 32 +#define SGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) +#define SGE_TSO_MAXSEGSIZE 4096 #define SGE_RX_BUF_ALIGN sizeof(uint64_t) #define SGE_RX_RING_SZ (SGE_RX_RING_CNT * sizeof(struct sge_desc)) From owner-svn-src-all@FreeBSD.ORG Mon May 10 17:35:18 2010 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 10D891065675; Mon, 10 May 2010 17:35:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E951D8FC19; Mon, 10 May 2010 17:35:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AHZHgU019691; Mon, 10 May 2010 17:35:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AHZHxB019689; Mon, 10 May 2010 17:35:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101735.o4AHZHxB019689@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 17:35: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: r207852 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 17:35:18 -0000 Author: yongari Date: Mon May 10 17:35:17 2010 New Revision: 207852 URL: http://svn.freebsd.org/changeset/base/207852 Log: SiS190 supports RX 10 bytes padding, CRC stripping as well as VLAN hardware tag insertion/stripping. Remove conditional code that disables these hardware features on SiS190. Also nuke RX fixup code which is no more required on strict-alignment architectures because SiS190 supports RX 10 bytes padding. Now all hardware features except jumbo frame and WOL are supported. Thanks to Masa Murayama who confirmed SiS190 also has the same hardware features of SiS191. I guess the only difference between SiS191 and SiS190 would be jumbo frame support. It will be implemented in near future. Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Mon May 10 17:14:14 2010 (r207851) +++ head/sys/dev/sge/if_sge.c Mon May 10 17:35:17 2010 (r207852) @@ -117,10 +117,6 @@ static void sge_miibus_statchg(device_t) static int sge_newbuf(struct sge_softc *, int); static int sge_encap(struct sge_softc *, struct mbuf **); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void - sge_fixup_rx(struct mbuf *); -#endif static __inline void sge_discard_rxbuf(struct sge_softc *, int); static void sge_rxeof(struct sge_softc *); @@ -644,10 +640,8 @@ sge_attach(device_t dev) ether_ifattach(ifp, eaddr); /* VLAN setup. */ - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; - ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTSO | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; /* Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); @@ -1129,23 +1123,6 @@ sge_newbuf(struct sge_softc *sc, int pro return (0); } -#ifndef __NO_STRICT_ALIGNMENT -static __inline void -sge_fixup_rx(struct mbuf *m) -{ - int i; - uint16_t *src, *dst; - - src = mtod(m, uint16_t *); - dst = src - 3; - - for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) - *dst++ = *src++; - - m->m_data -= (SGE_RX_BUF_ALIGN - ETHER_ALIGN); -} -#endif - static __inline void sge_discard_rxbuf(struct sge_softc *sc, int index) { @@ -1228,23 +1205,15 @@ sge_rxeof(struct sge_softc *sc) m->m_pkthdr.ether_vtag = rxinfo & RDC_VLAN_MASK; m->m_flags |= M_VLANTAG; } - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) { - /* - * Account for 10bytes auto padding which is used - * to align IP header on 32bit boundary. Also note, - * CRC bytes is automatically removed by the - * hardware. - */ - m->m_data += SGE_RX_PAD_BYTES; - m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - - SGE_RX_PAD_BYTES; - } else { - m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - - ETHER_CRC_LEN; -#ifndef __NO_STRICT_ALIGNMENT - sge_fixup_rx(m); -#endif - } + /* + * Account for 10bytes auto padding which is used + * to align IP header on 32bit boundary. Also note, + * CRC bytes is automatically removed by the + * hardware. + */ + m->m_data += SGE_RX_PAD_BYTES; + m->m_pkthdr.len = m->m_len = SGE_RX_BYTES(rxstat) - + SGE_RX_PAD_BYTES; m->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; SGE_UNLOCK(sc); @@ -1688,18 +1657,13 @@ sge_init_locked(struct sge_softc *sc) CSR_WRITE_4(sc, RxWakeOnLan, 0); CSR_WRITE_4(sc, RxWakeOnLanData, 0); /* Allow receiving VLAN frames. */ - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - CSR_WRITE_2(sc, RxMPSControl, - ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + SGE_RX_PAD_BYTES); - else - CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); + CSR_WRITE_2(sc, RxMPSControl, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + + SGE_RX_PAD_BYTES); for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); /* Configure RX MAC. */ - rxfilt = 0; - if ((sc->sge_flags & SGE_FLAG_SIS190) == 0) - rxfilt |= RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); sge_setvlan(sc); From owner-svn-src-all@FreeBSD.ORG Mon May 10 17:48:00 2010 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 74747106566B; Mon, 10 May 2010 17:48:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 63A948FC12; Mon, 10 May 2010 17:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AHm0Q2022448; Mon, 10 May 2010 17:48:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AHm0OI022446; Mon, 10 May 2010 17:48:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101748.o4AHm0OI022446@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 17:48: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: r207853 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 17:48:00 -0000 Author: yongari Date: Mon May 10 17:48:00 2010 New Revision: 207853 URL: http://svn.freebsd.org/changeset/base/207853 Log: Now sge(4) supports TCP segmentation offload (TSO). Modified: head/share/man/man4/sge.4 Modified: head/share/man/man4/sge.4 ============================================================================== --- head/share/man/man4/sge.4 Mon May 10 17:35:17 2010 (r207852) +++ head/share/man/man4/sge.4 Mon May 10 17:48:00 2010 (r207853) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2010 +.Dd May 10, 2010 .Dt SGE 4 .Os .Sh NAME @@ -54,9 +54,9 @@ controllers and SiS191 Fast/Gigabit Ethe All LOMs supported by the .Nm driver have TCP/UDP/IP checksum offload for transmit and receive, -hardware VLAN tag stripping/insertion features. -Due to lack of documentation more offloading features like TCP -segmentation offload (TSO), Wake On Lan (WOL), Jumbo frame and an +TCP segmentation offload (TSO), hardware VLAN tag stripping/insertion +features. +Due to lack of documentation Wake On Lan (WOL), Jumbo frame and an interrupt moderation mechanism are not supported yet. .Pp The From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:23:00 2010 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 89A051065670; Mon, 10 May 2010 18:23:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 793F68FC16; Mon, 10 May 2010 18:23:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIN0hS030228; Mon, 10 May 2010 18:23:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIN0Ms030226; Mon, 10 May 2010 18:23:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201005101823.o4AIN0Ms030226@svn.freebsd.org> From: Warner Losh Date: Mon, 10 May 2010 18:23: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: r207854 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 18:23:00 -0000 Author: imp Date: Mon May 10 18:23:00 2010 New Revision: 207854 URL: http://svn.freebsd.org/changeset/base/207854 Log: Formatting nit Modified: head/sys/boot/common/module.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Mon May 10 17:48:00 2010 (r207853) +++ head/sys/boot/common/module.c Mon May 10 18:23:00 2010 (r207854) @@ -295,7 +295,8 @@ file_load(char *filename, vm_offset_t de } static int -file_load_dependencies(struct preloaded_file *base_file) { +file_load_dependencies(struct preloaded_file *base_file) +{ struct file_metadata *md; struct preloaded_file *fp; struct mod_depend *verinfo; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:33:04 2010 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 A273F1065670; Mon, 10 May 2010 18:33:04 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB538FC1B; Mon, 10 May 2010 18:33:03 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id o4AIX273032583; Mon, 10 May 2010 20:33:02 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id o4AIX2YR032582; Mon, 10 May 2010 20:33:02 +0200 (CEST) (envelope-from marius) Date: Mon, 10 May 2010 20:33:02 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20100510183302.GC43981@alchemy.franken.de> References: <201004192327.o3JNRsK4047856@svn.freebsd.org> <20100509170414.GA35602@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206878 - 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, 10 May 2010 18:33:04 -0000 On Mon, May 10, 2010 at 12:27:40AM +0200, Attilio Rao wrote: > 2010/5/9 Marius Strobl : > > On Mon, Apr 19, 2010 at 11:27:54PM +0000, Attilio Rao wrote: > >> Author: attilio > >> Date: Mon Apr 19 23:27:54 2010 > >> New Revision: 206878 > >> URL: http://svn.freebsd.org/changeset/base/206878 > >> > >> Log: > >>   Fix a deadlock in the shutdown code: > >>   When performing a smp_rendezvous() or more likely, on amd64 and i386, > >>   a smp_tlb_shootdown() the caller will end up with the smp_ipi_mtx > >>   spinlock held, busy-waiting for other CPUs to acknowledge the operation. > >>   As long as CPUs are suspended (via cpu_reset()) between the active mask > >>   read and IPI sending there can be a deadlock where the caller will wait > >>   forever for a dead CPU to acknowledge the operation. > >>   Please note that on CPU0 that is going to be someway heavier because of > >>   the spinlocks being disabled earlier than quitting the machine. > >> > >>   Fix this bug by calling cpu_reset() with the smp_ipi_mtx held. > >>   Note that it is very likely that a saner offline/online CPUs mechanism > >>   will help heavilly in fixing similar cases as it is likely more bugs > >>   of this type may arise in the future. > >> > > > > This change causes a hang for me when running an SMP kernel on an > > UP machine or an MP machine with SMP disabled as in these cases > > smp_ipi_mtx isn't initialized (see mp_start()). The below patch > > fixes this for me. > > Marius, > thanks a lot for reporting this. > However, I think that a better fix is to always initialize the mutex. > Do you think the following patch is fine for you?: > http://www.freebsd.org/~attilio/smpipi_fixup.diff > Yes, this fixes it as well. Marius From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:37:47 2010 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 5003E1065675; Mon, 10 May 2010 18:37:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5BA8FC24; Mon, 10 May 2010 18:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIblbB033531; Mon, 10 May 2010 18:37:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIblmI033529; Mon, 10 May 2010 18:37:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101837.o4AIblmI033529@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 18:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207855 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:37:47 -0000 Author: yongari Date: Mon May 10 18:37:46 2010 New Revision: 207855 URL: http://svn.freebsd.org/changeset/base/207855 Log: MFC r207545,207625: r207545: Fix wrong dma tag usage. Previously it used TX descriptor ring dma tag which should be TX mbuf dma tag. r207625: Remove clearing RxHashTable2 register. The register is reprogrammed in sge_rxfilter(). Modified: stable/8/sys/dev/sge/if_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon May 10 18:23:00 2010 (r207854) +++ stable/8/sys/dev/sge/if_sge.c Mon May 10 18:37:46 2010 (r207855) @@ -1421,7 +1421,7 @@ sge_encap(struct sge_softc *sc, struct m } *m_head = m; } - error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_tx_tag, map, + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, map, *m_head, txsegs, &nsegs, 0); if (error != 0) { m_freem(*m_head); @@ -1430,10 +1430,11 @@ sge_encap(struct sge_softc *sc, struct m } /* Check descriptor overrun. */ if (sc->sge_cdata.sge_tx_cnt + nsegs >= SGE_TX_RING_CNT) { - bus_dmamap_unload(sc->sge_cdata.sge_tx_tag, map); + bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, map); return (ENOBUFS); } - bus_dmamap_sync(sc->sge_cdata.sge_tx_tag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, map, + BUS_DMASYNC_PREWRITE); cflags = 0; if ((*m_head)->m_pkthdr.csum_flags & CSUM_IP) @@ -1576,7 +1577,6 @@ sge_init_locked(struct sge_softc *sc) CSR_WRITE_4(sc, RX_DESC, SGE_ADDR_LO(sc->sge_ldata.sge_rx_paddr)); CSR_WRITE_4(sc, TxMacControl, 0x60); - CSR_WRITE_4(sc, 0x6c, 0); CSR_WRITE_4(sc, RxWakeOnLan, 0); CSR_WRITE_4(sc, RxWakeOnLanData, 0); /* Allow receiving VLAN frames. */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:40:37 2010 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 A7F681065670; Mon, 10 May 2010 18:40:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9633A8FC16; Mon, 10 May 2010 18:40:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIeb4Y034235; Mon, 10 May 2010 18:40:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIebWP034233; Mon, 10 May 2010 18:40:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101840.o4AIebWP034233@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 18:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207856 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:40:37 -0000 Author: yongari Date: Mon May 10 18:40:37 2010 New Revision: 207856 URL: http://svn.freebsd.org/changeset/base/207856 Log: MFC r207545,207625: r207545: Fix wrong dma tag usage. Previously it used TX descriptor ring dma tag which should be TX mbuf dma tag. r207625: Remove clearing RxHashTable2 register. The register is reprogrammed in sge_rxfilter(). Modified: stable/7/sys/dev/sge/if_sge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Mon May 10 18:37:46 2010 (r207855) +++ stable/7/sys/dev/sge/if_sge.c Mon May 10 18:40:37 2010 (r207856) @@ -1421,7 +1421,7 @@ sge_encap(struct sge_softc *sc, struct m } *m_head = m; } - error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_tx_tag, map, + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, map, *m_head, txsegs, &nsegs, 0); if (error != 0) { m_freem(*m_head); @@ -1430,10 +1430,11 @@ sge_encap(struct sge_softc *sc, struct m } /* Check descriptor overrun. */ if (sc->sge_cdata.sge_tx_cnt + nsegs >= SGE_TX_RING_CNT) { - bus_dmamap_unload(sc->sge_cdata.sge_tx_tag, map); + bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, map); return (ENOBUFS); } - bus_dmamap_sync(sc->sge_cdata.sge_tx_tag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, map, + BUS_DMASYNC_PREWRITE); cflags = 0; if ((*m_head)->m_pkthdr.csum_flags & CSUM_IP) @@ -1576,7 +1577,6 @@ sge_init_locked(struct sge_softc *sc) CSR_WRITE_4(sc, RX_DESC, SGE_ADDR_LO(sc->sge_ldata.sge_rx_paddr)); CSR_WRITE_4(sc, TxMacControl, 0x60); - CSR_WRITE_4(sc, 0x6c, 0); CSR_WRITE_4(sc, RxWakeOnLan, 0); CSR_WRITE_4(sc, RxWakeOnLanData, 0); /* Allow receiving VLAN frames. */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:41:27 2010 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 7ACF2106566C; Mon, 10 May 2010 18:41:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 697B08FC19; Mon, 10 May 2010 18:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIfREi034468; Mon, 10 May 2010 18:41:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIfRjI034466; Mon, 10 May 2010 18:41:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101841.o4AIfRjI034466@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:41:27 +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: r207857 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:41:27 -0000 Author: marius Date: Mon May 10 18:41:27 2010 New Revision: 207857 URL: http://svn.freebsd.org/changeset/base/207857 Log: MFC: r207240 Skip the pseudo-devices found in Fujitsu Siemens PRIMEPOWER250. Modified: stable/8/sys/sparc64/sparc64/nexus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/8/sys/sparc64/sparc64/nexus.c Mon May 10 18:40:37 2010 (r207856) +++ stable/8/sys/sparc64/sparc64/nexus.c Mon May 10 18:41:27 2010 (r207857) @@ -153,6 +153,7 @@ EARLY_DRIVER_MODULE(nexus, root, nexus_d MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { + "FJSV,system", "aliases", "associations", "chosen", @@ -163,6 +164,7 @@ static const char *const nexus_excl_name "openprom", "options", "packages", + "physical-memory", "rsc", "sgcn", "todsg", From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:43:45 2010 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 0A3A71065678; Mon, 10 May 2010 18:43:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id ECDA78FC1E; Mon, 10 May 2010 18:43:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIhi52035103; Mon, 10 May 2010 18:43:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIhi3t035102; Mon, 10 May 2010 18:43:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101843.o4AIhi3t035102@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:43:44 +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: r207858 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:43:45 -0000 Author: marius Date: Mon May 10 18:43:44 2010 New Revision: 207858 URL: http://svn.freebsd.org/changeset/base/207858 Log: MFC: r207240 Skip the pseudo-devices found in Fujitsu Siemens PRIMEPOWER250. Modified: stable/7/sys/sparc64/sparc64/nexus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/nexus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/nexus.c Mon May 10 18:41:27 2010 (r207857) +++ stable/7/sys/sparc64/sparc64/nexus.c Mon May 10 18:43:44 2010 (r207858) @@ -152,6 +152,7 @@ DRIVER_MODULE(nexus, root, nexus_driver, MODULE_VERSION(nexus, 1); static const char *const nexus_excl_name[] = { + "FJSV,system", "aliases", "associations", "chosen", @@ -162,6 +163,7 @@ static const char *const nexus_excl_name "openprom", "options", "packages", + "physical-memory", "rsc", "sgcn", "todsg", From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:45:19 2010 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 3849D10656A5; Mon, 10 May 2010 18:45:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 26F8D8FC2A; Mon, 10 May 2010 18:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIjJTD035508; Mon, 10 May 2010 18:45:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIjJ2w035506; Mon, 10 May 2010 18:45:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101845.o4AIjJ2w035506@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:45:19 +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: r207859 - stable/8/sys/sparc64/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, 10 May 2010 18:45:19 -0000 Author: marius Date: Mon May 10 18:45:18 2010 New Revision: 207859 URL: http://svn.freebsd.org/changeset/base/207859 Log: MFC: r207241 - Add a missing const. - Map the NS16550 found in Fujitsu Siemens PRIMEPOWER250 to PNP0501 as well. Modified: stable/8/sys/sparc64/isa/isa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/isa/isa.c ============================================================================== --- stable/8/sys/sparc64/isa/isa.c Mon May 10 18:43:44 2010 (r207858) +++ stable/8/sys/sparc64/isa/isa.c Mon May 10 18:45:18 2010 (r207859) @@ -116,7 +116,7 @@ isa_init(device_t dev) } static const struct { - const char *name; + const char *const name; uint32_t id; } const ofw_isa_pnp_map[] = { { "SUNW,lomh", 0x0000ae4e }, /* SUN0000 */ @@ -126,6 +126,7 @@ static const struct { { "flashprom", 0x0100ae4e }, /* SUN0001 */ { "parallel", 0x0104d041 }, /* PNP0401 */ { "serial", 0x0105d041 }, /* PNP0501 */ + { "su", 0x0105d041 }, /* PNP0501 */ { "i2c", 0x0200ae4e }, /* SUN0002 */ { "rmc-comm", 0x0300ae4e }, /* SUN0003 */ { "kb_ps2", 0x0303d041 }, /* PNP0303 */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:45:20 2010 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 D7D35106566B; Mon, 10 May 2010 18:45:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C69958FC13; Mon, 10 May 2010 18:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIjK5R035541; Mon, 10 May 2010 18:45:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIjKjb035539; Mon, 10 May 2010 18:45:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101845.o4AIjKjb035539@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:45:20 +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: r207860 - stable/7/sys/sparc64/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, 10 May 2010 18:45:21 -0000 Author: marius Date: Mon May 10 18:45:20 2010 New Revision: 207860 URL: http://svn.freebsd.org/changeset/base/207860 Log: MFC: r207241 - Add a missing const. - Map the NS16550 found in Fujitsu Siemens PRIMEPOWER250 to PNP0501 as well. Modified: stable/7/sys/sparc64/isa/isa.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/isa/isa.c ============================================================================== --- stable/7/sys/sparc64/isa/isa.c Mon May 10 18:45:18 2010 (r207859) +++ stable/7/sys/sparc64/isa/isa.c Mon May 10 18:45:20 2010 (r207860) @@ -116,7 +116,7 @@ isa_init(device_t dev) } static const struct { - const char *name; + const char *const name; uint32_t id; } const ofw_isa_pnp_map[] = { { "SUNW,lomh", 0x0000ae4e }, /* SUN0000 */ @@ -126,6 +126,7 @@ static const struct { { "flashprom", 0x0100ae4e }, /* SUN0001 */ { "parallel", 0x0104d041 }, /* PNP0401 */ { "serial", 0x0105d041 }, /* PNP0501 */ + { "su", 0x0105d041 }, /* PNP0501 */ { "i2c", 0x0200ae4e }, /* SUN0002 */ { "rmc-comm", 0x0300ae4e }, /* SUN0003 */ { "kb_ps2", 0x0303d041 }, /* PNP0303 */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:46:38 2010 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 26FC11065677; Mon, 10 May 2010 18:46:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 159F18FC13; Mon, 10 May 2010 18:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIkbT6035936; Mon, 10 May 2010 18:46:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIkbfb035927; Mon, 10 May 2010 18:46:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101846.o4AIkbfb035927@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:46: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: r207861 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:46:38 -0000 Author: marius Date: Mon May 10 18:46:37 2010 New Revision: 207861 URL: http://svn.freebsd.org/changeset/base/207861 Log: MFC: r207242 For the on-board interfaces found in Fujitsu SPARC64 machines obtain the MAC address via OFW as well. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon May 10 18:45:20 2010 (r207860) +++ stable/8/sys/dev/bge/if_bge.c Mon May 10 18:46:37 2010 (r207861) @@ -520,7 +520,7 @@ bge_has_eaddr(struct bge_softc *sc) */ if (OF_getprop(ofw_bus_get_node(dev), SPARC64_OFW_SUBVENDOR, &subvendor, sizeof(subvendor)) == sizeof(subvendor) && - subvendor == SUN_VENDORID) + (subvendor == FJTSU_VENDORID || subvendor == SUN_VENDORID)) return (0); memset(buf, 0, sizeof(buf)); if (OF_package_to_path(ofw_bus_get_node(dev), buf, sizeof(buf)) > 0) { From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:46:38 2010 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 27B771065679; Mon, 10 May 2010 18:46:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 165BB8FC14; Mon, 10 May 2010 18:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIkbRm035940; Mon, 10 May 2010 18:46:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIkbh8035938; Mon, 10 May 2010 18:46:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101846.o4AIkbh8035938@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207862 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:46:38 -0000 Author: marius Date: Mon May 10 18:46:37 2010 New Revision: 207862 URL: http://svn.freebsd.org/changeset/base/207862 Log: MFC: r207242 For the on-board interfaces found in Fujitsu SPARC64 machines obtain the MAC address via OFW as well. Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon May 10 18:46:37 2010 (r207861) +++ stable/7/sys/dev/bge/if_bge.c Mon May 10 18:46:37 2010 (r207862) @@ -520,7 +520,7 @@ bge_has_eaddr(struct bge_softc *sc) */ if (OF_getprop(ofw_bus_get_node(dev), SPARC64_OFW_SUBVENDOR, &subvendor, sizeof(subvendor)) == sizeof(subvendor) && - subvendor == SUN_VENDORID) + (subvendor == FJTSU_VENDORID || subvendor == SUN_VENDORID)) return (0); memset(buf, 0, sizeof(buf)); if (OF_package_to_path(ofw_bus_get_node(dev), buf, sizeof(buf)) > 0) { From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:47:53 2010 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 29F7A1065680; Mon, 10 May 2010 18:47:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 17E888FC27; Mon, 10 May 2010 18:47:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIlqZ9036273; Mon, 10 May 2010 18:47:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIlqSE036270; Mon, 10 May 2010 18:47:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101847.o4AIlqSE036270@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:47:52 +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: r207863 - in stable/8/sys: sparc64/include sparc64/sparc64 sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 18:47:53 -0000 Author: marius Date: Mon May 10 18:47:52 2010 New Revision: 207863 URL: http://svn.freebsd.org/changeset/base/207863 Log: MFC: r207243 Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for obtaining the initiator ID to be used for SPI controllers from the Open Firmware device tree. Modified: stable/8/sys/sparc64/include/ofw_machdep.h stable/8/sys/sparc64/sparc64/ofw_machdep.c stable/8/sys/sun4v/include/ofw_machdep.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sparc64/include/ofw_machdep.h Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sparc64/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *); Modified: stable/8/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:47:52 2010 (r207863) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 - 2009 by Marius Strobl . + * Copyright (c) 2005 - 2010 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,19 @@ OF_getetheraddr(device_t dev, u_char *ad bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } +u_int +OF_getscsinitid(device_t dev) +{ + phandle_t node; + uint32_t id; + + for (node = ofw_bus_get_node(dev); node != 0; node = OF_parent(node)) + if (OF_getprop(node, "scsi-initiator-id", &id, + sizeof(id)) > 0) + return (id); + return (7); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { Modified: stable/8/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/8/sys/sun4v/include/ofw_machdep.h Mon May 10 18:46:37 2010 (r207862) +++ stable/8/sys/sun4v/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) @@ -36,6 +36,7 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); int ofw_entry(void *); void ofw_exit(void *); From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:47:54 2010 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 D954E1065676; Mon, 10 May 2010 18:47:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C714F8FC19; Mon, 10 May 2010 18:47:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIls62036305; Mon, 10 May 2010 18:47:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIls4v036301; Mon, 10 May 2010 18:47:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101847.o4AIls4v036301@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207864 - in stable/7/sys: sparc64/include sparc64/sparc64 sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 18:47:55 -0000 Author: marius Date: Mon May 10 18:47:54 2010 New Revision: 207864 URL: http://svn.freebsd.org/changeset/base/207864 Log: MFC: r207243 Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for obtaining the initiator ID to be used for SPI controllers from the Open Firmware device tree. Modified: stable/7/sys/sparc64/include/ofw_machdep.h stable/7/sys/sparc64/sparc64/ofw_machdep.c stable/7/sys/sun4v/include/ofw_machdep.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/7/sys/sparc64/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) +++ stable/7/sys/sparc64/include/ofw_machdep.h Mon May 10 18:47:54 2010 (r207864) @@ -32,6 +32,7 @@ int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); void openfirmware_exit(void *); Modified: stable/7/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:47:52 2010 (r207863) +++ stable/7/sys/sparc64/sparc64/ofw_machdep.c Mon May 10 18:47:54 2010 (r207864) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001 by Thomas Moestl . - * Copyright (c) 2005 - 2009 by Marius Strobl . + * Copyright (c) 2005 - 2010 by Marius Strobl . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,19 @@ OF_getetheraddr(device_t dev, u_char *ad bcopy(&idp.id_ether, addr, ETHER_ADDR_LEN); } +u_int +OF_getscsinitid(device_t dev) +{ + phandle_t node; + uint32_t id; + + for (node = ofw_bus_get_node(dev); node != 0; node = OF_parent(node)) + if (OF_getprop(node, "scsi-initiator-id", &id, + sizeof(id)) > 0) + return (id); + return (7); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { Modified: stable/7/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/7/sys/sun4v/include/ofw_machdep.h Mon May 10 18:47:52 2010 (r207863) +++ stable/7/sys/sun4v/include/ofw_machdep.h Mon May 10 18:47:54 2010 (r207864) @@ -32,6 +32,7 @@ int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); +u_int OF_getscsinitid(device_t); void cpu_shutdown(void *); void openfirmware_exit(void *); From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:50:27 2010 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 51F8D1065677; Mon, 10 May 2010 18:50:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA0F8FC14; Mon, 10 May 2010 18:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIoRTh036933; Mon, 10 May 2010 18:50:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIoQ8f036931; Mon, 10 May 2010 18:50:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101850.o4AIoQ8f036931@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:50:26 +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: r207865 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:50:27 -0000 Author: marius Date: Mon May 10 18:50:26 2010 New Revision: 207865 URL: http://svn.freebsd.org/changeset/base/207865 Log: MFC: r207248 Don't bother enabling interrupts before we're ready to handle them. This prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes stray interrupts and erroneously enables interrupts at least when calling SUNW,set-trap-table, from shooting itself in the foot. Modified: stable/8/sys/sparc64/sparc64/cheetah.c stable/8/sys/sparc64/sparc64/locore.S stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Mon May 10 18:47:54 2010 (r207864) +++ stable/8/sys/sparc64/sparc64/cheetah.c Mon May 10 18:50:26 2010 (r207865) @@ -58,13 +58,6 @@ void cheetah_init(u_int cpu_impl) { u_long val; - register_t s; - - /* - * Disable interrupts for safety, this shouldn't be actually - * necessary though. - */ - s = intr_disable(); /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ @@ -134,8 +127,6 @@ cheetah_init(u_int cpu_impl) val &= ~DCR_DTPE; } wr(asr18, val, 0); - - intr_restore(s); } /* Modified: stable/8/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/locore.S Mon May 10 18:47:54 2010 (r207864) +++ stable/8/sys/sparc64/sparc64/locore.S Mon May 10 18:50:26 2010 (r207865) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -47,7 +48,7 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting @@ -55,7 +56,7 @@ ENTRY(_start) */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs /* @@ -66,11 +67,6 @@ ENTRY(_start) sub %l0, SPOFF + CCFSZ, %sp /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - - /* * Do initial bootstrap to setup pmap and thread0. */ call sparc64_init @@ -97,7 +93,7 @@ ENTRY(cpu_setregs) ldx [%o0 + PC_CURPCB], %o1 /* - * Disable interrupts, normal globals. + * Ensure we are on normal globals. */ wrpr %g0, PSTATE_NORMAL, %pstate @@ -147,11 +143,6 @@ ENTRY(cpu_setregs) wrpr %o1, 0, %tba stw %o3, [%o2] - /* - * Re-enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - retl nop END(cpu_setregs) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon May 10 18:47:54 2010 (r207864) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon May 10 18:50:26 2010 (r207865) @@ -341,7 +341,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_impl = VER_IMPL(rdpr(ver)); /* - * Do CPU-specific Initialization. + * Do CPU-specific initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); @@ -477,6 +477,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sizeof(itlb_slots)) == -1) panic("sparc64_init: cannot determine number of iTLB slots"); + /* + * Initialize and enable the caches. Note that his may include + * applying workarounds. + */ cache_init(pc); cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); @@ -568,8 +572,18 @@ sparc64_init(caddr_t mdp, u_long o1, u_l dpcpu_init(dpcpu0, 0); msgbufinit(msgbufp, MSGBUF_SIZE); + /* + * Initialize mutexes. + */ mutex_init(); + + /* + * Finish the interrupt initialization now that mutexes work and + * enable them. + */ intr_init2(); + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); /* * Finish pmap initialization now that we're ready for mutexes. Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Mon May 10 18:47:54 2010 (r207864) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Mon May 10 18:50:26 2010 (r207865) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,14 +45,14 @@ __FBSDID("$FreeBSD$"); _ALIGN_TEXT /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs rdpr %ver, %l7 @@ -262,11 +263,6 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp - /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon May 10 18:47:54 2010 (r207864) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon May 10 18:50:26 2010 (r207865) @@ -409,16 +409,32 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; + + /* Do CPU-specific initialization. */ if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + /* + * Enable the caches. Note that his may include applying workarounds. + */ cache_enable(pc->pc_impl); + + /* Lock the kernel TSB in the TLB. */ pmap_map_tsb(); + /* * Flush all non-locked TLB entries possibly left over by the * firmware. */ tlb_flush_nonlocked(); + + /* Initialize global registers. */ cpu_setregs(pc); + + /* Enable interrupts. */ + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); + + /* Start the (S)TICK interrupts. */ tick_start(); smp_cpus++; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:50:28 2010 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 A732A106566C; Mon, 10 May 2010 18:50:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 953128FC21; Mon, 10 May 2010 18:50:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIoS0k036967; Mon, 10 May 2010 18:50:28 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIoSvv036961; Mon, 10 May 2010 18:50:28 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101850.o4AIoSvv036961@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:50:28 +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: r207866 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:50:28 -0000 Author: marius Date: Mon May 10 18:50:28 2010 New Revision: 207866 URL: http://svn.freebsd.org/changeset/base/207866 Log: MFC: r207248 Don't bother enabling interrupts before we're ready to handle them. This prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes stray interrupts and erroneously enables interrupts at least when calling SUNW,set-trap-table, from shooting itself in the foot. Modified: stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/locore.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Mon May 10 18:50:26 2010 (r207865) +++ stable/7/sys/sparc64/sparc64/cheetah.c Mon May 10 18:50:28 2010 (r207866) @@ -58,13 +58,6 @@ void cheetah_init(u_int cpu_impl) { u_long val; - register_t s; - - /* - * Disable interrupts for safety, this shouldn't be actually - * necessary though. - */ - s = intr_disable(); /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ @@ -134,8 +127,6 @@ cheetah_init(u_int cpu_impl) val &= ~DCR_DTPE; } wr(asr18, val, 0); - - intr_restore(s); } /* Modified: stable/7/sys/sparc64/sparc64/locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/locore.S Mon May 10 18:50:26 2010 (r207865) +++ stable/7/sys/sparc64/sparc64/locore.S Mon May 10 18:50:28 2010 (r207866) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -47,7 +48,7 @@ ENTRY(btext) ENTRY(_start) /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting @@ -55,7 +56,7 @@ ENTRY(_start) */ wrpr %g0, PSTATE_NORMAL, %pstate flushw - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs /* @@ -66,11 +67,6 @@ ENTRY(_start) sub %l0, SPOFF + CCFSZ, %sp /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - - /* * Do initial bootstrap to setup pmap and thread0. */ call sparc64_init @@ -97,7 +93,7 @@ ENTRY(cpu_setregs) ldx [%o0 + PC_CURPCB], %o1 /* - * Disable interrupts, normal globals. + * Ensure we are on normal globals. */ wrpr %g0, PSTATE_NORMAL, %pstate @@ -147,11 +143,6 @@ ENTRY(cpu_setregs) wrpr %o1, 0, %tba stw %o3, [%o2] - /* - * Re-enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - retl nop END(cpu_setregs) Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon May 10 18:50:26 2010 (r207865) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon May 10 18:50:28 2010 (r207866) @@ -340,7 +340,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l cpu_impl = VER_IMPL(rdpr(ver)); /* - * Do CPU-specific Initialization. + * Do CPU-specific initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); @@ -469,6 +469,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sizeof(itlb_slots)) == -1) panic("sparc64_init: cannot determine number of iTLB slots"); + /* + * Initialize and enable the caches. Note that his may include + * applying workarounds. + */ cache_init(pc); cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); @@ -558,8 +562,18 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ msgbufinit(msgbufp, MSGBUF_SIZE); + /* + * Initialize mutexes. + */ mutex_init(); + + /* + * Finish the interrupt initialization now that mutexes work and + * enable them. + */ intr_init2(); + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); /* * Finish pmap initialization now that we're ready for mutexes. Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Mon May 10 18:50:26 2010 (r207865) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Mon May 10 18:50:28 2010 (r207866) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,14 +45,14 @@ __FBSDID("$FreeBSD$"); _ALIGN_TEXT /* * Initialize misc. state to known values: interrupts disabled, normal - * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL 0 and + * globals, windows flushed (cr = 0, cs = nwindows - 1), PIL_TICK and * floating point disabled. * Note that some firmware versions don't implement a clean window * trap handler so we unfortunately can't clear the windows by setting * %cleanwin to zero here. */ 1: wrpr %g0, PSTATE_NORMAL, %pstate - wrpr %g0, 0, %pil + wrpr %g0, PIL_TICK, %pil wr %g0, 0, %fprs rdpr %ver, %l7 @@ -262,11 +263,6 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp - /* - * Enable interrupts. - */ - wrpr %g0, PSTATE_KERNEL, %pstate - #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon May 10 18:50:26 2010 (r207865) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon May 10 18:50:28 2010 (r207866) @@ -401,16 +401,32 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; + + /* Do CPU-specific initialization. */ if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + /* + * Enable the caches. Note that his may include applying workarounds. + */ cache_enable(pc->pc_impl); + + /* Lock the kernel TSB in the TLB. */ pmap_map_tsb(); + /* * Flush all non-locked TLB entries possibly left over by the * firmware. */ tlb_flush_nonlocked(); + + /* Initialize global registers. */ cpu_setregs(pc); + + /* Enable interrupts. */ + wrpr(pil, 0, PIL_TICK); + wrpr(pstate, 0, PSTATE_KERNEL); + + /* Start the (S)TICK interrupts. */ tick_start(); smp_cpus++; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:51:49 2010 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 716F11065670; Mon, 10 May 2010 18:51:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5FE828FC1A; Mon, 10 May 2010 18:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIpnRq037324; Mon, 10 May 2010 18:51:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIpnqS037322; Mon, 10 May 2010 18:51:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101851.o4AIpnqS037322@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:51:49 +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: r207867 - stable/8/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:51:49 -0000 Author: marius Date: Mon May 10 18:51:49 2010 New Revision: 207867 URL: http://svn.freebsd.org/changeset/base/207867 Log: MFC: r207281 Take advantage of OF_getscsinitid(). Modified: stable/8/sys/dev/esp/esp_sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/esp/esp_sbus.c ============================================================================== --- stable/8/sys/dev/esp/esp_sbus.c Mon May 10 18:50:28 2010 (r207866) +++ stable/8/sys/dev/esp/esp_sbus.c Mon May 10 18:51:49 2010 (r207867) @@ -466,9 +466,7 @@ espattach(struct esp_softc *esc, const s goto fail_lock; } - if (OF_getprop(ofw_bus_get_node(esc->sc_dev), "scsi-initiator-id", - &sc->sc_id, sizeof(sc->sc_id)) == -1) - sc->sc_id = 7; + sc->sc_id = OF_getscsinitid(esc->sc_dev); #ifdef ESP_SBUS_DEBUG device_printf(esc->sc_dev, "%s: sc_id %d, freq %d\n", From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:52:01 2010 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 1A4791065674; Mon, 10 May 2010 18:52:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 090398FC12; Mon, 10 May 2010 18:52:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIq06d037423; Mon, 10 May 2010 18:52:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIq0Sv037421; Mon, 10 May 2010 18:52:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101852.o4AIq0Sv037421@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207868 - stable/7/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:52:01 -0000 Author: marius Date: Mon May 10 18:52:00 2010 New Revision: 207868 URL: http://svn.freebsd.org/changeset/base/207868 Log: MFC: r207281 Take advantage of OF_getscsinitid(). Modified: stable/7/sys/dev/esp/esp_sbus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/esp/esp_sbus.c ============================================================================== --- stable/7/sys/dev/esp/esp_sbus.c Mon May 10 18:51:49 2010 (r207867) +++ stable/7/sys/dev/esp/esp_sbus.c Mon May 10 18:52:00 2010 (r207868) @@ -466,9 +466,7 @@ espattach(struct esp_softc *esc, const s goto fail_lock; } - if (OF_getprop(ofw_bus_get_node(esc->sc_dev), "scsi-initiator-id", - &sc->sc_id, sizeof(sc->sc_id)) == -1) - sc->sc_id = 7; + sc->sc_id = OF_getscsinitid(esc->sc_dev); #ifdef ESP_SBUS_DEBUG device_printf(esc->sc_dev, "%s: sc_id %d, freq %d\n", From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:53:32 2010 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 66DBD1065673; Mon, 10 May 2010 18:53:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5588D8FC0A; Mon, 10 May 2010 18:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIrWgR037815; Mon, 10 May 2010 18:53:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIrWoI037813; Mon, 10 May 2010 18:53:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101853.o4AIrWoI037813@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:53:32 +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: r207869 - stable/8/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:53:32 -0000 Author: marius Date: Mon May 10 18:53:32 2010 New Revision: 207869 URL: http://svn.freebsd.org/changeset/base/207869 Log: MFC: r207285 - On sparc64 obtain the initiator ID from the Open Firmware device tree in order to match what the PROM built-in driver uses. - Remove some no longer used includes. Modified: stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Mon May 10 18:52:00 2010 (r207868) +++ stable/8/sys/dev/sym/sym_hipd.c Mon May 10 18:53:32 2010 (r207869) @@ -87,6 +87,12 @@ __FBSDID("$FreeBSD$"); #include #include + +#ifdef __sparc64__ +#include +#include +#endif + #include #include @@ -98,10 +104,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - /* Short and quite clear integer types */ typedef int8_t s8; typedef int16_t s16; @@ -2682,6 +2684,9 @@ static int sym_prepare_setting(hcb_p np, */ np->myaddr = 255; sym_nvram_setup_host (np, nvram); +#ifdef __sparc64__ + np->myaddr = OF_getscsinitid(np->device); +#endif /* * Get SCSI addr of host adapter (set by bios?). From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:53:44 2010 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 E5B191065675; Mon, 10 May 2010 18:53:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D45C98FC13; Mon, 10 May 2010 18:53:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIrifP037888; Mon, 10 May 2010 18:53:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIriOi037886; Mon, 10 May 2010 18:53:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101853.o4AIriOi037886@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:53:44 +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: r207870 - stable/7/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:53:45 -0000 Author: marius Date: Mon May 10 18:53:44 2010 New Revision: 207870 URL: http://svn.freebsd.org/changeset/base/207870 Log: MFC: r207285 - On sparc64 obtain the initiator ID from the Open Firmware device tree in order to match what the PROM built-in driver uses. - Remove some no longer used includes. Modified: stable/7/sys/dev/sym/sym_hipd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Mon May 10 18:53:32 2010 (r207869) +++ stable/7/sys/dev/sym/sym_hipd.c Mon May 10 18:53:44 2010 (r207870) @@ -87,6 +87,12 @@ __FBSDID("$FreeBSD$"); #include #include + +#ifdef __sparc64__ +#include +#include +#endif + #include #include @@ -98,10 +104,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - /* Short and quite clear integer types */ typedef int8_t s8; typedef int16_t s16; @@ -2682,6 +2684,9 @@ static int sym_prepare_setting(hcb_p np, */ np->myaddr = 255; sym_nvram_setup_host (np, nvram); +#ifdef __sparc64__ + np->myaddr = OF_getscsinitid(np->device); +#endif /* * Get SCSI addr of host adapter (set by bios?). From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:54:59 2010 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 2032C106564A; Mon, 10 May 2010 18:54:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0868FC17; Mon, 10 May 2010 18:54:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIsw6g038217; Mon, 10 May 2010 18:54:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIswVI038215; Mon, 10 May 2010 18:54:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101854.o4AIswVI038215@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207871 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:54:59 -0000 Author: marius Date: Mon May 10 18:54:58 2010 New Revision: 207871 URL: http://svn.freebsd.org/changeset/base/207871 Log: MFC: r207286 Replace a magic value with the appropriate macro. Modified: stable/8/sys/dev/mpt/mpt_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Mon May 10 18:53:44 2010 (r207870) +++ stable/8/sys/dev/mpt/mpt_cam.c Mon May 10 18:54:58 2010 (r207871) @@ -1058,12 +1058,13 @@ mpt_read_config_info_spi(struct mpt_soft static int mpt_set_initial_config_spi(struct mpt_softc *mpt) { - int i, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; - int error; + int error, i, pp1val; mpt->mpt_disc_enable = 0xff; mpt->mpt_tag_enable = 0; + pp1val = ((1 << mpt->mpt_ini_id) << + MPI_SCSIPORTPAGE1_CFG_SHIFT_PORT_RESPONSE_ID) | mpt->mpt_ini_id; if (mpt->mpt_port_page1.Configuration != pp1val) { CONFIG_PAGE_SCSI_PORT_1 tmp; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:54:59 2010 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 D964B106566C; Mon, 10 May 2010 18:54:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C82A08FC20; Mon, 10 May 2010 18:54:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIsxKt038247; Mon, 10 May 2010 18:54:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIsxHD038245; Mon, 10 May 2010 18:54:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101854.o4AIsxHD038245@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207872 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:55:00 -0000 Author: marius Date: Mon May 10 18:54:59 2010 New Revision: 207872 URL: http://svn.freebsd.org/changeset/base/207872 Log: MFC: r207286 Replace a magic value with the appropriate macro. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon May 10 18:54:58 2010 (r207871) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon May 10 18:54:59 2010 (r207872) @@ -1058,12 +1058,13 @@ mpt_read_config_info_spi(struct mpt_soft static int mpt_set_initial_config_spi(struct mpt_softc *mpt) { - int i, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; - int error; + int error, i, pp1val; mpt->mpt_disc_enable = 0xff; mpt->mpt_tag_enable = 0; + pp1val = ((1 << mpt->mpt_ini_id) << + MPI_SCSIPORTPAGE1_CFG_SHIFT_PORT_RESPONSE_ID) | mpt->mpt_ini_id; if (mpt->mpt_port_page1.Configuration != pp1val) { CONFIG_PAGE_SCSI_PORT_1 tmp; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:56:37 2010 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 DD4C0106567F; Mon, 10 May 2010 18:56:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C1F428FC1B; Mon, 10 May 2010 18:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIuaM4038686; Mon, 10 May 2010 18:56:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIuaGg038682; Mon, 10 May 2010 18:56:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101856.o4AIuaGg038682@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207873 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:56:37 -0000 Author: marius Date: Mon May 10 18:56:36 2010 New Revision: 207873 URL: http://svn.freebsd.org/changeset/base/207873 Log: MFC: r207287 On sparc64 obtain the initiator ID to be used for SPI HBAs from the Open Firmware device tree in order to match what the PROM built-in driver uses. This is especially important when netbooting Fujitsu Siemens PRIMEPOWER250 as in that case the built-in driver isn't used and the port facts PortSCSIID defaults to 0, conflicting with the disk at the same address. Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Mon May 10 18:54:59 2010 (r207872) +++ stable/8/sys/dev/mpt/mpt.c Mon May 10 18:56:36 2010 (r207873) @@ -2659,6 +2659,8 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->is_fc = 0; mpt->is_sas = 0; mpt->is_spi = 1; + if (mpt->mpt_ini_id == MPT_INI_ID_NONE) + mpt->mpt_ini_id = pfp->PortSCSIID; } else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_ISCSI) { mpt_prt(mpt, "iSCSI not supported yet\n"); return (ENXIO); Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Mon May 10 18:54:59 2010 (r207872) +++ stable/8/sys/dev/mpt/mpt.h Mon May 10 18:56:36 2010 (r207873) @@ -130,6 +130,11 @@ #include #endif +#ifdef __sparc64__ +#include +#include +#endif + #include #if __FreeBSD_version < 500000 @@ -172,6 +177,8 @@ #define MPT_ROLE_BOTH 3 #define MPT_ROLE_DEFAULT MPT_ROLE_INITIATOR +#define MPT_INI_ID_NONE -1 + /**************************** Forward Declarations ****************************/ struct mpt_softc; struct mpt_personality; @@ -644,7 +651,6 @@ struct mpt_softc { * Port Facts */ MSG_PORT_FACTS_REPLY * port_facts; -#define mpt_ini_id port_facts[0].PortSCSIID #define mpt_max_tgtcmds port_facts[0].MaxPostedCmdBuffers /* @@ -657,6 +663,7 @@ struct mpt_softc { CONFIG_PAGE_SCSI_PORT_2 _port_page2; CONFIG_PAGE_SCSI_DEVICE_0 _dev_page0[16]; CONFIG_PAGE_SCSI_DEVICE_1 _dev_page1[16]; + int _ini_id; uint16_t _tag_enable; uint16_t _disc_enable; } spi; @@ -665,6 +672,7 @@ struct mpt_softc { #define mpt_port_page2 cfg.spi._port_page2 #define mpt_dev_page0 cfg.spi._dev_page0 #define mpt_dev_page1 cfg.spi._dev_page1 +#define mpt_ini_id cfg.spi._ini_id #define mpt_tag_enable cfg.spi._tag_enable #define mpt_disc_enable cfg.spi._disc_enable struct mpi_fc_cfg { Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Mon May 10 18:54:59 2010 (r207872) +++ stable/8/sys/dev/mpt/mpt_pci.c Mon May 10 18:56:36 2010 (r207873) @@ -460,6 +460,11 @@ mpt_pci_attach(device_t dev) mpt->raid_queue_depth = MPT_RAID_QUEUE_DEPTH_DEFAULT; mpt->verbose = MPT_PRT_NONE; mpt->role = MPT_ROLE_NONE; + mpt->mpt_ini_id = MPT_INI_ID_NONE; +#ifdef __sparc64__ + if (mpt->is_spi) + mpt->mpt_ini_id = OF_getscsinitid(dev); +#endif mpt_set_options(mpt); if (mpt->verbose == MPT_PRT_NONE) { mpt->verbose = MPT_PRT_WARN; From owner-svn-src-all@FreeBSD.ORG Mon May 10 18:56:40 2010 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 B740F106567E; Mon, 10 May 2010 18:56:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9C96B8FC19; Mon, 10 May 2010 18:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AIueCN038754; Mon, 10 May 2010 18:56:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AIue38038750; Mon, 10 May 2010 18:56:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101856.o4AIue38038750@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 18:56:40 +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: r207874 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 18:56:40 -0000 Author: marius Date: Mon May 10 18:56:40 2010 New Revision: 207874 URL: http://svn.freebsd.org/changeset/base/207874 Log: MFC: r207287 On sparc64 obtain the initiator ID to be used for SPI HBAs from the Open Firmware device tree in order to match what the PROM built-in driver uses. This is especially important when netbooting Fujitsu Siemens PRIMEPOWER250 as in that case the built-in driver isn't used and the port facts PortSCSIID defaults to 0, conflicting with the disk at the same address. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon May 10 18:56:36 2010 (r207873) +++ stable/7/sys/dev/mpt/mpt.c Mon May 10 18:56:40 2010 (r207874) @@ -2659,6 +2659,8 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->is_fc = 0; mpt->is_sas = 0; mpt->is_spi = 1; + if (mpt->mpt_ini_id == MPT_INI_ID_NONE) + mpt->mpt_ini_id = pfp->PortSCSIID; } else if (pfp->PortType == MPI_PORTFACTS_PORTTYPE_ISCSI) { mpt_prt(mpt, "iSCSI not supported yet\n"); return (ENXIO); Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon May 10 18:56:36 2010 (r207873) +++ stable/7/sys/dev/mpt/mpt.h Mon May 10 18:56:40 2010 (r207874) @@ -130,6 +130,11 @@ #include #endif +#ifdef __sparc64__ +#include +#include +#endif + #include #if __FreeBSD_version < 500000 @@ -172,6 +177,8 @@ #define MPT_ROLE_BOTH 3 #define MPT_ROLE_DEFAULT MPT_ROLE_INITIATOR +#define MPT_INI_ID_NONE -1 + /**************************** Forward Declarations ****************************/ struct mpt_softc; struct mpt_personality; @@ -644,7 +651,6 @@ struct mpt_softc { * Port Facts */ MSG_PORT_FACTS_REPLY * port_facts; -#define mpt_ini_id port_facts[0].PortSCSIID #define mpt_max_tgtcmds port_facts[0].MaxPostedCmdBuffers /* @@ -657,6 +663,7 @@ struct mpt_softc { CONFIG_PAGE_SCSI_PORT_2 _port_page2; CONFIG_PAGE_SCSI_DEVICE_0 _dev_page0[16]; CONFIG_PAGE_SCSI_DEVICE_1 _dev_page1[16]; + int _ini_id; uint16_t _tag_enable; uint16_t _disc_enable; } spi; @@ -665,6 +672,7 @@ struct mpt_softc { #define mpt_port_page2 cfg.spi._port_page2 #define mpt_dev_page0 cfg.spi._dev_page0 #define mpt_dev_page1 cfg.spi._dev_page1 +#define mpt_ini_id cfg.spi._ini_id #define mpt_tag_enable cfg.spi._tag_enable #define mpt_disc_enable cfg.spi._disc_enable struct mpi_fc_cfg { Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon May 10 18:56:36 2010 (r207873) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon May 10 18:56:40 2010 (r207874) @@ -460,6 +460,11 @@ mpt_pci_attach(device_t dev) mpt->raid_queue_depth = MPT_RAID_QUEUE_DEPTH_DEFAULT; mpt->verbose = MPT_PRT_NONE; mpt->role = MPT_ROLE_NONE; + mpt->mpt_ini_id = MPT_INI_ID_NONE; +#ifdef __sparc64__ + if (mpt->is_spi) + mpt->mpt_ini_id = OF_getscsinitid(dev); +#endif mpt_set_options(mpt); if (mpt->verbose == MPT_PRT_NONE) { mpt->verbose = MPT_PRT_WARN; From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:02:21 2010 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 D8439106564A; Mon, 10 May 2010 19:02:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C6CB38FC19; Mon, 10 May 2010 19:02:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJ2LFN040054; Mon, 10 May 2010 19:02:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJ2Lg9040052; Mon, 10 May 2010 19:02:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101902.o4AJ2Lg9040052@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 19:02:21 +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: r207875 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:02:21 -0000 Author: marius Date: Mon May 10 19:02:21 2010 New Revision: 207875 URL: http://svn.freebsd.org/changeset/base/207875 Log: MFC: r207500 Add a hack for SPARC64 V CPUs, which set some undocumented bits in the first data word. Modified: stable/8/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/8/sys/sparc64/sparc64/interrupt.S Mon May 10 18:56:40 2010 (r207874) +++ stable/8/sys/sparc64/sparc64/interrupt.S Mon May 10 19:02:21 2010 (r207875) @@ -83,8 +83,11 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - nop + brnz,pt %g3, 1f + /* + * NB: Zeus CPUs set some undocumented bits in the first data word. + */ + and %g3, IV_MAX - 1, %g3 jmpl %g4, %g0 nop /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:02:22 2010 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 D350B106566C; Mon, 10 May 2010 19:02:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C20BB8FC1D; Mon, 10 May 2010 19:02:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJ2MXJ040084; Mon, 10 May 2010 19:02:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJ2MaI040082; Mon, 10 May 2010 19:02:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005101902.o4AJ2MaI040082@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 19:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207876 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:02:22 -0000 Author: marius Date: Mon May 10 19:02:22 2010 New Revision: 207876 URL: http://svn.freebsd.org/changeset/base/207876 Log: MFC: r207500 Add a hack for SPARC64 V CPUs, which set some undocumented bits in the first data word. Modified: stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Mon May 10 19:02:21 2010 (r207875) +++ stable/7/sys/sparc64/sparc64/interrupt.S Mon May 10 19:02:22 2010 (r207876) @@ -83,8 +83,11 @@ ENTRY(intr_vector) * The 2nd word points to code to execute and the 3rd is an argument * to pass. Jump to it. */ - brnz,a,pt %g3, 1f - nop + brnz,pt %g3, 1f + /* + * NB: Zeus CPUs set some undocumented bits in the first data word. + */ + and %g3, IV_MAX - 1, %g3 jmpl %g4, %g0 nop /* NOTREACHED */ From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:08:53 2010 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 D5E401065672; Mon, 10 May 2010 19:08:53 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C5B098FC08; Mon, 10 May 2010 19:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJ8rDo041567; Mon, 10 May 2010 19:08:53 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJ8rZL041565; Mon, 10 May 2010 19:08:53 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201005101908.o4AJ8rZL041565@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 10 May 2010 19:08: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: r207877 - head/sys/geom/zero X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:08:53 -0000 Author: jh Date: Mon May 10 19:08:53 2010 New Revision: 207877 URL: http://svn.freebsd.org/changeset/base/207877 Log: In g_zero_destroy_geom(), return 0 instead of EBUSY in the success case. EBUSY was probably used as a workaround for the deadlock fixed in r207671. Approved by: pjd X-MFC after: r207671 Modified: head/sys/geom/zero/g_zero.c Modified: head/sys/geom/zero/g_zero.c ============================================================================== --- head/sys/geom/zero/g_zero.c Mon May 10 19:02:22 2010 (r207876) +++ head/sys/geom/zero/g_zero.c Mon May 10 19:08:53 2010 (r207877) @@ -104,7 +104,7 @@ g_zero_destroy_geom(struct gctl_req *req if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) return (EBUSY); g_wither_geom(gp, ENXIO); - return (EBUSY); + return (0); } static struct g_class g_zero_class = { From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:12:24 2010 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 41E7E1065678; Mon, 10 May 2010 19:12:24 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 313658FC25; Mon, 10 May 2010 19:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJCOrX042397; Mon, 10 May 2010 19:12:24 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJCOFX042392; Mon, 10 May 2010 19:12:24 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201005101912.o4AJCOFX042392@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 10 May 2010 19:12: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: r207878 - head/sys/geom/vinum X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:12:24 -0000 Author: jh Date: Mon May 10 19:12:23 2010 New Revision: 207878 URL: http://svn.freebsd.org/changeset/base/207878 Log: - Don't return EAGAIN from gv_unload(). It was used to work around the deadlock fixed in r207671. - Wait for worker process to exit at class unload. The worker process was not guaranteed to exit before the linker unloaded the module. - Use 0 as the worker process exit status instead of ENXIO and style the NOTREACHED comment. Reviewed by: lulf X-MFC after: r207671 Modified: head/sys/geom/vinum/geom_vinum.c head/sys/geom/vinum/geom_vinum.h head/sys/geom/vinum/geom_vinum_events.c head/sys/geom/vinum/geom_vinum_var.h Modified: head/sys/geom/vinum/geom_vinum.c ============================================================================== --- head/sys/geom/vinum/geom_vinum.c Mon May 10 19:08:53 2010 (r207877) +++ head/sys/geom/vinum/geom_vinum.c Mon May 10 19:12:23 2010 (r207878) @@ -186,7 +186,7 @@ gv_init(struct g_class *mp) mtx_init(&sc->config_mtx, "gv_config", NULL, MTX_DEF); mtx_init(&sc->equeue_mtx, "gv_equeue", NULL, MTX_DEF); mtx_init(&sc->bqueue_mtx, "gv_bqueue", NULL, MTX_DEF); - kproc_create(gv_worker, sc, NULL, 0, 0, "gv_worker"); + kproc_create(gv_worker, sc, &sc->worker, 0, 0, "gv_worker"); } static int @@ -200,10 +200,9 @@ gv_unload(struct gctl_req *req, struct g sc = gp->softc; if (sc != NULL) { - gv_post_event(sc, GV_EVENT_THREAD_EXIT, NULL, NULL, 0, 0); + gv_worker_exit(sc); gp->softc = NULL; g_wither_geom(gp, ENXIO); - return (EAGAIN); } return (0); @@ -984,8 +983,8 @@ gv_worker(void *arg) g_free(sc->bqueue_down); g_free(sc->bqueue_up); g_free(sc); - kproc_exit(ENXIO); - break; /* not reached */ + kproc_exit(0); + /* NOTREACHED */ default: G_VINUM_DEBUG(1, "unknown event %d", ev->type); Modified: head/sys/geom/vinum/geom_vinum.h ============================================================================== --- head/sys/geom/vinum/geom_vinum.h Mon May 10 19:08:53 2010 (r207877) +++ head/sys/geom/vinum/geom_vinum.h Mon May 10 19:12:23 2010 (r207878) @@ -122,6 +122,7 @@ int gv_detach_sd(struct gv_sd *, int) void gv_worker(void *); void gv_post_event(struct gv_softc *, int, void *, void *, intmax_t, intmax_t); +void gv_worker_exit(struct gv_softc *); struct gv_event *gv_get_event(struct gv_softc *); void gv_remove_event(struct gv_softc *, struct gv_event *); void gv_drive_tasted(struct gv_softc *, struct g_provider *); Modified: head/sys/geom/vinum/geom_vinum_events.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_events.c Mon May 10 19:08:53 2010 (r207877) +++ head/sys/geom/vinum/geom_vinum_events.c Mon May 10 19:12:23 2010 (r207878) @@ -58,6 +58,20 @@ gv_post_event(struct gv_softc *sc, int e mtx_unlock(&sc->equeue_mtx); } +void +gv_worker_exit(struct gv_softc *sc) +{ + struct gv_event *ev; + + ev = g_malloc(sizeof(*ev), M_WAITOK | M_ZERO); + ev->type = GV_EVENT_THREAD_EXIT; + + mtx_lock(&sc->equeue_mtx); + TAILQ_INSERT_TAIL(&sc->equeue, ev, events); + wakeup(sc); + msleep(sc->worker, &sc->equeue_mtx, PDROP, "gv_wor", 0); +} + struct gv_event * gv_get_event(struct gv_softc *sc) { Modified: head/sys/geom/vinum/geom_vinum_var.h ============================================================================== --- head/sys/geom/vinum/geom_vinum_var.h Mon May 10 19:08:53 2010 (r207877) +++ head/sys/geom/vinum/geom_vinum_var.h Mon May 10 19:12:23 2010 (r207878) @@ -238,6 +238,7 @@ struct gv_softc { struct bio_queue_head *bqueue_up; /* BIO queue for completed requests. */ struct g_geom *geom; /* Pointer to our VINUM geom. */ + struct proc *worker; /* Worker process. */ }; #endif From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:21:50 2010 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 8A10C1065670; Mon, 10 May 2010 19:21:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 78B5B8FC1C; Mon, 10 May 2010 19:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJLoTO044556; Mon, 10 May 2010 19:21:50 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJLoBZ044553; Mon, 10 May 2010 19:21:50 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005101921.o4AJLoBZ044553@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 10 May 2010 19:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207879 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:21:50 -0000 Author: jkim Date: Mon May 10 19:21:50 2010 New Revision: 207879 URL: http://svn.freebsd.org/changeset/base/207879 Log: MFC: r207330, r207620 - Remove dead code. Calculated greatest common divisor was not used at all. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the function to a header file and make it a static inline function. Modified: stable/8/sys/dev/sound/pcm/buffer.c stable/8/sys/dev/sound/pcm/buffer.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sound/pcm/buffer.c ============================================================================== --- stable/8/sys/dev/sound/pcm/buffer.c Mon May 10 19:12:23 2010 (r207878) +++ stable/8/sys/dev/sound/pcm/buffer.c Mon May 10 19:21:50 2010 (r207879) @@ -566,30 +566,6 @@ sndbuf_updateprevtotal(struct snd_dbuf * } unsigned int -snd_xbytes(unsigned int v, unsigned int from, unsigned int to) -{ - unsigned int w, x, y; - - if (from == to) - return v; - - if (from == 0 || to == 0 || v == 0) - return 0; - - x = from; - y = to; - while (y != 0) { - w = x % y; - x = y; - y = w; - } - from /= x; - to /= x; - - return (unsigned int)(((u_int64_t)v * to) / from); -} - -unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to) { if (from == NULL || to == NULL || v == 0) Modified: stable/8/sys/dev/sound/pcm/buffer.h ============================================================================== --- stable/8/sys/dev/sound/pcm/buffer.h Mon May 10 19:12:23 2010 (r207878) +++ stable/8/sys/dev/sound/pcm/buffer.h Mon May 10 19:21:50 2010 (r207879) @@ -111,7 +111,6 @@ u_int64_t sndbuf_getblocks(struct snd_db u_int64_t sndbuf_getprevblocks(struct snd_dbuf *b); u_int64_t sndbuf_gettotal(struct snd_dbuf *b); u_int64_t sndbuf_getprevtotal(struct snd_dbuf *b); -unsigned int snd_xbytes(unsigned int v, unsigned int from, unsigned int to); unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to); u_int8_t sndbuf_zerodata(u_int32_t fmt); void sndbuf_updateprevtotal(struct snd_dbuf *b); @@ -132,3 +131,14 @@ void sndbuf_dmabounce(struct snd_dbuf *b #ifdef OSSV4_EXPERIMENT void sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp); #endif + +static inline u_int32_t +snd_xbytes(u_int32_t v, u_int32_t from, u_int32_t to) +{ + + if (from == to) + return (v); + if (from == 0) + return (0); + return ((u_int64_t)v * to / from); +} From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:22:35 2010 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 304EA1065678; Mon, 10 May 2010 19:22:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1868FC15; Mon, 10 May 2010 19:22:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJMZXj044777; Mon, 10 May 2010 19:22:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJMYHU044774; Mon, 10 May 2010 19:22:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201005101922.o4AJMYHU044774@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 10 May 2010 19:22:34 +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: r207880 - stable/7/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:22:35 -0000 Author: jkim Date: Mon May 10 19:22:34 2010 New Revision: 207880 URL: http://svn.freebsd.org/changeset/base/207880 Log: MFC: r207330, r207620 - Remove dead code. Calculated greatest common divisor was not used at all. - Prefer u_int32_t over unsigned int to make its intention more clearer. - Move the function to a header file and make it a static inline function. Modified: stable/7/sys/dev/sound/pcm/buffer.c stable/7/sys/dev/sound/pcm/buffer.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pcm/buffer.c ============================================================================== --- stable/7/sys/dev/sound/pcm/buffer.c Mon May 10 19:21:50 2010 (r207879) +++ stable/7/sys/dev/sound/pcm/buffer.c Mon May 10 19:22:34 2010 (r207880) @@ -548,30 +548,6 @@ sndbuf_updateprevtotal(struct snd_dbuf * } unsigned int -snd_xbytes(unsigned int v, unsigned int from, unsigned int to) -{ - unsigned int w, x, y; - - if (from == to) - return v; - - if (from == 0 || to == 0 || v == 0) - return 0; - - x = from; - y = to; - while (y != 0) { - w = x % y; - x = y; - y = w; - } - from /= x; - to /= x; - - return (unsigned int)(((u_int64_t)v * to) / from); -} - -unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to) { if (from == NULL || to == NULL || v == 0) Modified: stable/7/sys/dev/sound/pcm/buffer.h ============================================================================== --- stable/7/sys/dev/sound/pcm/buffer.h Mon May 10 19:21:50 2010 (r207879) +++ stable/7/sys/dev/sound/pcm/buffer.h Mon May 10 19:22:34 2010 (r207880) @@ -110,7 +110,6 @@ unsigned int sndbuf_getreadyptr(struct s unsigned int sndbuf_getblocks(struct snd_dbuf *b); unsigned int sndbuf_getprevblocks(struct snd_dbuf *b); unsigned int sndbuf_gettotal(struct snd_dbuf *b); -unsigned int snd_xbytes(unsigned int v, unsigned int from, unsigned int to); unsigned int sndbuf_xbytes(unsigned int v, struct snd_dbuf *from, struct snd_dbuf *to); u_int8_t sndbuf_zerodata(u_int32_t fmt); void sndbuf_updateprevtotal(struct snd_dbuf *b); @@ -131,3 +130,14 @@ void sndbuf_dmabounce(struct snd_dbuf *b #ifdef OSSV4_EXPERIMENT void sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp); #endif + +static inline u_int32_t +snd_xbytes(u_int32_t v, u_int32_t from, u_int32_t to) +{ + + if (from == to) + return (v); + if (from == 0) + return (0); + return ((u_int64_t)v * to / from); +} From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:47:38 2010 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 42E6A106564A; Mon, 10 May 2010 19:47:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 30AD28FC08; Mon, 10 May 2010 19:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJlcko050337; Mon, 10 May 2010 19:47:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJlckg050334; Mon, 10 May 2010 19:47:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101947.o4AJlckg050334@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 19:47:38 +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: r207881 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:47:38 -0000 Author: yongari Date: Mon May 10 19:47:37 2010 New Revision: 207881 URL: http://svn.freebsd.org/changeset/base/207881 Log: MFC r207628,207635: r207628: Enable multi-descriptor transmisstion for fragmented mbufs. There is no more need to defragment mbufs. After transmitting the multi-fragmented frame, the controller updates only the first descriptor of multi-descriptor transmission so it's driver's responsibility to clear OWN bits of remaining descriptor of multi-descriptor transmission. It seems the controller behaves much like jme(4) controllers in descriptor handling. r207635: Free entire mbuf chain instead of the first mbuf. Modified: stable/8/sys/dev/sge/if_sge.c stable/8/sys/dev/sge/if_sgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Mon May 10 19:22:34 2010 (r207880) +++ stable/8/sys/dev/sge/if_sge.c Mon May 10 19:47:37 2010 (r207881) @@ -756,6 +756,8 @@ sge_dma_alloc(struct sge_softc *sc) { struct sge_chain_data *cd; struct sge_list_data *ld; + struct sge_rxdesc *rxd; + struct sge_txdesc *txd; int error, i; cd = &sc->sge_cdata; @@ -869,8 +871,12 @@ sge_dma_alloc(struct sge_softc *sc) /* Create DMA maps for Tx buffers. */ for (i = 0; i < SGE_TX_RING_CNT; i++) { + txd = &cd->sge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + txd->tx_ndesc = 0; error = bus_dmamap_create(cd->sge_txmbuf_tag, 0, - &cd->sge_tx_map[i]); + &txd->tx_dmamap); if (error != 0) { device_printf(sc->sge_dev, "could not create Tx DMA map.\n"); @@ -886,8 +892,11 @@ sge_dma_alloc(struct sge_softc *sc) } /* Create DMA maps for Rx buffers. */ for (i = 0; i < SGE_RX_RING_CNT; i++) { + rxd = &cd->sge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; error = bus_dmamap_create(cd->sge_rxmbuf_tag, 0, - &cd->sge_rx_map[i]); + &rxd->rx_dmamap); if (error) { device_printf(sc->sge_dev, "could not create Rx DMA map.\n"); @@ -903,6 +912,8 @@ sge_dma_free(struct sge_softc *sc) { struct sge_chain_data *cd; struct sge_list_data *ld; + struct sge_rxdesc *rxd; + struct sge_txdesc *txd; int i; cd = &sc->sge_cdata; @@ -934,10 +945,11 @@ sge_dma_free(struct sge_softc *sc) /* Rx buffers. */ if (cd->sge_rxmbuf_tag != NULL) { for (i = 0; i < SGE_RX_RING_CNT; i++) { - if (cd->sge_rx_map[i] != NULL) { + rxd = &cd->sge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { bus_dmamap_destroy(cd->sge_rxmbuf_tag, - cd->sge_rx_map[i]); - cd->sge_rx_map[i] = NULL; + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; } } if (cd->sge_rx_spare_map != NULL) { @@ -951,10 +963,11 @@ sge_dma_free(struct sge_softc *sc) /* Tx buffers. */ if (cd->sge_txmbuf_tag != NULL) { for (i = 0; i < SGE_TX_RING_CNT; i++) { - if (cd->sge_tx_map[i] != NULL) { + txd = &cd->sge_txdesc[i]; + if (txd->tx_dmamap != NULL) { bus_dmamap_destroy(cd->sge_txmbuf_tag, - cd->sge_tx_map[i]); - cd->sge_tx_map[i] = NULL; + txd->tx_dmamap); + txd->tx_dmamap = NULL; } } bus_dma_tag_destroy(cd->sge_txmbuf_tag); @@ -991,18 +1004,20 @@ static int sge_list_tx_free(struct sge_softc *sc) { struct sge_chain_data *cd; + struct sge_txdesc *txd; int i; SGE_LOCK_ASSERT(sc); cd = &sc->sge_cdata; for (i = 0; i < SGE_TX_RING_CNT; i++) { - if (cd->sge_tx_mbuf[i] != NULL) { - bus_dmamap_sync(cd->sge_txmbuf_tag, - cd->sge_tx_map[i], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(cd->sge_txmbuf_tag, - cd->sge_tx_map[i]); - m_free(cd->sge_tx_mbuf[i]); - cd->sge_tx_mbuf[i] = NULL; + txd = &cd->sge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(cd->sge_txmbuf_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(cd->sge_txmbuf_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + txd->tx_ndesc = 0; } } @@ -1037,18 +1052,20 @@ static int sge_list_rx_free(struct sge_softc *sc) { struct sge_chain_data *cd; + struct sge_rxdesc *rxd; int i; SGE_LOCK_ASSERT(sc); cd = &sc->sge_cdata; for (i = 0; i < SGE_RX_RING_CNT; i++) { - if (cd->sge_rx_mbuf[i] != NULL) { - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[i], + rxd = &cd->sge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(cd->sge_rxmbuf_tag, - cd->sge_rx_map[i]); - m_free(cd->sge_rx_mbuf[i]); - cd->sge_rx_mbuf[i] = NULL; + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; } } return (0); @@ -1063,6 +1080,7 @@ sge_newbuf(struct sge_softc *sc, int pro struct mbuf *m; struct sge_desc *desc; struct sge_chain_data *cd; + struct sge_rxdesc *rxd; bus_dma_segment_t segs[1]; bus_dmamap_t map; int error, nsegs; @@ -1082,17 +1100,18 @@ sge_newbuf(struct sge_softc *sc, int pro return (error); } KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - if (cd->sge_rx_mbuf[prod] != NULL) { - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod], + rxd = &cd->sge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod]); + bus_dmamap_unload(cd->sge_rxmbuf_tag, rxd->rx_dmamap); } - map = cd->sge_rx_map[prod]; - cd->sge_rx_map[prod] = cd->sge_rx_spare_map; + map = rxd->rx_dmamap; + rxd->rx_dmamap = cd->sge_rx_spare_map; cd->sge_rx_spare_map = map; - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod], + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); - cd->sge_rx_mbuf[prod] = m; + rxd->rx_m = m; desc = &sc->sge_ldata.sge_rx_ring[prod]; desc->sge_sts_size = 0; @@ -1178,7 +1197,7 @@ sge_rxeof(struct sge_softc *sc) ifp->if_ierrors++; continue; } - m = cd->sge_rx_mbuf[cons]; + m = cd->sge_rxdesc[cons].rx_m; if (sge_newbuf(sc, cons) != 0) { sge_discard_rxbuf(sc, cons); ifp->if_iqdrops++; @@ -1245,8 +1264,9 @@ sge_txeof(struct sge_softc *sc) struct ifnet *ifp; struct sge_list_data *ld; struct sge_chain_data *cd; + struct sge_txdesc *txd; uint32_t txstat; - int cons, prod; + int cons, nsegs, prod; SGE_LOCK_ASSERT(sc); @@ -1260,33 +1280,47 @@ sge_txeof(struct sge_softc *sc) BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); cons = cd->sge_tx_cons; prod = cd->sge_tx_prod; - for (; cons != prod; SGE_INC(cons, SGE_TX_RING_CNT)) { + for (; cons != prod;) { txstat = le32toh(ld->sge_tx_ring[cons].sge_cmdsts); if ((txstat & TDC_OWN) != 0) break; - cd->sge_tx_cnt--; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (cd->sge_tx_mbuf[cons] != NULL) { - bus_dmamap_sync(cd->sge_txmbuf_tag, - cd->sge_tx_map[cons], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(cd->sge_txmbuf_tag, - cd->sge_tx_map[cons]); - m_freem(cd->sge_tx_mbuf[cons]); - cd->sge_tx_mbuf[cons] = NULL; - if (SGE_TX_ERROR(txstat) != 0) { + /* + * Only the first descriptor of multi-descriptor transmission + * is updated by controller. Driver should skip entire + * chained buffers for the transmitted frame. In other words + * TDC_OWN bit is valid only at the first descriptor of a + * multi-descriptor transmission. + */ + if (SGE_TX_ERROR(txstat) != 0) { #ifdef SGE_SHOW_ERRORS - device_printf(sc->sge_dev, "Tx error : 0x%b\n", - txstat, TX_ERR_BITS); + device_printf(sc->sge_dev, "Tx error : 0x%b\n", + txstat, TX_ERR_BITS); #endif - ifp->if_oerrors++; - } else { + ifp->if_oerrors++; + } else { #ifdef notyet - ifp->if_collisions += (txstat & 0xFFFF) - 1; + ifp->if_collisions += (txstat & 0xFFFF) - 1; #endif - ifp->if_opackets++; - } + ifp->if_opackets++; } - + txd = &cd->sge_txdesc[cons]; + for (nsegs = 0; nsegs < txd->tx_ndesc; nsegs++) { + ld->sge_tx_ring[cons].sge_cmdsts = 0; + SGE_INC(cons, SGE_TX_RING_CNT); + } + /* Reclaim transmitted mbuf. */ + KASSERT(txd->tx_m != NULL, + ("%s: freeing NULL mbuf\n", __func__)); + bus_dmamap_sync(cd->sge_txmbuf_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(cd->sge_txmbuf_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + cd->sge_tx_cnt -= txd->tx_ndesc; + KASSERT(cd->sge_tx_cnt >= 0, + ("%s: Active Tx desc counter was garbled\n", __func__)); + txd->tx_ndesc = 0; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } cd->sge_tx_cons = cons; if (cd->sge_tx_cnt == 0) @@ -1388,73 +1422,78 @@ sge_encap(struct sge_softc *sc, struct m { struct mbuf *m; struct sge_desc *desc; + struct sge_txdesc *txd; bus_dma_segment_t txsegs[SGE_MAXTXSEGS]; - bus_dmamap_t map; uint32_t cflags; - int error, nsegs, prod; + int error, i, nsegs, prod, si; SGE_LOCK_ASSERT(sc); - prod = sc->sge_cdata.sge_tx_prod; - map = sc->sge_cdata.sge_tx_map[prod]; - /* - * Reading Windows inf file indicates SiS controller supports - * TSO, VLAN hardware tag insertion/stripping, interrupt - * moderation and Tx/Rx checksum offloading. Unfortunately - * vendor didn't release these information so we're guessing - * descriptor usage with trial and errors. - * - * Controller seems to support multi-fragmented buffers but - * don't know how to enable that feature so limit number of - * fragmented Tx buffers to single buffer until we understand - * the controller internals. - * I assume the controller can pad zero bytes if frame length - * is less than 60 bytes and I also think the controller has - * no Tx buffer alignment limitation. - Need testing! - */ - if ((*m_head)->m_next != NULL) { - m = m_defrag(*m_head, M_DONTWAIT); + si = prod = sc->sge_cdata.sge_tx_prod; + txd = &sc->sge_cdata.sge_txdesc[prod]; + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, + txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, SGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; return (ENOBUFS); } *m_head = m; - } - error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, map, - *m_head, txsegs, &nsegs, 0); - if (error != 0) { - m_freem(*m_head); - *m_head = NULL; + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, + txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); + } + } else if (error != 0) return (error); - } + + KASSERT(nsegs != 0, ("zero segment returned")); /* Check descriptor overrun. */ if (sc->sge_cdata.sge_tx_cnt + nsegs >= SGE_TX_RING_CNT) { - bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, map); + bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap); return (ENOBUFS); } - bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, map, + bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap, BUS_DMASYNC_PREWRITE); + m = *m_head; cflags = 0; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_IP) + if (m->m_pkthdr.csum_flags & CSUM_IP) cflags |= TDC_IP_CSUM; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_TCP) + if (m->m_pkthdr.csum_flags & CSUM_TCP) cflags |= TDC_TCP_CSUM; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_UDP) + if (m->m_pkthdr.csum_flags & CSUM_UDP) cflags |= TDC_UDP_CSUM; - desc = &sc->sge_ldata.sge_tx_ring[prod]; - desc->sge_sts_size = htole32((*m_head)->m_pkthdr.len); - desc->sge_ptr = htole32(SGE_ADDR_LO(txsegs[0].ds_addr)); - desc->sge_flags = htole32(txsegs[0].ds_len); - if (prod == SGE_TX_RING_CNT - 1) - desc->sge_flags |= htole32(RING_END); + for (i = 0; i < nsegs; i++) { + desc = &sc->sge_ldata.sge_tx_ring[prod]; + if (i == 0) { + desc->sge_sts_size = htole32(m->m_pkthdr.len); + desc->sge_cmdsts = 0; + } else { + desc->sge_sts_size = 0; + desc->sge_cmdsts = htole32(TDC_OWN); + } + desc->sge_ptr = htole32(SGE_ADDR_LO(txsegs[i].ds_addr)); + desc->sge_flags = htole32(txsegs[i].ds_len); + if (prod == SGE_TX_RING_CNT - 1) + desc->sge_flags |= htole32(RING_END); + sc->sge_cdata.sge_tx_cnt++; + SGE_INC(prod, SGE_TX_RING_CNT); + } + /* Update producer index. */ + sc->sge_cdata.sge_tx_prod = prod; + + desc = &sc->sge_ldata.sge_tx_ring[si]; /* Configure VLAN. */ - if(((*m_head)->m_flags & M_VLANTAG) != 0) { - cflags |= (*m_head)->m_pkthdr.ether_vtag; + if((m->m_flags & M_VLANTAG) != 0) { + cflags |= m->m_pkthdr.ether_vtag; desc->sge_sts_size |= htole32(TDS_INS_VLAN); } - desc->sge_cmdsts = htole32(TDC_DEF | TDC_CRC | TDC_PAD | cflags); + desc->sge_cmdsts |= htole32(TDC_DEF | TDC_CRC | TDC_PAD | cflags); #if 1 if ((sc->sge_flags & SGE_FLAG_SPEED_1000) != 0) desc->sge_cmdsts |= htole32(TDC_BST); @@ -1466,13 +1505,9 @@ sge_encap(struct sge_softc *sc, struct m } #endif /* Request interrupt and give ownership to controller. */ - if ((prod % SGE_TX_INTR_FRAMES) == 0) - desc->sge_cmdsts |= htole32(TDC_OWN | TDC_INTR); - else - desc->sge_cmdsts |= htole32(TDC_OWN); - sc->sge_cdata.sge_tx_mbuf[prod] = *m_head; - sc->sge_cdata.sge_tx_cnt++; - SGE_INC(sc->sge_cdata.sge_tx_prod, SGE_TX_RING_CNT); + desc->sge_cmdsts |= htole32(TDC_OWN | TDC_INTR); + txd->tx_m = m; + txd->tx_ndesc = nsegs; return (0); } @@ -1503,7 +1538,8 @@ sge_start_locked(struct ifnet *ifp) return; for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd); ) { - if (sc->sge_cdata.sge_tx_cnt == SGE_TX_RING_CNT - 1) { + if (sc->sge_cdata.sge_tx_cnt > (SGE_TX_RING_CNT - + SGE_MAXTXSEGS)) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } Modified: stable/8/sys/dev/sge/if_sgereg.h ============================================================================== --- stable/8/sys/dev/sge/if_sgereg.h Mon May 10 19:22:34 2010 (r207880) +++ stable/8/sys/dev/sge/if_sgereg.h Mon May 10 19:47:37 2010 (r207881) @@ -283,7 +283,7 @@ struct sge_desc { #define SGE_RX_RING_CNT 256 /* [8, 1024] */ #define SGE_TX_RING_CNT 256 /* [8, 8192] */ #define SGE_DESC_ALIGN 16 -#define SGE_MAXTXSEGS 1 +#define SGE_MAXTXSEGS 16 #define SGE_RX_BUF_ALIGN sizeof(uint64_t) #define SGE_RX_RING_SZ (SGE_RX_RING_CNT * sizeof(struct sge_desc)) @@ -298,6 +298,17 @@ struct sge_list_data { bus_addr_t sge_tx_paddr; }; +struct sge_txdesc { + struct mbuf *tx_m; + bus_dmamap_t tx_dmamap; + int tx_ndesc; +}; + +struct sge_rxdesc { + struct mbuf *rx_m; + bus_dmamap_t rx_dmamap; +}; + struct sge_chain_data { bus_dma_tag_t sge_tag; bus_dma_tag_t sge_rx_tag; @@ -306,11 +317,9 @@ struct sge_chain_data { bus_dmamap_t sge_tx_dmamap; bus_dma_tag_t sge_txmbuf_tag; bus_dma_tag_t sge_rxmbuf_tag; - struct mbuf *sge_rx_mbuf[SGE_RX_RING_CNT]; - struct mbuf *sge_tx_mbuf[SGE_TX_RING_CNT]; - bus_dmamap_t sge_rx_map[SGE_RX_RING_CNT]; + struct sge_txdesc sge_txdesc[SGE_TX_RING_CNT]; + struct sge_rxdesc sge_rxdesc[SGE_RX_RING_CNT]; bus_dmamap_t sge_rx_spare_map; - bus_dmamap_t sge_tx_map[SGE_TX_RING_CNT]; int sge_rx_cons; int sge_tx_prod; int sge_tx_cons; From owner-svn-src-all@FreeBSD.ORG Mon May 10 19:54:01 2010 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 A5928106566B; Mon, 10 May 2010 19:54:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9377A8FC08; Mon, 10 May 2010 19:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AJs15A051837; Mon, 10 May 2010 19:54:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AJs12V051834; Mon, 10 May 2010 19:54:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005101954.o4AJs12V051834@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 19:54:01 +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: r207882 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 19:54:01 -0000 Author: yongari Date: Mon May 10 19:54:01 2010 New Revision: 207882 URL: http://svn.freebsd.org/changeset/base/207882 Log: MFC r207628,207635: r207628: Enable multi-descriptor transmisstion for fragmented mbufs. There is no more need to defragment mbufs. After transmitting the multi-fragmented frame, the controller updates only the first descriptor of multi-descriptor transmission so it's driver's responsibility to clear OWN bits of remaining descriptor of multi-descriptor transmission. It seems the controller behaves much like jme(4) controllers in descriptor handling. r207635: Free entire mbuf chain instead of the first mbuf. Modified: stable/7/sys/dev/sge/if_sge.c stable/7/sys/dev/sge/if_sgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Mon May 10 19:47:37 2010 (r207881) +++ stable/7/sys/dev/sge/if_sge.c Mon May 10 19:54:01 2010 (r207882) @@ -756,6 +756,8 @@ sge_dma_alloc(struct sge_softc *sc) { struct sge_chain_data *cd; struct sge_list_data *ld; + struct sge_rxdesc *rxd; + struct sge_txdesc *txd; int error, i; cd = &sc->sge_cdata; @@ -869,8 +871,12 @@ sge_dma_alloc(struct sge_softc *sc) /* Create DMA maps for Tx buffers. */ for (i = 0; i < SGE_TX_RING_CNT; i++) { + txd = &cd->sge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + txd->tx_ndesc = 0; error = bus_dmamap_create(cd->sge_txmbuf_tag, 0, - &cd->sge_tx_map[i]); + &txd->tx_dmamap); if (error != 0) { device_printf(sc->sge_dev, "could not create Tx DMA map.\n"); @@ -886,8 +892,11 @@ sge_dma_alloc(struct sge_softc *sc) } /* Create DMA maps for Rx buffers. */ for (i = 0; i < SGE_RX_RING_CNT; i++) { + rxd = &cd->sge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; error = bus_dmamap_create(cd->sge_rxmbuf_tag, 0, - &cd->sge_rx_map[i]); + &rxd->rx_dmamap); if (error) { device_printf(sc->sge_dev, "could not create Rx DMA map.\n"); @@ -903,6 +912,8 @@ sge_dma_free(struct sge_softc *sc) { struct sge_chain_data *cd; struct sge_list_data *ld; + struct sge_rxdesc *rxd; + struct sge_txdesc *txd; int i; cd = &sc->sge_cdata; @@ -934,10 +945,11 @@ sge_dma_free(struct sge_softc *sc) /* Rx buffers. */ if (cd->sge_rxmbuf_tag != NULL) { for (i = 0; i < SGE_RX_RING_CNT; i++) { - if (cd->sge_rx_map[i] != NULL) { + rxd = &cd->sge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { bus_dmamap_destroy(cd->sge_rxmbuf_tag, - cd->sge_rx_map[i]); - cd->sge_rx_map[i] = NULL; + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; } } if (cd->sge_rx_spare_map != NULL) { @@ -951,10 +963,11 @@ sge_dma_free(struct sge_softc *sc) /* Tx buffers. */ if (cd->sge_txmbuf_tag != NULL) { for (i = 0; i < SGE_TX_RING_CNT; i++) { - if (cd->sge_tx_map[i] != NULL) { + txd = &cd->sge_txdesc[i]; + if (txd->tx_dmamap != NULL) { bus_dmamap_destroy(cd->sge_txmbuf_tag, - cd->sge_tx_map[i]); - cd->sge_tx_map[i] = NULL; + txd->tx_dmamap); + txd->tx_dmamap = NULL; } } bus_dma_tag_destroy(cd->sge_txmbuf_tag); @@ -991,18 +1004,20 @@ static int sge_list_tx_free(struct sge_softc *sc) { struct sge_chain_data *cd; + struct sge_txdesc *txd; int i; SGE_LOCK_ASSERT(sc); cd = &sc->sge_cdata; for (i = 0; i < SGE_TX_RING_CNT; i++) { - if (cd->sge_tx_mbuf[i] != NULL) { - bus_dmamap_sync(cd->sge_txmbuf_tag, - cd->sge_tx_map[i], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(cd->sge_txmbuf_tag, - cd->sge_tx_map[i]); - m_free(cd->sge_tx_mbuf[i]); - cd->sge_tx_mbuf[i] = NULL; + txd = &cd->sge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(cd->sge_txmbuf_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(cd->sge_txmbuf_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + txd->tx_ndesc = 0; } } @@ -1037,18 +1052,20 @@ static int sge_list_rx_free(struct sge_softc *sc) { struct sge_chain_data *cd; + struct sge_rxdesc *rxd; int i; SGE_LOCK_ASSERT(sc); cd = &sc->sge_cdata; for (i = 0; i < SGE_RX_RING_CNT; i++) { - if (cd->sge_rx_mbuf[i] != NULL) { - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[i], + rxd = &cd->sge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(cd->sge_rxmbuf_tag, - cd->sge_rx_map[i]); - m_free(cd->sge_rx_mbuf[i]); - cd->sge_rx_mbuf[i] = NULL; + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; } } return (0); @@ -1063,6 +1080,7 @@ sge_newbuf(struct sge_softc *sc, int pro struct mbuf *m; struct sge_desc *desc; struct sge_chain_data *cd; + struct sge_rxdesc *rxd; bus_dma_segment_t segs[1]; bus_dmamap_t map; int error, nsegs; @@ -1082,17 +1100,18 @@ sge_newbuf(struct sge_softc *sc, int pro return (error); } KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - if (cd->sge_rx_mbuf[prod] != NULL) { - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod], + rxd = &cd->sge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod]); + bus_dmamap_unload(cd->sge_rxmbuf_tag, rxd->rx_dmamap); } - map = cd->sge_rx_map[prod]; - cd->sge_rx_map[prod] = cd->sge_rx_spare_map; + map = rxd->rx_dmamap; + rxd->rx_dmamap = cd->sge_rx_spare_map; cd->sge_rx_spare_map = map; - bus_dmamap_sync(cd->sge_rxmbuf_tag, cd->sge_rx_map[prod], + bus_dmamap_sync(cd->sge_rxmbuf_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); - cd->sge_rx_mbuf[prod] = m; + rxd->rx_m = m; desc = &sc->sge_ldata.sge_rx_ring[prod]; desc->sge_sts_size = 0; @@ -1178,7 +1197,7 @@ sge_rxeof(struct sge_softc *sc) ifp->if_ierrors++; continue; } - m = cd->sge_rx_mbuf[cons]; + m = cd->sge_rxdesc[cons].rx_m; if (sge_newbuf(sc, cons) != 0) { sge_discard_rxbuf(sc, cons); ifp->if_iqdrops++; @@ -1245,8 +1264,9 @@ sge_txeof(struct sge_softc *sc) struct ifnet *ifp; struct sge_list_data *ld; struct sge_chain_data *cd; + struct sge_txdesc *txd; uint32_t txstat; - int cons, prod; + int cons, nsegs, prod; SGE_LOCK_ASSERT(sc); @@ -1260,33 +1280,47 @@ sge_txeof(struct sge_softc *sc) BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); cons = cd->sge_tx_cons; prod = cd->sge_tx_prod; - for (; cons != prod; SGE_INC(cons, SGE_TX_RING_CNT)) { + for (; cons != prod;) { txstat = le32toh(ld->sge_tx_ring[cons].sge_cmdsts); if ((txstat & TDC_OWN) != 0) break; - cd->sge_tx_cnt--; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - if (cd->sge_tx_mbuf[cons] != NULL) { - bus_dmamap_sync(cd->sge_txmbuf_tag, - cd->sge_tx_map[cons], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(cd->sge_txmbuf_tag, - cd->sge_tx_map[cons]); - m_freem(cd->sge_tx_mbuf[cons]); - cd->sge_tx_mbuf[cons] = NULL; - if (SGE_TX_ERROR(txstat) != 0) { + /* + * Only the first descriptor of multi-descriptor transmission + * is updated by controller. Driver should skip entire + * chained buffers for the transmitted frame. In other words + * TDC_OWN bit is valid only at the first descriptor of a + * multi-descriptor transmission. + */ + if (SGE_TX_ERROR(txstat) != 0) { #ifdef SGE_SHOW_ERRORS - device_printf(sc->sge_dev, "Tx error : 0x%b\n", - txstat, TX_ERR_BITS); + device_printf(sc->sge_dev, "Tx error : 0x%b\n", + txstat, TX_ERR_BITS); #endif - ifp->if_oerrors++; - } else { + ifp->if_oerrors++; + } else { #ifdef notyet - ifp->if_collisions += (txstat & 0xFFFF) - 1; + ifp->if_collisions += (txstat & 0xFFFF) - 1; #endif - ifp->if_opackets++; - } + ifp->if_opackets++; } - + txd = &cd->sge_txdesc[cons]; + for (nsegs = 0; nsegs < txd->tx_ndesc; nsegs++) { + ld->sge_tx_ring[cons].sge_cmdsts = 0; + SGE_INC(cons, SGE_TX_RING_CNT); + } + /* Reclaim transmitted mbuf. */ + KASSERT(txd->tx_m != NULL, + ("%s: freeing NULL mbuf\n", __func__)); + bus_dmamap_sync(cd->sge_txmbuf_tag, txd->tx_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(cd->sge_txmbuf_tag, txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + cd->sge_tx_cnt -= txd->tx_ndesc; + KASSERT(cd->sge_tx_cnt >= 0, + ("%s: Active Tx desc counter was garbled\n", __func__)); + txd->tx_ndesc = 0; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } cd->sge_tx_cons = cons; if (cd->sge_tx_cnt == 0) @@ -1388,73 +1422,78 @@ sge_encap(struct sge_softc *sc, struct m { struct mbuf *m; struct sge_desc *desc; + struct sge_txdesc *txd; bus_dma_segment_t txsegs[SGE_MAXTXSEGS]; - bus_dmamap_t map; uint32_t cflags; - int error, nsegs, prod; + int error, i, nsegs, prod, si; SGE_LOCK_ASSERT(sc); - prod = sc->sge_cdata.sge_tx_prod; - map = sc->sge_cdata.sge_tx_map[prod]; - /* - * Reading Windows inf file indicates SiS controller supports - * TSO, VLAN hardware tag insertion/stripping, interrupt - * moderation and Tx/Rx checksum offloading. Unfortunately - * vendor didn't release these information so we're guessing - * descriptor usage with trial and errors. - * - * Controller seems to support multi-fragmented buffers but - * don't know how to enable that feature so limit number of - * fragmented Tx buffers to single buffer until we understand - * the controller internals. - * I assume the controller can pad zero bytes if frame length - * is less than 60 bytes and I also think the controller has - * no Tx buffer alignment limitation. - Need testing! - */ - if ((*m_head)->m_next != NULL) { - m = m_defrag(*m_head, M_DONTWAIT); + si = prod = sc->sge_cdata.sge_tx_prod; + txd = &sc->sge_cdata.sge_txdesc[prod]; + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, + txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); + if (error == EFBIG) { + m = m_collapse(*m_head, M_DONTWAIT, SGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; return (ENOBUFS); } *m_head = m; - } - error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, map, - *m_head, txsegs, &nsegs, 0); - if (error != 0) { - m_freem(*m_head); - *m_head = NULL; + error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, + txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); + if (error != 0) { + m_freem(*m_head); + *m_head = NULL; + return (error); + } + } else if (error != 0) return (error); - } + + KASSERT(nsegs != 0, ("zero segment returned")); /* Check descriptor overrun. */ if (sc->sge_cdata.sge_tx_cnt + nsegs >= SGE_TX_RING_CNT) { - bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, map); + bus_dmamap_unload(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap); return (ENOBUFS); } - bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, map, + bus_dmamap_sync(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap, BUS_DMASYNC_PREWRITE); + m = *m_head; cflags = 0; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_IP) + if (m->m_pkthdr.csum_flags & CSUM_IP) cflags |= TDC_IP_CSUM; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_TCP) + if (m->m_pkthdr.csum_flags & CSUM_TCP) cflags |= TDC_TCP_CSUM; - if ((*m_head)->m_pkthdr.csum_flags & CSUM_UDP) + if (m->m_pkthdr.csum_flags & CSUM_UDP) cflags |= TDC_UDP_CSUM; - desc = &sc->sge_ldata.sge_tx_ring[prod]; - desc->sge_sts_size = htole32((*m_head)->m_pkthdr.len); - desc->sge_ptr = htole32(SGE_ADDR_LO(txsegs[0].ds_addr)); - desc->sge_flags = htole32(txsegs[0].ds_len); - if (prod == SGE_TX_RING_CNT - 1) - desc->sge_flags |= htole32(RING_END); + for (i = 0; i < nsegs; i++) { + desc = &sc->sge_ldata.sge_tx_ring[prod]; + if (i == 0) { + desc->sge_sts_size = htole32(m->m_pkthdr.len); + desc->sge_cmdsts = 0; + } else { + desc->sge_sts_size = 0; + desc->sge_cmdsts = htole32(TDC_OWN); + } + desc->sge_ptr = htole32(SGE_ADDR_LO(txsegs[i].ds_addr)); + desc->sge_flags = htole32(txsegs[i].ds_len); + if (prod == SGE_TX_RING_CNT - 1) + desc->sge_flags |= htole32(RING_END); + sc->sge_cdata.sge_tx_cnt++; + SGE_INC(prod, SGE_TX_RING_CNT); + } + /* Update producer index. */ + sc->sge_cdata.sge_tx_prod = prod; + + desc = &sc->sge_ldata.sge_tx_ring[si]; /* Configure VLAN. */ - if(((*m_head)->m_flags & M_VLANTAG) != 0) { - cflags |= (*m_head)->m_pkthdr.ether_vtag; + if((m->m_flags & M_VLANTAG) != 0) { + cflags |= m->m_pkthdr.ether_vtag; desc->sge_sts_size |= htole32(TDS_INS_VLAN); } - desc->sge_cmdsts = htole32(TDC_DEF | TDC_CRC | TDC_PAD | cflags); + desc->sge_cmdsts |= htole32(TDC_DEF | TDC_CRC | TDC_PAD | cflags); #if 1 if ((sc->sge_flags & SGE_FLAG_SPEED_1000) != 0) desc->sge_cmdsts |= htole32(TDC_BST); @@ -1466,13 +1505,9 @@ sge_encap(struct sge_softc *sc, struct m } #endif /* Request interrupt and give ownership to controller. */ - if ((prod % SGE_TX_INTR_FRAMES) == 0) - desc->sge_cmdsts |= htole32(TDC_OWN | TDC_INTR); - else - desc->sge_cmdsts |= htole32(TDC_OWN); - sc->sge_cdata.sge_tx_mbuf[prod] = *m_head; - sc->sge_cdata.sge_tx_cnt++; - SGE_INC(sc->sge_cdata.sge_tx_prod, SGE_TX_RING_CNT); + desc->sge_cmdsts |= htole32(TDC_OWN | TDC_INTR); + txd->tx_m = m; + txd->tx_ndesc = nsegs; return (0); } @@ -1503,7 +1538,8 @@ sge_start_locked(struct ifnet *ifp) return; for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd); ) { - if (sc->sge_cdata.sge_tx_cnt == SGE_TX_RING_CNT - 1) { + if (sc->sge_cdata.sge_tx_cnt > (SGE_TX_RING_CNT - + SGE_MAXTXSEGS)) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } Modified: stable/7/sys/dev/sge/if_sgereg.h ============================================================================== --- stable/7/sys/dev/sge/if_sgereg.h Mon May 10 19:47:37 2010 (r207881) +++ stable/7/sys/dev/sge/if_sgereg.h Mon May 10 19:54:01 2010 (r207882) @@ -283,7 +283,7 @@ struct sge_desc { #define SGE_RX_RING_CNT 256 /* [8, 1024] */ #define SGE_TX_RING_CNT 256 /* [8, 8192] */ #define SGE_DESC_ALIGN 16 -#define SGE_MAXTXSEGS 1 +#define SGE_MAXTXSEGS 16 #define SGE_RX_BUF_ALIGN sizeof(uint64_t) #define SGE_RX_RING_SZ (SGE_RX_RING_CNT * sizeof(struct sge_desc)) @@ -298,6 +298,17 @@ struct sge_list_data { bus_addr_t sge_tx_paddr; }; +struct sge_txdesc { + struct mbuf *tx_m; + bus_dmamap_t tx_dmamap; + int tx_ndesc; +}; + +struct sge_rxdesc { + struct mbuf *rx_m; + bus_dmamap_t rx_dmamap; +}; + struct sge_chain_data { bus_dma_tag_t sge_tag; bus_dma_tag_t sge_rx_tag; @@ -306,11 +317,9 @@ struct sge_chain_data { bus_dmamap_t sge_tx_dmamap; bus_dma_tag_t sge_txmbuf_tag; bus_dma_tag_t sge_rxmbuf_tag; - struct mbuf *sge_rx_mbuf[SGE_RX_RING_CNT]; - struct mbuf *sge_tx_mbuf[SGE_TX_RING_CNT]; - bus_dmamap_t sge_rx_map[SGE_RX_RING_CNT]; + struct sge_txdesc sge_txdesc[SGE_TX_RING_CNT]; + struct sge_rxdesc sge_rxdesc[SGE_RX_RING_CNT]; bus_dmamap_t sge_rx_spare_map; - bus_dmamap_t sge_tx_map[SGE_TX_RING_CNT]; int sge_rx_cons; int sge_tx_prod; int sge_tx_cons; From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:00:50 2010 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 CF7D41065674; Mon, 10 May 2010 20:00:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BD7ED8FC0C; Mon, 10 May 2010 20:00:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AK0oGF053453; Mon, 10 May 2010 20:00:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AK0oVq053448; Mon, 10 May 2010 20:00:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102000.o4AK0oVq053448@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207883 - in stable/7/sys: dev/ofw powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2010 20:00:50 -0000 Author: marius Date: Mon May 10 20:00:50 2010 New Revision: 207883 URL: http://svn.freebsd.org/changeset/base/207883 Log: Partial MFC 186347 and 186355 in order to remove differences in headers required. Modified: stable/7/sys/dev/ofw/openfirm.h stable/7/sys/powerpc/include/ofw_machdep.h stable/7/sys/sparc64/include/ofw_machdep.h stable/7/sys/sun4v/include/ofw_machdep.h Modified: stable/7/sys/dev/ofw/openfirm.h ============================================================================== --- stable/7/sys/dev/ofw/openfirm.h Mon May 10 19:54:01 2010 (r207882) +++ stable/7/sys/dev/ofw/openfirm.h Mon May 10 20:00:50 2010 (r207883) @@ -74,6 +74,8 @@ typedef unsigned int phandle_t; #include #include +#include + MALLOC_DECLARE(M_OFWPROP); /* Modified: stable/7/sys/powerpc/include/ofw_machdep.h ============================================================================== --- stable/7/sys/powerpc/include/ofw_machdep.h Mon May 10 19:54:01 2010 (r207882) +++ stable/7/sys/powerpc/include/ofw_machdep.h Mon May 10 20:00:50 2010 (r207883) @@ -28,7 +28,11 @@ #ifndef _MACHINE_OFW_MACHDEP_H_ #define _MACHINE_OFW_MACHDEP_H_ +#include +#include +#include #include +#include int OF_decode_addr(phandle_t, int, bus_space_tag_t *, bus_space_handle_t *); void OF_getetheraddr(device_t dev, u_char *addr); Modified: stable/7/sys/sparc64/include/ofw_machdep.h ============================================================================== --- stable/7/sys/sparc64/include/ofw_machdep.h Mon May 10 19:54:01 2010 (r207882) +++ stable/7/sys/sparc64/include/ofw_machdep.h Mon May 10 20:00:50 2010 (r207883) @@ -29,6 +29,8 @@ #define _MACHINE_OFW_MACHDEP_H_ #include +#include +#include int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); Modified: stable/7/sys/sun4v/include/ofw_machdep.h ============================================================================== --- stable/7/sys/sun4v/include/ofw_machdep.h Mon May 10 19:54:01 2010 (r207882) +++ stable/7/sys/sun4v/include/ofw_machdep.h Mon May 10 20:00:50 2010 (r207883) @@ -29,6 +29,8 @@ #define _MACHINE_OFW_MACHDEP_H_ #include +#include +#include int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:01:52 2010 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 4CB36106566B; Mon, 10 May 2010 20:01:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7FE8FC0C; Mon, 10 May 2010 20:01:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AK1qCq053725; Mon, 10 May 2010 20:01:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AK1qCB053723; Mon, 10 May 2010 20:01:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005102001.o4AK1qCB053723@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 20:01:52 +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: r207884 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:01:52 -0000 Author: yongari Date: Mon May 10 20:01:51 2010 New Revision: 207884 URL: http://svn.freebsd.org/changeset/base/207884 Log: MFC r207622-207623,207638 r207622: Drop driver lock before exiting from interrupt handler. r207623: Make sure to check whether driver is running before processing received frames. Also check driver has valid ifp pointer before calling msk_stop() in device_shutdown handler. While I'm here remove unnecessary accesses to interrupt mask registers in device_shutdown handler because driver puts the controller into reset state. With these changes, msk(4) now survive from heavy RX traffic(1byte UDP frame) while reboot is in progress. r207638: When VLAN hardware tagging is disabled, make sure to disable VLAN checksum offloading as well as TSO over VLAN. Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Mon May 10 20:00:50 2010 (r207883) +++ stable/8/sys/dev/msk/if_msk.c Mon May 10 20:01:51 2010 (r207884) @@ -1017,7 +1017,8 @@ msk_ioctl(struct ifnet *ifp, u_long comm (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if ((IFCAP_VLAN_HWTAGGING & ifp->if_capenable) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + ifp->if_capenable &= + ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); msk_setvlan(sc_if, ifp); } if (ifp->if_mtu > ETHERMTU && @@ -2828,20 +2829,15 @@ mskc_shutdown(device_t dev) sc = device_get_softc(dev); MSK_LOCK(sc); for (i = 0; i < sc->msk_num_port; i++) { - if (sc->msk_if[i] != NULL) + if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && + ((sc->msk_if[i]->msk_ifp->if_drv_flags & + IFF_DRV_RUNNING) != 0)) msk_stop(sc->msk_if[i]); } - - /* Disable all interrupts. */ - CSR_WRITE_4(sc, B0_IMSK, 0); - CSR_READ_4(sc, B0_IMSK); - CSR_WRITE_4(sc, B0_HWE_IMSK, 0); - CSR_READ_4(sc, B0_HWE_IMSK); + MSK_UNLOCK(sc); /* Put hardware reset. */ CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - - MSK_UNLOCK(sc); return (0); } @@ -3376,6 +3372,8 @@ msk_handle_events(struct msk_softc *sc) sc_if->msk_vtag = ntohs(len); break; case OP_RXSTAT: + if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING)) + break; if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) msk_jumbo_rxeof(sc_if, status, control, len); @@ -3445,6 +3443,7 @@ msk_intr(void *xsc) (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || (status & sc->msk_intrmask) == 0) { CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); + MSK_UNLOCK(sc); return; } From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:02:40 2010 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 54DB6106566C; Mon, 10 May 2010 20:02:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0C3B18FC19; Mon, 10 May 2010 20:02:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AK2dmd053956; Mon, 10 May 2010 20:02:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AK2dJ4053954; Mon, 10 May 2010 20:02:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102002.o4AK2dJ4053954@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:02: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: r207885 - head/sys/dev/esp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:02:40 -0000 Author: marius Date: Mon May 10 20:02:39 2010 New Revision: 207885 URL: http://svn.freebsd.org/changeset/base/207885 Log: Include for OF_getscsinitid(). Modified: head/sys/dev/esp/esp_sbus.c Modified: head/sys/dev/esp/esp_sbus.c ============================================================================== --- head/sys/dev/esp/esp_sbus.c Mon May 10 20:01:51 2010 (r207884) +++ head/sys/dev/esp/esp_sbus.c Mon May 10 20:02:39 2010 (r207885) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:08:01 2010 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 BFD961065677; Mon, 10 May 2010 20:08:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id AE9A18FC18; Mon, 10 May 2010 20:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AK81dI055271; Mon, 10 May 2010 20:08:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AK81mN055269; Mon, 10 May 2010 20:08:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201005102008.o4AK81mN055269@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 10 May 2010 20:08:01 +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: r207886 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:08:01 -0000 Author: yongari Date: Mon May 10 20:08:01 2010 New Revision: 207886 URL: http://svn.freebsd.org/changeset/base/207886 Log: MFC r207622-207623,207638 r207622: Drop driver lock before exiting from interrupt handler. r207623: Make sure to check whether driver is running before processing received frames. Also check driver has valid ifp pointer before calling msk_stop() in device_shutdown handler. While I'm here remove unnecessary accesses to interrupt mask registers in device_shutdown handler because driver puts the controller into reset state. With these changes, msk(4) now survive from heavy RX traffic(1byte UDP frame) while reboot is in progress. r207638: When VLAN hardware tagging is disabled, make sure to disable VLAN checksum offloading as well as TSO over VLAN. Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon May 10 20:02:39 2010 (r207885) +++ stable/7/sys/dev/msk/if_msk.c Mon May 10 20:08:01 2010 (r207886) @@ -1017,7 +1017,8 @@ msk_ioctl(struct ifnet *ifp, u_long comm (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if ((IFCAP_VLAN_HWTAGGING & ifp->if_capenable) == 0) - ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; + ifp->if_capenable &= + ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); msk_setvlan(sc_if, ifp); } if (ifp->if_mtu > ETHERMTU && @@ -2828,20 +2829,15 @@ mskc_shutdown(device_t dev) sc = device_get_softc(dev); MSK_LOCK(sc); for (i = 0; i < sc->msk_num_port; i++) { - if (sc->msk_if[i] != NULL) + if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && + ((sc->msk_if[i]->msk_ifp->if_drv_flags & + IFF_DRV_RUNNING) != 0)) msk_stop(sc->msk_if[i]); } - - /* Disable all interrupts. */ - CSR_WRITE_4(sc, B0_IMSK, 0); - CSR_READ_4(sc, B0_IMSK); - CSR_WRITE_4(sc, B0_HWE_IMSK, 0); - CSR_READ_4(sc, B0_HWE_IMSK); + MSK_UNLOCK(sc); /* Put hardware reset. */ CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - - MSK_UNLOCK(sc); return (0); } @@ -3376,6 +3372,8 @@ msk_handle_events(struct msk_softc *sc) sc_if->msk_vtag = ntohs(len); break; case OP_RXSTAT: + if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING)) + break; if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) msk_jumbo_rxeof(sc_if, status, control, len); @@ -3445,6 +3443,7 @@ msk_intr(void *xsc) (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || (status & sc->msk_intrmask) == 0) { CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); + MSK_UNLOCK(sc); return; } From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:10:46 2010 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 25615106564A; Mon, 10 May 2010 20:10:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 148158FC12; Mon, 10 May 2010 20:10:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKAj3I055896; Mon, 10 May 2010 20:10:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKAjFi055894; Mon, 10 May 2010 20:10:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102010.o4AKAjFi055894@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:10:45 +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: r207887 - stable/8/sys/dev/quicc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:10:46 -0000 Author: marius Date: Mon May 10 20:10:45 2010 New Revision: 207887 URL: http://svn.freebsd.org/changeset/base/207887 Log: MFC: r207532 Remove a soft member which was never used. Modified: stable/8/sys/dev/quicc/quicc_bfe.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/quicc/quicc_bfe.h ============================================================================== --- stable/8/sys/dev/quicc/quicc_bfe.h Mon May 10 20:08:01 2010 (r207886) +++ stable/8/sys/dev/quicc/quicc_bfe.h Mon May 10 20:10:45 2010 (r207887) @@ -50,7 +50,6 @@ struct quicc_softc { u_int sc_clock; int sc_fastintr:1; - int sc_leaving:1; int sc_polled:1; }; From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:15:39 2010 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 A15241065670; Mon, 10 May 2010 20:15:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 908708FC0C; Mon, 10 May 2010 20:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKFdnF057022; Mon, 10 May 2010 20:15:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKFd3n057020; Mon, 10 May 2010 20:15:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102015.o4AKFd3n057020@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:15:39 +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: r207888 - stable/8/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:15:39 -0000 Author: marius Date: Mon May 10 20:15:39 2010 New Revision: 207888 URL: http://svn.freebsd.org/changeset/base/207888 Log: MFC: r207533 (partial) Remove redundant checking of sc_leaving (uart_intr() already handles this). Modified: stable/8/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/8/sys/dev/uart/uart_dev_ns8250.c Mon May 10 20:10:45 2010 (r207887) +++ stable/8/sys/dev/uart/uart_dev_ns8250.c Mon May 10 20:15:39 2010 (r207888) @@ -604,7 +604,7 @@ ns8250_bus_ipend(struct uart_softc *sc) if (ipend == 0) ns8250_clrint(bas); uart_unlock(sc->sc_hwmtx); - return ((sc->sc_leaving) ? 0 : ipend); + return (ipend); } static int From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:15:40 2010 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 C12BF1065672; Mon, 10 May 2010 20:15:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B07128FC12; Mon, 10 May 2010 20:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKFeiL057082; Mon, 10 May 2010 20:15:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKFet9057080; Mon, 10 May 2010 20:15:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102015.o4AKFet9057080@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:15:40 +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: r207889 - stable/7/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:15:40 -0000 Author: marius Date: Mon May 10 20:15:40 2010 New Revision: 207889 URL: http://svn.freebsd.org/changeset/base/207889 Log: MFC: r207533 (partial) Remove redundant checking of sc_leaving (uart_intr() already handles this). Modified: stable/7/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/7/sys/dev/uart/uart_dev_ns8250.c Mon May 10 20:15:39 2010 (r207888) +++ stable/7/sys/dev/uart/uart_dev_ns8250.c Mon May 10 20:15:40 2010 (r207889) @@ -580,7 +580,7 @@ ns8250_bus_ipend(struct uart_softc *sc) if (ipend == 0) ns8250_clrint(bas); uart_unlock(sc->sc_hwmtx); - return ((sc->sc_leaving) ? 0 : ipend); + return (ipend); } static int From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:25:51 2010 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 DC9C7106564A; Mon, 10 May 2010 20:25:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C99D78FC12; Mon, 10 May 2010 20:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKPpWW059426; Mon, 10 May 2010 20:25:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKPp9I059403; Mon, 10 May 2010 20:25:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102025.o4AKPp9I059403@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:25:51 +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: r207890 - in stable/8/sys: boot/sparc64/loader conf sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:25:52 -0000 Author: marius Date: Mon May 10 20:25:51 2010 New Revision: 207890 URL: http://svn.freebsd.org/changeset/base/207890 Log: MFC: r207537 Add support for SPARC64 V (and where it already makes sense for other HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the MMU and cache handling, it doesn't add pmap optimizations possible with these CPU, yet, though. With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250 and likely also other models based on SPARC64 V like 450, 650 and 850. Thanks go to Michael Moll for providing access to a PRIMEPOWER 250. Added: stable/8/sys/sparc64/include/mcntl.h - copied unchanged from r207537, head/sys/sparc64/include/mcntl.h stable/8/sys/sparc64/sparc64/zeus.c - copied unchanged from r207537, head/sys/sparc64/sparc64/zeus.c Modified: stable/8/sys/boot/sparc64/loader/main.c stable/8/sys/conf/files.sparc64 stable/8/sys/sparc64/include/asi.h stable/8/sys/sparc64/include/cache.h stable/8/sys/sparc64/sparc64/cache.c stable/8/sys/sparc64/sparc64/cheetah.c stable/8/sys/sparc64/sparc64/identcpu.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/mp_locore.S stable/8/sys/sparc64/sparc64/mp_machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/8/sys/boot/sparc64/loader/main.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/boot/sparc64/loader/main.c Mon May 10 20:25:51 2010 (r207890) @@ -451,7 +451,8 @@ dtlb_va_to_pa_sun4u(vm_offset_t va) reg = dtlb_get_data_sun4u(i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) return (reg & TD_PA_CH_MASK); return (reg & TD_PA_SF_MASK); } @@ -474,7 +475,8 @@ itlb_va_to_pa_sun4u(vm_offset_t va) reg = itlb_get_data_sun4u(i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) return (reg & TD_PA_CH_MASK); return (reg & TD_PA_SF_MASK); } @@ -696,6 +698,7 @@ cpu_cpuid_prop_sun4u(void) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -720,6 +723,7 @@ cpu_get_mid_sun4u(void) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/conf/files.sparc64 Mon May 10 20:25:51 2010 (r207890) @@ -137,3 +137,4 @@ sparc64/sparc64/tsb.c standard sparc64/sparc64/uio_machdep.c standard sparc64/sparc64/upa.c optional creator sparc64/sparc64/vm_machdep.c standard +sparc64/sparc64/zeus.c standard Modified: stable/8/sys/sparc64/include/asi.h ============================================================================== --- stable/8/sys/sparc64/include/asi.h Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/include/asi.h Mon May 10 20:25:51 2010 (r207890) @@ -82,7 +82,10 @@ #define ASI_DCACHE_SNOOP_TAG 0x44 /* US-III Cu */ /* Named ASI_DCUCR on US-III, but is mostly identical except for added bits. */ -#define ASI_LSU_CTL_REG 0x45 +#define ASI_LSU_CTL_REG 0x45 /* US only */ + +#define ASI_MCNTL 0x45 /* SPARC64 only */ +#define AA_MCNTL 0x08 #define ASI_DCACHE_DATA 0x46 #define ASI_DCACHE_TAG 0x47 @@ -167,6 +170,8 @@ #define ASI_ICACHE_PRE_DECODE 0x6e /* US-I, II */ #define ASI_ICACHE_PRE_NEXT_FIELD 0x6f /* US-I, II */ +#define ASI_FLUSH_L1I 0x67 /* SPARC64 only */ + #define ASI_BLK_AUIP 0x70 #define ASI_BLK_AIUS 0x71 Modified: stable/8/sys/sparc64/include/cache.h ============================================================================== --- stable/8/sys/sparc64/include/cache.h Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/include/cache.h Mon May 10 20:25:51 2010 (r207890) @@ -113,6 +113,10 @@ extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + #endif /* KERNEL */ #endif /* !LOCORE */ Copied: stable/8/sys/sparc64/include/mcntl.h (from r207537, head/sys/sparc64/include/mcntl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/include/mcntl.h Mon May 10 20:25:51 2010 (r207890, copy of r207537, head/sys/sparc64/include/mcntl.h) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_MCNTL_H +#define _MACHINE_MCNTL_H + +/* + * Definitions for the SPARC64 V, VI, VII and VIIIfx Memory Control Register + */ +#define MCNTL_JPS1_TSBP (1UL << 8) + +#define MCNTL_RMD_SHIFT 12 +#define MCNTL_RMD_BITS 2 +#define MCNTL_RMD_MASK \ + (((1UL << MCNTL_RMD_BITS) - 1) << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_FULL (0UL << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_1024 (2UL << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_512 (3UL << MCNTL_RMD_SHIFT) + +#define MCNTL_FW_FDTLB (1UL << 14) +#define MCNTL_FW_FITLB (1UL << 15) +#define MCNTL_NC_CACHE (1UL << 16) + +/* The following bits are valid for the SPARC64 VI, VII and VIIIfx only. */ +#define MCNTL_MPG_SDTLB (1UL << 6) +#define MCNTL_MPG_SITLB (1UL << 7) + +/* The following bits are valid for the SPARC64 VIIIfx only. */ +#define MCNTL_HPF_SHIFT 18 +#define MCNTL_HPF_BITS 2 +#define MCNTL_HPF_MASK \ + (((1UL << MCNTL_HPF_BITS) - 1) << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_STRONG (0UL << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_NOT (1UL << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_WEAK (2UL << MCNTL_HPF_SHIFT) + +#endif /* _MACHINE_MCNTL_H */ Modified: stable/8/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cache.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/cache.c Mon May 10 20:25:51 2010 (r207890) @@ -141,7 +141,12 @@ cache_init(struct pcpu *pcpu) if ((pcpu->pc_cache.dc_size & ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) panic("cache_init: D$ size not a power of 2"); - if (((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / + /* + * For CPUs which don't support unaliasing in hardware ensure that + * the data cache doesn't have too many virtual colors. + */ + if (pcpu->pc_impl != CPU_IMPL_SPARC64V && + ((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) panic("cache_init: too many D$ colors"); set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; @@ -155,12 +160,21 @@ cache_init(struct pcpu *pcpu) icache_page_inval = cheetah_icache_page_inval; tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; - } else { + } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { + cache_enable = cheetah_cache_enable; + cache_flush = zeus_cache_flush; + dcache_page_inval = zeus_dcache_page_inval; + icache_page_inval = zeus_icache_page_inval; + tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; + tlb_flush_user = cheetah_tlb_flush_user; + } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && + pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; cache_flush = spitfire_cache_flush; dcache_page_inval = spitfire_dcache_page_inval; icache_page_inval = spitfire_icache_page_inval; tlb_flush_nonlocked = spitfire_tlb_flush_nonlocked; tlb_flush_user = spitfire_tlb_flush_user; - } + } else + panic("cache_init: unknown CPU"); } Modified: stable/8/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/8/sys/sparc64/sparc64/cheetah.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/cheetah.c Mon May 10 20:25:51 2010 (r207890) @@ -39,11 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -52,7 +54,8 @@ __FBSDID("$FreeBSD$"); #define CHEETAH_ICACHE_TAG_LOWER 0x30 /* - * CPU-specific initialization + * CPU-specific initialization - this is used for both the Sun Cheetah and + * later as well as the Fujitsu Zeus and later CPUs. */ void cheetah_init(u_int cpu_impl) @@ -75,6 +78,14 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); + if (cpu_impl == CPU_IMPL_SPARC64V) { + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val = ldxa(AA_MCNTL, ASI_MCNTL); + val &= ~MCNTL_JPS1_TSBP; + stxa(AA_MCNTL, ASI_MCNTL, val); + return; + } + /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -207,7 +218,7 @@ cheetah_dcache_page_inval(vm_paddr_t spa * consistency is maintained by hardware. */ void -cheetah_icache_page_inval(vm_paddr_t pa) +cheetah_icache_page_inval(vm_paddr_t pa __unused) { } Modified: stable/8/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/identcpu.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/identcpu.c Mon May 10 20:25:51 2010 (r207890) @@ -41,7 +41,7 @@ cpu_identify(u_long vers, u_int freq, u_ switch (VER_MANUF(vers)) { case 0x04: - manus = "HAL"; + manus = "HAL/Fujitsu"; break; case 0x13: case 0x17: @@ -57,6 +57,27 @@ cpu_identify(u_long vers, u_int freq, u_ case CPU_IMPL_SPARC64: impls = "SPARC64"; break; + case CPU_IMPL_SPARC64II: + impls = "SPARC64-II"; + break; + case CPU_IMPL_SPARC64III: + impls = "SPARC64-III"; + break; + case CPU_IMPL_SPARC64IV: + impls = "SPARC64-IV"; + break; + case CPU_IMPL_SPARC64V: + impls = "SPARC64-V"; + break; + case CPU_IMPL_SPARC64VI: + impls = "SPARC64-VI"; + break; + case CPU_IMPL_SPARC64VII: + impls = "SPARC64-VII"; + break; + case CPU_IMPL_SPARC64VIIIfx: + impls = "SPARC64-VIIIfx"; + break; case CPU_IMPL_ULTRASPARCI: impls = "UltraSparc-I"; break; @@ -67,7 +88,6 @@ cpu_identify(u_long vers, u_int freq, u_ impls = "UltraSparc-IIi"; break; case CPU_IMPL_ULTRASPARCIIe: - /* V9 Manual says `UltraSparc-e'. I assume this is wrong. */ impls = "UltraSparc-IIe"; break; case CPU_IMPL_ULTRASPARCIII: Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon May 10 20:25:51 2010 (r207890) @@ -276,6 +276,7 @@ cpu_cpuid_prop(u_int cpu_impl) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -300,6 +301,7 @@ cpu_get_mid(u_int cpu_impl) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -343,7 +345,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); /* @@ -491,6 +494,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l if (cpu_use_vis) { switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: Modified: stable/8/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_locore.S Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/mp_locore.S Mon May 10 20:25:51 2010 (r207890) @@ -200,19 +200,25 @@ ENTRY(mp_startup) srlx %l1, VER_IMPL_SHIFT, %l1 sll %l1, VER_IMPL_SIZE, %l1 srl %l1, VER_IMPL_SIZE, %l1 + cmp %l1, CPU_IMPL_SPARC64V + bl %icc, 4f + nop + cmp %l1, CPU_IMPL_ULTRASPARCI + bl %icc, 2f + nop cmp %l1, CPU_IMPL_ULTRASPARCIII bl %icc, 3f nop - mov CPU_STICKSYNC, %l2 +2: mov CPU_STICKSYNC, %l2 membar #StoreLoad stw %l2, [%l0 + CSA_STATE] -2: ldx [%l0 + CSA_STICK], %l2 - brz %l2, 2b +3: ldx [%l0 + CSA_STICK], %l2 + brz %l2, 3b nop wr %l2, 0, %asr24 -3: call cpu_get_mid +4: call cpu_get_mid mov %l1, %o0 /* @@ -225,9 +231,9 @@ ENTRY(mp_startup) /* * Wait till its our turn to bootstrap. */ -4: lduw [%l0 + CSA_MID], %l1 +5: lduw [%l0 + CSA_MID], %l1 cmp %l1, %o0 - bne %xcc, 4b + bne %xcc, 5b nop add %l0, CSA_TTES, %l1 @@ -236,7 +242,7 @@ ENTRY(mp_startup) /* * Map the per-CPU pages. */ -5: sllx %l2, TTE_SHIFT, %l3 +6: sllx %l2, TTE_SHIFT, %l3 add %l1, %l3, %l3 ldx [%l3 + TTE_VPN], %l4 @@ -251,7 +257,7 @@ ENTRY(mp_startup) add %l2, 1, %l2 cmp %l2, PCPU_PAGES - bne %xcc, 5b + bne %xcc, 6b nop /* Modified: stable/8/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/mp_machdep.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/mp_machdep.c Mon May 10 20:25:51 2010 (r207890) @@ -164,7 +164,8 @@ mp_init(u_int cpu_impl) if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi || cpu_impl == CPU_IMPL_ULTRASPARCIIIip) isjbus = 1; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) cpu_ipi_selected = cheetah_ipi_selected; else cpu_ipi_selected = spitfire_ipi_selected; @@ -315,7 +316,8 @@ ap_start(phandle_t node, u_int mid, u_in ; membar(StoreLoad); csa->csa_tick = rd(tick); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) { while (csa->csa_state != CPU_STICKSYNC) ; membar(StoreLoad); @@ -411,7 +413,8 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl == CPU_IMPL_SPARC64V || + pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); /* * Enable the caches. Note that his may include applying workarounds. Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon May 10 20:25:51 2010 (r207890) @@ -528,7 +528,8 @@ pmap_bootstrap(u_int cpu_impl) tp->tte_data = ((translations[i].om_tte & ~((TD_SOFT2_MASK << TD_SOFT2_SHIFT) | - (cpu_impl < CPU_IMPL_ULTRASPARCIII ? + (cpu_impl >= CPU_IMPL_ULTRASPARCI && + cpu_impl < CPU_IMPL_ULTRASPARCIII ? (TD_DIAG_SF_MASK << TD_DIAG_SF_SHIFT) : (TD_RSVD_CH_MASK << TD_RSVD_CH_SHIFT)) | (TD_SOFT_MASK << TD_SOFT_SHIFT))) | TD_EXEC) + Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Mon May 10 20:15:40 2010 (r207889) +++ stable/8/sys/sparc64/sparc64/tick.c Mon May 10 20:25:51 2010 (r207890) @@ -120,7 +120,8 @@ cpu_initclocks(void) */ } else { clock = PCPU_GET(clock); - intr_setup(PIL_TICK, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? + intr_setup(PIL_TICK, PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCI && + PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); set_cputicker(tick_cputicks, clock, 0); } @@ -325,7 +326,8 @@ void tick_clear(u_int cpu_impl) { - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) wrstick(0, 0); wrpr(tick, 0, 0); } @@ -334,7 +336,8 @@ void tick_stop(u_int cpu_impl) { - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) wrstickcmpr(1L << 63, 0); wrtickcmpr(1L << 63, 0); } Copied: stable/8/sys/sparc64/sparc64/zeus.c (from r207537, head/sys/sparc64/sparc64/zeus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/sparc64/zeus.c Mon May 10 20:25:51 2010 (r207890, copy of r207537, head/sys/sparc64/sparc64/zeus.c) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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 + +/* + * Flush all lines from the level 1 caches. + */ +void +zeus_cache_flush(void) +{ + + stxa_sync(0, ASI_FLUSH_L1I, 0); +} + +/* + * Flush a physical page from the data cache. Data cache consistency is + * maintained by hardware. + */ +void +zeus_dcache_page_inval(vm_paddr_t spa __unused) +{ + +} + +/* + * Flush a physical page from the intsruction cache. Instruction cache + * consistency is maintained by hardware. + */ +void +zeus_icache_page_inval(vm_paddr_t pa __unused) +{ + +} From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:25:52 2010 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 03B3A106566B; Mon, 10 May 2010 20:25:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E4DA28FC18; Mon, 10 May 2010 20:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKPpeY059437; Mon, 10 May 2010 20:25:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKPpvk059413; Mon, 10 May 2010 20:25:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102025.o4AKPpvk059413@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:25:51 +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: r207891 - in stable/7/sys: boot/sparc64/loader conf sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:25:52 -0000 Author: marius Date: Mon May 10 20:25:51 2010 New Revision: 207891 URL: http://svn.freebsd.org/changeset/base/207891 Log: MFC: r207537 Add support for SPARC64 V (and where it already makes sense for other HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the MMU and cache handling, it doesn't add pmap optimizations possible with these CPU, yet, though. With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250 and likely also other models based on SPARC64 V like 450, 650 and 850. Thanks go to Michael Moll for providing access to a PRIMEPOWER 250. Added: stable/7/sys/sparc64/include/mcntl.h - copied unchanged from r207537, head/sys/sparc64/include/mcntl.h stable/7/sys/sparc64/sparc64/zeus.c - copied unchanged from r207537, head/sys/sparc64/sparc64/zeus.c Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/conf/files.sparc64 stable/7/sys/sparc64/include/asi.h stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/identcpu.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/boot/sparc64/loader/main.c Mon May 10 20:25:51 2010 (r207891) @@ -452,7 +452,8 @@ dtlb_va_to_pa_sun4u(vm_offset_t va) reg = dtlb_get_data_sun4u(i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) return (reg & TD_PA_CH_MASK); return (reg & TD_PA_SF_MASK); } @@ -475,7 +476,8 @@ itlb_va_to_pa_sun4u(vm_offset_t va) reg = itlb_get_data_sun4u(i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) return (reg & TD_PA_CH_MASK); return (reg & TD_PA_SF_MASK); } @@ -697,6 +699,7 @@ cpu_cpuid_prop_sun4u(void) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -721,6 +724,7 @@ cpu_get_mid_sun4u(void) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: Modified: stable/7/sys/conf/files.sparc64 ============================================================================== --- stable/7/sys/conf/files.sparc64 Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/conf/files.sparc64 Mon May 10 20:25:51 2010 (r207891) @@ -134,3 +134,4 @@ sparc64/sparc64/tsb.c standard sparc64/sparc64/uio_machdep.c standard sparc64/sparc64/upa.c optional creator sparc64/sparc64/vm_machdep.c standard +sparc64/sparc64/zeus.c standard Modified: stable/7/sys/sparc64/include/asi.h ============================================================================== --- stable/7/sys/sparc64/include/asi.h Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/include/asi.h Mon May 10 20:25:51 2010 (r207891) @@ -82,7 +82,10 @@ #define ASI_DCACHE_SNOOP_TAG 0x44 /* US-III Cu */ /* Named ASI_DCUCR on US-III, but is mostly identical except for added bits. */ -#define ASI_LSU_CTL_REG 0x45 +#define ASI_LSU_CTL_REG 0x45 /* US only */ + +#define ASI_MCNTL 0x45 /* SPARC64 only */ +#define AA_MCNTL 0x08 #define ASI_DCACHE_DATA 0x46 #define ASI_DCACHE_TAG 0x47 @@ -167,6 +170,8 @@ #define ASI_ICACHE_PRE_DECODE 0x6e /* US-I, II */ #define ASI_ICACHE_PRE_NEXT_FIELD 0x6f /* US-I, II */ +#define ASI_FLUSH_L1I 0x67 /* SPARC64 only */ + #define ASI_BLK_AUIP 0x70 #define ASI_BLK_AIUS 0x71 Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/include/cache.h Mon May 10 20:25:51 2010 (r207891) @@ -113,6 +113,10 @@ extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + #endif /* KERNEL */ #endif /* !LOCORE */ Copied: stable/7/sys/sparc64/include/mcntl.h (from r207537, head/sys/sparc64/include/mcntl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/include/mcntl.h Mon May 10 20:25:51 2010 (r207891, copy of r207537, head/sys/sparc64/include/mcntl.h) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_MCNTL_H +#define _MACHINE_MCNTL_H + +/* + * Definitions for the SPARC64 V, VI, VII and VIIIfx Memory Control Register + */ +#define MCNTL_JPS1_TSBP (1UL << 8) + +#define MCNTL_RMD_SHIFT 12 +#define MCNTL_RMD_BITS 2 +#define MCNTL_RMD_MASK \ + (((1UL << MCNTL_RMD_BITS) - 1) << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_FULL (0UL << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_1024 (2UL << MCNTL_RMD_SHIFT) +#define MCNTL_RMD_512 (3UL << MCNTL_RMD_SHIFT) + +#define MCNTL_FW_FDTLB (1UL << 14) +#define MCNTL_FW_FITLB (1UL << 15) +#define MCNTL_NC_CACHE (1UL << 16) + +/* The following bits are valid for the SPARC64 VI, VII and VIIIfx only. */ +#define MCNTL_MPG_SDTLB (1UL << 6) +#define MCNTL_MPG_SITLB (1UL << 7) + +/* The following bits are valid for the SPARC64 VIIIfx only. */ +#define MCNTL_HPF_SHIFT 18 +#define MCNTL_HPF_BITS 2 +#define MCNTL_HPF_MASK \ + (((1UL << MCNTL_HPF_BITS) - 1) << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_STRONG (0UL << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_NOT (1UL << MCNTL_HPF_SHIFT) +#define MCNTL_HPF_WEAK (2UL << MCNTL_HPF_SHIFT) + +#endif /* _MACHINE_MCNTL_H */ Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/cache.c Mon May 10 20:25:51 2010 (r207891) @@ -141,7 +141,12 @@ cache_init(struct pcpu *pcpu) if ((pcpu->pc_cache.dc_size & ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) panic("cache_init: D$ size not a power of 2"); - if (((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / + /* + * For CPUs which don't support unaliasing in hardware ensure that + * the data cache doesn't have too many virtual colors. + */ + if (pcpu->pc_impl != CPU_IMPL_SPARC64V && + ((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) panic("cache_init: too many D$ colors"); set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; @@ -155,12 +160,21 @@ cache_init(struct pcpu *pcpu) icache_page_inval = cheetah_icache_page_inval; tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; - } else { + } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { + cache_enable = cheetah_cache_enable; + cache_flush = zeus_cache_flush; + dcache_page_inval = zeus_dcache_page_inval; + icache_page_inval = zeus_icache_page_inval; + tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; + tlb_flush_user = cheetah_tlb_flush_user; + } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && + pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; cache_flush = spitfire_cache_flush; dcache_page_inval = spitfire_dcache_page_inval; icache_page_inval = spitfire_icache_page_inval; tlb_flush_nonlocked = spitfire_tlb_flush_nonlocked; tlb_flush_user = spitfire_tlb_flush_user; - } + } else + panic("cache_init: unknown CPU"); } Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/cheetah.c Mon May 10 20:25:51 2010 (r207891) @@ -39,11 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -52,7 +54,8 @@ __FBSDID("$FreeBSD$"); #define CHEETAH_ICACHE_TAG_LOWER 0x30 /* - * CPU-specific initialization + * CPU-specific initialization - this is used for both the Sun Cheetah and + * later as well as the Fujitsu Zeus and later CPUs. */ void cheetah_init(u_int cpu_impl) @@ -75,6 +78,14 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); + if (cpu_impl == CPU_IMPL_SPARC64V) { + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val = ldxa(AA_MCNTL, ASI_MCNTL); + val &= ~MCNTL_JPS1_TSBP; + stxa(AA_MCNTL, ASI_MCNTL, val); + return; + } + /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -207,7 +218,7 @@ cheetah_dcache_page_inval(vm_paddr_t spa * consistency is maintained by hardware. */ void -cheetah_icache_page_inval(vm_paddr_t pa) +cheetah_icache_page_inval(vm_paddr_t pa __unused) { } Modified: stable/7/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/identcpu.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/identcpu.c Mon May 10 20:25:51 2010 (r207891) @@ -34,7 +34,7 @@ cpu_identify(u_long vers, u_int freq, u_ switch (VER_MANUF(vers)) { case 0x04: - manus = "HAL"; + manus = "HAL/Fujitsu"; break; case 0x13: case 0x17: @@ -50,6 +50,27 @@ cpu_identify(u_long vers, u_int freq, u_ case CPU_IMPL_SPARC64: impls = "SPARC64"; break; + case CPU_IMPL_SPARC64II: + impls = "SPARC64-II"; + break; + case CPU_IMPL_SPARC64III: + impls = "SPARC64-III"; + break; + case CPU_IMPL_SPARC64IV: + impls = "SPARC64-IV"; + break; + case CPU_IMPL_SPARC64V: + impls = "SPARC64-V"; + break; + case CPU_IMPL_SPARC64VI: + impls = "SPARC64-VI"; + break; + case CPU_IMPL_SPARC64VII: + impls = "SPARC64-VII"; + break; + case CPU_IMPL_SPARC64VIIIfx: + impls = "SPARC64-VIIIfx"; + break; case CPU_IMPL_ULTRASPARCI: impls = "UltraSparc-I"; break; @@ -60,7 +81,6 @@ cpu_identify(u_long vers, u_int freq, u_ impls = "UltraSparc-IIi"; break; case CPU_IMPL_ULTRASPARCIIe: - /* V9 Manual says `UltraSparc-e'. I assume this is wrong. */ impls = "UltraSparc-IIe"; break; case CPU_IMPL_ULTRASPARCIII: Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon May 10 20:25:51 2010 (r207891) @@ -275,6 +275,7 @@ cpu_cpuid_prop(u_int cpu_impl) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -299,6 +300,7 @@ cpu_get_mid(u_int cpu_impl) switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: @@ -342,7 +344,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); /* @@ -483,6 +486,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l if (cpu_use_vis) { switch (cpu_impl) { case CPU_IMPL_SPARC64: + case CPU_IMPL_SPARC64V: case CPU_IMPL_ULTRASPARCI: case CPU_IMPL_ULTRASPARCII: case CPU_IMPL_ULTRASPARCIIi: Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Mon May 10 20:25:51 2010 (r207891) @@ -200,19 +200,25 @@ ENTRY(mp_startup) srlx %l1, VER_IMPL_SHIFT, %l1 sll %l1, VER_IMPL_SIZE, %l1 srl %l1, VER_IMPL_SIZE, %l1 + cmp %l1, CPU_IMPL_SPARC64V + bl %icc, 4f + nop + cmp %l1, CPU_IMPL_ULTRASPARCI + bl %icc, 2f + nop cmp %l1, CPU_IMPL_ULTRASPARCIII bl %icc, 3f nop - mov CPU_STICKSYNC, %l2 +2: mov CPU_STICKSYNC, %l2 membar #StoreLoad stw %l2, [%l0 + CSA_STATE] -2: ldx [%l0 + CSA_STICK], %l2 - brz %l2, 2b +3: ldx [%l0 + CSA_STICK], %l2 + brz %l2, 3b nop wr %l2, 0, %asr24 -3: call cpu_get_mid +4: call cpu_get_mid mov %l1, %o0 /* @@ -225,9 +231,9 @@ ENTRY(mp_startup) /* * Wait till its our turn to bootstrap. */ -4: lduw [%l0 + CSA_MID], %l1 +5: lduw [%l0 + CSA_MID], %l1 cmp %l1, %o0 - bne %xcc, 4b + bne %xcc, 5b nop add %l0, CSA_TTES, %l1 @@ -236,7 +242,7 @@ ENTRY(mp_startup) /* * Map the per-CPU pages. */ -5: sllx %l2, TTE_SHIFT, %l3 +6: sllx %l2, TTE_SHIFT, %l3 add %l1, %l3, %l3 ldx [%l3 + TTE_VPN], %l4 @@ -251,7 +257,7 @@ ENTRY(mp_startup) add %l2, 1, %l2 cmp %l2, PCPU_PAGES - bne %xcc, 5b + bne %xcc, 6b nop /* Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon May 10 20:25:51 2010 (r207891) @@ -164,7 +164,8 @@ mp_init(u_int cpu_impl) if (cpu_impl == CPU_IMPL_ULTRASPARCIIIi || cpu_impl == CPU_IMPL_ULTRASPARCIIIip) isjbus = 1; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) cpu_ipi_selected = cheetah_ipi_selected; else cpu_ipi_selected = spitfire_ipi_selected; @@ -308,7 +309,8 @@ ap_start(phandle_t node, u_int mid, u_in ; membar(StoreLoad); csa->csa_tick = rd(tick); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) { while (csa->csa_state != CPU_STICKSYNC) ; membar(StoreLoad); @@ -403,7 +405,8 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl == CPU_IMPL_SPARC64V || + pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); /* * Enable the caches. Note that his may include applying workarounds. Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon May 10 20:25:51 2010 (r207891) @@ -522,7 +522,8 @@ pmap_bootstrap(u_int cpu_impl) tp->tte_data = ((translations[i].om_tte & ~((TD_SOFT2_MASK << TD_SOFT2_SHIFT) | - (cpu_impl < CPU_IMPL_ULTRASPARCIII ? + (cpu_impl >= CPU_IMPL_ULTRASPARCI && + cpu_impl < CPU_IMPL_ULTRASPARCIII ? (TD_DIAG_SF_MASK << TD_DIAG_SF_SHIFT) : (TD_RSVD_CH_MASK << TD_RSVD_CH_SHIFT)) | (TD_SOFT_MASK << TD_SOFT_SHIFT))) | TD_EXEC) + Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon May 10 20:25:51 2010 (r207890) +++ stable/7/sys/sparc64/sparc64/tick.c Mon May 10 20:25:51 2010 (r207891) @@ -120,7 +120,8 @@ cpu_initclocks(void) */ } else { clock = PCPU_GET(clock); - intr_setup(PIL_TICK, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? + intr_setup(PIL_TICK, PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCI && + PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); set_cputicker(tick_cputicks, clock, 0); } @@ -325,7 +326,8 @@ void tick_clear(u_int cpu_impl) { - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) wrstick(0, 0); wrpr(tick, 0, 0); } @@ -334,7 +336,8 @@ void tick_stop(u_int cpu_impl) { - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl == CPU_IMPL_SPARC64V || + cpu_impl >= CPU_IMPL_ULTRASPARCIII) wrstickcmpr(1L << 63, 0); wrtickcmpr(1L << 63, 0); } Copied: stable/7/sys/sparc64/sparc64/zeus.c (from r207537, head/sys/sparc64/sparc64/zeus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/sparc64/sparc64/zeus.c Mon May 10 20:25:51 2010 (r207891, copy of r207537, head/sys/sparc64/sparc64/zeus.c) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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 + +/* + * Flush all lines from the level 1 caches. + */ +void +zeus_cache_flush(void) +{ + + stxa_sync(0, ASI_FLUSH_L1I, 0); +} + +/* + * Flush a physical page from the data cache. Data cache consistency is + * maintained by hardware. + */ +void +zeus_dcache_page_inval(vm_paddr_t spa __unused) +{ + +} + +/* + * Flush a physical page from the intsruction cache. Instruction cache + * consistency is maintained by hardware. + */ +void +zeus_icache_page_inval(vm_paddr_t pa __unused) +{ + +} From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:34:17 2010 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 2FA391065674; Mon, 10 May 2010 20:34:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBA48FC16; Mon, 10 May 2010 20:34:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKYHxJ061372; Mon, 10 May 2010 20:34:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKYGGc061369; Mon, 10 May 2010 20:34:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102034.o4AKYGGc061369@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207892 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:34:17 -0000 Author: marius Date: Mon May 10 20:34:16 2010 New Revision: 207892 URL: http://svn.freebsd.org/changeset/base/207892 Log: MFC: r207570 On sparc64 obtain the initiator ID from the Open Firmware device tree in order to match what the PROM built-in driver uses. Modified: stable/8/sys/dev/isp/isp_pci.c stable/8/sys/dev/isp/isp_sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/isp/isp_pci.c ============================================================================== --- stable/8/sys/dev/isp/isp_pci.c Mon May 10 20:25:51 2010 (r207891) +++ stable/8/sys/dev/isp/isp_pci.c Mon May 10 20:34:16 2010 (r207892) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __sparc64__ +#include +#include +#endif + #include static uint32_t isp_pci_rd_reg(ispsoftc_t *, int); @@ -517,7 +522,11 @@ isp_get_specific_options(device_t dev, i if (IS_FC(isp)) { ISP_FC_PC(isp, chan)->default_id = 109 - chan; } else { +#ifdef __sparc64__ + ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev); +#else ISP_SPI_PC(isp, chan)->iid = 7; +#endif } } else { if (IS_FC(isp)) { Modified: stable/8/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/8/sys/dev/isp/isp_sbus.c Mon May 10 20:25:51 2010 (r207891) +++ stable/8/sys/dev/isp/isp_sbus.c Mon May 10 20:34:16 2010 (r207892) @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -264,11 +266,7 @@ isp_sbus_attach(device_t dev) isp->isp_confopts |= ISP_CFG_OWNLOOPID; } if (default_id == -1) { - /* - * XXX: should be a way to get properties w/o having - * XXX: to call OF_xxx functions - */ - default_id = 7; + default_id = OF_getscsinitid(dev); } ISP_SPI_PC(isp, 0)->iid = default_id; From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:34:19 2010 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 A5A6D106566C; Mon, 10 May 2010 20:34:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 949B68FC17; Mon, 10 May 2010 20:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKYJkC061404; Mon, 10 May 2010 20:34:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKYJwJ061401; Mon, 10 May 2010 20:34:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102034.o4AKYJwJ061401@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:34:19 +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: r207893 - stable/7/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:34:19 -0000 Author: marius Date: Mon May 10 20:34:19 2010 New Revision: 207893 URL: http://svn.freebsd.org/changeset/base/207893 Log: MFC: r207570 On sparc64 obtain the initiator ID from the Open Firmware device tree in order to match what the PROM built-in driver uses. Modified: stable/7/sys/dev/isp/isp_pci.c stable/7/sys/dev/isp/isp_sbus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/isp/isp_pci.c ============================================================================== --- stable/7/sys/dev/isp/isp_pci.c Mon May 10 20:34:16 2010 (r207892) +++ stable/7/sys/dev/isp/isp_pci.c Mon May 10 20:34:19 2010 (r207893) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __sparc64__ +#include +#include +#endif + #include static uint32_t isp_pci_rd_reg(ispsoftc_t *, int); @@ -517,7 +522,11 @@ isp_get_specific_options(device_t dev, i if (IS_FC(isp)) { ISP_FC_PC(isp, chan)->default_id = 109 - chan; } else { +#ifdef __sparc64__ + ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev); +#else ISP_SPI_PC(isp, chan)->iid = 7; +#endif } } else { if (IS_FC(isp)) { Modified: stable/7/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/7/sys/dev/isp/isp_sbus.c Mon May 10 20:34:16 2010 (r207892) +++ stable/7/sys/dev/isp/isp_sbus.c Mon May 10 20:34:19 2010 (r207893) @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -264,11 +266,7 @@ isp_sbus_attach(device_t dev) isp->isp_confopts |= ISP_CFG_OWNLOOPID; } if (default_id == -1) { - /* - * XXX: should be a way to get properties w/o having - * XXX: to call OF_xxx functions - */ - default_id = 7; + default_id = OF_getscsinitid(dev); } ISP_SPI_PC(isp, 0)->iid = default_id; From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:55:24 2010 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 8F5CF106564A; Mon, 10 May 2010 20:55:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 748C28FC0A; Mon, 10 May 2010 20:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKtOFh066353; Mon, 10 May 2010 20:55:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKtOlG066351; Mon, 10 May 2010 20:55:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102055.o4AKtOlG066351@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:55:24 +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: r207894 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:55:24 -0000 Author: marius Date: Mon May 10 20:55:24 2010 New Revision: 207894 URL: http://svn.freebsd.org/changeset/base/207894 Log: MFC: r207683 - Fix broken symlinks on cross platform zfs send/recv. [1] - Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between amd64 and sparc64 in both directions by Michael Moll). PR: 146272 Approved by: mm, pjd Obtained from: OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1] Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Mon May 10 20:34:19 2010 (r207893) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Mon May 10 20:55:24 2010 (r207894) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -50,7 +48,6 @@ zfs_oldace_byteswap(ace_t *ace, int ace_ void zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout) { -#ifdef TODO caddr_t end; caddr_t ptr; zfs_ace_t *zacep; @@ -64,6 +61,20 @@ zfs_ace_byteswap(void *buf, size_t size, while (ptr < end) { if (zfs_layout) { + /* + * Avoid overrun. Embedded aces can have one + * of several sizes. We don't know exactly + * how many our present, only the size of the + * buffer containing them. That size may be + * larger than needed to hold the aces + * present. As long as we do not do any + * swapping beyond the end of our block we are + * okay. It it safe to swap any non-ace data + * within the block since it is just zeros. + */ + if (ptr + sizeof (zfs_ace_hdr_t) > end) { + break; + } zacep = (zfs_ace_t *)ptr; zacep->z_hdr.z_access_mask = BSWAP_32(zacep->z_hdr.z_access_mask); @@ -72,6 +83,10 @@ zfs_ace_byteswap(void *buf, size_t size, BSWAP_16(zacep->z_hdr.z_type); entry_type = zacep->z_hdr.z_flags & ACE_TYPE_FLAGS; } else { + /* Overrun avoidance */ + if (ptr + sizeof (ace_t) > end) { + break; + } acep = (ace_t *)ptr; acep->a_access_mask = BSWAP_32(acep->a_access_mask); acep->a_flags = BSWAP_16(acep->a_flags); @@ -88,8 +103,14 @@ zfs_ace_byteswap(void *buf, size_t size, break; case ACE_IDENTIFIER_GROUP: default: + /* Overrun avoidance */ if (zfs_layout) { - zacep->z_fuid = BSWAP_64(zacep->z_fuid); + if (ptr + sizeof (zfs_ace_t) <= end) { + zacep->z_fuid = BSWAP_64(zacep->z_fuid); + } else { + entry_size = sizeof (zfs_ace_t); + break; + } } switch (ace_type) { case ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE: @@ -108,9 +129,6 @@ zfs_ace_byteswap(void *buf, size_t size, } ptr = ptr + entry_size; } -#else /* TODO */ - panic("%s:%u: TODO", __func__, __LINE__); -#endif /* TODO */ } /* ARGSUSED */ @@ -173,7 +191,8 @@ zfs_znode_byteswap(void *buf, size_t siz if (zp->zp_acl.z_acl_version == ZFS_ACL_VERSION) { zfs_acl_byteswap((void *)&zp->zp_acl.z_ace_data[0], ZFS_ACE_SPACE); - } else + } else { zfs_oldace_byteswap((ace_t *)&zp->zp_acl.z_ace_data[0], ACE_SLOT_CNT); + } } From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:55:25 2010 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 1057D1065673; Mon, 10 May 2010 20:55:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id F2FC38FC1B; Mon, 10 May 2010 20:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKtO5L066374; Mon, 10 May 2010 20:55:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKtOpW066372; Mon, 10 May 2010 20:55:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201005102055.o4AKtOpW066372@svn.freebsd.org> From: Marius Strobl Date: Mon, 10 May 2010 20:55:24 +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: r207895 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 May 2010 20:55:25 -0000 Author: marius Date: Mon May 10 20:55:24 2010 New Revision: 207895 URL: http://svn.freebsd.org/changeset/base/207895 Log: MFC: r207683 - Fix broken symlinks on cross platform zfs send/recv. [1] - Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between amd64 and sparc64 in both directions by Michael Moll). PR: 146272 Approved by: mm, pjd Obtained from: OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1] Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Mon May 10 20:55:24 2010 (r207894) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c Mon May 10 20:55:24 2010 (r207895) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -50,7 +48,6 @@ zfs_oldace_byteswap(ace_t *ace, int ace_ void zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout) { -#ifdef TODO caddr_t end; caddr_t ptr; zfs_ace_t *zacep; @@ -64,6 +61,20 @@ zfs_ace_byteswap(void *buf, size_t size, while (ptr < end) { if (zfs_layout) { + /* + * Avoid overrun. Embedded aces can have one + * of several sizes. We don't know exactly + * how many our present, only the size of the + * buffer containing them. That size may be + * larger than needed to hold the aces + * present. As long as we do not do any + * swapping beyond the end of our block we are + * okay. It it safe to swap any non-ace data + * within the block since it is just zeros. + */ + if (ptr + sizeof (zfs_ace_hdr_t) > end) { + break; + } zacep = (zfs_ace_t *)ptr; zacep->z_hdr.z_access_mask = BSWAP_32(zacep->z_hdr.z_access_mask); @@ -72,6 +83,10 @@ zfs_ace_byteswap(void *buf, size_t size, BSWAP_16(zacep->z_hdr.z_type); entry_type = zacep->z_hdr.z_flags & ACE_TYPE_FLAGS; } else { + /* Overrun avoidance */ + if (ptr + sizeof (ace_t) > end) { + break; + } acep = (ace_t *)ptr; acep->a_access_mask = BSWAP_32(acep->a_access_mask); acep->a_flags = BSWAP_16(acep->a_flags); @@ -88,8 +103,14 @@ zfs_ace_byteswap(void *buf, size_t size, break; case ACE_IDENTIFIER_GROUP: default: + /* Overrun avoidance */ if (zfs_layout) { - zacep->z_fuid = BSWAP_64(zacep->z_fuid); + if (ptr + sizeof (zfs_ace_t) <= end) { + zacep->z_fuid = BSWAP_64(zacep->z_fuid); + } else { + entry_size = sizeof (zfs_ace_t); + break; + } } switch (ace_type) { case ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE: @@ -108,9 +129,6 @@ zfs_ace_byteswap(void *buf, size_t size, } ptr = ptr + entry_size; } -#else /* TODO */ - panic("%s:%u: TODO", __func__, __LINE__); -#endif /* TODO */ } /* ARGSUSED */ @@ -173,7 +191,8 @@ zfs_znode_byteswap(void *buf, size_t siz if (zp->zp_acl.z_acl_version == ZFS_ACL_VERSION) { zfs_acl_byteswap((void *)&zp->zp_acl.z_ace_data[0], ZFS_ACE_SPACE); - } else + } else { zfs_oldace_byteswap((ace_t *)&zp->zp_acl.z_ace_data[0], ACE_SLOT_CNT); + } } From owner-svn-src-all@FreeBSD.ORG Mon May 10 20:56:10 2010 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 097881065674; Mon, 10 May 2010 20:56:10 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E37838FC16; Mon, 10 May 2010 20:56:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKu91l066574; Mon, 10 May 2010 20:56:09 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKu9d6066571; Mon, 10 May 2010 20:56:09 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201005102056.o4AKu9d6066571@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 10 May 2010 20:56:09 +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: r207896 - vendor/tzdata/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: Mon, 10 May 2010 20:56:10 -0000 Author: edwin Date: Mon May 10 20:56:09 2010 New Revision: 207896 URL: http://svn.freebsd.org/changeset/base/207896 Log: Vendor import of tzdata2010j - Bahia de Banderas (Mexican state of Nayarit) changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same time zone as nearby city Puerto Vallarta, Jalisco). Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/northamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Mon May 10 20:55:24 2010 (r207895) +++ vendor/tzdata/dist/northamerica Mon May 10 20:56:09 2010 (r207896) @@ -1,5 +1,5 @@ #
-# @(#)northamerica	8.30
+# @(#)northamerica	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2089,7 +2089,44 @@ Zone America/Hermosillo	-7:23:52 -	LMT	1
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT	1999
 			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bahía de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bahía de Banderas homologa su horario al del centro del
+# país, a partir de este domingo
+# 
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# 
+#
+# Bahía de Banderas homologa su horario con el del Centro del
+# País
+# 
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# 
+#
+# (English)
+# Puerto Vallarta and Bahía de Banderas: One Time Zone
+# 
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# 
+#
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# 
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bahía de Banderas and Puerto Vallarta to share the same time
+# zone ..."
 # Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
 Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
 			-7:00	-	MST	1927 Jun 10 23:00
 			-6:00	-	CST	1930 Nov 15
@@ -2100,6 +2137,19 @@ Zone America/Mazatlan	-7:05:40 -	LMT	192
 			-7:00	-	MST	1949 Jan 14
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4
+			-6:00	Mexico	C%sT
+
 # Baja California (near US border)
 Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
 			-7:00	-	MST	1924

Modified: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Mon May 10 20:55:24 2010	(r207895)
+++ vendor/tzdata/dist/zone.tab	Mon May 10 20:56:09 2010	(r207896)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.35
+# @(#)zone.tab	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -288,6 +288,7 @@ MX	+2934-10425	America/Ojinaga	US Mounta
 MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
 MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
 MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
 MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 20:56:58 2010
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 5646E106566C;
	Mon, 10 May 2010 20:56:58 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 2D2528FC21;
	Mon, 10 May 2010 20:56:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AKuw2L066777;
	Mon, 10 May 2010 20:56:58 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AKuwq0066776;
	Mon, 10 May 2010 20:56:58 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201005102056.o4AKuwq0066776@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 10 May 2010 20:56: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: r207897 - vendor/tzdata/tzdata2010j
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 10 May 2010 20:56:58 -0000

Author: edwin
Date: Mon May 10 20:56:57 2010
New Revision: 207897
URL: http://svn.freebsd.org/changeset/base/207897

Log:
  Tag of tzdata2010j

Added:
  vendor/tzdata/tzdata2010j/
     - copied from r207896, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 21:02:17 2010
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 30F1C106566C;
	Mon, 10 May 2010 21:02:17 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 2049A8FC16;
	Mon, 10 May 2010 21:02:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AL2HXD068009;
	Mon, 10 May 2010 21:02:17 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AL2GWx068006;
	Mon, 10 May 2010 21:02:16 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201005102102.o4AL2GWx068006@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 10 May 2010 21:02: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: r207898 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 10 May 2010 21:02:17 -0000

Author: edwin
Date: Mon May 10 21:02:16 2010
New Revision: 207898
URL: http://svn.freebsd.org/changeset/base/207898

Log:
  MFV of tzdata2010j, r207896
  
  - Bahia de Banderas (Mexican state of Nayarit) changed time zone
    UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
    time zone as nearby city Puerto Vallarta, Jalisco).
  
  Obtained from:	ftp://elsie.nci.nih.gov/pub/

Modified:
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Mon May 10 20:56:57 2010	(r207897)
+++ head/contrib/tzdata/northamerica	Mon May 10 21:02:16 2010	(r207898)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.30
+# @(#)northamerica	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2089,7 +2089,44 @@ Zone America/Hermosillo	-7:23:52 -	LMT	1
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT	1999
 			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bahía de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bahía de Banderas homologa su horario al del centro del
+# país, a partir de este domingo
+# 
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# 
+#
+# Bahía de Banderas homologa su horario con el del Centro del
+# País
+# 
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# 
+#
+# (English)
+# Puerto Vallarta and Bahía de Banderas: One Time Zone
+# 
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# 
+#
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# 
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bahía de Banderas and Puerto Vallarta to share the same time
+# zone ..."
 # Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
 Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
 			-7:00	-	MST	1927 Jun 10 23:00
 			-6:00	-	CST	1930 Nov 15
@@ -2100,6 +2137,19 @@ Zone America/Mazatlan	-7:05:40 -	LMT	192
 			-7:00	-	MST	1949 Jan 14
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4
+			-6:00	Mexico	C%sT
+
 # Baja California (near US border)
 Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
 			-7:00	-	MST	1924

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Mon May 10 20:56:57 2010	(r207897)
+++ head/contrib/tzdata/zone.tab	Mon May 10 21:02:16 2010	(r207898)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.35
+# @(#)zone.tab	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -288,6 +288,7 @@ MX	+2934-10425	America/Ojinaga	US Mounta
 MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
 MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
 MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
 MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 21:04:38 2010
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 3DB3D1065674;
	Mon, 10 May 2010 21:04:38 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 2C5258FC1D;
	Mon, 10 May 2010 21:04:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AL4csJ068606;
	Mon, 10 May 2010 21:04:38 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AL4c3J068603;
	Mon, 10 May 2010 21:04:38 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201005102104.o4AL4c3J068603@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 10 May 2010 21:04:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207899 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 10 May 2010 21:04:38 -0000

Author: edwin
Date: Mon May 10 21:04:37 2010
New Revision: 207899
URL: http://svn.freebsd.org/changeset/base/207899

Log:
  MFC of 207898, tzdata2010j:
  
  - Bahia de Banderas (Mexican state of Nayarit) changed time zone
    UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
    time zone as nearby city Puerto Vallarta, Jalisco).

Modified:
  stable/6/share/zoneinfo/northamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Mon May 10 21:02:16 2010	(r207898)
+++ stable/6/share/zoneinfo/northamerica	Mon May 10 21:04:37 2010	(r207899)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.30
+# @(#)northamerica	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2089,7 +2089,44 @@ Zone America/Hermosillo	-7:23:52 -	LMT	1
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT	1999
 			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bahía de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bahía de Banderas homologa su horario al del centro del
+# país, a partir de este domingo
+# 
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# 
+#
+# Bahía de Banderas homologa su horario con el del Centro del
+# País
+# 
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# 
+#
+# (English)
+# Puerto Vallarta and Bahía de Banderas: One Time Zone
+# 
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# 
+#
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# 
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bahía de Banderas and Puerto Vallarta to share the same time
+# zone ..."
 # Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
 Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
 			-7:00	-	MST	1927 Jun 10 23:00
 			-6:00	-	CST	1930 Nov 15
@@ -2100,6 +2137,19 @@ Zone America/Mazatlan	-7:05:40 -	LMT	192
 			-7:00	-	MST	1949 Jan 14
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4
+			-6:00	Mexico	C%sT
+
 # Baja California (near US border)
 Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
 			-7:00	-	MST	1924

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Mon May 10 21:02:16 2010	(r207898)
+++ stable/6/share/zoneinfo/zone.tab	Mon May 10 21:04:37 2010	(r207899)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.35
+# @(#)zone.tab	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -288,6 +288,7 @@ MX	+2934-10425	America/Ojinaga	US Mounta
 MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
 MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
 MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
 MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 21:04:40 2010
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 D03B91065670;
	Mon, 10 May 2010 21:04:40 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id B53C68FC1E;
	Mon, 10 May 2010 21:04:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AL4eim068645;
	Mon, 10 May 2010 21:04:40 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AL4e7Z068642;
	Mon, 10 May 2010 21:04:40 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201005102104.o4AL4e7Z068642@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 10 May 2010 21:04:40 +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: r207900 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 10 May 2010 21:04:40 -0000

Author: edwin
Date: Mon May 10 21:04:40 2010
New Revision: 207900
URL: http://svn.freebsd.org/changeset/base/207900

Log:
  MFC of 207898, tzdata2010j:
  
  - Bahia de Banderas (Mexican state of Nayarit) changed time zone
    UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
    time zone as nearby city Puerto Vallarta, Jalisco).

Modified:
  stable/7/share/zoneinfo/northamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Mon May 10 21:04:37 2010	(r207899)
+++ stable/7/share/zoneinfo/northamerica	Mon May 10 21:04:40 2010	(r207900)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.30
+# @(#)northamerica	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2089,7 +2089,44 @@ Zone America/Hermosillo	-7:23:52 -	LMT	1
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT	1999
 			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bahía de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bahía de Banderas homologa su horario al del centro del
+# país, a partir de este domingo
+# 
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# 
+#
+# Bahía de Banderas homologa su horario con el del Centro del
+# País
+# 
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# 
+#
+# (English)
+# Puerto Vallarta and Bahía de Banderas: One Time Zone
+# 
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# 
+#
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# 
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bahía de Banderas and Puerto Vallarta to share the same time
+# zone ..."
 # Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
 Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
 			-7:00	-	MST	1927 Jun 10 23:00
 			-6:00	-	CST	1930 Nov 15
@@ -2100,6 +2137,19 @@ Zone America/Mazatlan	-7:05:40 -	LMT	192
 			-7:00	-	MST	1949 Jan 14
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4
+			-6:00	Mexico	C%sT
+
 # Baja California (near US border)
 Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
 			-7:00	-	MST	1924

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Mon May 10 21:04:37 2010	(r207899)
+++ stable/7/share/zoneinfo/zone.tab	Mon May 10 21:04:40 2010	(r207900)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.35
+# @(#)zone.tab	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -288,6 +288,7 @@ MX	+2934-10425	America/Ojinaga	US Mounta
 MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
 MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
 MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
 MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 21:04:45 2010
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 782D51065698;
	Mon, 10 May 2010 21:04:45 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 5BF8D8FC08;
	Mon, 10 May 2010 21:04:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4AL4j0U068715;
	Mon, 10 May 2010 21:04:45 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4AL4jvL068712;
	Mon, 10 May 2010 21:04:45 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201005102104.o4AL4jvL068712@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 10 May 2010 21:04:45 +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: r207901 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 10 May 2010 21:04:45 -0000

Author: edwin
Date: Mon May 10 21:04:45 2010
New Revision: 207901
URL: http://svn.freebsd.org/changeset/base/207901

Log:
  MFC of 207898, tzdata2010j:
  
  - Bahia de Banderas (Mexican state of Nayarit) changed time zone
    UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
    time zone as nearby city Puerto Vallarta, Jalisco).

Modified:
  stable/8/share/zoneinfo/northamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/northamerica
==============================================================================
--- stable/8/share/zoneinfo/northamerica	Mon May 10 21:04:40 2010	(r207900)
+++ stable/8/share/zoneinfo/northamerica	Mon May 10 21:04:45 2010	(r207901)
@@ -1,5 +1,5 @@
 # 
-# @(#)northamerica	8.30
+# @(#)northamerica	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2089,7 +2089,44 @@ Zone America/Hermosillo	-7:23:52 -	LMT	1
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT	1999
 			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bahía de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bahía de Banderas homologa su horario al del centro del
+# país, a partir de este domingo
+# 
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# 
+#
+# Bahía de Banderas homologa su horario con el del Centro del
+# País
+# 
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# 
+#
+# (English)
+# Puerto Vallarta and Bahía de Banderas: One Time Zone
+# 
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# 
+#
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# 
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bahía de Banderas and Puerto Vallarta to share the same time
+# zone ..."
 # Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
 Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
 			-7:00	-	MST	1927 Jun 10 23:00
 			-6:00	-	CST	1930 Nov 15
@@ -2100,6 +2137,19 @@ Zone America/Mazatlan	-7:05:40 -	LMT	192
 			-7:00	-	MST	1949 Jan 14
 			-8:00	-	PST	1970
 			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4
+			-6:00	Mexico	C%sT
+
 # Baja California (near US border)
 Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
 			-7:00	-	MST	1924

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Mon May 10 21:04:40 2010	(r207900)
+++ stable/8/share/zoneinfo/zone.tab	Mon May 10 21:04:45 2010	(r207901)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.35
+# @(#)zone.tab	8.36
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -288,6 +288,7 @@ MX	+2934-10425	America/Ojinaga	US Mounta
 MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
 MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
 MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
 MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo

From owner-svn-src-all@FreeBSD.ORG  Mon May 10 21:31:21 2010
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 285CB1065672;
	Mon, 10 May 2010 21:31:21 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 18ECF8FC0C;
	Mon, 10 May 2010 21:31:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ALVK11074550;
	Mon, 10 May 2010 21:31:20 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ALVKmg074548;
	Mon, 10 May 2010 21:31:20 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201005102131.o4ALVKmg074548@svn.freebsd.org>
From: Kip Macy 
Date: Mon, 10 May 2010 21:31: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: r207902 - 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: Mon, 10 May 2010 21:31:21 -0000

Author: kmacy
Date: Mon May 10 21:31:20 2010
New Revision: 207902
URL: http://svn.freebsd.org/changeset/base/207902

Log:
  boot time size the flowtable
  
  MFC after:	3 days

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Mon May 10 21:04:45 2010	(r207901)
+++ head/sys/netinet6/ip6_input.c	Mon May 10 21:31:20 2010	(r207902)
@@ -177,9 +177,21 @@ ip6_init(void)
 	frag6_init();
 
 #ifdef FLOWTABLE
- 	TUNABLE_INT_FETCH("net.inet6.ip6.output_flowtable_size",
- 	    &V_ip6_output_flowtable_size);
- 	V_ip6_ft = flowtable_alloc("ipv6", V_ip6_output_flowtable_size, FL_PCPU);
+	if (TUNABLE_INT_FETCH("net.inet6.ip6.output_flowtable_size",
+		&V_ip6_output_flowtable_size)) {
+		if (V_ip6_output_flowtable_size < 256)
+			V_ip6_output_flowtable_size = 256;
+		if (!powerof2(V_ip6_output_flowtable_size)) {
+			printf("flowtable must be power of 2 size\n");
+			V_ip6_output_flowtable_size = 2048;
+		}
+	} else {
+		/*
+		 * round up to the next power of 2
+		 */
+		V_ip6_output_flowtable_size = 1 << fls((1024 + maxusers * 64)-1);
+	}
+	V_ip6_ft = flowtable_alloc("ipv6", V_ip6_output_flowtable_size, FL_PCPU);
 #endif	
 	
 	V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR;

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 01:29:19 2010
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 4AB30106564A;
	Tue, 11 May 2010 01:29:19 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B53C8FC1C;
	Tue, 11 May 2010 01:29:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B1TJDO026535;
	Tue, 11 May 2010 01:29:19 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B1TJEk026533;
	Tue, 11 May 2010 01:29:19 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201005110129.o4B1TJEk026533@svn.freebsd.org>
From: Alan Cox 
Date: Tue, 11 May 2010 01:29: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: r207905 - 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: Tue, 11 May 2010 01:29:19 -0000

Author: alc
Date: Tue May 11 01:29:18 2010
New Revision: 207905
URL: http://svn.freebsd.org/changeset/base/207905

Log:
  Update synchronization annotations for struct vm_page.  Add a comment
  explaining how the setting of PG_WRITEABLE is synchronized.

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Mon May 10 22:21:08 2010	(r207904)
+++ head/sys/vm/vm_page.h	Tue May 11 01:29:18 2010	(r207905)
@@ -112,7 +112,7 @@ struct vm_page {
 	u_short	flags;			/* see below */
 	uint8_t	order;			/* index of the buddy queue */
 	uint8_t pool;
-	u_short cow;			/* page cow mapping count (Q) */
+	u_short cow;			/* page cow mapping count (P) */
 	u_int wire_count;		/* wired down maps refs (P) */
 	short hold_count;		/* page hold count (P) */
 	u_short oflags;			/* page flags (O) */
@@ -122,16 +122,16 @@ struct vm_page {
 	/* so, on normal X86 kernels, they must be at least 8 bits wide */
 #if PAGE_SIZE == 4096
 	u_char	valid;			/* map of valid DEV_BSIZE chunks (O) */
-	u_char	dirty;			/* map of dirty DEV_BSIZE chunks */
+	u_char	dirty;			/* map of dirty DEV_BSIZE chunks (O) */
 #elif PAGE_SIZE == 8192
 	u_short	valid;			/* map of valid DEV_BSIZE chunks (O) */
-	u_short	dirty;			/* map of dirty DEV_BSIZE chunks */
+	u_short	dirty;			/* map of dirty DEV_BSIZE chunks (O) */
 #elif PAGE_SIZE == 16384
 	u_int valid;			/* map of valid DEV_BSIZE chunks (O) */
-	u_int dirty;			/* map of dirty DEV_BSIZE chunks */
+	u_int dirty;			/* map of dirty DEV_BSIZE chunks (O) */
 #elif PAGE_SIZE == 32768
 	u_long valid;			/* map of valid DEV_BSIZE chunks (O) */
-	u_long dirty;			/* map of dirty DEV_BSIZE chunks */
+	u_long dirty;			/* map of dirty DEV_BSIZE chunks (O) */
 #endif
 };
 
@@ -216,6 +216,9 @@ extern struct vpglocks pa_lock[];
  *	 via the object/vm_page_t because there is no knowledge of their
  *	 pte mappings, nor can they be removed from their objects via 
  *	 the object, and such pages are also not on any PQ queue.
+ *
+ * PG_WRITEABLE is set exclusively by pmap_enter().  When it does so, either
+ * the page must be VPO_BUSY or the containing object must be locked.
  */
 #define	PG_CACHED	0x0001		/* page is cached */
 #define	PG_FREE		0x0002		/* page is free */

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 07:02:29 2010
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 CDBD2106567D;
	Tue, 11 May 2010 07:02:29 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id BBE4D8FC1C;
	Tue, 11 May 2010 07:02:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B72TD6099733;
	Tue, 11 May 2010 07:02:29 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B72T7N099730;
	Tue, 11 May 2010 07:02:29 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110702.o4B72T7N099730@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 07:02:29 +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: r207906 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 07:02:30 -0000

Author: mm
Date: Tue May 11 07:02:29 2010
New Revision: 207906
URL: http://svn.freebsd.org/changeset/base/207906

Log:
  MFC r207624:
  
  Fix deadlock during zfs receive.
  
  OpenSolaris onnv revision:	9299:8809e849f63e
  
  PR:		kern/146296
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6783818, 6826836)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue May 11 01:29:18 2010	(r207905)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue May 11 07:02:29 2010	(r207906)
@@ -464,15 +464,15 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
 	ASSERT(db->db_buf == NULL);
 
 	if (db->db_blkid == DB_BONUS_BLKID) {
-		int bonuslen = dn->dn_bonuslen;
+		int bonuslen = MIN(dn->dn_bonuslen, dn->dn_phys->dn_bonuslen);
 
 		ASSERT3U(bonuslen, <=, db->db.db_size);
 		db->db.db_data = zio_buf_alloc(DN_MAX_BONUSLEN);
 		arc_space_consume(DN_MAX_BONUSLEN);
 		if (bonuslen < DN_MAX_BONUSLEN)
 			bzero(db->db.db_data, DN_MAX_BONUSLEN);
-		bcopy(DN_BONUS(dn->dn_phys), db->db.db_data,
-		    bonuslen);
+		if (bonuslen)
+			bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen);
 		dbuf_update_data(db);
 		db->db_state = DB_CACHED;
 		mutex_exit(&db->db_mtx);

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c	Tue May 11 01:29:18 2010	(r207905)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c	Tue May 11 07:02:29 2010	(r207906)
@@ -128,15 +128,6 @@ dmu_object_reclaim(objset_t *os, uint64_
 		return (0);
 	}
 
-	tx = dmu_tx_create(os);
-	dmu_tx_hold_bonus(tx, object);
-	err = dmu_tx_assign(tx, TXG_WAIT);
-	if (err) {
-		dmu_tx_abort(tx);
-		dnode_rele(dn, FTAG);
-		return (err);
-	}
-
 	nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT);
 
 	/*
@@ -144,16 +135,27 @@ dmu_object_reclaim(objset_t *os, uint64_
 	 * be a new file instance.   We must clear out the previous file
 	 * contents before we can change this type of metadata in the dnode.
 	 */
-	if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize)
-		dmu_free_long_range(os, object, 0, DMU_OBJECT_END);
+	if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) {
+		err = dmu_free_long_range(os, object, 0, DMU_OBJECT_END);
+		if (err)
+			goto out;
+	}
+
+	tx = dmu_tx_create(os);
+	dmu_tx_hold_bonus(tx, object);
+	err = dmu_tx_assign(tx, TXG_WAIT);
+	if (err) {
+		dmu_tx_abort(tx);
+		goto out;
+	}
 
 	dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx);
 
 	dmu_tx_commit(tx);
-
+out:
 	dnode_rele(dn, FTAG);
 
-	return (0);
+	return (err);
 }
 
 int

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 07:07:44 2010
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 AD38F106564A;
	Tue, 11 May 2010 07:07:44 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B56A8FC28;
	Tue, 11 May 2010 07:07:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B77ikP001050;
	Tue, 11 May 2010 07:07:44 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B77iPW001047;
	Tue, 11 May 2010 07:07:44 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110707.o4B77iPW001047@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 07:07:44 +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: r207907 -
	stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 07:07:44 -0000

Author: mm
Date: Tue May 11 07:07:44 2010
New Revision: 207907
URL: http://svn.freebsd.org/changeset/base/207907

Log:
  MFC r207624:
  
  Fix deadlock during zfs receive.
  
  OpenSolaris onnv revision:	9299:8809e849f63e
  
  PR:		kern/146296
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6783818, 6826836)

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue May 11 07:02:29 2010	(r207906)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue May 11 07:07:44 2010	(r207907)
@@ -464,15 +464,15 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t
 	ASSERT(db->db_buf == NULL);
 
 	if (db->db_blkid == DB_BONUS_BLKID) {
-		int bonuslen = dn->dn_bonuslen;
+		int bonuslen = MIN(dn->dn_bonuslen, dn->dn_phys->dn_bonuslen);
 
 		ASSERT3U(bonuslen, <=, db->db.db_size);
 		db->db.db_data = zio_buf_alloc(DN_MAX_BONUSLEN);
 		arc_space_consume(DN_MAX_BONUSLEN);
 		if (bonuslen < DN_MAX_BONUSLEN)
 			bzero(db->db.db_data, DN_MAX_BONUSLEN);
-		bcopy(DN_BONUS(dn->dn_phys), db->db.db_data,
-		    bonuslen);
+		if (bonuslen)
+			bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen);
 		dbuf_update_data(db);
 		db->db_state = DB_CACHED;
 		mutex_exit(&db->db_mtx);

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c	Tue May 11 07:02:29 2010	(r207906)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c	Tue May 11 07:07:44 2010	(r207907)
@@ -128,15 +128,6 @@ dmu_object_reclaim(objset_t *os, uint64_
 		return (0);
 	}
 
-	tx = dmu_tx_create(os);
-	dmu_tx_hold_bonus(tx, object);
-	err = dmu_tx_assign(tx, TXG_WAIT);
-	if (err) {
-		dmu_tx_abort(tx);
-		dnode_rele(dn, FTAG);
-		return (err);
-	}
-
 	nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT);
 
 	/*
@@ -144,16 +135,27 @@ dmu_object_reclaim(objset_t *os, uint64_
 	 * be a new file instance.   We must clear out the previous file
 	 * contents before we can change this type of metadata in the dnode.
 	 */
-	if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize)
-		dmu_free_long_range(os, object, 0, DMU_OBJECT_END);
+	if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) {
+		err = dmu_free_long_range(os, object, 0, DMU_OBJECT_END);
+		if (err)
+			goto out;
+	}
+
+	tx = dmu_tx_create(os);
+	dmu_tx_hold_bonus(tx, object);
+	err = dmu_tx_assign(tx, TXG_WAIT);
+	if (err) {
+		dmu_tx_abort(tx);
+		goto out;
+	}
 
 	dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx);
 
 	dmu_tx_commit(tx);
-
+out:
 	dnode_rele(dn, FTAG);
 
-	return (0);
+	return (err);
 }
 
 int

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 07:25:14 2010
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 44CF4106567C;
	Tue, 11 May 2010 07:25:14 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 342158FC12;
	Tue, 11 May 2010 07:25:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B7PEBA004949;
	Tue, 11 May 2010 07:25:14 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B7PEnC004947;
	Tue, 11 May 2010 07:25:14 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110725.o4B7PEnC004947@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 07: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: r207908 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 07:25:14 -0000

Author: mm
Date: Tue May 11 07:25:13 2010
New Revision: 207908
URL: http://svn.freebsd.org/changeset/base/207908

Log:
  Fix endianess bug in ZFS intent log (ZIL).
  
  OpenSolaris onnv revision:	8109:6147a1bdd359
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6760048)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Tue May 11 07:07:44 2010	(r207907)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Tue May 11 07:25:13 2010	(r207908)
@@ -358,14 +358,20 @@ zil_create(zilog_t *zilog)
 	blk = zh->zh_log;
 
 	/*
-	 * If we don't already have an initial log block, allocate one now.
+	 * If we don't already have an initial log block or we have one
+	 * but it's the wrong endianness then allocate one.
 	 */
-	if (BP_IS_HOLE(&blk)) {
+	if (BP_IS_HOLE(&blk) || BP_SHOULD_BYTESWAP(&blk)) {
 		tx = dmu_tx_create(zilog->zl_os);
 		(void) dmu_tx_assign(tx, TXG_WAIT);
 		dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
 		txg = dmu_tx_get_txg(tx);
 
+		if (!BP_IS_HOLE(&blk)) {
+			zio_free_blk(zilog->zl_spa, &blk, txg);
+			BP_ZERO(&blk);
+		}
+
 		error = zio_alloc_blk(zilog->zl_spa, ZIL_MIN_BLKSZ, &blk,
 		    NULL, txg);
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 09:12:42 2010
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 791F41065677;
	Tue, 11 May 2010 09:12:42 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 34DF88FC1A;
	Tue, 11 May 2010 09:12:41 +0000 (UTC)
Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14])
	by karen.lavabit.com (Postfix) with ESMTP id E5EE911B8A3;
	Tue, 11 May 2010 04:12:40 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id FRBYZ07UMEK5;
	Tue, 11 May 2010 04:12:40 -0500
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <201005081156.o48Bu0ma006645@svn.freebsd.org>
Date: Tue, 11 May 2010 10:12:37 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <615D8823-C354-4CC7-8CC1-75BCD1791EC2@FreeBSD.org>
References: <201005081156.o48Bu0ma006645@svn.freebsd.org>
To: Ed Maste 
X-Mailer: Apple Mail (2.1078)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207768 - head/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: Tue, 11 May 2010 09:12:42 -0000

On 8 May 2010, at 12:56, Ed Maste wrote:

> Author: emaste
> Date: Sat May  8 11:56:00 2010
> New Revision: 207768
> URL: http://svn.freebsd.org/changeset/base/207768
>=20
> Log:
>  Add dummy function for ic_update_mcast (a la if_urtw) to avoid =
console
>  spam.

I don't agree with this. I think these dummy functions should be removed =
in all drivers and if the console spam is annoying it should be limited =
to one message per interface.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Tue May 11 09:19:42 2010
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 2EFFB1065672;
	Tue, 11 May 2010 09:19:42 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F2D48FC08;
	Tue, 11 May 2010 09:19:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B9Jgkq030136;
	Tue, 11 May 2010 09:19:42 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B9JfuV030134;
	Tue, 11 May 2010 09:19:42 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110919.o4B9JfuV030134@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 09:19: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: r207909 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 09:19:42 -0000

Author: mm
Date: Tue May 11 09:19:41 2010
New Revision: 207909
URL: http://svn.freebsd.org/changeset/base/207909

Log:
  Fix zfs rename (may occasionally fail with dataset busy).
  
  OpenSolaris onnv revision:	8517:41a0783dde17
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784757)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 07:25:13 2010	(r207908)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 09:19:41 2010	(r207909)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2205,6 +2205,12 @@ dsl_dataset_rename(char *oldname, const 
 	err = dsl_dir_open(oldname, FTAG, &dd, &tail);
 	if (err)
 		return (err);
+	/*
+	 * If there are more than 2 references there may be holds
+	 * hanging around that haven't been cleared out yet.
+	 */
+	if (dmu_buf_refcount(dd->dd_dbuf) > 2)
+		txg_wait_synced(dd->dd_pool, 0);
 	if (tail == NULL) {
 		int delta = strlen(newname) - strlen(oldname);
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 09:23:46 2010
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 681AB1065672;
	Tue, 11 May 2010 09:23:46 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 571A78FC0C;
	Tue, 11 May 2010 09:23:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B9NkXF031112;
	Tue, 11 May 2010 09:23:46 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B9Nkg4031079;
	Tue, 11 May 2010 09:23:46 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110923.o4B9Nkg4031079@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 09:23: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: r207910 - in head: cddl/contrib/opensolaris/cmd/ztest
	sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 09:23:46 -0000

Author: mm
Date: Tue May 11 09:23:46 2010
New Revision: 207910
URL: http://svn.freebsd.org/changeset/base/207910

Log:
  Fix possible panic with zfs destroy.
  
  OpenSolaris onnv revision:	8779:f164e0e90508
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784924)
  MFC after:	3 days

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue May 11 09:19:41 2010	(r207909)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue May 11 09:23:46 2010	(r207910)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -93,6 +93,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -174,6 +175,7 @@ ztest_func_t ztest_traverse;
 ztest_func_t ztest_dsl_prop_get_set;
 ztest_func_t ztest_dmu_objset_create_destroy;
 ztest_func_t ztest_dmu_snapshot_create_destroy;
+ztest_func_t ztest_dsl_dataset_promote_busy;
 ztest_func_t ztest_spa_create_destroy;
 ztest_func_t ztest_fault_inject;
 ztest_func_t ztest_spa_rename;
@@ -208,6 +210,7 @@ ztest_info_t ztest_info[] = {
 	{ ztest_dsl_prop_get_set,		1,	&zopt_sometimes	},
 	{ ztest_dmu_objset_create_destroy,	1,	&zopt_sometimes },
 	{ ztest_dmu_snapshot_create_destroy,	1,	&zopt_sometimes },
+	{ ztest_dsl_dataset_promote_busy,	1,	&zopt_sometimes },
 	{ ztest_spa_create_destroy,		1,	&zopt_sometimes },
 	{ ztest_fault_inject,			1,	&zopt_sometimes	},
 	{ ztest_spa_rename,			1,	&zopt_rarely	},
@@ -1591,6 +1594,109 @@ ztest_traverse(ztest_args_t *za)
 }
 
 /*
+ * Verify dsl_dataset_promote handles EBUSY
+ */
+void
+ztest_dsl_dataset_promote_busy(ztest_args_t *za)
+{
+	int error;
+	objset_t *os = za->za_os;
+	objset_t *clone;
+	dsl_dataset_t *ds;
+	char snap1name[100];
+	char clone1name[100];
+	char snap2name[100];
+	char clone2name[100];
+	char snap3name[100];
+	char osname[MAXNAMELEN];
+	static uint64_t uniq = 0;
+	uint64_t curval;
+
+	curval = atomic_add_64_nv(&uniq, 5) - 5;
+
+	(void) rw_rdlock(&ztest_shared->zs_name_lock);
+
+	dmu_objset_name(os, osname);
+	(void) snprintf(snap1name, 100, "%s@s1_%llu", osname, curval++);
+	(void) snprintf(clone1name, 100, "%s/c1_%llu", osname, curval++);
+	(void) snprintf(snap2name, 100, "%s@s2_%llu", clone1name, curval++);
+	(void) snprintf(clone2name, 100, "%s/c2_%llu", osname, curval++);
+	(void) snprintf(snap3name, 100, "%s@s3_%llu", clone1name, curval++);
+
+	error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap1name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
+
+	error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
+	dmu_objset_close(clone);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap3name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
+
+	error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
+	dmu_objset_close(clone);
+
+	error = dsl_dataset_own(snap1name, 0, FTAG, &ds);
+	if (error)
+		fatal(0, "dsl_dataset_own(%s) = %d", snap1name, error);
+	error = dsl_dataset_promote(clone2name);
+	if (error != EBUSY)
+		fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
+		    error);
+	dsl_dataset_disown(ds, FTAG);
+
+	error = dmu_objset_destroy(clone2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
+
+	error = dmu_objset_destroy(snap3name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(snap2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(clone1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
+	error = dmu_objset_destroy(snap1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
+
+	(void) rw_unlock(&ztest_shared->zs_name_lock);
+}
+
+/*
  * Verify that dmu_object_{alloc,free} work as expected.
  */
 void

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 09:19:41 2010	(r207909)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 09:23:46 2010	(r207910)
@@ -554,6 +554,7 @@ dsl_dataset_own_obj(dsl_pool_t *dp, uint
 		return (err);
 	if (!dsl_dataset_tryown(*dsp, DS_MODE_IS_INCONSISTENT(flags), owner)) {
 		dsl_dataset_rele(*dsp, owner);
+		*dsp = NULL;
 		return (EBUSY);
 	}
 	return (0);
@@ -2584,7 +2585,7 @@ snaplist_destroy(list_t *l, boolean_t ow
 {
 	struct promotenode *snap;
 
-	if (!list_link_active(&l->list_head))
+	if (!l || !list_link_active(&l->list_head))
 		return;
 
 	while ((snap = list_tail(l)) != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 09:26:46 2010
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 A7730106564A;
	Tue, 11 May 2010 09:26:46 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 97A178FC13;
	Tue, 11 May 2010 09:26:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4B9Qk2D031767;
	Tue, 11 May 2010 09:26:46 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4B9QkmF031765;
	Tue, 11 May 2010 09:26:46 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005110926.o4B9QkmF031765@svn.freebsd.org>
From: Martin Matuska 
Date: Tue, 11 May 2010 09:26: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: r207911 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 09:26:46 -0000

Author: mm
Date: Tue May 11 09:26:46 2010
New Revision: 207911
URL: http://svn.freebsd.org/changeset/base/207911

Log:
  Fix failed assertion on destroying datasets from an older pool version.
  
  OpenSolaris onnv revision:	9390:887948510f80
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6826861)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 09:23:46 2010	(r207910)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue May 11 09:26:46 2010	(r207911)
@@ -1268,8 +1268,7 @@ dsl_dataset_rollback_sync(void *arg1, vo
 		(void) zio_wait(zio);
 	}
 
-	ASSERT(!(ds->ds_phys->ds_flags & DS_FLAG_UNIQUE_ACCURATE) ||
-	    ds->ds_phys->ds_unique_bytes == 0);
+	ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == 0);
 
 	if (ds->ds_prev && ds->ds_prev != ds->ds_dir->dd_pool->dp_origin_snap) {
 		/* Change our contents to that of the prev snapshot */
@@ -1661,7 +1660,7 @@ dsl_dataset_destroy_sync(void *arg1, voi
 		err = traverse_dsl_dataset(ds, ds->ds_phys->ds_prev_snap_txg,
 		    ADVANCE_POST, kill_blkptr, &ka);
 		ASSERT3U(err, ==, 0);
-		ASSERT(spa_version(dp->dp_spa) < SPA_VERSION_UNIQUE_ACCURATE ||
+		ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) ||
 		    ds->ds_phys->ds_unique_bytes == 0);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 11:08:16 2010
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 6ECD1106564A;
	Tue, 11 May 2010 11:08:16 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C8548FC18;
	Tue, 11 May 2010 11:08:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BB8GVx062651;
	Tue, 11 May 2010 11:08:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BB8GFd062635;
	Tue, 11 May 2010 11:08:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201005111108.o4BB8GFd062635@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 11 May 2010 11:08:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207912 - in stable/8/sys: conf dev/bwi dev/bwn dev/iwn
	dev/ral dev/usb/wlan dev/wpi modules/wlan net80211
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 11 May 2010 11:08:16 -0000

Author: rpaulo
Date: Tue May 11 11:08:15 2010
New Revision: 207912
URL: http://svn.freebsd.org/changeset/base/207912

Log:
  MFC r206367, r206358, r206370, r206371, r206372, r206398, r206415,
      r206416, r206417, r206418, r206418:
  
  net80211 ratectl framework.

Added:
  stable/8/sys/net80211/ieee80211_ratectl.c
     - copied unchanged from r206358, head/sys/net80211/ieee80211_ratectl.c
  stable/8/sys/net80211/ieee80211_ratectl.h
     - copied, changed from r206358, head/sys/net80211/ieee80211_ratectl.h
Modified:
  stable/8/sys/conf/files
  stable/8/sys/dev/bwi/if_bwi.c
  stable/8/sys/dev/bwi/if_bwivar.h
  stable/8/sys/dev/bwn/if_bwn.c
  stable/8/sys/dev/bwn/if_bwnvar.h
  stable/8/sys/dev/iwn/if_iwn.c
  stable/8/sys/dev/iwn/if_iwnvar.h
  stable/8/sys/dev/ral/rt2560.c
  stable/8/sys/dev/ral/rt2560var.h
  stable/8/sys/dev/ral/rt2661.c
  stable/8/sys/dev/ral/rt2661var.h
  stable/8/sys/dev/usb/wlan/if_rum.c
  stable/8/sys/dev/usb/wlan/if_rumvar.h
  stable/8/sys/dev/usb/wlan/if_run.c
  stable/8/sys/dev/usb/wlan/if_runvar.h
  stable/8/sys/dev/usb/wlan/if_ural.c
  stable/8/sys/dev/usb/wlan/if_uralvar.h
  stable/8/sys/dev/usb/wlan/if_urtw.c
  stable/8/sys/dev/usb/wlan/if_zyd.c
  stable/8/sys/dev/usb/wlan/if_zydreg.h
  stable/8/sys/dev/wpi/if_wpi.c
  stable/8/sys/dev/wpi/if_wpivar.h
  stable/8/sys/modules/wlan/Makefile
  stable/8/sys/net80211/ieee80211.c
  stable/8/sys/net80211/ieee80211_amrr.c
  stable/8/sys/net80211/ieee80211_amrr.h
  stable/8/sys/net80211/ieee80211_freebsd.h
  stable/8/sys/net80211/ieee80211_node.c
  stable/8/sys/net80211/ieee80211_node.h
  stable/8/sys/net80211/ieee80211_rssadapt.c
  stable/8/sys/net80211/ieee80211_rssadapt.h
  stable/8/sys/net80211/ieee80211_var.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/conf/files	Tue May 11 11:08:15 2010	(r207912)
@@ -2370,6 +2370,7 @@ net80211/ieee80211_phy.c	optional wlan
 net80211/ieee80211_power.c	optional wlan
 net80211/ieee80211_proto.c	optional wlan
 net80211/ieee80211_radiotap.c	optional wlan
+net80211/ieee80211_ratectl.c	optional wlan
 net80211/ieee80211_regdomain.c	optional wlan
 net80211/ieee80211_rssadapt.c	optional wlan wlan_rssadapt
 net80211/ieee80211_scan.c	optional wlan

Modified: stable/8/sys/dev/bwi/if_bwi.c
==============================================================================
--- stable/8/sys/dev/bwi/if_bwi.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/bwi/if_bwi.c	Tue May 11 11:08:15 2010	(r207912)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 #include 
 
@@ -112,9 +112,6 @@ static void	bwi_set_channel(struct ieee8
 static void	bwi_scan_end(struct ieee80211com *);
 static int	bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static void	bwi_updateslot(struct ifnet *);
-static struct ieee80211_node *bwi_node_alloc(struct ieee80211vap *,
-		    const uint8_t [IEEE80211_ADDR_LEN]);
-static void	bwi_newassoc(struct ieee80211_node *, int);
 static int	bwi_media_change(struct ifnet *);
 
 static void	bwi_calibrate(void *);
@@ -525,7 +522,6 @@ bwi_attach(struct bwi_softc *sc)
 	ic->ic_vap_delete = bwi_vap_delete;
 	ic->ic_raw_xmit = bwi_raw_xmit;
 	ic->ic_updateslot = bwi_updateslot;
-	ic->ic_node_alloc = bwi_node_alloc;
 	ic->ic_scan_start = bwi_scan_start;
 	ic->ic_scan_end = bwi_scan_end;
 	ic->ic_set_channel = bwi_set_channel;
@@ -620,10 +616,7 @@ bwi_vap_create(struct ieee80211com *ic,
 #if 0
 	vap->iv_update_beacon = bwi_beacon_update;
 #endif
-	ieee80211_amrr_init(&bvp->bv_amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    500 /*ms*/);
+	ieee80211_ratectl_init(vap);
 
 	/* complete setup */
 	ieee80211_vap_attach(vap, bwi_media_change, ieee80211_media_status);
@@ -636,7 +629,7 @@ bwi_vap_delete(struct ieee80211vap *vap)
 {
 	struct bwi_vap *bvp = BWI_VAP(vap);
 
-	ieee80211_amrr_cleanup(&bvp->bv_amrr);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(bvp, M_80211_VAP);
 }
@@ -1826,7 +1819,7 @@ bwi_newstate(struct ieee80211vap *vap, e
 #endif
 		if (vap->iv_opmode == IEEE80211_M_STA) {
 			/* fake a join to init the tx rate */
-			bwi_newassoc(ni, 1);
+			ic->ic_newassoc(ni, 1);
 		}
 
 		callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc);
@@ -1837,25 +1830,6 @@ back:
 	return error;
 }
 
-/* ARGUSED */
-static struct ieee80211_node *
-bwi_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
-{
-	struct bwi_node *bn;
-
-	bn = malloc(sizeof(struct bwi_node), M_80211_NODE, M_NOWAIT | M_ZERO);
-	return bn != NULL ? &bn->ni : NULL;
-}
-
-static void
-bwi_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-
-	ieee80211_amrr_node_init(&BWI_VAP(vap)->bv_amrr,
-	    &BWI_NODE(ni)->amn, ni);
-}
-
 static int
 bwi_media_change(struct ifnet *ifp)
 {
@@ -3007,7 +2981,7 @@ bwi_encap(struct bwi_softc *sc, int idx,
 	} else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
 		rate = rate_fb = tp->ucastrate;
 	} else {
-		rix = ieee80211_amrr_choose(ni, &BWI_NODE(ni)->amn);
+		rix = ieee80211_ratectl_rate(ni, NULL, pkt_len);
 		rate = ni->ni_txrate;
 
 		if (rix > 0) {
@@ -3364,6 +3338,7 @@ _bwi_txeof(struct bwi_softc *sc, uint16_
 	struct bwi_txbuf *tb;
 	int ring_idx, buf_idx;
 	struct ieee80211_node *ni;
+	struct ieee80211vap *vap;
 
 	if (tx_id == 0) {
 		if_printf(ifp, "%s: zero tx id\n", __func__);
@@ -3389,9 +3364,9 @@ _bwi_txeof(struct bwi_softc *sc, uint16_
 
 	ni = tb->tb_ni;
 	if (tb->tb_ni != NULL) {
-		struct bwi_node *bn = (struct bwi_node *) tb->tb_ni;
 		const struct bwi_txbuf_hdr *hdr =
 		    mtod(tb->tb_mbuf, const struct bwi_txbuf_hdr *);
+		vap = ni->ni_vap;
 
 		/* NB: update rate control only for unicast frames */
 		if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) {
@@ -3402,8 +3377,9 @@ _bwi_txeof(struct bwi_softc *sc, uint16_
 			 * well so to avoid over-aggressive downshifting we
 			 * treat any number of retries as "1".
 			 */
-			ieee80211_amrr_tx_complete(&bn->amn, acked,
-			    data_txcnt > 1);
+			ieee80211_ratectl_tx_complete(vap, ni,
+			    (data_txcnt > 1) ? IEEE80211_RATECTL_TX_SUCCESS :
+			        IEEE80211_RATECTL_TX_FAILURE, &acked, NULL);
 		}
 
 		/*

Modified: stable/8/sys/dev/bwi/if_bwivar.h
==============================================================================
--- stable/8/sys/dev/bwi/if_bwivar.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/bwi/if_bwivar.h	Tue May 11 11:08:15 2010	(r207912)
@@ -533,15 +533,8 @@ struct bwi_rx_radiotap_hdr {
 	/* TODO: sq */
 };
 
-struct bwi_node {
-	struct ieee80211_node		ni;	/* must be the first */
-	struct ieee80211_amrr_node	amn;
-};
-#define	BWI_NODE(ni)	((struct bwi_node *)(ni))
-
 struct bwi_vap {
 	struct ieee80211vap	bv_vap;
-	struct ieee80211_amrr	bv_amrr;
 	int			(*bv_newstate)(struct ieee80211vap *,
 				    enum ieee80211_state, int);
 };

Modified: stable/8/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/8/sys/dev/bwn/if_bwn.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/bwn/if_bwn.c	Tue May 11 11:08:15 2010	(r207912)
@@ -67,8 +67,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -180,18 +180,14 @@ static void	bwn_addchannels(struct ieee8
 		    const struct bwn_channelinfo *, int);
 static int	bwn_raw_xmit(struct ieee80211_node *, struct mbuf *,
 		    const struct ieee80211_bpf_params *);
-static void	bwn_newassoc(struct ieee80211_node *, int);
 static void	bwn_updateslot(struct ifnet *);
 static void	bwn_update_promisc(struct ifnet *);
 static void	bwn_wme_init(struct bwn_mac *);
 static int	bwn_wme_update(struct ieee80211com *);
-static struct ieee80211_node *bwn_node_alloc(struct ieee80211vap *,
-		    const uint8_t [IEEE80211_ADDR_LEN]);
 static void	bwn_wme_clear(struct bwn_softc *);
 static void	bwn_wme_load(struct bwn_mac *);
 static void	bwn_wme_loadparams(struct bwn_mac *,
 		    const struct wmeParams *, uint16_t);
-static void	bwn_node_cleanup(struct ieee80211_node *);
 static void	bwn_scan_start(struct ieee80211com *);
 static void	bwn_scan_end(struct ieee80211com *);
 static void	bwn_set_channel(struct ieee80211com *);
@@ -1088,15 +1084,10 @@ bwn_attach_post(struct bwn_softc *sc)
 
 	/* override default methods */
 	ic->ic_raw_xmit = bwn_raw_xmit;
-	ic->ic_newassoc = bwn_newassoc;
 	ic->ic_updateslot = bwn_updateslot;
 	ic->ic_update_promisc = bwn_update_promisc;
 	ic->ic_wme.wme_update = bwn_wme_update;
 
-	ic->ic_node_alloc = bwn_node_alloc;
-	sc->sc_node_cleanup = ic->ic_node_cleanup;
-	ic->ic_node_cleanup = bwn_node_cleanup;
-
 	ic->ic_scan_start = bwn_scan_start;
 	ic->ic_scan_end = bwn_scan_end;
 	ic->ic_set_channel = bwn_set_channel;
@@ -2772,20 +2763,6 @@ bwn_raw_xmit(struct ieee80211_node *ni, 
 }
 
 /*
- * Setup driver-specific state for a newly associated node.
- * Note that we're called also on a re-associate, the isnew
- * param tells us if this is the first time or not.
- */
-static void
-bwn_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-
-	ieee80211_amrr_node_init(&BWN_VAP(vap)->bv_amrr,
-	    &BWN_NODE(ni)->bn_amn, ni);
-}
-
-/*
  * Callback from the 802.11 layer to update the slot time
  * based on the current setting.  We use it to notify the
  * firmware of ERP changes and the f/w takes care of things
@@ -2857,32 +2834,6 @@ bwn_wme_update(struct ieee80211com *ic)
 	return (0);
 }
 
-static struct ieee80211_node *
-bwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
-{
-	struct ieee80211com *ic = vap->iv_ic;
-	struct bwn_softc *sc = ic->ic_ifp->if_softc;
-	const size_t space = sizeof(struct bwn_node);
-	struct bwn_node *bn;
-
-	bn = malloc(space, M_80211_NODE, M_NOWAIT|M_ZERO);
-	if (bn == NULL) {
-		/* XXX stat+msg */
-		return (NULL);
-	}
-	DPRINTF(sc, BWN_DEBUG_NODE, "%s: bn %p\n", __func__, bn);
-	return (&bn->bn_node);
-}
-
-static void
-bwn_node_cleanup(struct ieee80211_node *ni)
-{
-	struct ieee80211com *ic = ni->ni_ic;
-	struct bwn_softc *sc = ic->ic_ifp->if_softc;
-
-	sc->sc_node_cleanup(ni);
-}
-
 static void
 bwn_scan_start(struct ieee80211com *ic)
 {
@@ -3018,10 +2969,7 @@ bwn_vap_create(struct ieee80211com *ic,
 	/* override max aid so sta's cannot assoc when we're out of sta id's */
 	vap->iv_max_aid = BWN_STAID_MAX;
 
-	ieee80211_amrr_init(&bvp->bv_amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    500 /*ms*/);
+	ieee80211_ratectl_init(vap);
 
 	/* complete setup */
 	ieee80211_vap_attach(vap, ieee80211_media_change,
@@ -3034,7 +2982,7 @@ bwn_vap_delete(struct ieee80211vap *vap)
 {
 	struct bwn_vap *bvp = BWN_VAP(vap);
 
-	ieee80211_amrr_cleanup(&bvp->bv_amrr);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(bvp, M_80211_VAP);
 }
@@ -9040,12 +8988,12 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 	struct bwn_dma_ring *dr;
 	struct bwn_dmadesc_generic *desc;
 	struct bwn_dmadesc_meta *meta;
-	struct bwn_node *bn;
 	struct bwn_pio_txqueue *tq;
 	struct bwn_pio_txpkt *tp = NULL;
 	struct bwn_softc *sc = mac->mac_sc;
 	struct bwn_stats *stats = &mac->mac_stats;
 	struct ieee80211_node *ni;
+	struct ieee80211vap *vap;
 	int slot;
 
 	BWN_ASSERT_LOCKED(mac->mac_sc);
@@ -9074,9 +9022,12 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 				dr->getdesc(dr, slot, &desc, &meta);
 				if (meta->mt_islast) {
 					ni = meta->mt_ni;
-					bn = (struct bwn_node *)ni;
-					ieee80211_amrr_tx_complete(&bn->bn_amn,
-					    status->ack, 0);
+					vap = ni->ni_vap;
+					ieee80211_ratectl_tx_complete(vap, ni,
+					    status->ack ?
+					      IEEE80211_RATECTL_TX_SUCCESS :
+					      IEEE80211_RATECTL_TX_FAILURE,
+					    NULL, 0);
 					break;
 				}
 				slot = bwn_dma_nextslot(dr, slot);
@@ -9092,8 +9043,12 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 				return;
 			}
 			ni = tp->tp_ni;
-			bn = (struct bwn_node *)ni;
-			ieee80211_amrr_tx_complete(&bn->bn_amn, status->ack, 0);
+			vap = ni->ni_vap;
+			ieee80211_ratectl_tx_complete(vap, ni,
+			    status->ack ?
+			      IEEE80211_RATECTL_TX_SUCCESS :
+			      IEEE80211_RATECTL_TX_FAILURE,
+			    NULL, 0);
 		}
 		bwn_pio_handle_txeof(mac, status);
 	}
@@ -9680,7 +9635,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc
 	else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
 		rate = rate_fb = tp->ucastrate;
 	else {
-		rix = ieee80211_amrr_choose(ni, &BWN_NODE(ni)->bn_amn);
+		rix = ieee80211_ratectl_rate(ni, NULL, 0);
 		rate = ni->ni_txrate;
 
 		if (rix > 0)

Modified: stable/8/sys/dev/bwn/if_bwnvar.h
==============================================================================
--- stable/8/sys/dev/bwn/if_bwnvar.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/bwn/if_bwnvar.h	Tue May 11 11:08:15 2010	(r207912)
@@ -883,18 +883,11 @@ struct bwn_mac {
 	TAILQ_ENTRY(bwn_mac)	mac_list;
 };
 
-struct bwn_node {
-	struct ieee80211_node		bn_node;	/* must be the first */
-	struct ieee80211_amrr_node	bn_amn;
-};
-#define	BWN_NODE(ni)			((struct bwn_node *)(ni))
-
 /*
  * Driver-specific vap state.
  */
 struct bwn_vap {
 	struct ieee80211vap		bv_vap;	/* base class */
-	struct ieee80211_amrr		bv_amrr;
 	int				(*bv_newstate)(struct ieee80211vap *,
 					    enum ieee80211_state, int);
 };

Modified: stable/8/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/8/sys/dev/iwn/if_iwn.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/iwn/if_iwn.c	Tue May 11 11:08:15 2010	(r207912)
@@ -65,9 +65,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -785,11 +785,7 @@ iwn_vap_create(struct ieee80211com *ic,
 	ivp->iv_newstate = vap->iv_newstate;
 	vap->iv_newstate = iwn_newstate;
 
-	ieee80211_amrr_init(&ivp->iv_amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    500 /* ms */);
-
+	ieee80211_ratectl_init(vap);
 	/* Complete setup. */
 	ieee80211_vap_attach(vap, iwn_media_change, ieee80211_media_status);
 	ic->ic_opmode = opmode;
@@ -801,7 +797,7 @@ iwn_vap_delete(struct ieee80211vap *vap)
 {
 	struct iwn_vap *ivp = IWN_VAP(vap);
 
-	ieee80211_amrr_cleanup(&ivp->iv_amrr);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(ivp, M_80211_VAP);
 }
@@ -1897,11 +1893,8 @@ iwn_node_alloc(struct ieee80211vap *vap,
 static void
 iwn_newassoc(struct ieee80211_node *ni, int isnew)
 {
-	struct ieee80211vap *vap = ni->ni_vap;
-	struct iwn_node *wn = (void *)ni;
-
-	ieee80211_amrr_node_init(&IWN_VAP(vap)->iv_amrr,
-	    &wn->amn, ni);
+	/* XXX move */
+	ieee80211_ratectl_node_init(ni);
 }
 
 static int
@@ -2333,9 +2326,9 @@ iwn_tx_done(struct iwn_softc *sc, struct
 	struct ifnet *ifp = sc->sc_ifp;
 	struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf];
 	struct iwn_tx_data *data = &ring->data[desc->idx];
-	struct iwn_node *wn = (void *)data->ni;
 	struct mbuf *m;
 	struct ieee80211_node *ni;
+	struct ieee80211vap *vap;
 
 	KASSERT(data->ni != NULL, ("no node"));
 
@@ -2344,6 +2337,7 @@ iwn_tx_done(struct iwn_softc *sc, struct
 	bus_dmamap_unload(ring->data_dmat, data->map);
 	m = data->m, data->m = NULL;
 	ni = data->ni, data->ni = NULL;
+	vap = ni->ni_vap;
 
 	if (m->m_flags & M_TXCB) {
 		/*
@@ -2373,11 +2367,11 @@ iwn_tx_done(struct iwn_softc *sc, struct
 	 */
 	if (status & 0x80) {
 		ifp->if_oerrors++;
-		ieee80211_amrr_tx_complete(&wn->amn,
-		    IEEE80211_AMRR_FAILURE, ackfailcnt);
+		ieee80211_ratectl_tx_complete(vap, ni,
+		    IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL);
 	} else {
-		ieee80211_amrr_tx_complete(&wn->amn,
-		    IEEE80211_AMRR_SUCCESS, ackfailcnt);
+		ieee80211_ratectl_tx_complete(vap, ni,
+		    IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL);
 	}
 	m_freem(m);
 	ieee80211_free_node(ni);
@@ -2897,7 +2891,8 @@ iwn_tx_data(struct iwn_softc *sc, struct
 	else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
 		rate = tp->ucastrate;
 	else {
-		(void) ieee80211_amrr_choose(ni, &wn->amn);
+		/* XXX pass pktlen */
+		(void) ieee80211_ratectl_rate(ni, NULL, 0);
 		rate = ni->ni_txrate;
 	}
 	ridx = iwn_plcp_signal(rate);
@@ -6480,4 +6475,3 @@ DRIVER_MODULE(iwn, pci, iwn_driver, iwn_
 MODULE_DEPEND(iwn, pci, 1, 1, 1);
 MODULE_DEPEND(iwn, firmware, 1, 1, 1);
 MODULE_DEPEND(iwn, wlan, 1, 1, 1);
-MODULE_DEPEND(iwn, wlan_amrr, 1, 1, 1);

Modified: stable/8/sys/dev/iwn/if_iwnvar.h
==============================================================================
--- stable/8/sys/dev/iwn/if_iwnvar.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/iwn/if_iwnvar.h	Tue May 11 11:08:15 2010	(r207912)
@@ -99,7 +99,6 @@ struct iwn_rx_ring {
 
 struct iwn_node {
 	struct	ieee80211_node		ni;	/* must be the first */
-	struct	ieee80211_amrr_node	amn;
 	uint16_t			disable_tid;
 	uint8_t				id;
 	uint8_t				ridx[IEEE80211_RATE_MAXSIZE];
@@ -193,8 +192,6 @@ struct iwn_hal {
 
 struct iwn_vap {
 	struct ieee80211vap	iv_vap;
-	struct ieee80211_amrr	iv_amrr;
-	struct callout		iv_amrr_to;
 	uint8_t			iv_ridx;
 
 	int			(*iv_newstate)(struct ieee80211vap *,

Modified: stable/8/sys/dev/ral/rt2560.c
==============================================================================
--- stable/8/sys/dev/ral/rt2560.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/ral/rt2560.c	Tue May 11 11:08:15 2010	(r207912)
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -103,8 +103,6 @@ static void		rt2560_reset_rx_ring(struct
 			    struct rt2560_rx_ring *);
 static void		rt2560_free_rx_ring(struct rt2560_softc *,
 			    struct rt2560_rx_ring *);
-static struct ieee80211_node *rt2560_node_alloc(struct ieee80211vap *,
-			    const uint8_t [IEEE80211_ADDR_LEN]);
 static void		rt2560_newassoc(struct ieee80211_node *, int);
 static int		rt2560_newstate(struct ieee80211vap *,
 			    enum ieee80211_state, int);
@@ -307,7 +305,6 @@ rt2560_attach(device_t dev, int id)
 	ic->ic_raw_xmit = rt2560_raw_xmit;
 	ic->ic_updateslot = rt2560_update_slot;
 	ic->ic_update_promisc = rt2560_update_promisc;
-	ic->ic_node_alloc = rt2560_node_alloc;
 	ic->ic_scan_start = rt2560_scan_start;
 	ic->ic_scan_end = rt2560_scan_end;
 	ic->ic_set_channel = rt2560_set_channel;
@@ -430,11 +427,7 @@ rt2560_vap_create(struct ieee80211com *i
 	vap->iv_newstate = rt2560_newstate;
 	vap->iv_update_beacon = rt2560_beacon_update;
 
-	ieee80211_amrr_init(&rvp->amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    500 /* ms */);
-
+	ieee80211_ratectl_init(vap);
 	/* complete setup */
 	ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status);
 	if (TAILQ_FIRST(&ic->ic_vaps) == vap)
@@ -447,7 +440,7 @@ rt2560_vap_delete(struct ieee80211vap *v
 {
 	struct rt2560_vap *rvp = RT2560_VAP(vap);
 
-	ieee80211_amrr_cleanup(&rvp->amrr);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(rvp, M_80211_VAP);
 }
@@ -764,25 +757,11 @@ rt2560_free_rx_ring(struct rt2560_softc 
 		bus_dma_tag_destroy(ring->data_dmat);
 }
 
-static struct ieee80211_node *
-rt2560_node_alloc(struct ieee80211vap *vap,
-	const uint8_t mac[IEEE80211_ADDR_LEN])
-{
-	struct rt2560_node *rn;
-
-	rn = malloc(sizeof (struct rt2560_node), M_80211_NODE,
-	    M_NOWAIT | M_ZERO);
-
-	return (rn != NULL) ? &rn->ni : NULL;
-}
-
 static void
 rt2560_newassoc(struct ieee80211_node *ni, int isnew)
 {
-	struct ieee80211vap *vap = ni->ni_vap;
-
-	ieee80211_amrr_node_init(&RT2560_VAP(vap)->amrr,
-	    &RT2560_NODE(ni)->amrr, ni);
+	/* XXX move */
+	ieee80211_ratectl_node_init(ni);
 }
 
 static int
@@ -955,10 +934,11 @@ rt2560_tx_intr(struct rt2560_softc *sc)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct rt2560_tx_desc *desc;
 	struct rt2560_tx_data *data;
-	struct rt2560_node *rn;
 	struct mbuf *m;
 	uint32_t flags;
 	int retrycnt;
+	struct ieee80211vap *vap;
+	struct ieee80211_node *ni;
 
 	bus_dmamap_sync(sc->txq.desc_dmat, sc->txq.desc_map,
 	    BUS_DMASYNC_POSTREAD);
@@ -973,15 +953,19 @@ rt2560_tx_intr(struct rt2560_softc *sc)
 		    !(flags & RT2560_TX_VALID))
 			break;
 
-		rn = (struct rt2560_node *)data->ni;
 		m = data->m;
+		ni = data->ni;
+		vap = ni->ni_vap;
 
 		switch (flags & RT2560_TX_RESULT_MASK) {
 		case RT2560_TX_SUCCESS:
+			retrycnt = 0;
+
 			DPRINTFN(sc, 10, "%s\n", "data frame sent successfully");
 			if (data->rix != IEEE80211_FIXED_RATE_NONE)
-				ieee80211_amrr_tx_complete(&rn->amrr,
-				    IEEE80211_AMRR_SUCCESS, 0);
+				ieee80211_ratectl_tx_complete(vap, ni,
+				    IEEE80211_RATECTL_TX_SUCCESS,
+				    &retrycnt, NULL);
 			ifp->if_opackets++;
 			break;
 
@@ -991,8 +975,9 @@ rt2560_tx_intr(struct rt2560_softc *sc)
 			DPRINTFN(sc, 9, "data frame sent after %u retries\n",
 			    retrycnt);
 			if (data->rix != IEEE80211_FIXED_RATE_NONE)
-				ieee80211_amrr_tx_complete(&rn->amrr,
-				    IEEE80211_AMRR_SUCCESS, retrycnt);
+				ieee80211_ratectl_tx_complete(vap, ni,
+				    IEEE80211_RATECTL_TX_SUCCESS,
+				    &retrycnt, NULL);
 			ifp->if_opackets++;
 			break;
 
@@ -1002,8 +987,9 @@ rt2560_tx_intr(struct rt2560_softc *sc)
 			DPRINTFN(sc, 9, "data frame failed after %d retries\n",
 			    retrycnt);
 			if (data->rix != IEEE80211_FIXED_RATE_NONE)
-				ieee80211_amrr_tx_complete(&rn->amrr,
-				    IEEE80211_AMRR_FAILURE, retrycnt);
+				ieee80211_ratectl_tx_complete(vap, ni,
+				    IEEE80211_RATECTL_TX_FAILURE,
+				    &retrycnt, NULL);
 			ifp->if_oerrors++;
 			break;
 
@@ -1821,7 +1807,7 @@ rt2560_tx_data(struct rt2560_softc *sc, 
 	} else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
 		rate = tp->ucastrate;
 	} else {
-		(void) ieee80211_amrr_choose(ni, &RT2560_NODE(ni)->amrr);
+		(void) ieee80211_ratectl_rate(ni, NULL, 0);
 		rate = ni->ni_txrate;
 	}
 

Modified: stable/8/sys/dev/ral/rt2560var.h
==============================================================================
--- stable/8/sys/dev/ral/rt2560var.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/ral/rt2560var.h	Tue May 11 11:08:15 2010	(r207912)
@@ -95,16 +95,9 @@ struct rt2560_rx_ring {
 	int			cur_decrypt;
 };
 
-struct rt2560_node {
-	struct ieee80211_node	ni;
-	struct ieee80211_amrr_node amrr;
-};
-#define	RT2560_NODE(ni)		((struct rt2560_node *)(ni))
-
 struct rt2560_vap {
 	struct ieee80211vap	ral_vap;
 	struct ieee80211_beacon_offsets	ral_bo;
-	struct ieee80211_amrr	amrr;
 
 	int			(*ral_newstate)(struct ieee80211vap *,
 				    enum ieee80211_state, int);

Modified: stable/8/sys/dev/ral/rt2661.c
==============================================================================
--- stable/8/sys/dev/ral/rt2661.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/ral/rt2661.c	Tue May 11 11:08:15 2010	(r207912)
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -100,8 +100,6 @@ static void		rt2661_reset_rx_ring(struct
 			    struct rt2661_rx_ring *);
 static void		rt2661_free_rx_ring(struct rt2661_softc *,
 			    struct rt2661_rx_ring *);
-static struct ieee80211_node *rt2661_node_alloc(struct ieee80211vap *,
-			    const uint8_t [IEEE80211_ADDR_LEN]);
 static void		rt2661_newassoc(struct ieee80211_node *, int);
 static int		rt2661_newstate(struct ieee80211vap *,
 			    enum ieee80211_state, int);
@@ -307,7 +305,6 @@ rt2661_attach(device_t dev, int id)
 
 	ieee80211_ifattach(ic, macaddr);
 	ic->ic_newassoc = rt2661_newassoc;
-	ic->ic_node_alloc = rt2661_node_alloc;
 #if 0
 	ic->ic_wme.wme_update = rt2661_wme_update;
 #endif
@@ -428,11 +425,7 @@ rt2661_vap_create(struct ieee80211com *i
 	vap->iv_update_beacon = rt2661_beacon_update;
 #endif
 
-	ieee80211_amrr_init(&rvp->amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    500 /* ms */);
-
+	ieee80211_ratectl_init(vap);
 	/* complete setup */
 	ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status);
 	if (TAILQ_FIRST(&ic->ic_vaps) == vap)
@@ -445,7 +438,7 @@ rt2661_vap_delete(struct ieee80211vap *v
 {
 	struct rt2661_vap *rvp = RT2661_VAP(vap);
 
-	ieee80211_amrr_cleanup(&rvp->amrr);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(rvp, M_80211_VAP);
 }
@@ -771,25 +764,11 @@ rt2661_free_rx_ring(struct rt2661_softc 
 		bus_dma_tag_destroy(ring->data_dmat);
 }
 
-static struct ieee80211_node *
-rt2661_node_alloc(struct ieee80211vap *vap,
-	const uint8_t mac[IEEE80211_ADDR_LEN])
-{
-	struct rt2661_node *rn;
-
-	rn = malloc(sizeof (struct rt2661_node), M_80211_NODE,
-	    M_NOWAIT | M_ZERO);
-
-	return (rn != NULL) ? &rn->ni : NULL;
-}
-
 static void
 rt2661_newassoc(struct ieee80211_node *ni, int isnew)
 {
-	struct ieee80211vap *vap = ni->ni_vap;
-
-	ieee80211_amrr_node_init(&RT2661_VAP(vap)->amrr,
-	    &RT2661_NODE(ni)->amrr, ni);
+	/* XXX move */
+	ieee80211_ratectl_node_init(ni);
 }
 
 static int
@@ -899,9 +878,9 @@ rt2661_tx_intr(struct rt2661_softc *sc)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct rt2661_tx_ring *txq;
 	struct rt2661_tx_data *data;
-	struct rt2661_node *rn;
 	uint32_t val;
 	int qid, retrycnt;
+	struct ieee80211vap *vap;
 
 	for (;;) {
 		struct ieee80211_node *ni;
@@ -925,8 +904,8 @@ rt2661_tx_intr(struct rt2661_softc *sc)
 		/* if no frame has been sent, ignore */
 		if (ni == NULL)
 			continue;
-
-		rn = RT2661_NODE(ni);
+		else
+			vap = ni->ni_vap;
 
 		switch (RT2661_TX_RESULT(val)) {
 		case RT2661_TX_SUCCESS:
@@ -935,8 +914,9 @@ rt2661_tx_intr(struct rt2661_softc *sc)
 			DPRINTFN(sc, 10, "data frame sent successfully after "
 			    "%d retries\n", retrycnt);
 			if (data->rix != IEEE80211_FIXED_RATE_NONE)
-				ieee80211_amrr_tx_complete(&rn->amrr,
-				    IEEE80211_AMRR_SUCCESS, retrycnt);
+				ieee80211_ratectl_tx_complete(vap, ni,
+				    IEEE80211_RATECTL_TX_SUCCESS,
+				    &retrycnt, NULL);
 			ifp->if_opackets++;
 			break;
 
@@ -946,8 +926,9 @@ rt2661_tx_intr(struct rt2661_softc *sc)
 			DPRINTFN(sc, 9, "%s\n",
 			    "sending data frame failed (too much retries)");
 			if (data->rix != IEEE80211_FIXED_RATE_NONE)
-				ieee80211_amrr_tx_complete(&rn->amrr,
-				    IEEE80211_AMRR_FAILURE, retrycnt);
+				ieee80211_ratectl_tx_complete(vap, ni,
+				    IEEE80211_RATECTL_TX_FAILURE,
+				    &retrycnt, NULL);
 			ifp->if_oerrors++;
 			break;
 
@@ -1511,7 +1492,7 @@ rt2661_tx_data(struct rt2661_softc *sc, 
 	} else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
 		rate = tp->ucastrate;
 	} else {
-		(void) ieee80211_amrr_choose(ni, &RT2661_NODE(ni)->amrr);
+		(void) ieee80211_ratectl_rate(ni, NULL, 0);
 		rate = ni->ni_txrate;
 	}
 	rate &= IEEE80211_RATE_VAL;

Modified: stable/8/sys/dev/ral/rt2661var.h
==============================================================================
--- stable/8/sys/dev/ral/rt2661var.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/ral/rt2661var.h	Tue May 11 11:08:15 2010	(r207912)
@@ -88,15 +88,8 @@ struct rt2661_rx_ring {
 	int			next;
 };
 
-struct rt2661_node {
-	struct ieee80211_node	ni;
-	struct ieee80211_amrr_node amrr;
-};
-#define	RT2661_NODE(ni)		((struct rt2661_node *)(ni))
-
 struct rt2661_vap {
 	struct ieee80211vap	ral_vap;
-	struct ieee80211_amrr	amrr;
 
 	int			(*ral_newstate)(struct ieee80211vap *,
 				    enum ieee80211_state, int);

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rum.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Tue May 11 11:08:15 2010	(r207912)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -140,7 +140,6 @@ static const struct usb_device_id rum_de
 };
 
 MODULE_DEPEND(rum, wlan, 1, 1, 1);
-MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1);
 MODULE_DEPEND(rum, usb, 1, 1, 1);
 
 static device_probe_t rum_match;
@@ -212,17 +211,14 @@ static int		rum_prepare_beacon(struct ru
 			    struct ieee80211vap *);
 static int		rum_raw_xmit(struct ieee80211_node *, struct mbuf *,
 			    const struct ieee80211_bpf_params *);
-static struct ieee80211_node *rum_node_alloc(struct ieee80211vap *,
-			    const uint8_t mac[IEEE80211_ADDR_LEN]);
-static void		rum_newassoc(struct ieee80211_node *, int);
 static void		rum_scan_start(struct ieee80211com *);
 static void		rum_scan_end(struct ieee80211com *);
 static void		rum_set_channel(struct ieee80211com *);
 static int		rum_get_rssi(struct rum_softc *, uint8_t);
-static void		rum_amrr_start(struct rum_softc *,
+static void		rum_ratectl_start(struct rum_softc *,
 			    struct ieee80211_node *);
-static void		rum_amrr_timeout(void *);
-static void		rum_amrr_task(void *, int);
+static void		rum_ratectl_timeout(void *);
+static void		rum_ratectl_task(void *, int);
 static int		rum_pause(struct rum_softc *, int);
 
 static const struct {
@@ -511,9 +507,7 @@ rum_attach(device_t self)
 
 	ieee80211_ifattach(ic, sc->sc_bssid);
 	ic->ic_update_promisc = rum_update_promisc;
-	ic->ic_newassoc = rum_newassoc;
 	ic->ic_raw_xmit = rum_raw_xmit;
-	ic->ic_node_alloc = rum_node_alloc;
 	ic->ic_scan_start = rum_scan_start;
 	ic->ic_scan_end = rum_scan_end;
 	ic->ic_set_channel = rum_set_channel;
@@ -608,13 +602,10 @@ rum_vap_create(struct ieee80211com *ic,
 	rvp->newstate = vap->iv_newstate;
 	vap->iv_newstate = rum_newstate;
 
-	usb_callout_init_mtx(&rvp->amrr_ch, &sc->sc_mtx, 0);
-	TASK_INIT(&rvp->amrr_task, 0, rum_amrr_task, rvp);
-	ieee80211_amrr_init(&rvp->amrr, vap,
-	    IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
-	    IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
-	    1000 /* 1 sec */);
-
+	usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0);
+	TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp);
+	ieee80211_ratectl_init(vap);
+	ieee80211_ratectl_setinterval(vap, 1000 /* 1 sec */);
 	/* complete setup */
 	ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status);
 	ic->ic_opmode = opmode;
@@ -627,9 +618,9 @@ rum_vap_delete(struct ieee80211vap *vap)
 	struct rum_vap *rvp = RUM_VAP(vap);
 	struct ieee80211com *ic = vap->iv_ic;
 
-	usb_callout_drain(&rvp->amrr_ch);
-	ieee80211_draintask(ic, &rvp->amrr_task);
-	ieee80211_amrr_cleanup(&rvp->amrr);
+	usb_callout_drain(&rvp->ratectl_ch);
+	ieee80211_draintask(ic, &rvp->ratectl_task);
+	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(rvp, M_80211_VAP);
 }
@@ -716,7 +707,7 @@ rum_newstate(struct ieee80211vap *vap, e
 
 	IEEE80211_UNLOCK(ic);
 	RUM_LOCK(sc);
-	usb_callout_stop(&rvp->amrr_ch);
+	usb_callout_stop(&rvp->ratectl_ch);
 
 	switch (nstate) {
 	case IEEE80211_S_INIT:
@@ -751,7 +742,7 @@ rum_newstate(struct ieee80211vap *vap, e
 		/* enable automatic rate adaptation */
 		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
 		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
-			rum_amrr_start(sc, ni);
+			rum_ratectl_start(sc, ni);
 		break;
 	default:
 		break;
@@ -2194,7 +2185,7 @@ bad:
 }
 
 static void
-rum_amrr_start(struct rum_softc *sc, struct ieee80211_node *ni)
+rum_ratectl_start(struct rum_softc *sc, struct ieee80211_node *ni)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct rum_vap *rvp = RUM_VAP(vap);
@@ -2202,23 +2193,23 @@ rum_amrr_start(struct rum_softc *sc, str
 	/* clear statistic registers (STA_CSR0 to STA_CSR5) */
 	rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta);
 
-	ieee80211_amrr_node_init(&rvp->amrr, &RUM_NODE(ni)->amn, ni);
+	ieee80211_ratectl_node_init(ni);
 
-	usb_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp);
+	usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp);
 }
 
 static void
-rum_amrr_timeout(void *arg)
+rum_ratectl_timeout(void *arg)
 {
 	struct rum_vap *rvp = arg;
 	struct ieee80211vap *vap = &rvp->vap;
 	struct ieee80211com *ic = vap->iv_ic;
 
-	ieee80211_runtask(ic, &rvp->amrr_task);
+	ieee80211_runtask(ic, &rvp->ratectl_task);
 }
 
 static void
-rum_amrr_task(void *arg, int pending)
+rum_ratectl_task(void *arg, int pending)
 {
 	struct rum_vap *rvp = arg;
 	struct ieee80211vap *vap = &rvp->vap;
@@ -2227,6 +2218,7 @@ rum_amrr_task(void *arg, int pending)
 	struct rum_softc *sc = ifp->if_softc;
 	struct ieee80211_node *ni = vap->iv_bss;
 	int ok, fail;
+	int sum, retrycnt;
 
 	RUM_LOCK(sc);
 	/* read and clear statistic registers (STA_CSR0 to STA_CSR10) */
@@ -2235,36 +2227,18 @@ rum_amrr_task(void *arg, int pending)
 	ok = (le32toh(sc->sta[4]) >> 16) +	/* TX ok w/o retry */
 	    (le32toh(sc->sta[5]) & 0xffff);	/* TX ok w/ retry */
 	fail = (le32toh(sc->sta[5]) >> 16);	/* TX retry-fail count */
+	sum = ok+fail;
+	retrycnt = (le32toh(sc->sta[5]) & 0xffff) + fail;
 
-	ieee80211_amrr_tx_update(&RUM_NODE(ni)->amn,
-	    ok+fail, ok, (le32toh(sc->sta[5]) & 0xffff) + fail);
-	(void) ieee80211_amrr_choose(ni, &RUM_NODE(ni)->amn);
+	ieee80211_ratectl_tx_update(vap, ni, &sum, &ok, &retrycnt);
+	(void) ieee80211_ratectl_rate(ni, NULL, 0);
 
 	ifp->if_oerrors += fail;	/* count TX retry-fail as Tx errors */
 
-	usb_callout_reset(&rvp->amrr_ch, hz, rum_amrr_timeout, rvp);
+	usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp);
 	RUM_UNLOCK(sc);
 }
 
-/* ARGUSED */
-static struct ieee80211_node *
-rum_node_alloc(struct ieee80211vap *vap __unused,
-	const uint8_t mac[IEEE80211_ADDR_LEN] __unused)
-{
-	struct rum_node *rn;
-
-	rn = malloc(sizeof(struct rum_node), M_80211_NODE, M_NOWAIT | M_ZERO);
-	return rn != NULL ? &rn->ni : NULL;
-}
-
-static void
-rum_newassoc(struct ieee80211_node *ni, int isnew)
-{
-	struct ieee80211vap *vap = ni->ni_vap;
-
-	ieee80211_amrr_node_init(&RUM_VAP(vap)->amrr, &RUM_NODE(ni)->amn, ni);
-}
-
 static void
 rum_scan_start(struct ieee80211com *ic)
 {

Modified: stable/8/sys/dev/usb/wlan/if_rumvar.h
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rumvar.h	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/usb/wlan/if_rumvar.h	Tue May 11 11:08:15 2010	(r207912)
@@ -67,18 +67,11 @@ struct rum_tx_data {
 };
 typedef STAILQ_HEAD(, rum_tx_data) rum_txdhead;
 
-struct rum_node {
-	struct ieee80211_node	ni;
-	struct ieee80211_amrr_node amn;
-};
-#define	RUM_NODE(ni)	((struct rum_node *)(ni))
-
 struct rum_vap {
 	struct ieee80211vap		vap;
 	struct ieee80211_beacon_offsets	bo;
-	struct ieee80211_amrr		amrr;
-	struct usb_callout		amrr_ch;
-	struct task			amrr_task;
+	struct usb_callout		ratectl_ch;
+	struct task			ratectl_task;
 
 	int				(*newstate)(struct ieee80211vap *,
 					    enum ieee80211_state, int);

Modified: stable/8/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_run.c	Tue May 11 09:26:46 2010	(r207911)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Tue May 11 11:08:15 2010	(r207912)
@@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$");
 #include 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 11:22:19 2010
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 8A5BF106566B;
	Tue, 11 May 2010 11:22:18 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A1AE8FC08;
	Tue, 11 May 2010 11:22:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BBMIoq065771;
	Tue, 11 May 2010 11:22:18 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BBMISA065769;
	Tue, 11 May 2010 11:22:18 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111122.o4BBMISA065769@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 11:22:18 +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: r207913 - stable/8/bin/ps
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 11:22:19 -0000

Author: kib
Date: Tue May 11 11:22:18 2010
New Revision: 207913
URL: http://svn.freebsd.org/changeset/base/207913

Log:
  MFC r206548:
  Update the list of the process flags for P_WKILLED.

Modified:
  stable/8/bin/ps/ps.1
Directory Properties:
  stable/8/bin/ps/   (props changed)

Modified: stable/8/bin/ps/ps.1
==============================================================================
--- stable/8/bin/ps/ps.1	Tue May 11 11:08:15 2010	(r207912)
+++ stable/8/bin/ps/ps.1	Tue May 11 11:22:18 2010	(r207913)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 5, 2010
+.Dd April 13, 2010
 .Dt PS 1
 .Os
 .Sh NAME
@@ -298,6 +298,7 @@ the include file
 .It Dv "P_WAITED" Ta No "0x01000	Someone is waiting for us"
 .It Dv "P_WEXIT" Ta No "0x02000		Working on exiting"
 .It Dv "P_EXEC" Ta No "0x04000		Process called exec"
+.It Dv "P_WKILLED" Ta No "0x08000	Killed, shall go to kernel/user boundary ASAP"
 .It Dv "P_CONTINUED" Ta No "0x10000	Proc has continued from a stopped state"
 .It Dv "P_STOPPED_SIG" Ta No "0x20000	Stopped due to SIGSTOP/SIGTSTP"
 .It Dv "P_STOPPED_TRACE" Ta No "0x40000	Stopped because of tracing"

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 11:53:10 2010
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 D2500106566B;
	Tue, 11 May 2010 11:53:10 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id C2E4A8FC1A;
	Tue, 11 May 2010 11:53:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BBrASI072500;
	Tue, 11 May 2010 11:53:10 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BBrASK072498;
	Tue, 11 May 2010 11:53:10 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111153.o4BBrASK072498@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 11:53:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207914 - stable/8/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: Tue, 11 May 2010 11:53:10 -0000

Author: kib
Date: Tue May 11 11:53:10 2010
New Revision: 207914
URL: http://svn.freebsd.org/changeset/base/207914

Log:
  MFC r207268:
  Provide 32bit compat for SIOCGDEFIFACE_IN6.

Modified:
  stable/8/sys/netinet6/in6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Tue May 11 11:22:18 2010	(r207913)
+++ stable/8/sys/netinet6/in6.c	Tue May 11 11:53:10 2010	(r207914)
@@ -63,6 +63,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
@@ -176,6 +177,14 @@ in6_mask2len(struct in6_addr *mask, u_ch
 #define ifa2ia6(ifa)	((struct in6_ifaddr *)(ifa))
 #define ia62ifa(ia6)	(&((ia6)->ia_ifa))
 
+#ifdef COMPAT_FREEBSD32
+struct in6_ndifreq32 {
+        char ifname[IFNAMSIZ];
+        uint32_t ifindex;
+};
+#define	SIOCGDEFIFACE32_IN6     _IOWR('i', 86, struct in6_ndifreq32)
+#endif
+
 int
 in6_control(struct socket *so, u_long cmd, caddr_t data,
     struct ifnet *ifp, struct thread *td)
@@ -226,6 +235,22 @@ in6_control(struct socket *so, u_long cm
 	case SIOCGNBRINFO_IN6:
 	case SIOCGDEFIFACE_IN6:
 		return (nd6_ioctl(cmd, data, ifp));
+
+#ifdef COMPAT_FREEBSD32
+	case SIOCGDEFIFACE32_IN6:
+		{
+			struct in6_ndifreq ndif;
+			struct in6_ndifreq32 *ndif32;
+
+			error = nd6_ioctl(SIOCGDEFIFACE_IN6, (caddr_t)&ndif,
+			    ifp);
+			if (error)
+				return (error);
+			ndif32 = (struct in6_ndifreq32 *)data;
+			ndif32->ifindex = ndif.ifindex;
+			return (0);
+		}
+#endif
 	}
 
 	switch (cmd) {

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 12:07:41 2010
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 43B4D1065674;
	Tue, 11 May 2010 12:07:41 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 341968FC2D;
	Tue, 11 May 2010 12:07:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BC7fZI075734;
	Tue, 11 May 2010 12:07:41 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BC7f8B075732;
	Tue, 11 May 2010 12:07:41 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111207.o4BC7f8B075732@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 12:07:41 +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: r207915 - stable/8/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 11 May 2010 12:07:41 -0000

Author: kib
Date: Tue May 11 12:07:40 2010
New Revision: 207915
URL: http://svn.freebsd.org/changeset/base/207915

Log:
  MFC r207600:
  Move definition of struct rusage_ext before struct thread.

Modified:
  stable/8/sys/sys/proc.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/sys/proc.h
==============================================================================
--- stable/8/sys/sys/proc.h	Tue May 11 11:53:10 2010	(r207914)
+++ stable/8/sys/sys/proc.h	Tue May 11 12:07:40 2010	(r207915)
@@ -172,6 +172,27 @@ struct kdtrace_thread;
 struct cpuset;
 
 /*
+ * XXX: Does this belong in resource.h or resourcevar.h instead?
+ * Resource usage extension.  The times in rusage structs in the kernel are
+ * never up to date.  The actual times are kept as runtimes and tick counts
+ * (with control info in the "previous" times), and are converted when
+ * userland asks for rusage info.  Backwards compatibility prevents putting
+ * this directly in the user-visible rusage struct.
+ *
+ * Locking for p_rux: (cj) means (j) for p_rux and (c) for p_crux.
+ * Locking for td_rux: (t) for all fields.
+ */
+struct rusage_ext {
+	u_int64_t	rux_runtime;    /* (cj) Real time. */
+	u_int64_t	rux_uticks;     /* (cj) Statclock hits in user mode. */
+	u_int64_t	rux_sticks;     /* (cj) Statclock hits in sys mode. */
+	u_int64_t	rux_iticks;     /* (cj) Statclock hits in intr mode. */
+	u_int64_t	rux_uu;         /* (c) Previous user time in usec. */
+	u_int64_t	rux_su;         /* (c) Previous sys time in usec. */
+	u_int64_t	rux_tu;         /* (c) Previous total time in usec. */
+};
+
+/*
  * Kernel runnable context (thread).
  * This is what is put to sleep and reactivated.
  * Thread context.  Processes may have multiple threads.
@@ -428,26 +449,6 @@ do {									\
 #define	TD_SET_CAN_RUN(td)	(td)->td_state = TDS_CAN_RUN
 
 /*
- * XXX: Does this belong in resource.h or resourcevar.h instead?
- * Resource usage extension.  The times in rusage structs in the kernel are
- * never up to date.  The actual times are kept as runtimes and tick counts
- * (with control info in the "previous" times), and are converted when
- * userland asks for rusage info.  Backwards compatibility prevents putting
- * this directly in the user-visible rusage struct.
- *
- * Locking: (cj) means (j) for p_rux and (c) for p_crux.
- */
-struct rusage_ext {
-	u_int64_t	rux_runtime;    /* (cj) Real time. */
-	u_int64_t	rux_uticks;     /* (cj) Statclock hits in user mode. */
-	u_int64_t	rux_sticks;     /* (cj) Statclock hits in sys mode. */
-	u_int64_t	rux_iticks;     /* (cj) Statclock hits in intr mode. */
-	u_int64_t	rux_uu;         /* (c) Previous user time in usec. */
-	u_int64_t	rux_su;         /* (c) Previous sys time in usec. */
-	u_int64_t	rux_tu;         /* (c) Previous total time in usec. */
-};
-
-/*
  * Process structure.
  */
 struct proc {

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 13:18:42 2010
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 5ACBA106578F;
	Tue, 11 May 2010 13:18:42 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A6FB8FC20;
	Tue, 11 May 2010 13:18:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BDIgPx091703;
	Tue, 11 May 2010 13:18:42 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BDIgRb091693;
	Tue, 11 May 2010 13:18:42 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111318.o4BDIgRb091693@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 13:18:42 +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: r207916 - in stable/8/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: Tue, 11 May 2010 13:18:42 -0000

Author: kib
Date: Tue May 11 13:18:41 2010
New Revision: 207916
URL: http://svn.freebsd.org/changeset/base/207916

Log:
  MFC r207468:
  Extract thread_lock()/ruxagg()/thread_unlock() fragment into utility
  function ruxagg_tlock().
  Convert the definition of kern_getrusage() to ANSI C.
  
  MFC r207602:
  Implement RUSAGE_THREAD. Add td_rux to keep extended runtime and ticks
  information for thread to allow calcru1() (re)use.
  
  Rename ruxagg()->ruxagg_locked(), ruxagg_tlock()->ruxagg() [1].
  The ruxagg_locked() function no longer clears thread ticks nor
  td_incruntime.
  
  Not an MFC: the td_rux is added to the end of struct thread to keep
  the KBI. Explicit bzero() of td_rux is added to new thread initialization
  points.

Modified:
  stable/8/sys/kern/kern_fork.c
  stable/8/sys/kern/kern_kthread.c
  stable/8/sys/kern/kern_resource.c
  stable/8/sys/kern/kern_thr.c
  stable/8/sys/kern/kern_thread.c
  stable/8/sys/sys/proc.h
  stable/8/sys/sys/resource.h
  stable/8/sys/sys/resourcevar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_fork.c
==============================================================================
--- stable/8/sys/kern/kern_fork.c	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/kern/kern_fork.c	Tue May 11 13:18:41 2010	(r207916)
@@ -531,6 +531,7 @@ again:
 
 	bzero(&td2->td_startzero,
 	    __rangeof(struct thread, td_startzero, td_endzero));
+	bzero(&td2->td_rux, sizeof(td2->td_rux));
 
 	bcopy(&td->td_startcopy, &td2->td_startcopy,
 	    __rangeof(struct thread, td_startcopy, td_endcopy));

Modified: stable/8/sys/kern/kern_kthread.c
==============================================================================
--- stable/8/sys/kern/kern_kthread.c	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/kern/kern_kthread.c	Tue May 11 13:18:41 2010	(r207916)
@@ -262,6 +262,7 @@ kthread_add(void (*func)(void *), void *
 
 	bzero(&newtd->td_startzero,
 	    __rangeof(struct thread, td_startzero, td_endzero));
+	bzero(&newtd->td_rux, sizeof(newtd->td_rux));
 /* XXX check if we should zero. */
 	bcopy(&oldtd->td_startcopy, &newtd->td_startcopy,
 	    __rangeof(struct thread, td_startcopy, td_endcopy));

Modified: stable/8/sys/kern/kern_resource.c
==============================================================================
--- stable/8/sys/kern/kern_resource.c	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/kern/kern_resource.c	Tue May 11 13:18:41 2010	(r207916)
@@ -76,6 +76,7 @@ static void	calcru1(struct proc *p, stru
 		    struct timeval *up, struct timeval *sp);
 static int	donice(struct thread *td, struct proc *chgp, int n);
 static struct uidinfo *uilookup(uid_t uid);
+static void	ruxagg(struct proc *p, struct thread *td);
 
 /*
  * Resource controls and accounting.
@@ -629,9 +630,7 @@ lim_cb(void *arg)
 		return;
 	PROC_SLOCK(p);
 	FOREACH_THREAD_IN_PROC(p, td) {
-		thread_lock(td);
-		ruxagg(&p->p_rux, td);
-		thread_unlock(td);
+		ruxagg(p, td);
 	}
 	PROC_SUNLOCK(p);
 	if (p->p_rux.rux_runtime > p->p_cpulimit * cpu_tickrate()) {
@@ -842,9 +841,7 @@ calcru(struct proc *p, struct timeval *u
 	FOREACH_THREAD_IN_PROC(p, td) {
 		if (td->td_incruntime == 0)
 			continue;
-		thread_lock(td);
-		ruxagg(&p->p_rux, td);
-		thread_unlock(td);
+		ruxagg(p, td);
 	}
 	calcru1(p, &p->p_rux, up, sp);
 }
@@ -945,10 +942,7 @@ getrusage(td, uap)
 }
 
 int
-kern_getrusage(td, who, rup)
-	struct thread *td;
-	int who;
-	struct rusage *rup;
+kern_getrusage(struct thread *td, int who, struct rusage *rup)
 {
 	struct proc *p;
 	int error;
@@ -967,6 +961,16 @@ kern_getrusage(td, who, rup)
 		calccru(p, &rup->ru_utime, &rup->ru_stime);
 		break;
 
+	case RUSAGE_THREAD:
+		PROC_SLOCK(p);
+		ruxagg(p, td);
+		PROC_SUNLOCK(p);
+		thread_lock(td);
+		*rup = td->td_ru;
+		calcru1(p, &td->td_rux, &rup->ru_utime, &rup->ru_stime);
+		thread_unlock(td);
+		break;
+
 	default:
 		error = EINVAL;
 	}
@@ -1007,7 +1011,7 @@ ruadd(struct rusage *ru, struct rusage_e
  * Aggregate tick counts into the proc's rusage_ext.
  */
 void
-ruxagg(struct rusage_ext *rux, struct thread *td)
+ruxagg_locked(struct rusage_ext *rux, struct thread *td)
 {
 
 	THREAD_LOCK_ASSERT(td, MA_OWNED);
@@ -1016,10 +1020,20 @@ ruxagg(struct rusage_ext *rux, struct th
 	rux->rux_uticks += td->td_uticks;
 	rux->rux_sticks += td->td_sticks;
 	rux->rux_iticks += td->td_iticks;
+}
+
+static void
+ruxagg(struct proc *p, struct thread *td)
+{
+
+	thread_lock(td);
+	ruxagg_locked(&p->p_rux, td);
+	ruxagg_locked(&td->td_rux, td);
 	td->td_incruntime = 0;
 	td->td_uticks = 0;
 	td->td_iticks = 0;
 	td->td_sticks = 0;
+	thread_unlock(td);
 }
 
 /*
@@ -1036,9 +1050,7 @@ rufetch(struct proc *p, struct rusage *r
 	*ru = p->p_ru;
 	if (p->p_numthreads > 0)  {
 		FOREACH_THREAD_IN_PROC(p, td) {
-			thread_lock(td);
-			ruxagg(&p->p_rux, td);
-			thread_unlock(td);
+			ruxagg(p, td);
 			rucollect(ru, &td->td_ru);
 		}
 	}

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/kern/kern_thr.c	Tue May 11 13:18:41 2010	(r207916)
@@ -199,6 +199,7 @@ create_thread(struct thread *td, mcontex
 
 	bzero(&newtd->td_startzero,
 	    __rangeof(struct thread, td_startzero, td_endzero));
+	bzero(&newtd->td_rux, sizeof(newtd->td_rux));
 	bcopy(&td->td_startcopy, &newtd->td_startcopy,
 	    __rangeof(struct thread, td_startcopy, td_endcopy));
 	newtd->td_proc = td->td_proc;

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/kern/kern_thread.c	Tue May 11 13:18:41 2010	(r207916)
@@ -432,7 +432,7 @@ thread_exit(void)
 	PROC_UNLOCK(p);
 	thread_lock(td);
 	/* Save our tick information with both the thread and proc locked */
-	ruxagg(&p->p_rux, td);
+	ruxagg_locked(&p->p_rux, td);
 	PROC_SUNLOCK(p);
 	td->td_state = TDS_INACTIVE;
 #ifdef WITNESS

Modified: stable/8/sys/sys/proc.h
==============================================================================
--- stable/8/sys/sys/proc.h	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/sys/proc.h	Tue May 11 13:18:41 2010	(r207916)
@@ -239,7 +239,7 @@ struct thread {
 	u_int		td_estcpu;	/* (t) estimated cpu utilization */
 	int		td_slptick;	/* (t) Time at sleep. */
 	int		td_blktick;	/* (t) Time spent blocked. */
-	struct rusage	td_ru;		/* (t) rusage information */
+	struct rusage	td_ru;		/* (t) rusage information. */
 	uint64_t	td_incruntime;	/* (t) Cpu ticks to transfer to proc. */
 	uint64_t	td_runtime;	/* (t) How many cpu ticks we've run. */
 	u_int 		td_pticks;	/* (t) Statclock hits for profiling */
@@ -302,6 +302,7 @@ struct thread {
 	int		td_errno;	/* Error returned by last syscall. */
 	struct vnet	*td_vnet;	/* (k) Effective vnet. */
 	const char	*td_vnet_lpush;	/* (k) Debugging vnet push / pop. */
+	struct rusage_ext td_rux;	/* (t) Internal rusage information. */
 };
 
 struct mtx *thread_lock_block(struct thread *);

Modified: stable/8/sys/sys/resource.h
==============================================================================
--- stable/8/sys/sys/resource.h	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/sys/resource.h	Tue May 11 13:18:41 2010	(r207916)
@@ -56,6 +56,7 @@
 
 #define	RUSAGE_SELF	0
 #define	RUSAGE_CHILDREN	-1
+#define	RUSAGE_THREAD	1
 
 struct rusage {
 	struct timeval ru_utime;	/* user time used */

Modified: stable/8/sys/sys/resourcevar.h
==============================================================================
--- stable/8/sys/sys/resourcevar.h	Tue May 11 12:07:40 2010	(r207915)
+++ stable/8/sys/sys/resourcevar.h	Tue May 11 13:18:41 2010	(r207916)
@@ -131,7 +131,7 @@ void	 rucollect(struct rusage *ru, struc
 void	 rufetch(struct proc *p, struct rusage *ru);
 void	 rufetchcalc(struct proc *p, struct rusage *ru, struct timeval *up,
 	    struct timeval *sp);
-void	 ruxagg(struct rusage_ext *rux, struct thread *td);
+void	 ruxagg_locked(struct rusage_ext *rux, struct thread *td);
 int	 suswintr(void *base, int word);
 struct uidinfo
 	*uifind(uid_t uid);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 13:33:38 2010
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 4C65D1065676;
	Tue, 11 May 2010 13:33:38 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3D4DE8FC1A;
	Tue, 11 May 2010 13:33:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BDXcwV095013;
	Tue, 11 May 2010 13:33:38 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BDXcop095011;
	Tue, 11 May 2010 13:33:38 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111333.o4BDXcop095011@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 13:33:38 +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: r207917 - stable/8/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, 11 May 2010 13:33:38 -0000

Author: kib
Date: Tue May 11 13:33:37 2010
New Revision: 207917
URL: http://svn.freebsd.org/changeset/base/207917

Log:
  MFC r207603
  Use td_rux.rux_runtime for ki_runtime instead of redoing calculation.
  
  MFC r207659:
  Fix a mistake in r207603. td_rux.rux_runtime still needs conversion.

Modified:
  stable/8/sys/kern/kern_proc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_proc.c
==============================================================================
--- stable/8/sys/kern/kern_proc.c	Tue May 11 13:18:41 2010	(r207916)
+++ stable/8/sys/kern/kern_proc.c	Tue May 11 13:33:37 2010	(r207917)
@@ -900,7 +900,7 @@ fill_kinfo_thread(struct thread *td, str
 	kp->ki_pri.pri_user = td->td_user_pri;
 
 	if (preferthread) {
-		kp->ki_runtime = cputick2usec(td->td_runtime);
+		kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime);
 		kp->ki_pctcpu = sched_pctcpu(td);
 		kp->ki_estcpu = td->td_estcpu;
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 13:35:36 2010
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 21B4A106564A;
	Tue, 11 May 2010 13:35:36 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 1289B8FC08;
	Tue, 11 May 2010 13:35:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BDZZrg095500;
	Tue, 11 May 2010 13:35:35 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BDZZ7S095498;
	Tue, 11 May 2010 13:35:35 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111335.o4BDZZ7S095498@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 13:35:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207918 - stable/8/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, 11 May 2010 13:35:36 -0000

Author: kib
Date: Tue May 11 13:35:35 2010
New Revision: 207918
URL: http://svn.freebsd.org/changeset/base/207918

Log:
  MFC r207605:
  Remove a comment that merely repeats code.

Modified:
  stable/8/sys/kern/kern_thread.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c	Tue May 11 13:33:37 2010	(r207917)
+++ stable/8/sys/kern/kern_thread.c	Tue May 11 13:35:35 2010	(r207918)
@@ -431,7 +431,6 @@ thread_exit(void)
 #endif
 	PROC_UNLOCK(p);
 	thread_lock(td);
-	/* Save our tick information with both the thread and proc locked */
 	ruxagg_locked(&p->p_rux, td);
 	PROC_SUNLOCK(p);
 	td->td_state = TDS_INACTIVE;

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 13:39:38 2010
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 4E995106566C;
	Tue, 11 May 2010 13:39:38 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F1838FC1D;
	Tue, 11 May 2010 13:39:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BDdc6X096442;
	Tue, 11 May 2010 13:39:38 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BDdcJW096440;
	Tue, 11 May 2010 13:39:38 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005111339.o4BDdcJW096440@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 11 May 2010 13:39:38 +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: r207919 - stable/8/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, 11 May 2010 13:39:38 -0000

Author: kib
Date: Tue May 11 13:39:37 2010
New Revision: 207919
URL: http://svn.freebsd.org/changeset/base/207919

Log:
  MFC r207604:
  Document RUSAGE_THREAD.

Modified:
  stable/8/lib/libc/sys/getrusage.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/getrusage.2
==============================================================================
--- stable/8/lib/libc/sys/getrusage.2	Tue May 11 13:35:35 2010	(r207918)
+++ stable/8/lib/libc/sys/getrusage.2	Tue May 11 13:39:37 2010	(r207919)
@@ -28,7 +28,7 @@
 .\"     @(#)getrusage.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd May 1, 2010
 .Dt GETRUSAGE 2
 .Os
 .Sh NAME
@@ -42,6 +42,7 @@
 .In sys/resource.h
 .Fd "#define	RUSAGE_SELF	 0"
 .Fd "#define	RUSAGE_CHILDREN	-1"
+.Fd "#define	RUSAGE_THREAD	1"
 .Ft int
 .Fn getrusage "int who" "struct rusage *rusage"
 .Sh DESCRIPTION
@@ -49,11 +50,12 @@ The
 .Fn getrusage
 system call
 returns information describing the resources utilized by the current
-process, or all its terminated child processes.
+thread, the current process, or all its terminated child processes.
 The
 .Fa who
 argument is either
-.Dv RUSAGE_SELF
+.Dv RUSAGE_THREAD ,
+.Dv RUSAGE_SELF ,
 or
 .Dv RUSAGE_CHILDREN .
 The buffer to which
@@ -175,6 +177,10 @@ The
 .Fn getrusage
 system call appeared in
 .Bx 4.2 .
+The
+.Dv RUSAGE_THREAD
+facility first appeared in
+.Fx 8.1 .
 .Sh BUGS
 There is no way to obtain information about a child process
 that has not yet terminated.

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 15:32:22 2010
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 53437106566B;
	Tue, 11 May 2010 15:32:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 434B48FC18;
	Tue, 11 May 2010 15:32:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BFWMvo021742;
	Tue, 11 May 2010 15:32:22 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BFWMYd021740;
	Tue, 11 May 2010 15:32:22 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201005111532.o4BFWMYd021740@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 11 May 2010 15:32: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: r207920 - head/sys/modules/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 15:32:22 -0000

Author: pjd
Date: Tue May 11 15:32:21 2010
New Revision: 207920
URL: http://svn.freebsd.org/changeset/base/207920

Log:
  Back out r205134. It is not stable.
  
  MFC after:	3 days

Modified:
  head/sys/modules/zfs/Makefile

Modified: head/sys/modules/zfs/Makefile
==============================================================================
--- head/sys/modules/zfs/Makefile	Tue May 11 13:39:37 2010	(r207919)
+++ head/sys/modules/zfs/Makefile	Tue May 11 15:32:21 2010	(r207920)
@@ -64,7 +64,7 @@ SRCS+=	${ZFS_SRCS}
 SRCS+=	vdev_geom.c
 
 # Use UMA for ZIO allocation.
-CFLAGS+=-DZIO_USE_UMA
+#CFLAGS+=-DZIO_USE_UMA
 
 # Use FreeBSD's namecache.
 CFLAGS+=-DFREEBSD_NAMECACHE

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 15:36:17 2010
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 287A8106567A;
	Tue, 11 May 2010 15:36:17 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 1860E8FC24;
	Tue, 11 May 2010 15:36:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BFaGPk022635;
	Tue, 11 May 2010 15:36:16 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BFaGWv022633;
	Tue, 11 May 2010 15:36:16 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201005111536.o4BFaGWv022633@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 11 May 2010 15:36: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: r207921 - 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, 11 May 2010 15:36:17 -0000

Author: attilio
Date: Tue May 11 15:36:16 2010
New Revision: 207921
URL: http://svn.freebsd.org/changeset/base/207921

Log:
  Fix a hang introduced in r206878 for kernel compiled with SMP support but
  being not actual SMP and similar situations by always initializing the
  smp ipi mutex.
  
  Reported by:	marius
  MFC after:	3 days
  X-MFC:		r206878

Modified:
  head/sys/kern/subr_smp.c

Modified: head/sys/kern/subr_smp.c
==============================================================================
--- head/sys/kern/subr_smp.c	Tue May 11 15:32:21 2010	(r207920)
+++ head/sys/kern/subr_smp.c	Tue May 11 15:36:16 2010	(r207921)
@@ -137,6 +137,8 @@ static void
 mp_start(void *dummy)
 {
 
+	mtx_init(&smp_ipi_mtx, "smp rendezvous", NULL, MTX_SPIN);
+
 	/* Probe for MP hardware. */
 	if (smp_disabled != 0 || cpu_mp_probe() == 0) {
 		mp_ncpus = 1;
@@ -144,7 +146,6 @@ mp_start(void *dummy)
 		return;
 	}
 
-	mtx_init(&smp_ipi_mtx, "smp rendezvous", NULL, MTX_SPIN);
 	cpu_mp_start();
 	printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n",
 	    mp_ncpus);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 16:11:13 2010
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 06DA81065673;
	Tue, 11 May 2010 16:11:13 +0000 (UTC) (envelope-from sam@errno.com)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id CBCEE8FC1B;
	Tue, 11 May 2010 16:11:12 +0000 (UTC)
Received: from [10.1.64.240] (216-239-44-65.google.com [216.239.44.65])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id o4BGB9pQ063845
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Tue, 11 May 2010 09:11:11 -0700 (PDT) (envelope-from sam@errno.com)
Message-Id: 
From: Sam Leffler 
To: Rui Paulo 
In-Reply-To: <615D8823-C354-4CC7-8CC1-75BCD1791EC2@FreeBSD.org>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Date: Tue, 11 May 2010 12:11:09 -0400
References: <201005081156.o48Bu0ma006645@svn.freebsd.org>
	<615D8823-C354-4CC7-8CC1-75BCD1791EC2@FreeBSD.org>
X-Mailer: Apple Mail (2.936)
X-DCC-USENIX-Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Ed Maste 
Subject: Re: svn commit: r207768 - head/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: Tue, 11 May 2010 16:11:13 -0000

On May 11, 2010, at 5:12 AM, Rui Paulo wrote:

> On 8 May 2010, at 12:56, Ed Maste wrote:
>
>> Author: emaste
>> Date: Sat May  8 11:56:00 2010
>> New Revision: 207768
>> URL: http://svn.freebsd.org/changeset/base/207768
>>
>> Log:
>> Add dummy function for ic_update_mcast (a la if_urtw) to avoid  
>> console
>> spam.
>
> I don't agree with this. I think these dummy functions should be  
> removed in all drivers and if the console spam is annoying it should  
> be limited to one message per interface.
>

Yes, I didn't catch the other stubs going in but already talked to Ed  
about this one.  People need to understand that stub'ing out this  
function is masking a real problem.  Drivers that can support mcast  
filtering should do so.  Otherwise we need mcast filtering implemented  
in the 802.3 layer to support the ALLMULTI ifnet flag; in which case  
drivers that are incomplete can fallback on this support.  In lieu of  
working support a better solution is to provide a stub in net80211  
that ratelimits the printf but doesn't completely remove it.

	Sam


From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:01:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 457E01065672;
	Tue, 11 May 2010 17:01:15 +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 341568FC15;
	Tue, 11 May 2010 17:01:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BH1EMH041358;
	Tue, 11 May 2010 17:01:14 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BH1EQZ041354;
	Tue, 11 May 2010 17:01:14 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201005111701.o4BH1EQZ041354@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 11 May 2010 17:01: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: r207922 - in head/sys: ddb 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, 11 May 2010 17:01:15 -0000

Author: attilio
Date: Tue May 11 17:01:14 2010
New Revision: 207922
URL: http://svn.freebsd.org/changeset/base/207922

Log:
  There is not a good reason to have a different prototype for db_printf()
  when compared to printf().
  Unify it by returning the number of characters displayed for db_printf()
  as well.
  
  MFC after:	7 days

Modified:
  head/sys/ddb/db_output.c
  head/sys/ddb/ddb.h
  head/sys/kern/subr_witness.c

Modified: head/sys/ddb/db_output.c
==============================================================================
--- head/sys/ddb/db_output.c	Tue May 11 15:36:16 2010	(r207921)
+++ head/sys/ddb/db_output.c	Tue May 11 17:01:14 2010	(r207922)
@@ -316,7 +316,7 @@ db_print_position()
 /*
  * Printing
  */
-void
+int
 db_printf(const char *fmt, ...)
 {
 #ifdef DDB_BUFR_SIZE
@@ -324,6 +324,7 @@ db_printf(const char *fmt, ...)
 #endif
 	struct dbputchar_arg dca;
 	va_list	listp;
+	int retval;
 
 #ifdef DDB_BUFR_SIZE
 	dca.da_pbufr = bufr;
@@ -336,13 +337,14 @@ db_printf(const char *fmt, ...)
 #endif
 
 	va_start(listp, fmt);
-	kvprintf (fmt, db_putchar, &dca, db_radix, listp);
+	retval = kvprintf (fmt, db_putchar, &dca, db_radix, listp);
 	va_end(listp);
 
 #ifdef DDB_BUFR_SIZE
 	if (*dca.da_pbufr != '\0')
 		db_puts(dca.da_pbufr);
 #endif
+	return (retval);
 }
 
 int db_indent;

Modified: head/sys/ddb/ddb.h
==============================================================================
--- head/sys/ddb/ddb.h	Tue May 11 15:36:16 2010	(r207921)
+++ head/sys/ddb/ddb.h	Tue May 11 17:01:14 2010	(r207922)
@@ -200,7 +200,7 @@ int		db_md_clr_watchpoint(db_expr_t addr
 void		db_md_list_watchpoints(void);
 void		db_print_loc_and_inst(db_addr_t loc);
 void		db_print_thread(void);
-void		db_printf(const char *fmt, ...) __printflike(1, 2);
+int		db_printf(const char *fmt, ...) __printflike(1, 2);
 int		db_read_bytes(vm_offset_t addr, size_t size, char *data);
 				/* machine-dependent */
 int		db_readline(char *lstart, int lsize);

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Tue May 11 15:36:16 2010	(r207921)
+++ head/sys/kern/subr_witness.c	Tue May 11 17:01:14 2010	(r207922)
@@ -343,10 +343,10 @@ static int	sysctl_debug_witness_fullgrap
 static void	witness_add_fullgraph(struct sbuf *sb, struct witness *parent);
 #ifdef DDB
 static void	witness_ddb_compute_levels(void);
-static void	witness_ddb_display(void(*)(const char *fmt, ...));
-static void	witness_ddb_display_descendants(void(*)(const char *fmt, ...),
+static void	witness_ddb_display(int(*)(const char *fmt, ...));
+static void	witness_ddb_display_descendants(int(*)(const char *fmt, ...),
 		    struct witness *, int indent);
-static void	witness_ddb_display_list(void(*prnt)(const char *fmt, ...),
+static void	witness_ddb_display_list(int(*prnt)(const char *fmt, ...),
 		    struct witness_list *list);
 static void	witness_ddb_level_descendants(struct witness *parent, int l);
 static void	witness_ddb_list(struct thread *td);
@@ -908,7 +908,7 @@ witness_ddb_level_descendants(struct wit
 }
 
 static void
-witness_ddb_display_descendants(void(*prnt)(const char *fmt, ...),
+witness_ddb_display_descendants(int(*prnt)(const char *fmt, ...),
     struct witness *w, int indent)
 {
 	int i;
@@ -938,7 +938,7 @@ witness_ddb_display_descendants(void(*pr
 }
 
 static void
-witness_ddb_display_list(void(*prnt)(const char *fmt, ...),
+witness_ddb_display_list(int(*prnt)(const char *fmt, ...),
     struct witness_list *list)
 {
 	struct witness *w;
@@ -953,7 +953,7 @@ witness_ddb_display_list(void(*prnt)(con
 }
 	
 static void
-witness_ddb_display(void(*prnt)(const char *fmt, ...))
+witness_ddb_display(int(*prnt)(const char *fmt, ...))
 {
 	struct witness *w;
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:02:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F093C106566C;
	Tue, 11 May 2010 17:02:12 +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 DFD878FC14;
	Tue, 11 May 2010 17:02:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BH2Cn3041621;
	Tue, 11 May 2010 17:02:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BH2CgZ041619;
	Tue, 11 May 2010 17:02:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005111702.o4BH2CgZ041619@svn.freebsd.org>
From: Christian Brueffer 
Date: Tue, 11 May 2010 17:02: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: r207923 - 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, 11 May 2010 17:02:13 -0000

Author: brueffer
Date: Tue May 11 17:02:12 2010
New Revision: 207923
URL: http://svn.freebsd.org/changeset/base/207923

Log:
  Document FIONREAD, FIONWRITE and FIONSPACE.
  
  Obtained from:	NetBSD
  Submitted by:	emaste
  MFC after:	1 week

Modified:
  head/lib/libc/sys/ioctl.2

Modified: head/lib/libc/sys/ioctl.2
==============================================================================
--- head/lib/libc/sys/ioctl.2	Tue May 11 17:01:14 2010	(r207922)
+++ head/lib/libc/sys/ioctl.2	Tue May 11 17:02:12 2010	(r207923)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 14, 2007
+.Dd May 11, 2010
 .Dt IOCTL 2
 .Os
 .Sh NAME
@@ -80,6 +80,30 @@ Macros and defines used in specifying an
 .Fa request
 are located in the file
 .In sys/ioctl.h .
+.Sh GENERIC IOCTLS
+Some generic ioctls are not implemented for all types of file
+descriptors.
+These include:
+.Bl -tag -width "xxxxxx"
+.It Dv FIONREAD int
+Get the number of bytes that are immediately available for reading.
+.It Dv FIONWRITE int
+Get the number of bytes in the descriptor's send queue.
+These bytes are data which has been written to the descriptor but
+which are being held by the kernel for further processing.
+The nature of the required processing depends on the underlying device.
+For TCP sockets, these bytes have not yet been acknowledged by the
+other side of the connection.
+.It Dv FIONSPACE int
+Get the free space in the descriptor's send queue.
+This value is the size of the send queue minus the number of bytes
+being held in the queue.
+Note: while this value represents the number of bytes that may be
+added to the queue, other resource limitations may cause a write
+not larger than the send queue's space to be blocked.
+One such limitation would be a lack of network buffers for a write
+to a network connection.
+.El
 .Sh RETURN VALUES
 If an error has occurred, a value of -1 is returned and
 .Va errno

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:02:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F0181065752;
	Tue, 11 May 2010 17:02:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7DB838FC17;
	Tue, 11 May 2010 17:02:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BH2TRY041726;
	Tue, 11 May 2010 17:02:29 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BH2TLA041721;
	Tue, 11 May 2010 17:02:29 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201005111702.o4BH2TLA041721@svn.freebsd.org>
From: Randall Stewart 
Date: Tue, 11 May 2010 17:02:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207924 - 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: Tue, 11 May 2010 17:02:29 -0000

Author: rrs
Date: Tue May 11 17:02:29 2010
New Revision: 207924
URL: http://svn.freebsd.org/changeset/base/207924

Log:
  This fixes a bug with the one-2-one model socket when a
  user sets up a socket to a server sends data and closes
  the socket before the server has called accept(). It used
  to NOT work at all. Now we add a flag to the assoc and
  defer assoc cleanup so that the accept will suceed.

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_constants.h
==============================================================================
--- head/sys/netinet/sctp_constants.h	Tue May 11 17:02:12 2010	(r207923)
+++ head/sys/netinet/sctp_constants.h	Tue May 11 17:02:29 2010	(r207924)
@@ -498,6 +498,7 @@ __FBSDID("$FreeBSD$");
 #define SCTP_STATE_ABOUT_TO_BE_FREED    0x0200
 #define SCTP_STATE_PARTIAL_MSG_LEFT     0x0400
 #define SCTP_STATE_WAS_ABORTED          0x0800
+#define SCTP_STATE_IN_ACCEPT_QUEUE      0x1000
 #define SCTP_STATE_MASK			0x007f
 
 #define SCTP_GET_STATE(asoc)	((asoc)->state & SCTP_STATE_MASK)

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c	Tue May 11 17:02:12 2010	(r207923)
+++ head/sys/netinet/sctp_input.c	Tue May 11 17:02:29 2010	(r207924)
@@ -2743,6 +2743,14 @@ sctp_handle_cookie_echo(struct mbuf *m, 
 			 * Now we must move it from one hash table to
 			 * another and get the tcb in the right place.
 			 */
+
+			/*
+			 * This is where the one-2-one socket is put into
+			 * the accept state waiting for the accept!
+			 */
+			if (*stcb) {
+				(*stcb)->asoc.state |= SCTP_STATE_IN_ACCEPT_QUEUE;
+			}
 			sctp_move_pcb_and_assoc(*inp_p, inp, *stcb);
 
 			atomic_add_int(&(*stcb)->asoc.refcnt, 1);
@@ -4859,8 +4867,8 @@ process_control_chunks:
 			}
 			/*
 			 * First are we accepting? We do this again here
-			 * sincen it is possible that a previous endpoint
-			 * WAS listening responded to a INIT-ACK and then
+			 * since it is possible that a previous endpoint WAS
+			 * listening responded to a INIT-ACK and then
 			 * closed. We opened and bound.. and are now no
 			 * longer listening.
 			 */

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Tue May 11 17:02:12 2010	(r207923)
+++ head/sys/netinet/sctp_pcb.c	Tue May 11 17:02:29 2010	(r207924)
@@ -4576,12 +4576,13 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
 			stcb->block_entry = NULL;
 		}
 	}
-	if (stcb->asoc.refcnt) {
+	if ((stcb->asoc.refcnt) || (stcb->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE)) {
 		/*
-		 * reader or writer in the way, we have hopefully given him
-		 * something to chew on above.
+		 * Someone holds a reference OR the socket is unaccepted
+		 * yet.
 		 */
-		sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL);
+		if (stcb->asoc.refcnt)
+			sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL);
 		SCTP_TCB_UNLOCK(stcb);
 		if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) ||
 		    (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE))

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Tue May 11 17:02:12 2010	(r207923)
+++ head/sys/netinet/sctp_usrreq.c	Tue May 11 17:02:29 2010	(r207924)
@@ -1510,7 +1510,7 @@ sctp_do_connect_x(struct socket *so, str
 	added = sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
 	/* Fill in the return id */
 	if (error) {
-		(void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_12);
+		(void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6);
 		goto out_now;
 	}
 	a_id = (sctp_assoc_t *) optval;
@@ -4670,6 +4670,7 @@ sctp_accept(struct socket *so, struct so
 	SCTP_TCB_LOCK(stcb);
 	SCTP_INP_RUNLOCK(inp);
 	store = stcb->asoc.primary_destination->ro._l_addr;
+	stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE;
 	SCTP_TCB_UNLOCK(stcb);
 	switch (store.sa.sa_family) {
 	case AF_INET:
@@ -4736,6 +4737,10 @@ sctp_accept(struct socket *so, struct so
 		}
 		SCTP_INP_WUNLOCK(inp);
 	}
+	if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
+		SCTP_TCB_LOCK(stcb);
+		sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7);
+	}
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:03:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0DA2A106567F;
	Tue, 11 May 2010 17:03:49 +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 F114E8FC34;
	Tue, 11 May 2010 17:03:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BH3mOc042027;
	Tue, 11 May 2010 17:03:48 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BH3mhb042025;
	Tue, 11 May 2010 17:03:48 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201005111703.o4BH3mhb042025@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 11 May 2010 17:03: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: r207925 - head/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 11 May 2010 17:03:49 -0000

Author: attilio
Date: Tue May 11 17:03:48 2010
New Revision: 207925
URL: http://svn.freebsd.org/changeset/base/207925

Log:
  Fix style for witness functions prototypes.
  
  MFC after:	7 days

Modified:
  head/sys/sys/lock.h

Modified: head/sys/sys/lock.h
==============================================================================
--- head/sys/sys/lock.h	Tue May 11 17:02:29 2010	(r207924)
+++ head/sys/sys/lock.h	Tue May 11 17:03:48 2010	(r207925)
@@ -197,7 +197,7 @@ extern struct lock_class lock_class_lock
 extern struct lock_class *lock_classes[];
 
 void	lock_init(struct lock_object *, struct lock_class *,
-    const char *, const char *, int);
+	    const char *, const char *, int);
 void	lock_destroy(struct lock_object *);
 void	spinlock_enter(void);
 void	spinlock_exit(void);
@@ -205,7 +205,7 @@ void	witness_init(struct lock_object *, 
 void	witness_destroy(struct lock_object *);
 int	witness_defineorder(struct lock_object *, struct lock_object *);
 void	witness_checkorder(struct lock_object *, int, const char *, int,
-    struct lock_object *);
+	    struct lock_object *);
 void	witness_lock(struct lock_object *, int, const char *, int);
 void	witness_upgrade(struct lock_object *, int, const char *, int);
 void	witness_downgrade(struct lock_object *, int, const char *, int);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:14:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29BF1106566C;
	Tue, 11 May 2010 17:14:18 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 18B278FC1A;
	Tue, 11 May 2010 17:14:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BHEH88044407;
	Tue, 11 May 2010 17:14:17 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BHEHc0044405;
	Tue, 11 May 2010 17:14:17 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201005111714.o4BHEHc0044405@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Tue, 11 May 2010 17:14: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: r207926 - head/sys/dev/ipw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 17:14:18 -0000

Author: bschmidt
Date: Tue May 11 17:14:17 2010
New Revision: 207926
URL: http://svn.freebsd.org/changeset/base/207926

Log:
  Enable 5.5 and 11Mbit TX rates.
  
  Reviewed by:	sam
  Approved by:	rpaulo (mentor)
  MFC after:	3 days

Modified:
  head/sys/dev/ipw/if_ipw.c

Modified: head/sys/dev/ipw/if_ipw.c
==============================================================================
--- head/sys/dev/ipw/if_ipw.c	Tue May 11 17:03:48 2010	(r207925)
+++ head/sys/dev/ipw/if_ipw.c	Tue May 11 17:14:17 2010	(r207926)
@@ -2505,19 +2505,19 @@ ipw_config(struct ipw_softc *sc)
 	if (error != 0)
 		return error;
 
-	data = htole32(0x3); /* 1, 2 */
+	data = htole32(0xf); /* 1, 2, 5.5, 11 */
 	DPRINTF(("Setting basic tx rates to 0x%x\n", le32toh(data)));
 	error = ipw_cmd(sc, IPW_CMD_SET_BASIC_TX_RATES, &data, sizeof data);
 	if (error != 0)
 		return error;
 
-	/* NB: use the same rate set */
+	/* Use the same rate set */
 	DPRINTF(("Setting msdu tx rates to 0x%x\n", le32toh(data)));
 	error = ipw_cmd(sc, IPW_CMD_SET_MSDU_TX_RATES, &data, sizeof data);
 	if (error != 0)
 		return error;
 
-	data = htole32(0xf); /* 1, 2, 5.5, 11 */
+	/* Use the same rate set */
 	DPRINTF(("Setting tx rates to 0x%x\n", le32toh(data)));
 	error = ipw_cmd(sc, IPW_CMD_SET_TX_RATES, &data, sizeof data);
 	if (error != 0)

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 17:21:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38F90106564A;
	Tue, 11 May 2010 17:21:55 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 271A28FC12;
	Tue, 11 May 2010 17:21:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BHLtLr046143;
	Tue, 11 May 2010 17:21:55 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BHLtvI046141;
	Tue, 11 May 2010 17:21:55 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201005111721.o4BHLtvI046141@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Tue, 11 May 2010 17:21:55 +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: r207927 - stable/8/sys/dev/iwn
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 17:21:55 -0000

Author: bschmidt
Date: Tue May 11 17:21:54 2010
New Revision: 207927
URL: http://svn.freebsd.org/changeset/base/207927

Log:
  MFC r207709:
  Add a workaround for a bug in the firmware regarding the transition
  from passive to active scans. Basicly disable it by increasing the
  amount packets to be received to an amount which can't be reached
  during dwell times.
  
  Approved by:	rpaulo (mentor)

Modified:
  stable/8/sys/dev/iwn/if_iwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/8/sys/dev/iwn/if_iwn.c	Tue May 11 17:14:17 2010	(r207926)
+++ stable/8/sys/dev/iwn/if_iwn.c	Tue May 11 17:21:54 2010	(r207927)
@@ -4730,7 +4730,7 @@ iwn_scan(struct iwn_softc *sc)
 			chan->passive = htole16(78);
 		else
 			chan->passive = htole16(110);
-		hdr->crc_threshold = htole16(1);
+		hdr->crc_threshold = 0xffff;
 	} else if (!(c->ic_flags & IEEE80211_CHAN_PASSIVE)) {
 		chan->rf_gain = 0x28;
 		chan->active  = htole16(36);
@@ -4743,7 +4743,7 @@ iwn_scan(struct iwn_softc *sc)
 			chan->passive = htole16(88);
 		else
 			chan->passive = htole16(120);
-		hdr->crc_threshold = htole16(1);
+		hdr->crc_threshold = 0xffff;
 	}
 
 	DPRINTF(sc, IWN_DEBUG_STATE,

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 18:24:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F5F2106566B;
	Tue, 11 May 2010 18:24:22 +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 7DC178FC08;
	Tue, 11 May 2010 18:24:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BIOM8c060022;
	Tue, 11 May 2010 18:24:22 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BIOMdP060017;
	Tue, 11 May 2010 18:24:22 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201005111824.o4BIOMdP060017@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 11 May 2010 18:24:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207929 - 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: Tue, 11 May 2010 18:24:22 -0000

Author: attilio
Date: Tue May 11 18:24:22 2010
New Revision: 207929
URL: http://svn.freebsd.org/changeset/base/207929

Log:
  Right now, WITNESS just blindly pipes all the output to the
  (TOCONS | TOLOG) mask even when called from DDB points.
  That breaks several output, where the most notable is textdump output.
  Fix this by having configurable callbacks passed to witness_list_locks()
  and witness_display_spinlock() for printing out datas.
  
  Reported by:	several broken textdump outputs
  Tested by:	Giovanni Trematerra
  		
  MFC after:	7 days
  X-MFC:		r207922

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/kern/subr_pcpu.c
  head/sys/kern/subr_witness.c
  head/sys/sys/lock.h

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Tue May 11 18:09:24 2010	(r207928)
+++ head/sys/kern/kern_mutex.c	Tue May 11 18:24:22 2010	(r207929)
@@ -485,7 +485,7 @@ _mtx_lock_spin_failed(struct mtx *m)
 	printf( "spin lock %p (%s) held by %p (tid %d) too long\n",
 	    m, m->lock_object.lo_name, td, td->td_tid);
 #ifdef WITNESS
-	witness_display_spinlock(&m->lock_object, td);
+	witness_display_spinlock(&m->lock_object, td, printf);
 #endif
 	panic("spin lock held too long");
 }

Modified: head/sys/kern/subr_pcpu.c
==============================================================================
--- head/sys/kern/subr_pcpu.c	Tue May 11 18:09:24 2010	(r207928)
+++ head/sys/kern/subr_pcpu.c	Tue May 11 18:24:22 2010	(r207929)
@@ -363,7 +363,7 @@ show_pcpu(struct pcpu *pc)
 
 #ifdef WITNESS
 	db_printf("spin locks held:\n");
-	witness_list_locks(&pc->pc_spinlocks);
+	witness_list_locks(&pc->pc_spinlocks, db_printf);
 #endif
 }
 

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Tue May 11 18:09:24 2010	(r207928)
+++ head/sys/kern/subr_witness.c	Tue May 11 18:24:22 2010	(r207929)
@@ -367,7 +367,8 @@ static int	witness_lock_order_check(stru
 static struct witness_lock_order_data	*witness_lock_order_get(
 					    struct witness *parent,
 					    struct witness *child);
-static void	witness_list_lock(struct lock_instance *instance);
+static void	witness_list_lock(struct lock_instance *instance,
+		    int (*prnt)(const char *fmt, ...));
 static void	witness_setflag(struct lock_object *lock, int flag, int set);
 
 #ifdef KDB
@@ -1597,7 +1598,7 @@ witness_thread_exit(struct thread *td)
 		printf("Thread %p exiting with the following locks held:\n",
 					    td);
 				n++;
-				witness_list_lock(&lle->ll_children[i]);
+				witness_list_lock(&lle->ll_children[i], printf);
 				
 			}
 		panic("Thread %p cannot exit while holding sleeplocks\n", td);
@@ -1646,7 +1647,7 @@ witness_warn(int flags, struct lock_obje
 				printf(" locks held:\n");
 			}
 			n++;
-			witness_list_lock(lock1);
+			witness_list_lock(lock1, printf);
 		}
 
 	/*
@@ -1677,7 +1678,7 @@ witness_warn(int flags, struct lock_obje
 		if (flags & WARN_SLEEPOK)
 			printf(" non-sleepable");
 		printf(" locks held:\n");
-		n += witness_list_locks(&lock_list);
+		n += witness_list_locks(&lock_list, printf);
 	} else
 		sched_unpin();
 	if (flags & WARN_PANIC && n)
@@ -2063,16 +2064,17 @@ find_instance(struct lock_list_entry *li
 }
 
 static void
-witness_list_lock(struct lock_instance *instance)
+witness_list_lock(struct lock_instance *instance,
+    int (*prnt)(const char *fmt, ...))
 {
 	struct lock_object *lock;
 
 	lock = instance->li_lock;
-	printf("%s %s %s", (instance->li_flags & LI_EXCLUSIVE) != 0 ?
+	prnt("%s %s %s", (instance->li_flags & LI_EXCLUSIVE) != 0 ?
 	    "exclusive" : "shared", LOCK_CLASS(lock)->lc_name, lock->lo_name);
 	if (lock->lo_witness->w_name != lock->lo_name)
-		printf(" (%s)", lock->lo_witness->w_name);
-	printf(" r = %d (%p) locked @ %s:%d\n",
+		prnt(" (%s)", lock->lo_witness->w_name);
+	prnt(" r = %d (%p) locked @ %s:%d\n",
 	    instance->li_flags & LI_RECURSEMASK, lock, instance->li_file,
 	    instance->li_line);
 }
@@ -2101,7 +2103,8 @@ witness_proc_has_locks(struct proc *p)
 #endif
 
 int
-witness_list_locks(struct lock_list_entry **lock_list)
+witness_list_locks(struct lock_list_entry **lock_list,
+    int (*prnt)(const char *fmt, ...))
 {
 	struct lock_list_entry *lle;
 	int i, nheld;
@@ -2109,7 +2112,7 @@ witness_list_locks(struct lock_list_entr
 	nheld = 0;
 	for (lle = *lock_list; lle != NULL; lle = lle->ll_next)
 		for (i = lle->ll_count - 1; i >= 0; i--) {
-			witness_list_lock(&lle->ll_children[i]);
+			witness_list_lock(&lle->ll_children[i], prnt);
 			nheld++;
 		}
 	return (nheld);
@@ -2123,7 +2126,8 @@ witness_list_locks(struct lock_list_entr
  * see when it was last acquired.
  */
 void
-witness_display_spinlock(struct lock_object *lock, struct thread *owner)
+witness_display_spinlock(struct lock_object *lock, struct thread *owner,
+    int (*prnt)(const char *fmt, ...))
 {
 	struct lock_instance *instance;
 	struct pcpu *pc;
@@ -2133,7 +2137,7 @@ witness_display_spinlock(struct lock_obj
 	pc = pcpu_find(owner->td_oncpu);
 	instance = find_instance(pc->pc_spinlocks, lock);
 	if (instance != NULL)
-		witness_list_lock(instance);
+		witness_list_lock(instance, prnt);
 }
 
 void
@@ -2306,7 +2310,7 @@ witness_ddb_list(struct thread *td)
 	if (witness_watch < 1)
 		return;
 
-	witness_list_locks(&td->td_sleeplocks);
+	witness_list_locks(&td->td_sleeplocks, db_printf);
 
 	/*
 	 * We only handle spinlocks if td == curthread.  This is somewhat broken
@@ -2322,7 +2326,7 @@ witness_ddb_list(struct thread *td)
 	 * handle threads on other CPU's for now.
 	 */
 	if (td == curthread && PCPU_GET(spinlocks) != NULL)
-		witness_list_locks(PCPU_PTR(spinlocks));
+		witness_list_locks(PCPU_PTR(spinlocks), db_printf);
 }
 
 DB_SHOW_COMMAND(locks, db_witness_list)

Modified: head/sys/sys/lock.h
==============================================================================
--- head/sys/sys/lock.h	Tue May 11 18:09:24 2010	(r207928)
+++ head/sys/sys/lock.h	Tue May 11 18:24:22 2010	(r207929)
@@ -212,10 +212,12 @@ void	witness_downgrade(struct lock_objec
 void	witness_unlock(struct lock_object *, int, const char *, int);
 void	witness_save(struct lock_object *, const char **, int *);
 void	witness_restore(struct lock_object *, const char *, int);
-int	witness_list_locks(struct lock_list_entry **);
+int	witness_list_locks(struct lock_list_entry **,
+	    int (*)(const char *, ...));
 int	witness_warn(int, struct lock_object *, const char *, ...);
 void	witness_assert(struct lock_object *, int, const char *, int);
-void	witness_display_spinlock(struct lock_object *, struct thread *);
+void	witness_display_spinlock(struct lock_object *, struct thread *,
+	    int (*)(const char *, ...));
 int	witness_line(struct lock_object *);
 void	witness_norelease(struct lock_object *);
 void	witness_releaseok(struct lock_object *);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 19:02:28 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59290106566C
	for ; Tue, 11 May 2010 19:02:28 +0000 (UTC)
	(envelope-from njm@njm.me.uk)
Received: from smtp004.apm-internet.net (smtp004.apm-internet.net
	[85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id A45748FC0C
	for ; Tue, 11 May 2010 19:02:27 +0000 (UTC)
Received: (qmail 57915 invoked from network); 11 May 2010 19:02:25 -0000
Received: from unknown (HELO oberon.njm.me.uk) (81.155.116.165)
	by smtp004.apm-internet.net with SMTP; 11 May 2010 19:02:25 -0000
Received: from titania.njm.me.uk (titania.njm.me.uk [192.168.144.130])
	by oberon.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4BJ2Pn9051986;
	Tue, 11 May 2010 20:02:25 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: from titania.njm.me.uk (localhost [127.0.0.1])
	by titania.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4BJ2OaI092587;
	Tue, 11 May 2010 20:02:24 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: (from njm@localhost)
	by titania.njm.me.uk (8.14.4/8.14.4/Submit) id o4BJ2Oc8092586;
	Tue, 11 May 2010 20:02:24 +0100 (BST) (envelope-from njm@njm.me.uk)
Date: Tue, 11 May 2010 20:02:24 +0100
From: "N.J. Mann" 
To: Martin Matuska 
Message-ID: <20100511190224.GA90875@titania.njm.me.uk>
Mail-Followup-To: Martin Matuska ,
	src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201005101528.o4AFSiMx091913@svn.freebsd.org>
X-Operating-System: FreeBSD 7.3-STABLE
User-Agent: mutt-NJM (2010-05-06)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 19:02:28 -0000

In message <201005101528.o4AFSiMx091913@svn.freebsd.org>,
	 Martin Matuska (mm@FreeBSD.org) wrote:
> Author: mm
> Date: Mon May 10 15:28:44 2010
> New Revision: 207849
> URL: http://svn.freebsd.org/changeset/base/207849
> 
> Log:
>   Enable liblzma support in libarchive
>   Adjust dependencies for programs using libarchive
>   Add xz and linkage against liblzma to rescue system
>   
>   Approved by:	kientzle, delphij (mentor)
>   MFC after:	2 weeks
> 
> Modified:
>   head/Makefile.inc1
>   head/lib/libarchive/Makefile
>   head/rescue/rescue/Makefile
>   head/usr.bin/ar/Makefile
>   head/usr.bin/cpio/Makefile
>   head/usr.bin/cpio/test/Makefile
>   head/usr.bin/tar/Makefile
>   head/usr.bin/tar/test/Makefile
[...]

This commit breaks the build for me.  I am building on a i386 system
running FreeBSD 7.3-STABLE r205828.  Prior to this commit I could build
HEAD fine.  Here are the last few lines of the build up to the point it
fails:

===> usr.bin/ar (obj,depend,all,install)
/usr/obj/home/FreeBSD.svn/base/head/tmp/home/FreeBSD.svn/base/head/usr.bin/ar created for /home/FreeBSD.svn/base/head/usr.bin/ar
lex -t  /home/FreeBSD.svn/base/head/usr.bin/ar/acplex.l > acplex.c
yacc -d /home/FreeBSD.svn/base/head/usr.bin/ar/acpyacc.y
cp y.tab.c acpyacc.c
rm -f .depend
mkdep -f .depend -a    -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include /home/FreeBSD.svn/base/head/usr.bin/ar/ar.c acplex.c acpyacc.c /home/FreeBSD.svn/base/head/usr.bin/ar/read.c /home/FreeBSD.svn/base/head/usr.bin/ar/util.c /home/FreeBSD.svn/base/head/usr.bin/ar/write.c
echo ar: /usr/lib/libc.a /usr/lib/libarchive.a /usr/lib/libbz2.a /usr/lib/libz.a /usr/lib/liblzma.a /usr/lib/libelf.a /usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/lib/libegacy.a >> .depend
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c /home/FreeBSD.svn/base/head/usr.bin/ar/ar.c
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c acplex.c
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c acpyacc.c
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c /home/FreeBSD.svn/base/head/usr.bin/ar/read.c
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c /home/FreeBSD.svn/base/head/usr.bin/ar/util.c
cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=gnu99   -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c /home/FreeBSD.svn/base/head/usr.bin/ar/write.c
make: don't know how to make /usr/lib/liblzma.a. Stop
*** Error code 2

Stop in /home/FreeBSD.svn/base/head.
*** Error code 1

Stop in /home/FreeBSD.svn/base/head.
*** Error code 1

Stop in /home/FreeBSD.svn/base/head.


I have removed my /etc/make.conf and /etc/src.conf and deleted /usr/obj
before starting the build.


Cheers,
       Nick.
-- 


From owner-svn-src-all@FreeBSD.ORG  Tue May 11 19:25:14 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10EF81065673;
	Tue, 11 May 2010 19:25:14 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F40798FC15;
	Tue, 11 May 2010 19:25:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BJPD8k073572;
	Tue, 11 May 2010 19:25:13 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BJPDg7073570;
	Tue, 11 May 2010 19:25:13 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201005111925.o4BJPDg7073570@svn.freebsd.org>
From: Xin LI 
Date: Tue, 11 May 2010 19:25:13 +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: r207930 - stable/8
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 19:25:14 -0000

Author: delphij
Date: Tue May 11 19:25:13 2010
New Revision: 207930
URL: http://svn.freebsd.org/changeset/base/207930

Log:
  MFC r205622:
  
  Expose MACHINE_CPU while building lib32 target.

Modified:
  stable/8/Makefile.inc1   (contents, props changed)

Modified: stable/8/Makefile.inc1
==============================================================================
--- stable/8/Makefile.inc1	Tue May 11 18:24:22 2010	(r207929)
+++ stable/8/Makefile.inc1	Tue May 11 19:25:13 2010	(r207930)
@@ -282,6 +282,7 @@ LIB32WMAKEENV=	MAKEOBJDIRPREFIX=${OBJTRE
 		VERSION="${VERSION}" \
 		MACHINE=i386 \
 		MACHINE_ARCH=i386 \
+		MACHINE_CPU="i686 mmx sse sse2" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH} \
 		CC="${CC} ${LIB32FLAGS}" \

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 19:26:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F0124106566B;
	Tue, 11 May 2010 19:26:17 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF2398FC2C;
	Tue, 11 May 2010 19:26:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BJQHkt073854;
	Tue, 11 May 2010 19:26:17 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BJQHd1073852;
	Tue, 11 May 2010 19:26:17 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201005111926.o4BJQHd1073852@svn.freebsd.org>
From: Xin LI 
Date: Tue, 11 May 2010 19:26:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207931 - stable/7
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 19:26:18 -0000

Author: delphij
Date: Tue May 11 19:26:17 2010
New Revision: 207931
URL: http://svn.freebsd.org/changeset/base/207931

Log:
  MFC r205622:
  
  Expose MACHINE_CPU while building lib32 target.

Modified:
  stable/7/Makefile.inc1   (contents, props changed)

Modified: stable/7/Makefile.inc1
==============================================================================
--- stable/7/Makefile.inc1	Tue May 11 19:25:13 2010	(r207930)
+++ stable/7/Makefile.inc1	Tue May 11 19:26:17 2010	(r207931)
@@ -263,6 +263,7 @@ LIB32WMAKEENV=	MAKEOBJDIRPREFIX=${OBJTRE
 		VERSION="${VERSION}" \
 		MACHINE=i386 \
 		MACHINE_ARCH=i386 \
+		MACHINE_CPU="i686 mmx sse sse2" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH} \
 		CC="${CC} ${LIB32FLAGS}" \

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 19:34:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4C6A1106564A;
	Tue, 11 May 2010 19:34:50 +0000 (UTC)
	(envelope-from yanefbsd@gmail.com)
Received: from mail-pz0-f174.google.com (mail-pz0-f174.google.com
	[209.85.222.174])
	by mx1.freebsd.org (Postfix) with ESMTP id 0BFC38FC1C;
	Tue, 11 May 2010 19:34:49 +0000 (UTC)
Received: by pzk4 with SMTP id 4so2637780pzk.7
	for ; Tue, 11 May 2010 12:34:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:subject:mime-version
	:content-type:from:in-reply-to:date:cc:content-transfer-encoding
	:message-id:references:to:x-mailer;
	bh=5M2mm8WR7czKYWSlcAtGjHWmWqEV2991+4hspZh7TMc=;
	b=md4MyIDZUgcURWGBaNZyfs+lfCkVhNgefmK377VwpL/0lYfVSFVUh7SlUKx8A4Ol8m
	nyB7C5IC3umedGihVjgvdV2s8IWsO70rWxH2s35OK6HT0TEz4KQmg4T6drRyz3582ykf
	QaarlrOSyNW7WoSUntuSzAAXkRp+ebLuJDc+g=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=uGpEzQeSeq+WhVlmsw4SC8VOGAP+emYZvphPSMQn782HsBqWyVhDe6CYBalEfFPNJm
	LbdvFOzumCHi3od8hopxD0yVTv5QgLp8sYYQ+s7RAE0Zc1fHT8ig+4xeCtJXWS5gkude
	rNAETrQ20IPZ4YnoZJ80i2VJLqO7169uCA/Og=
Received: by 10.143.193.8 with SMTP id v8mr3971952wfp.162.1273606489370;
	Tue, 11 May 2010 12:34:49 -0700 (PDT)
Received: from [172.24.100.15] ([192.75.139.254])
	by mx.google.com with ESMTPS id s21sm941947wff.0.2010.05.11.12.34.46
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 11 May 2010 12:34:47 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Garrett Cooper 
In-Reply-To: <20100511190224.GA90875@titania.njm.me.uk>
Date: Tue, 11 May 2010 15:34:54 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
To: N.J. Mann 
X-Mailer: Apple Mail (2.1078)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Martin Matuska 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
	usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar
	usr.bin/tar/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 19:34:50 -0000

On May 11, 2010, at 3:02 PM, N.J. Mann wrote:

> In message <201005101528.o4AFSiMx091913@svn.freebsd.org>,
> 	 Martin Matuska (mm@FreeBSD.org) wrote:
>> Author: mm
>> Date: Mon May 10 15:28:44 2010
>> New Revision: 207849
>> URL: http://svn.freebsd.org/changeset/base/207849
>>=20
>> Log:
>>  Enable liblzma support in libarchive
>>  Adjust dependencies for programs using libarchive
>>  Add xz and linkage against liblzma to rescue system
>>=20
>>  Approved by:	kientzle, delphij (mentor)
>>  MFC after:	2 weeks
>>=20
>> Modified:
>>  head/Makefile.inc1
>>  head/lib/libarchive/Makefile
>>  head/rescue/rescue/Makefile
>>  head/usr.bin/ar/Makefile
>>  head/usr.bin/cpio/Makefile
>>  head/usr.bin/cpio/test/Makefile
>>  head/usr.bin/tar/Makefile
>>  head/usr.bin/tar/test/Makefile
> [...]
>=20
> This commit breaks the build for me.  I am building on a i386 system
> running FreeBSD 7.3-STABLE r205828.  Prior to this commit I could =
build
> HEAD fine.  Here are the last few lines of the build up to the point =
it
> fails:
>=20
> =3D=3D=3D> usr.bin/ar (obj,depend,all,install)
> =
/usr/obj/home/FreeBSD.svn/base/head/tmp/home/FreeBSD.svn/base/head/usr.bin=
/ar created for /home/FreeBSD.svn/base/head/usr.bin/ar
> lex -t  /home/FreeBSD.svn/base/head/usr.bin/ar/acplex.l > acplex.c
> yacc -d /home/FreeBSD.svn/base/head/usr.bin/ar/acpyacc.y
> cp y.tab.c acpyacc.c
> rm -f .depend
> mkdep -f .depend -a    -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar =
-I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include =
/home/FreeBSD.svn/base/head/usr.bin/ar/ar.c acplex.c acpyacc.c =
/home/FreeBSD.svn/base/head/usr.bin/ar/read.c =
/home/FreeBSD.svn/base/head/usr.bin/ar/util.c =
/home/FreeBSD.svn/base/head/usr.bin/ar/write.c
> echo ar: /usr/lib/libc.a /usr/lib/libarchive.a /usr/lib/libbz2.a =
/usr/lib/libz.a /usr/lib/liblzma.a /usr/lib/libelf.a =
/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/lib/libegacy.a >> =
.depend
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
/home/FreeBSD.svn/base/head/usr.bin/ar/ar.c
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
acplex.c
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
acpyacc.c
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
/home/FreeBSD.svn/base/head/usr.bin/ar/read.c
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
/home/FreeBSD.svn/base/head/usr.bin/ar/util.c
> cc -O2 -pipe -I. -I/home/FreeBSD.svn/base/head/usr.bin/ar -std=3Dgnu99 =
  -I/usr/obj/home/FreeBSD.svn/base/head/tmp/legacy/usr/include -c =
/home/FreeBSD.svn/base/head/usr.bin/ar/write.c
> make: don't know how to make /usr/lib/liblzma.a. Stop
> *** Error code 2
>=20
> Stop in /home/FreeBSD.svn/base/head.
> *** Error code 1
>=20
> Stop in /home/FreeBSD.svn/base/head.
> *** Error code 1
>=20
> Stop in /home/FreeBSD.svn/base/head.
>=20
>=20
> I have removed my /etc/make.conf and /etc/src.conf and deleted =
/usr/obj
> before starting the build.


Hi Nick,
	Please detail the steps that you did to actually reproduce the =
problem. Just to let you know though, piecewise updating of just =
libarchive isn't possible; you need to update some Makefiles and other =
pieces that Martin touched in the lzma import (in particular =
Makefile.inc1). Otherwise things will break quickly.
HTH,
-Garrett=

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 20:03:54 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C30791065676
	for ; Tue, 11 May 2010 20:03:54 +0000 (UTC)
	(envelope-from njm@njm.me.uk)
Received: from smtp004.apm-internet.net (smtp004.apm-internet.net
	[85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id 2CEC08FC1B
	for ; Tue, 11 May 2010 20:03:54 +0000 (UTC)
Received: (qmail 71996 invoked from network); 11 May 2010 20:03:53 -0000
Received: from unknown (HELO oberon.njm.me.uk) (81.155.116.165)
	by smtp004.apm-internet.net with SMTP; 11 May 2010 20:03:53 -0000
Received: from titania.njm.me.uk (titania.njm.me.uk [192.168.144.130])
	by oberon.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4BK3qAF074111;
	Tue, 11 May 2010 21:03:52 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: from titania.njm.me.uk (localhost [127.0.0.1])
	by titania.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4BK3q10094284;
	Tue, 11 May 2010 21:03:52 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: (from njm@localhost)
	by titania.njm.me.uk (8.14.4/8.14.4/Submit) id o4BK3qOj094283;
	Tue, 11 May 2010 21:03:52 +0100 (BST) (envelope-from njm@njm.me.uk)
Date: Tue, 11 May 2010 21:03:52 +0100
From: "N.J. Mann" 
To: Garrett Cooper 
Message-ID: <20100511200352.GB90875@titania.njm.me.uk>
Mail-Followup-To: Garrett Cooper ,
	svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Martin Matuska 
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
	<25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
X-Operating-System: FreeBSD 7.3-STABLE
User-Agent: mutt-NJM (2010-05-06)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Martin Matuska 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 20:03:54 -0000

In message <25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>,
	Garrett Cooper (yanefbsd@gmail.com) wrote:
> Please detail the steps that you did to actually reproduce the problem.

I usually do a SVN update every day and then do a buildworld and buildkernel
(GENERIC and four other custom kernels) for head, stable/8 and stable/7.
Because the build box is an old dual-P3 machine that lot takes about 18
hours.  Also, I am preparing to update my desktop machine from 7-STABLE to
8-STABLE and so I didn't do a SVN update for a couple of days.  Hence, this
was the first time I had done a SVN update since lzma was imported to the
tree.

My usual procedure is:

1. remove any local patches
2. svn update
3. re-add local patches
4. buildworld in head
5. buildkernel in head (GENERIC and then custom kernels)
6. buildworld in stable/8
7. buildkernel in stable/8 (GENERIC and then custom kernels)
8. buildworld in stable/7
9. buildkernel in stable/7 (GENERIC and then custom kernels)

When I had the initial failure I immediately did a `rm -r /usr/obj' and
re-tried the build (step 4 above).  It failed again in the same place.  I
then moved my /usr/src.conf and /usr/make.conf aside, just in case, `rm -r
/usr/obj' again and re-tried the build.  It failed in the same place, so I
then started to a search to find which commit was causing the breakage:
207848 is okay, 207849 fails.

> Just to let you know though, piecewise updating of just libarchive isn't
> possible; you need to update some Makefiles and other pieces that Martin
> touched in the lzma import (in particular Makefile.inc1).
> Otherwise things will break quickly.

So, should I build 207848 and then update to 207849?  I think I must be
misunderstanding something here because I fail to see how that will work.
Please feel free to enlighten me.  :-)

Many thanks.


Cheers,
       Nick.
-- 


From owner-svn-src-all@FreeBSD.ORG  Tue May 11 20:08:59 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 283AA106564A;
	Tue, 11 May 2010 20:08:59 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by mx1.freebsd.org (Postfix) with ESMTP id BD0CB8FC08;
	Tue, 11 May 2010 20:08:58 +0000 (UTC)
Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id 7BC53A672B6;
	Wed, 12 May 2010 04:08:27 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with LMTP id TOe5+ztxvE5m; Wed, 12 May 2010 04:08:09 +0800 (CST)
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 tarsier.geekcn.org (Postfix) with ESMTPSA id 3D089A550AB;
	Wed, 12 May 2010 04:08:07 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:cc:subject:references:in-reply-to:
	x-enigmail-version:openpgp:content-type:content-transfer-encoding;
	b=OcpGRm2ibAA5KDo3nkdX4dZlnuAPDSI8BouiMJYJeIfExTmmSDjoH8g1KeAcN8A5D
	3LqpcryPoMKxfrH6tq1oQ==
Message-ID: <4BE9B923.9020800@delphij.net>
Date: Tue, 11 May 2010 13:08:03 -0700
From: Xin LI 
Organization: The Geek China Organization
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1
MIME-Version: 1.0
To: Garrett Cooper 
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
	<25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
In-Reply-To: <25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
X-Enigmail-Version: 1.0.1
OpenPGP: id=3FCA37C1;
	url=http://www.delphij.net/delphij.asc
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, Martin Matuska ,
	"N.J. Mann" 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
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: Tue, 11 May 2010 20:08:59 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2010/05/11 12:34, Garrett Cooper wrote:
> Hi Nick,
> 	Please detail the steps that you did to actually reproduce the problem. Just to let you know though, piecewise updating of just libarchive isn't possible; you need to update some Makefiles and other pieces that Martin touched in the lzma import (in particular Makefile.inc1). Otherwise things will break quickly.

I don't think there is anything wrong with Nick's procedure, I am able
to reproduce this on ref7.  Figuring out why this would happen...

Cheers,
- -- 
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJL6bkjAAoJEATO+BI/yjfBiHwH/1iCBXPC+07tNc/luBwDub3v
fl5t4DSassr6QAZ9GEK3q2TQtbnOCtBPaEU70AgjX+7UHnzUQc9+4Dpyz8wVGpXB
L5SP1hDXKPhwmbzadUbk6xPS2k7AMdcJVhedf13TR6T7WRDKfudx90wYhtC3FSKZ
zPla/IIrBHuNb4sHgSBRZdpdpcmi+exi4wXQjGPER7MwRGT3snlK8YPSClS/7M5R
NrghOA9EEQ1xCK4sGX3PcUX45RG+Fm+QSMe7iiYzDXNWzxZ7Qr+lBYqISilEM+hC
luZHFPCswmAinh/XgCVCM/CYHBCvi5fRHnmE0ykAxD4bwmgu1ODSVXnsmZSOO8k=
=5qQt
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 21:07:48 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6FE10106566B;
	Tue, 11 May 2010 21:07:48 +0000 (UTC)
	(envelope-from philip@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 461118FC14;
	Tue, 11 May 2010 21:07:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BL7mH5096617;
	Tue, 11 May 2010 21:07:48 GMT (envelope-from philip@svn.freebsd.org)
Received: (from philip@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BL7mbL096615;
	Tue, 11 May 2010 21:07:48 GMT (envelope-from philip@svn.freebsd.org)
Message-Id: <201005112107.o4BL7mbL096615@svn.freebsd.org>
From: Philip Paeps 
Date: Tue, 11 May 2010 21:07:48 +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: r207932 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 11 May 2010 21:07:48 -0000

Author: philip
Date: Tue May 11 21:07:47 2010
New Revision: 207932
URL: http://svn.freebsd.org/changeset/base/207932

Log:
  Release uqs from mentorship.  He is now free to collect his own pointy hats!

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Tue May 11 19:26:17 2010	(r207931)
+++ svnadmin/conf/mentors	Tue May 11 21:07:47 2010	(r207932)
@@ -26,7 +26,6 @@ rstone		emaste		Co-mentor: jkoshy
 sbruno		scottl
 snb		dwmalone
 sson		gnn
-uqs		philip		Co-mentor: ed
 versus		dds
 will		ken
 zml		dfr

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:22:02 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27E311065670;
	Tue, 11 May 2010 22:22:02 +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 1762A8FC18;
	Tue, 11 May 2010 22:22:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMM1MA012876;
	Tue, 11 May 2010 22:22:01 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMM1uq012874;
	Tue, 11 May 2010 22:22:01 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201005112222.o4BMM1uq012874@svn.freebsd.org>
From: Matt Jacob 
Date: Tue, 11 May 2010 22:22: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: r207933 - 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: Tue, 11 May 2010 22:22:02 -0000

Author: mjacob
Date: Tue May 11 22:22:01 2010
New Revision: 207933
URL: http://svn.freebsd.org/changeset/base/207933

Log:
  Deal sensibly with more than 26 sg devices. It isn't a complete
  solution.
  
  Sponsored by:   Panasas
  MFC after:	1 week

Modified:
  head/sys/cam/scsi/scsi_sg.c

Modified: head/sys/cam/scsi/scsi_sg.c
==============================================================================
--- head/sys/cam/scsi/scsi_sg.c	Tue May 11 21:07:47 2010	(r207932)
+++ head/sys/cam/scsi/scsi_sg.c	Tue May 11 22:22:01 2010	(r207933)
@@ -303,7 +303,12 @@ sgregister(struct cam_periph *periph, vo
 	softc->dev = make_dev(&sg_cdevsw, periph->unit_number,
 			      UID_ROOT, GID_OPERATOR, 0600, "%s%d",
 			      periph->periph_name, periph->unit_number);
-	(void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number);
+	if (periph->unit_number < 26) {
+		(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
+	} else {
+		(void)make_dev_alias(softc->dev, "sg%c%c",
+		    ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a');
+	}
 	cam_periph_lock(periph);
 	softc->dev->si_drv1 = periph;
 

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:23:36 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E6971065673;
	Tue, 11 May 2010 22:23:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D8938FC14;
	Tue, 11 May 2010 22:23:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMNadk013235;
	Tue, 11 May 2010 22:23:36 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMNZjv013233;
	Tue, 11 May 2010 22:23:36 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201005112223.o4BMNZjv013233@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 11 May 2010 22:23: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: r207934 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 22:23:36 -0000

Author: pjd
Date: Tue May 11 22:23:35 2010
New Revision: 207934
URL: http://svn.freebsd.org/changeset/base/207934

Log:
  Add missing new line characters to the warnings.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue May 11 22:22:01 2010	(r207933)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue May 11 22:23:35 2010	(r207934)
@@ -396,7 +396,7 @@ vdev_geom_attach_by_guid_event(void *arg
 					continue;
 				ap->cp = vdev_geom_attach(pp);
 				if (ap->cp == NULL) {
-					printf("ZFS WARNING: Unable to attach to %s.",
+					printf("ZFS WARNING: Unable to attach to %s.\n",
 					    pp->name);
 					continue;
 				}
@@ -533,7 +533,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		g_topology_lock();
 		error = g_access(cp, 0, 1, 0);
 		if (error != 0) {
-			printf("ZFS WARNING: Unable to open %s for writing (error=%d).",
+			printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n",
 			    vd->vdev_path, error);
 			vdev_geom_detach(cp, 0);
 			cp = NULL;

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:28:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BFC84106566C;
	Tue, 11 May 2010 22:28:55 +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 959A18FC19;
	Tue, 11 May 2010 22:28:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMStih014502;
	Tue, 11 May 2010 22:28:55 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMStlD014501;
	Tue, 11 May 2010 22:28:55 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005112228.o4BMStlD014501@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 11 May 2010 22:28: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: r207935 - 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: Tue, 11 May 2010 22:28:55 -0000

Author: jilles
Date: Tue May 11 22:28:55 2010
New Revision: 207935
URL: http://svn.freebsd.org/changeset/base/207935

Log:
  sh: Add some simple testcases for pathname expansion.

Added:
  head/tools/regression/bin/sh/expansion/pathname1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/expansion/pathname1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/pathname1.0	Tue May 11 22:28:55 2010	(r207935)
@@ -0,0 +1,61 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+	testcase=$1
+	expect=$2
+	eval "set -- $testcase"
+	actual="$*"
+	if [ "$actual" != "$expect" ]; then
+		failures=$((failures+1))
+		printf '%s\n' "For $testcase, expected $expect actual $actual"
+	fi
+}
+
+set -e
+T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
+trap 'rm -rf $T' 0
+cd -P $T
+
+mkdir testdir testdir2 'testdir/*' 'testdir/?' testdir/a testdir/b testdir2/b
+mkdir testdir2/.c
+touch testf 'testdir/*/1' 'testdir/?/1' testdir/a/1 testdir/b/1 testdir2/b/.a
+
+check '' ''
+check 'testdir/b' 'testdir/b'
+check 'testdir/c' 'testdir/c'
+check '\*' '*'
+check '\?' '?'
+check '*' 'testdir testdir2 testf'
+check '*""' 'testdir testdir2 testf'
+check '""*' 'testdir testdir2 testf'
+check '*/' 'testdir/ testdir2/'
+check 'testdir*/a' 'testdir/a'
+check 'testdir*/b' 'testdir/b testdir2/b'
+check '*/.c' 'testdir2/.c'
+check 'testdir2/*' 'testdir2/b'
+check 'testdir2/b/*' 'testdir2/b/*'
+check 'testdir/*' 'testdir/* testdir/? testdir/a testdir/b'
+check 'testdir/*/1' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check '"testdir/"*/1' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check 'testdir/\*/*' 'testdir/*/1'
+check 'testdir/\?/*' 'testdir/?/1'
+check 'testdir/"?"/*' 'testdir/?/1'
+check '"testdir"/"?"/*' 'testdir/?/1'
+check '"testdir"/"?"*/*' 'testdir/?/1'
+check '"testdir"/*"?"/*' 'testdir/?/1'
+check '"testdir/?"*/*' 'testdir/?/1'
+check 'testdir/\*/' 'testdir/*/'
+check 'testdir/\?/' 'testdir/?/'
+check 'testdir/"?"/' 'testdir/?/'
+check '"testdir"/"?"/' 'testdir/?/'
+check '"testdir"/"?"*/' 'testdir/?/'
+check '"testdir"/*"?"/' 'testdir/?/'
+check '"testdir/?"*/' 'testdir/?/'
+check 'testdir/[*]/' 'testdir/*/'
+check 'testdir/[?]/' 'testdir/?/'
+check 'testdir/[*?]/' 'testdir/*/ testdir/?/'
+check '[tz]estdir/[*]/' 'testdir/*/'
+
+exit $((failures != 0))

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:29:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72679106564A;
	Tue, 11 May 2010 22:29:00 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 614288FC1A;
	Tue, 11 May 2010 22:29:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMT0L8014540;
	Tue, 11 May 2010 22:29:00 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMT08P014538;
	Tue, 11 May 2010 22:29:00 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201005112229.o4BMT08P014538@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 11 May 2010 22:29: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: r207936 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 22:29:00 -0000

Author: pjd
Date: Tue May 11 22:29:00 2010
New Revision: 207936
URL: http://svn.freebsd.org/changeset/base/207936

Log:
  Eventhough r203504 eliminates taste traffic provoked by vdev_geom.c,
  ZFS still like to open all vdevs, close them and open them again,
  which in turn provokes taste traffic anyway.
  
  I don't know of any clean way to fix it, so do it the hard way - if we can't
  open provider for writing just retry 5 times with 0.5 pauses. This should
  elimitate accidental races caused by other classes tasting providers created on
  top of our vdevs.
  
  MFC after:	3 days
  Reported by:	James R. Van Artsdalen 
  Reported by:	Yuri Pankov 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue May 11 22:28:55 2010	(r207935)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Tue May 11 22:29:00 2010	(r207936)
@@ -530,8 +530,17 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
 		error = ENOENT;
 	} else if (cp->acw == 0 && (spa_mode & FWRITE) != 0) {
+		int i;
+
 		g_topology_lock();
-		error = g_access(cp, 0, 1, 0);
+		for (i = 0; i < 5; i++) {
+			error = g_access(cp, 0, 1, 0);
+			if (error == 0)
+				break;
+			g_topology_unlock();
+			tsleep(vd, 0, "vdev", hz / 2);
+			g_topology_lock();
+		}
 		if (error != 0) {
 			printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n",
 			    vd->vdev_path, error);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:46:36 2010
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 EFC6C106566C;
	Tue, 11 May 2010 22:46:36 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id DEACC8FC1B;
	Tue, 11 May 2010 22:46:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMkaQB018391;
	Tue, 11 May 2010 22:46:36 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMkan5018387;
	Tue, 11 May 2010 22:46:36 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201005112246.o4BMkan5018387@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Tue, 11 May 2010 22:46: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: r207937 - in head/sys: cddl/compat/opensolaris/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: Tue, 11 May 2010 22:46:37 -0000

Author: pjd
Date: Tue May 11 22:46:36 2010
New Revision: 207937
URL: http://svn.freebsd.org/changeset/base/207937

Log:
  I added vfs_lowvnodes event, but it was only used for a short while and now
  it is totally unused. Remove it.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/compat/opensolaris/sys/dnlc.h
  head/sys/kern/vfs_subr.c
  head/sys/sys/eventhandler.h

Modified: head/sys/cddl/compat/opensolaris/sys/dnlc.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/dnlc.h	Tue May 11 22:29:00 2010	(r207936)
+++ head/sys/cddl/compat/opensolaris/sys/dnlc.h	Tue May 11 22:46:36 2010	(r207937)
@@ -35,6 +35,6 @@
 #define	dnlc_update(dvp, name, vp)	do { } while (0)
 #define	dnlc_remove(dvp, name)		do { } while (0)
 #define	dnlc_purge_vfsp(vfsp, count)	(0)
-#define	dnlc_reduce_cache(percent)	EVENTHANDLER_INVOKE(vfs_lowvnodes, (int)(intptr_t)(percent))
+#define	dnlc_reduce_cache(percent)	do { } while (0)
 
 #endif	/* !_OPENSOLARIS_SYS_DNLC_H_ */

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Tue May 11 22:29:00 2010	(r207936)
+++ head/sys/kern/vfs_subr.c	Tue May 11 22:46:36 2010	(r207937)
@@ -800,7 +800,6 @@ vnlru_proc(void)
 		}
 		mtx_unlock(&mountlist_mtx);
 		if (done == 0) {
-			EVENTHANDLER_INVOKE(vfs_lowvnodes, desiredvnodes / 10);
 #if 0
 			/* These messages are temporary debugging aids */
 			if (vnlru_nowhere < 5)

Modified: head/sys/sys/eventhandler.h
==============================================================================
--- head/sys/sys/eventhandler.h	Tue May 11 22:29:00 2010	(r207936)
+++ head/sys/sys/eventhandler.h	Tue May 11 22:46:36 2010	(r207937)
@@ -183,10 +183,6 @@ typedef void (*vm_lowmem_handler_t)(void
 #define	LOWMEM_PRI_DEFAULT	EVENTHANDLER_PRI_FIRST
 EVENTHANDLER_DECLARE(vm_lowmem, vm_lowmem_handler_t);
 
-/* Low vnodes event */
-typedef void (*vfs_lowvnodes_handler_t)(void *, int);
-EVENTHANDLER_DECLARE(vfs_lowvnodes, vfs_lowvnodes_handler_t);
-
 /* Root mounted event */
 typedef void (*mountroot_handler_t)(void *);
 EVENTHANDLER_DECLARE(mountroot, mountroot_handler_t);

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 22:51:15 2010
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 2ECA9106564A;
	Tue, 11 May 2010 22:51:15 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id B122C8FC12;
	Tue, 11 May 2010 22:51:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BMpDfj019435;
	Tue, 11 May 2010 22:51:13 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BMpDAW019433;
	Tue, 11 May 2010 22:51:13 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201005112251.o4BMpDAW019433@svn.freebsd.org>
From: Matt Jacob 
Date: Tue, 11 May 2010 22:51: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: r207938 - 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: Tue, 11 May 2010 22:51:15 -0000

Author: mjacob
Date: Tue May 11 22:51:13 2010
New Revision: 207938
URL: http://svn.freebsd.org/changeset/base/207938

Log:
  Pick up the right change, not it's close cousin. The one
  previously submitted was wrong.
  
  Point hat:      mjacob
  X-MFC:          207933
  MFC after:	1 week

Modified:
  head/sys/cam/scsi/scsi_sg.c

Modified: head/sys/cam/scsi/scsi_sg.c
==============================================================================
--- head/sys/cam/scsi/scsi_sg.c	Tue May 11 22:46:36 2010	(r207937)
+++ head/sys/cam/scsi/scsi_sg.c	Tue May 11 22:51:13 2010	(r207938)
@@ -304,10 +304,12 @@ sgregister(struct cam_periph *periph, vo
 			      UID_ROOT, GID_OPERATOR, 0600, "%s%d",
 			      periph->periph_name, periph->unit_number);
 	if (periph->unit_number < 26) {
-		(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
+		(void)make_dev_alias(softc->dev, "sg%c",
+		    periph->unit_number + 'a');
 	} else {
 		(void)make_dev_alias(softc->dev, "sg%c%c",
-		    ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a');
+		    ((periph->unit_number / 26) - 1) + 'a',
+		    (periph->unit_number % 26) + 'a');
 	}
 	cam_periph_lock(periph);
 	softc->dev->si_drv1 = periph;

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:08:07 2010
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 7121D1065677;
	Tue, 11 May 2010 23:08:07 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 60B468FC1C;
	Tue, 11 May 2010 23:08:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BN8780023133;
	Tue, 11 May 2010 23:08:07 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BN87Dv023131;
	Tue, 11 May 2010 23:08:07 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005112308.o4BN87Dv023131@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 11 May 2010 23:08: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: r207939 - 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: Tue, 11 May 2010 23:08:07 -0000

Author: uqs
Date: Tue May 11 23:08:07 2010
New Revision: 207939
URL: http://svn.freebsd.org/changeset/base/207939

Log:
  mdoc: fix prologue order in mdoc template
  
  Reviewed by:	brueffer

Modified:
  head/share/misc/mdoc.template

Modified: head/share/misc/mdoc.template
==============================================================================
--- head/share/misc/mdoc.template	Tue May 11 22:51:13 2010	(r207938)
+++ head/share/misc/mdoc.template	Tue May 11 23:08:07 2010	(r207939)
@@ -2,8 +2,8 @@
 .\"
 .\" The following requests are required for all man pages.
 .Dd Month day, year
-.Os [OPERATING_SYSTEM] [version/release]
 .Dt DOCUMENT_TITLE [section number] [architecture/volume]
+.Os [OPERATING_SYSTEM] [version/release]
 .Sh NAME
 .Nm name
 .Nd one line description of name

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:08:15 2010
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 A1D93106566B;
	Tue, 11 May 2010 23:08:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 914FB8FC15;
	Tue, 11 May 2010 23:08:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BN8FjI023201;
	Tue, 11 May 2010 23:08:15 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BN8Fft023198;
	Tue, 11 May 2010 23:08:15 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005112308.o4BN8Fft023198@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 11 May 2010 23:08: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: r207940 - head/lib/libc/stdio
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 23:08:15 -0000

Author: uqs
Date: Tue May 11 23:08:15 2010
New Revision: 207940
URL: http://svn.freebsd.org/changeset/base/207940

Log:
  mdoc: use macro for +- that is understood by mdocml
  
  Reviewed by:	brueffer

Modified:
  head/lib/libc/stdio/printf.3
  head/lib/libc/stdio/wprintf.3

Modified: head/lib/libc/stdio/printf.3
==============================================================================
--- head/lib/libc/stdio/printf.3	Tue May 11 23:08:07 2010	(r207939)
+++ head/lib/libc/stdio/printf.3	Tue May 11 23:08:15 2010	(r207940)
@@ -449,7 +449,7 @@ The
 .Vt double
 argument is rounded and converted in the style
 .Sm off
-.Oo \- Oc Ar d Li \&. Ar ddd Li e \\*[Pm] Ar dd
+.Oo \- Oc Ar d Li \&. Ar ddd Li e \(+- Ar dd
 .Sm on
 where there is one digit before the
 decimal-point character
@@ -525,7 +525,7 @@ The
 .Vt double
 argument is rounded and converted to hexadecimal notation in the style
 .Sm off
-.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \\*[Pm] Oc Ar d ,
+.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \(+- Oc Ar d ,
 .Sm on
 where the number of digits after the hexadecimal-point character
 is equal to the precision specification.

Modified: head/lib/libc/stdio/wprintf.3
==============================================================================
--- head/lib/libc/stdio/wprintf.3	Tue May 11 23:08:07 2010	(r207939)
+++ head/lib/libc/stdio/wprintf.3	Tue May 11 23:08:15 2010	(r207940)
@@ -376,7 +376,7 @@ The
 .Vt double
 argument is rounded and converted in the style
 .Sm off
-.Oo \- Oc Ar d Li \&. Ar ddd Li e \\*[Pm] Ar dd
+.Oo \- Oc Ar d Li \&. Ar ddd Li e \(+- Ar dd
 .Sm on
 where there is one digit before the
 decimal-point character
@@ -452,7 +452,7 @@ The
 .Vt double
 argument is converted to hexadecimal notation in the style
 .Sm off
-.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \\*[Pm] Oc Ar d ,
+.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \(+- Oc Ar d ,
 .Sm on
 where the number of digits after the hexadecimal-point character
 is equal to the precision specification.

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:08:23 2010
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 52243106564A;
	Tue, 11 May 2010 23:08:23 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 285208FC14;
	Tue, 11 May 2010 23:08:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BN8Nhw023267;
	Tue, 11 May 2010 23:08:23 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BN8NE4023265;
	Tue, 11 May 2010 23:08:23 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005112308.o4BN8NE4023265@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 11 May 2010 23:08: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: r207941 - head/usr.bin/chpass
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 23:08:23 -0000

Author: uqs
Date: Tue May 11 23:08:22 2010
New Revision: 207941
URL: http://svn.freebsd.org/changeset/base/207941

Log:
  mdoc: remove stray and
  
  Found via:	mdocml
  Reviewed by:	brueffer

Modified:
  head/usr.bin/chpass/chpass.1

Modified: head/usr.bin/chpass/chpass.1
==============================================================================
--- head/usr.bin/chpass/chpass.1	Tue May 11 23:08:15 2010	(r207940)
+++ head/usr.bin/chpass/chpass.1	Tue May 11 23:08:22 2010	(r207941)
@@ -479,7 +479,6 @@ the list of approved shells
 .Xr vipw 8
 .Rs
 .%A Robert Morris
-and
 .%A Ken Thompson
 .%T "UNIX Password security"
 .Re

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:08:31 2010
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 6CFE21065670;
	Tue, 11 May 2010 23:08:31 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 5CB258FC1A;
	Tue, 11 May 2010 23:08:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BN8Vv0023335;
	Tue, 11 May 2010 23:08:31 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BN8VLg023332;
	Tue, 11 May 2010 23:08:31 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005112308.o4BN8VLg023332@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 11 May 2010 23:08: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: r207942 - in head/lib: libc/stdio libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 23:08:31 -0000

Author: uqs
Date: Tue May 11 23:08:31 2010
New Revision: 207942
URL: http://svn.freebsd.org/changeset/base/207942

Log:
  mdoc: fix parenthesis
  
  Reviewed by:	brueffer

Modified:
  head/lib/libc/stdio/fopen.3
  head/lib/libelf/elf.3

Modified: head/lib/libc/stdio/fopen.3
==============================================================================
--- head/lib/libc/stdio/fopen.3	Tue May 11 23:08:22 2010	(r207941)
+++ head/lib/libc/stdio/fopen.3	Tue May 11 23:08:31 2010	(r207942)
@@ -104,7 +104,7 @@ This is strictly for compatibility with
 and has no effect; the ``b'' is ignored.
 .Pp
 Any created files will have mode
-.Pf \\*q Dv S_IRUSR
+.Do Dv S_IRUSR
 \&|
 .Dv S_IWUSR
 \&|
@@ -114,7 +114,7 @@ Any created files will have mode
 \&|
 .Dv S_IROTH
 \&|
-.Dv S_IWOTH Ns \\*q
+.Dv S_IWOTH Dc
 .Pq Li 0666 ,
 as modified by the process'
 umask value (see

Modified: head/lib/libelf/elf.3
==============================================================================
--- head/lib/libelf/elf.3	Tue May 11 23:08:22 2010	(r207941)
+++ head/lib/libelf/elf.3	Tue May 11 23:08:31 2010	(r207942)
@@ -111,11 +111,13 @@ constraints.
 Accordingly, the
 .Xr ELF 3
 library offers translation facilities
-.Xr ( elf32_xlatetof 3 ,
+.Po
+.Xr elf32_xlatetof 3 ,
 .Xr elf32_xlatetom 3 ,
 .Xr elf64_xlatetof 3
 and
-.Xr elf64_xlatetom 3 )
+.Xr elf64_xlatetom 3
+.Pc
 to and from these
 representations and also provides higher-level APIs that retrieve and store
 data from the ELF object in a transparent manner.

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:08:39 2010
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 52C02106564A;
	Tue, 11 May 2010 23:08:39 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 424528FC20;
	Tue, 11 May 2010 23:08:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BN8dHI023401;
	Tue, 11 May 2010 23:08:39 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BN8dIA023399;
	Tue, 11 May 2010 23:08:39 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005112308.o4BN8dIA023399@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 11 May 2010 23:08: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: r207943 - head/lib/libc/locale
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 11 May 2010 23:08:39 -0000

Author: uqs
Date: Tue May 11 23:08:38 2010
New Revision: 207943
URL: http://svn.freebsd.org/changeset/base/207943

Log:
  mdoc: simplify quotation scheme
  
  Reviewed by:	brueffer

Modified:
  head/lib/libc/locale/isblank.3

Modified: head/lib/libc/locale/isblank.3
==============================================================================
--- head/lib/libc/locale/isblank.3	Tue May 11 23:08:31 2010	(r207942)
+++ head/lib/libc/locale/isblank.3	Tue May 11 23:08:38 2010	(r207943)
@@ -45,9 +45,8 @@ The
 .Fn isblank
 function tests for a space or tab character.
 For any locale, this includes the following standard characters:
-.Pp
-.Bl -column \&`\et''___ \&``\et''___
-.It "\&``\et''\t`` ''"
+.Bl -column XXXX
+.It Do \et Dc Ta Dq " "
 .El
 .Pp
 In the "C" locale, a successful

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:19:28 2010
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 C12891065673;
	Tue, 11 May 2010 23:19:28 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id AF9218FC13;
	Tue, 11 May 2010 23:19:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4BNJSKg025793;
	Tue, 11 May 2010 23:19:28 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4BNJSl2025790;
	Tue, 11 May 2010 23:19:28 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005112319.o4BNJSl2025790@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 11 May 2010 23:19: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: r207944 - in head: bin/sh
	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: Tue, 11 May 2010 23:19:28 -0000

Author: jilles
Date: Tue May 11 23:19:28 2010
New Revision: 207944
URL: http://svn.freebsd.org/changeset/base/207944

Log:
  sh: Fix pathname expansion with quoted slashes like *\/.
  
  These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
  d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.
  
  Because this is the first code I'm importing from dash to expand.c, add the
  Herbert Xu copyright notice which is in dash's expand.c.
  
  When pathname expanding *\/, the CTLESC representing the quoted state was
  erroneously taken as part of the * pathname component. This CTLESC was then
  seen by the pattern matching code as escaping the '\0' terminating the
  string.
  
  The code is slightly different because dash converts the CTLESC characters
  to backslashes and removes all the other CTL* characters to allow
  substituting glob(3).
  
  The effect of the bug was also slightly different from dash (where nothing
  matched at all). Because a CTLESC can escape a '\0' in some way, whether
  files were included despite the bug depended on memory that should not be
  read. In particular, on many machines /*\/ expanded to a strict subset of
  what /*/ expanded to.
  
  Example:
    echo /*"/null"
  
  This should print /dev/null, not /*/null.
  
  PR:		bin/146378
  Obtained from:	dash

Added:
  head/tools/regression/bin/sh/expansion/pathname2.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Tue May 11 23:08:38 2010	(r207943)
+++ head/bin/sh/expand.c	Tue May 11 23:19:28 2010	(r207944)
@@ -1,6 +1,8 @@
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 1997-2005
+ *	Herbert Xu .  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * Kenneth Almquist.
@@ -1150,10 +1152,11 @@ expmeta(char *enddir, char *name)
 	struct dirent *dp;
 	int atend;
 	int matchdot;
+	int esc;
 
 	metaflag = 0;
 	start = name;
-	for (p = name ; ; p++) {
+	for (p = name; esc = 0, *p; p += esc + 1) {
 		if (*p == '*' || *p == '?')
 			metaflag = 1;
 		else if (*p == '[') {
@@ -1178,12 +1181,14 @@ expmeta(char *enddir, char *name)
 			break;
 		else if (*p == CTLQUOTEMARK)
 			continue;
-		else if (*p == CTLESC)
-			p++;
-		if (*p == '/') {
-			if (metaflag)
-				break;
-			start = p + 1;
+		else {
+			if (*p == CTLESC)
+				esc++;
+			if (p[esc] == '/') {
+				if (metaflag)
+					break;
+				start = p + esc + 1;
+			}
 		}
 	}
 	if (metaflag == 0) {	/* we've reached the end of the file name */
@@ -1229,7 +1234,8 @@ expmeta(char *enddir, char *name)
 		atend = 1;
 	} else {
 		atend = 0;
-		*endname++ = '\0';
+		*endname = '\0';
+		endname += esc + 1;
 	}
 	matchdot = 0;
 	p = start;
@@ -1257,7 +1263,7 @@ expmeta(char *enddir, char *name)
 	}
 	closedir(dirp);
 	if (! atend)
-		endname[-1] = '/';
+		endname[-esc - 1] = esc ? CTLESC : '/';
 }
 
 

Added: head/tools/regression/bin/sh/expansion/pathname2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/pathname2.0	Tue May 11 23:19:28 2010	(r207944)
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+	testcase=$1
+	expect=$2
+	eval "set -- $testcase"
+	actual="$*"
+	if [ "$actual" != "$expect" ]; then
+		failures=$((failures+1))
+		printf '%s\n' "For $testcase, expected $expect actual $actual"
+	fi
+}
+
+set -e
+T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
+trap 'rm -rf $T' 0
+cd -P $T
+
+mkdir testdir testdir2 'testdir/*' 'testdir/?' testdir/a testdir/b testdir2/b
+mkdir testdir2/.c
+touch testf 'testdir/*/1' 'testdir/?/1' testdir/a/1 testdir/b/1 testdir2/b/.a
+
+check '*\/' 'testdir/ testdir2/'
+check '"testdir/"*"/1"' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check '"testdir/"*"/"*' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check '"testdir/"*\/*' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check '"testdir"*"/"*"/"*' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+
+exit $((failures != 0))

From owner-svn-src-all@FreeBSD.ORG  Tue May 11 23:22:30 2010
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 3B7B71065670;
	Tue, 11 May 2010 23:22:30 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by mx1.freebsd.org (Postfix) with ESMTP id C49DA8FC1E;
	Tue, 11 May 2010 23:22:29 +0000 (UTC)
Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id A6504A69773;
	Wed, 12 May 2010 07:22:28 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with LMTP id NfsXwkKn5vPO; Wed, 12 May 2010 07:22:09 +0800 (CST)
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 tarsier.geekcn.org (Postfix) with ESMTPSA id B1A54A550AB;
	Wed, 12 May 2010 07:22:06 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:cc:subject:references:in-reply-to:
	x-enigmail-version:openpgp:content-type:content-transfer-encoding;
	b=rIN2ZhbPL6j1Z0oz+2EXXIMcPBdZkqQ0aTlSTs6aC5QhRMIjmCXWXqEEQ6O0nwdtA
	nKqH2fd7XtBLy565pD5Aw==
Message-ID: <4BE9E69A.9020805@delphij.net>
Date: Tue, 11 May 2010 16:22:02 -0700
From: Xin LI 
Organization: The Geek China Organization
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1
MIME-Version: 1.0
To: d@delphij.net
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
	<25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
	<4BE9B923.9020800@delphij.net>
In-Reply-To: <4BE9B923.9020800@delphij.net>
X-Enigmail-Version: 1.0.1
OpenPGP: id=3FCA37C1;
	url=http://www.delphij.net/delphij.asc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: src-committers@FreeBSD.ORG, Martin Matuska ,
	"N.J. Mann" , svn-src-all@FreeBSD.ORG,
	Ruslan Ermilov , svn-src-head@FreeBSD.ORG,
	Garrett Cooper 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
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: Tue, 11 May 2010 23:22:30 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Please try this patch:

http://people.freebsd.org/~delphij/for_review/patch-lzmabuild.diff

I'm not quite satisfied with this patch though.

The problem was:

 - ar, libarchive now unconditionally depends on LZMA library;
 - When building on old system, /usr/lib/liblzma.a would not exist;
 - ar is bootstrap tool and thus will be built in BMAKE stage;
 - The build fails here since no liblzma is pre-built.

The current approach of mine is:

 - When OSRELDATE is less than the import, pass NO_LZMA when building ar(1)
 - Add support for build flag NO_LZMA to ar(1).[*]

[*] I think this is not quite right, perhaps we need to have a global
MK_XZ or something and use that flag?

Cheers,
- -- 
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!	       Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJL6eaaAAoJEATO+BI/yjfB3l0H/jvOofC2zzZS1xpqVA/e4ROD
NIXl0HeXvt1ra12wqKCt9w2Ilgx830qVAB1kHLXnOOckWYrSkWQ3soxMSuszBEM5
dkrNFwzMIi4Jed1Vg9vtpPtKPyMysM+xA1b6asGT/y18NqEBr35YnZrfqr5L/G0N
7D4qLWpMNQyhJqtIhSSXarT5NTI5272/lNQh3J3568yTtvPq2gbiTg0yj0hTr00J
M+DcSFssHM9wNwM1rKWjpuRaY/x+9gjaka2y23hZVAhoFDXjSWHy5JoVwmNjHvIU
2qlnf8y87vMncEFy5FNFVzTAn/tJJfaGXO/GoHnzMxtpgdcrcwMcmcMujRaKpyI=
=4nAw
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 00:56:53 2010
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 AA0C8106566B;
	Wed, 12 May 2010 00:56:53 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 98E4D8FC0A;
	Wed, 12 May 2010 00:56:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C0urBA046984;
	Wed, 12 May 2010 00:56:53 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C0urLI046982;
	Wed, 12 May 2010 00:56:53 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005120056.o4C0urLI046982@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 00:56: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: r207945 - head/contrib/ipfilter/man
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 00:56:53 -0000

Author: brueffer
Date: Wed May 12 00:56:53 2010
New Revision: 207945
URL: http://svn.freebsd.org/changeset/base/207945

Log:
  Comment in the BUGS section header. Matches what's in ipfilter 5.10.
  
  PR:		144880
  Submitted by:	Glen Barber 
  MFC after:	1 week

Modified:
  head/contrib/ipfilter/man/ipmon.8

Modified: head/contrib/ipfilter/man/ipmon.8
==============================================================================
--- head/contrib/ipfilter/man/ipmon.8	Tue May 11 23:19:28 2010	(r207944)
+++ head/contrib/ipfilter/man/ipmon.8	Wed May 12 00:56:53 2010	(r207945)
@@ -181,6 +181,6 @@ recorded data.
 /etc/services
 .SH SEE ALSO
 ipl(4), ipf(8), ipfstat(8), ipnat(8)
-.\".SH BUGS
+.SH BUGS
 .PP
 If you find any, please send email to me at darrenr@pobox.com

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 01:13:50 2010
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 54B3D106564A;
	Wed, 12 May 2010 01:13:50 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 4386A8FC1B;
	Wed, 12 May 2010 01:13:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C1DocS050765;
	Wed, 12 May 2010 01:13:50 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C1DoVF050763;
	Wed, 12 May 2010 01:13:50 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005120113.o4C1DoVF050763@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 01:13: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: r207946 - head/lib/libc/stdlib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 01:13:50 -0000

Author: brueffer
Date: Wed May 12 01:13:49 2010
New Revision: 207946
URL: http://svn.freebsd.org/changeset/base/207946

Log:
  The previous revision actually removed the bug being hinted at, so
  go ahead and remove the hint.
  
  PR:		143944
  Submitted by:	Jeremy Huddleston 
  MFC after:	1 week

Modified:
  head/lib/libc/stdlib/strtod.3

Modified: head/lib/libc/stdlib/strtod.3
==============================================================================
--- head/lib/libc/stdlib/strtod.3	Wed May 12 00:56:53 2010	(r207945)
+++ head/lib/libc/stdlib/strtod.3	Wed May 12 01:13:49 2010	(r207946)
@@ -32,7 +32,7 @@
 .\"     @(#)strtod.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd March 2, 2003
+.Dd May 11, 2010
 .Dt STRTOD 3
 .Os
 .Sh NAME
@@ -169,8 +169,7 @@ The
 .Fn strtod
 function
 conforms to
-.St -isoC-99 ,
-with the exception of the bug noted below.
+.St -isoC-99 .
 .Sh AUTHORS
 The author of this software is
 .An David M. Gay .

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 01:33:51 2010
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 9A6EE106566C;
	Wed, 12 May 2010 01:33:51 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 893178FC08;
	Wed, 12 May 2010 01:33:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C1Xpkf055175;
	Wed, 12 May 2010 01:33:51 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C1XpnF055173;
	Wed, 12 May 2010 01:33:51 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005120133.o4C1XpnF055173@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 01:33:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207947 - head/usr.sbin/uathload
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 01:33:51 -0000

Author: brueffer
Date: Wed May 12 01:33:51 2010
New Revision: 207947
URL: http://svn.freebsd.org/changeset/base/207947

Log:
  The -d flag is non-optional.
  
  PR:		143694
  Submitted by:	Nikolai Saoukh 
  MFC after:	1 week

Modified:
  head/usr.sbin/uathload/uathload.8

Modified: head/usr.sbin/uathload/uathload.8
==============================================================================
--- head/usr.sbin/uathload/uathload.8	Wed May 12 01:13:49 2010	(r207946)
+++ head/usr.sbin/uathload/uathload.8	Wed May 12 01:33:51 2010	(r207947)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 7, 2009
+.Dd May 11, 2010
 .Dt UATHLOAD 8
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl v
-.Op Fl d Ar ugen-device
+.Fl d Ar ugen-device
 .Op Ar firmware-file
 .Sh DESCRIPTION
 The

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 02:00:12 2010
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 50E3B1065672;
	Wed, 12 May 2010 02:00:12 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F7218FC14;
	Wed, 12 May 2010 02:00:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C20C9f060985;
	Wed, 12 May 2010 02:00:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C20Cnj060983;
	Wed, 12 May 2010 02:00:12 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005120200.o4C20Cnj060983@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 02:00: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: r207948 - head/usr.bin/make
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 02:00:12 -0000

Author: brueffer
Date: Wed May 12 02:00:11 2010
New Revision: 207948
URL: http://svn.freebsd.org/changeset/base/207948

Log:
  - Missing full stops
  - Upper case the first character of an description
  - Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81
  - Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61
  - s/seperating/separating/
  
  PR:		135165
  Submitted by:	Alan R. S. Bueno 
  MFC after:	1 week

Modified:
  head/usr.bin/make/make.1

Modified: head/usr.bin/make/make.1
==============================================================================
--- head/usr.bin/make/make.1	Wed May 12 01:33:51 2010	(r207947)
+++ head/usr.bin/make/make.1	Wed May 12 02:00:11 2010	(r207948)
@@ -990,7 +990,7 @@ Otherwise
 is the substring of
 .Ar old_string
 to be replaced in
-.Ar new_string
+.Ar new_string .
 .It Cm :T
 Replaces each word in the variable with its last component.
 .It Cm :U
@@ -1138,7 +1138,7 @@ The
 may be any one of the following:
 .Bl -tag -width "Cm XX"
 .It Cm ||
-logical
+Logical
 .Tn OR
 .It Cm &&
 Logical
@@ -1328,7 +1328,7 @@ made before the sources that succeed it 
 Loops are not being
 detected and targets that form loops will be silently ignored.
 .El
-.Sh "SPECIAL TARGETS"
+.Sh SPECIAL TARGETS
 Special targets may not be included with other targets, i.e., they must be
 the only target specified.
 .Bl -tag -width Ic
@@ -1620,7 +1620,7 @@ command in the file.
 .It Ic .SUFFIXES
 Each source specifies a suffix to
 .Nm .
-If no sources are specified, any previous specified suffices are deleted.
+If no sources are specified, any previous specified suffixes are deleted.
 .It Ic .WARN
 Each source specifies a warning flag as previously described for the
 .Fl x
@@ -1633,7 +1633,7 @@ environment variables so that a warning 
 line will influence all sub-makes.
 Several flags can be specified on a single
 .Ic .WARN
-target by seperating them with blanks.
+target by separating them with blanks.
 .El
 .Sh REMAKING MAKEFILES
 If the special target
@@ -1779,7 +1779,7 @@ The evaluation of
 .Ar expression
 in a test is very simple-minded.
 Currently, the only form that works is
-.Ql .if ${VAR} op something
+.Ql .if ${VAR} op something .
 For instance, you should write tests as
 .Ql .if ${VAR} == "string"
 not the other way around, which would give you an error.

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 03:29:12 2010
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 26ECD106564A;
	Wed, 12 May 2010 03:29:12 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 16C2D8FC17;
	Wed, 12 May 2010 03:29:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C3TBrN080984;
	Wed, 12 May 2010 03:29:11 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C3TBoK080982;
	Wed, 12 May 2010 03:29:11 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201005120329.o4C3TBoK080982@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 12 May 2010 03:29: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: r207949 - 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: Wed, 12 May 2010 03:29:12 -0000

Author: kmacy
Date: Wed May 12 03:29:11 2010
New Revision: 207949
URL: http://svn.freebsd.org/changeset/base/207949

Log:
  try working around panic by validating rt and lle
  
  MFC after:	3 days

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c	Wed May 12 02:00:11 2010	(r207948)
+++ head/sys/netinet6/ip6_output.c	Wed May 12 03:29:11 2010	(r207949)
@@ -486,7 +486,8 @@ skip_ipsec2:;
 		 */
 		if ((fle = flowtable_lookup_mbuf(V_ip6_ft, m, AF_INET6)) != NULL) {
 			flow_to_route_in6(fle, ro);
-			flevalid = 1;
+			if (ro->ro_rt != NULL && ro->ro_lle != NULL)
+				flevalid = 1;
 		}
 	}
 #endif	

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 04:51:20 2010
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 9BFEF10656C0;
	Wed, 12 May 2010 04:51:20 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C3BA8FC0C;
	Wed, 12 May 2010 04:51:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C4pKPU099153;
	Wed, 12 May 2010 04:51:20 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C4pKnN099151;
	Wed, 12 May 2010 04:51:20 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201005120451.o4C4pKnN099151@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 12 May 2010 04:51: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: r207953 - 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: Wed, 12 May 2010 04:51:20 -0000

Author: kmacy
Date: Wed May 12 04:51:20 2010
New Revision: 207953
URL: http://svn.freebsd.org/changeset/base/207953

Log:
  workaround bug with ipv6 where a flow can have a null rtentry

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==============================================================================
--- head/sys/net/flowtable.c	Wed May 12 04:44:59 2010	(r207952)
+++ head/sys/net/flowtable.c	Wed May 12 04:51:20 2010	(r207953)
@@ -1389,8 +1389,10 @@ fle_free(struct flentry *fle, struct flo
 
 	rt = __DEVOLATILE(struct rtentry *, fle->f_rt);
 	lle = __DEVOLATILE(struct llentry *, fle->f_lle);
-	RTFREE(rt);
-	LLE_FREE(lle);
+	if (rt != NULL)
+		RTFREE(rt);
+	if (lle != NULL)
+		LLE_FREE(lle);
 	flow_free(fle, ft);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 05:50:57 2010
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 9DAC3106566B;
	Wed, 12 May 2010 05:50:57 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D6178FC0C;
	Wed, 12 May 2010 05:50:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C5ovBs012323;
	Wed, 12 May 2010 05:50:57 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C5ovWH012322;
	Wed, 12 May 2010 05:50:57 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201005120550.o4C5ovWH012322@svn.freebsd.org>
From: Kevin Lo 
Date: Wed, 12 May 2010 05:50: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: r207954 - in head/sys/arm: 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: Wed, 12 May 2010 05:50:57 -0000

Author: kevlo
Date: Wed May 12 05:50:56 2010
New Revision: 207954
URL: http://svn.freebsd.org/changeset/base/207954

Log:
  The FA526 belongs to the ARM9TDMI family

Modified:
  head/sys/arm/arm/identcpu.c
  head/sys/arm/include/md_var.h

Modified: head/sys/arm/arm/identcpu.c
==============================================================================
--- head/sys/arm/arm/identcpu.c	Wed May 12 04:51:20 2010	(r207953)
+++ head/sys/arm/arm/identcpu.c	Wed May 12 05:50:56 2010	(r207954)
@@ -220,7 +220,7 @@ const struct cpuidtab cpuids[] = {
 	  generic_steppings },
 	{ CPU_ID_ARM966ESR1,	CPU_CLASS_ARM9ES,	"ARM966E-S",
 	  generic_steppings },
-	{ CPU_ID_FA526,		CPU_CLASS_ARM9,		"FA526",
+	{ CPU_ID_FA526,		CPU_CLASS_ARM9TDMI,	"FA526",
 	  generic_steppings },
 	{ CPU_ID_FA626TE,	CPU_CLASS_ARM9ES,	"FA626TE",
 	  generic_steppings },
@@ -322,7 +322,6 @@ const struct cpu_classtab cpu_classes[] 
 	{ "ARM7",	"CPU_ARM7" },		/* CPU_CLASS_ARM7 */
 	{ "ARM7TDMI",	"CPU_ARM7TDMI" },	/* CPU_CLASS_ARM7TDMI */
 	{ "ARM8",	"CPU_ARM8" },		/* CPU_CLASS_ARM8 */
-	{ "ARM9",	"CPU_ARM9" },		/* CPU_CLASS_ARM9 */
 	{ "ARM9TDMI",	"CPU_ARM9TDMI" },	/* CPU_CLASS_ARM9TDMI */
 	{ "ARM9E-S",	"CPU_ARM9E" },		/* CPU_CLASS_ARM9ES */
 	{ "ARM9EJ-S",	"CPU_ARM9E" },		/* CPU_CLASS_ARM9EJS */

Modified: head/sys/arm/include/md_var.h
==============================================================================
--- head/sys/arm/include/md_var.h	Wed May 12 04:51:20 2010	(r207953)
+++ head/sys/arm/include/md_var.h	Wed May 12 05:50:56 2010	(r207954)
@@ -57,7 +57,6 @@ enum cpu_class {
 	CPU_CLASS_ARM7,
 	CPU_CLASS_ARM7TDMI,
 	CPU_CLASS_ARM8,
-	CPU_CLASS_ARM9,
 	CPU_CLASS_ARM9TDMI,
 	CPU_CLASS_ARM9ES,
 	CPU_CLASS_ARM9EJS,

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 07:24:25 2010
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 B73B41065670;
	Wed, 12 May 2010 07:24:25 +0000 (UTC)
	(envelope-from ronald-freebsd8@klop.yi.org)
Received: from smtp-out3.tiscali.nl (smtp-out3.tiscali.nl [195.241.79.178])
	by mx1.freebsd.org (Postfix) with ESMTP id 72EE28FC0A;
	Wed, 12 May 2010 07:24:24 +0000 (UTC)
Received: from [212.123.145.58] (helo=sjakie.klop.ws)
	by smtp-out3.tiscali.nl with esmtp (Exim)
	(envelope-from )
	id 1OC6Ip-0005CR-P4; Wed, 12 May 2010 09:24:23 +0200
Received: from 212-123-145-58.ip.telfort.nl (localhost [127.0.0.1])
	by sjakie.klop.ws (Postfix) with ESMTP id 715A8BFC3;
	Wed, 12 May 2010 09:24:17 +0200 (CEST)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
To: "Matt Jacob" , src-committers@freebsd.org,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
Date: Wed, 12 May 2010 09:24:17 +0200
MIME-Version: 1.0
From: "Ronald Klop" 
Message-ID: 
In-Reply-To: <201005112222.o4BMM1uq012874@svn.freebsd.org>
User-Agent: Opera Mail/10.10 (FreeBSD)
Content-Transfer-Encoding: quoted-printable
Cc: 
Subject: Re: svn commit: r207933 - 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, 12 May 2010 07:24:25 -0000

On Wed, 12 May 2010 00:22:01 +0200, Matt Jacob  wrote=
:

> Author: mjacob
> Date: Tue May 11 22:22:01 2010
> New Revision: 207933
> URL: http://svn.freebsd.org/changeset/base/207933
>
> Log:
>   Deal sensibly with more than 26 sg devices. It isn't a complete
>   solution.
>  Sponsored by:   Panasas
>   MFC after:	1 week
>
> Modified:
>   head/sys/cam/scsi/scsi_sg.c
>
> Modified: head/sys/cam/scsi/scsi_sg.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/cam/scsi/scsi_sg.c	Tue May 11 21:07:47 2010	(r207932)
> +++ head/sys/cam/scsi/scsi_sg.c	Tue May 11 22:22:01 2010	(r207933)
> @@ -303,7 +303,12 @@ sgregister(struct cam_periph *periph, vo
>  	softc->dev =3D make_dev(&sg_cdevsw, periph->unit_number,
>  			      UID_ROOT, GID_OPERATOR, 0600, "%s%d",
>  			      periph->periph_name, periph->unit_number);
> -	(void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number);
> +	if (periph->unit_number < 26) {
> +		(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
> +	} else {
> +		(void)make_dev_alias(softc->dev, "sg%c%c",
> +		    ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + =20
> 'a');
> +	}
>  	cam_periph_lock(periph);
>  	softc->dev->si_drv1 =3D periph;

Wow, did you copy this from windows? :-)

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 09:34:11 2010
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 5CD361065673;
	Wed, 12 May 2010 09:34:11 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 432348FC0A;
	Wed, 12 May 2010 09:34:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C9YBaQ061456;
	Wed, 12 May 2010 09:34:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C9YBea061455;
	Wed, 12 May 2010 09:34:11 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005120934.o4C9YBea061455@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 12 May 2010 09:34:11 +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: r207955 - in stable/8/sys: amd64/amd64 amd64/include
	i386/i386 i386/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: Wed, 12 May 2010 09:34:11 -0000

Author: kib
Date: Wed May 12 09:34:10 2010
New Revision: 207955
URL: http://svn.freebsd.org/changeset/base/207955

Log:
  MFC r207676:
  Add definitions for Intel AESNI CPUID bits and print the capabilities
  on boot.

Modified:
  stable/8/sys/amd64/amd64/identcpu.c
  stable/8/sys/amd64/include/specialreg.h
  stable/8/sys/i386/i386/identcpu.c
  stable/8/sys/i386/include/specialreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/amd64/amd64/identcpu.c
==============================================================================
--- stable/8/sys/amd64/amd64/identcpu.c	Wed May 12 05:50:56 2010	(r207954)
+++ stable/8/sys/amd64/amd64/identcpu.c	Wed May 12 09:34:10 2010	(r207955)
@@ -240,7 +240,7 @@ printcpuinfo(void)
 				printf("\n  Features2=0x%b", cpu_feature2,
 				"\020"
 				"\001SSE3"	/* SSE3 */
-				"\002"
+				"\002PCLMULQDQ"	/* Carry-Less Mul Quadword */
 				"\003DTES64"	/* 64-bit Debug Trace */
 				"\004MON"	/* MONITOR/MWAIT Instructions */
 				"\005DS_CPL"	/* CPL Qualified Debug Store */
@@ -264,7 +264,7 @@ printcpuinfo(void)
 				"\027MOVBE"
 				"\030POPCNT"
 				"\031"
-				"\032"
+				"\032AESNI"	/* AES Crypto*/
 				"\033XSAVE"
 				"\034OSXSAVE"
 				"\035"

Modified: stable/8/sys/amd64/include/specialreg.h
==============================================================================
--- stable/8/sys/amd64/include/specialreg.h	Wed May 12 05:50:56 2010	(r207954)
+++ stable/8/sys/amd64/include/specialreg.h	Wed May 12 09:34:10 2010	(r207955)
@@ -113,6 +113,7 @@
 #define	CPUID_PBE	0x80000000
 
 #define	CPUID2_SSE3	0x00000001
+#define	CPUID2_PCLMULQDQ 0x00000002
 #define	CPUID2_DTES64	0x00000004
 #define	CPUID2_MON	0x00000008
 #define	CPUID2_DS_CPL	0x00000010
@@ -131,6 +132,7 @@
 #define	CPUID2_X2APIC	0x00200000
 #define	CPUID2_MOVBE	0x00400000
 #define	CPUID2_POPCNT	0x00800000
+#define	CPUID2_AESNI	0x02000000
 
 /*
  * Important bits in the AMD extended cpuid flags

Modified: stable/8/sys/i386/i386/identcpu.c
==============================================================================
--- stable/8/sys/i386/i386/identcpu.c	Wed May 12 05:50:56 2010	(r207954)
+++ stable/8/sys/i386/i386/identcpu.c	Wed May 12 09:34:10 2010	(r207955)
@@ -727,7 +727,7 @@ printcpuinfo(void)
 				printf("\n  Features2=0x%b", cpu_feature2,
 				"\020"
 				"\001SSE3"	/* SSE3 */
-				"\002"
+				"\002PCLMULQDQ"	/* Carry-Less Mul Quadword */
 				"\003DTES64"	/* 64-bit Debug Trace */
 				"\004MON"	/* MONITOR/MWAIT Instructions */
 				"\005DS_CPL"	/* CPL Qualified Debug Store */
@@ -751,7 +751,7 @@ printcpuinfo(void)
 				"\027MOVBE"
 				"\030POPCNT"
 				"\031"
-				"\032"
+				"\032AESNI"	/* AES Crypto*/
 				"\033XSAVE"
 				"\034OSXSAVE"
 				"\035"

Modified: stable/8/sys/i386/include/specialreg.h
==============================================================================
--- stable/8/sys/i386/include/specialreg.h	Wed May 12 05:50:56 2010	(r207954)
+++ stable/8/sys/i386/include/specialreg.h	Wed May 12 09:34:10 2010	(r207955)
@@ -110,6 +110,7 @@
 #define	CPUID_PBE	0x80000000
 
 #define	CPUID2_SSE3	0x00000001
+#define	CPUID2_PCLMULQDQ 0x00000002
 #define	CPUID2_DTES64	0x00000004
 #define	CPUID2_MON	0x00000008
 #define	CPUID2_DS_CPL	0x00000010
@@ -128,6 +129,7 @@
 #define	CPUID2_X2APIC	0x00200000
 #define	CPUID2_MOVBE	0x00400000
 #define	CPUID2_POPCNT	0x00800000
+#define	CPUID2_AESNI	0x02000000
 
 /*
  * Important bits in the AMD extended cpuid flags

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 09:51:57 2010
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 935B61065670;
	Wed, 12 May 2010 09:51:57 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 83BAC8FC12;
	Wed, 12 May 2010 09:51:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4C9pvXF065379;
	Wed, 12 May 2010 09:51:57 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4C9pvWs065377;
	Wed, 12 May 2010 09:51:57 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005120951.o4C9pvWs065377@svn.freebsd.org>
From: Martin Matuska 
Date: Wed, 12 May 2010 09:51: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: r207956 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 09:51:57 -0000

Author: mm
Date: Wed May 12 09:51:57 2010
New Revision: 207956
URL: http://svn.freebsd.org/changeset/base/207956

Log:
  Fix possible hang when replaying large truncations.
  
  OpenSolaris onnv revision:	7904:6a124a4ca9c5
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6761624)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Wed May 12 09:34:10 2010	(r207955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Wed May 12 09:51:57 2010	(r207956)
@@ -1567,6 +1567,29 @@ zil_replay_log_record(zilog_t *zilog, lr
 	}
 
 	/*
+	 * Replay of large truncates can end up needing additional txs
+	 * and a different txg. If they are nested within the replay tx
+	 * as below then a hang is possible. So we do the truncate here
+	 * and redo the truncate later (a no-op) and update the sequence
+	 * number whilst in the replay tx. Fortunately, it's safe to repeat
+	 * a truncate if we crash and the truncate commits. A create over
+	 * an existing file will also come in as a TX_TRUNCATE record.
+	 *
+	 * Note, remove of large files and renames over large files is
+	 * handled by putting the deleted object on a stable list
+	 * and if necessary force deleting the object outside of the replay
+	 * transaction using the zr_replay_cleaner.
+	 */
+	if (txtype == TX_TRUNCATE) {
+		*zr->zr_txgp = TXG_NOWAIT;
+		error = zr->zr_replay[TX_TRUNCATE](zr->zr_arg, zr->zr_lrbuf,
+		    zr->zr_byteswap);
+		if (error)
+			goto bad;
+		zr->zr_byteswap = 0; /* only byteswap once */
+	}
+
+	/*
 	 * We must now do two things atomically: replay this log record,
 	 * and update the log header to reflect the fact that we did so.
 	 * We use the DMU's ability to assign into a specific txg to do this.
@@ -1636,6 +1659,7 @@ zil_replay_log_record(zilog_t *zilog, lr
 		dprintf("pass %d, retrying\n", pass);
 	}
 
+bad:
 	ASSERT(error && error != ERESTART);
 	name = kmem_alloc(MAXNAMELEN, KM_SLEEP);
 	dmu_objset_name(zr->zr_os, name);

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 10:29:07 2010
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 208BB106566B;
	Wed, 12 May 2010 10:29:07 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 1195D8FC12;
	Wed, 12 May 2010 10:29:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CAT6Uu080705;
	Wed, 12 May 2010 10:29:06 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CAT6AB080703;
	Wed, 12 May 2010 10:29:06 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005121029.o4CAT6AB080703@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 12 May 2010 10:29: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: r207957 - 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: Wed, 12 May 2010 10:29:07 -0000

Author: kib
Date: Wed May 12 10:29:06 2010
New Revision: 207957
URL: http://svn.freebsd.org/changeset/base/207957

Log:
  Remove unneeded overrides of the segment registers in the inner trap
  frame upon segment register load fault. The doreti procedure does not
  load segment registers when returning to the kernel frame, and current
  values in the segment descriptor cache already allow the kernel mode
  to run, not modified by faulted loaded.
  
  Suggested by:	bde
  Tested by:	pho
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Wed May 12 09:51:57 2010	(r207956)
+++ head/sys/amd64/amd64/trap.c	Wed May 12 10:29:06 2010	(r207957)
@@ -488,22 +488,18 @@ trap(struct trapframe *frame)
 			}
 			if (frame->tf_rip == (long)ld_ds) {
 				frame->tf_rip = (long)ds_load_fault;
-				frame->tf_ds = _udatasel;
 				goto out;
 			}
 			if (frame->tf_rip == (long)ld_es) {
 				frame->tf_rip = (long)es_load_fault;
-				frame->tf_es = _udatasel;
 				goto out;
 			}
 			if (frame->tf_rip == (long)ld_fs) {
 				frame->tf_rip = (long)fs_load_fault;
-				frame->tf_fs = _ufssel;
 				goto out;
 			}
 			if (frame->tf_rip == (long)ld_gs) {
 				frame->tf_rip = (long)gs_load_fault;
-				frame->tf_gs = _ugssel;
 				goto out;
 			}
 			if (frame->tf_rip == (long)ld_gsbase) {

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 10:29:35 2010
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 8FA5710657C2;
	Wed, 12 May 2010 10:29:35 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 808CE8FC16;
	Wed, 12 May 2010 10:29:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CATZg1080839;
	Wed, 12 May 2010 10:29:35 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CATZgR080836;
	Wed, 12 May 2010 10:29:35 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005121029.o4CATZgR080836@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 12 May 2010 10:29: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: r207958 - 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: Wed, 12 May 2010 10:29:35 -0000

Author: kib
Date: Wed May 12 10:29:35 2010
New Revision: 207958
URL: http://svn.freebsd.org/changeset/base/207958

Log:
  Route all returns from the interrupts and faults through the doreti_iret
  labeled iretq instruction.
  
  Suppose that multithreaded process executes two threads, currently
  scheduled on different processors. Let assume that thread A executes
  using %cs or %ss pointing into the descriptor from LDT. If IPI comes
  which handler does not return by jump to doreti, and meantime thread B
  invalidates descriptor pointed to by %cs or %ss, then iretq from IPI
  handler could fault.
  
  Routing the return by doreti_iret allows kernel to catch the situation
  and recover from it by sending signal to the usermode.
  
  Tested by:	pho
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/apic_vector.S
  head/sys/amd64/amd64/exception.S

Modified: head/sys/amd64/amd64/apic_vector.S
==============================================================================
--- head/sys/amd64/amd64/apic_vector.S	Wed May 12 10:29:06 2010	(r207957)
+++ head/sys/amd64/amd64/apic_vector.S	Wed May 12 10:29:35 2010	(r207958)
@@ -41,6 +41,7 @@
 
 #include "assym.s"
 
+	.extern	doreti_iret
 /*
  * I/O Interrupt Entry Point.  Rather than having one entry point for
  * each interrupt source, we use one entry point for each 32-bit word
@@ -81,7 +82,7 @@ IDTVEC(spuriousint)
 
 	/* No EOI cycle used here */
 
-	iretq
+	jmp	doreti_iret
 
 	ISR_VEC(1, apic_isr1)
 	ISR_VEC(2, apic_isr2)
@@ -135,7 +136,7 @@ IDTVEC(invltlb)
 	incl	smp_tlb_wait
 
 	popq	%rax
-	iretq
+	jmp	doreti_iret
 
 /*
  * Single page TLB shootdown
@@ -155,7 +156,7 @@ IDTVEC(invlpg)
 	incl	smp_tlb_wait
 
 	popq	%rax
-	iretq
+	jmp	doreti_iret
 
 /*
  * Page range TLB shootdown.
@@ -181,7 +182,7 @@ IDTVEC(invlrng)
 
 	popq	%rdx
 	popq	%rax
-	iretq
+	jmp	doreti_iret
 
 /*
  * Invalidate cache.
@@ -200,7 +201,7 @@ IDTVEC(invlcache)
 	incl	smp_tlb_wait
 
 	popq	%rax
-	iretq
+	jmp	doreti_iret
 
 /*
  * Handler for IPIs sent via the per-cpu IPI bitmap.
@@ -247,7 +248,7 @@ IDTVEC(cpususpend)
 	call	cpususpend_handler
 
 	POP_FRAME
-	iretq
+	jmp	doreti_iret
 
 /*
  * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU.

Modified: head/sys/amd64/amd64/exception.S
==============================================================================
--- head/sys/amd64/amd64/exception.S	Wed May 12 10:29:06 2010	(r207957)
+++ head/sys/amd64/amd64/exception.S	Wed May 12 10:29:35 2010	(r207958)
@@ -553,7 +553,7 @@ nmi_restoreregs:
 	movq	TF_R14(%rsp),%r14
 	movq	TF_R15(%rsp),%r15
 	addq	$TF_RIP,%rsp
-	iretq
+	jmp	doreti_iret
 
 ENTRY(fork_trampoline)
 	movq	%r12,%rdi		/* function */

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 11:22:47 2010
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 4716B1065676
	for ; Wed, 12 May 2010 11:22:47 +0000 (UTC)
	(envelope-from njm@njm.me.uk)
Received: from smtp004.apm-internet.net (smtp004.apm-internet.net
	[85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id 8B0848FC13
	for ; Wed, 12 May 2010 11:22:46 +0000 (UTC)
Received: (qmail 65936 invoked from network); 12 May 2010 11:22:45 -0000
Received: from unknown (HELO oberon.njm.me.uk) (81.155.116.165)
	by smtp004.apm-internet.net with SMTP; 12 May 2010 11:22:45 -0000
Received: from titania.njm.me.uk (titania.njm.me.uk [192.168.144.130])
	by oberon.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4CBMin2090815;
	Wed, 12 May 2010 12:22:44 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: from titania.njm.me.uk (localhost [127.0.0.1])
	by titania.njm.me.uk (8.14.4/8.14.4) with ESMTP id o4CBMi7t035577;
	Wed, 12 May 2010 12:22:44 +0100 (BST) (envelope-from njm@njm.me.uk)
Received: (from njm@localhost)
	by titania.njm.me.uk (8.14.4/8.14.4/Submit) id o4CBMihH035576;
	Wed, 12 May 2010 12:22:44 +0100 (BST) (envelope-from njm@njm.me.uk)
Date: Wed, 12 May 2010 12:22:44 +0100
From: "N.J. Mann" 
To: d@delphij.net
Message-ID: <20100512112244.GA34380@titania.njm.me.uk>
Mail-Followup-To: d@delphij.net, src-committers@FreeBSD.ORG,
	Martin Matuska , svn-src-all@FreeBSD.ORG,
	Ruslan Ermilov , svn-src-head@FreeBSD.ORG,
	Garrett Cooper 
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
	<25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
	<4BE9B923.9020800@delphij.net> <4BE9E69A.9020805@delphij.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4BE9E69A.9020805@delphij.net>
X-Operating-System: FreeBSD 7.3-STABLE
User-Agent: mutt-NJM (2010-05-06)
Cc: src-committers@FreeBSD.ORG, Martin Matuska ,
	svn-src-all@FreeBSD.ORG, Ruslan Ermilov ,
	svn-src-head@FreeBSD.ORG, Garrett Cooper 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 11:22:47 -0000

In message <4BE9E69A.9020805@delphij.net>,
	Xin LI (delphij@delphij.net) wrote:
> 
> Please try this patch:
> 
> http://people.freebsd.org/~delphij/for_review/patch-lzmabuild.diff
> 
> I'm not quite satisfied with this patch though.
[...]

It fixed the build.  If you need another patch testing just let me know.

Many thanks.


Cheers,
       Nick.
-- 


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 11:49:16 2010
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 761CE106566C;
	Wed, 12 May 2010 11:49:16 +0000 (UTC)
	(envelope-from vanhu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 665458FC0C;
	Wed, 12 May 2010 11:49:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CBnGe0098325;
	Wed, 12 May 2010 11:49:16 GMT (envelope-from vanhu@svn.freebsd.org)
Received: (from vanhu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CBnGrW098324;
	Wed, 12 May 2010 11:49:16 GMT (envelope-from vanhu@svn.freebsd.org)
Message-Id: <201005121149.o4CBnGrW098324@svn.freebsd.org>
From: VANHULLEBUS Yvan 
Date: Wed, 12 May 2010 11:49:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207959 - stable/8/sys/netipsec
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 11:49:16 -0000

Author: vanhu
Date: Wed May 12 11:49:15 2010
New Revision: 207959
URL: http://svn.freebsd.org/changeset/base/207959

Log:
  MFC:
  Set/update SA's NAT-T stuff before calling key_mature() in
  key_add() and key_update(), as the SA may be used as soon as
  key_mature() has been called
  
  Obtained from: NETASQ

Modified:
  stable/8/sys/netipsec/key.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/netipsec/key.c
==============================================================================
--- stable/8/sys/netipsec/key.c	Wed May 12 10:29:35 2010	(r207958)
+++ stable/8/sys/netipsec/key.c	Wed May 12 11:49:15 2010	(r207959)
@@ -5158,12 +5158,6 @@ key_update(so, m, mhp)
 		return key_senderror(so, m, error);
 	}
 
-	/* check SA values to be mature. */
-	if ((mhp->msg->sadb_msg_errno = key_mature(sav)) != 0) {
-		KEY_FREESAV(&sav);
-		return key_senderror(so, m, 0);
-	}
-
 #ifdef IPSEC_NAT_T
 	/*
 	 * Handle more NAT-T info if present,
@@ -5190,6 +5184,12 @@ key_update(so, m, mhp)
 #endif
 #endif
 
+	/* check SA values to be mature. */
+	if ((mhp->msg->sadb_msg_errno = key_mature(sav)) != 0) {
+		KEY_FREESAV(&sav);
+		return key_senderror(so, m, 0);
+	}
+
     {
 	struct mbuf *n;
 
@@ -5424,12 +5424,6 @@ key_add(so, m, mhp)
 		return key_senderror(so, m, error);
 	}
 
-	/* check SA values to be mature. */
-	if ((error = key_mature(newsav)) != 0) {
-		KEY_FREESAV(&newsav);
-		return key_senderror(so, m, error);
-	}
-
 #ifdef IPSEC_NAT_T
 	/*
 	 * Handle more NAT-T info if present,
@@ -5449,6 +5443,12 @@ key_add(so, m, mhp)
 #endif
 #endif
 
+	/* check SA values to be mature. */
+	if ((error = key_mature(newsav)) != 0) {
+		KEY_FREESAV(&newsav);
+		return key_senderror(so, m, error);
+	}
+
 	/*
 	 * don't call key_freesav() here, as we would like to keep the SA
 	 * in the database on success.

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 13:20:06 2010
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 6F2C1106566C;
	Wed, 12 May 2010 13:20:06 +0000 (UTC) (envelope-from dfr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 46A3F8FC19;
	Wed, 12 May 2010 13:20:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CDK6Jl018663;
	Wed, 12 May 2010 13:20:06 GMT (envelope-from dfr@svn.freebsd.org)
Received: (from dfr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CDK6gm018661;
	Wed, 12 May 2010 13:20:06 GMT (envelope-from dfr@svn.freebsd.org)
Message-Id: <201005121320.o4CDK6gm018661@svn.freebsd.org>
From: Doug Rabson 
Date: Wed, 12 May 2010 13:20:06 +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: r207962 - 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, 12 May 2010 13:20:06 -0000

Author: dfr
Date: Wed May 12 13:20:05 2010
New Revision: 207962
URL: http://svn.freebsd.org/changeset/base/207962

Log:
  Release zml@ from mentorship.

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Wed May 12 12:52:39 2010	(r207961)
+++ svnadmin/conf/mentors	Wed May 12 13:20:05 2010	(r207962)
@@ -28,4 +28,3 @@ snb		dwmalone
 sson		gnn
 versus		dds
 will		ken
-zml		dfr

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 13:23:52 2010
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 757371065679;
	Wed, 12 May 2010 13:23:52 +0000 (UTC) (envelope-from ru@freebsd.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B8A68FC23;
	Wed, 12 May 2010 13:23:51 +0000 (UTC)
Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.71 (FreeBSD)) (envelope-from )
	id 1OCBub-0008Ok-3u; Wed, 12 May 2010 17:23:45 +0400
Date: Wed, 12 May 2010 17:23:30 +0400
From: Ruslan Ermilov 
To: d@delphij.net
Message-ID: <20100512132330.GA92013@edoofus.dev.vega.ru>
References: <201005101528.o4AFSiMx091913@svn.freebsd.org>
	<20100511190224.GA90875@titania.njm.me.uk>
	<25885E8D-93A9-47C7-BC55-AEE2D3773010@gmail.com>
	<4BE9B923.9020800@delphij.net> <4BE9E69A.9020805@delphij.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4BE9E69A.9020805@delphij.net>
Cc: src-committers@freebsd.org, Martin Matuska ,
	"N.J. Mann" , svn-src-all@freebsd.org,
	svn-src-head@freebsd.org, Garrett Cooper 
Subject: Re: svn commit: r207849 - in head: . lib/libarchive rescue/rescue
 usr.bin/ar usr.bin/cpio usr.bin/cpio/test usr.bin/tar usr.bin/tar/test
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 13:23:52 -0000

On Tue, May 11, 2010 at 04:22:02PM -0700, Xin LI wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> Please try this patch:
> 
> http://people.freebsd.org/~delphij/for_review/patch-lzmabuild.diff
> 
> I'm not quite satisfied with this patch though.
> 
> The problem was:
> 
>  - ar, libarchive now unconditionally depends on LZMA library;
>  - When building on old system, /usr/lib/liblzma.a would not exist;
>  - ar is bootstrap tool and thus will be built in BMAKE stage;
>  - The build fails here since no liblzma is pre-built.

How about bootstrapping liblzma instead?  NB: Completely untested.

%%%
Index: Makefile.inc1
===================================================================
--- Makefile.inc1	(revision 207959)
+++ Makefile.inc1	(working copy)
@@ -931,7 +931,7 @@
 .endif
 
 .if ${BOOTSTRAPPING} >= 700044 && ${BOOTSTRAPPING} < 800022
-_ar=		usr.bin/ar
+_ar=		lib/liblzma usr.bin/ar
 .endif
 
 .if ${BOOTSTRAPPING} < 800013
%%%


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 13:45:47 2010
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 2A559106566B;
	Wed, 12 May 2010 13:45:47 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A9608FC26;
	Wed, 12 May 2010 13:45:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CDjk4S024361;
	Wed, 12 May 2010 13:45:47 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CDjkcI024359;
	Wed, 12 May 2010 13:45:46 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201005121345.o4CDjkcI024359@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 12 May 2010 13:45: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: r207963 - 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: Wed, 12 May 2010 13:45:47 -0000

Author: rrs
Date: Wed May 12 13:45:46 2010
New Revision: 207963
URL: http://svn.freebsd.org/changeset/base/207963

Log:
  This fixes PR-SCTP issues:
   - Slide the map at the proper place.
   - Mark the bits in the nr_array ONLY if there
     is no marking.
   - When generating a FWD-TSN we allow us to skip past
     ACKED chunks too.
  
  MFC after:	1 weeks

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Wed May 12 13:20:05 2010	(r207962)
+++ head/sys/netinet/sctp_indata.c	Wed May 12 13:45:46 2010	(r207963)
@@ -3694,6 +3694,7 @@ sctp_try_advance_peer_ack_point(struct s
 	tp1 = TAILQ_FIRST(&asoc->sent_queue);
 	while (tp1) {
 		if (tp1->sent != SCTP_FORWARD_TSN_SKIP &&
+		    tp1->sent != SCTP_DATAGRAM_ACKED &&
 		    tp1->sent != SCTP_DATAGRAM_RESEND) {
 			/* no chance to advance, out of here */
 			break;
@@ -5540,8 +5541,8 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 	 * report where we are.
 	 */
 	struct sctp_association *asoc;
-	uint32_t new_cum_tsn, tsn, gap;
-	unsigned int i, fwd_sz, cumack_set_flag, m_size, fnd = 0;
+	uint32_t new_cum_tsn, gap;
+	unsigned int i, fwd_sz, cumack_set_flag, m_size;
 	uint32_t str_seq;
 	struct sctp_stream_in *strm;
 	struct sctp_tmit_chunk *chk, *at;
@@ -5565,15 +5566,6 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 		/* Already got there ... */
 		return;
 	}
-	if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_map,
-	    MAX_TSN)) {
-		asoc->highest_tsn_inside_map = new_cum_tsn;
-
-	}
-	if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_nr_map,
-	    MAX_TSN)) {
-		asoc->highest_tsn_inside_nr_map = new_cum_tsn;
-	}
 	/*
 	 * now we know the new TSN is more advanced, let's find the actual
 	 * gap
@@ -5628,34 +5620,14 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 	} else {
 		SCTP_TCB_LOCK_ASSERT(stcb);
 		for (i = 0; i <= gap; i++) {
-			SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, i);
-			SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i);
-			/* FIX ME add something to set up highest TSN in map */
-		}
-		if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
-			asoc->highest_tsn_inside_nr_map = new_cum_tsn;
-		}
-		if (compare_with_wrap(new_cum_tsn, asoc->highest_tsn_inside_map, MAX_TSN) ||
-		    new_cum_tsn == asoc->highest_tsn_inside_map) {
-			/* We must back down to see what the new highest is */
-			for (tsn = new_cum_tsn; (compare_with_wrap(tsn, asoc->mapping_array_base_tsn, MAX_TSN) ||
-			    (tsn == asoc->mapping_array_base_tsn)); tsn--) {
-				SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn);
-				if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) {
-					asoc->highest_tsn_inside_map = tsn;
-					fnd = 1;
-					break;
+			if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) &&
+			    !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) {
+				SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i);
+				if (compare_with_wrap(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map, MAX_TSN)) {
+					asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i;
 				}
 			}
-			if (!fnd) {
-				asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1;
-			}
 		}
-		/*
-		 * Now after marking all, slide thing forward but no sack
-		 * please.
-		 */
-		sctp_slide_mapping_arrays(stcb);
 	}
 	/*************************************************************/
 	/* 2. Clear up re-assembly queue                             */
@@ -5826,6 +5798,11 @@ sctp_handle_forward_tsn(struct sctp_tcb 
 		}
 		SCTP_INP_READ_UNLOCK(stcb->sctp_ep);
 	}
+	/*
+	 * Now slide thing forward.
+	 */
+	sctp_slide_mapping_arrays(stcb);
+
 	if (TAILQ_FIRST(&asoc->reasmqueue)) {
 		/* now lets kick out and check for more fragmented delivery */
 		/* sa_ignore NO_NULL_CHK */

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 14:20:49 2010
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 0C7DA1065678;
	Wed, 12 May 2010 14:20:49 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id C11478FC21;
	Wed, 12 May 2010 14:20:48 +0000 (UTC)
Received: from [192.168.0.102] (m206-63.dsl.tsoft.com [198.144.206.63])
	by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o4CEKlvt098002;
	Wed, 12 May 2010 07:20:48 -0700 (PDT) (envelope-from mj@feral.com)
Message-ID: <4BEAB941.1000009@feral.com>
Date: Wed, 12 May 2010 07:20:49 -0700
From: Matthew Jacob 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: Ronald Klop 
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3
	(ns1.feral.com [192.67.166.1]);
	Wed, 12 May 2010 07:20:48 -0700 (PDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Matt Jacob 
Subject: Re: svn commit: r207933 - 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, 12 May 2010 14:20:49 -0000

  Ow. No need to be rude :-).

No, I didn't, why do you ask?

> Wow, did you copy this from windows? :-)


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 14:23:46 2010
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 C62CC1065679;
	Wed, 12 May 2010 14:23:46 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id 6BF9E8FC1B;
	Wed, 12 May 2010 14:23:46 +0000 (UTC)
Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57])
	(authenticated bits=0)
	by pooker.samsco.org (8.14.3/8.14.3) with ESMTP id o4CENdUK032676;
	Wed, 12 May 2010 08:23:40 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Scott Long 
In-Reply-To: <4BEAB941.1000009@feral.com>
Date: Wed, 12 May 2010 08:23:39 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	
	<4BEAB941.1000009@feral.com>
To: Matthew Jacob 
X-Mailer: Apple Mail (2.1078)
X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org
Cc: svn-src-head@FreeBSD.org, Ronald Klop ,
	src-committers@FreeBSD.org, Matt Jacob ,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r207933 - 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, 12 May 2010 14:23:46 -0000

On May 12, 2010, at 8:20 AM, Matthew Jacob wrote:
> Ow. No need to be rude :-).
>=20
> No, I didn't, why do you ask?
>=20
>> Wow, did you copy this from windows? :-)
>=20

Actually I'm impressed that someone is using my code.  I wrote it on a =
dare to see just how horrid the linux SG interface really is, and I =
wasn't disappointed.

Scott


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 14:29:23 2010
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 81A3A1065679;
	Wed, 12 May 2010 14:29:23 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DE6A8FC21;
	Wed, 12 May 2010 14:29:23 +0000 (UTC)
Received: from [192.168.0.102] (m206-63.dsl.tsoft.com [198.144.206.63])
	by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o4CETMcw098076;
	Wed, 12 May 2010 07:29:22 -0700 (PDT) (envelope-from mj@feral.com)
Message-ID: <4BEABB45.8030401@feral.com>
Date: Wed, 12 May 2010 07:29:25 -0700
From: Matthew Jacob 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: Scott Long 
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	
	<4BEAB941.1000009@feral.com>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3
	(ns1.feral.com [192.67.166.1]);
	Wed, 12 May 2010 07:29:22 -0700 (PDT)
Cc: svn-src-head@FreeBSD.org, Ronald Klop ,
	src-committers@FreeBSD.org, Matt Jacob ,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r207933 - 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, 12 May 2010 14:29:23 -0000

On 5/12/2010 7:23 AM, Scott Long wrote:
> On May 12, 2010, at 8:20 AM, Matthew Jacob wrote:
>    
>> Ow. No need to be rude :-).
>>
>> No, I didn't, why do you ask?
>>
>>      
>>> Wow, did you copy this from windows? :-)
>>>        
>>      
> Actually I'm impressed that someone is using my code.  I wrote it on a dare to see just how horrid the linux SG interface really is, and I wasn't disappointed.
>
> Scott
>
>    
It turns out that Panasas is using the Java bundle from LSI on FreeBSD 
for Santricity management. It opens /dev/sg**. There's a change 
somewhere else to manage some 64 and 32 bit compatibility issues I'm 
going to pull in.

No matter how bad Linux can be in many respects, it has market share, 
and it benefits freebsd to be able to support tools, no matter how 
broken, from that platform.

The reason I also hit this situation is my virtual fake HBA has one test 
mode where it creates 2000 da devices. That's why I found this funny one 
for sg.
And, it turns out, this is not just a cosmetic issue.


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 14:35:33 2010
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 A4B8A106564A;
	Wed, 12 May 2010 14:35:33 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id 416628FC0A;
	Wed, 12 May 2010 14:35:33 +0000 (UTC)
Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57])
	(authenticated bits=0)
	by pooker.samsco.org (8.14.3/8.14.3) with ESMTP id o4CEZTnD032761;
	Wed, 12 May 2010 08:35:29 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Scott Long 
In-Reply-To: <4BEABB45.8030401@feral.com>
Date: Wed, 12 May 2010 08:35:29 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <9039EF21-1DAA-445F-95D5-02CB6E0DDF7D@samsco.org>
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	
	<4BEAB941.1000009@feral.com>
	
	<4BEABB45.8030401@feral.com>
To: Matthew Jacob 
X-Mailer: Apple Mail (2.1078)
X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org
Cc: svn-src-head@FreeBSD.org, Ronald Klop ,
	src-committers@FreeBSD.org, Matt Jacob ,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r207933 - 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, 12 May 2010 14:35:33 -0000


On May 12, 2010, at 8:29 AM, Matthew Jacob wrote:

> On 5/12/2010 7:23 AM, Scott Long wrote:
>> On May 12, 2010, at 8:20 AM, Matthew Jacob wrote:
>>  =20
>>> Ow. No need to be rude :-).
>>>=20
>>> No, I didn't, why do you ask?
>>>=20
>>>    =20
>>>> Wow, did you copy this from windows? :-)
>>>>      =20
>>>    =20
>> Actually I'm impressed that someone is using my code.  I wrote it on =
a dare to see just how horrid the linux SG interface really is, and I =
wasn't disappointed.
>>=20
>> Scott
>>=20
>>  =20
> It turns out that Panasas is using the Java bundle from LSI on FreeBSD =
for Santricity management. It opens /dev/sg**. There's a change =
somewhere else to manage some 64 and 32 bit compatibility issues I'm =
going to pull in.
>=20
> No matter how bad Linux can be in many respects, it has market share, =
and it benefits freebsd to be able to support tools, no matter how =
broken, from that platform.
>=20

Yup, and that's exactly why I checked it into the tree instead of =
burning it while performing pagan dances under a full moon =3D-)

> The reason I also hit this situation is my virtual fake HBA has one =
test mode where it creates 2000 da devices. That's why I found this =
funny one for sg.
> And, it turns out, this is not just a cosmetic issue.
>=20

Thanks for taking an interest in it and fixing bugs.

Scott


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 15:47:43 2010
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 685E81065673;
	Wed, 12 May 2010 15:47:43 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 582528FC1C;
	Wed, 12 May 2010 15:47:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CFlhBC051301;
	Wed, 12 May 2010 15:47:43 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CFlhtF051299;
	Wed, 12 May 2010 15:47:43 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121547.o4CFlhtF051299@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 15:47: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: r207964 - head/sbin/kldstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 15:47:43 -0000

Author: brueffer
Date: Wed May 12 15:47:43 2010
New Revision: 207964
URL: http://svn.freebsd.org/changeset/base/207964

Log:
  Casting size_t to uintmax_t is not necessary anymore. This also
  removes the need for stdint.h inclusion.
  
  PR:		146046
  Submitted by:	Alexander Best 
  Reviewed by:	kan
  MFC after:	1 week

Modified:
  head/sbin/kldstat/kldstat.c

Modified: head/sbin/kldstat/kldstat.c
==============================================================================
--- head/sbin/kldstat/kldstat.c	Wed May 12 13:45:46 2010	(r207963)
+++ head/sbin/kldstat/kldstat.c	Wed May 12 15:47:43 2010	(r207964)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -60,8 +59,8 @@ static void printfile(int fileid, int ve
     if (kldstat(fileid, &stat) < 0)
 	warn("can't stat file id %d", fileid);
     else
-	printf("%2d %4d %p %-8jx %s",
-	       stat.id, stat.refs, stat.address, (uintmax_t)stat.size, 
+	printf("%2d %4d %p %-8zx %s",
+	       stat.id, stat.refs, stat.address, stat.size, 
 	       stat.name);
 
     if (verbose) {

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 16:10:33 2010
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 BEA6F1065673;
	Wed, 12 May 2010 16:10:33 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id AE9C48FC16;
	Wed, 12 May 2010 16:10:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CGAXkE056601;
	Wed, 12 May 2010 16:10:33 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CGAXp5056598;
	Wed, 12 May 2010 16:10:33 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201005121610.o4CGAXp5056598@svn.freebsd.org>
From: Michael Tuexen 
Date: Wed, 12 May 2010 16:10: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: r207966 - 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: Wed, 12 May 2010 16:10:33 -0000

Author: tuexen
Date: Wed May 12 16:10:33 2010
New Revision: 207966
URL: http://svn.freebsd.org/changeset/base/207966

Log:
  Get rid of unused constants.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_constants.h
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_constants.h
==============================================================================
--- head/sys/netinet/sctp_constants.h	Wed May 12 16:01:48 2010	(r207965)
+++ head/sys/netinet/sctp_constants.h	Wed May 12 16:10:33 2010	(r207966)
@@ -361,14 +361,6 @@ __FBSDID("$FreeBSD$");
 						 * hit this value) */
 #define SCTP_DATAGRAM_RESEND		4
 #define SCTP_DATAGRAM_ACKED		10010
-/* EY
- * If a tsn is nr-gapped, its first tagged as NR_MARKED and then NR_ACKED
- * When yet another nr-sack is received, if a particular TSN's sent tag
- * is observed to be NR_ACKED after gap-ack info is processed, this implies
- * that particular TSN is reneged
-*/
-#define SCTP_DATAGRAM_NR_ACKED 		10020
-#define SCTP_DATAGRAM_NR_MARKED		20005
 #define SCTP_DATAGRAM_MARKED		20010
 #define SCTP_FORWARD_TSN_SKIP		30010
 

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Wed May 12 16:01:48 2010	(r207965)
+++ head/sys/netinet/sctp_indata.c	Wed May 12 16:10:33 2010	(r207966)
@@ -4917,14 +4917,6 @@ done_with_it:
 		if (tp1 != NULL) {
 			/* Peer revoked all dg's marked or acked */
 			TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) {
-				/*
-				 * EY- maybe check only if it is nr_acked
-				 * nr_marked may not be possible
-				 */
-				if ((tp1->sent == SCTP_DATAGRAM_NR_ACKED) ||
-				    (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) {
-					continue;
-				}
 				if (tp1->sent == SCTP_DATAGRAM_ACKED) {
 					tp1->sent = SCTP_DATAGRAM_SENT;
 					if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 16:42:28 2010
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 A890B1065670;
	Wed, 12 May 2010 16:42:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 9863F8FC0C;
	Wed, 12 May 2010 16:42:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CGgSlu063843;
	Wed, 12 May 2010 16:42:28 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CGgS8h063841;
	Wed, 12 May 2010 16:42:28 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201005121642.o4CGgS8h063841@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 12 May 2010 16:42:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207970 - 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, 12 May 2010 16:42:28 -0000

Author: pjd
Date: Wed May 12 16:42:28 2010
New Revision: 207970
URL: http://svn.freebsd.org/changeset/base/207970

Log:
  When there is no memory or KVA, try to help by reclaiming some vnodes.
  This helps with 'kmem_map too small' panics.
  
  No objections from:	kib
  Tested by:		Alexander V. Ribchansky 
  MFC after:		1 week

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed May 12 16:28:41 2010	(r207969)
+++ head/sys/kern/vfs_subr.c	Wed May 12 16:42:28 2010	(r207970)
@@ -821,6 +821,19 @@ static struct kproc_desc vnlru_kp = {
 };
 SYSINIT(vnlru, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start,
     &vnlru_kp);
+ 
+static void
+vfs_lowmem(void *arg __unused)
+{
+
+	/*
+	 * On low memory condition free 1/8th of the free vnodes.
+	 */
+	mtx_lock(&vnode_free_list_mtx);
+	vnlru_free(freevnodes / 8);
+	mtx_unlock(&vnode_free_list_mtx);
+}
+EVENTHANDLER_DEFINE(vm_lowmem, vfs_lowmem, NULL, 0);
 
 /*
  * Routines having to do with the management of the vnode table.

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 16:59:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5693B106566B;
	Wed, 12 May 2010 16:59:59 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C2258FC0A;
	Wed, 12 May 2010 16:59:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CGxwKJ067687;
	Wed, 12 May 2010 16:59:58 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CGxwCt067685;
	Wed, 12 May 2010 16:59:58 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005121659.o4CGxwCt067685@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 12 May 2010 16:59: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: r207971 - head/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 16:59:59 -0000

Author: yongari
Date: Wed May 12 16:59:58 2010
New Revision: 207971
URL: http://svn.freebsd.org/changeset/base/207971

Log:
  Document undocumented tunables and sysctl variables.
  While here use actual string to specify width as well as using Cm
  to set command argument.
  
  Reviewed by:	brueffer

Modified:
  head/share/man/man4/fxp.4

Modified: head/share/man/man4/fxp.4
==============================================================================
--- head/share/man/man4/fxp.4	Wed May 12 16:42:28 2010	(r207970)
+++ head/share/man/man4/fxp.4	Wed May 12 16:59:58 2010	(r207971)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 15, 2008
+.Dd May 12, 2010
 .Dt FXP 4
 .Os
 .Sh NAME
@@ -62,23 +62,25 @@ except i82557, i82259ER and early i82558
 The
 .Nm
 driver supports the following media types:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It autoselect
-Enable autoselection of the media type and options
-.It 10baseT/UTP
-Set 10Mbps operation
-.It 100baseTX
-Set 100Mbps (Fast Ethernet) operation
+.Bl -tag -width "10baseT/UTP"
+.It Cm autoselect
+Enable autoselection of the media type and options.
+The autoselected mode can be overridden by adding the media options to
+.Xr rc.conf 5 .
+.It Cm 10baseT/UTP
+Set 10Mbps operation.
+.It Cm 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
 .El
 .Pp
 The
 .Nm
 driver supports the following media options:
-.Pp
-.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
-.It full-duplex
-Set full duplex operation
+.Bl -tag -width "full-duplex"
+.It Cm full-duplex
+Force full duplex operation.
+.It Cm half-duplex
+Force half duplex operation.
 .El
 .Pp
 Note that 100baseTX media type is not available on the Pro/10.
@@ -143,6 +145,43 @@ NEC PC-9821X-B06 (PC-98)
 .It
 Many on-board network interfaces on Intel motherboards
 .El
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+The following variables are available as both
+.Xr loader 8
+tunables and
+.Xr sysctl 8
+variables:
+.Bl -tag -width "xxxxxx"
+.It Va dev.fxp.%d.int_delay
+Maximum amount of time, in microseconds, that an interrupt may
+be delayed in an attempt to coalesce interrupts.
+This is only effective if the Intel microcode is loaded.
+The accepted range is 300 to 3000, the default is 1000.
+.It Va dev.fxp.%d.bundle_max
+Number of packets that will be bundled, before an interrupt is
+generated.
+This is only effective if the Intel microcode is loaded.
+The accepted range is 1 to 65535, the default is 6.
+.It Va dev.fxp.%d.noflow
+Controls whether flow control should be used or not.
+The default is 1 (no flow control).
+.El
+.Sh SYSCTL VARIABLES
+The following variables are available as
+.Xr sysctl 8
+variables.
+.Bl -tag -width "xxxxxx"
+.It Va dev.fxp.%d.rnr
+This is a read-only variable and shows the number of events of
+RNR (resource not ready).
+.It Va dev.fxp.%d.stats
+This is a read-only variable and displays useful MAC counters
+maintained in the driver.
+.El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "fxp%d: couldn't map memory"

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:07:20 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 615CA106564A;
	Wed, 12 May 2010 17:07:20 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4FE4C8FC1B;
	Wed, 12 May 2010 17:07:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CH7Jal069360;
	Wed, 12 May 2010 17:07:19 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CH7JuV069358;
	Wed, 12 May 2010 17:07:19 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005121707.o4CH7JuV069358@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 12 May 2010 17:07:19 +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: r207972 - stable/8/sys/dev/fxp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 17:07:20 -0000

Author: yongari
Date: Wed May 12 17:07:19 2010
New Revision: 207972
URL: http://svn.freebsd.org/changeset/base/207972

Log:
  MFC r207748:
    It seems controller has two types of promiscuous control, one for
    unicast and the other for multicast. To receive multicast frames
    that host didn't join in promiscuous mode, driver have to set
    promiscuous mode for multicast frames as well.
    The Open Source Software Developer Manual for i8255x was not clear
    how to handle promiscuous mode.
  
    PR:		kern/145905

Modified:
  stable/8/sys/dev/fxp/if_fxp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/8/sys/dev/fxp/if_fxp.c	Wed May 12 16:59:58 2010	(r207971)
+++ stable/8/sys/dev/fxp/if_fxp.c	Wed May 12 17:07:19 2010	(r207972)
@@ -2345,7 +2345,7 @@ fxp_init_body(struct fxp_softc *sc)
 	cbp->force_fdx =	0;	/* (don't) force full duplex */
 	cbp->fdx_pin_en =	1;	/* (enable) FDX# pin */
 	cbp->multi_ia =		0;	/* (don't) accept multiple IAs */
-	cbp->mc_all =		ifp->if_flags & IFF_ALLMULTI ? 1 : 0;
+	cbp->mc_all =		ifp->if_flags & IFF_ALLMULTI ? 1 : prm;
 	cbp->gamla_rx =		sc->flags & FXP_FLAG_EXT_RFA ? 1 : 0;
 	cbp->vlan_strip_en =	((sc->flags & FXP_FLAG_EXT_RFA) != 0 &&
 	    (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) ? 1 : 0;

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:12:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E9531065673;
	Wed, 12 May 2010 17:12:39 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E4D18FC1B;
	Wed, 12 May 2010 17:12:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHCd9K070652;
	Wed, 12 May 2010 17:12:39 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHCdK4070650;
	Wed, 12 May 2010 17:12:39 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121712.o4CHCdK4070650@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 17:12: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: r207975 - head/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 17:12:39 -0000

Author: brueffer
Date: Wed May 12 17:12:38 2010
New Revision: 207975
URL: http://svn.freebsd.org/changeset/base/207975

Log:
  IBM ServeRAID M5015 SAS/SATA works.
  
  PR:		144614
  Submitted by:	pluknet 
  MFC after:	1 week

Modified:
  head/share/man/man4/mfi.4

Modified: head/share/man/man4/mfi.4
==============================================================================
--- head/share/man/man4/mfi.4	Wed May 12 17:11:38 2010	(r207974)
+++ head/share/man/man4/mfi.4	Wed May 12 17:12:38 2010	(r207975)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 2, 2010
+.Dd May 12, 2010
 .Dt MFI 4
 .Os
 .Sh NAME
@@ -91,6 +91,8 @@ Dell PERC5
 .It
 Dell PERC6
 .It
+IBM ServeRAID M5015 SAS/SATA
+.It
 IBM ServeRAID-MR10i
 .It
 Intel RAID Controller SROMBSAS18E

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:12:48 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C2F21065769;
	Wed, 12 May 2010 17:12:48 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1AA8C8FC19;
	Wed, 12 May 2010 17:12:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHCmsd070721;
	Wed, 12 May 2010 17:12:48 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHClHZ070719;
	Wed, 12 May 2010 17:12:47 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005121712.o4CHClHZ070719@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 12 May 2010 17:12:47 +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: r207976 - stable/7/sys/dev/fxp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 17:12:48 -0000

Author: yongari
Date: Wed May 12 17:12:47 2010
New Revision: 207976
URL: http://svn.freebsd.org/changeset/base/207976

Log:
  MFC r207748:
    It seems controller has two types of promiscuous control, one for
    unicast and the other for multicast. To receive multicast frames
    that host didn't join in promiscuous mode, driver have to set
    promiscuous mode for multicast frames as well.
    The Open Source Software Developer Manual for i8255x was not clear
    how to handle promiscuous mode.
  
    PR:		kern/145905

Modified:
  stable/7/sys/dev/fxp/if_fxp.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/7/sys/dev/fxp/if_fxp.c	Wed May 12 17:12:38 2010	(r207975)
+++ stable/7/sys/dev/fxp/if_fxp.c	Wed May 12 17:12:47 2010	(r207976)
@@ -2339,7 +2339,7 @@ fxp_init_body(struct fxp_softc *sc)
 	cbp->force_fdx =	0;	/* (don't) force full duplex */
 	cbp->fdx_pin_en =	1;	/* (enable) FDX# pin */
 	cbp->multi_ia =		0;	/* (don't) accept multiple IAs */
-	cbp->mc_all =		ifp->if_flags & IFF_ALLMULTI ? 1 : 0;
+	cbp->mc_all =		ifp->if_flags & IFF_ALLMULTI ? 1 : prm;
 	cbp->gamla_rx =		sc->flags & FXP_FLAG_EXT_RFA ? 1 : 0;
 	cbp->vlan_strip_en =	((sc->flags & FXP_FLAG_EXT_RFA) != 0 &&
 	    (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) ? 1 : 0;

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:18:07 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9FD50106566B;
	Wed, 12 May 2010 17:18:07 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8ED6B8FC14;
	Wed, 12 May 2010 17:18:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHI7Gn071919;
	Wed, 12 May 2010 17:18:07 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHI7eP071917;
	Wed, 12 May 2010 17:18:07 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005121718.o4CHI7eP071917@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 12 May 2010 17:18:07 +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: r207977 - stable/8/sys/dev/re
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 17:18:07 -0000

Author: yongari
Date: Wed May 12 17:18:07 2010
New Revision: 207977
URL: http://svn.freebsd.org/changeset/base/207977

Log:
  MFC r207763:
    Don't change PCIe maximum read request size to 2048 on RTL810x
    controllers. It caused device timeouts.
  
    Reported by:	McLone < mclone <> gmail dot com >
    Tested by:	McLone < mclone <> gmail dot com >

Modified:
  stable/8/sys/dev/re/if_re.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/re/if_re.c
==============================================================================
--- stable/8/sys/dev/re/if_re.c	Wed May 12 17:12:47 2010	(r207976)
+++ stable/8/sys/dev/re/if_re.c	Wed May 12 17:18:07 2010	(r207977)
@@ -1162,9 +1162,11 @@ re_attach(device_t dev)
 	msic = 0;
 	if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) {
 		sc->rl_flags |= RL_FLAG_PCIE;
-		/* Set PCIe maximum read request size to 2048. */
-		if (pci_get_max_read_req(dev) < 2048)
-			pci_set_max_read_req(dev, 2048);
+		if (devid != RT_DEVICEID_8101E) {
+			/* Set PCIe maximum read request size to 2048. */
+			if (pci_get_max_read_req(dev) < 2048)
+				pci_set_max_read_req(dev, 2048);
+		}
 		msic = pci_msi_count(dev);
 		if (bootverbose)
 			device_printf(dev, "MSI count : %d\n", msic);

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:22:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E9AC106566C;
	Wed, 12 May 2010 17:22:11 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E2208FC1D;
	Wed, 12 May 2010 17:22:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHMBmR072864;
	Wed, 12 May 2010 17:22:11 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHMB5k072862;
	Wed, 12 May 2010 17:22:11 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201005121722.o4CHMB5k072862@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 12 May 2010 17:22:11 +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: r207978 - stable/8/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: Wed, 12 May 2010 17:22:11 -0000

Author: jh
Date: Wed May 12 17:22:11 2010
New Revision: 207978
URL: http://svn.freebsd.org/changeset/base/207978

Log:
  MFC r203757:
  
  - Remove reference to nfs4. mount_nfs4(8) was removed in r192578.
  - Add newnfs.

Modified:
  stable/8/sbin/mount/mount.8
Directory Properties:
  stable/8/sbin/mount/   (props changed)

Modified: stable/8/sbin/mount/mount.8
==============================================================================
--- stable/8/sbin/mount/mount.8	Wed May 12 17:18:07 2010	(r207977)
+++ stable/8/sbin/mount/mount.8	Wed May 12 17:22:11 2010	(r207978)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd March 11, 2008
+.Dd February 10, 2010
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -433,8 +433,8 @@ However, for the following file system t
 .Cm cd9660 ,
 .Cm mfs ,
 .Cm msdosfs ,
+.Cm newnfs ,
 .Cm nfs ,
-.Cm nfs4 ,
 .Cm ntfs ,
 .Cm nwfs ,
 .Cm nullfs ,

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:30:47 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E3C11065676;
	Wed, 12 May 2010 17:30:47 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5DFF18FC1B;
	Wed, 12 May 2010 17:30:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHUlm2074831;
	Wed, 12 May 2010 17:30:47 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHUlgp074829;
	Wed, 12 May 2010 17:30:47 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121730.o4CHUlgp074829@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 17:30: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: r207979 - head/sys/modules
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 17:30:47 -0000

Author: brueffer
Date: Wed May 12 17:30:46 2010
New Revision: 207979
URL: http://svn.freebsd.org/changeset/base/207979

Log:
  Build the ixgbe(4) and mwlfw(4) modules by default.
  
  PR:		144494
  Submitted by:	John Giacomoni , brucec

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Wed May 12 17:22:11 2010	(r207978)
+++ head/sys/modules/Makefile	Wed May 12 17:30:46 2010	(r207979)
@@ -144,6 +144,7 @@ SUBDIR=	${_3dfx} \
 	${_iwn} \
 	${_iwnfw} \
 	${_ixgb} \
+	${_ixgbe} \
 	jme \
 	joy \
 	kbdmux \
@@ -190,6 +191,7 @@ SUBDIR=	${_3dfx} \
 	msk \
 	mvs \
 	mwl \
+	mwlfw \
 	mxge \
 	my \
 	${_ncp} \
@@ -465,6 +467,7 @@ _iwifw=		iwifw
 _iwn=		iwn
 _iwnfw=		iwnfw
 _ixgb=		ixgb
+_ixgbe=		ixgbe
 _mly=		mly
 _nfe=		nfe
 _nve=		nve
@@ -537,6 +540,7 @@ _iwifw=		iwifw
 _iwn=		iwn
 _iwnfw=		iwnfw
 _ixgb=		ixgb
+_ixgbe=		ixgbe
 _lindev=	lindev
 _linprocfs=	linprocfs
 _linsysfs=	linsysfs

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:34:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B447E1065674;
	Wed, 12 May 2010 17:34:51 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A32C28FC1A;
	Wed, 12 May 2010 17:34:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHYpEj075772;
	Wed, 12 May 2010 17:34:51 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHYphQ075770;
	Wed, 12 May 2010 17:34:51 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005121734.o4CHYphQ075770@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 12 May 2010 17:34:51 +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: r207980 - stable/7/sys/dev/re
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 17:34:51 -0000

Author: yongari
Date: Wed May 12 17:34:51 2010
New Revision: 207980
URL: http://svn.freebsd.org/changeset/base/207980

Log:
  MFC r207763:
    Don't change PCIe maximum read request size to 2048 on RTL810x
    controllers. It caused device timeouts.
  
    Reported by:	McLone < mclone <> gmail dot com >
    Tested by:	McLone < mclone <> gmail dot com >

Modified:
  stable/7/sys/dev/re/if_re.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/re/if_re.c
==============================================================================
--- stable/7/sys/dev/re/if_re.c	Wed May 12 17:30:46 2010	(r207979)
+++ stable/7/sys/dev/re/if_re.c	Wed May 12 17:34:51 2010	(r207980)
@@ -1163,9 +1163,11 @@ re_attach(device_t dev)
 	msic = 0;
 	if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) {
 		sc->rl_flags |= RL_FLAG_PCIE;
-		/* Set PCIe maximum read request size to 2048. */
-		if (pci_get_max_read_req(dev) < 2048)
-			pci_set_max_read_req(dev, 2048);
+		if (devid != RT_DEVICEID_8101E) {
+			/* Set PCIe maximum read request size to 2048. */
+			if (pci_get_max_read_req(dev) < 2048)
+				pci_set_max_read_req(dev, 2048);
+		}
 		msic = pci_msi_count(dev);
 		if (bootverbose)
 			device_printf(dev, "MSI count : %d\n", msic);

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:44:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 97D831065673;
	Wed, 12 May 2010 17:44:00 +0000 (UTC)
	(envelope-from gordon@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8788D8FC18;
	Wed, 12 May 2010 17:44:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHi0Zh077968;
	Wed, 12 May 2010 17:44:00 GMT (envelope-from gordon@svn.freebsd.org)
Received: (from gordon@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHi02M077966;
	Wed, 12 May 2010 17:44:00 GMT (envelope-from gordon@svn.freebsd.org)
Message-Id: <201005121744.o4CHi02M077966@svn.freebsd.org>
From: Gordon Tetlow 
Date: Wed, 12 May 2010 17:44: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: r207981 - head/lib/libc/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: Wed, 12 May 2010 17:44:00 -0000

Author: gordon
Date: Wed May 12 17:44:00 2010
New Revision: 207981
URL: http://svn.freebsd.org/changeset/base/207981

Log:
  Fix a bug due to a type conversion from 64 to 32 bits. The side effect of
  this type conversion is the high bits which were used to indicate if a
  special character was a literal or special were dropped. As a result, all
  special character were treated as special, even if they were supposed to
  be literals.
  
  Reviewed by:	gad@
  Approved by:	mentor (wes@)

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==============================================================================
--- head/lib/libc/gen/glob.c	Wed May 12 17:34:51 2010	(r207980)
+++ head/lib/libc/gen/glob.c	Wed May 12 17:44:00 2010	(r207981)
@@ -433,9 +433,9 @@ static int
 glob0(const Char *pattern, glob_t *pglob, size_t *limit)
 {
 	const Char *qpatnext;
-	int c, err;
+	int err;
 	size_t oldpathc;
-	Char *bufnext, patbuf[MAXPATHLEN];
+	Char *bufnext, c, patbuf[MAXPATHLEN];
 
 	qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
 	oldpathc = pglob->gl_pathc;

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 17:53:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29CB81065676;
	Wed, 12 May 2010 17:53:06 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1909F8FC16;
	Wed, 12 May 2010 17:53:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CHr5GK080049;
	Wed, 12 May 2010 17:53:05 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CHr5J2080047;
	Wed, 12 May 2010 17:53:05 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121753.o4CHr5J2080047@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 17:53:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r207982 - head/release/doc/en_US.ISO8859-1/hardware
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 17:53:06 -0000

Author: brueffer
Date: Wed May 12 17:53:05 2010
New Revision: 207982
URL: http://svn.freebsd.org/changeset/base/207982

Log:
  Add et(4), sge(4) and mwl(4).

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Wed May 12 17:44:00 2010	(r207981)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Wed May 12 17:53:05 2010	(r207982)
@@ -842,6 +842,8 @@
 
       &hwlist.ep;
 
+      &hwlist.et;
+
       &hwlist.ex;
 
       &hwlist.fe;
@@ -890,6 +892,8 @@
 
       &hwlist.sf;
 
+      &hwlist.sge;
+
       &hwlist.sis;
 
       &hwlist.sk;
@@ -981,6 +985,9 @@
       [&arch.i386;, &arch.amd64;] Marvell Libertas IEEE 802.11b/g
         PCI network adapters (&man.malo.4; driver)
 
+      Marvell 88W8363 IEEE 802.11n wireless network
+	adapters (&man.mwl.4; driver)
+
       &hwlist.ral;
 
       &hwlist.rum;

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 18:00:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B767F1065672;
	Wed, 12 May 2010 18:00:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8A7368FC22;
	Wed, 12 May 2010 18:00:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CI0FQ8081695;
	Wed, 12 May 2010 18:00:15 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CI0Fwq081692;
	Wed, 12 May 2010 18:00:15 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201005121800.o4CI0Fwq081692@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 12 May 2010 18:00: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: r207983 - 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: Wed, 12 May 2010 18:00:15 -0000

Author: rrs
Date: Wed May 12 18:00:15 2010
New Revision: 207983
URL: http://svn.freebsd.org/changeset/base/207983

Log:
  More PR-SCTP bugs:
    - Make sure that when you kick the streams you add correctly
      using a 16 bit unsigned.
    - Make sure when sending out you allow FWD-TSN to skip over
      and list the ACKED chunks in the stream/seq list (so the
      rcv will kick the stream)
  MFC after:	3 days

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Wed May 12 17:53:05 2010	(r207982)
+++ head/sys/netinet/sctp_indata.c	Wed May 12 18:00:15 2010	(r207983)
@@ -3750,7 +3750,8 @@ sctp_try_advance_peer_ack_point(struct s
 		 * the chunk, advance our peer ack point and we can check
 		 * the next chunk.
 		 */
-		if (tp1->sent == SCTP_FORWARD_TSN_SKIP) {
+		if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) ||
+		    (tp1->sent == SCTP_DATAGRAM_ACKED)) {
 			/* advance PeerAckPoint goes forward */
 			if (compare_with_wrap(tp1->rec.data.TSN_seq,
 			    asoc->advanced_peer_ack_point,
@@ -5351,7 +5352,7 @@ sctp_kick_prsctp_reorder_queue(struct sc
 {
 	struct sctp_queued_to_read *ctl, *nctl;
 	struct sctp_association *asoc;
-	int tt;
+	uint16_t tt;
 
 	asoc = &stcb->asoc;
 	tt = strmin->last_sequence_delivered;

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Wed May 12 17:53:05 2010	(r207982)
+++ head/sys/netinet/sctp_output.c	Wed May 12 18:00:15 2010	(r207983)
@@ -9707,7 +9707,6 @@ send_forward_tsn(struct sctp_tcb *stcb,
 	chk->rec.chunk_id.can_take_data = 0;
 	chk->asoc = asoc;
 	chk->whoTo = NULL;
-
 	chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA);
 	if (chk->data == NULL) {
 		sctp_free_a_chunk(stcb, chk);
@@ -9734,7 +9733,8 @@ sctp_fill_in_rest:
 		unsigned int cnt_of_skipped = 0;
 
 		TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) {
-			if (at->sent != SCTP_FORWARD_TSN_SKIP) {
+			if ((at->sent != SCTP_FORWARD_TSN_SKIP) &&
+			    (at->sent != SCTP_DATAGRAM_ACKED)) {
 				/* no more to look at */
 				break;
 			}

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 18:12:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 267C6106564A;
	Wed, 12 May 2010 18:12:54 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15])
	by mx1.freebsd.org (Postfix) with ESMTP id D43888FC12;
	Wed, 12 May 2010 18:12:53 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.71) (envelope-from )
	id 1OCGQM-0000Oq-Ug; Wed, 12 May 2010 22:12:51 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 7A541B84D;
	Wed, 12 May 2010 22:12:50 +0400 (MSD)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 65B6FB829; Wed, 12 May 2010 22:12:50 +0400 (MSD)
Date: Wed, 12 May 2010 22:12:50 +0400
From: Dmitry Marakasov 
To: Matt Jacob 
Message-ID: <20100512181250.GB497@hades.panopticon>
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <201005112222.o4BMM1uq012874@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207933 - 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, 12 May 2010 18:12:54 -0000

* Matt Jacob (mjacob@FreeBSD.org) wrote:

> -	(void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number);
> +	if (periph->unit_number < 26) {
> +		(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
> +	} else {
> +		(void)make_dev_alias(softc->dev, "sg%c%c",
> +		    ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a');

		    ((periph->unit_number / 26) - 1) + 'a', (periph->unit_number % 26) + 'a');

No?

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 18:18:48 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99105106564A;
	Wed, 12 May 2010 18:18:48 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 70A1F8FC08;
	Wed, 12 May 2010 18:18:48 +0000 (UTC)
Received: from [192.168.221.2] (remotevpn [192.168.221.2])
	by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o4CIIenj000562
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 12 May 2010 11:18:40 -0700 (PDT) (envelope-from mj@feral.com)
Message-ID: <4BEAF100.5020500@feral.com>
Date: Wed, 12 May 2010 11:18:40 -0700
From: Matthew Jacob 
Organization: Feral Software
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Thunderbird/3.0.4
MIME-Version: 1.0
To: Dmitry Marakasov 
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	<20100512181250.GB497@hades.panopticon>
In-Reply-To: <20100512181250.GB497@hades.panopticon>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3
	(ns1.feral.com [192.168.221.1]);
	Wed, 12 May 2010 11:18:41 -0700 (PDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Matt Jacob 
Subject: Re: svn commit: r207933 - head/sys/cam/scsi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: mj@feral.com
List-Id: "SVN commit messages 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, 12 May 2010 18:18:48 -0000

On 05/12/2010 11:12 AM, Dmitry Marakasov wrote:
> * Matt Jacob (mjacob@FreeBSD.org) wrote:
>
>    
>> -	(void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number);
>> +	if (periph->unit_number<  26) {
>> +		(void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a');
>> +	} else {
>> +		(void)make_dev_alias(softc->dev, "sg%c%c",
>> +		    ((periph->unit_number / 26) - 1) + 'a', periph->unit_number + 'a');
>>      
> 		((periph->unit_number / 26) - 1) + 'a', (periph->unit_number % 26) + 'a');
>
> No?
>
>    
yes, yes, the followup change corrected my pulling the wrong patch
thx


From owner-svn-src-all@FreeBSD.ORG  Wed May 12 18:33:26 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E14D106564A;
	Wed, 12 May 2010 18:33:26 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F22288FC0C;
	Wed, 12 May 2010 18:33:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CIXPcc089137;
	Wed, 12 May 2010 18:33:25 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CIXPHH089135;
	Wed, 12 May 2010 18:33:25 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <201005121833.o4CIXPHH089135@svn.freebsd.org>
From: Randall Stewart 
Date: Wed, 12 May 2010 18:33: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: r207985 - 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: Wed, 12 May 2010 18:33:26 -0000

Author: rrs
Date: Wed May 12 18:33:25 2010
New Revision: 207985
URL: http://svn.freebsd.org/changeset/base/207985

Log:
  Fix an old long time bug in generating a
  fwd-tsn. This would appear when greater than
  the size of mbuf TSN's would need to be skipped.
  
  MFC after:	3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Wed May 12 18:16:08 2010	(r207984)
+++ head/sys/netinet/sctp_output.c	Wed May 12 18:33:25 2010	(r207985)
@@ -9775,9 +9775,8 @@ sctp_fill_in_rest:
 				    0xff, 0xff, cnt_of_space,
 				    space_needed);
 			}
-			cnt_of_skipped = (cnt_of_space -
-			    ((sizeof(struct sctp_forward_tsn_chunk)) /
-			    sizeof(struct sctp_strseq)));
+			cnt_of_skipped = cnt_of_space - sizeof(struct sctp_forward_tsn_chunk);
+			cnt_of_skipped /= sizeof(struct sctp_strseq);
 			/*-
 			 * Go through and find the TSN that will be the one
 			 * we report.

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 19:20:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA3831065676;
	Wed, 12 May 2010 19:20:32 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DA3B28FC17;
	Wed, 12 May 2010 19:20:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CJKWYq099789;
	Wed, 12 May 2010 19:20:32 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CJKWTs099787;
	Wed, 12 May 2010 19:20:32 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121920.o4CJKWTs099787@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 19:20: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: r207990 - head/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 19:20:33 -0000

Author: brueffer
Date: Wed May 12 19:20:32 2010
New Revision: 207990
URL: http://svn.freebsd.org/changeset/base/207990

Log:
  Make this ready for automatic hardware notes generation.

Modified:
  head/share/man/man4/run.4

Modified: head/share/man/man4/run.4
==============================================================================
--- head/share/man/man4/run.4	Wed May 12 19:20:03 2010	(r207989)
+++ head/share/man/man4/run.4	Wed May 12 19:20:32 2010	(r207990)
@@ -98,7 +98,9 @@ driver can be configured at runtime with
 or on boot with
 .Xr hostname.if 5 .
 .Sh HARDWARE
-The following adapters should work:
+The 
+.Nm
+driver supports the following wireless adapters:
 .Pp
 .Bl -tag -width Ds -offset indent -compact
 .It Airlink101 AWLL6090

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 19:24:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EF6C1065673;
	Wed, 12 May 2010 19:24:32 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E4088FC18;
	Wed, 12 May 2010 19:24:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CJOWTK000821;
	Wed, 12 May 2010 19:24:32 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CJOWm4000818;
	Wed, 12 May 2010 19:24:32 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005121924.o4CJOWm4000818@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 19:24: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: r207991 - in head/release/doc: en_US.ISO8859-1/hardware
	share/misc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 19:24:32 -0000

Author: brueffer
Date: Wed May 12 19:24:31 2010
New Revision: 207991
URL: http://svn.freebsd.org/changeset/base/207991

Log:
  Automatically generate hardware notes for run(4).

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml
  head/release/doc/share/misc/dev.archlist.txt

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Wed May 12 19:20:32 2010	(r207990)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Wed May 12 19:24:31 2010	(r207991)
@@ -992,6 +992,8 @@
 
       &hwlist.rum;
 
+      &hwlist.run;
+
       &hwlist.uath;
 
       &hwlist.upgt;

Modified: head/release/doc/share/misc/dev.archlist.txt
==============================================================================
--- head/release/doc/share/misc/dev.archlist.txt	Wed May 12 19:20:32 2010	(r207990)
+++ head/release/doc/share/misc/dev.archlist.txt	Wed May 12 19:24:31 2010	(r207991)
@@ -104,6 +104,7 @@ rc	i386
 ral	i386,amd64
 rue	i386,pc98,amd64
 rum	i386,amd64
+run	i386,amd64
 safe	i386,pc98,amd64
 sbp	i386,sparc64,ia64,amd64
 sis	i386,pc98,ia64,amd64

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 19:59:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28A5B106566C;
	Wed, 12 May 2010 19:59:33 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 160DE8FC13;
	Wed, 12 May 2010 19:59:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CJxWEO008794;
	Wed, 12 May 2010 19:59:32 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CJxWHc008785;
	Wed, 12 May 2010 19:59:32 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201005121959.o4CJxWHc008785@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Wed, 12 May 2010 19:59: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: r207995 - in head: . etc/mtree gnu/lib/libgcc
	gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/usr.bin/cc
	gnu/usr.bin/cc/cc_tools gnu/usr.bin/cc/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: Wed, 12 May 2010 19:59:33 -0000

Author: obrien
Date: Wed May 12 19:59:32 2010
New Revision: 207995
URL: http://svn.freebsd.org/changeset/base/207995

Log:
  Non-GCC gcc compatible compilers may provide the same multimedia intrinsic
  headers as GCC, but of their own implementation.  So put the GCC ones into
  their own header "namespace".
  
  Requested by:	ed

Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.include.dist
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libstdc++/Makefile
  head/gnu/lib/libsupc++/Makefile
  head/gnu/usr.bin/cc/Makefile.inc
  head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
  head/gnu/usr.bin/cc/include/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed May 12 19:35:13 2010	(r207994)
+++ head/ObsoleteFiles.inc	Wed May 12 19:59:32 2010	(r207995)
@@ -14,6 +14,24 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100511: move GCC-specific headers to /usr/include/gcc
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/include/emmintrin.h
+OLD_FILES+=usr/include/mm_malloc.h
+OLD_FILES+=usr/include/pmmintrin.h
+OLD_FILES+=usr/include/xmmintrin.h
+.endif
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "arm"
+OLD_FILES+=usr/include/mmintrin.h
+.endif
+.if ${TARGET_ARCH} == "ia64"
+OLD_FILES+=usr/include/ia64intrin.h
+.endif
+.if ${TARGET_ARCH} == "powerpc"
+OLD_FILES+=usr/include/altivec.h
+OLD_FILES+=usr/include/ppc-asm.h
+OLD_FILES+=usr/include/spe.h
+.endif
 # 20100416: [mips] removed 
 .if ${TARGET_ARCH} == "mips"
 OLD_FILES+=usr/include/machine/psl.h

Modified: head/etc/mtree/BSD.include.dist
==============================================================================
--- head/etc/mtree/BSD.include.dist	Wed May 12 19:35:13 2010	(r207994)
+++ head/etc/mtree/BSD.include.dist	Wed May 12 19:59:32 2010	(r207995)
@@ -159,6 +159,10 @@
         unionfs
         ..
     ..
+    gcc
+        4.2
+        ..
+    ..
     geom
         cache
         ..

Modified: head/gnu/lib/libgcc/Makefile
==============================================================================
--- head/gnu/lib/libgcc/Makefile	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/lib/libgcc/Makefile	Wed May 12 19:59:32 2010	(r207995)
@@ -1,4 +1,5 @@
 # $FreeBSD$
+
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../contrib/gcclibs
 

Modified: head/gnu/lib/libstdc++/Makefile
==============================================================================
--- head/gnu/lib/libstdc++/Makefile	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/lib/libstdc++/Makefile	Wed May 12 19:59:32 2010	(r207995)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
+GCCVER=	4.2
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../contrib/gcclibs
 SRCDIR=	${.CURDIR}/../../../contrib/libstdc++
@@ -94,7 +95,7 @@ CLEANFILES+=	atomicity.cc
 
 INCSGROUPS=	BITSHDRS BKWHDRS EXTHDRS BASEHDRS BASEXHDRS STDHDRS \
 		TARGETHDRS THRHDRS DEBUGHDRS TR1HDRS PBHDRS0 PBHDRS1
-CXXINCLUDEDIR=	${INCLUDEDIR}/c++/4.2
+CXXINCLUDEDIR=	${INCLUDEDIR}/c++/${GCCVER}
 
 STDHDRS=	std_algorithm.h std_bitset.h std_complex.h std_deque.h \
 		std_fstream.h std_functional.h std_iomanip.h std_ios.h \

Modified: head/gnu/lib/libsupc++/Makefile
==============================================================================
--- head/gnu/lib/libsupc++/Makefile	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/lib/libsupc++/Makefile	Wed May 12 19:59:32 2010	(r207995)
@@ -1,10 +1,11 @@
 # $FreeBSD$
 
+GCCVER=	4.2
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../contrib/gcclibs
 SRCDIR=	${.CURDIR}/../../../contrib/libstdc++/libsupc++
 
-.PATH: ${SRCDIR} ${GCCLIB}/libiberty 
+.PATH: ${SRCDIR} ${GCCLIB}/libiberty
 
 # Static only.
 LIB=	supc++
@@ -27,7 +28,7 @@ PO_CXXFLAGS=    ${CXXFLAGS:N-ffunction-s
 
 HDRS=	exception new typeinfo cxxabi.h exception_defines.h
 INCS=	${HDRS:S;^;${SRCDIR}/;}
-INCSDIR=${INCLUDEDIR}/c++/4.2
+INCSDIR=${INCLUDEDIR}/c++/${GCCVER}
 
 unwind.h: ${GCCDIR}/unwind-generic.h
 	ln -sf ${.ALLSRC} ${.TARGET}

Modified: head/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/cc/Makefile.inc	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/usr.bin/cc/Makefile.inc	Wed May 12 19:59:32 2010	(r207995)
@@ -6,6 +6,7 @@
 .if !defined(__CC_MAKEFILE_INC__)
 __CC_MAKEFILE_INC__= ${MFILE}
 
+GCCVER=	4.2
 GCCDIR=	${.CURDIR}/../../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../../contrib/gcclibs
 
@@ -15,6 +16,7 @@ GCCLIB=	${.CURDIR}/../../../../contrib/g
 MD_FILE=	${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.md
 GCC_TARGET=	${TARGET_ARCH}-undermydesk-freebsd
 
+CFLAGS+=	-DGCCVER=\"${GCCVER}\"
 CFLAGS+=	-DIN_GCC -DHAVE_CONFIG_H
 CFLAGS+=	-DPREFIX=\"${TOOLS_PREFIX}/usr\"
 #CFLAGS+=	-DWANT_COMPILER_INVARIANTS

Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
==============================================================================
--- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h	Wed May 12 19:59:32 2010	(r207995)
@@ -15,9 +15,9 @@
 #undef LOCAL_INCLUDE_DIR		/* We don't wish to support one. */
 
 /* Look for the include files in the system-defined places.  */
-#define GPLUSPLUS_INCLUDE_DIR		PREFIX"/include/c++/4.2"
-#define	GPLUSPLUS_BACKWARD_INCLUDE_DIR	PREFIX"/include/c++/4.2/backward"
-#define GCC_INCLUDE_DIR			PREFIX"/include"
+#define GPLUSPLUS_INCLUDE_DIR		PREFIX"/include/c++/"GCCVER
+#define	GPLUSPLUS_BACKWARD_INCLUDE_DIR	PREFIX"/include/c++/"GCCVER"/backward"
+#define GCC_INCLUDE_DIR			PREFIX"/include/gcc/"GCCVER
 #ifdef CROSS_COMPILE
 #define CROSS_INCLUDE_DIR		PREFIX"/include"
 #else

Modified: head/gnu/usr.bin/cc/include/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/include/Makefile	Wed May 12 19:35:13 2010	(r207994)
+++ head/gnu/usr.bin/cc/include/Makefile	Wed May 12 19:59:32 2010	(r207995)
@@ -2,6 +2,8 @@
 
 .include "../Makefile.inc"
 
+INCSDIR=${INCLUDEDIR}/gcc/${GCCVER}
+
 .PATH: ${GCCDIR}/config/${GCC_CPU}
 
 .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 20:21:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D54C1065676;
	Wed, 12 May 2010 20:21:44 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D54B8FC13;
	Wed, 12 May 2010 20:21:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CKLiJT013790;
	Wed, 12 May 2010 20:21:44 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CKLiVQ013788;
	Wed, 12 May 2010 20:21:44 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005122021.o4CKLiVQ013788@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 20:21: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: r207998 - head/sbin/restore
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 20:21:44 -0000

Author: brueffer
Date: Wed May 12 20:21:44 2010
New Revision: 207998
URL: http://svn.freebsd.org/changeset/base/207998

Log:
  Fix grammar in a line of output.
  
  PR:		145343
  Submitted by:	Hywel Mallett 
  MFC after:	1 week

Modified:
  head/sbin/restore/symtab.c

Modified: head/sbin/restore/symtab.c
==============================================================================
--- head/sbin/restore/symtab.c	Wed May 12 20:15:05 2010	(r207997)
+++ head/sbin/restore/symtab.c	Wed May 12 20:21:44 2010	(r207998)
@@ -443,7 +443,7 @@ dumpsymtable(char *filename, long checkp
 	FILE *fd;
 	struct symtableheader hdr;
 
-	vprintf(stdout, "Check pointing the restore\n");
+	vprintf(stdout, "Checkpointing the restore\n");
 	if (Nflag)
 		return;
 	if ((fd = fopen(filename, "w")) == NULL) {

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 21:20:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0147B1065678;
	Wed, 12 May 2010 21:20:05 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E5E948FC13;
	Wed, 12 May 2010 21:20:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CLK4LX026851;
	Wed, 12 May 2010 21:20:04 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CLK4RE026849;
	Wed, 12 May 2010 21:20:04 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005122120.o4CLK4RE026849@svn.freebsd.org>
From: Christian Brueffer 
Date: Wed, 12 May 2010 21:20: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: r208002 - 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: Wed, 12 May 2010 21:20:05 -0000

Author: brueffer
Date: Wed May 12 21:20:04 2010
New Revision: 208002
URL: http://svn.freebsd.org/changeset/base/208002

Log:
  Note 8.0-RELEASE.
  
  PR:		143824
  Submitted by:	pluknet 

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed May 12 20:58:08 2010	(r208001)
+++ head/UPDATING	Wed May 12 21:20:04 2010	(r208002)
@@ -83,6 +83,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 
 	The meanings correspond to the relevant IPv4 variables.
 
+20091125:
+	8.0-RELEASE.
+
 20091113:
 	The default terminal emulation for syscons(4) has been changed
 	from cons25 to xterm on all platforms except pc98.  This means

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 21:24:47 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 520671065672;
	Wed, 12 May 2010 21:24:47 +0000 (UTC) (envelope-from zml@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 28C078FC24;
	Wed, 12 May 2010 21:24:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CLOlic027909;
	Wed, 12 May 2010 21:24:47 GMT (envelope-from zml@svn.freebsd.org)
Received: (from zml@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CLOk3b027904;
	Wed, 12 May 2010 21:24:46 GMT (envelope-from zml@svn.freebsd.org)
Message-Id: <201005122124.o4CLOk3b027904@svn.freebsd.org>
From: Zachary Loafman 
Date: Wed, 12 May 2010 21: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: r208003 - 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: Wed, 12 May 2010 21:24:47 -0000

Author: zml
Date: Wed May 12 21:24:46 2010
New Revision: 208003
URL: http://svn.freebsd.org/changeset/base/208003

Log:
  Add VOP_ADVLOCKPURGE so that the file system is called when purging
  locks (in the case where the VFS impl isn't using lf_*)
  
  Submitted by:       Matthew Fleming 
  Reviewed by:        zml, dfr

Modified:
  head/sys/kern/vfs_default.c
  head/sys/kern/vfs_subr.c
  head/sys/kern/vnode_if.src
  head/sys/sys/vnode.h

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Wed May 12 21:20:04 2010	(r208002)
+++ head/sys/kern/vfs_default.c	Wed May 12 21:24:46 2010	(r208003)
@@ -98,6 +98,7 @@ struct vop_vector default_vnodeops = {
 	.vop_accessx =		vop_stdaccessx,
 	.vop_advlock =		vop_stdadvlock,
 	.vop_advlockasync =	vop_stdadvlockasync,
+	.vop_advlockpurge =	vop_stdadvlockpurge,
 	.vop_bmap =		vop_stdbmap,
 	.vop_close =		VOP_NULL,
 	.vop_fsync =		VOP_NULL,
@@ -413,6 +414,16 @@ vop_stdadvlockasync(struct vop_advlockas
 	return (lf_advlockasync(ap, &(vp->v_lockf), vattr.va_size));
 }
 
+int
+vop_stdadvlockpurge(struct vop_advlockpurge_args *ap)
+{
+	struct vnode *vp;
+
+	vp = ap->a_vp;
+	lf_purgelocks(vp, &vp->v_lockf);
+	return (0);
+}
+
 /*
  * vop_stdpathconf:
  *

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed May 12 21:20:04 2010	(r208002)
+++ head/sys/kern/vfs_subr.c	Wed May 12 21:24:46 2010	(r208003)
@@ -2585,7 +2585,7 @@ vgonel(struct vnode *vp)
 	/*
 	 * Clear the advisory locks and wake up waiting threads.
 	 */
-	lf_purgelocks(vp, &(vp->v_lockf));
+	(void)VOP_ADVLOCKPURGE(vp);
 	/*
 	 * Delete from old mount point vnode list.
 	 */

Modified: head/sys/kern/vnode_if.src
==============================================================================
--- head/sys/kern/vnode_if.src	Wed May 12 21:20:04 2010	(r208002)
+++ head/sys/kern/vnode_if.src	Wed May 12 21:24:46 2010	(r208003)
@@ -453,6 +453,13 @@ vop_advlockasync {
 };
 
 
+%% advlockpurge	vp	E E E
+
+vop_advlockpurge {
+	IN struct vnode *vp;
+};
+
+
 %% reallocblks	vp	E E E
 
 vop_reallocblks {

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Wed May 12 21:20:04 2010	(r208002)
+++ head/sys/sys/vnode.h	Wed May 12 21:24:46 2010	(r208003)
@@ -692,6 +692,7 @@ int	vop_stdaccess(struct vop_access_args
 int	vop_stdaccessx(struct vop_accessx_args *ap);
 int	vop_stdadvlock(struct vop_advlock_args *ap);
 int	vop_stdadvlockasync(struct vop_advlockasync_args *ap);
+int	vop_stdadvlockpurge(struct vop_advlockpurge_args *ap);
 int	vop_stdpathconf(struct vop_pathconf_args *);
 int	vop_stdpoll(struct vop_poll_args *);
 int	vop_stdvptocnp(struct vop_vptocnp_args *ap);

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 21:25:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B4DD10656DF;
	Wed, 12 May 2010 21:25:05 +0000 (UTC) (envelope-from zml@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BF7F8FC2A;
	Wed, 12 May 2010 21:25:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CLP56W028020;
	Wed, 12 May 2010 21:25:05 GMT (envelope-from zml@svn.freebsd.org)
Received: (from zml@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CLP5OM028018;
	Wed, 12 May 2010 21:25:05 GMT (envelope-from zml@svn.freebsd.org)
Message-Id: <201005122125.o4CLP5OM028018@svn.freebsd.org>
From: Zachary Loafman 
Date: Wed, 12 May 2010 21:25:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208004 - head/usr.sbin/extattr
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 21:25:05 -0000

Author: zml
Date: Wed May 12 21:25:05 2010
New Revision: 208004
URL: http://svn.freebsd.org/changeset/base/208004

Log:
  extattr: Fix a signed/unsigned issue
  
  Submitted by:       Matthew Fleming 
  Reviewed by:        zml, dfr

Modified:
  head/usr.sbin/extattr/rmextattr.c

Modified: head/usr.sbin/extattr/rmextattr.c
==============================================================================
--- head/usr.sbin/extattr/rmextattr.c	Wed May 12 21:24:46 2010	(r208003)
+++ head/usr.sbin/extattr/rmextattr.c	Wed May 12 21:25:05 2010	(r208004)
@@ -231,9 +231,12 @@ main(int argc, char *argv[])
 				break;
 			if (!flag_quiet)
 				printf("%s\t", argv[arg_counter]);
-			for (i = 0; i < error; i += buf[i] + 1)
+			for (i = 0; i < error; i += ch + 1) {
+			    /* The attribute name length is unsigned. */
+			    ch = (unsigned char)buf[i];
 			    printf("%s%*.*s", i ? "\t" : "",
-				buf[i], buf[i], buf + i + 1);
+				ch, ch, buf + i + 1);
+			}
 			printf("\n");
 			continue;
 		case EAGET:

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:26:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8FA7106566B;
	Wed, 12 May 2010 22:26:23 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BE0628FC08;
	Wed, 12 May 2010 22:26:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMQNrx041507;
	Wed, 12 May 2010 22:26:23 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMQNVs041504;
	Wed, 12 May 2010 22:26:23 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122226.o4CMQNVs041504@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:26: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: r208006 - in head/sys/dev/usb: . quirk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 22:26:24 -0000

Author: thompsa
Date: Wed May 12 22:26:23 2010
New Revision: 208006
URL: http://svn.freebsd.org/changeset/base/208006

Log:
  Add quirks for the Alcor SDCR_6362 Card Reader, Freecom HDD storage device and
  Samsung YP_U4 music player.
  
  PR:		usb/145265, usb/146104
  Submitted by:	Dmitry Luhtionov, Urankar Mikael, Peter Toth

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- head/sys/dev/usb/quirk/usb_quirk.c	Wed May 12 21:50:03 2010	(r208005)
+++ head/sys/dev/usb/quirk/usb_quirk.c	Wed May 12 22:26:23 2010	(r208006)
@@ -151,6 +151,8 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(AIPTEK2, SUNPLUS_TECH, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(ALCOR, SDCR_6335, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY,
 	    UQ_MSC_NO_SYNC_CACHE),
+	USB_QUIRK(ALCOR, SDCR_6362, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY,
+	    UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(ALCOR, AU6390, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
@@ -184,6 +186,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(FEIYA, 5IN1, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI),
 	USB_QUIRK(FREECOM, DVD, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI),
+	USB_QUIRK(FREECOM, HDD, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(FUJIPHOTO, MASS0100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I,
 	    UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA),
 	USB_QUIRK(GENESYS, GL641USB2IDE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB,
@@ -323,6 +326,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK_VP(USB_VENDOR_SAMSUNG_TECHWIN,
 	    USB_PRODUCT_SAMSUNG_TECHWIN_DIGIMAX_410, UQ_MSC_FORCE_WIRE_BBB,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY),
+	USB_QUIRK(SAMSUNG, YP_U4, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),
 	USB_QUIRK(SANDISK, SDDR05A, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI,
 	    UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1,
 	    UQ_MSC_NO_GETMAXLUN),

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Wed May 12 21:50:03 2010	(r208005)
+++ head/sys/dev/usb/usbdevs	Wed May 12 22:26:23 2010	(r208006)
@@ -873,6 +873,7 @@ product AKS USBHASP		0x0001	USB-HASP 0.0
 product ALCOR2 KBD_HUB		0x2802	Kbd Hub
 
 product ALCOR SDCR_6335		0x6335	SD/MMC Card Reader
+product ALCOR SDCR_6362		0x6362	SD/MMC Card Reader
 product ALCOR TRANSCEND		0x6387	Transcend JetFlash Drive
 product ALCOR MA_KBD_HUB	0x9213	MacAlly Kbd Hub
 product ALCOR AU9814		0x9215	AU9814 Hub
@@ -1483,6 +1484,7 @@ product FOSSIL WRISTPDA		0x0002	Wrist PD
 
 /* Freecom products */
 product FREECOM DVD		0xfc01	DVD drive
+product FREECOM HDD		0xfc05	Classic SL Hard Drive
 
 /* Fujitsu Siemens Computers products */
 product FSC E5400		0x1009	PrismGT USB 2.0 WLAN
@@ -2591,6 +2593,8 @@ product SAGEM XG76NA		0x0062	XG-76NA
 /* Samsung products */
 product SAMSUNG ML6060		0x3008	ML-6060 laser printer
 product SAMSUNG YP_U2		0x5050	YP-U2 MP3 Player
+product SAMSUNG YP_U4		0x5092	YP-U4 MP3 Player
+
 product SAMSUNG I500		0x6601	I500 Palm USB Phone 
 product SAMSUNG2 RT2870_1	0x2018	RT2870
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:28:40 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C0EA1065674;
	Wed, 12 May 2010 22:28:40 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BE2C8FC0C;
	Wed, 12 May 2010 22:28:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMSe1B042028;
	Wed, 12 May 2010 22:28:40 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMSeNm042026;
	Wed, 12 May 2010 22:28:40 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122228.o4CMSeNm042026@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:28: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: r208007 - 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, 12 May 2010 22:28:40 -0000

Author: thompsa
Date: Wed May 12 22:28:40 2010
New Revision: 208007
URL: http://svn.freebsd.org/changeset/base/208007

Log:
  Staticise usb_ref_device and usb_unref_device.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_dev.c

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Wed May 12 22:26:23 2010	(r208006)
+++ head/sys/dev/usb/usb_dev.c	Wed May 12 22:28:40 2010	(r208007)
@@ -182,7 +182,7 @@ usb_loc_fill(struct usb_fs_privdata* pd,
  *  0: Success, refcount incremented on the given USB device.
  *  Else: Failure.
  *------------------------------------------------------------------------*/
-usb_error_t
+static usb_error_t
 usb_ref_device(struct usb_cdev_privdata *cpd, 
     struct usb_cdev_refdata *crd, int need_uref)
 {
@@ -327,7 +327,7 @@ usb_usb_ref_device(struct usb_cdev_privd
  * This function will release the reference count by one unit for the
  * given USB device.
  *------------------------------------------------------------------------*/
-void
+static void
 usb_unref_device(struct usb_cdev_privdata *cpd,
     struct usb_cdev_refdata *crd)
 {

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:42:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 865F51065676;
	Wed, 12 May 2010 22:42:35 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 74F408FC15;
	Wed, 12 May 2010 22:42:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMgZN1045071;
	Wed, 12 May 2010 22:42:35 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMgZFn045065;
	Wed, 12 May 2010 22:42:35 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122242.o4CMgZFn045065@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:42: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: r208008 - 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, 12 May 2010 22:42:35 -0000

Author: thompsa
Date: Wed May 12 22:42:35 2010
New Revision: 208008
URL: http://svn.freebsd.org/changeset/base/208008

Log:
  If a USB device is suspended and a USB set config request is issued when the
  USB enumeration lock is locked, then the USB stack fails to resume the device
  because locking the USB enumeration lock is part of the resume procedure. To
  solve this issue a new lock is introduced which only protects the suspend and
  resume callbacks, which can be dropped inside the usbd_do_request_flags()
  function, to allow suspend and resume during so-called enumeration operations.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_request.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Wed May 12 22:28:40 2010	(r208007)
+++ head/sys/dev/usb/usb_device.c	Wed May 12 22:42:35 2010	(r208008)
@@ -1380,7 +1380,7 @@ usb_suspend_resume(struct usb_device *ud
 	}
 	DPRINTFN(4, "udev=%p do_suspend=%d\n", udev, do_suspend);
 
-	sx_assert(&udev->enum_sx, SA_LOCKED);
+	sx_assert(&udev->sr_sx, SA_LOCKED);
 
 	USB_BUS_LOCK(udev->bus);
 	/* filter the suspend events */
@@ -1495,6 +1495,7 @@ usb_alloc_device(device_t parent_dev, st
 
 	/* initialise our SX-lock */
 	sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK);
+	sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_DUPOK);
 
 	cv_init(&udev->ctrlreq_cv, "WCTRL");
 	cv_init(&udev->ref_cv, "UGONE");
@@ -2038,6 +2039,7 @@ usb_free_device(struct usb_device *udev,
 
 	sx_destroy(&udev->ctrl_sx);
 	sx_destroy(&udev->enum_sx);
+	sx_destroy(&udev->sr_sx);
 
 	cv_destroy(&udev->ctrlreq_cv);
 	cv_destroy(&udev->ref_cv);
@@ -2188,12 +2190,12 @@ usbd_set_device_strings(struct usb_devic
 #ifdef USB_VERBOSE
 	const struct usb_knowndev *kdp;
 #endif
-	uint8_t *temp_ptr;
+	char *temp_ptr;
 	size_t temp_size;
 	uint16_t vendor_id;
 	uint16_t product_id;
 
-	temp_ptr = udev->bus->scratch[0].data;
+	temp_ptr = (char *)udev->bus->scratch[0].data;
 	temp_size = sizeof(udev->bus->scratch[0].data);
 
 	vendor_id = UGETW(udd->idVendor);
@@ -2589,6 +2591,7 @@ void
 usbd_enum_lock(struct usb_device *udev)
 {
 	sx_xlock(&udev->enum_sx);
+	sx_xlock(&udev->sr_sx);
 	/* 
 	 * NEWBUS LOCK NOTE: We should check if any parent SX locks
 	 * are locked before locking Giant. Else the lock can be
@@ -2604,6 +2607,30 @@ usbd_enum_unlock(struct usb_device *udev
 {
 	mtx_unlock(&Giant);
 	sx_xunlock(&udev->enum_sx);
+	sx_xunlock(&udev->sr_sx);
+}
+
+/* The following function locks suspend and resume. */
+
+void
+usbd_sr_lock(struct usb_device *udev)
+{
+	sx_xlock(&udev->sr_sx);
+	/* 
+	 * NEWBUS LOCK NOTE: We should check if any parent SX locks
+	 * are locked before locking Giant. Else the lock can be
+	 * locked multiple times.
+	 */
+	mtx_lock(&Giant);
+}
+
+/* The following function unlocks suspend and resume. */
+
+void
+usbd_sr_unlock(struct usb_device *udev)
+{
+	mtx_unlock(&Giant);
+	sx_xunlock(&udev->sr_sx);
 }
 
 /*

Modified: head/sys/dev/usb/usb_device.h
==============================================================================
--- head/sys/dev/usb/usb_device.h	Wed May 12 22:28:40 2010	(r208007)
+++ head/sys/dev/usb/usb_device.h	Wed May 12 22:42:35 2010	(r208008)
@@ -115,6 +115,7 @@ struct usb_device {
 						 * messages */
 	struct sx ctrl_sx;
 	struct sx enum_sx;
+	struct sx sr_sx;
 	struct mtx device_mtx;
 	struct cv ctrlreq_cv;
 	struct cv ref_cv;
@@ -215,6 +216,8 @@ void	usb_set_device_state(struct usb_dev
 	    enum usb_dev_state state);
 void	usbd_enum_lock(struct usb_device *);
 void	usbd_enum_unlock(struct usb_device *);
+void	usbd_sr_lock(struct usb_device *);
+void	usbd_sr_unlock(struct usb_device *);
 uint8_t usbd_enum_is_locked(struct usb_device *);
 
 #endif					/* _USB_DEVICE_H_ */

Modified: head/sys/dev/usb/usb_generic.c
==============================================================================
--- head/sys/dev/usb/usb_generic.c	Wed May 12 22:28:40 2010	(r208007)
+++ head/sys/dev/usb/usb_generic.c	Wed May 12 22:42:35 2010	(r208008)
@@ -1735,14 +1735,34 @@ ugen_set_power_mode(struct usb_fifo *f, 
 		break;
 
 	case USB_POWER_MODE_RESUME:
-		err = usbd_req_clear_port_feature(udev->parent_hub,
-		    NULL, udev->port_no, UHF_PORT_SUSPEND);
+#if USB_HAVE_POWERD
+		/* let USB-powerd handle resume */
+		USB_BUS_LOCK(udev->bus);
+		udev->pwr_save.write_refs++;
+		udev->pwr_save.last_xfer_time = ticks;
+		USB_BUS_UNLOCK(udev->bus);
+
+		/* set new power mode */
+		usbd_set_power_mode(udev, USB_POWER_MODE_SAVE);
+
+		/* wait for resume to complete */
+		usb_pause_mtx(NULL, hz / 4);
+
+		/* clear write reference */
+		USB_BUS_LOCK(udev->bus);
+		udev->pwr_save.write_refs--;
+		USB_BUS_UNLOCK(udev->bus);
+#endif
 		mode = USB_POWER_MODE_SAVE;
 		break;
 
 	case USB_POWER_MODE_SUSPEND:
-		err = usbd_req_set_port_feature(udev->parent_hub,
-		    NULL, udev->port_no, UHF_PORT_SUSPEND);
+#if USB_HAVE_POWERD
+		/* let USB-powerd handle suspend */
+		USB_BUS_LOCK(udev->bus);
+		udev->pwr_save.last_xfer_time = ticks - (256 * hz);
+		USB_BUS_UNLOCK(udev->bus);
+#endif
 		mode = USB_POWER_MODE_SAVE;
 		break;
 

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Wed May 12 22:28:40 2010	(r208007)
+++ head/sys/dev/usb/usb_hub.c	Wed May 12 22:42:35 2010	(r208008)
@@ -126,6 +126,7 @@ static usb_callback_t uhub_intr_callback
 
 static void usb_dev_resume_peer(struct usb_device *udev);
 static void usb_dev_suspend_peer(struct usb_device *udev);
+static uint8_t usb_peer_should_wakeup(struct usb_device *udev);
 
 static const struct usb_config uhub_config[UHUB_N_TRANSFER] = {
 
@@ -1706,8 +1707,8 @@ usbd_transfer_power_ref(struct usb_xfer 
 		udev->pwr_save.read_refs += val;
 		if (xfer->flags_int.usb_mode == USB_MODE_HOST) {
 			/*
-			 * it is not allowed to suspend during a control
-			 * transfer
+			 * It is not allowed to suspend during a
+			 * control transfer:
 			 */
 			udev->pwr_save.write_refs += val;
 		}
@@ -1717,19 +1718,21 @@ usbd_transfer_power_ref(struct usb_xfer 
 		udev->pwr_save.write_refs += val;
 	}
 
-	if (udev->flags.self_suspended)
-		needs_explore =
-		    (udev->pwr_save.write_refs != 0) ||
-		    ((udev->pwr_save.read_refs != 0) &&
-		    (usb_peer_can_wakeup(udev) == 0));
-	else
-		needs_explore = 0;
+	if (val > 0) {
+		if (udev->flags.self_suspended)
+			needs_explore = usb_peer_should_wakeup(udev);
+		else
+			needs_explore = 0;
 
-	if (!(udev->bus->hw_power_state & power_mask[xfer_type])) {
-		DPRINTF("Adding type %u to power state\n", xfer_type);
-		udev->bus->hw_power_state |= power_mask[xfer_type];
-		needs_hw_power = 1;
+		if (!(udev->bus->hw_power_state & power_mask[xfer_type])) {
+			DPRINTF("Adding type %u to power state\n", xfer_type);
+			udev->bus->hw_power_state |= power_mask[xfer_type];
+			needs_hw_power = 1;
+		} else {
+			needs_hw_power = 0;
+		}
 	} else {
+		needs_explore = 0;
 		needs_hw_power = 0;
 	}
 
@@ -1748,6 +1751,22 @@ usbd_transfer_power_ref(struct usb_xfer 
 #endif
 
 /*------------------------------------------------------------------------*
+ *	usb_peer_should_wakeup
+ *
+ * This function returns non-zero if the current device should wake up.
+ *------------------------------------------------------------------------*/
+static uint8_t
+usb_peer_should_wakeup(struct usb_device *udev)
+{
+	return ((udev->power_mode == USB_POWER_MODE_ON) ||
+	    (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) ||
+	    (udev->pwr_save.write_refs != 0) ||
+	    ((udev->pwr_save.read_refs != 0) &&
+	    (udev->flags.usb_mode == USB_MODE_HOST) &&
+	    (usb_peer_can_wakeup(udev) == 0)));
+}
+
+/*------------------------------------------------------------------------*
  *	usb_bus_powerd
  *
  * This function implements the USB power daemon and is called
@@ -1763,7 +1782,6 @@ usb_bus_powerd(struct usb_bus *bus)
 	usb_ticks_t mintime;
 	usb_size_t type_refs[5];
 	uint8_t x;
-	uint8_t rem_wakeup;
 
 	limit = usb_power_timeout;
 	if (limit == 0)
@@ -1788,30 +1806,23 @@ usb_bus_powerd(struct usb_bus *bus)
 		if (udev == NULL)
 			continue;
 
-		rem_wakeup = usb_peer_can_wakeup(udev);
-
 		temp = ticks - udev->pwr_save.last_xfer_time;
 
-		if ((udev->power_mode == USB_POWER_MODE_ON) ||
-		    (udev->pwr_save.type_refs[UE_ISOCHRONOUS] != 0) ||
-		    (udev->pwr_save.write_refs != 0) ||
-		    ((udev->pwr_save.read_refs != 0) &&
-		    (rem_wakeup == 0))) {
-
+		if (usb_peer_should_wakeup(udev)) {
 			/* check if we are suspended */
 			if (udev->flags.self_suspended != 0) {
 				USB_BUS_UNLOCK(bus);
 				usb_dev_resume_peer(udev);
 				USB_BUS_LOCK(bus);
 			}
-		} else if (temp >= limit) {
-
-			/* check if we are not suspended */
-			if (udev->flags.self_suspended == 0) {
-				USB_BUS_UNLOCK(bus);
-				usb_dev_suspend_peer(udev);
-				USB_BUS_LOCK(bus);
-			}
+		} else if ((temp >= limit) &&
+		    (udev->flags.usb_mode == USB_MODE_HOST) &&
+		    (udev->flags.self_suspended == 0)) {
+			/* try to do suspend */
+
+			USB_BUS_UNLOCK(bus);
+			usb_dev_suspend_peer(udev);
+			USB_BUS_LOCK(bus);
 		}
 	}
 
@@ -1920,6 +1931,9 @@ usb_dev_resume_peer(struct usb_device *u
 	/* resume parent hub first */
 	usb_dev_resume_peer(udev->parent_hub);
 
+	/* reduce chance of instant resume failure by waiting a little bit */
+	usb_pause_mtx(NULL, USB_MS_TO_TICKS(20));
+
 	/* resume current port (Valid in Host and Device Mode) */
 	err = usbd_req_clear_port_feature(udev->parent_hub,
 	    NULL, udev->port_no, UHF_PORT_SUSPEND);
@@ -1958,12 +1972,12 @@ usb_dev_resume_peer(struct usb_device *u
 		(bus->methods->set_hw_power) (bus);
 	}
 
-	usbd_enum_lock(udev);
+	usbd_sr_lock(udev);
 
 	/* notify all sub-devices about resume */
 	err = usb_suspend_resume(udev, 0);
 
-	usbd_enum_unlock(udev);
+	usbd_sr_unlock(udev);
 
 	/* check if peer has wakeup capability */
 	if (usb_peer_can_wakeup(udev)) {
@@ -2029,12 +2043,47 @@ repeat:
 		}
 	}
 
-	usbd_enum_lock(udev);
+	USB_BUS_LOCK(udev->bus);
+	/*
+	 * Checking for suspend condition and setting suspended bit
+	 * must be atomic!
+	 */
+	err = usb_peer_should_wakeup(udev);
+	if (err == 0) {
+		/*
+		 * Set that this device is suspended. This variable
+		 * must be set before calling USB controller suspend
+		 * callbacks.
+		 */
+		udev->flags.self_suspended = 1;
+	}
+	USB_BUS_UNLOCK(udev->bus);
+
+	if (err != 0) {
+		if (udev->flags.usb_mode == USB_MODE_DEVICE) {
+			/* resume parent HUB first */
+			usb_dev_resume_peer(udev->parent_hub);
+
+			/* reduce chance of instant resume failure by waiting a little bit */
+			usb_pause_mtx(NULL, USB_MS_TO_TICKS(20));
+
+			/* resume current port (Valid in Host and Device Mode) */
+			err = usbd_req_clear_port_feature(udev->parent_hub,
+			    NULL, udev->port_no, UHF_PORT_SUSPEND);
+
+			/* resume settle time */
+			usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY));
+		}
+		DPRINTF("Suspend was cancelled!\n");
+		return;
+	}
+
+	usbd_sr_lock(udev);
 
 	/* notify all sub-devices about suspend */
 	err = usb_suspend_resume(udev, 1);
 
-	usbd_enum_unlock(udev);
+	usbd_sr_unlock(udev);
 
 	if (usb_peer_can_wakeup(udev)) {
 		/* allow device to do remote wakeup */
@@ -2045,13 +2094,6 @@ repeat:
 			    "remote wakeup failed\n");
 		}
 	}
-	USB_BUS_LOCK(udev->bus);
-	/*
-	 * Set that this device is suspended. This variable must be set
-	 * before calling USB controller suspend callbacks.
-	 */
-	udev->flags.self_suspended = 1;
-	USB_BUS_UNLOCK(udev->bus);
 
 	if (udev->bus->methods->device_suspend != NULL) {
 		usb_timeout_t temp;

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Wed May 12 22:28:40 2010	(r208007)
+++ head/sys/dev/usb/usb_request.c	Wed May 12 22:42:35 2010	(r208008)
@@ -273,6 +273,7 @@ usbd_do_request_flags(struct usb_device 
 	usb_ticks_t max_ticks;
 	uint16_t length;
 	uint16_t temp;
+	uint8_t enum_locked;
 
 	if (timeout < 50) {
 		/* timeout is too small */
@@ -284,6 +285,8 @@ usbd_do_request_flags(struct usb_device 
 	}
 	length = UGETW(req->wLength);
 
+	enum_locked = usbd_enum_is_locked(udev);
+
 	DPRINTFN(5, "udev=%p bmRequestType=0x%02x bRequest=0x%02x "
 	    "wValue=0x%02x%02x wIndex=0x%02x%02x wLength=0x%02x%02x\n",
 	    udev, req->bmRequestType, req->bRequest,
@@ -308,12 +311,18 @@ usbd_do_request_flags(struct usb_device 
 	if (flags & USB_USER_DATA_PTR)
 		return (USB_ERR_INVAL);
 #endif
-	if (mtx) {
+	if ((mtx != NULL) && (mtx != &Giant)) {
 		mtx_unlock(mtx);
-		if (mtx != &Giant) {
-			mtx_assert(mtx, MA_NOTOWNED);
-		}
+		mtx_assert(mtx, MA_NOTOWNED);
 	}
+
+	/*
+	 * We need to allow suspend and resume at this point, else the
+	 * control transfer will timeout if the device is suspended!
+	 */
+	if (enum_locked)
+		usbd_sr_unlock(udev);
+
 	/*
 	 * Grab the default sx-lock so that serialisation
 	 * is achieved when multiple threads are involved:
@@ -536,9 +545,12 @@ usbd_do_request_flags(struct usb_device 
 done:
 	sx_xunlock(&udev->ctrl_sx);
 
-	if (mtx) {
+	if (enum_locked)
+		usbd_sr_lock(udev);
+
+	if ((mtx != NULL) && (mtx != &Giant))
 		mtx_lock(mtx);
-	}
+
 	return ((usb_error_t)err);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:43:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC37E1065670;
	Wed, 12 May 2010 22:43:33 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ABB688FC15;
	Wed, 12 May 2010 22:43:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMhXSI045334;
	Wed, 12 May 2010 22:43:33 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMhXaj045331;
	Wed, 12 May 2010 22:43:33 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122243.o4CMhXaj045331@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:43: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: r208009 - in head/sys/dev/usb: . input
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 22:43:33 -0000

Author: thompsa
Date: Wed May 12 22:43:33 2010
New Revision: 208009
URL: http://svn.freebsd.org/changeset/base/208009

Log:
  Enable support for mouse panning wheels.
  
  Submitted by:	Henry Hu

Modified:
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/usbhid.h

Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c	Wed May 12 22:42:35 2010	(r208008)
+++ head/sys/dev/usb/input/ums.c	Wed May 12 22:43:33 2010	(r208009)
@@ -286,6 +286,12 @@ ums_intr_callback(struct usb_xfer *xfer,
 			DPRINTFN(6, "x:%d y:%d z:%d t:%d w:%d buttons:0x%08x\n",
 			    dx, dy, dz, dt, dw, buttons);
 
+			/* translate T-axis into button presses until further */
+			if (dt > 0)
+				buttons |= 1UL << 3;
+			else if (dt < 0)
+				buttons |= 1UL << 4;
+
 			sc->sc_status.button = buttons;
 			sc->sc_status.dx += dx;
 			sc->sc_status.dy += dy;
@@ -454,6 +460,12 @@ ums_hid_parse(struct ums_softc *sc, devi
 		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) {
 			info->sc_flags |= UMS_FLAG_T_AXIS;
 		}
+	} else if (hid_locate(buf, len, HID_USAGE2(HUP_CONSUMER,
+		HUC_AC_PAN), hid_input, index, &info->sc_loc_t,
+		&flags, &info->sc_iid_t)) {
+
+		if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS)
+			info->sc_flags |= UMS_FLAG_T_AXIS;
 	}
 	/* figure out the number of buttons */
 

Modified: head/sys/dev/usb/usbhid.h
==============================================================================
--- head/sys/dev/usb/usbhid.h	Wed May 12 22:42:35 2010	(r208008)
+++ head/sys/dev/usb/usbhid.h	Wed May 12 22:43:33 2010	(r208009)
@@ -156,6 +156,9 @@ struct usb_hid_descriptor {
 #define	HUD_ERASER		0x0045
 #define	HUD_TABLET_PICK		0x0046
 
+/* Usages, Consumer */
+#define	HUC_AC_PAN		0x0238
+
 #define	HID_USAGE2(p,u) (((p) << 16) | (u))
 
 #define	UHID_INPUT_REPORT 0x01

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:44:57 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A25D7106566B;
	Wed, 12 May 2010 22:44:57 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 91FF28FC1A;
	Wed, 12 May 2010 22:44:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMivZ6045676;
	Wed, 12 May 2010 22:44:57 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMivJQ045674;
	Wed, 12 May 2010 22:44:57 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122244.o4CMivJQ045674@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:44: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: r208010 - 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, 12 May 2010 22:44:57 -0000

Author: thompsa
Date: Wed May 12 22:44:57 2010
New Revision: 208010
URL: http://svn.freebsd.org/changeset/base/208010

Log:
  Provide more information about the device location in the USB system.
  
  Submitted by:	Hans Petter Sekasky

Modified:
  head/sys/dev/usb/usb_hub.c

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c	Wed May 12 22:43:33 2010	(r208009)
+++ head/sys/dev/usb/usb_hub.c	Wed May 12 22:44:57 2010	(r208010)
@@ -1010,8 +1010,10 @@ uhub_child_location_string(device_t pare
 		}
 		goto done;
 	}
-	snprintf(buf, buflen, "port=%u interface=%u",
-	    res.portno, res.iface_index);
+	snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u",
+	    (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0,
+	    res.portno, device_get_unit(res.udev->bus->bdev),
+	    res.udev->device_index, res.iface_index);
 done:
 	mtx_unlock(&Giant);
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:45:45 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C2411065673;
	Wed, 12 May 2010 22:45:45 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1BE9F8FC16;
	Wed, 12 May 2010 22:45:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMjjNd045884;
	Wed, 12 May 2010 22:45:45 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMji77045882;
	Wed, 12 May 2010 22:45:44 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122245.o4CMji77045882@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:45: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: r208011 - 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, 12 May 2010 22:45:45 -0000

Author: thompsa
Date: Wed May 12 22:45:44 2010
New Revision: 208011
URL: http://svn.freebsd.org/changeset/base/208011

Log:
  Add the ASUS MyPal A730W device id.
  
  Submitted by:	Dmitry Luhtionov

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Wed May 12 22:44:57 2010	(r208010)
+++ head/sys/dev/usb/usbdevs	Wed May 12 22:45:44 2010	(r208011)
@@ -1007,6 +1007,7 @@ product ASUS RT2870_4		0x1760	RT2870
 product ASUS RT2870_5		0x1761	RT2870
 product	ASUS USBN13		0x1784	USB-N13
 product	ASUS RT3070_1		0x1790	RT3070
+product ASUS A730W		0x4202	ASUS MyPal A730W
 product ASUS P535		0x420f	ASUS P535 PDA
 product	ASUS GMSC		0x422f	ASUS Generic Mass Storage
 product ASUS RT2570		0x1706	RT2500USB Wireless Adapter

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:50:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA8571065670;
	Wed, 12 May 2010 22:50:23 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 783048FC1F;
	Wed, 12 May 2010 22:50:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMoN42046927;
	Wed, 12 May 2010 22:50:23 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMoNaP046923;
	Wed, 12 May 2010 22:50:23 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122250.o4CMoNaP046923@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:50: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: r208012 - in head: lib/libusbhid 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, 12 May 2010 22:50:23 -0000

Author: thompsa
Date: Wed May 12 22:50:23 2010
New Revision: 208012
URL: http://svn.freebsd.org/changeset/base/208012

Log:
  Support getting signed and unsigned HID data.
  
  Submitted by:	Alex Deiter
  Reviewed by:	Hans Petter Selaksy

Modified:
  head/lib/libusbhid/data.c
  head/sys/dev/usb/usb_hid.c
  head/sys/dev/usb/usbhid.h

Modified: head/lib/libusbhid/data.c
==============================================================================
--- head/lib/libusbhid/data.c	Wed May 12 22:45:44 2010	(r208011)
+++ head/lib/libusbhid/data.c	Wed May 12 22:50:23 2010	(r208012)
@@ -63,13 +63,17 @@ hid_get_data(const void *p, const hid_it
 	data = 0;
 	for (i = 0; i <= end; i++)
 		data |= buf[offs + i] << (i*8);
+
+	/* Correctly shift down data */
 	data >>= hpos % 8;
-	data &= (1 << hsize) - 1;
-	if (h->logical_minimum < 0) {
-		/* Need to sign extend */
-		hsize = sizeof data * 8 - hsize;
-		data = (data << hsize) >> hsize;
-	}
+	hsize = 32 - hsize;
+
+	/* Mask and sign extend in one */
+	if ((h->logical_minimum < 0) || (h->logical_maximum < 0))
+		data = (int32_t)((int32_t)data << hsize) >> hsize;
+	else
+		data = (uint32_t)((uint32_t)data << hsize) >> hsize;
+
 	return (data);
 }
 

Modified: head/sys/dev/usb/usb_hid.c
==============================================================================
--- head/sys/dev/usb/usb_hid.c	Wed May 12 22:45:44 2010	(r208011)
+++ head/sys/dev/usb/usb_hid.c	Wed May 12 22:50:23 2010	(r208012)
@@ -646,8 +646,9 @@ hid_locate(const void *desc, usb_size_t 
 /*------------------------------------------------------------------------*
  *	hid_get_data
  *------------------------------------------------------------------------*/
-uint32_t
-hid_get_data(const uint8_t *buf, usb_size_t len, struct hid_location *loc)
+static uint32_t
+hid_get_data_sub(const uint8_t *buf, usb_size_t len, struct hid_location *loc,
+    int is_signed)
 {
 	uint32_t hpos = loc->pos;
 	uint32_t hsize = loc->size;
@@ -676,16 +677,31 @@ hid_get_data(const uint8_t *buf, usb_siz
 
 	/* Correctly shift down data */
 	data = (data >> (hpos % 8));
+	n = 32 - hsize;
 
 	/* Mask and sign extend in one */
-	n = 32 - hsize;
-	data = ((int32_t)data << n) >> n;
+	if (is_signed != 0)
+		data = (int32_t)((int32_t)data << n) >> n;
+	else
+		data = (uint32_t)((uint32_t)data << n) >> n;
 
 	DPRINTFN(11, "hid_get_data: loc %d/%d = %lu\n",
 	    loc->pos, loc->size, (long)data);
 	return (data);
 }
 
+int32_t
+hid_get_data(const uint8_t *buf, usb_size_t len, struct hid_location *loc)
+{
+	return (hid_get_data_sub(buf, len, loc, 1));
+}
+
+uint32_t
+hid_get_data_unsigned(const uint8_t *buf, usb_size_t len, struct hid_location *loc)
+{
+        return (hid_get_data_sub(buf, len, loc, 0));
+}
+
 /*------------------------------------------------------------------------*
  *	hid_is_collection
  *------------------------------------------------------------------------*/

Modified: head/sys/dev/usb/usbhid.h
==============================================================================
--- head/sys/dev/usb/usbhid.h	Wed May 12 22:45:44 2010	(r208011)
+++ head/sys/dev/usb/usbhid.h	Wed May 12 22:50:23 2010	(r208012)
@@ -229,7 +229,9 @@ int	hid_report_size(const void *buf, usb
 int	hid_locate(const void *desc, usb_size_t size, uint32_t usage,
 	    enum hid_kind kind, uint8_t index, struct hid_location *loc,
 	    uint32_t *flags, uint8_t *id);
-uint32_t hid_get_data(const uint8_t *buf, usb_size_t len,
+int32_t hid_get_data(const uint8_t *buf, usb_size_t len,
+	    struct hid_location *loc);
+uint32_t hid_get_data_unsigned(const uint8_t *buf, usb_size_t len,
 	    struct hid_location *loc);
 int	hid_is_collection(const void *desc, usb_size_t size, uint32_t usage);
 struct usb_hid_descriptor *hid_get_descriptor_from_usb(

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:51:45 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BE1D1065675;
	Wed, 12 May 2010 22:51:45 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B7788FC1C;
	Wed, 12 May 2010 22:51:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMpjbI047316;
	Wed, 12 May 2010 22:51:45 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMpjrE047314;
	Wed, 12 May 2010 22:51:45 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122251.o4CMpjrE047314@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:51: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: r208013 - head/sys/dev/usb/controller
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 22:51:45 -0000

Author: thompsa
Date: Wed May 12 22:51:45 2010
New Revision: 208013
URL: http://svn.freebsd.org/changeset/base/208013

Log:
  Add missing ifdefs for usb power saving support.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/usb_controller.c

Modified: head/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- head/sys/dev/usb/controller/usb_controller.c	Wed May 12 22:50:23 2010	(r208012)
+++ head/sys/dev/usb/controller/usb_controller.c	Wed May 12 22:51:45 2010	(r208013)
@@ -234,11 +234,12 @@ usb_bus_explore(struct usb_proc_msg *pm)
 
 		USB_BUS_UNLOCK(bus);
 
+#if USB_HAVE_POWERD
 		/*
 		 * First update the USB power state!
 		 */
 		usb_bus_powerd(bus);
-
+#endif
 		 /* Explore the Root USB HUB. */
 		(udev->hub->explore) (udev);
 		USB_BUS_LOCK(bus);
@@ -301,11 +302,13 @@ usb_power_wdog(void *arg)
 	usb_proc_rewakeup(&bus->explore_proc);	/* recover from DDB */
 #endif
 
+#if USB_HAVE_POWERD
 	USB_BUS_UNLOCK(bus);
 
 	usb_bus_power_update(bus);
 
 	USB_BUS_LOCK(bus);
+#endif
 }
 
 /*------------------------------------------------------------------------*

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:55:46 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 40325106566C;
	Wed, 12 May 2010 22:55:46 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 256CB8FC14;
	Wed, 12 May 2010 22:55:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMtkZd048247;
	Wed, 12 May 2010 22:55:46 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMtkKM048245;
	Wed, 12 May 2010 22:55:46 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122255.o4CMtkKM048245@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:55: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: r208014 - head/sys/dev/usb/controller
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 12 May 2010 22:55:46 -0000

Author: thompsa
Date: Wed May 12 22:55:45 2010
New Revision: 208014
URL: http://svn.freebsd.org/changeset/base/208014

Log:
  Back out r203140 which was causing problems when the first and the last
  microframe slot was not in the smask. The problem was that the EHCI driver was
  then thinking that the transfer was immediately complete in some cases. Which
  could lead to freeze-like situations, which can be recovered by unplugging the
  USB device.
  
  Reported by:	Richard Kolkovich
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==============================================================================
--- head/sys/dev/usb/controller/ehci.c	Wed May 12 22:51:45 2010	(r208013)
+++ head/sys/dev/usb/controller/ehci.c	Wed May 12 22:55:45 2010	(r208014)
@@ -1352,22 +1352,32 @@ ehci_check_transfer(struct usb_xfer *xfe
 		}
 	} else if (methods == &ehci_device_isoc_hs_methods) {
 		ehci_itd_t *td;
-		uint8_t n = (xfer->nframes & 7);
 
 		/* isochronous high speed transfer */
 
 		/* check last transfer */
 		td = xfer->td_transfer_last;
 		usb_pc_cpu_invalidate(td->page_cache);
-		if (n == 0)
-			status = td->itd_status[7];
-		else
-			status = td->itd_status[n-1];
+		status = td->itd_status[0];
+		status |= td->itd_status[1];
+		status |= td->itd_status[2];
+		status |= td->itd_status[3];
+		status |= td->itd_status[4];
+		status |= td->itd_status[5];
+		status |= td->itd_status[6];
+		status |= td->itd_status[7];
 
 		/* also check first transfer */
 		td = xfer->td_transfer_first;
 		usb_pc_cpu_invalidate(td->page_cache);
 		status |= td->itd_status[0];
+		status |= td->itd_status[1];
+		status |= td->itd_status[2];
+		status |= td->itd_status[3];
+		status |= td->itd_status[4];
+		status |= td->itd_status[5];
+		status |= td->itd_status[6];
+		status |= td->itd_status[7];
 
 		/* if no transactions are active we continue */
 		if (!(status & htohc32(sc, EHCI_ITD_ACTIVE))) {
@@ -2799,14 +2809,15 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 	uint8_t x;
 	uint8_t td_no;
 	uint8_t page_no;
+	uint8_t shift = usbd_xfer_get_fps_shift(xfer);
 
 #ifdef USB_DEBUG
 	uint8_t once = 1;
 
 #endif
 
-	DPRINTFN(6, "xfer=%p next=%d nframes=%d\n",
-	    xfer, xfer->endpoint->isoc_next, xfer->nframes);
+	DPRINTFN(6, "xfer=%p next=%d nframes=%d shift=%d\n",
+	    xfer, xfer->endpoint->isoc_next, xfer->nframes, (int)shift);
 
 	/* get the current frame index */
 
@@ -2820,7 +2831,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 	    (EHCI_VIRTUAL_FRAMELIST_COUNT - 1);
 
 	if ((xfer->endpoint->is_synced == 0) ||
-	    (buf_offset < ((xfer->nframes + 7) / 8))) {
+	    (buf_offset < (((xfer->nframes << shift) + 7) / 8))) {
 		/*
 		 * If there is data underflow or the pipe queue is empty we
 		 * schedule the transfer a few frames ahead of the current
@@ -2844,7 +2855,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe
 	 */
 	xfer->isoc_time_complete =
 	    usb_isoc_time_expand(&sc->sc_bus, nframes) + buf_offset +
-	    ((xfer->nframes + 7) / 8);
+	    (((xfer->nframes << shift) + 7) / 8);
 
 	/* get the real number of frames */
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:57:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04B131065670;
	Wed, 12 May 2010 22:57:17 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E83688FC15;
	Wed, 12 May 2010 22:57:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMvGpe048607;
	Wed, 12 May 2010 22:57:16 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMvGG7048605;
	Wed, 12 May 2010 22:57:16 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122257.o4CMvGG7048605@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:57: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: r208015 - head/sys/dev/usb/serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 22:57:17 -0000

Author: thompsa
Date: Wed May 12 22:57:16 2010
New Revision: 208015
URL: http://svn.freebsd.org/changeset/base/208015

Log:
  Increase the max ports to 12, 3G devices exist where the ppp endpoint is #9.
  
  Requested by:	n_hibma

Modified:
  head/sys/dev/usb/serial/u3g.c

Modified: head/sys/dev/usb/serial/u3g.c
==============================================================================
--- head/sys/dev/usb/serial/u3g.c	Wed May 12 22:55:45 2010	(r208014)
+++ head/sys/dev/usb/serial/u3g.c	Wed May 12 22:57:16 2010	(r208015)
@@ -71,7 +71,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug,
     &u3g_debug, 0, "Debug level");
 #endif
 
-#define	U3G_MAXPORTS		8
+#define	U3G_MAXPORTS		12
 #define	U3G_CONFIG_INDEX	0
 #define	U3G_BSIZE		2048
 

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 22:59:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BA371065676;
	Wed, 12 May 2010 22:59:00 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EEB088FC0A;
	Wed, 12 May 2010 22:58:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CMwxFv049003;
	Wed, 12 May 2010 22:58:59 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CMwxDm049000;
	Wed, 12 May 2010 22:58:59 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122258.o4CMwxDm049000@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 22:58: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: r208016 - in head/sys/dev/usb: . serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 12 May 2010 22:59:00 -0000

Author: thompsa
Date: Wed May 12 22:58:59 2010
New Revision: 208016
URL: http://svn.freebsd.org/changeset/base/208016

Log:
  Add new FTDI USB device ID.
  
  PR:		kern/146483
  Submitted by:	Andre Albsmeier

Modified:
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/uftdi.c
==============================================================================
--- head/sys/dev/usb/serial/uftdi.c	Wed May 12 22:57:16 2010	(r208015)
+++ head/sys/dev/usb/serial/uftdi.c	Wed May 12 22:58:59 2010	(r208016)
@@ -212,6 +212,7 @@ static struct usb_device_id uftdi_devs[]
 	UFTDI_DEV(ATMEL, STK541, 8U232AM),
 	UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM),
 	UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM),
+	UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM),
 	UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO),
 	UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM),
 	UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM),

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Wed May 12 22:57:16 2010	(r208015)
+++ head/sys/dev/usb/usbdevs	Wed May 12 22:58:59 2010	(r208016)
@@ -1501,6 +1501,7 @@ product FTDI SERIAL_4232H	0x6011	FT4232H
 product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
 product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru
 product FTDI TACTRIX_OPENPORT_13U 0xcc4a OpenPort 1.3 Universal
+product FTDI GAMMASCOUT		0xd678	Gamma-Scout
 product FTDI EISCOU		0xe888	Expert ISDN Control USB
 product FTDI UOPTBR		0xe889	USB-RS232 OptoBridge
 product FTDI EMCU2D		0xe88a	Expert mouseCLOCK USB II

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 23:00:36 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D1D4B1065689;
	Wed, 12 May 2010 23:00:36 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C145A8FC1C;
	Wed, 12 May 2010 23:00:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CN0aKs049426;
	Wed, 12 May 2010 23:00:36 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CN0anV049424;
	Wed, 12 May 2010 23:00:36 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122300.o4CN0anV049424@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 23:00: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: r208017 - head/sys/dev/usb/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: Wed, 12 May 2010 23:00:36 -0000

Author: thompsa
Date: Wed May 12 23:00:36 2010
New Revision: 208017
URL: http://svn.freebsd.org/changeset/base/208017

Log:
  Fix possibly wrong bit masking.
  
  Reported by:	n_hibma
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/net/uhso.c

Modified: head/sys/dev/usb/net/uhso.c
==============================================================================
--- head/sys/dev/usb/net/uhso.c	Wed May 12 22:58:59 2010	(r208016)
+++ head/sys/dev/usb/net/uhso.c	Wed May 12 23:00:36 2010	(r208017)
@@ -1339,7 +1339,7 @@ uhso_ucom_cfg_set_dtr(struct ucom_softc 
 	if (onoff)
 		sc->sc_line |= UCDC_LINE_DTR;
 	else
-		sc->sc_line &= UCDC_LINE_DTR;
+		sc->sc_line &= ~UCDC_LINE_DTR;
 
 	uhso_bs_cfg(sc);
 }
@@ -1355,7 +1355,7 @@ uhso_ucom_cfg_set_rts(struct ucom_softc 
 	if (onoff)
 		sc->sc_line |= UCDC_LINE_RTS;
 	else
-		sc->sc_line &= UCDC_LINE_DTR;
+		sc->sc_line &= ~UCDC_LINE_RTS;
 
 	uhso_bs_cfg(sc);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed May 12 23:40:45 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8CAB4106564A;
	Wed, 12 May 2010 23:40:45 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A9DD8FC18;
	Wed, 12 May 2010 23:40:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4CNejWN058211;
	Wed, 12 May 2010 23:40:45 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4CNejPY058210;
	Wed, 12 May 2010 23:40:45 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005122340.o4CNejPY058210@svn.freebsd.org>
From: Andrew Thompson 
Date: Wed, 12 May 2010 23:40: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: r208018 - 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, 12 May 2010 23:40:45 -0000

Author: thompsa
Date: Wed May 12 23:40:44 2010
New Revision: 208018
URL: http://svn.freebsd.org/changeset/base/208018

Log:
  Reduce diffs to p4.
  
   Add test code for delaying or failing usb control requests, disabled by
   default under ifdef USB_REQ_DEBUG.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_request.c

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Wed May 12 23:00:36 2010	(r208017)
+++ head/sys/dev/usb/usb_request.c	Wed May 12 23:40:44 2010	(r208018)
@@ -71,15 +71,122 @@
 #ifdef USB_DEBUG
 static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
 static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY;
-static int usb_ss_delay = 0;
 
 SYSCTL_INT(_hw_usb, OID_AUTO, pr_poll_delay, CTLFLAG_RW,
     &usb_pr_poll_delay, 0, "USB port reset poll delay in ms");
 SYSCTL_INT(_hw_usb, OID_AUTO, pr_recovery_delay, CTLFLAG_RW,
     &usb_pr_recovery_delay, 0, "USB port reset recovery delay in ms");
-SYSCTL_INT(_hw_usb, OID_AUTO, ss_delay, CTLFLAG_RW,
-    &usb_ss_delay, 0, "USB status stage delay in ms");
-#endif
+
+#ifdef USB_REQ_DEBUG
+/* The following structures are used in connection to fault injection. */
+struct usb_ctrl_debug {
+	int bus_index;		/* target bus */
+	int dev_index;		/* target address */
+	int ds_fail;		/* fail data stage */
+	int ss_fail;		/* fail data stage */
+	int ds_delay;		/* data stage delay in ms */
+	int ss_delay;		/* status stage delay in ms */
+	int bmRequestType_value;
+	int bRequest_value;
+};
+
+struct usb_ctrl_debug_bits {
+	uint16_t ds_delay;
+	uint16_t ss_delay;
+	uint8_t ds_fail:1;
+	uint8_t ss_fail:1;
+	uint8_t enabled:1;
+};
+
+/* The default is to disable fault injection. */
+
+static struct usb_ctrl_debug usb_ctrl_debug = {
+	.bus_index = -1,
+	.dev_index = -1,
+	.bmRequestType_value = -1,
+	.bRequest_value = -1,
+};
+
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_bus_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.bus_index, 0, "USB controller index to fail");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_dev_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.dev_index, 0, "USB device address to fail");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_ds_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.ds_fail, 0, "USB fail data stage");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_ss_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.ss_fail, 0, "USB fail status stage");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_ds_delay, CTLFLAG_RW,
+    &usb_ctrl_debug.ds_delay, 0, "USB data stage delay in ms");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_ss_delay, CTLFLAG_RW,
+    &usb_ctrl_debug.ss_delay, 0, "USB status stage delay in ms");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_rt_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.bmRequestType_value, 0, "USB bmRequestType to fail");
+SYSCTL_INT(_hw_usb, OID_AUTO, ctrl_rv_fail, CTLFLAG_RW,
+    &usb_ctrl_debug.bRequest_value, 0, "USB bRequest to fail");
+
+/*------------------------------------------------------------------------*
+ *	usbd_get_debug_bits
+ *
+ * This function is only useful in USB host mode.
+ *------------------------------------------------------------------------*/
+static void
+usbd_get_debug_bits(struct usb_device *udev, struct usb_device_request *req,
+    struct usb_ctrl_debug_bits *dbg)
+{
+	int temp;
+
+	memset(dbg, 0, sizeof(*dbg));
+
+	/* Compute data stage delay */
+
+	temp = usb_ctrl_debug.ds_delay;
+	if (temp < 0)
+		temp = 0;
+	else if (temp > (16*1024))
+		temp = (16*1024);
+
+	dbg->ds_delay = temp;
+
+	/* Compute status stage delay */
+
+	temp = usb_ctrl_debug.ss_delay;
+	if (temp < 0)
+		temp = 0;
+	else if (temp > (16*1024))
+		temp = (16*1024);
+
+	dbg->ss_delay = temp;
+
+	/* Check if this control request should be failed */
+
+	if (usbd_get_bus_index(udev) != usb_ctrl_debug.bus_index)
+		return;
+
+	if (usbd_get_device_index(udev) != usb_ctrl_debug.dev_index)
+		return;
+
+	temp = usb_ctrl_debug.bmRequestType_value;
+
+	if ((temp != req->bmRequestType) && (temp >= 0) && (temp <= 255))
+		return;
+
+	temp = usb_ctrl_debug.bRequest_value;
+
+	if ((temp != req->bRequest) && (temp >= 0) && (temp <= 255))
+		return;
+
+	temp = usb_ctrl_debug.ds_fail;
+	if (temp)
+		dbg->ds_fail = 1;
+
+	temp = usb_ctrl_debug.ss_fail;
+	if (temp)
+		dbg->ss_fail = 1;
+
+	dbg->enabled = 1;
+}
+#endif	/* USB_REQ_DEBUG */
+#endif	/* USB_DEBUG */
 
 /*------------------------------------------------------------------------*
  *	usbd_do_request_callback
@@ -264,6 +371,9 @@ usbd_do_request_flags(struct usb_device 
     struct usb_device_request *req, void *data, uint16_t flags,
     uint16_t *actlen, usb_timeout_t timeout)
 {
+#ifdef USB_REQ_DEBUG
+	struct usb_ctrl_debug_bits dbg;
+#endif
 	usb_handle_req_t *hr_func;
 	struct usb_xfer *xfer;
 	const void *desc;
@@ -273,6 +383,7 @@ usbd_do_request_flags(struct usb_device 
 	usb_ticks_t max_ticks;
 	uint16_t length;
 	uint16_t temp;
+	uint16_t acttemp;
 	uint8_t enum_locked;
 
 	if (timeout < 50) {
@@ -327,7 +438,6 @@ usbd_do_request_flags(struct usb_device 
 	 * Grab the default sx-lock so that serialisation
 	 * is achieved when multiple threads are involved:
 	 */
-
 	sx_xlock(&udev->ctrl_sx);
 
 	hr_func = usbd_get_hr_func(udev);
@@ -391,6 +501,15 @@ usbd_do_request_flags(struct usb_device 
 		err = USB_ERR_NOMEM;
 		goto done;
 	}
+
+#ifdef USB_REQ_DEBUG
+	/* Get debug bits */
+	usbd_get_debug_bits(udev, req, &dbg);
+
+	/* Check for fault injection */
+	if (dbg.enabled)
+		flags |= USB_DELAY_STATUS_STAGE;
+#endif
 	USB_XFER_LOCK(xfer);
 
 	if (flags & USB_DELAY_STATUS_STAGE)
@@ -412,13 +531,32 @@ usbd_do_request_flags(struct usb_device 
 	usbd_copy_in(xfer->frbuffers, 0, req, sizeof(*req));
 
 	usbd_xfer_set_frame_len(xfer, 0, sizeof(*req));
-	xfer->nframes = 2;
 
 	while (1) {
 		temp = length;
-		if (temp > xfer->max_data_length) {
+		if (temp > usbd_xfer_max_len(xfer)) {
 			temp = usbd_xfer_max_len(xfer);
 		}
+#ifdef USB_REQ_DEBUG
+		if (xfer->flags.manual_status) {
+			if (usbd_xfer_frame_len(xfer, 0) != 0) {
+				/* Execute data stage separately */
+				temp = 0;
+			} else if (temp > 0) {
+				if (dbg.ds_fail) {
+					err = USB_ERR_INVAL;
+					break;
+				}
+				if (dbg.ds_delay > 0) {
+					usb_pause_mtx(
+					    xfer->xroot->xfer_mtx,
+				            USB_MS_TO_TICKS(dbg.ds_delay));
+					/* make sure we don't time out */
+					start_ticks = ticks;
+				}
+			}
+		}
+#endif
 		usbd_xfer_set_frame_len(xfer, 1, temp);
 
 		if (temp > 0) {
@@ -438,21 +576,21 @@ usbd_do_request_flags(struct usb_device 
 					usbd_copy_in(xfer->frbuffers + 1,
 					    0, data, temp);
 			}
-			xfer->nframes = 2;
+			usbd_xfer_set_frames(xfer, 2);
 		} else {
-			if (xfer->frlengths[0] == 0) {
+			if (usbd_xfer_frame_len(xfer, 0) == 0) {
 				if (xfer->flags.manual_status) {
-#ifdef USB_DEBUG
-					int temp;
-
-					temp = usb_ss_delay;
-					if (temp > 5000) {
-						temp = 5000;
+#ifdef USB_REQ_DEBUG
+					if (dbg.ss_fail) {
+						err = USB_ERR_INVAL;
+						break;
 					}
-					if (temp > 0) {
+					if (dbg.ss_delay > 0) {
 						usb_pause_mtx(
 						    xfer->xroot->xfer_mtx,
-						    USB_MS_TO_TICKS(temp));
+						    USB_MS_TO_TICKS(dbg.ss_delay));
+						/* make sure we don't time out */
+						start_ticks = ticks;
 					}
 #endif
 					xfer->flags.manual_status = 0;
@@ -460,7 +598,7 @@ usbd_do_request_flags(struct usb_device 
 					break;
 				}
 			}
-			xfer->nframes = 1;
+			usbd_xfer_set_frames(xfer, 1);
 		}
 
 		usbd_transfer_start(xfer);
@@ -475,18 +613,19 @@ usbd_do_request_flags(struct usb_device 
 		if (err) {
 			break;
 		}
-		/* subtract length of SETUP packet, if any */
 
-		if (xfer->aframes > 0) {
-			xfer->actlen -= xfer->frlengths[0];
+		/* get actual length of DATA stage */
+
+		if (xfer->aframes < 2) {
+			acttemp = 0;
 		} else {
-			xfer->actlen = 0;
+			acttemp = usbd_xfer_frame_len(xfer, 1);
 		}
 
 		/* check for short packet */
 
-		if (temp > xfer->actlen) {
-			temp = xfer->actlen;
+		if (temp > acttemp) {
+			temp = acttemp;
 			length = temp;
 		}
 		if (temp > 0) {

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 00:19:04 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 24C87106566C;
	Thu, 13 May 2010 00:19:04 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 110828FC13;
	Thu, 13 May 2010 00:19:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D0J3BO066796;
	Thu, 13 May 2010 00:19:03 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D0J3p7066792;
	Thu, 13 May 2010 00:19:03 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005130019.o4D0J3p7066792@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 13 May 2010 00:19: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: r208019 - in head/sys: contrib/dev/run 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: Thu, 13 May 2010 00:19:04 -0000

Author: thompsa
Date: Thu May 13 00:19:03 2010
New Revision: 208019
URL: http://svn.freebsd.org/changeset/base/208019

Log:
  Sync run(4) driver from author's site.
  
  Submitted by:	Akinori Furukoshi
  Obtained from:	git://gitorious.org/run/run.git

Modified:
  head/sys/contrib/dev/run/rt2870.fw.uu
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_runreg.h
  head/sys/dev/usb/wlan/if_runvar.h

Modified: head/sys/contrib/dev/run/rt2870.fw.uu
==============================================================================
--- head/sys/contrib/dev/run/rt2870.fw.uu	Wed May 12 23:40:44 2010	(r208018)
+++ head/sys/contrib/dev/run/rt2870.fw.uu	Thu May 13 00:19:03 2010	(r208019)
@@ -1,112 +1,108 @@
-# Copyright (c) 2007, Ralink Technology Corporation 
+# Copyright (c) 2007, Ralink Technology Corporation
 # All rights reserved.
 # 
-# Redistribution.  Redistribution and use in binary form, without 
-# modification, are permitted provided that the following conditions are 
+# Redistribution.  Redistribution and use in binary form, without
+# modification, are permitted provided that the following conditions are
 # met:
-# 
-# * Redistributions must reproduce the above copyright notice and the 
-#   following disclaimer in the documentation and/or other materials 
-#   provided with the distribution. 
+#
+# * Redistributions must reproduce the above copyright notice and the
+#   following disclaimer in the documentation and/or other materials
+#   provided with the distribution.
 # * Neither the name of Ralink Technology Corporation nor the names of its
 #   suppliers may be used to endorse or promote products derived from this
-#   software without specific prior written permission. 
-# * No reverse engineering, decompilation, or disassembly of this software 
+#   software without specific prior written permission.
+# * No reverse engineering, decompilation, or disassembly of this software
 #   is permitted.
-# 
-# Limited patent license. Ralink Technology Corporation grants a world-wide, 
-# royalty-free, non-exclusive license under patents it now or hereafter 
-# owns or controls to make, have made, use, import, offer to sell and 
-# sell ("Utilize") this software, but solely to the extent that any 
-# such patent is necessary to Utilize the software alone, or in 
-# combination with an operating system licensed under an approved Open 
-# Source license as listed by the Open Source Initiative at 
-# http://opensource.org/licenses.  The patent license shall not apply to 
-# any other combinations which include this software.  No hardware per 
+#
+# Limited patent license. Ralink Technology Corporation grants a world-wide,
+# royalty-free, non-exclusive license under patents it now or hereafter
+# owns or controls to make, have made, use, import, offer to sell and
+# sell ("Utilize") this software, but solely to the extent that any
+# such patent is necessary to Utilize the software alone, or in
+# combination with an operating system licensed under an approved Open
+# Source license as listed by the Open Source Initiative at
+# http://opensource.org/licenses.  The patent license shall not apply to
+# any other combinations which include this software.  No hardware per
 # se is licensed hereunder.
-# 
-# DISCLAIMER.  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 
+#
+# DISCLAIMER.  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.
-begin 644 rt2870.fw
-M____`A`H`A`R`A!X`A)G`A)H`A*'`A*,$A*((@(620(7'P(3=P(2C3`%!B`-
-M`Q(7P2*0`8S@,.,;Y4PPX`1_0(`"?P"0$"_O\)`!C'0(\.20`:?PD`&,X##@
-M')`!@."T`A6CX+0!$)`!A."T@0F0`8QT`?`2#<@BD`04X"#G`P(29I!P$N#U
-M5I`$!.`2"IT0MS$0X%`1!%$1#5(1#5,1#5013E41?G`1J7$1UW(2'7,2/H``
-M`!)F(`(#,`,=?0*O5A(+D9`$%'2`\.20`D7?57D'`0X/]T1R57^,;OQI!P$>#_=$@E5_C&[\;D_:]6$@N1D`04
-M=(#PY)!P$_#E5O1P`P(29@(27^5'9`=@"^5'9`A@!>5'M`D(D'`1X%0/]3KE
-M1[0)".4ZM`,#Y/5&Y/VO5A(+D=($(I!P$.#^D'`1X/WM^.;U5_VO5A(+D9`$
-M%'2`\.20#][?6"CH/@]5?]KU82"Y&0
-M!!1T@/#DD'`3\.56]'`#`A)F`A)?D!`"X+1P'J/@M#`9D`4(X$0!\/V0!07@
-M5/OP1`3P[53^D`4(\.3U3O5/=3K_K5>O5A(+D9`$%'2`\.20!$`?`B(N53Y4=D!F`#`A-$@!OE2,14#_5#Y4K$5`_U
-M0N5,Q%0/]5[E1V0&<&930P^`885)0X5+0H5-7N5'9`9P4H`;Y4G$5`_U0^5+
-MQ%0/]4+E3<14#_5>Y4=D!G`UY4-4#T00]4.`*^5'M`0&4U[[=4()Y4>T!09#
-M7@1U0@GE1[0&$.5#5`]$,/5#@`;22X`"TDSD]27E0L14\/_E0U0/3_5?D'!$
-M\*/E7O"CY4KPH^5(\*/E3/"CY43PH^5"\*/E0_#28"+E1V`0),!P`Q(6*1(3
-MC,*OP@32KR+"KY`$%.!4#F`$TAB`".5.14\D_Y(8TJ^0!!3@HN22&70>\.5?
-M5`_U+>4E5?5##_OS`1Y25P!74E#(`"%272;-)M@`_E
-M7S#F!L)LTFV`!-)LPFWE1V0#<"$P2P;";-)M@!CE)7`#,$P1PDSE)7`%=24'
-M@`(5)=)LTFWE1[0)%.5$(.,+Y3ID`F`%Y3JT`P3";-)MD'!&Y2WP(&D'Y5X@
-MX`*R:"!K!^5>(.$"LFH@;0?E7B#B`K)LD'!'Y2WP=2Y`(&D$HFB`)C!H!N5&
-MHN*`'>5>(.($?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_DG.2!4_O#E0\14#Q1@%"3^8",D`V`#`A88D`(HX#!'#X`'D`(HX"!'
-M!E3^\`(6&$0!\`(6&.5&,.($?P&``G\`D`(HX%3^3_`"%ACE1V0'8`_E1V0(
-M8`GE1V0)8`,"%ACD]2>0`BG@5/SPY3H48"T48"X48#8D_&!?)/E@'R0.<&GE
-M1A,35#]U\`.$K_`@1P1^`8`"?@#O;B3_@$6B1X!!Y48PX@/3@"?#@"3E1C#B
-M#50XPY0P4`9^`'\!@`1^`'\`($<$?0&``GT`[VU.)/^2.*)'LY(Y@!GE1C#B
-M`].``<.2.:)'LY(X@`>B1[.2.)(YD`(HX%3\12?PD'"4Z
-M\"+DD`(I\#!'!*]%@`3E1?3_D`(H[_`BCU#262*/5-)8(N3U8L*OY5$48$84
-M8&(D`F`#`A<#TEEU50&0`J+@5'_PH^`@YR*0!#3@M`(;H^"T`A:CX+0"$7\@
-M$A8_D!`$X%3S\'51`8!SY5!P!75B`X!JD!(`X%0#50<`*`1I`"H^`@YCN0!#?@9")P,Y`!BG1^\)`!EO"0$@1T"O"0$RC@
-M5/#PH^!4\/"CX%3Z\)`$`>!4^?!U8@%U50+D]5&`">50<`5U8@/U4>5B8!7"
-M`>3U4<)9K6*O0!(7C>5BM`,"T@/2KR+"KS`!$N20`9;P]5'"6<(!?0*O0!(7
-MC>52%&`)!'!,=5(!=54#D`0!X$0.\)`3*.!$#_"CX$0/\*/@1`7PD!($=`/P
-MD`*BX$3`\)`0!.!$#/#D]5+U53`""\("?0&O01(7C8`"P@/DD`&6\-*O(N_T
-M8"WD_G04+O6"Y#1P]8/@M/\9=!0N]8+D-'#U@^_P=!PN]8+D-'#U@^WP(@Z^
-M!-4B(B*0<"K@,.%-PJ^0<"C@D!`<\)!P*>"0$!WPD'`JX)`0'O"0$!S@]6*0
-M$![@(.'SD!`"T"`9U3@%U3X20`D_Y)'(I`$!.`EX"1=]5>0T#`B0#T_Y!P$.!?_Y!P$>!5)T^0#_D'`9X/[O7I`"*?`P1P2O)X`$
+MY2?T_Y`"*._PY5;T<`,"$RD"$R*0#][?CF]5?]KU82"Y&0!!1T
+M@/#DD'`3\.56]'`#`A,I`A,BD'`0X/Z0WU@HZ#X/57_:]6$@N1D`04
+M=(#PY)!P$_#E5O1P`P(3*0(3(I`0`.#U5Y`0`N#U6*/@]5GE6+1P'N59M#`9
+MD`4(X$0!\/V0!07@5/OP1`3P[53^D`4(\.3U3O5/=3K_=3S_K5>O5A(+D9`$
+M%'2`\.20!$`?`B
+M(N53!5
+M)_^0D`(I\#!'!*\G@`3E)_3_D`(H[_#"%"+"
+M2\),Y402"IT3I0`4,P04+P@4#Q`3N2`3V6`3ZJ```!0UA4A#A4I"A4Q>Y4=D
+M!F`#`A0U@!OE2,14#_5#Y4K$5`_U0N5,Q%0/]5[E1V0&<&%30P^`7(5)0X5+
+M0H5-7N5'9`9P38`;Y4G$5`_U0^5+Q%0/]4+E3<14#_5>Y4=D!G`PY4-4#T00
+M]4.`)N5'9`1@!>5'M`4&0UX$=4()Y4>T!A#E0U0/1##U0X`&TDN``M),Y/4E
+MY4+$5/#_Y4-4#T_U7])@(M(5Y4\.5?5`_U
+M+>4E5?5##_OS`1Y25P!74E#(`"%272;-)M@`_E7S#F
+M!L)LTFV`!-)LPFWE1V0#<"$P2P;";-)M@!CE)7`#,$P1PDSE)7`%=24'@`(5
+M)=)LTFWE1[0)%.5$(.,+Y3ID`F`%Y3JT`P3";-)MY4>T"A/E.K0!!L)LTFV`
+M".4Z<`32;,)M(&D'Y5X@X`*R:"!K!^5>(.$"LFH@;0?E7B#B`K)L=2Y`(&D$
+MHFB`)C!H!N5&HN*`'>5>(.($?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_DG.2
+M5>(.$$?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_
+MDG&2<)`0`."0$"SPD!`#X,.4,$`4HG&2=Z)PDG;E+A,35#_U+L)WTG:0$"_E
+M+O#E1V0&<#F0`BG@5/[PY4/$5`\48`PD_F`,)`-P$\(X@`_2.(`+Y48PX@/3
+M@`'#DC@P1P6O)P(7?N4G]/\"%W[E1V0'8`_E1V0(8`GE1V0)8`,"%OV0`BG@
+M5/SPY3H48"(48"448"TD_&!))/E@%"0.<%#E1A,35#]U\`.$Y?`D_X`ZTCG"
+M.(`^Y48PX@/3@!W#@!KE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(XPCF`
+M$^5&,.(#TX`!PY(YPCB`!,(XPCDP1P2O)X`$Y2?T_P(7?N5'9`Q@!N5'9`MP
+M>I`"*>!4_?#E.A1@(!1@(11@*R3\8$4D^6`2)`YP2N5&$Q-4/W7P`X3E\(`I
+MTCF`.N5&,.(#TX`!PY(Y@"WE1C#B#50XPY0P4`9^`'\!@`1^`'\`[D\D_Y(Y
+M@`_E1C#B`].``<.2.8`"PCDP1P2O)X`$Y2?T_Y`"*._P(N5'M`L0D`(IX%3K
+M\.4G5.M%1?4G(N20`BGP,$<$KT6`!.5%]/^0`BCO\"*/4-)9(H]4TE@BY/5B
+MPJ_E411@2!1@9B0"8`,"&-326755`9`"HN!4?_"CX"#G(Y`$-."T`ARCX+0"
+M%Z/@M`(2?R`2%Z^0$`3@5//P=5$!`AC4Y5!P!G5B`P(8U)`2`.!4`W`2?R`2
+M%Z^0`J+@5+_P=5$"`AC4Y5!P`P(8SY`"H^`PY@,"&,N0!#?@9")@`P(8RY`!
+MBG1^\)`!EO"0$@1T"O#E6+1R%>59M#40Y)`%`/"C=`CPHW0!\'0#\'\!$@TJ
+MD!,HX)!P&O"0$RG@D'`;\)`3*.!4\/"CX%3P\.59M#44Y3ST8`:CX%3S@!20
+M$RK@5/OP@!3E//20$RI@".!4\D4\\(`$X%3Z\)`$`>!4_?!U8@%U50+D]5&`
+M">50<`5U8@/U4>5B8!7"`>3U4<)9K6*O0!(9E.5BM`,"T@/2KR+"KS`!$N20
+M`9;P]5'"6<(!?0*O0!(9E.52%&`,!&`#`AF1=5(!=54#D`0!X$0.\)!P&N"0
+M$RCPD'`;X)`3*?#E//1@".4\1`&C\(`&D!,J=`7PD!($=`/PY5BT"0$!WPD'`JX)`0'O"0$!S@]6*0$![@(.'SD!``(29P(2:`(2AP(2C!(2B"("%DD"%Q\"$W<"$HTP!08@
-M#0,2%\$BD`&,X##C&^5,,.`$?T"``G\`D!`O[_"0`8QT"/#DD`&G\)`!C.`P
-MX!R0`8#@M`(5H^"T`1"0`83@M($)D`&,=`'P$@W=(I`$%.`@YP,"$F:0!D"&`(X&0@8`,"$F9U3@-U3R`BD'`1X"3_DD!4#_4Z
-MY4>T"0CE.K0#`^3U1N3]KU82"ZK2!"*0#][?CF]5?]KU82"ZJ0
-M!!1T@/#DD'`3\.56]'`#`A)F`A)?D'`0X/Z0WU@HZ#X/57_:]6$@NJ
-MD`04=(#PY)!P$_#E5O1P`P(29@(27Y`0`N"TO5A(+JI`$%'2`\.200<"7@1`'P(B+E4W`:,&`)LDTP300%
-M1L($Y4]%3F`(Y4\53W`"%4XB(L)"TR(BPDO"3.5$$@JV$J\`$T($$SX($QD0
-M$L,@$N-@$O2@```31(5(0X5*0H5,7N5'9`9@`P(31(`;Y4C$5`_U0^5*Q%0/
-M]4+E3,14#_5>Y4=D!G!F4T,/@&&%24.%2T*%35[E1V0&<%*`&^5)Q%0/]4/E
-M2\14#_5"Y4W$5`_U7N5'9`9P->5#5`]$$/5#@"OE1[0$!E->^W5"">5'M`4&
-M0UX$=4()Y4>T!A#E0U0/1##U0X`&TDN``M),Y/4EY4+$5/#_Y4-4#T_U7Y!P
-M1/"CY5[PH^5*\*/E2/"CY4SPH^5$\*/E0O"CY4/PTF`BY4=@$"3`<`,2%BD2
-M$XS"K\($TJ\BPJ^0!!3@5`Y@!-(8@`CE3D5/)/^2&-*OD`04X*+DDAET'O#E
-M7U0/]2WE)7`3,!@%Y5\@Y0LP&1GE7U0P_[\P$>4E<`5U)0R``A4ETFS2;8`/
-MY5\PY@;";-)M@`32;,)MY4=D`W`A,$L&PFS2;8`8Y25P`S!,$<),Y25P!74E
-M!X`"%272;-)MY4>T"13E1"#C"^4Z9`)@!>4ZM`,$PFS2;9!P1N4M\"!I!^5>
-M(.`"LF@@:P?E7B#A`K)J(&T'Y5X@X@*R;)!P1^4M\'4N0"!I!*)H@"8P:`;E
-M1J+B@!WE7B#B!'\!@`)_`.5&5/#^OO`$?@&``GX`[F\D_Y)SDG(@:P2B:H`F
-M,&H&Y4:BXH`=Y5X@X`1_`8`"?P#E1E3P_K[P!'X!@`)^`.YO)/^2=9)T(&T$
-MHFR`)C!L!N5&HN*`'>5>(.$$?P&``G\`Y494\/Z^\`1^`8`"?@#N;R3_DG&2
-M<)`0`."0$"_PD!`#X,.4,$`4HG&2=Z)PDG;E+A,35#_U+L)WTG:0$"_E+O#E
-M1V0&<$R0`BG@5/[PY4/$5`\48!0D_F`C)`-@`P(6&)`"*.`P1P^`!Y`"*.`@
-M1P94_O`"%AA$`?`"%ACE1C#B!'\!@`)_`)`"*.!4_D_P`A88Y4=D!V`/Y4=D
-M"&`)Y4=D"6`#`A88Y/4GD`(IX%3\\.4Z%&`M%&`N%&`V)/Q@7R3Y8!\D#G!I
-MY483$U0_=?`#A*_P($<$?@&``GX`[VXD_X!%HD>`0>5&,.(#TX`GPX`DY48P
-MX@U4.,.4,%`&?@!_`8`$?@!_`"!'!'T!@`)]`.]M3B3_DCBB1[.2.8`9Y48P
-MX@/3@`'#DCFB1[.2.(`'HD>SDCB2.9`"*.!4_$4G\)!PG.4Z\*/E1_"0<$'E
-M.O`BY)`"*?`P1P2O18`$Y47T_Y`"*._P(H]0TEDBCU326"+D]6+"K^51%&!&
-M%&!B)`)@`P(7`])9=54!D`*BX%1_\*/@(.!$#O"0$RC@1`_PH^!$#_"CX$0%\)`2!'0#
-M\)`"HN!$P/"0$`3@1`SPY/52]54P`@O"`GT!KT$2%XV``L(#Y)`!EO#2KR+O
-M]&`MY/YT%"[U@N0TX"#A\Y`0'."0<"CPD!`=X)!P*?"0$![@D'`J\#!*!Y!P).!$`?#"!=*O
-M(B(B````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
@@ -187,6 +135,65 @@ M```````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````!'"
+M>O___P(0*`(0,@(0>`(3*@(3*P(32@(33Q(32R("%[D"&/`"%$@"$X,P!08@
+M#0,2&<@BD`&,X##C&^5,,.`$?T"``G\`D!`O[_"0`8QT"/#DD`&G\)`!C.`P
+MX!R0`8#@M`(5H^"T`1"0`83@M($)D`&,=`'P$@W=(I`$%.`@YP,"$RF0#U/.20!D"&`$X+0@!G5.`W5/(.3U)R*0
+M`D7?57D'`0X/]T1R57^,;OQI!P$>#_=$@E5_C&[\;D
+M_:]6$@NJD`04=(#PY)!P$_#E5O1P`P(3*0(3(N5'9`=@'>5'9`A@%^5'9`E@
+M$>5'9`I@"^5'9`M@!>5'M`P(D'`1X%0/]3KE1[0)".4ZM`,#Y/5&Y4>T"@CE
+M.K0!`^3U1N3]KU82"ZK2!"*0"0
+M0`BG@_Y!P&>#^[UZ0`BGP,$<$KR>`
+M!.4G]/^0`BCO\.56]'`#`A,I`A,BD'`0X/Z0WXYO57_:]6$@NJD`04
+M=(#PY)!P$_#E5O1P`P(3*0(3(I!P$.#^D'`1X/WM]8*.@^#U5_VO5A(+JI`$
+M%'2`\.200$`+@]5BCX/59Y5BTO5A(+JI`$%'2`\.200<"7@1`'P
+M(B+E4W`:,&`)LDTP300%1L($Y4]%3F`(Y4\53W`"%4XB(L)"TR(P%#"0#_D'`9X/[O7I`"*?`P1P2O)X`$Y2?T_Y`"*._PPA0B
+MPDO"3.5$$@JV$Z4`%#,$%"\(%`\0$[D@$]E@$^J@```4-85(0X5*0H5,7N5'
+M9`9@`P(4-8`;Y4C$5`_U0^5*Q%0/]4+E3,14#_5>Y4=D!G!A4T,/@%R%24.%
+M2T*%35[E1V0&<$V`&^5)Q%0/]4/E2\14#_5"Y4W$5`_U7N5'9`9P,.5#5`]$
+M$/5#@";E1V0$8`7E1[0%!D->!'5"">5'M`80Y4-4#T0P]4.`!M)+@`+23.3U
+M)>5"Q%3P_^5#5`]/]5_28"+2%>5')/5@"R3+8`$$A1JPA7"
+MK\($TJ\BPJ^0!!3@5`Y@!-(8@`CE3D5/)/^2&-*OD`04X*+DDAET'O#E7U0/
+M]2WE)7`3,!@%Y5\@Y0LP&1GE7U0P_[\P$>4E<`5U)0R``A4ETFS2;8`/Y5\P
+MY@;";-)M@`32;,)MY4=D`W`A,$L&PFS2;8`8Y25P`S!,$<),Y25P!74E!X`"
+M%272;-)MY4>T"13E1"#C"^4Z9`)@!>4ZM`,$PFS2;>5'M`H3Y3JT`0;";-)M
+M@`CE.G`$TFS";2!I!^5>(.`"LF@@:P?E7B#A`K)J(&T'Y5X@X@*R;'4N0"!I
+M!*)H@"8P:`;E1J+B@!WE7B#B!'\!@`)_`.5&5/#^OO`$?@&``GX`[F\D_Y)S
+MDG(@:P2B:H`F,&H&Y4:BXH`=Y5X@X`1_`8`"?P#E1E3P_K[P!'X!@`)^`.YO
+M)/^2=9)T(&T$HFR`)N5'9`IP(C!L!N5&HN.`%^4ZM`$&Y4:BXX`TY48@Y`,P
+MY0/3@`'#@"8P;`;E1J+B@!WE7B#A!'\!@`)_`.5&5/#^OO`$?@&``GX`[F\D
+M_Y)QDG"0$`#@D!`L\)`0`^##E#!`%*)QDG>B<))VY2X3$U0_]2["=])VD!`O
+MY2[PY4=D!G`YD`(IX%3^\.5#Q%0/%&`,)/Y@#"0#`!.4G]/\"%W[E1V0,8`;E1V0+
+M<'J0`BG@5/WPY3H48"`48"$48"LD_&!%)/E@$B0.<$KE1A,35#]U\`.$Y?"`
+M*=(Y@#KE1C#B`].``<.2.8`MY48PX@U4.,.4,%`&?@!_`8`$?@!_`.Y/)/^2
+M.8`/Y48PX@/3@`'#DCF``L(Y,$<$KR>`!.4G]/^0`BCO\"+E1[0+$)`"*>!4
+MZ_#E)U3K147U)R+DD`(I\#!'!*]%@`3E1?3_D`(H[_`BCU#262*/5-)8(N3U
+M8L*OY5$48$@48&8D`F`#`AC4TEEU50&0`J+@5'_PH^`@YR.0!#3@M`(CX+0"$G\@$A>OD!`$X%3S\'51`0(8U.50<`9U8@,"&-20$@#@5`-P$G\@
+M$A>OD`*BX%2_\'51`@(8U.50<`,"&,^0`J/@,.8#`AC+D`0WX&0B8`,"&,N0
+M`8IT?O"0`9;PD!($=`KPY5BT!$#O"0X"#A\Y`0'."0<"CPD!`=X)!P
+M*?"0$![@D'`J\#!*!Y!P).!$`?#"!=*O(B(B````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
@@ -219,7 +226,7 @@ M```````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
 M````````````````````````````````````````````````````````````
-M```````````````````````````````````````````````````````````"
-"F\``
+M```````````````````````````````````````````````````````````1
+"=X$`
 `
 end

Modified: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c	Wed May 12 23:40:44 2010	(r208018)
+++ head/sys/dev/usb/wlan/if_run.c	Thu May 13 00:19:03 2010	(r208019)
@@ -1,5 +1,3 @@
-/*	$FreeBSD$	*/
-
 /*-
  * Copyright (c) 2008,2010 Damien Bergamini 
  * ported to FreeBSD by Akinori Furukoshi 
@@ -39,7 +37,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -74,7 +71,7 @@ __FBSDID("$FreeBSD$");
 #define USB_DEBUG_VAR run_debug
 #include 
 
-#include "if_runreg.h"		/* shared with ral(4) */
+#include "if_runreg.h"
 #include "if_runvar.h"
 
 #define nitems(_a)      (sizeof((_a)) / sizeof((_a)[0]))
@@ -93,6 +90,12 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug,
 #define IEEE80211_HAS_ADDR4(wh) \
 	(((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS)
 
+/*
+ * Because of LOR in run_key_delete(), use atomic instead.
+ * '& RUN_CMDQ_MASQ' is to loop cmdq[].
+ */
+#define RUN_CMDQ_GET(c)	(atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ)
+
 static const struct usb_device_id run_devs[] = {
     { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT2770) },
     { USB_VP(USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_RT2870) },
@@ -312,6 +315,7 @@ static struct ieee80211vap *run_vap_crea
 		    const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t
 		    mac[IEEE80211_ADDR_LEN]);
 static void	run_vap_delete(struct ieee80211vap *);
+static void	run_cmdq_cb(void *, int);
 static void	run_setup_tx_list(struct run_softc *,
 		    struct run_endpoint_queue *);
 static void	run_unsetup_tx_list(struct run_softc *,
@@ -342,23 +346,24 @@ static struct ieee80211_node *run_node_a
 static int	run_media_change(struct ifnet *);
 static int	run_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static int	run_wme_update(struct ieee80211com *);
-static void	run_wme_update_cb(void *, int);
+static void	run_wme_update_cb(void *);
 static void	run_key_update_begin(struct ieee80211vap *);
 static void	run_key_update_end(struct ieee80211vap *);
-static int	run_key_set(struct ieee80211vap *, const struct ieee80211_key *,
+static void	run_key_set_cb(void *);
+static int	run_key_set(struct ieee80211vap *, struct ieee80211_key *,
 			    const uint8_t mac[IEEE80211_ADDR_LEN]);
-static int	run_key_delete(struct ieee80211vap *,
-		    const struct ieee80211_key *);
-static void	run_ratectl_start(struct run_softc *, struct ieee80211_node *);
+static void	run_key_delete_cb(void *);
+static int	run_key_delete(struct ieee80211vap *, struct ieee80211_key *);
 static void	run_ratectl_to(void *);
 static void	run_ratectl_cb(void *, int);
+static void	run_drain_fifo(void *);
 static void	run_iter_func(void *, struct ieee80211_node *);
+static void	run_newassoc_cb(void *);
 static void	run_newassoc(struct ieee80211_node *, int);
 static void	run_rx_frame(struct run_softc *, struct mbuf *, uint32_t);
 static void	run_tx_free(struct run_endpoint_queue *pq,
 		    struct run_tx_data *, int);
-static void	run_set_tx_desc(struct run_softc *, struct run_tx_data *,
-		    uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
+static void	run_set_tx_desc(struct run_softc *, struct run_tx_data *);
 static int	run_tx(struct run_softc *, struct mbuf *,
 		    struct ieee80211_node *);
 static int	run_tx_mgt(struct run_softc *, struct mbuf *,
@@ -382,11 +387,10 @@ static int	run_set_chan(struct run_softc
 static void	run_set_channel(struct ieee80211com *);
 static void	run_scan_start(struct ieee80211com *);
 static void	run_scan_end(struct ieee80211com *);
-static uint8_t	run_rate2mcs(uint8_t);
 static void	run_update_beacon(struct ieee80211vap *, int);
-static void	run_update_beacon_locked(struct ieee80211vap *, int);
+static void	run_update_beacon_cb(void *);
 static void	run_updateprot(struct ieee80211com *);
-static void	run_usb_timeout_cb(void *, int);
+static void	run_usb_timeout_cb(void *);
 static void	run_reset_livelock(struct run_softc *);
 static void	run_enable_tsf_sync(struct run_softc *);
 static void	run_enable_mrr(struct run_softc *);
@@ -396,6 +400,7 @@ static void	run_set_leds(struct run_soft
 static void	run_set_bssid(struct run_softc *, const uint8_t *);
 static void	run_set_macaddr(struct run_softc *, const uint8_t *);
 static void	run_updateslot(struct ifnet *);
+static void	run_update_mcast(struct ifnet *);
 static int8_t	run_rssi2dbm(struct run_softc *, uint8_t, uint8_t);
 static void	run_update_promisc_locked(struct ifnet *);
 static void	run_update_promisc(struct ifnet *);
@@ -411,7 +416,7 @@ static void	run_stop(void *);
 static void	run_delay(struct run_softc *, unsigned int);
 
 static const struct {
-	uint32_t	reg;
+	uint16_t	reg;
 	uint32_t	val;
 } rt2870_def_mac[] = {
 	RT2870_DEF_MAC
@@ -551,6 +556,7 @@ run_attach(device_t self)
 	    MTX_NETWORK_LOCK, MTX_DEF);
 
 	iface_index = RT2860_IFACE_INDEX;
+
 	error = usbd_transfer_setup(uaa->device, &iface_index,
 	    sc->sc_xfer, run_config, RUN_N_XFER, sc, &sc->sc_mtx);
 	if (error) {
@@ -616,15 +622,15 @@ run_attach(device_t self)
 	ic->ic_ifp = ifp;
 	ic->ic_phytype = IEEE80211_T_OFDM;	/* not only, but not used */
 	ic->ic_opmode = IEEE80211_M_STA;	/* default to BSS mode */
-#if 0
-	ic->ic_state = IEEE80211_S_INIT;
-#endif
+
 	/* set device capabilities */
 	ic->ic_caps =
 	    IEEE80211_C_STA |		/* station mode supported */
 	    IEEE80211_C_MONITOR |	/* monitor mode supported */
 	    IEEE80211_C_IBSS |
 	    IEEE80211_C_HOSTAP |
+	    IEEE80211_C_WDS |		/* 4-address traffic works */
+	    IEEE80211_C_MBSS |
 	    IEEE80211_C_SHPREAMBLE |	/* short preamble supported */
 	    IEEE80211_C_SHSLOT |	/* short slot time supported */
 	    IEEE80211_C_WME |		/* WME */
@@ -671,6 +677,7 @@ run_attach(device_t self)
 	ic->ic_node_alloc = run_node_alloc;
 	ic->ic_newassoc = run_newassoc;
 	//ic->ic_updateslot = run_updateslot;
+	ic->ic_update_mcast = run_update_mcast;
 	ic->ic_wme.wme_update = run_wme_update;
 	ic->ic_raw_xmit = run_raw_xmit;
 	ic->ic_update_promisc = run_update_promisc;
@@ -684,6 +691,10 @@ run_attach(device_t self)
 	    &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap),
 		RUN_RX_RADIOTAP_PRESENT);
 
+	TASK_INIT(&sc->cmdq_task, 0, run_cmdq_cb, sc);
+	TASK_INIT(&sc->ratectl_task, 0, run_ratectl_cb, sc);
+	callout_init((struct callout *)&sc->ratectl_ch, 1);
+
 	if (bootverbose)
 		ieee80211_announce(ic);
 
@@ -713,6 +724,10 @@ run_detach(device_t self)
 
 	if (ifp) {
 		ic = ifp->if_l2com;
+		/* drain tasks */
+		usb_callout_drain(&sc->ratectl_ch);
+		ieee80211_draintask(ic, &sc->cmdq_task);
+		ieee80211_draintask(ic, &sc->ratectl_task);
 		ieee80211_ifdetach(ic);
 		if_free(ifp);
 	}
@@ -728,41 +743,92 @@ run_vap_create(struct ieee80211com *ic,
     const uint8_t bssid[IEEE80211_ADDR_LEN],
     const uint8_t mac[IEEE80211_ADDR_LEN])
 {
-	struct run_softc *sc = ic->ic_ifp->if_softc;
+	struct ifnet *ifp = ic->ic_ifp;
+	struct run_softc *sc = ifp->if_softc;
 	struct run_vap *rvp;
 	struct ieee80211vap *vap;
+	int i;
 
-	if (!TAILQ_EMPTY(&ic->ic_vaps))         /* only one at a time */
+	if(sc->rvp_cnt >= RUN_VAP_MAX){
+		if_printf(ifp, "number of VAPs maxed out\n");
 		return NULL;
-	sc->sc_rvp = rvp = (struct run_vap *) malloc(sizeof(struct run_vap),
+	}
+
+	switch (opmode) {
+	case IEEE80211_M_STA:
+		/* enable s/w bmiss handling for sta mode */
+		flags |= IEEE80211_CLONE_NOBEACONS; 
+		/* fall though */
+	case IEEE80211_M_IBSS:
+	case IEEE80211_M_MONITOR:
+	case IEEE80211_M_HOSTAP:
+	case IEEE80211_M_MBSS:
+		/* other than WDS vaps, only one at a time */
+		if (!TAILQ_EMPTY(&ic->ic_vaps))
+			return NULL;
+		break;
+	case IEEE80211_M_WDS:
+		TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next){
+			if(vap->iv_opmode != IEEE80211_M_HOSTAP)
+				continue;
+			/* WDS vap's always share the local mac address. */
+			flags &= ~IEEE80211_CLONE_BSSID;
+			break;
+		}
+		if(vap == NULL){
+			if_printf(ifp, "wds only supported in ap mode\n");
+			return NULL;
+		}
+		break;
+	default:
+		if_printf(ifp, "unknown opmode %d\n", opmode);
+		return NULL;
+	}
+
+	rvp = (struct run_vap *) malloc(sizeof(struct run_vap),
 	    M_80211_VAP, M_NOWAIT | M_ZERO);
 	if (rvp == NULL)
 		return NULL;
 	vap = &rvp->vap;
-	/* enable s/w bmiss handling for sta mode */
-	ieee80211_vap_setup(ic, vap, name, unit, opmode,
-	    flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
+	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);
 
 	vap->iv_key_update_begin = run_key_update_begin;
 	vap->iv_key_update_end = run_key_update_end;
-	vap->iv_key_delete = run_key_delete;
-	vap->iv_key_set = run_key_set;
 	vap->iv_update_beacon = run_update_beacon;
+	vap->iv_max_aid = RT2870_WCID_MAX;
+	/*
+	 * To delete the right key from h/w, we need wcid.
+	 * Luckily, there is unused space in ieee80211_key{}, wk_pad,
+	 * and matching wcid will be written into there. So, cast
+	 * some spells to remove 'const' from ieee80211_key{}
+	 */
+	vap->iv_key_delete = (void *)run_key_delete;
+	vap->iv_key_set = (void *)run_key_set;
 
 	/* override state transition machine */
 	rvp->newstate = vap->iv_newstate;
 	vap->iv_newstate = run_newstate;
 
-	TASK_INIT(&rvp->ratectl_task, 0, run_ratectl_cb, rvp);
-	TASK_INIT(&sc->wme_task, 0, run_wme_update_cb, ic);
-	TASK_INIT(&sc->usb_timeout_task, 0, run_usb_timeout_cb, sc);
-	callout_init((struct callout *)&rvp->ratectl_ch, 1);
 	ieee80211_ratectl_init(vap);
 	ieee80211_ratectl_setinterval(vap, 1000 /* 1 sec */);
 
 	/* complete setup */
 	ieee80211_vap_attach(vap, run_media_change, ieee80211_media_status);
-	ic->ic_opmode = opmode;
+
+	/* make sure id is always unique */
+	for(i = 0; i < RUN_VAP_MAX; i++){
+		if((sc->rvp_bmap & 1 << i) == 0){
+			sc->rvp_bmap |= 1 << i;
+			rvp->rvp_id = i;
+			break;
+		}
+	}
+	if(sc->rvp_cnt++ == 0)
+		ic->ic_opmode = opmode;
+
+	DPRINTF("rvp_id=%d bmap=%x rvp_cnt=%d\n",
+	    rvp->rvp_id, sc->rvp_bmap, sc->rvp_cnt);
+
 	return vap;
 }
 
@@ -773,6 +839,7 @@ run_vap_delete(struct ieee80211vap *vap)
 	struct ifnet *ifp;
 	struct ieee80211com *ic;
 	struct run_softc *sc;
+	uint8_t rvp_id;
 
 	if(vap == NULL)
 		return;
@@ -783,19 +850,59 @@ run_vap_delete(struct ieee80211vap *vap)
 	sc = ifp->if_softc;
 
 	RUN_LOCK(sc);
-	sc->sc_rvp->ratectl_run = RUN_RATECTL_OFF;
-	RUN_UNLOCK(sc);
 
-	/* drain them all */
-	usb_callout_drain(&sc->sc_rvp->ratectl_ch);
-	ieee80211_draintask(ic, &sc->sc_rvp->ratectl_task);
-	ieee80211_draintask(ic, &sc->wme_task);
-	ieee80211_draintask(ic, &sc->usb_timeout_task);
+	rvp_id = rvp->rvp_id;
+	sc->ratectl_run &= ~(1 << rvp_id);
+	sc->rvp_bmap &= ~(1 << rvp_id);
+	run_set_region_4(sc, RT2860_SKEY(rvp_id, 0), 0, 128);
+	run_set_region_4(sc, RT2860_BCN_BASE(rvp_id), 0, 512);
+	--sc->rvp_cnt;
+
+	DPRINTF("vap=%p rvp_id=%d bmap=%x rvp_cnt=%d\n",
+	    vap, rvp_id, sc->rvp_bmap, sc->rvp_cnt);
+
+	RUN_UNLOCK(sc);
 
 	ieee80211_ratectl_deinit(vap);
 	ieee80211_vap_detach(vap);
 	free(rvp, M_80211_VAP);
-	sc->sc_rvp = NULL;
+}
+
+/*
+ * There are numbers of functions need to be called in context thread.
+ * Rather than creating taskqueue event for each of those functions,
+ * here is all-for-one taskqueue callback function. This function
+ * gurantees deferred functions are executed in the same order they
+ * were enqueued.
+ * '& RUN_CMDQ_MASQ' is to loop cmdq[].
+ */
+static void
+run_cmdq_cb(void *arg, int pending)
+{
+	struct run_softc *sc = arg;
+	uint8_t i;
+
+	/* call cmdq[].func locked */
+	RUN_LOCK(sc);
+	for(i = sc->cmdq_exec; sc->cmdq[i].func && pending;
+	    i = sc->cmdq_exec, pending--){
+		DPRINTFN(6, "cmdq_exec=%d pending=%d\n", i, pending);
+		if(sc->cmdq_run == RUN_CMDQ_GO){
+			/*
+			 * If arg0 is NULL, callback func needs more
+			 * than one arg. So, pass ptr to cmdq struct.
+			 */
+			if(sc->cmdq[i].arg0)
+				sc->cmdq[i].func(sc->cmdq[i].arg0);
+			else
+				sc->cmdq[i].func(&sc->cmdq[i]);
+		}
+		sc->cmdq[i].arg0 = NULL;
+		sc->cmdq[i].func = NULL;
+		sc->cmdq_exec++;
+		sc->cmdq_exec &= RUN_CMDQ_MASQ;
+	}
+	RUN_UNLOCK(sc);
 }
 
 static void
@@ -1415,6 +1522,7 @@ run_read_eeprom(struct run_softc *sc)
 	DPRINTF("EEPROM RF rev=0x%02x chains=%dT%dR\n",
 	    sc->rf_rev, sc->ntxchains, sc->nrxchains);
 
+	/* check if RF supports automatic Tx access gain control */
 	run_srom_read(sc, RT2860_EEPROM_CONFIG, &val);
 	DPRINTF("EEPROM CFG 0x%04x\n", val);
 	/* check if driver should patch the DAC issue */
@@ -1489,10 +1597,10 @@ run_read_eeprom(struct run_softc *sc)
 	for (ridx = 0; ridx < 5; ridx++) {
 		uint32_t reg;
 
-		run_srom_read(sc, RT2860_EEPROM_RPWR + ridx, &val);
-		reg = (uint32_t)val << 16;
-		run_srom_read(sc, RT2860_EEPROM_RPWR + ridx + 1, &val);
-		reg |= val;
+		run_srom_read(sc, RT2860_EEPROM_RPWR + ridx * 2, &val);
+		reg = val;
+		run_srom_read(sc, RT2860_EEPROM_RPWR + ridx * 2 + 1, &val);
+		reg |= (uint32_t)val << 16;
 
 		sc->txpow20mhz[ridx] = reg;
 		sc->txpow40mhz_2ghz[ridx] = b4inc(reg, delta_2ghz);
@@ -1575,19 +1683,21 @@ run_node_alloc(struct ieee80211vap *vap,
 static int
 run_media_change(struct ifnet *ifp)
 {
+	struct ieee80211vap *vap = ifp->if_softc;
+	struct ieee80211com *ic = vap->iv_ic;
 	const struct ieee80211_txparam *tp;
-	struct run_softc *sc = ifp->if_softc;
-	struct ieee80211com *ic = sc->sc_ifp->if_l2com;
-	struct ieee80211vap *vap = &sc->sc_rvp->vap;
+	struct run_softc *sc = ic->ic_ifp->if_softc;
+	struct run_node	*rn = (void *)vap->iv_bss;
 	uint8_t rate, ridx;
 	int error;
 
 	RUN_LOCK(sc);
 
 	error = ieee80211_media_change(ifp);
-	if (error != ENETRESET)
+	if (error != ENETRESET){
 		RUN_UNLOCK(sc);
 		return error;
+	}
 
 	tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
 	if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
@@ -1596,13 +1706,16 @@ run_media_change(struct ifnet *ifp)
 		for (ridx = 0; ridx < RT2860_RIDX_MAX; ridx++)
 			if (rt2860_rates[ridx].rate == rate)
 				break;
-		sc->fixed_ridx = ridx;
+		rn->fix_ridx = ridx;
+		DPRINTF("rate=%d, fix_ridx=%d\n", rate, rn->fix_ridx);
 	}
 
+#if 0
 	if ((ifp->if_flags & IFF_UP) &&
 	    (ifp->if_drv_flags &  IFF_DRV_RUNNING)){
 		run_init_locked(sc);
 	}
+#endif
 
 	RUN_UNLOCK(sc);
 
@@ -1618,8 +1731,11 @@ run_newstate(struct ieee80211vap *vap, e
 	struct run_vap *rvp = RUN_VAP(vap);
 	enum ieee80211_state ostate;
 	struct ieee80211_node *ni;
+	uint32_t sta[3];
 	uint32_t tmp;
-	uint8_t wcid;
+	uint8_t ratectl;
+	uint8_t restart_ratectl = 0;
+	uint8_t bid = 1 << rvp->rvp_id;
 
 	ostate = vap->iv_state;
 	DPRINTF("%s -> %s\n",
@@ -1629,8 +1745,9 @@ run_newstate(struct ieee80211vap *vap, e
 	IEEE80211_UNLOCK(ic);
 	RUN_LOCK(sc);
 
-	sc->sc_rvp->ratectl_run = RUN_RATECTL_OFF;
-	usb_callout_stop(&rvp->ratectl_ch);
+	ratectl = sc->ratectl_run; /* remember current state */
+	sc->ratectl_run = RUN_RATECTL_OFF;
+	usb_callout_stop(&sc->ratectl_ch);
 
 	if (ostate == IEEE80211_S_RUN) {
 		/* turn link LED off */
@@ -1639,8 +1756,16 @@ run_newstate(struct ieee80211vap *vap, e
 
 	switch (nstate) {
 	case IEEE80211_S_INIT:
-		if (ostate == IEEE80211_S_RUN) {
-			/* abort TSF synchronization */
+		restart_ratectl = 1;
+
+		if (ostate != IEEE80211_S_RUN)
+			break;
+
+		ratectl &= ~bid;
+		sc->runbmap &= ~bid;
+
+		/* abort TSF synchronization if there is no vap running */
+		if(--sc->running == 0){
 			run_read(sc, RT2860_BCN_TIME_CFG, &tmp);
 			run_write(sc, RT2860_BCN_TIME_CFG,
 			    tmp & ~(RT2860_BCN_TX_EN | RT2860_TSF_TIMER_EN |
@@ -1648,8 +1773,42 @@ run_newstate(struct ieee80211vap *vap, e
 		}
 		break;
 
+
 	case IEEE80211_S_RUN:
 		ni = vap->iv_bss;
+		if(!(sc->runbmap & bid)){
+			if(sc->running++)
+				restart_ratectl = 1;
+			sc->runbmap |= bid;
+		}
+
+		switch(vap->iv_opmode){
+		case IEEE80211_M_HOSTAP:
+		case IEEE80211_M_MBSS:
+			sc->ap_running |= bid;
+			ic->ic_opmode = vap->iv_opmode;
+			run_update_beacon_cb(vap);
+			break;
+		case IEEE80211_M_IBSS:
+			sc->adhoc_running |= bid;
+			if(!sc->ap_running)
+				ic->ic_opmode = vap->iv_opmode;
+			run_update_beacon_cb(vap);
+			break;
+		case IEEE80211_M_STA:
+			sc->sta_running |= bid;
+			if(!sc->ap_running && !sc->adhoc_running)
+				ic->ic_opmode = vap->iv_opmode;
+
+			/* read statistic counters (clear on read) */
+			run_read_region_1(sc, RT2860_TX_STA_CNT0,
+			    (uint8_t *)sta, sizeof sta);
+
+			break;
+		default:
+			ic->ic_opmode = vap->iv_opmode;
+			break;
+		}
 
 		if (vap->iv_opmode != IEEE80211_M_MONITOR) {
 			run_updateslot(ic->ic_ifp);
@@ -1658,31 +1817,17 @@ run_newstate(struct ieee80211vap *vap, e
 			run_set_basicrates(sc);
 			IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid);
 			run_set_bssid(sc, ni->ni_bssid);
-		}
-
-		if (vap->iv_opmode == IEEE80211_M_STA) {
-			/* add BSS entry to the WCID table */
-			wcid = RUN_AID2WCID(ni->ni_associd);
-			run_write_region_1(sc, RT2860_WCID_ENTRY(wcid),
-			    ni->ni_macaddr, IEEE80211_ADDR_LEN);
-		}
-
-		if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
-		    vap->iv_opmode == IEEE80211_M_IBSS)
-			run_update_beacon_locked(vap, 0);
-
-		if (vap->iv_opmode != IEEE80211_M_MONITOR) {
 			run_enable_tsf_sync(sc);
-		} /* else tsf */
 
-		/* enable automatic rate adaptation */
-		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
-		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
-			run_ratectl_start(sc, ni);
+			/* enable automatic rate adaptation */
+			tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
+			if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
+				ratectl |= bid;
+		}
 
 		/* turn link LED on */
 		run_set_leds(sc, RT2860_LED_RADIO |
-		    (IEEE80211_IS_CHAN_2GHZ(vap->iv_bss->ni_chan) ?
+		    (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan) ?
 		     RT2860_LED_LINK_2GHZ : RT2860_LED_LINK_5GHZ));
 
 		break;
@@ -1691,34 +1836,26 @@ run_newstate(struct ieee80211vap *vap, e
 		break;
 	}
 
+	/* restart amrr for running VAPs */
+	if((sc->ratectl_run = ratectl) && restart_ratectl)
+		usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc);
+
 	RUN_UNLOCK(sc);
 	IEEE80211_LOCK(ic);
 
 	return(rvp->newstate(vap, nstate, arg));
 }
 
-/* another taskqueue, so usbd_do_request() can go sleep */
-static int
-run_wme_update(struct ieee80211com *ic)
-{
-	struct run_softc *sc = ic->ic_ifp->if_softc;
-
-	ieee80211_runtask(ic, &sc->wme_task);
-
-	/* return whatever, upper layer desn't care anyway */
-	return 0;
-}
-
 /* ARGSUSED */
 static void
-run_wme_update_cb(void *arg, int pending)
+run_wme_update_cb(void *arg)
 {
 	struct ieee80211com *ic = arg;
 	struct run_softc *sc = ic->ic_ifp->if_softc;
 	struct ieee80211_wme_state *wmesp = &ic->ic_wme;
 	int aci, error = 0;
 
-	RUN_LOCK(sc);
+	RUN_LOCK_ASSERT(sc, MA_OWNED);
 
 	/* update MAC TX configuration registers */
 	for (aci = 0; aci < WME_NUM_AC; aci++) {
@@ -1761,19 +1898,39 @@ err:
 	if(error)
 		DPRINTF("WME update failed\n");
 
-	RUN_UNLOCK(sc);
 	return;
 }
 
+static int
+run_wme_update(struct ieee80211com *ic)
+{
+	struct run_softc *sc = ic->ic_ifp->if_softc;
+
+	/* sometime called wothout lock */
+	if(mtx_owned(&ic->ic_comlock.mtx)){
+		uint32_t i = RUN_CMDQ_GET(&sc->cmdq_store);
+		DPRINTF("cmdq_store=%d\n", i);
+		sc->cmdq[i].func = run_wme_update_cb;
+		sc->cmdq[i].arg0 = ic;
+		ieee80211_runtask(ic, &sc->cmdq_task);
+		return (0);
+	}
+
+	RUN_LOCK(sc);
+	run_wme_update_cb(ic);
+	RUN_UNLOCK(sc);
+
+	/* return whatever, upper layer desn't care anyway */
+	return (0);
+}
+
 static void
 run_key_update_begin(struct ieee80211vap *vap)
 {
 	/*
-	 * Because run_key_delete() needs special attention
-	 * on lock related operation, lock handling is being done
-	 * differently in run_key_set and _delete.
-	 *
-	 * So, we don't use key_update_begin and _end.
+	 * To avoid out-of-order events, both run_key_set() and
+	 * _delete() are deferred and handled by run_cmdq_cb().
+	 * So, there is nothing we need to do here.
 	 */
 }
 
@@ -1783,37 +1940,31 @@ run_key_update_end(struct ieee80211vap *
 	/* null */
 }
 
-/*
- * return 0 on error
- */
-static int
-run_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k,
-		const uint8_t mac[IEEE80211_ADDR_LEN])
+static void
+run_key_set_cb(void *arg)
 {
+	struct run_cmdq *cmdq = arg;
+	struct ieee80211vap *vap = cmdq->arg1;
+	struct ieee80211_key *k = cmdq->k;
 	struct ieee80211com *ic = vap->iv_ic;
-	struct ifnet *ifp = ic->ic_ifp;
-	struct run_softc *sc = ifp->if_softc;
+	struct run_softc *sc = ic->ic_ifp->if_softc;
 	struct ieee80211_node *ni;
 	uint32_t attr;
 	uint16_t base, associd;
 	uint8_t mode, wcid, txmic, rxmic, iv[8];
-	int error = 0;
 
-	RUN_LOCK(sc);
+	RUN_LOCK_ASSERT(sc, MA_OWNED);
 
 	if(vap->iv_opmode == IEEE80211_M_HOSTAP){

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 00:25:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5322A106566C;
	Thu, 13 May 2010 00:25:31 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 280308FC18;
	Thu, 13 May 2010 00:25:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D0PVmB068254;
	Thu, 13 May 2010 00:25:31 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D0PVK2068249;
	Thu, 13 May 2010 00:25:31 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005130025.o4D0PVK2068249@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 13 May 2010 00:25: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: r208020 - head/lib/libusb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 00:25:31 -0000

Author: thompsa
Date: Thu May 13 00:25:30 2010
New Revision: 208020
URL: http://svn.freebsd.org/changeset/base/208020

Log:
  Fix header file compliancy with libusb 1.0 from sourceforge.
  
  Reported by:	Xiaofan Chen
  Submitted by:	Hans Petter Selasky

Modified:
  head/lib/libusb/libusb.h
  head/lib/libusb/libusb10.c
  head/lib/libusb/libusb10_desc.c
  head/lib/libusb/libusb10_io.c

Modified: head/lib/libusb/libusb.h
==============================================================================
--- head/lib/libusb/libusb.h	Thu May 13 00:19:03 2010	(r208019)
+++ head/lib/libusb/libusb.h	Thu May 13 00:25:30 2010	(r208020)
@@ -178,7 +178,7 @@ enum libusb_debug_level {
 struct libusb_context;
 struct libusb_device;
 struct libusb_transfer;
-struct libusb20_device;
+struct libusb_device_handle;
 
 struct libusb_pollfd {
 	int	fd;
@@ -187,7 +187,7 @@ struct libusb_pollfd {
 
 typedef struct libusb_context libusb_context;
 typedef struct libusb_device libusb_device;
-typedef struct libusb20_device libusb_device_handle;
+typedef struct libusb_device_handle libusb_device_handle;
 typedef struct libusb_pollfd libusb_pollfd;
 typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data);
 typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data);

Modified: head/lib/libusb/libusb10.c
==============================================================================
--- head/lib/libusb/libusb10.c	Thu May 13 00:19:03 2010	(r208019)
+++ head/lib/libusb/libusb10.c	Thu May 13 00:25:30 2010	(r208020)
@@ -37,6 +37,8 @@
 #include 
 #include 
 
+#define	libusb_device_handle libusb20_device
+
 #include "libusb20.h"
 #include "libusb20_desc.h"
 #include "libusb20_int.h"

Modified: head/lib/libusb/libusb10_desc.c
==============================================================================
--- head/lib/libusb/libusb10_desc.c	Thu May 13 00:19:03 2010	(r208019)
+++ head/lib/libusb/libusb10_desc.c	Thu May 13 00:25:30 2010	(r208020)
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#define	libusb_device_handle libusb20_device
+
 #include "libusb20.h"
 #include "libusb20_desc.h"
 #include "libusb20_int.h"

Modified: head/lib/libusb/libusb10_io.c
==============================================================================
--- head/lib/libusb/libusb10_io.c	Thu May 13 00:19:03 2010	(r208019)
+++ head/lib/libusb/libusb10_io.c	Thu May 13 00:25:30 2010	(r208020)
@@ -34,6 +34,8 @@
 #include 
 #include 
 
+#define	libusb_device_handle libusb20_device
+
 #include "libusb20.h"
 #include "libusb20_desc.h"
 #include "libusb20_int.h"

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 00:26:30 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5EDA5106566B;
	Thu, 13 May 2010 00:26:30 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D7D08FC13;
	Thu, 13 May 2010 00:26:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D0QUr7068519;
	Thu, 13 May 2010 00:26:30 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D0QUvr068517;
	Thu, 13 May 2010 00:26:30 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005130026.o4D0QUvr068517@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 13 May 2010 00:26: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: r208021 - head/lib/libusb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 00:26:30 -0000

Author: thompsa
Date: Thu May 13 00:26:30 2010
New Revision: 208021
URL: http://svn.freebsd.org/changeset/base/208021

Log:
  Fix return values for usb_find_busses() and usb_find_devices(). We should try
  to return the actual number of busses and devices.
  
  Reported by:	Mike Tancsa
  Submitted by:	Hans Petter Selaksy

Modified:
  head/lib/libusb/libusb20_compat01.c

Modified: head/lib/libusb/libusb20_compat01.c
==============================================================================
--- head/lib/libusb/libusb20_compat01.c	Thu May 13 00:25:30 2010	(r208020)
+++ head/lib/libusb/libusb20_compat01.c	Thu May 13 00:26:30 2010	(r208021)
@@ -820,7 +820,7 @@ int
 usb_find_busses(void)
 {
 	usb_busses = &usb_global_bus;
-	return (0);
+	return (1);
 }
 
 int
@@ -907,7 +907,7 @@ usb_find_devices(void)
 		LIST_ADD(usb_global_bus.devices, udev);
 	}
 
-	return (0);			/* success */
+	return (devnum - 1);			/* success */
 }
 
 struct usb_device *

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 01:50:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDEE3106566C;
	Thu, 13 May 2010 01:50:29 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ABE4E8FC17;
	Thu, 13 May 2010 01:50:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D1oTQa086820;
	Thu, 13 May 2010 01:50:29 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D1oTFk086817;
	Thu, 13 May 2010 01:50:29 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201005130150.o4D1oTFk086817@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 13 May 2010 01:50:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208022 - in head/sys/mips: adm5120 mips
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 01:50:29 -0000

Author: imp
Date: Thu May 13 01:50:29 2010
New Revision: 208022
URL: http://svn.freebsd.org/changeset/base/208022

Log:
  Remove some stray ';'s
  
  Submitted by:	marc balmer

Modified:
  head/sys/mips/adm5120/if_admsw.c
  head/sys/mips/mips/elf_machdep.c

Modified: head/sys/mips/adm5120/if_admsw.c
==============================================================================
--- head/sys/mips/adm5120/if_admsw.c	Thu May 13 00:26:30 2010	(r208021)
+++ head/sys/mips/adm5120/if_admsw.c	Thu May 13 01:50:29 2010	(r208022)
@@ -528,7 +528,7 @@ admsw_attach(device_t dev)
 		ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO, 0, NULL);
 		ifmedia_set(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO);
 
-		ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);;
+		ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);
 
 		/* Setup interface parameters */
 		ifp->if_softc = sc;

Modified: head/sys/mips/mips/elf_machdep.c
==============================================================================
--- head/sys/mips/mips/elf_machdep.c	Thu May 13 00:26:30 2010	(r208021)
+++ head/sys/mips/mips/elf_machdep.c	Thu May 13 01:50:29 2010	(r208022)
@@ -159,7 +159,7 @@ static int
 elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
     int type, int local, elf_lookup_fn lookup)
 {
-	Elf_Addr *where = (Elf_Addr *)NULL;;
+	Elf_Addr *where = (Elf_Addr *)NULL;
 	Elf_Addr addr;
 	Elf_Addr addend = (Elf_Addr)0;
 	Elf_Word rtype = (Elf_Word)0, symidx;

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 02:03:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C44F7106564A;
	Thu, 13 May 2010 02:03:00 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B20308FC16;
	Thu, 13 May 2010 02:03:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D2305W089608;
	Thu, 13 May 2010 02:03:00 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D2305O089605;
	Thu, 13 May 2010 02:03:00 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005130203.o4D2305O089605@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 13 May 2010 02: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: r208023 - head/lib/libusbhid
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 02:03:00 -0000

Author: thompsa
Date: Thu May 13 02:03:00 2010
New Revision: 208023
URL: http://svn.freebsd.org/changeset/base/208023

Log:
  Use fixed width integer types for parsing the binary hid data.
  
  PR:		usb/146367
  Submitted by:	Hans Petter Selasky

Modified:
  head/lib/libusbhid/data.c
  head/lib/libusbhid/usbhid.h

Modified: head/lib/libusbhid/data.c
==============================================================================
--- head/lib/libusbhid/data.c	Thu May 13 01:50:29 2010	(r208022)
+++ head/lib/libusbhid/data.c	Thu May 13 02:03:00 2010	(r208023)
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "usbhid.h"
 
-int
+int32_t
 hid_get_data(const void *p, const hid_item_t *h)
 {
 	const uint8_t *buf;
@@ -78,12 +78,15 @@ hid_get_data(const void *p, const hid_it
 }
 
 void
-hid_set_data(void *p, const hid_item_t *h, int data)
+hid_set_data(void *p, const hid_item_t *h, int32_t data)
 {
 	uint8_t *buf;
 	uint32_t hpos;
 	uint32_t hsize;
-	int i, end, offs, mask;
+	uint32_t mask;
+	int i;
+	int end;
+	int offs;
 
 	buf = p;
 

Modified: head/lib/libusbhid/usbhid.h
==============================================================================
--- head/lib/libusbhid/usbhid.h	Thu May 13 01:50:29 2010	(r208022)
+++ head/lib/libusbhid/usbhid.h	Thu May 13 02:03:00 2010	(r208023)
@@ -29,7 +29,7 @@
  *
  */
 
-#include 
+#include 
 
 typedef struct report_desc *report_desc_t;
 
@@ -102,7 +102,7 @@ int hid_parse_usage_in_page(const char *
 int hid_parse_usage_page(const char *name);
 
 /* Extracting/insertion of data, data.c: */
-int hid_get_data(const void *p, const hid_item_t *h);
-void hid_set_data(void *p, const hid_item_t *h, int data);
+int32_t hid_get_data(const void *p, const hid_item_t *h);
+void hid_set_data(void *p, const hid_item_t *h, int32_t data);
 
 __END_DECLS

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 03:13:02 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79C33106566B;
	Thu, 13 May 2010 03:13:02 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com
	[209.85.211.181])
	by mx1.freebsd.org (Postfix) with ESMTP id D66378FC1D;
	Thu, 13 May 2010 03:13:01 +0000 (UTC)
Received: by ywh11 with SMTP id 11so394979ywh.7
	for ; Wed, 12 May 2010 20:13:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=8koAffvVL226IY4PI7gmgafiAikUpvyXUjNONKhh078=;
	b=nz1YV8EqRGKbuk9TWfmeaI+qpgDMPNp59Q737h8eq5QUrp7PKVOWJ6/odwBkEPOp+p
	4eSC389dSYVAvyqqAhGoCV1MJA71v/tDUyPK4evm4k+zxG6kRQ/1GAdFWvZvgKE940LB
	5HrWEVy9k/2AO8PhfcSRjyOFKKNoqjMf5ME5U=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=TAfw5xxS+89hyZKoaZdAU3sqvHUrPL/gR3gkkahBiS62KlhYHXyAf/QITK5yHgrpGP
	bPuETa57OCRzXfZtX3eFjKY3HFLWL3hVuZk+lTFJt1b+HChRCx3NdwOhEnNijuGD50V3
	15WpCbSi2WCpNwHjFCvMFvL0IeWDaU7v/Ka+g=
MIME-Version: 1.0
Received: by 10.101.203.1 with SMTP id f1mr5434171anq.242.1273720380987; Wed, 
	12 May 2010 20:13:00 -0700 (PDT)
Received: by 10.100.208.9 with HTTP; Wed, 12 May 2010 20:13:00 -0700 (PDT)
In-Reply-To: <201005122120.o4CLK4RE026849@svn.freebsd.org>
References: <201005122120.o4CLK4RE026849@svn.freebsd.org>
Date: Thu, 13 May 2010 07:13:00 +0400
Message-ID: 
From: pluknet 
To: Christian Brueffer 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r208002 - 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, 13 May 2010 03:13:02 -0000

On 13 May 2010 01:20, Christian Brueffer  wrote:
> Author: brueffer
> Date: Wed May 12 21:20:04 2010
> New Revision: 208002
> URL: http://svn.freebsd.org/changeset/base/208002
>
> Log:
> =A0Note 8.0-RELEASE.
>
> =A0PR: =A0 =A0 =A0 =A0 =A0 143824
> =A0Submitted by: pluknet 
>
> Modified:
> =A0head/UPDATING
>
> Modified: head/UPDATING
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=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/UPDATING =A0 =A0 =A0 Wed May 12 20:58:08 2010 =A0 =A0 =A0 =A0(r2=
08001)
> +++ head/UPDATING =A0 =A0 =A0 Wed May 12 21:20:04 2010 =A0 =A0 =A0 =A0(r2=
08002)
> @@ -83,6 +83,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
>
> =A0 =A0 =A0 =A0The meanings correspond to the relevant IPv4 variables.
>
> +20091125:
> + =A0 =A0 =A0 8.0-RELEASE.
> +
> =A020091113:
> =A0 =A0 =A0 =A0The default terminal emulation for syscons(4) has been cha=
nged
> =A0 =A0 =A0 =A0from cons25 to xterm on all platforms except pc98. =A0This=
 means

Woops, that should have been committed directly to stable/8, not touching h=
ead.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 03:37:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D51B106566B;
	Thu, 13 May 2010 03:37:39 +0000 (UTC)
	(envelope-from kensmith@buffalo.edu)
Received: from localmailB.acsu.buffalo.edu (localmail.buffalo.edu
	[128.205.5.200])
	by mx1.freebsd.org (Postfix) with ESMTP id DDEB78FC14;
	Thu, 13 May 2010 03:37:38 +0000 (UTC)
Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1])
	by localhost (Postfix) with SMTP id C6D46633;
	Wed, 12 May 2010 23:37:37 -0400 (EDT)
Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1])
	by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 1547E9D0;
	Wed, 12 May 2010 23:37:37 -0400 (EDT)
Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239])
	by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 0BA019FB;
	Wed, 12 May 2010 23:37:37 -0400 (EDT)
Received: from ken-smiths-macbook-pro.local (unknown [24.114.252.231])
	by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id AF5B4207AA;
	Wed, 12 May 2010 23:37:36 -0400 (EDT)
Message-ID: <4BEB73FF.8040601@buffalo.edu>
Date: Wed, 12 May 2010 23:37:35 -0400
From: Ken Smith 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: pluknet 
References: <201005122120.o4CLK4RE026849@svn.freebsd.org>
	
In-Reply-To: 
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-PM-EL-Spam-Prob: : 8%
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Christian Brueffer 
Subject: Re: svn commit: r208002 - 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, 13 May 2010 03:37:39 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/12/10 11:13 PM, pluknet wrote:
> On 13 May 2010 01:20, Christian Brueffer  wrote:
>> Author: brueffer
>> Date: Wed May 12 21:20:04 2010
>> New Revision: 208002
>> URL: http://svn.freebsd.org/changeset/base/208002
>>
>> Log:
>>  Note 8.0-RELEASE.
>>
>>  PR:           143824
>>  Submitted by: pluknet 
>>
>> Modified:
>>  head/UPDATING
>>
>> Modified: head/UPDATING
>> ==============================================================================
>> --- head/UPDATING       Wed May 12 20:58:08 2010        (r208001)
>> +++ head/UPDATING       Wed May 12 21:20:04 2010        (r208002)
>> @@ -83,6 +83,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
>>
>>        The meanings correspond to the relevant IPv4 variables.
>>
>> +20091125:
>> +       8.0-RELEASE.
>> +
>>  20091113:
>>        The default terminal emulation for syscons(4) has been changed
>>        from cons25 to xterm on all platforms except pc98.  This means
> 
> Woops, that should have been committed directly to stable/8, not touching head.
> 

Why should it be added to stable/8 when no other release is noted
there?


- -- 
						Ken Smith
- - From there to here, from here to      |       kensmith@buffalo.edu
  there, funny things are everywhere.   |
                      - Theodore Geisel |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvrc/8ACgkQ/G14VSmup/ZrrgCeJ40cdyJV/4xY79uN9fcVBj6k
XAYAn2v3JKesJOBgp97ZbkfkRDCDYZbP
=9Aeo
-----END PGP SIGNATURE-----

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 03:52:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0C8A106566C;
	Thu, 13 May 2010 03:52:10 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 178248FC14;
	Thu, 13 May 2010 03:52:09 +0000 (UTC)
Received: by gwj16 with SMTP id 16so530282gwj.13
	for ; Wed, 12 May 2010 20:52:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=NyUPT/ex0cIwKW7ghlEPYUz2LOosjCyidrfmClg43MM=;
	b=dzB4SeskGrXdg+9TJqAT+wNOqz3Niq/dTkpQxGIN1h8di7Vhv6F6490LVs5c+E7Szo
	q5neT0Tmfas1+5dmOpJxnG/H+av831HyA7Y66v95V0SpGZ1xvzvrY1ou2fJm2jN4Hwa5
	8ER4x9RtbqLdk8nhGO8CGCFgRc2FU+84DlstA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=AiBu5AtuDazkji/NynHMZkjnr1MOoGJI06WnXwmdRqX6OoCX1SeRnWSBGxWc2h16RV
	2X2bhnJdzGrLMAokMvaMJCYQSyUOKGDlZsHo9tkJsTmYvB0ms9KNluZR0VDh48jSNJJu
	ONob1q9KWnnmFZUf6WAzF/2t3eD41VfE1vDQg=
MIME-Version: 1.0
Received: by 10.101.29.16 with SMTP id g16mr5661302anj.245.1273722728914; Wed, 
	12 May 2010 20:52:08 -0700 (PDT)
Received: by 10.100.208.9 with HTTP; Wed, 12 May 2010 20:52:08 -0700 (PDT)
In-Reply-To: <4BEB73FF.8040601@buffalo.edu>
References: <201005122120.o4CLK4RE026849@svn.freebsd.org>
	
	<4BEB73FF.8040601@buffalo.edu>
Date: Thu, 13 May 2010 07:52:08 +0400
Message-ID: 
From: pluknet 
To: Ken Smith 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Christian Brueffer 
Subject: Re: svn commit: r208002 - 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, 13 May 2010 03:52:10 -0000

On 13 May 2010 07:37, Ken Smith  wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 5/12/10 11:13 PM, pluknet wrote:
>> On 13 May 2010 01:20, Christian Brueffer  wrote:
>>> Author: brueffer
>>> Date: Wed May 12 21:20:04 2010
>>> New Revision: 208002
>>> URL: http://svn.freebsd.org/changeset/base/208002
>>>
>>> Log:
>>> =A0Note 8.0-RELEASE.
>>>
>>> =A0PR: =A0 =A0 =A0 =A0 =A0 143824
>>> =A0Submitted by: pluknet 
>>>
>>> Modified:
>>> =A0head/UPDATING
>>>
>>> Modified: head/UPDATING
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=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/UPDATING =A0 =A0 =A0 Wed May 12 20:58:08 2010 =A0 =A0 =A0 =A0(=
r208001)
>>> +++ head/UPDATING =A0 =A0 =A0 Wed May 12 21:20:04 2010 =A0 =A0 =A0 =A0(=
r208002)
>>> @@ -83,6 +83,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
>>>
>>> =A0 =A0 =A0 =A0The meanings correspond to the relevant IPv4 variables.
>>>
>>> +20091125:
>>> + =A0 =A0 =A0 8.0-RELEASE.
>>> +
>>> =A020091113:
>>> =A0 =A0 =A0 =A0The default terminal emulation for syscons(4) has been c=
hanged
>>> =A0 =A0 =A0 =A0from cons25 to xterm on all platforms except pc98. =A0Th=
is means
>>
>> Woops, that should have been committed directly to stable/8, not touchin=
g head.
>>
>
> Why should it be added to stable/8 when no other release is noted
> there?
>

No other release is rather not *yet* noted there, I would say, since
that's the first one.
If you look at the previous stable branches, you''ll find a scheme, where e=
ach
stable branch has notes about every releases, besides from that branch only=
.
If that scheme was changed before stable/8, please correct me.

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 03:56:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 400DD106566B;
	Thu, 13 May 2010 03:56:58 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E74F8FC1B;
	Thu, 13 May 2010 03:56:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D3uwJu015064;
	Thu, 13 May 2010 03:56:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D3uwc3015062;
	Thu, 13 May 2010 03:56:58 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005130356.o4D3uwc3015062@svn.freebsd.org>
From: Christian Brueffer 
Date: Thu, 13 May 2010 03:56: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: r208024 - head/release/doc/en_US.ISO8859-1/hardware
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 03:56:58 -0000

Author: brueffer
Date: Thu May 13 03:56:57 2010
New Revision: 208024
URL: http://svn.freebsd.org/changeset/base/208024

Log:
  et.4 doesn't have a HARDWARE section. Unbreak the build by manually
  describing the supported et(4) chips.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Thu May 13 02:03:00 2010	(r208023)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Thu May 13 03:56:57 2010	(r208024)
@@ -842,7 +842,8 @@
 
       &hwlist.ep;
 
-      &hwlist.et;
+      Agere ET1310 Gigabit Ethernet adapters
+	(&man.et.4; driver)
 
       &hwlist.ex;
 

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 04:02:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66CCE1065672;
	Thu, 13 May 2010 04:02:18 +0000 (UTC)
	(envelope-from kensmith@buffalo.edu)
Received: from localmailA.acsu.buffalo.edu (localmailA.acsu.buffalo.edu
	[128.205.5.196])
	by mx1.freebsd.org (Postfix) with ESMTP id 3230D8FC0C;
	Thu, 13 May 2010 04:02:17 +0000 (UTC)
Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1])
	by localhost (Postfix) with SMTP id 4A557B4E6;
	Thu, 13 May 2010 00:02:17 -0400 (EDT)
Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1])
	by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 7FB7EB4F4;
	Thu, 13 May 2010 00:02:16 -0400 (EDT)
Received: from mweb1.acsu.buffalo.edu (mweb1.acsu.buffalo.edu [128.205.5.238])
	by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id 76F1CB4EF;
	Thu, 13 May 2010 00:02:16 -0400 (EDT)
Received: from ken-smiths-macbook-pro.local (unknown [24.114.252.231])
	by mweb1.acsu.buffalo.edu (Postfix) with ESMTP id 208635B003A;
	Thu, 13 May 2010 00:02:16 -0400 (EDT)
Message-ID: <4BEB79C6.1050105@buffalo.edu>
Date: Thu, 13 May 2010 00:02:14 -0400
From: Ken Smith 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: pluknet 
References: <201005122120.o4CLK4RE026849@svn.freebsd.org>	
		
	<4BEB73FF.8040601@buffalo.edu>
	
In-Reply-To: 
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-PM-EL-Spam-Prob: : 8%
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Christian Brueffer 
Subject: Re: svn commit: r208002 - 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, 13 May 2010 04:02:18 -0000

On 5/12/10 11:52 PM, pluknet wrote:
> On 13 May 2010 07:37, Ken Smith  wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 5/12/10 11:13 PM, pluknet wrote:
>>> On 13 May 2010 01:20, Christian Brueffer  wrote:
>>>> Author: brueffer
>>>> Date: Wed May 12 21:20:04 2010
>>>> New Revision: 208002
>>>> URL: http://svn.freebsd.org/changeset/base/208002
>>>>
>>>> Log:
>>>>  Note 8.0-RELEASE.
>>>>
>>>>  PR:           143824
>>>>  Submitted by: pluknet 
>>>>
>>>> Modified:
>>>>  head/UPDATING
>>>>
>>>> Modified: head/UPDATING
>>>> ==============================================================================
>>>> --- head/UPDATING       Wed May 12 20:58:08 2010        (r208001)
>>>> +++ head/UPDATING       Wed May 12 21:20:04 2010        (r208002)
>>>> @@ -83,6 +83,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
>>>>
>>>>        The meanings correspond to the relevant IPv4 variables.
>>>>
>>>> +20091125:
>>>> +       8.0-RELEASE.
>>>> +
>>>>  20091113:
>>>>        The default terminal emulation for syscons(4) has been changed
>>>>        from cons25 to xterm on all platforms except pc98.  This means
>>>
>>> Woops, that should have been committed directly to stable/8, not touching head.
>>>
>>
>> Why should it be added to stable/8 when no other release is noted
>> there?
>>
> 
> No other release is rather not *yet* noted there, I would say, since
> that's the first one.
> If you look at the previous stable branches, you''ll find a scheme, where each
> stable branch has notes about every releases, besides from that branch only.
> If that scheme was changed before stable/8, please correct me.
> 

Grumble.  Yes you're right.  I forgot that one gets added to
both the releng/X.Y/UPDATING and stable/X/UPDATING.  No previous
mentions of releases because that version of UPDATING had most
recently been on HEAD and that's the one that never gets the
release dates noted on it, just the branch dates.

Sorry, long day...  :-(

-- 
						Ken Smith
- From there to here, from here to      |       kensmith@buffalo.edu
  there, funny things are everywhere.   |
                      - Theodore Geisel |

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 09:26:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D334F106566B;
	Thu, 13 May 2010 09:26:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C1D488FC0C;
	Thu, 13 May 2010 09:26:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D9QVVq087487;
	Thu, 13 May 2010 09:26:31 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D9QVIi087486;
	Thu, 13 May 2010 09:26:31 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005130926.o4D9QVIi087486@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 09:26:31 +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: r208025 - stable/8/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: Thu, 13 May 2010 09:26:31 -0000

Author: kib
Date: Thu May 13 09:26:31 2010
New Revision: 208025
URL: http://svn.freebsd.org/changeset/base/208025

Log:
  MFC r207364:
  In swap pager, do not free the non-requested pages from the run if they are
  wired. Kstack pages are wired, this change prepares swap pager for handling
  of long runs of kstack pages.

Modified:
  stable/8/sys/vm/swap_pager.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/vm/swap_pager.c
==============================================================================
--- stable/8/sys/vm/swap_pager.c	Thu May 13 03:56:57 2010	(r208024)
+++ stable/8/sys/vm/swap_pager.c	Thu May 13 09:26:31 2010	(r208025)
@@ -374,6 +374,14 @@ static void swp_pager_meta_free(vm_objec
 static void swp_pager_meta_free_all(vm_object_t);
 static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int);
 
+static void
+swp_pager_free_nrpage(vm_page_t m)
+{
+
+	if (m->wire_count == 0)
+		vm_page_free(m);
+}
+
 /*
  * SWP_SIZECHECK() -	update swap_pager_full indication
  *	
@@ -1128,9 +1136,9 @@ swap_pager_getpages(vm_object_t object, 
 
 		vm_page_lock_queues();
 		for (k = 0; k < i; ++k)
-			vm_page_free(m[k]);
+			swp_pager_free_nrpage(m[k]);
 		for (k = j; k < count; ++k)
-			vm_page_free(m[k]);
+			swp_pager_free_nrpage(m[k]);
 		vm_page_unlock_queues();
 	}
 
@@ -1529,7 +1537,7 @@ swp_pager_async_iodone(struct buf *bp)
 				 */
 				m->valid = 0;
 				if (i != bp->b_pager.pg_reqpage)
-					vm_page_free(m);
+					swp_pager_free_nrpage(m);
 				else
 					vm_page_flash(m);
 				/*

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 09:59:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03D58106566B;
	Thu, 13 May 2010 09:59:11 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E70FD8FC23;
	Thu, 13 May 2010 09:59:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4D9xAqC094722;
	Thu, 13 May 2010 09:59:10 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4D9xAtJ094720;
	Thu, 13 May 2010 09:59:10 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005130959.o4D9xAtJ094720@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 09:59: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: r208026 - 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: Thu, 13 May 2010 09:59:11 -0000

Author: kib
Date: Thu May 13 09:59:10 2010
New Revision: 208026
URL: http://svn.freebsd.org/changeset/base/208026

Log:
  Do not use .extern, it is not strictly needed with gas and it is custom
  to omit it.
  
  Requested by:	bde
  MFC after:	6 days

Modified:
  head/sys/amd64/amd64/apic_vector.S

Modified: head/sys/amd64/amd64/apic_vector.S
==============================================================================
--- head/sys/amd64/amd64/apic_vector.S	Thu May 13 09:26:31 2010	(r208025)
+++ head/sys/amd64/amd64/apic_vector.S	Thu May 13 09:59:10 2010	(r208026)
@@ -41,7 +41,6 @@
 
 #include "assym.s"
 
-	.extern	doreti_iret
 /*
  * I/O Interrupt Entry Point.  Rather than having one entry point for
  * each interrupt source, we use one entry point for each 32-bit word

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 12:07:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C01E106566C;
	Thu, 13 May 2010 12:07:56 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 16CCE8FC1E;
	Thu, 13 May 2010 12:07:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DC7tX6028462;
	Thu, 13 May 2010 12:07:55 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DC7tcF028433;
	Thu, 13 May 2010 12:07:55 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005131207.o4DC7tcF028433@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 13 May 2010 12:07: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: r208027 - in head: lib/libarchive lib/libc/gen
	lib/libc/stdio lib/libc/stdlib lib/libc/string lib/libc/sys
	lib/libpmc lib/msun/man sbin/fsirand sbin/mksnap_ffs
	sbin/mount sbin/mount_msd...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 12:07:56 -0000

Author: uqs
Date: Thu May 13 12:07:55 2010
New Revision: 208027
URL: http://svn.freebsd.org/changeset/base/208027

Log:
  mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
  bottom of the manpages and order them consistently.
  
  GNU groff doesn't care about the ordering, and doesn't even mention
  CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
  them.
  
  Found by:	mdocml lint run
  Reviewed by:	ru

Modified:
  head/lib/libarchive/cpio.5
  head/lib/libc/gen/fmtcheck.3
  head/lib/libc/stdio/fgets.3
  head/lib/libc/stdio/printf.3
  head/lib/libc/stdio/tmpnam.3
  head/lib/libc/stdio/wprintf.3
  head/lib/libc/stdlib/realpath.3
  head/lib/libc/string/strcat.3
  head/lib/libc/string/strcpy.3
  head/lib/libc/sys/access.2
  head/lib/libc/sys/execve.2
  head/lib/libc/sys/setuid.2
  head/lib/libpmc/pmc.mips.3
  head/lib/libpmc/pmc.xscale.3
  head/lib/msun/man/fenv.3
  head/sbin/fsirand/fsirand.8
  head/sbin/mksnap_ffs/mksnap_ffs.8
  head/sbin/mount/mount.8
  head/sbin/mount_msdosfs/mount_msdosfs.8
  head/sbin/mount_ntfs/mount_ntfs.8
  head/sbin/mount_reiserfs/mount_reiserfs.8
  head/sbin/mount_std/mount_std.8
  head/sbin/rcorder/rcorder.8
  head/share/man/man4/ae.4
  head/share/man/man4/ahb.4
  head/share/man/man4/amdtemp.4
  head/share/man/man4/ataraid.4
  head/share/man/man4/cpuctl.4
  head/share/man/man4/ed.4
  head/share/man/man4/ef.4
  head/share/man/man4/en.4
  head/share/man/man4/fpa.4
  head/share/man/man4/geom_fox.4
  head/share/man/man4/harp.4
  head/share/man/man4/hatm.4
  head/share/man/man4/hifn.4
  head/share/man/man4/hwpmc.4
  head/share/man/man4/inet.4
  head/share/man/man4/kbdmux.4
  head/share/man/man4/ksyms.4
  head/share/man/man4/man4.i386/cs.4
  head/share/man/man4/man4.i386/ie.4
  head/share/man/man4/man4.i386/mse.4
  head/share/man/man4/man4.i386/pnp.4
  head/share/man/man4/man4.i386/pnpbios.4
  head/share/man/man4/man4.i386/vx.4
  head/share/man/man4/man4.i386/wl.4
  head/share/man/man4/man4.powerpc/snd_ai2s.4
  head/share/man/man4/man4.powerpc/snd_davbus.4
  head/share/man/man4/man4.sparc64/clkbrd.4
  head/share/man/man4/man4.sparc64/creator.4
  head/share/man/man4/man4.sparc64/machfb.4
  head/share/man/man4/man4.sparc64/ofw_console.4
  head/share/man/man4/man4.sparc64/openfirm.4
  head/share/man/man4/man4.sparc64/openprom.4
  head/share/man/man4/natm.4
  head/share/man/man4/nve.4
  head/share/man/man4/patm.4
  head/share/man/man4/psm.4
  head/share/man/man4/splash.4
  head/share/man/man4/syscons.4
  head/share/man/man4/twa.4   (contents, props changed)
  head/share/man/man4/ucom.4
  head/share/man/man4/vkbd.4
  head/share/man/man4/wpi.4
  head/share/man/man5/make.conf.5
  head/share/man/man5/reiserfs.5
  head/share/man/man5/xfs.5
  head/share/man/man9/fail.9
  head/share/man/man9/mbpool.9
  head/sys/boot/forth/loader.conf.5
  head/tools/tools/vimage/vimage.8
  head/usr.bin/bsdiff/bsdiff/bsdiff.1
  head/usr.bin/bsdiff/bspatch/bspatch.1
  head/usr.sbin/adduser/adduser.conf.5
  head/usr.sbin/bluetooth/bthidd/bthidd.8
  head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
  head/usr.sbin/cpucontrol/cpucontrol.8
  head/usr.sbin/crunch/crunchgen/crunchgen.1
  head/usr.sbin/mount_portalfs/mount_portalfs.8
  head/usr.sbin/moused/moused.8
  head/usr.sbin/mtree/mtree.5
  head/usr.sbin/rtprio/rtprio.1

Modified: head/lib/libarchive/cpio.5
==============================================================================
--- head/lib/libarchive/cpio.5	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libarchive/cpio.5	Thu May 13 12:07:55 2010	(r208027)
@@ -268,31 +268,6 @@ data, including ACLs and extended attrib
 entries in cpio archives.
 .Pp
 XXX Others? XXX
-.Sh BUGS
-The
-.Dq CRC
-format is mis-named, as it uses a simple checksum and
-not a cyclic redundancy check.
-.Pp
-The old binary format is limited to 16 bits for user id,
-group id, device, and inode numbers.
-It is limited to 4 gigabyte file sizes.
-.Pp
-The old ASCII format is limited to 18 bits for
-the user id, group id, device, and inode numbers.
-It is limited to 8 gigabyte file sizes.
-.Pp
-The new ASCII format is limited to 4 gigabyte file sizes.
-.Pp
-None of the cpio formats store user or group names,
-which are essential when moving files between systems with
-dissimilar user or group numbering.
-.Pp
-Especially when writing older cpio variants, it may be necessary
-to map actual device/inode values to synthesized values that
-fit the available fields.
-With very large filesystems, this may be necessary even for
-the newer formats.
 .Sh SEE ALSO
 .Xr cpio 1 ,
 .Xr tar 5
@@ -323,3 +298,28 @@ license.
 The character format was adopted as part of
 .St -p1003.1-88 .
 XXX when did "newc" appear?  Who invented it?  When did HP come out with their variant?  When did Sun introduce ACLs and extended attributes? XXX
+.Sh BUGS
+The
+.Dq CRC
+format is mis-named, as it uses a simple checksum and
+not a cyclic redundancy check.
+.Pp
+The old binary format is limited to 16 bits for user id,
+group id, device, and inode numbers.
+It is limited to 4 gigabyte file sizes.
+.Pp
+The old ASCII format is limited to 18 bits for
+the user id, group id, device, and inode numbers.
+It is limited to 8 gigabyte file sizes.
+.Pp
+The new ASCII format is limited to 4 gigabyte file sizes.
+.Pp
+None of the cpio formats store user or group names,
+which are essential when moving files between systems with
+dissimilar user or group numbering.
+.Pp
+Especially when writing older cpio variants, it may be necessary
+to map actual device/inode values to synthesized values that
+fit the available fields.
+With very large filesystems, this may be necessary even for
+the newer formats.

Modified: head/lib/libc/gen/fmtcheck.3
==============================================================================
--- head/lib/libc/gen/fmtcheck.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/gen/fmtcheck.3	Thu May 13 12:07:55 2010	(r208027)
@@ -87,6 +87,12 @@ will return
 .Fa fmt_suspect .
 Otherwise, it will return
 .Fa fmt_default .
+.Sh SEE ALSO
+.Xr printf 3
+.Sh BUGS
+The
+.Fn fmtcheck
+function does not recognize positional parameters.
 .Sh SECURITY CONSIDERATIONS
 Note that the formats may be quite different as long as they accept the
 same arguments.
@@ -100,9 +106,3 @@ is not equivalent to
 .Qq Li %lx
 because
 the first requires an integer and the second requires a long.
-.Sh SEE ALSO
-.Xr printf 3
-.Sh BUGS
-The
-.Fn fmtcheck
-function does not recognize positional parameters.

Modified: head/lib/libc/stdio/fgets.3
==============================================================================
--- head/lib/libc/stdio/fgets.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/stdio/fgets.3	Thu May 13 12:07:55 2010	(r208027)
@@ -128,6 +128,19 @@ may also fail and set
 .Va errno
 for any of the errors specified for the routine
 .Xr getchar 3 .
+.Sh SEE ALSO
+.Xr feof 3 ,
+.Xr ferror 3 ,
+.Xr fgetln 3 ,
+.Xr fgetws 3 ,
+.Xr getline 3
+.Sh STANDARDS
+The functions
+.Fn fgets
+and
+.Fn gets
+conform to
+.St -isoC-99 .
 .Sh SECURITY CONSIDERATIONS
 The
 .Fn gets
@@ -143,16 +156,3 @@ It is strongly suggested that the
 function be used in all cases.
 (See
 the FSA.)
-.Sh SEE ALSO
-.Xr feof 3 ,
-.Xr ferror 3 ,
-.Xr fgetln 3 ,
-.Xr fgetws 3 ,
-.Xr getline 3
-.Sh STANDARDS
-The functions
-.Fn fgets
-and
-.Fn gets
-conform to
-.St -isoC-99 .

Modified: head/lib/libc/stdio/printf.3
==============================================================================
--- head/lib/libc/stdio/printf.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/stdio/printf.3	Thu May 13 12:07:55 2010	(r208027)
@@ -709,77 +709,6 @@ char *newfmt(const char *fmt, ...)
 	return (p);
 }
 .Ed
-.Sh SECURITY CONSIDERATIONS
-The
-.Fn sprintf
-and
-.Fn vsprintf
-functions are easily misused in a manner which enables malicious users
-to arbitrarily change a running program's functionality through
-a buffer overflow attack.
-Because
-.Fn sprintf
-and
-.Fn vsprintf
-assume an infinitely long string,
-callers must be careful not to overflow the actual space;
-this is often hard to assure.
-For safety, programmers should use the
-.Fn snprintf
-interface instead.
-For example:
-.Bd -literal
-void
-foo(const char *arbitrary_string, const char *and_another)
-{
-	char onstack[8];
-
-#ifdef BAD
-	/*
-	 * This first sprintf is bad behavior.  Do not use sprintf!
-	 */
-	sprintf(onstack, "%s, %s", arbitrary_string, and_another);
-#else
-	/*
-	 * The following two lines demonstrate better use of
-	 * snprintf().
-	 */
-	snprintf(onstack, sizeof(onstack), "%s, %s", arbitrary_string,
-	    and_another);
-#endif
-}
-.Ed
-.Pp
-The
-.Fn printf
-and
-.Fn sprintf
-family of functions are also easily misused in a manner
-allowing malicious users to arbitrarily change a running program's
-functionality by either causing the program
-to print potentially sensitive data
-.Dq "left on the stack" ,
-or causing it to generate a memory fault or bus error
-by dereferencing an invalid pointer.
-.Pp
-.Cm %n
-can be used to write arbitrary data to potentially carefully-selected
-addresses.
-Programmers are therefore strongly advised to never pass untrusted strings
-as the
-.Fa format
-argument, as an attacker can put format specifiers in the string
-to mangle your stack,
-leading to a possible security hole.
-This holds true even if the string was built using a function like
-.Fn snprintf ,
-as the resulting string may still contain user-supplied conversion specifiers
-for later interpolation by
-.Fn printf .
-.Pp
-Always use the proper secure idiom:
-.Pp
-.Dl "snprintf(buffer, sizeof(buffer), \*q%s\*q, string);"
 .Sh COMPATIBILITY
 Many application writers used the name
 .Va dprintf
@@ -906,3 +835,74 @@ The
 family of functions do not correctly handle multibyte characters in the
 .Fa format
 argument.
+.Sh SECURITY CONSIDERATIONS
+The
+.Fn sprintf
+and
+.Fn vsprintf
+functions are easily misused in a manner which enables malicious users
+to arbitrarily change a running program's functionality through
+a buffer overflow attack.
+Because
+.Fn sprintf
+and
+.Fn vsprintf
+assume an infinitely long string,
+callers must be careful not to overflow the actual space;
+this is often hard to assure.
+For safety, programmers should use the
+.Fn snprintf
+interface instead.
+For example:
+.Bd -literal
+void
+foo(const char *arbitrary_string, const char *and_another)
+{
+	char onstack[8];
+
+#ifdef BAD
+	/*
+	 * This first sprintf is bad behavior.  Do not use sprintf!
+	 */
+	sprintf(onstack, "%s, %s", arbitrary_string, and_another);
+#else
+	/*
+	 * The following two lines demonstrate better use of
+	 * snprintf().
+	 */
+	snprintf(onstack, sizeof(onstack), "%s, %s", arbitrary_string,
+	    and_another);
+#endif
+}
+.Ed
+.Pp
+The
+.Fn printf
+and
+.Fn sprintf
+family of functions are also easily misused in a manner
+allowing malicious users to arbitrarily change a running program's
+functionality by either causing the program
+to print potentially sensitive data
+.Dq "left on the stack" ,
+or causing it to generate a memory fault or bus error
+by dereferencing an invalid pointer.
+.Pp
+.Cm %n
+can be used to write arbitrary data to potentially carefully-selected
+addresses.
+Programmers are therefore strongly advised to never pass untrusted strings
+as the
+.Fa format
+argument, as an attacker can put format specifiers in the string
+to mangle your stack,
+leading to a possible security hole.
+This holds true even if the string was built using a function like
+.Fn snprintf ,
+as the resulting string may still contain user-supplied conversion specifiers
+for later interpolation by
+.Fn printf .
+.Pp
+Always use the proper secure idiom:
+.Pp
+.Dl "snprintf(buffer, sizeof(buffer), \*q%s\*q, string);"

Modified: head/lib/libc/stdio/tmpnam.3
==============================================================================
--- head/lib/libc/stdio/tmpnam.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/stdio/tmpnam.3	Thu May 13 12:07:55 2010	(r208027)
@@ -217,6 +217,17 @@ for any of the errors specified for the 
 .Xr malloc 3
 or
 .Xr mktemp 3 .
+.Sh SEE ALSO
+.Xr mkstemp 3 ,
+.Xr mktemp 3
+.Sh STANDARDS
+The
+.Fn tmpfile
+and
+.Fn tmpnam
+functions
+conform to
+.St -isoC .
 .Sh SECURITY CONSIDERATIONS
 The
 .Fn tmpnam
@@ -235,14 +246,3 @@ It is strongly suggested that
 be used in place of these functions.
 (See
 the FSA.)
-.Sh SEE ALSO
-.Xr mkstemp 3 ,
-.Xr mktemp 3
-.Sh STANDARDS
-The
-.Fn tmpfile
-and
-.Fn tmpnam
-functions
-conform to
-.St -isoC .

Modified: head/lib/libc/stdio/wprintf.3
==============================================================================
--- head/lib/libc/stdio/wprintf.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/stdio/wprintf.3	Thu May 13 12:07:55 2010	(r208027)
@@ -588,9 +588,6 @@ In no case does a non-existent or small 
 a numeric field; if the result of a conversion is wider than the field
 width, the
 field is expanded to contain the conversion result.
-.Sh SECURITY CONSIDERATIONS
-Refer to
-.Xr printf 3 .
 .Sh SEE ALSO
 .Xr btowc 3 ,
 .Xr fputws 3 ,
@@ -616,3 +613,6 @@ and
 functions
 conform to
 .St -isoC-99 .
+.Sh SECURITY CONSIDERATIONS
+Refer to
+.Xr printf 3 .

Modified: head/lib/libc/stdlib/realpath.3
==============================================================================
--- head/lib/libc/stdlib/realpath.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/stdlib/realpath.3	Thu May 13 12:07:55 2010	(r208027)
@@ -109,6 +109,18 @@ for any of the errors specified for the 
 .Xr readlink 2
 and
 .Xr getcwd 3 .
+.Sh SEE ALSO
+.Xr getcwd 3
+.Sh STANDARDS
+The
+.Fn realpath
+function conforms to
+.St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Fn realpath
+function first appeared in
+.Bx 4.4 .
 .Sh CAVEATS
 This implementation of
 .Fn realpath
@@ -121,15 +133,3 @@ under certain circumstances, return a re
 .Fa resolved_path
 when given a relative
 .Fa pathname .
-.Sh "SEE ALSO"
-.Xr getcwd 3
-.Sh STANDARDS
-The
-.Fn realpath
-function conforms to
-.St -p1003.1-2001 .
-.Sh HISTORY
-The
-.Fn realpath
-function first appeared in
-.Bx 4.4 .

Modified: head/lib/libc/string/strcat.3
==============================================================================
--- head/lib/libc/string/strcat.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/string/strcat.3	Thu May 13 12:07:55 2010	(r208027)
@@ -80,6 +80,23 @@ and
 functions
 return the pointer
 .Fa s .
+.Sh SEE ALSO
+.Xr bcopy 3 ,
+.Xr memccpy 3 ,
+.Xr memcpy 3 ,
+.Xr memmove 3 ,
+.Xr strcpy 3 ,
+.Xr strlcat 3 ,
+.Xr strlcpy 3 ,
+.Xr wcscat 3
+.Sh STANDARDS
+The
+.Fn strcat
+and
+.Fn strncat
+functions
+conform to
+.St -isoC .
 .Sh SECURITY CONSIDERATIONS
 The
 .Fn strcat
@@ -138,20 +155,3 @@ foo(const char *arbitrary_string)
 #endif
 }
 .Ed
-.Sh SEE ALSO
-.Xr bcopy 3 ,
-.Xr memccpy 3 ,
-.Xr memcpy 3 ,
-.Xr memmove 3 ,
-.Xr strcpy 3 ,
-.Xr strlcat 3 ,
-.Xr strlcpy 3 ,
-.Xr wcscat 3
-.Sh STANDARDS
-The
-.Fn strcat
-and
-.Fn strncat
-functions
-conform to
-.St -isoC .

Modified: head/lib/libc/string/strcpy.3
==============================================================================
--- head/lib/libc/string/strcpy.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/string/strcpy.3	Thu May 13 12:07:55 2010	(r208027)
@@ -174,16 +174,6 @@ Note that because
 .Xr strlcpy 3
 is not defined in any standards, it should
 only be used when portability is not a concern.
-.Sh SECURITY CONSIDERATIONS
-The
-.Fn strcpy
-function is easily misused in a manner which enables malicious users
-to arbitrarily change a running program's functionality through a
-buffer overflow attack.
-(See
-the FSA
-and
-.Sx EXAMPLES . )
 .Sh SEE ALSO
 .Xr bcopy 3 ,
 .Xr memccpy 3 ,
@@ -214,3 +204,13 @@ and
 .Fn stpncpy
 was added in
 .Fx 8.0 .
+.Sh SECURITY CONSIDERATIONS
+The
+.Fn strcpy
+function is easily misused in a manner which enables malicious users
+to arbitrarily change a running program's functionality through a
+buffer overflow attack.
+(See
+the FSA
+and
+.Sx EXAMPLES . )

Modified: head/lib/libc/sys/access.2
==============================================================================
--- head/lib/libc/sys/access.2	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/sys/access.2	Thu May 13 12:07:55 2010	(r208027)
@@ -188,6 +188,27 @@ is neither
 .Dv AT_FDCWD
 nor a file descriptor associated with a directory.
 .El
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr intro 2 ,
+.Xr stat 2
+.Sh STANDARDS
+The
+.Fn access
+system call is expected to conform to
+.St -p1003.1-90 .
+The
+.Fn faccessat
+system call follows The Open Group Extended API Set 2 specification.
+.Sh HISTORY
+The
+.Fn access
+function appeared in
+.At v7 .
+The
+.Fn faccessat
+system call appeared in
+.Fx 8.0 .
 .Sh SECURITY CONSIDERATIONS
 The
 .Fn access
@@ -212,24 +233,3 @@ of the st_mode bits that the application
 e.g. in the case of AFS).
 It also allows a cheaper file existence test than
 .Xr stat 2 .
-.Sh SEE ALSO
-.Xr chmod 2 ,
-.Xr intro 2 ,
-.Xr stat 2
-.Sh STANDARDS
-The
-.Fn access
-system call is expected to conform to
-.St -p1003.1-90 .
-The
-.Fn faccessat
-system call follows The Open Group Extended API Set 2 specification.
-.Sh HISTORY
-The
-.Fn access
-function appeared in
-.At v7 .
-The
-.Fn faccessat
-system call appeared in
-.Fx 8.0 .

Modified: head/lib/libc/sys/execve.2
==============================================================================
--- head/lib/libc/sys/execve.2	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/sys/execve.2	Thu May 13 12:07:55 2010	(r208027)
@@ -313,30 +313,6 @@ The
 .Fa fd
 argument is not a valid file descriptor open for executing.
 .El
-.Sh CAVEATS
-If a program is
-.Em setuid
-to a non-super-user, but is executed when
-the real
-.Em uid
-is ``root'', then the program has some of the powers
-of a super-user as well.
-.Pp
-When executing an interpreted program through
-.Fn fexecve ,
-kernel supplies
-.Pa /dev/fd/n
-as a second argument to the interpreter,
-where
-.Ar n
-is the file descriptor passed in the
-.Fa fd
-argument to
-.Fn fexecve .
-For this construction to work correctly, the
-.Xr fdescfs 5
-filesystem shall be mounted on
-.Pa /dev/fd .
 .Sh SEE ALSO
 .Xr ktrace 1 ,
 .Xr _exit 2 ,
@@ -373,3 +349,27 @@ The
 .Fn fexecve
 system call appeared in
 .Fx 8.0 .
+.Sh CAVEATS
+If a program is
+.Em setuid
+to a non-super-user, but is executed when
+the real
+.Em uid
+is ``root'', then the program has some of the powers
+of a super-user as well.
+.Pp
+When executing an interpreted program through
+.Fn fexecve ,
+kernel supplies
+.Pa /dev/fd/n
+as a second argument to the interpreter,
+where
+.Ar n
+is the file descriptor passed in the
+.Fa fd
+argument to
+.Fn fexecve .
+For this construction to work correctly, the
+.Xr fdescfs 5
+filesystem shall be mounted on
+.Pa /dev/fd .

Modified: head/lib/libc/sys/setuid.2
==============================================================================
--- head/lib/libc/sys/setuid.2	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libc/sys/setuid.2	Thu May 13 12:07:55 2010	(r208027)
@@ -124,39 +124,6 @@ The system calls will fail if:
 The user is not the super user and the ID
 specified is not the real, effective ID, or saved ID.
 .El
-.Sh SECURITY CONSIDERATIONS
-Read and write permissions to files are determined upon a call to
-.Xr open 2 .
-Once a file descriptor is open, dropping privilege does not affect
-the process's read/write permissions, even if the user ID specified
-has no read or write permissions to the file.
-These files normally remain open in any new process executed,
-resulting in a user being able to read or modify
-potentially sensitive data.
-.Pp
-To prevent these files from remaining open after an
-.Xr exec 3
-call, be sure to set the close-on-exec flag is set:
-.Bd -literal
-void
-pseudocode(void)
-{
-	int fd;
-	/* ... */
-
-	fd = open("/path/to/sensitive/data", O_RDWR);
-	if (fd == -1)
-		err(1, "open");
-
-	/*
-	 * Set close-on-exec flag; see fcntl(2) for more information.
-	 */
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
-		err(1, "fcntl(F_SETFD)");
-	/* ... */
-	execve(path, argv, environ);
-}
-.Ed
 .Sh SEE ALSO
 .Xr getgid 2 ,
 .Xr getuid 2 ,
@@ -191,3 +158,36 @@ and
 .Fn setgid
 functions appeared in
 .At v7 .
+.Sh SECURITY CONSIDERATIONS
+Read and write permissions to files are determined upon a call to
+.Xr open 2 .
+Once a file descriptor is open, dropping privilege does not affect
+the process's read/write permissions, even if the user ID specified
+has no read or write permissions to the file.
+These files normally remain open in any new process executed,
+resulting in a user being able to read or modify
+potentially sensitive data.
+.Pp
+To prevent these files from remaining open after an
+.Xr exec 3
+call, be sure to set the close-on-exec flag is set:
+.Bd -literal
+void
+pseudocode(void)
+{
+	int fd;
+	/* ... */
+
+	fd = open("/path/to/sensitive/data", O_RDWR);
+	if (fd == -1)
+		err(1, "open");
+
+	/*
+	 * Set close-on-exec flag; see fcntl(2) for more information.
+	 */
+	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
+		err(1, "fcntl(F_SETFD)");
+	/* ... */
+	execve(path, argv, environ);
+}
+.Ed

Modified: head/lib/libpmc/pmc.mips.3
==============================================================================
--- head/lib/libpmc/pmc.mips.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libpmc/pmc.mips.3	Thu May 13 12:07:55 2010	(r208027)
@@ -392,8 +392,6 @@ and the underlying hardware events used.
 .Xr pmc_cpuinfo 3 ,
 .Xr pmclog 3 ,
 .Xr hwpmc 4
-.Sh CAVEATS
-The MIPS code does not yet support sampling.
 .Sh HISTORY
 The
 .Nm pmc
@@ -408,3 +406,5 @@ library was written by
 MIPS support was added by
 .An "George Neville-Neil"
 .Aq gnn@FreeBSD.org .
+.Sh CAVEATS
+The MIPS code does not yet support sampling.

Modified: head/lib/libpmc/pmc.xscale.3
==============================================================================
--- head/lib/libpmc/pmc.xscale.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/libpmc/pmc.xscale.3	Thu May 13 12:07:55 2010	(r208027)
@@ -135,8 +135,6 @@ and the underlying hardware events used.
 .Xr pmc_cpuinfo 3 ,
 .Xr pmclog 3 ,
 .Xr hwpmc 4
-.Sh CAVEATS
-The Intel XScale code does not yet support sampling.
 .Sh HISTORY
 The
 .Nm pmc
@@ -154,3 +152,5 @@ library was written by
 Intel XScale support was added by
 .An "Rui Paulo"
 .Aq rpaulo@FreeBSD.org .
+.Sh CAVEATS
+The Intel XScale code does not yet support sampling.

Modified: head/lib/msun/man/fenv.3
==============================================================================
--- head/lib/msun/man/fenv.3	Thu May 13 09:59:10 2010	(r208026)
+++ head/lib/msun/man/fenv.3	Thu May 13 12:07:55 2010	(r208027)
@@ -196,18 +196,6 @@ environment.
 The macro
 .Dv FE_DFL_ENV
 expands to a pointer to the default environment.
-.Sh CAVEATS
-The FENV_ACCESS pragma can be enabled with
-.Dl "#pragma STDC FENV_ACCESS ON"
-and disabled with the
-.Dl "#pragma STDC FENV_ACCESS OFF"
-directive.
-This lexically-scoped annotation tells the compiler that the program
-may access the floating-point environment, so optimizations that would
-violate strict IEEE-754 semantics are disabled.
-If execution reaches a block of code for which
-.Dv FENV_ACCESS
-is off, the floating-point environment will become undefined.
 .Sh EXAMPLES
 The following routine computes the square root function.
 It explicitly raises an invalid exception on appropriate inputs using
@@ -274,6 +262,18 @@ It supersedes the non-standard routines 
 .In ieeefp.h
 and documented in
 .Xr fpgetround 3 .
+.Sh CAVEATS
+The FENV_ACCESS pragma can be enabled with
+.Dl "#pragma STDC FENV_ACCESS ON"
+and disabled with the
+.Dl "#pragma STDC FENV_ACCESS OFF"
+directive.
+This lexically-scoped annotation tells the compiler that the program
+may access the floating-point environment, so optimizations that would
+violate strict IEEE-754 semantics are disabled.
+If execution reaches a block of code for which
+.Dv FENV_ACCESS
+is off, the floating-point environment will become undefined.
 .Sh BUGS
 The
 .Dv FENV_ACCESS

Modified: head/sbin/fsirand/fsirand.8
==============================================================================
--- head/sbin/fsirand/fsirand.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/fsirand/fsirand.8	Thu May 13 12:07:55 2010	(r208027)
@@ -88,12 +88,6 @@ is not marked as clean.
 Print the current generation numbers for all inodes instead of
 generating new ones.
 .El
-.Sh CAVEATS
-Since
-.Nm
-allocates enough memory to hold all the inodes in
-a given cylinder group it may use a large amount
-of memory for large disks with few cylinder groups.
 .Sh SEE ALSO
 .Xr fs 5 ,
 .Xr fsck 8 ,
@@ -114,3 +108,9 @@ version first appeared in
 .Fx 2.2.5 .
 .Sh AUTHORS
 .An Todd C. Miller Aq Todd.Miller@courtesan.com
+.Sh CAVEATS
+Since
+.Nm
+allocates enough memory to hold all the inodes in
+a given cylinder group it may use a large amount
+of memory for large disks with few cylinder groups.

Modified: head/sbin/mksnap_ffs/mksnap_ffs.8
==============================================================================
--- head/sbin/mksnap_ffs/mksnap_ffs.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mksnap_ffs/mksnap_ffs.8	Thu May 13 12:07:55 2010	(r208027)
@@ -71,11 +71,11 @@ mount -o ro /dev/md0 /mnt/
 .Xr chown 8 ,
 .Xr mdconfig 8 ,
 .Xr mount 8
-.Sh CAVEATS
-The disk full situation is not handled gracefully and may
-lead to a system panic when no free blocks are found.
 .Sh HISTORY
 The
 .Nm
 utility first appeared in
 .Fx 5.0 .
+.Sh CAVEATS
+The disk full situation is not handled gracefully and may
+lead to a system panic when no free blocks are found.

Modified: head/sbin/mount/mount.8
==============================================================================
--- head/sbin/mount/mount.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mount/mount.8	Thu May 13 12:07:55 2010	(r208027)
@@ -542,6 +542,11 @@ support for a particular file system mig
 .Xr umount 8 ,
 .Xr zfs 8 ,
 .Xr zpool 8
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.At v1 .
 .Sh CAVEATS
 After a successful
 .Nm ,
@@ -564,10 +569,5 @@ gets a
 signal (that causes an update of the export list)
 only when the file system is mounted via
 .Nm .
-.Sh HISTORY
-A
-.Nm
-utility appeared in
-.At v1 .
 .Sh BUGS
 It is possible for a corrupted file system to cause a crash.

Modified: head/sbin/mount_msdosfs/mount_msdosfs.8
==============================================================================
--- head/sbin/mount_msdosfs/mount_msdosfs.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mount_msdosfs/mount_msdosfs.8	Thu May 13 12:07:55 2010	(r208027)
@@ -199,12 +199,6 @@ To mount a Japanese MS-DOS file system l
 .Pp
 List of Localized MS Operating Systems:
 .Pa http://www.microsoft.com/globaldev/reference/oslocversion.mspx .
-.Sh CAVEATS
-The use of the
-.Fl 9
-flag could result in damaged file systems,
-albeit the damage is in part taken care of by
-procedures similar to the ones used in Win'95.
 .Sh HISTORY
 The
 .Nm
@@ -221,3 +215,9 @@ of the more aptly-named
 The character code conversion routine was added by
 .An Ryuichiro Imura Aq imura@ryu16.org
 at 2003.
+.Sh CAVEATS
+The use of the
+.Fl 9
+flag could result in damaged file systems,
+albeit the damage is in part taken care of by
+procedures similar to the ones used in Win'95.

Modified: head/sbin/mount_ntfs/mount_ntfs.8
==============================================================================
--- head/sbin/mount_ntfs/mount_ntfs.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mount_ntfs/mount_ntfs.8	Thu May 13 12:07:55 2010	(r208027)
@@ -149,14 +149,6 @@ The file name must not contain multibyte
 .Xr fstab 5 ,
 .Xr mount 8 ,
 .Xr mount_msdosfs 8
-.Sh CAVEATS
-This utility is primarily used for read access to an NTFS volume.
-See the
-.Sx WRITING
-section for details about writing to an NTFS volume.
-.Pp
-For a full read-write NTFS support consider sysutils/fusefs-ntfs
-port/package.
 .Sh HISTORY
 The
 .Nm
@@ -171,3 +163,11 @@ The NTFS kernel implementation,
 .Nm
 utility, and manual were written by
 .An Semen Ustimenko Aq semenu@FreeBSD.org .
+.Sh CAVEATS
+This utility is primarily used for read access to an NTFS volume.
+See the
+.Sx WRITING
+section for details about writing to an NTFS volume.
+.Pp
+For a full read-write NTFS support consider sysutils/fusefs-ntfs
+port/package.

Modified: head/sbin/mount_reiserfs/mount_reiserfs.8
==============================================================================
--- head/sbin/mount_reiserfs/mount_reiserfs.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mount_reiserfs/mount_reiserfs.8	Thu May 13 12:07:55 2010	(r208027)
@@ -66,9 +66,6 @@ To mount a ReiserFS volume located in
 .Xr unmount 2 ,
 .Xr fstab 5 ,
 .Xr mount 8
-.Sh CAVEATS
-This utility is primarily used for read access to a ReiserFS volume.
-Writing to a volume is currently unsupported.
 .Sh HISTORY
 The
 .Nm
@@ -88,3 +85,6 @@ The
 .Nm
 utility and manual were written by
 .An Jean-S\['e]bastien P\['e]dron Aq dumbbell@FreeBSD.org .
+.Sh CAVEATS
+This utility is primarily used for read access to a ReiserFS volume.
+Writing to a volume is currently unsupported.

Modified: head/sbin/mount_std/mount_std.8
==============================================================================
--- head/sbin/mount_std/mount_std.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/mount_std/mount_std.8	Thu May 13 12:07:55 2010	(r208027)
@@ -142,8 +142,6 @@ loadable module for it was found.
 .Xr linprocfs 5 ,
 .Xr procfs 5 ,
 .Xr mount 8
-.Sh CAVEATS
-None of the ``standard'' file systems may be NFS-exported.
 .Sh HISTORY
 The
 .Nm
@@ -165,3 +163,5 @@ the
 .Dq linprocfs
 file system type first appeared in
 .Fx 4.0 .
+.Sh CAVEATS
+None of the ``standard'' file systems may be NFS-exported.

Modified: head/sbin/rcorder/rcorder.8
==============================================================================
--- head/sbin/rcorder/rcorder.8	Thu May 13 09:59:10 2010	(r208026)
+++ head/sbin/rcorder/rcorder.8	Thu May 13 12:07:55 2010	(r208027)
@@ -152,6 +152,19 @@ processing the stated condition.
 A set of files has a circular dependency which was detected while
 processing the stated file.
 .El
+.Sh SEE ALSO
+.Xr rc 8
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Nx 1.5 .
+.Sh AUTHORS
+.An -nosplit
+Written by
+.An Perry E. Metzger Aq perry@piermont.com
+and
+.An Matthew R. Green Aq mrg@eterna.com.au .
 .Sh BUGS
 The
 .Dq Li REQUIRE
@@ -171,16 +184,3 @@ script in the dependency ordering,
 not necessarily that it requires
 .Xr named 8
 to be started or enabled.
-.Sh SEE ALSO
-.Xr rc 8
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Nx 1.5 .
-.Sh AUTHORS
-.An -nosplit
-Written by
-.An Perry E. Metzger Aq perry@piermont.com
-and
-.An Matthew R. Green Aq mrg@eterna.com.au .

Modified: head/share/man/man4/ae.4
==============================================================================
--- head/share/man/man4/ae.4	Thu May 13 09:59:10 2010	(r208026)
+++ head/share/man/man4/ae.4	Thu May 13 12:07:55 2010	(r208027)
@@ -133,6 +133,14 @@ instead.
 .Xr ng_ether 4 ,
 .Xr vlan 4 ,
 .Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+driver and this manual page was written by
+.An Stanislav Sedov
+.Aq stas@FreeBSD.org .
+It first appeared in
+.Fx 7.1 .
 .Sh BUGS
 The Attansic L2 FastEthernet contoller supports DMA but does not use a
 descriptor based transfer mechanism via scatter-gather DMA.
@@ -142,11 +150,3 @@ Furthermore, a lot of data alignment res
 This may introduce a high CPU load on systems with heavy network activity.
 Luckily enough this should not be a problem on modern hardware as L2 does
 not support speeds faster than 100Mbps.
-.Sh HISTORY
-The
-.Nm
-driver and this manual page was written by
-.An Stanislav Sedov
-.Aq stas@FreeBSD.org .
-It first appeared in
-.Fx 7.1 .

Modified: head/share/man/man4/ahb.4
==============================================================================
--- head/share/man/man4/ahb.4	Thu May 13 09:59:10 2010	(r208026)
+++ head/share/man/man4/ahb.4	Thu May 13 12:07:55 2010	(r208027)
@@ -70,13 +70,6 @@ Adaptec AHA-1740A
 .It
 Adaptec AHA-1742A
 .El
-.Sh CAVEATS
-The Adaptec 174X is very sensitive to SCSI bus termination and cable
-length.
-It may also have difficulties operating with some modern devices
-that, due to their speed, expose timing problems in the controller.
-There are no known mechanisms for working around device incompatibilities of
-this nature.
 .Sh SEE ALSO
 .Xr aha 4 ,
 .Xr ahc 4 ,
@@ -90,3 +83,10 @@ The
 .Nm
 driver was written by
 .An Justin T. Gibbs .
+.Sh CAVEATS
+The Adaptec 174X is very sensitive to SCSI bus termination and cable
+length.
+It may also have difficulties operating with some modern devices
+that, due to their speed, expose timing problems in the controller.
+There are no known mechanisms for working around device incompatibilities of
+this nature.

Modified: head/share/man/man4/amdtemp.4
==============================================================================
--- head/share/man/man4/amdtemp.4	Thu May 13 09:59:10 2010	(r208026)
+++ head/share/man/man4/amdtemp.4	Thu May 13 12:07:55 2010	(r208027)
@@ -64,9 +64,6 @@ located in each CPU core.
 For the K10 and K11 families, the driver creates
 .Va dev.cpu.%d.temperature
 with the temperature of each core.
-.Sh BUGS
-AMD K9 is not supported because temperature reporting has been replaced
-by Maltese.
 .Sh SEE ALSO
 .Xr sysctl 8
 .Sh HISTORY
@@ -77,3 +74,6 @@ driver first appeared in
 .Sh AUTHORS
 .An Rui Paulo Aq rpaulo@FreeBSD.org
 .An Norikatsu Shigemura Aq nork@FreeBSD.org
+.Sh BUGS
+AMD K9 is not supported because temperature reporting has been replaced
+by Maltese.

Modified: head/share/man/man4/ataraid.4
==============================================================================
--- head/share/man/man4/ataraid.4	Thu May 13 09:59:10 2010	(r208026)
+++ head/share/man/man4/ataraid.4	Thu May 13 12:07:55 2010	(r208027)
@@ -135,9 +135,6 @@ ATA RAID device nodes
 .Sh SEE ALSO
 .Xr ata 4 ,
 .Xr atacontrol 8
-.Sh CAVEATS

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 12:08:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF8B51065687;
	Thu, 13 May 2010 12:08:11 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9ACEA8FC21;
	Thu, 13 May 2010 12:08:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DC8B04028588;
	Thu, 13 May 2010 12:08:11 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DC8B9d028562;
	Thu, 13 May 2010 12:08:11 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005131208.o4DC8B9d028562@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Thu, 13 May 2010 12:08: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: r208028 - in head: lib/msun/man sbin/hastctl sbin/hastd
	share/man/man3 share/man/man4 share/man/man5 share/man/man9
	usr.bin/killall usr.bin/setchannel usr.bin/tar
	usr.bin/wtmpcvt usr.sb...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 12:08:11 -0000

Author: uqs
Date: Thu May 13 12:08:11 2010
New Revision: 208028
URL: http://svn.freebsd.org/changeset/base/208028

Log:
  mdoc: move remaining sections into consistent order
  
  This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections.
  
  Found by:	mdocml lint run
  Reviewed by:	ru

Modified:
  head/lib/msun/man/hypot.3
  head/sbin/hastctl/hastctl.8
  head/sbin/hastd/hast.conf.5
  head/sbin/hastd/hastd.8
  head/share/man/man3/fpgetround.3
  head/share/man/man4/cmx.4
  head/share/man/man4/uhso.4
  head/share/man/man5/boot.config.5
  head/share/man/man5/fdescfs.5
  head/share/man/man5/linsysfs.5
  head/share/man/man9/namei.9
  head/share/man/man9/uio.9
  head/usr.bin/killall/killall.1
  head/usr.bin/setchannel/setchannel.1
  head/usr.bin/tar/bsdtar.1
  head/usr.bin/wtmpcvt/wtmpcvt.1
  head/usr.sbin/bluetooth/btpand/btpand.8
  head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
  head/usr.sbin/mptutil/mptutil.8
  head/usr.sbin/newsyslog/newsyslog.8
  head/usr.sbin/pkg_install/updating/pkg_updating.1
  head/usr.sbin/rtadvd/rtadvd.8
  head/usr.sbin/rtsold/rtsold.8
  head/usr.sbin/sa/sa.8
  head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5

Modified: head/lib/msun/man/hypot.3
==============================================================================
--- head/lib/msun/man/hypot.3	Thu May 13 12:07:55 2010	(r208027)
+++ head/lib/msun/man/hypot.3	Thu May 13 12:08:11 2010	(r208028)
@@ -124,14 +124,6 @@ disappear when it turns out to be irrele
 .Xr carg 3 ,
 .Xr math 3 ,
 .Xr sqrt 3
-.Sh HISTORY
-Both a
-.Fn hypot
-function and a
-.Fn cabs
-function
-appeared in
-.At v7 .
 .Sh STANDARDS
 The
 .Fn hypot ,
@@ -143,3 +135,11 @@ and
 .Fn cabsl
 functions conform to
 .St -isoC-99 .
+.Sh HISTORY
+Both a
+.Fn hypot
+function and a
+.Fn cabs
+function
+appeared in
+.At v7 .

Modified: head/sbin/hastctl/hastctl.8
==============================================================================
--- head/sbin/hastctl/hastctl.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/sbin/hastctl/hastctl.8	Thu May 13 12:08:11 2010	(r208028)
@@ -153,6 +153,20 @@ Print debugging information.
 This option can be specified multiple times to raise the verbosity
 level.
 .El
+.Sh FILES
+.Bl -tag -width ".Pa /var/run/hastctl" -compact
+.It Pa /etc/hast.conf
+Configuration file for
+.Nm
+and
+.Xr hastd 8 .
+.It Pa /var/run/hastctl
+Control socket used by
+.Nm
+to communicate with the
+.Xr hastd 8
+daemon.
+.El
 .Sh EXIT STATUS
 Exit status is 0 on success, or one of the values described in
 .Xr sysexits 3
@@ -185,20 +199,6 @@ nodeB# fsck -t ufs /dev/hast/shared
 nodeB# mount -o noatime /dev/hast/shared /shared
 nodeB# application_start
 .Ed
-.Sh FILES
-.Bl -tag -width ".Pa /var/run/hastctl" -compact
-.It Pa /etc/hast.conf
-Configuration file for
-.Nm
-and
-.Xr hastd 8 .
-.It Pa /var/run/hastctl
-Control socket used by
-.Nm
-to communicate with the
-.Xr hastd 8
-daemon.
-.El
 .Sh SEE ALSO
 .Xr sysexits 3 ,
 .Xr geom 4 ,

Modified: head/sbin/hastd/hast.conf.5
==============================================================================
--- head/sbin/hastd/hast.conf.5	Thu May 13 12:07:55 2010	(r208027)
+++ head/sbin/hastd/hast.conf.5	Thu May 13 12:08:11 2010	(r208028)
@@ -224,6 +224,19 @@ the secondary node.
 When operating as a secondary node only connections from this address
 will be accepted.
 .El
+.Sh FILES
+.Bl -tag -width ".Pa /var/run/hastctl" -compact
+.It Pa /etc/hast.conf
+The default
+.Nm
+configuration file.
+.It Pa /var/run/hastctl
+Control socket used by the
+.Xr hastctl 8
+control utility to communicate with the
+.Xr hastd 8
+daemon.
+.El
 .Sh EXAMPLES
 The example configuration file can look as follows:
 .Bd -literal -offset indent
@@ -248,19 +261,6 @@ resource tank {
 	}
 }
 .Ed
-.Sh FILES
-.Bl -tag -width ".Pa /var/run/hastctl" -compact
-.It Pa /etc/hast.conf
-The default
-.Nm
-configuration file.
-.It Pa /var/run/hastctl
-Control socket used by the
-.Xr hastctl 8
-control utility to communicate with the
-.Xr hastd 8
-daemon.
-.El
 .Sh SEE ALSO
 .Xr gethostname 3 ,
 .Xr geom 4 ,

Modified: head/sbin/hastd/hastd.8
==============================================================================
--- head/sbin/hastd/hastd.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/sbin/hastd/hastd.8	Thu May 13 12:08:11 2010	(r208028)
@@ -170,6 +170,23 @@ stored.
 The default location is
 .Pa /var/run/hastd.pid .
 .El
+.Sh FILES
+.Bl -tag -width ".Pa /var/run/hastctl" -compact
+.It Pa /etc/hast.conf
+The configuration file for
+.Nm
+and
+.Xr hastctl 8 .
+.It Pa /var/run/hastctl
+Control socket used by the
+.Xr hastctl 8
+control utility to communicate with
+.Nm .
+.It Pa /var/run/hastd.pid
+The default location of the
+.Nm
+PID file.
+.El
 .Sh EXIT STATUS
 Exit status is 0 on success, or one of the values described in
 .Xr sysexits 3
@@ -196,23 +213,6 @@ nodeA# hastctl role primary shared
 nodeA# newfs -U /dev/hast/shared
 nodeA# mount -o noatime /dev/hast/shared /shared
 .Ed
-.Sh FILES
-.Bl -tag -width ".Pa /var/run/hastctl" -compact
-.It Pa /etc/hast.conf
-The configuration file for
-.Nm
-and
-.Xr hastctl 8 .
-.It Pa /var/run/hastctl
-Control socket used by the
-.Xr hastctl 8
-control utility to communicate with
-.Nm .
-.It Pa /var/run/hastd.pid
-The default location of the
-.Nm
-PID file.
-.El
 .Sh SEE ALSO
 .Xr sysexits 3 ,
 .Xr geom 4 ,

Modified: head/share/man/man3/fpgetround.3
==============================================================================
--- head/share/man/man3/fpgetround.3	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man3/fpgetround.3	Thu May 13 12:08:11 2010	(r208028)
@@ -170,10 +170,10 @@ At present, they are implemented only on
 .Sh SEE ALSO
 .Xr fenv 3 ,
 .Xr isnan 3
+.Sh HISTORY
+These routines are based on SysV/386 routines of the same name.
 .Sh CAVEATS
 After a floating point exception and before a mask is set, the sticky
 flags must be reset.
 If another exception occurs before the sticky
 flags are reset, then a wrong exception type may be signaled.
-.Sh HISTORY
-These routines are based on SysV/386 routines of the same name.

Modified: head/share/man/man4/cmx.4
==============================================================================
--- head/share/man/man4/cmx.4	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man4/cmx.4	Thu May 13 12:08:11 2010	(r208028)
@@ -67,11 +67,6 @@ and
 are supported and work as expected.  An open file descriptor
 will always be ready for writing, but only ready for reading
 if the device indicates that it has data available.
-.Sh COMPATIBILITY
-Userland smartcard code written for the vendor's Linux drivers
-should work with the
-.Nm
-driver without modification.
 .Sh FILES
 .Bl -tag -width /usr/ports/security/openct -compact
 .It Pa /dev/cmx\fBn\fP
@@ -91,6 +86,11 @@ devices.
 .\".Nm
 .\"devices.
 .El
+.Sh COMPATIBILITY
+Userland smartcard code written for the vendor's Linux drivers
+should work with the
+.Nm
+driver without modification.
 .Sh SEE ALSO
 .Xr pccard 4
 .Sh HISTORY

Modified: head/share/man/man4/uhso.4
==============================================================================
--- head/share/man/man4/uhso.4	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man4/uhso.4	Thu May 13 12:08:11 2010	(r208028)
@@ -87,6 +87,10 @@ This behavior can be disabled by setting
 .Va hw.usb.uhso.auto_switch
 to 0 using
 .Xr sysctl 8
+.Sh FILES
+.Bl -tag -width "XXXXXX"
+.It Pa /dev/cuaU?.?
+.El
 .Sh EXAMPLES
 Establishing a packet interface connection
 .Bd -literal -offset indent
@@ -112,10 +116,6 @@ The connection can be terminated with
 .Bd -literal -offset indent
 AT_OWANCALL=1,0,1
 .Ed
-.Sh FILES
-.Bl -tag -width "XXXXXX"
-.It Pa /dev/cuaU?.?
-.El
 .Sh SEE ALSO
 .Xr ucom 4 ,
 .Xr usb 4

Modified: head/share/man/man5/boot.config.5
==============================================================================
--- head/share/man/man5/boot.config.5	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man5/boot.config.5	Thu May 13 12:08:11 2010	(r208028)
@@ -64,6 +64,11 @@ the other options available for
 are documented in detail in the
 .Xr boot 8
 manual page.
+.Sh FILES
+.Bl -tag -width /boot.config -compact
+.It Pa /boot.config
+parameters for the boot blocks (optional)
+.El
 .Sh EXAMPLES
 The command:
 .Bd -literal -offset indent
@@ -90,11 +95,6 @@ The command:
 .Ed
 .Pp
 will do both of the above.
-.Sh FILES
-.Bl -tag -width /boot.config -compact
-.It Pa /boot.config
-parameters for the boot blocks (optional)
-.El
 .Sh SEE ALSO
 .Xr boot 8 ,
 .Xr loader 8

Modified: head/share/man/man5/fdescfs.5
==============================================================================
--- head/share/man/man5/fdescfs.5	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man5/fdescfs.5	Thu May 13 12:08:11 2010	(r208028)
@@ -87,6 +87,10 @@ call other than
 and
 .Dv O_RDWR
 are ignored.
+.Sh FILES
+.Bl -tag -width /dev/stderr -compact
+.It Pa /dev/fd/#
+.El
 .Sh EXAMPLES
 To mount a  
 .Nm
@@ -94,10 +98,6 @@ volume located on
 .Pa /dev/fd :
 .Pp
 .Dl "mount -t fdescfs null /dev/fd"
-.Sh FILES
-.Bl -tag -width /dev/stderr -compact
-.It Pa /dev/fd/#
-.El
 .Sh SEE ALSO
 .Xr mount 8
 .Sh HISTORY

Modified: head/share/man/man5/linsysfs.5
==============================================================================
--- head/share/man/man5/linsysfs.5	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man5/linsysfs.5	Thu May 13 12:08:11 2010	(r208028)
@@ -55,14 +55,6 @@ registered driver name for these devices
 .It Pa device
 A symlink to the PCI device directory.
 .El
-.Sh EXAMPLES
-The most common usage follows:
-.Pp
-.Dl "mount -t linsysfs linsys /compat/linux/sys"
-.Pp
-where
-.Pa /compat/linux/sys
-is a mount point.
 .Sh FILES
 .Bl -tag -width ".Pa /compat/linux/sys/devices/pci0000:00" -compact
 .It Pa /compat/linux/sys
@@ -73,6 +65,14 @@ The storage host node.
 .It Pa /compat/linux/sys/devices/pci0000:00
 The PCI device hierarchy node.
 .El
+.Sh EXAMPLES
+The most common usage follows:
+.Pp
+.Dl "mount -t linsysfs linsys /compat/linux/sys"
+.Pp
+where
+.Pa /compat/linux/sys
+is a mount point.
 .Sh SEE ALSO
 .Xr nmount 2 ,
 .Xr unmount 2 ,

Modified: head/share/man/man9/namei.9
==============================================================================
--- head/share/man/man9/namei.9	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man9/namei.9	Thu May 13 12:08:11 2010	(r208028)
@@ -319,6 +319,10 @@ function.
 If successful,
 .Fn namei
 will return 0, otherwise it will return an error.
+.Sh FILES
+.Bl -tag
+.It Pa src/sys/kern/vfs_lookup.c
+.El
 .Sh ERRORS
 Errors which
 .Fn namei
@@ -343,10 +347,6 @@ An attempt is made to open a directory w
 .It Bq Er EROFS
 An attempt is made to modify a file or directory on a read-only file system.
 .El
-.Sh FILES
-.Bl -tag
-.It Pa src/sys/kern/vfs_lookup.c
-.El
 .Sh SEE ALSO
 .Xr uio 9 ,
 .Xr uma 9 ,

Modified: head/share/man/man9/uio.9
==============================================================================
--- head/share/man/man9/uio.9	Thu May 13 12:07:55 2010	(r208027)
+++ head/share/man/man9/uio.9	Thu May 13 12:08:11 2010	(r208028)
@@ -115,18 +115,6 @@ space.
 On success
 .Fn uiomove
 will return 0, on error it will return an appropriate errno.
-.Sh ERRORS
-.Fn uiomove
-will fail and return the following error code if:
-.Bl -tag -width Er
-.It Bq Er EFAULT
-The invoked
-.Xr copyin 9
-or
-.Xr copyout 9
-returned
-.Er EFAULT
-.El
 .Sh EXAMPLES
 The idea is that the driver maintains a private buffer for its data,
 and processes the request in chunks of maximal the size of this
@@ -167,6 +155,18 @@ fooread(dev_t dev, struct uio *uio, int 
 	return (rv);
 }
 .Ed
+.Sh ERRORS
+.Fn uiomove
+will fail and return the following error code if:
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The invoked
+.Xr copyin 9
+or
+.Xr copyout 9
+returned
+.Er EFAULT
+.El
 .Sh SEE ALSO
 .Xr read 2 ,
 .Xr readv 2 ,

Modified: head/usr.bin/killall/killall.1
==============================================================================
--- head/usr.bin/killall/killall.1	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.bin/killall/killall.1	Thu May 13 12:08:11 2010	(r208028)
@@ -121,6 +121,17 @@ for this job (e.g.\&
 .Dq Li "kill -TERM -1
 or as root
 .Dq Li "echo kill -TERM -1 | su -m " ) .
+.Sh IMPLEMENTATION NOTES
+This
+.Fx
+implementation of
+.Nm
+has completely different semantics as compared to the traditional
+.Ux
+System V behavior of
+.Nm .
+The latter will kill all processes that the current user is able to
+kill, and is intended to be used by the system shutdown process only.
 .Sh EXIT STATUS
 The
 .Nm
@@ -145,17 +156,6 @@ command appeared in
 It has been modeled after the
 .Nm
 command as available on other platforms.
-.Sh IMPLEMENTATION NOTES
-This
-.Fx
-implementation of
-.Nm
-has completely different semantics as compared to the traditional
-.Ux
-System V behavior of
-.Nm .
-The latter will kill all processes that the current user is able to
-kill, and is intended to be used by the system shutdown process only.
 .Sh AUTHORS
 .An -nosplit
 The

Modified: head/usr.bin/setchannel/setchannel.1
==============================================================================
--- head/usr.bin/setchannel/setchannel.1	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.bin/setchannel/setchannel.1	Thu May 13 12:08:11 2010	(r208028)
@@ -85,13 +85,6 @@ Channel number to set.
 .It Cm freq
 Frequency in MHz (must include decimal point).
 .El
-.Sh AUTHORS
-.An -nosplit
-This program is made by
-.An John Wehle 
-.Pp
-This man page is made by
-.An Edwin Groothuis 
 .Sh SEE ALSO
 .Xr cxm 4 ,
 .Xr bktr 4 ,
@@ -102,3 +95,10 @@ The
 program first appeared in the -multimedia mailing-list in January 2004. The
 .Nm
 program first appeared in the FreeBSD Ports collection in October 2004.
+.Sh AUTHORS
+.An -nosplit
+This program is made by
+.An John Wehle 
+.Pp
+This man page is made by
+.An Edwin Groothuis 

Modified: head/usr.bin/tar/bsdtar.1
==============================================================================
--- head/usr.bin/tar/bsdtar.1	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.bin/tar/bsdtar.1	Thu May 13 12:08:11 2010	(r208028)
@@ -647,8 +647,6 @@ Note that, unlike other
 implementations, this implementation recognizes gzip compression
 automatically when reading archives.
 .El
-.Sh EXIT STATUS
-.Ex -std
 .Sh ENVIRONMENT
 The following environment variables affect the execution of
 .Nm :
@@ -672,6 +670,8 @@ See
 .Xr environ 7
 for more information.
 .El
+.Sh EXIT STATUS
+.Ex -std
 .Sh EXAMPLES
 The following creates a new archive
 called

Modified: head/usr.bin/wtmpcvt/wtmpcvt.1
==============================================================================
--- head/usr.bin/wtmpcvt/wtmpcvt.1	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.bin/wtmpcvt/wtmpcvt.1	Thu May 13 12:08:11 2010	(r208028)
@@ -55,6 +55,8 @@ The
 .Nm
 utility appeared in
 .Fx 9.0 .
+.Sh AUTHORS
+.An Ed Schouten Aq ed@FreeBSD.org
 .Sh BUGS
 The application assumes the
 .Ar input
@@ -62,5 +64,3 @@ file has the same byte order as the host
 The
 .Ar output
 file can be used on any architecture.
-.Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org

Modified: head/usr.sbin/bluetooth/btpand/btpand.8
==============================================================================
--- head/usr.sbin/bluetooth/btpand/btpand.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/bluetooth/btpand/btpand.8	Thu May 13 12:08:11 2010	(r208028)
@@ -181,8 +181,6 @@ After
 has set up the client or server connection and opened the
 .Xr tap 4
 interface, it will create a pid file and detach.
-.Sh EXIT STATUS
-.Ex -std
 .Sh FILES
 .Bl -tag -compact
 .It Pa /dev/tap
@@ -190,6 +188,8 @@ interface, it will create a pid file and
 .It Pa /var/run/sdp
 .It Pa /var/run/tap Ns Em N Ns No .pid
 .El
+.Sh EXIT STATUS
+.Ex -std
 .Sh EXAMPLES
 .Dl ifconfig tap1 create
 .Dl btpand -a host -d mydevice -s NAP -i tap1

Modified: head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
==============================================================================
--- head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8	Thu May 13 12:08:11 2010	(r208028)
@@ -90,6 +90,13 @@ are:
 .It Cm Browse
 .It Cm Search
 .El
+.Sh EXIT STATUS
+.Ex -std
+.Sh SEE ALSO
+.Xr bluetooth 3 ,
+.Xr sdp 3
+.Sh AUTHORS
+.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
 .Sh CAVEATS
 The
 .Nm
@@ -109,10 +116,3 @@ Protocol Descriptor List
 .It
 Bluetooth Profile Descriptor List
 .El
-.Sh EXIT STATUS
-.Ex -std
-.Sh SEE ALSO
-.Xr bluetooth 3 ,
-.Xr sdp 3
-.Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com

Modified: head/usr.sbin/mptutil/mptutil.8
==============================================================================
--- head/usr.sbin/mptutil/mptutil.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/mptutil/mptutil.8	Thu May 13 12:08:11 2010	(r208028)
@@ -348,6 +348,11 @@ as a global hot spare:
 .Dl Nm Cm add da3
 .Sh SEE ALSO
 .Xr mpt 4
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Fx 8.0 .
 .Sh BUGS
 .Pp
 The handling of spare drives appears to be unreliable.
@@ -379,8 +384,3 @@ configurations may not work reliably.
 .Pp
 Drive configuration commands result in an excessive flood of messages on the
 console.
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Fx 8.0 .

Modified: head/usr.sbin/newsyslog/newsyslog.8
==============================================================================
--- head/usr.sbin/newsyslog/newsyslog.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/newsyslog/newsyslog.8	Thu May 13 12:08:11 2010	(r208028)
@@ -238,6 +238,13 @@ this has been changed to a colon (``:'')
 names may contain the dot character.
 The dot (``.'') character is still
 accepted for backwards compatibility.
+.Sh SEE ALSO
+.Xr bzip2 1 ,
+.Xr gzip 1 ,
+.Xr syslog 3 ,
+.Xr newsyslog.conf 5 ,
+.Xr chown 8 ,
+.Xr syslogd 8
 .Sh HISTORY
 The
 .Nm
@@ -250,12 +257,5 @@ and first appeared in
 MIT Project Athena
 .Pp
 Copyright 1987, Massachusetts Institute of Technology
-.Sh "SEE ALSO"
-.Xr bzip2 1 ,
-.Xr gzip 1 ,
-.Xr syslog 3 ,
-.Xr newsyslog.conf 5 ,
-.Xr chown 8 ,
-.Xr syslogd 8
 .Sh BUGS
 Does not yet automatically read the logs to find security breaches.

Modified: head/usr.sbin/pkg_install/updating/pkg_updating.1
==============================================================================
--- head/usr.sbin/pkg_install/updating/pkg_updating.1	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/pkg_install/updating/pkg_updating.1	Thu May 13 12:08:11 2010	(r208028)
@@ -43,6 +43,20 @@ Defines a alternative location of the UP
 .It Fl h , -help
 Print help message.
 .El
+.Sh ENVIRONMENT
+.Bl -tag -width PKG_DBDIR
+.It Ev PKG_DBDIR
+Specifies an alternative location for the installed package database.
+.It Ev PORTSDIR
+Location of the ports tree.
+.El
+.Sh FILES
+.Bl -tag -width /var/db/pkg -compact
+.It Pa /var/db/pkg
+Default location of the installed package database.
+.It Pa /usr/ports
+The default ports directory and default location of the UPDATING file
+.El
 .Sh EXAMPLES
 Shows all entries of all installed ports:
 .Dl % pkg_updating
@@ -63,20 +77,6 @@ installed ports:
 Fetch UPDATING file from ftp mirror and show all entries of all
 installed ports:
 .Dl % pkg_updating -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/UPDATING
-.Sh ENVIRONMENT
-.Bl -tag -width PKG_DBDIR
-.It Ev PKG_DBDIR
-Specifies an alternative location for the installed package database.
-.It Ev PORTSDIR
-Location of the ports tree.
-.El
-.Sh FILES
-.Bl -tag -width /var/db/pkg -compact
-.It Pa /var/db/pkg
-Default location of the installed package database.
-.It Pa /usr/ports
-The default ports directory and default location of the UPDATING file
-.El
 .Sh SEE ALSO
 .Xr pkg_add 1 ,
 .Xr pkg_create 1 ,

Modified: head/usr.sbin/rtadvd/rtadvd.8
==============================================================================
--- head/usr.sbin/rtadvd/rtadvd.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/rtadvd/rtadvd.8	Thu May 13 12:08:11 2010	(r208028)
@@ -162,8 +162,6 @@ In this case,
 will transmit router advertisement with router lifetime 0
 to all the interfaces
 .Pq in accordance with RFC2461 6.2.5 .
-.Sh EXIT STATUS
-.Ex -std
 .Sh FILES
 .Bl -tag -width Pa -compact
 .It Pa /etc/rtadvd.conf
@@ -176,6 +174,8 @@ The file in which
 .Nm
 dumps its internal state.
 .El
+.Sh EXIT STATUS
+.Ex -std
 .Sh SEE ALSO
 .Xr rtadvd.conf 5 ,
 .Xr rtsol 8

Modified: head/usr.sbin/rtsold/rtsold.8
==============================================================================
--- head/usr.sbin/rtsold/rtsold.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/rtsold/rtsold.8	Thu May 13 12:08:11 2010	(r208028)
@@ -222,9 +222,6 @@ must be the absolute path from root to t
 file, and be created by the same owner who runs
 .Nm .
 .El
-.Sh EXIT STATUS
-.Ex -std
-.\"
 .Sh FILES
 .Bl -tag -width /var/run/rtsold.dump -compact
 .It Pa /var/run/rtsold.pid
@@ -234,6 +231,9 @@ the pid of the currently running
 dumps internal state on.
 .El
 .\"
+.Sh EXIT STATUS
+.Ex -std
+.\"
 .Sh SEE ALSO
 .Xr rtadvd 8 ,
 .Xr sysctl 8

Modified: head/usr.sbin/sa/sa.8
==============================================================================
--- head/usr.sbin/sa/sa.8	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/sa/sa.8	Thu May 13 12:08:11 2010	(r208028)
@@ -234,6 +234,8 @@ per-user accounting summary database
 .Xr acct 5 ,
 .Xr ac 8 ,
 .Xr accton 8
+.Sh AUTHORS
+.An Chris G. Demetriou Aq cgd@postgres.berkeley.edu
 .Sh CAVEATS
 While the behavior of the options in this version of
 .Nm
@@ -251,8 +253,6 @@ The formats of the summary files created
 are very different from the those used by the original version.
 This is not considered a problem, however, because the accounting record
 format has changed as well (since user ids are now 32 bits).
-.Sh AUTHORS
-.An Chris G. Demetriou Aq cgd@postgres.berkeley.edu
 .Sh BUGS
 The number of options to this program is absurd, especially considering
 that there is not much logic behind their lettering.

Modified: head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5
==============================================================================
--- head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5	Thu May 13 12:07:55 2010	(r208027)
+++ head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5	Thu May 13 12:08:11 2010	(r208028)
@@ -456,6 +456,11 @@ openssl pkcs12 -in example.pfx -out user
 # convert CA certificate (if included in PFX file) to PEM format
 openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
 .Ed
+.Sh FILES
+.Bl -tag -width ".Pa /usr/share/examples/etc/wpa_supplicant.conf" -compact
+.It Pa /etc/wpa_supplicant.conf
+.It Pa /usr/share/examples/etc/wpa_supplicant.conf
+.El
 .Sh EXAMPLES
 WPA-Personal (PSK) as a home network and WPA-Enterprise with EAP-TLS
 as a work network:
@@ -538,11 +543,6 @@ network={
         wep_key0=42FEEDDEAFBABEDEAFBEEFAA55
 }
 .Ed
-.Sh FILES
-.Bl -tag -width ".Pa /usr/share/examples/etc/wpa_supplicant.conf" -compact
-.It Pa /etc/wpa_supplicant.conf
-.It Pa /usr/share/examples/etc/wpa_supplicant.conf
-.El
 .Sh SEE ALSO
 .Xr wpa_cli 8 ,
 .Xr wpa_passphrase 8 ,

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 15:28:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 323D41065673;
	Thu, 13 May 2010 15:28:35 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FEC28FC15;
	Thu, 13 May 2010 15:28:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DFSZWh072820;
	Thu, 13 May 2010 15:28:35 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DFSYs4072813;
	Thu, 13 May 2010 15:28:34 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005131528.o4DFSYs4072813@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 13 May 2010 15:28:34 +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: r208029 - stable/7/contrib/telnet/telnet
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 15:28:35 -0000

Author: jilles
Date: Thu May 13 15:28:34 2010
New Revision: 208029
URL: http://svn.freebsd.org/changeset/base/208029

Log:
  MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.
  
  Instead of catching SIGPIPE and jumping out of the signal handler with
  longjmp, ignore it and handle write errors to the local output by exiting
  from there. I have changed the error message to mention the local output
  instead of NetBSD's wrong "Connection closed by foreign host". Write errors
  to the network were already handled by exiting immediately and this now
  applies to EPIPE too.
  
  The code assumed that SIGPIPE could only be generated by the network
  connection; if it was generated by the local output, it would longjmp out of
  the signal handler and write an error message which caused another SIGPIPE.
  
  PR:		19773
  Obtained from:	NetBSD

Modified:
  stable/7/contrib/telnet/telnet/commands.c
  stable/7/contrib/telnet/telnet/externs.h
  stable/7/contrib/telnet/telnet/network.c
  stable/7/contrib/telnet/telnet/sys_bsd.c
  stable/7/contrib/telnet/telnet/telnet.c
  stable/7/contrib/telnet/telnet/terminal.c
Directory Properties:
  stable/7/contrib/telnet/   (props changed)

Modified: stable/7/contrib/telnet/telnet/commands.c
==============================================================================
--- stable/7/contrib/telnet/telnet/commands.c	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/commands.c	Thu May 13 15:28:34 2010	(r208029)
@@ -2491,8 +2491,7 @@ tn(int argc, char *argv[])
 	env_export("USER");
     }
     (void) call(status, "status", "notmuch", 0);
-    if (setjmp(peerdied) == 0)
-	telnet(user);
+    telnet(user); 
     (void) NetClose(net);
     ExitString("Connection closed by foreign host.\n",1);
     /*NOTREACHED*/

Modified: stable/7/contrib/telnet/telnet/externs.h
==============================================================================
--- stable/7/contrib/telnet/telnet/externs.h	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/externs.h	Thu May 13 15:28:34 2010	(r208029)
@@ -233,7 +233,6 @@ extern void
     SetNetTrace(char *);	/* Function to change where debugging goes */
 
 extern jmp_buf
-    peerdied,
     toplevel;		/* For error conditions. */
 
 extern void

Modified: stable/7/contrib/telnet/telnet/network.c
==============================================================================
--- stable/7/contrib/telnet/telnet/network.c	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/network.c	Thu May 13 15:28:34 2010	(r208029)
@@ -158,7 +158,7 @@ netflush(void)
 	    perror(hostname);
 	    (void)NetClose(net);
 	    ring_clear_mark(&netoring);
-	    longjmp(peerdied, -1);
+	    ExitString("Connection closed by foreign host.\n", 1);
 	    /*NOTREACHED*/
 	}
 	n = 0;

Modified: stable/7/contrib/telnet/telnet/sys_bsd.c
==============================================================================
--- stable/7/contrib/telnet/telnet/sys_bsd.c	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/sys_bsd.c	Thu May 13 15:28:34 2010	(r208029)
@@ -809,14 +809,6 @@ NetNonblockingIO(int fd, int onoff)
  */
 
 /* ARGSUSED */
-static SIG_FUNC_RET
-deadpeer(int sig __unused)
-{
-	setcommandmode();
-	longjmp(peerdied, -1);
-}
-
-/* ARGSUSED */
 SIG_FUNC_RET
 intr(int sig __unused)
 {
@@ -884,7 +876,7 @@ sys_telnet_init(void)
 {
     (void) signal(SIGINT, intr);
     (void) signal(SIGQUIT, intr2);
-    (void) signal(SIGPIPE, deadpeer);
+    (void) signal(SIGPIPE, SIG_IGN);
 #ifdef	SIGWINCH
     (void) signal(SIGWINCH, sendwin);
 #endif

Modified: stable/7/contrib/telnet/telnet/telnet.c
==============================================================================
--- stable/7/contrib/telnet/telnet/telnet.c	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/telnet.c	Thu May 13 15:28:34 2010	(r208029)
@@ -146,7 +146,6 @@ unsigned char telopt_environ = TELOPT_NE
 #endif
 
 jmp_buf	toplevel;
-jmp_buf	peerdied;
 
 int	flushline;
 int	linemode;

Modified: stable/7/contrib/telnet/telnet/terminal.c
==============================================================================
--- stable/7/contrib/telnet/telnet/terminal.c	Thu May 13 12:08:11 2010	(r208028)
+++ stable/7/contrib/telnet/telnet/terminal.c	Thu May 13 15:28:34 2010	(r208029)
@@ -111,7 +111,8 @@ init_terminal(void)
 }
 
 /*
- *		Send as much data as possible to the terminal.
+ *		Send as much data as possible to the terminal, else exits if
+ *		it encounters a permanent failure when writing to the tty.
  *
  *		Return value:
  *			-1: No useful work done, data waiting to go out.
@@ -152,8 +153,19 @@ ttyflush(int drop)
 	}
 	ring_consumed(&ttyoring, n);
     }
-    if (n < 0)
+    if (n < 0) {
+	if (errno == EAGAIN || errno == EINTR) {
+	    return -1;
+	} else {
+	    ring_consumed(&ttyoring, ring_full_count(&ttyoring));
+	    setconnmode(0);
+	    setcommandmode();
+	    NetClose(net);
+	    fprintf(stderr, "Write error on local output.\n");
+	    exit(1);
+	}
 	return -1;
+    }
     if (n == n0) {
 	if (n0)
 	    return -1;

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 15:31:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 478A1106566C;
	Thu, 13 May 2010 15:31:01 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 360F58FC0A;
	Thu, 13 May 2010 15:31:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DFV1eW073381;
	Thu, 13 May 2010 15:31:01 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DFV191073379;
	Thu, 13 May 2010 15:31:01 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201005131531.o4DFV191073379@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 13 May 2010 15:31: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: r208030 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 15:31:01 -0000

Author: trasz
Date: Thu May 13 15:31:00 2010
New Revision: 208030
URL: http://svn.freebsd.org/changeset/base/208030

Log:
  Add missing check to prevent local users from panicing the kernel by trying
  to set malformed ACL.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu May 13 15:28:34 2010	(r208029)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu May 13 15:31:00 2010	(r208030)
@@ -4939,6 +4939,10 @@ zfs_freebsd_setacl(ap)
 	if (ap->a_aclp->acl_cnt * 2 + 6 > ACL_MAX_ENTRIES)
 		return (ENOSPC);
 
+	error = acl_nfs4_check(ap->a_aclp, ap->a_vp->v_type == VDIR);
+	if (error != 0)
+		return (error);
+
 	vsecattr.vsa_mask = VSA_ACE;
 	aclbsize = ap->a_aclp->acl_cnt * sizeof(ace_t);
 	vsecattr.vsa_aclentp = kmem_alloc(aclbsize, KM_SLEEP);

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 15:44:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BBD371065675;
	Thu, 13 May 2010 15:44:49 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9F5D8FC08;
	Thu, 13 May 2010 15:44:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DFindF076548;
	Thu, 13 May 2010 15:44:49 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DFiniB076546;
	Thu, 13 May 2010 15:44:49 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005131544.o4DFiniB076546@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 13 May 2010 15:44:49 +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: r208032 - stable/8/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: Thu, 13 May 2010 15:44:49 -0000

Author: jilles
Date: Thu May 13 15:44:49 2010
New Revision: 208032
URL: http://svn.freebsd.org/changeset/base/208032

Log:
  MFC r207734: sigaltstack(2): document some modernizations:
  * un-document 'struct sigaltstack' tag for stack_t as this is BSD-specific;
    this doesn't seem useful enough to document as such
  * alternate stacks are per thread, not per process
  * update error codes to what the kernel does and POSIX requires

Modified:
  stable/8/lib/libc/sys/sigaltstack.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/sigaltstack.2
==============================================================================
--- stable/8/lib/libc/sys/sigaltstack.2	Thu May 13 15:43:40 2010	(r208031)
+++ stable/8/lib/libc/sys/sigaltstack.2	Thu May 13 15:44:49 2010	(r208032)
@@ -28,7 +28,7 @@
 .\"     @(#)sigaltstack.2	8.2 (Berkeley) 5/1/95
 .\" $FreeBSD$
 .\"
-.Dd May 1, 1995
+.Dd May 6, 2010
 .Dt SIGALTSTACK 2
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .In signal.h
 .Bd -literal
-typedef struct sigaltstack {
+typedef struct {
         char    *ss_sp;
         size_t  ss_size;
         int     ss_flags;
@@ -51,25 +51,25 @@ typedef struct sigaltstack {
 The
 .Fn sigaltstack
 system call
-allows users to define an alternate stack on which signals
-are to be processed.
+allows defining an alternate stack on which signals
+are to be processed for the current thread.
 If
 .Fa ss
 is non-zero,
 it specifies a pointer to and the size of a
 .Em "signal stack"
-on which to deliver signals,
-and tells the system if the process is currently executing
-on that stack.
+on which to deliver signals.
 When a signal's action indicates its handler
 should execute on the signal stack (specified with a
 .Xr sigaction 2
 system call), the system checks to see
-if the process is currently executing on that stack.
-If the process is not currently executing on the signal stack,
+if the thread is currently executing on that stack.
+If the thread is not currently executing on the signal stack,
 the system arranges a switch to the signal stack for the
 duration of the signal handler's execution.
 .Pp
+An active stack cannot be modified.
+.Pp
 If
 .Dv SS_DISABLE
 is set in
@@ -78,12 +78,6 @@ is set in
 and
 .Fa ss_size
 are ignored and the signal stack will be disabled.
-Trying to disable an active stack will cause
-.Fn sigaltstack
-to return -1 with
-.Va errno
-set to
-.Er EINVAL .
 A disabled stack will cause all signals to be
 taken on the regular user stack.
 If the stack is later re-enabled then all signals that were specified
@@ -96,7 +90,7 @@ The
 .Fa ss_flags
 field will contain the value
 .Dv SS_ONSTACK
-if the process is currently on a signal stack and
+if the thread is currently on a signal stack and
 .Dv SS_DISABLE
 if the signal stack is currently disabled.
 .Sh NOTES
@@ -146,8 +140,12 @@ or
 .Fa oss
 points to memory that is not a valid part of the process
 address space.
+.It Bq Er EPERM
+An attempt was made to modify an active stack.
 .It Bq Er EINVAL
-An attempt was made to disable an active stack.
+The
+.Fa ss_flags
+field was invalid.
 .It Bq Er ENOMEM
 Size of alternate stack area is less than or equal to
 .Dv MINSIGSTKSZ .

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 16:42:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61189106566C;
	Thu, 13 May 2010 16:42:01 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F1158FC1C;
	Thu, 13 May 2010 16:42:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DGg1Wa089223;
	Thu, 13 May 2010 16:42:01 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DGg1nh089221;
	Thu, 13 May 2010 16:42:01 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201005131642.o4DGg1nh089221@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 13 May 2010 16:42: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: r208033 - head/lib/libc/posix1e
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 16:42:01 -0000

Author: trasz
Date: Thu May 13 16:42:01 2010
New Revision: 208033
URL: http://svn.freebsd.org/changeset/base/208033

Log:
  Make it possible to actually use NFSv4 permission bits with acl_set_perm(3)
  and acl_delete_perm(3).  It went undetected, because neither setfacl(1)
  nor Samba use this routines.  D'oh.
  
  MFC after:	1 week

Modified:
  head/lib/libc/posix1e/acl_perm.c

Modified: head/lib/libc/posix1e/acl_perm.c
==============================================================================
--- head/lib/libc/posix1e/acl_perm.c	Thu May 13 15:44:49 2010	(r208032)
+++ head/lib/libc/posix1e/acl_perm.c	Thu May 13 16:42:01 2010	(r208033)
@@ -35,6 +35,20 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+static int
+_perm_is_invalid(acl_perm_t perm)
+{
+
+	/* Check if more than a single bit is set. */
+	if ((perm & -perm) == perm &&
+	    (perm & (ACL_POSIX1E_BITS | ACL_NFS4_PERM_BITS)) == perm)
+		return (0);
+
+	errno = EINVAL;
+
+	return (1);
+}
+
 /*
  * acl_add_perm() (23.4.1): add the permission contained in perm to the
  * permission set permset_d
@@ -43,18 +57,17 @@ int
 acl_add_perm(acl_permset_t permset_d, acl_perm_t perm)
 {
 
-	if (permset_d) {
-		switch(perm) {
-		case ACL_READ:
-		case ACL_WRITE:
-		case ACL_EXECUTE:
-			*permset_d |= perm;
-			return (0);
-		}
+	if (permset_d == NULL) {
+		errno = EINVAL;
+		return (-1);
 	}
 
-	errno = EINVAL;
-	return (-1);
+	if (_perm_is_invalid(perm))
+		return (-1);
+
+	*permset_d |= perm;
+
+	return (0);
 }
 
 /*
@@ -83,16 +96,15 @@ int
 acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm)
 {
 
-	if (permset_d) {
-		switch(perm) {
-		case ACL_READ:
-		case ACL_WRITE:
-		case ACL_EXECUTE:
-			*permset_d &= ~(perm & ACL_PERM_BITS);
-			return (0);
-		}
+	if (permset_d == NULL) {
+		errno = EINVAL;
+		return (-1);
 	}
 
-	errno = EINVAL;
-	return (-1);
+	if (_perm_is_invalid(perm))
+		return (-1);
+
+	*permset_d &= ~perm;
+
+	return (0);
 }

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 16:44:28 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 878991065675;
	Thu, 13 May 2010 16:44:28 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 76B768FC17;
	Thu, 13 May 2010 16:44:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DGiSOX089892;
	Thu, 13 May 2010 16:44:28 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DGiSXE089890;
	Thu, 13 May 2010 16:44:28 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201005131644.o4DGiSXE089890@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 13 May 2010 16:44: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: r208034 - head/lib/libc/posix1e
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 16:44:28 -0000

Author: trasz
Date: Thu May 13 16:44:27 2010
New Revision: 208034
URL: http://svn.freebsd.org/changeset/base/208034

Log:
  Make branding less intrusive - in acl_set(3), in case ACL brand
  is ACL_BRAND_UNKNOWN, do what the programmer says instead of failing.
  
  MFC after:	1 week

Modified:
  head/lib/libc/posix1e/acl_branding.c

Modified: head/lib/libc/posix1e/acl_branding.c
==============================================================================
--- head/lib/libc/posix1e/acl_branding.c	Thu May 13 16:42:01 2010	(r208033)
+++ head/lib/libc/posix1e/acl_branding.c	Thu May 13 16:44:27 2010	(r208034)
@@ -129,6 +129,9 @@ _acl_type_not_valid_for_acl(const acl_t 
 		if (type == ACL_TYPE_ACCESS || type == ACL_TYPE_DEFAULT)
 			return (0);
 		break;
+
+	case ACL_BRAND_UNKNOWN:
+		return (0);
 	}
 
 	return (-1);

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 16:46:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E72A31065674;
	Thu, 13 May 2010 16:46:23 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D6A168FC0A;
	Thu, 13 May 2010 16:46:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DGkNQI090359;
	Thu, 13 May 2010 16:46:23 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DGkNbf090357;
	Thu, 13 May 2010 16:46:23 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201005131646.o4DGkNbf090357@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 13 May 2010 16:46: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: r208035 - head/bin/setfacl
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 16:46:24 -0000

Author: trasz
Date: Thu May 13 16:46:23 2010
New Revision: 208035
URL: http://svn.freebsd.org/changeset/base/208035

Log:
  Update authors and history.
  
  MFC after:	1 week

Modified:
  head/bin/setfacl/setfacl.1

Modified: head/bin/setfacl/setfacl.1
==============================================================================
--- head/bin/setfacl/setfacl.1	Thu May 13 16:44:27 2010	(r208034)
+++ head/bin/setfacl/setfacl.1	Thu May 13 16:46:23 2010	(r208035)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2009
+.Dd May 13, 2010
 .Dt SETFACL 1
 .Os
 .Sh NAME
@@ -453,8 +453,13 @@ as part of the
 .Tn TrustedBSD
 Project and introduced in
 .Fx 5.0 .
+NFSv4 ACL support was introduced in
+.Fx 8.1 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm
 utility was written by
 .An Chris D. Faulhaber Aq jedgar@fxp.org .
+NFSv4 ACL support was implemented by
+.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 16:48:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67C661065672;
	Thu, 13 May 2010 16:48:29 +0000 (UTC) (envelope-from zec@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 575DA8FC15;
	Thu, 13 May 2010 16:48:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DGmTtc090875;
	Thu, 13 May 2010 16:48:29 GMT (envelope-from zec@svn.freebsd.org)
Received: (from zec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DGmTeZ090873;
	Thu, 13 May 2010 16:48:29 GMT (envelope-from zec@svn.freebsd.org)
Message-Id: <201005131648.o4DGmTeZ090873@svn.freebsd.org>
From: Marko Zec 
Date: Thu, 13 May 2010 16:48: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: r208036 - head/sys/netgraph
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 16:48:29 -0000

Author: zec
Date: Thu May 13 16:48:28 2010
New Revision: 208036
URL: http://svn.freebsd.org/changeset/base/208036

Log:
  Increase the target buffer for performing NGM_ASCII2BINARY conversion
  from 2000 bytes to 20 Kbytes, which now matches the buffer size used for
  NGM_BINARY2ASCII conversions.
  
  The aim of this change is to allow for bigger binary structures to be
  managed via netgraph ASCII messages, until we come up with an API
  improvement which would get rid of such arbitrary hardcoded limits.
  
  MFC after:	3 days

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==============================================================================
--- head/sys/netgraph/ng_base.c	Thu May 13 16:46:23 2010	(r208035)
+++ head/sys/netgraph/ng_base.c	Thu May 13 16:48:28 2010	(r208036)
@@ -2763,7 +2763,7 @@ ng_generic_msg(node_p here, item_p item,
 
 	case NGM_ASCII2BINARY:
 	    {
-		int bufSize = 2000;	/* XXX hard coded constant */
+		int bufSize = 20 * 1024;	/* XXX hard coded constant */
 		const struct ng_cmdlist *c;
 		const struct ng_parse_type *argstype;
 		struct ng_mesg *ascii, *binary;

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 17:22:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0DC931065670;
	Thu, 13 May 2010 17:22:01 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE7278FC19;
	Thu, 13 May 2010 17:22:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DHM0qq098662;
	Thu, 13 May 2010 17:22:00 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DHM0iP098653;
	Thu, 13 May 2010 17:22:00 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005131722.o4DHM0iP098653@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 13 May 2010 17:22:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208037 - in stable/8/tools/regression/bin/sh:
	expansion parameters parser
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 17:22:01 -0000

Author: jilles
Date: Thu May 13 17:22:00 2010
New Revision: 208037
URL: http://svn.freebsd.org/changeset/base/208037

Log:
  MFC r206143,r206148,r206149,r206167,r206491,r206817,r207127,r207824
  Various testcases that work correctly with stable/8 sh.

Added:
  stable/8/tools/regression/bin/sh/expansion/arith4.0
     - copied unchanged from r206167, head/tools/regression/bin/sh/expansion/arith4.0
  stable/8/tools/regression/bin/sh/expansion/plus-minus3.0
     - copied unchanged from r206817, head/tools/regression/bin/sh/expansion/plus-minus3.0
  stable/8/tools/regression/bin/sh/expansion/tilde1.0
     - copied unchanged from r206149, head/tools/regression/bin/sh/expansion/tilde1.0
  stable/8/tools/regression/bin/sh/expansion/trim1.0
     - copied unchanged from r206143, head/tools/regression/bin/sh/expansion/trim1.0
  stable/8/tools/regression/bin/sh/expansion/trim3.0
     - copied unchanged from r207127, head/tools/regression/bin/sh/expansion/trim3.0
  stable/8/tools/regression/bin/sh/parameters/pwd1.0
     - copied unchanged from r206491, head/tools/regression/bin/sh/parameters/pwd1.0
  stable/8/tools/regression/bin/sh/parser/case1.0
     - copied unchanged from r207824, head/tools/regression/bin/sh/parser/case1.0
  stable/8/tools/regression/bin/sh/parser/case2.0
     - copied unchanged from r207824, head/tools/regression/bin/sh/parser/case2.0
  stable/8/tools/regression/bin/sh/parser/heredoc3.0
     - copied unchanged from r207824, head/tools/regression/bin/sh/parser/heredoc3.0
Modified:
Directory Properties:
  stable/8/tools/regression/bin/sh/   (props changed)

Copied: stable/8/tools/regression/bin/sh/expansion/arith4.0 (from r206167, head/tools/regression/bin/sh/expansion/arith4.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/arith4.0	Thu May 13 17:22:00 2010	(r208037, copy of r206167, head/tools/regression/bin/sh/expansion/arith4.0)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+	if [ $(($1)) != $2 ]; then
+		failures=$((failures+1))
+		echo "For $1, expected $2 actual $(($1))"
+	fi
+}
+
+check '20 / 2 / 2' 5
+check '20 - 2 - 2' 16
+unset a b c d
+check "a = b = c = d = 1" 1
+check "a == 1 && b == 1 && c == 1 && d == 1" 1
+check "a += b += c += d" 4
+check "a == 4 && b == 3 && c == 2 && d == 1" 1
+
+exit $((failures != 0))

Copied: stable/8/tools/regression/bin/sh/expansion/plus-minus3.0 (from r206817, head/tools/regression/bin/sh/expansion/plus-minus3.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/plus-minus3.0	Thu May 13 17:22:00 2010	(r208037, copy of r206817, head/tools/regression/bin/sh/expansion/plus-minus3.0)
@@ -0,0 +1,44 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+	code="$1"
+	expected="$2"
+	oIFS="$IFS"
+	eval "$code"
+	IFS='|'
+	result="$#|$*"
+	IFS="$oIFS"
+	if [ "x$result" = "x$expected" ]; then
+		ok=x$ok
+	else
+		failures=x$failures
+		echo "For $code, expected $expected actual $result"
+	fi
+}
+
+# We follow original ash behaviour for quoted ${var+-=?} expansions:
+# a double-quote in one switches back to unquoted state.
+# This allows expanding a variable as a single word if it is set
+# and substituting multiple words otherwise.
+# It is also close to the Bourne and Korn shells.
+# POSIX leaves this undefined, and various other shells treat
+# such double-quotes as introducing a second level of quoting
+# which does not do much except quoting close braces.
+
+testcase 'set -- "${p+"/et[c]/"}"'		'1|/etc/'
+testcase 'set -- "${p-"/et[c]/"}"'		'1|/et[c]/'
+testcase 'set -- "${p+"$p"}"'			'1|/etc/'
+testcase 'set -- "${p-"$p"}"'			'1|/et[c]/'
+testcase 'set -- "${p+"""/et[c]/"}"'		'1|/etc/'
+testcase 'set -- "${p-"""/et[c]/"}"'		'1|/et[c]/'
+testcase 'set -- "${p+"""$p"}"'			'1|/etc/'
+testcase 'set -- "${p-"""$p"}"'			'1|/et[c]/'
+testcase 'set -- "${p+"\@"}"'			'1|@'
+testcase 'set -- "${p+"'\''/et[c]/'\''"}"'	'1|/et[c]/'
+
+test "x$failures" = x

Copied: stable/8/tools/regression/bin/sh/expansion/tilde1.0 (from r206149, head/tools/regression/bin/sh/expansion/tilde1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/tilde1.0	Thu May 13 17:22:00 2010	(r208037, copy of r206149, head/tools/regression/bin/sh/expansion/tilde1.0)
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+HOME=/tmp
+roothome=~root
+if [ "$roothome" = "~root" ]; then
+	echo "~root is not expanded!"
+	exit 2
+fi
+
+testcase() {
+	code="$1"
+	expected="$2"
+	oIFS="$IFS"
+	eval "$code"
+	IFS='|'
+	result="$#|$*"
+	IFS="$oIFS"
+	if [ "x$result" = "x$expected" ]; then
+		ok=x$ok
+	else
+		failures=x$failures
+		echo "For $code, expected $expected actual $result"
+	fi
+}
+
+testcase 'set -- ~'				'1|/tmp'
+testcase 'set -- ~/foo'				'1|/tmp/foo'
+testcase 'set -- x~'				'1|x~'
+testcase 'set -- ~root'				"1|$roothome"
+h=~
+testcase 'set -- "$h"'				'1|/tmp'
+ooIFS=$IFS
+IFS=m
+testcase 'set -- ~'				'1|/tmp'
+testcase 'set -- ~/foo'				'1|/tmp/foo'
+testcase 'set -- $h'				'2|/t|p'
+IFS=$ooIFS
+t=\~
+testcase 'set -- $t'				'1|~'
+r=$(cat <&2 ;;
+	esac)
+}
+f1
+f2() {
+	x=$(case x in
+		(x|esac) ;;
+		(*) echo bad >&2
+	esac)
+}
+f2
+f3() {
+	x=$(case x in
+		x|esac) ;;
+		*) echo bad >&2 ;;
+	esac)
+}
+f3
+f4() {
+	x=$(case x in
+		x|esac) ;;
+		*) echo bad >&2
+	esac)
+}
+f4

Copied: stable/8/tools/regression/bin/sh/parser/heredoc3.0 (from r207824, head/tools/regression/bin/sh/parser/heredoc3.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/parser/heredoc3.0	Thu May 13 17:22:00 2010	(r208037, copy of r207824, head/tools/regression/bin/sh/parser/heredoc3.0)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+# This may be expected to work, but pretty much only ash derivatives allow it.
+
+test "$(cat <
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3293A106564A;
	Thu, 13 May 2010 17:39:00 +0000 (UTC)
	(envelope-from alexbestms@uni-muenster.de)
Received: from SECMAIL.UNI-MUENSTER.DE (SECMAIL.UNI-MUENSTER.DE
	[128.176.192.141])
	by mx1.freebsd.org (Postfix) with ESMTP id DD7F48FC18;
	Thu, 13 May 2010 17:38:59 +0000 (UTC)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by SECMAIL.UNI-MUENSTER.DE (Postfix) with ESMTP id 3BF3DBF405;
	Thu, 13 May 2010 19:09:05 +0200 (CEST)
Received: by fxm17 with SMTP id 17so585896fxm.13
	for ; Thu, 13 May 2010 10:09:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.135.18 with SMTP id m18mr198435mun.4.1273770544978; Thu, 
	13 May 2010 10:09:04 -0700 (PDT)
Received: by 10.103.167.8 with HTTP; Thu, 13 May 2010 10:09:04 -0700 (PDT)
In-Reply-To: <201005121547.o4CFlhtF051299@svn.freebsd.org>
References: <201005121547.o4CFlhtF051299@svn.freebsd.org>
Date: Thu, 13 May 2010 19:09:04 +0200
Message-ID: 
From: Alexander Best 
To: Christian Brueffer 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r207964 - head/sbin/kldstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 17:39:00 -0000

On Wed, May 12, 2010 at 5:47 PM, Christian Brueffer
 wrote:

[snip]

>
> =A0PR: =A0 =A0 =A0 =A0 =A0 146046
> =A0Submitted by: Alexander Best 
> =A0Reviewed by: =A0kan
> =A0MFC after: =A0 =A01 week

thanks. maybe you could also have a look at docs/146047 which improves
the kldstat(2) manual.

cheers

[snip]



--=20
Alexander Best

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 17:45:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F07BC106568E;
	Thu, 13 May 2010 17:45:32 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DD7BB8FC18;
	Thu, 13 May 2010 17:45:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DHjW59004083;
	Thu, 13 May 2010 17:45:32 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DHjW7b004078;
	Thu, 13 May 2010 17:45:32 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201005131745.o4DHjW7b004078@svn.freebsd.org>
From: Navdeep Parhar 
Date: Thu, 13 May 2010 17:45:32 +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: r208039 - stable/8/sys/dev/cxgb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 17:45:33 -0000

Author: np
Date: Thu May 13 17:45:32 2010
New Revision: 208039
URL: http://svn.freebsd.org/changeset/base/208039

Log:
  MFC r207639, r207643, r207687, r207688
  
  r207639: Add IFCAP_LINKSTATE to cxgb
  r207643: T3 hardware filters + cxgbtool interface to this functionality.
  r207687: if_cxgb should not depend on the T3 firmware module directly.
  r207688: various doorbell adjustments

Modified:
  stable/8/sys/dev/cxgb/cxgb_adapter.h
  stable/8/sys/dev/cxgb/cxgb_ioctl.h
  stable/8/sys/dev/cxgb/cxgb_main.c
  stable/8/sys/dev/cxgb/cxgb_sge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_adapter.h	Thu May 13 17:32:30 2010	(r208038)
+++ stable/8/sys/dev/cxgb/cxgb_adapter.h	Thu May 13 17:45:32 2010	(r208039)
@@ -204,6 +204,7 @@ struct sge_fl {
 	uint32_t	cidx;
 	uint32_t	pidx;
 	uint32_t	gen;
+	uint32_t	db_pending;
 	bus_addr_t	phys_addr;
 	uint32_t	cntxt_id;
 	uint32_t	empty;
@@ -232,6 +233,7 @@ struct sge_txq {
 	uint32_t	pidx;
 	uint32_t	gen;
 	uint32_t	unacked;
+	uint32_t	db_pending;
 	struct tx_desc	*desc;
 	struct tx_sw_desc *sdesc;
 	uint32_t	token;

Modified: stable/8/sys/dev/cxgb/cxgb_ioctl.h
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_ioctl.h	Thu May 13 17:32:30 2010	(r208038)
+++ stable/8/sys/dev/cxgb/cxgb_ioctl.h	Thu May 13 17:45:32 2010	(r208039)
@@ -59,6 +59,9 @@ enum {
 	CH_CLEAR_STATS,
 	CH_GET_UP_LA,
 	CH_GET_UP_IOQS,
+	CH_SET_FILTER,
+	CH_DEL_FILTER,
+	CH_GET_FILTER,
 };
 
 /* statistics categories */
@@ -215,6 +218,29 @@ struct ch_up_ioqs {
 	struct t3_ioq_entry *data;
 };
 
+struct ch_filter_tuple {
+	uint32_t sip;
+	uint32_t dip;
+	uint16_t sport;
+	uint16_t dport;
+	uint16_t vlan:12;
+	uint16_t vlan_prio:3;
+};
+
+struct ch_filter {
+	uint32_t filter_id;
+	struct ch_filter_tuple val;
+	struct ch_filter_tuple mask;
+	uint16_t mac_addr_idx;
+	uint8_t mac_hit:1;
+	uint8_t proto:2;
+
+	uint8_t want_filter_id:1;
+	uint8_t pass:1;
+	uint8_t rss:1;
+	uint8_t qset;
+};
+
 #define CHELSIO_SETREG		_IOW('f', CH_SETREG, struct ch_reg)
 #define CHELSIO_GETREG		_IOWR('f', CH_GETREG, struct ch_reg)
 #define CHELSIO_GETMTUTAB	_IOR('f', CH_GETMTUTAB, struct ch_mtus)
@@ -239,4 +265,7 @@ struct ch_up_ioqs {
 #define CHELSIO_GET_EEPROM	_IOWR('f', CH_GET_EEPROM, struct ch_eeprom)
 #define CHELSIO_GET_UP_LA	_IOWR('f', CH_GET_UP_LA, struct ch_up_la)
 #define CHELSIO_GET_UP_IOQS	_IOWR('f', CH_GET_UP_IOQS, struct ch_up_ioqs)
+#define CHELSIO_SET_FILTER	_IOW('f', CH_SET_FILTER, struct ch_filter)
+#define CHELSIO_DEL_FILTER	_IOW('f', CH_DEL_FILTER, struct ch_filter)
+#define CHELSIO_GET_FILTER	_IOWR('f', CH_GET_FILTER, struct ch_filter)
 #endif

Modified: stable/8/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_main.c	Thu May 13 17:32:30 2010	(r208038)
+++ stable/8/sys/dev/cxgb/cxgb_main.c	Thu May 13 17:45:32 2010	(r208039)
@@ -99,6 +99,13 @@ static void cxgb_ext_intr_handler(void *
 static void cxgb_tick_handler(void *, int);
 static void cxgb_tick(void *);
 static void setup_rss(adapter_t *sc);
+static int alloc_filters(struct adapter *);
+static int setup_hw_filters(struct adapter *);
+static int set_filter(struct adapter *, int, const struct filter_info *);
+static inline void mk_set_tcb_field(struct cpl_set_tcb_field *, unsigned int,
+    unsigned int, u64, u64);
+static inline void set_tcb_field_ulp(struct cpl_set_tcb_field *, unsigned int,
+    unsigned int, u64, u64);
 
 /* Attachment glue for the PCI controller end of the device.  Each port of
  * the device is attached separately, as defined later.
@@ -981,7 +988,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_VLAN_HWTSO | IFCAP_LINKSTATE)
 #define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6)
 
 static int
@@ -1665,6 +1672,13 @@ cxgb_up(struct adapter *sc)
 			if ((err = update_tpsram(sc)))
 				goto out;
 
+		if (is_offload(sc)) {
+			sc->params.mc5.nservers = 0;
+			sc->params.mc5.nroutes = 0;
+			sc->params.mc5.nfilters = t3_mc5_size(&sc->mc5) -
+			    MC5_MIN_TIDS;
+		}
+
 		err = t3_init_hw(sc, 0);
 		if (err)
 			goto out;
@@ -1676,6 +1690,7 @@ cxgb_up(struct adapter *sc)
 		if (err)
 			goto out;
 
+		alloc_filters(sc);
 		setup_rss(sc);
 
 		t3_intr_clear(sc);
@@ -1702,6 +1717,7 @@ cxgb_up(struct adapter *sc)
 	
 	if (!(sc->flags & QUEUES_BOUND)) {
 		bind_qsets(sc);
+		setup_hw_filters(sc);
 		sc->flags |= QUEUES_BOUND;		
 	}
 
@@ -3080,6 +3096,139 @@ cxgb_extension_ioctl(struct cdev *dev, u
 		free(buf, M_DEVBUF);
 		break;
 	}
+	case CHELSIO_SET_FILTER: {
+		struct ch_filter *f = (struct ch_filter *)data;;
+		struct filter_info *p;
+		unsigned int nfilters = sc->params.mc5.nfilters;
+
+		if (!is_offload(sc))
+			return (EOPNOTSUPP);	/* No TCAM */
+		if (!(sc->flags & FULL_INIT_DONE))
+			return (EAGAIN);	/* mc5 not setup yet */
+		if (nfilters == 0)
+			return (EBUSY);		/* TOE will use TCAM */
+
+		/* sanity checks */
+		if (f->filter_id >= nfilters ||
+		    (f->val.dip && f->mask.dip != 0xffffffff) ||
+		    (f->val.sport && f->mask.sport != 0xffff) ||
+		    (f->val.dport && f->mask.dport != 0xffff) ||
+		    (f->val.vlan && f->mask.vlan != 0xfff) ||
+		    (f->val.vlan_prio &&
+			f->mask.vlan_prio != FILTER_NO_VLAN_PRI) ||
+		    (f->mac_addr_idx != 0xffff && f->mac_addr_idx > 15) ||
+		    f->qset >= SGE_QSETS ||
+		    sc->rrss_map[f->qset] >= RSS_TABLE_SIZE)
+			return (EINVAL);
+
+		/* Was allocated with M_WAITOK */
+		KASSERT(sc->filters, ("filter table NULL\n"));
+
+		p = &sc->filters[f->filter_id];
+		if (p->locked)
+			return (EPERM);
+
+		bzero(p, sizeof(*p));
+		p->sip = f->val.sip;
+		p->sip_mask = f->mask.sip;
+		p->dip = f->val.dip;
+		p->sport = f->val.sport;
+		p->dport = f->val.dport;
+		p->vlan = f->mask.vlan ? f->val.vlan : 0xfff;
+		p->vlan_prio = f->mask.vlan_prio ? (f->val.vlan_prio & 6) :
+		    FILTER_NO_VLAN_PRI;
+		p->mac_hit = f->mac_hit;
+		p->mac_vld = f->mac_addr_idx != 0xffff;
+		p->mac_idx = f->mac_addr_idx;
+		p->pkt_type = f->proto;
+		p->report_filter_id = f->want_filter_id;
+		p->pass = f->pass;
+		p->rss = f->rss;
+		p->qset = f->qset;
+
+		error = set_filter(sc, f->filter_id, p);
+		if (error == 0)
+			p->valid = 1;
+		break;
+	}
+	case CHELSIO_DEL_FILTER: {
+		struct ch_filter *f = (struct ch_filter *)data;
+		struct filter_info *p;
+		unsigned int nfilters = sc->params.mc5.nfilters;
+
+		if (!is_offload(sc))
+			return (EOPNOTSUPP);
+		if (!(sc->flags & FULL_INIT_DONE))
+			return (EAGAIN);
+		if (nfilters == 0 || sc->filters == NULL)
+			return (EINVAL);
+		if (f->filter_id >= nfilters)
+		       return (EINVAL);
+
+		p = &sc->filters[f->filter_id];
+		if (p->locked)
+			return (EPERM);
+		if (!p->valid)
+			return (EFAULT); /* Read "Bad address" as "Bad index" */
+
+		bzero(p, sizeof(*p));
+		p->sip = p->sip_mask = 0xffffffff;
+		p->vlan = 0xfff;
+		p->vlan_prio = FILTER_NO_VLAN_PRI;
+		p->pkt_type = 1;
+		error = set_filter(sc, f->filter_id, p);
+		break;
+	}
+	case CHELSIO_GET_FILTER: {
+		struct ch_filter *f = (struct ch_filter *)data;
+		struct filter_info *p;
+		unsigned int i, nfilters = sc->params.mc5.nfilters;
+
+		if (!is_offload(sc))
+			return (EOPNOTSUPP);
+		if (!(sc->flags & FULL_INIT_DONE))
+			return (EAGAIN);
+		if (nfilters == 0 || sc->filters == NULL)
+			return (EINVAL);
+
+		i = f->filter_id == 0xffffffff ? 0 : f->filter_id + 1;
+		for (; i < nfilters; i++) {
+			p = &sc->filters[i];
+			if (!p->valid)
+				continue;
+
+			bzero(f, sizeof(*f));
+
+			f->filter_id = i;
+			f->val.sip = p->sip;
+			f->mask.sip = p->sip_mask;
+			f->val.dip = p->dip;
+			f->mask.dip = p->dip ? 0xffffffff : 0;
+			f->val.sport = p->sport;
+			f->mask.sport = p->sport ? 0xffff : 0;
+			f->val.dport = p->dport;
+			f->mask.dport = p->dport ? 0xffff : 0;
+			f->val.vlan = p->vlan == 0xfff ? 0 : p->vlan;
+			f->mask.vlan = p->vlan == 0xfff ? 0 : 0xfff;
+			f->val.vlan_prio = p->vlan_prio == FILTER_NO_VLAN_PRI ?
+			    0 : p->vlan_prio;
+			f->mask.vlan_prio = p->vlan_prio == FILTER_NO_VLAN_PRI ?
+			    0 : FILTER_NO_VLAN_PRI;
+			f->mac_hit = p->mac_hit;
+			f->mac_addr_idx = p->mac_vld ? p->mac_idx : 0xffff;
+			f->proto = p->pkt_type;
+			f->want_filter_id = p->report_filter_id;
+			f->pass = p->pass;
+			f->rss = p->rss;
+			f->qset = p->qset;
+
+			break;
+		}
+		
+		if (i == nfilters)
+			f->filter_id = 0xffffffff;
+		break;
+	}
 	default:
 		return (EOPNOTSUPP);
 		break;
@@ -3134,5 +3283,127 @@ cxgb_get_regs(adapter_t *sc, struct ch_i
 		       XGM_REG(A_XGM_RX_SPI4_SOP_EOP_CNT, 1));
 }
 
+static int
+alloc_filters(struct adapter *sc)
+{
+	struct filter_info *p;
+	unsigned int nfilters = sc->params.mc5.nfilters;
+
+	if (nfilters == 0)
+		return (0);
+
+	p = malloc(sizeof(*p) * nfilters, M_DEVBUF, M_WAITOK | M_ZERO);
+	sc->filters = p;
+
+	p = &sc->filters[nfilters - 1];
+	p->vlan = 0xfff;
+	p->vlan_prio = FILTER_NO_VLAN_PRI;
+	p->pass = p->rss = p->valid = p->locked = 1;
+
+	return (0);
+}
+
+static int
+setup_hw_filters(struct adapter *sc)
+{
+	int i, rc;
+	unsigned int nfilters = sc->params.mc5.nfilters;
+
+	if (!sc->filters)
+		return (0);
+
+	t3_enable_filters(sc);
+
+	for (i = rc = 0; i < nfilters && !rc; i++) {
+		if (sc->filters[i].locked)
+			rc = set_filter(sc, i, &sc->filters[i]);
+	}
+
+	return (rc);
+}
+
+static int
+set_filter(struct adapter *sc, int id, const struct filter_info *f)
+{
+	int len;
+	struct mbuf *m;
+	struct ulp_txpkt *txpkt;
+	struct work_request_hdr *wr;
+	struct cpl_pass_open_req *oreq;
+	struct cpl_set_tcb_field *sreq;
+
+	len = sizeof(*wr) + sizeof(*oreq) + 2 * sizeof(*sreq);
+	KASSERT(len <= MHLEN, ("filter request too big for an mbuf"));
+
+	id += t3_mc5_size(&sc->mc5) - sc->params.mc5.nroutes -
+	      sc->params.mc5.nfilters;
+
+	m = m_gethdr(M_WAITOK, MT_DATA);
+	m->m_len = m->m_pkthdr.len = len;
+	bzero(mtod(m, char *), len);
 
-MODULE_DEPEND(if_cxgb, cxgb_t3fw, 1, 1, 1);
+	wr = mtod(m, struct work_request_hdr *);
+	wr->wrh_hi = htonl(V_WR_OP(FW_WROPCODE_BYPASS) | F_WR_ATOMIC);
+
+	oreq = (struct cpl_pass_open_req *)(wr + 1);
+	txpkt = (struct ulp_txpkt *)oreq;
+	txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT));
+	txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*oreq) / 8));
+	OPCODE_TID(oreq) = htonl(MK_OPCODE_TID(CPL_PASS_OPEN_REQ, id));
+	oreq->local_port = htons(f->dport);
+	oreq->peer_port = htons(f->sport);
+	oreq->local_ip = htonl(f->dip);
+	oreq->peer_ip = htonl(f->sip);
+	oreq->peer_netmask = htonl(f->sip_mask);
+	oreq->opt0h = 0;
+	oreq->opt0l = htonl(F_NO_OFFLOAD);
+	oreq->opt1 = htonl(V_MAC_MATCH_VALID(f->mac_vld) |
+			 V_CONN_POLICY(CPL_CONN_POLICY_FILTER) |
+			 V_VLAN_PRI(f->vlan_prio >> 1) |
+			 V_VLAN_PRI_VALID(f->vlan_prio != FILTER_NO_VLAN_PRI) |
+			 V_PKT_TYPE(f->pkt_type) | V_OPT1_VLAN(f->vlan) |
+			 V_MAC_MATCH(f->mac_idx | (f->mac_hit << 4)));
+
+	sreq = (struct cpl_set_tcb_field *)(oreq + 1);
+	set_tcb_field_ulp(sreq, id, 1, 0x1800808000ULL,
+			  (f->report_filter_id << 15) | (1 << 23) |
+			  ((u64)f->pass << 35) | ((u64)!f->rss << 36));
+	set_tcb_field_ulp(sreq + 1, id, 0, 0xffffffff, (2 << 19) | 1);
+	t3_mgmt_tx(sc, m);
+
+	if (f->pass && !f->rss) {
+		len = sizeof(*sreq);
+		m = m_gethdr(M_WAITOK, MT_DATA);
+		m->m_len = m->m_pkthdr.len = len;
+		bzero(mtod(m, char *), len);
+		sreq = mtod(m, struct cpl_set_tcb_field *);
+		sreq->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+		mk_set_tcb_field(sreq, id, 25, 0x3f80000,
+				 (u64)sc->rrss_map[f->qset] << 19);
+		t3_mgmt_tx(sc, m);
+	}
+	return 0;
+}
+
+static inline void
+mk_set_tcb_field(struct cpl_set_tcb_field *req, unsigned int tid,
+    unsigned int word, u64 mask, u64 val)
+{
+	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
+	req->reply = V_NO_REPLY(1);
+	req->cpu_idx = 0;
+	req->word = htons(word);
+	req->mask = htobe64(mask);
+	req->val = htobe64(val);
+}
+
+static inline void
+set_tcb_field_ulp(struct cpl_set_tcb_field *req, unsigned int tid,
+    unsigned int word, u64 mask, u64 val)
+{
+	struct ulp_txpkt *txpkt = (struct ulp_txpkt *)req;
+
+	txpkt->cmd_dest = htonl(V_ULPTX_CMD(ULP_TXPKT));
+	txpkt->len = htonl(V_ULPTX_NFLITS(sizeof(*req) / 8));
+	mk_set_tcb_field(req, tid, word, mask, val);
+}

Modified: stable/8/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/8/sys/dev/cxgb/cxgb_sge.c	Thu May 13 17:32:30 2010	(r208038)
+++ stable/8/sys/dev/cxgb/cxgb_sge.c	Thu May 13 17:45:32 2010	(r208039)
@@ -696,7 +696,7 @@ refill_fl(adapter_t *sc, struct sge_fl *
 	struct refill_fl_cb_arg cb_arg;
 	struct mbuf *m;
 	caddr_t cl;
-	int err, count = 0;
+	int err;
 	
 	cb_arg.error = 0;
 	while (n--) {
@@ -754,12 +754,14 @@ refill_fl(adapter_t *sc, struct sge_fl *
 			d = q->desc;
 		}
 		q->credits++;
-		count++;
+		q->db_pending++;
 	}
 
 done:
-	if (count)
+	if (q->db_pending >= 32) {
+		q->db_pending = 0;
 		t3_write_reg(sc, A_SG_KDOORBELL, V_EGRCNTX(q->cntxt_id));
+	}
 }
 
 
@@ -810,8 +812,10 @@ __refill_fl(adapter_t *adap, struct sge_
 static __inline void
 __refill_fl_lt(adapter_t *adap, struct sge_fl *fl, int max)
 {
-	if ((fl->size - fl->credits) < max)
-		refill_fl(adap, fl, min(max, fl->size - fl->credits));
+	uint32_t reclaimable = fl->size - fl->credits;
+
+	if (reclaimable > 0)
+		refill_fl(adap, fl, min(max, reclaimable));
 }
 
 /**
@@ -1261,7 +1265,7 @@ make_sgl(struct sg_ent *sgp, bus_dma_seg
  *	When GTS is disabled we unconditionally ring the doorbell.
  */
 static __inline void
-check_ring_tx_db(adapter_t *adap, struct sge_txq *q)
+check_ring_tx_db(adapter_t *adap, struct sge_txq *q, int mustring)
 {
 #if USE_GTS
 	clear_bit(TXQ_LAST_PKT_DB, &q->flags);
@@ -1275,9 +1279,12 @@ check_ring_tx_db(adapter_t *adap, struct
 			     F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
 	}
 #else
-	wmb();            /* write descriptors before telling HW */
-	t3_write_reg(adap, A_SG_KDOORBELL,
-		     F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
+	if (mustring || ++q->db_pending >= 32) {
+		wmb();            /* write descriptors before telling HW */
+		t3_write_reg(adap, A_SG_KDOORBELL,
+		    F_SELEGRCNTX | V_EGRCNTX(q->cntxt_id));
+		q->db_pending = 0;
+	}
 #endif
 }
 
@@ -1480,7 +1487,7 @@ t3_encap(struct sge_qset *qs, struct mbu
 		wmb();
 		ETHER_BPF_MTAP(pi->ifp, m0);
 		wr_gen2(txd, txqs.gen);
-		check_ring_tx_db(sc, txq);
+		check_ring_tx_db(sc, txq, 0);
 		return (0);		
 	} else if (tso_info) {
 		int eth_type;
@@ -1543,7 +1550,7 @@ t3_encap(struct sge_qset *qs, struct mbu
 			wmb();
 			ETHER_BPF_MTAP(pi->ifp, m0);
 			wr_gen2(txd, txqs.gen);
-			check_ring_tx_db(sc, txq);
+			check_ring_tx_db(sc, txq, 0);
 			m_freem(m0);
 			return (0);
 		}
@@ -1574,7 +1581,7 @@ t3_encap(struct sge_qset *qs, struct mbu
 			wmb();
 			ETHER_BPF_MTAP(pi->ifp, m0);
 			wr_gen2(txd, txqs.gen);
-			check_ring_tx_db(sc, txq);
+			check_ring_tx_db(sc, txq, 0);
 			m_freem(m0);
 			return (0);
 		}
@@ -1593,7 +1600,7 @@ t3_encap(struct sge_qset *qs, struct mbu
 	wr_lo = htonl(V_WR_TID(txq->token));
 	write_wr_hdr_sgl(ndesc, txd, &txqs, txq, sgl, flits,
 	    sgl_flits, wr_hi, wr_lo);
-	check_ring_tx_db(sc, txq);
+	check_ring_tx_db(sc, txq, 0);
 
 	return (0);
 }
@@ -1643,7 +1650,6 @@ cxgb_start_locked(struct sge_qset *qs)
 {
 	struct mbuf *m_head = NULL;
 	struct sge_txq *txq = &qs->txq[TXQ_ETH];
-	int in_use_init = txq->in_use;
 	struct port_info *pi = qs->port;
 	struct ifnet *ifp = pi->ifp;
 
@@ -1655,8 +1661,7 @@ cxgb_start_locked(struct sge_qset *qs)
 		return;
 	}
 	TXQ_LOCK_ASSERT(qs);
-	while ((txq->in_use - in_use_init < TX_START_MAX_DESC) &&
-	    !TXQ_RING_EMPTY(qs) && (ifp->if_drv_flags & IFF_DRV_RUNNING) &&
+	while (!TXQ_RING_EMPTY(qs) && (ifp->if_drv_flags & IFF_DRV_RUNNING) &&
 	    pi->link_config.link_ok) {
 		reclaim_completed_tx(qs, cxgb_tx_reclaim_threshold, TXQ_ETH);
 
@@ -1674,6 +1679,10 @@ cxgb_start_locked(struct sge_qset *qs)
 
 		m_head = NULL;
 	}
+
+	if (txq->db_pending)
+		check_ring_tx_db(pi->adapter, txq, 1);
+
 	if (!TXQ_RING_EMPTY(qs) && callout_pending(&txq->txq_timer) == 0 &&
 	    pi->link_config.link_ok)
 		callout_reset_on(&txq->txq_timer, 1, cxgb_tx_timeout,
@@ -1707,6 +1716,9 @@ cxgb_transmit_locked(struct ifnet *ifp, 
 			    (error = drbr_enqueue(ifp, br, m)) != 0) 
 				return (error);
 		} else {
+			if (txq->db_pending)
+				check_ring_tx_db(pi->adapter, txq, 1);
+
 			/*
 			 * We've bypassed the buf ring so we need to update
 			 * the stats directly
@@ -2354,7 +2366,7 @@ again:	reclaim_completed_tx(qs, 16, TXQ_
 	TXQ_UNLOCK(qs);
 
 	write_ofld_wr(adap, m, q, pidx, gen, ndesc, segs, nsegs);
-	check_ring_tx_db(adap, q);
+	check_ring_tx_db(adap, q, 1);
 	return (0);
 }
 
@@ -3033,7 +3045,7 @@ process_responses(adapter_t *adap, struc
 			r = rspq->desc;
 		}
 
-		if (++rspq->credits >= (rspq->size / 4)) {
+		if (++rspq->credits >= 64) {
 			refill_rspq(adap, rspq, rspq->credits);
 			rspq->credits = 0;
 		}

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 18:12:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB5E3106564A;
	Thu, 13 May 2010 18:12:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C9DC08FC12;
	Thu, 13 May 2010 18:12:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DICius010255;
	Thu, 13 May 2010 18:12:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DICiYT010253;
	Thu, 13 May 2010 18:12:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005131812.o4DICiYT010253@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 18:12:44 +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: r208040 - stable/8/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: Thu, 13 May 2010 18:12:45 -0000

Author: kib
Date: Thu May 13 18:12:44 2010
New Revision: 208040
URL: http://svn.freebsd.org/changeset/base/208040

Log:
  MFC r206545 (by alc):
  Simplify vm_thread_swapin().
  
  Approved by:	alc

Modified:
  stable/8/sys/vm/vm_glue.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/vm/vm_glue.c
==============================================================================
--- stable/8/sys/vm/vm_glue.c	Thu May 13 17:45:32 2010	(r208039)
+++ stable/8/sys/vm/vm_glue.c	Thu May 13 18:12:44 2010	(r208040)
@@ -539,7 +539,8 @@ vm_thread_swapin(struct thread *td)
 	ksobj = td->td_kstack_obj;
 	VM_OBJECT_LOCK(ksobj);
 	for (i = 0; i < pages; i++) {
-		m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
+		m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY |
+		    VM_ALLOC_WIRED);
 		if (m->valid != VM_PAGE_BITS_ALL) {
 			rv = vm_pager_get_pages(ksobj, &m, 1, 0);
 			if (rv != VM_PAGER_OK)
@@ -547,9 +548,6 @@ vm_thread_swapin(struct thread *td)
 			m = vm_page_lookup(ksobj, i);
 		}
 		ma[i] = m;
-		vm_page_lock_queues();
-		vm_page_wire(m);
-		vm_page_unlock_queues();
 		vm_page_wakeup(m);
 	}
 	VM_OBJECT_UNLOCK(ksobj);

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 18:17:02 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8C4C106566C;
	Thu, 13 May 2010 18:17:02 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E3478FC1A;
	Thu, 13 May 2010 18:17:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DIH2ch011296;
	Thu, 13 May 2010 18:17:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DIH2OH011294;
	Thu, 13 May 2010 18:17:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005131817.o4DIH2OH011294@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 18:17:02 +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: r208041 - stable/8/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: Thu, 13 May 2010 18:17:02 -0000

Author: kib
Date: Thu May 13 18:17:01 2010
New Revision: 208041
URL: http://svn.freebsd.org/changeset/base/208041

Log:
  MFC r207365:
  When doing kstack swapin, read as much pages in one run as possible.

Modified:
  stable/8/sys/vm/vm_glue.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/vm/vm_glue.c
==============================================================================
--- stable/8/sys/vm/vm_glue.c	Thu May 13 18:12:44 2010	(r208040)
+++ stable/8/sys/vm/vm_glue.c	Thu May 13 18:17:01 2010	(r208041)
@@ -532,23 +532,37 @@ void
 vm_thread_swapin(struct thread *td)
 {
 	vm_object_t ksobj;
-	vm_page_t m, ma[KSTACK_MAX_PAGES];
-	int i, pages, rv;
+	vm_page_t ma[KSTACK_MAX_PAGES];
+	int i, j, k, pages, rv;
 
 	pages = td->td_kstack_pages;
 	ksobj = td->td_kstack_obj;
 	VM_OBJECT_LOCK(ksobj);
-	for (i = 0; i < pages; i++) {
-		m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY |
+	for (i = 0; i < pages; i++)
+		ma[i] = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY |
 		    VM_ALLOC_WIRED);
-		if (m->valid != VM_PAGE_BITS_ALL) {
-			rv = vm_pager_get_pages(ksobj, &m, 1, 0);
+	for (i = 0; i < pages; i++) {
+		if (ma[i]->valid != VM_PAGE_BITS_ALL) {
+			KASSERT(ma[i]->oflags & VPO_BUSY,
+			    ("lost busy 1"));
+			vm_object_pip_add(ksobj, 1);
+			for (j = i + 1; j < pages; j++) {
+				KASSERT(ma[j]->valid == VM_PAGE_BITS_ALL ||
+				    (ma[j]->oflags & VPO_BUSY),
+				    ("lost busy 2"));
+				if (ma[j]->valid == VM_PAGE_BITS_ALL)
+					break;
+			}
+			rv = vm_pager_get_pages(ksobj, ma + i, j - i, 0);
 			if (rv != VM_PAGER_OK)
-				panic("vm_thread_swapin: cannot get kstack for proc: %d", td->td_proc->p_pid);
-			m = vm_page_lookup(ksobj, i);
-		}
-		ma[i] = m;
-		vm_page_wakeup(m);
+	panic("vm_thread_swapin: cannot get kstack for proc: %d",
+				    td->td_proc->p_pid);
+			vm_object_pip_wakeup(ksobj);
+			for (k = i; k < j; k++)
+				ma[k] = vm_page_lookup(ksobj, k);
+			vm_page_wakeup(ma[i]);
+		} else if (ma[i]->oflags & VPO_BUSY)
+			vm_page_wakeup(ma[i]);
 	}
 	VM_OBJECT_UNLOCK(ksobj);
 	pmap_qenter(td->td_kstack, ma, pages);

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 19:03:52 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C318A1065670;
	Thu, 13 May 2010 19:03:52 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id ED2E88FC19;
	Thu, 13 May 2010 19:03:51 +0000 (UTC)
Received: by fxm17 with SMTP id 17so726632fxm.13
	for ; Thu, 13 May 2010 12:03:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:cc:subject:references
	:date:in-reply-to:message-id:user-agent:mime-version:content-type;
	bh=rw4lEHIYM6LCtRT6r3o87Exo1GhzTEL1VY0vg+XYFA8=;
	b=tF0ETFfZTVCywYHdQi1RnDktE+ZCinUKzEZGDh0lWVL+wK46Vd+LbmF+WR4zfWM7lx
	6+3uv3MdIBBNoxYDaoxg9e3cdQCAwuoU3QDl38QVW3BV1kTE6NMT3U7XiLkncI1740FJ
	xOw+PfrWkFFqGD1tEfPXIykmjXAlSHkehjEUo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	b=Iw2vVR1L48wVOP1goZgWtXqCc0MnHAzlrHLvcFa1YYvzkMmkTEclEK0QDhYKxw/7QQ
	46eZZHdQ/6lkpZEZaFaoHZsNm41UhdHrRg3Vzciaq4IyeqUOUU2r4ljQ2/eWad0tL/x/
	yXUAuNhzVsXV6UBIHqjOd0qfz3eiOe8AtH4g8=
Received: by 10.223.24.148 with SMTP id v20mr346693fab.43.1273777430570;
	Thu, 13 May 2010 12:03:50 -0700 (PDT)
Received: from localhost (89-178-204-240.broadband.corbina.ru [89.178.204.240])
	by mx.google.com with ESMTPS id 2sm7093394faf.3.2010.05.13.12.03.49
	(version=SSLv3 cipher=RC4-MD5); Thu, 13 May 2010 12:03:50 -0700 (PDT)
From: Anonymous 
To: Tim Kientzle 
References: <201005081628.o48GSM9s067363__30886.3841965378$1273336146$gmane$org@svn.freebsd.org>
Date: Thu, 13 May 2010 23:03:48 +0400
In-Reply-To: <201005081628.o48GSM9s067363__30886.3841965378$1273336146$gmane$org@svn.freebsd.org>
	(Tim Kientzle's message of "Sat, 8 May 2010 16:28:22 +0000 (UTC)")
Message-ID: <86aas3oc8b.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (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: r207790 - head/usr.bin/tar
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 19:03:53 -0000

Tim Kientzle  writes:

> Author: kientzle
> Date: Sat May  8 16:28:22 2010
> New Revision: 207790
> URL: http://svn.freebsd.org/changeset/base/207790
>
> Log:
>   Config updates.
>
> Modified:
>   head/usr.bin/tar/config_freebsd.h

Smth broke after this commit. Hitting ^T causes ports to barf errors.

before

    x11-toolkits/wxgtk28 $ make BATCH= patch
    ===>  Extracting for wxgtk2-2.8.10_4
    => MD5 Checksum OK for wxGTK-2.8.10.tar.bz2.
    => SHA256 Checksum OK for wxGTK-2.8.10.tar.bz2.
    load: 0.05  cmd: sh 64229 [running] 0.00r 0.00u 0.00s 0% 1576k
    load: 0.05  cmd: bzip2 64231 [running] 0.19r 0.16u 0.00s 2% 4564k
    load: 0.05  cmd: bsdtar 64232 [running] 0.36r 0.00u 0.13s 1% 2420k
    load: 0.05  cmd: bzip2 64231 [running] 0.56r 0.47u 0.00s 4% 4568k
    load: 0.05  cmd: bsdtar 64232 [running] 1.82r 0.05u 0.62s 6% 2448k
    ===>  Patching for wxgtk2-2.8.10_4
    ===>  Applying FreeBSD patches for wxgtk2-2.8.10_4

after

    x11-toolkits/wxgtk28 $ make BATCH= patch
    load: 0.05  cmd: make 63587 [zio->io_cv)] 0.19r 0.03u 0.00s 0% 1268k
    ===>  Extracting for wxgtk2-2.8.10_4
    load: 0.05  cmd: awk 63621 [zio->io_cv)] 0.01r 0.00u 0.00s 0% 1492k
    => MD5 Checksum OK for wxGTK-2.8.10.tar.bz2.
    => SHA256 Checksum OK for wxGTK-2.8.10.tar.bz2.
    load: 0.05  cmd: bzip2 63631 [running] 0.13r 0.10u 0.00s 1% 4564k
    wxGTK-2.8.10/contrib/include/wx/fl/controlbar.h: Error reading stdin
    load: 0.05  cmd: bzip2 63631 [running] 0.34r 0.30u 0.00s 3% 4568k
    tar: Error exit delayed from previous errors.
    *** Error code 1

Looks like errors are related to extracting from stdin.

    $ bzip2 -dc wxGTK-2.8.10.tar.bz2 | tar xf -
    load: 0.04  cmd: bzip2 65117 [running] 0.17r 0.07u 0.00s 0% 4564k
    tar: Error reading stdin
    load: 0.04  cmd: bzip2 65117 [running] 0.33r 0.23u 0.00s 2% 4568k
    tar: Error exit delayed from previous errors.
    zsh: broken pipe  bzip2 -dc wxGTK-2.8.10.tar.bz2 |
    zsh: exit 1       tar xf -

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 19:36:14 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F68B106566B;
	Thu, 13 May 2010 19:36:14 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1EEBB8FC14;
	Thu, 13 May 2010 19:36:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DJaEem028827;
	Thu, 13 May 2010 19:36:14 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DJaEAN028825;
	Thu, 13 May 2010 19:36:14 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201005131936.o4DJaEAN028825@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 13 May 2010 19:36: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: r208042 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 19:36:14 -0000

Author: kmacy
Date: Thu May 13 19:36:13 2010
New Revision: 208042
URL: http://svn.freebsd.org/changeset/base/208042

Log:
  fix compile error on some builds by doing the equivalent of
  an "extern VNET_DEFINE" without "__used"
  
  MFC after:	3 days

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Thu May 13 18:17:01 2010	(r208041)
+++ head/sys/netinet6/ip6_input.c	Thu May 13 19:36:13 2010	(r208042)
@@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef FLOWTABLE
 #include 
-extern VNET_DEFINE(int, ip6_output_flowtable_size);
+extern int VNET_NAME(ip6_output_flowtable_size) __section(VNET_SETNAME);
 #define	V_ip6_output_flowtable_size	VNET(ip6_output_flowtable_size)
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 19:47:36 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C4D1106564A;
	Thu, 13 May 2010 19:47:36 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BCED8FC15;
	Thu, 13 May 2010 19:47:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DJlaYQ031343;
	Thu, 13 May 2010 19:47:36 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DJla15031341;
	Thu, 13 May 2010 19:47:36 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <201005131947.o4DJla15031341@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 13 May 2010 19:47: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: r208043 - head/sys/netinet6
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 19:47:36 -0000

Author: kmacy
Date: Thu May 13 19:47:36 2010
New Revision: 208043
URL: http://svn.freebsd.org/changeset/base/208043

Log:
  do a proper fix
  
  Pointed out by: np@
  
  MFC after:	3 days

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Thu May 13 19:36:13 2010	(r208042)
+++ head/sys/netinet6/ip6_input.c	Thu May 13 19:47:36 2010	(r208043)
@@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef FLOWTABLE
 #include 
-extern int VNET_NAME(ip6_output_flowtable_size) __section(VNET_SETNAME);
+VNET_DECLARE(int, ip6_output_flowtable_size);
 #define	V_ip6_output_flowtable_size	VNET(ip6_output_flowtable_size)
 #endif
 

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 20:26:16 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3758106564A;
	Thu, 13 May 2010 20:26:16 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A1ABA8FC1C;
	Thu, 13 May 2010 20:26:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DKQGeW039849;
	Thu, 13 May 2010 20:26:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DKQGUm039846;
	Thu, 13 May 2010 20:26:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005132026.o4DKQGUm039846@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 20:26:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208044 - stable/8/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: Thu, 13 May 2010 20:26:16 -0000

Author: kib
Date: Thu May 13 20:26:16 2010
New Revision: 208044
URL: http://svn.freebsd.org/changeset/base/208044

Log:
  MFC elimination of several settings of PG_REFERENCED bit, that either
  do not make sense or are harmful.
  
  MFC r206761 (by alc):
  Setting PG_REFERENCED on the requested page in swap_pager_getpages() is
  either redundant or harmful, depending on the caller.
  
  MFC r206768 (by alc):
  In vm_object_backing_scan(), setting PG_REFERENCED on a page before
  sleeping on that page is nonsensical.
  
  MFC r206770 (by alc):
  In vm_object_madvise() setting PG_REFERENCED on a page before sleeping on
  that page only makes sense if the advice is MADV_WILLNEED.
  
  MFC r206801 (by alc):
  There is no justification for vm_object_split() setting PG_REFERENCED on a
  page that it is going to sleep on.

Modified:
  stable/8/sys/vm/swap_pager.c
  stable/8/sys/vm/vm_object.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/vm/swap_pager.c
==============================================================================
--- stable/8/sys/vm/swap_pager.c	Thu May 13 19:47:36 2010	(r208043)
+++ stable/8/sys/vm/swap_pager.c	Thu May 13 20:26:16 2010	(r208044)
@@ -1105,8 +1105,7 @@ swap_pager_getpages(vm_object_t object, 
 	 * happen.  Note that blk, iblk & jblk can be SWAPBLK_NONE, but the 
 	 * loops are set up such that the case(s) are handled implicitly.
 	 *
-	 * The swp_*() calls must be made at splvm().  vm_page_free() does
-	 * not need to be, but it will go a little faster if it is.
+	 * The swp_*() calls must be made with the object locked.
 	 */
 	blk = swp_pager_meta_ctl(mreq->object, mreq->pindex, 0);
 
@@ -1216,9 +1215,6 @@ swap_pager_getpages(vm_object_t object, 
 	VM_OBJECT_LOCK(object);
 	while ((mreq->oflags & VPO_SWAPINPROG) != 0) {
 		mreq->oflags |= VPO_WANTED;
-		vm_page_lock_queues();
-		vm_page_flag_set(mreq, PG_REFERENCED);
-		vm_page_unlock_queues();
 		PCPU_INC(cnt.v_intrans);
 		if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) {
 			printf(

Modified: stable/8/sys/vm/vm_object.c
==============================================================================
--- stable/8/sys/vm/vm_object.c	Thu May 13 19:47:36 2010	(r208043)
+++ stable/8/sys/vm/vm_object.c	Thu May 13 20:26:16 2010	(r208044)
@@ -1205,12 +1205,19 @@ shadowlookup:
 			goto unlock_tobject;
 		}
 		if ((m->oflags & VPO_BUSY) || m->busy) {
-			vm_page_flag_set(m, PG_REFERENCED);
+			if (advise == MADV_WILLNEED)
+				/*
+				 * Reference the page before unlocking and
+				 * sleeping so that the page daemon is less
+				 * likely to reclaim it. 
+				 */
+				vm_page_flag_set(m, PG_REFERENCED);
 			vm_page_unlock_queues();
 			if (object != tobject)
 				VM_OBJECT_UNLOCK(object);
 			m->oflags |= VPO_WANTED;
-			msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo", 0);
+			msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo",
+			    0);
 			VM_OBJECT_LOCK(object);
   			goto relookup;
 		}
@@ -1415,7 +1422,6 @@ retry:
 		 * not be changed by this operation.
 		 */
 		if ((m->oflags & VPO_BUSY) || m->busy) {
-			vm_page_flag_set(m, PG_REFERENCED);
 			vm_page_unlock_queues();
 			VM_OBJECT_UNLOCK(new_object);
 			m->oflags |= VPO_WANTED;
@@ -1553,9 +1559,6 @@ vm_object_backing_scan(vm_object_t objec
 				}
 			} else if (op & OBSC_COLLAPSE_WAIT) {
 				if ((p->oflags & VPO_BUSY) || p->busy) {
-					vm_page_lock_queues();
-					vm_page_flag_set(p, PG_REFERENCED);
-					vm_page_unlock_queues();
 					VM_OBJECT_UNLOCK(object);
 					p->oflags |= VPO_WANTED;
 					msleep(p, VM_OBJECT_MTX(backing_object),

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 20:31:24 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 594E31065670;
	Thu, 13 May 2010 20:31:24 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4876D8FC18;
	Thu, 13 May 2010 20:31:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DKVO6n041042;
	Thu, 13 May 2010 20:31:24 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DKVOoI041040;
	Thu, 13 May 2010 20:31:24 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201005132031.o4DKVOoI041040@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 13 May 2010 20:31:24 +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: r208046 - stable/8/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: Thu, 13 May 2010 20:31:24 -0000

Author: kib
Date: Thu May 13 20:31:24 2010
New Revision: 208046
URL: http://svn.freebsd.org/changeset/base/208046

Log:
  MFC r206814 (by alc):
  Remove a nonsensical test from vm_pageout_clean().  A page can't be in the
  inactive queue and have a non-zero wire count.

Modified:
  stable/8/sys/vm/vm_pageout.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/vm/vm_pageout.c
==============================================================================
--- stable/8/sys/vm/vm_pageout.c	Thu May 13 20:29:42 2010	(r208045)
+++ stable/8/sys/vm/vm_pageout.c	Thu May 13 20:31:24 2010	(r208046)
@@ -350,7 +350,6 @@ more:
 		vm_page_test_dirty(p);
 		if (p->dirty == 0 ||
 		    p->queue != PQ_INACTIVE ||
-		    p->wire_count != 0 ||	/* may be held by buf cache */
 		    p->hold_count != 0) {	/* may be undergoing I/O */
 			ib = 0;
 			break;
@@ -378,7 +377,6 @@ more:
 		vm_page_test_dirty(p);
 		if (p->dirty == 0 ||
 		    p->queue != PQ_INACTIVE ||
-		    p->wire_count != 0 ||	/* may be held by buf cache */
 		    p->hold_count != 0) {	/* may be undergoing I/O */
 			break;
 		}

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 20:32:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94E211065670;
	Thu, 13 May 2010 20:32:56 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 807A38FC13;
	Thu, 13 May 2010 20:32:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DKWubm041442;
	Thu, 13 May 2010 20:32:56 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DKWuFI041431;
	Thu, 13 May 2010 20:32:56 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005132032.o4DKWuFI041431@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 13 May 2010 20:32: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: r208047 - in head: cddl/contrib/opensolaris/cmd/zdb
	cddl/contrib/opensolaris/cmd/ztest
	cddl/contrib/opensolaris/lib/libzpool/common
	cddl/contrib/opensolaris/lib/libzpool/common/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: Thu, 13 May 2010 20:32:56 -0000

Author: mm
Date: Thu May 13 20:32:56 2010
New Revision: 208047
URL: http://svn.freebsd.org/changeset/base/208047

Log:
  Import OpenSolaris revision 7837:001de5627df3
  It includes the following changes:
  - parallel reads in traversal code (Bug ID 6333409)
  - faster traversal for zfs send (Bug ID 6418042)
  - traversal code cleanup (Bug ID 6725675)
  - fix for two scrub related bugs (Bug ID 6729696, 6730101)
  - fix assertion in dbuf_verify (Bug ID 6752226)
  - fix panic during zfs send with i/o errors (Bug ID 6577985)
  - replace P2CROSS with P2BOUNDARY (Bug ID 6725680)
  
  List of OpenSolaris Bug IDs:
  6333409, 6418042, 6757112, 6725668, 6725675, 6725680,
  6725698, 6729696, 6730101, 6752226, 6577985, 6755042
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (multiple Bug IDs)
  MFC after:	1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
  head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/sys/cddl/compat/opensolaris/sys/sysmacros.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Thu May 13 20:32:56 2010	(r208047)
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #undef ZFS_MAXNAMELEN
 #undef verify
 #include 
@@ -62,8 +63,6 @@ typedef void object_viewer_t(objset_t *,
 extern void dump_intent_log(zilog_t *);
 uint64_t *zopt_object = NULL;
 int zopt_objects = 0;
-int zdb_advance = ADVANCE_PRE;
-zbookmark_t zdb_noread = { 0, 0, ZB_NO_LEVEL, 0 };
 libzfs_handle_t *g_zfs;
 boolean_t zdb_sig_user_data = B_TRUE;
 int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256;
@@ -88,8 +87,8 @@ static void
 usage(void)
 {
 	(void) fprintf(stderr,
-	    "Usage: %s [-udibcsvL] [-U cachefile_path] [-O order] "
-	    "[-B os:obj:level:blkid] [-S user:cksumalg] "
+	    "Usage: %s [-udibcsv] [-U cachefile_path] "
+	    "[-S user:cksumalg] "
 	    "dataset [object...]\n"
 	    "       %s -C [pool]\n"
 	    "       %s -l dev\n"
@@ -109,13 +108,8 @@ usage(void)
 	    "dump blkptr signatures\n");
 	(void) fprintf(stderr, "	-v verbose (applies to all others)\n");
 	(void) fprintf(stderr, "        -l dump label contents\n");
-	(void) fprintf(stderr, "	-L live pool (allows some errors)\n");
-	(void) fprintf(stderr, "	-O [!] "
-	    "visitation order\n");
 	(void) fprintf(stderr, "	-U cachefile_path -- use alternate "
 	    "cachefile\n");
-	(void) fprintf(stderr, "	-B objset:object:level:blkid -- "
-	    "simulate bad block\n");
 	(void) fprintf(stderr, "        -R read and display block from a "
 	    "device\n");
 	(void) fprintf(stderr, "        -e Pool is exported/destroyed/"
@@ -138,7 +132,7 @@ fatal(const char *fmt, ...)
 	va_end(ap);
 	(void) fprintf(stderr, "\n");
 
-	exit(1);
+	abort();
 }
 
 static void
@@ -571,7 +565,7 @@ dump_dnode(objset_t *os, uint64_t object
 }
 
 static uint64_t
-blkid2offset(dnode_phys_t *dnp, int level, uint64_t blkid)
+blkid2offset(const dnode_phys_t *dnp, int level, uint64_t blkid)
 {
 	if (level < 0)
 		return (blkid);
@@ -602,115 +596,104 @@ sprintf_blkptr_compact(char *blkbuf, blk
 	    (u_longlong_t)bp->blk_birth);
 }
 
-/* ARGSUSED */
-static int
-zdb_indirect_cb(traverse_blk_cache_t *bc, spa_t *spa, void *a)
+static void
+print_indirect(blkptr_t *bp, const zbookmark_t *zb,
+    const dnode_phys_t *dnp)
 {
-	zbookmark_t *zb = &bc->bc_bookmark;
-	blkptr_t *bp = &bc->bc_blkptr;
-	void *data = bc->bc_data;
-	dnode_phys_t *dnp = bc->bc_dnode;
-	char blkbuf[BP_SPRINTF_LEN + 80];
+	char blkbuf[BP_SPRINTF_LEN];
 	int l;
 
-	if (bc->bc_errno) {
-		(void) sprintf(blkbuf,
-		    "Error %d reading <%llu, %llu, %lld, %llu>: ",
-		    bc->bc_errno,
-		    (u_longlong_t)zb->zb_objset,
-		    (u_longlong_t)zb->zb_object,
-		    (u_longlong_t)zb->zb_level,
-		    (u_longlong_t)zb->zb_blkid);
-		goto out;
-	}
-
-	if (zb->zb_level == -1) {
-		ASSERT3U(BP_GET_TYPE(bp), ==, DMU_OT_OBJSET);
-		ASSERT3U(BP_GET_LEVEL(bp), ==, 0);
-	} else {
-		ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type);
-		ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level);
-	}
-
-	if (zb->zb_level > 0) {
-		uint64_t fill = 0;
-		blkptr_t *bpx, *bpend;
-
-		for (bpx = data, bpend = bpx + BP_GET_LSIZE(bp) / sizeof (*bpx);
-		    bpx < bpend; bpx++) {
-			if (bpx->blk_birth != 0) {
-				fill += bpx->blk_fill;
-			} else {
-				ASSERT(bpx->blk_fill == 0);
-			}
-		}
-		ASSERT3U(fill, ==, bp->blk_fill);
-	}
+	ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type);
+	ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level);
 
-	if (zb->zb_level == 0 && dnp->dn_type == DMU_OT_DNODE) {
-		uint64_t fill = 0;
-		dnode_phys_t *dnx, *dnend;
-
-		for (dnx = data, dnend = dnx + (BP_GET_LSIZE(bp)>>DNODE_SHIFT);
-		    dnx < dnend; dnx++) {
-			if (dnx->dn_type != DMU_OT_NONE)
-				fill++;
-		}
-		ASSERT3U(fill, ==, bp->blk_fill);
-	}
-
-	(void) sprintf(blkbuf, "%16llx ",
+	(void) printf("%16llx ",
 	    (u_longlong_t)blkid2offset(dnp, zb->zb_level, zb->zb_blkid));
 
 	ASSERT(zb->zb_level >= 0);
 
 	for (l = dnp->dn_nlevels - 1; l >= -1; l--) {
 		if (l == zb->zb_level) {
-			(void) sprintf(blkbuf + strlen(blkbuf), "L%llx",
-			    (u_longlong_t)zb->zb_level);
+			(void) printf("L%llx", (u_longlong_t)zb->zb_level);
 		} else {
-			(void) sprintf(blkbuf + strlen(blkbuf), " ");
+			(void) printf(" ");
 		}
 	}
 
-out:
-	if (bp->blk_birth == 0) {
-		(void) sprintf(blkbuf + strlen(blkbuf), "");
-		(void) printf("%s\n", blkbuf);
-	} else {
-		sprintf_blkptr_compact(blkbuf + strlen(blkbuf), bp,
-		    dump_opt['d'] > 5 ? 1 : 0);
-		(void) printf("%s\n", blkbuf);
+	sprintf_blkptr_compact(blkbuf, bp, dump_opt['d'] > 5 ? 1 : 0);
+	(void) printf("%s\n", blkbuf);
+}
+
+#define	SET_BOOKMARK(zb, objset, object, level, blkid)  \
+{                                                       \
+	(zb)->zb_objset = objset;                       \
+	(zb)->zb_object = object;                       \
+	(zb)->zb_level = level;                         \
+	(zb)->zb_blkid = blkid;                         \
+}
+
+static int
+visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
+    blkptr_t *bp, const zbookmark_t *zb)
+{
+	int err;
+
+	if (bp->blk_birth == 0)
+		return (0);
+
+	print_indirect(bp, zb, dnp);
+
+	if (BP_GET_LEVEL(bp) > 0) {
+		uint32_t flags = ARC_WAIT;
+		int i;
+		blkptr_t *cbp;
+		int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
+		arc_buf_t *buf;
+		uint64_t fill = 0;
+
+		err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, &buf,
+		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
+		if (err)
+			return (err);
+
+		/* recursively visit blocks below this */
+		cbp = buf->b_data;
+		for (i = 0; i < epb; i++, cbp++) {
+			zbookmark_t czb;
+
+			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
+			    zb->zb_level - 1,
+			    zb->zb_blkid * epb + i);
+			err = visit_indirect(spa, dnp, cbp, &czb);
+			if (err)
+				break;
+			fill += cbp->blk_fill;
+		}
+		ASSERT3U(fill, ==, bp->blk_fill);
+		(void) arc_buf_remove_ref(buf, &buf);
 	}
 
-	return (bc->bc_errno ? ERESTART : 0);
+	return (err);
 }
 
 /*ARGSUSED*/
 static void
-dump_indirect(objset_t *os, uint64_t object, void *data, size_t size)
+dump_indirect(dnode_t *dn)
 {
-	traverse_handle_t *th;
-	uint64_t objset = dmu_objset_id(os);
-	int advance = zdb_advance;
+	dnode_phys_t *dnp = dn->dn_phys;
+	int j;
+	zbookmark_t czb;
 
 	(void) printf("Indirect blocks:\n");
 
-	if (object == 0)
-		advance |= ADVANCE_DATA;
-
-	th = traverse_init(dmu_objset_spa(os), zdb_indirect_cb, NULL, advance,
-	    ZIO_FLAG_CANFAIL);
-	th->th_noread = zdb_noread;
-
-	traverse_add_dnode(th, 0, -1ULL, objset, object);
-
-	while (traverse_more(th) == EAGAIN)
-		continue;
+	SET_BOOKMARK(&czb, dmu_objset_id(&dn->dn_objset->os),
+	    dn->dn_object, dnp->dn_nlevels - 1, 0);
+	for (j = 0; j < dnp->dn_nblkptr; j++) {
+		czb.zb_blkid = j;
+		(void) visit_indirect(dmu_objset_spa(&dn->dn_objset->os), dnp,
+		    &dnp->dn_blkptr[j], &czb);
+	}
 
 	(void) printf("\n");
-
-	traverse_fini(th);
 }
 
 /*ARGSUSED*/
@@ -1093,7 +1076,7 @@ dump_object(objset_t *os, uint64_t objec
 	}
 
 	if (verbosity >= 5)
-		dump_indirect(os, object, NULL, 0);
+		dump_indirect(dn);
 
 	if (verbosity >= 5) {
 		/*
@@ -1458,18 +1441,17 @@ typedef struct zdb_blkstats {
 #define	DMU_OT_DEFERRED	DMU_OT_NONE
 #define	DMU_OT_TOTAL	DMU_OT_NUMTYPES
 
-#define	ZB_TOTAL	ZB_MAXLEVEL
+#define	ZB_TOTAL	DN_MAX_LEVELS
 
 typedef struct zdb_cb {
 	zdb_blkstats_t	zcb_type[ZB_TOTAL + 1][DMU_OT_TOTAL + 1];
 	uint64_t	zcb_errors[256];
-	traverse_blk_cache_t *zcb_cache;
 	int		zcb_readfails;
 	int		zcb_haderrors;
 } zdb_cb_t;
 
 static void
-zdb_count_block(spa_t *spa, zdb_cb_t *zcb, blkptr_t *bp, int type)
+zdb_count_block(spa_t *spa, zdb_cb_t *zcb, blkptr_t *bp, dmu_object_type_t type)
 {
 	for (int i = 0; i < 4; i++) {
 		int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL;
@@ -1485,7 +1467,7 @@ zdb_count_block(spa_t *spa, zdb_cb_t *zc
 	if (dump_opt['S']) {
 		boolean_t print_sig;
 
-		print_sig  = !zdb_sig_user_data || (BP_GET_LEVEL(bp) == 0 &&
+		print_sig = !zdb_sig_user_data || (BP_GET_LEVEL(bp) == 0 &&
 		    BP_GET_TYPE(bp) == DMU_OT_PLAIN_FILE_CONTENTS);
 
 		if (BP_GET_CHECKSUM(bp) < zdb_sig_cksumalg)
@@ -1507,56 +1489,55 @@ zdb_count_block(spa_t *spa, zdb_cb_t *zc
 		}
 	}
 
-	if (!dump_opt['L'])
-		VERIFY(zio_wait(zio_claim(NULL, spa, spa_first_txg(spa), bp,
-		    NULL, NULL, ZIO_FLAG_MUSTSUCCEED)) == 0);
+	VERIFY(zio_wait(zio_claim(NULL, spa, spa_first_txg(spa), bp,
+	    NULL, NULL, ZIO_FLAG_MUSTSUCCEED)) == 0);
 }
 
 static int
-zdb_blkptr_cb(traverse_blk_cache_t *bc, spa_t *spa, void *arg)
+zdb_blkptr_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb,
+    const dnode_phys_t *dnp, void *arg)
 {
-	zbookmark_t *zb = &bc->bc_bookmark;
 	zdb_cb_t *zcb = arg;
-	blkptr_t *bp = &bc->bc_blkptr;
-	dmu_object_type_t type = BP_GET_TYPE(bp);
 	char blkbuf[BP_SPRINTF_LEN];
-	int error = 0;
 
-	ASSERT(!BP_IS_HOLE(bp));
+	if (bp == NULL)
+		return (0);
 
-	zdb_count_block(spa, zcb, bp, type);
+	zdb_count_block(spa, zcb, bp, BP_GET_TYPE(bp));
 
-	if (bc->bc_errno) {
-		if (zcb->zcb_readfails++ < 10 && dump_opt['L']) {
-			uberblock_t ub;
-			vdev_uberblock_load(NULL, spa->spa_root_vdev, &ub);
-			if (ub.ub_txg != 0)
-				spa->spa_ubsync = ub;
-			error = EAGAIN;
-		} else {
+	if (dump_opt['c'] || dump_opt['S']) {
+		int ioerr, size;
+		void *data;
+
+		size = BP_GET_LSIZE(bp);
+		data = malloc(size);
+		ioerr = zio_wait(zio_read(NULL, spa, bp, data, size,
+		    NULL, NULL, ZIO_PRIORITY_ASYNC_READ,
+		    ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB, zb));
+		free(data);
+
+		/* We expect io errors on intent log */
+		if (ioerr && BP_GET_TYPE(bp) != DMU_OT_INTENT_LOG) {
 			zcb->zcb_haderrors = 1;
-			zcb->zcb_errors[bc->bc_errno]++;
-			error = ERESTART;
-		}
+			zcb->zcb_errors[ioerr]++;
 
-		if (dump_opt['b'] >= 3 || (dump_opt['b'] >= 2 && bc->bc_errno))
-			sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, bp);
-		else
-			blkbuf[0] = '\0';
+			if (dump_opt['b'] >= 2)
+				sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, bp);
+			else
+				blkbuf[0] = '\0';
 
-		if (!dump_opt['S']) {
-			(void) printf("zdb_blkptr_cb: Got error %d reading "
-			    "<%llu, %llu, %lld, %llx> %s -- %s\n",
-			    bc->bc_errno,
-			    (u_longlong_t)zb->zb_objset,
-			    (u_longlong_t)zb->zb_object,
-			    (u_longlong_t)zb->zb_level,
-			    (u_longlong_t)zb->zb_blkid,
-			    blkbuf,
-			    error == EAGAIN ? "retrying" : "skipping");
+			if (!dump_opt['S']) {
+				(void) printf("zdb_blkptr_cb: "
+				    "Got error %d reading "
+				    "<%llu, %llu, %lld, %llx> %s -- skipping\n",
+				    ioerr,
+				    (u_longlong_t)zb->zb_objset,
+				    (u_longlong_t)zb->zb_object,
+				    (u_longlong_t)zb->zb_level,
+				    (u_longlong_t)zb->zb_blkid,
+				    blkbuf);
+			}
 		}
-
-		return (error);
 	}
 
 	zcb->zcb_readfails = 0;
@@ -1566,8 +1547,8 @@ zdb_blkptr_cb(traverse_blk_cache_t *bc, 
 		(void) printf("objset %llu object %llu offset 0x%llx %s\n",
 		    (u_longlong_t)zb->zb_objset,
 		    (u_longlong_t)zb->zb_object,
-		    (u_longlong_t)blkid2offset(bc->bc_dnode,
-		    zb->zb_level, zb->zb_blkid), blkbuf);
+		    (u_longlong_t)blkid2offset(dnp, zb->zb_level, zb->zb_blkid),
+		    blkbuf);
 	}
 
 	return (0);
@@ -1576,22 +1557,12 @@ zdb_blkptr_cb(traverse_blk_cache_t *bc, 
 static int
 dump_block_stats(spa_t *spa)
 {
-	traverse_handle_t *th;
 	zdb_cb_t zcb = { 0 };
-	traverse_blk_cache_t dummy_cache = { 0 };
 	zdb_blkstats_t *zb, *tzb;
 	uint64_t alloc, space, logalloc;
 	vdev_t *rvd = spa->spa_root_vdev;
 	int leaks = 0;
-	int advance = zdb_advance;
-	int c, e, flags;
-
-	zcb.zcb_cache = &dummy_cache;
-
-	if (dump_opt['c'] || dump_opt['S'])
-		advance |= ADVANCE_DATA;
-
-	advance |= ADVANCE_PRUNE | ADVANCE_ZIL;
+	int c, e;
 
 	if (!dump_opt['S']) {
 		(void) printf("\nTraversing all blocks to %sverify"
@@ -1607,8 +1578,7 @@ dump_block_stats(spa_t *spa)
 	 * it's not part of any space map) is a double allocation,
 	 * reference to a freed block, or an unclaimed log block.
 	 */
-	if (!dump_opt['L'])
-		zdb_leak_init(spa);
+	zdb_leak_init(spa);
 
 	/*
 	 * If there's a deferred-free bplist, process that first.
@@ -1634,22 +1604,7 @@ dump_block_stats(spa_t *spa)
 		bplist_close(bpl);
 	}
 
-	/*
-	 * Now traverse the pool.  If we're reading all data to verify
-	 * checksums, do a scrubbing read so that we validate all copies.
-	 */
-	flags = ZIO_FLAG_CANFAIL;
-	if (advance & ADVANCE_DATA)
-		flags |= ZIO_FLAG_SCRUB;
-	th = traverse_init(spa, zdb_blkptr_cb, &zcb, advance, flags);
-	th->th_noread = zdb_noread;
-
-	traverse_add_pool(th, 0, spa_first_txg(spa) + TXG_CONCURRENT_STATES);
-
-	while (traverse_more(th) == EAGAIN)
-		continue;
-
-	traverse_fini(th);
+	zcb.zcb_haderrors |= traverse_pool(spa, zdb_blkptr_cb, &zcb);
 
 	if (zcb.zcb_haderrors && !dump_opt['S']) {
 		(void) printf("\nError counts:\n\n");
@@ -1665,8 +1620,7 @@ dump_block_stats(spa_t *spa)
 	/*
 	 * Report any leaked segments.
 	 */
-	if (!dump_opt['L'])
-		zdb_leak_fini(spa);
+	zdb_leak_fini(spa);
 
 	/*
 	 * If we're interested in printing out the blkptr signatures,
@@ -1676,10 +1630,6 @@ dump_block_stats(spa_t *spa)
 	if (dump_opt['S'])
 		return (zcb.zcb_haderrors ? 3 : 0);
 
-	if (dump_opt['L'])
-		(void) printf("\n\n *** Live pool traversal; "
-		    "block counts are only approximate ***\n\n");
-
 	alloc = spa_get_alloc(spa);
 	space = spa_get_space(spa);
 
@@ -2285,7 +2235,6 @@ main(int argc, char **argv)
 	int dump_all = 1;
 	int verbose = 0;
 	int error;
-	int flag, set;
 	int exported = 0;
 	char *vdev_dir = NULL;
 
@@ -2294,7 +2243,7 @@ main(int argc, char **argv)
 
 	dprintf_setup(&argc, argv);
 
-	while ((c = getopt(argc, argv, "udibcsvCLO:B:S:U:lRep:")) != -1) {
+	while ((c = getopt(argc, argv, "udibcsvCS:U:lRep:")) != -1) {
 		switch (c) {
 		case 'u':
 		case 'd':
@@ -2308,49 +2257,6 @@ main(int argc, char **argv)
 			dump_opt[c]++;
 			dump_all = 0;
 			break;
-		case 'L':
-			dump_opt[c]++;
-			break;
-		case 'O':
-			endstr = optarg;
-			if (endstr[0] == '!') {
-				endstr++;
-				set = 0;
-			} else {
-				set = 1;
-			}
-			if (strcmp(endstr, "post") == 0) {
-				flag = ADVANCE_PRE;
-				set = !set;
-			} else if (strcmp(endstr, "pre") == 0) {
-				flag = ADVANCE_PRE;
-			} else if (strcmp(endstr, "prune") == 0) {
-				flag = ADVANCE_PRUNE;
-			} else if (strcmp(endstr, "data") == 0) {
-				flag = ADVANCE_DATA;
-			} else if (strcmp(endstr, "holes") == 0) {
-				flag = ADVANCE_HOLES;
-			} else {
-				usage();
-			}
-			if (set)
-				zdb_advance |= flag;
-			else
-				zdb_advance &= ~flag;
-			break;
-		case 'B':
-			endstr = optarg - 1;
-			zdb_noread.zb_objset = strtoull(endstr + 1, &endstr, 0);
-			zdb_noread.zb_object = strtoull(endstr + 1, &endstr, 0);
-			zdb_noread.zb_level = strtol(endstr + 1, &endstr, 0);
-			zdb_noread.zb_blkid = strtoull(endstr + 1, &endstr, 16);
-			(void) printf("simulating bad block "
-			    "<%llu, %llu, %lld, %llx>\n",
-			    (u_longlong_t)zdb_noread.zb_objset,
-			    (u_longlong_t)zdb_noread.zb_object,
-			    (u_longlong_t)zdb_noread.zb_level,
-			    (u_longlong_t)zdb_noread.zb_blkid);
-			break;
 		case 'v':
 			verbose++;
 			break;
@@ -2387,21 +2293,17 @@ main(int argc, char **argv)
 		}
 	}
 
-	if (vdev_dir != NULL && exported == 0)
-		(void) fatal("-p option requires use of -e\n");
+	if (vdev_dir != NULL && exported == 0) {
+		(void) fprintf(stderr, "-p option requires use of -e\n");
+		usage();
+	}
 
 	kernel_init(FREAD);
 	g_zfs = libzfs_init();
 	ASSERT(g_zfs != NULL);
 
-	/*
-	 * Disable vdev caching.  If we don't do this, live pool traversal
-	 * won't make progress because it will never see disk updates.
-	 */
-	zfs_vdev_cache_size = 0;
-
 	for (c = 0; c < 256; c++) {
-		if (dump_all && c != 'L' && c != 'l' && c != 'R')
+		if (dump_all && c != 'l' && c != 'R')
 			dump_opt[c] = 1;
 		if (dump_opt[c])
 			dump_opt[c] += verbose;

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu May 13 20:32:56 2010	(r208047)
@@ -77,7 +77,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -151,7 +150,6 @@ typedef struct ztest_args {
 	hrtime_t	za_start;
 	hrtime_t	za_stop;
 	hrtime_t	za_kill;
-	traverse_handle_t *za_th;
 	/*
 	 * Thread-local variables can go here to aid debugging.
 	 */
@@ -206,7 +204,6 @@ ztest_info_t ztest_info[] = {
 	{ ztest_dmu_object_alloc_free,		1,	&zopt_always	},
 	{ ztest_zap,				30,	&zopt_always	},
 	{ ztest_zap_parallel,			100,	&zopt_always	},
-	{ ztest_traverse,			1,	&zopt_often	},
 	{ ztest_dsl_prop_get_set,		1,	&zopt_sometimes	},
 	{ ztest_dmu_objset_create_destroy,	1,	&zopt_sometimes },
 	{ ztest_dmu_snapshot_create_destroy,	1,	&zopt_sometimes },
@@ -1447,152 +1444,6 @@ ztest_dmu_snapshot_create_destroy(ztest_
 	(void) rw_unlock(&ztest_shared->zs_name_lock);
 }
 
-#define	ZTEST_TRAVERSE_BLOCKS	1000
-
-static int
-ztest_blk_cb(traverse_blk_cache_t *bc, spa_t *spa, void *arg)
-{
-	ztest_args_t *za = arg;
-	zbookmark_t *zb = &bc->bc_bookmark;
-	blkptr_t *bp = &bc->bc_blkptr;
-	dnode_phys_t *dnp = bc->bc_dnode;
-	traverse_handle_t *th = za->za_th;
-	uint64_t size = BP_GET_LSIZE(bp);
-
-	/*
-	 * Level -1 indicates the objset_phys_t or something in its intent log.
-	 */
-	if (zb->zb_level == -1) {
-		if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) {
-			ASSERT3U(zb->zb_object, ==, 0);
-			ASSERT3U(zb->zb_blkid, ==, 0);
-			ASSERT3U(size, ==, sizeof (objset_phys_t));
-			za->za_zil_seq = 0;
-		} else if (BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG) {
-			ASSERT3U(zb->zb_object, ==, 0);
-			ASSERT3U(zb->zb_blkid, >, za->za_zil_seq);
-			za->za_zil_seq = zb->zb_blkid;
-		} else {
-			ASSERT3U(zb->zb_object, !=, 0);	/* lr_write_t */
-		}
-
-		return (0);
-	}
-
-	ASSERT(dnp != NULL);
-
-	if (bc->bc_errno)
-		return (ERESTART);
-
-	/*
-	 * Once in a while, abort the traverse.   We only do this to odd
-	 * instance numbers to ensure that even ones can run to completion.
-	 */
-	if ((za->za_instance & 1) && ztest_random(10000) == 0)
-		return (EINTR);
-
-	if (bp->blk_birth == 0) {
-		ASSERT(th->th_advance & ADVANCE_HOLES);
-		return (0);
-	}
-
-	if (zb->zb_level == 0 && !(th->th_advance & ADVANCE_DATA) &&
-	    bc == &th->th_cache[ZB_DN_CACHE][0]) {
-		ASSERT(bc->bc_data == NULL);
-		return (0);
-	}
-
-	ASSERT(bc->bc_data != NULL);
-
-	/*
-	 * This is an expensive question, so don't ask it too often.
-	 */
-	if (((za->za_random ^ th->th_callbacks) & 0xff) == 0) {
-		void *xbuf = umem_alloc(size, UMEM_NOFAIL);
-		if (arc_tryread(spa, bp, xbuf) == 0) {
-			ASSERT(bcmp(bc->bc_data, xbuf, size) == 0);
-		}
-		umem_free(xbuf, size);
-	}
-
-	if (zb->zb_level > 0) {
-		ASSERT3U(size, ==, 1ULL << dnp->dn_indblkshift);
-		return (0);
-	}
-
-	ASSERT(zb->zb_level == 0);
-	ASSERT3U(size, ==, dnp->dn_datablkszsec << DEV_BSHIFT);
-
-	return (0);
-}
-
-/*
- * Verify that live pool traversal works.
- */
-void
-ztest_traverse(ztest_args_t *za)
-{
-	spa_t *spa = za->za_spa;
-	traverse_handle_t *th = za->za_th;
-	int rc, advance;
-	uint64_t cbstart, cblimit;
-
-	if (th == NULL) {
-		advance = 0;
-
-		if (ztest_random(2) == 0)
-			advance |= ADVANCE_PRE;
-
-		if (ztest_random(2) == 0)
-			advance |= ADVANCE_PRUNE;
-
-		if (ztest_random(2) == 0)
-			advance |= ADVANCE_DATA;
-
-		if (ztest_random(2) == 0)
-			advance |= ADVANCE_HOLES;
-
-		if (ztest_random(2) == 0)
-			advance |= ADVANCE_ZIL;
-
-		th = za->za_th = traverse_init(spa, ztest_blk_cb, za, advance,
-		    ZIO_FLAG_CANFAIL);
-
-		traverse_add_pool(th, 0, -1ULL);
-	}
-
-	advance = th->th_advance;
-	cbstart = th->th_callbacks;
-	cblimit = cbstart + ((advance & ADVANCE_DATA) ? 100 : 1000);
-
-	while ((rc = traverse_more(th)) == EAGAIN && th->th_callbacks < cblimit)
-		continue;
-
-	if (zopt_verbose >= 5)
-		(void) printf("traverse %s%s%s%s %llu blocks to "
-		    "<%llu, %llu, %lld, %llx>%s\n",
-		    (advance & ADVANCE_PRE) ? "pre" : "post",
-		    (advance & ADVANCE_PRUNE) ? "|prune" : "",
-		    (advance & ADVANCE_DATA) ? "|data" : "",
-		    (advance & ADVANCE_HOLES) ? "|holes" : "",
-		    (u_longlong_t)(th->th_callbacks - cbstart),
-		    (u_longlong_t)th->th_lastcb.zb_objset,
-		    (u_longlong_t)th->th_lastcb.zb_object,
-		    (u_longlong_t)th->th_lastcb.zb_level,
-		    (u_longlong_t)th->th_lastcb.zb_blkid,
-		    rc == 0 ? " [done]" :
-		    rc == EINTR ? " [aborted]" :
-		    rc == EAGAIN ? "" :
-		    strerror(rc));
-
-	if (rc != EAGAIN) {
-		if (rc != 0 && rc != EINTR)
-			fatal(0, "traverse_more(%p) = %d", th, rc);
-		traverse_fini(th);
-		za->za_th = NULL;
-	}
-}
-
 /*
  * Verify dsl_dataset_promote handles EBUSY
  */
@@ -3067,12 +2918,12 @@ ztest_verify_blocks(char *pool)
 	isa = strdup(isa);
 	/* LINTED */
 	(void) sprintf(bin,
-	    "/usr/sbin%.*s/zdb -bc%s%s -U /tmp/zpool.cache -O %s %s",
+	    "/usr/sbin%.*s/zdb -bc%s%s -U /tmp/zpool.cache %s",
 	    isalen,
 	    isa,
 	    zopt_verbose >= 3 ? "s" : "",
 	    zopt_verbose >= 4 ? "v" : "",
-	    ztest_random(2) == 0 ? "pre" : "post", pool);
+	    pool);
 	free(isa);
 
 	if (zopt_verbose >= 5)
@@ -3438,8 +3289,6 @@ ztest_run(char *pool)
 
 	while (--t >= 0) {
 		VERIFY(thr_join(za[t].za_thread, NULL, NULL) == 0);
-		if (za[t].za_th)
-			traverse_fini(za[t].za_th);
 		if (t < zopt_datasets) {
 			zil_close(za[t].za_zilog);
 			dmu_objset_close(za[t].za_os);

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Thu May 13 20:32:56 2010	(r208047)
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include 
 #include 
 #include 
@@ -842,6 +840,8 @@ kernel_init(int mode)
 	VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
 	VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);
 
+	system_taskq_init();
+
 	spa_init(mode);
 }
 

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Thu May 13 20:31:24 2010	(r208046)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Thu May 13 20:32:56 2010	(r208047)
@@ -334,11 +334,14 @@ typedef void (task_func_t)(void *);
 #define	TQ_NOSLEEP	KM_NOSLEEP	/* cannot block for memory; may fail */
 #define	TQ_NOQUEUE	0x02	/* Do not enqueue if can't dispatch */
 
+extern taskq_t *system_taskq;
+
 extern taskq_t	*taskq_create(const char *, int, pri_t, int, int, uint_t);
 extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
 extern void	taskq_destroy(taskq_t *);
 extern void	taskq_wait(taskq_t *);
 extern int	taskq_member(taskq_t *, void *);
+extern void	system_taskq_init(void);
 
 #define	XVA_MAPSIZE	3
 #define	XVA_MAGIC	0x78766174

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Thu May 13 20:32:56 2010	(r208047)
@@ -19,15 +19,14 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include 
 
 int taskq_now;
+taskq_t *system_taskq;
 
 typedef struct task {
 	struct task	*task_next;
@@ -253,3 +252,10 @@ taskq_member(taskq_t *tq, void *t)
 
 	return (0);
 }
+
+void
+system_taskq_init(void)
+{
+	system_taskq = taskq_create("system_taskq", 64, minclsyspri, 4, 512,
+	    TASKQ_DYNAMIC | TASKQ_PREPOPULATE);
+}

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==============================================================================
--- head/sys/cddl/boot/zfs/zfsimpl.h	Thu May 13 20:31:24 2010	(r208046)
+++ head/sys/cddl/boot/zfs/zfsimpl.h	Thu May 13 20:32:56 2010	(r208047)
@@ -66,7 +66,7 @@
 #define	P2ROUNDUP(x, align)		(-(-(x) & -(align)))
 #define	P2END(x, align)			(-(~(x) & -(align)))
 #define	P2PHASEUP(x, align, phase)	((phase) - (((phase) - (x)) & -(align)))
-#define	P2CROSS(x, y, align)		(((x) ^ (y)) > (align) - 1)
+#define	P2BOUNDARY(off, len, align)	(((off) ^ ((off) + (len) - 1)) > (align) - 1)
 
 /*
  * General-purpose 32-bit and 64-bit bitfield encodings.

Modified: head/sys/cddl/compat/opensolaris/sys/sysmacros.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/sysmacros.h	Thu May 13 20:31:24 2010	(r208046)
+++ head/sys/cddl/compat/opensolaris/sys/sysmacros.h	Thu May 13 20:32:56 2010	(r208047)
@@ -43,6 +43,10 @@ extern "C" {
 #define	ABS(a)	((a) < 0 ? -(a) : (a))
 #endif
 
+#ifndef	SIGNOF
+#define	SIGNOF(a)	((a) < 0 ? -1 : (a) > 0)
+#endif
+
 /*
  * Macro for checking power of 2 address alignment.
  */
@@ -63,7 +67,7 @@ extern "C" {
 #define	P2ROUNDUP(x, align)		(-(-(x) & -(align)))
 #define	P2END(x, align)			(-(~(x) & -(align)))
 #define	P2PHASEUP(x, align, phase)	((phase) - (((phase) - (x)) & -(align)))
-#define	P2CROSS(x, y, align)		(((x) ^ (y)) > (align) - 1)
+#define	P2BOUNDARY(off, len, align)	(((off) ^ ((off) + (len) - 1)) > (align) - 1)
 /*
  * Determine whether two numbers have the same high-order bit.
  */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu May 13 20:32:56 2010	(r208047)
@@ -308,20 +308,18 @@ dbuf_verify(dmu_buf_impl_t *db)
 		ASSERT3U(db->db.db_offset, ==, db->db_blkid * db->db.db_size);
 	}
 
-	if (db->db_level == 0) {
-		/* we can be momentarily larger in dnode_set_blksz() */
-		if (db->db_blkid != DB_BONUS_BLKID && dn) {
-			ASSERT3U(db->db.db_size, >=, dn->dn_datablksz);
-		}
-		if (db->db.db_object == DMU_META_DNODE_OBJECT) {
-			dbuf_dirty_record_t *dr = db->db_data_pending;
-			/*
-			 * it should only be modified in syncing
-			 * context, so make sure we only have
-			 * one copy of the data.
-			 */
-			ASSERT(dr == NULL || dr->dt.dl.dr_data == db->db_buf);
-		}
+	/*
+	 * We can't assert that db_size matches dn_datablksz because it
+	 * can be momentarily different when another thread is doing
+	 * dnode_set_blksz().
+	 */
+	if (db->db_level == 0 && db->db.db_object == DMU_META_DNODE_OBJECT) {
+		dbuf_dirty_record_t *dr = db->db_data_pending;
+		/*
+		 * It should only be modified in syncing context, so
+		 * make sure we only have one copy of the data.
+		 */
+		ASSERT(dr == NULL || dr->dt.dl.dr_data == db->db_buf);
 	}
 
 	/* verify db->db_blkptr */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Thu May 13 20:31:24 2010	(r208046)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Thu May 13 20:32:56 2010	(r208047)
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include 
 #include 
 #include 
@@ -172,66 +170,59 @@ dump_dnode(struct backuparg *ba, uint64_
 	(level) * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT)))
 
 static int
-backup_cb(traverse_blk_cache_t *bc, spa_t *spa, void *arg)
+backup_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb,
+    const dnode_phys_t *dnp, void *arg)
 {
 	struct backuparg *ba = arg;
-	uint64_t object = bc->bc_bookmark.zb_object;
-	int level = bc->bc_bookmark.zb_level;
-	uint64_t blkid = bc->bc_bookmark.zb_blkid;
-	blkptr_t *bp = bc->bc_blkptr.blk_birth ? &bc->bc_blkptr : NULL;
 	dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE;
-	void *data = bc->bc_data;
 	int err = 0;
 
 	if (issig(JUSTLOOKING) && issig(FORREAL))
 		return (EINTR);
 
-	ASSERT(data || bp == NULL);
-
-	if (bp == NULL && object == 0) {
-		uint64_t span = BP_SPAN(bc->bc_dnode, level);
-		uint64_t dnobj = (blkid * span) >> DNODE_SHIFT;
+	if (bp == NULL && zb->zb_object == 0) {
+		uint64_t span = BP_SPAN(dnp, zb->zb_level);
+		uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT;
 		err = dump_freeobjects(ba, dnobj, span >> DNODE_SHIFT);
 	} else if (bp == NULL) {
-		uint64_t span = BP_SPAN(bc->bc_dnode, level);
-		err = dump_free(ba, object, blkid * span, span);
-	} else if (data && level == 0 && type == DMU_OT_DNODE) {
-		dnode_phys_t *blk = data;
+		uint64_t span = BP_SPAN(dnp, zb->zb_level);
+		err = dump_free(ba, zb->zb_object, zb->zb_blkid * span, span);
+	} else if (zb->zb_level > 0 || type == DMU_OT_OBJSET) {
+		return (0);
+	} else if (type == DMU_OT_DNODE) {
+		dnode_phys_t *blk;
 		int i;
 		int blksz = BP_GET_LSIZE(bp);
+		uint32_t aflags = ARC_WAIT;
+		arc_buf_t *abuf;
 
+		if (arc_read_nolock(NULL, spa, bp,
+		    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
+		    ZIO_FLAG_CANFAIL, &aflags, zb) != 0)
+			return (EIO);
+
+		blk = abuf->b_data;
 		for (i = 0; i < blksz >> DNODE_SHIFT; i++) {
-			uint64_t dnobj =
-			    (blkid << (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i;
+			uint64_t dnobj = (zb->zb_blkid <<
+			    (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i;
 			err = dump_dnode(ba, dnobj, blk+i);
 			if (err)
 				break;
 		}
-	} else if (level == 0 &&
-	    type != DMU_OT_DNODE && type != DMU_OT_OBJSET) {
+		(void) arc_buf_remove_ref(abuf, &abuf);
+	} else { /* it's a level-0 block of a regular object */
+		uint32_t aflags = ARC_WAIT;
+		arc_buf_t *abuf;
 		int blksz = BP_GET_LSIZE(bp);
-		if (data == NULL) {
-			uint32_t aflags = ARC_WAIT;
-			arc_buf_t *abuf;
-			zbookmark_t zb;
-
-			zb.zb_objset = ba->os->os->os_dsl_dataset->ds_object;
-			zb.zb_object = object;
-			zb.zb_level = level;
-			zb.zb_blkid = blkid;
-			(void) arc_read_nolock(NULL, spa, bp,
-			    arc_getbuf_func, &abuf, ZIO_PRIORITY_ASYNC_READ,
-			    ZIO_FLAG_MUSTSUCCEED, &aflags, &zb);
-
-			if (abuf) {
-				err = dump_data(ba, type, object, blkid * blksz,
-				    blksz, abuf->b_data);
-				(void) arc_buf_remove_ref(abuf, &abuf);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 20:48:41 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7881B1065670;
	Thu, 13 May 2010 20:48:41 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 67B328FC15;
	Thu, 13 May 2010 20:48:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DKmeZk044974;
	Thu, 13 May 2010 20:48:40 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DKmeZe044972;
	Thu, 13 May 2010 20:48:40 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201005132048.o4DKmeZe044972@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 13 May 2010 20:48:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208048 - head/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 20:48:41 -0000

Author: thompsa
Date: Thu May 13 20:48:39 2010
New Revision: 208048
URL: http://svn.freebsd.org/changeset/base/208048

Log:
  Allow the USB_REQ_DEBUG to be enabled in the kernel conf.
  
  Requested by:	HPS

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Thu May 13 20:32:56 2010	(r208047)
+++ head/sys/conf/options	Thu May 13 20:48:39 2010	(r208048)
@@ -639,6 +639,7 @@ BUS_DEBUG		opt_bus.h
 
 # options for USB support
 USB_DEBUG		opt_usb.h
+USB_REQ_DEBUG		opt_usb.h
 USB_VERBOSE		opt_usb.h
 USB_EHCI_BIG_ENDIAN_DESC	opt_usb.h
 U3G_DEBUG		opt_u3g.h

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 20:55:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 763DB106564A;
	Thu, 13 May 2010 20:55:59 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 640D88FC0A;
	Thu, 13 May 2010 20:55:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DKtxoG046660;
	Thu, 13 May 2010 20:55:59 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DKtxrM046654;
	Thu, 13 May 2010 20:55:59 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005132055.o4DKtxrM046654@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 13 May 2010 20:55: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: r208050 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 13 May 2010 20:55:59 -0000

Author: mm
Date: Thu May 13 20:55:58 2010
New Revision: 208050
URL: http://svn.freebsd.org/changeset/base/208050

Log:
  Fix ZIL-related panic on zfs rollback.
  
  OpenSolaris onnv-revision: 8746:e1d96ca6808c
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6796377)
  MCF after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu May 13 20:51:20 2010	(r208049)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu May 13 20:55:58 2010	(r208050)
@@ -1915,7 +1915,6 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, 
 	dnode_t *dn = db->db_dnode;
 	objset_impl_t *os = dn->dn_objset;
 	uint64_t txg = tx->tx_txg;
-	int blksz;
 
 	ASSERT(dmu_tx_is_syncing(tx));
 
@@ -2025,23 +2024,24 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, 
 		return;
 	}
 
-	blksz = arc_buf_size(*datap);
-
-	if (dn->dn_object != DMU_META_DNODE_OBJECT) {
+	if (dn->dn_object != DMU_META_DNODE_OBJECT &&
+	    refcount_count(&db->db_holds) > 1 &&
+	    *datap == db->db_buf) {
 		/*
-		 * If this buffer is currently "in use" (i.e., there are
-		 * active holds and db_data still references it), then make
-		 * a copy before we start the write so that any modifications
-		 * from the open txg will not leak into this write.
+		 * If this buffer is currently "in use" (i.e., there
+		 * are active holds and db_data still references it),
+		 * then make a copy before we start the write so that
+		 * any modifications from the open txg will not leak
+		 * into this write.
 		 *
-		 * NOTE: this copy does not need to be made for objects only
-		 * modified in the syncing context (e.g. DNONE_DNODE blocks).
+		 * NOTE: this copy does not need to be made for
+		 * objects only modified in the syncing context (e.g.
+		 * DNONE_DNODE blocks).
 		 */
-		if (refcount_count(&db->db_holds) > 1 && *datap == db->db_buf) {
-			arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db);
-			*datap = arc_buf_alloc(os->os_spa, blksz, db, type);
-			bcopy(db->db.db_data, (*datap)->b_data, blksz);
-		}
+		int blksz = arc_buf_size(*datap);
+		arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db);
+		*datap = arc_buf_alloc(os->os_spa, blksz, db, type);
+		bcopy(db->db.db_data, (*datap)->b_data, blksz);
 	}
 
 	ASSERT(*datap != NULL);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Thu May 13 20:51:20 2010	(r208049)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Thu May 13 20:55:58 2010	(r208050)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -226,10 +226,6 @@ traverse_visitbp(struct traverse_data *t
 			return (err);
 
 		osp = buf->b_data;
-		/*
-		 * traverse_zil is just here for zdb's leak checking.
-		 * For other consumers, there will be no ZIL blocks.
-		 */
 		traverse_zil(td, &osp->os_zil_header);
 
 		for (j = 0; j < osp->os_meta_dnode.dn_nblkptr; j++) {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Thu May 13 20:51:20 2010	(r208049)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Thu May 13 20:55:58 2010	(r208050)
@@ -1171,8 +1171,18 @@ kill_blkptr(spa_t *spa, blkptr_t *bp, co
 	if (bp == NULL)
 		return (0);
 
-	ASSERT3U(bp->blk_birth, >, ka->ds->ds_phys->ds_prev_snap_txg);
-	(void) dsl_dataset_block_kill(ka->ds, bp, ka->zio, ka->tx);
+	if ((zb->zb_level == -1ULL && zb->zb_blkid != 0) ||
+	    (zb->zb_object != 0 && dnp == NULL)) {
+		/*
+		 * It's a block in the intent log.  It has no
+		 * accounting, so just free it.
+		 */
+		VERIFY3U(0, ==, dsl_free(ka->zio, ka->tx->tx_pool,
+		    ka->tx->tx_txg, bp, NULL, NULL, ARC_NOWAIT));
+	} else {
+		ASSERT3U(bp->blk_birth, >, ka->ds->ds_phys->ds_prev_snap_txg);
+		(void) dsl_dataset_block_kill(ka->ds, bp, ka->zio, ka->tx);
+	}
 
 	return (0);
 }
@@ -1216,13 +1226,7 @@ dsl_dataset_rollback_sync(void *arg1, vo
 
 	dmu_buf_will_dirty(ds->ds_dbuf, tx);
 
-	/*
-	 * Before the roll back destroy the zil.
-	 */
 	if (ds->ds_user_ptr != NULL) {
-		zil_rollback_destroy(
-		    ((objset_impl_t *)ds->ds_user_ptr)->os_zil, tx);
-
 		/*
 		 * We need to make sure that the objset_impl_t is reopened after
 		 * we do the rollback, otherwise it will have the wrong
@@ -1255,7 +1259,10 @@ dsl_dataset_rollback_sync(void *arg1, vo
 	    ds->ds_phys->ds_deadlist_obj));
 
 	{
-		/* Free blkptrs that we gave birth to */
+		/*
+		 * Free blkptrs that we gave birth to - this covers
+		 * claimed but not played log blocks too.
+		 */
 		zio_t *zio;
 		struct killarg ka;
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c	Thu May 13 20:51:20 2010	(r208049)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c	Thu May 13 20:55:58 2010	(r208050)
@@ -344,6 +344,12 @@ traverse_zil_block(zilog_t *zilog, blkpt
 	if (bp->blk_birth <= dp->dp_scrub_min_txg)
 		return;
 
+	/*
+	 * One block ("stumpy") can be allocated a long time ago; we
+	 * want to visit that one because it has been allocated
+	 * (on-disk) even if it hasn't been claimed (even though for
+	 * plain scrub there's nothing to do to it).
+	 */
 	if (claim_txg == 0 && bp->blk_birth >= spa_first_txg(dp->dp_spa))
 		return;
 
@@ -369,6 +375,11 @@ traverse_zil_record(zilog_t *zilog, lr_t
 		if (bp->blk_birth <= dp->dp_scrub_min_txg)
 			return;
 
+		/*
+		 * birth can be < claim_txg if this record's txg is
+		 * already txg sync'ed (but this log block contains
+		 * other records that are not synced)
+		 */
 		if (claim_txg == 0 || bp->blk_birth < claim_txg)
 			return;
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu May 13 20:51:20 2010	(r208049)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu May 13 20:55:58 2010	(r208050)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -478,37 +478,6 @@ zil_destroy(zilog_t *zilog, boolean_t ke
 }
 
 /*
- * zil_rollback_destroy() is only called by the rollback code.
- * We already have a syncing tx. Rollback has exclusive access to the
- * dataset, so we don't have to worry about concurrent zil access.
- * The actual freeing of any log blocks occurs in zil_sync() later in
- * this txg syncing phase.
- */
-void
-zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx)
-{
-	const zil_header_t *zh = zilog->zl_header;
-	uint64_t txg;
-
-	if (BP_IS_HOLE(&zh->zh_log))
-		return;
-
-	txg = dmu_tx_get_txg(tx);
-	ASSERT3U(zilog->zl_destroy_txg, <, txg);
-	zilog->zl_destroy_txg = txg;
-	zilog->zl_keep_first = B_FALSE;
-
-	/*
-	 * Ensure there's no outstanding ZIL IO.  No lwbs or just the
-	 * unused one that allocated in advance is ok.
-	 */
-	ASSERT(zilog->zl_lwb_list.list_head.list_next ==
-	    zilog->zl_lwb_list.list_head.list_prev);
-	(void) zil_parse(zilog, zil_free_log_block, zil_free_log_record,
-	    tx, zh->zh_claim_txg);
-}
-
-/*
  * return true if the initial log block is not valid
  */
 static boolean_t

From owner-svn-src-all@FreeBSD.ORG  Thu May 13 23:28:21 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41512106566B;
	Thu, 13 May 2010 23:28:21 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F3CF8FC15;
	Thu, 13 May 2010 23:28:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4DNSLfI080073;
	Thu, 13 May 2010 23:28:21 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4DNSLYi080072;
	Thu, 13 May 2010 23:28:21 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201005132328.o4DNSLYi080072@svn.freebsd.org>
From: Xin LI 
Date: Thu, 13 May 2010 23:28:20 +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: r208051 - stable/8/lib/libc/string
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 13 May 2010 23:28:21 -0000

Author: delphij
Date: Thu May 13 23:28:20 2010
New Revision: 208051
URL: http://svn.freebsd.org/changeset/base/208051

Log:
  MFC r205099-205100,205108:
  
  Two optimizations to MI strlen(3) inspired by David S. Miller's
  blog posting [1].
  
   - Use word-sized test for unaligned pointer before working
     the hard way.
  
     Memory page boundary is always integral multiple of a word
     alignment boundary.  Therefore, if we can access memory
     referenced by pointer p, then (p & ~word mask) must be also
     accessible.
  
   - Better utilization of multi-issue processor's ability of
     concurrency.
  
     The previous implementation utilized a formular that must be
     executed sequentially.  However, the ~, & and - operations can
     actually be caculated at the same time when the operand were
     different and unrelated.
  
     The original Hacker's Delight formular also offered consistent
     performance regardless whether the input would contain
     characters with their highest-bit set, as it catches real
     nul characters only.
  
  These two optimizations has shown further improvements over the
  previous implementation on microbenchmarks on i386 and amd64 CPU
  including Pentium 4, Core Duo 2 and i7.
  
  [1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1

Modified:
  stable/8/lib/libc/string/strlen.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/string/strlen.c
==============================================================================
--- stable/8/lib/libc/string/strlen.c	Thu May 13 20:55:58 2010	(r208050)
+++ stable/8/lib/libc/string/strlen.c	Thu May 13 23:28:20 2010	(r208051)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2009 Xin LI 
+ * Copyright (c) 2009, 2010 Xin LI 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,15 +43,17 @@ __FBSDID("$FreeBSD$");
  *	((x - 0x01....01) & ~x & 0x80....80)
  *
  * would evaluate to a non-zero value iff any of the bytes in the
- * original word is zero.  However, we can further reduce ~1/3 of
- * time if we consider that strlen() usually operate on 7-bit ASCII
- * by employing the following expression, which allows false positive
- * when high bit of 1 and use the tail case to catch these case:
+ * original word is zero.
  *
- *	((x - 0x01....01) & 0x80....80)
+ * On multi-issue processors, we can divide the above expression into:
+ *	a)  (x - 0x01....01)
+ *	b) (~x & 0x80....80)
+ *	c) a & b
  *
- * This is more than 5.2 times as fast as the raw implementation on
- * Intel T7300 under long mode for strings longer than word length.
+ * Where, a) and b) can be partially computed in parallel.
+ *
+ * The algorithm above is found on "Hacker's Delight" by
+ * Henry S. Warren, Jr.
  */
 
 /* Magic numbers for the algorithm */
@@ -82,29 +84,47 @@ strlen(const char *str)
 {
 	const char *p;
 	const unsigned long *lp;
+	long va, vb;
 
-	/* Skip the first few bytes until we have an aligned p */
-	for (p = str; (uintptr_t)p & LONGPTR_MASK; p++)
-	    if (*p == '\0')
-		return (p - str);
+	/*
+	 * Before trying the hard (unaligned byte-by-byte access) way
+	 * to figure out whether there is a nul character, try to see
+	 * if there is a nul character is within this accessible word
+	 * first.
+	 *
+	 * p and (p & ~LONGPTR_MASK) must be equally accessible since
+	 * they always fall in the same memory page, as long as page
+	 * boundaries is integral multiple of word size.
+	 */
+	lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK);
+	va = (*lp - mask01);
+	vb = ((~*lp) & mask80);
+	lp++;
+	if (va & vb)
+		/* Check if we have \0 in the first part */
+		for (p = str; p < (const char *)lp; p++)
+			if (*p == '\0')
+				return (p - str);
 
 	/* Scan the rest of the string using word sized operation */
-	for (lp = (const unsigned long *)p; ; lp++)
-	    if ((*lp - mask01) & mask80) {
-		p = (const char *)(lp);
-		testbyte(0);
-		testbyte(1);
-		testbyte(2);
-		testbyte(3);
+	for (; ; lp++) {
+		va = (*lp - mask01);
+		vb = ((~*lp) & mask80);
+		if (va & vb) {
+			p = (const char *)(lp);
+			testbyte(0);
+			testbyte(1);
+			testbyte(2);
+			testbyte(3);
 #if (LONG_BIT >= 64)
-		testbyte(4);
-		testbyte(5);
-		testbyte(6);
-		testbyte(7);
+			testbyte(4);
+			testbyte(5);
+			testbyte(6);
+			testbyte(7);
 #endif
-	    }
+		}
+	}
 
 	/* NOTREACHED */
 	return (0);
 }
-

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 00:00:20 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22C9F1065672;
	Fri, 14 May 2010 00:00:20 +0000 (UTC)
	(envelope-from cognet@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 11C698FC16;
	Fri, 14 May 2010 00:00:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E00JJR087144;
	Fri, 14 May 2010 00:00:19 GMT (envelope-from cognet@svn.freebsd.org)
Received: (from cognet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E00JhD087142;
	Fri, 14 May 2010 00:00:19 GMT (envelope-from cognet@svn.freebsd.org)
Message-Id: <201005140000.o4E00JhD087142@svn.freebsd.org>
From: Olivier Houchard 
Date: Fri, 14 May 2010 00:00: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: r208052 - 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: Fri, 14 May 2010 00:00:20 -0000

Author: cognet
Date: Fri May 14 00:00:19 2010
New Revision: 208052
URL: http://svn.freebsd.org/changeset/base/208052

Log:
  Catchup with new prototype for db_printf().

Modified:
  head/sys/arm/include/disassem.h

Modified: head/sys/arm/include/disassem.h
==============================================================================
--- head/sys/arm/include/disassem.h	Thu May 13 23:28:20 2010	(r208051)
+++ head/sys/arm/include/disassem.h	Fri May 14 00:00:19 2010	(r208052)
@@ -43,7 +43,7 @@
 typedef struct {
 	u_int	(*di_readword)(u_int);
 	void	(*di_printaddr)(u_int);	
-	void	(*di_printf)(const char *, ...) __printflike(1, 2);
+	int	(*di_printf)(const char *, ...) __printflike(1, 2);
 } disasm_interface_t;
 
 /* Prototypes for callable functions */

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 01:10:20 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FEBB106566B;
	Fri, 14 May 2010 01:10:20 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7EEC68FC19;
	Fri, 14 May 2010 01:10:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E1AKaY002668;
	Fri, 14 May 2010 01:10:20 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E1AKTU002666;
	Fri, 14 May 2010 01:10:20 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005140110.o4E1AKTU002666@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 14 May 2010 01:10:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208053 - head/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 01:10:20 -0000

Author: brueffer
Date: Fri May 14 01:10:20 2010
New Revision: 208053
URL: http://svn.freebsd.org/changeset/base/208053

Log:
  Mention LSI Logic FC949E.
  
  PR:		110359
  Submitted by:	Vivek Khera 
  MFC after:	3 days

Modified:
  head/share/man/man4/mpt.4

Modified: head/share/man/man4/mpt.4
==============================================================================
--- head/share/man/man4/mpt.4	Fri May 14 00:00:19 2010	(r208052)
+++ head/share/man/man4/mpt.4	Fri May 14 01:10:20 2010	(r208053)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 15, 2009
+.Dd May 13, 2010
 .Dt MPT 4
 .Os
 .Sh NAME
@@ -105,6 +105,7 @@ LSI Logic FC949X
 (Dual 4Gb/s
 .Tn Fibre Channel )
 .It
+LSI Logic FC949E,
 LSI Logic FC949ES
 (Dual 4Gb/s
 .Tn Fibre Channel PCI-Express)

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 01:25:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 505FD1065670;
	Fri, 14 May 2010 01:25:31 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F3018FC08;
	Fri, 14 May 2010 01:25:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E1PVl6006140;
	Fri, 14 May 2010 01:25:31 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E1PVOe006138;
	Fri, 14 May 2010 01:25:31 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005140125.o4E1PVOe006138@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 14 May 2010 01:25: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: r208054 - head/usr.sbin/cron/crontab
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 01:25:31 -0000

Author: brueffer
Date: Fri May 14 01:25:30 2010
New Revision: 208054
URL: http://svn.freebsd.org/changeset/base/208054

Log:
  List /var/cron/tabs in FILES and add descriptions for the other entries.
  
  PR:		145912
  Submitted by:	Julian H. Stacey 
  Obtained from:	OpenBSD
  MFC after:	1 week

Modified:
  head/usr.sbin/cron/crontab/crontab.1

Modified: head/usr.sbin/cron/crontab/crontab.1
==============================================================================
--- head/usr.sbin/cron/crontab/crontab.1	Fri May 14 01:10:20 2010	(r208053)
+++ head/usr.sbin/cron/crontab/crontab.1	Fri May 14 01:25:30 2010	(r208054)
@@ -17,7 +17,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 29, 1993
+.Dd May 13, 2010
 .Dt CRONTAB 1
 .Os
 .Sh NAME
@@ -114,7 +114,11 @@ from the editor, the modified crontab wi
 .Sh FILES
 .Bl -tag -width /var/cron/allow -compact
 .It Pa /var/cron/allow
+List of users allowed to use crontab
 .It Pa /var/cron/deny
+List of users prohibited from using crontab
+.It Pa /var/cron/tabs
+Directory for personal crontab files
 .El
 .Sh DIAGNOSTICS
 A fairly informative usage message appears if you run it with a bad command

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 01:43:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7FC97106566C;
	Fri, 14 May 2010 01:43:13 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6465D8FC0C;
	Fri, 14 May 2010 01:43:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E1hDbB010130;
	Fri, 14 May 2010 01:43:13 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E1hDc5010127;
	Fri, 14 May 2010 01:43:13 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201005140143.o4E1hDc5010127@svn.freebsd.org>
From: Attilio Rao 
Date: Fri, 14 May 2010 01:43:13 +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: r208055 - stable/8/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, 14 May 2010 01:43:13 -0000

Author: attilio
Date: Fri May 14 01:43:13 2010
New Revision: 208055
URL: http://svn.freebsd.org/changeset/base/208055

Log:
  MFC r206878, r206897, r207921:
  Fix a deadlock in the shutdown code when some CPUs are performing
  smp_rendezvous() (or smp_tlb_shootdown()) and are waiting for
  acknowledgment.

Modified:
  stable/8/sys/kern/kern_shutdown.c
  stable/8/sys/kern/subr_smp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/kern/kern_shutdown.c
==============================================================================
--- stable/8/sys/kern/kern_shutdown.c	Fri May 14 01:25:30 2010	(r208054)
+++ stable/8/sys/kern/kern_shutdown.c	Fri May 14 01:43:13 2010	(r208055)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 		/* smp_active */
+#include 
 #include 
 #include 
 
@@ -485,15 +485,26 @@ static void
 shutdown_reset(void *junk, int howto)
 {
 
+	printf("Rebooting...\n");
+	DELAY(1000000);	/* wait 1 sec for printf's to complete and be read */
+
 	/*
-	 * Disable interrupts on CPU0 in order to avoid fast handlers
-	 * to preempt the stopping process and to deadlock against other
-	 * CPUs.
+	 * Acquiring smp_ipi_mtx here has a double effect:
+	 * - it disables interrupts avoiding CPU0 preemption
+	 *   by fast handlers (thus deadlocking  against other CPUs)
+	 * - it avoids deadlocks against smp_rendezvous() or, more 
+	 *   generally, threads busy-waiting, with this spinlock held,
+	 *   and waiting for responses by threads on other CPUs
+	 *   (ie. smp_tlb_shootdown()).
+	 *
+	 * For the !SMP case it just needs to handle the former problem.
 	 */
+#ifdef SMP
+	mtx_lock_spin(&smp_ipi_mtx);
+#else
 	spinlock_enter();
+#endif
 
-	printf("Rebooting...\n");
-	DELAY(1000000);	/* wait 1 sec for printf's to complete and be read */
 	/* cpu_boot(howto); */ /* doesn't do anything at the moment */
 	cpu_reset();
 	/* NOTREACHED */ /* assuming reset worked */

Modified: stable/8/sys/kern/subr_smp.c
==============================================================================
--- stable/8/sys/kern/subr_smp.c	Fri May 14 01:25:30 2010	(r208054)
+++ stable/8/sys/kern/subr_smp.c	Fri May 14 01:43:13 2010	(r208055)
@@ -137,6 +137,8 @@ static void
 mp_start(void *dummy)
 {
 
+	mtx_init(&smp_ipi_mtx, "smp rendezvous", NULL, MTX_SPIN);
+
 	/* Probe for MP hardware. */
 	if (smp_disabled != 0 || cpu_mp_probe() == 0) {
 		mp_ncpus = 1;
@@ -144,7 +146,6 @@ mp_start(void *dummy)
 		return;
 	}
 
-	mtx_init(&smp_ipi_mtx, "smp rendezvous", NULL, MTX_SPIN);
 	cpu_mp_start();
 	printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n",
 	    mp_ncpus);

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 01:45:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 808E7106566B;
	Fri, 14 May 2010 01:45:05 +0000 (UTC)
	(envelope-from brueffer@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6FCD48FC0A;
	Fri, 14 May 2010 01:45:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E1j5Ec010608;
	Fri, 14 May 2010 01:45:05 GMT
	(envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E1j5SE010606;
	Fri, 14 May 2010 01:45:05 GMT
	(envelope-from brueffer@svn.freebsd.org)
Message-Id: <201005140145.o4E1j5SE010606@svn.freebsd.org>
From: Christian Brueffer 
Date: Fri, 14 May 2010 01:45:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208056 - head/usr.sbin/mtree
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 01:45:05 -0000

Author: brueffer
Date: Fri May 14 01:45:05 2010
New Revision: 208056
URL: http://svn.freebsd.org/changeset/base/208056

Log:
  Wording fixes.
  
  PR:		143454
  Submitted by:	Warren Block 
  MFC after:	3 days

Modified:
  head/usr.sbin/mtree/mtree.8

Modified: head/usr.sbin/mtree/mtree.8
==============================================================================
--- head/usr.sbin/mtree/mtree.8	Fri May 14 01:43:13 2010	(r208055)
+++ head/usr.sbin/mtree/mtree.8	Fri May 14 01:45:05 2010	(r208056)
@@ -88,7 +88,7 @@ Do not complain about files that are in 
 specification.
 .It Fl i
 Indent the output 4 spaces each time a directory level is descended when
-create a specification with the
+creating a specification with the
 .Fl c
 option.
 This does not affect either the /set statements or the comment before each
@@ -126,7 +126,7 @@ instead of from the standard input.
 .Pp
 If this option is specified twice, the two specifications are compared
 to each other rather than to the file hierarchy.
-The specifications be sorted like output generated using
+The specifications will be sorted like output generated using
 .Fl c .
 The output format in this case is somewhat remniscent of
 .Xr comm 1 ,

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 04:53:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 916FB106564A;
	Fri, 14 May 2010 04:53:59 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F5D48FC0A;
	Fri, 14 May 2010 04:53:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E4rwxP052667;
	Fri, 14 May 2010 04:53:58 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E4rvDO052642;
	Fri, 14 May 2010 04:53:57 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005140453.o4E4rvDO052642@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 04:53: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: r208060 - in head/etc: . defaults periodic/daily
	periodic/weekly 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, 14 May 2010 04:53:59 -0000

Author: dougb
Date: Fri May 14 04:53:57 2010
New Revision: 208060
URL: http://svn.freebsd.org/changeset/base/208060

Log:
  Remove trailing white space. No functional changes.

Modified:
  head/etc/defaults/rc.conf
  head/etc/devd.conf
  head/etc/network.subr
  head/etc/periodic/daily/310.accounting
  head/etc/periodic/daily/440.status-mailq
  head/etc/periodic/weekly/330.catman
  head/etc/rc.d/bluetooth
  head/etc/rc.d/bridge
  head/etc/rc.d/cleanvar
  head/etc/rc.d/defaultroute
  head/etc/rc.d/geli
  head/etc/rc.d/geli2
  head/etc/rc.d/ipfw
  head/etc/rc.d/mdconfig
  head/etc/rc.d/mdconfig2
  head/etc/rc.d/nscd
  head/etc/rc.d/rfcomm_pppd_server
  head/etc/rc.d/stf
  head/etc/rc.d/syscons
  head/etc/rc.d/ubthidhci
  head/etc/rc.firewall
  head/etc/rc.initdiskless
  head/etc/regdomain.xml
  head/etc/services

Modified: head/etc/defaults/rc.conf
==============================================================================
--- head/etc/defaults/rc.conf	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/defaults/rc.conf	Fri May 14 04:53:57 2010	(r208060)
@@ -221,7 +221,7 @@ ifconfig_lo0="inet 127.0.0.1"	# default 
 #wlandebug_wlan0="scan+auth+assoc"	# Set debug flags with wlanddebug(8)
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
-#autobridge_interfaces="bridge0"	# List of bridges to check 
+#autobridge_interfaces="bridge0"	# List of bridges to check
 #autobridge_bridge0="tap* vlan0"	# Interface glob to automatically add to the bridge
 #
 # If you have any sppp(4) interfaces above, you might also want to set
@@ -662,11 +662,11 @@ jail_sysvipc_allow="NO"	# Allow SystemV 
 #jail_example_rootdir="/usr/jail/default"	# Jail's root directory
 #jail_example_hostname="default.domain.com"	# Jail's hostname
 #jail_example_interface=""			# Jail's interface variable to create IP aliases on
-#jail_example_fib="0"				# Routing table for setfib(1) 
+#jail_example_fib="0"				# Routing table for setfib(1)
 #jail_example_ip="192.0.2.10,2001:db8::17"	# Jail's primary IPv4 and IPv6 address
 #jail_example_ip_multi0="2001:db8::10"		#  and another IPv6 address
 #jail_example_exec_start="/bin/sh /etc/rc"		# command to execute in jail for starting
-#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for 
+#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for
 							# starting the jail. More than one can be
 							# specified using a trailing number
 #jail_example_exec_stop="/bin/sh /etc/rc.shutdown"	# command to execute in jail for stopping

Modified: head/etc/devd.conf
==============================================================================
--- head/etc/devd.conf	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/devd.conf	Fri May 14 04:53:57 2010	(r208060)
@@ -112,10 +112,10 @@ attach 100 {
 	action "/etc/rc.d/moused quietstart $device-name";
 };
 
-detach 100 { 
-        device-name "ums[0-9]+"; 
-        action "/etc/rc.d/moused stop $device-name"; 
-}; 
+detach 100 {
+        device-name "ums[0-9]+";
+        action "/etc/rc.d/moused stop $device-name";
+};
 
 # Firmware download into the ActiveWire board. After the firmware download is
 # done the device detaches and reappears as something new and shiny

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/network.subr	Fri May 14 04:53:57 2010	(r208060)
@@ -478,7 +478,7 @@ ifexists()
 }
 
 # ipv4_up if
-#	add IPv4 addresses to the interface $if 
+#	add IPv4 addresses to the interface $if
 ipv4_up()
 {
 	local _if _ret
@@ -588,14 +588,14 @@ ipv6_down()
 ipv4_addrs_common()
 {
 	local _ret _if _action _cidr _cidr_addr
-	local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount 
+	local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount
 	_ret=1
 	_if=$1
 	_action=$2
-    
+
 	# get ipv4-addresses
 	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
-    
+
 	for _cidr in ${cidr_addr}; do
 		_ipaddr=${_cidr%%/*}
 		_netmask="/"${_cidr##*/}
@@ -608,7 +608,7 @@ ipv4_addrs_common()
 		if [ "${_action}" = "-alias" ]; then
 			_netmask=""
 		fi
-        
+
 		_ipcount=${_iplow}
 		while [ "${_ipcount}" -le "${_iphigh}" ]; do
 			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"

Modified: head/etc/periodic/daily/310.accounting
==============================================================================
--- head/etc/periodic/daily/310.accounting	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/periodic/daily/310.accounting	Fri May 14 04:53:57 2010	(r208060)
@@ -29,7 +29,7 @@ case "$daily_accounting_enable" in
 
 	    cd /var/account
 	    rc=0
-	
+
 	    n=$daily_accounting_save
 	    rm -f acct.$n.gz acct.$n || rc=3
 	    m=$n

Modified: head/etc/periodic/daily/440.status-mailq
==============================================================================
--- head/etc/periodic/daily/440.status-mailq	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/periodic/daily/440.status-mailq	Fri May 14 04:53:57 2010	(r208060)
@@ -59,7 +59,7 @@ case "$daily_status_mailq_enable" in
 		fi;;
 	    esac
 	fi;;
-		
+
     *)  rc=0;;
 esac
 

Modified: head/etc/periodic/weekly/330.catman
==============================================================================
--- head/etc/periodic/weekly/330.catman	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/periodic/weekly/330.catman	Fri May 14 04:53:57 2010	(r208060)
@@ -27,13 +27,13 @@ case "$weekly_catman_enable" in
 	    then
 		if [ -z "${MANPATH}" ]
 		then
-		    echo "manpath failed to find any manpath directories" 
+		    echo "manpath failed to find any manpath directories"
 		    rc=3
 		else
 		    man_locales=`/usr/bin/manpath -qL`
 		    rc=0
-         
-		    # Preformat original, non-localized manpages  
+
+		    # Preformat original, non-localized manpages
 		    echo /usr/libexec/catman.local -r "$MANPATH" |
 			su -fm man || rc=3
 

Modified: head/etc/rc.d/bluetooth
==============================================================================
--- head/etc/rc.d/bluetooth	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/bluetooth	Fri May 14 04:53:57 2010	(r208060)
@@ -95,7 +95,7 @@ bluetooth_setup_stack()
 	hook=$1
 	shift
 
-	# Setup HCI 
+	# Setup HCI
 	ngctl mkpeer ${dev}: hci ${hook} drv \
 		> /dev/null 2>&1 || return 1
 
@@ -282,7 +282,7 @@ bluetooth_start()
 		;;
 	esac
 
-	# Be backward compatible and setup reasonable defaults 
+	# Be backward compatible and setup reasonable defaults
 	bluetooth_device_authentication_enable="0"
 	bluetooth_device_class="ff:01:0c"
 	bluetooth_device_connectable="1"
@@ -312,7 +312,7 @@ bluetooth_start()
 		bluetooth_shutdown_stack $dev
 		err 1 "Unable to setup Bluetooth stack for device ${dev}"
 	fi
-		
+
 	return 0
 }
 

Modified: head/etc/rc.d/bridge
==============================================================================
--- head/etc/rc.d/bridge	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/bridge	Fri May 14 04:53:57 2010	(r208060)
@@ -42,7 +42,7 @@ glob_int () {
 		$2 ) true ;;
 		* ) false ;;
 	esac
-} 
+}
 
 bridge_test () {
 	bridge=$1

Modified: head/etc/rc.d/cleanvar
==============================================================================
--- head/etc/rc.d/cleanvar	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/cleanvar	Fri May 14 04:53:57 2010	(r208060)
@@ -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/defaultroute
==============================================================================
--- head/etc/rc.d/defaultroute	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/defaultroute	Fri May 14 04:53:57 2010	(r208060)
@@ -28,7 +28,7 @@ defaultroute_start()
 	[ -z "${dhcp_interfaces}" ] && return
 	carrier=false
 	for _if in ${dhcp_interfaces}; do
-		output=`/sbin/ifconfig ${_if}` 
+		output=`/sbin/ifconfig ${_if}`
 		nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
 		[ -z "${nocarrier}" ] && carrier=true
 	done

Modified: head/etc/rc.d/geli
==============================================================================
--- head/etc/rc.d/geli	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/geli	Fri May 14 04:53:57 2010	(r208060)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: head/etc/rc.d/geli2
==============================================================================
--- head/etc/rc.d/geli2	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/geli2	Fri May 14 04:53:57 2010	(r208060)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: head/etc/rc.d/ipfw
==============================================================================
--- head/etc/rc.d/ipfw	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/ipfw	Fri May 14 04:53:57 2010	(r208060)
@@ -30,14 +30,14 @@ ipfw_prestart()
 		if ! checkyesno natd_enable; then
 			required_modules="$required_modules ipfw_nat"
 		fi
-	fi 
+	fi
 }
 
 ipfw_start()
 {
 	local   _firewall_type
 
-	_firewall_type=$1 
+	_firewall_type=$1
 
 	# set the firewall rules script if none was specified
 	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall

Modified: head/etc/rc.d/mdconfig
==============================================================================
--- head/etc/rc.d/mdconfig	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/mdconfig	Fri May 14 04:53:57 2010	(r208060)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -139,7 +139,7 @@ mdconfig_start()
 				if ! eval ${_fsck_cmd} -p ${_dev} >/dev/null; then
 					echo "Fsck failed on ${_dev}, not mounting the filesystem."
 					continue
-					
+
 				fi
 			else
 				newfs ${_newfs} ${_dev} >/dev/null
@@ -194,5 +194,5 @@ if [ -z "${_mdconfig_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig_cmd}"

Modified: head/etc/rc.d/mdconfig2
==============================================================================
--- head/etc/rc.d/mdconfig2	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/mdconfig2	Fri May 14 04:53:57 2010	(r208060)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -223,5 +223,5 @@ if [ -z "${_mdconfig2_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig2_cmd}"

Modified: head/etc/rc.d/nscd
==============================================================================
--- head/etc/rc.d/nscd	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/nscd	Fri May 14 04:53:57 2010	(r208060)
@@ -34,7 +34,7 @@ _nscd_set_option() {
 
 	_nscd_opt_val=$(eval "echo \$nscd_${_optname}")
 	_cached_opt_val=$(eval "echo \$cached_${_optname}")
-	
+
 	if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
 		warn "You should use nscd_${_optname} instead of" \
 		    "cached_${_optname}"

Modified: head/etc/rc.d/rfcomm_pppd_server
==============================================================================
--- head/etc/rc.d/rfcomm_pppd_server	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/rfcomm_pppd_server	Fri May 14 04:53:57 2010	(r208060)
@@ -46,7 +46,7 @@ rfcomm_pppd_server_start_profile()
 		_channel=1
 	fi
 	rc_flags="${rc_flags} -C ${_channel}"
-	
+
 	# Check for RFCOMM PPP profile register SP override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_sp
@@ -55,7 +55,7 @@ rfcomm_pppd_server_start_profile()
 			rc_flags="${rc_flags} -S"
 		fi
 	fi
-	
+
 	# Check for RFCOMM PPP profile register DUN override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_dun

Modified: head/etc/rc.d/stf
==============================================================================
--- head/etc/rc.d/stf	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/stf	Fri May 14 04:53:57 2010	(r208060)
@@ -49,7 +49,7 @@ stf_up()
 			esac
 			;;
 		esac
-		echo "Configuring 6to4 tunnel interface: stf0." 
+		echo "Configuring 6to4 tunnel interface: stf0."
 		ifconfig stf0 create >/dev/null 2>&1
 		ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \
 			prefixlen ${stf_prefixlen}
@@ -66,7 +66,7 @@ stf_up()
 
 stf_down()
 {
-	echo "Removing 6to4 tunnel interface: stf0." 
+	echo "Removing 6to4 tunnel interface: stf0."
 	ifconfig stf0 destroy
 	route delete -inet6 2002:e000:: -prefixlen 20 ::1
 	route delete -inet6 2002:7f00:: -prefixlen 24 ::1

Modified: head/etc/rc.d/syscons
==============================================================================
--- head/etc/rc.d/syscons	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/syscons	Fri May 14 04:53:57 2010	(r208060)
@@ -121,7 +121,7 @@ syscons_configure_keyboard()
 syscons_setkeyboard()
 {
 	kbd=$1
-                
+
 	if [ -z "${kbd}" ]; then
 		return 1
 	fi

Modified: head/etc/rc.d/ubthidhci
==============================================================================
--- head/etc/rc.d/ubthidhci	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.d/ubthidhci	Fri May 14 04:53:57 2010	(r208060)
@@ -4,8 +4,8 @@
 #
 
 # PROVIDE: ubthidhci
-# REQUIRE: DAEMON 
-# BEFORE: bluetooth 
+# REQUIRE: DAEMON
+# BEFORE: bluetooth
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr

Modified: head/etc/rc.firewall
==============================================================================
--- head/etc/rc.firewall	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.firewall	Fri May 14 04:53:57 2010	(r208060)
@@ -461,7 +461,7 @@ case ${firewall_type} in
 	if [ $ipv6_available -eq 0 ]; then
 		${fwcmd} add pass udp from fe80::/10 to me 546 in
 	fi
-	# Some servers will ping the IP while trying to decide if it's 
+	# Some servers will ping the IP while trying to decide if it's
 	# still in use.
 	${fwcmd} add pass icmp from any to any icmptype 8
 	if [ $ipv6_available -eq 0 ]; then
@@ -476,11 +476,11 @@ case ${firewall_type} in
 
 	# Add permits for this workstations published services below
 	# Only IPs and nets in firewall_allowservices is allowed in.
-	# If you really wish to let anyone use services on your 
+	# If you really wish to let anyone use services on your
 	# workstation, then set "firewall_allowservices='any'" in /etc/rc.conf
 	#
 	# Note: We don't use keep-state as that would allow DoS of
-	#       our statetable. 
+	#       our statetable.
 	#       You can add 'keep-state' to the lines for slightly
 	#       better performance if you fell that DoS of your
 	#       workstation won't be a problem.

Modified: head/etc/rc.initdiskless
==============================================================================
--- head/etc/rc.initdiskless	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/rc.initdiskless	Fri May 14 04:53:57 2010	(r208060)
@@ -119,7 +119,7 @@
 #		Similar to /conf/T/M/diskless_remount above, but allows
 #		all of /conf to be remounted.  This can be used to allow
 #		multiple roots to share the same /conf.
-#		
+#
 #
 # You will almost universally want to create the following files under /conf
 #

Modified: head/etc/regdomain.xml
==============================================================================
--- head/etc/regdomain.xml	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/regdomain.xml	Fri May 14 04:53:57 2010	(r208060)
@@ -1,7 +1,7 @@
 
 
@@ -1200,7 +1200,7 @@
 
 
 
 

Modified: head/etc/services
==============================================================================
--- head/etc/services	Fri May 14 04:22:58 2010	(r208059)
+++ head/etc/services	Fri May 14 04:53:57 2010	(r208060)
@@ -1243,8 +1243,8 @@ dctp		675/tcp
 dctp		675/udp
 vpps-via	676/tcp    #VPPS Via
 vpps-via	676/udp    #VPPS Via
-vpp		677/tcp    #Virtual Presence Protocol 
-vpp		677/udp    #Virtual Presence Protocol 
+vpp		677/tcp    #Virtual Presence Protocol
+vpp		677/udp    #Virtual Presence Protocol
 ggf-ncp		678/tcp    #GNU Generation Foundation NCP
 ggf-ncp		678/udp    #GNU Generation Foundation NCP
 mrm             679/tcp
@@ -1255,8 +1255,8 @@ entrust-aams	681/tcp
 entrust-aams	681/udp
 xfr             682/tcp
 xfr             682/udp
-corba-iiop      683/tcp    #CORBA IIOP 
-corba-iiop      683/udp    #CORBA IIOP 
+corba-iiop      683/tcp    #CORBA IIOP
+corba-iiop      683/udp    #CORBA IIOP
 corba-iiop-ssl	684/tcp    #CORBA IIOP SSL
 corba-iiop-ssl	684/udp    #CORBA IIOP SSL
 mdc-portmapper	685/tcp    #MDC Port Mapper
@@ -1311,8 +1311,8 @@ cisco-tdp       711/tcp    #Cisco TDP
 cisco-tdp       711/udp    #Cisco TDP
 tbrpf           712/tcp
 tbrpf           712/udp
-iris-xpc	713/tcp    #IRIS over XPC 
-iris-xpc	713/udp    #IRIS over XPC 
+iris-xpc	713/tcp    #IRIS over XPC
+iris-xpc	713/udp    #IRIS over XPC
 iris-xpcs	714/tcp    #IRIS over XPCS
 iris-xpcs	714/udp    #IRIS over XPCS
 iris-lwz	715/tcp
@@ -1412,7 +1412,7 @@ pkix-3-ca-ra	829/tcp    #PKIX-3 CA/RA
 pkix-3-ca-ra    829/udp    #PKIX-3 CA/RA
 netconf-ssh     830/tcp    #NETCONF over SSH
 netconf-ssh     830/udp    #NETCONF over SSH
-netconf-beep    831/tcp    #NETCONF over BEEP 
+netconf-beep    831/tcp    #NETCONF over BEEP
 netconf-beep    831/udp    #NETCONF over BEEP
 netconfsoaphttp 832/tcp    #NETCONF for SOAP over HTTPS
 netconfsoaphttp 832/udp    #NETCONF for SOAP over HTTPS
@@ -1444,14 +1444,14 @@ ideafarm-chat   902/tcp
 ideafarm-chat   902/udp
 ideafarm-catch  903/tcp
 ideafarm-catch  903/udp
-kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK) 
+kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK)
 kink            910/udp    #Kerberized Internet Negotiation of Keys (KINK)
 xact-backup     911/tcp
 xact-backup     911/udp
 apex-mesh       912/tcp    #APEX relay-relay service
 apex-mesh       912/udp    #APEX relay-relay service
 apex-edge       913/tcp    #APEX endpoint-relay service
-apex-edge       913/udp    #APEX endpoint-relay service    
+apex-edge       913/udp    #APEX endpoint-relay service
 rndc		953/tcp	   # named's rndc control socket
 ftps-data	989/tcp	   # ftp protocol, data, over TLS/SSL
 ftps-data	989/udp

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 08:56:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04901106566B;
	Fri, 14 May 2010 08:56:08 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E72F28FC21;
	Fri, 14 May 2010 08:56:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E8u7AE006099;
	Fri, 14 May 2010 08:56:07 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E8u7vH006098;
	Fri, 14 May 2010 08:56:07 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140856.o4E8u7vH006098@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 08:56:07 +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: r208061 -
	stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 08:56:08 -0000

Author: mm
Date: Fri May 14 08:56:07 2010
New Revision: 208061
URL: http://svn.freebsd.org/changeset/base/208061

Log:
  MFC r207480:
  
  Change description of tunable group vfs.zfs.txg to be more
  understandable.
  
  Approved by:	pjd, delphij (mentor)

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri May 14 04:53:57 2010	(r208060)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri May 14 08:56:07 2010	(r208061)
@@ -40,7 +40,8 @@ int zfs_txg_timeout = 30;	/* max seconds
 extern int zfs_txg_synctime;
 
 SYSCTL_DECL(_vfs_zfs);
-SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG");
+SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0,
+    "ZFS transaction groups (TXG)");
 TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout);
 SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RDTUN, &zfs_txg_timeout, 0,
     "Maximum seconds worth of delta per txg");

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:00:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 961FE106564A;
	Fri, 14 May 2010 09:00:29 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 848C88FC19;
	Fri, 14 May 2010 09:00:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E90TtA007112;
	Fri, 14 May 2010 09:00:29 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E90TjQ007110;
	Fri, 14 May 2010 09:00:29 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140900.o4E90TjQ007110@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:00:29 +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: r208062 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:00:29 -0000

Author: mm
Date: Fri May 14 09:00:29 2010
New Revision: 208062
URL: http://svn.freebsd.org/changeset/base/208062

Log:
  MFC r207427:
  
  Fix improper pool write throughput calculation.
  
  OpenSolaris onnv revision:	9366:17553395a745
  
  PR:		kern/146108
  Obtained from:	OpenSolaris (Bug ID 6817339)
  Approved by:	pjd, delphij (mentor)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri May 14 08:56:07 2010	(r208061)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri May 14 09:00:29 2010	(r208062)
@@ -300,6 +300,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t
 	tx = dmu_tx_create_assigned(dp, txg);
 
 	dp->dp_read_overhead = 0;
+	start = gethrtime();
 	zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);
 	while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) {
 		if (!list_link_active(&ds->ds_synced_link))
@@ -310,7 +311,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t
 	}
 	DTRACE_PROBE(pool_sync__1setup);
 
-	start = gethrtime();
 	err = zio_wait(zio);
 	write_time = gethrtime() - start;
 	ASSERT(err == 0);

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:02:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D21341065670;
	Fri, 14 May 2010 09:02:31 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0E8D8FC1E;
	Fri, 14 May 2010 09:02:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E92V9o007613;
	Fri, 14 May 2010 09:02:31 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E92VlN007611;
	Fri, 14 May 2010 09:02:31 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140902.o4E92VlN007611@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:02:31 +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: r208063 -
	stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:02:31 -0000

Author: mm
Date: Fri May 14 09:02:31 2010
New Revision: 208063
URL: http://svn.freebsd.org/changeset/base/208063

Log:
  MFC r207427:
  
  Fix improper pool write throughput calculation.
  
  OpenSolaris onnv revision:      9366:17553395a745
  
  PR:		kern/146108
  Obtained from:	OpenSolaris (Bug ID 6817339)
  Approved by:	pjd, delphij (mentor)

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri May 14 09:00:29 2010	(r208062)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri May 14 09:02:31 2010	(r208063)
@@ -300,6 +300,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t
 	tx = dmu_tx_create_assigned(dp, txg);
 
 	dp->dp_read_overhead = 0;
+	start = gethrtime();
 	zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);
 	while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) {
 		if (!list_link_active(&ds->ds_synced_link))
@@ -310,7 +311,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t
 	}
 	DTRACE_PROBE(pool_sync__1setup);
 
-	start = gethrtime();
 	err = zio_wait(zio);
 	write_time = gethrtime() - start;
 	ASSERT(err == 0);

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:06:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9B16106566C;
	Fri, 14 May 2010 09:06:50 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A6A78FC28;
	Fri, 14 May 2010 09:06:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E96naW008565;
	Fri, 14 May 2010 09:06:49 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E96nWo008563;
	Fri, 14 May 2010 09:06:49 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140906.o4E96nWo008563@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:06:49 +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: r208064 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:06:50 -0000

Author: mm
Date: Fri May 14 09:06:49 2010
New Revision: 208064
URL: http://svn.freebsd.org/changeset/base/208064

Log:
  MFC r207908:
  
  Fix endianess bug in ZFS intent log (ZIL).
  
  OpenSolaris onnv revision:	8109:6147a1bdd359
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6760048)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Fri May 14 09:02:31 2010	(r208063)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Fri May 14 09:06:49 2010	(r208064)
@@ -358,14 +358,20 @@ zil_create(zilog_t *zilog)
 	blk = zh->zh_log;
 
 	/*
-	 * If we don't already have an initial log block, allocate one now.
+	 * If we don't already have an initial log block or we have one
+	 * but it's the wrong endianness then allocate one.
 	 */
-	if (BP_IS_HOLE(&blk)) {
+	if (BP_IS_HOLE(&blk) || BP_SHOULD_BYTESWAP(&blk)) {
 		tx = dmu_tx_create(zilog->zl_os);
 		(void) dmu_tx_assign(tx, TXG_WAIT);
 		dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
 		txg = dmu_tx_get_txg(tx);
 
+		if (!BP_IS_HOLE(&blk)) {
+			zio_free_blk(zilog->zl_spa, &blk, txg);
+			BP_ZERO(&blk);
+		}
+
 		error = zio_alloc_blk(zilog->zl_spa, ZIL_MIN_BLKSZ, &blk,
 		    NULL, txg);
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:09:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 062D41065674;
	Fri, 14 May 2010 09:09:09 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8F9D8FC0A;
	Fri, 14 May 2010 09:09:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E998ae009134;
	Fri, 14 May 2010 09:09:08 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E998YB009132;
	Fri, 14 May 2010 09:09:08 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140909.o4E998YB009132@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:09:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208065 -
	stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:09:09 -0000

Author: mm
Date: Fri May 14 09:09:08 2010
New Revision: 208065
URL: http://svn.freebsd.org/changeset/base/208065

Log:
  MFC r207908:
  
  Fix endianess bug in ZFS intent log (ZIL).
  
  OpenSolaris onnv revision:	8109:6147a1bdd359
  
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6760048)

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Fri May 14 09:06:49 2010	(r208064)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Fri May 14 09:09:08 2010	(r208065)
@@ -362,14 +362,20 @@ zil_create(zilog_t *zilog)
 	blk = zh->zh_log;
 
 	/*
-	 * If we don't already have an initial log block, allocate one now.
+	 * If we don't already have an initial log block or we have one
+	 * but it's the wrong endianness then allocate one.
 	 */
-	if (BP_IS_HOLE(&blk)) {
+	if (BP_IS_HOLE(&blk) || BP_SHOULD_BYTESWAP(&blk)) {
 		tx = dmu_tx_create(zilog->zl_os);
 		(void) dmu_tx_assign(tx, TXG_WAIT);
 		dsl_dataset_dirty(dmu_objset_ds(zilog->zl_os), tx);
 		txg = dmu_tx_get_txg(tx);
 
+		if (!BP_IS_HOLE(&blk)) {
+			zio_free_blk(zilog->zl_spa, &blk, txg);
+			BP_ZERO(&blk);
+		}
+
 		error = zio_alloc_blk(zilog->zl_spa, ZIL_MIN_BLKSZ, &blk,
 		    NULL, txg);
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:50:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A067E1065672;
	Fri, 14 May 2010 09:50:29 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 85D5B8FC08;
	Fri, 14 May 2010 09:50:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E9oT2g018223;
	Fri, 14 May 2010 09:50:29 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E9oTkX018222;
	Fri, 14 May 2010 09:50:29 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140950.o4E9oTkX018222@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:50:29 +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: r208066 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:50:29 -0000

Author: mm
Date: Fri May 14 09:50:28 2010
New Revision: 208066
URL: http://svn.freebsd.org/changeset/base/208066

Log:
  MFC r207909, r207910, r207911:
  
  MFC r207909:
  Fix zfs rename (may occasionally fail with dataset busy).
  OpenSolaris onnv revision:	8517:41a0783dde17
  
  MFC r207910:
  Fix possible panic with zfs destroy.
  OpenSolaris onnv revision:	8779:f164e0e90508
  
  MFC r207911:
  Fix failed assertion on destroying datasets from an older pool version.
  OpenSolaris onnv revision:	9390:887948510f80
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784757, 6784924, 6826861)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri May 14 09:09:08 2010	(r208065)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri May 14 09:50:28 2010	(r208066)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -554,6 +554,7 @@ dsl_dataset_own_obj(dsl_pool_t *dp, uint
 		return (err);
 	if (!dsl_dataset_tryown(*dsp, DS_MODE_IS_INCONSISTENT(flags), owner)) {
 		dsl_dataset_rele(*dsp, owner);
+		*dsp = NULL;
 		return (EBUSY);
 	}
 	return (0);
@@ -1267,8 +1268,7 @@ dsl_dataset_rollback_sync(void *arg1, vo
 		(void) zio_wait(zio);
 	}
 
-	ASSERT(!(ds->ds_phys->ds_flags & DS_FLAG_UNIQUE_ACCURATE) ||
-	    ds->ds_phys->ds_unique_bytes == 0);
+	ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == 0);
 
 	if (ds->ds_prev && ds->ds_prev != ds->ds_dir->dd_pool->dp_origin_snap) {
 		/* Change our contents to that of the prev snapshot */
@@ -1660,7 +1660,7 @@ dsl_dataset_destroy_sync(void *arg1, voi
 		err = traverse_dsl_dataset(ds, ds->ds_phys->ds_prev_snap_txg,
 		    ADVANCE_POST, kill_blkptr, &ka);
 		ASSERT3U(err, ==, 0);
-		ASSERT(spa_version(dp->dp_spa) < SPA_VERSION_UNIQUE_ACCURATE ||
+		ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) ||
 		    ds->ds_phys->ds_unique_bytes == 0);
 	}
 
@@ -2205,6 +2205,12 @@ dsl_dataset_rename(char *oldname, const 
 	err = dsl_dir_open(oldname, FTAG, &dd, &tail);
 	if (err)
 		return (err);
+	/*
+	 * If there are more than 2 references there may be holds
+	 * hanging around that haven't been cleared out yet.
+	 */
+	if (dmu_buf_refcount(dd->dd_dbuf) > 2)
+		txg_wait_synced(dd->dd_pool, 0);
 	if (tail == NULL) {
 		int delta = strlen(newname) - strlen(oldname);
 
@@ -2578,7 +2584,7 @@ snaplist_destroy(list_t *l, boolean_t ow
 {
 	struct promotenode *snap;
 
-	if (!list_link_active(&l->list_head))
+	if (!l || !list_link_active(&l->list_head))
 		return;
 
 	while ((snap = list_tail(l)) != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 09:57:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE8931065674;
	Fri, 14 May 2010 09:57:10 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9CB868FC13;
	Fri, 14 May 2010 09:57:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4E9vANn019755;
	Fri, 14 May 2010 09:57:10 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4E9vAmM019753;
	Fri, 14 May 2010 09:57:10 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005140957.o4E9vAmM019753@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 09:57:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208067 - stable/8/cddl/contrib/opensolaris/cmd/ztest
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 09:57:10 -0000

Author: mm
Date: Fri May 14 09:57:10 2010
New Revision: 208067
URL: http://svn.freebsd.org/changeset/base/208067

Log:
  MFC r207910:
  (cddl/contrib/opensolaris part)
  
  Fix possible panic with zfs destroy.
  OpenSolaris onnv revision:	8779:f164e0e90508
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784924)

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  stable/8/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Fri May 14 09:50:28 2010	(r208066)
+++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Fri May 14 09:57:10 2010	(r208067)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -93,6 +93,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -174,6 +175,7 @@ ztest_func_t ztest_traverse;
 ztest_func_t ztest_dsl_prop_get_set;
 ztest_func_t ztest_dmu_objset_create_destroy;
 ztest_func_t ztest_dmu_snapshot_create_destroy;
+ztest_func_t ztest_dsl_dataset_promote_busy;
 ztest_func_t ztest_spa_create_destroy;
 ztest_func_t ztest_fault_inject;
 ztest_func_t ztest_spa_rename;
@@ -208,6 +210,7 @@ ztest_info_t ztest_info[] = {
 	{ ztest_dsl_prop_get_set,		1,	&zopt_sometimes	},
 	{ ztest_dmu_objset_create_destroy,	1,	&zopt_sometimes },
 	{ ztest_dmu_snapshot_create_destroy,	1,	&zopt_sometimes },
+	{ ztest_dsl_dataset_promote_busy,	1,	&zopt_sometimes },
 	{ ztest_spa_create_destroy,		1,	&zopt_sometimes },
 	{ ztest_fault_inject,			1,	&zopt_sometimes	},
 	{ ztest_spa_rename,			1,	&zopt_rarely	},
@@ -1591,6 +1594,109 @@ ztest_traverse(ztest_args_t *za)
 }
 
 /*
+ * Verify dsl_dataset_promote handles EBUSY
+ */
+void
+ztest_dsl_dataset_promote_busy(ztest_args_t *za)
+{
+	int error;
+	objset_t *os = za->za_os;
+	objset_t *clone;
+	dsl_dataset_t *ds;
+	char snap1name[100];
+	char clone1name[100];
+	char snap2name[100];
+	char clone2name[100];
+	char snap3name[100];
+	char osname[MAXNAMELEN];
+	static uint64_t uniq = 0;
+	uint64_t curval;
+
+	curval = atomic_add_64_nv(&uniq, 5) - 5;
+
+	(void) rw_rdlock(&ztest_shared->zs_name_lock);
+
+	dmu_objset_name(os, osname);
+	(void) snprintf(snap1name, 100, "%s@s1_%llu", osname, curval++);
+	(void) snprintf(clone1name, 100, "%s/c1_%llu", osname, curval++);
+	(void) snprintf(snap2name, 100, "%s@s2_%llu", clone1name, curval++);
+	(void) snprintf(clone2name, 100, "%s/c2_%llu", osname, curval++);
+	(void) snprintf(snap3name, 100, "%s@s3_%llu", clone1name, curval++);
+
+	error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap1name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
+
+	error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
+	dmu_objset_close(clone);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap3name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
+
+	error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
+	dmu_objset_close(clone);
+
+	error = dsl_dataset_own(snap1name, 0, FTAG, &ds);
+	if (error)
+		fatal(0, "dsl_dataset_own(%s) = %d", snap1name, error);
+	error = dsl_dataset_promote(clone2name);
+	if (error != EBUSY)
+		fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
+		    error);
+	dsl_dataset_disown(ds, FTAG);
+
+	error = dmu_objset_destroy(clone2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
+
+	error = dmu_objset_destroy(snap3name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(snap2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(clone1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
+	error = dmu_objset_destroy(snap1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
+
+	(void) rw_unlock(&ztest_shared->zs_name_lock);
+}
+
+/*
  * Verify that dmu_object_{alloc,free} work as expected.
  */
 void

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 10:04:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C8E2C106564A;
	Fri, 14 May 2010 10:04:11 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ADA038FC16;
	Fri, 14 May 2010 10:04:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EA4Bfn021378;
	Fri, 14 May 2010 10:04:11 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EA4BCO021376;
	Fri, 14 May 2010 10:04:11 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005141004.o4EA4BCO021376@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 10:04:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208068 -
	stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 10:04:12 -0000

Author: mm
Date: Fri May 14 10:04:11 2010
New Revision: 208068
URL: http://svn.freebsd.org/changeset/base/208068

Log:
  MFC r207909, r207910, r207911:
  
  MFC r207909:
  Fix zfs rename (may occasionally fail with dataset busy).
  OpenSolaris onnv revision:	8517:41a0783dde17
  
  MFC r207910:
  Fix possible panic with zfs destroy.
  OpenSolaris onnv revision:	8779:f164e0e90508
  
  MFC r207911:
  Fix failed assertion on destroying datasets from an older pool version.
  OpenSolaris onnv revision:	9390:887948510f80
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784757, 6784924, 6826861)

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri May 14 09:57:10 2010	(r208067)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Fri May 14 10:04:11 2010	(r208068)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -554,6 +554,7 @@ dsl_dataset_own_obj(dsl_pool_t *dp, uint
 		return (err);
 	if (!dsl_dataset_tryown(*dsp, DS_MODE_IS_INCONSISTENT(flags), owner)) {
 		dsl_dataset_rele(*dsp, owner);
+		*dsp = NULL;
 		return (EBUSY);
 	}
 	return (0);
@@ -1267,8 +1268,7 @@ dsl_dataset_rollback_sync(void *arg1, vo
 		(void) zio_wait(zio);
 	}
 
-	ASSERT(!(ds->ds_phys->ds_flags & DS_FLAG_UNIQUE_ACCURATE) ||
-	    ds->ds_phys->ds_unique_bytes == 0);
+	ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == 0);
 
 	if (ds->ds_prev && ds->ds_prev != ds->ds_dir->dd_pool->dp_origin_snap) {
 		/* Change our contents to that of the prev snapshot */
@@ -1660,7 +1660,7 @@ dsl_dataset_destroy_sync(void *arg1, voi
 		err = traverse_dsl_dataset(ds, ds->ds_phys->ds_prev_snap_txg,
 		    ADVANCE_POST, kill_blkptr, &ka);
 		ASSERT3U(err, ==, 0);
-		ASSERT(spa_version(dp->dp_spa) < SPA_VERSION_UNIQUE_ACCURATE ||
+		ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) ||
 		    ds->ds_phys->ds_unique_bytes == 0);
 	}
 
@@ -2205,6 +2205,12 @@ dsl_dataset_rename(char *oldname, const 
 	err = dsl_dir_open(oldname, FTAG, &dd, &tail);
 	if (err)
 		return (err);
+	/*
+	 * If there are more than 2 references there may be holds
+	 * hanging around that haven't been cleared out yet.
+	 */
+	if (dmu_buf_refcount(dd->dd_dbuf) > 2)
+		txg_wait_synced(dd->dd_pool, 0);
 	if (tail == NULL) {
 		int delta = strlen(newname) - strlen(oldname);
 
@@ -2578,7 +2584,7 @@ snaplist_destroy(list_t *l, boolean_t ow
 {
 	struct promotenode *snap;
 
-	if (!list_link_active(&l->list_head))
+	if (!l || !list_link_active(&l->list_head))
 		return;
 
 	while ((snap = list_tail(l)) != NULL) {

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 10:06:21 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4593A1065676;
	Fri, 14 May 2010 10:06:21 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 33BCB8FC25;
	Fri, 14 May 2010 10:06:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EA6KmO023875;
	Fri, 14 May 2010 10:06:20 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EA6Kti023873;
	Fri, 14 May 2010 10:06:20 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005141006.o4EA6Kti023873@svn.freebsd.org>
From: Martin Matuska 
Date: Fri, 14 May 2010 10:06:20 +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: r208069 - stable/7/cddl/contrib/opensolaris/cmd/ztest
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 10:06:21 -0000

Author: mm
Date: Fri May 14 10:06:20 2010
New Revision: 208069
URL: http://svn.freebsd.org/changeset/base/208069

Log:
  MFC r207910:
  (cddl/contrib/opensolaris part)
  
  Fix possible panic with zfs destroy.
  OpenSolaris onnv revision:	8779:f164e0e90508
  
  PR:		kern/146471
  Approved by:	pjd, delphij (mentor)
  Obtained from:	OpenSolaris (Bug ID 6784924)

Modified:
  stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  stable/7/cddl/contrib/opensolaris/   (props changed)

Modified: stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Fri May 14 10:04:11 2010	(r208068)
+++ stable/7/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Fri May 14 10:06:20 2010	(r208069)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -93,6 +93,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -174,6 +175,7 @@ ztest_func_t ztest_traverse;
 ztest_func_t ztest_dsl_prop_get_set;
 ztest_func_t ztest_dmu_objset_create_destroy;
 ztest_func_t ztest_dmu_snapshot_create_destroy;
+ztest_func_t ztest_dsl_dataset_promote_busy;
 ztest_func_t ztest_spa_create_destroy;
 ztest_func_t ztest_fault_inject;
 ztest_func_t ztest_spa_rename;
@@ -208,6 +210,7 @@ ztest_info_t ztest_info[] = {
 	{ ztest_dsl_prop_get_set,		1,	&zopt_sometimes	},
 	{ ztest_dmu_objset_create_destroy,	1,	&zopt_sometimes },
 	{ ztest_dmu_snapshot_create_destroy,	1,	&zopt_sometimes },
+	{ ztest_dsl_dataset_promote_busy,	1,	&zopt_sometimes },
 	{ ztest_spa_create_destroy,		1,	&zopt_sometimes },
 	{ ztest_fault_inject,			1,	&zopt_sometimes	},
 	{ ztest_spa_rename,			1,	&zopt_rarely	},
@@ -1592,6 +1595,109 @@ ztest_traverse(ztest_args_t *za)
 }
 
 /*
+ * Verify dsl_dataset_promote handles EBUSY
+ */
+void
+ztest_dsl_dataset_promote_busy(ztest_args_t *za)
+{
+	int error;
+	objset_t *os = za->za_os;
+	objset_t *clone;
+	dsl_dataset_t *ds;
+	char snap1name[100];
+	char clone1name[100];
+	char snap2name[100];
+	char clone2name[100];
+	char snap3name[100];
+	char osname[MAXNAMELEN];
+	static uint64_t uniq = 0;
+	uint64_t curval;
+
+	curval = atomic_add_64_nv(&uniq, 5) - 5;
+
+	(void) rw_rdlock(&ztest_shared->zs_name_lock);
+
+	dmu_objset_name(os, osname);
+	(void) snprintf(snap1name, 100, "%s@s1_%llu", osname, curval++);
+	(void) snprintf(clone1name, 100, "%s/c1_%llu", osname, curval++);
+	(void) snprintf(snap2name, 100, "%s@s2_%llu", clone1name, curval++);
+	(void) snprintf(clone2name, 100, "%s/c2_%llu", osname, curval++);
+	(void) snprintf(snap3name, 100, "%s@s3_%llu", clone1name, curval++);
+
+	error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap1name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
+
+	error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
+	dmu_objset_close(clone);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
+	    FALSE);
+	if (error == ENOSPC)
+		ztest_record_enospc("dmu_take_snapshot");
+	else if (error != 0 && error != EEXIST)
+		fatal(0, "dmu_take_snapshot = %d", error);
+
+	error = dmu_objset_open(snap3name, DMU_OST_OTHER,
+	    DS_MODE_USER | DS_MODE_READONLY, &clone);
+	if (error)
+		fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
+
+	error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0,
+	    NULL, NULL);
+	if (error)
+		fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
+	dmu_objset_close(clone);
+
+	error = dsl_dataset_own(snap1name, 0, FTAG, &ds);
+	if (error)
+		fatal(0, "dsl_dataset_own(%s) = %d", snap1name, error);
+	error = dsl_dataset_promote(clone2name);
+	if (error != EBUSY)
+		fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
+		    error);
+	dsl_dataset_disown(ds, FTAG);
+
+	error = dmu_objset_destroy(clone2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
+
+	error = dmu_objset_destroy(snap3name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(snap2name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
+
+	error = dmu_objset_destroy(clone1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
+	error = dmu_objset_destroy(snap1name);
+	if (error)
+		fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
+
+	(void) rw_unlock(&ztest_shared->zs_name_lock);
+}
+
+/*
  * Verify that dmu_object_{alloc,free} work as expected.
  */
 void

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 12:34:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 825E6106566C;
	Fri, 14 May 2010 12:34:06 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 718B48FC21;
	Fri, 14 May 2010 12:34:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ECY68T056286;
	Fri, 14 May 2010 12:34:06 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ECY6XW056284;
	Fri, 14 May 2010 12:34:06 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <201005141234.o4ECY6XW056284@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 14 May 2010 12:34: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: r208070 - stable/8/usr.bin/script
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 12:34:06 -0000

Author: ed
Date: Fri May 14 12:34:06 2010
New Revision: 208070
URL: http://svn.freebsd.org/changeset/base/208070

Log:
  MFC r207453:
  
    Remove WNOHANG flag from wait3().
  
    Because script(1) now reliably terminates when the TTY is closed, it may
    be the case that the call to wait3() occurs just before the child
    process exits. This causes error codes to be ignored.
  
    Just change script(1) to use waitpid() instead of wait3(). This makes it
    more portable and prevents the need for a loop, since waitpid() only
    returns a specified process.
  
  PR:           bin/146189
  Tested by:    amdmi3@, older version

Modified:
  stable/8/usr.bin/script/script.c
Directory Properties:
  stable/8/usr.bin/script/   (props changed)

Modified: stable/8/usr.bin/script/script.c
==============================================================================
--- stable/8/usr.bin/script/script.c	Fri May 14 10:06:20 2010	(r208069)
+++ stable/8/usr.bin/script/script.c	Fri May 14 12:34:06 2010	(r208070)
@@ -219,23 +219,17 @@ usage(void)
 void
 finish(void)
 {
-	pid_t pid;
-	int die, e, status;
+	int e, status;
 
-	die = e = 0;
-	while ((pid = wait3(&status, WNOHANG, 0)) > 0)
-	        if (pid == child) {
-			die = 1;
-			if (WIFEXITED(status))
-				e = WEXITSTATUS(status);
-			else if (WIFSIGNALED(status))
-				e = WTERMSIG(status);
-			else /* can't happen */
-				e = 1;
-		}
-
-	if (die)
+	if (waitpid(child, &status, 0) == child) {
+		if (WIFEXITED(status))
+			e = WEXITSTATUS(status);
+		else if (WIFSIGNALED(status))
+			e = WTERMSIG(status);
+		else /* can't happen */
+			e = 1;
 		done(e);
+	}
 }
 
 void

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 13:42:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29E481065678;
	Fri, 14 May 2010 13:42:18 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0EEAD8FC0C;
	Fri, 14 May 2010 13:42:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EDgH5k071275;
	Fri, 14 May 2010 13:42:17 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EDgHRF071273;
	Fri, 14 May 2010 13:42:17 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201005141342.o4EDgHRF071273@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 14 May 2010 13:42:17 +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: r208071 - stable/8/usr.sbin/pmcstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 13:42:18 -0000

Author: fabient
Date: Fri May 14 13:42:17 2010
New Revision: 208071
URL: http://svn.freebsd.org/changeset/base/208071

Log:
  MFC r207755:
  Rework the calltree top view by critical callchain.
  The percentage shown is the sum of the cost for the codepath.

Modified:
  stable/8/usr.sbin/pmcstat/pmcpl_calltree.c
Directory Properties:
  stable/8/usr.sbin/pmcstat/   (props changed)

Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c	Fri May 14 12:34:06 2010	(r208070)
+++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c	Fri May 14 13:42:17 2010	(r208071)
@@ -120,8 +120,15 @@ struct pmcpl_ct_node_hash {
 struct pmcpl_ct_sample pmcpl_ct_callid;
 
 #define PMCPL_CT_MAXCOL		PMC_CALLCHAIN_DEPTH_MAX	
-#define PMCPL_CT_MAXLINE	256
-struct pmcpl_ct_node  *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL][PMCPL_CT_MAXLINE];
+#define PMCPL_CT_MAXLINE	1024	/* TODO: dynamic. */
+
+struct pmcpl_ct_line {
+	unsigned	ln_sum;
+	unsigned	ln_index;
+};
+
+struct pmcpl_ct_line	pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
+struct pmcpl_ct_node	*pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1];
 
 /*
  * All nodes indexed by function/image name are placed in a hash table.
@@ -225,28 +232,6 @@ pmcpl_ct_arc_grow(int cursize, int *maxs
 }
 
 /*
- * Compare two arc by samples value.
- */
-static int
-pmcpl_ct_arc_compare(void *thunk, const void *a, const void *b)
-{
-	const struct pmcpl_ct_arc *ct1, *ct2;
-	int pmcin = *(int *)thunk;
-
-	ct1 = (const struct pmcpl_ct_arc *) a;
-	ct2 = (const struct pmcpl_ct_arc *) b;
-
-	/* Sort in reverse order */
-	if (PMCPL_CT_SAMPLE(pmcin, &ct1->pcta_samples) <
-	    PMCPL_CT_SAMPLE(pmcin, &ct2->pcta_samples))
-		return (1);
-	if (PMCPL_CT_SAMPLE(pmcin, &ct1->pcta_samples) >
-	    PMCPL_CT_SAMPLE(pmcin, &ct2->pcta_samples))
-		return (-1);
-	return (0);
-}
-
-/*
  * Grow the instr table.
  */
 
@@ -366,9 +351,9 @@ pmcpl_ct_node_cleartag(void)
 
 static int
 pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct,
-    struct pmcpl_ct_sample *rsamples, int x, int *y, int maxy)
+    struct pmcpl_ct_sample *rsamples, int x, int *y)
 {
-	int i;
+	int i, terminal;
 
 	if (ct->pct_flags & PMCPL_PCT_TAG)
 		return 0;
@@ -382,12 +367,21 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 	pmcpl_ct_topscreen[x][*y] = ct;
 
 	/*
-	 * This is a terminal node
+	 * Check if this is a terminal node.
+	 * We need to check that some samples exist
+	 * for at least one arc for that PMC.
 	 */
-	if (ct->pct_narc == 0) {
+	terminal = 1;
+	for (i = 0; i < ct->pct_narc; i++)
+		if (PMCPL_CT_SAMPLE(pmcin,
+		    &ct->pct_arc[i].pcta_samples) != 0) {
+			terminal = 0;
+			break;
+		}
+
+	if (ct->pct_narc == 0 || terminal) {
 		pmcpl_ct_topscreen[x+1][*y] = NULL;
-		if (*y >= PMCPL_CT_MAXLINE ||
-		    *y >= maxy)
+		if (*y >= PMCPL_CT_MAXLINE)
 			return 1;
 		*y = *y + 1;
 		for (i=0; i < x; i++)
@@ -396,14 +390,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 		return 0;
 	}
 
-	/*
-	 * Quicksort the arcs.
-	 */
-	qsort_r(ct->pct_arc, ct->pct_narc, sizeof(struct pmcpl_ct_arc),
-	    &pmcin, pmcpl_ct_arc_compare);
-
 	for (i = 0; i < ct->pct_narc; i++) {
-		/* Skip this arc if there is no sample at all. */
 		if (PMCPL_CT_SAMPLE(pmcin,
 		    &ct->pct_arc[i].pcta_samples) == 0)
 			continue;
@@ -411,7 +398,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 		    &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) {
 			if (pmcpl_ct_node_dumptop(pmcin,
 			        ct->pct_arc[i].pcta_child,
-			        rsamples, x+1, y, maxy))
+			        rsamples, x+1, y))
 				return 1;
 		}
 	}
@@ -420,12 +407,36 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 }
 
 /*
+ * Compare two top line by sum.
+ */
+static int
+pmcpl_ct_line_compare(const void *a, const void *b)
+{
+	const struct pmcpl_ct_line *ct1, *ct2;
+
+	ct1 = (const struct pmcpl_ct_line *) a;
+	ct2 = (const struct pmcpl_ct_line *) b;
+
+	/* Sort in reverse order */
+	if (ct1->ln_sum < ct2->ln_sum)
+		return (1);
+	if (ct1->ln_sum > ct2->ln_sum)
+		return (-1);
+	return (0);
+}
+
+/*
  * Format and display given PMC index.
  */
 
 static void
 pmcpl_ct_node_printtop(struct pmcpl_ct_sample *rsamples, int pmcin, int maxy)
 {
+#undef	TS
+#undef	TSI
+#define	TS(x, y)	(pmcpl_ct_topscreen[x][y])
+#define	TSI(x, y)	(pmcpl_ct_topscreen[x][pmcpl_ct_topmax[y].ln_index])
+
 	int v_attrs, ns_len, vs_len, is_len, width, indentwidth, x, y;
 	float v;
 	char ns[30], vs[10], is[20];
@@ -433,33 +444,60 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 	struct pmcstat_symbol *sym;
 	const char *space = " ";
 
+	/*
+	 * Sort by line cost.
+	 */
+	for (y = 0; ; y++) {
+		ct = TS(1, y);
+		if (ct == NULL)
+			break;
+
+		pmcpl_ct_topmax[y].ln_sum = 0;
+		pmcpl_ct_topmax[y].ln_index = y;
+		for (x = 1; TS(x, y) != NULL; x++) {
+			pmcpl_ct_topmax[y].ln_sum +=
+			    PMCPL_CT_SAMPLE(pmcin, &TS(x, y)->pct_samples);
+		}
+	}
+	qsort(pmcpl_ct_topmax, y, sizeof(pmcpl_ct_topmax[0]),
+	    pmcpl_ct_line_compare);
+	pmcpl_ct_topmax[y].ln_index = y;
+
 	for (y = 0; y < maxy; y++) {
-		/* Output image. */
-		ct = pmcpl_ct_topscreen[0][y];
-		snprintf(is, sizeof(is), "%-10.10s",
-		    pmcstat_string_unintern(ct->pct_image->pi_name));
-		PMCSTAT_PRINTW("%s ", is);
-		width = indentwidth = 11;
+		ct = TSI(1, y);
+		if (ct == NULL)
+			break;
 
-		for (x = 0; pmcpl_ct_topscreen[x][y] !=NULL; x++) {
+		if (y > 0)
+			PMCSTAT_PRINTW("\n");
 
-			ct = pmcpl_ct_topscreen[x][y];
+		/* Output sum. */
+		v = pmcpl_ct_topmax[y].ln_sum * 100.0 /
+		    rsamples->sb[pmcin];
+		snprintf(vs, sizeof(vs), "%.1f", v);
+		v_attrs = PMCSTAT_ATTRPERCENT(v);
+		PMCSTAT_ATTRON(v_attrs);
+		PMCSTAT_PRINTW("%5.5s ", vs);
+		PMCSTAT_ATTROFF(v_attrs);
+
+		width = indentwidth = 5 + 1;
+
+		for (x = 1; (ct = TSI(x, y)) != NULL; x++) {
 
-			ns[0] = '\0'; ns_len = 0;
 			vs[0] = '\0'; vs_len = 0;
 			is[0] = '\0'; is_len = 0;
 
 			/* Format value. */
 			v = PMCPL_CT_SAMPLEP(pmcin, &ct->pct_samples);
 			if (v > pmcstat_threshold)
-				vs_len  = snprintf(vs, sizeof(vs), "(%.1f%%)", v);
+				vs_len  = snprintf(vs, sizeof(vs),
+				    "(%.1f%%)", v);
 			v_attrs = PMCSTAT_ATTRPERCENT(v);
 
 			if (pmcstat_skiplink && v <= pmcstat_threshold) {
-				PMCSTAT_PRINTW(". ");
-				width += 2;
-				continue;
-			}
+				strlcpy(ns, ".", sizeof(ns));
+				ns_len = 1;
+			} else {
 			sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func);
 			if (sym != NULL) {
 				ns_len = snprintf(ns, sizeof(ns), "%s",
@@ -469,12 +507,14 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 				    (void *)ct->pct_func);
 
 			/* Format image. */
-			if (x > 0 && pmcpl_ct_topscreen[x-1][y]->pct_image != ct->pct_image)
+			if (x == 1 ||
+			    TSI(x-1, y)->pct_image != ct->pct_image)
 				is_len = snprintf(is, sizeof(is), "@%s",
 				    pmcstat_string_unintern(ct->pct_image->pi_name));
 
 			/* Check for line wrap. */
 			width += ns_len + is_len + vs_len + 1;
+			}
 			if (width >= pmcstat_displaywidth) {
 				maxy--;
 				if (y >= maxy)
@@ -487,7 +527,6 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 			PMCSTAT_PRINTW("%s%s%s ", ns, is, vs);
 			PMCSTAT_ATTROFF(v_attrs);
 		}
-		PMCSTAT_PRINTW("\n");
 	}
 }
 
@@ -498,46 +537,25 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 void
 pmcpl_ct_topdisplay(void)
 {
-	int i, x, y, pmcin;
+	int y;
 	struct pmcpl_ct_sample r, *rsamples;
 
 	rsamples = &r;
 	pmcpl_ct_samples_root(rsamples);
 
-	PMCSTAT_PRINTW("%-10.10s %s\n", "IMAGE", "CALLTREE");
+	pmcpl_ct_node_cleartag();
 
-	for (pmcin = 0; pmcin < pmcstat_npmcs; pmcin++) {
-		/* Filter PMCs. */
-		if (pmcstat_pmcinfilter != pmcin)
-			continue;
+	PMCSTAT_PRINTW("%5.5s %s\n", "%SAMP", "CALLTREE");
 
-		pmcpl_ct_node_cleartag();
+	y = 0;
+	if (pmcpl_ct_node_dumptop(pmcstat_pmcinfilter,
+	    pmcpl_ct_root, rsamples, 0, &y))
+		PMCSTAT_PRINTW("...\n");
+	pmcpl_ct_topscreen[1][y] = NULL;
 
-		/* Quicksort the arcs. */
-		qsort_r(pmcpl_ct_root->pct_arc,
-		    pmcpl_ct_root->pct_narc,
-		    sizeof(struct pmcpl_ct_arc),
-		    &pmcin, pmcpl_ct_arc_compare);
-
-		x = y = 0;
-		for (i = 0; i < pmcpl_ct_root->pct_narc; i++) {
-			/* Skip this arc if there is no sample at all. */
-			if (PMCPL_CT_SAMPLE(pmcin,
-			    &pmcpl_ct_root->pct_arc[i].pcta_samples) == 0)
-				continue;
-			if (PMCPL_CT_SAMPLEP(pmcin,
-			    &pmcpl_ct_root->pct_arc[i].pcta_samples) <=
-			    pmcstat_threshold)
-				continue;
-			if (pmcpl_ct_node_dumptop(pmcin,
-			        pmcpl_ct_root->pct_arc[i].pcta_child,
-			        rsamples, x, &y, pmcstat_displayheight - 2)) {
-				break;
-			}
-		}
+	pmcpl_ct_node_printtop(rsamples,
+	    pmcstat_pmcinfilter, pmcstat_displayheight - 2);
 
-		pmcpl_ct_node_printtop(rsamples, pmcin, y);
-	}
 	pmcpl_ct_samples_free(rsamples);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 13:43:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E3BC41065674;
	Fri, 14 May 2010 13:43:23 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D20708FC15;
	Fri, 14 May 2010 13:43:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EDhNSu071556;
	Fri, 14 May 2010 13:43:23 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EDhN1Q071554;
	Fri, 14 May 2010 13:43:23 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201005141343.o4EDhN1Q071554@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 14 May 2010 13:43:23 +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: r208072 - stable/7/usr.sbin/pmcstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 13:43:24 -0000

Author: fabient
Date: Fri May 14 13:43:23 2010
New Revision: 208072
URL: http://svn.freebsd.org/changeset/base/208072

Log:
  MFC r207755:
  Rework the calltree top view by critical callchain.
  The percentage shown is the sum of the cost for the codepath.

Modified:
  stable/7/usr.sbin/pmcstat/pmcpl_calltree.c
Directory Properties:
  stable/7/usr.sbin/pmcstat/   (props changed)

Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- stable/7/usr.sbin/pmcstat/pmcpl_calltree.c	Fri May 14 13:42:17 2010	(r208071)
+++ stable/7/usr.sbin/pmcstat/pmcpl_calltree.c	Fri May 14 13:43:23 2010	(r208072)
@@ -120,8 +120,15 @@ struct pmcpl_ct_node_hash {
 struct pmcpl_ct_sample pmcpl_ct_callid;
 
 #define PMCPL_CT_MAXCOL		PMC_CALLCHAIN_DEPTH_MAX	
-#define PMCPL_CT_MAXLINE	256
-struct pmcpl_ct_node  *pmcpl_ct_topscreen[PMCPL_CT_MAXCOL][PMCPL_CT_MAXLINE];
+#define PMCPL_CT_MAXLINE	1024	/* TODO: dynamic. */
+
+struct pmcpl_ct_line {
+	unsigned	ln_sum;
+	unsigned	ln_index;
+};
+
+struct pmcpl_ct_line	pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
+struct pmcpl_ct_node	*pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1];
 
 /*
  * All nodes indexed by function/image name are placed in a hash table.
@@ -225,28 +232,6 @@ pmcpl_ct_arc_grow(int cursize, int *maxs
 }
 
 /*
- * Compare two arc by samples value.
- */
-static int
-pmcpl_ct_arc_compare(void *thunk, const void *a, const void *b)
-{
-	const struct pmcpl_ct_arc *ct1, *ct2;
-	int pmcin = *(int *)thunk;
-
-	ct1 = (const struct pmcpl_ct_arc *) a;
-	ct2 = (const struct pmcpl_ct_arc *) b;
-
-	/* Sort in reverse order */
-	if (PMCPL_CT_SAMPLE(pmcin, &ct1->pcta_samples) <
-	    PMCPL_CT_SAMPLE(pmcin, &ct2->pcta_samples))
-		return (1);
-	if (PMCPL_CT_SAMPLE(pmcin, &ct1->pcta_samples) >
-	    PMCPL_CT_SAMPLE(pmcin, &ct2->pcta_samples))
-		return (-1);
-	return (0);
-}
-
-/*
  * Grow the instr table.
  */
 
@@ -366,9 +351,9 @@ pmcpl_ct_node_cleartag(void)
 
 static int
 pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct,
-    struct pmcpl_ct_sample *rsamples, int x, int *y, int maxy)
+    struct pmcpl_ct_sample *rsamples, int x, int *y)
 {
-	int i;
+	int i, terminal;
 
 	if (ct->pct_flags & PMCPL_PCT_TAG)
 		return 0;
@@ -382,12 +367,21 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 	pmcpl_ct_topscreen[x][*y] = ct;
 
 	/*
-	 * This is a terminal node
+	 * Check if this is a terminal node.
+	 * We need to check that some samples exist
+	 * for at least one arc for that PMC.
 	 */
-	if (ct->pct_narc == 0) {
+	terminal = 1;
+	for (i = 0; i < ct->pct_narc; i++)
+		if (PMCPL_CT_SAMPLE(pmcin,
+		    &ct->pct_arc[i].pcta_samples) != 0) {
+			terminal = 0;
+			break;
+		}
+
+	if (ct->pct_narc == 0 || terminal) {
 		pmcpl_ct_topscreen[x+1][*y] = NULL;
-		if (*y >= PMCPL_CT_MAXLINE ||
-		    *y >= maxy)
+		if (*y >= PMCPL_CT_MAXLINE)
 			return 1;
 		*y = *y + 1;
 		for (i=0; i < x; i++)
@@ -396,14 +390,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 		return 0;
 	}
 
-	/*
-	 * Quicksort the arcs.
-	 */
-	qsort_r(ct->pct_arc, ct->pct_narc, sizeof(struct pmcpl_ct_arc),
-	    &pmcin, pmcpl_ct_arc_compare);
-
 	for (i = 0; i < ct->pct_narc; i++) {
-		/* Skip this arc if there is no sample at all. */
 		if (PMCPL_CT_SAMPLE(pmcin,
 		    &ct->pct_arc[i].pcta_samples) == 0)
 			continue;
@@ -411,7 +398,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 		    &ct->pct_arc[i].pcta_samples) > pmcstat_threshold) {
 			if (pmcpl_ct_node_dumptop(pmcin,
 			        ct->pct_arc[i].pcta_child,
-			        rsamples, x+1, y, maxy))
+			        rsamples, x+1, y))
 				return 1;
 		}
 	}
@@ -420,12 +407,36 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 }
 
 /*
+ * Compare two top line by sum.
+ */
+static int
+pmcpl_ct_line_compare(const void *a, const void *b)
+{
+	const struct pmcpl_ct_line *ct1, *ct2;
+
+	ct1 = (const struct pmcpl_ct_line *) a;
+	ct2 = (const struct pmcpl_ct_line *) b;
+
+	/* Sort in reverse order */
+	if (ct1->ln_sum < ct2->ln_sum)
+		return (1);
+	if (ct1->ln_sum > ct2->ln_sum)
+		return (-1);
+	return (0);
+}
+
+/*
  * Format and display given PMC index.
  */
 
 static void
 pmcpl_ct_node_printtop(struct pmcpl_ct_sample *rsamples, int pmcin, int maxy)
 {
+#undef	TS
+#undef	TSI
+#define	TS(x, y)	(pmcpl_ct_topscreen[x][y])
+#define	TSI(x, y)	(pmcpl_ct_topscreen[x][pmcpl_ct_topmax[y].ln_index])
+
 	int v_attrs, ns_len, vs_len, is_len, width, indentwidth, x, y;
 	float v;
 	char ns[30], vs[10], is[20];
@@ -433,33 +444,60 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 	struct pmcstat_symbol *sym;
 	const char *space = " ";
 
+	/*
+	 * Sort by line cost.
+	 */
+	for (y = 0; ; y++) {
+		ct = TS(1, y);
+		if (ct == NULL)
+			break;
+
+		pmcpl_ct_topmax[y].ln_sum = 0;
+		pmcpl_ct_topmax[y].ln_index = y;
+		for (x = 1; TS(x, y) != NULL; x++) {
+			pmcpl_ct_topmax[y].ln_sum +=
+			    PMCPL_CT_SAMPLE(pmcin, &TS(x, y)->pct_samples);
+		}
+	}
+	qsort(pmcpl_ct_topmax, y, sizeof(pmcpl_ct_topmax[0]),
+	    pmcpl_ct_line_compare);
+	pmcpl_ct_topmax[y].ln_index = y;
+
 	for (y = 0; y < maxy; y++) {
-		/* Output image. */
-		ct = pmcpl_ct_topscreen[0][y];
-		snprintf(is, sizeof(is), "%-10.10s",
-		    pmcstat_string_unintern(ct->pct_image->pi_name));
-		PMCSTAT_PRINTW("%s ", is);
-		width = indentwidth = 11;
+		ct = TSI(1, y);
+		if (ct == NULL)
+			break;
 
-		for (x = 0; pmcpl_ct_topscreen[x][y] !=NULL; x++) {
+		if (y > 0)
+			PMCSTAT_PRINTW("\n");
 
-			ct = pmcpl_ct_topscreen[x][y];
+		/* Output sum. */
+		v = pmcpl_ct_topmax[y].ln_sum * 100.0 /
+		    rsamples->sb[pmcin];
+		snprintf(vs, sizeof(vs), "%.1f", v);
+		v_attrs = PMCSTAT_ATTRPERCENT(v);
+		PMCSTAT_ATTRON(v_attrs);
+		PMCSTAT_PRINTW("%5.5s ", vs);
+		PMCSTAT_ATTROFF(v_attrs);
+
+		width = indentwidth = 5 + 1;
+
+		for (x = 1; (ct = TSI(x, y)) != NULL; x++) {
 
-			ns[0] = '\0'; ns_len = 0;
 			vs[0] = '\0'; vs_len = 0;
 			is[0] = '\0'; is_len = 0;
 
 			/* Format value. */
 			v = PMCPL_CT_SAMPLEP(pmcin, &ct->pct_samples);
 			if (v > pmcstat_threshold)
-				vs_len  = snprintf(vs, sizeof(vs), "(%.1f%%)", v);
+				vs_len  = snprintf(vs, sizeof(vs),
+				    "(%.1f%%)", v);
 			v_attrs = PMCSTAT_ATTRPERCENT(v);
 
 			if (pmcstat_skiplink && v <= pmcstat_threshold) {
-				PMCSTAT_PRINTW(". ");
-				width += 2;
-				continue;
-			}
+				strlcpy(ns, ".", sizeof(ns));
+				ns_len = 1;
+			} else {
 			sym = pmcstat_symbol_search(ct->pct_image, ct->pct_func);
 			if (sym != NULL) {
 				ns_len = snprintf(ns, sizeof(ns), "%s",
@@ -469,12 +507,14 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 				    (void *)ct->pct_func);
 
 			/* Format image. */
-			if (x > 0 && pmcpl_ct_topscreen[x-1][y]->pct_image != ct->pct_image)
+			if (x == 1 ||
+			    TSI(x-1, y)->pct_image != ct->pct_image)
 				is_len = snprintf(is, sizeof(is), "@%s",
 				    pmcstat_string_unintern(ct->pct_image->pi_name));
 
 			/* Check for line wrap. */
 			width += ns_len + is_len + vs_len + 1;
+			}
 			if (width >= pmcstat_displaywidth) {
 				maxy--;
 				if (y >= maxy)
@@ -487,7 +527,6 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 			PMCSTAT_PRINTW("%s%s%s ", ns, is, vs);
 			PMCSTAT_ATTROFF(v_attrs);
 		}
-		PMCSTAT_PRINTW("\n");
 	}
 }
 
@@ -498,46 +537,25 @@ pmcpl_ct_node_printtop(struct pmcpl_ct_s
 void
 pmcpl_ct_topdisplay(void)
 {
-	int i, x, y, pmcin;
+	int y;
 	struct pmcpl_ct_sample r, *rsamples;
 
 	rsamples = &r;
 	pmcpl_ct_samples_root(rsamples);
 
-	PMCSTAT_PRINTW("%-10.10s %s\n", "IMAGE", "CALLTREE");
+	pmcpl_ct_node_cleartag();
 
-	for (pmcin = 0; pmcin < pmcstat_npmcs; pmcin++) {
-		/* Filter PMCs. */
-		if (pmcstat_pmcinfilter != pmcin)
-			continue;
+	PMCSTAT_PRINTW("%5.5s %s\n", "%SAMP", "CALLTREE");
 
-		pmcpl_ct_node_cleartag();
+	y = 0;
+	if (pmcpl_ct_node_dumptop(pmcstat_pmcinfilter,
+	    pmcpl_ct_root, rsamples, 0, &y))
+		PMCSTAT_PRINTW("...\n");
+	pmcpl_ct_topscreen[1][y] = NULL;
 
-		/* Quicksort the arcs. */
-		qsort_r(pmcpl_ct_root->pct_arc,
-		    pmcpl_ct_root->pct_narc,
-		    sizeof(struct pmcpl_ct_arc),
-		    &pmcin, pmcpl_ct_arc_compare);
-
-		x = y = 0;
-		for (i = 0; i < pmcpl_ct_root->pct_narc; i++) {
-			/* Skip this arc if there is no sample at all. */
-			if (PMCPL_CT_SAMPLE(pmcin,
-			    &pmcpl_ct_root->pct_arc[i].pcta_samples) == 0)
-				continue;
-			if (PMCPL_CT_SAMPLEP(pmcin,
-			    &pmcpl_ct_root->pct_arc[i].pcta_samples) <=
-			    pmcstat_threshold)
-				continue;
-			if (pmcpl_ct_node_dumptop(pmcin,
-			        pmcpl_ct_root->pct_arc[i].pcta_child,
-			        rsamples, x, &y, pmcstat_displayheight - 2)) {
-				break;
-			}
-		}
+	pmcpl_ct_node_printtop(rsamples,
+	    pmcstat_pmcinfilter, pmcstat_displayheight - 2);
 
-		pmcpl_ct_node_printtop(rsamples, pmcin, y);
-	}
 	pmcpl_ct_samples_free(rsamples);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 13:48:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47C2A106567F;
	Fri, 14 May 2010 13:48:12 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F3148FC2B;
	Fri, 14 May 2010 13:48:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EDmCu4072662;
	Fri, 14 May 2010 13:48:12 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EDmCek072660;
	Fri, 14 May 2010 13:48:12 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201005141348.o4EDmCek072660@svn.freebsd.org>
From: Fabien Thomas 
Date: Fri, 14 May 2010 13:48:12 +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: r208073 - stable/8/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 13:48:12 -0000

Author: fabient
Date: Fri May 14 13:48:11 2010
New Revision: 208073
URL: http://svn.freebsd.org/changeset/base/208073

Log:
  MFC r207761 partially:
   Add a fastpath to allocate from packet zone when using m_getjcl.
   This will add support for packet zone for at least igb and ixgbe.

Modified:
  stable/8/sys/sys/mbuf.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/sys/mbuf.h
==============================================================================
--- stable/8/sys/sys/mbuf.h	Fri May 14 13:43:23 2010	(r208072)
+++ stable/8/sys/sys/mbuf.h	Fri May 14 13:48:11 2010	(r208073)
@@ -523,6 +523,9 @@ m_getjcl(int how, short type, int flags,
 	struct mbuf *m, *n;
 	uma_zone_t zone;
 
+	if (size == MCLBYTES)
+		return m_getcl(how, type, flags);
+
 	args.flags = flags;
 	args.type = type;
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 14:26:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7295B1065670;
	Fri, 14 May 2010 14:26:49 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 622318FC13;
	Fri, 14 May 2010 14:26:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EEQnCa081232;
	Fri, 14 May 2010 14:26:49 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EEQnRt081229;
	Fri, 14 May 2010 14:26:49 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005141426.o4EEQnRt081229@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 14 May 2010 14:26:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208074 - head/sbin/fsirand
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 14:26:49 -0000

Author: uqs
Date: Fri May 14 14:26:49 2010
New Revision: 208074
URL: http://svn.freebsd.org/changeset/base/208074

Log:
  fsirand(8): make WARNS=3 clean
  
  - Drop bogus quad_t cast for di_gen, it is a 32bit type
  - Print di_gen with leading zeros, to get consistent output
    Before this change, amd64 would print:
  
    ino 18 gen 616ca2bd
    ino 19 gen ffffffff95c2a3ff
    ino 20 gen 25c3a3d5
    ino 21 gen 8dc1472
    ino 22 gen 3797056b
    ino 23 gen 1d47853a
    ino 24 gen ffffffff82d26995
  
    After the change
  
    ino 18 gen 616ca2bd
    ino 19 gen 95c2a3ff
    ino 20 gen 25c3a3d5
    ino 21 gen 08dc1472
    ino 22 gen 3797056b
    ino 23 gen 1d47853a
    ino 24 gen 82d26995
  
  PR:		bin/139994 (sort of)
  Reviewed by:	mckusick

Modified:
  head/sbin/fsirand/Makefile
  head/sbin/fsirand/fsirand.c

Modified: head/sbin/fsirand/Makefile
==============================================================================
--- head/sbin/fsirand/Makefile	Fri May 14 13:48:11 2010	(r208073)
+++ head/sbin/fsirand/Makefile	Fri May 14 14:26:49 2010	(r208074)
@@ -2,8 +2,8 @@
 # $FreeBSD$
 
 PROG=	fsirand
-WARNS?=	0
 MAN=	fsirand.8
+WARNS?=	3
 DPADD=	${LIBUTIL}
 LDADD=	-lutil
 

Modified: head/sbin/fsirand/fsirand.c
==============================================================================
--- head/sbin/fsirand/fsirand.c	Fri May 14 13:48:11 2010	(r208073)
+++ head/sbin/fsirand/fsirand.c	Fri May 14 14:26:49 2010	(r208074)
@@ -47,6 +47,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -112,7 +113,7 @@ fsirand(char *device)
 	struct ufs1_dinode *dp1;
 	struct ufs2_dinode *dp2;
 	caddr_t inodebuf;
-	size_t ibufsize;
+	ssize_t ibufsize;
 	struct fs *sblock;
 	ino_t inumber, maxino;
 	ufs2_daddr_t sblockloc, dblk;
@@ -135,14 +136,17 @@ fsirand(char *device)
 			bsize = label.d_secsize;
 	}
 
+	dp1 = NULL;
+	dp2 = NULL;
+
 	/* Read in master superblock */
 	(void)memset(&sbuf, 0, sizeof(sbuf));
 	sblock = (struct fs *)&sbuf;
 	for (i = 0; sblock_try[i] != -1; i++) {
 		sblockloc = sblock_try[i];
 		if (lseek(devfd, sblockloc, SEEK_SET) == -1) {
-			warn("can't seek to superblock (%qd) on %s",
-			    sblockloc, device);
+			warn("can't seek to superblock (%jd) on %s",
+			    (intmax_t)sblockloc, device);
 			return (1);
 		}
 		if ((n = read(devfd, (void *)sblock, SBLOCKSIZE))!=SBLOCKSIZE) {
@@ -154,7 +158,7 @@ fsirand(char *device)
 		     (sblock->fs_magic == FS_UFS2_MAGIC &&
 		      sblock->fs_sblockloc == sblock_try[i])) &&
 		    sblock->fs_bsize <= MAXBSIZE &&
-		    sblock->fs_bsize >= sizeof(struct fs))
+		    sblock->fs_bsize >= (ssize_t)sizeof(struct fs))
 			break;
 	}
 	if (sblock_try[i] == -1) {
@@ -175,10 +179,10 @@ fsirand(char *device)
 
 	/* Make sure backup superblocks are sane. */
 	sblock = (struct fs *)&sbuftmp;
-	for (cg = 0; cg < sblock->fs_ncg; cg++) {
+	for (cg = 0; cg < (int)sblock->fs_ncg; cg++) {
 		dblk = fsbtodb(sblock, cgsblock(sblock, cg));
 		if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) {
-			warn("can't seek to %qd", (off_t)dblk * bsize);
+			warn("can't seek to %jd", (intmax_t)dblk * bsize);
 			return (1);
 		} else if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) != SBLOCKSIZE) {
 			warn("can't read backup superblock %d on %s: %s",
@@ -211,7 +215,7 @@ fsirand(char *device)
 	if (printonly && (sblock->fs_id[0] || sblock->fs_id[1])) {
 		if (sblock->fs_id[0])
 			(void)printf("%s was randomized on %s", device,
-			    ctime((const time_t *)&(sblock->fs_id[0])));
+			    ctime((void *)&(sblock->fs_id[0])));
 		(void)printf("fsid: %x %x\n", sblock->fs_id[0],
 			    sblock->fs_id[1]);
 	}
@@ -223,8 +227,8 @@ fsirand(char *device)
 		sblock->fs_id[1] = random();
 
 		if (lseek(devfd, sblockloc, SEEK_SET) == -1) {
-			warn("can't seek to superblock (%qd) on %s", sblockloc,
-			    device);
+			warn("can't seek to superblock (%jd) on %s",
+			    (intmax_t)sblockloc, device);
 			return (1);
 		}
 		if ((n = write(devfd, (void *)sblock, SBLOCKSIZE)) !=
@@ -236,12 +240,13 @@ fsirand(char *device)
 	}
 
 	/* For each cylinder group, randomize inodes and update backup sblock */
-	for (cg = 0, inumber = 0; cg < sblock->fs_ncg; cg++) {
+	for (cg = 0, inumber = 0; cg < (int)sblock->fs_ncg; cg++) {
 		/* Update superblock if appropriate */
 		if (!printonly) {
 			dblk = fsbtodb(sblock, cgsblock(sblock, cg));
 			if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) {
-				warn("can't seek to %qd", (off_t)dblk * bsize);
+				warn("can't seek to %jd",
+				    (intmax_t)dblk * bsize);
 				return (1);
 			} else if ((n = write(devfd, (void *)sblock,
 			    SBLOCKSIZE)) != SBLOCKSIZE) {
@@ -255,7 +260,7 @@ fsirand(char *device)
 		/* Read in inodes, then print or randomize generation nums */
 		dblk = fsbtodb(sblock, ino_to_fsba(sblock, inumber));
 		if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) {
-			warn("can't seek to %qd", (off_t)dblk * bsize);
+			warn("can't seek to %jd", (intmax_t)dblk * bsize);
 			return (1);
 		} else if ((n = read(devfd, inodebuf, ibufsize)) != ibufsize) {
 			warnx("can't read inodes: %s",
@@ -263,17 +268,17 @@ fsirand(char *device)
 			return (1);
 		}
 
-		for (n = 0; n < sblock->fs_ipg; n++, inumber++) {
+		for (n = 0; n < (int)sblock->fs_ipg; n++, inumber++) {
 			if (sblock->fs_magic == FS_UFS1_MAGIC)
 				dp1 = &((struct ufs1_dinode *)inodebuf)[n];
 			else
 				dp2 = &((struct ufs2_dinode *)inodebuf)[n];
 			if (inumber >= ROOTINO) {
 				if (printonly)
-					(void)printf("ino %d gen %qx\n",
+					(void)printf("ino %d gen %08x\n",
 					    inumber,
 					    sblock->fs_magic == FS_UFS1_MAGIC ?
-					    (quad_t)dp1->di_gen : dp2->di_gen);
+					    dp1->di_gen : dp2->di_gen);
 				else if (sblock->fs_magic == FS_UFS1_MAGIC) 
 					dp1->di_gen = random(); 
 				else
@@ -284,8 +289,8 @@ fsirand(char *device)
 		/* Write out modified inodes */
 		if (!printonly) {
 			if (lseek(devfd, (off_t)dblk * bsize, SEEK_SET) < 0) {
-				warn("can't seek to %qd",
-				    (off_t)dblk * bsize);
+				warn("can't seek to %jd",
+				    (intmax_t)dblk * bsize);
 				return (1);
 			} else if ((n = write(devfd, inodebuf, ibufsize)) !=
 				 ibufsize) {

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 14:26:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9CED9106577A;
	Fri, 14 May 2010 14:26:57 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 16A418FC1D;
	Fri, 14 May 2010 14:26:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EEQuqa081275;
	Fri, 14 May 2010 14:26:56 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EEQu7B081269;
	Fri, 14 May 2010 14:26:56 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201005141426.o4EEQu7B081269@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Fri, 14 May 2010 14:26: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: r208075 - in head/usr.sbin/apmd: . contrib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 14:26:58 -0000

Author: uqs
Date: Fri May 14 14:26:56 2010
New Revision: 208075
URL: http://svn.freebsd.org/changeset/base/208075

Log:
  Sync apmd(8) with DragonflyBSD, bringing WARNS to 3
  
  Reviewed by:	ed (partial, long time ago)

Modified:
  head/usr.sbin/apmd/Makefile
  head/usr.sbin/apmd/apmd.8
  head/usr.sbin/apmd/apmd.c
  head/usr.sbin/apmd/apmd.h
  head/usr.sbin/apmd/apmdlex.l
  head/usr.sbin/apmd/contrib/pccardq.c

Modified: head/usr.sbin/apmd/Makefile
==============================================================================
--- head/usr.sbin/apmd/Makefile	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/Makefile	Fri May 14 14:26:56 2010	(r208075)
@@ -5,7 +5,7 @@ MAN=	apmd.8
 MANSUBDIR= /i386
 SRCS=	apmd.c apmdlex.l apmdparse.y y.tab.h
 
-WARNS?=	0
+WARNS?=	3
 
 DPADD=	${LIBL}
 LDADD=	-ll

Modified: head/usr.sbin/apmd/apmd.8
==============================================================================
--- head/usr.sbin/apmd/apmd.8	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/apmd.8	Fri May 14 14:26:56 2010	(r208075)
@@ -99,7 +99,9 @@ monitored events.
 .Pp
 If the
 .Nm
-process receives a SIGHUP, it will reread its configuration file and
+process receives a
+.Dv SIGHUP ,
+it will reread its configuration file and
 notify the APM device driver of any changes to its configuration.
 .Pp
 The
@@ -166,7 +168,7 @@ The apm_event keyword
 .Bd -ragged -offset indent
 .Ql apm_event
 is the keyword which indicates the start of configuration for
-each events.
+each event.
 .Ed
 .It
 APM events

Modified: head/usr.sbin/apmd/apmd.c
==============================================================================
--- head/usr.sbin/apmd/apmd.c	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/apmd.c	Fri May 14 14:26:56 2010	(r208075)
@@ -52,8 +52,6 @@ static const char rcsid[] =
 
 #include "apmd.h"
 
-extern int	yyparse(void);
-
 int		debug_level = 0;
 int		verbose = 0;
 int		soft_power_state_change = 0;
@@ -116,14 +114,14 @@ event_cmd_exec_act(void *this)
 
 	switch ((pid = fork())) {
 	case -1:
-		(void) warn("cannot fork");
+		warn("cannot fork");
 		goto out;
 	case 0:
 		/* child process */
 		signal(SIGHUP, SIG_DFL);
 		signal(SIGCHLD, SIG_DFL);
 		signal(SIGTERM, SIG_DFL);
-		execl(_PATH_BSHELL, "sh", "-c", p->line, (char *)NULL);
+		execl(_PATH_BSHELL, "sh", "-c", p->line, NULL);
 		_exit(127);
 	default:
 		/* parent process */
@@ -170,7 +168,7 @@ struct event_cmd_op event_cmd_exec_ops =
  * reject commad
  */
 int
-event_cmd_reject_act(void *this)
+event_cmd_reject_act(void *this __unused)
 {
 	int rc = -1;
 
@@ -200,7 +198,7 @@ clone_event_cmd_list(struct event_cmd *p
 	for ( ;p; p = p->next) {
 		assert(p->op->clone);
 		if ((q->next = p->op->clone(p)) == NULL)
-			(void) err(1, "out of memory");
+			err(1, "out of memory");
 		q = q->next;
 	}
 	q->next = NULL;
@@ -238,7 +236,7 @@ register_battery_handlers(
 		struct battery_watch_event *we;
 		
 		if ((we = malloc(sizeof(struct battery_watch_event))) == NULL)
-			(void) err(1, "out of memory");
+			err(1, "out of memory");
 
 		we->next = battery_watch_list; /* starts at NULL */
 		battery_watch_list = we;
@@ -269,7 +267,7 @@ register_apm_event_handlers(
 				break;
 			p = events[n].cmdlist;
 			if ((q = clone_event_cmd_list(cmdlist)) == NULL)
-				(void) err(1, "out of memory");
+				err(1, "out of memory");
 			if (p) {
 				while (p->next != NULL)
 					p = p->next;
@@ -315,7 +313,7 @@ exec_event_cmd(struct event_config *ev)
 	status = exec_run_cmd(ev->cmdlist);
 	if (status && ev->rejectable) {
 		syslog(LOG_ERR, "canceled");
-		(void) event_cmd_reject_act(NULL);
+		event_cmd_reject_act(NULL);
 	}
 	return status;
 }
@@ -332,7 +330,7 @@ read_config(void)
 	int i;
 
 	if ((yyin = fopen(apmd_configfile, "r")) == NULL) {
-		(void) err(1, "cannot open config file");
+		err(1, "cannot open config file");
 	}
 
 #ifdef DEBUG
@@ -340,7 +338,7 @@ read_config(void)
 #endif
 
 	if (yyparse() != 0)
-		(void) err(1, "cannot parse config file");
+		err(1, "cannot parse config file");
 
 	fclose(yyin);
 
@@ -349,14 +347,14 @@ read_config(void)
 		if (events[i].cmdlist) {
 			u_int event_type = i;
 			if (write(apmctl_fd, &event_type, sizeof(u_int)) == -1) {
-				(void) err(1, "cannot enable event 0x%x", event_type);
+				err(1, "cannot enable event 0x%x", event_type);
 			}
 		}
 	}
 }
 
 void
-dump_config()
+dump_config(void)
 {
 	int i;
 	struct battery_watch_event *q;
@@ -392,7 +390,7 @@ dump_config()
 }
 
 void
-destroy_config()
+destroy_config(void)
 {
 	int i;
 	struct battery_watch_event *q;
@@ -402,7 +400,7 @@ destroy_config()
 		if (events[i].cmdlist) {
 			u_int event_type = i;
 			if (write(apmctl_fd, &event_type, sizeof(u_int)) == -1) {
-				(void) err(1, "cannot disable event 0x%x", event_type);
+				err(1, "cannot disable event 0x%x", event_type);
 			}
 		}
 	}
@@ -423,7 +421,7 @@ destroy_config()
 }
 
 void
-restart()
+restart(void)
 {
 	destroy_config();
 	read_config();
@@ -435,7 +433,7 @@ restart()
  * write pid file
  */
 static void
-write_pid()
+write_pid(void)
 {
 	FILE *fp = fopen(apmd_pidfile, "w");
 
@@ -454,11 +452,11 @@ void
 enque_signal(int sig)
 {
 	if (write(signal_fd[1], &sig, sizeof sig) != sizeof sig)
-		(void) err(1, "cannot process signal.");
+		err(1, "cannot process signal.");
 }
 
 void
-wait_child()
+wait_child(void)
 {
 	int status;
 	while (waitpid(-1, &status, WNOHANG) > 0)
@@ -486,7 +484,7 @@ proc_signal(int fd)
 			wait_child();
 			break;
 		default:
-			(void) warn("unexpected signal(%d) received.", sig);
+			warn("unexpected signal(%d) received.", sig);
 			break;
 		}
 	}
@@ -515,7 +513,7 @@ proc_apmevent(int fd)
 	BATTERY_DISCHARGING)
 
 void
-check_battery()
+check_battery(void)
 {
 
 	static int first_time=1, last_state;
@@ -530,7 +528,7 @@ check_battery()
 
 	if (first_time) {
 		if ( ioctl(apmnorm_fd, APMIO_GETINFO, &pw_info) < 0)
-			(void) err(1, "cannot check battery state.");
+			err(1, "cannot check battery state.");
 /*
  * This next statement isn't entirely true. The spec does not tie AC
  * line state to battery charging or not, but this is a bit lazier to do.
@@ -545,7 +543,7 @@ check_battery()
 	 * of smoothing or correction?
 	 */
 	if ( ioctl(apmnorm_fd, APMIO_GETINFO, &pw_info) < 0)
-		(void) err(1, "cannot check battery state.");
+		err(1, "cannot check battery state.");
 
 	/*
 	 * If we're not in the state now that we were in last time,
@@ -565,7 +563,7 @@ check_battery()
 		if (p -> direction == AC_POWER_STATE &&
 			!(p -> done) &&
 			((p -> type == BATTERY_PERCENT && 
-				p -> level == pw_info.ai_batt_life) ||
+				p -> level == (int)pw_info.ai_batt_life) ||
 			(p -> type == BATTERY_MINUTES &&
 				p -> level == (pw_info.ai_batt_time / 60)))) {
 			p -> done++;
@@ -621,7 +619,7 @@ event_loop(void)
 		sigprocmask(SIG_SETMASK, &osigmask, NULL);
 		if ((res=select(fdmax + 1, &rfds, 0, 0, &to)) < 0) {
 			if (errno != EINTR)
-				(void) err(1, "select");
+				err(1, "select");
 		}
 		sigprocmask(SIG_SETMASK, &sigmask, NULL);
 
@@ -666,7 +664,7 @@ main(int ac, char* av[])
 			verbose = 1;
 			break;
 		default:
-			(void) err(1, "unknown option `%c'", ch);
+			err(1, "unknown option `%c'", ch);
 		}
 	}
 
@@ -674,7 +672,7 @@ main(int ac, char* av[])
 		daemon(0, 0);
 
 #ifdef NICE_INCR
-	(void) nice(NICE_INCR);
+	nice(NICE_INCR);
 #endif
 
 	if (!daemonize)
@@ -686,29 +684,29 @@ main(int ac, char* av[])
 	syslog(LOG_NOTICE, "start");
 
 	if (pipe(signal_fd) < 0)
-		(void) err(1, "pipe");
+		err(1, "pipe");
 	if (fcntl(signal_fd[0], F_SETFL, O_NONBLOCK) < 0)
-		(void) err(1, "fcntl");
+		err(1, "fcntl");
 
 	if ((apmnorm_fd = open(APM_NORM_DEVICEFILE, O_RDWR)) == -1) {
-		(void) err(1, "cannot open device file `%s'", APM_NORM_DEVICEFILE);
+		err(1, "cannot open device file `%s'", APM_NORM_DEVICEFILE);
 	}
 
 	if (fcntl(apmnorm_fd, F_SETFD, 1) == -1) {
-		(void) err(1, "cannot set close-on-exec flag for device file '%s'", APM_NORM_DEVICEFILE);
+		err(1, "cannot set close-on-exec flag for device file '%s'", APM_NORM_DEVICEFILE);
 	}
 
 	if ((apmctl_fd = open(APM_CTL_DEVICEFILE, O_RDWR)) == -1) {
-		(void) err(1, "cannot open device file `%s'", APM_CTL_DEVICEFILE);
+		err(1, "cannot open device file `%s'", APM_CTL_DEVICEFILE);
 	}
 
 	if (fcntl(apmctl_fd, F_SETFD, 1) == -1) {
-		(void) err(1, "cannot set close-on-exec flag for device file '%s'", APM_CTL_DEVICEFILE);
- 	}
+		err(1, "cannot set close-on-exec flag for device file '%s'", APM_CTL_DEVICEFILE);
+	}
 
 	restart();
 	write_pid();
 	event_loop();
- 	exit(EXIT_SUCCESS);
+	exit(EXIT_SUCCESS);
 }
 

Modified: head/usr.sbin/apmd/apmd.h
==============================================================================
--- head/usr.sbin/apmd/apmd.h	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/apmd.h	Fri May 14 14:26:56 2010	(r208075)
@@ -106,3 +106,28 @@ extern int register_apm_event_handlers(
 	bitstr_t bit_decl(evlist, EVENT_MAX),
 	struct event_cmd *cmdlist);
 extern void free_event_cmd_list(struct event_cmd *p);
+
+extern int	yyparse(void);
+
+void	yyerror(const char *);
+int	yylex(void);
+
+struct event_cmd *event_cmd_default_clone(void *);
+int event_cmd_exec_act(void *);
+void event_cmd_exec_dump(void *, FILE *);
+struct event_cmd *event_cmd_exec_clone(void *);
+void event_cmd_exec_free(void *);
+int event_cmd_reject_act(void *);
+struct event_cmd *clone_event_cmd_list(struct event_cmd *);
+int exec_run_cmd(struct event_cmd *);
+int exec_event_cmd(struct event_config *);
+void read_config(void);
+void dump_config(void);
+void destroy_config(void);
+void restart(void);
+void enque_signal(int);
+void wait_child(void);
+int proc_signal(int);
+void proc_apmevent(int);
+void check_battery(void);
+void event_loop(void);

Modified: head/usr.sbin/apmd/apmdlex.l
==============================================================================
--- head/usr.sbin/apmd/apmdlex.l	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/apmdlex.l	Fri May 14 14:26:56 2010	(r208075)
@@ -36,6 +36,9 @@
 #include "apmd.h"
 #include "y.tab.h"
 
+/* We don't need it, avoid the warning. */
+#define YY_NO_UNPUT
+
 int lineno;
 int first_time;
 %}

Modified: head/usr.sbin/apmd/contrib/pccardq.c
==============================================================================
--- head/usr.sbin/apmd/contrib/pccardq.c	Fri May 14 14:26:49 2010	(r208074)
+++ head/usr.sbin/apmd/contrib/pccardq.c	Fri May 14 14:26:56 2010	(r208075)
@@ -20,7 +20,7 @@ const char     *tmp_dir = "/tmp";
 unsigned        slot_map = ~0;
 
 void
-usage()
+usage(void)
 {
     fprintf(stderr, "usage: %s [-a] [-n] [-s slot]\n", prog);
 }
@@ -223,7 +223,7 @@ get_slot_info(int so, int slot, char **m
     return rc;
 }
 
-const char     *
+const char *
 strstate(int state)
 {
     switch (state) {

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 15:06:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DEFA106579C;
	Fri, 14 May 2010 15:06:13 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E3588FC13;
	Fri, 14 May 2010 15:06:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EF6DwP090037;
	Fri, 14 May 2010 15:06:13 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EF6Dnt090035;
	Fri, 14 May 2010 15:06:13 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201005141506.o4EF6Dnt090035@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 14 May 2010 15:06: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: r208077 - head/sbin/ifconfig
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 15:06:13 -0000

Author: bz
Date: Fri May 14 15:06:12 2010
New Revision: 208077
URL: http://svn.freebsd.org/changeset/base/208077

Log:
  Document the 'short preamble' capability for 802.11bg.
  
  Reviewed by:	sam
  MFC after:	4 days

Modified:
  head/sbin/ifconfig/ifconfig.8

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Fri May 14 14:34:22 2010	(r208076)
+++ head/sbin/ifconfig/ifconfig.8	Fri May 14 15:06:12 2010	(r208077)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8	8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd April 28, 2010
+.Dd May 14, 2010
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -1294,6 +1294,10 @@ Quality of Service (QoS).
 Indicates that the station is using QoS encapsulation for
 data frame.
 QoS encapsulation is enabled only when WME mode is enabled.
+.It Li S
+Short Preamble.
+Indicates that the station is doing short preamble to optionally
+improve throughput performance with 802.11g and 802.11b.
 .It Li T
 Transitional Security Network (TSN).
 Indicates that the station associated using TSN; see also
@@ -1368,6 +1372,10 @@ Quality of Service (QoS).
 Indicates that the station is using QoS encapsulation for
 data frame.
 QoS encapsulation is enabled only when WME mode is enabled.
+.It Li S
+Short Preamble.
+Indicates that the station is doing short preamble to optionally
+improve throughput performance with 802.11g and 802.11b.
 .It Li T
 Transitional Security Network (TSN).
 Indicates that the station associated using TSN; see also

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 16:55:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E2FA71065679;
	Fri, 14 May 2010 16:55:13 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2E3A8FC1C;
	Fri, 14 May 2010 16:55:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EGtDJQ014441;
	Fri, 14 May 2010 16:55:13 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EGtDVo014439;
	Fri, 14 May 2010 16:55:13 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005141655.o4EGtDVo014439@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 14 May 2010 16:55: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: r208081 - head/sys/dev/fxp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 16:55:14 -0000

Author: yongari
Date: Fri May 14 16:55:13 2010
New Revision: 208081
URL: http://svn.freebsd.org/changeset/base/208081

Log:
  Controller updates RFA via DMA so driver needs synchronization.
  Add missing BUS_DMASYNC_POSTWRITE and BUS_DMASYNC_PREREAD.

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Fri May 14 15:47:51 2010	(r208080)
+++ head/sys/dev/fxp/if_fxp.c	Fri May 14 16:55:13 2010	(r208081)
@@ -1899,7 +1899,7 @@ fxp_intr_body(struct fxp_softc *sc, stru
 		rfa = (struct fxp_rfa *)(m->m_ext.ext_buf +
 		    RFA_ALIGNMENT_FUDGE);
 		bus_dmamap_sync(sc->fxp_rxmtag, rxp->rx_map,
-		    BUS_DMASYNC_POSTREAD);
+		    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 
 #ifdef DEVICE_POLLING /* loop at most count times if count >=0 */
 		if (count >= 0 && count-- == 0) {
@@ -2659,7 +2659,7 @@ fxp_add_rfabuf(struct fxp_softc *sc, str
 		le32enc(&p_rfa->link_addr, rxp->rx_addr);
 		p_rfa->rfa_control = 0;
 		bus_dmamap_sync(sc->fxp_rxmtag, p_rx->rx_map,
-		    BUS_DMASYNC_PREWRITE);
+		    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	} else {
 		rxp->rx_next = NULL;
 		sc->fxp_desc.rx_head = rxp;

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 16:56:19 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4922E106564A;
	Fri, 14 May 2010 16:56:19 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F0A1B8FC1C;
	Fri, 14 May 2010 16:56:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EGuIk6014705;
	Fri, 14 May 2010 16:56:18 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EGuIjM014703;
	Fri, 14 May 2010 16:56:18 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201005141656.o4EGuIjM014703@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 14 May 2010 16:56: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: r208082 - head/sys/geom/multipath
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 16:56:19 -0000

Author: mjacob
Date: Fri May 14 16:56:18 2010
New Revision: 208082
URL: http://svn.freebsd.org/changeset/base/208082

Log:
  Make sure to check that the active provider pointer points to something before
  dereferencing the pointer.
  
  Sponsored by:   Pansas
  MFC after:	1 week

Modified:
  head/sys/geom/multipath/g_multipath.c

Modified: head/sys/geom/multipath/g_multipath.c
==============================================================================
--- head/sys/geom/multipath/g_multipath.c	Fri May 14 16:55:13 2010	(r208081)
+++ head/sys/geom/multipath/g_multipath.c	Fri May 14 16:56:18 2010	(r208082)
@@ -757,7 +757,7 @@ g_multipath_ctl_getactive(struct gctl_re
 		return;
 	}
 	sc = gp->softc;
-	if (sc->cp_active) {
+	if (sc->cp_active && sc->cp_active->provider) {
 		sbuf_printf(sb, "%s\n", sc->cp_active->provider->name);
 	} else {
 		sbuf_printf(sb, "none\n");

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 16:58:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 423881065672;
	Fri, 14 May 2010 16:58:38 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 320488FC0C;
	Fri, 14 May 2010 16:58:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EGwceu015291;
	Fri, 14 May 2010 16:58:38 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EGwcME015289;
	Fri, 14 May 2010 16:58:38 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005141658.o4EGwcME015289@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 14 May 2010 16:58: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: r208083 - head/sys/dev/fxp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 16:58:38 -0000

Author: yongari
Date: Fri May 14 16:58:37 2010
New Revision: 208083
URL: http://svn.freebsd.org/changeset/base/208083

Log:
  Dont' allow dma map load deferring. fxp(4) is not able to handle
  EINPROGRESS.

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Fri May 14 16:56:18 2010	(r208082)
+++ head/sys/dev/fxp/if_fxp.c	Fri May 14 16:58:37 2010	(r208083)
@@ -2623,7 +2623,7 @@ fxp_new_rfabuf(struct fxp_softc *sc, str
 	/* Map the RFA into DMA memory. */
 	error = bus_dmamap_load(sc->fxp_rxmtag, sc->spare_map, rfa,
 	    MCLBYTES - RFA_ALIGNMENT_FUDGE, fxp_dma_map_addr,
-	    &rxp->rx_addr, 0);
+	    &rxp->rx_addr, BUS_DMA_NOWAIT);
 	if (error) {
 		m_freem(m);
 		return (error);

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 17:39:28 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D08C1065670;
	Fri, 14 May 2010 17:39:28 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C7558FC0A;
	Fri, 14 May 2010 17:39:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EHdSY5024209;
	Fri, 14 May 2010 17:39:28 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EHdSaW024207;
	Fri, 14 May 2010 17:39:28 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201005141739.o4EHdSaW024207@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 14 May 2010 17:39: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: r208084 - head/sys/dev/fxp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 17:39:28 -0000

Author: yongari
Date: Fri May 14 17:39:28 2010
New Revision: 208084
URL: http://svn.freebsd.org/changeset/base/208084

Log:
  If controller received bad frames make sure to update newly added
  RFA. Also drop frames that have either CRC error or alignment
  error. Normally bad frames are not received at all. But controllers
  running in promiscuous mode will receive bad frames. 82557 will
  also receive bad frames to receive VLAN oversized frames.
  
  While I'm here mark RNR condition if driver happen to see RNR in
  RFA status and restart RU to receive frames again. Because driver
  checks all received frames in RX loop, RNR condition could be set
  in the middle of RX processing. Just relying on RNR interrupt was
  not enough.
  
  This change fixes "Memory modified after free" issue when fxp(4)
  is running as a member of if_bridge(4).
  
  Tested by:	Larry Baird  gta dot com>
  MFC after:	5 days

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==============================================================================
--- head/sys/dev/fxp/if_fxp.c	Fri May 14 16:58:37 2010	(r208083)
+++ head/sys/dev/fxp/if_fxp.c	Fri May 14 17:39:28 2010	(r208084)
@@ -1916,6 +1916,8 @@ fxp_intr_body(struct fxp_softc *sc, stru
 		if ((status & FXP_RFA_STATUS_C) == 0)
 			break;
 
+		if ((status & FXP_RFA_STATUS_RNR) != 0)
+			rnr++;
 		/*
 		 * Advance head forward.
 		 */
@@ -1942,9 +1944,12 @@ fxp_intr_body(struct fxp_softc *sc, stru
 				total_len -= 2;
 			}
 			if (total_len < sizeof(struct ether_header) ||
-			    total_len > MCLBYTES - RFA_ALIGNMENT_FUDGE -
-				sc->rfa_size || status & FXP_RFA_STATUS_CRC) {
+			    total_len > (MCLBYTES - RFA_ALIGNMENT_FUDGE -
+			    sc->rfa_size) ||
+			    status & (FXP_RFA_STATUS_CRC |
+			    FXP_RFA_STATUS_ALIGN)) {
 				m_freem(m);
+				fxp_add_rfabuf(sc, rxp);
 				continue;
 			}
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:11:41 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EEF44106566C;
	Fri, 14 May 2010 19:11:41 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC74B8FC08;
	Fri, 14 May 2010 19:11:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJBfMw044516;
	Fri, 14 May 2010 19:11:41 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJBfTM044513;
	Fri, 14 May 2010 19:11:41 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141911.o4EJBfTM044513@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:11:41 +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: r208086 - stable/8/sys/dev/cas
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 19:11:42 -0000

Author: marius
Date: Fri May 14 19:11:41 2010
New Revision: 208086
URL: http://svn.freebsd.org/changeset/base/208086

Log:
  MFC: r207585
  
  - Don't set CAS_PCS_DATAPATH to anything except CAS_PCS_DATAPATH_SERDES
    on Cassini using the external PCS SERDES otherwise unaligned access
    traps and other strange effects happen with some machines. Don't touch
    the MIF which is unused in that case either. These changes require the
    PHY type to use to be determined via the OFW device tree or from the
    VPD in machines without the former.
  - Disable the SERDES pins of Saturn when not used in order to save power
    and ensure they are enabled otherwise.
  - In cas_attach() use the correct register offset for CAS_PCS_CONF_EN.
  - Add some bus space barriers missing in the PCS code path.
  
  These changes make the Sun GigaSwift Ethernet 1.0 MMF cards as well as
  the on-board interfaces found in Sun Fire B100s Blade Server work.
  
  PR:	144867

Modified:
  stable/8/sys/dev/cas/if_cas.c
  stable/8/sys/dev/cas/if_casreg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/cas/if_cas.c
==============================================================================
--- stable/8/sys/dev/cas/if_cas.c	Fri May 14 18:00:21 2010	(r208085)
+++ stable/8/sys/dev/cas/if_cas.c	Fri May 14 19:11:41 2010	(r208086)
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #if defined(__powerpc__) || defined(__sparc64__)
+#include 
 #include 
 #include 
 #endif
@@ -321,55 +322,82 @@ cas_attach(struct cas_softc *sc)
 		}
 	}
 
-	CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_MII);
-
-	cas_mifinit(sc);
-
-	/*
-	 * Look for an external PHY.
-	 */
-	error = ENXIO;
-	v = CAS_READ_4(sc, CAS_MIF_CONF);
-	if ((v & CAS_MIF_CONF_MDI1) != 0) {
-		v |= CAS_MIF_CONF_PHY_SELECT;
-		CAS_WRITE_4(sc, CAS_MIF_CONF, v);
-		switch (sc->sc_variant) {
-		default:
-			sc->sc_phyad = -1;
-			break;
+	if ((sc->sc_flags & CAS_SERDES) == 0) {
+		CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_MII);
+		CAS_BARRIER(sc, CAS_PCS_DATAPATH, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+		cas_mifinit(sc);
+		/*
+		 * Look for an external PHY.
+		 */
+		error = ENXIO;
+		v = CAS_READ_4(sc, CAS_MIF_CONF);
+		if ((v & CAS_MIF_CONF_MDI1) != 0) {
+			v |= CAS_MIF_CONF_PHY_SELECT;
+			CAS_WRITE_4(sc, CAS_MIF_CONF, v);
+			CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+			/* Enable/unfreeze the GMII pins of Saturn. */
+			if (sc->sc_variant == CAS_SATURN) {
+				CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0);
+				CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+				    BUS_SPACE_BARRIER_READ |
+				    BUS_SPACE_BARRIER_WRITE);
+			}
+			switch (sc->sc_variant) {
+			default:
+				sc->sc_phyad = -1;
+				break;
+			}
+			error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
+			    cas_mediachange, cas_mediastatus);
 		}
-		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
-		    cas_mediachange, cas_mediastatus);
-	}
-
-	/*
-	 * Fall back on an internal PHY if no external PHY was found.
-	 */
-	if (error != 0 && (v & CAS_MIF_CONF_MDI0) != 0) {
-		v &= ~CAS_MIF_CONF_PHY_SELECT;
-		CAS_WRITE_4(sc, CAS_MIF_CONF, v);
-		switch (sc->sc_variant) {
-		default:
-			sc->sc_phyad = -1;
-			break;
+		/*
+		 * Fall back on an internal PHY if no external PHY was found.
+		 */
+		if (error != 0 && (v & CAS_MIF_CONF_MDI0) != 0) {
+			v &= ~CAS_MIF_CONF_PHY_SELECT;
+			CAS_WRITE_4(sc, CAS_MIF_CONF, v);
+			CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+			/* Freeze the GMII pins of Saturn for saving power. */
+			if (sc->sc_variant == CAS_SATURN) {
+				CAS_WRITE_4(sc, CAS_SATURN_PCFG,
+				    CAS_SATURN_PCFG_FSI);
+				CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+				    BUS_SPACE_BARRIER_READ |
+				    BUS_SPACE_BARRIER_WRITE);
+			}
+			switch (sc->sc_variant) {
+			default:
+				sc->sc_phyad = -1;
+				break;
+			}
+			error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
+			    cas_mediachange, cas_mediastatus);
 		}
-		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
-		    cas_mediachange, cas_mediastatus);
-	}
-
-	/*
-	 * Try the external PCS SERDES if we didn't find any PHYs.
-	 */
-	if (error != 0) {
+	} else {
+		/*
+		 * Use the external PCS SERDES.
+		 */
 		CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_SERDES);
+		CAS_BARRIER(sc, CAS_PCS_DATAPATH, 4, BUS_SPACE_BARRIER_WRITE);
+		/* Enable/unfreeze the SERDES pins of Saturn. */
+		if (sc->sc_variant == CAS_SATURN) {
+			CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0);
+			CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+			    BUS_SPACE_BARRIER_WRITE);
+		}
 		CAS_WRITE_4(sc, CAS_PCS_SERDES_CTRL, CAS_PCS_SERDES_CTRL_ESD);
-		CAS_WRITE_4(sc, CAS_PCS_CONF_EN, CAS_PCS_CONF_EN);
-		sc->sc_flags |= CAS_SERDES;
+		CAS_BARRIER(sc, CAS_PCS_SERDES_CTRL, 4,
+		    BUS_SPACE_BARRIER_WRITE);
+		CAS_WRITE_4(sc, CAS_PCS_CONF, CAS_PCS_CONF_EN);
+		CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 		sc->sc_phyad = CAS_PHYAD_EXTERNAL;
 		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
 		    cas_mediachange, cas_mediastatus);
 	}
-
 	if (error != 0) {
 		device_printf(sc->sc_dev, "PHY probe failed: %d\n", error);
 		goto fail_rxmap;
@@ -956,8 +984,9 @@ cas_init_locked(struct cas_softc *sc)
 	    __func__);
 #endif
 
-	/* Re-initialize the MIF. */
-	cas_mifinit(sc);
+	if ((sc->sc_flags & CAS_SERDES) == 0)
+		/* Re-initialize the MIF. */
+		cas_mifinit(sc);
 
 	/* step 3.  Setup data structures in host memory. */
 	cas_meminit(sc);
@@ -2105,6 +2134,8 @@ cas_mifinit(struct cas_softc *sc)
 	/* Configure the MIF in frame mode. */
 	CAS_WRITE_4(sc, CAS_MIF_CONF,
 	    CAS_READ_4(sc, CAS_MIF_CONF) & ~CAS_MIF_CONF_BB_MODE);
+	CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 }
 
 /*
@@ -2219,10 +2250,16 @@ cas_mii_writereg(device_t dev, int phy, 
 			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
 			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_ANAR, val);
+			CAS_BARRIER(sc, CAS_PCS_ANAR, 4,
+			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_SERDES_CTRL,
 			    CAS_PCS_SERDES_CTRL_ESD);
+			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_CONF,
 			    CAS_PCS_CONF_EN);
+			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 			return (0);
 		case MII_ANLPAR:
 			reg = CAS_PCS_ANLPAR;
@@ -2233,6 +2270,8 @@ cas_mii_writereg(device_t dev, int phy, 
 			return (0);
 		}
 		CAS_WRITE_4(sc, reg, val);
+		CAS_BARRIER(sc, reg, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 		return (0);
 	}
 
@@ -2630,15 +2669,20 @@ static struct resource_spec cas_pci_res_
 	{ -1, 0 }
 };
 
+#define	CAS_LOCAL_MAC_ADDRESS	"local-mac-address"
+#define	CAS_PHY_INTERFACE	"phy-interface"
+#define	CAS_PHY_TYPE		"phy-type"
+#define	CAS_PHY_TYPE_PCS	"pcs"
+
 static int
 cas_pci_attach(device_t dev)
 {
+	char buf[sizeof(CAS_LOCAL_MAC_ADDRESS)];
 	struct cas_softc *sc;
 	int i;
 #if !(defined(__powerpc__) || defined(__sparc64__))
 	u_char enaddr[4][ETHER_ADDR_LEN];
-	char lma[sizeof("local-mac-address")];
-	int found, j;
+	u_int j, k, lma, pcs[4], phy;
 #endif
 
 	sc = device_get_softc(dev);
@@ -2679,13 +2723,20 @@ cas_pci_attach(device_t dev)
 
 #if defined(__powerpc__) || defined(__sparc64__)
 	OF_getetheraddr(dev, sc->sc_enaddr);
+	if (OF_getprop(ofw_bus_get_node(dev), CAS_PHY_INTERFACE, buf,
+	    sizeof(buf)) > 0 || OF_getprop(ofw_bus_get_node(dev),
+	    CAS_PHY_TYPE, buf, sizeof(buf)) > 0) {
+		buf[sizeof(buf) - 1] = '\0';
+		if (strcmp(buf, CAS_PHY_TYPE_PCS) == 0)
+			sc->sc_flags |= CAS_SERDES;
+	}
 #else
 	/*
-	 * Dig out VPD (vital product data) and read the MAX address.
-	 * The VPD resides in the PCI Expansion ROM (PCI FCode) and
-	 * can't be accessed via the PCI capability pointer.
-	 * SUNW,pci-ce and SUNW,pci-qge use the Enhanced VPD format
-	 * described in US Patent 7149820.
+	 * Dig out VPD (vital product data) and read the MAC address as well
+	 * as the PHY type.  The VPD resides in the PCI Expansion ROM (PCI
+	 * FCode) and can't be accessed via the PCI capability pointer.
+	 * SUNW,pci-ce and SUNW,pci-qge use the Enhanced VPD format described
+	 * in the free US Patent 7149820.
 	 */
 
 #define	PCI_ROMHDR_SIZE			0x1c
@@ -2719,7 +2770,10 @@ cas_pci_attach(device_t dev)
 #define	CAS_ROM_READ_4(sc, offs)					\
 	CAS_READ_4((sc), CAS_PCI_ROM_OFFSET + (offs))
 
-	found = 0;
+	lma = phy = 0;
+	memset(enaddr, 0, sizeof(enaddr));
+	memset(pcs, 0, sizeof(pcs));
+
 	/* Enable PCI Expansion ROM access. */
 	CAS_WRITE_4(sc, CAS_BIM_LDEV_OEN,
 	    CAS_BIM_LDEV_OEN_PAD | CAS_BIM_LDEV_OEN_PROM);
@@ -2768,23 +2822,51 @@ cas_pci_attach(device_t dev)
 			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE) != 'I')
 				/* no instance property */
 				continue;
-			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) != 'B')
-				/* no byte array */
-				continue;
-			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 4) !=
-			    ETHER_ADDR_LEN)
-				continue;
-			bus_read_region_1(sc->sc_res[CAS_RES_MEM],
-			    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
-			    lma, sizeof(lma));
-			if (strcmp(lma, "local-mac-address") != 0)
-				continue;
-			bus_read_region_1(sc->sc_res[CAS_RES_MEM],
-			    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5 +
-			    sizeof(lma), enaddr[found],
-			    sizeof(enaddr[found]));
-			if (found++ == 4)
-				break;
+			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) == 'B') {
+				/* byte array */
+				if (CAS_ROM_READ_1(sc,
+				    j + PCI_VPD_SIZE + 4) != ETHER_ADDR_LEN)
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
+				    buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_LOCAL_MAC_ADDRESS) != 0)
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE +
+				    5 + sizeof(CAS_LOCAL_MAC_ADDRESS),
+				    enaddr[lma], sizeof(enaddr[lma]));
+				lma++;
+				if (lma == 4 && phy == 4)
+					break;
+			} else if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) ==
+			   'S') {
+				/* string */
+				if (CAS_ROM_READ_1(sc,
+				    j + PCI_VPD_SIZE + 4) !=
+				    sizeof(CAS_PHY_TYPE_PCS))
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
+				    buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_PHY_INTERFACE) == 0)
+					k = sizeof(CAS_PHY_INTERFACE);
+				else if (strcmp(buf, CAS_PHY_TYPE) == 0)
+					k = sizeof(CAS_PHY_TYPE);
+				else
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE +
+				    5 + k, buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_PHY_TYPE_PCS) == 0)
+					pcs[phy] = 1;
+				phy++;
+				if (lma == 4 && phy == 4)
+					break;
+			}
 		}
 		break;
 	default:
@@ -2795,14 +2877,24 @@ cas_pci_attach(device_t dev)
  fail_prom:
 	CAS_WRITE_4(sc, CAS_BIM_LDEV_OEN, 0);
 
-	if (found == 0) {
+	if (lma == 0) {
 		device_printf(dev, "could not determine Ethernet address\n");
 		goto fail;
 	}
 	i = 0;
-	if (found > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr))
+	if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr))
 		i = pci_get_slot(dev);
 	memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN);
+
+	if (phy == 0) {
+		device_printf(dev, "could not determine PHY type\n");
+		goto fail;
+	}
+	i = 0;
+	if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs))
+		i = pci_get_slot(dev);
+	if (pcs[i] != 0)
+		sc->sc_flags |= CAS_SERDES;
 #endif
 
 	if (cas_attach(sc) != 0) {

Modified: stable/8/sys/dev/cas/if_casreg.h
==============================================================================
--- stable/8/sys/dev/cas/if_casreg.h	Fri May 14 18:00:21 2010	(r208085)
+++ stable/8/sys/dev/cas/if_casreg.h	Fri May 14 19:11:41 2010	(r208086)
@@ -68,6 +68,7 @@
 #define	CAS_STATUS4		0x105c	/* interrupt status 4 for INTD */
 #define	CAS_CLEAR_ALIAS4	0x1060	/* clear mask alias 4 for INTD */
 #define	CAS_STATUS_ALIAS4	0x1064	/* interrupt status alias 4 for INTD */
+#define	CAS_SATURN_PCFG		0x106c	/* internal MACPHY pin configuration */
 
 #define	CAS_CAW_RX_WGHT_MASK	0x00000003	/* RX DMA factor for... */
 #define	CAS_CAW_RX_WGHT_SHFT	0		/* ...weighted round robin */
@@ -171,6 +172,17 @@
 /* INTn enable bit for CAS_INTMASK[2-4] */
 #define	CAS_INTMASKN_EN		0x00000080	/* INT[B-D] enable */
 
+#define	CAS_SATURN_PCFG_TLA	0x00000001	/* PHY activity LED */
+#define	CAS_SATURN_PCFG_FLA	0x00000002	/* PHY 10MBit/sec LED */
+#define	CAS_SATURN_PCFG_CLA	0x00000004	/* PHY 100MBit/sec LED */
+#define	CAS_SATURN_PCFG_LLA	0x00000008	/* PHY 1000MBit/sec LED */
+#define	CAS_SATURN_PCFG_RLA	0x00000010	/* PHY full-duplex LED */
+#define	CAS_SATURN_PCFG_PDS	0x00000020	/* PHY debug mode */
+#define	CAS_SATURN_PCFG_MTP	0x00000080	/* test point select */
+#define	CAS_SATURN_PCFG_GMO	0x00000100	/* GMII observe */
+#define	CAS_SATURN_PCFG_FSI	0x00000200	/* freeze GMII/SERDES */
+#define	CAS_SATURN_PCFG_LAD	0x00000800	/* MAC LED control active low */
+
 /* TX DMA registers */
 #define	CAS_TX_CONF		0x2004	/* TX configuration */
 #define	CAS_TX_FIFO_WR		0x2014	/* FIFO write pointer */

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:12:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92BB41065780;
	Fri, 14 May 2010 19:12:01 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8034F8FC13;
	Fri, 14 May 2010 19:12:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJC1Yd044619;
	Fri, 14 May 2010 19:12:01 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJC1iv044616;
	Fri, 14 May 2010 19:12:01 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141912.o4EJC1iv044616@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:12:01 +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: r208087 - stable/7/sys/dev/cas
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 19:12:01 -0000

Author: marius
Date: Fri May 14 19:12:01 2010
New Revision: 208087
URL: http://svn.freebsd.org/changeset/base/208087

Log:
  MFC: r207585
  
  - Don't set CAS_PCS_DATAPATH to anything except CAS_PCS_DATAPATH_SERDES
    on Cassini using the external PCS SERDES otherwise unaligned access
    traps and other strange effects happen with some machines. Don't touch
    the MIF which is unused in that case either. These changes require the
    PHY type to use to be determined via the OFW device tree or from the
    VPD in machines without the former.
  - Disable the SERDES pins of Saturn when not used in order to save power
    and ensure they are enabled otherwise.
  - In cas_attach() use the correct register offset for CAS_PCS_CONF_EN.
  - Add some bus space barriers missing in the PCS code path.
  
  These changes make the Sun GigaSwift Ethernet 1.0 MMF cards as well as
  the on-board interfaces found in Sun Fire B100s Blade Server work.
  
  PR:	144867

Modified:
  stable/7/sys/dev/cas/if_cas.c
  stable/7/sys/dev/cas/if_casreg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/cas/if_cas.c
==============================================================================
--- stable/7/sys/dev/cas/if_cas.c	Fri May 14 19:11:41 2010	(r208086)
+++ stable/7/sys/dev/cas/if_cas.c	Fri May 14 19:12:01 2010	(r208087)
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #if defined(__powerpc__) || defined(__sparc64__)
+#include 
 #include 
 #include 
 #endif
@@ -321,55 +322,82 @@ cas_attach(struct cas_softc *sc)
 		}
 	}
 
-	CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_MII);
-
-	cas_mifinit(sc);
-
-	/*
-	 * Look for an external PHY.
-	 */
-	error = ENXIO;
-	v = CAS_READ_4(sc, CAS_MIF_CONF);
-	if ((v & CAS_MIF_CONF_MDI1) != 0) {
-		v |= CAS_MIF_CONF_PHY_SELECT;
-		CAS_WRITE_4(sc, CAS_MIF_CONF, v);
-		switch (sc->sc_variant) {
-		default:
-			sc->sc_phyad = -1;
-			break;
+	if ((sc->sc_flags & CAS_SERDES) == 0) {
+		CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_MII);
+		CAS_BARRIER(sc, CAS_PCS_DATAPATH, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+		cas_mifinit(sc);
+		/*
+		 * Look for an external PHY.
+		 */
+		error = ENXIO;
+		v = CAS_READ_4(sc, CAS_MIF_CONF);
+		if ((v & CAS_MIF_CONF_MDI1) != 0) {
+			v |= CAS_MIF_CONF_PHY_SELECT;
+			CAS_WRITE_4(sc, CAS_MIF_CONF, v);
+			CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+			/* Enable/unfreeze the GMII pins of Saturn. */
+			if (sc->sc_variant == CAS_SATURN) {
+				CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0);
+				CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+				    BUS_SPACE_BARRIER_READ |
+				    BUS_SPACE_BARRIER_WRITE);
+			}
+			switch (sc->sc_variant) {
+			default:
+				sc->sc_phyad = -1;
+				break;
+			}
+			error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
+			    cas_mediachange, cas_mediastatus);
 		}
-		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
-		    cas_mediachange, cas_mediastatus);
-	}
-
-	/*
-	 * Fall back on an internal PHY if no external PHY was found.
-	 */
-	if (error != 0 && (v & CAS_MIF_CONF_MDI0) != 0) {
-		v &= ~CAS_MIF_CONF_PHY_SELECT;
-		CAS_WRITE_4(sc, CAS_MIF_CONF, v);
-		switch (sc->sc_variant) {
-		default:
-			sc->sc_phyad = -1;
-			break;
+		/*
+		 * Fall back on an internal PHY if no external PHY was found.
+		 */
+		if (error != 0 && (v & CAS_MIF_CONF_MDI0) != 0) {
+			v &= ~CAS_MIF_CONF_PHY_SELECT;
+			CAS_WRITE_4(sc, CAS_MIF_CONF, v);
+			CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
+			/* Freeze the GMII pins of Saturn for saving power. */
+			if (sc->sc_variant == CAS_SATURN) {
+				CAS_WRITE_4(sc, CAS_SATURN_PCFG,
+				    CAS_SATURN_PCFG_FSI);
+				CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+				    BUS_SPACE_BARRIER_READ |
+				    BUS_SPACE_BARRIER_WRITE);
+			}
+			switch (sc->sc_variant) {
+			default:
+				sc->sc_phyad = -1;
+				break;
+			}
+			error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
+			    cas_mediachange, cas_mediastatus);
 		}
-		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
-		    cas_mediachange, cas_mediastatus);
-	}
-
-	/*
-	 * Try the external PCS SERDES if we didn't find any PHYs.
-	 */
-	if (error != 0) {
+	} else {
+		/*
+		 * Use the external PCS SERDES.
+		 */
 		CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_SERDES);
+		CAS_BARRIER(sc, CAS_PCS_DATAPATH, 4, BUS_SPACE_BARRIER_WRITE);
+		/* Enable/unfreeze the SERDES pins of Saturn. */
+		if (sc->sc_variant == CAS_SATURN) {
+			CAS_WRITE_4(sc, CAS_SATURN_PCFG, 0);
+			CAS_BARRIER(sc, CAS_SATURN_PCFG, 4,
+			    BUS_SPACE_BARRIER_WRITE);
+		}
 		CAS_WRITE_4(sc, CAS_PCS_SERDES_CTRL, CAS_PCS_SERDES_CTRL_ESD);
-		CAS_WRITE_4(sc, CAS_PCS_CONF_EN, CAS_PCS_CONF_EN);
-		sc->sc_flags |= CAS_SERDES;
+		CAS_BARRIER(sc, CAS_PCS_SERDES_CTRL, 4,
+		    BUS_SPACE_BARRIER_WRITE);
+		CAS_WRITE_4(sc, CAS_PCS_CONF, CAS_PCS_CONF_EN);
+		CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 		sc->sc_phyad = CAS_PHYAD_EXTERNAL;
 		error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus,
 		    cas_mediachange, cas_mediastatus);
 	}
-
 	if (error != 0) {
 		device_printf(sc->sc_dev, "PHY probe failed: %d\n", error);
 		goto fail_rxmap;
@@ -956,8 +984,9 @@ cas_init_locked(struct cas_softc *sc)
 	    __func__);
 #endif
 
-	/* Re-initialize the MIF. */
-	cas_mifinit(sc);
+	if ((sc->sc_flags & CAS_SERDES) == 0)
+		/* Re-initialize the MIF. */
+		cas_mifinit(sc);
 
 	/* step 3.  Setup data structures in host memory. */
 	cas_meminit(sc);
@@ -2105,6 +2134,8 @@ cas_mifinit(struct cas_softc *sc)
 	/* Configure the MIF in frame mode. */
 	CAS_WRITE_4(sc, CAS_MIF_CONF,
 	    CAS_READ_4(sc, CAS_MIF_CONF) & ~CAS_MIF_CONF_BB_MODE);
+	CAS_BARRIER(sc, CAS_MIF_CONF, 4,
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 }
 
 /*
@@ -2219,10 +2250,16 @@ cas_mii_writereg(device_t dev, int phy, 
 			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
 			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_ANAR, val);
+			CAS_BARRIER(sc, CAS_PCS_ANAR, 4,
+			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_SERDES_CTRL,
 			    CAS_PCS_SERDES_CTRL_ESD);
+			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+			    BUS_SPACE_BARRIER_WRITE);
 			CAS_WRITE_4(sc, CAS_PCS_CONF,
 			    CAS_PCS_CONF_EN);
+			CAS_BARRIER(sc, CAS_PCS_CONF, 4,
+			    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 			return (0);
 		case MII_ANLPAR:
 			reg = CAS_PCS_ANLPAR;
@@ -2233,6 +2270,8 @@ cas_mii_writereg(device_t dev, int phy, 
 			return (0);
 		}
 		CAS_WRITE_4(sc, reg, val);
+		CAS_BARRIER(sc, reg, 4,
+		    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
 		return (0);
 	}
 
@@ -2630,15 +2669,20 @@ static struct resource_spec cas_pci_res_
 	{ -1, 0 }
 };
 
+#define	CAS_LOCAL_MAC_ADDRESS	"local-mac-address"
+#define	CAS_PHY_INTERFACE	"phy-interface"
+#define	CAS_PHY_TYPE		"phy-type"
+#define	CAS_PHY_TYPE_PCS	"pcs"
+
 static int
 cas_pci_attach(device_t dev)
 {
+	char buf[sizeof(CAS_LOCAL_MAC_ADDRESS)];
 	struct cas_softc *sc;
 	int i;
 #if !(defined(__powerpc__) || defined(__sparc64__))
 	u_char enaddr[4][ETHER_ADDR_LEN];
-	char lma[sizeof("local-mac-address")];
-	int found, j;
+	u_int j, k, lma, pcs[4], phy;
 #endif
 
 	sc = device_get_softc(dev);
@@ -2679,13 +2723,20 @@ cas_pci_attach(device_t dev)
 
 #if defined(__powerpc__) || defined(__sparc64__)
 	OF_getetheraddr(dev, sc->sc_enaddr);
+	if (OF_getprop(ofw_bus_get_node(dev), CAS_PHY_INTERFACE, buf,
+	    sizeof(buf)) > 0 || OF_getprop(ofw_bus_get_node(dev),
+	    CAS_PHY_TYPE, buf, sizeof(buf)) > 0) {
+		buf[sizeof(buf) - 1] = '\0';
+		if (strcmp(buf, CAS_PHY_TYPE_PCS) == 0)
+			sc->sc_flags |= CAS_SERDES;
+	}
 #else
 	/*
-	 * Dig out VPD (vital product data) and read the MAX address.
-	 * The VPD resides in the PCI Expansion ROM (PCI FCode) and
-	 * can't be accessed via the PCI capability pointer.
-	 * SUNW,pci-ce and SUNW,pci-qge use the Enhanced VPD format
-	 * described in US Patent 7149820.
+	 * Dig out VPD (vital product data) and read the MAC address as well
+	 * as the PHY type.  The VPD resides in the PCI Expansion ROM (PCI
+	 * FCode) and can't be accessed via the PCI capability pointer.
+	 * SUNW,pci-ce and SUNW,pci-qge use the Enhanced VPD format described
+	 * in the free US Patent 7149820.
 	 */
 
 #define	PCI_ROMHDR_SIZE			0x1c
@@ -2719,7 +2770,10 @@ cas_pci_attach(device_t dev)
 #define	CAS_ROM_READ_4(sc, offs)					\
 	CAS_READ_4((sc), CAS_PCI_ROM_OFFSET + (offs))
 
-	found = 0;
+	lma = phy = 0;
+	memset(enaddr, 0, sizeof(enaddr));
+	memset(pcs, 0, sizeof(pcs));
+
 	/* Enable PCI Expansion ROM access. */
 	CAS_WRITE_4(sc, CAS_BIM_LDEV_OEN,
 	    CAS_BIM_LDEV_OEN_PAD | CAS_BIM_LDEV_OEN_PROM);
@@ -2768,23 +2822,51 @@ cas_pci_attach(device_t dev)
 			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE) != 'I')
 				/* no instance property */
 				continue;
-			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) != 'B')
-				/* no byte array */
-				continue;
-			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 4) !=
-			    ETHER_ADDR_LEN)
-				continue;
-			bus_read_region_1(sc->sc_res[CAS_RES_MEM],
-			    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
-			    lma, sizeof(lma));
-			if (strcmp(lma, "local-mac-address") != 0)
-				continue;
-			bus_read_region_1(sc->sc_res[CAS_RES_MEM],
-			    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5 +
-			    sizeof(lma), enaddr[found],
-			    sizeof(enaddr[found]));
-			if (found++ == 4)
-				break;
+			if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) == 'B') {
+				/* byte array */
+				if (CAS_ROM_READ_1(sc,
+				    j + PCI_VPD_SIZE + 4) != ETHER_ADDR_LEN)
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
+				    buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_LOCAL_MAC_ADDRESS) != 0)
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE +
+				    5 + sizeof(CAS_LOCAL_MAC_ADDRESS),
+				    enaddr[lma], sizeof(enaddr[lma]));
+				lma++;
+				if (lma == 4 && phy == 4)
+					break;
+			} else if (CAS_ROM_READ_1(sc, j + PCI_VPD_SIZE + 3) ==
+			   'S') {
+				/* string */
+				if (CAS_ROM_READ_1(sc,
+				    j + PCI_VPD_SIZE + 4) !=
+				    sizeof(CAS_PHY_TYPE_PCS))
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE + 5,
+				    buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_PHY_INTERFACE) == 0)
+					k = sizeof(CAS_PHY_INTERFACE);
+				else if (strcmp(buf, CAS_PHY_TYPE) == 0)
+					k = sizeof(CAS_PHY_TYPE);
+				else
+					continue;
+				bus_read_region_1(sc->sc_res[CAS_RES_MEM],
+				    CAS_PCI_ROM_OFFSET + j + PCI_VPD_SIZE +
+				    5 + k, buf, sizeof(buf));
+				buf[sizeof(buf) - 1] = '\0';
+				if (strcmp(buf, CAS_PHY_TYPE_PCS) == 0)
+					pcs[phy] = 1;
+				phy++;
+				if (lma == 4 && phy == 4)
+					break;
+			}
 		}
 		break;
 	default:
@@ -2795,14 +2877,24 @@ cas_pci_attach(device_t dev)
  fail_prom:
 	CAS_WRITE_4(sc, CAS_BIM_LDEV_OEN, 0);
 
-	if (found == 0) {
+	if (lma == 0) {
 		device_printf(dev, "could not determine Ethernet address\n");
 		goto fail;
 	}
 	i = 0;
-	if (found > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr))
+	if (lma > 1 && pci_get_slot(dev) < sizeof(enaddr) / sizeof(*enaddr))
 		i = pci_get_slot(dev);
 	memcpy(sc->sc_enaddr, enaddr[i], ETHER_ADDR_LEN);
+
+	if (phy == 0) {
+		device_printf(dev, "could not determine PHY type\n");
+		goto fail;
+	}
+	i = 0;
+	if (phy > 1 && pci_get_slot(dev) < sizeof(pcs) / sizeof(*pcs))
+		i = pci_get_slot(dev);
+	if (pcs[i] != 0)
+		sc->sc_flags |= CAS_SERDES;
 #endif
 
 	if (cas_attach(sc) != 0) {

Modified: stable/7/sys/dev/cas/if_casreg.h
==============================================================================
--- stable/7/sys/dev/cas/if_casreg.h	Fri May 14 19:11:41 2010	(r208086)
+++ stable/7/sys/dev/cas/if_casreg.h	Fri May 14 19:12:01 2010	(r208087)
@@ -68,6 +68,7 @@
 #define	CAS_STATUS4		0x105c	/* interrupt status 4 for INTD */
 #define	CAS_CLEAR_ALIAS4	0x1060	/* clear mask alias 4 for INTD */
 #define	CAS_STATUS_ALIAS4	0x1064	/* interrupt status alias 4 for INTD */
+#define	CAS_SATURN_PCFG		0x106c	/* internal MACPHY pin configuration */
 
 #define	CAS_CAW_RX_WGHT_MASK	0x00000003	/* RX DMA factor for... */
 #define	CAS_CAW_RX_WGHT_SHFT	0		/* ...weighted round robin */
@@ -171,6 +172,17 @@
 /* INTn enable bit for CAS_INTMASK[2-4] */
 #define	CAS_INTMASKN_EN		0x00000080	/* INT[B-D] enable */
 
+#define	CAS_SATURN_PCFG_TLA	0x00000001	/* PHY activity LED */
+#define	CAS_SATURN_PCFG_FLA	0x00000002	/* PHY 10MBit/sec LED */
+#define	CAS_SATURN_PCFG_CLA	0x00000004	/* PHY 100MBit/sec LED */
+#define	CAS_SATURN_PCFG_LLA	0x00000008	/* PHY 1000MBit/sec LED */
+#define	CAS_SATURN_PCFG_RLA	0x00000010	/* PHY full-duplex LED */
+#define	CAS_SATURN_PCFG_PDS	0x00000020	/* PHY debug mode */
+#define	CAS_SATURN_PCFG_MTP	0x00000080	/* test point select */
+#define	CAS_SATURN_PCFG_GMO	0x00000100	/* GMII observe */
+#define	CAS_SATURN_PCFG_FSI	0x00000200	/* freeze GMII/SERDES */
+#define	CAS_SATURN_PCFG_LAD	0x00000800	/* MAC LED control active low */
+
 /* TX DMA registers */
 #define	CAS_TX_CONF		0x2004	/* TX configuration */
 #define	CAS_TX_FIFO_WR		0x2014	/* FIFO write pointer */

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:12:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1C031065781;
	Fri, 14 May 2010 19:12:06 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A13958FC14;
	Fri, 14 May 2010 19:12:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJC6TT044660;
	Fri, 14 May 2010 19:12:06 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJC6aB044658;
	Fri, 14 May 2010 19:12:06 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005141912.o4EJC6aB044658@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 19:12: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: r208088 - head/usr.sbin/mergemaster
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 19:12:09 -0000

Author: dougb
Date: Fri May 14 19:12:06 2010
New Revision: 208088
URL: http://svn.freebsd.org/changeset/base/208088

Log:
  Hide the creation and population of the temproot

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.sh	Fri May 14 19:12:01 2010	(r208087)
+++ head/usr.sbin/mergemaster/mergemaster.sh	Fri May 14 19:12:06 2010	(r208088)
@@ -617,14 +617,14 @@ case "${RERUN}" in
       case "${DESTDIR}" in
       '') ;;
       *)
-        ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs
+        ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs >/dev/null
         ;;
       esac
       od=${TEMPROOT}/usr/obj
-      ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs &&
-      MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc &&
-      MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc &&
-      MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} ||
+      ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs >/dev/null &&
+      MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null &&
+      MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null &&
+      MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} ||
     { echo '';
      echo "  *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to";
       echo "      the temproot environment";

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:14:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6672C1065670;
	Fri, 14 May 2010 19:14:59 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 560A88FC15;
	Fri, 14 May 2010 19:14:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJExjW045386;
	Fri, 14 May 2010 19:14:59 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJExNv045384;
	Fri, 14 May 2010 19:14:59 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005141914.o4EJExNv045384@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 19:14: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: r208089 - head/usr.bin/calendar/calendars
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 19:14:59 -0000

Author: dougb
Date: Fri May 14 19:14:59 2010
New Revision: 208089
URL: http://svn.freebsd.org/changeset/base/208089

Log:
  Remove duplicate

Modified:
  head/usr.bin/calendar/calendars/calendar.history

Modified: head/usr.bin/calendar/calendars/calendar.history
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.history	Fri May 14 19:12:06 2010	(r208088)
+++ head/usr.bin/calendar/calendars/calendar.history	Fri May 14 19:14:59 2010	(r208089)
@@ -80,7 +80,6 @@
 03/15	Watts, Los Angeles, riots kill two, injure 25, 1966
 03/15	Ides of March.  Gaius Julius Caesar assassinated by senators,
 	including adoptive son Marcus Junius Brutus Caepio, 44BC
-03/16	First liquid-fuel-powered rocket flight, 1926
 03/16	MyLai Massacre; 300 non-combatant villagers killed by US infantrymen
 03/16	Robert Goddard launches first liquid-fueled rocket, Auburn MA, 1926
 03/17	Vanguard I launched, 1958.  Earth proved pear-shaped

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:15:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2A6F1065673;
	Fri, 14 May 2010 19:15:51 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 918428FC19;
	Fri, 14 May 2010 19:15:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJFpY4045604;
	Fri, 14 May 2010 19:15:51 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJFpXn045602;
	Fri, 14 May 2010 19:15:51 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141915.o4EJFpXn045602@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:15:51 +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: r208090 - stable/8/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 19:15:51 -0000

Author: marius
Date: Fri May 14 19:15:51 2010
New Revision: 208090
URL: http://svn.freebsd.org/changeset/base/208090

Log:
  MFC: r207586
  
  Sun GigaSwift Ethernet 1.0 MMF work with r207585 (MFC'ed to stable/8 in
  r208086) in place.

Modified:
  stable/8/share/man/man4/cas.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/cas.4
==============================================================================
--- stable/8/share/man/man4/cas.4	Fri May 14 19:14:59 2010	(r208089)
+++ stable/8/share/man/man4/cas.4	Fri May 14 19:15:51 2010	(r208090)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 15, 2009
+.Dd May 3, 2010
 .Dt CAS 4
 .Os
 .Sh NAME
@@ -91,6 +91,9 @@ driver at this time:
 .Pp
 .Bl -bullet -compact
 .It
+Sun GigaSwift Ethernet 1.0 MMF (Cassini Kuheen)
+(part no.\& 501-5524)
+.It
 Sun GigaSwift Ethernet 1.0 UTP (Cassini)
 (part no.\& 501-5902)
 .It

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:15:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90F4D1065676;
	Fri, 14 May 2010 19:15:55 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 801988FC1E;
	Fri, 14 May 2010 19:15:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJFtdh045668;
	Fri, 14 May 2010 19:15:55 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJFta8045666;
	Fri, 14 May 2010 19:15:55 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141915.o4EJFta8045666@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:15:55 +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: r208091 - stable/7/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 19:15:55 -0000

Author: marius
Date: Fri May 14 19:15:55 2010
New Revision: 208091
URL: http://svn.freebsd.org/changeset/base/208091

Log:
  MFC: r207586
  
  Sun GigaSwift Ethernet 1.0 MMF work with r207585 (MFC'ed to stable/7 in
  r208087) in place.

Modified:
  stable/7/share/man/man4/cas.4
Directory Properties:
  stable/7/share/man/man4/   (props changed)

Modified: stable/7/share/man/man4/cas.4
==============================================================================
--- stable/7/share/man/man4/cas.4	Fri May 14 19:15:51 2010	(r208090)
+++ stable/7/share/man/man4/cas.4	Fri May 14 19:15:55 2010	(r208091)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 15, 2009
+.Dd May 3, 2010
 .Dt CAS 4
 .Os
 .Sh NAME
@@ -91,6 +91,9 @@ driver at this time:
 .Pp
 .Bl -bullet -compact
 .It
+Sun GigaSwift Ethernet 1.0 MMF (Cassini Kuheen)
+(part no.\& 501-5524)
+.It
 Sun GigaSwift Ethernet 1.0 UTP (Cassini)
 (part no.\& 501-5902)
 .It

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:18:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC07C1065670;
	Fri, 14 May 2010 19:18:06 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CB4B88FC16;
	Fri, 14 May 2010 19:18:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJI6eg046201;
	Fri, 14 May 2010 19:18:06 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJI6YY046199;
	Fri, 14 May 2010 19:18:06 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141918.o4EJI6YY046199@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:18:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208092 - stable/7/sys/dev/esp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 19:18:07 -0000

Author: marius
Date: Fri May 14 19:18:06 2010
New Revision: 208092
URL: http://svn.freebsd.org/changeset/base/208092

Log:
  MFC: r207885
  
  Include  for OF_getscsinitid().

Modified:
  stable/7/sys/dev/esp/esp_sbus.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/esp/esp_sbus.c
==============================================================================
--- stable/7/sys/dev/esp/esp_sbus.c	Fri May 14 19:15:55 2010	(r208091)
+++ stable/7/sys/dev/esp/esp_sbus.c	Fri May 14 19:18:06 2010	(r208092)
@@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:18:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 479C91065673;
	Fri, 14 May 2010 19:18:08 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 36E408FC13;
	Fri, 14 May 2010 19:18:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJI8ht046231;
	Fri, 14 May 2010 19:18:08 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJI8S5046229;
	Fri, 14 May 2010 19:18:08 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005141918.o4EJI8S5046229@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 19:18:08 +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: r208093 - stable/8/sys/dev/esp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 19:18:08 -0000

Author: marius
Date: Fri May 14 19:18:07 2010
New Revision: 208093
URL: http://svn.freebsd.org/changeset/base/208093

Log:
  MFC: r207885
  
  Include  for OF_getscsinitid().

Modified:
  stable/8/sys/dev/esp/esp_sbus.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/esp/esp_sbus.c
==============================================================================
--- stable/8/sys/dev/esp/esp_sbus.c	Fri May 14 19:18:06 2010	(r208092)
+++ stable/8/sys/dev/esp/esp_sbus.c	Fri May 14 19:18:07 2010	(r208093)
@@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:28:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3571E106566B;
	Fri, 14 May 2010 19:28:17 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 229078FC1A;
	Fri, 14 May 2010 19:28:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJSG28048555;
	Fri, 14 May 2010 19:28:16 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJSGiQ048531;
	Fri, 14 May 2010 19:28:16 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005141928.o4EJSGiQ048531@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 19:28:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208094 - in stable/8/etc: . defaults periodic/daily
	periodic/weekly 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, 14 May 2010 19:28:17 -0000

Author: dougb
Date: Fri May 14 19:28:16 2010
New Revision: 208094
URL: http://svn.freebsd.org/changeset/base/208094

Log:
  MFC 208060:
  
  Remove trailing white space. No functional changes.

Modified:
  stable/8/etc/defaults/rc.conf
  stable/8/etc/devd.conf
  stable/8/etc/network.subr
  stable/8/etc/periodic/daily/310.accounting
  stable/8/etc/periodic/daily/440.status-mailq
  stable/8/etc/periodic/weekly/330.catman
  stable/8/etc/rc.d/bluetooth
  stable/8/etc/rc.d/bridge
  stable/8/etc/rc.d/cleanvar
  stable/8/etc/rc.d/defaultroute
  stable/8/etc/rc.d/geli
  stable/8/etc/rc.d/geli2
  stable/8/etc/rc.d/ipfw
  stable/8/etc/rc.d/mdconfig
  stable/8/etc/rc.d/mdconfig2
  stable/8/etc/rc.d/nscd
  stable/8/etc/rc.d/rfcomm_pppd_server
  stable/8/etc/rc.d/syscons
  stable/8/etc/rc.d/ubthidhci
  stable/8/etc/rc.firewall
  stable/8/etc/rc.initdiskless
  stable/8/etc/regdomain.xml
  stable/8/etc/services
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/defaults/rc.conf
==============================================================================
--- stable/8/etc/defaults/rc.conf	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/defaults/rc.conf	Fri May 14 19:28:16 2010	(r208094)
@@ -217,7 +217,7 @@ ifconfig_lo0="inet 127.0.0.1"	# default 
 #wlandebug_wlan0="scan+auth+assoc"	# Set debug flags with wlanddebug(8)
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
-#autobridge_interfaces="bridge0"	# List of bridges to check 
+#autobridge_interfaces="bridge0"	# List of bridges to check
 #autobridge_bridge0="tap* vlan0"	# Interface glob to automatically add to the bridge
 #
 # If you have any sppp(4) interfaces above, you might also want to set
@@ -657,11 +657,11 @@ jail_sysvipc_allow="NO"	# Allow SystemV 
 #jail_example_rootdir="/usr/jail/default"	# Jail's root directory
 #jail_example_hostname="default.domain.com"	# Jail's hostname
 #jail_example_interface=""			# Jail's interface variable to create IP aliases on
-#jail_example_fib="0"				# Routing table for setfib(1) 
+#jail_example_fib="0"				# Routing table for setfib(1)
 #jail_example_ip="192.0.2.10,2001:db8::17"	# Jail's primary IPv4 and IPv6 address
 #jail_example_ip_multi0="2001:db8::10"		#  and another IPv6 address
 #jail_example_exec_start="/bin/sh /etc/rc"		# command to execute in jail for starting
-#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for 
+#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for
 							# starting the jail. More than one can be
 							# specified using a trailing number
 #jail_example_exec_stop="/bin/sh /etc/rc.shutdown"	# command to execute in jail for stopping

Modified: stable/8/etc/devd.conf
==============================================================================
--- stable/8/etc/devd.conf	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/devd.conf	Fri May 14 19:28:16 2010	(r208094)
@@ -112,10 +112,10 @@ attach 100 {
 	action "/etc/rc.d/moused quietstart $device-name";
 };
 
-detach 100 { 
-        device-name "ums[0-9]+"; 
-        action "/etc/rc.d/moused stop $device-name"; 
-}; 
+detach 100 {
+        device-name "ums[0-9]+";
+        action "/etc/rc.d/moused stop $device-name";
+};
 
 # Firmware download into the ActiveWire board. After the firmware download is
 # done the device detaches and reappears as something new and shiny

Modified: stable/8/etc/network.subr
==============================================================================
--- stable/8/etc/network.subr	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/network.subr	Fri May 14 19:28:16 2010	(r208094)
@@ -339,7 +339,7 @@ ifexists()
 }
 
 # ipv4_up if
-#  add IPv4 addresses to the interface $if 
+#  add IPv4 addresses to the interface $if
 ipv4_up()
 {
 	_if=$1
@@ -384,14 +384,14 @@ ipv4_down()
 #   Evaluate the ifconfig_if_ipv4 arguments for interface $if
 #   and use $action to add or remove IPv4 addresses from $if.
 ipv4_addrs_common()
-{  
+{
 	_ret=1
 	_if=$1
 	_action=$2
-    
+
 	# get ipv4-addresses
 	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
-    
+
 	for _cidr in ${cidr_addr}; do
 		_ipaddr=${_cidr%%/*}
 		_netmask="/"${_cidr##*/}
@@ -404,7 +404,7 @@ ipv4_addrs_common()
 		if [ "${_action}" = "-alias" ]; then
 			_netmask=""
 		fi
-        
+
 		_ipcount=${_iplow}
 		while [ "${_ipcount}" -le "${_iphigh}" ]; do
 			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"

Modified: stable/8/etc/periodic/daily/310.accounting
==============================================================================
--- stable/8/etc/periodic/daily/310.accounting	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/periodic/daily/310.accounting	Fri May 14 19:28:16 2010	(r208094)
@@ -29,7 +29,7 @@ case "$daily_accounting_enable" in
 
 	    cd /var/account
 	    rc=0
-	
+
 	    n=$daily_accounting_save
 	    rm -f acct.$n.gz acct.$n || rc=3
 	    m=$n

Modified: stable/8/etc/periodic/daily/440.status-mailq
==============================================================================
--- stable/8/etc/periodic/daily/440.status-mailq	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/periodic/daily/440.status-mailq	Fri May 14 19:28:16 2010	(r208094)
@@ -59,7 +59,7 @@ case "$daily_status_mailq_enable" in
 		fi;;
 	    esac
 	fi;;
-		
+
     *)  rc=0;;
 esac
 

Modified: stable/8/etc/periodic/weekly/330.catman
==============================================================================
--- stable/8/etc/periodic/weekly/330.catman	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/periodic/weekly/330.catman	Fri May 14 19:28:16 2010	(r208094)
@@ -27,13 +27,13 @@ case "$weekly_catman_enable" in
 	    then
 		if [ -z "${MANPATH}" ]
 		then
-		    echo "manpath failed to find any manpath directories" 
+		    echo "manpath failed to find any manpath directories"
 		    rc=3
 		else
 		    man_locales=`/usr/bin/manpath -qL`
 		    rc=0
-         
-		    # Preformat original, non-localized manpages  
+
+		    # Preformat original, non-localized manpages
 		    echo /usr/libexec/catman.local -r "$MANPATH" |
 			su -fm man || rc=3
 

Modified: stable/8/etc/rc.d/bluetooth
==============================================================================
--- stable/8/etc/rc.d/bluetooth	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/bluetooth	Fri May 14 19:28:16 2010	(r208094)
@@ -95,7 +95,7 @@ bluetooth_setup_stack()
 	hook=$1
 	shift
 
-	# Setup HCI 
+	# Setup HCI
 	ngctl mkpeer ${dev}: hci ${hook} drv \
 		> /dev/null 2>&1 || return 1
 
@@ -282,7 +282,7 @@ bluetooth_start()
 		;;
 	esac
 
-	# Be backward compatible and setup reasonable defaults 
+	# Be backward compatible and setup reasonable defaults
 	bluetooth_device_authentication_enable="0"
 	bluetooth_device_class="ff:01:0c"
 	bluetooth_device_connectable="1"
@@ -312,7 +312,7 @@ bluetooth_start()
 		bluetooth_shutdown_stack $dev
 		err 1 "Unable to setup Bluetooth stack for device ${dev}"
 	fi
-		
+
 	return 0
 }
 

Modified: stable/8/etc/rc.d/bridge
==============================================================================
--- stable/8/etc/rc.d/bridge	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/bridge	Fri May 14 19:28:16 2010	(r208094)
@@ -42,7 +42,7 @@ glob_int () {
 		$2 ) true ;;
 		* ) false ;;
 	esac
-} 
+}
 
 bridge_test () {
 	bridge=$1

Modified: stable/8/etc/rc.d/cleanvar
==============================================================================
--- stable/8/etc/rc.d/cleanvar	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/cleanvar	Fri May 14 19:28:16 2010	(r208094)
@@ -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: stable/8/etc/rc.d/defaultroute
==============================================================================
--- stable/8/etc/rc.d/defaultroute	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/defaultroute	Fri May 14 19:28:16 2010	(r208094)
@@ -26,7 +26,7 @@ defaultroute_start()
 	[ -z "${dhcp_interfaces}" ] && return
 	carrier=false
 	for _if in ${dhcp_interfaces}; do
-		output=`/sbin/ifconfig ${_if}` 
+		output=`/sbin/ifconfig ${_if}`
 		nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
 		[ -z "${nocarrier}" ] && carrier=true
 	done

Modified: stable/8/etc/rc.d/geli
==============================================================================
--- stable/8/etc/rc.d/geli	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/geli	Fri May 14 19:28:16 2010	(r208094)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/8/etc/rc.d/geli2
==============================================================================
--- stable/8/etc/rc.d/geli2	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/geli2	Fri May 14 19:28:16 2010	(r208094)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/8/etc/rc.d/ipfw
==============================================================================
--- stable/8/etc/rc.d/ipfw	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/ipfw	Fri May 14 19:28:16 2010	(r208094)
@@ -30,14 +30,14 @@ ipfw_prestart()
 		if ! checkyesno natd_enable; then
 			required_modules="$required_modules ipfw_nat"
 		fi
-	fi 
+	fi
 }
 
 ipfw_start()
 {
 	local   _firewall_type
 
-	_firewall_type=$1 
+	_firewall_type=$1
 
 	# set the firewall rules script if none was specified
 	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall

Modified: stable/8/etc/rc.d/mdconfig
==============================================================================
--- stable/8/etc/rc.d/mdconfig	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/mdconfig	Fri May 14 19:28:16 2010	(r208094)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -139,7 +139,7 @@ mdconfig_start()
 				if ! eval ${_fsck_cmd} -p ${_dev} >/dev/null; then
 					echo "Fsck failed on ${_dev}, not mounting the filesystem."
 					continue
-					
+
 				fi
 			else
 				newfs ${_newfs} ${_dev} >/dev/null
@@ -194,5 +194,5 @@ if [ -z "${_mdconfig_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig_cmd}"

Modified: stable/8/etc/rc.d/mdconfig2
==============================================================================
--- stable/8/etc/rc.d/mdconfig2	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/mdconfig2	Fri May 14 19:28:16 2010	(r208094)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -223,5 +223,5 @@ if [ -z "${_mdconfig2_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig2_cmd}"

Modified: stable/8/etc/rc.d/nscd
==============================================================================
--- stable/8/etc/rc.d/nscd	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/nscd	Fri May 14 19:28:16 2010	(r208094)
@@ -34,7 +34,7 @@ _nscd_set_option() {
 
 	_nscd_opt_val=$(eval "echo \$nscd_${_optname}")
 	_cached_opt_val=$(eval "echo \$cached_${_optname}")
-	
+
 	if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
 		warn "You should use nscd_${_optname} instead of" \
 		    "cached_${_optname}"

Modified: stable/8/etc/rc.d/rfcomm_pppd_server
==============================================================================
--- stable/8/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:28:16 2010	(r208094)
@@ -46,7 +46,7 @@ rfcomm_pppd_server_start_profile()
 		_channel=1
 	fi
 	rc_flags="${rc_flags} -C ${_channel}"
-	
+
 	# Check for RFCOMM PPP profile register SP override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_sp
@@ -55,7 +55,7 @@ rfcomm_pppd_server_start_profile()
 			rc_flags="${rc_flags} -S"
 		fi
 	fi
-	
+
 	# Check for RFCOMM PPP profile register DUN override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_dun

Modified: stable/8/etc/rc.d/syscons
==============================================================================
--- stable/8/etc/rc.d/syscons	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/syscons	Fri May 14 19:28:16 2010	(r208094)
@@ -121,7 +121,7 @@ syscons_configure_keyboard()
 syscons_setkeyboard()
 {
 	kbd=$1
-                
+
 	if [ -z "${kbd}" ]; then
 		return 1
 	fi

Modified: stable/8/etc/rc.d/ubthidhci
==============================================================================
--- stable/8/etc/rc.d/ubthidhci	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.d/ubthidhci	Fri May 14 19:28:16 2010	(r208094)
@@ -4,8 +4,8 @@
 #
 
 # PROVIDE: ubthidhci
-# REQUIRE: DAEMON 
-# BEFORE: bluetooth 
+# REQUIRE: DAEMON
+# BEFORE: bluetooth
 # KEYWORD: nojail shutdown
 
 . /etc/rc.subr

Modified: stable/8/etc/rc.firewall
==============================================================================
--- stable/8/etc/rc.firewall	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.firewall	Fri May 14 19:28:16 2010	(r208094)
@@ -461,7 +461,7 @@ case ${firewall_type} in
 	if [ $ipv6_available -eq 0 ]; then
 		${fwcmd} add pass udp from fe80::/10 to me 546 in
 	fi
-	# Some servers will ping the IP while trying to decide if it's 
+	# Some servers will ping the IP while trying to decide if it's
 	# still in use.
 	${fwcmd} add pass icmp from any to any icmptype 8
 	if [ $ipv6_available -eq 0 ]; then
@@ -476,11 +476,11 @@ case ${firewall_type} in
 
 	# Add permits for this workstations published services below
 	# Only IPs and nets in firewall_allowservices is allowed in.
-	# If you really wish to let anyone use services on your 
+	# If you really wish to let anyone use services on your
 	# workstation, then set "firewall_allowservices='any'" in /etc/rc.conf
 	#
 	# Note: We don't use keep-state as that would allow DoS of
-	#       our statetable. 
+	#       our statetable.
 	#       You can add 'keep-state' to the lines for slightly
 	#       better performance if you fell that DoS of your
 	#       workstation won't be a problem.

Modified: stable/8/etc/rc.initdiskless
==============================================================================
--- stable/8/etc/rc.initdiskless	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/rc.initdiskless	Fri May 14 19:28:16 2010	(r208094)
@@ -119,7 +119,7 @@
 #		Similar to /conf/T/M/diskless_remount above, but allows
 #		all of /conf to be remounted.  This can be used to allow
 #		multiple roots to share the same /conf.
-#		
+#
 #
 # You will almost universally want to create the following files under /conf
 #

Modified: stable/8/etc/regdomain.xml
==============================================================================
--- stable/8/etc/regdomain.xml	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/regdomain.xml	Fri May 14 19:28:16 2010	(r208094)
@@ -1,7 +1,7 @@
 
 
@@ -1200,7 +1200,7 @@
 
 
 
 

Modified: stable/8/etc/services
==============================================================================
--- stable/8/etc/services	Fri May 14 19:18:07 2010	(r208093)
+++ stable/8/etc/services	Fri May 14 19:28:16 2010	(r208094)
@@ -1243,8 +1243,8 @@ dctp		675/tcp
 dctp		675/udp
 vpps-via	676/tcp    #VPPS Via
 vpps-via	676/udp    #VPPS Via
-vpp		677/tcp    #Virtual Presence Protocol 
-vpp		677/udp    #Virtual Presence Protocol 
+vpp		677/tcp    #Virtual Presence Protocol
+vpp		677/udp    #Virtual Presence Protocol
 ggf-ncp		678/tcp    #GNU Generation Foundation NCP
 ggf-ncp		678/udp    #GNU Generation Foundation NCP
 mrm             679/tcp
@@ -1255,8 +1255,8 @@ entrust-aams	681/tcp
 entrust-aams	681/udp
 xfr             682/tcp
 xfr             682/udp
-corba-iiop      683/tcp    #CORBA IIOP 
-corba-iiop      683/udp    #CORBA IIOP 
+corba-iiop      683/tcp    #CORBA IIOP
+corba-iiop      683/udp    #CORBA IIOP
 corba-iiop-ssl	684/tcp    #CORBA IIOP SSL
 corba-iiop-ssl	684/udp    #CORBA IIOP SSL
 mdc-portmapper	685/tcp    #MDC Port Mapper
@@ -1311,8 +1311,8 @@ cisco-tdp       711/tcp    #Cisco TDP
 cisco-tdp       711/udp    #Cisco TDP
 tbrpf           712/tcp
 tbrpf           712/udp
-iris-xpc	713/tcp    #IRIS over XPC 
-iris-xpc	713/udp    #IRIS over XPC 
+iris-xpc	713/tcp    #IRIS over XPC
+iris-xpc	713/udp    #IRIS over XPC
 iris-xpcs	714/tcp    #IRIS over XPCS
 iris-xpcs	714/udp    #IRIS over XPCS
 iris-lwz	715/tcp
@@ -1412,7 +1412,7 @@ pkix-3-ca-ra	829/tcp    #PKIX-3 CA/RA
 pkix-3-ca-ra    829/udp    #PKIX-3 CA/RA
 netconf-ssh     830/tcp    #NETCONF over SSH
 netconf-ssh     830/udp    #NETCONF over SSH
-netconf-beep    831/tcp    #NETCONF over BEEP 
+netconf-beep    831/tcp    #NETCONF over BEEP
 netconf-beep    831/udp    #NETCONF over BEEP
 netconfsoaphttp 832/tcp    #NETCONF for SOAP over HTTPS
 netconfsoaphttp 832/udp    #NETCONF for SOAP over HTTPS
@@ -1444,14 +1444,14 @@ ideafarm-chat   902/tcp
 ideafarm-chat   902/udp
 ideafarm-catch  903/tcp
 ideafarm-catch  903/udp
-kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK) 
+kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK)
 kink            910/udp    #Kerberized Internet Negotiation of Keys (KINK)
 xact-backup     911/tcp
 xact-backup     911/udp
 apex-mesh       912/tcp    #APEX relay-relay service
 apex-mesh       912/udp    #APEX relay-relay service
 apex-edge       913/tcp    #APEX endpoint-relay service
-apex-edge       913/udp    #APEX endpoint-relay service    
+apex-edge       913/udp    #APEX endpoint-relay service
 rndc		953/tcp	   # named's rndc control socket
 ftps-data	989/tcp	   # ftp protocol, data, over TLS/SSL
 ftps-data	989/udp

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:36:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF2C8106566B;
	Fri, 14 May 2010 19:36:11 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC5078FC16;
	Fri, 14 May 2010 19:36:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJaBHN050332;
	Fri, 14 May 2010 19:36:11 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJaBHd050312;
	Fri, 14 May 2010 19:36:11 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005141936.o4EJaBHd050312@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 19:36:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208095 - in stable/7/etc: . defaults periodic/daily
	periodic/weekly 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, 14 May 2010 19:36:12 -0000

Author: dougb
Date: Fri May 14 19:36:11 2010
New Revision: 208095
URL: http://svn.freebsd.org/changeset/base/208095

Log:
  MFC 208060:
  
  Remove trailing white space. No functional changes.
  
  Hand-delete trailing ws from rc.firewall while I'm here.

Modified:
  stable/7/etc/defaults/rc.conf
  stable/7/etc/network.subr
  stable/7/etc/periodic/daily/310.accounting
  stable/7/etc/periodic/daily/440.status-mailq
  stable/7/etc/periodic/weekly/330.catman
  stable/7/etc/rc.d/bluetooth
  stable/7/etc/rc.d/bridge
  stable/7/etc/rc.d/cleanvar
  stable/7/etc/rc.d/geli
  stable/7/etc/rc.d/geli2
  stable/7/etc/rc.d/ipfw
  stable/7/etc/rc.d/mdconfig
  stable/7/etc/rc.d/mdconfig2
  stable/7/etc/rc.d/nscd
  stable/7/etc/rc.d/rfcomm_pppd_server
  stable/7/etc/rc.d/syscons
  stable/7/etc/rc.firewall
  stable/7/etc/rc.initdiskless
  stable/7/etc/services
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/defaults/rc.conf
==============================================================================
--- stable/7/etc/defaults/rc.conf	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/defaults/rc.conf	Fri May 14 19:36:11 2010	(r208095)
@@ -198,7 +198,7 @@ ifconfig_lo0="inet 127.0.0.1"	# default 
 #create_arg_vlan0="vlan 102"	# vlan tag for vlan0 device
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
-#autobridge_interfaces="bridge0"	# List of bridges to check 
+#autobridge_interfaces="bridge0"	# List of bridges to check
 #autobridge_bridge0="tap* vlan0"	# Interface glob to automatically add to the bridge
 #
 # If you have any sppp(4) interfaces above, you might also want to set
@@ -636,11 +636,11 @@ jail_sysvipc_allow="NO"	# Allow SystemV 
 #jail_example_rootdir="/usr/jail/default"	# Jail's root directory
 #jail_example_hostname="default.domain.com"	# Jail's hostname
 #jail_example_interface=""			# Jail's interface variable to create IP aliases on
-#jail_example_fib="0"				# Routing table for setfib(1) 
+#jail_example_fib="0"				# Routing table for setfib(1)
 #jail_example_ip="192.0.2.10,2001:db8::17"	# Jail's primary IPv4 and IPv6 address
 #jail_example_ip_multi0="2001:db8::10"		#  and another IPv6 address
 #jail_example_exec_start="/bin/sh /etc/rc"		# command to execute in jail for starting
-#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for 
+#jail_example_exec_afterstart0="/bin/sh command"	# command to execute after the one for
 							# starting the jail. More than one can be
 							# specified using a trailing number
 #jail_example_exec_stop="/bin/sh /etc/rc.shutdown"	# command to execute in jail for stopping

Modified: stable/7/etc/network.subr
==============================================================================
--- stable/7/etc/network.subr	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/network.subr	Fri May 14 19:36:11 2010	(r208095)
@@ -308,7 +308,7 @@ ifexists()
 }
 
 # ipv4_up if
-#  add IPv4 addresses to the interface $if 
+#  add IPv4 addresses to the interface $if
 ipv4_up()
 {
 	_if=$1
@@ -353,14 +353,14 @@ ipv4_down()
 #   Evaluate the ifconfig_if_ipv4 arguments for interface $if
 #   and use $action to add or remove IPv4 addresses from $if.
 ipv4_addrs_common()
-{  
+{
 	_ret=1
 	_if=$1
 	_action=$2
-    
+
 	# get ipv4-addresses
 	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
-    
+
 	for _cidr in ${cidr_addr}; do
 		_ipaddr=${_cidr%%/*}
 		_netmask="/"${_cidr##*/}
@@ -373,7 +373,7 @@ ipv4_addrs_common()
 		if [ "${_action}" = "-alias" ]; then
 			_netmask=""
 		fi
-        
+
 		_ipcount=${_iplow}
 		while [ "${_ipcount}" -le "${_iphigh}" ]; do
 			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"

Modified: stable/7/etc/periodic/daily/310.accounting
==============================================================================
--- stable/7/etc/periodic/daily/310.accounting	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/periodic/daily/310.accounting	Fri May 14 19:36:11 2010	(r208095)
@@ -29,7 +29,7 @@ case "$daily_accounting_enable" in
 
 	    cd /var/account
 	    rc=0
-	
+
 	    n=$daily_accounting_save
 	    rm -f acct.$n.gz acct.$n || rc=3
 	    m=$n

Modified: stable/7/etc/periodic/daily/440.status-mailq
==============================================================================
--- stable/7/etc/periodic/daily/440.status-mailq	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/periodic/daily/440.status-mailq	Fri May 14 19:36:11 2010	(r208095)
@@ -59,7 +59,7 @@ case "$daily_status_mailq_enable" in
 		fi;;
 	    esac
 	fi;;
-		
+
     *)  rc=0;;
 esac
 

Modified: stable/7/etc/periodic/weekly/330.catman
==============================================================================
--- stable/7/etc/periodic/weekly/330.catman	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/periodic/weekly/330.catman	Fri May 14 19:36:11 2010	(r208095)
@@ -27,13 +27,13 @@ case "$weekly_catman_enable" in
 	    then
 		if [ -z "${MANPATH}" ]
 		then
-		    echo "manpath failed to find any manpath directories" 
+		    echo "manpath failed to find any manpath directories"
 		    rc=3
 		else
 		    man_locales=`/usr/bin/manpath -qL`
 		    rc=0
-         
-		    # Preformat original, non-localized manpages  
+
+		    # Preformat original, non-localized manpages
 		    echo /usr/libexec/catman.local -r "$MANPATH" |
 			su -fm man || rc=3
 

Modified: stable/7/etc/rc.d/bluetooth
==============================================================================
--- stable/7/etc/rc.d/bluetooth	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/bluetooth	Fri May 14 19:36:11 2010	(r208095)
@@ -95,7 +95,7 @@ bluetooth_setup_stack()
 	hook=$1
 	shift
 
-	# Setup HCI 
+	# Setup HCI
 	ngctl mkpeer ${dev}: hci ${hook} drv \
 		> /dev/null 2>&1 || return 1
 
@@ -282,7 +282,7 @@ bluetooth_start()
 		;;
 	esac
 
-	# Be backward compatible and setup reasonable defaults 
+	# Be backward compatible and setup reasonable defaults
 	bluetooth_device_authentication_enable="0"
 	bluetooth_device_class="ff:01:0c"
 	bluetooth_device_connectable="1"
@@ -312,7 +312,7 @@ bluetooth_start()
 		bluetooth_shutdown_stack $dev
 		err 1 "Unable to setup Bluetooth stack for device ${dev}"
 	fi
-		
+
 	return 0
 }
 

Modified: stable/7/etc/rc.d/bridge
==============================================================================
--- stable/7/etc/rc.d/bridge	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/bridge	Fri May 14 19:36:11 2010	(r208095)
@@ -42,7 +42,7 @@ glob_int () {
 		$2 ) true ;;
 		* ) false ;;
 	esac
-} 
+}
 
 bridge_test () {
 	bridge=$1

Modified: stable/7/etc/rc.d/cleanvar
==============================================================================
--- stable/7/etc/rc.d/cleanvar	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/cleanvar	Fri May 14 19:36:11 2010	(r208095)
@@ -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: stable/7/etc/rc.d/geli
==============================================================================
--- stable/7/etc/rc.d/geli	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/geli	Fri May 14 19:36:11 2010	(r208095)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/7/etc/rc.d/geli2
==============================================================================
--- stable/7/etc/rc.d/geli2	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/geli2	Fri May 14 19:36:11 2010	(r208095)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/7/etc/rc.d/ipfw
==============================================================================
--- stable/7/etc/rc.d/ipfw	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/ipfw	Fri May 14 19:36:11 2010	(r208095)
@@ -29,14 +29,14 @@ ipfw_prestart()
 		if ! checkyesno natd_enable; then
 			required_modules="$required_modules ipfw_nat"
 		fi
-	fi 
+	fi
 }
 
 ipfw_start()
 {
 	local   _firewall_type
 
-	_firewall_type=$1 
+	_firewall_type=$1
 
 	# set the firewall rules script if none was specified
 	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall

Modified: stable/7/etc/rc.d/mdconfig
==============================================================================
--- stable/7/etc/rc.d/mdconfig	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/mdconfig	Fri May 14 19:36:11 2010	(r208095)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -139,7 +139,7 @@ mdconfig_start()
 				if ! eval ${_fsck_cmd} -p ${_dev} >/dev/null; then
 					echo "Fsck failed on ${_dev}, not mounting the filesystem."
 					continue
-					
+
 				fi
 			else
 				newfs ${_newfs} ${_dev} >/dev/null
@@ -194,5 +194,5 @@ if [ -z "${_mdconfig_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig_cmd}"

Modified: stable/7/etc/rc.d/mdconfig2
==============================================================================
--- stable/7/etc/rc.d/mdconfig2	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/mdconfig2	Fri May 14 19:36:11 2010	(r208095)
@@ -49,7 +49,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -223,5 +223,5 @@ if [ -z "${_mdconfig2_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig2_cmd}"

Modified: stable/7/etc/rc.d/nscd
==============================================================================
--- stable/7/etc/rc.d/nscd	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/nscd	Fri May 14 19:36:11 2010	(r208095)
@@ -34,7 +34,7 @@ _nscd_set_option() {
 
 	_nscd_opt_val=$(eval "echo \$nscd_${_optname}")
 	_cached_opt_val=$(eval "echo \$cached_${_optname}")
-	
+
 	if [ -n "$_cached_opt_val" -a "$_nscd_opt_val" != "$_defoptval" ]; then
 		warn "You should use nscd_${_optname} instead of" \
 		    "cached_${_optname}"

Modified: stable/7/etc/rc.d/rfcomm_pppd_server
==============================================================================
--- stable/7/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:36:11 2010	(r208095)
@@ -46,7 +46,7 @@ rfcomm_pppd_server_start_profile()
 		_channel=1
 	fi
 	rc_flags="${rc_flags} -C ${_channel}"
-	
+
 	# Check for RFCOMM PPP profile register SP override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_sp
@@ -55,7 +55,7 @@ rfcomm_pppd_server_start_profile()
 			rc_flags="${rc_flags} -S"
 		fi
 	fi
-	
+
 	# Check for RFCOMM PPP profile register DUN override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_dun

Modified: stable/7/etc/rc.d/syscons
==============================================================================
--- stable/7/etc/rc.d/syscons	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.d/syscons	Fri May 14 19:36:11 2010	(r208095)
@@ -106,7 +106,7 @@ syscons_configure_keyboard()
 syscons_setkeyboard()
 {
 	kbd=$1
-                
+
 	if [ -z "${kbd}" ]; then
 		return 1
 	fi

Modified: stable/7/etc/rc.firewall
==============================================================================
--- stable/7/etc/rc.firewall	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.firewall	Fri May 14 19:36:11 2010	(r208095)
@@ -310,10 +310,10 @@ case ${firewall_type} in
 	#			 	 offers services.
 	#  firewall_allowservices:	List of IPs which has access to
 	#				 $firewall_myservices.
-	#  firewall_trusted:		List of IPs which has full access 
-	#				 to this host. Be very carefull 
+	#  firewall_trusted:		List of IPs which has full access
+	#				 to this host. Be very carefull
 	#				 when setting this. This option can
-	#				 seriously degrade the level of 
+	#				 seriously degrade the level of
 	#				 protection provided by the firewall.
 	#  firewall_logdeny:		Boolean (YES/NO) specifying if the
 	#				 default denied packets should be
@@ -321,7 +321,7 @@ case ${firewall_type} in
 	#  firewall_nologports:		List of TCP/UDP ports for which
 	#				 denied incomming packets are not
 	#				 logged.
-	
+
 	# Allow packets for which a state has been built.
 	${fwcmd} add check-state
 
@@ -337,20 +337,20 @@ case ${firewall_type} in
 	${fwcmd} add pass udp  from 0.0.0.0 68 to 255.255.255.255 67 out
 	${fwcmd} add pass udp  from any 67     to me 68 in
 	${fwcmd} add pass udp  from any 67     to 255.255.255.255 68 in
-	# Some servers will ping the IP while trying to decide if it's 
+	# Some servers will ping the IP while trying to decide if it's
 	# still in use.
 	${fwcmd} add pass icmp from any to any icmptype 8
 
 	# Allow "mandatory" ICMP in.
 	${fwcmd} add pass icmp from any to any icmptype 3,4,11
-	
+
 	# Add permits for this workstations published services below
 	# Only IPs and nets in firewall_allowservices is allowed in.
-	# If you really wish to let anyone use services on your 
+	# If you really wish to let anyone use services on your
 	# workstation, then set "firewall_allowservices='any'" in /etc/rc.conf
 	#
 	# Note: We don't use keep-state as that would allow DoS of
-	#       our statetable. 
+	#       our statetable.
 	#       You can add 'keep-state' to the lines for slightly
 	#       better performance if you fell that DoS of your
 	#       workstation won't be a problem.
@@ -367,7 +367,7 @@ case ${firewall_type} in
 	for i in ${firewall_trusted} ; do
 	  ${fwcmd} add pass ip from $i to me
 	done
-	
+
 	${fwcmd} add 65000 count ip from any to any
 
 	# Drop packets to ports where we don't want logging

Modified: stable/7/etc/rc.initdiskless
==============================================================================
--- stable/7/etc/rc.initdiskless	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/rc.initdiskless	Fri May 14 19:36:11 2010	(r208095)
@@ -119,7 +119,7 @@
 #		Similar to /conf/T/M/diskless_remount above, but allows
 #		all of /conf to be remounted.  This can be used to allow
 #		multiple roots to share the same /conf.
-#		
+#
 #
 # You will almost universally want to create the following files under /conf
 #

Modified: stable/7/etc/services
==============================================================================
--- stable/7/etc/services	Fri May 14 19:28:16 2010	(r208094)
+++ stable/7/etc/services	Fri May 14 19:36:11 2010	(r208095)
@@ -1243,8 +1243,8 @@ dctp		675/tcp
 dctp		675/udp
 vpps-via	676/tcp    #VPPS Via
 vpps-via	676/udp    #VPPS Via
-vpp		677/tcp    #Virtual Presence Protocol 
-vpp		677/udp    #Virtual Presence Protocol 
+vpp		677/tcp    #Virtual Presence Protocol
+vpp		677/udp    #Virtual Presence Protocol
 ggf-ncp		678/tcp    #GNU Generation Foundation NCP
 ggf-ncp		678/udp    #GNU Generation Foundation NCP
 mrm             679/tcp
@@ -1255,8 +1255,8 @@ entrust-aams	681/tcp
 entrust-aams	681/udp
 xfr             682/tcp
 xfr             682/udp
-corba-iiop      683/tcp    #CORBA IIOP 
-corba-iiop      683/udp    #CORBA IIOP 
+corba-iiop      683/tcp    #CORBA IIOP
+corba-iiop      683/udp    #CORBA IIOP
 corba-iiop-ssl	684/tcp    #CORBA IIOP SSL
 corba-iiop-ssl	684/udp    #CORBA IIOP SSL
 mdc-portmapper	685/tcp    #MDC Port Mapper
@@ -1311,8 +1311,8 @@ cisco-tdp       711/tcp    #Cisco TDP
 cisco-tdp       711/udp    #Cisco TDP
 tbrpf           712/tcp
 tbrpf           712/udp
-iris-xpc	713/tcp    #IRIS over XPC 
-iris-xpc	713/udp    #IRIS over XPC 
+iris-xpc	713/tcp    #IRIS over XPC
+iris-xpc	713/udp    #IRIS over XPC
 iris-xpcs	714/tcp    #IRIS over XPCS
 iris-xpcs	714/udp    #IRIS over XPCS
 iris-lwz	715/tcp
@@ -1412,7 +1412,7 @@ pkix-3-ca-ra	829/tcp    #PKIX-3 CA/RA
 pkix-3-ca-ra    829/udp    #PKIX-3 CA/RA
 netconf-ssh     830/tcp    #NETCONF over SSH
 netconf-ssh     830/udp    #NETCONF over SSH
-netconf-beep    831/tcp    #NETCONF over BEEP 
+netconf-beep    831/tcp    #NETCONF over BEEP
 netconf-beep    831/udp    #NETCONF over BEEP
 netconfsoaphttp 832/tcp    #NETCONF for SOAP over HTTPS
 netconfsoaphttp 832/udp    #NETCONF for SOAP over HTTPS
@@ -1444,14 +1444,14 @@ ideafarm-chat   902/tcp
 ideafarm-chat   902/udp
 ideafarm-catch  903/tcp
 ideafarm-catch  903/udp
-kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK) 
+kink            910/tcp    #Kerberized Internet Negotiation of Keys (KINK)
 kink            910/udp    #Kerberized Internet Negotiation of Keys (KINK)
 xact-backup     911/tcp
 xact-backup     911/udp
 apex-mesh       912/tcp    #APEX relay-relay service
 apex-mesh       912/udp    #APEX relay-relay service
 apex-edge       913/tcp    #APEX endpoint-relay service
-apex-edge       913/udp    #APEX endpoint-relay service    
+apex-edge       913/udp    #APEX endpoint-relay service
 rndc		953/tcp	   # named's rndc control socket
 ftps-data	989/tcp	   # ftp protocol, data, over TLS/SSL
 ftps-data	989/udp

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 19:57:19 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D869106564A;
	Fri, 14 May 2010 19:57:19 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6AB818FC19;
	Fri, 14 May 2010 19:57:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EJvJWT055080;
	Fri, 14 May 2010 19:57:19 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EJvJbr055061;
	Fri, 14 May 2010 19:57:19 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201005141957.o4EJvJbr055061@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 14 May 2010 19:57:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208096 - in stable/6/etc: . defaults periodic/daily
	periodic/weekly 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, 14 May 2010 19:57:19 -0000

Author: dougb
Date: Fri May 14 19:57:18 2010
New Revision: 208096
URL: http://svn.freebsd.org/changeset/base/208096

Log:
  MFC 208060:
  
  Remove trailing white space. No functional changes.
  
  Hand-delete trailing ws from rc.subr, rc.d/nsswitch, and rc.d/nfslocking
  while I'm here.

Modified:
  stable/6/etc/defaults/rc.conf
  stable/6/etc/network.subr
  stable/6/etc/periodic/daily/310.accounting
  stable/6/etc/periodic/daily/440.status-mailq
  stable/6/etc/periodic/weekly/330.catman
  stable/6/etc/rc.d/bluetooth
  stable/6/etc/rc.d/bridge
  stable/6/etc/rc.d/cleanvar
  stable/6/etc/rc.d/geli
  stable/6/etc/rc.d/geli2
  stable/6/etc/rc.d/mdconfig
  stable/6/etc/rc.d/mdconfig2
  stable/6/etc/rc.d/nfslocking
  stable/6/etc/rc.d/nsswitch
  stable/6/etc/rc.d/rfcomm_pppd_server
  stable/6/etc/rc.d/syscons
  stable/6/etc/rc.initdiskless
  stable/6/etc/rc.subr
Directory Properties:
  stable/6/etc/   (props changed)

Modified: stable/6/etc/defaults/rc.conf
==============================================================================
--- stable/6/etc/defaults/rc.conf	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/defaults/rc.conf	Fri May 14 19:57:18 2010	(r208096)
@@ -178,7 +178,7 @@ ifconfig_lo0="inet 127.0.0.1"	# default 
 #ifconfig_fxp0_name="net0"	# Change interface name from fxp0 to net0.
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
 #
-#autobridge_interfaces="bridge0"	# List of bridges to check 
+#autobridge_interfaces="bridge0"	# List of bridges to check
 #autobridge_bridge0="tap* vlan0"	# Interface glob to automatically add to the bridge
 #
 # If you have any sppp(4) interfaces above, you might also want to set

Modified: stable/6/etc/network.subr
==============================================================================
--- stable/6/etc/network.subr	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/network.subr	Fri May 14 19:57:18 2010	(r208096)
@@ -269,7 +269,7 @@ ifexists()
 }
 
 # ipv4_up if
-#  add IPv4 addresses to the interface $if 
+#  add IPv4 addresses to the interface $if
 ipv4_up()
 {
 	_if=$1
@@ -314,14 +314,14 @@ ipv4_down()
 #   Evaluate the ifconfig_if_ipv4 arguments for interface $if
 #   and use $action to add or remove IPv4 addresses from $if.
 ipv4_addrs_common()
-{  
+{
 	_ret=1
 	_if=$1
 	_action=$2
-    
+
 	# get ipv4-addresses
 	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
-    
+
 	for _cidr in ${cidr_addr}; do
 		_ipaddr=${_cidr%%/*}
 		_netmask="/"${_cidr##*/}
@@ -334,7 +334,7 @@ ipv4_addrs_common()
 		if [ "${_action}" = "-alias" ]; then
 			_netmask=""
 		fi
-        
+
 		_ipcount=${_iplow}
 		while [ "${_ipcount}" -le "${_iphigh}" ]; do
 			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"

Modified: stable/6/etc/periodic/daily/310.accounting
==============================================================================
--- stable/6/etc/periodic/daily/310.accounting	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/periodic/daily/310.accounting	Fri May 14 19:57:18 2010	(r208096)
@@ -29,7 +29,7 @@ case "$daily_accounting_enable" in
 
 	    cd /var/account
 	    rc=0
-	
+
 	    n=$daily_accounting_save
 	    rm -f acct.$n.gz acct.$n || rc=3
 	    m=$n

Modified: stable/6/etc/periodic/daily/440.status-mailq
==============================================================================
--- stable/6/etc/periodic/daily/440.status-mailq	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/periodic/daily/440.status-mailq	Fri May 14 19:57:18 2010	(r208096)
@@ -59,7 +59,7 @@ case "$daily_status_mailq_enable" in
 		fi;;
 	    esac
 	fi;;
-		
+
     *)  rc=0;;
 esac
 

Modified: stable/6/etc/periodic/weekly/330.catman
==============================================================================
--- stable/6/etc/periodic/weekly/330.catman	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/periodic/weekly/330.catman	Fri May 14 19:57:18 2010	(r208096)
@@ -27,13 +27,13 @@ case "$weekly_catman_enable" in
 	    then
 		if [ -z "${MANPATH}" ]
 		then
-		    echo "manpath failed to find any manpath directories" 
+		    echo "manpath failed to find any manpath directories"
 		    rc=3
 		else
 		    man_locales=`/usr/bin/manpath -qL`
 		    rc=0
-         
-		    # Preformat original, non-localized manpages  
+
+		    # Preformat original, non-localized manpages
 		    echo /usr/libexec/catman.local -r "$MANPATH" |
 			su -fm man || rc=3
 

Modified: stable/6/etc/rc.d/bluetooth
==============================================================================
--- stable/6/etc/rc.d/bluetooth	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/bluetooth	Fri May 14 19:57:18 2010	(r208096)
@@ -94,7 +94,7 @@ bluetooth_setup_stack()
 	hook=$1
 	shift
 
-	# Setup HCI 
+	# Setup HCI
 	ngctl mkpeer ${dev}: hci ${hook} drv \
 		> /dev/null 2>&1 || return 1
 
@@ -287,7 +287,7 @@ bluetooth_start()
 		;;
 	esac
 
-	# Be backward compatible and setup reasonable defaults 
+	# Be backward compatible and setup reasonable defaults
 	bluetooth_device_authentication_enable="0"
 	bluetooth_device_class="ff:01:0c"
 	bluetooth_device_connectable="1"
@@ -317,7 +317,7 @@ bluetooth_start()
 		bluetooth_shutdown_stack $dev
 		err 1 "Unable to setup Bluetooth stack for device ${dev}"
 	fi
-		
+
 	return 0
 }
 

Modified: stable/6/etc/rc.d/bridge
==============================================================================
--- stable/6/etc/rc.d/bridge	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/bridge	Fri May 14 19:57:18 2010	(r208096)
@@ -42,7 +42,7 @@ glob_int () {
 		$2 ) true ;;
 		* ) false ;;
 	esac
-} 
+}
 
 bridge_test () {
 	bridge=$1

Modified: stable/6/etc/rc.d/cleanvar
==============================================================================
--- stable/6/etc/rc.d/cleanvar	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/cleanvar	Fri May 14 19:57:18 2010	(r208096)
@@ -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: stable/6/etc/rc.d/geli
==============================================================================
--- stable/6/etc/rc.d/geli	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/geli	Fri May 14 19:57:18 2010	(r208096)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/6/etc/rc.d/geli2
==============================================================================
--- stable/6/etc/rc.d/geli2	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/geli2	Fri May 14 19:57:18 2010	(r208096)
@@ -11,7 +11,7 @@
 # 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 AUTHORS 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

Modified: stable/6/etc/rc.d/mdconfig
==============================================================================
--- stable/6/etc/rc.d/mdconfig	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/mdconfig	Fri May 14 19:57:18 2010	(r208096)
@@ -47,7 +47,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -141,7 +141,7 @@ mdconfig_start()
 				if ! eval ${_fsck_cmd} -p ${_dev} >/dev/null; then
 					echo "Fsck failed on ${_dev}, not mounting the filesystem."
 					continue
-					
+
 				fi
 			else
 				newfs ${_newfs} ${_dev} >/dev/null
@@ -196,5 +196,5 @@ if [ -z "${_mdconfig_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig_cmd}"

Modified: stable/6/etc/rc.d/mdconfig2
==============================================================================
--- stable/6/etc/rc.d/mdconfig2	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/mdconfig2	Fri May 14 19:57:18 2010	(r208096)
@@ -47,7 +47,7 @@ is_readonly()
 		*" ${_mp} "*read-only*)
 			echo "yes"
 			;;
-		
+
 		*)
 			;;
 		esac;
@@ -227,5 +227,5 @@ if [ -z "${_mdconfig2_list}" ]; then
 		fi
 	done
 fi
-	
+
 run_rc_command "${_mdconfig2_cmd}"

Modified: stable/6/etc/rc.d/nfslocking
==============================================================================
--- stable/6/etc/rc.d/nfslocking	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/nfslocking	Fri May 14 19:57:18 2010	(r208096)
@@ -31,7 +31,7 @@ nfslocking_precmd()
 		force_depend rpcbind || ret=1
 	fi
 
-	if [ $name = "statd" ] 
+	if [ $name = "statd" ]
 	then
 		rc_flags=${rpc_statd_flags}
 	elif [ $name = "lockd" ]

Modified: stable/6/etc/rc.d/nsswitch
==============================================================================
--- stable/6/etc/rc.d/nsswitch	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/nsswitch	Fri May 14 19:57:18 2010	(r208096)
@@ -58,7 +58,7 @@ convert_host_conf()
 	*)
         	printf "Warning: unrecognized line [%s]", $line > "/dev/stderr"
 		;;
-		
+
 	esac
     done < $host_conf
 

Modified: stable/6/etc/rc.d/rfcomm_pppd_server
==============================================================================
--- stable/6/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/rfcomm_pppd_server	Fri May 14 19:57:18 2010	(r208096)
@@ -46,7 +46,7 @@ rfcomm_pppd_server_start_profile()
 		_channel=1
 	fi
 	rc_flags="${rc_flags} -C ${_channel}"
-	
+
 	# Check for RFCOMM PPP profile register SP override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_sp
@@ -55,7 +55,7 @@ rfcomm_pppd_server_start_profile()
 			rc_flags="${rc_flags} -S"
 		fi
 	fi
-	
+
 	# Check for RFCOMM PPP profile register DUN override
 	#
 	eval _x=\$rfcomm_pppd_server_${_profile_cleaned}_register_dun

Modified: stable/6/etc/rc.d/syscons
==============================================================================
--- stable/6/etc/rc.d/syscons	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.d/syscons	Fri May 14 19:57:18 2010	(r208096)
@@ -106,7 +106,7 @@ syscons_configure_keyboard()
 syscons_setkeyboard()
 {
 	kbd=$1
-                
+
 	if [ -z "${kbd}" ]; then
 		return 1
 	fi

Modified: stable/6/etc/rc.initdiskless
==============================================================================
--- stable/6/etc/rc.initdiskless	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.initdiskless	Fri May 14 19:57:18 2010	(r208096)
@@ -105,7 +105,7 @@
 #		Similar to /conf/T/M/diskless_remount above, but allows
 #		all of /conf to be remounted.  This can be used to allow
 #		multiple roots to share the same /conf.
-#		
+#
 #
 # You will almost universally want to create the following files under /conf
 #

Modified: stable/6/etc/rc.subr
==============================================================================
--- stable/6/etc/rc.subr	Fri May 14 19:36:11 2010	(r208095)
+++ stable/6/etc/rc.subr	Fri May 14 19:57:18 2010	(r208096)
@@ -678,7 +678,7 @@ $command $rc_flags $command_args"
 				if [ -n "$_nice" ]; then
 					if [ -z "$_user" ]; then
 						_doit="sh -c \"$_doit\""
-					fi	
+					fi
 					_doit="nice -n $_nice $_doit"
 				fi
 			fi
@@ -944,7 +944,7 @@ load_rc_config()
 		;;
 	esac
 }
-  
+
 #
 # load_rc_config_var name var
 #	Read the rc.conf(5) var for name and set in the

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 20:00:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51BA11065675;
	Fri, 14 May 2010 20:00:22 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 404A58FC22;
	Fri, 14 May 2010 20:00:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EK0MPv055807;
	Fri, 14 May 2010 20:00:22 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EK0MCO055803;
	Fri, 14 May 2010 20:00:22 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005142000.o4EK0MCO055803@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 20: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: r208097 - head/sys/sparc64/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 20:00:22 -0000

Author: marius
Date: Fri May 14 20:00:21 2010
New Revision: 208097
URL: http://svn.freebsd.org/changeset/base/208097

Log:
  - Enable DMA write parity error interrupts on Schizo with a working
    implementation.
  - Revert the Sun Fire V890 WAR of r205254. Instead let schizo_pci_bus()
    only panic in case of fatal errors as the interrupt triggered by the
    error the firmware of these and also Sun Fire 280R with version 7
    Schizo caused may happen as late as using the HBA and not only prior
    to touching the PCI bus (in the former case the actual error still is
    fatal but we clear it before touching the PCI bus).
    While at it count and export non-fatal error interrupts via sysctl(9).
  - Remove unnecessary locking from schizo_ue().

Modified:
  head/sys/sparc64/pci/schizo.c
  head/sys/sparc64/pci/schizoreg.h
  head/sys/sparc64/pci/schizovar.h

Modified: head/sys/sparc64/pci/schizo.c
==============================================================================
--- head/sys/sparc64/pci/schizo.c	Fri May 14 19:57:18 2010	(r208096)
+++ head/sys/sparc64/pci/schizo.c	Fri May 14 20:00:21 2010	(r208097)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -385,6 +386,21 @@ schizo_attach(device_t dev)
 	SCHIZO_PCI_WRITE_8(sc, STX_PCI_DIAG, reg);
 
 	/*
+	 * Enable DMA write parity error interrupts of version >= 7 (i.e.
+	 * revision >= 2.5) Schizo.
+	 */
+	if (mode == SCHIZO_MODE_SCZ && sc->sc_ver >= 7) {
+		reg = SCHIZO_PCI_READ_8(sc, SX_PCI_CFG_ICD);
+		reg |= SX_PCI_CFG_ICD_DMAW_PERR_IEN;
+#ifdef SCHIZO_DEBUG
+		device_printf(dev, "PCI CFG/ICD 0x%016llx -> 0x%016llx\n",
+		(unsigned long long)SCHIZO_PCI_READ_8(sc, SX_PCI_CFG_ICD),
+		(unsigned long long)reg);
+#endif
+		SCHIZO_PCI_WRITE_8(sc, SX_PCI_CFG_ICD, reg);
+	}
+
+	/*
 	 * On Tomatillo clear the I/O prefetch lengths (workaround for a
 	 * Jalapeno bug).
 	 */
@@ -697,14 +713,18 @@ schizo_attach(device_t dev)
 
 	ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t));
 
-	/*
-	 * At least when booting Fire V890 from disk a Schizo comes up with
-	 * a PCI bus error residing which triggers as soon as we register
-	 * schizo_pci_bus() even when clearing it from all involved registers
-	 * beforehand (but is quiet once it has fired).  Thus we make PCI bus
-	 * errors non-fatal until we actually touch the bus.
-	 */
-	sc->sc_flags |= SCHIZO_FLAGS_ARMED;
+#define	SCHIZO_SYSCTL_ADD_UINT(name, arg, desc)				\
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),			\
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,	\
+	    (name), CTLFLAG_RD, (arg), 0, (desc))
+
+	SCHIZO_SYSCTL_ADD_UINT("dma_ce", &sc->sc_stats_dma_ce,
+	    "DMA correctable errors");
+	SCHIZO_SYSCTL_ADD_UINT("pci_non_fatal", &sc->sc_stats_pci_non_fatal,
+	    "PCI bus non-fatal errors");
+
+#undef SCHIZO_SYSCTL_ADD_UINT
+
 	device_add_child(dev, "pci", -1);
 	return (bus_generic_attach(dev));
 }
@@ -801,6 +821,11 @@ schizo_pci_bus(void *arg)
 	struct schizo_softc *sc = arg;
 	uint64_t afar, afsr, csr, iommu;
 	uint32_t status;
+	u_int fatal;
+
+	fatal = 0;
+
+	mtx_lock_spin(sc->sc_mtx);
 
 	afar = SCHIZO_PCI_READ_8(sc, STX_PCI_AFAR);
 	afsr = SCHIZO_PCI_READ_8(sc, STX_PCI_AFSR);
@@ -808,41 +833,51 @@ schizo_pci_bus(void *arg)
 	iommu = SCHIZO_PCI_READ_8(sc, STX_PCI_IOMMU);
 	status = PCIB_READ_CONFIG(sc->sc_dev, sc->sc_pci_secbus,
 	    STX_CS_DEVICE, STX_CS_FUNC, PCIR_STATUS, 2);
-	if ((sc->sc_flags & SCHIZO_FLAGS_ARMED) == 0)
-			goto clear_error;
-	if ((csr & STX_PCI_CTRL_MMU_ERR) != 0) {
-		if ((iommu & TOM_PCI_IOMMU_ERR) == 0)
-			goto clear_error;
-
-		/* These are non-fatal if target abort was signaled. */
-		if ((status & PCIM_STATUS_STABORT) != 0 &&
-		    ((iommu & TOM_PCI_IOMMU_ERRMASK) ==
-		    TOM_PCI_IOMMU_INVALID_ERR ||
-		    (iommu & TOM_PCI_IOMMU_ERR_ILLTSBTBW) != 0 ||
-		    (iommu & TOM_PCI_IOMMU_ERR_BAD_VA) != 0)) {
-			SCHIZO_PCI_WRITE_8(sc, STX_PCI_IOMMU, iommu);
-			goto clear_error;
-		}
-	}
 
-	panic("%s: PCI bus %c error AFAR %#llx AFSR %#llx PCI CSR %#llx "
-	    "IOMMU %#llx STATUS %#llx", device_get_nameunit(sc->sc_dev),
-	    'A' + sc->sc_half, (unsigned long long)afar,
-	    (unsigned long long)afsr, (unsigned long long)csr,
-	    (unsigned long long)iommu, (unsigned long long)status);
+	/*
+	 * IOMMU errors are only fatal on Tomatillo and there also only if
+	 * target abort was not signaled.
+	 */
+	if ((csr & STX_PCI_CTRL_MMU_ERR) != 0 &&
+	    (iommu & TOM_PCI_IOMMU_ERR) != 0 &&
+	    ((status & PCIM_STATUS_STABORT) == 0 ||
+	    ((iommu & TOM_PCI_IOMMU_ERRMASK) != TOM_PCI_IOMMU_INVALID_ERR &&
+	    (iommu & TOM_PCI_IOMMU_ERR_ILLTSBTBW) == 0 &&
+	    (iommu & TOM_PCI_IOMMU_ERR_BAD_VA) == 0)))
+		fatal = 1;
+	else if ((status & PCIM_STATUS_STABORT) != 0)
+		fatal = 1;
+	if ((status & (PCIM_STATUS_PERR | PCIM_STATUS_SERR |
+	    PCIM_STATUS_RMABORT | PCIM_STATUS_RTABORT |
+	    PCIM_STATUS_PERRREPORT)) != 0 ||
+	    (csr & (SCZ_PCI_CTRL_BUS_UNUS | TOM_PCI_CTRL_DTO_ERR |
+	    STX_PCI_CTRL_TTO_ERR | STX_PCI_CTRL_RTRY_ERR |
+	    SCZ_PCI_CTRL_SBH_ERR | STX_PCI_CTRL_SERR)) != 0 ||
+	    (afsr & (STX_PCI_AFSR_P_MA | STX_PCI_AFSR_P_TA |
+	    STX_PCI_AFSR_P_RTRY | STX_PCI_AFSR_P_PERR | STX_PCI_AFSR_P_TTO |
+	    STX_PCI_AFSR_P_UNUS)) != 0)
+		fatal = 1;
+	if (fatal == 0)
+		sc->sc_stats_pci_non_fatal++;
+
+	device_printf(sc->sc_dev, "PCI bus %c error AFAR %#llx AFSR %#llx "
+	    "PCI CSR %#llx IOMMU %#llx STATUS %#llx\n", 'A' + sc->sc_half,
+	    (unsigned long long)afar, (unsigned long long)afsr,
+	    (unsigned long long)csr, (unsigned long long)iommu,
+	    (unsigned long long)status);
 
- clear_error:
-	if (bootverbose)
-		device_printf(sc->sc_dev,
-		    "PCI bus %c error AFAR %#llx AFSR %#llx PCI CSR %#llx "
-		    "STATUS %#llx", 'A' + sc->sc_half,
-		    (unsigned long long)afar, (unsigned long long)afsr,
-		    (unsigned long long)csr, (unsigned long long)status);
 	/* Clear the error bits that we caught. */
 	PCIB_WRITE_CONFIG(sc->sc_dev, sc->sc_pci_secbus, STX_CS_DEVICE,
 	    STX_CS_FUNC, PCIR_STATUS, status, 2);
 	SCHIZO_PCI_WRITE_8(sc, STX_PCI_CTRL, csr);
 	SCHIZO_PCI_WRITE_8(sc, STX_PCI_AFSR, afsr);
+	SCHIZO_PCI_WRITE_8(sc, STX_PCI_IOMMU, iommu);
+
+	mtx_unlock_spin(sc->sc_mtx);
+
+	if (fatal != 0)
+		panic("%s: fatal PCI bus error",
+		    device_get_nameunit(sc->sc_dev));
 	return (FILTER_HANDLED);
 }
 
@@ -853,13 +888,11 @@ schizo_ue(void *arg)
 	uint64_t afar, afsr;
 	int i;
 
-	mtx_lock_spin(sc->sc_mtx);
 	afar = SCHIZO_CTRL_READ_8(sc, STX_CTRL_UE_AFAR);
 	for (i = 0; i < 1000; i++)
 		if (((afsr = SCHIZO_CTRL_READ_8(sc, STX_CTRL_UE_AFSR)) &
 		    STX_CTRL_CE_AFSR_ERRPNDG) == 0)
 			break;
-	mtx_unlock_spin(sc->sc_mtx);
 	panic("%s: uncorrectable DMA error AFAR %#llx AFSR %#llx",
 	    device_get_nameunit(sc->sc_dev), (unsigned long long)afar,
 	    (unsigned long long)afsr);
@@ -874,17 +907,22 @@ schizo_ce(void *arg)
 	int i;
 
 	mtx_lock_spin(sc->sc_mtx);
+
 	afar = SCHIZO_CTRL_READ_8(sc, STX_CTRL_CE_AFAR);
 	for (i = 0; i < 1000; i++)
 		if (((afsr = SCHIZO_CTRL_READ_8(sc, STX_CTRL_UE_AFSR)) &
 		    STX_CTRL_CE_AFSR_ERRPNDG) == 0)
 			break;
+	sc->sc_stats_dma_ce++;
 	device_printf(sc->sc_dev,
 	    "correctable DMA error AFAR %#llx AFSR %#llx\n",
 	    (unsigned long long)afar, (unsigned long long)afsr);
+
 	/* Clear the error bits that we caught. */
 	SCHIZO_CTRL_WRITE_8(sc, STX_CTRL_UE_AFSR, afsr);
+
 	mtx_unlock_spin(sc->sc_mtx);
+
 	return (FILTER_HANDLED);
 }
 

Modified: head/sys/sparc64/pci/schizoreg.h
==============================================================================
--- head/sys/sparc64/pci/schizoreg.h	Fri May 14 19:57:18 2010	(r208096)
+++ head/sys/sparc64/pci/schizoreg.h	Fri May 14 20:00:21 2010	(r208097)
@@ -42,6 +42,7 @@
 #define	STX_ICON			3
 
 /* PCI configuration and status registers */
+#define	SX_PCI_CFG_ICD			0x00110
 #define	STX_PCI_IOMMU			0x00200
 #define	STX_PCI_IOMMU_CTXFLUSH		0x00218
 #define	STX_PCI_IMAP_BASE		0x01000
@@ -67,6 +68,15 @@
 #define	STX_PCI_IOBIO_DIAG		0x0a808
 #define	STX_PCI_STRBUF_CTXMATCH		0x10000
 
+/* PCI configuration/idle check diagnostic registers */
+#define	SX_PCI_CFG_ICD_PCI_2_0_COMPAT	0x0000000000008000ULL
+#define	SX_PCI_CFG_ICD_DMAW_PERR_IEN	0x0000000000004000ULL
+#define	SX_PCI_CFG_ICD_IFC_NOT_IDLE	0x0000000000000010ULL
+#define	SX_PCI_CFG_ICD_MDU_NOT_IDLE	0x0000000000000008ULL
+#define	SX_PCI_CFG_ICD_MMU_NOT_IDLE	0x0000000000000004ULL
+#define	SX_PCI_CFG_ICD_PBM_NOT_IDLE	0x0000000000000002ULL
+#define	SX_PCI_CFG_ICD_STC_NOT_IDLE	0x0000000000000001ULL
+
 /* PCI IOMMU control registers */
 #define	TOM_PCI_IOMMU_ERR_BAD_VA	0x0000000010000000ULL
 #define	TOM_PCI_IOMMU_ERR_ILLTSBTBW	0x0000000008000000ULL

Modified: head/sys/sparc64/pci/schizovar.h
==============================================================================
--- head/sys/sparc64/pci/schizovar.h	Fri May 14 19:57:18 2010	(r208096)
+++ head/sys/sparc64/pci/schizovar.h	Fri May 14 20:00:21 2010	(r208097)
@@ -44,9 +44,8 @@ struct schizo_softc {
 #define	SCHIZO_MODE_XMS			2
 
 	u_int				sc_flags;
-#define	SCHIZO_FLAGS_ARMED		(1 << 0)
-#define	SCHIZO_FLAGS_BSWAR		(1 << 1)
-#define	SCHIZO_FLAGS_CDMA		(1 << 2)
+#define	SCHIZO_FLAGS_BSWAR		(1 << 0)
+#define	SCHIZO_FLAGS_CDMA		(1 << 1)
 
 	bus_addr_t			sc_cdma_clr;
 	uint32_t			sc_cdma_state;
@@ -71,6 +70,9 @@ struct schizo_softc {
 	bus_space_tag_t			sc_pci_memt;
 	bus_dma_tag_t			sc_pci_dmat;
 
+	uint32_t			sc_stats_dma_ce;
+	uint32_t			sc_stats_pci_non_fatal;
+
 	uint8_t				sc_pci_secbus;
 	uint8_t				sc_pci_subbus;
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 20:11:30 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B53CC1065674;
	Fri, 14 May 2010 20:11:30 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B63E8FC12;
	Fri, 14 May 2010 20:11:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EKBUj4058326;
	Fri, 14 May 2010 20:11:30 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EKBUik058323;
	Fri, 14 May 2010 20:11:30 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005142011.o4EKBUik058323@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 14 May 2010 20: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: r208098 - head/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 20:11:30 -0000

Author: marius
Date: Fri May 14 20:11:30 2010
New Revision: 208098
URL: http://svn.freebsd.org/changeset/base/208098

Log:
  Document the led(4) interface to the identification LEDs.
  
  MFC after:	3 days

Modified:
  head/share/man/man4/em.4
  head/share/man/man4/igb.4

Modified: head/share/man/man4/em.4
==============================================================================
--- head/share/man/man4/em.4	Fri May 14 20:00:21 2010	(r208097)
+++ head/share/man/man4/em.4	Fri May 14 20:11:30 2010	(r208098)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 6, 2008
+.Dd May 14, 2010
 .Dt EM 4
 .Os
 .Sh NAME
@@ -62,6 +62,11 @@ The driver supports Transmit/Receive che
 and Jumbo Frames on all but 82542-based adapters.
 Furthermore it supports TCP segmentation offload (TSO) on all adapters but
 those based on the 82543, 82544 and 82547 controller chips.
+The identification LEDs of the adapters supported by the
+.Nm
+driver can be controlled via the
+.Xr led 4
+API for localization purposes.
 For further hardware information, see the
 .Pa README
 included with the driver.
@@ -241,10 +246,25 @@ If an issue is identified with the relea
 with a supported adapter, email the specific information related to the
 issue to
 .Aq freebsdnic@mailbox.intel.com .
+.Sh FILES
+.Bl -tag -width /dev/led/em*
+.It Pa /dev/led/em*
+identification LED device nodes
+.El
+.Sh EXAMPLES
+Make the identification LED of em0 blink:
+.Pp
+.Dl "echo f2 > /dev/led/em0"
+.Pp
+Turn the identification LED of em0 off again:
+.Pp
+.Dl "echo 0 > /dev/led/em0"
+.Pp
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
 .Xr igb 4 ,
+.Xr led 4 ,
 .Xr netintro 4 ,
 .Xr ng_ether 4 ,
 .Xr polling 4 ,

Modified: head/share/man/man4/igb.4
==============================================================================
--- head/share/man/man4/igb.4	Fri May 14 20:00:21 2010	(r208097)
+++ head/share/man/man4/igb.4	Fri May 14 20:11:30 2010	(r208098)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 6, 2008
+.Dd May 14, 2010
 .Dt IGB 4
 .Os
 .Sh NAME
@@ -60,6 +60,11 @@ The driver supports Transmit/Receive che
 Frames.
 Furthermore it supports TCP segmentation offload (TSO) on all
 adapters.
+The identification LEDs of the adapters supported by the
+.Nm
+driver can be controlled via the
+.Xr led 4
+API for localization purposes.
 .Pp
 For questions related to hardware requirements, refer to the
 documentation supplied with your Intel PRO/1000 adapter.
@@ -175,10 +180,25 @@ If an issue is identified with the relea
 with a supported adapter, email the specific information related to the
 issue to
 .Aq freebsdnic@mailbox.intel.com .
+.Sh FILES
+.Bl -tag -width /dev/led/igb*
+.It Pa /dev/led/igb*
+identification LED device nodes
+.El
+.Sh EXAMPLES
+Make the identification LED of igb0 blink:
+.Pp
+.Dl "echo f2 > /dev/led/igb0"
+.Pp
+Turn the identification LED of igb0 off again:
+.Pp
+.Dl "echo 0 > /dev/led/igb0"
+.Pp
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
 .Xr em 4 ,
+.Xr led 4 ,
 .Xr netintro 4 ,
 .Xr ng_ether 4 ,
 .Xr polling 4 ,

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 20:40:37 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79E781065672;
	Fri, 14 May 2010 20:40:37 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 692DC8FC1A;
	Fri, 14 May 2010 20:40:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EKeb3o064767;
	Fri, 14 May 2010 20:40:37 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EKebXT064762;
	Fri, 14 May 2010 20:40:37 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201005142040.o4EKebXT064762@svn.freebsd.org>
From: Xin LI 
Date: Fri, 14 May 2010 20:40: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: r208099 - in head: . lib/liblzma
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 20:40:37 -0000

Author: delphij
Date: Fri May 14 20:40:37 2010
New Revision: 208099
URL: http://svn.freebsd.org/changeset/base/208099

Log:
   - Add versioned symbols to liblzma
   - Use default SHLIB_MAJOR.
  
  Approved by:	mm
  X-MFC with:	lzma library MFC

Added:
  head/lib/liblzma/Symbol.map   (contents, props changed)
  head/lib/liblzma/Versions.def   (contents, props changed)
Modified:
  head/ObsoleteFiles.inc
  head/lib/liblzma/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Fri May 14 20:11:30 2010	(r208098)
+++ head/ObsoleteFiles.inc	Fri May 14 20:40:37 2010	(r208099)
@@ -14,6 +14,11 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100514: library version bump for versioned symbols for liblzma
+OLD_LIBS+=usr/lib/liblzma.so.0
+.if ${TARGET_ARCH} == "amd64"
+OLD_LIBS+=usr/lib32/liblzma.so.0
+.endif
 # 20100511: move GCC-specific headers to /usr/include/gcc
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
 OLD_FILES+=usr/include/emmintrin.h

Modified: head/lib/liblzma/Makefile
==============================================================================
--- head/lib/liblzma/Makefile	Fri May 14 20:11:30 2010	(r208098)
+++ head/lib/liblzma/Makefile	Fri May 14 20:40:37 2010	(r208099)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
-LIB=	lzma
-SHLIB_MAJOR=	0
+LIB=		lzma
 LZMADIR=	${.CURDIR}/../../contrib/xz/src/liblzma
 
 .PATH: ${LZMADIR}/../common
@@ -122,6 +121,7 @@ SRCS+=	simple_coder.c \
 WARNS?=	3
 
 CFLAGS+=	-DHAVE_CONFIG_H \
+		-DTUKLIB_SYMBOL_PREFIX=lzma_ \
 		-I${.CURDIR} \
 		-I${LZMADIR}/api \
 		-I${LZMADIR}/common \
@@ -134,4 +134,8 @@ CFLAGS+=	-DHAVE_CONFIG_H \
 		-I${LZMADIR}/simple \
 		-I${LZMADIR}/../common
 
+VERSION_DEF=	${.CURDIR}/Versions.def
+SYMBOL_MAPS=	${.CURDIR}/Symbol.map
+CFLAGS+=	-DSYMBOL_VERSIONING
+
 .include 

Added: head/lib/liblzma/Symbol.map
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/liblzma/Symbol.map	Fri May 14 20:40:37 2010	(r208099)
@@ -0,0 +1,189 @@
+/*
+ * $FreeBSD$
+ */
+
+XZ_5.0 {
+	lzma_alone_decoder;
+	lzma_alone_encoder;
+	lzma_auto_decoder;
+	lzma_block_buffer_bound;
+	lzma_block_buffer_decode;
+	lzma_block_buffer_encode;
+	lzma_block_compressed_size;
+	lzma_block_decoder;
+	lzma_block_encoder;
+	lzma_block_header_decode;
+	lzma_block_header_encode;
+	lzma_block_header_size;
+	lzma_block_total_size;
+	lzma_block_unpadded_size;
+	lzma_check_is_supported;
+	lzma_check_size;
+	lzma_code;
+	lzma_crc32;
+	lzma_crc64;
+	lzma_easy_buffer_encode;
+	lzma_easy_decoder_memusage;
+	lzma_easy_encoder;
+	lzma_easy_encoder_memusage;
+	lzma_end;
+	lzma_filter_decoder_is_supported;
+	lzma_filter_encoder_is_supported;
+	lzma_filter_flags_decode;
+	lzma_filter_flags_encode;
+	lzma_filter_flags_size;
+	lzma_filters_copy;
+	lzma_filters_update;
+	lzma_get_check;
+	lzma_index_append;
+	lzma_index_block_count;
+	lzma_index_buffer_decode;
+	lzma_index_buffer_encode;
+	lzma_index_cat;
+	lzma_index_checks;
+	lzma_index_decoder;
+	lzma_index_dup;
+	lzma_index_encoder;
+	lzma_index_end;
+	lzma_index_file_size;
+	lzma_index_hash_append;
+	lzma_index_hash_decode;
+	lzma_index_hash_end;
+	lzma_index_hash_init;
+	lzma_index_hash_size;
+	lzma_index_init;
+	lzma_index_iter_init;
+	lzma_index_iter_locate;
+	lzma_index_iter_next;
+	lzma_index_iter_rewind;
+	lzma_index_memusage;
+	lzma_index_memused;
+	lzma_index_size;
+	lzma_index_stream_count;
+	lzma_index_stream_flags;
+	lzma_index_stream_padding;
+	lzma_index_stream_size;
+	lzma_index_total_size;
+	lzma_index_uncompressed_size;
+	lzma_lzma_preset;
+	lzma_memlimit_get;
+	lzma_memlimit_set;
+	lzma_memusage;
+	lzma_mf_is_supported;
+	lzma_mode_is_supported;
+	lzma_physmem;
+	lzma_properties_decode;
+	lzma_properties_encode;
+	lzma_properties_size;
+	lzma_raw_buffer_decode;
+	lzma_raw_buffer_encode;
+	lzma_raw_decoder;
+	lzma_raw_decoder_memusage;
+	lzma_raw_encoder;
+	lzma_raw_encoder_memusage;
+	lzma_stream_buffer_bound;
+	lzma_stream_buffer_decode;
+	lzma_stream_buffer_encode;
+	lzma_stream_decoder;
+	lzma_stream_encoder;
+	lzma_stream_flags_compare;
+	lzma_stream_footer_decode;
+	lzma_stream_footer_encode;
+	lzma_stream_header_decode;
+	lzma_stream_header_encode;
+	lzma_version_number;
+	lzma_version_string;
+	lzma_vli_decode;
+	lzma_vli_encode;
+	lzma_vli_size;
+};
+
+XZprivate_1.0 {
+	lzma_alloc;
+	lzma_alone_decoder_init;
+	lzma_block_decoder_init;
+	lzma_block_encoder_init;
+	lzma_bufcpy;
+	lzma_check_finish;
+	lzma_check_init;
+	lzma_check_update;
+	lzma_chunk_size;
+	lzma_delta_coder_init;
+	lzma_delta_coder_memusage;
+	lzma_delta_decoder_init;
+	lzma_delta_encoder_init;
+	lzma_delta_props_decode;
+	lzma_delta_props_encode;
+	lzma_easy_preset;
+	lzma_free;
+	lzma_index_encoder_init;
+	lzma_index_padding_size;
+	lzma_index_prealloc;
+	lzma_lz_decoder_init;
+	lzma_lz_decoder_memusage;
+	lzma_lz_decoder_uncompressed;
+	lzma_lz_encoder_init;
+	lzma_lz_encoder_memusage;
+	lzma_lzma2_decoder_init;
+	lzma_lzma2_decoder_memusage;
+	lzma_lzma2_encoder_init;
+	lzma_lzma2_encoder_memusage;
+	lzma_lzma2_props_decode;
+	lzma_lzma2_props_encode;
+	lzma_lzma_decoder_create;
+	lzma_lzma_decoder_init;
+	lzma_lzma_decoder_memusage;
+	lzma_lzma_decoder_memusage_nocheck;
+	lzma_lzma_encode;
+	lzma_lzma_encoder_create;
+	lzma_lzma_encoder_init;
+	lzma_lzma_encoder_memusage;
+	lzma_lzma_encoder_reset;
+	lzma_lzma_lclppb_decode;
+	lzma_lzma_lclppb_encode;
+	lzma_lzma_optimum_fast;
+	lzma_lzma_optimum_normal;
+	lzma_lzma_props_decode;
+	lzma_lzma_props_encode;
+	lzma_mf_bt2_find;
+	lzma_mf_bt2_skip;
+	lzma_mf_bt3_find;
+	lzma_mf_bt3_skip;
+	lzma_mf_bt4_find;
+	lzma_mf_bt4_skip;
+	lzma_mf_find;
+	lzma_mf_hc3_find;
+	lzma_mf_hc3_skip;
+	lzma_mf_hc4_find;
+	lzma_mf_hc4_skip;
+	lzma_next_end;
+	lzma_next_filter_init;
+	lzma_next_filter_update;
+	lzma_raw_coder_init;
+	lzma_raw_coder_memusage;
+	lzma_raw_decoder_init;
+	lzma_raw_encoder_init;
+	lzma_sha256_finish;
+	lzma_sha256_init;
+	lzma_sha256_update;
+	lzma_simple_arm_decoder_init;
+	lzma_simple_arm_encoder_init;
+	lzma_simple_armthumb_decoder_init;
+	lzma_simple_armthumb_encoder_init;
+	lzma_simple_coder_init;
+	lzma_simple_ia64_decoder_init;
+	lzma_simple_ia64_encoder_init;
+	lzma_simple_powerpc_decoder_init;
+	lzma_simple_powerpc_encoder_init;
+	lzma_simple_props_decode;
+	lzma_simple_props_encode;
+	lzma_simple_props_size;
+	lzma_simple_sparc_decoder_init;
+	lzma_simple_sparc_encoder_init;
+	lzma_simple_x86_decoder_init;
+	lzma_simple_x86_encoder_init;
+	lzma_stream_decoder_init;
+	lzma_stream_encoder_init;
+	lzma_strm_init;
+	lzma_tuklib_physmem;
+};

Added: head/lib/liblzma/Versions.def
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/liblzma/Versions.def	Fri May 14 20:40:37 2010	(r208099)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+XZ_5.0 {
+};
+
+
+XZprivate_1.0 {
+} XZ_5.0;
+

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 20:42:26 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA4C9106566B;
	Fri, 14 May 2010 20:42:26 +0000 (UTC)
	(envelope-from ronald-freebsd8@klop.yi.org)
Received: from smtp-out1.tiscali.nl (smtp-out1.tiscali.nl [195.241.79.176])
	by mx1.freebsd.org (Postfix) with ESMTP id A1D1B8FC1A;
	Fri, 14 May 2010 20:42:26 +0000 (UTC)
Received: from [212.123.145.58] (helo=sjakie.klop.ws)
	by smtp-out1.tiscali.nl with esmtp (Exim)
	(envelope-from )
	id 1OD1iD-0003vS-Jg; Fri, 14 May 2010 22:42:25 +0200
Received: from 212-123-145-58.ip.telfort.nl (localhost [127.0.0.1])
	by sjakie.klop.ws (Postfix) with ESMTP id 662BC146D3;
	Fri, 14 May 2010 22:42:15 +0200 (CEST)
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
To: "Matthew Jacob" , "Ronald Klop"
	
References: <201005112222.o4BMM1uq012874@svn.freebsd.org>
	
	<4BEAB941.1000009@feral.com>
Date: Fri, 14 May 2010 22:42:15 +0200
MIME-Version: 1.0
From: "Ronald Klop" 
Message-ID: 
In-Reply-To: <4BEAB941.1000009@feral.com>
User-Agent: Opera Mail/10.10 (FreeBSD)
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Matt Jacob 
Subject: Re: svn commit: r207933 - head/sys/cam/scsi
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 20:42:27 -0000

On Wed, 12 May 2010 16:20:49 +0200, Matthew Jacob  wrote:

>   Ow. No need to be rude :-).
>
> No, I didn't, why do you ask?

Oh never mind, I just liked the use of alphabetical characters to indicat=
e =20
disk devices and I always wondered what DOS/Windows would do if you had =20
more than 26 disks.

Cheers,

Ronald.

>> Wow, did you copy this from windows? :-)
>
> _______________________________________________
> 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  Fri May 14 20:47:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 624811065672;
	Fri, 14 May 2010 20:47:13 +0000 (UTC)
	(envelope-from kabaev@gmail.com)
Received: from mail-pz0-f174.google.com (mail-pz0-f174.google.com
	[209.85.222.174])
	by mx1.freebsd.org (Postfix) with ESMTP id B98D58FC1B;
	Fri, 14 May 2010 20:47:12 +0000 (UTC)
Received: by pzk4 with SMTP id 4so1638727pzk.7
	for ; Fri, 14 May 2010 13:47:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:date:from:to:cc:subject
	:message-id:in-reply-to:references:x-mailer:mime-version
	:content-type; bh=p3Z1NO/AdaVRkIatlFUU9wmFlCRM49YcMcLzRnj1eUE=;
	b=E76UXuaCVbtaSqU6/F1iqPZY8mMW9jh2I2STr3BkQvmhRNgFcZkapiLzkdTGYXlskJ
	Q70FJ8zQjhfWDWpJ328QwJA9biC4PoR2lAmKiU1dqBqITCPne8Z3r35LWeDfmYNBFXLi
	tIcDPRPyKf938fG+hElqL2M1nj+yxfF+CW1gU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer
	:mime-version:content-type;
	b=Id6nQHR/jBJpNAu+IxQXlkS6RzR5LI5pOtT+DiZuFUDCDjFeYozLfLtosS7ZFVFD9k
	9cCWIFFesNkgyZxVwLQmvqCwqkHw6GqXo35Pi8zcdt+bs4UZp+aYKmr18/n1k1/7Q3B8
	U1MiEVP0SLkYJm6pix4onjN+2WJvUySfbhyAg=
Received: by 10.142.247.16 with SMTP id u16mr1127083wfh.217.1273870032028;
	Fri, 14 May 2010 13:47:12 -0700 (PDT)
Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net
	[24.63.226.98])
	by mx.google.com with ESMTPS id u18sm1246594wfh.7.2010.05.14.13.47.10
	(version=SSLv3 cipher=RC4-MD5); Fri, 14 May 2010 13:47:11 -0700 (PDT)
Date: Fri, 14 May 2010 16:47:04 -0400
From: Alexander Kabaev 
To: Xin LI 
Message-ID: <20100514164704.5e9ddfb9@kan.dnsalias.net>
In-Reply-To: <201005142040.o4EKebXT064762@svn.freebsd.org>
References: <201005142040.o4EKebXT064762@svn.freebsd.org>
X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0)
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=PGP-SHA1;
	boundary="Sig_/lVPsEOK9tII8UF/xNrPIsDS";
	protocol="application/pgp-signature"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r208099 - in head: . lib/liblzma
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 20:47:13 -0000

--Sig_/lVPsEOK9tII8UF/xNrPIsDS
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Fri, 14 May 2010 20:40:37 +0000 (UTC)
Xin LI  wrote:

> Author: delphij
> Date: Fri May 14 20:40:37 2010
> New Revision: 208099
> URL: http://svn.freebsd.org/changeset/base/208099
>=20
> Log:
>    - Add versioned symbols to liblzma
>    - Use default SHLIB_MAJOR.
>  =20
>   Approved by:	mm
>   X-MFC with:	lzma library MFC
>

If adding symbol versioning is all patch does, then bumping library
major version is not necessary. If you wanted so.1 for other reasons,
please ignore this email.

--=20
Alexander Kabaev

--Sig_/lVPsEOK9tII8UF/xNrPIsDS
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iD8DBQFL7bbMQ6z1jMm+XZYRAg2rAJ9CqbeU+ZinCMqHulSCOYTLb0lndQCcDkFQ
xBrzTVoQEvmETIo4WyPU0z8=
=dkMF
-----END PGP SIGNATURE-----

--Sig_/lVPsEOK9tII8UF/xNrPIsDS--

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 21:11:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5A81B106566B;
	Fri, 14 May 2010 21:11:59 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 43ED08FC08;
	Fri, 14 May 2010 21:11:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ELBxEL071692;
	Fri, 14 May 2010 21:11:59 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ELBxLw071689;
	Fri, 14 May 2010 21:11:59 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201005142111.o4ELBxLw071689@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 14 May 2010 21:11: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: r208100 - in head/sys: kern net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 14 May 2010 21:11:59 -0000

Author: bz
Date: Fri May 14 21:11:58 2010
New Revision: 208100
URL: http://svn.freebsd.org/changeset/base/208100

Log:
  Fix an issue with the dynamic pcpu/vnet data allocators.
  
  We cannot expect that modspace is the last entry in the linker
  set and thus that modspace + possible extra space up to PAGE_SIZE
  would be contiguous.  For the moment do not support more than
  *_MODMIN space and ignore the extra space (*).
  
  (*) We know how to get it back but it'll need testing.
  
  Discussed with:	jeff, rwatson (briefly)
  Reviewed by:	jeff
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	CK Software GmbH
  MFC after:	4 days

Modified:
  head/sys/kern/subr_pcpu.c
  head/sys/net/vnet.c

Modified: head/sys/kern/subr_pcpu.c
==============================================================================
--- head/sys/kern/subr_pcpu.c	Fri May 14 20:40:37 2010	(r208099)
+++ head/sys/kern/subr_pcpu.c	Fri May 14 21:11:58 2010	(r208100)
@@ -125,7 +125,7 @@ dpcpu_startup(void *dummy __unused)
 
 	df = malloc(sizeof(*df), M_PCPU, M_WAITOK | M_ZERO);
 	df->df_start = (uintptr_t)&DPCPU_NAME(modspace);
-	df->df_len = DPCPU_MODSIZE;
+	df->df_len = DPCPU_MODMIN;
 	TAILQ_INSERT_HEAD(&dpcpu_head, df, df_link);
 	sx_init(&dpcpu_lock, "dpcpu alloc lock");
 }

Modified: head/sys/net/vnet.c
==============================================================================
--- head/sys/net/vnet.c	Fri May 14 20:40:37 2010	(r208099)
+++ head/sys/net/vnet.c	Fri May 14 21:11:58 2010	(r208100)
@@ -348,7 +348,7 @@ vnet_data_startup(void *dummy __unused)
 
 	df = malloc(sizeof(*df), M_VNET_DATA_FREE, M_WAITOK | M_ZERO);
 	df->vnd_start = (uintptr_t)&VNET_NAME(modspace);
-	df->vnd_len = VNET_MODSIZE;
+	df->vnd_len = VNET_MODMIN;
 	TAILQ_INSERT_HEAD(&vnet_data_free_head, df, vnd_link);
 	sx_init(&vnet_data_free_lock, "vnet_data alloc lock");
 }

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 21:27:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E01031065670;
	Fri, 14 May 2010 21:27:39 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D03678FC19;
	Fri, 14 May 2010 21:27:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4ELRdrY075155;
	Fri, 14 May 2010 21:27:39 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4ELRdDS075153;
	Fri, 14 May 2010 21:27:39 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201005142127.o4ELRdDS075153@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 14 May 2010 21:27: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: r208101 - head/sys/geom/multipath
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 21:27:40 -0000

Author: mjacob
Date: Fri May 14 21:27:39 2010
New Revision: 208101
URL: http://svn.freebsd.org/changeset/base/208101

Log:
  Yet another potential dereference of a dead provider.
  
  Sponsored by:   Panasas
  MFC after:	1 week

Modified:
  head/sys/geom/multipath/g_multipath.c

Modified: head/sys/geom/multipath/g_multipath.c
==============================================================================
--- head/sys/geom/multipath/g_multipath.c	Fri May 14 21:11:58 2010	(r208100)
+++ head/sys/geom/multipath/g_multipath.c	Fri May 14 21:27:39 2010	(r208101)
@@ -197,7 +197,7 @@ g_multipath_done_error(struct bio *bp)
 				break;
 			}
 		}
-		if (sc->cp_active == NULL) {
+		if (sc->cp_active == NULL || sc->cp_active->provider == NULL) {
 			printf("GEOM_MULTIPATH: out of providers for %s\n",
 			    sc->sc_name);
 			g_topology_unlock();

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 22:00:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FE991065673;
	Fri, 14 May 2010 22:00:38 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66FCB8FC08;
	Fri, 14 May 2010 22:00:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EM0c9a082425;
	Fri, 14 May 2010 22:00:38 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EM0c1U082423;
	Fri, 14 May 2010 22:00:38 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201005142200.o4EM0c1U082423@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 14 May 2010 22: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: r208102 - head/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: Fri, 14 May 2010 22:00:38 -0000

Author: jfv
Date: Fri May 14 22:00:37 2010
New Revision: 208102
URL: http://svn.freebsd.org/changeset/base/208102

Log:
   A few minor fixes:
     - add a moderation value to the Link vector
     - allow disabling HW RSC on the 82599 if LRO
       is not enabled.
     - correct error in the stats code
     - change optic type on the 82598 DA device
  
  Thanks to Andrew Boyer for the changes.

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Fri May 14 21:27:39 2010	(r208101)
+++ head/sys/dev/ixgbe/ixgbe.c	Fri May 14 22:00:37 2010	(r208102)
@@ -46,7 +46,7 @@ int             ixgbe_display_debug_stat
 /*********************************************************************
  *  Driver version
  *********************************************************************/
-char ixgbe_driver_version[] = "2.1.7";
+char ixgbe_driver_version[] = "2.1.8";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -412,7 +412,6 @@ ixgbe_attach(device_t dev)
 			break;
 		case IXGBE_DEV_ID_82598 :
 		case IXGBE_DEV_ID_82598AF_DUAL_PORT :
-		case IXGBE_DEV_ID_82598_DA_DUAL_PORT :
 		case IXGBE_DEV_ID_82598AF_SINGLE_PORT :
 		case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM :
 		case IXGBE_DEV_ID_82598EB_SFP_LOM :
@@ -425,6 +424,9 @@ ixgbe_attach(device_t dev)
 		case IXGBE_DEV_ID_82598EB_XF_LR :
 			adapter->optics = IFM_10G_LR;
 			break;
+		case IXGBE_DEV_ID_82598_DA_DUAL_PORT :
+			adapter->optics = IFM_10G_TWINAX;
+			break;
 		case IXGBE_DEV_ID_82599_SFP :
 			adapter->optics = IFM_10G_SR;
 			ixgbe_num_segs = IXGBE_82599_SCATTER;
@@ -1158,6 +1160,9 @@ ixgbe_init_locked(struct adapter *adapte
         	}
 	}
 
+	/* Set moderation on the Link interrupt */
+	IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR);
+
 	/* Config/Enable Link */
 	ixgbe_config_link(adapter);
 
@@ -3638,13 +3643,11 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	/*
 	** Now set up the LRO interface:
 	** 82598 uses software LRO, the
-	** 82599 additionally uses a
-	** hardware assist.
-	**
-	** Disable RSC when RXCSUM is off
+	** 82599 uses a hardware assist.
 	*/
 	if ((adapter->hw.mac.type == ixgbe_mac_82599EB) &&
-	    (ifp->if_capenable & IFCAP_RXCSUM))
+	    (ifp->if_capenable & IFCAP_RXCSUM) &&
+	    (ifp->if_capenable & IFCAP_LRO))
 		ixgbe_setup_hw_rsc(rxr);
 	else if (ifp->if_capenable & IFCAP_LRO) {
 		int err = tcp_lro_init(lro);
@@ -4661,7 +4664,7 @@ ixgbe_update_stats_counters(struct adapt
 		adapter->stats.lxoffrxc += IXGBE_READ_REG(hw, IXGBE_LXOFFRXC);
 		/* 82598 only has a counter in the high register */
 		adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCH);
-		adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
+		adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH);
 		adapter->stats.tor += IXGBE_READ_REG(hw, IXGBE_TORH);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 22:18:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 225461065677;
	Fri, 14 May 2010 22:18:35 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 12DD98FC0A;
	Fri, 14 May 2010 22:18:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EMIYT9086710;
	Fri, 14 May 2010 22:18:34 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EMIYT2086706;
	Fri, 14 May 2010 22:18:34 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201005142218.o4EMIYT2086706@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 14 May 2010 22:18: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: r208103 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 22:18:35 -0000

Author: jfv
Date: Fri May 14 22:18:34 2010
New Revision: 208103
URL: http://svn.freebsd.org/changeset/base/208103

Log:
  Small changes preparing for MFC, need to conditionalize
  the buf_ring_free call, and lem is missing the WOL change
  put into em.

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Fri May 14 22:00:37 2010	(r208102)
+++ head/sys/dev/e1000/if_em.c	Fri May 14 22:18:34 2010	(r208103)
@@ -2948,7 +2948,9 @@ err_tx_desc:
 		em_dma_free(adapter, &txr->txdma);
 	free(adapter->rx_rings, M_DEVBUF);
 rx_fail:
+#if __FreeBSD_version >= 800000
 	buf_ring_free(txr->br, M_DEVBUF);
+#endif
 	free(adapter->tx_rings, M_DEVBUF);
 fail:
 	return (error);

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Fri May 14 22:00:37 2010	(r208102)
+++ head/sys/dev/e1000/if_igb.c	Fri May 14 22:18:34 2010	(r208103)
@@ -2969,7 +2969,9 @@ err_tx_desc:
 		igb_dma_free(adapter, &txr->txdma);
 	free(adapter->rx_rings, M_DEVBUF);
 rx_fail:
+#if __FreeBSD_version >= 800000
 	buf_ring_free(txr->br, M_DEVBUF);
+#endif
 	free(adapter->tx_rings, M_DEVBUF);
 tx_fail:
 	free(adapter->queues, M_DEVBUF);

Modified: head/sys/dev/e1000/if_lem.c
==============================================================================
--- head/sys/dev/e1000/if_lem.c	Fri May 14 22:00:37 2010	(r208102)
+++ head/sys/dev/e1000/if_lem.c	Fri May 14 22:18:34 2010	(r208103)
@@ -2422,10 +2422,10 @@ lem_setup_interface(device_t dev, struct
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
 
-	/* Enable All WOL methods by default */
+	/* Enable only WOL MAGIC by default */
 	if (adapter->wol) {
 		ifp->if_capabilities |= IFCAP_WOL;
-		ifp->if_capenable |= IFCAP_WOL;
+		ifp->if_capenable |= IFCAP_WOL_MAGIC;
 	}
 		
 	/*

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 22:20:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85DA31065672;
	Fri, 14 May 2010 22:20:58 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C4A68FC08;
	Fri, 14 May 2010 22:20:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EMKwZU087491;
	Fri, 14 May 2010 22:20:58 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EMKwqp087487;
	Fri, 14 May 2010 22:20:58 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201005142220.o4EMKwqp087487@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 14 May 2010 22:20:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208104 - stable/8/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 14 May 2010 22:20:58 -0000

Author: jfv
Date: Fri May 14 22:20:58 2010
New Revision: 208104
URL: http://svn.freebsd.org/changeset/base/208104

Log:
  Missing fix in lem code to limit WOL to MAGIC,
  and made code backward compatible to 7.3 with
  conditionals around the buf_ring_free call.

Modified:
  stable/8/sys/dev/e1000/if_em.c
  stable/8/sys/dev/e1000/if_igb.c
  stable/8/sys/dev/e1000/if_lem.c

Modified: stable/8/sys/dev/e1000/if_em.c
==============================================================================
--- stable/8/sys/dev/e1000/if_em.c	Fri May 14 22:18:34 2010	(r208103)
+++ stable/8/sys/dev/e1000/if_em.c	Fri May 14 22:20:58 2010	(r208104)
@@ -2951,7 +2951,9 @@ err_tx_desc:
 		em_dma_free(adapter, &txr->txdma);
 	free(adapter->rx_rings, M_DEVBUF);
 rx_fail:
+#if __FreeBSD_version >= 800000
 	buf_ring_free(txr->br, M_DEVBUF);
+#endif
 	free(adapter->tx_rings, M_DEVBUF);
 fail:
 	return (error);

Modified: stable/8/sys/dev/e1000/if_igb.c
==============================================================================
--- stable/8/sys/dev/e1000/if_igb.c	Fri May 14 22:18:34 2010	(r208103)
+++ stable/8/sys/dev/e1000/if_igb.c	Fri May 14 22:20:58 2010	(r208104)
@@ -2969,7 +2969,9 @@ err_tx_desc:
 		igb_dma_free(adapter, &txr->txdma);
 	free(adapter->rx_rings, M_DEVBUF);
 rx_fail:
+#if __FreeBSD_version >= 800000
 	buf_ring_free(txr->br, M_DEVBUF);
+#endif
 	free(adapter->tx_rings, M_DEVBUF);
 tx_fail:
 	free(adapter->queues, M_DEVBUF);

Modified: stable/8/sys/dev/e1000/if_lem.c
==============================================================================
--- stable/8/sys/dev/e1000/if_lem.c	Fri May 14 22:18:34 2010	(r208103)
+++ stable/8/sys/dev/e1000/if_lem.c	Fri May 14 22:20:58 2010	(r208104)
@@ -2422,10 +2422,10 @@ lem_setup_interface(device_t dev, struct
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
 
-	/* Enable All WOL methods by default */
+	/* Enable only WOL MAGIC by default */
 	if (adapter->wol) {
 		ifp->if_capabilities |= IFCAP_WOL;
-		ifp->if_capenable |= IFCAP_WOL;
+		ifp->if_capenable |= IFCAP_WOL_MAGIC;
 	}
 		
 	/*

From owner-svn-src-all@FreeBSD.ORG  Fri May 14 22:39:52 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01DA1106566B;
	Fri, 14 May 2010 22:39:52 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD8348FC13;
	Fri, 14 May 2010 22:39:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EMdp84092046;
	Fri, 14 May 2010 22:39:51 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4EMdpEs092036;
	Fri, 14 May 2010 22:39:51 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201005142239.o4EMdpEs092036@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 14 May 2010 22:39:51 +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: r208105 - in stable/7/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: Fri, 14 May 2010 22:39:52 -0000

Author: jfv
Date: Fri May 14 22:39:51 2010
New Revision: 208105
URL: http://svn.freebsd.org/changeset/base/208105

Log:
  MFC the new em/lem/igb drivers for stable/7

Modified:
  stable/7/sys/conf/files
  stable/7/sys/dev/e1000/e1000_80003es2lan.c
  stable/7/sys/dev/e1000/e1000_80003es2lan.h
  stable/7/sys/dev/e1000/e1000_82540.c
  stable/7/sys/dev/e1000/e1000_82541.c
  stable/7/sys/dev/e1000/e1000_82542.c
  stable/7/sys/dev/e1000/e1000_82543.c
  stable/7/sys/dev/e1000/e1000_82571.c
  stable/7/sys/dev/e1000/e1000_82575.c
  stable/7/sys/dev/e1000/e1000_82575.h
  stable/7/sys/dev/e1000/e1000_api.c
  stable/7/sys/dev/e1000/e1000_api.h
  stable/7/sys/dev/e1000/e1000_defines.h
  stable/7/sys/dev/e1000/e1000_hw.h
  stable/7/sys/dev/e1000/e1000_ich8lan.c
  stable/7/sys/dev/e1000/e1000_ich8lan.h
  stable/7/sys/dev/e1000/e1000_mac.c
  stable/7/sys/dev/e1000/e1000_mac.h
  stable/7/sys/dev/e1000/e1000_manage.c
  stable/7/sys/dev/e1000/e1000_nvm.c
  stable/7/sys/dev/e1000/e1000_nvm.h
  stable/7/sys/dev/e1000/e1000_osdep.c
  stable/7/sys/dev/e1000/e1000_osdep.h
  stable/7/sys/dev/e1000/e1000_phy.c
  stable/7/sys/dev/e1000/e1000_phy.h
  stable/7/sys/dev/e1000/e1000_regs.h
  stable/7/sys/dev/e1000/if_em.c
  stable/7/sys/dev/e1000/if_em.h
  stable/7/sys/dev/e1000/if_igb.c
  stable/7/sys/dev/e1000/if_igb.h
  stable/7/sys/modules/em/Makefile
  stable/7/sys/modules/igb/Makefile

Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/conf/files	Fri May 14 22:39:51 2010	(r208105)
@@ -782,6 +782,8 @@ dev/eisa/eisa_if.m		standard
 dev/eisa/eisaconf.c		optional eisa
 dev/e1000/if_em.c		optional em \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
+dev/e1000/if_lem.c		optional em \
+	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/if_igb.c		optional igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_80003es2lan.c	optional em | igb \

Modified: stable/7/sys/dev/e1000/e1000_80003es2lan.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_80003es2lan.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_80003es2lan.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -43,9 +43,7 @@ static s32  e1000_init_phy_params_80003e
 static s32  e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_init_mac_params_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_acquire_phy_80003es2lan(struct e1000_hw *hw);
-static s32  e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw);
 static void e1000_release_phy_80003es2lan(struct e1000_hw *hw);
-static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw);
 static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
@@ -173,7 +171,7 @@ static s32 e1000_init_nvm_params_80003es
 		break;
 	}
 
-	nvm->type               = e1000_nvm_eeprom_spi;
+	nvm->type = e1000_nvm_eeprom_spi;
 
 	size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
 	                  E1000_EECD_SIZE_EX_SHIFT);
@@ -208,17 +206,22 @@ static s32 e1000_init_nvm_params_80003es
 static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
-	s32 ret_val = E1000_SUCCESS;
 
 	DEBUGFUNC("e1000_init_mac_params_80003es2lan");
 
-	/* Set media type */
+	/* Set media type and media-dependent function pointers */
 	switch (hw->device_id) {
 	case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
 		hw->phy.media_type = e1000_media_type_internal_serdes;
+		mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
+		mac->ops.setup_physical_interface =
+			e1000_setup_fiber_serdes_link_generic;
 		break;
 	default:
 		hw->phy.media_type = e1000_media_type_copper;
+		mac->ops.check_for_link = e1000_check_for_copper_link_generic;
+		mac->ops.setup_physical_interface =
+			e1000_setup_copper_link_80003es2lan;
 		break;
 	}
 
@@ -228,10 +231,14 @@ static s32 e1000_init_mac_params_80003es
 	mac->rar_entry_count = E1000_RAR_ENTRIES;
 	/* Set if part includes ASF firmware */
 	mac->asf_firmware_present = TRUE;
-	/* Set if manageability features are enabled. */
+	/* FWSM register */
+	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;
+	/* Adaptive IFS not supported */
+	mac->adaptive_ifs = FALSE;
 
 	/* Function pointers */
 
@@ -243,27 +250,6 @@ static s32 e1000_init_mac_params_80003es
 	mac->ops.init_hw = e1000_init_hw_80003es2lan;
 	/* link setup */
 	mac->ops.setup_link = e1000_setup_link_generic;
-	/* physical interface link setup */
-	mac->ops.setup_physical_interface =
-	        (hw->phy.media_type == e1000_media_type_copper)
-	                ? e1000_setup_copper_link_80003es2lan
-	                : e1000_setup_fiber_serdes_link_generic;
-	/* check for link */
-	switch (hw->phy.media_type) {
-	case e1000_media_type_copper:
-		mac->ops.check_for_link = e1000_check_for_copper_link_generic;
-		break;
-	case e1000_media_type_fiber:
-		mac->ops.check_for_link = e1000_check_for_fiber_link_generic;
-		break;
-	case e1000_media_type_internal_serdes:
-		mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
-		break;
-	default:
-		ret_val = -E1000_ERR_CONFIG;
-		goto out;
-		break;
-	}
 	/* check management mode */
 	mac->ops.check_mng_mode = e1000_check_mng_mode_generic;
 	/* multicast address update */
@@ -272,10 +258,10 @@ static s32 e1000_init_mac_params_80003es
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 	/* clearing VFTA */
 	mac->ops.clear_vfta = e1000_clear_vfta_generic;
-	/* setting MTA */
-	mac->ops.mta_set = e1000_mta_set_generic;
 	/* read mac address */
 	mac->ops.read_mac_addr = e1000_read_mac_addr_80003es2lan;
+	/* ID LED init */
+	mac->ops.id_led_init = e1000_id_led_init_generic;
 	/* blink LED */
 	mac->ops.blink_led = e1000_blink_led_generic;
 	/* setup LED */
@@ -290,8 +276,10 @@ static s32 e1000_init_mac_params_80003es
 	/* link info */
 	mac->ops.get_link_up_info = e1000_get_link_up_info_80003es2lan;
 
-out:
-	return ret_val;
+	/* set lan id for port to determine which phy lock to use */
+	hw->mac.ops.set_lan_id(hw);
+
+	return E1000_SUCCESS;
 }
 
 /**
@@ -307,7 +295,6 @@ void e1000_init_function_pointers_80003e
 	hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan;
 	hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan;
 	hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan;
-	e1000_get_bus_info_pcie_generic(hw);
 }
 
 /**
@@ -342,7 +329,6 @@ static void e1000_release_phy_80003es2la
 	e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
-
 /**
  *  e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register
  *  @hw: pointer to the HW structure
@@ -532,28 +518,36 @@ static s32 e1000_read_phy_reg_gg82563_80
 		goto out;
 	}
 
-	/*
-	 * The "ready" bit in the MDIC register may be incorrectly set
-	 * before the device has completed the "Page Select" MDI
-	 * transaction.  So we wait 200us after each MDI command...
-	 */
-	usec_delay(200);
+	if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) {
+		/*
+		 * The "ready" bit in the MDIC register may be incorrectly set
+		 * before the device has completed the "Page Select" MDI
+		 * transaction.  So we wait 200us after each MDI command...
+		 */
+		usec_delay(200);
 
-	/* ...and verify the command was successful. */
-	ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
+		/* ...and verify the command was successful. */
+		ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
 
-	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
-		ret_val = -E1000_ERR_PHY;
-		e1000_release_phy_80003es2lan(hw);
-		goto out;
-	}
+		if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+			ret_val = -E1000_ERR_PHY;
+			e1000_release_phy_80003es2lan(hw);
+			goto out;
+		}
 
-	usec_delay(200);
+		usec_delay(200);
 
-	ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
-	                                   data);
+		ret_val = e1000_read_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
+
+		usec_delay(200);
+	} else {
+		ret_val = e1000_read_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
+	}
 
-	usec_delay(200);
 	e1000_release_phy_80003es2lan(hw);
 
 out:
@@ -599,29 +593,36 @@ static s32 e1000_write_phy_reg_gg82563_8
 		goto out;
 	}
 
+	if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) {
+		/*
+		 * The "ready" bit in the MDIC register may be incorrectly set
+		 * before the device has completed the "Page Select" MDI
+		 * transaction.  So we wait 200us after each MDI command...
+		 */
+		usec_delay(200);
 
-	/*
-	 * The "ready" bit in the MDIC register may be incorrectly set
-	 * before the device has completed the "Page Select" MDI
-	 * transaction.  So we wait 200us after each MDI command...
-	 */
-	usec_delay(200);
+		/* ...and verify the command was successful. */
+		ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
 
-	/* ...and verify the command was successful. */
-	ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
+		if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
+			ret_val = -E1000_ERR_PHY;
+			e1000_release_phy_80003es2lan(hw);
+			goto out;
+		}
 
-	if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
-		ret_val = -E1000_ERR_PHY;
-		e1000_release_phy_80003es2lan(hw);
-		goto out;
-	}
+		usec_delay(200);
 
-	usec_delay(200);
+		ret_val = e1000_write_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
 
-	ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
-	                                  data);
+		usec_delay(200);
+	} else {
+		ret_val = e1000_write_phy_reg_mdic(hw,
+		                                  MAX_PHY_REG_ADDRESS & offset,
+		                                  data);
+	}
 
-	usec_delay(200);
 	e1000_release_phy_80003es2lan(hw);
 
 out:
@@ -802,17 +803,16 @@ static s32 e1000_get_cable_length_80003e
 
 	index = phy_data & GG82563_DSPD_CABLE_LENGTH;
 
-	if (index < GG82563_CABLE_LENGTH_TABLE_SIZE + 5) {
-		phy->min_cable_length = e1000_gg82563_cable_length_table[index];
-		phy->max_cable_length =
-		                 e1000_gg82563_cable_length_table[index+5];
-
-		phy->cable_length = (phy->min_cable_length +
-		                     phy->max_cable_length) / 2;
-	} else {
-		ret_val = E1000_ERR_PHY;
+	if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) {
+		ret_val = -E1000_ERR_PHY;
+		goto out;
 	}
 
+	phy->min_cable_length = e1000_gg82563_cable_length_table[index];
+	phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5];
+
+	phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
+
 out:
 	return ret_val;
 }
@@ -892,7 +892,7 @@ static s32 e1000_reset_hw_80003es2lan(st
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
 	icr = E1000_READ_REG(hw, E1000_ICR);
 
-	e1000_check_alt_mac_addr_generic(hw);
+	ret_val = e1000_check_alt_mac_addr_generic(hw);
 
 out:
 	return ret_val;
@@ -916,11 +916,10 @@ static s32 e1000_init_hw_80003es2lan(str
 	e1000_initialize_hw_bits_80003es2lan(hw);
 
 	/* Initialize identification LED */
-	ret_val = e1000_id_led_init_generic(hw);
-	if (ret_val) {
+	ret_val = mac->ops.id_led_init(hw);
+	if (ret_val)
 		DEBUGOUT("Error initializing identification LED\n");
 		/* This is not fatal and we should not stop init due to this */
-	}
 
 	/* Disabling VLAN filtering */
 	DEBUGOUT("Initializing the IEEE VLAN\n");
@@ -970,6 +969,19 @@ static s32 e1000_init_hw_80003es2lan(str
 	reg_data &= ~0x00100000;
 	E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data);
 
+	/* default to TRUE to enable the MDIC W/A */
+	hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE;
+
+	ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
+	                              E1000_KMRNCTRLSTA_OFFSET >>
+	                              E1000_KMRNCTRLSTA_OFFSET_SHIFT,
+	                              &i);
+	if (!ret_val) {
+		if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) ==
+		     E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO)
+			hw->dev_spec._80003es2lan.mdic_wa_enable = FALSE;
+	}
+
 	/*
 	 * Clear all of the statistics registers (clear on read).  It is
 	 * important that we do this after we have tried to establish link
@@ -1036,77 +1048,78 @@ static s32 e1000_copper_link_setup_gg825
 
 	DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan");
 
-	if (!phy->reset_disable) {
-		ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
-		                             &data);
-		if (ret_val)
-			goto out;
+	if (phy->reset_disable)
+		goto skip_reset;
 
-		data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
-		/* Use 25MHz for both link down and 1000Base-T for Tx clock. */
-		data |= GG82563_MSCR_TX_CLK_1000MBPS_25;
+	ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
+				     &data);
+	if (ret_val)
+		goto out;
 
-		ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
-		                              data);
-		if (ret_val)
-			goto out;
+	data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
+	/* Use 25MHz for both link down and 1000Base-T for Tx clock. */
+	data |= GG82563_MSCR_TX_CLK_1000MBPS_25;
 
-		/*
-		 * Options:
-		 *   MDI/MDI-X = 0 (default)
-		 *   0 - Auto for all speeds
-		 *   1 - MDI mode
-		 *   2 - MDI-X mode
-		 *   3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
-		 */
-		ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data);
-		if (ret_val)
-			goto out;
+	ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
+				      data);
+	if (ret_val)
+		goto out;
 
-		data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
+	/*
+	 * Options:
+	 *   MDI/MDI-X = 0 (default)
+	 *   0 - Auto for all speeds
+	 *   1 - MDI mode
+	 *   2 - MDI-X mode
+	 *   3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
+	 */
+	ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data);
+	if (ret_val)
+		goto out;
 
-		switch (phy->mdix) {
-		case 1:
-			data |= GG82563_PSCR_CROSSOVER_MODE_MDI;
-			break;
-		case 2:
-			data |= GG82563_PSCR_CROSSOVER_MODE_MDIX;
-			break;
-		case 0:
-		default:
-			data |= GG82563_PSCR_CROSSOVER_MODE_AUTO;
-			break;
-		}
+	data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
 
-		/*
-		 * Options:
-		 *   disable_polarity_correction = 0 (default)
-		 *       Automatic Correction for Reversed Cable Polarity
-		 *   0 - Disabled
-		 *   1 - Enabled
-		 */
-		data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
-		if (phy->disable_polarity_correction)
-			data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
+	switch (phy->mdix) {
+	case 1:
+		data |= GG82563_PSCR_CROSSOVER_MODE_MDI;
+		break;
+	case 2:
+		data |= GG82563_PSCR_CROSSOVER_MODE_MDIX;
+		break;
+	case 0:
+	default:
+		data |= GG82563_PSCR_CROSSOVER_MODE_AUTO;
+		break;
+	}
 
-		ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data);
-		if (ret_val)
-			goto out;
+	/*
+	 * Options:
+	 *   disable_polarity_correction = 0 (default)
+	 *       Automatic Correction for Reversed Cable Polarity
+	 *   0 - Disabled
+	 *   1 - Enabled
+	 */
+	data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
+	if (phy->disable_polarity_correction)
+		data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
 
-		/* SW Reset the PHY so all changes take effect */
-		ret_val = hw->phy.ops.commit(hw);
-		if (ret_val) {
-			DEBUGOUT("Error Resetting the PHY\n");
-			goto out;
-		}
+	ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data);
+	if (ret_val)
+		goto out;
 
+	/* SW Reset the PHY so all changes take effect */
+	ret_val = hw->phy.ops.commit(hw);
+	if (ret_val) {
+		DEBUGOUT("Error Resetting the PHY\n");
+		goto out;
 	}
 
+skip_reset:
 	/* Bypass Rx and Tx FIFO's */
 	ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-	                        E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
-	                        E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
-	                                E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
+					E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
+					E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
+					E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
 	if (ret_val)
 		goto out;
 
@@ -1147,22 +1160,19 @@ static s32 e1000_copper_link_setup_gg825
 	if (!(hw->mac.ops.check_mng_mode(hw))) {
 		/* Enable Electrical Idle on the PHY */
 		data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
-		ret_val = hw->phy.ops.write_reg(hw,
-		                                GG82563_PHY_PWR_MGMT_CTRL,
+		ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL,
 		                                data);
 		if (ret_val)
 			goto out;
-		ret_val = hw->phy.ops.read_reg(hw,
-			                       GG82563_PHY_KMRN_MODE_CTRL,
-			                       &data);
-			if (ret_val)
-				goto out;
+
+		ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
+		                               &data);
+		if (ret_val)
+			goto out;
 
 		data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
-		ret_val = hw->phy.ops.write_reg(hw,
-		                                GG82563_PHY_KMRN_MODE_CTRL,
+		ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
 		                                data);
-
 		if (ret_val)
 			goto out;
 	}
@@ -1261,7 +1271,6 @@ static s32 e1000_cfg_on_link_up_80003es2
 	DEBUGFUNC("e1000_configure_on_link_up");
 
 	if (hw->phy.media_type == e1000_media_type_copper) {
-
 		ret_val = e1000_get_speed_and_duplex_copper_generic(hw,
 		                                                    &speed,
 		                                                    &duplex);
@@ -1308,7 +1317,6 @@ static s32 e1000_cfg_kmrn_10_100_80003es
 	tipg |= DEFAULT_TIPG_IPGT_10_100_80003ES2LAN;
 	E1000_WRITE_REG(hw, E1000_TIPG, tipg);
 
-
 	do {
 		ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
 		                               ®_data);
@@ -1362,7 +1370,6 @@ static s32 e1000_cfg_kmrn_1000_80003es2l
 	tipg |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN;
 	E1000_WRITE_REG(hw, E1000_TIPG, tipg);
 
-
 	do {
 		ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
 		                               ®_data);
@@ -1393,7 +1400,8 @@ out:
  *  using the kumeran interface.  The information retrieved is stored in data.
  *  Release the semaphore before exiting.
  **/
-s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data)
+static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+                                           u16 *data)
 {
 	u32 kmrnctrlsta;
 	s32 ret_val = E1000_SUCCESS;
@@ -1429,7 +1437,8 @@ out:
  *  at the offset using the kumeran interface.  Release semaphore
  *  before exiting.
  **/
-s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data)
+static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+                                            u16 data)
 {
 	u32 kmrnctrlsta;
 	s32 ret_val = E1000_SUCCESS;
@@ -1461,9 +1470,19 @@ static s32 e1000_read_mac_addr_80003es2l
 	s32 ret_val = E1000_SUCCESS;
 
 	DEBUGFUNC("e1000_read_mac_addr_80003es2lan");
-	if (e1000_check_alt_mac_addr_generic(hw))
-		ret_val = e1000_read_mac_addr_generic(hw);
 
+	/*
+	 * If there's an alternate MAC address place it in RAR0
+	 * so that it will override the Si installed default perm
+	 * address.
+	 */
+	ret_val = e1000_check_alt_mac_addr_generic(hw);
+	if (ret_val)
+		goto out;
+
+	ret_val = e1000_read_mac_addr_generic(hw);
+
+out:
 	return ret_val;
 }
 

Modified: stable/7/sys/dev/e1000/e1000_80003es2lan.h
==============================================================================
--- stable/7/sys/dev/e1000/e1000_80003es2lan.h	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_80003es2lan.h	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
-/*******************************************************************************
+/******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2009, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -29,10 +29,9 @@
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.
 
-*******************************************************************************/
+******************************************************************************/
 /*$FreeBSD$*/
 
-
 #ifndef _E1000_80003ES2LAN_H_
 #define _E1000_80003ES2LAN_H_
 
@@ -49,6 +48,9 @@
 #define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT   0x0000
 #define E1000_KMRNCTRLSTA_OPMODE_E_IDLE          0x2000
 
+#define E1000_KMRNCTRLSTA_OPMODE_MASK            0x000C
+#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO     0x0004
+
 #define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */
 #define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN        0x00010000
 

Modified: stable/7/sys/dev/e1000/e1000_82540.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_82540.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_82540.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -57,6 +57,7 @@ static s32  e1000_set_vco_speed_82540(st
 static s32  e1000_setup_copper_link_82540(struct e1000_hw *hw);
 static s32  e1000_setup_fiber_serdes_link_82540(struct e1000_hw *hw);
 static void e1000_power_down_phy_copper_82540(struct e1000_hw *hw);
+static s32  e1000_read_mac_addr_82540(struct e1000_hw *hw);
 
 /**
  * e1000_init_phy_params_82540 - Init PHY func ptrs.
@@ -227,8 +228,10 @@ static s32 e1000_init_mac_params_82540(s
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 	/* clearing VFTA */
 	mac->ops.clear_vfta = e1000_clear_vfta_generic;
-	/* setting MTA */
-	mac->ops.mta_set = e1000_mta_set_generic;
+	/* read mac address */
+	mac->ops.read_mac_addr = e1000_read_mac_addr_82540;
+	/* ID LED init */
+	mac->ops.id_led_init = e1000_id_led_init_generic;
 	/* setup LED */
 	mac->ops.setup_led = e1000_setup_led_generic;
 	/* cleanup LED */
@@ -332,7 +335,7 @@ static s32 e1000_init_hw_82540(struct e1
 	DEBUGFUNC("e1000_init_hw_82540");
 
 	/* Initialize identification LED */
-	ret_val = e1000_id_led_init_generic(hw);
+	ret_val = mac->ops.id_led_init(hw);
 	if (ret_val) {
 		DEBUGOUT("Error initializing identification LED\n");
 		/* This is not fatal and we should not stop init due to this */
@@ -674,3 +677,45 @@ static void e1000_clear_hw_cntrs_82540(s
 	E1000_READ_REG(hw, E1000_MGTPTC);
 }
 
+/**
+ *  e1000_read_mac_addr_82540 - Read device MAC address
+ *  @hw: pointer to the HW structure
+ *
+ *  Reads the device MAC address from the EEPROM and stores the value.
+ *  Since devices with two ports use the same EEPROM, we increment the
+ *  last bit in the MAC address for the second port.
+ *
+ *  This version is being used over generic because of customer issues
+ *  with VmWare and Virtual Box when using generic. It seems in
+ *  the emulated 82545, RAR[0] does NOT have a valid address after a
+ *  reset, this older method works and using this breaks nothing for
+ *  these legacy adapters.
+ **/
+s32 e1000_read_mac_addr_82540(struct e1000_hw *hw)
+{
+	s32  ret_val = E1000_SUCCESS;
+	u16 offset, nvm_data, i;
+
+	DEBUGFUNC("e1000_read_mac_addr");
+
+	for (i = 0; i < ETH_ADDR_LEN; i += 2) {
+		offset = i >> 1;
+		ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
+		if (ret_val) {
+			DEBUGOUT("NVM Read Error\n");
+			goto out;
+		}
+		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+	}
+
+	/* Flip last bit of mac address if we're on second port */
+	if (hw->bus.func == E1000_FUNC_1)
+		hw->mac.perm_addr[5] ^= 1;
+
+	for (i = 0; i < ETH_ADDR_LEN; i++)
+		hw->mac.addr[i] = hw->mac.perm_addr[i];
+
+out:
+	return ret_val;
+}

Modified: stable/7/sys/dev/e1000/e1000_82541.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_82541.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_82541.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -59,6 +59,7 @@ static s32  e1000_set_d3_lplu_state_8254
 static s32  e1000_setup_led_82541(struct e1000_hw *hw);
 static s32  e1000_cleanup_led_82541(struct e1000_hw *hw);
 static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw);
+static s32  e1000_read_mac_addr_82541(struct e1000_hw *hw);
 static s32  e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw,
                                                      bool link_up);
 static s32  e1000_phy_init_script_82541(struct e1000_hw *hw);
@@ -259,8 +260,10 @@ static s32 e1000_init_mac_params_82541(s
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 	/* clearing VFTA */
 	mac->ops.clear_vfta = e1000_clear_vfta_generic;
-	/* setting MTA */
-	mac->ops.mta_set = e1000_mta_set_generic;
+	/* read mac address */
+	mac->ops.read_mac_addr = e1000_read_mac_addr_82541;
+	/* ID LED init */
+	mac->ops.id_led_init = e1000_id_led_init_generic;
 	/* setup LED */
 	mac->ops.setup_led = e1000_setup_led_82541;
 	/* cleanup LED */
@@ -375,17 +378,25 @@ static s32 e1000_reset_hw_82541(struct e
 static s32 e1000_init_hw_82541(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
+	struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541;
 	u32 i, txdctl;
 	s32 ret_val;
 
 	DEBUGFUNC("e1000_init_hw_82541");
 
 	/* Initialize identification LED */
-	ret_val = e1000_id_led_init_generic(hw);
+	ret_val = mac->ops.id_led_init(hw);
 	if (ret_val) {
 		DEBUGOUT("Error initializing identification LED\n");
 		/* This is not fatal and we should not stop init due to this */
 	}
+        
+	/* Storing the Speed Power Down  value for later use */
+	ret_val = hw->phy.ops.read_reg(hw,
+	                               IGP01E1000_GMII_FIFO,
+	                               &dev_spec->spd_default);
+	if (ret_val)
+		goto out;
 
 	/* Disabling VLAN filtering */
 	DEBUGOUT("Initializing the IEEE VLAN\n");
@@ -423,6 +434,7 @@ static s32 e1000_init_hw_82541(struct e1
 	 */
 	e1000_clear_hw_cntrs_82541(hw);
 
+out:
 	return ret_val;
 }
 
@@ -1281,3 +1293,35 @@ static void e1000_clear_hw_cntrs_82541(s
 	E1000_READ_REG(hw, E1000_MGTPDC);
 	E1000_READ_REG(hw, E1000_MGTPTC);
 }
+
+/**
+ *  e1000_read_mac_addr_82541 - Read device MAC address
+ *  @hw: pointer to the HW structure
+ *
+ *  Reads the device MAC address from the EEPROM and stores the value.
+ **/
+static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw)
+{
+	s32  ret_val = E1000_SUCCESS;
+	u16 offset, nvm_data, i;
+
+	DEBUGFUNC("e1000_read_mac_addr");
+
+	for (i = 0; i < ETH_ADDR_LEN; i += 2) {
+		offset = i >> 1;
+		ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
+		if (ret_val) {
+			DEBUGOUT("NVM Read Error\n");
+			goto out;
+		}
+		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+	}
+
+	for (i = 0; i < ETH_ADDR_LEN; i++)
+		hw->mac.addr[i] = hw->mac.perm_addr[i];
+
+out:
+	return ret_val;
+}
+

Modified: stable/7/sys/dev/e1000/e1000_82542.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_82542.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_82542.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -49,6 +49,8 @@ static s32  e1000_led_on_82542(struct e1
 static s32  e1000_led_off_82542(struct e1000_hw *hw);
 static void e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index);
 static void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw);
+static s32  e1000_read_mac_addr_82542(struct e1000_hw *hw);
+
 
 /**
  *  e1000_init_phy_params_82542 - Init PHY func ptrs.
@@ -132,8 +134,8 @@ static s32 e1000_init_mac_params_82542(s
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 	/* clearing VFTA */
 	mac->ops.clear_vfta = e1000_clear_vfta_generic;
-	/* setting MTA */
-	mac->ops.mta_set = e1000_mta_set_generic;
+	/* read mac address */
+	mac->ops.read_mac_addr = e1000_read_mac_addr_82542;
 	/* set RAR */
 	mac->ops.rar_set = e1000_rar_set_82542;
 	/* turn on/off LED */
@@ -554,3 +556,34 @@ static void e1000_clear_hw_cntrs_82542(s
 	E1000_READ_REG(hw, E1000_PTC1023);
 	E1000_READ_REG(hw, E1000_PTC1522);
 }
+
+/**
+ *  e1000_read_mac_addr_82542 - Read device MAC address
+ *  @hw: pointer to the HW structure
+ *
+ *  Reads the device MAC address from the EEPROM and stores the value.
+ **/
+static s32 e1000_read_mac_addr_82542(struct e1000_hw *hw)
+{
+	s32  ret_val = E1000_SUCCESS;
+	u16 offset, nvm_data, i;
+
+	DEBUGFUNC("e1000_read_mac_addr");
+
+	for (i = 0; i < ETH_ADDR_LEN; i += 2) {
+		offset = i >> 1;
+		ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
+		if (ret_val) {
+			DEBUGOUT("NVM Read Error\n");
+			goto out;
+		}
+		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+	}
+
+	for (i = 0; i < ETH_ADDR_LEN; i++)
+		hw->mac.addr[i] = hw->mac.perm_addr[i];
+
+out:
+	return ret_val;
+}

Modified: stable/7/sys/dev/e1000/e1000_82543.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_82543.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_82543.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -63,7 +63,6 @@ static s32  e1000_led_on_82543(struct e1
 static s32  e1000_led_off_82543(struct e1000_hw *hw);
 static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset,
                                    u32 value);
-static void e1000_mta_set_82543(struct e1000_hw *hw, u32 hash_value);
 static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw);
 static s32  e1000_config_mac_to_phy_82543(struct e1000_hw *hw);
 static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw);
@@ -75,6 +74,8 @@ static void e1000_shift_out_mdi_bits_825
                                            u16 count);
 static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw);
 static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state);
+static s32  e1000_read_mac_addr_82543(struct e1000_hw *hw);
+
 
 /**
  *  e1000_init_phy_params_82543 - Init PHY func ptrs.
@@ -244,8 +245,8 @@ static s32 e1000_init_mac_params_82543(s
 	mac->ops.write_vfta = e1000_write_vfta_82543;
 	/* clearing VFTA */
 	mac->ops.clear_vfta = e1000_clear_vfta_generic;
-	/* setting MTA */
-	mac->ops.mta_set = e1000_mta_set_82543;
+	/* read mac address */
+	mac->ops.read_mac_addr = e1000_read_mac_addr_82543;
 	/* turn on/off LED */
 	mac->ops.led_on = e1000_led_on_82543;
 	mac->ops.led_off = e1000_led_off_82543;
@@ -1477,45 +1478,6 @@ static void e1000_write_vfta_82543(struc
 }
 
 /**
- *  e1000_mta_set_82543 - Set multicast filter table address
- *  @hw: pointer to the HW structure
- *  @hash_value: determines the MTA register and bit to set
- *
- *  The multicast table address is a register array of 32-bit registers.
- *  The hash_value is used to determine what register the bit is in, the
- *  current value is read, the new bit is OR'd in and the new value is
- *  written back into the register.
- **/
-static void e1000_mta_set_82543(struct e1000_hw *hw, u32 hash_value)
-{
-	u32 hash_bit, hash_reg, mta, temp;
-
-	DEBUGFUNC("e1000_mta_set_82543");
-
-	hash_reg = (hash_value >> 5);
-
-	/*
-	 * If we are on an 82544 and we are trying to write an odd offset
-	 * in the MTA, save off the previous entry before writing and
-	 * restore the old value after writing.
-	 */
-	if ((hw->mac.type == e1000_82544) && (hash_reg & 1)) {
-		hash_reg &= (hw->mac.mta_reg_count - 1);
-		hash_bit = hash_value & 0x1F;
-		mta = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg);
-		mta |= (1 << hash_bit);
-		temp = E1000_READ_REG_ARRAY(hw, E1000_MTA, hash_reg - 1);
-
-		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg, mta);
-		E1000_WRITE_FLUSH(hw);
-		E1000_WRITE_REG_ARRAY(hw, E1000_MTA, hash_reg - 1, temp);
-		E1000_WRITE_FLUSH(hw);
-	} else {
-		e1000_mta_set_generic(hw, hash_value);
-	}
-}
-
-/**
  *  e1000_led_on_82543 - Turn on SW controllable LED
  *  @hw: pointer to the HW structure
  *
@@ -1600,3 +1562,41 @@ static void e1000_clear_hw_cntrs_82543(s
 	E1000_READ_REG(hw, E1000_TSCTC);
 	E1000_READ_REG(hw, E1000_TSCTFC);
 }
+
+/**
+ *  e1000_read_mac_addr_82543 - Read device MAC address
+ *  @hw: pointer to the HW structure
+ *
+ *  Reads the device MAC address from the EEPROM and stores the value.
+ *  Since devices with two ports use the same EEPROM, we increment the
+ *  last bit in the MAC address for the second port.
+ *
+ **/
+s32 e1000_read_mac_addr_82543(struct e1000_hw *hw)
+{
+	s32  ret_val = E1000_SUCCESS;
+	u16 offset, nvm_data, i;
+
+	DEBUGFUNC("e1000_read_mac_addr");
+
+	for (i = 0; i < ETH_ADDR_LEN; i += 2) {
+		offset = i >> 1;
+		ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data);
+		if (ret_val) {
+			DEBUGOUT("NVM Read Error\n");
+			goto out;
+		}
+		hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF);
+		hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8);
+	}
+
+	/* Flip last bit of mac address if we're on second port */
+	if (hw->bus.func == E1000_FUNC_1)
+		hw->mac.perm_addr[5] ^= 1;
+
+	for (i = 0; i < ETH_ADDR_LEN; i++)
+		hw->mac.addr[i] = hw->mac.perm_addr[i];
+
+out:
+	return ret_val;
+}

Modified: stable/7/sys/dev/e1000/e1000_82571.c
==============================================================================
--- stable/7/sys/dev/e1000/e1000_82571.c	Fri May 14 22:20:58 2010	(r208104)
+++ stable/7/sys/dev/e1000/e1000_82571.c	Fri May 14 22:39:51 2010	(r208105)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2010, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -46,6 +46,7 @@
  * 82573E Gigabit Ethernet Controller (Copper)
  * 82573L Gigabit Ethernet Controller
  * 82574L Gigabit Network Connection
+ * 82583V Gigabit Network Connection
  */
 
 #include "e1000_api.h"
@@ -67,11 +68,9 @@ static s32  e1000_init_hw_82571(struct e
 static void e1000_clear_vfta_82571(struct e1000_hw *hw);
 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw);
 static s32 e1000_led_on_82574(struct e1000_hw *hw);
-static void e1000_update_mc_addr_list_82571(struct e1000_hw *hw,
-                                           u8 *mc_addr_list, u32 mc_addr_count,
-                                           u32 rar_used_count, u32 rar_count);
 static s32  e1000_setup_link_82571(struct e1000_hw *hw);
 static s32  e1000_setup_copper_link_82571(struct e1000_hw *hw);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 04:48:10 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 924D0106566B;
	Sat, 15 May 2010 04:48:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 302FD8FC1D;
	Sat, 15 May 2010 04:48:10 +0000 (UTC)
Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1])
	by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o4F4m9ZK001739
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 15 May 2010 06:48:09 +0200 (CEST)
	(envelope-from uqs@FreeBSD.org)
Received: (from uqs@localhost)
	by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o4F4m9h2001738;
	Sat, 15 May 2010 06:48:09 +0200 (CEST)
	(envelope-from uqs@FreeBSD.org)
Date: Sat, 15 May 2010 06:48:09 +0200
From: Ulrich Spoerlein 
To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	svn-src-head@FreeBSD.org
Message-ID: <20100515044809.GP88504@acme.spoerlein.net>
Mail-Followup-To: Ulrich Spoerlein ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	svn-src-head@FreeBSD.org
References: <201005141426.o4EEQnRt081229@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201005141426.o4EEQnRt081229@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: 
Subject: Re: svn commit: r208074 - head/sbin/fsirand
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 04:48:10 -0000

On Fri, 14.05.2010 at 14:26:49 +0000, Ulrich Spoerlein wrote:
> Author: uqs
> Date: Fri May 14 14:26:49 2010
> New Revision: 208074
> URL: http://svn.freebsd.org/changeset/base/208074
> 
> Log:
>   fsirand(8): make WARNS=3 clean
>   

Forgot to add:

X-MFC-After:            3 weeks

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 07:01:42 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FFA81065679;
	Sat, 15 May 2010 07:01:42 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F0FAA8FC21;
	Sat, 15 May 2010 07:01:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4F71fu6002351;
	Sat, 15 May 2010 07:01:41 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4F71fBS002349;
	Sat, 15 May 2010 07:01:41 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201005150701.o4F71fBS002349@svn.freebsd.org>
From: Jack F Vogel 
Date: Sat, 15 May 2010 07:01:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208108 - stable/7/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 07:01:42 -0000

Author: jfv
Date: Sat May 15 07:01:41 2010
New Revision: 208108
URL: http://svn.freebsd.org/changeset/base/208108

Log:
  Add missing lem files to the MFC

Added:
  stable/7/sys/dev/e1000/if_lem.c   (contents, props changed)
  stable/7/sys/dev/e1000/if_lem.h   (contents, props changed)

Added: stable/7/sys/dev/e1000/if_lem.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/sys/dev/e1000/if_lem.c	Sat May 15 07:01:41 2010	(r208108)
@@ -0,0 +1,4552 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2010, 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$*/
+
+#ifdef HAVE_KERNEL_OPTION_HEADERS
+#include "opt_device_polling.h"
+#include "opt_inet.h"
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#if __FreeBSD_version >= 700029
+#include 
+#endif
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "e1000_api.h"
+#include "if_lem.h"
+
+/*********************************************************************
+ *  Set this to one to display debug statistics
+ *********************************************************************/
+int	lem_display_debug_stats = 0;
+
+/*********************************************************************
+ *  Legacy Em Driver version:
+ *********************************************************************/
+char lem_driver_version[] = "1.0.1";
+
+
+/*********************************************************************
+ *  PCI Device ID Table
+ *
+ *  Used by probe to select devices to load on
+ *  Last field stores an index into e1000_strings
+ *  Last entry must be all 0s
+ *
+ *  { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index }
+ *********************************************************************/
+
+static em_vendor_info_t lem_vendor_info_array[] =
+{
+	/* Intel(R) PRO/1000 Network Connection */
+	{ 0x8086, E1000_DEV_ID_82540EM,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82540EM_LOM,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82540EP,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82540EP_LOM,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82540EP_LP,	PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82541EI,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541ER,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541ER_LOM,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541EI_MOBILE,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541GI,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541GI_LF,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82541GI_MOBILE,	PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82542,		PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82543GC_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82543GC_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82544EI_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82544EI_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82544GC_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82544GC_LOM,	PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82545EM_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82545EM_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82545GM_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82545GM_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82545GM_SERDES,	PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82546EB_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546EB_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546EB_QUAD_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_COPPER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_FIBER,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_SERDES,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_PCIE,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER, PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3,
+						PCI_ANY_ID, PCI_ANY_ID, 0},
+
+	{ 0x8086, E1000_DEV_ID_82547EI,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82547EI_MOBILE,	PCI_ANY_ID, PCI_ANY_ID, 0},
+	{ 0x8086, E1000_DEV_ID_82547GI,		PCI_ANY_ID, PCI_ANY_ID, 0},
+	/* required last entry */
+	{ 0, 0, 0, 0, 0}
+};
+
+/*********************************************************************
+ *  Table of branding strings for all supported NICs.
+ *********************************************************************/
+
+static char *lem_strings[] = {
+	"Intel(R) PRO/1000 Legacy Network Connection"
+};
+
+/*********************************************************************
+ *  Function prototypes
+ *********************************************************************/
+static int	lem_probe(device_t);
+static int	lem_attach(device_t);
+static int	lem_detach(device_t);
+static int	lem_shutdown(device_t);
+static int	lem_suspend(device_t);
+static int	lem_resume(device_t);
+static void	lem_start(struct ifnet *);
+static void	lem_start_locked(struct ifnet *ifp);
+static int	lem_ioctl(struct ifnet *, u_long, caddr_t);
+static void	lem_init(void *);
+static void	lem_init_locked(struct adapter *);
+static void	lem_stop(void *);
+static void	lem_media_status(struct ifnet *, struct ifmediareq *);
+static int	lem_media_change(struct ifnet *);
+static void	lem_identify_hardware(struct adapter *);
+static int	lem_allocate_pci_resources(struct adapter *);
+static int	lem_allocate_irq(struct adapter *adapter);
+static void	lem_free_pci_resources(struct adapter *);
+static void	lem_local_timer(void *);
+static int	lem_hardware_init(struct adapter *);
+static void	lem_setup_interface(device_t, struct adapter *);
+static void	lem_setup_transmit_structures(struct adapter *);
+static void	lem_initialize_transmit_unit(struct adapter *);
+static int	lem_setup_receive_structures(struct adapter *);
+static void	lem_initialize_receive_unit(struct adapter *);
+static void	lem_enable_intr(struct adapter *);
+static void	lem_disable_intr(struct adapter *);
+static void	lem_free_transmit_structures(struct adapter *);
+static void	lem_free_receive_structures(struct adapter *);
+static void	lem_update_stats_counters(struct adapter *);
+static void	lem_txeof(struct adapter *);
+static void	lem_tx_purge(struct adapter *);
+static int	lem_allocate_receive_structures(struct adapter *);
+static int	lem_allocate_transmit_structures(struct adapter *);
+static int	lem_rxeof(struct adapter *, int);
+#ifndef __NO_STRICT_ALIGNMENT
+static int	lem_fixup_rx(struct adapter *);
+#endif
+static void	lem_receive_checksum(struct adapter *, struct e1000_rx_desc *,
+		    struct mbuf *);
+static void	lem_transmit_checksum_setup(struct adapter *, struct mbuf *,
+		    u32 *, u32 *);
+static void	lem_set_promisc(struct adapter *);
+static void	lem_disable_promisc(struct adapter *);
+static void	lem_set_multi(struct adapter *);
+static void	lem_print_hw_stats(struct adapter *);
+static void	lem_update_link_status(struct adapter *);
+static int	lem_get_buf(struct adapter *, int);
+#if __FreeBSD_version >= 700029
+static void	lem_register_vlan(void *, struct ifnet *, u16);
+static void	lem_unregister_vlan(void *, struct ifnet *, u16);
+static void	lem_setup_vlan_hw_support(struct adapter *);
+#endif
+static int	lem_xmit(struct adapter *, struct mbuf **);
+static void	lem_smartspeed(struct adapter *);
+static int	lem_82547_fifo_workaround(struct adapter *, int);
+static void	lem_82547_update_fifo_head(struct adapter *, int);
+static int	lem_82547_tx_fifo_reset(struct adapter *);
+static void	lem_82547_move_tail(void *);
+static int	lem_dma_malloc(struct adapter *, bus_size_t,
+		    struct em_dma_alloc *, int);
+static void	lem_dma_free(struct adapter *, struct em_dma_alloc *);
+static void	lem_print_debug_info(struct adapter *);
+static void	lem_print_nvm_info(struct adapter *);
+static int 	lem_is_valid_ether_addr(u8 *);
+static int	lem_sysctl_stats(SYSCTL_HANDLER_ARGS);
+static int	lem_sysctl_debug_info(SYSCTL_HANDLER_ARGS);
+static u32	lem_fill_descriptors (bus_addr_t address, u32 length,
+		    PDESC_ARRAY desc_array);
+static int	lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS);
+static void	lem_add_int_delay_sysctl(struct adapter *, const char *,
+		    const char *, struct em_int_delay_info *, int, int);
+/* Management and WOL Support */
+static void	lem_init_manageability(struct adapter *);
+static void	lem_release_manageability(struct adapter *);
+static void     lem_get_hw_control(struct adapter *);
+static void     lem_release_hw_control(struct adapter *);
+static void	lem_get_wakeup(device_t);
+static void     lem_enable_wakeup(device_t);
+static int	lem_enable_phy_wakeup(struct adapter *);
+static void	lem_led_func(void *, int);
+
+#ifdef EM_LEGACY_IRQ
+static void	lem_intr(void *);
+#else /* FAST IRQ */
+#if __FreeBSD_version < 700000
+static void	lem_irq_fast(void *);
+#else
+static int	lem_irq_fast(void *);
+#endif
+static void	lem_handle_rxtx(void *context, int pending);
+static void	lem_handle_link(void *context, int pending);
+static void	lem_add_rx_process_limit(struct adapter *, const char *,
+		    const char *, int *, int);
+#endif /* ~EM_LEGACY_IRQ */
+
+#ifdef DEVICE_POLLING
+static poll_handler_t lem_poll;
+#endif /* POLLING */
+
+/*********************************************************************
+ *  FreeBSD Device Interface Entry Points
+ *********************************************************************/
+
+static device_method_t lem_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe, lem_probe),
+	DEVMETHOD(device_attach, lem_attach),
+	DEVMETHOD(device_detach, lem_detach),
+	DEVMETHOD(device_shutdown, lem_shutdown),
+	DEVMETHOD(device_suspend, lem_suspend),
+	DEVMETHOD(device_resume, lem_resume),
+	{0, 0}
+};
+
+static driver_t lem_driver = {
+	"em", lem_methods, sizeof(struct adapter),
+};
+
+extern devclass_t em_devclass;
+DRIVER_MODULE(lem, pci, lem_driver, em_devclass, 0, 0);
+MODULE_DEPEND(lem, pci, 1, 1, 1);
+MODULE_DEPEND(lem, ether, 1, 1, 1);
+
+/*********************************************************************
+ *  Tunable default values.
+ *********************************************************************/
+
+#define EM_TICKS_TO_USECS(ticks)	((1024 * (ticks) + 500) / 1000)
+#define EM_USECS_TO_TICKS(usecs)	((1000 * (usecs) + 512) / 1024)
+
+static int lem_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV);
+static int lem_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR);
+static int lem_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV);
+static int lem_rx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_RADV);
+static int lem_rxd = EM_DEFAULT_RXD;
+static int lem_txd = EM_DEFAULT_TXD;
+static int lem_smart_pwr_down = FALSE;
+
+/* Controls whether promiscuous also shows bad packets */
+static int lem_debug_sbp = FALSE;
+
+TUNABLE_INT("hw.em.tx_int_delay", &lem_tx_int_delay_dflt);
+TUNABLE_INT("hw.em.rx_int_delay", &lem_rx_int_delay_dflt);
+TUNABLE_INT("hw.em.tx_abs_int_delay", &lem_tx_abs_int_delay_dflt);
+TUNABLE_INT("hw.em.rx_abs_int_delay", &lem_rx_abs_int_delay_dflt);
+TUNABLE_INT("hw.em.rxd", &lem_rxd);
+TUNABLE_INT("hw.em.txd", &lem_txd);
+TUNABLE_INT("hw.em.smart_pwr_down", &lem_smart_pwr_down);
+TUNABLE_INT("hw.em.sbp", &lem_debug_sbp);
+
+#ifndef EM_LEGACY_IRQ
+/* How many packets rxeof tries to clean at a time */
+static int lem_rx_process_limit = 100;
+TUNABLE_INT("hw.em.rx_process_limit", &lem_rx_process_limit);
+#endif
+
+/* Flow control setting - default to FULL */
+static int lem_fc_setting = e1000_fc_full;
+TUNABLE_INT("hw.em.fc_setting", &lem_fc_setting);
+
+/*
+** Shadow VFTA table, this is needed because
+** the real vlan filter table gets cleared during
+** a soft reset and the driver needs to be able
+** to repopulate it.
+*/
+static u32 lem_shadow_vfta[EM_VFTA_SIZE];
+
+/* Global used in WOL setup with multiport cards */
+static int global_quad_port_a = 0;
+
+/*********************************************************************
+ *  Device identification routine
+ *
+ *  em_probe determines if the driver should be loaded on
+ *  adapter based on PCI vendor/device id of the adapter.
+ *
+ *  return BUS_PROBE_DEFAULT on success, positive on failure
+ *********************************************************************/
+
+static int
+lem_probe(device_t dev)
+{
+	char		adapter_name[60];
+	u16		pci_vendor_id = 0;
+	u16		pci_device_id = 0;
+	u16		pci_subvendor_id = 0;
+	u16		pci_subdevice_id = 0;
+	em_vendor_info_t *ent;
+
+	INIT_DEBUGOUT("em_probe: begin");
+
+	pci_vendor_id = pci_get_vendor(dev);
+	if (pci_vendor_id != EM_VENDOR_ID)
+		return (ENXIO);
+
+	pci_device_id = pci_get_device(dev);
+	pci_subvendor_id = pci_get_subvendor(dev);
+	pci_subdevice_id = pci_get_subdevice(dev);
+
+	ent = lem_vendor_info_array;
+	while (ent->vendor_id != 0) {
+		if ((pci_vendor_id == ent->vendor_id) &&
+		    (pci_device_id == ent->device_id) &&
+
+		    ((pci_subvendor_id == ent->subvendor_id) ||
+		    (ent->subvendor_id == PCI_ANY_ID)) &&
+
+		    ((pci_subdevice_id == ent->subdevice_id) ||
+		    (ent->subdevice_id == PCI_ANY_ID))) {
+			sprintf(adapter_name, "%s %s",
+				lem_strings[ent->index],
+				lem_driver_version);
+			device_set_desc_copy(dev, adapter_name);
+			return (BUS_PROBE_DEFAULT);
+		}
+		ent++;
+	}
+
+	return (ENXIO);
+}
+
+/*********************************************************************
+ *  Device initialization routine
+ *
+ *  The attach entry point is called when the driver is being loaded.
+ *  This routine identifies the type of hardware, allocates all resources
+ *  and initializes the hardware.
+ *
+ *  return 0 on success, positive on failure
+ *********************************************************************/
+
+static int
+lem_attach(device_t dev)
+{
+	struct adapter	*adapter;
+	int		tsize, rsize;
+	int		error = 0;
+
+	INIT_DEBUGOUT("lem_attach: begin");
+
+	adapter = device_get_softc(dev);
+	adapter->dev = adapter->osdep.dev = dev;
+	EM_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
+	EM_TX_LOCK_INIT(adapter, device_get_nameunit(dev));
+	EM_RX_LOCK_INIT(adapter, device_get_nameunit(dev));
+
+	/* SYSCTL stuff */
+	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+	    OID_AUTO, "debug", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
+	    lem_sysctl_debug_info, "I", "Debug Information");
+
+	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+	    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+	    OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
+	    lem_sysctl_stats, "I", "Statistics");
+
+	callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0);
+	callout_init_mtx(&adapter->tx_fifo_timer, &adapter->tx_mtx, 0);
+
+	/* Determine hardware and mac info */
+	lem_identify_hardware(adapter);
+
+	/* Setup PCI resources */
+	if (lem_allocate_pci_resources(adapter)) {
+		device_printf(dev, "Allocation of PCI resources failed\n");
+		error = ENXIO;
+		goto err_pci;
+	}
+
+	/* Do Shared Code initialization */
+	if (e1000_setup_init_funcs(&adapter->hw, TRUE)) {
+		device_printf(dev, "Setup of Shared code failed\n");
+		error = ENXIO;
+		goto err_pci;
+	}
+
+	e1000_get_bus_info(&adapter->hw);
+
+	/* Set up some sysctls for the tunable interrupt delays */
+	lem_add_int_delay_sysctl(adapter, "rx_int_delay",
+	    "receive interrupt delay in usecs", &adapter->rx_int_delay,
+	    E1000_REGISTER(&adapter->hw, E1000_RDTR), lem_rx_int_delay_dflt);
+	lem_add_int_delay_sysctl(adapter, "tx_int_delay",
+	    "transmit interrupt delay in usecs", &adapter->tx_int_delay,
+	    E1000_REGISTER(&adapter->hw, E1000_TIDV), lem_tx_int_delay_dflt);
+	if (adapter->hw.mac.type >= e1000_82540) {
+		lem_add_int_delay_sysctl(adapter, "rx_abs_int_delay",
+		    "receive interrupt delay limit in usecs",
+		    &adapter->rx_abs_int_delay,
+		    E1000_REGISTER(&adapter->hw, E1000_RADV),
+		    lem_rx_abs_int_delay_dflt);
+		lem_add_int_delay_sysctl(adapter, "tx_abs_int_delay",
+		    "transmit interrupt delay limit in usecs",
+		    &adapter->tx_abs_int_delay,
+		    E1000_REGISTER(&adapter->hw, E1000_TADV),
+		    lem_tx_abs_int_delay_dflt);
+	}
+
+#ifndef EM_LEGACY_IRQ
+	/* Sysctls for limiting the amount of work done in the taskqueue */
+	lem_add_rx_process_limit(adapter, "rx_processing_limit",
+	    "max number of rx packets to process", &adapter->rx_process_limit,
+	    lem_rx_process_limit);
+#endif
+
+	/*
+	 * Validate number of transmit and receive descriptors. It
+	 * must not exceed hardware maximum, and must be multiple
+	 * of E1000_DBA_ALIGN.
+	 */
+	if (((lem_txd * sizeof(struct e1000_tx_desc)) % EM_DBA_ALIGN) != 0 ||
+	    (adapter->hw.mac.type >= e1000_82544 && lem_txd > EM_MAX_TXD) ||
+	    (adapter->hw.mac.type < e1000_82544 && lem_txd > EM_MAX_TXD_82543) ||
+	    (lem_txd < EM_MIN_TXD)) {
+		device_printf(dev, "Using %d TX descriptors instead of %d!\n",
+		    EM_DEFAULT_TXD, lem_txd);
+		adapter->num_tx_desc = EM_DEFAULT_TXD;
+	} else
+		adapter->num_tx_desc = lem_txd;
+	if (((lem_rxd * sizeof(struct e1000_rx_desc)) % EM_DBA_ALIGN) != 0 ||
+	    (adapter->hw.mac.type >= e1000_82544 && lem_rxd > EM_MAX_RXD) ||
+	    (adapter->hw.mac.type < e1000_82544 && lem_rxd > EM_MAX_RXD_82543) ||
+	    (lem_rxd < EM_MIN_RXD)) {
+		device_printf(dev, "Using %d RX descriptors instead of %d!\n",
+		    EM_DEFAULT_RXD, lem_rxd);
+		adapter->num_rx_desc = EM_DEFAULT_RXD;
+	} else
+		adapter->num_rx_desc = lem_rxd;
+
+	adapter->hw.mac.autoneg = DO_AUTO_NEG;
+	adapter->hw.phy.autoneg_wait_to_complete = FALSE;
+	adapter->hw.phy.autoneg_advertised = AUTONEG_ADV_DEFAULT;
+	adapter->rx_buffer_len = 2048;
+
+	e1000_init_script_state_82541(&adapter->hw, TRUE);
+	e1000_set_tbi_compatibility_82543(&adapter->hw, TRUE);
+
+	/* Copper options */
+	if (adapter->hw.phy.media_type == e1000_media_type_copper) {
+		adapter->hw.phy.mdix = AUTO_ALL_MODES;
+		adapter->hw.phy.disable_polarity_correction = FALSE;
+		adapter->hw.phy.ms_type = EM_MASTER_SLAVE;
+	}
+
+	/*
+	 * Set the frame limits assuming
+	 * standard ethernet sized frames.
+	 */
+	adapter->max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE;
+	adapter->min_frame_size = ETH_ZLEN + ETHERNET_FCS_SIZE;
+
+	/*
+	 * This controls when hardware reports transmit completion
+	 * status.
+	 */
+	adapter->hw.mac.report_tx_early = 1;
+
+	tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc),
+	    EM_DBA_ALIGN);
+
+	/* Allocate Transmit Descriptor ring */
+	if (lem_dma_malloc(adapter, tsize, &adapter->txdma, BUS_DMA_NOWAIT)) {
+		device_printf(dev, "Unable to allocate tx_desc memory\n");
+		error = ENOMEM;
+		goto err_tx_desc;
+	}
+	adapter->tx_desc_base = 
+	    (struct e1000_tx_desc *)adapter->txdma.dma_vaddr;
+
+	rsize = roundup2(adapter->num_rx_desc * sizeof(struct e1000_rx_desc),
+	    EM_DBA_ALIGN);
+
+	/* Allocate Receive Descriptor ring */
+	if (lem_dma_malloc(adapter, rsize, &adapter->rxdma, BUS_DMA_NOWAIT)) {
+		device_printf(dev, "Unable to allocate rx_desc memory\n");
+		error = ENOMEM;
+		goto err_rx_desc;
+	}
+	adapter->rx_desc_base =
+	    (struct e1000_rx_desc *)adapter->rxdma.dma_vaddr;
+
+	/*
+	** Start from a known state, this is
+	** important in reading the nvm and
+	** mac from that.
+	*/
+	e1000_reset_hw(&adapter->hw);
+
+	/* Make sure we have a good EEPROM before we read from it */
+	if (e1000_validate_nvm_checksum(&adapter->hw) < 0) {
+		/*
+		** Some PCI-E parts fail the first check due to
+		** the link being in sleep state, call it again,
+		** if it fails a second time its a real issue.
+		*/
+		if (e1000_validate_nvm_checksum(&adapter->hw) < 0) {
+			device_printf(dev,
+			    "The EEPROM Checksum Is Not Valid\n");
+			error = EIO;
+			goto err_hw_init;
+		}
+	}
+
+	/* Copy the permanent MAC address out of the EEPROM */
+	if (e1000_read_mac_addr(&adapter->hw) < 0) {
+		device_printf(dev, "EEPROM read error while reading MAC"
+		    " address\n");
+		error = EIO;
+		goto err_hw_init;
+	}
+
+	if (!lem_is_valid_ether_addr(adapter->hw.mac.addr)) {
+		device_printf(dev, "Invalid MAC address\n");
+		error = EIO;
+		goto err_hw_init;
+	}
+
+	/* Initialize the hardware */
+	if (lem_hardware_init(adapter)) {
+		device_printf(dev, "Unable to initialize the hardware\n");
+		error = EIO;
+		goto err_hw_init;
+	}
+
+	/* Allocate transmit descriptors and buffers */
+	if (lem_allocate_transmit_structures(adapter)) {
+		device_printf(dev, "Could not setup transmit structures\n");
+		error = ENOMEM;
+		goto err_tx_struct;
+	}
+
+	/* Allocate receive descriptors and buffers */
+	if (lem_allocate_receive_structures(adapter)) {
+		device_printf(dev, "Could not setup receive structures\n");
+		error = ENOMEM;
+		goto err_rx_struct;
+	}
+
+	/*
+	**  Do interrupt configuration
+	*/
+	error = lem_allocate_irq(adapter);
+	if (error)
+		goto err_rx_struct;
+
+	/*
+	 * Get Wake-on-Lan and Management info for later use
+	 */
+	lem_get_wakeup(dev);
+
+	/* Setup OS specific network interface */
+	lem_setup_interface(dev, adapter);
+
+	/* Initialize statistics */
+	lem_update_stats_counters(adapter);
+
+	adapter->hw.mac.get_link_status = 1;
+	lem_update_link_status(adapter);
+
+	/* Indicate SOL/IDER usage */
+	if (e1000_check_reset_block(&adapter->hw))
+		device_printf(dev,
+		    "PHY reset is blocked due to SOL/IDER session.\n");
+
+	/* Do we need workaround for 82544 PCI-X adapter? */
+	if (adapter->hw.bus.type == e1000_bus_type_pcix &&
+	    adapter->hw.mac.type == e1000_82544)
+		adapter->pcix_82544 = TRUE;
+	else
+		adapter->pcix_82544 = FALSE;
+
+#if __FreeBSD_version >= 700029
+	/* Register for VLAN events */
+	adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config,
+	    lem_register_vlan, adapter, EVENTHANDLER_PRI_FIRST);
+	adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig,
+	    lem_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); 
+#endif
+
+	/* Non-AMT based hardware can now take control from firmware */
+	if (adapter->has_manage && !adapter->has_amt)
+		lem_get_hw_control(adapter);
+
+	/* Tell the stack that the interface is not active */
+	adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+
+	adapter->led_dev = led_create(lem_led_func, adapter,
+	    device_get_nameunit(dev));
+
+	INIT_DEBUGOUT("lem_attach: end");
+
+	return (0);
+
+err_rx_struct:
+	lem_free_transmit_structures(adapter);
+err_tx_struct:
+err_hw_init:
+	lem_release_hw_control(adapter);
+	lem_dma_free(adapter, &adapter->rxdma);
+err_rx_desc:
+	lem_dma_free(adapter, &adapter->txdma);
+err_tx_desc:
+err_pci:
+	lem_free_pci_resources(adapter);
+	EM_TX_LOCK_DESTROY(adapter);
+	EM_RX_LOCK_DESTROY(adapter);
+	EM_CORE_LOCK_DESTROY(adapter);
+
+	return (error);
+}
+
+/*********************************************************************
+ *  Device removal routine
+ *
+ *  The detach entry point is called when the driver is being removed.
+ *  This routine stops the adapter and deallocates all the resources
+ *  that were allocated for driver operation.
+ *
+ *  return 0 on success, positive on failure
+ *********************************************************************/
+
+static int
+lem_detach(device_t dev)
+{
+	struct adapter	*adapter = device_get_softc(dev);
+	struct ifnet	*ifp = adapter->ifp;
+
+	INIT_DEBUGOUT("em_detach: begin");
+
+	/* Make sure VLANS are not using driver */
+#if __FreeBSD_version >= 700000
+	if (adapter->ifp->if_vlantrunk != NULL) {
+#else
+	if (adapter->ifp->if_nvlans != 0) {
+#endif   
+		device_printf(dev,"Vlan in use, detach first\n");
+		return (EBUSY);
+	}
+
+#ifdef DEVICE_POLLING
+	if (ifp->if_capenable & IFCAP_POLLING)
+		ether_poll_deregister(ifp);
+#endif
+
+	if (adapter->led_dev != NULL)
+		led_destroy(adapter->led_dev);
+
+	EM_CORE_LOCK(adapter);
+	EM_TX_LOCK(adapter);
+	adapter->in_detach = 1;
+	lem_stop(adapter);
+	e1000_phy_hw_reset(&adapter->hw);
+
+	lem_release_manageability(adapter);
+
+	EM_TX_UNLOCK(adapter);
+	EM_CORE_UNLOCK(adapter);
+
+#if __FreeBSD_version >= 700029
+	/* Unregister VLAN events */
+	if (adapter->vlan_attach != NULL)
+		EVENTHANDLER_DEREGISTER(vlan_config, adapter->vlan_attach);
+	if (adapter->vlan_detach != NULL)
+		EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); 
+#endif
+
+	ether_ifdetach(adapter->ifp);
+	callout_drain(&adapter->timer);
+	callout_drain(&adapter->tx_fifo_timer);
+
+	lem_free_pci_resources(adapter);
+	bus_generic_detach(dev);
+	if_free(ifp);
+
+	lem_free_transmit_structures(adapter);
+	lem_free_receive_structures(adapter);
+
+	/* Free Transmit Descriptor ring */
+	if (adapter->tx_desc_base) {
+		lem_dma_free(adapter, &adapter->txdma);
+		adapter->tx_desc_base = NULL;
+	}
+
+	/* Free Receive Descriptor ring */
+	if (adapter->rx_desc_base) {
+		lem_dma_free(adapter, &adapter->rxdma);
+		adapter->rx_desc_base = NULL;
+	}
+
+	lem_release_hw_control(adapter);
+	EM_TX_LOCK_DESTROY(adapter);
+	EM_RX_LOCK_DESTROY(adapter);
+	EM_CORE_LOCK_DESTROY(adapter);
+
+	return (0);
+}
+
+/*********************************************************************
+ *
+ *  Shutdown entry point
+ *
+ **********************************************************************/
+
+static int
+lem_shutdown(device_t dev)
+{
+	return lem_suspend(dev);
+}
+
+/*
+ * Suspend/resume device methods.
+ */
+static int
+lem_suspend(device_t dev)
+{
+	struct adapter *adapter = device_get_softc(dev);
+
+	EM_CORE_LOCK(adapter);
+
+	lem_release_manageability(adapter);
+	lem_release_hw_control(adapter);
+	lem_enable_wakeup(dev);
+
+	EM_CORE_UNLOCK(adapter);
+
+	return bus_generic_suspend(dev);
+}
+
+static int
+lem_resume(device_t dev)
+{
+	struct adapter *adapter = device_get_softc(dev);
+	struct ifnet *ifp = adapter->ifp;
+
+	EM_CORE_LOCK(adapter);
+	lem_init_locked(adapter);
+	lem_init_manageability(adapter);
+	EM_CORE_UNLOCK(adapter);
+	lem_start(ifp);
+
+	return bus_generic_resume(dev);
+}
+
+
+static void
+lem_start_locked(struct ifnet *ifp)
+{
+	struct adapter	*adapter = ifp->if_softc;
+	struct mbuf	*m_head;
+
+	EM_TX_LOCK_ASSERT(adapter);
+
+	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING)
+		return;
+	if (!adapter->link_active)
+		return;
+
+	while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
+
+                IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
+		if (m_head == NULL)
+			break;
+		/*
+		 *  Encapsulation can modify our pointer, and or make it
+		 *  NULL on failure.  In that event, we can't requeue.
+		 */
+		if (lem_xmit(adapter, &m_head)) {
+			if (m_head == NULL)
+				break;
+			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+			break;
+		}
+
+		/* Send a copy of the frame to the BPF listener */
+		ETHER_BPF_MTAP(ifp, m_head);
+
+		/* Set timeout in case hardware has problems transmitting. */
+		adapter->watchdog_check = TRUE;
+		adapter->watchdog_time = ticks;
+	}
+	if (adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD)
+		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+
+	return;
+}
+
+static void
+lem_start(struct ifnet *ifp)
+{
+	struct adapter *adapter = ifp->if_softc;
+
+	EM_TX_LOCK(adapter);
+	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+		lem_start_locked(ifp);
+	EM_TX_UNLOCK(adapter);
+}
+
+/*********************************************************************
+ *  Ioctl entry point
+ *
+ *  em_ioctl is called when the user wants to configure the
+ *  interface.
+ *
+ *  return 0 on success, positive on failure
+ **********************************************************************/
+
+static int
+lem_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
+{
+	struct adapter	*adapter = ifp->if_softc;
+	struct ifreq *ifr = (struct ifreq *)data;
+#ifdef INET
+	struct ifaddr *ifa = (struct ifaddr *)data;
+#endif
+	int error = 0;
+
+	if (adapter->in_detach)
+		return (error);
+
+	switch (command) {
+	case SIOCSIFADDR:
+#ifdef INET
+		if (ifa->ifa_addr->sa_family == AF_INET) {
+			/*
+			 * XXX
+			 * Since resetting hardware takes a very long time
+			 * and results in link renegotiation we only
+			 * initialize the hardware only when it is absolutely
+			 * required.
+			 */
+			ifp->if_flags |= IFF_UP;
+			if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+				EM_CORE_LOCK(adapter);
+				lem_init_locked(adapter);
+				EM_CORE_UNLOCK(adapter);
+			}
+			arp_ifinit(ifp, ifa);
+		} else
+#endif
+			error = ether_ioctl(ifp, command, data);
+		break;
+	case SIOCSIFMTU:
+	    {
+		int max_frame_size;
+
+		IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
+
+		EM_CORE_LOCK(adapter);
+		switch (adapter->hw.mac.type) {
+		case e1000_82542:
+			max_frame_size = ETHER_MAX_LEN;
+			break;
+		default:
+			max_frame_size = MAX_JUMBO_FRAME_SIZE;
+		}
+		if (ifr->ifr_mtu > max_frame_size - ETHER_HDR_LEN -
+		    ETHER_CRC_LEN) {
+			EM_CORE_UNLOCK(adapter);
+			error = EINVAL;
+			break;
+		}
+
+		ifp->if_mtu = ifr->ifr_mtu;
+		adapter->max_frame_size =
+		    ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+		lem_init_locked(adapter);
+		EM_CORE_UNLOCK(adapter);
+		break;
+	    }
+	case SIOCSIFFLAGS:
+		IOCTL_DEBUGOUT("ioctl rcv'd:\
+		    SIOCSIFFLAGS (Set Interface Flags)");
+		EM_CORE_LOCK(adapter);
+		if (ifp->if_flags & IFF_UP) {
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+				if ((ifp->if_flags ^ adapter->if_flags) &
+				    (IFF_PROMISC | IFF_ALLMULTI)) {
+					lem_disable_promisc(adapter);
+					lem_set_promisc(adapter);
+				}
+			} else
+				lem_init_locked(adapter);
+		} else
+			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+				EM_TX_LOCK(adapter);
+				lem_stop(adapter);
+				EM_TX_UNLOCK(adapter);
+			}
+		adapter->if_flags = ifp->if_flags;
+		EM_CORE_UNLOCK(adapter);
+		break;
+	case SIOCADDMULTI:
+	case SIOCDELMULTI:
+		IOCTL_DEBUGOUT("ioctl rcv'd: SIOC(ADD|DEL)MULTI");
+		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+			EM_CORE_LOCK(adapter);
+			lem_disable_intr(adapter);
+			lem_set_multi(adapter);
+			if (adapter->hw.mac.type == e1000_82542 && 
+	    		    adapter->hw.revision_id == E1000_REVISION_2) {
+				lem_initialize_receive_unit(adapter);
+			}
+#ifdef DEVICE_POLLING
+			if (!(ifp->if_capenable & IFCAP_POLLING))
+#endif
+				lem_enable_intr(adapter);
+			EM_CORE_UNLOCK(adapter);
+		}
+		break;
+	case SIOCSIFMEDIA:
+		/* Check SOL/IDER usage */
+		EM_CORE_LOCK(adapter);
+		if (e1000_check_reset_block(&adapter->hw)) {
+			EM_CORE_UNLOCK(adapter);
+			device_printf(adapter->dev, "Media change is"
+			    " blocked due to SOL/IDER session.\n");
+			break;
+		}
+		EM_CORE_UNLOCK(adapter);
+	case SIOCGIFMEDIA:
+		IOCTL_DEBUGOUT("ioctl rcv'd: \
+		    SIOCxIFMEDIA (Get/Set Interface Media)");
+		error = ifmedia_ioctl(ifp, ifr, &adapter->media, command);
+		break;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 07:07:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA9B3106566C;
	Sat, 15 May 2010 07:07:38 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D851C8FC18;
	Sat, 15 May 2010 07:07:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4F77ctm003648;
	Sat, 15 May 2010 07:07:38 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4F77cZx003645;
	Sat, 15 May 2010 07:07:38 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201005150707.o4F77cZx003645@svn.freebsd.org>
From: Martin Matuska 
Date: Sat, 15 May 2010 07:07:38 +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: r208109 -
	stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 07:07:39 -0000

Author: mm
Date: Sat May 15 07:07:38 2010
New Revision: 208109
URL: http://svn.freebsd.org/changeset/base/208109

Log:
  MFC r207481, r207956:
  
  MFC r207481 [1]:
  Add sysctl and loader tunable vfs.zfs.txg.write_limit_override.
  This tunable improves fine-tuning of ZFS write throttling.
  
  MFC r207956 [2]:
  Fix possible hang when replaying large truncations.
  OpenSolaris onnv revision:	7904:6a124a4ca9c5
  
  PR:		kern/146108 [1]
  Suggested by:	Nikolay Denev  [1]
  Obtained from:	OpenSolaris (Bug ID 6761624) [2]
  Approved by:	pjd, delphij (mentor)

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Sat May 15 07:01:41 2010	(r208108)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Sat May 15 07:07:38 2010	(r208109)
@@ -38,6 +38,7 @@ static void txg_quiesce_thread(void *arg
 
 int zfs_txg_timeout = 30;	/* max seconds worth of delta per txg */
 extern int zfs_txg_synctime;
+extern uint64_t zfs_write_limit_override;
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0,
@@ -48,6 +49,11 @@ SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeo
 TUNABLE_INT("vfs.zfs.txg.synctime", &zfs_txg_synctime);
 SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, synctime, CTLFLAG_RDTUN, &zfs_txg_synctime,
     0, "Target seconds to sync a txg");
+TUNABLE_QUAD("vfs.zfs.txg.write_limit_override", &zfs_write_limit_override);
+SYSCTL_QUAD(_vfs_zfs_txg, OID_AUTO, write_limit_override, CTLFLAG_RW,
+    &zfs_write_limit_override, 0,
+    "Override maximum size of a txg to this size in bytes, "
+    "value of 0 means don't override");
 
 /*
  * Prepare the txg subsystem.

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Sat May 15 07:01:41 2010	(r208108)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Sat May 15 07:07:38 2010	(r208109)
@@ -1567,6 +1567,29 @@ zil_replay_log_record(zilog_t *zilog, lr
 	}
 
 	/*
+	 * Replay of large truncates can end up needing additional txs
+	 * and a different txg. If they are nested within the replay tx
+	 * as below then a hang is possible. So we do the truncate here
+	 * and redo the truncate later (a no-op) and update the sequence
+	 * number whilst in the replay tx. Fortunately, it's safe to repeat
+	 * a truncate if we crash and the truncate commits. A create over
+	 * an existing file will also come in as a TX_TRUNCATE record.
+	 *
+	 * Note, remove of large files and renames over large files is
+	 * handled by putting the deleted object on a stable list
+	 * and if necessary force deleting the object outside of the replay
+	 * transaction using the zr_replay_cleaner.
+	 */
+	if (txtype == TX_TRUNCATE) {
+		*zr->zr_txgp = TXG_NOWAIT;
+		error = zr->zr_replay[TX_TRUNCATE](zr->zr_arg, zr->zr_lrbuf,
+		    zr->zr_byteswap);
+		if (error)
+			goto bad;
+		zr->zr_byteswap = 0; /* only byteswap once */
+	}
+
+	/*
 	 * We must now do two things atomically: replay this log record,
 	 * and update the log header to reflect the fact that we did so.
 	 * We use the DMU's ability to assign into a specific txg to do this.
@@ -1636,6 +1659,7 @@ zil_replay_log_record(zilog_t *zilog, lr
 		dprintf("pass %d, retrying\n", pass);
 	}
 
+bad:
 	ASSERT(error && error != ERESTART);
 	name = kmem_alloc(MAXNAMELEN, KM_SLEEP);
 	dmu_objset_name(zr->zr_os, name);

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 08:57:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76752106566B;
	Sat, 15 May 2010 08:57:17 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6530F8FC12;
	Sat, 15 May 2010 08:57:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4F8vHcI027580;
	Sat, 15 May 2010 08:57:17 GMT (envelope-from phk@svn.freebsd.org)
Received: (from phk@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4F8vHOU027578;
	Sat, 15 May 2010 08:57:17 GMT (envelope-from phk@svn.freebsd.org)
Message-Id: <201005150857.o4F8vHOU027578@svn.freebsd.org>
From: Poul-Henning Kamp 
Date: Sat, 15 May 2010 08:57: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: r208110 - head/usr.sbin/fifolog/lib
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 08:57:17 -0000

Author: phk
Date: Sat May 15 08:57:16 2010
New Revision: 208110
URL: http://svn.freebsd.org/changeset/base/208110

Log:
  Do not attempt to render a logrecord with length byte, until we have
  decompressed all the bytes required.

Modified:
  head/usr.sbin/fifolog/lib/fifolog_reader.c

Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c
==============================================================================
--- head/usr.sbin/fifolog/lib/fifolog_reader.c	Sat May 15 07:07:38 2010	(r208109)
+++ head/usr.sbin/fifolog/lib/fifolog_reader.c	Sat May 15 08:57:16 2010	(r208110)
@@ -225,6 +225,8 @@ fifolog_reader_chop(struct fifolog_reade
 		if (u & FIFOLOG_LENGTH) {
 			v = p[w];
 			w++;
+			if (p + w + v >= q)
+				return (p);
 		} else {
 			for (v = 0; p + v + w < q && p[v + w] != '\0'; v++)
 				continue;

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 10:31:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 090861065679;
	Sat, 15 May 2010 10:31:12 +0000 (UTC) (envelope-from phk@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D2DA38FC15;
	Sat, 15 May 2010 10:31:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FAVBFj049848;
	Sat, 15 May 2010 10:31:11 GMT (envelope-from phk@svn.freebsd.org)
Received: (from phk@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FAVBwX049846;
	Sat, 15 May 2010 10:31:11 GMT (envelope-from phk@svn.freebsd.org)
Message-Id: <201005151031.o4FAVBwX049846@svn.freebsd.org>
From: Poul-Henning Kamp 
Date: Sat, 15 May 2010 10:31: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: r208111 - head/sys/i386/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 15 May 2010 10:31:12 -0000

Author: phk
Date: Sat May 15 10:31:11 2010
New Revision: 208111
URL: http://svn.freebsd.org/changeset/base/208111

Log:
  Apply a patch that has been lingering in my inbox for far too long:
  
  On a soekris Net5501, if you do a watchdog -t 16, followed by a watchdog
  -t 0 to disable the watchdog, and then after some time (16s) re-enable
  the watchdog the box reboots immediatly. This prevents also to stop and
  restart watchdogd(8).
  
  This is because when you stop the watchdog, the timer is not stoped,
  only the hard reset is disabled. So when the timer has elapsed, the C2
  event of the timer is set.
  
  But when the hard reset is re-enabled, the event is not cleared and the
  box reboots.
  
  The attached patch stops and resets the counter when the watchdog is
  disabled and do not disable the hard reset of the timer (if the timer
  has elapsed it's too late).
  
  Submitted by:	 Patrick Lamaizière

Modified:
  head/sys/i386/i386/geode.c

Modified: head/sys/i386/i386/geode.c
==============================================================================
--- head/sys/i386/i386/geode.c	Sat May 15 08:57:16 2010	(r208110)
+++ head/sys/i386/i386/geode.c	Sat May 15 10:31:11 2010	(r208111)
@@ -208,14 +208,11 @@ geode_watchdog(void *foo __unused, u_int
 static void
 cs5536_watchdog(void *foo __unused, u_int cmd, int *error)
 {
-	u_int u, p;
+	u_int u, p, s;
 	uint16_t a;
 	uint32_t m;
 
 	a = rdmsr(0x5140000d);
-	m = rdmsr(0x51400029);
-	m &= ~(1 << 24);
-	wrmsr(0x51400029, m);
 
 	u = cmd & WD_INTERVAL;
 	if (u >= 30 && u <= 44) {
@@ -228,12 +225,24 @@ cs5536_watchdog(void *foo __unused, u_in
 		/* reset counter */
 		outw(a + 4, 0);
 		/* Arm reset mechanism */
+		m = rdmsr(0x51400029);
 		m |= (1 << 24);
 		wrmsr(0x51400029, m);
 		/* Start counter */
 		outw(a + 6, 0x8000);
 
 		*error = 0;
+	} else {
+		/* 
+		 * MFGPT_SETUP is write-once
+		 * Check if the counter has been setup
+		 */
+		s = inw(a + 6);
+		if (s & (1 << 12)) {
+			/* Stop and reset counter */
+			outw(a + 6, 0);
+			outw(a + 4, 0);
+		}
 	}
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 12:42:07 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8657B106566B;
	Sat, 15 May 2010 12:42:07 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 73A808FC08;
	Sat, 15 May 2010 12:42:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FCg7Mf078429;
	Sat, 15 May 2010 12:42:07 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FCg7lm078425;
	Sat, 15 May 2010 12:42:07 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005151242.o4FCg7lm078425@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 15 May 2010 12:42:07 +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: r208112 - in stable/8/tools/regression: bin/sh/builtins
	lib/libc/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: Sat, 15 May 2010 12:42:07 -0000

Author: jilles
Date: Sat May 15 12:42:07 2010
New Revision: 208112
URL: http://svn.freebsd.org/changeset/base/208112

Log:
  MFC r207821: Generate some tests for sh's case command
  from the fnmatch tests.
  
  I'm committing the generated files because I don't like a build dependency
  for the sh(1) tests, and they are small and will not change much.

Added:
  stable/8/tools/regression/bin/sh/builtins/case2.0
     - copied unchanged from r207821, head/tools/regression/bin/sh/builtins/case2.0
  stable/8/tools/regression/bin/sh/builtins/case3.0
     - copied unchanged from r207821, head/tools/regression/bin/sh/builtins/case3.0
Modified:
  stable/8/tools/regression/lib/libc/gen/Makefile
  stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
Directory Properties:
  stable/8/tools/regression/bin/sh/   (props changed)
  stable/8/tools/regression/lib/libc/   (props changed)

Copied: stable/8/tools/regression/bin/sh/builtins/case2.0 (from r207821, head/tools/regression/bin/sh/builtins/case2.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/builtins/case2.0	Sat May 15 12:42:07 2010	(r208112, copy of r207821, head/tools/regression/bin/sh/builtins/case2.0)
@@ -0,0 +1,106 @@
+# Generated by ./test-fnmatch -s 1, do not edit.
+# $FreeBSD$
+failures=
+failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; }
+testmatch() { eval "case \$2 in ''$1) ;; *) failed testmatch \"\$@\";; esac"; }
+testnomatch() { eval "case \$2 in ''$1) failed testnomatch \"\$@\";; esac"; }
+testmatch '' ''
+testmatch 'a' 'a'
+testnomatch 'a' 'b'
+testnomatch 'a' 'A'
+testmatch '*' 'a'
+testmatch '*' 'aa'
+testmatch '*a' 'a'
+testnomatch '*a' 'b'
+testnomatch '*a*' 'b'
+testmatch '*a*b*' 'ab'
+testmatch '*a*b*' 'qaqbq'
+testmatch '*a*bb*' 'qaqbqbbq'
+testmatch '*a*bc*' 'qaqbqbcq'
+testmatch '*a*bb*' 'qaqbqbb'
+testmatch '*a*bc*' 'qaqbqbc'
+testmatch '*a*bb' 'qaqbqbb'
+testmatch '*a*bc' 'qaqbqbc'
+testnomatch '*a*bb' 'qaqbqbbq'
+testnomatch '*a*bc' 'qaqbqbcq'
+testnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa'
+testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa'
+testmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa'
+testnomatch '.*.*.*.*.*.*.*.*.*.*' '.........'
+testmatch '.*.*.*.*.*.*.*.*.*.*' '..........'
+testmatch '.*.*.*.*.*.*.*.*.*.*' '...........'
+testnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789'
+testnomatch '??????????*' '123456789'
+testnomatch '*??????????' '123456789'
+testmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890'
+testmatch '??????????*' '1234567890'
+testmatch '*??????????' '1234567890'
+testmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901'
+testmatch '??????????*' '12345678901'
+testmatch '*??????????' '12345678901'
+testmatch '[x]' 'x'
+testmatch '[*]' '*'
+testmatch '[?]' '?'
+testmatch '[' '['
+testmatch '[[]' '['
+testnomatch '[[]' 'x'
+testnomatch '[*]' ''
+testnomatch '[*]' 'x'
+testnomatch '[?]' 'x'
+testmatch '*[*]*' 'foo*foo'
+testnomatch '*[*]*' 'foo'
+testmatch '[0-9]' '0'
+testmatch '[0-9]' '5'
+testmatch '[0-9]' '9'
+testnomatch '[0-9]' '/'
+testnomatch '[0-9]' ':'
+testnomatch '[0-9]' '*'
+testnomatch '[!0-9]' '0'
+testnomatch '[!0-9]' '5'
+testnomatch '[!0-9]' '9'
+testmatch '[!0-9]' '/'
+testmatch '[!0-9]' ':'
+testmatch '[!0-9]' '*'
+testmatch '*[0-9]' 'a0'
+testmatch '*[0-9]' 'a5'
+testmatch '*[0-9]' 'a9'
+testnomatch '*[0-9]' 'a/'
+testnomatch '*[0-9]' 'a:'
+testnomatch '*[0-9]' 'a*'
+testnomatch '*[!0-9]' 'a0'
+testnomatch '*[!0-9]' 'a5'
+testnomatch '*[!0-9]' 'a9'
+testmatch '*[!0-9]' 'a/'
+testmatch '*[!0-9]' 'a:'
+testmatch '*[!0-9]' 'a*'
+testmatch '*[0-9]' 'a00'
+testmatch '*[0-9]' 'a55'
+testmatch '*[0-9]' 'a99'
+testmatch '*[0-9]' 'a0a0'
+testmatch '*[0-9]' 'a5a5'
+testmatch '*[0-9]' 'a9a9'
+testmatch '\*' '*'
+testmatch '\?' '?'
+testmatch '\[x]' '[x]'
+testmatch '\[' '['
+testmatch '\\' '\'
+testmatch '*\**' 'foo*foo'
+testnomatch '*\**' 'foo'
+testmatch '*\\*' 'foo\foo'
+testnomatch '*\\*' 'foo'
+testmatch '\(' '('
+testmatch '\a' 'a'
+testnomatch '\*' 'a'
+testnomatch '\?' 'a'
+testnomatch '\*' '\*'
+testnomatch '\?' '\?'
+testnomatch '\[x]' '\[x]'
+testnomatch '\[x]' '\x'
+testnomatch '\[' '\['
+testnomatch '\(' '\('
+testnomatch '\a' '\a'
+testmatch '.*' '.'
+testmatch '.*' '..'
+testmatch '.*' '.a'
+testmatch 'a*' 'a.'
+[ -z "$failures" ]

Copied: stable/8/tools/regression/bin/sh/builtins/case3.0 (from r207821, head/tools/regression/bin/sh/builtins/case3.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/builtins/case3.0	Sat May 15 12:42:07 2010	(r208112, copy of r207821, head/tools/regression/bin/sh/builtins/case3.0)
@@ -0,0 +1,95 @@
+# Generated by ./test-fnmatch -s 2, do not edit.
+# $FreeBSD$
+failures=
+failed() { printf '%s\n' "Failed: $1 '$2' '$3'"; failures=x$failures; }
+# We do not treat a backslash specially in this case,
+# but this is not the case in all shells.
+netestmatch() { case $2 in $1) ;; *) failed netestmatch "$@";; esac; }
+netestnomatch() { case $2 in $1) failed netestnomatch "$@";; esac; }
+netestmatch '' ''
+netestmatch 'a' 'a'
+netestnomatch 'a' 'b'
+netestnomatch 'a' 'A'
+netestmatch '*' 'a'
+netestmatch '*' 'aa'
+netestmatch '*a' 'a'
+netestnomatch '*a' 'b'
+netestnomatch '*a*' 'b'
+netestmatch '*a*b*' 'ab'
+netestmatch '*a*b*' 'qaqbq'
+netestmatch '*a*bb*' 'qaqbqbbq'
+netestmatch '*a*bc*' 'qaqbqbcq'
+netestmatch '*a*bb*' 'qaqbqbb'
+netestmatch '*a*bc*' 'qaqbqbc'
+netestmatch '*a*bb' 'qaqbqbb'
+netestmatch '*a*bc' 'qaqbqbc'
+netestnomatch '*a*bb' 'qaqbqbbq'
+netestnomatch '*a*bc' 'qaqbqbcq'
+netestnomatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaa'
+netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaa'
+netestmatch '*a*a*a*a*a*a*a*a*a*a*' 'aaaaaaaaaaa'
+netestnomatch '.*.*.*.*.*.*.*.*.*.*' '.........'
+netestmatch '.*.*.*.*.*.*.*.*.*.*' '..........'
+netestmatch '.*.*.*.*.*.*.*.*.*.*' '...........'
+netestnomatch '*?*?*?*?*?*?*?*?*?*?*' '123456789'
+netestnomatch '??????????*' '123456789'
+netestnomatch '*??????????' '123456789'
+netestmatch '*?*?*?*?*?*?*?*?*?*?*' '1234567890'
+netestmatch '??????????*' '1234567890'
+netestmatch '*??????????' '1234567890'
+netestmatch '*?*?*?*?*?*?*?*?*?*?*' '12345678901'
+netestmatch '??????????*' '12345678901'
+netestmatch '*??????????' '12345678901'
+netestmatch '[x]' 'x'
+netestmatch '[*]' '*'
+netestmatch '[?]' '?'
+netestmatch '[' '['
+netestmatch '[[]' '['
+netestnomatch '[[]' 'x'
+netestnomatch '[*]' ''
+netestnomatch '[*]' 'x'
+netestnomatch '[?]' 'x'
+netestmatch '*[*]*' 'foo*foo'
+netestnomatch '*[*]*' 'foo'
+netestmatch '[0-9]' '0'
+netestmatch '[0-9]' '5'
+netestmatch '[0-9]' '9'
+netestnomatch '[0-9]' '/'
+netestnomatch '[0-9]' ':'
+netestnomatch '[0-9]' '*'
+netestnomatch '[!0-9]' '0'
+netestnomatch '[!0-9]' '5'
+netestnomatch '[!0-9]' '9'
+netestmatch '[!0-9]' '/'
+netestmatch '[!0-9]' ':'
+netestmatch '[!0-9]' '*'
+netestmatch '*[0-9]' 'a0'
+netestmatch '*[0-9]' 'a5'
+netestmatch '*[0-9]' 'a9'
+netestnomatch '*[0-9]' 'a/'
+netestnomatch '*[0-9]' 'a:'
+netestnomatch '*[0-9]' 'a*'
+netestnomatch '*[!0-9]' 'a0'
+netestnomatch '*[!0-9]' 'a5'
+netestnomatch '*[!0-9]' 'a9'
+netestmatch '*[!0-9]' 'a/'
+netestmatch '*[!0-9]' 'a:'
+netestmatch '*[!0-9]' 'a*'
+netestmatch '*[0-9]' 'a00'
+netestmatch '*[0-9]' 'a55'
+netestmatch '*[0-9]' 'a99'
+netestmatch '*[0-9]' 'a0a0'
+netestmatch '*[0-9]' 'a5a5'
+netestmatch '*[0-9]' 'a9a9'
+netestmatch '\*' '\*'
+netestmatch '\?' '\?'
+netestmatch '\' '\'
+netestnomatch '\\' '\'
+netestmatch '\\' '\\'
+netestmatch '*\*' 'foo\foo'
+netestnomatch '*\*' 'foo'
+netestmatch '.*' '.'
+netestmatch '.*' '..'
+netestmatch '.*' '.a'
+netestmatch 'a*' 'a.'
+[ -z "$failures" ]

Modified: stable/8/tools/regression/lib/libc/gen/Makefile
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/Makefile	Sat May 15 10:31:11 2010	(r208111)
+++ stable/8/tools/regression/lib/libc/gen/Makefile	Sat May 15 12:42:07 2010	(r208112)
@@ -9,3 +9,7 @@ tests: ${TESTS}
 .PHONY: clean
 clean:
 	-rm -f ${TESTS}
+
+sh-tests: test-fnmatch
+	./test-fnmatch -s 1 >../../../bin/sh/builtins/case2.0
+	./test-fnmatch -s 2 >../../../bin/sh/builtins/case3.0

Modified: stable/8/tools/regression/lib/libc/gen/test-fnmatch.c
==============================================================================
--- stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Sat May 15 10:31:11 2010	(r208111)
+++ stable/8/tools/regression/lib/libc/gen/test-fnmatch.c	Sat May 15 12:42:07 2010	(r208112)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct testcase {
@@ -210,13 +211,62 @@ flags_to_string(int flags)
 	return result;
 }
 
+static int
+write_sh_tests(const char *progname, int num)
+{
+	size_t i, n;
+	struct testcase *t;
+
+	printf("# Generated by %s -s %d, do not edit.\n", progname, num);
+	printf("# $" "FreeBSD$\n");
+	printf("failures=\n");
+	printf("failed() { printf '%%s\\n' \"Failed: $1 '$2' '$3'\"; failures=x$failures; }\n");
+	if (num == 1) {
+		printf("testmatch() { eval \"case \\$2 in ''$1) ;; *) failed testmatch \\\"\\$@\\\";; esac\"; }\n");
+		printf("testnomatch() { eval \"case \\$2 in ''$1) failed testnomatch \\\"\\$@\\\";; esac\"; }\n");
+	} else if (num == 2) {
+		printf("# We do not treat a backslash specially in this case,\n");
+		printf("# but this is not the case in all shells.\n");
+		printf("netestmatch() { case $2 in $1) ;; *) failed netestmatch \"$@\";; esac; }\n");
+		printf("netestnomatch() { case $2 in $1) failed netestnomatch \"$@\";; esac; }\n");
+	}
+	n = sizeof(testcases) / sizeof(testcases[0]);
+	for (i = 0; i < n; i++) {
+		t = &testcases[i];
+		if (strchr(t->pattern, '\'') != NULL ||
+		    strchr(t->string, '\'') != NULL)
+			continue;
+		if (num == 1 && t->flags == 0)
+			printf("test%smatch '%s' '%s'\n",
+			    t->result == FNM_NOMATCH ? "no" : "",
+			    t->pattern, t->string);
+		if (num == 2 && (t->flags == FNM_NOESCAPE ||
+		    (t->flags == 0 && strchr(t->pattern, '\\') == NULL)))
+			printf("netest%smatch '%s' '%s'\n",
+			    t->result == FNM_NOMATCH ? "no" : "",
+			    t->pattern, t->string);
+	}
+	printf("[ -z \"$failures\" ]\n");
+	return 0;
+}
+
 int
 main(int argc, char *argv[])
 {
 	size_t i, n;
-	int flags, result, extra, errors;
+	int opt, flags, result, extra, errors;
 	struct testcase *t;
 
+	while ((opt = getopt(argc, argv, "s:")) != -1) {
+		switch (opt) {
+			case 's':
+				return (write_sh_tests(argv[0], atoi(optarg)));
+			default:
+				fprintf(stderr, "usage: %s [-s num]\n", argv[0]);
+				fprintf(stderr, "-s option writes tests for sh(1), num is 1 or 2\n");
+				exit(1);
+		}
+	}
 	n = sizeof(testcases) / sizeof(testcases[0]);
 	errors = 0;
 	printf("1..%zu\n", n);

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 12:51:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63AF5106564A;
	Sat, 15 May 2010 12:51:23 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 388C98FC18;
	Sat, 15 May 2010 12:51:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FCpNjq080518;
	Sat, 15 May 2010 12:51:23 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FCpN39080517;
	Sat, 15 May 2010 12:51:23 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005151251.o4FCpN39080517@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 15 May 2010 12:51:23 +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: r208113 - stable/8/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: Sat, 15 May 2010 12:51:23 -0000

Author: jilles
Date: Sat May 15 12:51:22 2010
New Revision: 208113
URL: http://svn.freebsd.org/changeset/base/208113

Log:
  MFC r207935: sh: Add some simple testcases for pathname expansion.

Added:
  stable/8/tools/regression/bin/sh/expansion/pathname1.0
     - copied unchanged from r207935, head/tools/regression/bin/sh/expansion/pathname1.0
Modified:
Directory Properties:
  stable/8/tools/regression/bin/sh/   (props changed)

Copied: stable/8/tools/regression/bin/sh/expansion/pathname1.0 (from r207935, head/tools/regression/bin/sh/expansion/pathname1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/pathname1.0	Sat May 15 12:51:22 2010	(r208113, copy of r207935, head/tools/regression/bin/sh/expansion/pathname1.0)
@@ -0,0 +1,61 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+	testcase=$1
+	expect=$2
+	eval "set -- $testcase"
+	actual="$*"
+	if [ "$actual" != "$expect" ]; then
+		failures=$((failures+1))
+		printf '%s\n' "For $testcase, expected $expect actual $actual"
+	fi
+}
+
+set -e
+T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
+trap 'rm -rf $T' 0
+cd -P $T
+
+mkdir testdir testdir2 'testdir/*' 'testdir/?' testdir/a testdir/b testdir2/b
+mkdir testdir2/.c
+touch testf 'testdir/*/1' 'testdir/?/1' testdir/a/1 testdir/b/1 testdir2/b/.a
+
+check '' ''
+check 'testdir/b' 'testdir/b'
+check 'testdir/c' 'testdir/c'
+check '\*' '*'
+check '\?' '?'
+check '*' 'testdir testdir2 testf'
+check '*""' 'testdir testdir2 testf'
+check '""*' 'testdir testdir2 testf'
+check '*/' 'testdir/ testdir2/'
+check 'testdir*/a' 'testdir/a'
+check 'testdir*/b' 'testdir/b testdir2/b'
+check '*/.c' 'testdir2/.c'
+check 'testdir2/*' 'testdir2/b'
+check 'testdir2/b/*' 'testdir2/b/*'
+check 'testdir/*' 'testdir/* testdir/? testdir/a testdir/b'
+check 'testdir/*/1' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check '"testdir/"*/1' 'testdir/*/1 testdir/?/1 testdir/a/1 testdir/b/1'
+check 'testdir/\*/*' 'testdir/*/1'
+check 'testdir/\?/*' 'testdir/?/1'
+check 'testdir/"?"/*' 'testdir/?/1'
+check '"testdir"/"?"/*' 'testdir/?/1'
+check '"testdir"/"?"*/*' 'testdir/?/1'
+check '"testdir"/*"?"/*' 'testdir/?/1'
+check '"testdir/?"*/*' 'testdir/?/1'
+check 'testdir/\*/' 'testdir/*/'
+check 'testdir/\?/' 'testdir/?/'
+check 'testdir/"?"/' 'testdir/?/'
+check '"testdir"/"?"/' 'testdir/?/'
+check '"testdir"/"?"*/' 'testdir/?/'
+check '"testdir"/*"?"/' 'testdir/?/'
+check '"testdir/?"*/' 'testdir/?/'
+check 'testdir/[*]/' 'testdir/*/'
+check 'testdir/[?]/' 'testdir/?/'
+check 'testdir/[*?]/' 'testdir/*/ testdir/?/'
+check '[tz]estdir/[*]/' 'testdir/*/'
+
+exit $((failures != 0))

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 17:49:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF9ED106566C;
	Sat, 15 May 2010 17:49:56 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DED278FC08;
	Sat, 15 May 2010 17:49:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FHnuVO047536;
	Sat, 15 May 2010 17:49:56 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FHnu0u047533;
	Sat, 15 May 2010 17:49:56 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201005151749.o4FHnu0u047533@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 15 May 2010 17:49:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r208116 - 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: Sat, 15 May 2010 17:49:57 -0000

Author: jilles
Date: Sat May 15 17:49:56 2010
New Revision: 208116
URL: http://svn.freebsd.org/changeset/base/208116

Log:
  Change the commented msgs examples in profile/csh.login from -f to -q.
  
  Starting something that wants input on login seems strange and can be
  dangerous. In some configurations, causing output can be bad, but it is not
  as dangerous.
  
  I do not expect this msgs invocation to be uncommented often.
  
  PR:		conf/96015
  MFC after:	4 days

Modified:
  head/etc/csh.login
  head/etc/profile

Modified: head/etc/csh.login
==============================================================================
--- head/etc/csh.login	Sat May 15 17:02:33 2010	(r208115)
+++ head/etc/csh.login	Sat May 15 17:49:56 2010	(r208116)
@@ -9,7 +9,7 @@
 # login.conf(5) and in particular the charset and lang options.
 # For full locales list check /usr/share/locale/*
 #
-# Read system messages
-# msgs -f
+# Check system messages
+# msgs -q
 # Allow terminal messages
 # mesg y

Modified: head/etc/profile
==============================================================================
--- head/etc/profile	Sat May 15 17:02:33 2010	(r208115)
+++ head/etc/profile	Sat May 15 17:49:56 2010	(r208116)
@@ -12,7 +12,7 @@
 # You should also read the setlocale(3) man page for information
 # on how to achieve more precise control of locale settings.
 #
-# Read system messages
-# msgs -f
+# Check system messages
+# msgs -q
 # Allow terminal messages
 # mesg y

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 19:46:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DBE31065676;
	Sat, 15 May 2010 19:46:17 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D0F78FC1A;
	Sat, 15 May 2010 19:46:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FJkHAL073014;
	Sat, 15 May 2010 19:46:17 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FJkGft073012;
	Sat, 15 May 2010 19:46:16 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201005151946.o4FJkGft073012@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 15 May 2010 19:46: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: r208117 - head/sys/dev/e1000
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 19:46:17 -0000

Author: marius
Date: Sat May 15 19:46:16 2010
New Revision: 208117
URL: http://svn.freebsd.org/changeset/base/208117

Log:
  Fix a mismerge in r206001.
  
  PR:		146614
  Approved by:	jfv (implicit)
  MFC afer:	3 days

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Sat May 15 17:49:56 2010	(r208116)
+++ head/sys/dev/e1000/if_em.c	Sat May 15 19:46:16 2010	(r208117)
@@ -710,6 +710,9 @@ em_detach(device_t dev)
 		ether_poll_deregister(ifp);
 #endif
 
+	if (adapter->led_dev != NULL)
+		led_destroy(adapter->led_dev);
+
 	EM_CORE_LOCK(adapter);
 	adapter->in_detach = 1;
 	em_stop(adapter);
@@ -779,9 +782,6 @@ em_resume(device_t dev)
 	struct adapter *adapter = device_get_softc(dev);
 	struct ifnet *ifp = adapter->ifp;
 
-	if (adapter->led_dev != NULL)
-		led_destroy(adapter->led_dev);
-
 	EM_CORE_LOCK(adapter);
 	em_init_locked(adapter);
 	em_init_manageability(adapter);

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 20:26:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5FB9106566B;
	Sat, 15 May 2010 20:26:10 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9AB3B8FC0A;
	Sat, 15 May 2010 20:26:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FKQAC6081992;
	Sat, 15 May 2010 20:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FKQA3T081989;
	Sat, 15 May 2010 20:26:10 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201005152026.o4FKQA3T081989@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 15 May 2010 20:26: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: r208119 - head/sys/dev/isp
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 20:26:10 -0000

Author: mjacob
Date: Sat May 15 20:26:10 2010
New Revision: 208119
URL: http://svn.freebsd.org/changeset/base/208119

Log:
  Whap. Hook up some wires that were forgotten a few months ago and restore
  the zombie device timeout code and the loop down time code and the fabric
  hysteresis code.
  MFC after:	1 week
  Sponsored By:	Panasas

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Sat May 15 20:25:29 2010	(r208118)
+++ head/sys/dev/isp/isp_freebsd.c	Sat May 15 20:26:10 2010	(r208119)
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
 MODULE_VERSION(isp, 1);
 MODULE_DEPEND(isp, cam, 1, 1, 1);
 int isp_announced = 0;
-int isp_fabric_hysteresis = 3;
+int isp_fabric_hysteresis = 5;
 int isp_loop_down_limit = 60;	/* default loop down limit */
 int isp_change_is_bad = 0;	/* "changed" devices are bad */
 int isp_quickboot_time = 7;	/* don't wait more than N secs for loop up */
@@ -141,9 +141,12 @@ isp_attach_chan(ispsoftc_t *isp, struct 
 		fc->path = path;
 		fc->isp = isp;
 		fc->ready = 1;
-
+		fc->gone_device_time = isp_gone_device_time;
+		fc->loop_down_limit = isp_loop_down_limit;
+		fc->hysteresis = isp_fabric_hysteresis;
 		callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0);
 		callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0);
+
 		/*
 		 * We start by being "loop down" if we have an initiator role
 		 */
@@ -3940,7 +3943,7 @@ isp_gdt(void *arg)
 	fcportdb_t *lp;
 	int dbidx, tgt, more_to_do = 0;
 
-	isp_prt(isp, ISP_LOGDEBUG0, "Chan %d GDT timer expired", chan);
+	isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d GDT timer expired @ %lu", chan, time_uptime);
 	for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) {
 		lp = &FCPARAM(isp, chan)->portdb[dbidx];
 
@@ -3950,15 +3953,8 @@ isp_gdt(void *arg)
 		if (lp->dev_map_idx == 0 || lp->target_mode) {
 			continue;
 		}
-		/*
-		 * We can use new_portid here because it is untouched
-		 * while the state is ZOMBIE
-		 */
-		if (lp->new_portid == 0) {
-			continue;
-		}
-		lp->new_portid -= 1;
-		if (lp->new_portid != 0) {
+		if (lp->gone_timer != 0) {
+			lp->gone_timer -= 1;
 			more_to_do++;
 			continue;
 		}
@@ -3973,7 +3969,7 @@ isp_gdt(void *arg)
 		if (more_to_do) {
 			callout_reset(&fc->gdt, hz, isp_gdt, fc);
 		} else {
-			isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan);
+			isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Stopping Gone Device Timer", chan);
 		}
 	}
 }
@@ -4942,7 +4938,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 				}
 				if (!callout_active(&fc->ldt)) {
 					callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc);
-					isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime);
+					isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Starting Loop Down Timer @ %lu", (unsigned long) time_uptime);
 				}
 			}
 		}
@@ -4972,6 +4968,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		va_end(ap);
 		fc = ISP_FC_PC(isp, bus);
 		lp->reserved = 0;
+		lp->gone_timer = 0;
 		if ((FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) {
 			int dbidx = lp - FCPARAM(isp, bus)->portdb;
 			int i;
@@ -5007,6 +5004,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		va_end(ap);
 		fc = ISP_FC_PC(isp, bus);
 		lp->reserved = 0;
+		lp->gone_timer = 0;
 		if (isp_change_is_bad) {
 			lp->state = FC_PORTDB_STATE_NIL;
 			if (lp->dev_map_idx) {
@@ -5061,15 +5059,13 @@ isp_async(ispsoftc_t *isp, ispasync_t cm
 		 * If it isn't marked that isp_gdt is going to get rid of it,
 		 * announce that it's gone.
 		 *
-		 * We can use new_portid for the gone timer because it's
-		 * undefined while the state is ZOMBIE.
 		 */
 		if (lp->dev_map_idx && lp->reserved == 0) {
 			lp->reserved = 1;
-			lp->new_portid = ISP_FC_PC(isp, bus)->gone_device_time;
 			lp->state = FC_PORTDB_STATE_ZOMBIE;
+			lp->gone_timer = ISP_FC_PC(isp, bus)->gone_device_time;
 			if (fc->ready && !callout_active(&fc->gdt)) {
-				isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus);
+				isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Starting Gone Device Timer with %u seconds time now %lu", bus, lp->gone_timer, time_uptime);
 				callout_reset(&fc->gdt, hz, isp_gdt, fc);
 			}
 			tgt = lp->dev_map_idx - 1;

Modified: head/sys/dev/isp/ispvar.h
==============================================================================
--- head/sys/dev/isp/ispvar.h	Sat May 15 20:25:29 2010	(r208118)
+++ head/sys/dev/isp/ispvar.h	Sat May 15 20:26:10 2010	(r208119)
@@ -426,6 +426,7 @@ typedef struct {
 			new_portid	: 24;
 	uint64_t	node_wwn;
 	uint64_t	port_wwn;
+	uint32_t	gone_timer;
 } fcportdb_t;
 
 #define	FC_PORTDB_STATE_NIL		0

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 21:18:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F831106568A;
	Sat, 15 May 2010 21:18:15 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7ACE78FC2C;
	Sat, 15 May 2010 21:18:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FLIFe8093566;
	Sat, 15 May 2010 21:18:15 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4FLIF8E093555;
	Sat, 15 May 2010 21:18:15 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <201005152118.o4FLIF8E093555@svn.freebsd.org>
From: Weongyo Jeong 
Date: Sat, 15 May 2010 21:18: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: r208120 - head/sys/dev/bwn
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 21:18:15 -0000

Author: weongyo
Date: Sat May 15 21:18:15 2010
New Revision: 208120
URL: http://svn.freebsd.org/changeset/base/208120

Log:
  - fixes a bug that it didn't initialize the ratectl after association;
    so ni_txrate returned 0 which is a invalid result.
  - The fourth argument of ieee80211_ratectl_tx_complete() could be not
    NULL.
  
  Reported by:	Gustau P?rez 
  Tested by:	Gustau P?rez ,
  		Ian FREISLICH 
  MFC after:	3 days

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==============================================================================
--- head/sys/dev/bwn/if_bwn.c	Sat May 15 20:26:10 2010	(r208119)
+++ head/sys/dev/bwn/if_bwn.c	Sat May 15 21:18:15 2010	(r208120)
@@ -8329,6 +8329,7 @@ bwn_phy_reset(struct bwn_mac *mac)
 static int
 bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
 {
+	const struct ieee80211_txparam *tp;
 	struct bwn_vap *bvp = BWN_VAP(vap);
 	struct ieee80211com *ic= vap->iv_ic;
 	struct ifnet *ifp = ic->ic_ifp;
@@ -8377,6 +8378,11 @@ bwn_newstate(struct ieee80211vap *vap, e
 		bwn_set_pretbtt(mac);
 		bwn_spu_setdelay(mac, 0);
 		bwn_set_macaddr(mac);
+
+		/* Initializes ratectl for a node. */
+		tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
+		if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
+			ieee80211_ratectl_node_init(vap->iv_bss);
 	}
 
 	BWN_UNLOCK(sc);
@@ -8994,7 +9000,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 	struct bwn_stats *stats = &mac->mac_stats;
 	struct ieee80211_node *ni;
 	struct ieee80211vap *vap;
-	int slot;
+	int retrycnt = 0, slot;
 
 	BWN_ASSERT_LOCKED(mac->mac_sc);
 
@@ -9027,7 +9033,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 					    status->ack ?
 					      IEEE80211_RATECTL_TX_SUCCESS :
 					      IEEE80211_RATECTL_TX_FAILURE,
-					    NULL, 0);
+					    &retrycnt, 0);
 					break;
 				}
 				slot = bwn_dma_nextslot(dr, slot);
@@ -9048,7 +9054,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
 			    status->ack ?
 			      IEEE80211_RATECTL_TX_SUCCESS :
 			      IEEE80211_RATECTL_TX_FAILURE,
-			    NULL, 0);
+			    &retrycnt, 0);
 		}
 		bwn_pio_handle_txeof(mac, status);
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat May 15 23:02:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A2351065670;
	Sat, 15 May 2010 23:02:55 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id CED968FC0C;
	Sat, 15 May 2010 23:02:54 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 5B8C911BA62;
	Sat, 15 May 2010 18:02:53 -0500 (CDT)
Received: from 192.168.0.6 (24.114.252.231)
	by lavabit.com with ESMTP id MV754Q0F95ML;
	Sat, 15 May 2010 18:02:53 -0500
References: <201005152118.o4FLIF8E093555@svn.freebsd.org>
In-Reply-To: <201005152118.o4FLIF8E093555@svn.freebsd.org>
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
Message-Id: <4C04B013-9922-4934-AD3B-88C283FCC968@FreeBSD.org>
Content-Transfer-Encoding: quoted-printable
From: Rui Paulo 
Date: Sat, 15 May 2010 19:02:51 -0400
To: Weongyo Jeong 
X-Mailer: Apple Mail (2.1078)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r208120 - head/sys/dev/bwn
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 15 May 2010 23:02:55 -0000


On 15 May 2010, at 17:18, Weongyo Jeong wrote:

> Author: weongyo
> Date: Sat May 15 21:18:15 2010
> New Revision: 208120
> URL: http://svn.freebsd.org/changeset/base/208120
>=20
> Log:
>  - fixes a bug that it didn't initialize the ratectl after =
association;
>    so ni_txrate returned 0 which is a invalid result.
>  - The fourth argument of ieee80211_ratectl_tx_complete() could be not
>    NULL.
>=20


Thanks!

>  Reported by:	Gustau P?rez 
>  Tested by:	Gustau P?rez ,
>  		Ian FREISLICH 
>  MFC after:	3 days
>=20
> Modified:
>  head/sys/dev/bwn/if_bwn.c
>=20
> Modified: head/sys/dev/bwn/if_bwn.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/dev/bwn/if_bwn.c	Sat May 15 20:26:10 2010	=
(r208119)
> +++ head/sys/dev/bwn/if_bwn.c	Sat May 15 21:18:15 2010	=
(r208120)
> @@ -8329,6 +8329,7 @@ bwn_phy_reset(struct bwn_mac *mac)
> static int
> bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, =
int arg)
> {
> +	const struct ieee80211_txparam *tp;
> 	struct bwn_vap *bvp =3D BWN_VAP(vap);
> 	struct ieee80211com *ic=3D vap->iv_ic;
> 	struct ifnet *ifp =3D ic->ic_ifp;
> @@ -8377,6 +8378,11 @@ bwn_newstate(struct ieee80211vap *vap, e
> 		bwn_set_pretbtt(mac);
> 		bwn_spu_setdelay(mac, 0);
> 		bwn_set_macaddr(mac);
> +
> +		/* Initializes ratectl for a node. */
> +		tp =3D =
&vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
> +		if (tp->ucastrate =3D=3D IEEE80211_FIXED_RATE_NONE)
> +			ieee80211_ratectl_node_init(vap->iv_bss);
> 	}
>=20
> 	BWN_UNLOCK(sc);
> @@ -8994,7 +9000,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
> 	struct bwn_stats *stats =3D &mac->mac_stats;
> 	struct ieee80211_node *ni;
> 	struct ieee80211vap *vap;
> -	int slot;
> +	int retrycnt =3D 0, slot;
>=20
> 	BWN_ASSERT_LOCKED(mac->mac_sc);
>=20
> @@ -9027,7 +9033,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
> 					    status->ack ?
> 					      =
IEEE80211_RATECTL_TX_SUCCESS :
> 					      =
IEEE80211_RATECTL_TX_FAILURE,
> -					    NULL, 0);
> +					    &retrycnt, 0);
> 					break;
> 				}
> 				slot =3D bwn_dma_nextslot(dr, slot);
> @@ -9048,7 +9054,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
> 			    status->ack ?
> 			      IEEE80211_RATECTL_TX_SUCCESS :
> 			      IEEE80211_RATECTL_TX_FAILURE,
> -			    NULL, 0);
> +			    &retrycnt, 0);
> 		}
> 		bwn_pio_handle_txeof(mac, status);
> 	}
>=20
> =
__________________________________________________________________________=
__________
> Use the link below to report this message as spam.
> https://lavabit.com/apps/teacher?sig=3D1097658&key=3D888213324
> =
__________________________________________________________________________=
__________

--
Rui Paulo