From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 00:44:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B362106564A; Sun, 6 Nov 2011 00:44:41 +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 EF35D8FC08; Sun, 6 Nov 2011 00:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA60ieg0091691; Sun, 6 Nov 2011 00:44:40 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA60ie5H091688; Sun, 6 Nov 2011 00:44:40 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201111060044.pA60ie5H091688@svn.freebsd.org> From: Matt Jacob Date: Sun, 6 Nov 2011 00:44: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: r227126 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 00:44:41 -0000 Author: mjacob Date: Sun Nov 6 00:44:40 2011 New Revision: 227126 URL: http://svn.freebsd.org/changeset/base/227126 Log: Implement the sysctl's for fibre channel that are listed in the man page. MFC after: 3 days Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sat Nov 5 22:44:37 2011 (r227125) +++ head/sys/dev/isp/isp_freebsd.c Sun Nov 6 00:44:40 2011 (r227126) @@ -175,6 +175,14 @@ isp_attach_chan(ispsoftc_t *isp, struct isp_prt(isp, ISP_LOGERR, "cannot create test target thread"); } #endif + if (chan == 0) { + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(isp->isp_osinfo.dev); + struct sysctl_oid *tree = device_get_sysctl_tree(isp->isp_osinfo.dev); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwnn", CTLFLAG_RD, &FCPARAM(isp, 0)->isp_wwnn, "World Wide Node Name"); + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwpn", CTLFLAG_RD, &FCPARAM(isp, 0)->isp_wwpn, "World Wide Port Name"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "loop_down_limit", CTLFLAG_RW, &ISP_FC_PC(isp, 0)->loop_down_limit, 0, "Loop Down Limit"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "gone_device_time", CTLFLAG_RW, &ISP_FC_PC(isp, 0)->gone_device_time, 0, "Gone Device Time"); + } } return (0); } Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sat Nov 5 22:44:37 2011 (r227125) +++ head/sys/dev/isp/isp_freebsd.h Sun Nov 6 00:44:40 2011 (r227126) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 02:03:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E613106566C; Sun, 6 Nov 2011 02:03:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A998FC1F; Sun, 6 Nov 2011 02:03:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA623R46094058; Sun, 6 Nov 2011 02:03:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA623Rdi094056; Sun, 6 Nov 2011 02:03:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201111060203.pA623Rdi094056@svn.freebsd.org> From: Alan Cox Date: Sun, 6 Nov 2011 02:03: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: r227127 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 02:03:27 -0000 Author: alc Date: Sun Nov 6 02:03:27 2011 New Revision: 227127 URL: http://svn.freebsd.org/changeset/base/227127 Log: Wake up the page daemon in vm_page_alloc_freelist() if it couldn't allocate the requested page because too few pages are cached or free. Document the VM_ALLOC_COUNT() option to vm_page_alloc() and vm_page_alloc_freelist(). Make style changes to vm_page_alloc() and vm_page_alloc_freelist(), such as using a variable name that more closely corresponds to the comments. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Nov 6 00:44:40 2011 (r227126) +++ head/sys/vm/vm_page.c Sun Nov 6 02:03:27 2011 (r227127) @@ -1298,6 +1298,8 @@ vm_page_cache_transfer(vm_object_t orig_ * VM_ALLOC_INTERRUPT interrupt time request * * optional allocation flags: + * VM_ALLOC_COUNT(number) the number of additional pages that the caller + * intends to allocate * VM_ALLOC_IFCACHED return page only if it is cached * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page * is cached @@ -1315,27 +1317,26 @@ vm_page_alloc(vm_object_t object, vm_pin struct vnode *vp = NULL; vm_object_t m_object; vm_page_t m; - int flags, page_req; + int flags, req_class; - if ((req & VM_ALLOC_NOOBJ) == 0) { - KASSERT(object != NULL, - ("vm_page_alloc: NULL object.")); + KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0), + ("vm_page_alloc: inconsistent object/req")); + if (object != NULL) VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - } - page_req = req & VM_ALLOC_CLASS_MASK; + req_class = req & VM_ALLOC_CLASS_MASK; /* - * The pager is allowed to eat deeper into the free page list. + * The page daemon is allowed to dig deeper into the free page list. */ - if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) - page_req = VM_ALLOC_SYSTEM; + if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) + req_class = VM_ALLOC_SYSTEM; mtx_lock(&vm_page_queue_free_mtx); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || - (page_req == VM_ALLOC_SYSTEM && + (req_class == VM_ALLOC_SYSTEM && cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || - (page_req == VM_ALLOC_INTERRUPT && + (req_class == VM_ALLOC_INTERRUPT && cnt.v_free_count + cnt.v_cache_count > 0)) { /* * Allocate from the free queue if the number of free pages @@ -1383,7 +1384,7 @@ vm_page_alloc(vm_object_t object, vm_pin */ mtx_unlock(&vm_page_queue_free_mtx); atomic_add_int(&vm_pageout_deficit, - MAX((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); + max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); pagedaemon_wakeup(); return (NULL); } @@ -1391,7 +1392,6 @@ vm_page_alloc(vm_object_t object, vm_pin /* * At this point we had better have found a good page. */ - KASSERT(m != NULL, ("vm_page_alloc: missing page")); KASSERT(m->queue == PQ_NONE, ("vm_page_alloc: page %p has unexpected queue %d", m, m->queue)); @@ -1403,6 +1403,8 @@ vm_page_alloc(vm_object_t object, vm_pin ("vm_page_alloc: page %p has unexpected memattr %d", m, pmap_page_get_memattr(m))); if ((m->flags & PG_CACHED) != 0) { + KASSERT((m->flags & PG_ZERO) == 0, + ("vm_page_alloc: cached page %p is PG_ZERO", m)); KASSERT(m->valid != 0, ("vm_page_alloc: cached page %p is invalid", m)); if (m->object == object && m->pindex == pindex) @@ -1546,6 +1548,8 @@ vm_page_alloc_init(vm_page_t m) * VM_ALLOC_INTERRUPT interrupt time request * * optional allocation flags: + * VM_ALLOC_COUNT(number) the number of additional pages that the caller + * intends to allocate * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page * @@ -1557,20 +1561,32 @@ vm_page_alloc_freelist(int flind, int re struct vnode *drop; vm_page_t m; u_int flags; - int page_req; + int req_class; + + req_class = req & VM_ALLOC_CLASS_MASK; + + /* + * The page daemon is allowed to dig deeper into the free page list. + */ + if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) + req_class = VM_ALLOC_SYSTEM; - m = NULL; - page_req = req & VM_ALLOC_CLASS_MASK; - mtx_lock(&vm_page_queue_free_mtx); /* * Do not allocate reserved pages unless the req has asked for it. */ + mtx_lock(&vm_page_queue_free_mtx); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || - (page_req == VM_ALLOC_SYSTEM && + (req_class == VM_ALLOC_SYSTEM && cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || - (page_req == VM_ALLOC_INTERRUPT && - cnt.v_free_count + cnt.v_cache_count > 0)) { + (req_class == VM_ALLOC_INTERRUPT && + cnt.v_free_count + cnt.v_cache_count > 0)) m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); + else { + mtx_unlock(&vm_page_queue_free_mtx); + atomic_add_int(&vm_pageout_deficit, + max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); + pagedaemon_wakeup(); + return (NULL); } if (m == NULL) { mtx_unlock(&vm_page_queue_free_mtx); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 05:20:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71D71065670; Sun, 6 Nov 2011 05:20:27 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6A7C8FC0A; Sun, 6 Nov 2011 05:20:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA65KRqx000636; Sun, 6 Nov 2011 05:20:27 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA65KRID000633; Sun, 6 Nov 2011 05:20:27 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111060520.pA65KRID000633@svn.freebsd.org> From: Max Khon Date: Sun, 6 Nov 2011 05:20: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: r227130 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 05:20:27 -0000 Author: fjoe Date: Sun Nov 6 05:20:27 2011 New Revision: 227130 URL: http://svn.freebsd.org/changeset/base/227130 Log: Constify "address" argument of ng_address_path(). Modified: head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Sun Nov 6 03:18:50 2011 (r227129) +++ head/sys/netgraph/netgraph.h Sun Nov 6 05:20:27 2011 (r227130) @@ -1135,7 +1135,7 @@ SYSCTL_DECL(_net_graph); */ int ng_address_ID(node_p here, item_p item, ng_ID_t ID, ng_ID_t retaddr); int ng_address_hook(node_p here, item_p item, hook_p hook, ng_ID_t retaddr); -int ng_address_path(node_p here, item_p item, char *address, ng_ID_t raddr); +int ng_address_path(node_p here, item_p item, const char *address, ng_ID_t raddr); int ng_bypass(hook_p hook1, hook_p hook2); hook_p ng_findhook(node_p node, const char *name); struct ng_type *ng_findtype(const char *type); Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Sun Nov 6 03:18:50 2011 (r227129) +++ head/sys/netgraph/ng_base.c Sun Nov 6 05:20:27 2011 (r227130) @@ -3515,7 +3515,7 @@ ng_address_hook(node_p here, item_p item } int -ng_address_path(node_p here, item_p item, char *address, ng_ID_t retaddr) +ng_address_path(node_p here, item_p item, const char *address, ng_ID_t retaddr) { node_p dest = NULL; hook_p hook = NULL; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 05:23:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9DB0106566C; Sun, 6 Nov 2011 05:23:42 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA02F8FC0A; Sun, 6 Nov 2011 05:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA65Ngwn000777; Sun, 6 Nov 2011 05:23:42 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA65NgdP000775; Sun, 6 Nov 2011 05:23:42 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111060523.pA65NgdP000775@svn.freebsd.org> From: Max Khon Date: Sun, 6 Nov 2011 05:23: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: r227131 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 05:23:43 -0000 Author: fjoe Date: Sun Nov 6 05:23:42 2011 New Revision: 227131 URL: http://svn.freebsd.org/changeset/base/227131 Log: Fix potential double mbuf free: M_PREPEND may free mbuf chain and return NULL but item will still have the reference ot the mbuf chain and will free it upon destruction. Modified: head/sys/netgraph/ng_cisco.c Modified: head/sys/netgraph/ng_cisco.c ============================================================================== --- head/sys/netgraph/ng_cisco.c Sun Nov 6 05:20:27 2011 (r227130) +++ head/sys/netgraph/ng_cisco.c Sun Nov 6 05:23:42 2011 (r227131) @@ -359,12 +359,13 @@ cisco_rcvdata(hook_p hook, item_p item) /* OK so it came from a protocol, heading out. Prepend general data packet header. For now, IP,IPX only */ - m = NGI_M(item); /* still associated with item */ + NGI_GET_M(item, m); M_PREPEND(m, CISCO_HEADER_LEN, M_DONTWAIT); if (!m) { error = ENOBUFS; goto out; } + NGI_M(item) = m; h = mtod(m, struct cisco_header *); h->address = CISCO_UNICAST; h->control = 0; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 05:24:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1FEB1065672; Sun, 6 Nov 2011 05:24:54 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1EFE8FC15; Sun, 6 Nov 2011 05:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA65OsDW000844; Sun, 6 Nov 2011 05:24:54 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA65OsVj000842; Sun, 6 Nov 2011 05:24:54 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111060524.pA65OsVj000842@svn.freebsd.org> From: Max Khon Date: Sun, 6 Nov 2011 05:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227132 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 05:24:55 -0000 Author: fjoe Date: Sun Nov 6 05:24:54 2011 New Revision: 227132 URL: http://svn.freebsd.org/changeset/base/227132 Log: - Fix potential double mbuf free: M_PREPEND may free mbuf chain and return NULL but item will still have the reference ot the mbuf chain and will free it upon destruction. - Fix memory leak (unfree'd item on error path). Modified: head/sys/netgraph/ng_atmllc.c Modified: head/sys/netgraph/ng_atmllc.c ============================================================================== --- head/sys/netgraph/ng_atmllc.c Sun Nov 6 05:23:42 2011 (r227131) +++ head/sys/netgraph/ng_atmllc.c Sun Nov 6 05:24:54 2011 (r227132) @@ -153,7 +153,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p it int error; priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); - m = NGI_M(item); + NGI_GET_M(item, m); outhook = NULL; padding = 0; @@ -170,6 +170,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p it if (m->m_len < sizeof(struct atmllc) + ETHER_HDR_LEN) { m = m_pullup(m, sizeof(struct atmllc) + ETHER_HDR_LEN); if (m == NULL) { + NG_FREE_ITEM(item); return (ENOMEM); } } @@ -236,6 +237,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p it } if (outhook == NULL) { + NG_FREE_M(m); NG_FREE_ITEM(item); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 06:28:41 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id B02F9106564A; Sun, 6 Nov 2011 06:28:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 3CD771528B1; Sun, 6 Nov 2011 06:28:41 +0000 (UTC) Message-ID: <4EB62918.6050408@FreeBSD.org> Date: Sat, 05 Nov 2011 23:28:40 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Dimitry Andric References: <4EB55B99.2000308@FreeBSD.org> <4EB5B776.7090205@FreeBSD.org> In-Reply-To: <4EB5B776.7090205@FreeBSD.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org, Andriy Gapon Subject: Re: mergeinfo under sys/boot? X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 06:28:41 -0000 On 11/05/2011 15:23, Dimitry Andric wrote: > I remember, merging to sys/ itself caused some problems, so that is why > I merged to the individual subdirectories instead. Yeah, that's the exact thing that you're never supposed to do. :) ALWAYS merge thing under sys/ there. If you think that doing so is going to cause a problem, ask for help before proceeding. -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:10:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E652C106566C; Sun, 6 Nov 2011 08:10:41 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5BB98FC0C; Sun, 6 Nov 2011 08:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68AffX007696; Sun, 6 Nov 2011 08:10:41 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Afxr007693; Sun, 6 Nov 2011 08:10:41 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111060810.pA68Afxr007693@svn.freebsd.org> From: Max Khon Date: Sun, 6 Nov 2011 08:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227151 - in head/sys: conf kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:10:42 -0000 Author: fjoe Date: Sun Nov 6 08:10:41 2011 New Revision: 227151 URL: http://svn.freebsd.org/changeset/base/227151 Log: Add KLD_DEBUG option. Modified: head/sys/conf/options head/sys/kern/kern_linker.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Nov 6 08:03:33 2011 (r227150) +++ head/sys/conf/options Sun Nov 6 08:10:41 2011 (r227151) @@ -59,6 +59,7 @@ GDB KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h +KLD_DEBUG opt_kld.h SYSCTL_DEBUG opt_sysctl.h # Miscellaneous options. Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Nov 6 08:03:33 2011 (r227150) +++ head/sys/kern/kern_linker.c Sun Nov 6 08:10:41 2011 (r227151) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kld.h" #include "opt_hwpmc_hooks.h" #include From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:13:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D751106564A; Sun, 6 Nov 2011 08:13:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D10F8FC0A; Sun, 6 Nov 2011 08:13:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Dpbq007849; Sun, 6 Nov 2011 08:13:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Dp01007847; Sun, 6 Nov 2011 08:13:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060813.pA68Dp01007847@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:13: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: r227152 - head/usr.bin/banner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:13:52 -0000 Author: ed Date: Sun Nov 6 08:13:51 2011 New Revision: 227152 URL: http://svn.freebsd.org/changeset/base/227152 Log: Add missing static keywords to banner(1) Modified: head/usr.bin/banner/banner.c Modified: head/usr.bin/banner/banner.c ============================================================================== --- head/usr.bin/banner/banner.c Sun Nov 6 08:10:41 2011 (r227151) +++ head/usr.bin/banner/banner.c Sun Nov 6 08:13:51 2011 (r227152) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define NBYTES 9271 /* Pointers into data_table for each ASCII char */ -const int asc_ptr[NCHARS] = { +static const int asc_ptr[NCHARS] = { /* ^@ */ 0, 0, 0, 0, 0, 0, 0, 0, /* ^H */ 0, 0, 0, 0, 0, 0, 0, 0, /* ^P */ 0, 0, 0, 0, 0, 0, 0, 0, @@ -86,7 +86,7 @@ const int asc_ptr[NCHARS] = { * is the next elt in array) and goto second * next element in array. */ -const unsigned char data_table[NBYTES] = { +static const unsigned char data_table[NBYTES] = { /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 */ 129, 227, 130, 34, 6, 90, 19, 129, 32, 10, /* 10 */ 74, 40, 129, 31, 12, 64, 53, 129, 30, 14, @@ -1018,11 +1018,11 @@ const unsigned char data_table[NBYTES] = /* 9270 */ 193 }; -char line[DWIDTH]; -char *message; -char print[DWIDTH]; -int debug, i, j, linen, max, nchars, pc, term, trace, x, y; -int width = DWIDTH; /* -w option: scrunch letters to 80 columns */ +static char line[DWIDTH]; +static char *message; +static char print[DWIDTH]; +static int debug, i, j, linen, max, nchars, pc, term, trace, x, y; +static int width = DWIDTH; /* -w option: scrunch letters to 80 columns */ static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:13:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0597B1065772; Sun, 6 Nov 2011 08:13:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79E488FC0C; Sun, 6 Nov 2011 08:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68DwpE007889; Sun, 6 Nov 2011 08:13:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68DwhZ007887; Sun, 6 Nov 2011 08:13:58 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060813.pA68DwhZ007887@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:13: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: r227153 - head/usr.bin/c99 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:13:59 -0000 Author: ed Date: Sun Nov 6 08:13:58 2011 New Revision: 227153 URL: http://svn.freebsd.org/changeset/base/227153 Log: Add missing static keywords to c99(1) Modified: head/usr.bin/c99/c99.c Modified: head/usr.bin/c99/c99.c ============================================================================== --- head/usr.bin/c99/c99.c Sun Nov 6 08:13:51 2011 (r227152) +++ head/usr.bin/c99/c99.c Sun Nov 6 08:13:58 2011 (r227153) @@ -43,12 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include -char **args; -u_int cargs, nargs; +static char **args; +static u_int cargs, nargs; -void addarg(const char *); -void addlib(const char *); -void usage(void); +static void addarg(const char *); +static void addlib(const char *); +static void usage(void); int main(int argc, char *argv[]) @@ -91,7 +91,7 @@ main(int argc, char *argv[]) err(1, "/usr/bin/cc"); } -void +static void addarg(const char *item) { if (nargs + 1 >= cargs) { @@ -104,7 +104,7 @@ addarg(const char *item) args[nargs] = NULL; } -void +static void addlib(const char *lib) { @@ -123,7 +123,7 @@ addlib(const char *lib) } } -void +static void usage(void) { (void)fprintf(stderr, "%s\n%s\n", From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A3AD1065692; Sun, 6 Nov 2011 08:14:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19BA88FC14; Sun, 6 Nov 2011 08:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68E341007930; Sun, 6 Nov 2011 08:14:03 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68E3TA007928; Sun, 6 Nov 2011 08:14:03 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68E3TA007928@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227154 - head/usr.bin/cap_mkdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:04 -0000 Author: ed Date: Sun Nov 6 08:14:03 2011 New Revision: 227154 URL: http://svn.freebsd.org/changeset/base/227154 Log: Add missing static keywords to cap_mkdb(1) Modified: head/usr.bin/cap_mkdb/cap_mkdb.c Modified: head/usr.bin/cap_mkdb/cap_mkdb.c ============================================================================== --- head/usr.bin/cap_mkdb/cap_mkdb.c Sun Nov 6 08:13:58 2011 (r227153) +++ head/usr.bin/cap_mkdb/cap_mkdb.c Sun Nov 6 08:14:03 2011 (r227154) @@ -53,15 +53,15 @@ __FBSDID("$FreeBSD$"); #include #include -void db_build(char **); -void dounlink(void); -void usage(void); - -DB *capdbp; -int verbose; -char *capdb, *capname, buf[8 * 1024]; +static void db_build(char **); +static void dounlink(void); +static void usage(void); + +static DB *capdbp; +static int verbose; +static char *capname, buf[8 * 1024]; -HASHINFO openinfo = { +static HASHINFO openinfo = { 4096, /* bsize */ 0, /* ffactor */ 0, /* nelem */ @@ -134,7 +134,7 @@ main(int argc, char *argv[]) exit(0); } -void +static void dounlink(void) { if (capname != NULL) @@ -153,7 +153,7 @@ dounlink(void) * Db_build() builds the name and capability databases according to the * details above. */ -void +static void db_build(char **ifiles) { DBT key, data; @@ -259,7 +259,7 @@ db_build(char **ifiles) (void)printf("cap_mkdb: %d capability records\n", reccnt); } -void +static void usage(void) { (void)fprintf(stderr, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A48A10656EB; Sun, 6 Nov 2011 08:14:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE388FC15; Sun, 6 Nov 2011 08:14:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EAJr007969; Sun, 6 Nov 2011 08:14:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68E9Ex007968; Sun, 6 Nov 2011 08:14:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68E9Ex007968@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227155 - head/usr.bin/catman X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:13 -0000 Author: ed Date: Sun Nov 6 08:14:09 2011 New Revision: 227155 URL: http://svn.freebsd.org/changeset/base/227155 Log: Add missing static keywords to catman(1) Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Sun Nov 6 08:14:03 2011 (r227154) +++ head/usr.bin/catman/catman.c Sun Nov 6 08:14:09 2011 (r227155) @@ -94,7 +94,7 @@ enum Ziptype {NONE, BZIP, GZIP}; static uid_t uid; static int starting_dir; static char tmp_file[MAXPATHLEN]; -struct stat test_st; +static struct stat test_st; /* * A hashtable is an array of chains composed of this entry structure. From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7298E1065843; Sun, 6 Nov 2011 08:14:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 624558FC19; Sun, 6 Nov 2011 08:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EGfC008007; Sun, 6 Nov 2011 08:14:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68EGLf008005; Sun, 6 Nov 2011 08:14:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68EGLf008005@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227156 - head/usr.bin/cmp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:16 -0000 Author: ed Date: Sun Nov 6 08:14:16 2011 New Revision: 227156 URL: http://svn.freebsd.org/changeset/base/227156 Log: Add missing static keywords to cmp(1) Modified: head/usr.bin/cmp/extern.h Modified: head/usr.bin/cmp/extern.h ============================================================================== --- head/usr.bin/cmp/extern.h Sun Nov 6 08:14:09 2011 (r227155) +++ head/usr.bin/cmp/extern.h Sun Nov 6 08:14:16 2011 (r227156) @@ -42,4 +42,4 @@ void c_special(int, const char *, off_t, void diffmsg(const char *, const char *, off_t, off_t); void eofmsg(const char *); -extern int lflag, sflag, xflag; +extern int lflag, sflag, xflag, zflag; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A449410657CB; Sun, 6 Nov 2011 08:14:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A9EE8FC08; Sun, 6 Nov 2011 08:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EMJm008047; Sun, 6 Nov 2011 08:14:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68EMlj008045; Sun, 6 Nov 2011 08:14:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68EMlj008045@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227157 - head/usr.bin/col X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:22 -0000 Author: ed Date: Sun Nov 6 08:14:22 2011 New Revision: 227157 URL: http://svn.freebsd.org/changeset/base/227157 Log: Add missing static keywords to col(1) Modified: head/usr.bin/col/col.c Modified: head/usr.bin/col/col.c ============================================================================== --- head/usr.bin/col/col.c Sun Nov 6 08:14:16 2011 (r227156) +++ head/usr.bin/col/col.c Sun Nov 6 08:14:22 2011 (r227157) @@ -92,22 +92,22 @@ struct line_str { int l_max_col; /* max column in the line */ }; -LINE *alloc_line(void); -void dowarn(int); -void flush_line(LINE *); -void flush_lines(int); -void flush_blanks(void); -void free_line(LINE *); -void usage(void); - -CSET last_set; /* char_set of last char printed */ -LINE *lines; -int compress_spaces; /* if doing space -> tab conversion */ -int fine; /* if `fine' resolution (half lines) */ -int max_bufd_lines; /* max # lines to keep in memory */ -int nblank_lines; /* # blanks after last flushed line */ -int no_backspaces; /* if not to output any backspaces */ -int pass_unknown_seqs; /* pass unknown control sequences */ +static LINE *alloc_line(void); +static void dowarn(int); +static void flush_line(LINE *); +static void flush_lines(int); +static void flush_blanks(void); +static void free_line(LINE *); +static void usage(void); + +static CSET last_set; /* char_set of last char printed */ +static LINE *lines; +static int compress_spaces; /* if doing space -> tab conversion */ +static int fine; /* if `fine' resolution (half lines) */ +static int max_bufd_lines; /* max # lines to keep in memory */ +static int nblank_lines; /* # blanks after last flushed line */ +static int no_backspaces; /* if not to output any backspaces */ +static int pass_unknown_seqs; /* pass unknown control sequences */ #define PUTC(ch) \ do { \ @@ -334,7 +334,7 @@ main(int argc, char **argv) exit(0); } -void +static void flush_lines(int nflush) { LINE *l; @@ -360,7 +360,7 @@ flush_lines(int nflush) * is the number of half line feeds, otherwise it is the number of whole line * feeds. */ -void +static void flush_blanks(void) { int half, i, nb; @@ -389,7 +389,7 @@ flush_blanks(void) * Write a line to stdout taking care of space to tab conversion (-h flag) * and character set shifts. */ -void +static void flush_line(LINE *l) { CHAR *c, *endc; @@ -502,7 +502,7 @@ flush_line(LINE *l) static LINE *line_freelist; -LINE * +static LINE * alloc_line(void) { LINE *l; @@ -523,7 +523,7 @@ alloc_line(void) return (l); } -void +static void free_line(LINE *l) { @@ -531,7 +531,7 @@ free_line(LINE *l) line_freelist = l; } -void +static void usage(void) { @@ -539,7 +539,7 @@ usage(void) exit(1); } -void +static void dowarn(int line) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C496410659D7; Sun, 6 Nov 2011 08:14:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B45FF8FC15; Sun, 6 Nov 2011 08:14:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68ESRW008087; Sun, 6 Nov 2011 08:14:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68ESKs008085; Sun, 6 Nov 2011 08:14:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68ESKs008085@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227158 - head/usr.bin/colcrt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:28 -0000 Author: ed Date: Sun Nov 6 08:14:28 2011 New Revision: 227158 URL: http://svn.freebsd.org/changeset/base/227158 Log: Add missing static keywords to colcrt(1) Modified: head/usr.bin/colcrt/colcrt.c Modified: head/usr.bin/colcrt/colcrt.c ============================================================================== --- head/usr.bin/colcrt/colcrt.c Sun Nov 6 08:14:22 2011 (r227157) +++ head/usr.bin/colcrt/colcrt.c Sun Nov 6 08:14:28 2011 (r227158) @@ -64,13 +64,13 @@ __FBSDID("$FreeBSD$"); * Option -2 forces printing of all half lines. */ -wchar_t page[267][132]; +static wchar_t page[267][132]; -int outline = 1; -int outcol; +static int outline = 1; +static int outcol; -char suppresul; -char printall; +static char suppresul; +static char printall; static void move(int, int); static void pflush(int); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57AA71065759; Sun, 6 Nov 2011 08:14:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 578388FC19; Sun, 6 Nov 2011 08:14:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EYNB008127; Sun, 6 Nov 2011 08:14:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68EYS9008125; Sun, 6 Nov 2011 08:14:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68EYS9008125@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227159 - head/usr.bin/column X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:35 -0000 Author: ed Date: Sun Nov 6 08:14:34 2011 New Revision: 227159 URL: http://svn.freebsd.org/changeset/base/227159 Log: Add missing static keywords to column(1) Modified: head/usr.bin/column/column.c Modified: head/usr.bin/column/column.c ============================================================================== --- head/usr.bin/column/column.c Sun Nov 6 08:14:28 2011 (r227158) +++ head/usr.bin/column/column.c Sun Nov 6 08:14:34 2011 (r227159) @@ -58,21 +58,21 @@ __FBSDID("$FreeBSD$"); #define TAB 8 -void c_columnate(void); -void input(FILE *); -void maketbl(void); -void print(void); -void r_columnate(void); -void usage(void); -int width(const wchar_t *); - -int termwidth = 80; /* default terminal width */ - -int entries; /* number of records */ -int eval; /* exit value */ -int maxlength; /* longest record */ -wchar_t **list; /* array of pointers to records */ -const wchar_t *separator = L"\t "; /* field separator for table option */ +static void c_columnate(void); +static void input(FILE *); +static void maketbl(void); +static void print(void); +static void r_columnate(void); +static void usage(void); +static int width(const wchar_t *); + +static int termwidth = 80; /* default terminal width */ + +static int entries; /* number of records */ +static int eval; /* exit value */ +static int maxlength; /* longest record */ +static wchar_t **list; /* array of pointers to records */ +static const wchar_t *separator = L"\t "; /* field separator for table option */ int main(int argc, char **argv) @@ -149,7 +149,7 @@ main(int argc, char **argv) exit(eval); } -void +static void c_columnate(void) { int chcnt, col, cnt, endcol, numcols; @@ -178,7 +178,7 @@ c_columnate(void) putwchar('\n'); } -void +static void r_columnate(void) { int base, chcnt, cnt, col, endcol, numcols, numrows, row; @@ -205,7 +205,7 @@ r_columnate(void) } } -void +static void print(void) { int cnt; @@ -221,7 +221,7 @@ typedef struct _tbl { } TBL; #define DEFCOLS 25 -void +static void maketbl(void) { TBL *t; @@ -274,7 +274,7 @@ maketbl(void) #define DEFNUM 1000 #define MAXLINELEN (LINE_MAX + 1) -void +static void input(FILE *fp) { static int maxentry; @@ -313,7 +313,7 @@ input(FILE *fp) } /* Like wcswidth(), but ignores non-printing characters. */ -int +static int width(const wchar_t *wcs) { int w, cw; @@ -324,7 +324,7 @@ width(const wchar_t *wcs) return (w); } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2B41065782; Sun, 6 Nov 2011 08:14:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CDC68FC1C; Sun, 6 Nov 2011 08:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Eesk008167; Sun, 6 Nov 2011 08:14:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Een3008165; Sun, 6 Nov 2011 08:14:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68Een3008165@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227160 - head/usr.bin/cpuset X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:40 -0000 Author: ed Date: Sun Nov 6 08:14:40 2011 New Revision: 227160 URL: http://svn.freebsd.org/changeset/base/227160 Log: Add missing static keywords to cpuset(1) Modified: head/usr.bin/cpuset/cpuset.c Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Sun Nov 6 08:14:34 2011 (r227159) +++ head/usr.bin/cpuset/cpuset.c Sun Nov 6 08:14:40 2011 (r227160) @@ -46,22 +46,22 @@ __FBSDID("$FreeBSD$"); #include #include -int Cflag; -int cflag; -int gflag; -int iflag; -int jflag; -int lflag; -int pflag; -int rflag; -int sflag; -int tflag; -int xflag; -id_t id; -cpulevel_t level; -cpuwhich_t which; +static int Cflag; +static int cflag; +static int gflag; +static int iflag; +static int jflag; +static int lflag; +static int pflag; +static int rflag; +static int sflag; +static int tflag; +static int xflag; +static id_t id; +static cpulevel_t level; +static cpuwhich_t which; -void usage(void); +static void usage(void); static void printset(cpuset_t *mask); @@ -161,8 +161,8 @@ printset(cpuset_t *mask) printf("\n"); } -const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "irq", "jail" }; -const char *levelnames[] = { NULL, " root", " cpuset", "" }; +static const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "irq", "jail" }; +static const char *levelnames[] = { NULL, " root", " cpuset", "" }; static void printaffinity(void) @@ -343,7 +343,7 @@ main(int argc, char *argv[]) exit(EXIT_SUCCESS); } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A56601065C14; Sun, 6 Nov 2011 08:14:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED028FC14; Sun, 6 Nov 2011 08:14:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EjKW008206; Sun, 6 Nov 2011 08:14:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68EjZs008204; Sun, 6 Nov 2011 08:14:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68EjZs008204@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227161 - head/usr.bin/csplit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:46 -0000 Author: ed Date: Sun Nov 6 08:14:45 2011 New Revision: 227161 URL: http://svn.freebsd.org/changeset/base/227161 Log: Add missing static keywords to csplit(1) Modified: head/usr.bin/csplit/csplit.c Modified: head/usr.bin/csplit/csplit.c ============================================================================== --- head/usr.bin/csplit/csplit.c Sun Nov 6 08:14:40 2011 (r227160) +++ head/usr.bin/csplit/csplit.c Sun Nov 6 08:14:45 2011 (r227161) @@ -60,36 +60,36 @@ __FBSDID("$FreeBSD$"); #include #include -void cleanup(void); -void do_lineno(const char *); -void do_rexp(const char *); -char *getline(void); -void handlesig(int); -FILE *newfile(void); -void toomuch(FILE *, long); -void usage(void); +static void cleanup(void); +static void do_lineno(const char *); +static void do_rexp(const char *); +static char *getline(void); +static void handlesig(int); +static FILE *newfile(void); +static void toomuch(FILE *, long); +static void usage(void); /* * Command line options */ -const char *prefix; /* File name prefix */ -long sufflen; /* Number of decimal digits for suffix */ -int sflag; /* Suppress output of file names */ -int kflag; /* Keep output if error occurs */ +static const char *prefix; /* File name prefix */ +static long sufflen; /* Number of decimal digits for suffix */ +static int sflag; /* Suppress output of file names */ +static int kflag; /* Keep output if error occurs */ /* * Other miscellaneous globals (XXX too many) */ -long lineno; /* Current line number in input file */ -long reps; /* Number of repetitions for this pattern */ -long nfiles; /* Number of files output so far */ -long maxfiles; /* Maximum number of files we can create */ -char currfile[PATH_MAX]; /* Current output file */ -const char *infn; /* Name of the input file */ -FILE *infile; /* Input file handle */ -FILE *overfile; /* Overflow file for toomuch() */ -off_t truncofs; /* Offset this file should be truncated at */ -int doclean; /* Should cleanup() remove output? */ +static long lineno; /* Current line number in input file */ +static long reps; /* Number of repetitions for this pattern */ +static long nfiles; /* Number of files output so far */ +static long maxfiles; /* Maximum number of files we can create */ +static char currfile[PATH_MAX]; /* Current output file */ +static const char *infn; /* Name of the input file */ +static FILE *infile; /* Input file handle */ +static FILE *overfile; /* Overflow file for toomuch() */ +static off_t truncofs; /* Offset this file should be truncated at */ +static int doclean; /* Should cleanup() remove output? */ int main(int argc, char *argv[]) @@ -209,7 +209,7 @@ main(int argc, char *argv[]) return (0); } -void +static void usage(void) { @@ -218,7 +218,7 @@ usage(void) exit(1); } -void +static void handlesig(int sig __unused) { const char msg[] = "csplit: caught signal, cleaning up\n"; @@ -229,7 +229,7 @@ handlesig(int sig __unused) } /* Create a new output file. */ -FILE * +static FILE * newfile(void) { FILE *fp; @@ -245,7 +245,7 @@ newfile(void) } /* Remove partial output, called before exiting. */ -void +static void cleanup(void) { char fnbuf[PATH_MAX]; @@ -269,7 +269,7 @@ cleanup(void) } /* Read a line from the input into a static buffer. */ -char * +static char * getline(void) { static char lbuf[LINE_MAX]; @@ -292,7 +292,7 @@ again: if (fgets(lbuf, sizeof(lbuf), src } /* Conceptually rewind the input (as obtained by getline()) back `n' lines. */ -void +static void toomuch(FILE *ofp, long n) { char buf[BUFSIZ]; @@ -351,7 +351,7 @@ toomuch(FILE *ofp, long n) } /* Handle splits for /regexp/ and %regexp% patterns. */ -void +static void do_rexp(const char *expr) { regex_t cre; @@ -433,7 +433,7 @@ do_rexp(const char *expr) } /* Handle splits based on line number. */ -void +static void do_lineno(const char *expr) { long lastline, tgtline; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C951065D60; Sun, 6 Nov 2011 08:14:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447D78FC08; Sun, 6 Nov 2011 08:14:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EqM0008249; Sun, 6 Nov 2011 08:14:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Eqwu008247; Sun, 6 Nov 2011 08:14:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68Eqwu008247@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227162 - head/usr.bin/cut X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:52 -0000 Author: ed Date: Sun Nov 6 08:14:51 2011 New Revision: 227162 URL: http://svn.freebsd.org/changeset/base/227162 Log: Add missing static keywords to cut(1) Modified: head/usr.bin/cut/cut.c Modified: head/usr.bin/cut/cut.c ============================================================================== --- head/usr.bin/cut/cut.c Sun Nov 6 08:14:45 2011 (r227161) +++ head/usr.bin/cut/cut.c Sun Nov 6 08:14:51 2011 (r227162) @@ -50,25 +50,25 @@ __FBSDID("$FreeBSD$"); #include #include -int bflag; -int cflag; -wchar_t dchar; -char dcharmb[MB_LEN_MAX + 1]; -int dflag; -int fflag; -int nflag; -int sflag; - -size_t autostart, autostop, maxval; -char * positions; - -int b_cut(FILE *, const char *); -int b_n_cut(FILE *, const char *); -int c_cut(FILE *, const char *); -int f_cut(FILE *, const char *); -void get_list(char *); -void needpos(size_t); -static void usage(void); +static int bflag; +static int cflag; +static wchar_t dchar; +static char dcharmb[MB_LEN_MAX + 1]; +static int dflag; +static int fflag; +static int nflag; +static int sflag; + +static size_t autostart, autostop, maxval; +static char * positions; + +static int b_cut(FILE *, const char *); +static int b_n_cut(FILE *, const char *); +static int c_cut(FILE *, const char *); +static int f_cut(FILE *, const char *); +static void get_list(char *); +static void needpos(size_t); +static void usage(void); int main(int argc, char *argv[]) @@ -153,7 +153,7 @@ main(int argc, char *argv[]) exit(rval); } -void +static void get_list(char *list) { size_t setautostart, start, stop; @@ -208,7 +208,7 @@ get_list(char *list) memset(positions + 1, '1', autostart); } -void +static void needpos(size_t n) { static size_t npos; @@ -227,7 +227,7 @@ needpos(size_t n) } } -int +static int b_cut(FILE *fp, const char *fname __unused) { int ch, col; @@ -261,7 +261,7 @@ b_cut(FILE *fp, const char *fname __unus * Although this function also handles the case where -n is not specified, * b_cut() ought to be much faster. */ -int +static int b_n_cut(FILE *fp, const char *fname) { size_t col, i, lbuflen; @@ -323,7 +323,7 @@ b_n_cut(FILE *fp, const char *fname) return (warned); } -int +static int c_cut(FILE *fp, const char *fname) { wint_t ch; @@ -358,7 +358,7 @@ out: return (0); } -int +static int f_cut(FILE *fp, const char *fname) { wchar_t ch; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:14:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1441F1065E32; Sun, 6 Nov 2011 08:14:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02ABE8FC14; Sun, 6 Nov 2011 08:14:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68EvsA008289; Sun, 6 Nov 2011 08:14:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Evj9008287; Sun, 6 Nov 2011 08:14:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060814.pA68Evj9008287@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:14: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: r227163 - head/usr.bin/dc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:14:58 -0000 Author: ed Date: Sun Nov 6 08:14:57 2011 New Revision: 227163 URL: http://svn.freebsd.org/changeset/base/227163 Log: Add missing static keywords to dc(1) Modified: head/usr.bin/dc/dc.c Modified: head/usr.bin/dc/dc.c ============================================================================== --- head/usr.bin/dc/dc.c Sun Nov 6 08:14:51 2011 (r227162) +++ head/usr.bin/dc/dc.c Sun Nov 6 08:14:57 2011 (r227163) @@ -39,9 +39,9 @@ static void usage(void); extern char *__progname; -struct source src; +static struct source src; -struct option long_options[] = +static const struct option long_options[] = { {"expression", required_argument, NULL, 'e'}, {"file", required_argument, NULL, 'f'}, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B25B1065961; Sun, 6 Nov 2011 08:15:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AB328FC13; Sun, 6 Nov 2011 08:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FILn008343; Sun, 6 Nov 2011 08:15:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68FIvC008341; Sun, 6 Nov 2011 08:15:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68FIvC008341@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:18 -0000 Author: ed Date: Sun Nov 6 08:15:17 2011 New Revision: 227164 URL: http://svn.freebsd.org/changeset/base/227164 Log: Add missing static keywords to du(1) Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Sun Nov 6 08:14:57 2011 (r227163) +++ head/usr.bin/du/du.c Sun Nov 6 08:15:17 2011 (r227164) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -SLIST_HEAD(ignhead, ignentry) ignores; +static SLIST_HEAD(ignhead, ignentry) ignores; struct ignentry { char *mask; SLIST_ENTRY(ignentry) next; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 606D01065AA2; Sun, 6 Nov 2011 08:15:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8F38FC20; Sun, 6 Nov 2011 08:15:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FOlx008383; Sun, 6 Nov 2011 08:15:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68FOb5008381; Sun, 6 Nov 2011 08:15:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68FOb5008381@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227165 - head/usr.bin/fold X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:24 -0000 Author: ed Date: Sun Nov 6 08:15:23 2011 New Revision: 227165 URL: http://svn.freebsd.org/changeset/base/227165 Log: Add missing static keywords to fold(1) Modified: head/usr.bin/fold/fold.c Modified: head/usr.bin/fold/fold.c ============================================================================== --- head/usr.bin/fold/fold.c Sun Nov 6 08:15:17 2011 (r227164) +++ head/usr.bin/fold/fold.c Sun Nov 6 08:15:23 2011 (r227165) @@ -61,8 +61,8 @@ void fold(int); static int newpos(int, wint_t); static void usage(void); -int bflag; /* Count bytes, not columns */ -int sflag; /* Split on word boundaries */ +static int bflag; /* Count bytes, not columns */ +static int sflag; /* Split on word boundaries */ int main(int argc, char **argv) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DD11065EC4; Sun, 6 Nov 2011 08:15:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 572178FC0C; Sun, 6 Nov 2011 08:15:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FULR008424; Sun, 6 Nov 2011 08:15:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68FUU2008422; Sun, 6 Nov 2011 08:15:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68FUU2008422@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227166 - head/usr.bin/id X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:30 -0000 Author: ed Date: Sun Nov 6 08:15:30 2011 New Revision: 227166 URL: http://svn.freebsd.org/changeset/base/227166 Log: Add missing static keywords to id(1) Modified: head/usr.bin/id/id.c Modified: head/usr.bin/id/id.c ============================================================================== --- head/usr.bin/id/id.c Sun Nov 6 08:15:23 2011 (r227165) +++ head/usr.bin/id/id.c Sun Nov 6 08:15:30 2011 (r227166) @@ -57,16 +57,16 @@ __FBSDID("$FreeBSD$"); #include #include -void id_print(struct passwd *, int, int, int); -void pline(struct passwd *); -void pretty(struct passwd *); -void auditid(void); -void group(struct passwd *, int); -void maclabel(void); -void usage(void); -struct passwd *who(char *); +static void id_print(struct passwd *, int, int, int); +static void pline(struct passwd *); +static void pretty(struct passwd *); +static void auditid(void); +static void group(struct passwd *, int); +static void maclabel(void); +static void usage(void); +static struct passwd *who(char *); -int isgroups, iswhoami; +static int isgroups, iswhoami; int main(int argc, char *argv[]) @@ -220,7 +220,7 @@ main(int argc, char *argv[]) exit(0); } -void +static void pretty(struct passwd *pw) { struct group *gr; @@ -260,7 +260,7 @@ pretty(struct passwd *pw) } } -void +static void id_print(struct passwd *pw, int use_ggl, int p_euid, int p_egid) { struct group *gr; @@ -324,7 +324,7 @@ id_print(struct passwd *pw, int use_ggl, } #ifdef USE_BSM_AUDIT -void +static void auditid(void) { auditinfo_t auditinfo; @@ -371,7 +371,7 @@ auditid(void) } #endif -void +static void group(struct passwd *pw, int nflag) { struct group *gr; @@ -411,7 +411,7 @@ group(struct passwd *pw, int nflag) free(groups); } -void +static void maclabel(void) { char *string; @@ -435,7 +435,7 @@ maclabel(void) free(string); } -struct passwd * +static struct passwd * who(char *u) { struct passwd *pw; @@ -455,7 +455,7 @@ who(char *u) /* NOTREACHED */ } -void +static void pline(struct passwd *pw) { @@ -471,7 +471,7 @@ pline(struct passwd *pw) } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 846891065BC6; Sun, 6 Nov 2011 08:15:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2947E8FC16; Sun, 6 Nov 2011 08:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FaoF008463; Sun, 6 Nov 2011 08:15:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Faov008461; Sun, 6 Nov 2011 08:15:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68Faov008461@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227167 - head/usr.bin/join X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:36 -0000 Author: ed Date: Sun Nov 6 08:15:35 2011 New Revision: 227167 URL: http://svn.freebsd.org/changeset/base/227167 Log: Add missing static keywords to join(1) Modified: head/usr.bin/join/join.c Modified: head/usr.bin/join/join.c ============================================================================== --- head/usr.bin/join/join.c Sun Nov 6 08:15:30 2011 (r227166) +++ head/usr.bin/join/join.c Sun Nov 6 08:15:35 2011 (r227167) @@ -83,36 +83,36 @@ typedef struct { u_long setcnt; /* set count */ u_long setalloc; /* set allocated count */ } INPUT; -INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 }, - input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 }; +static INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 }, + input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 }; typedef struct { u_long filenum; /* file number */ u_long fieldno; /* field number */ } OLIST; -OLIST *olist; /* output field list */ -u_long olistcnt; /* output field list count */ -u_long olistalloc; /* output field allocated count */ - -int joinout = 1; /* show lines with matched join fields (-v) */ -int needsep; /* need separator character */ -int spans = 1; /* span multiple delimiters (-t) */ -char *empty; /* empty field replacement string (-e) */ +static OLIST *olist; /* output field list */ +static u_long olistcnt; /* output field list count */ +static u_long olistalloc; /* output field allocated count */ + +static int joinout = 1; /* show lines with matched join fields (-v) */ +static int needsep; /* need separator character */ +static int spans = 1; /* span multiple delimiters (-t) */ +static char *empty; /* empty field replacement string (-e) */ static wchar_t default_tabchar[] = L" \t"; -wchar_t *tabchar = default_tabchar;/* delimiter characters (-t) */ +static wchar_t *tabchar = default_tabchar; /* delimiter characters (-t) */ -int cmp(LINE *, u_long, LINE *, u_long); -void fieldarg(char *); -void joinlines(INPUT *, INPUT *); -int mbscoll(const char *, const char *); -char *mbssep(char **, const wchar_t *); -void obsolete(char **); -void outfield(LINE *, u_long, int); -void outoneline(INPUT *, LINE *); -void outtwoline(INPUT *, LINE *, INPUT *, LINE *); -void slurp(INPUT *); -wchar_t *towcs(const char *); -void usage(void); +static int cmp(LINE *, u_long, LINE *, u_long); +static void fieldarg(char *); +static void joinlines(INPUT *, INPUT *); +static int mbscoll(const char *, const char *); +static char *mbssep(char **, const wchar_t *); +static void obsolete(char **); +static void outfield(LINE *, u_long, int); +static void outoneline(INPUT *, LINE *); +static void outtwoline(INPUT *, LINE *, INPUT *, LINE *); +static void slurp(INPUT *); +static wchar_t *towcs(const char *); +static void usage(void); int main(int argc, char *argv[]) @@ -270,7 +270,7 @@ main(int argc, char *argv[]) exit(0); } -void +static void slurp(INPUT *F) { LINE *lp, *lastlp, tmp; @@ -359,7 +359,7 @@ slurp(INPUT *F) } } -char * +static char * mbssep(char **stringp, const wchar_t *delim) { char *s, *tok; @@ -388,7 +388,7 @@ mbssep(char **stringp, const wchar_t *de } } -int +static int cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2) { if (lp1->fieldcnt <= fieldno1) @@ -398,7 +398,7 @@ cmp(LINE *lp1, u_long fieldno1, LINE *lp return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2])); } -int +static int mbscoll(const char *s1, const char *s2) { wchar_t *w1, *w2; @@ -414,7 +414,7 @@ mbscoll(const char *s1, const char *s2) return (ret); } -wchar_t * +static wchar_t * towcs(const char *s) { wchar_t *wcs; @@ -428,7 +428,7 @@ towcs(const char *s) return (wcs); } -void +static void joinlines(INPUT *F1, INPUT *F2) { u_long cnt1, cnt2; @@ -448,7 +448,7 @@ joinlines(INPUT *F1, INPUT *F2) outtwoline(F1, &F1->set[cnt1], F2, &F2->set[cnt2]); } -void +static void outoneline(INPUT *F, LINE *lp) { u_long cnt; @@ -476,7 +476,7 @@ outoneline(INPUT *F, LINE *lp) needsep = 0; } -void +static void outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2) { u_long cnt; @@ -512,7 +512,7 @@ outtwoline(INPUT *F1, LINE *lp1, INPUT * needsep = 0; } -void +static void outfield(LINE *lp, u_long fieldno, int out_empty) { if (needsep++) @@ -535,7 +535,7 @@ outfield(LINE *lp, u_long fieldno, int o * Convert an output list argument "2.1, 1.3, 2.4" into an array of output * fields. */ -void +static void fieldarg(char *option) { u_long fieldno, filenum; @@ -569,7 +569,7 @@ fieldarg(char *option) } } -void +static void obsolete(char **argv) { size_t len; @@ -654,7 +654,7 @@ jbad: errx(1, "illegal option -- %s", } } -void +static void usage(void) { (void)fprintf(stderr, "%s %s\n%s\n", From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A494B1065F61; Sun, 6 Nov 2011 08:15:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4289B8FC18; Sun, 6 Nov 2011 08:15:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FgFw008503; Sun, 6 Nov 2011 08:15:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Fgxt008501; Sun, 6 Nov 2011 08:15:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68Fgxt008501@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227168 - head/usr.bin/last X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:42 -0000 Author: ed Date: Sun Nov 6 08:15:41 2011 New Revision: 227168 URL: http://svn.freebsd.org/changeset/base/227168 Log: Add missing static keywords to last(1) Modified: head/usr.bin/last/last.c Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Sun Nov 6 08:15:35 2011 (r227167) +++ head/usr.bin/last/last.c Sun Nov 6 08:15:41 2011 (r227168) @@ -70,9 +70,9 @@ typedef struct arg { int type; /* type of arg */ struct arg *next; /* linked list pointer */ } ARG; -ARG *arglist; /* head of linked list */ +static ARG *arglist; /* head of linked list */ -LIST_HEAD(idlisthead, idtab) idlist; +static LIST_HEAD(idlisthead, idtab) idlist; struct idtab { time_t logout; /* log out time */ @@ -94,17 +94,17 @@ static time_t snaptime; /* if != 0, we * at this snapshot time */ -void addarg(int, char *); -time_t dateconv(char *); -void doentry(struct utmpx *); -void hostconv(char *); -void printentry(struct utmpx *, struct idtab *); -char *ttyconv(char *); -int want(struct utmpx *); -void usage(void); -void wtmp(void); +static void addarg(int, char *); +static time_t dateconv(char *); +static void doentry(struct utmpx *); +static void hostconv(char *); +static void printentry(struct utmpx *, struct idtab *); +static char *ttyconv(char *); +static int want(struct utmpx *); +static void usage(void); +static void wtmp(void); -void +static void usage(void) { (void)fprintf(stderr, @@ -196,7 +196,7 @@ main(int argc, char *argv[]) * wtmp -- * read through the wtmp file */ -void +static void wtmp(void) { struct utmpx *buf = NULL; @@ -237,7 +237,7 @@ wtmp(void) * doentry -- * process a single wtmp entry */ -void +static void doentry(struct utmpx *bp) { struct idtab *tt, *ttx; /* idlist entry */ @@ -313,7 +313,7 @@ doentry(struct utmpx *bp) * If `tt' is non-NULL, use it and `crmsg' to print the logout time or * logout type (crash/shutdown) as appropriate. */ -void +static void printentry(struct utmpx *bp, struct idtab *tt) { char ct[80]; @@ -378,7 +378,7 @@ printentry(struct utmpx *bp, struct idta * want -- * see if want this entry */ -int +static int want(struct utmpx *bp) { ARG *step; @@ -411,7 +411,7 @@ want(struct utmpx *bp) * addarg -- * add an entry to a linked list of arguments */ -void +static void addarg(int type, char *arg) { ARG *cur; @@ -430,7 +430,7 @@ addarg(int type, char *arg) * has a domain attached that is the same as the current domain, rip * off the domain suffix since that's what login(1) does. */ -void +static void hostconv(char *arg) { static int first = 1; @@ -453,7 +453,7 @@ hostconv(char *arg) * ttyconv -- * convert tty to correct name. */ -char * +static char * ttyconv(char *arg) { char *mval; @@ -485,7 +485,7 @@ ttyconv(char *arg) * [[CC]YY]MMDDhhmm[.SS]] to a time_t. * Derived from atime_arg1() in usr.bin/touch/touch.c */ -time_t +static time_t dateconv(char *arg) { time_t timet; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D391066035; Sun, 6 Nov 2011 08:15:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 796508FC20; Sun, 6 Nov 2011 08:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Fm5W008542; Sun, 6 Nov 2011 08:15:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Fm4s008540; Sun, 6 Nov 2011 08:15:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68Fm4s008540@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227169 - head/usr.bin/lock X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:49 -0000 Author: ed Date: Sun Nov 6 08:15:48 2011 New Revision: 227169 URL: http://svn.freebsd.org/changeset/base/227169 Log: Add missing static keywords to lock(1) Modified: head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Sun Nov 6 08:15:41 2011 (r227168) +++ head/usr.bin/lock/lock.c Sun Nov 6 08:15:48 2011 (r227169) @@ -72,17 +72,17 @@ __FBSDID("$FreeBSD$"); #define TIMEOUT 15 -void quit(int); -void bye(int); -void hi(int); +static void quit(int); +static void bye(int); +static void hi(int); static void usage(void); -struct timeval timeout; -struct timeval zerotime; -struct termios tty, ntty; -long nexttime; /* keep the timeout time */ -int no_timeout; /* lock terminal forever */ -int vtyunlock; /* Unlock flag and code. */ +static struct timeval timeout; +static struct timeval zerotime; +static struct termios tty, ntty; +static long nexttime; /* keep the timeout time */ +static int no_timeout; /* lock terminal forever */ +static int vtyunlock; /* Unlock flag and code. */ /*ARGSUSED*/ int @@ -252,7 +252,7 @@ usage(void) exit(1); } -void +static void hi(int signo __unused) { struct timeval timval; @@ -269,7 +269,7 @@ hi(int signo __unused) } } -void +static void quit(int signo __unused) { (void)putchar('\n'); @@ -279,7 +279,7 @@ quit(int signo __unused) exit(0); } -void +static void bye(int signo __unused) { if (!no_timeout) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:15:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A6251066053; Sun, 6 Nov 2011 08:15:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09EA48FC15; Sun, 6 Nov 2011 08:15:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68FrGD008585; Sun, 6 Nov 2011 08:15:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Fr2g008583; Sun, 6 Nov 2011 08:15:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060815.pA68Fr2g008583@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:15: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: r227170 - head/usr.bin/logger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:15:54 -0000 Author: ed Date: Sun Nov 6 08:15:53 2011 New Revision: 227170 URL: http://svn.freebsd.org/changeset/base/227170 Log: Add missing static keywords to logger(1) Modified: head/usr.bin/logger/logger.c Modified: head/usr.bin/logger/logger.c ============================================================================== --- head/usr.bin/logger/logger.c Sun Nov 6 08:15:48 2011 (r227169) +++ head/usr.bin/logger/logger.c Sun Nov 6 08:15:53 2011 (r227170) @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); #define SYSLOG_NAMES #include -int decode(char *, CODE *); -int pencode(char *); +static int decode(char *, CODE *); +static int pencode(char *); static void logmessage(int, const char *, const char *, const char *, const char *); static void usage(void); @@ -70,11 +70,11 @@ struct socks { }; #ifdef INET6 -int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ +static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */ #else -int family = PF_INET; /* protocol family (IPv4 only) */ +static int family = PF_INET; /* protocol family (IPv4 only) */ #endif -int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ +static int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ /* * logger -- read and log utility @@ -176,7 +176,7 @@ main(int argc, char *argv[]) /* * Send the message to syslog, either on the local host, or on a remote host */ -void +static void logmessage(int pri, const char *tag, const char *host, const char *svcname, const char *buf) { @@ -246,7 +246,7 @@ logmessage(int pri, const char *tag, con /* * Decode a symbolic name to a numeric value */ -int +static int pencode(char *s) { char *save; @@ -270,7 +270,7 @@ pencode(char *s) return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); } -int +static int decode(char *name, CODE *codetab) { CODE *c; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA89E106625B; Sun, 6 Nov 2011 08:16:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3998FC15; Sun, 6 Nov 2011 08:16:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68G0gE008626; Sun, 6 Nov 2011 08:16:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68G0lE008624; Sun, 6 Nov 2011 08:16:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68G0lE008624@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227171 - head/usr.bin/look X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:00 -0000 Author: ed Date: Sun Nov 6 08:15:59 2011 New Revision: 227171 URL: http://svn.freebsd.org/changeset/base/227171 Log: Add missing static keywords to look(1) Modified: head/usr.bin/look/look.c Modified: head/usr.bin/look/look.c ============================================================================== --- head/usr.bin/look/look.c Sun Nov 6 08:15:53 2011 (r227170) +++ head/usr.bin/look/look.c Sun Nov 6 08:15:59 2011 (r227171) @@ -77,14 +77,14 @@ static char _path_words[] = _PATH_WORDS; #define GREATER 1 #define LESS (-1) -int dflag, fflag; +static int dflag, fflag; -char *binary_search(wchar_t *, unsigned char *, unsigned char *); -int compare(wchar_t *, unsigned char *, unsigned char *); -char *linear_search(wchar_t *, unsigned char *, unsigned char *); -int look(wchar_t *, unsigned char *, unsigned char *); -wchar_t *prepkey(const char *, wchar_t); -void print_from(wchar_t *, unsigned char *, unsigned char *); +static char *binary_search(wchar_t *, unsigned char *, unsigned char *); +static int compare(wchar_t *, unsigned char *, unsigned char *); +static char *linear_search(wchar_t *, unsigned char *, unsigned char *); +static int look(wchar_t *, unsigned char *, unsigned char *); +static wchar_t *prepkey(const char *, wchar_t); +static void print_from(wchar_t *, unsigned char *, unsigned char *); static void usage(void); @@ -151,7 +151,7 @@ main(int argc, char *argv[]) exit(match); } -wchar_t * +static wchar_t * prepkey(const char *string, wchar_t termchar) { const char *readp; @@ -182,7 +182,7 @@ prepkey(const char *string, wchar_t term return (key); } -int +static int look(wchar_t *string, unsigned char *front, unsigned char *back) { @@ -236,7 +236,7 @@ look(wchar_t *string, unsigned char *fro #define SKIP_PAST_NEWLINE(p, back) \ while (p < back && *p++ != '\n'); -char * +static char * binary_search(wchar_t *string, unsigned char *front, unsigned char *back) { unsigned char *p; @@ -270,7 +270,7 @@ binary_search(wchar_t *string, unsigned * o front points at the first character in a line. * o front is before or at the first line to be printed. */ -char * +static char * linear_search(wchar_t *string, unsigned char *front, unsigned char *back) { while (front < back) { @@ -290,7 +290,7 @@ linear_search(wchar_t *string, unsigned /* * Print as many lines as match string, starting at front. */ -void +static void print_from(wchar_t *string, unsigned char *front, unsigned char *back) { for (; front < back && compare(string, front, back) == EQUAL; ++front) { @@ -315,7 +315,7 @@ print_from(wchar_t *string, unsigned cha * The string "s1" is null terminated. The string s2 is '\n' terminated (or * "back" terminated). */ -int +static int compare(wchar_t *s1, unsigned char *s2, unsigned char *back) { wchar_t ch1, ch2; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFF1F1065834; Sun, 6 Nov 2011 08:16:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5C798FC1C; Sun, 6 Nov 2011 08:16:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68G6kX008669; Sun, 6 Nov 2011 08:16:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68G69P008667; Sun, 6 Nov 2011 08:16:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68G69P008667@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227172 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:06 -0000 Author: ed Date: Sun Nov 6 08:16:06 2011 New Revision: 227172 URL: http://svn.freebsd.org/changeset/base/227172 Log: Add missing static keywords to make(1) Modified: head/usr.bin/make/globals.h Modified: head/usr.bin/make/globals.h ============================================================================== --- head/usr.bin/make/globals.h Sun Nov 6 08:15:59 2011 (r227171) +++ head/usr.bin/make/globals.h Sun Nov 6 08:16:06 2011 (r227172) @@ -75,6 +75,7 @@ extern Boolean beSilent; /* True if shou extern Boolean beVerbose; /* True if should print extra cruft */ extern Boolean beQuiet; /* True if want quiet headers with -j */ extern Boolean noExecute; /* True if should execute nothing */ +extern Boolean printGraphOnly; /* -p flag */ extern Boolean allPrecious; /* True if every target is precious */ extern Boolean is_posix; /* .POSIX target seen */ extern Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36F611065D87; Sun, 6 Nov 2011 08:16:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2526A8FC1E; Sun, 6 Nov 2011 08:16:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GCdv008708; Sun, 6 Nov 2011 08:16:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GCle008706; Sun, 6 Nov 2011 08:16:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GCle008706@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227173 - head/usr.bin/ministat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:12 -0000 Author: ed Date: Sun Nov 6 08:16:11 2011 New Revision: 227173 URL: http://svn.freebsd.org/changeset/base/227173 Log: Add missing static keywords to ministat(1) Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Sun Nov 6 08:16:06 2011 (r227172) +++ head/usr.bin/ministat/ministat.c Sun Nov 6 08:16:11 2011 (r227173) @@ -23,8 +23,8 @@ __FBSDID("$FreeBSD$"); #define NSTUDENT 100 #define NCONF 6 -double const studentpct[] = { 80, 90, 95, 98, 99, 99.5 }; -double student [NSTUDENT + 1][NCONF] = { +static double const studentpct[] = { 80, 90, 95, 98, 99, 99.5 }; +static double student[NSTUDENT + 1][NCONF] = { /* inf */ { 1.282, 1.645, 1.960, 2.326, 2.576, 3.090 }, /* 1. */ { 3.078, 6.314, 12.706, 31.821, 63.657, 318.313 }, /* 2. */ { 1.886, 2.920, 4.303, 6.965, 9.925, 22.327 }, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821DC106627E; Sun, 6 Nov 2011 08:16:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6726B8FC1D; Sun, 6 Nov 2011 08:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GItv008747; Sun, 6 Nov 2011 08:16:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GIZi008745; Sun, 6 Nov 2011 08:16:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GIZi008745@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227174 - head/usr.bin/mt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:18 -0000 Author: ed Date: Sun Nov 6 08:16:18 2011 New Revision: 227174 URL: http://svn.freebsd.org/changeset/base/227174 Log: Add missing static keywords to mt(1) Modified: head/usr.bin/mt/mt.c Modified: head/usr.bin/mt/mt.c ============================================================================== --- head/usr.bin/mt/mt.c Sun Nov 6 08:16:11 2011 (r227173) +++ head/usr.bin/mt/mt.c Sun Nov 6 08:16:18 2011 (r227174) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #define FALSE 0 #endif -struct commands { +static const struct commands { const char *c_name; int c_code; int c_ronly; @@ -114,22 +114,22 @@ struct commands { { NULL, 0, 0, 0 } }; -const char *getblksiz(int); -void printreg(const char *, u_int, const char *); -void status(struct mtget *); -void usage(void); -void st_status (struct mtget *); -int stringtodens (const char *s); -const char *denstostring (int d); -int denstobp(int d, int bpi); -u_int32_t stringtocomp(const char *s); -const char *comptostring(u_int32_t comp); -void warn_eof(void); +static const char *getblksiz(int); +static void printreg(const char *, u_int, const char *); +static void status(struct mtget *); +static void usage(void); +static void st_status(struct mtget *); +static int stringtodens(const char *s); +static const char *denstostring(int d); +static int denstobp(int d, int bpi); +static u_int32_t stringtocomp(const char *s); +static const char *comptostring(u_int32_t comp); +static void warn_eof(void); int main(int argc, char *argv[]) { - struct commands *comp; + const struct commands *comp; struct mtget mt_status; struct mtop mt_com; int ch, len, mtfd; @@ -303,7 +303,7 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -struct tape_desc { +static const struct tape_desc { short t_type; /* type of magtape device */ const char *t_name; /* printing name */ const char *t_dsbits; /* "drive status" register */ @@ -316,10 +316,10 @@ struct tape_desc { /* * Interpret the status buffer returned */ -void +static void status(struct mtget *bp) { - struct tape_desc *mt; + const struct tape_desc *mt; for (mt = tapes;; mt++) { if (mt->t_type == 0) { @@ -344,7 +344,7 @@ status(struct mtget *bp) /* * Print a register a la the %b format of the kernel's printf. */ -void +static void printreg(const char *s, u_int v, const char *bits) { int i, any = 0; @@ -374,14 +374,14 @@ printreg(const char *s, u_int v, const c } } -void +static void usage(void) { (void)fprintf(stderr, "usage: mt [-f device] command [count]\n"); exit(1); } -struct densities { +static const struct densities { int dens; int bpmm; int bpi; @@ -437,7 +437,7 @@ struct densities { { 0, 0, 0, NULL } }; -struct compression_types { +static const struct compression_types { u_int32_t comp_number; const char *name; } comp_types[] = { @@ -450,11 +450,11 @@ struct compression_types { { 0xf0f0f0f0, NULL} }; -const char * +static const char * denstostring(int d) { static char buf[20]; - struct densities *sd; + const struct densities *sd; /* densities 0 and 0x7f are handled as special cases */ if (d == 0) @@ -475,10 +475,10 @@ denstostring(int d) * Given a specific density number, return either the bits per inch or bits * per millimeter for the given density. */ -int +static int denstobp(int d, int bpi) { - struct densities *sd; + const struct densities *sd; for (sd = dens; sd->dens; sd++) if (sd->dens == d) @@ -493,10 +493,10 @@ denstobp(int d, int bpi) } } -int +static int stringtodens(const char *s) { - struct densities *sd; + const struct densities *sd; size_t l = strlen(s); for (sd = dens; sd->dens; sd++) @@ -506,7 +506,7 @@ stringtodens(const char *s) } -const char * +static const char * getblksiz(int bs) { static char buf[25]; @@ -518,11 +518,11 @@ getblksiz(int bs) } } -const char * +static const char * comptostring(u_int32_t comp) { static char buf[20]; - struct compression_types *ct; + const struct compression_types *ct; if (comp == MT_COMP_DISABLED) return "disabled"; @@ -540,10 +540,10 @@ comptostring(u_int32_t comp) return(ct->name); } -u_int32_t +static u_int32_t stringtocomp(const char *s) { - struct compression_types *ct; + const struct compression_types *ct; size_t l = strlen(s); for (ct = comp_types; ct->name; ct++) @@ -553,7 +553,7 @@ stringtocomp(const char *s) return(ct->comp_number); } -void +static void st_status(struct mtget *bp) { printf("Mode Density Blocksize bpi " @@ -634,7 +634,7 @@ st_status(struct mtget *bp) bp->mt_fileno, bp->mt_blkno, bp->mt_resid); } -void +static void warn_eof(void) { fprintf(stderr, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD1810659F8; Sun, 6 Nov 2011 08:16:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EAEC8FC1D; Sun, 6 Nov 2011 08:16:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GOle008790; Sun, 6 Nov 2011 08:16:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GOwY008787; Sun, 6 Nov 2011 08:16:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GOwY008787@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227175 - head/usr.bin/pr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:25 -0000 Author: ed Date: Sun Nov 6 08:16:24 2011 New Revision: 227175 URL: http://svn.freebsd.org/changeset/base/227175 Log: Add missing static keywords to pr(1) Modified: head/usr.bin/pr/extern.h head/usr.bin/pr/pr.c Modified: head/usr.bin/pr/extern.h ============================================================================== --- head/usr.bin/pr/extern.h Sun Nov 6 08:16:18 2011 (r227174) +++ head/usr.bin/pr/extern.h Sun Nov 6 08:16:24 2011 (r227175) @@ -38,7 +38,9 @@ * $FreeBSD$ */ +extern int eopterr; extern int eoptind; +extern int eoptopt; extern char *eoptarg; void addnum(char *, int, int); Modified: head/usr.bin/pr/pr.c ============================================================================== --- head/usr.bin/pr/pr.c Sun Nov 6 08:16:18 2011 (r227174) +++ head/usr.bin/pr/pr.c Sun Nov 6 08:16:24 2011 (r227175) @@ -80,40 +80,40 @@ __FBSDID("$FreeBSD$"); /* * parameter variables */ -int pgnm; /* starting page number */ -int clcnt; /* number of columns */ -int colwd; /* column data width - multiple columns */ -int across; /* mult col flag; write across page */ -int dspace; /* double space flag */ -char inchar; /* expand input char */ -int ingap; /* expand input gap */ -int pausefst; /* Pause before first page */ -int pauseall; /* Pause before each page */ -int formfeed; /* use formfeed as trailer */ -char *header; /* header name instead of file name */ -char ochar; /* contract output char */ -int ogap; /* contract output gap */ -int lines; /* number of lines per page */ -int merge; /* merge multiple files in output */ -char nmchar; /* line numbering append char */ -int nmwd; /* width of line number field */ -int offst; /* number of page offset spaces */ -int nodiag; /* do not report file open errors */ -char schar; /* text column separation character */ -int sflag; /* -s option for multiple columns */ -int nohead; /* do not write head and trailer */ -int pgwd; /* page width with multiple col output */ -const char *timefrmt; /* time conversion string */ +static int pgnm; /* starting page number */ +static int clcnt; /* number of columns */ +static int colwd; /* column data width - multiple columns */ +static int across; /* mult col flag; write across page */ +static int dspace; /* double space flag */ +static char inchar; /* expand input char */ +static int ingap; /* expand input gap */ +static int pausefst; /* Pause before first page */ +static int pauseall; /* Pause before each page */ +static int formfeed; /* use formfeed as trailer */ +static char *header; /* header name instead of file name */ +static char ochar; /* contract output char */ +static int ogap; /* contract output gap */ +static int lines; /* number of lines per page */ +static int merge; /* merge multiple files in output */ +static char nmchar; /* line numbering append char */ +static int nmwd; /* width of line number field */ +static int offst; /* number of page offset spaces */ +static int nodiag; /* do not report file open errors */ +static char schar; /* text column separation character */ +static int sflag; /* -s option for multiple columns */ +static int nohead; /* do not write head and trailer */ +static int pgwd; /* page width with multiple col output */ +static const char *timefrmt; /* time conversion string */ /* * misc globals */ -FILE *err; /* error message file pointer */ -int addone; /* page length is odd with double space */ -int errcnt; /* error count on file processing */ -char digs[] = "0123456789"; /* page number translation map */ +static FILE *err; /* error message file pointer */ +static int addone; /* page length is odd with double space */ +static int errcnt; /* error count on file processing */ +static char digs[] = "0123456789"; /* page number translation map */ -char fnamedefault[] = FNAME; +static char fnamedefault[] = FNAME; int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56DF41065A06; Sun, 6 Nov 2011 08:16:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4687B8FC28; Sun, 6 Nov 2011 08:16:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GTbo008830; Sun, 6 Nov 2011 08:16:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GT9Q008828; Sun, 6 Nov 2011 08:16:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GT9Q008828@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227176 - head/usr.bin/quota X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:30 -0000 Author: ed Date: Sun Nov 6 08:16:29 2011 New Revision: 227176 URL: http://svn.freebsd.org/changeset/base/227176 Log: Add missing static keywords to quota(1) Modified: head/usr.bin/quota/quota.c Modified: head/usr.bin/quota/quota.c ============================================================================== --- head/usr.bin/quota/quota.c Sun Nov 6 08:16:24 2011 (r227175) +++ head/usr.bin/quota/quota.c Sun Nov 6 08:16:29 2011 (r227176) @@ -73,8 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include -const char *qfname = QUOTAFILENAME; -const char *qfextension[] = INITQFNAMES; +static const char *qfextension[] = INITQFNAMES; struct quotause { struct quotause *next; @@ -101,12 +100,12 @@ static int callaurpc(char *host, int pro xdrproc_t inproc, char *in, xdrproc_t outproc, char *out); static int alldigits(char *s); -int hflag; -int lflag; -int rflag; -int qflag; -int vflag; -char *filename = NULL; +static int hflag; +static int lflag; +static int rflag; +static int qflag; +static int vflag; +static char *filename = NULL; int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8520A10664F4; Sun, 6 Nov 2011 08:16:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDAF8FC24; Sun, 6 Nov 2011 08:16:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GapU008870; Sun, 6 Nov 2011 08:16:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Ga7d008868; Sun, 6 Nov 2011 08:16:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68Ga7d008868@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227177 - head/usr.bin/rs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:37 -0000 Author: ed Date: Sun Nov 6 08:16:35 2011 New Revision: 227177 URL: http://svn.freebsd.org/changeset/base/227177 Log: Add missing static keywords to rs(1) Modified: head/usr.bin/rs/rs.c Modified: head/usr.bin/rs/rs.c ============================================================================== --- head/usr.bin/rs/rs.c Sun Nov 6 08:16:29 2011 (r227176) +++ head/usr.bin/rs/rs.c Sun Nov 6 08:16:35 2011 (r227177) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -long flags; +static long flags; #define TRANSPOSE 000001 #define MTRANSPOSE 000002 #define ONEPERLINE 000004 @@ -72,34 +72,34 @@ long flags; #define ONEPERCHAR 0100000 #define NOARGS 0200000 -short *colwidths; -short *cord; -short *icbd; -short *ocbd; -int nelem; -char **elem; -char **endelem; -char *curline; -int allocsize = BUFSIZ; -int curlen; -int irows, icols; -int orows = 0, ocols = 0; -int maxlen; -int skip; -int propgutter; -char isep = ' ', osep = ' '; -char blank[] = ""; -int owidth = 80, gutter = 2; - -void getargs(int, char *[]); -void getfile(void); -int getline(void); -char *getlist(short **, char *); -char *getnum(int *, char *, int); -char **getptrs(char **); -void prepfile(void); -void prints(char *, int); -void putfile(void); +static short *colwidths; +static short *cord; +static short *icbd; +static short *ocbd; +static int nelem; +static char **elem; +static char **endelem; +static char *curline; +static int allocsize = BUFSIZ; +static int curlen; +static int irows, icols; +static int orows = 0, ocols = 0; +static int maxlen; +static int skip; +static int propgutter; +static char isep = ' ', osep = ' '; +static char blank[] = ""; +static int owidth = 80, gutter = 2; + +static void getargs(int, char *[]); +static void getfile(void); +static int getline(void); +static char *getlist(short **, char *); +static char *getnum(int *, char *, int); +static char **getptrs(char **); +static void prepfile(void); +static void prints(char *, int); +static void putfile(void); static void usage(void); #define INCR(ep) do { \ @@ -121,7 +121,7 @@ main(int argc, char *argv[]) exit(0); } -void +static void getfile(void) { char *p; @@ -189,7 +189,7 @@ getfile(void) nelem = ep - elem; } -void +static void putfile(void) { char **ep; @@ -211,7 +211,7 @@ putfile(void) } } -void +static void prints(char *s, int col) { int n; @@ -237,7 +237,7 @@ usage(void) exit(1); } -void +static void prepfile(void) { char **ep; @@ -330,9 +330,9 @@ prepfile(void) } #define BSIZE (LINE_MAX * 2) -char ibuf[BSIZE]; +static char ibuf[BSIZE]; -int +static int getline(void) /* get line; maintain curline, curlen; manage storage */ { static int putlength; @@ -372,7 +372,7 @@ getline(void) /* get line; maintain curl return(c); } -char ** +static char ** getptrs(char **sp) { char **p; @@ -387,7 +387,7 @@ getptrs(char **sp) return(sp); } -void +static void getargs(int ac, char *av[]) { char *p; @@ -498,7 +498,7 @@ getargs(int ac, char *av[]) } } -char * +static char * getlist(short **list, char *p) { int count = 1; @@ -534,7 +534,7 @@ getlist(short **list, char *p) * num = number p points to; if (strict) complain * returns pointer to end of num */ -char * +static char * getnum(int *num, char *p, int strict) { char *t = p; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 376521066545; Sun, 6 Nov 2011 08:16:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2E78FC1C; Sun, 6 Nov 2011 08:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GffT008908; Sun, 6 Nov 2011 08:16:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GfbF008906; Sun, 6 Nov 2011 08:16:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GfbF008906@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227178 - head/usr.bin/ruptime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:42 -0000 Author: ed Date: Sun Nov 6 08:16:41 2011 New Revision: 227178 URL: http://svn.freebsd.org/changeset/base/227178 Log: Add missing static keywords to ruptime(1) Modified: head/usr.bin/ruptime/ruptime.c Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Sun Nov 6 08:16:35 2011 (r227177) +++ head/usr.bin/ruptime/ruptime.c Sun Nov 6 08:16:41 2011 (r227178) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct hs { +static struct hs { struct whod hs_wd; int hs_nusers; } *hs; @@ -62,19 +62,18 @@ struct hs { #define ISDOWN(h) (now - (h)->hs_wd.wd_recvtime > 11 * 60) #define WHDRSIZE __offsetof(struct whod, wd_we) -size_t nhosts; -time_t now; -int rflg = 1; -DIR *dirp; - -int hscmp(const void *, const void *); -char *interval(time_t, const char *); -int lcmp(const void *, const void *); -void morehosts(void); -void ruptime(const char *, int, int (*)(const void *, const void *)); -int tcmp(const void *, const void *); -int ucmp(const void *, const void *); -void usage(void); +static size_t nhosts; +static time_t now; +static int rflg = 1; +static DIR *dirp; + +static int hscmp(const void *, const void *); +static char *interval(time_t, const char *); +static int lcmp(const void *, const void *); +static void ruptime(const char *, int, int (*)(const void *, const void *)); +static int tcmp(const void *, const void *); +static int ucmp(const void *, const void *); +static void usage(void); int main(int argc, char *argv[]) @@ -119,7 +118,7 @@ main(int argc, char *argv[]) exit(0); } -char * +static char * interval(time_t tval, const char *updown) { static char resbuf[32]; @@ -147,7 +146,7 @@ interval(time_t tval, const char *updown #define HS(a) ((const struct hs *)(a)) /* Alphabetical comparison. */ -int +static int hscmp(const void *a1, const void *a2) { return (rflg * @@ -155,7 +154,7 @@ hscmp(const void *a1, const void *a2) } /* Load average comparison. */ -int +static int lcmp(const void *a1, const void *a2) { if (ISDOWN(HS(a1))) @@ -170,7 +169,7 @@ lcmp(const void *a1, const void *a2) (HS(a2)->hs_wd.wd_loadav[0] - HS(a1)->hs_wd.wd_loadav[0])); } -void +static void ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *)) { struct hs *hsp; @@ -261,7 +260,7 @@ ruptime(const char *host, int aflg, int } /* Number of users comparison. */ -int +static int ucmp(const void *a1, const void *a2) { if (ISDOWN(HS(a1))) @@ -276,7 +275,7 @@ ucmp(const void *a1, const void *a2) } /* Uptime comparison. */ -int +static int tcmp(const void *a1, const void *a2) { return (rflg * ( @@ -288,7 +287,7 @@ tcmp(const void *a1, const void *a2) )); } -void +static void usage(void) { (void)fprintf(stderr, "usage: ruptime [-alrtu] [host ...]\n"); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BD3B1065745; Sun, 6 Nov 2011 08:16:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B99D8FC18; Sun, 6 Nov 2011 08:16:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GlMw008947; Sun, 6 Nov 2011 08:16:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GlPX008945; Sun, 6 Nov 2011 08:16:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GlPX008945@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227179 - head/usr.bin/rusers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:48 -0000 Author: ed Date: Sun Nov 6 08:16:47 2011 New Revision: 227179 URL: http://svn.freebsd.org/changeset/base/227179 Log: Add missing static keywords to rusers(1) Modified: head/usr.bin/rusers/rusers.c Modified: head/usr.bin/rusers/rusers.c ============================================================================== --- head/usr.bin/rusers/rusers.c Sun Nov 6 08:16:41 2011 (r227178) +++ head/usr.bin/rusers/rusers.c Sun Nov 6 08:16:47 2011 (r227179) @@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$"); #define HOST_WIDTH 20 #define LINE_WIDTH 15 -int longopt; -int allopt; +static int longopt; +static int allopt; -struct host_list { +static struct host_list { struct host_list *next; struct in_addr addr; } *hosts; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796A91065A66; Sun, 6 Nov 2011 08:16:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E71F8FC1C; Sun, 6 Nov 2011 08:16:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Gsbu008988; Sun, 6 Nov 2011 08:16:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GsCo008986; Sun, 6 Nov 2011 08:16:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GsCo008986@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227180 - head/usr.bin/rwall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:54 -0000 Author: ed Date: Sun Nov 6 08:16:53 2011 New Revision: 227180 URL: http://svn.freebsd.org/changeset/base/227180 Log: Add missing static keywords to rwall(1) Modified: head/usr.bin/rwall/rwall.c Modified: head/usr.bin/rwall/rwall.c ============================================================================== --- head/usr.bin/rwall/rwall.c Sun Nov 6 08:16:47 2011 (r227179) +++ head/usr.bin/rwall/rwall.c Sun Nov 6 08:16:53 2011 (r227180) @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); #include #include -char *mbuf; +static char *mbuf; static char notty[] = "no tty"; -void makemsg(const char *); +static void makemsg(const char *); static void usage(void); /* ARGSUSED */ @@ -121,7 +121,7 @@ usage(void) exit(1); } -void +static void makemsg(const char *fname) { struct tm *lt; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8402A1065BC5; Sun, 6 Nov 2011 08:17:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14CFB8FC20; Sun, 6 Nov 2011 08:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68GxX7009028; Sun, 6 Nov 2011 08:16:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GxTF009026; Sun, 6 Nov 2011 08:16:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GxTF009026@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16: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: r227181 - head/usr.bin/rwho X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:00 -0000 Author: ed Date: Sun Nov 6 08:16:59 2011 New Revision: 227181 URL: http://svn.freebsd.org/changeset/base/227181 Log: Add missing static keywords to rwho(1) Modified: head/usr.bin/rwho/rwho.c Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Sun Nov 6 08:16:53 2011 (r227180) +++ head/usr.bin/rwho/rwho.c Sun Nov 6 08:16:59 2011 (r227181) @@ -58,16 +58,16 @@ __FBSDID("$FreeBSD$"); #include #include -DIR *dirp; +static DIR *dirp; -struct whod wd; +static struct whod wd; #define NUSERS 1000 -struct myutmp { +static struct myutmp { char myhost[sizeof(wd.wd_hostname)]; int myidle; struct outmp myutmp; } myutmp[NUSERS]; -int nusers; +static int nusers; #define WHDRSIZE (ssize_t)(sizeof (wd) - sizeof (wd.wd_we)) /* @@ -75,11 +75,11 @@ int nusers; */ #define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) -time_t now; -int aflg; +static time_t now; +static int aflg; static void usage(void); -int utmpcmp(const void *, const void *); +static int utmpcmp(const void *, const void *); int main(int argc, char *argv[]) @@ -202,7 +202,7 @@ usage(void) #define MYUTMP(a) ((const struct myutmp *)(a)) -int +static int utmpcmp(const void *u1, const void *u2) { int rc; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9340B1066768; Sun, 6 Nov 2011 08:17:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CC4C8FC0C; Sun, 6 Nov 2011 08:17:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68H64V009070; Sun, 6 Nov 2011 08:17:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68H6LH009068; Sun, 6 Nov 2011 08:17:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68H6LH009068@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227182 - head/usr.bin/seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:06 -0000 Author: ed Date: Sun Nov 6 08:17:05 2011 New Revision: 227182 URL: http://svn.freebsd.org/changeset/base/227182 Log: Add missing static keywords to seq(1) Modified: head/usr.bin/seq/seq.c Modified: head/usr.bin/seq/seq.c ============================================================================== --- head/usr.bin/seq/seq.c Sun Nov 6 08:16:59 2011 (r227181) +++ head/usr.bin/seq/seq.c Sun Nov 6 08:17:05 2011 (r227182) @@ -51,20 +51,19 @@ __FBSDID("$FreeBSD$"); /* Globals */ -const char *decimal_point = "."; /* default */ -char default_format[] = { "%g" }; /* default */ +static const char *decimal_point = "."; /* default */ +static char default_format[] = { "%g" }; /* default */ /* Prototypes */ -double e_atof(const char *); +static double e_atof(const char *); -int decimal_places(const char *); -int main(int, char *[]); -int numeric(const char *); -int valid_format(const char *); +static int decimal_places(const char *); +static int numeric(const char *); +static int valid_format(const char *); -char *generate_format(double, double, double, int, char); -char *unescape(char *); +static char *generate_format(double, double, double, int, char); +static char *unescape(char *); /* * The seq command will print out a numeric sequence from 1, the default, @@ -186,7 +185,7 @@ main(int argc, char *argv[]) /* * numeric - verify that string is numeric */ -int +static int numeric(const char *s) { int seen_decimal_pt, decimal_pt_len; @@ -223,7 +222,7 @@ numeric(const char *s) /* * valid_format - validate user specified format string */ -int +static int valid_format(const char *fmt) { int conversions = 0; @@ -268,7 +267,7 @@ valid_format(const char *fmt) /* * unescape - handle C escapes in a string */ -char * +static char * unescape(char *orig) { char c, *cp, *new = orig; @@ -358,7 +357,7 @@ unescape(char *orig) * exit if string is not a valid double, or if converted value would * cause overflow or underflow */ -double +static double e_atof(const char *num) { char *endp; @@ -383,7 +382,7 @@ e_atof(const char *num) /* * decimal_places - count decimal places in a number (string) */ -int +static int decimal_places(const char *number) { int places = 0; @@ -405,7 +404,7 @@ decimal_places(const char *number) * XXX to be bug for bug compatible with Plan9 and GNU return "%g" * when "%g" prints as "%e" (this way no width adjustments are made) */ -char * +static char * generate_format(double first, double incr, double last, int equalize, char pad) { static char buf[256]; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8763210667FF; Sun, 6 Nov 2011 08:17:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 319DC8FC08; Sun, 6 Nov 2011 08:17:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HC1f009112; Sun, 6 Nov 2011 08:17:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HC2f009110; Sun, 6 Nov 2011 08:17:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HC2f009110@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227183 - head/usr.bin/split X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:12 -0000 Author: ed Date: Sun Nov 6 08:17:11 2011 New Revision: 227183 URL: http://svn.freebsd.org/changeset/base/227183 Log: Add missing static keywords to split(1) Modified: head/usr.bin/split/split.c Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Sun Nov 6 08:17:05 2011 (r227182) +++ head/usr.bin/split/split.c Sun Nov 6 08:17:11 2011 (r227183) @@ -61,16 +61,16 @@ static const char sccsid[] = "@(#)split. #define DEFLINE 1000 /* Default num lines per file. */ -off_t bytecnt; /* Byte count to split on. */ -off_t chunks = 0; /* Chunks count to split into. */ -long numlines; /* Line count to split on. */ -int file_open; /* If a file open. */ -int ifd = -1, ofd = -1; /* Input/output file descriptors. */ -char bfr[MAXBSIZE]; /* I/O buffer. */ -char fname[MAXPATHLEN]; /* File name prefix. */ -regex_t rgx; -int pflag; -long sufflen = 2; /* File name suffix length. */ +static off_t bytecnt; /* Byte count to split on. */ +static off_t chunks = 0; /* Chunks count to split into. */ +static long numlines; /* Line count to split on. */ +static int file_open; /* If a file open. */ +static int ifd = -1, ofd = -1; /* Input/output file descriptors. */ +static char bfr[MAXBSIZE]; /* I/O buffer. */ +static char fname[MAXPATHLEN]; /* File name prefix. */ +static regex_t rgx; +static int pflag; +static long sufflen = 2; /* File name suffix length. */ static void newfile(void); static void split1(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2D010668AA; Sun, 6 Nov 2011 08:17:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CAE78FC1E; Sun, 6 Nov 2011 08:17:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HIAD009152; Sun, 6 Nov 2011 08:17:18 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HIif009149; Sun, 6 Nov 2011 08:17:18 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HIif009149@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227184 - head/usr.bin/tail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:18 -0000 Author: ed Date: Sun Nov 6 08:17:17 2011 New Revision: 227184 URL: http://svn.freebsd.org/changeset/base/227184 Log: Add missing static keywords to tail(1) Modified: head/usr.bin/tail/forward.c head/usr.bin/tail/tail.c Modified: head/usr.bin/tail/forward.c ============================================================================== --- head/usr.bin/tail/forward.c Sun Nov 6 08:17:11 2011 (r227183) +++ head/usr.bin/tail/forward.c Sun Nov 6 08:17:17 2011 (r227184) @@ -66,9 +66,9 @@ static void set_events(file_info_t *file #define USE_KQUEUE 1 #define ADD_EVENTS 2 -struct kevent *ev; -int action = USE_SLEEP; -int kq; +static struct kevent *ev; +static int action = USE_SLEEP; +static int kq; static const file_info_t *last; Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Sun Nov 6 08:17:11 2011 (r227183) +++ head/usr.bin/tail/tail.c Sun Nov 6 08:17:17 2011 (r227184) @@ -58,7 +58,7 @@ static const char sccsid[] = "@(#)tail.c int Fflag, fflag, qflag, rflag, rval, no_files; -file_info_t *files; +static file_info_t *files; static void obsolete(char **); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2E71066919; Sun, 6 Nov 2011 08:17:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6858FC1B; Sun, 6 Nov 2011 08:17:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HOsO009194; Sun, 6 Nov 2011 08:17:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HNX7009189; Sun, 6 Nov 2011 08:17:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HNX7009189@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227185 - head/usr.bin/talk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:24 -0000 Author: ed Date: Sun Nov 6 08:17:23 2011 New Revision: 227185 URL: http://svn.freebsd.org/changeset/base/227185 Log: Add missing static keywords to talk(1) Modified: head/usr.bin/talk/ctl.c head/usr.bin/talk/init_disp.c head/usr.bin/talk/invite.c head/usr.bin/talk/talk.h Modified: head/usr.bin/talk/ctl.c ============================================================================== --- head/usr.bin/talk/ctl.c Sun Nov 6 08:17:17 2011 (r227184) +++ head/usr.bin/talk/ctl.c Sun Nov 6 08:17:23 2011 (r227185) @@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)ctl.c #include #include "talk.h" +#include "talk_ctl.h" struct sockaddr_in daemon_addr = { .sin_len = sizeof(daemon_addr), .sin_family = AF_INET }; struct sockaddr_in ctl_addr = { .sin_len = sizeof(ctl_addr), .sin_family = AF_INET }; Modified: head/usr.bin/talk/init_disp.c ============================================================================== --- head/usr.bin/talk/init_disp.c Sun Nov 6 08:17:17 2011 (r227184) +++ head/usr.bin/talk/init_disp.c Sun Nov 6 08:17:23 2011 (r227185) @@ -50,8 +50,6 @@ static const char sccsid[] = "@(#)init_d #include "talk.h" -extern volatile sig_atomic_t gotwinch; - /* * Make sure the callee can write to the screen */ Modified: head/usr.bin/talk/invite.c ============================================================================== --- head/usr.bin/talk/invite.c Sun Nov 6 08:17:17 2011 (r227184) +++ head/usr.bin/talk/invite.c Sun Nov 6 08:17:23 2011 (r227185) @@ -60,8 +60,8 @@ static const char sccsid[] = "@(#)invite * These are used to delete the * invitations. */ -int local_id, remote_id; -jmp_buf invitebuf; +static int local_id, remote_id; +static jmp_buf invitebuf; void invite_remote(void) Modified: head/usr.bin/talk/talk.h ============================================================================== --- head/usr.bin/talk/talk.h Sun Nov 6 08:17:17 2011 (r227184) +++ head/usr.bin/talk/talk.h Sun Nov 6 08:17:23 2011 (r227185) @@ -38,6 +38,7 @@ #include #include #include +#include extern int sockt; extern int curses_initialized; @@ -46,6 +47,8 @@ extern int invitation_waiting; extern const char *current_state; extern int current_line; +extern volatile sig_atomic_t gotwinch; + typedef struct xwin { WINDOW *x_win; int x_nlines; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D201066175; Sun, 6 Nov 2011 08:17:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B3C28FC08; Sun, 6 Nov 2011 08:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HT7Q009235; Sun, 6 Nov 2011 08:17:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HTM4009233; Sun, 6 Nov 2011 08:17:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HTM4009233@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227186 - head/usr.bin/tcopy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:30 -0000 Author: ed Date: Sun Nov 6 08:17:29 2011 New Revision: 227186 URL: http://svn.freebsd.org/changeset/base/227186 Log: Add missing static keywords to tcopy(1) Modified: head/usr.bin/tcopy/tcopy.c Modified: head/usr.bin/tcopy/tcopy.c ============================================================================== --- head/usr.bin/tcopy/tcopy.c Sun Nov 6 08:17:23 2011 (r227185) +++ head/usr.bin/tcopy/tcopy.c Sun Nov 6 08:17:29 2011 (r227186) @@ -60,16 +60,16 @@ static const char sccsid[] = "@(#)tcopy. #define MAXREC (64 * 1024) #define NOCOUNT (-2) -int filen, guesslen, maxblk = MAXREC; -u_int64_t lastrec, record, size, tsize; -FILE *msg; +static int filen, guesslen, maxblk = MAXREC; +static uint64_t lastrec, record, size, tsize; +static FILE *msg; -void *getspace(int); -void intr(int); +static void *getspace(int); +static void intr(int); static void usage(void) __dead2; -void verify(int, int, char *); -void writeop(int, int); -void rewind_tape(int); +static void verify(int, int, char *); +static void writeop(int, int); +static void rewind_tape(int); int main(int argc, char *argv[]) @@ -223,7 +223,7 @@ r1: guesslen = 0; exit(0); } -void +static void verify(int inp, int outp, char *outb) { int eot, inmaxblk, inn, outmaxblk, outn; @@ -275,7 +275,7 @@ r2: if (inn != outn) { exit(1); } -void +static void intr(int signo __unused) { if (record) { @@ -289,7 +289,7 @@ intr(int signo __unused) exit(1); } -void * +static void * getspace(int blk) { void *bp; @@ -299,7 +299,7 @@ getspace(int blk) return (bp); } -void +static void writeop(int fd, int type) { struct mtop op; @@ -317,7 +317,7 @@ usage(void) exit(1); } -void +static void rewind_tape(int fd) { struct stat sp; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79BDF1066A60; Sun, 6 Nov 2011 08:17:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 215778FC22; Sun, 6 Nov 2011 08:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HapP009275; Sun, 6 Nov 2011 08:17:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Ha5t009273; Sun, 6 Nov 2011 08:17:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68Ha5t009273@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227187 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:36 -0000 Author: ed Date: Sun Nov 6 08:17:35 2011 New Revision: 227187 URL: http://svn.freebsd.org/changeset/base/227187 Log: Add missing static keywords to tee(1) Modified: head/usr.bin/tee/tee.c Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Sun Nov 6 08:17:29 2011 (r227186) +++ head/usr.bin/tee/tee.c Sun Nov 6 08:17:35 2011 (r227187) @@ -56,9 +56,9 @@ typedef struct _list { int fd; const char *name; } LIST; -LIST *head; +static LIST *head; -void add(int, const char *); +static void add(int, const char *); static void usage(void); int @@ -125,7 +125,7 @@ usage(void) exit(1); } -void +static void add(int fd, const char *name) { LIST *p; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DD1C1066BB8; Sun, 6 Nov 2011 08:17:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F17808FC1A; Sun, 6 Nov 2011 08:17:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HgEC009315; Sun, 6 Nov 2011 08:17:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68Hg0G009313; Sun, 6 Nov 2011 08:17:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68Hg0G009313@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227188 - head/usr.bin/tr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:43 -0000 Author: ed Date: Sun Nov 6 08:17:42 2011 New Revision: 227188 URL: http://svn.freebsd.org/changeset/base/227188 Log: Add missing static keywords to tr(1) Modified: head/usr.bin/tr/tr.c Modified: head/usr.bin/tr/tr.c ============================================================================== --- head/usr.bin/tr/tr.c Sun Nov 6 08:17:35 2011 (r227187) +++ head/usr.bin/tr/tr.c Sun Nov 6 08:17:42 2011 (r227188) @@ -58,8 +58,8 @@ static const char sccsid[] = "@(#)tr.c 8 #include "cset.h" #include "extern.h" -STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; -STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; +static STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; +static STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL }; static struct cset *setup(char *, STR *, int, int); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C72E1066BF7; Sun, 6 Nov 2011 08:17:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FC5E8FC20; Sun, 6 Nov 2011 08:17:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68HmYw009357; Sun, 6 Nov 2011 08:17:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HmXt009355; Sun, 6 Nov 2011 08:17:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HmXt009355@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227189 - head/usr.bin/tsort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:48 -0000 Author: ed Date: Sun Nov 6 08:17:47 2011 New Revision: 227189 URL: http://svn.freebsd.org/changeset/base/227189 Log: Add missing static keywords to tsort(1) Modified: head/usr.bin/tsort/tsort.c Modified: head/usr.bin/tsort/tsort.c ============================================================================== --- head/usr.bin/tsort/tsort.c Sun Nov 6 08:17:42 2011 (r227188) +++ head/usr.bin/tsort/tsort.c Sun Nov 6 08:17:47 2011 (r227189) @@ -96,18 +96,18 @@ typedef struct _buf { int b_bsize; } BUF; -DB *db; -NODE *graph, **cycle_buf, **longest_cycle; -int debug, longest, quiet; - -void add_arc(char *, char *); -int find_cycle(NODE *, NODE *, int, int); -NODE *get_node(char *); -void *grow_buf(void *, size_t); -void remove_node(NODE *); -void clear_cycle(void); -void tsort(void); -void usage(void); +static DB *db; +static NODE *graph, **cycle_buf, **longest_cycle; +static int debug, longest, quiet; + +static void add_arc(char *, char *); +static int find_cycle(NODE *, NODE *, int, int); +static NODE *get_node(char *); +static void *grow_buf(void *, size_t); +static void remove_node(NODE *); +static void clear_cycle(void); +static void tsort(void); +static void usage(void); int main(int argc, char *argv[]) @@ -185,7 +185,7 @@ main(int argc, char *argv[]) } /* double the size of oldbuf and return a pointer to the new buffer. */ -void * +static void * grow_buf(void *bp, size_t size) { if ((bp = realloc(bp, size)) == NULL) @@ -197,7 +197,7 @@ grow_buf(void *bp, size_t size) * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in * the graph, then add them. */ -void +static void add_arc(char *s1, char *s2) { NODE *n1; @@ -232,7 +232,7 @@ add_arc(char *s1, char *s2) } /* Find a node in the graph (insert if not found) and return a pointer to it. */ -NODE * +static NODE * get_node(char *name) { DBT data, key; @@ -284,7 +284,7 @@ get_node(char *name) /* * Clear the NODEST flag from all nodes. */ -void +static void clear_cycle(void) { NODE *n; @@ -294,7 +294,7 @@ clear_cycle(void) } /* do topological sort on graph */ -void +static void tsort(void) { NODE *n, *next; @@ -357,7 +357,7 @@ tsort(void) } /* print node and remove from graph (does not actually free node) */ -void +static void remove_node(NODE *n) { NODE **np; @@ -374,7 +374,7 @@ remove_node(NODE *n) /* look for the longest? cycle from node from to node to. */ -int +static int find_cycle(NODE *from, NODE *to, int longest_len, int depth) { NODE **np; @@ -420,7 +420,7 @@ find_cycle(NODE *from, NODE *to, int lon return (longest_len); } -void +static void usage(void) { (void)fprintf(stderr, "usage: tsort [-dlq] [file]\n"); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:17:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32137106575F; Sun, 6 Nov 2011 08:17:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14D9E8FC27; Sun, 6 Nov 2011 08:17:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Hr0S009398; Sun, 6 Nov 2011 08:17:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HrLk009396; Sun, 6 Nov 2011 08:17:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HrLk009396@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17: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: r227190 - head/usr.bin/ul X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:17:54 -0000 Author: ed Date: Sun Nov 6 08:17:53 2011 New Revision: 227190 URL: http://svn.freebsd.org/changeset/base/227190 Log: Add missing static keywords to ul(1) Modified: head/usr.bin/ul/ul.c Modified: head/usr.bin/ul/ul.c ============================================================================== --- head/usr.bin/ul/ul.c Sun Nov 6 08:17:47 2011 (r227189) +++ head/usr.bin/ul/ul.c Sun Nov 6 08:17:53 2011 (r227190) @@ -66,8 +66,8 @@ static const char rcsid[] = #define UNDERL 010 /* Ul */ #define BOLD 020 /* Bold */ -int must_use_uc, must_overstrike; -const char +static int must_use_uc, must_overstrike; +static const char *CURS_UP, *CURS_RIGHT, *CURS_LEFT, *ENTER_STANDOUT, *EXIT_STANDOUT, *ENTER_UNDERLINE, *EXIT_UNDERLINE, *ENTER_DIM, *ENTER_BOLD, *ENTER_REVERSE, *UNDER_CHAR, *EXIT_ATTRIBUTES; @@ -78,25 +78,25 @@ struct CHAR { int c_width; /* width or -1 if multi-column char. filler */ } ; -struct CHAR obuf[MAXBUF]; -int col, maxcol; -int mode; -int halfpos; -int upln; -int iflag; +static struct CHAR obuf[MAXBUF]; +static int col, maxcol; +static int mode; +static int halfpos; +static int upln; +static int iflag; static void usage(void); -void setnewmode(int); -void initcap(void); -void reverse(void); -int outchar(int); -void fwd(void); -void initbuf(void); -void iattr(void); -void overstrike(void); -void flushln(void); -void filter(FILE *); -void outc(wint_t, int); +static void setnewmode(int); +static void initcap(void); +static void reverse(void); +static int outchar(int); +static void fwd(void); +static void initbuf(void); +static void iattr(void); +static void overstrike(void); +static void flushln(void); +static void filter(FILE *); +static void outc(wint_t, int); #define PRINT(s) if (s == NULL) /* void */; else tputs(s, 1, outchar) @@ -165,7 +165,7 @@ usage(void) exit(1); } -void +static void filter(FILE *f) { wint_t c; @@ -299,7 +299,7 @@ filter(FILE *f) flushln(); } -void +static void flushln(void) { int lastmode; @@ -341,7 +341,7 @@ flushln(void) * For terminals that can overstrike, overstrike underlines and bolds. * We don't do anything with halfline ups and downs, or Greek. */ -void +static void overstrike(void) { int i; @@ -381,7 +381,7 @@ overstrike(void) } } -void +static void iattr(void) { int i; @@ -405,7 +405,7 @@ iattr(void) putwchar('\n'); } -void +static void initbuf(void) { @@ -415,7 +415,7 @@ initbuf(void) mode &= ALTSET; } -void +static void fwd(void) { int oldcol, oldmax; @@ -427,7 +427,7 @@ fwd(void) maxcol = oldmax; } -void +static void reverse(void) { upln++; @@ -437,7 +437,7 @@ reverse(void) upln++; } -void +static void initcap(void) { static char tcapbuf[512]; @@ -490,7 +490,7 @@ initcap(void) must_use_uc = (UNDER_CHAR && !ENTER_UNDERLINE); } -int +static int outchar(int c) { return (putwchar(c) != WEOF ? c : EOF); @@ -498,7 +498,7 @@ outchar(int c) static int curmode = 0; -void +static void outc(wint_t c, int width) { int i; @@ -512,7 +512,7 @@ outc(wint_t c, int width) } } -void +static void setnewmode(int newmode) { if (!iflag) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83CA510660CA; Sun, 6 Nov 2011 08:18:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6E18FC15; Sun, 6 Nov 2011 08:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Hxsp009437; Sun, 6 Nov 2011 08:17:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68HxKQ009435; Sun, 6 Nov 2011 08:17:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060817.pA68HxKQ009435@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227191 - head/usr.bin/uname X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:00 -0000 Author: ed Date: Sun Nov 6 08:17:59 2011 New Revision: 227191 URL: http://svn.freebsd.org/changeset/base/227191 Log: Add missing static keywords to uname(1) Modified: head/usr.bin/uname/uname.c Modified: head/usr.bin/uname/uname.c ============================================================================== --- head/usr.bin/uname/uname.c Sun Nov 6 08:17:53 2011 (r227190) +++ head/usr.bin/uname/uname.c Sun Nov 6 08:17:59 2011 (r227191) @@ -63,21 +63,22 @@ static const char sccsid[] = "@(#)uname. #define IFLAG 0x40 typedef void (*get_t)(void); -get_t get_ident, get_platform, get_hostname, get_arch, get_release, get_sysname, get_version; +static get_t get_ident, get_platform, get_hostname, get_arch, + get_release, get_sysname, get_version; -void native_ident(void); -void native_platform(void); -void native_hostname(void); -void native_arch(void); -void native_release(void); -void native_sysname(void); -void native_version(void); -void print_uname(u_int); -void setup_get(void); -void usage(void); +static void native_ident(void); +static void native_platform(void); +static void native_hostname(void); +static void native_arch(void); +static void native_release(void); +static void native_sysname(void); +static void native_version(void); +static void print_uname(u_int); +static void setup_get(void); +static void usage(void); -char *ident, *platform, *hostname, *arch, *release, *sysname, *version; -int space; +static char *ident, *platform, *hostname, *arch, *release, *sysname, *version; +static int space; int main(int argc, char *argv[]) @@ -142,7 +143,7 @@ do { \ } \ } while (0) -void +static void setup_get(void) { CHECK_ENV("s", sysname); @@ -165,7 +166,7 @@ setup_get(void) printf("%s", var); \ } -void +static void print_uname(u_int flags) { PRINT_FLAG(flags, SFLAG, sysname); @@ -179,7 +180,7 @@ print_uname(u_int flags) } #define NATIVE_SYSCTL2_GET(var,mib0,mib1) \ -void \ +static void \ native_##var(void) \ { \ int mib[] = { (mib0), (mib1) }; \ @@ -193,7 +194,7 @@ native_##var(void) \ err(1, "sysctl"); #define NATIVE_SYSCTLNAME_GET(var,name) \ -void \ +static void \ native_##var(void) \ { \ size_t len; \ @@ -242,7 +243,7 @@ NATIVE_SYSCTL2_GET(arch, CTL_HW, HW_MACH NATIVE_SYSCTLNAME_GET(ident, "kern.ident") { } NATIVE_SET; -void +static void usage(void) { fprintf(stderr, "usage: uname [-aimnoprsv]\n"); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B69ED1066232; Sun, 6 Nov 2011 08:18:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1233F8FC0A; Sun, 6 Nov 2011 08:18:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68I5fM009478; Sun, 6 Nov 2011 08:18:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68I5tw009476; Sun, 6 Nov 2011 08:18:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68I5tw009476@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227192 - head/usr.bin/unexpand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:06 -0000 Author: ed Date: Sun Nov 6 08:18:05 2011 New Revision: 227192 URL: http://svn.freebsd.org/changeset/base/227192 Log: Add missing static keywords to unexpand(1) Modified: head/usr.bin/unexpand/unexpand.c Modified: head/usr.bin/unexpand/unexpand.c ============================================================================== --- head/usr.bin/unexpand/unexpand.c Sun Nov 6 08:17:59 2011 (r227191) +++ head/usr.bin/unexpand/unexpand.c Sun Nov 6 08:18:05 2011 (r227192) @@ -55,9 +55,9 @@ static const char sccsid[] = "@(#)unexpa #include #include -int all; -int nstops; -int tabstops[100]; +static int all; +static int nstops; +static int tabstops[100]; static void getstops(const char *); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4662F1066D82; Sun, 6 Nov 2011 08:18:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08FD38FC0C; Sun, 6 Nov 2011 08:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IBMS009517; Sun, 6 Nov 2011 08:18:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IBCC009515; Sun, 6 Nov 2011 08:18:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IBCC009515@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227193 - head/usr.bin/uniq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:12 -0000 Author: ed Date: Sun Nov 6 08:18:11 2011 New Revision: 227193 URL: http://svn.freebsd.org/changeset/base/227193 Log: Add missing static keywords to uniq(1) Modified: head/usr.bin/uniq/uniq.c Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Sun Nov 6 08:18:05 2011 (r227192) +++ head/usr.bin/uniq/uniq.c Sun Nov 6 08:18:11 2011 (r227193) @@ -57,15 +57,15 @@ static const char rcsid[] = #include #include -int cflag, dflag, uflag, iflag; -int numchars, numfields, repeats; +static int cflag, dflag, uflag, iflag; +static int numchars, numfields, repeats; -FILE *file(const char *, const char *); -wchar_t *convert(const char *); -int inlcmp(const char *, const char *); -void show(FILE *, const char *); -wchar_t *skip(wchar_t *); -void obsolete(char *[]); +static FILE *file(const char *, const char *); +static wchar_t *convert(const char *); +static int inlcmp(const char *, const char *); +static void show(FILE *, const char *); +static wchar_t *skip(wchar_t *); +static void obsolete(char *[]); static void usage(void); int @@ -184,7 +184,7 @@ main (int argc, char *argv[]) exit(0); } -wchar_t * +static wchar_t * convert(const char *str) { size_t n; @@ -218,7 +218,7 @@ convert(const char *str) return (ret); } -int +static int inlcmp(const char *s1, const char *s2) { int c1, c2; @@ -241,7 +241,7 @@ inlcmp(const char *s1, const char *s2) * Output a line depending on the flags and number of repetitions * of the line. */ -void +static void show(FILE *ofp, const char *str) { @@ -251,7 +251,7 @@ show(FILE *ofp, const char *str) (void)fprintf(ofp, "%s", str); } -wchar_t * +static wchar_t * skip(wchar_t *str) { int nchars, nfields; @@ -267,7 +267,7 @@ skip(wchar_t *str) return(str); } -FILE * +static FILE * file(const char *name, const char *mode) { FILE *fp; @@ -277,7 +277,7 @@ file(const char *name, const char *mode) return(fp); } -void +static void obsolete(char *argv[]) { int len; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE9C1066EF5; Sun, 6 Nov 2011 08:18:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 115D08FC0C; Sun, 6 Nov 2011 08:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IHYr009556; Sun, 6 Nov 2011 08:18:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IHq8009554; Sun, 6 Nov 2011 08:18:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IHq8009554@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227194 - head/usr.bin/units X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:18 -0000 Author: ed Date: Sun Nov 6 08:18:17 2011 New Revision: 227194 URL: http://svn.freebsd.org/changeset/base/227194 Log: Add missing static keywords to units(1) Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sun Nov 6 08:18:11 2011 (r227193) +++ head/usr.bin/units/units.c Sun Nov 6 08:18:17 2011 (r227194) @@ -42,9 +42,9 @@ static const char rcsid[] = #define PRIMITIVECHAR '!' -const char *powerstring = "^"; +static const char *powerstring = "^"; -struct { +static struct { char *uname; char *uval; } unittable[MAXUNITS]; @@ -57,13 +57,13 @@ struct unittype { int quantity; }; -struct { +static struct { char *prefixname; char *prefixval; } prefixtable[MAXPREFIXES]; -char NULLUNIT[] = ""; +static char NULLUNIT[] = ""; #ifdef MSDOS #define SEPARATOR ";" @@ -71,8 +71,8 @@ char NULLUNIT[] = ""; #define SEPARATOR ":" #endif -int unitcount; -int prefixcount; +static int unitcount; +static int prefixcount; char *dupstr(const char *str); void readunits(const char *userfile); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 479291066F58; Sun, 6 Nov 2011 08:18:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36BA88FC16; Sun, 6 Nov 2011 08:18:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IO3C009595; Sun, 6 Nov 2011 08:18:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IOJj009593; Sun, 6 Nov 2011 08:18:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IOJj009593@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227195 - head/usr.bin/usbhidaction X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:24 -0000 Author: ed Date: Sun Nov 6 08:18:23 2011 New Revision: 227195 URL: http://svn.freebsd.org/changeset/base/227195 Log: Add missing static keywords to usbhidaction(1) Modified: head/usr.bin/usbhidaction/usbhidaction.c Modified: head/usr.bin/usbhidaction/usbhidaction.c ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.c Sun Nov 6 08:18:17 2011 (r227194) +++ head/usr.bin/usbhidaction/usbhidaction.c Sun Nov 6 08:18:23 2011 (r227195) @@ -64,7 +64,7 @@ struct command { char *name; char *action; }; -struct command *commands; +static struct command *commands; #define SIZE 4000 From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B634C1065E20; Sun, 6 Nov 2011 08:18:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AB478FC26; Sun, 6 Nov 2011 08:18:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IUuJ009636; Sun, 6 Nov 2011 08:18:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IUPu009634; Sun, 6 Nov 2011 08:18:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IUPu009634@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227196 - head/usr.bin/usbhidctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:30 -0000 Author: ed Date: Sun Nov 6 08:18:30 2011 New Revision: 227196 URL: http://svn.freebsd.org/changeset/base/227196 Log: Add missing static keywords to usbhidctl(1) Modified: head/usr.bin/usbhidctl/usbhid.c Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Sun Nov 6 08:18:23 2011 (r227195) +++ head/usr.bin/usbhidctl/usbhid.c Sun Nov 6 08:18:30 2011 (r227196) @@ -42,7 +42,7 @@ #include #include -struct variable { +static struct variable { char *name; int instance; int val; @@ -50,11 +50,11 @@ struct variable { struct variable *next; } *vars; -int verbose = 0; -int noname = 0; -int hexdump = 0; -int wflag = 0; -int zflag = 0; +static int verbose = 0; +static int noname = 0; +static int hexdump = 0; +static int wflag = 0; +static int zflag = 0; static void usage(void); static void dumpitem(const char *label, struct hid_item *h); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBDD11066FAB; Sun, 6 Nov 2011 08:18:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E41A8FC29; Sun, 6 Nov 2011 08:18:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IZuK009676; Sun, 6 Nov 2011 08:18:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IZFl009674; Sun, 6 Nov 2011 08:18:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IZFl009674@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227197 - head/usr.bin/uuencode X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:36 -0000 Author: ed Date: Sun Nov 6 08:18:35 2011 New Revision: 227197 URL: http://svn.freebsd.org/changeset/base/227197 Log: Add missing static keywords to uuencode(1) Modified: head/usr.bin/uuencode/uuencode.c Modified: head/usr.bin/uuencode/uuencode.c ============================================================================== --- head/usr.bin/uuencode/uuencode.c Sun Nov 6 08:18:30 2011 (r227196) +++ head/usr.bin/uuencode/uuencode.c Sun Nov 6 08:18:35 2011 (r227197) @@ -60,13 +60,13 @@ __FBSDID("$FreeBSD$"); #include #include -void encode(void); -void base64_encode(void); +static void encode(void); +static void base64_encode(void); static void usage(void); -FILE *output; -int mode; -char **av; +static FILE *output; +static int mode; +static char **av; int main(int argc, char *argv[]) @@ -138,7 +138,7 @@ main(int argc, char *argv[]) /* * Copy from in to out, encoding in base64 as you go along. */ -void +static void base64_encode(void) { /* @@ -168,7 +168,7 @@ base64_encode(void) /* * Copy from in to out, encoding as you go along. */ -void +static void encode(void) { register int ch, n; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3B01067086; Sun, 6 Nov 2011 08:18:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A94D8FC13; Sun, 6 Nov 2011 08:18:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68IgrR009715; Sun, 6 Nov 2011 08:18:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68IgPM009713; Sun, 6 Nov 2011 08:18:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68IgPM009713@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227198 - head/usr.bin/vis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:43 -0000 Author: ed Date: Sun Nov 6 08:18:42 2011 New Revision: 227198 URL: http://svn.freebsd.org/changeset/base/227198 Log: Add missing static keywords to vis(1) Modified: head/usr.bin/vis/vis.c Modified: head/usr.bin/vis/vis.c ============================================================================== --- head/usr.bin/vis/vis.c Sun Nov 6 08:18:35 2011 (r227197) +++ head/usr.bin/vis/vis.c Sun Nov 6 08:18:42 2011 (r227198) @@ -50,9 +50,12 @@ static const char sccsid[] = "@(#)vis.c #include "extern.h" -int eflags, fold, foldwidth=80, none, markeol, debug; +static int eflags, fold, foldwidth = 80, none, markeol; +#ifdef DEBUG +static int debug; +#endif -void process(FILE *); +static void process(FILE *); static void usage(void); int @@ -133,7 +136,7 @@ usage(void) exit(1); } -void +static void process(FILE *fp) { static int col = 0; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C9C1065680; Sun, 6 Nov 2011 08:18:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 278E58FC17; Sun, 6 Nov 2011 08:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68ImCH009754; Sun, 6 Nov 2011 08:18:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68ImQP009752; Sun, 6 Nov 2011 08:18:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68ImQP009752@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227199 - head/usr.bin/w X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:48 -0000 Author: ed Date: Sun Nov 6 08:18:47 2011 New Revision: 227199 URL: http://svn.freebsd.org/changeset/base/227199 Log: Add missing static keywords to w(1) Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Sun Nov 6 08:18:42 2011 (r227198) +++ head/usr.bin/w/w.c Sun Nov 6 08:18:47 2011 (r227199) @@ -85,25 +85,24 @@ static const char sccsid[] = "@(#)w.c 8. #include "extern.h" -struct timeval boottime; -struct utmpx *utmp; -struct winsize ws; -kvm_t *kd; -time_t now; /* the current time of day */ -int ttywidth; /* width of tty */ -int argwidth; /* width of tty */ -int header = 1; /* true if -h flag: don't print heading */ -int nflag; /* true if -n flag: don't convert addrs */ -int dflag; /* true if -d flag: output debug info */ -int sortidle; /* sort by idle time */ +static struct utmpx *utmp; +static struct winsize ws; +static kvm_t *kd; +static time_t now; /* the current time of day */ +static int ttywidth; /* width of tty */ +static int argwidth; /* width of tty */ +static int header = 1; /* true if -h flag: don't print heading */ +static int nflag; /* true if -n flag: don't convert addrs */ +static int dflag; /* true if -d flag: output debug info */ +static int sortidle; /* sort by idle time */ int use_ampm; /* use AM/PM time */ -int use_comma; /* use comma as floats separator */ -char **sel_users; /* login array of particular users selected */ +static int use_comma; /* use comma as floats separator */ +static char **sel_users; /* login array of particular users selected */ /* * One of these per active utmp entry. */ -struct entry { +static struct entry { struct entry *next; struct utmpx utmp; dev_t tdev; /* dev_t of terminal */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:18:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AF6C1065A1D; Sun, 6 Nov 2011 08:18:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE4C8FC20; Sun, 6 Nov 2011 08:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68Itlj009794; Sun, 6 Nov 2011 08:18:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68ItWe009792; Sun, 6 Nov 2011 08:18:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060818.pA68ItWe009792@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:18: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: r227200 - head/usr.bin/wall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:18:55 -0000 Author: ed Date: Sun Nov 6 08:18:55 2011 New Revision: 227200 URL: http://svn.freebsd.org/changeset/base/227200 Log: Add missing static keywords to wall(1) Modified: head/usr.bin/wall/wall.c Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Sun Nov 6 08:18:47 2011 (r227199) +++ head/usr.bin/wall/wall.c Sun Nov 6 08:18:55 2011 (r227200) @@ -68,14 +68,14 @@ static const char sccsid[] = "@(#)wall.c static void makemsg(char *); static void usage(void); -struct wallgroup { +static struct wallgroup { struct wallgroup *next; char *name; gid_t gid; } *grouplist; -int nobanner; -int mbufsize; -char *mbuf; +static int nobanner; +static int mbufsize; +static char *mbuf; static int ttystat(char *line) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:19:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FEF1106654F; Sun, 6 Nov 2011 08:19:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ECD48FC1E; Sun, 6 Nov 2011 08:19:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68J19e009834; Sun, 6 Nov 2011 08:19:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68J1BD009832; Sun, 6 Nov 2011 08:19:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060819.pA68J1BD009832@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:19: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: r227201 - head/usr.bin/wc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:19:01 -0000 Author: ed Date: Sun Nov 6 08:19:00 2011 New Revision: 227201 URL: http://svn.freebsd.org/changeset/base/227201 Log: Add missing static keywords to wc(1) Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Sun Nov 6 08:18:55 2011 (r227200) +++ head/usr.bin/wc/wc.c Sun Nov 6 08:19:00 2011 (r227201) @@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include -uintmax_t tlinect, twordct, tcharct, tlongline; -int doline, doword, dochar, domulti, dolongline; +static uintmax_t tlinect, twordct, tcharct, tlongline; +static int doline, doword, dochar, domulti, dolongline; static volatile sig_atomic_t siginfo; static void show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:19:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64177106655A; Sun, 6 Nov 2011 08:19:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533218FC12; Sun, 6 Nov 2011 08:19:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA68J7eN009874; Sun, 6 Nov 2011 08:19:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68J7ZF009872; Sun, 6 Nov 2011 08:19:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060819.pA68J7ZF009872@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:19: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: r227202 - head/usr.bin/xinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:19:07 -0000 Author: ed Date: Sun Nov 6 08:19:07 2011 New Revision: 227202 URL: http://svn.freebsd.org/changeset/base/227202 Log: Add missing static keywords to xinstall(1) Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sun Nov 6 08:19:00 2011 (r227201) +++ head/usr.bin/xinstall/xinstall.c Sun Nov 6 08:19:07 2011 (r227202) @@ -73,13 +73,14 @@ __FBSDID("$FreeBSD$"); #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) #define BACKUP_SUFFIX ".old" -struct passwd *pp; -struct group *gp; -gid_t gid; -uid_t uid; -int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose; -mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; -const char *suffix = BACKUP_SUFFIX; +static struct passwd *pp; +static struct group *gp; +static gid_t gid; +static uid_t uid; +static int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, + verbose; +static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; +static const char *suffix = BACKUP_SUFFIX; static int compare(int, const char *, size_t, int, const char *, size_t); static void copy(int, const char *, int, const char *, off_t); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 09:09:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC66106564A; Sun, 6 Nov 2011 09:09:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D91F8FC12; Sun, 6 Nov 2011 09:09:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA699jYI011751; Sun, 6 Nov 2011 09:09:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA699jfo011749; Sun, 6 Nov 2011 09:09:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060909.pA699jfo011749@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 09:09: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: r227203 - head/usr.bin/id X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 09:09:45 -0000 Author: ed Date: Sun Nov 6 09:09:45 2011 New Revision: 227203 URL: http://svn.freebsd.org/changeset/base/227203 Log: Correct the change made in r227166. This function is only compiled in when building WITH_AUDIT. Modified: head/usr.bin/id/id.c Modified: head/usr.bin/id/id.c ============================================================================== --- head/usr.bin/id/id.c Sun Nov 6 08:19:07 2011 (r227202) +++ head/usr.bin/id/id.c Sun Nov 6 09:09:45 2011 (r227203) @@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$"); static void id_print(struct passwd *, int, int, int); static void pline(struct passwd *); static void pretty(struct passwd *); +#ifdef USE_BSM_AUDIT static void auditid(void); +#endif static void group(struct passwd *, int); static void maclabel(void); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 09:10:08 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92CBD106564A; Sun, 6 Nov 2011 09:10:08 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au [211.29.132.199]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2218FC13; Sun, 6 Nov 2011 09:10:07 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pA69A4hL008246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Nov 2011 20:10:05 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id pA69A3dV016452; Sun, 6 Nov 2011 20:10:03 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id pA69A3vA016451; Sun, 6 Nov 2011 20:10:03 +1100 (EST) (envelope-from peter) Date: Sun, 6 Nov 2011 20:10:03 +1100 From: Peter Jeremy To: Ed Schouten Message-ID: <20111106091003.GA37935@server.vk2pj.dyndns.org> References: <201111060814.pA68EGLf008005@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <201111060814.pA68EGLf008005@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227156 - head/usr.bin/cmp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 09:10:08 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Nov-06 08:14:16 +0000, Ed Schouten wrote: >Log: > Add missing static keywords to cmp(1) > >Modified: > head/usr.bin/cmp/extern.h > >Modified: head/usr.bin/cmp/extern.h >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/usr.bin/cmp/extern.h Sun Nov 6 08:14:09 2011 (r227155) >+++ head/usr.bin/cmp/extern.h Sun Nov 6 08:14:16 2011 (r227156) >@@ -42,4 +42,4 @@ void c_special(int, const char *, off_t, > void diffmsg(const char *, const char *, off_t, off_t); > void eofmsg(const char *); >=20 >-extern int lflag, sflag, xflag; >+extern int lflag, sflag, xflag, zflag; That's an interesting spelling of "static". I presume this is a general cleanup of identifier visibility to prevent unexpected aliasing - in which case a more general log message may have nicer. --=20 Peter Jeremy --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk62TusACgkQ/opHv/APuIeFtQCgiMREp2DST3LTbyM0EJ+nqlKK IEwAmgP40UZDCDLtazmJwMI5Dk4p0AsC =Gz3J -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 09:17:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D69F1065670; Sun, 6 Nov 2011 09:17:49 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0F598FC12; Sun, 6 Nov 2011 09:17:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA69HmZT012064; Sun, 6 Nov 2011 09:17:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA69Hmgq012062; Sun, 6 Nov 2011 09:17:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111060917.pA69Hmgq012062@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 6 Nov 2011 09:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227204 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 09:17:49 -0000 Author: trociny Date: Sun Nov 6 09:17:48 2011 New Revision: 227204 URL: http://svn.freebsd.org/changeset/base/227204 Log: Fix the typo made in r157474. MFC after: 3 days Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Nov 6 09:09:45 2011 (r227203) +++ head/sys/netinet/in_pcb.c Sun Nov 6 09:17:48 2011 (r227204) @@ -590,7 +590,7 @@ in_pcbbind_setup(struct inpcb *inp, stru * being in use (for now). This is better * than a panic, but not desirable. */ - tw = intotw(inp); + tw = intotw(t); if (tw == NULL || (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 09:29:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99D9106564A; Sun, 6 Nov 2011 09:29:52 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FBE28FC0A; Sun, 6 Nov 2011 09:29:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA69Tq7o012529; Sun, 6 Nov 2011 09:29:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA69TqFO012527; Sun, 6 Nov 2011 09:29:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111060929.pA69TqFO012527@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 6 Nov 2011 09:29: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: r227206 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 09:29:52 -0000 Author: trociny Date: Sun Nov 6 09:29:52 2011 New Revision: 227206 URL: http://svn.freebsd.org/changeset/base/227206 Log: Before dereferencing intotw() check for NULL, the same way as it is done for in_pcb (see r157474). MFC after: 1 week Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Nov 6 09:27:40 2011 (r227205) +++ head/sys/netinet6/in6_pcb.c Sun Nov 6 09:29:52 2011 (r227206) @@ -187,6 +187,7 @@ in6_pcbbind(register struct inpcb *inp, } if (lport) { struct inpcb *t; + struct tcptw *tw; /* GROSS */ if (ntohs(lport) <= V_ipport_reservedhigh && @@ -233,10 +234,21 @@ in6_pcbbind(register struct inpcb *inp, } t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr, lport, lookupflags, cred); - if (t && (reuseport & ((t->inp_flags & INP_TIMEWAIT) ? - intotw(t)->tw_so_options : - t->inp_socket->so_options)) == 0) + if (t && (t->inp_flags & INP_TIMEWAIT)) { + /* + * XXXRW: If an incpb has had its timewait + * state recycled, we treat the address as + * being in use (for now). This is better + * than a panic, but not desirable. + */ + tw = intotw(t); + if (tw == NULL || + (reuseport & tw->tw_so_options) == 0) + return (EADDRINUSE); + } else if (t && (reuseport & t->inp_socket->so_options) + == 0) { return (EADDRINUSE); + } #ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { @@ -246,9 +258,11 @@ in6_pcbbind(register struct inpcb *inp, t = in_pcblookup_local(pcbinfo, sin.sin_addr, lport, lookupflags, cred); if (t && t->inp_flags & INP_TIMEWAIT) { - if ((reuseport & - intotw(t)->tw_so_options) == 0 && - (ntohl(t->inp_laddr.s_addr) != + tw = intotw(t); + if (tw == NULL) + return (EADDRINUSE); + if ((reuseport & tw->tw_so_options) == 0 + && (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || ((inp->inp_vflag & INP_IPV6PROTO) == (t->inp_vflag & INP_IPV6PROTO)))) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 09:31:57 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7BEB1065670; Sun, 6 Nov 2011 09:31:57 +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 96E9C8FC0A; Sun, 6 Nov 2011 09:31:57 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 61EF92A28CC8; Sun, 6 Nov 2011 10:15:44 +0100 (CET) Date: Sun, 6 Nov 2011 10:15:44 +0100 From: Ed Schouten To: Peter Jeremy Message-ID: <20111106091544.GM2258@hoeg.nl> References: <201111060814.pA68EGLf008005@svn.freebsd.org> <20111106091003.GA37935@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YGQsgxOP0v8GKjPA" Content-Disposition: inline In-Reply-To: <20111106091003.GA37935@server.vk2pj.dyndns.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227156 - head/usr.bin/cmp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 09:31:57 -0000 --YGQsgxOP0v8GKjPA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Peter Jeremy , 20111106 10:10: > That's an interesting spelling of "static". I presume this is a > general cleanup of identifier visibility to prevent unexpected > aliasing - in which case a more general log message may have nicer. Yes, sorry about that. When I read through the diff, I overlooked that there were a small number of changes in there that don't mark things static, but instead mark them extern. In the case for cmp, simply all the `*flag' variables were marked extern anyway, so I decided not to deviate from that for `zflag'. --=20 Ed Schouten WWW: http://80386.nl/ --YGQsgxOP0v8GKjPA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOtlBAAAoJEG5e2P40kaK7i0sP/0oVG9vV/vCgxOszXXQjh5U2 cXURdBXrPnTfisoOGAFleM8GIDunAal4mZstYK4o1sLvDmhBzy91XahARwS/71bB StcA4/dKbn1duVEFb+Sc/NKY1V0EbWSe5smDD3PIDUIz6I4pzFhRPeZ6WPUbwDQa GTkcNzyl7rhtjt+MxHsnVEh2gOQI7JGdg2eJ1/6UMoIte3SDFlQQXpwfnHyAGG9W p+m96PoTXcnnbFq2hgX2Uf+/p+6av9H9dhqFUTcVTWNVVA/6LWZNlh+HLeqmnfE7 vrYCEhd4th1xYPXi8mhJxjb6mu43dofL68psHWKjrfjSDPY+PFJ39WpRzVtcEaNC N52fpj7He0RAVYESgAnvly04npX7xHP6oi1y69nbkaid6uTPrfb7D58etIWypFQM Vmfx6mYj8K2eGM8ECVncSSmDAA5ErO205mHW3uh9OWsTVnkUN5ReCLDr1UKXpIcS 8VPQRmfwRuWVFJvjX+MCZ5gONJILfBcVydYwWqa9wci8PKJ8WE+qZsNY+KVmeUSA RxjInOh9HDBwj6e7USmTDH69V5TOfHgY+1PlNJMTb6R+dXaVpVEsmWURbEPiYaAX N/Orrw4VIZinJoNaVlVfYZAnX/kYY+OWBPtTQIZJmDD++yVI4BrbeRvvpqqmKQKb ryAzraZkO14U90jcyRdW =o13K -----END PGP SIGNATURE----- --YGQsgxOP0v8GKjPA-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 10:47:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6ACD106564A; Sun, 6 Nov 2011 10:47:20 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65D58FC0C; Sun, 6 Nov 2011 10:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6AlKRp017574; Sun, 6 Nov 2011 10:47:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6AlKnc017568; Sun, 6 Nov 2011 10:47:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111061047.pA6AlKnc017568@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 6 Nov 2011 10:47: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: r227207 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 10:47:21 -0000 Author: trociny Date: Sun Nov 6 10:47:20 2011 New Revision: 227207 URL: http://svn.freebsd.org/changeset/base/227207 Log: Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid inp_socket->so_options dereference when we may not acquire the lock on the inpcb. This fixes the crash due to NULL pointer dereference in in_pcbbind_setup() when inp_socket->so_options in a pcb returned by in_pcblookup_local() was checked. Reported by: dave jones , Arnaud Lacombe Suggested by: rwatson Glanced by: rwatson Tested by: dave jones Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Nov 6 09:29:52 2011 (r227206) +++ head/sys/netinet/in_pcb.c Sun Nov 6 10:47:20 2011 (r227207) @@ -575,8 +575,7 @@ in_pcbbind_setup(struct inpcb *inp, stru ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_socket->so_options & - SO_REUSEPORT) == 0) && + (t->inp_flags2 & INP_REUSEPORT) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -594,15 +593,15 @@ in_pcbbind_setup(struct inpcb *inp, stru if (tw == NULL || (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } else if (t && - (reuseport & t->inp_socket->so_options) == 0) { + } else if (t && (reuseport == 0 || + (t->inp_flags2 & INP_REUSEPORT) == 0)) { #ifdef INET6 if (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - INP_SOCKAF(so) == - INP_SOCKAF(t->inp_socket)) + (inp->inp_vflag & INP_IPV6PROTO) == 0 || + (t->inp_vflag & INP_IPV6PROTO) == 0) #endif return (EADDRINUSE); } Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun Nov 6 09:29:52 2011 (r227206) +++ head/sys/netinet/in_pcb.h Sun Nov 6 10:47:20 2011 (r227207) @@ -540,6 +540,7 @@ void inp_4tuple_get(struct inpcb *inp, #define INP_LLE_VALID 0x00000001 /* cached lle is valid */ #define INP_RT_VALID 0x00000002 /* cached rtentry is valid */ #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ +#define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ /* * Flags passed to in_pcblookup*() functions. Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun Nov 6 09:29:52 2011 (r227206) +++ head/sys/netinet/ip_output.c Sun Nov 6 10:47:20 2011 (r227207) @@ -895,12 +895,43 @@ ip_ctloutput(struct socket *so, struct s error = optval = 0; if (sopt->sopt_level != IPPROTO_IP) { - if ((sopt->sopt_level == SOL_SOCKET) && - (sopt->sopt_name == SO_SETFIB)) { - inp->inp_inc.inc_fibnum = so->so_fibnum; - return (0); + error = EINVAL; + + if (sopt->sopt_level == SOL_SOCKET && + sopt->sopt_dir == SOPT_SET) { + switch (sopt->sopt_name) { + case SO_REUSEADDR: + INP_WLOCK(inp); + if (IN_MULTICAST(ntohl(inp->inp_laddr.s_addr))) { + if ((so->so_options & + (SO_REUSEADDR | SO_REUSEPORT)) != 0) + inp->inp_flags2 |= INP_REUSEPORT; + else + inp->inp_flags2 &= ~INP_REUSEPORT; + } + INP_WUNLOCK(inp); + error = 0; + break; + case SO_REUSEPORT: + INP_WLOCK(inp); + if ((so->so_options & SO_REUSEPORT) != 0) + inp->inp_flags2 |= INP_REUSEPORT; + else + inp->inp_flags2 &= ~INP_REUSEPORT; + INP_WUNLOCK(inp); + error = 0; + break; + case SO_SETFIB: + INP_WLOCK(inp); + inp->inp_inc.inc_fibnum = so->so_fibnum; + INP_WUNLOCK(inp); + error = 0; + break; + default: + break; + } } - return (EINVAL); + return (error); } switch (sopt->sopt_dir) { Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Nov 6 09:29:52 2011 (r227206) +++ head/sys/netinet6/in6_pcb.c Sun Nov 6 10:47:20 2011 (r227207) @@ -207,8 +207,8 @@ in6_pcbbind(register struct inpcb *inp, IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_socket->so_options & SO_REUSEPORT) - == 0) && (inp->inp_cred->cr_uid != + (t->inp_flags2 & INP_REUSEPORT) == 0) && + (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); #ifdef INET @@ -267,12 +267,10 @@ in6_pcbbind(register struct inpcb *inp, INP_IPV6PROTO) == (t->inp_vflag & INP_IPV6PROTO)))) return (EADDRINUSE); - } - else if (t && - (reuseport & t->inp_socket->so_options) - == 0 && (ntohl(t->inp_laddr.s_addr) != - INADDR_ANY || INP_SOCKAF(so) == - INP_SOCKAF(t->inp_socket))) + } else if (t && (reuseport == 0 || + (t->inp_flags2 & INP_REUSEPORT) == 0) && + (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || + (t->inp_vflag & INP_IPV6PROTO) == 0)) return (EADDRINUSE); } #endif Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Nov 6 09:29:52 2011 (r227206) +++ head/sys/netinet6/ip6_output.c Sun Nov 6 10:47:20 2011 (r227207) @@ -1421,7 +1421,38 @@ ip6_ctloutput(struct socket *so, struct optval = 0; uproto = (int)so->so_proto->pr_protocol; - if (level == IPPROTO_IPV6) { + if (level != IPPROTO_IPV6) { + error = EINVAL; + + if (sopt->sopt_level == SOL_SOCKET && + sopt->sopt_dir == SOPT_SET) { + switch (sopt->sopt_name) { + case SO_REUSEADDR: + INP_WLOCK(in6p); + if (IN_MULTICAST(ntohl(in6p->inp_laddr.s_addr))) { + if ((so->so_options & + (SO_REUSEADDR | SO_REUSEPORT)) != 0) + in6p->inp_flags2 |= INP_REUSEPORT; + else + in6p->inp_flags2 &= ~INP_REUSEPORT; + } + INP_WUNLOCK(in6p); + error = 0; + break; + case SO_REUSEPORT: + INP_WLOCK(in6p); + if ((so->so_options & SO_REUSEPORT) != 0) + in6p->inp_flags2 |= INP_REUSEPORT; + else + in6p->inp_flags2 &= ~INP_REUSEPORT; + INP_WUNLOCK(in6p); + error = 0; + break; + default: + break; + } + } + } else { /* level == IPPROTO_IPV6 */ switch (op) { case SOPT_SET: @@ -2044,8 +2075,6 @@ do { \ } break; } - } else { /* level != IPPROTO_IPV6 */ - error = EINVAL; } return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 10:51:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66B5F106564A; Sun, 6 Nov 2011 10:51:20 +0000 (UTC) (envelope-from to.my.trociny@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 4F24E8FC14; Sun, 6 Nov 2011 10:51:18 +0000 (UTC) Received: by faar19 with SMTP id r19so6109418faa.13 for ; Sun, 06 Nov 2011 02:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=fmDTxO8feWZxv4f2uWLO8RdfwfumMXpidvQkYa/wKGc=; b=cULbNPO9CWVIjCajg/fezC0JAW7Llrp1nsZSSv5kGbKAS61+5eRMagB+uXP2JiQX98 Xtibcnnw8REPuIRtET1F4GHJS0ko83jCeViM6alonTLXig2TW/kkMwfOYGrVGKhUOSs8 PSft07u5yIg1Hhuz1d4jheBOsMIsX6k+BUui0= Received: by 10.223.30.149 with SMTP id u21mr38663224fac.18.1320576678083; Sun, 06 Nov 2011 02:51:18 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id x19sm26051655fag.5.2011.11.06.02.51.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Nov 2011 02:51:16 -0800 (PST) From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111061047.pA6AlKnc017568@svn.freebsd.org> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Sun, 06 Nov 2011 12:51:13 +0200 In-Reply-To: <201111061047.pA6AlKnc017568@svn.freebsd.org> (Mikolaj Golub's message of "Sun, 6 Nov 2011 10:47:20 +0000 (UTC)") Message-ID: <86r51lcyn2.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Robert Watson Subject: Re: svn commit: r227207 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 10:51:20 -0000 On Sun, 6 Nov 2011 10:47:20 +0000 (UTC) Mikolaj Golub wrote: MG> Author: trociny MG> Date: Sun Nov 6 10:47:20 2011 MG> New Revision: 227207 MG> URL: http://svn.freebsd.org/changeset/base/227207 MG> Log: MG> Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid MG> inp_socket->so_options dereference when we may not acquire the lock on MG> the inpcb. MG> MG> This fixes the crash due to NULL pointer dereference in MG> in_pcbbind_setup() when inp_socket->so_options in a pcb returned by MG> in_pcblookup_local() was checked. MG> MG> Reported by: dave jones , Arnaud Lacombe MG> Suggested by: rwatson MG> Glanced by: rwatson MG> Tested by: dave jones This commit fixes the panic reported by Dave for 9.0 triggered by named. Robert has helped very much suggesting the solution and looking at the patches. Unfortunately being saturated on free time he couldn't do thorough review of the final version confirming only that presumably the approach was correct. I made an effort to check that there was no regression and SO_REUSEADDR worked the same way as it had worked before. But I can't be 100% confident that I haven't broken something. Because of this I am going to MFC only after the release. Here is the initial discussion of the issue: http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029858.html MG> Modified: MG> head/sys/netinet/in_pcb.c MG> head/sys/netinet/in_pcb.h MG> head/sys/netinet/ip_output.c MG> head/sys/netinet6/in6_pcb.c MG> head/sys/netinet6/ip6_output.c MG> Modified: head/sys/netinet/in_pcb.c MG> ============================================================================== MG> --- head/sys/netinet/in_pcb.c Sun Nov 6 09:29:52 2011 (r227206) MG> +++ head/sys/netinet/in_pcb.c Sun Nov 6 10:47:20 2011 (r227207) MG> @@ -575,8 +575,7 @@ in_pcbbind_setup(struct inpcb *inp, stru MG> ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && MG> (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || MG> ntohl(t->inp_laddr.s_addr) != INADDR_ANY || MG> - (t->inp_socket->so_options & MG> - SO_REUSEPORT) == 0) && MG> + (t->inp_flags2 & INP_REUSEPORT) == 0) && MG> (inp->inp_cred->cr_uid != MG> t->inp_cred->cr_uid)) MG> return (EADDRINUSE); MG> @@ -594,15 +593,15 @@ in_pcbbind_setup(struct inpcb *inp, stru MG> if (tw == NULL || MG> (reuseport & tw->tw_so_options) == 0) MG> return (EADDRINUSE); MG> - } else if (t && MG> - (reuseport & t->inp_socket->so_options) == 0) { MG> + } else if (t && (reuseport == 0 || MG> + (t->inp_flags2 & INP_REUSEPORT) == 0)) { MG> #ifdef INET6 MG> if (ntohl(sin->sin_addr.s_addr) != MG> INADDR_ANY || MG> ntohl(t->inp_laddr.s_addr) != MG> INADDR_ANY || MG> - INP_SOCKAF(so) == MG> - INP_SOCKAF(t->inp_socket)) MG> + (inp->inp_vflag & INP_IPV6PROTO) == 0 || MG> + (t->inp_vflag & INP_IPV6PROTO) == 0) MG> #endif MG> return (EADDRINUSE); MG> } MG> Modified: head/sys/netinet/in_pcb.h MG> ============================================================================== MG> --- head/sys/netinet/in_pcb.h Sun Nov 6 09:29:52 2011 (r227206) MG> +++ head/sys/netinet/in_pcb.h Sun Nov 6 10:47:20 2011 (r227207) MG> @@ -540,6 +540,7 @@ void inp_4tuple_get(struct inpcb *inp, MG> #define INP_LLE_VALID 0x00000001 /* cached lle is valid */ MG> #define INP_RT_VALID 0x00000002 /* cached rtentry is valid */ MG> #define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */ MG> +#define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */ MG> MG> /* MG> * Flags passed to in_pcblookup*() functions. MG> Modified: head/sys/netinet/ip_output.c MG> ============================================================================== MG> --- head/sys/netinet/ip_output.c Sun Nov 6 09:29:52 2011 (r227206) MG> +++ head/sys/netinet/ip_output.c Sun Nov 6 10:47:20 2011 (r227207) MG> @@ -895,12 +895,43 @@ ip_ctloutput(struct socket *so, struct s MG> MG> error = optval = 0; MG> if (sopt->sopt_level != IPPROTO_IP) { MG> - if ((sopt->sopt_level == SOL_SOCKET) && MG> - (sopt->sopt_name == SO_SETFIB)) { MG> - inp->inp_inc.inc_fibnum = so->so_fibnum; MG> - return (0); MG> + error = EINVAL; MG> + MG> + if (sopt->sopt_level == SOL_SOCKET && MG> + sopt->sopt_dir == SOPT_SET) { MG> + switch (sopt->sopt_name) { MG> + case SO_REUSEADDR: MG> + INP_WLOCK(inp); MG> + if (IN_MULTICAST(ntohl(inp->inp_laddr.s_addr))) { MG> + if ((so->so_options & MG> + (SO_REUSEADDR | SO_REUSEPORT)) != 0) MG> + inp->inp_flags2 |= INP_REUSEPORT; MG> + else MG> + inp->inp_flags2 &= ~INP_REUSEPORT; MG> + } MG> + INP_WUNLOCK(inp); MG> + error = 0; MG> + break; MG> + case SO_REUSEPORT: MG> + INP_WLOCK(inp); MG> + if ((so->so_options & SO_REUSEPORT) != 0) MG> + inp->inp_flags2 |= INP_REUSEPORT; MG> + else MG> + inp->inp_flags2 &= ~INP_REUSEPORT; MG> + INP_WUNLOCK(inp); MG> + error = 0; MG> + break; MG> + case SO_SETFIB: MG> + INP_WLOCK(inp); MG> + inp->inp_inc.inc_fibnum = so->so_fibnum; MG> + INP_WUNLOCK(inp); MG> + error = 0; MG> + break; MG> + default: MG> + break; MG> + } MG> } MG> - return (EINVAL); MG> + return (error); MG> } MG> MG> switch (sopt->sopt_dir) { MG> Modified: head/sys/netinet6/in6_pcb.c MG> ============================================================================== MG> --- head/sys/netinet6/in6_pcb.c Sun Nov 6 09:29:52 2011 (r227206) MG> +++ head/sys/netinet6/in6_pcb.c Sun Nov 6 10:47:20 2011 (r227207) MG> @@ -207,8 +207,8 @@ in6_pcbbind(register struct inpcb *inp, MG> IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && MG> (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || MG> !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || MG> - (t->inp_socket->so_options & SO_REUSEPORT) MG> - == 0) && (inp->inp_cred->cr_uid != MG> + (t->inp_flags2 & INP_REUSEPORT) == 0) && MG> + (inp->inp_cred->cr_uid != MG> t->inp_cred->cr_uid)) MG> return (EADDRINUSE); MG> #ifdef INET MG> @@ -267,12 +267,10 @@ in6_pcbbind(register struct inpcb *inp, MG> INP_IPV6PROTO) == MG> (t->inp_vflag & INP_IPV6PROTO)))) MG> return (EADDRINUSE); MG> - } MG> - else if (t && MG> - (reuseport & t->inp_socket->so_options) MG> - == 0 && (ntohl(t->inp_laddr.s_addr) != MG> - INADDR_ANY || INP_SOCKAF(so) == MG> - INP_SOCKAF(t->inp_socket))) MG> + } else if (t && (reuseport == 0 || MG> + (t->inp_flags2 & INP_REUSEPORT) == 0) && MG> + (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || MG> + (t->inp_vflag & INP_IPV6PROTO) == 0)) MG> return (EADDRINUSE); MG> } MG> #endif MG> Modified: head/sys/netinet6/ip6_output.c MG> ============================================================================== MG> --- head/sys/netinet6/ip6_output.c Sun Nov 6 09:29:52 2011 (r227206) MG> +++ head/sys/netinet6/ip6_output.c Sun Nov 6 10:47:20 2011 (r227207) MG> @@ -1421,7 +1421,38 @@ ip6_ctloutput(struct socket *so, struct MG> optval = 0; MG> uproto = (int)so->so_proto->pr_protocol; MG> MG> - if (level == IPPROTO_IPV6) { MG> + if (level != IPPROTO_IPV6) { MG> + error = EINVAL; MG> + MG> + if (sopt->sopt_level == SOL_SOCKET && MG> + sopt->sopt_dir == SOPT_SET) { MG> + switch (sopt->sopt_name) { MG> + case SO_REUSEADDR: MG> + INP_WLOCK(in6p); MG> + if (IN_MULTICAST(ntohl(in6p->inp_laddr.s_addr))) { MG> + if ((so->so_options & MG> + (SO_REUSEADDR | SO_REUSEPORT)) != 0) MG> + in6p->inp_flags2 |= INP_REUSEPORT; MG> + else MG> + in6p->inp_flags2 &= ~INP_REUSEPORT; MG> + } MG> + INP_WUNLOCK(in6p); MG> + error = 0; MG> + break; MG> + case SO_REUSEPORT: MG> + INP_WLOCK(in6p); MG> + if ((so->so_options & SO_REUSEPORT) != 0) MG> + in6p->inp_flags2 |= INP_REUSEPORT; MG> + else MG> + in6p->inp_flags2 &= ~INP_REUSEPORT; MG> + INP_WUNLOCK(in6p); MG> + error = 0; MG> + break; MG> + default: MG> + break; MG> + } MG> + } MG> + } else { /* level == IPPROTO_IPV6 */ MG> switch (op) { MG> MG> case SOPT_SET: MG> @@ -2044,8 +2075,6 @@ do { \ MG> } MG> break; MG> } MG> - } else { /* level != IPPROTO_IPV6 */ MG> - error = EINVAL; MG> } MG> return (error); MG> } -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 14:00:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F641065672; Sun, 6 Nov 2011 14:00:20 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6491E8FC0C; Sun, 6 Nov 2011 14:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6E0KIV024511; Sun, 6 Nov 2011 14:00:20 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6E0K2Y024510; Sun, 6 Nov 2011 14:00:20 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201111061400.pA6E0K2Y024510@svn.freebsd.org> From: Antoine Brodin Date: Sun, 6 Nov 2011 14:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227214 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 14:00:20 -0000 Author: antoine Date: Sun Nov 6 14:00:18 2011 New Revision: 227214 URL: http://svn.freebsd.org/changeset/base/227214 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 6 13:35:55 2011 (r227213) +++ head/ObsoleteFiles.inc Sun Nov 6 14:00:18 2011 (r227214) @@ -44,10 +44,12 @@ OLD_FILES+=usr/share/man/man8/sysinstall OLD_FILES+=usr/lib/libftpio.a OLD_FILES+=usr/lib/libftpio.so OLD_LIBS+=usr/lib/libftpio.so.8 +OLD_FILES+=usr/lib/libftpio_p.a .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libftpio.a OLD_FILES+=usr/lib32/libftpio.so OLD_LIBS+=usr/lib32/libftpio.so.8 +OLD_FILES+=usr/lib32/libftpio_p.a .endif OLD_FILES+=usr/include/ftpio.h OLD_FILES+=usr/share/man/man3/ftpio.3.gz @@ -77,11 +79,22 @@ OLD_LIBS+=usr/lib32/libopie.so.6 OLD_LIBS+=usr/lib32/librtld_db.so.1 OLD_LIBS+=usr/lib32/libtacplus.so.4 .endif +# 20110817: no more acd.4, ad.4, afd.4 and ast.4 +OLD_FILES+=usr/share/man/man4/acd.4.gz +OLD_FILES+=usr/share/man/man4/ad.4.gz +OLD_FILES+=usr/share/man/man4/afd.4.gz +OLD_FILES+=usr/share/man/man4/ast.4.gz # 20110718: no longer useful in the age of rc.d OLD_FILES+=usr/sbin/named.reconfig OLD_FILES+=usr/sbin/named.reload +OLD_FILES+=usr/share/man/man8/named.reconfig.8.gz +OLD_FILES+=usr/share/man/man8/named.reload.8.gz # 20110716: bind 9.8.0 import OLD_LIBS+=usr/lib/liblwres.so.50 +OLD_FILES+=usr/share/doc/bind9/KNOWN-DEFECTS +OLD_FILES+=usr/share/doc/bind9/NSEC3-NOTES +OLD_FILES+=usr/share/doc/bind9/README.idnkit +OLD_FILES+=usr/share/doc/bind9/README.pkcs11 # 20110709: vm_map_clean.9 -> vm_map_sync.9 OLD_FILES+=usr/share/man/man9/vm_map_clean.9.gz # 20110709: Catch up with removal of these functions. From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 14:07:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE09106566C; Sun, 6 Nov 2011 14:07:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75EA88FC18; Sun, 6 Nov 2011 14:07:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6E7N6v024807; Sun, 6 Nov 2011 14:07:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6E7NQG024803; Sun, 6 Nov 2011 14:07:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111061407.pA6E7NQG024803@svn.freebsd.org> From: Dimitry Andric Date: Sun, 6 Nov 2011 14:07: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: r227215 - in head: gnu/lib/libstdc++ lib/clang/include/llvm/Config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 14:07:23 -0000 Author: dim Date: Sun Nov 6 14:07:23 2011 New Revision: 227215 URL: http://svn.freebsd.org/changeset/base/227215 Log: When one attempts to compile the tree with -march=i386, which also used to be gcc's default before r198344, calls to atomic builtins will not be expanded inline. Instead, they will be generated as calls to external functions (e.g. __sync_fetch_and_add_N), leading to linking errors later on. Put in a seatbelt that disables use of atomic builtins in libstdc++ and llvm, when tuning specifically for the real i386 CPU. This does not protect against all possible issues, but it is better than nothing. Modified: head/gnu/lib/libstdc++/config.h head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h Modified: head/gnu/lib/libstdc++/config.h ============================================================================== --- head/gnu/lib/libstdc++/config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/gnu/lib/libstdc++/config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -671,7 +671,7 @@ /* #undef VERSION */ /* Define if builtin atomic operations are supported on this host. */ -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && !defined(__tune_i386__)) #define _GLIBCXX_ATOMIC_BUILTINS 1 #endif Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/lib/clang/include/llvm/Config/config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -552,7 +552,9 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ +#ifndef __tune_i386__ #define LLVM_HAS_ATOMICS 1 +#endif /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */ Modified: head/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- head/lib/clang/include/llvm/Config/llvm-config.h Sun Nov 6 14:00:18 2011 (r227214) +++ head/lib/clang/include/llvm/Config/llvm-config.h Sun Nov 6 14:07:23 2011 (r227215) @@ -34,7 +34,9 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ +#ifndef __tune_i386__ #define LLVM_HAS_ATOMICS 1 +#endif /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 16:37:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 101FB10656D2; Sun, 6 Nov 2011 16:37:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 003938FC21; Sun, 6 Nov 2011 16:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6GbFli030401; Sun, 6 Nov 2011 16:37:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6GbF4a030398; Sun, 6 Nov 2011 16:37:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061637.pA6GbF4a030398@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 16:37: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: r227221 - head/usr.sbin/timed/timed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 16:37:16 -0000 Author: ed Date: Sun Nov 6 16:37:15 2011 New Revision: 227221 URL: http://svn.freebsd.org/changeset/base/227221 Log: Simplify inclusion of the tsptype array a bit. We don't need this array in timed.c -- only readmsg.c. Modified: head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/timed.c Modified: head/usr.sbin/timed/timed/readmsg.c ============================================================================== --- head/usr.sbin/timed/timed/readmsg.c Sun Nov 6 16:36:54 2011 (r227220) +++ head/usr.sbin/timed/timed/readmsg.c Sun Nov 6 16:37:15 2011 (r227221) @@ -35,10 +35,9 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#define TSPTYPES #include "globals.h" -extern char *tsptype[]; - /* * LOOKAT checks if the message is of the requested type and comes from * the right machine, returning 1 in case of affirmative answer Modified: head/usr.sbin/timed/timed/timed.c ============================================================================== --- head/usr.sbin/timed/timed/timed.c Sun Nov 6 16:36:54 2011 (r227220) +++ head/usr.sbin/timed/timed/timed.c Sun Nov 6 16:37:15 2011 (r227221) @@ -42,7 +42,6 @@ static char sccsid[] = "@(#)timed.c 8.1 #include __FBSDID("$FreeBSD$"); -#define TSPTYPES #include "globals.h" #include #include From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 16:40:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EE78106567E; Sun, 6 Nov 2011 16:40:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EED08FC13; Sun, 6 Nov 2011 16:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6GeH4a030583; Sun, 6 Nov 2011 16:40:17 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6GeHvF030581; Sun, 6 Nov 2011 16:40:17 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061640.pA6GeHvF030581@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 16:40: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: r227223 - head/usr.sbin/chroot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 16:40:17 -0000 Author: ed Date: Sun Nov 6 16:40:17 2011 New Revision: 227223 URL: http://svn.freebsd.org/changeset/base/227223 Log: Eliminate global variables. There is no reason why these three variables should be declared as global variables, while the others aren't. They are only used inside main(). Modified: head/usr.sbin/chroot/chroot.c Modified: head/usr.sbin/chroot/chroot.c ============================================================================== --- head/usr.sbin/chroot/chroot.c Sun Nov 6 16:37:50 2011 (r227222) +++ head/usr.sbin/chroot/chroot.c Sun Nov 6 16:40:17 2011 (r227223) @@ -56,16 +56,12 @@ __FBSDID("$FreeBSD$"); static void usage(void); -char *user; /* user to switch to before running program */ -char *group; /* group to switch to ... */ -char *grouplist; /* group list to switch to ... */ - int main(int argc, char *argv[]) { struct group *gp; struct passwd *pw; - char *endp, *p; + char *endp, *p, *user, *group, *grouplist; const char *shell; gid_t gid, *gidlist; uid_t uid; @@ -74,6 +70,7 @@ main(int argc, char *argv[]) gid = 0; uid = 0; + user = group = grouplist = NULL; while ((ch = getopt(argc, argv, "G:g:u:")) != -1) { switch(ch) { case 'u': From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 16:47:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39DFB106564A; Sun, 6 Nov 2011 16:47:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10A2C8FC12; Sun, 6 Nov 2011 16:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6GloMc030978; Sun, 6 Nov 2011 16:47:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6GloTs030976; Sun, 6 Nov 2011 16:47:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061647.pA6GloTs030976@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 16:47: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: r227224 - head/usr.sbin/mptable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 16:47:51 -0000 Author: ed Date: Sun Nov 6 16:47:50 2011 New Revision: 227224 URL: http://svn.freebsd.org/changeset/base/227224 Log: Mark all global variables static for mptable(1). While there, remove basetableEntryTypes, which became unused in r71209. Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c ============================================================================== --- head/usr.sbin/mptable/mptable.c Sun Nov 6 16:40:17 2011 (r227223) +++ head/usr.sbin/mptable/mptable.c Sun Nov 6 16:47:50 2011 (r227224) @@ -96,7 +96,7 @@ typedef struct BUSTYPENAME { char name[ 7 ]; } busTypeName; -static busTypeName busTypeTable[] = +static const busTypeName busTypeTable[] = { { CBUS, "CBUS" }, { CBUSII, "CBUSII" }, @@ -119,7 +119,7 @@ static busTypeName busTypeTable[] = { UNKNOWN_BUSTYPE, "---" } }; -const char* whereStrings[] = { +static const char *whereStrings[] = { "Extended BIOS Data Area", "BIOS top of memory", "Default top of memory", @@ -135,16 +135,7 @@ typedef struct TABLE_ENTRY { char name[ 32 ]; } tableEntry; -tableEntry basetableEntryTypes[] = -{ - { 0, 20, "Processor" }, - { 1, 8, "Bus" }, - { 2, 8, "I/O APIC" }, - { 3, 8, "I/O INT" }, - { 4, 8, "Local INT" } -}; - -tableEntry extendedtableEntryTypes[] = +static const tableEntry extendedtableEntryTypes[] = { { 128, 20, "System Address Space" }, { 129, 8, "Bus Hierarchy" }, @@ -277,19 +268,19 @@ static void doDmesg( void ); static void pnstr( char* s, int c ); /* global data */ -int pfd; /* physical /dev/mem fd */ +static int pfd; /* physical /dev/mem fd */ -int busses[ 16 ]; -int apics[ 16 ]; +static int busses[16]; +static int apics[16]; -int ncpu; -int nbus; -int napic; -int nintr; - -int dmesg; -int grope; -int verbose; +static int ncpu; +static int nbus; +static int napic; +static int nintr; + +static int dmesg; +static int grope; +static int verbose; static void usage( void ) @@ -978,14 +969,14 @@ ioApicEntry( void ) } -const char* intTypes[] = { +static const char *intTypes[] = { "INT", "NMI", "SMI", "ExtINT" }; -const char* polarityMode[] = { +static const char *polarityMode[] = { "conforms", "active-hi", "reserved", "active-lo" }; -const char* triggerMode[] = { +static const char *triggerMode[] = { "conforms", "edge", "reserved", "level" }; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 16:52:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF63C106566B; Sun, 6 Nov 2011 16:52:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB278FC17; Sun, 6 Nov 2011 16:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6GqQ6B031209; Sun, 6 Nov 2011 16:52:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6GqQ54031207; Sun, 6 Nov 2011 16:52:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061652.pA6GqQ54031207@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 16:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227225 - head/usr.sbin/cdcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 16:52:27 -0000 Author: ed Date: Sun Nov 6 16:52:26 2011 New Revision: 227225 URL: http://svn.freebsd.org/changeset/base/227225 Log: Make all functions and global variables static for cdcontrol(8). While there, replace __const by const, which seems to be our preference nowadays. Also fix some style(9) bugs by adding newlines and removing unneeded spaces from function declarations. Modified: head/usr.sbin/cdcontrol/cdcontrol.c Modified: head/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.c Sun Nov 6 16:47:50 2011 (r227224) +++ head/usr.sbin/cdcontrol/cdcontrol.c Sun Nov 6 16:52:26 2011 (r227225) @@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$"); #define STATUS_MEDIA 0x2 #define STATUS_VOLUME 0x4 -struct cmdtab { +static struct cmdtab { int command; const char *name; unsigned min; @@ -119,40 +119,40 @@ struct cmdtab { { 0, NULL, 0, NULL } }; -struct cd_toc_entry toc_buffer[100]; +static struct cd_toc_entry toc_buffer[100]; -const char *cdname; -int fd = -1; -int verbose = 1; -int msf = 1; - -int setvol(int, int); -int read_toc_entrys(int); -int play_msf(int, int, int, int, int, int); -int play_track(int, int, int, int); -int get_vol(int *, int *); -int status(int *, int *, int *, int *); -int open_cd(void); -int next_prev(char *arg, int); -int play(char *arg); -int info(char *arg); -int cdid(void); -int pstatus(char *arg); -char *input(int *); -void prtrack(struct cd_toc_entry *e, int lastflag); -void lba2msf(unsigned long lba, u_char *m, u_char *s, u_char *f); -unsigned int msf2lba(u_char m, u_char s, u_char f); -int play_blocks(int blk, int len); -int run(int cmd, char *arg); -char *parse(char *buf, int *cmd); -void help(void); -void usage(void); -char *use_cdrom_instead(const char *); -__const char *strstatus(int); +static const char *cdname; +static int fd = -1; +static int verbose = 1; +static int msf = 1; + +static int setvol(int, int); +static int read_toc_entrys(int); +static int play_msf(int, int, int, int, int, int); +static int play_track(int, int, int, int); +static int status(int *, int *, int *, int *); +static int open_cd(void); +static int next_prev(char *arg, int); +static int play(char *arg); +static int info(char *arg); +static int cdid(void); +static int pstatus(char *arg); +static char *input(int *); +static void prtrack(struct cd_toc_entry *e, int lastflag); +static void lba2msf(unsigned long lba, u_char *m, u_char *s, u_char *f); +static unsigned int msf2lba(u_char m, u_char s, u_char f); +static int play_blocks(int blk, int len); +static int run(int cmd, char *arg); +static char *parse(char *buf, int *cmd); +static void help(void); +static void usage(void); +static char *use_cdrom_instead(const char *); +static const char *strstatus(int); static u_int dbprog_discid(void); -__const char *cdcontrol_prompt(void); +static const char *cdcontrol_prompt(void); -void help (void) +static void +help(void) { struct cmdtab *c; const char *s; @@ -178,13 +178,15 @@ void help (void) printf ("\tThe plain target address is taken as a synonym for play.\n"); } -void usage (void) +static void +usage(void) { fprintf (stderr, "usage: cdcontrol [-sv] [-f device] [command ...]\n"); exit (1); } -char *use_cdrom_instead(const char *old_envvar) +static char * +use_cdrom_instead(const char *old_envvar) { char *device; @@ -196,7 +198,8 @@ char *use_cdrom_instead(const char *old_ } -int main (int argc, char **argv) +int +main(int argc, char **argv) { int cmd; char *arg; @@ -284,7 +287,8 @@ int main (int argc, char **argv) } } -int run (int cmd, char *arg) +static int +run(int cmd, char *arg) { long speed; int l, r, rc, count; @@ -465,7 +469,8 @@ int run (int cmd, char *arg) } } -int play (char *arg) +static int +play(char *arg) { struct ioc_toc_header h; unsigned int n; @@ -748,7 +753,8 @@ Clean_up: return (0); } -int next_prev (char *arg, int cmd) +static int +next_prev(char *arg, int cmd) { struct ioc_toc_header h; int dir, junk, n, off, rc, trk; @@ -778,7 +784,8 @@ int next_prev (char *arg, int cmd) return (play_track (trk, 1, n, 1)); } -const char *strstatus (int sts) +static const char * +strstatus(int sts) { switch (sts) { case ASTS_INVALID: return ("invalid"); @@ -791,7 +798,8 @@ const char *strstatus (int sts) } } -int pstatus (char *arg) +static int +pstatus(char *arg) { struct ioc_vol v; struct ioc_read_subchannel ss; @@ -933,7 +941,8 @@ dbprog_discid(void) return((n % 0xff) << 24 | t << 8 | ntr); } -int cdid (void) +static int +cdid(void) { u_int id; @@ -947,7 +956,8 @@ int cdid (void) return id ? 0 : 1; } -int info (char *arg __unused) +static int +info(char *arg __unused) { struct ioc_toc_header h; int rc, i, n; @@ -984,7 +994,8 @@ int info (char *arg __unused) return (0); } -void lba2msf (unsigned long lba, u_char *m, u_char *s, u_char *f) +static void +lba2msf(unsigned long lba, u_char *m, u_char *s, u_char *f) { lba += 150; /* block start offset */ lba &= 0xffffff; /* negative lbas use only 24 bits */ @@ -994,12 +1005,14 @@ void lba2msf (unsigned long lba, u_char *f = lba % 75; } -unsigned int msf2lba (u_char m, u_char s, u_char f) +static unsigned int +msf2lba(u_char m, u_char s, u_char f) { return (((m * 60) + s) * 75 + f) - 150; } -void prtrack (struct cd_toc_entry *e, int lastflag) +static void +prtrack(struct cd_toc_entry *e, int lastflag) { int block, next, len; u_char m, s, f; @@ -1037,7 +1050,8 @@ void prtrack (struct cd_toc_entry *e, in (e->control & 4) ? "data" : "audio"); } -int play_track (int tstart, int istart, int tend, int iend) +static int +play_track(int tstart, int istart, int tend, int iend) { struct ioc_play_track t; @@ -1049,7 +1063,8 @@ int play_track (int tstart, int istart, return ioctl (fd, CDIOCPLAYTRACKS, &t); } -int play_blocks (int blk, int len) +static int +play_blocks(int blk, int len) { struct ioc_play_blocks t; @@ -1059,7 +1074,8 @@ int play_blocks (int blk, int len) return ioctl (fd, CDIOCPLAYBLOCKS, &t); } -int setvol (int left, int right) +static int +setvol(int left, int right) { struct ioc_vol v; @@ -1074,7 +1090,8 @@ int setvol (int left, int right) return ioctl (fd, CDIOCSETVOL, &v); } -int read_toc_entrys (int len) +static int +read_toc_entrys(int len) { struct ioc_read_toc_entry t; @@ -1086,7 +1103,8 @@ int read_toc_entrys (int len) return (ioctl (fd, CDIOREADTOCENTRYS, (char *) &t)); } -int play_msf (int start_m, int start_s, int start_f, +static int +play_msf(int start_m, int start_s, int start_f, int end_m, int end_s, int end_f) { struct ioc_play_msf a; @@ -1101,7 +1119,8 @@ int play_msf (int start_m, int start_s, return ioctl (fd, CDIOCPLAYMSF, (char *) &a); } -int status (int *trk, int *min, int *sec, int *frame) +static int +status(int *trk, int *min, int *sec, int *frame) { struct ioc_read_subchannel s; struct cd_sub_channel_info data; @@ -1132,14 +1151,14 @@ int status (int *trk, int *min, int *sec return s.data->header.audio_status; } -const char * +static const char * cdcontrol_prompt(void) { return ("cdcontrol> "); } -char * -input (int *cmd) +static char * +input(int *cmd) { #define MAXLINE 80 static EditLine *el = NULL; @@ -1188,7 +1207,8 @@ input (int *cmd) return (p); } -char *parse (char *buf, int *cmd) +static char * +parse(char *buf, int *cmd) { struct cmdtab *c; char *p; @@ -1252,7 +1272,8 @@ char *parse (char *buf, int *cmd) return p; } -int open_cd (void) +static int +open_cd(void) { char devbuf[MAXPATHLEN]; const char *dev; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 17:20:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36BC5106564A; Sun, 6 Nov 2011 17:20:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2F08FC13; Sun, 6 Nov 2011 17:20:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6HKijU032383; Sun, 6 Nov 2011 17:20:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6HKidM032380; Sun, 6 Nov 2011 17:20:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061720.pA6HKidM032380@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 17:20: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: r227228 - head/usr.bin/chpass X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 17:20:45 -0000 Author: ed Date: Sun Nov 6 17:20:44 2011 New Revision: 227228 URL: http://svn.freebsd.org/changeset/base/227228 Log: Mark the structure fields as const. This allows us to simply place these strings as constants in the table itself, letting the compiler decide to simply merge duplicate strings. Modified: head/usr.bin/chpass/chpass.h head/usr.bin/chpass/table.c Modified: head/usr.bin/chpass/chpass.h ============================================================================== --- head/usr.bin/chpass/chpass.h Sun Nov 6 16:58:17 2011 (r227227) +++ head/usr.bin/chpass/chpass.h Sun Nov 6 17:20:44 2011 (r227228) @@ -48,7 +48,7 @@ typedef struct _entry { int (*func)(char *, struct passwd *, struct _entry *); int restricted; size_t len; - char *except, *save; + const char *except, *save; } ENTRY; /* Field numbers. */ Modified: head/usr.bin/chpass/table.c ============================================================================== --- head/usr.bin/chpass/table.c Sun Nov 6 16:58:17 2011 (r227227) +++ head/usr.bin/chpass/table.c Sun Nov 6 17:20:44 2011 (r227228) @@ -39,27 +39,24 @@ __FBSDID("$FreeBSD$"); #include #include "chpass.h" -char e1[] = ": "; -char e2[] = ":,"; - ENTRY list[] = { - { "login", p_login, 1, 5, e1, NULL }, - { "password", p_passwd, 1, 8, e1, NULL }, - { "uid", p_uid, 1, 3, e1, NULL }, - { "gid", p_gid, 1, 3, e1, NULL }, - { "class", p_class, 1, 5, e1, NULL }, + { "login", p_login, 1, 5, ": ", NULL }, + { "password", p_passwd, 1, 8, ": ", NULL }, + { "uid", p_uid, 1, 3, ": ", NULL }, + { "gid", p_gid, 1, 3, ": ", NULL }, + { "class", p_class, 1, 5, ": ", NULL }, { "change", p_change, 1, 6, NULL, NULL }, { "expire", p_expire, 1, 6, NULL, NULL }, #ifdef RESTRICT_FULLNAME_CHANGE /* do not allow fullname changes */ - { "full name", p_gecos, 1, 9, e2, NULL }, + { "full name", p_gecos, 1, 9, ":,", NULL }, #else - { "full name", p_gecos, 0, 9, e2, NULL }, + { "full name", p_gecos, 0, 9, ":,", NULL }, #endif - { "office phone", p_gecos, 0, 12, e2, NULL }, - { "home phone", p_gecos, 0, 10, e2, NULL }, - { "office location", p_gecos, 0, 15, e2, NULL }, - { "other information", p_gecos, 0, 11, e1, NULL }, - { "home directory", p_hdir, 1, 14, e1, NULL }, - { "shell", p_shell, 0, 5, e1, NULL }, + { "office phone", p_gecos, 0, 12, ":,", NULL }, + { "home phone", p_gecos, 0, 10, ":,", NULL }, + { "office location", p_gecos, 0, 15, ":,", NULL }, + { "other information", p_gecos, 0, 11, ": ", NULL }, + { "home directory", p_hdir, 1, 14, ": ", NULL }, + { "shell", p_shell, 0, 5, ": ", NULL }, { NULL, NULL, 0, 0, NULL, NULL }, }; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 17:30:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D29761065673; Sun, 6 Nov 2011 17:30:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C24DB8FC1E; Sun, 6 Nov 2011 17:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6HUWf2032897; Sun, 6 Nov 2011 17:30:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6HUWwH032895; Sun, 6 Nov 2011 17:30:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111061730.pA6HUWwH032895@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 17:30: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: r227231 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 17:30:32 -0000 Author: ae Date: Sun Nov 6 17:30:32 2011 New Revision: 227231 URL: http://svn.freebsd.org/changeset/base/227231 Log: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC after: 1 week Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 17:25:22 2011 (r227230) +++ head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 17:30:32 2011 (r227231) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 17:32:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4830B1065675; Sun, 6 Nov 2011 17:32:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDB88FC0A; Sun, 6 Nov 2011 17:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6HWUCj033050; Sun, 6 Nov 2011 17:32:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6HWTWw033046; Sun, 6 Nov 2011 17:32:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061732.pA6HWTWw033046@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 17:32: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: r227233 - head/usr.bin/at X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 17:32:30 -0000 Author: ed Date: Sun Nov 6 17:32:29 2011 New Revision: 227233 URL: http://svn.freebsd.org/changeset/base/227233 Log: Add missing static keywords to at(1). While there, tidy up the privs.h part, where at.c has to #define to declare some globals. Also group static and non-static global variables in at.c. Modified: head/usr.bin/at/at.c head/usr.bin/at/parsetime.c head/usr.bin/at/privs.h Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/at.c Sun Nov 6 17:32:29 2011 (r227233) @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); #include "panic.h" #include "parsetime.h" #include "perm.h" - -#define MAIN #include "privs.h" /* Macros */ @@ -90,22 +88,22 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* w /* File scope variables */ -const char *no_export[] = -{ +static const char *no_export[] = { "TERM", "TERMCAP", "DISPLAY", "_" -} ; +}; static int send_mail = 0; +static char *atinput = NULL; /* where to get input from */ +static char atqueue = 0; /* which queue to examine for jobs (atq) */ /* External variables */ extern char **environ; int fcreated; char atfile[] = ATJOB_DIR "12345678901234"; - -char *atinput = (char*)0; /* where to get input from */ -char atqueue = 0; /* which queue to examine for jobs (atq) */ char atverify = 0; /* verify time instead of queuing job */ char *namep; +uid_t real_uid, effective_uid; +gid_t real_gid, effective_gid; /* Function declarations */ Modified: head/usr.bin/at/parsetime.c ============================================================================== --- head/usr.bin/at/parsetime.c Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/parsetime.c Sun Nov 6 17:32:29 2011 (r227233) @@ -72,7 +72,7 @@ enum { /* symbols */ /* parse translation table - table driven parsers can be your FRIEND! */ -struct { +static const struct { const char *name; /* token name */ int value; /* token id */ int plural; /* is this plural? */ Modified: head/usr.bin/at/privs.h ============================================================================== --- head/usr.bin/at/privs.h Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/privs.h Sun Nov 6 17:32:29 2011 (r227233) @@ -59,15 +59,8 @@ * to the real userid before calling any of them. */ -#ifndef MAIN -extern -#endif -uid_t real_uid, effective_uid; - -#ifndef MAIN -extern -#endif -gid_t real_gid, effective_gid; +extern uid_t real_uid, effective_uid; +extern gid_t real_gid, effective_gid; #define RELINQUISH_PRIVS { \ real_uid = getuid(); \ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31A01106564A; Sun, 6 Nov 2011 18:49:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 214908FC17; Sun, 6 Nov 2011 18:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6In4GV035833; Sun, 6 Nov 2011 18:49:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6In4J6035831; Sun, 6 Nov 2011 18:49:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6In4J6035831@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227234 - head/usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:04 -0000 Author: ed Date: Sun Nov 6 18:49:03 2011 New Revision: 227234 URL: http://svn.freebsd.org/changeset/base/227234 Log: Mark global functions and/or variables in checknr(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/checknr/checknr.c Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Sun Nov 6 17:32:29 2011 (r227233) +++ head/usr.bin/checknr/checknr.c Sun Nov 6 18:49:03 2011 (r227234) @@ -59,34 +59,34 @@ __FBSDID("$FreeBSD$"); #define MAXBR 100 /* Max number of bracket pairs known */ #define MAXCMDS 500 /* Max number of commands known */ -void addcmd(char *); -void addmac(const char *); -int binsrch(const char *); -void checkknown(const char *); -void chkcmd(const char *, const char *); -void complain(int); -int eq(const char *, const char *); -void nomatch(const char *); -void pe(int); -void process(FILE *); -void prop(int); +static void addcmd(char *); +static void addmac(const char *); +static int binsrch(const char *); +static void checkknown(const char *); +static void chkcmd(const char *, const char *); +static void complain(int); +static int eq(const char *, const char *); +static void nomatch(const char *); +static void pe(int); +static void process(FILE *); +static void prop(int); static void usage(void); /* * The stack on which we remember what we've seen so far. */ -struct stkstr { +static struct stkstr { int opno; /* number of opening bracket */ int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ int parm; /* parm to size, font, etc */ int lno; /* line number */ } stk[MAXSTK]; -int stktop; +static int stktop; /* * The kinds of opening and closing brackets. */ -struct brstr { +static struct brstr { const char *opbr; const char *clbr; } br[MAXBR] = { @@ -145,7 +145,7 @@ struct brstr { * All commands known to nroff, plus macro packages. * Used so we can complain about unrecognized commands. */ -const char *knowncmds[MAXCMDS] = { +static const char *knowncmds[MAXCMDS] = { "$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t", "(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++", "+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M", @@ -179,13 +179,13 @@ const char *knowncmds[MAXCMDS] = { "yr", 0 }; -int lineno; /* current line number in input file */ -const char *cfilename; /* name of current file */ -int nfiles; /* number of files to process */ -int fflag; /* -f: ignore \f */ -int sflag; /* -s: ignore \s */ -int ncmds; /* size of knowncmds */ -int slot; /* slot in knowncmds found by binsrch */ +static int lineno; /* current line number in input file */ +static const char *cfilename; /* name of current file */ +static int nfiles; /* number of files to process */ +static int fflag; /* -f: ignore \f */ +static int sflag; /* -s: ignore \s */ +static int ncmds; /* size of knowncmds */ +static int slot; /* slot in knowncmds found by binsrch */ int main(int argc, char **argv) @@ -275,7 +275,7 @@ usage(void) exit(1); } -void +static void process(FILE *f) { int i, n; @@ -372,7 +372,7 @@ process(FILE *f) } } -void +static void complain(int i) { pe(stk[i].lno); @@ -381,7 +381,7 @@ complain(int i) printf("\n"); } -void +static void prop(int i) { if (stk[i].pl == 0) @@ -399,7 +399,7 @@ prop(int i) } } -void +static void chkcmd(const char *line __unused, const char *mac) { int i; @@ -435,7 +435,7 @@ chkcmd(const char *line __unused, const } } -void +static void nomatch(const char *mac) { int i, j; @@ -480,14 +480,14 @@ nomatch(const char *mac) } /* eq: are two strings equal? */ -int +static int eq(const char *s1, const char *s2) { return (strcmp(s1, s2) == 0); } /* print the first part of an error message, given the line number */ -void +static void pe(int linen) { if (nfiles > 1) @@ -495,7 +495,7 @@ pe(int linen) printf("%d: ", linen); } -void +static void checkknown(const char *mac) { @@ -513,7 +513,7 @@ checkknown(const char *mac) /* * We have a .de xx line in "line". Add xx to the list of known commands. */ -void +static void addcmd(char *line) { char *mac; @@ -544,7 +544,7 @@ addcmd(char *line) * me someday?) Anyway, I claim that .de is fairly rare in user * nroff programs, and the register loop below is pretty fast. */ -void +static void addmac(const char *mac) { const char **src, **dest, **loc; @@ -575,7 +575,7 @@ printf("after: %s %s %s %s %s, %d cmds\n * Do a binary search in knowncmds for mac. * If found, return the index. If not, return -1. */ -int +static int binsrch(const char *mac) { const char *p; /* pointer to current cmd in list */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03EB61065704; Sun, 6 Nov 2011 18:49:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E33C8FC15; Sun, 6 Nov 2011 18:49:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InA1e035873; Sun, 6 Nov 2011 18:49:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InAD6035871; Sun, 6 Nov 2011 18:49:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InAD6035871@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227235 - head/usr.bin/comm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:12 -0000 Author: ed Date: Sun Nov 6 18:49:10 2011 New Revision: 227235 URL: http://svn.freebsd.org/changeset/base/227235 Log: Mark global functions and/or variables in comm(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/comm/comm.c Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Sun Nov 6 18:49:03 2011 (r227234) +++ head/usr.bin/comm/comm.c Sun Nov 6 18:49:10 2011 (r227235) @@ -57,12 +57,12 @@ __FBSDID("$FreeBSD$"); #include #include -int iflag; -const char *tabs[] = { "", "\t", "\t\t" }; +static int iflag; +static const char *tabs[] = { "", "\t", "\t\t" }; -FILE *file(const char *); -wchar_t *convert(const char *); -void show(FILE *, const char *, const char *, char **, size_t *); +static FILE *file(const char *); +static wchar_t *convert(const char *); +static void show(FILE *, const char *, const char *, char **, size_t *); static void usage(void); int @@ -189,7 +189,7 @@ main(int argc, char *argv[]) exit(0); } -wchar_t * +static wchar_t * convert(const char *str) { size_t n; @@ -212,7 +212,7 @@ convert(const char *str) return (buf); } -void +static void show(FILE *fp, const char *fn, const char *offset, char **bufp, size_t *buflenp) { ssize_t n; @@ -228,7 +228,7 @@ show(FILE *fp, const char *fn, const cha err(1, "%s", fn); } -FILE * +static FILE * file(const char *name) { FILE *fp; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807941065799; Sun, 6 Nov 2011 18:49:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5235A8FC19; Sun, 6 Nov 2011 18:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InG6R035912; Sun, 6 Nov 2011 18:49:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InG1V035910; Sun, 6 Nov 2011 18:49:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InG1V035910@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227236 - head/usr.bin/compress X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:16 -0000 Author: ed Date: Sun Nov 6 18:49:16 2011 New Revision: 227236 URL: http://svn.freebsd.org/changeset/base/227236 Log: Mark global functions and/or variables in compress(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/compress/compress.c Modified: head/usr.bin/compress/compress.c ============================================================================== --- head/usr.bin/compress/compress.c Sun Nov 6 18:49:10 2011 (r227235) +++ head/usr.bin/compress/compress.c Sun Nov 6 18:49:16 2011 (r227236) @@ -56,15 +56,15 @@ __FBSDID("$FreeBSD$"); #include "zopen.h" -void compress(const char *, const char *, int); -void cwarn(const char *, ...) __printflike(1, 2); -void cwarnx(const char *, ...) __printflike(1, 2); -void decompress(const char *, const char *, int); -int permission(const char *); -void setfile(const char *, struct stat *); -void usage(int); +static void compress(const char *, const char *, int); +static void cwarn(const char *, ...) __printflike(1, 2); +static void cwarnx(const char *, ...) __printflike(1, 2); +static void decompress(const char *, const char *, int); +static int permission(const char *); +static void setfile(const char *, struct stat *); +static void usage(int); -int eval, force, verbose; +static int eval, force, verbose; int main(int argc, char *argv[]) @@ -191,7 +191,7 @@ main(int argc, char *argv[]) exit (eval); } -void +static void compress(const char *in, const char *out, int bits) { size_t nr; @@ -281,7 +281,7 @@ err: if (ofp) { (void)fclose(ifp); } -void +static void decompress(const char *in, const char *out, int bits) { size_t nr; @@ -357,7 +357,7 @@ err: if (ofp) { (void)fclose(ifp); } -void +static void setfile(const char *name, struct stat *fs) { static struct timeval tv[2]; @@ -387,7 +387,7 @@ setfile(const char *name, struct stat *f cwarn("chflags: %s", name); } -int +static int permission(const char *fname) { int ch, first; @@ -401,7 +401,7 @@ permission(const char *fname) return (first == 'y'); } -void +static void usage(int iscompress) { if (iscompress) @@ -413,7 +413,7 @@ usage(int iscompress) exit(1); } -void +static void cwarnx(const char *fmt, ...) { va_list ap; @@ -424,7 +424,7 @@ cwarnx(const char *fmt, ...) eval = 1; } -void +static void cwarn(const char *fmt, ...) { va_list ap; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5861810658A4; Sun, 6 Nov 2011 18:49:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48A5E8FC13; Sun, 6 Nov 2011 18:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InOTo035953; Sun, 6 Nov 2011 18:49:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InOTm035951; Sun, 6 Nov 2011 18:49:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InOTm035951@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227237 - head/usr.bin/enigma X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:24 -0000 Author: ed Date: Sun Nov 6 18:49:23 2011 New Revision: 227237 URL: http://svn.freebsd.org/changeset/base/227237 Log: Mark global functions and/or variables in enigma(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/enigma/enigma.c Modified: head/usr.bin/enigma/enigma.c ============================================================================== --- head/usr.bin/enigma/enigma.c Sun Nov 6 18:49:16 2011 (r227236) +++ head/usr.bin/enigma/enigma.c Sun Nov 6 18:49:23 2011 (r227237) @@ -25,16 +25,16 @@ __FBSDID("$FreeBSD$"); #define ECHO 010 #define ROTORSZ 256 #define MASK 0377 -char t1[ROTORSZ]; -char t2[ROTORSZ]; -char t3[ROTORSZ]; -char deck[ROTORSZ]; -char buf[13]; +static char t1[ROTORSZ]; +static char t2[ROTORSZ]; +static char t3[ROTORSZ]; +static char deck[ROTORSZ]; +static char buf[13]; -void shuffle(char *); -void setup(char *); +static void shuffle(char *); +static void setup(char *); -void +static void setup(char *pw) { int ic, i, k, temp; @@ -128,7 +128,7 @@ main(int argc, char *argv[]) return 0; } -void +static void shuffle(char deckary[]) { int i, ic, k, temp; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37741065890; Sun, 6 Nov 2011 18:49:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B2D8FC0A; Sun, 6 Nov 2011 18:49:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InUTV035992; Sun, 6 Nov 2011 18:49:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InUJB035990; Sun, 6 Nov 2011 18:49:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InUJB035990@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227238 - head/usr.bin/expand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:31 -0000 Author: ed Date: Sun Nov 6 18:49:30 2011 New Revision: 227238 URL: http://svn.freebsd.org/changeset/base/227238 Log: Mark global functions and/or variables in expand(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/expand/expand.c Modified: head/usr.bin/expand/expand.c ============================================================================== --- head/usr.bin/expand/expand.c Sun Nov 6 18:49:23 2011 (r227237) +++ head/usr.bin/expand/expand.c Sun Nov 6 18:49:30 2011 (r227238) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); /* * expand - expand tabs to equivalent spaces */ -int nstops; -int tabstops[100]; +static int nstops; +static int tabstops[100]; static void getstops(char *); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF561065A83; Sun, 6 Nov 2011 18:49:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609FE8FC15; Sun, 6 Nov 2011 18:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Inafd036032; Sun, 6 Nov 2011 18:49:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Inadi036029; Sun, 6 Nov 2011 18:49:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6Inadi036029@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227239 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:37 -0000 Author: ed Date: Sun Nov 6 18:49:36 2011 New Revision: 227239 URL: http://svn.freebsd.org/changeset/base/227239 Log: Mark global functions and/or variables in fstat(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/fstat/fstat.c head/usr.bin/fstat/fuser.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Sun Nov 6 18:49:30 2011 (r227238) +++ head/usr.bin/fstat/fstat.c Sun Nov 6 18:49:36 2011 (r227239) @@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$"); #include "functions.h" -int fsflg, /* show files on same filesystem as file(s) argument */ - pflg, /* show files open by a particular pid */ - uflg; /* show files open by a particular (effective) user */ -int checkfile; /* true if restricting to particular files or filesystems */ -int nflg; /* (numerical) display f.s. and rdev as dev_t */ -int mflg; /* include memory-mapped files */ -int vflg; /* be verbose */ +static int fsflg, /* show files on same filesystem as file(s) argument */ + pflg, /* show files open by a particular pid */ + uflg; /* show files open by a particular (effective) user */ +static int checkfile; /* restrict to particular files or filesystems */ +static int nflg; /* (numerical) display f.s. and rdev as dev_t */ +static int mflg; /* include memory-mapped files */ +static int vflg; /* be verbose */ typedef struct devs { struct devs *next; @@ -72,8 +72,8 @@ typedef struct devs { const char *name; } DEVS; -DEVS *devs; -char *memf, *nlistf; +static DEVS *devs; +static char *memf, *nlistf; static int getfname(const char *filename); static void dofiles(struct procstat *procstat, struct kinfo_proc *p); Modified: head/usr.bin/fstat/fuser.c ============================================================================== --- head/usr.bin/fstat/fuser.c Sun Nov 6 18:49:30 2011 (r227238) +++ head/usr.bin/fstat/fuser.c Sun Nov 6 18:49:36 2011 (r227239) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); /* * File access mode flags table. */ -struct { +static const struct { int flag; char ch; } fflags[] = { @@ -67,7 +67,7 @@ struct { /* * Usage flags translation table. */ -struct { +static const struct { int flag; char ch; } uflags[] = { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424A01065881; Sun, 6 Nov 2011 18:49:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3288D8FC18; Sun, 6 Nov 2011 18:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Ingbp036071; Sun, 6 Nov 2011 18:49:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6IngsR036069; Sun, 6 Nov 2011 18:49:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6IngsR036069@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227240 - head/usr.bin/lam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:42 -0000 Author: ed Date: Sun Nov 6 18:49:41 2011 New Revision: 227240 URL: http://svn.freebsd.org/changeset/base/227240 Log: Mark global functions and/or variables in lam(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/lam/lam.c Modified: head/usr.bin/lam/lam.c ============================================================================== --- head/usr.bin/lam/lam.c Sun Nov 6 18:49:36 2011 (r227239) +++ head/usr.bin/lam/lam.c Sun Nov 6 18:49:41 2011 (r227240) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define MAXOFILES 20 #define BIGBUFSIZ 5 * BUFSIZ -struct openfile { /* open file structure */ +static struct openfile { /* open file structure */ FILE *fp; /* file pointer */ short eof; /* eof flag */ short pad; /* pad flag for missing columns */ @@ -64,10 +64,10 @@ struct openfile { /* open file structur const char *format; /* printf(3) style string spec. */ } input[MAXOFILES]; -int morefiles; /* set by getargs(), changed by gatherline() */ -int nofinalnl; /* normally append \n to each output line */ -char line[BIGBUFSIZ]; -char *linep; +static int morefiles; /* set by getargs(), changed by gatherline() */ +static int nofinalnl; /* normally append \n to each output line */ +static char line[BIGBUFSIZ]; +static char *linep; static char *gatherline(struct openfile *); static void getargs(char *[]); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 256FD10657A0; Sun, 6 Nov 2011 18:49:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D86F8FC22; Sun, 6 Nov 2011 18:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InmLB036112; Sun, 6 Nov 2011 18:49:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Inmbh036109; Sun, 6 Nov 2011 18:49:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6Inmbh036109@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227241 - head/usr.bin/m4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:49 -0000 Author: ed Date: Sun Nov 6 18:49:48 2011 New Revision: 227241 URL: http://svn.freebsd.org/changeset/base/227241 Log: Mark global functions and/or variables in m4(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/m4/gnum4.c head/usr.bin/m4/main.c Modified: head/usr.bin/m4/gnum4.c ============================================================================== --- head/usr.bin/m4/gnum4.c Sun Nov 6 18:49:41 2011 (r227240) +++ head/usr.bin/m4/gnum4.c Sun Nov 6 18:49:48 2011 (r227241) @@ -60,7 +60,7 @@ int mimic_gnu = 0; * Then M4PATH env variable */ -struct path_entry { +static struct path_entry { char *name; struct path_entry *next; } *first, *last; Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Sun Nov 6 18:49:41 2011 (r227240) +++ head/usr.bin/m4/main.c Sun Nov 6 18:49:48 2011 (r227241) @@ -99,7 +99,7 @@ char scommt[MAXCCHARS+1] = {SCOMMT}; /* char ecommt[MAXCCHARS+1] = {ECOMMT}; /* end character for comment */ int synccpp; /* Line synchronisation for C preprocessor */ -struct keyblk keywrds[] = { /* m4 keywords to be installed */ +static const struct keyblk keywrds[] = { /* m4 keywords to be installed */ { "include", INCLTYPE }, { "sinclude", SINCTYPE }, { "define", DEFITYPE }, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:49:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2032610657CF; Sun, 6 Nov 2011 18:49:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10A368FC14; Sun, 6 Nov 2011 18:49:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6InrZn036151; Sun, 6 Nov 2011 18:49:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6InrOg036149; Sun, 6 Nov 2011 18:49:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6InrOg036149@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49: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: r227242 - head/usr.bin/paste X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:49:54 -0000 Author: ed Date: Sun Nov 6 18:49:53 2011 New Revision: 227242 URL: http://svn.freebsd.org/changeset/base/227242 Log: Mark global functions and/or variables in paste(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/paste/paste.c Modified: head/usr.bin/paste/paste.c ============================================================================== --- head/usr.bin/paste/paste.c Sun Nov 6 18:49:48 2011 (r227241) +++ head/usr.bin/paste/paste.c Sun Nov 6 18:49:53 2011 (r227242) @@ -57,15 +57,15 @@ __FBSDID("$FreeBSD$"); #include #include -wchar_t *delim; -int delimcnt; +static wchar_t *delim; +static int delimcnt; -int parallel(char **); -int sequential(char **); -int tr(wchar_t *); +static int parallel(char **); +static int sequential(char **); +static int tr(wchar_t *); static void usage(void); -wchar_t tab[] = L"\t"; +static wchar_t tab[] = L"\t"; int main(int argc, char *argv[]) @@ -125,7 +125,7 @@ typedef struct _list { char *name; } LIST; -int +static int parallel(char **argv) { LIST *lp; @@ -195,7 +195,7 @@ parallel(char **argv) return (0); } -int +static int sequential(char **argv) { FILE *fp; @@ -235,7 +235,7 @@ sequential(char **argv) return (failed != 0); } -int +static int tr(wchar_t *arg) { int cnt; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:50:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C14F810659E2; Sun, 6 Nov 2011 18:50:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80EC48FC1D; Sun, 6 Nov 2011 18:50:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Io0oO036191; Sun, 6 Nov 2011 18:50:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Io0VA036189; Sun, 6 Nov 2011 18:50:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061850.pA6Io0VA036189@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:50: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: r227243 - head/usr.bin/unifdef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:50:07 -0000 Author: ed Date: Sun Nov 6 18:50:00 2011 New Revision: 227243 URL: http://svn.freebsd.org/changeset/base/227243 Log: Mark global functions and/or variables in unifdef(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Sun Nov 6 18:49:53 2011 (r227242) +++ head/usr.bin/unifdef/unifdef.c Sun Nov 6 18:50:00 2011 (r227243) @@ -56,7 +56,7 @@ #include #include -const char copyright[] = +static const char copyright[] = "@(#) $Version: unifdef-2.5.6.21f1388 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:50:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F331065831; Sun, 6 Nov 2011 18:50:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9E88FC27; Sun, 6 Nov 2011 18:50:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6IoK0N036239; Sun, 6 Nov 2011 18:50:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6IoKQA036237; Sun, 6 Nov 2011 18:50:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061850.pA6IoKQA036237@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:50: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: r227244 - head/usr.bin/whereis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:50:20 -0000 Author: ed Date: Sun Nov 6 18:50:19 2011 New Revision: 227244 URL: http://svn.freebsd.org/changeset/base/227244 Log: Mark global functions and/or variables in whereis(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Sun Nov 6 18:50:00 2011 (r227243) +++ head/usr.bin/whereis/whereis.c Sun Nov 6 18:50:19 2011 (r227244) @@ -56,18 +56,18 @@ __FBSDID("$FreeBSD$"); typedef const char *ccharp; -int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x; -ccharp *bindirs, *mandirs, *sourcedirs; -char **query; - -const char *sourcepath = PATH_SOURCES; - -char *colonify(ccharp *); -int contains(ccharp *, const char *); -void decolonify(char *, ccharp **, int *); -void defaults(void); -void scanopts(int, char **); -void usage(void); +static int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x; +static ccharp *bindirs, *mandirs, *sourcedirs; +static char **query; + +static const char *sourcepath = PATH_SOURCES; + +static char *colonify(ccharp *); +static int contains(ccharp *, const char *); +static void decolonify(char *, ccharp **, int *); +static void defaults(void); +static void scanopts(int, char **); +static void usage(void); /* * Throughout this program, a number of strings are dynamically @@ -85,7 +85,7 @@ void usage(void); * abort(3) in case of an allocation failure. */ -void +static void usage(void) { (void)fprintf(stderr, @@ -99,7 +99,7 @@ usage(void) * Note that the -B/-M/-S options expect a list of directory * names that must be terminated with -f. */ -void +static void scanopts(int argc, char **argv) { int c, i; @@ -174,7 +174,7 @@ scanopts(int argc, char **argv) /* * Find out whether string `s' is contained in list `cpp'. */ -int +static int contains(ccharp *cpp, const char *s) { ccharp cp; @@ -197,7 +197,7 @@ contains(ccharp *cpp, const char *s) * partial string is only added if it has a length greater than 0, and * if it's not already contained in the string list. */ -void +static void decolonify(char *s, ccharp **cppp, int *ip) { char *cp; @@ -223,7 +223,7 @@ decolonify(char *s, ccharp **cppp, int * /* * Join string list `cpp' into a colon-separated string. */ -char * +static char * colonify(ccharp *cpp) { size_t s; @@ -249,7 +249,7 @@ colonify(ccharp *cpp) /* * Provide defaults for all options and directory lists. */ -void +static void defaults(void) { size_t s; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:50:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 228F810657DD; Sun, 6 Nov 2011 18:50:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12CF08FC18; Sun, 6 Nov 2011 18:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6IoQsL036279; Sun, 6 Nov 2011 18:50:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6IoQGd036277; Sun, 6 Nov 2011 18:50:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061850.pA6IoQGd036277@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227245 - head/usr.bin/which X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:50:27 -0000 Author: ed Date: Sun Nov 6 18:50:26 2011 New Revision: 227245 URL: http://svn.freebsd.org/changeset/base/227245 Log: Mark global functions and/or variables in which(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/which/which.c Modified: head/usr.bin/which/which.c ============================================================================== --- head/usr.bin/which/which.c Sun Nov 6 18:50:19 2011 (r227244) +++ head/usr.bin/which/which.c Sun Nov 6 18:50:26 2011 (r227245) @@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$"); static void usage(void); static int print_matches(char *, char *); -int silent; -int allpaths; +static int silent; +static int allpaths; int main(int argc, char **argv) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:50:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C3DF1065A48; Sun, 6 Nov 2011 18:50:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA2F8FC20; Sun, 6 Nov 2011 18:50:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6IoXvL036320; Sun, 6 Nov 2011 18:50:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6IoXua036318; Sun, 6 Nov 2011 18:50:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061850.pA6IoXua036318@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:50: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: r227246 - head/usr.bin/whois X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:50:33 -0000 Author: ed Date: Sun Nov 6 18:50:33 2011 New Revision: 227246 URL: http://svn.freebsd.org/changeset/base/227246 Log: Mark global functions and/or variables in whois(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Sun Nov 6 18:50:26 2011 (r227245) +++ head/usr.bin/whois/whois.c Sun Nov 6 18:50:33 2011 (r227246) @@ -81,9 +81,9 @@ __FBSDID("$FreeBSD$"); #define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-') -const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, - FNICHOST, NULL }; -const char *port = DEFAULT_PORT; +static const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, + FNICHOST, NULL }; +static const char *port = DEFAULT_PORT; static char *choose_server(char *); static struct addrinfo *gethostinfo(char const *host, int exit_on_error); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:50:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3F91065B4D; Sun, 6 Nov 2011 18:50:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 571938FC13; Sun, 6 Nov 2011 18:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Iodl2036359; Sun, 6 Nov 2011 18:50:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Iod95036357; Sun, 6 Nov 2011 18:50:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061850.pA6Iod95036357@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:50: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: r227247 - head/usr.bin/xstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:50:40 -0000 Author: ed Date: Sun Nov 6 18:50:39 2011 New Revision: 227247 URL: http://svn.freebsd.org/changeset/base/227247 Log: Mark global functions and/or variables in xstr(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/xstr/xstr.c Modified: head/usr.bin/xstr/xstr.c ============================================================================== --- head/usr.bin/xstr/xstr.c Sun Nov 6 18:50:33 2011 (r227246) +++ head/usr.bin/xstr/xstr.c Sun Nov 6 18:50:39 2011 (r227247) @@ -62,35 +62,35 @@ static const char sccsid[] = "@(#)xstr.c #define ignore(a) ((void) a) -off_t tellpt; +static off_t tellpt; -off_t mesgpt; -char cstrings[] = "strings"; -char *strings = cstrings; +static off_t mesgpt; +static char cstrings[] = "strings"; +static char *strings = cstrings; -int cflg; -int vflg; -int readstd; +static int cflg; +static int vflg; +static int readstd; -char lastchr(char *); +static char lastchr(char *); -int fgetNUL(char *, int, FILE *); -int istail(char *, char *); -int octdigit(char); -int xgetc(FILE *); +static int fgetNUL(char *, int, FILE *); +static int istail(char *, char *); +static int octdigit(char); +static int xgetc(FILE *); -off_t hashit(char *, int); -off_t yankstr(char **); +static off_t hashit(char *, int); +static off_t yankstr(char **); static void usage(void); -void flushsh(void); -void found(int, off_t, char *); -void inithash(void); -void onintr(int); -void process(const char *); -void prstr(char *); -void xsdotc(void); +static void flushsh(void); +static void found(int, off_t, char *); +static void inithash(void); +static void onintr(int); +static void process(const char *); +static void prstr(char *); +static void xsdotc(void); int main(int argc, char *argv[]) @@ -155,9 +155,9 @@ usage(void) exit (1); } -char linebuf[BUFSIZ]; +static char linebuf[BUFSIZ]; -void +static void process(const char *name) { char *cp; @@ -225,7 +225,7 @@ out: warn("x.c"), onintr(0); } -off_t +static off_t yankstr(char **cpp) { char *cp = *cpp; @@ -285,13 +285,13 @@ out: return (hashit(dbuf, 1)); } -int +static int octdigit(char c) { return (isdigit(c) && c != '8' && c != '9'); } -void +static void inithash(void) { char buf[BUFSIZ]; @@ -308,7 +308,7 @@ inithash(void) ignore(fclose(mesgread)); } -int +static int fgetNUL(char *obuf, int rmdr, FILE *file) { int c; @@ -320,7 +320,7 @@ fgetNUL(char *obuf, int rmdr, FILE *file return ((feof(file) || ferror(file)) ? 0 : 1); } -int +static int xgetc(FILE *file) { @@ -330,14 +330,14 @@ xgetc(FILE *file) #define BUCKETS 128 -struct hash { +static struct hash { off_t hpt; char *hstr; struct hash *hnext; short hnew; } bucket[BUCKETS]; -off_t +static off_t hashit(char *str, int new) { int i; @@ -362,7 +362,7 @@ hashit(char *str, int new) return (hp->hpt); } -void +static void flushsh(void) { int i; @@ -395,7 +395,7 @@ flushsh(void) err(4, "%s", strings); } -void +static void found(int new, off_t off, char *str) { if (vflg == 0) @@ -408,7 +408,7 @@ found(int new, off_t off, char *str) fprintf(stderr, "\n"); } -void +static void prstr(char *cp) { int c; @@ -424,7 +424,7 @@ prstr(char *cp) fprintf(stderr, "%c", c); } -void +static void xsdotc(void) { FILE *strf = fopen(strings, "r"); @@ -459,7 +459,7 @@ out: ignore(fclose(strf)); } -char +static char lastchr(char *cp) { @@ -468,7 +468,7 @@ lastchr(char *cp) return (*cp); } -int +static int istail(char *str, char *of) { int d = strlen(of) - strlen(str); @@ -478,7 +478,7 @@ istail(char *str, char *of) return (d); } -void +static void onintr(int dummy __unused) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 18:59:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64549106566B; Sun, 6 Nov 2011 18:59:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ACC18FC0C; Sun, 6 Nov 2011 18:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Ixha1036664; Sun, 6 Nov 2011 18:59:43 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Ixho6036662; Sun, 6 Nov 2011 18:59:43 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111061859.pA6Ixho6036662@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 18:59: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: r227248 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 18:59:43 -0000 Author: ae Date: Sun Nov 6 18:59:42 2011 New Revision: 227248 URL: http://svn.freebsd.org/changeset/base/227248 Log: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC after: 1 week Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 18:50:39 2011 (r227247) +++ head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 18:59:42 2011 (r227248) @@ -836,6 +836,11 @@ getasciilabel(FILE *f, struct disklabel "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1149,23 +1154,42 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions == 0 || + lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:01:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88C2F1065672; Sun, 6 Nov 2011 19:01:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78F7F8FC15; Sun, 6 Nov 2011 19:01:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J1UoE036777; Sun, 6 Nov 2011 19:01:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J1UPG036775; Sun, 6 Nov 2011 19:01:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061901.pA6J1UPG036775@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:01: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: r227249 - head/usr.sbin/apm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:01:30 -0000 Author: ed Date: Sun Nov 6 19:01:30 2011 New Revision: 227249 URL: http://svn.freebsd.org/changeset/base/227249 Log: Mark global functions and/or variables in apm(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/apm/apm.c Modified: head/usr.sbin/apm/apm.c ============================================================================== --- head/usr.sbin/apm/apm.c Sun Nov 6 18:59:42 2011 (r227248) +++ head/usr.sbin/apm/apm.c Sun Nov 6 19:01:30 2011 (r227249) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #define xl(a) ((a) & 0xff) #define APMERR(a) xh(a) -int cmos_wall = 0; /* True when wall time is in cmos clock, else UTC */ +static int cmos_wall = 0; /* True when wall time is in cmos clock, else UTC */ static void usage(void) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:01:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E046A1065787; Sun, 6 Nov 2011 19:01:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0468FC17; Sun, 6 Nov 2011 19:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J1a8d036817; Sun, 6 Nov 2011 19:01:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J1ap5036815; Sun, 6 Nov 2011 19:01:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061901.pA6J1ap5036815@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19: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: r227250 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:01:37 -0000 Author: ed Date: Sun Nov 6 19:01:35 2011 New Revision: 227250 URL: http://svn.freebsd.org/changeset/base/227250 Log: Mark global functions and/or variables in boot0cfg(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Sun Nov 6 19:01:30 2011 (r227249) +++ head/usr.sbin/boot0cfg/boot0cfg.c Sun Nov 6 19:01:35 2011 (r227250) @@ -60,13 +60,13 @@ struct opt_offsets { int ticks; }; -struct opt_offsets b0_ofs[] = { +static struct opt_offsets b0_ofs[] = { { 0x0, 0x0, 0x0, 0x0 }, /* no boot block */ { 0x1b9, 0x1ba, 0x1bb, 0x1bc }, /* original block */ { 0x1b5, 0x1b6, 0x1b7, 0x1bc }, /* NT_SERIAL block */ }; -int b0_ver; /* boot block version set by boot0bs */ +static int b0_ver; /* boot block version set by boot0bs */ #define OFF_OPT (b0_ofs[b0_ver].opt) /* default boot option */ #define OFF_DRIVE (b0_ofs[b0_ver].drive) /* setdrv drive */ @@ -106,9 +106,9 @@ static int argtoi(const char *, int, int static int set_bell(u_int8_t *, int, int); static void usage(void); -unsigned vol_id[5]; /* 4 plus 1 for flag */ +static unsigned vol_id[5]; /* 4 plus 1 for flag */ -int v_flag; +static int v_flag; /* * Boot manager installation/configuration utility. */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:01:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34834106578A; Sun, 6 Nov 2011 19:01:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 249638FC08; Sun, 6 Nov 2011 19:01:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J1gIA036856; Sun, 6 Nov 2011 19:01:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J1gTT036854; Sun, 6 Nov 2011 19:01:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061901.pA6J1gTT036854@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:01: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: r227251 - head/usr.sbin/chown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:01:42 -0000 Author: ed Date: Sun Nov 6 19:01:41 2011 New Revision: 227251 URL: http://svn.freebsd.org/changeset/base/227251 Log: Mark global functions and/or variables in chown(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/chown/chown.c Modified: head/usr.sbin/chown/chown.c ============================================================================== --- head/usr.sbin/chown/chown.c Sun Nov 6 19:01:35 2011 (r227250) +++ head/usr.sbin/chown/chown.c Sun Nov 6 19:01:41 2011 (r227251) @@ -57,16 +57,16 @@ __FBSDID("$FreeBSD$"); #include #include -void a_gid(const char *); -void a_uid(const char *); -void chownerr(const char *); -uid_t id(const char *, const char *); -void usage(void); - -uid_t uid; -gid_t gid; -int ischown; -const char *gname; +static void a_gid(const char *); +static void a_uid(const char *); +static void chownerr(const char *); +static uid_t id(const char *, const char *); +static void usage(void); + +static uid_t uid; +static gid_t gid; +static int ischown; +static const char *gname; int main(int argc, char **argv) @@ -229,7 +229,7 @@ main(int argc, char **argv) exit(rval); } -void +static void a_gid(const char *s) { struct group *gr; @@ -240,7 +240,7 @@ a_gid(const char *s) gid = ((gr = getgrnam(s)) != NULL) ? gr->gr_gid : id(s, "group"); } -void +static void a_uid(const char *s) { struct passwd *pw; @@ -250,7 +250,7 @@ a_uid(const char *s) uid = ((pw = getpwnam(s)) != NULL) ? pw->pw_uid : id(s, "user"); } -uid_t +static uid_t id(const char *name, const char *type) { uid_t val; @@ -267,7 +267,7 @@ id(const char *name, const char *type) return (val); } -void +static void chownerr(const char *file) { static uid_t euid = -1; @@ -299,7 +299,7 @@ chownerr(const char *file) warn("%s", file); } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:01:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7680910658DC; Sun, 6 Nov 2011 19:01:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 669028FC15; Sun, 6 Nov 2011 19:01:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J1mbx036895; Sun, 6 Nov 2011 19:01:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J1mj0036893; Sun, 6 Nov 2011 19:01:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061901.pA6J1mj0036893@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227252 - head/usr.sbin/devinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:01:48 -0000 Author: ed Date: Sun Nov 6 19:01:48 2011 New Revision: 227252 URL: http://svn.freebsd.org/changeset/base/227252 Log: Mark global functions and/or variables in devinfo(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/devinfo/devinfo.c Modified: head/usr.sbin/devinfo/devinfo.c ============================================================================== --- head/usr.sbin/devinfo/devinfo.c Sun Nov 6 19:01:41 2011 (r227251) +++ head/usr.sbin/devinfo/devinfo.c Sun Nov 6 19:01:48 2011 (r227252) @@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include "devinfo.h" -int rflag; -int vflag; +static int rflag; +static int vflag; static void print_resource(struct devinfo_res *); static int print_device_matching_resource(struct devinfo_res *, void *); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:01:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34BDD10657AE; Sun, 6 Nov 2011 19:01:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24DEC8FC20; Sun, 6 Nov 2011 19:01:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J1svU036935; Sun, 6 Nov 2011 19:01:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J1sM6036933; Sun, 6 Nov 2011 19:01:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061901.pA6J1sM6036933@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227253 - head/usr.sbin/fdread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:01:55 -0000 Author: ed Date: Sun Nov 6 19:01:54 2011 New Revision: 227253 URL: http://svn.freebsd.org/changeset/base/227253 Log: Mark global functions and/or variables in fdread(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/fdread/fdread.c Modified: head/usr.sbin/fdread/fdread.c ============================================================================== --- head/usr.sbin/fdread/fdread.c Sun Nov 6 19:01:48 2011 (r227252) +++ head/usr.sbin/fdread/fdread.c Sun Nov 6 19:01:54 2011 (r227253) @@ -44,14 +44,14 @@ #include "fdutil.h" -int quiet, recover; -unsigned char fillbyte = 0xf0; /* "foo" */ +static int quiet, recover; +static unsigned char fillbyte = 0xf0; /* "foo" */ -int doread(int fd, FILE *of, const char *_devname); -int doreadid(int fd, unsigned int numids, unsigned int trackno); -void usage(void); +static int doread(int fd, FILE *of, const char *_devname); +static int doreadid(int fd, unsigned int numids, unsigned int trackno); +static void usage(void); -void +static void usage(void) { @@ -155,7 +155,7 @@ main(int argc, char **argv) return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); } -int +static int doread(int fd, FILE *of, const char *_devname) { char *trackbuf; @@ -294,7 +294,7 @@ doread(int fd, FILE *of, const char *_de return (nerrs? EX_IOERR: EX_OK); } -int +static int doreadid(int fd, unsigned int numids, unsigned int trackno) { int rv = 0; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4332F106567B; Sun, 6 Nov 2011 19:02:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 337198FC1D; Sun, 6 Nov 2011 19:02:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J208c036973; Sun, 6 Nov 2011 19:02:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J20bh036971; Sun, 6 Nov 2011 19:02:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J20bh036971@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227254 - head/usr.sbin/memcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:00 -0000 Author: ed Date: Sun Nov 6 19:01:59 2011 New Revision: 227254 URL: http://svn.freebsd.org/changeset/base/227254 Log: Mark global functions and/or variables in memcontrol(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/memcontrol/memcontrol.c Modified: head/usr.sbin/memcontrol/memcontrol.c ============================================================================== --- head/usr.sbin/memcontrol/memcontrol.c Sun Nov 6 19:01:54 2011 (r227253) +++ head/usr.sbin/memcontrol/memcontrol.c Sun Nov 6 19:01:59 2011 (r227254) @@ -39,8 +39,7 @@ #include #include -struct -{ +static struct { const char *name; int val; int kind; @@ -67,8 +66,7 @@ static void clearfunc(int memfd, int arg static void helpfunc(int memfd, int argc, char *argv[]); static void help(const char *what); -struct -{ +static struct { const char *cmd; const char *desc; void (*func)(int memfd, int argc, char *argv[]); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C677110656EE; Sun, 6 Nov 2011 19:02:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1D3A8FC17; Sun, 6 Nov 2011 19:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2DkT037014; Sun, 6 Nov 2011 19:02:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2DRP037013; Sun, 6 Nov 2011 19:02:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2DRP037013@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227255 - head/usr.sbin/mixer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:14 -0000 Author: ed Date: Sun Nov 6 19:02:13 2011 New Revision: 227255 URL: http://svn.freebsd.org/changeset/base/227255 Log: Mark global functions and/or variables in mixer(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/mixer/mixer.c Modified: head/usr.sbin/mixer/mixer.c ============================================================================== --- head/usr.sbin/mixer/mixer.c Sun Nov 6 19:01:59 2011 (r227254) +++ head/usr.sbin/mixer/mixer.c Sun Nov 6 19:02:13 2011 (r227255) @@ -24,7 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include -const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; +static const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; static void usage(int devmask, int recmask); static int res_name(const char *name, int mask); From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78C4510657F4; Sun, 6 Nov 2011 19:02:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6863C8FC18; Sun, 6 Nov 2011 19:02:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2KnY037054; Sun, 6 Nov 2011 19:02:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2KtN037052; Sun, 6 Nov 2011 19:02:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2KtN037052@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227256 - head/usr.sbin/moused X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:20 -0000 Author: ed Date: Sun Nov 6 19:02:20 2011 New Revision: 227256 URL: http://svn.freebsd.org/changeset/base/227256 Log: Mark global functions and/or variables in moused(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/moused/moused.c Modified: head/usr.sbin/moused/moused.c ============================================================================== --- head/usr.sbin/moused/moused.c Sun Nov 6 19:02:13 2011 (r227255) +++ head/usr.sbin/moused/moused.c Sun Nov 6 19:02:20 2011 (r227256) @@ -174,14 +174,14 @@ typedef struct { /* global variables */ -int debug = 0; -int nodaemon = FALSE; -int background = FALSE; -int paused = FALSE; -int identify = ID_NONE; -int extioctl = FALSE; -const char *pidfile = "/var/run/moused.pid"; -struct pidfh *pfh; +static int debug = 0; +static int nodaemon = FALSE; +static int background = FALSE; +static int paused = FALSE; +static int identify = ID_NONE; +static int extioctl = FALSE; +static const char *pidfile = "/var/run/moused.pid"; +static struct pidfh *pfh; #define SCROLL_NOTSCROLLING 0 #define SCROLL_PREPARE 1 From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1DC8106580B; Sun, 6 Nov 2011 19:02:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5DD8FC30; Sun, 6 Nov 2011 19:02:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2QtQ037093; Sun, 6 Nov 2011 19:02:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2QPZ037091; Sun, 6 Nov 2011 19:02:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2QPZ037091@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227257 - head/usr.sbin/pwd_mkdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:26 -0000 Author: ed Date: Sun Nov 6 19:02:25 2011 New Revision: 227257 URL: http://svn.freebsd.org/changeset/base/227257 Log: Mark global functions and/or variables in pwd_mkdb(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Sun Nov 6 19:02:20 2011 (r227256) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Sun Nov 6 19:02:25 2011 (r227257) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #define LEGACY_VERSION(x) _PW_VERSIONED(x, 3) #define CURRENT_VERSION(x) _PW_VERSIONED(x, 4) -HASHINFO openinfo = { +static HASHINFO openinfo = { 4096, /* bsize */ 32, /* ffactor */ 256, /* nelem */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C69F2106597F; Sun, 6 Nov 2011 19:02:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C2698FC0C; Sun, 6 Nov 2011 19:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2WpJ037132; Sun, 6 Nov 2011 19:02:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2WQe037130; Sun, 6 Nov 2011 19:02:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2WQe037130@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227258 - head/usr.sbin/rip6query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:33 -0000 Author: ed Date: Sun Nov 6 19:02:31 2011 New Revision: 227258 URL: http://svn.freebsd.org/changeset/base/227258 Log: Mark global functions and/or variables in rip6query(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/rip6query/rip6query.c Modified: head/usr.sbin/rip6query/rip6query.c ============================================================================== --- head/usr.sbin/rip6query/rip6query.c Sun Nov 6 19:02:25 2011 (r227257) +++ head/usr.sbin/rip6query/rip6query.c Sun Nov 6 19:02:31 2011 (r227258) @@ -56,9 +56,9 @@ #include "route6d.h" -int s; -struct sockaddr_in6 sin6; -struct rip6 *ripbuf; +static int s; +static struct sockaddr_in6 sin6; +static struct rip6 *ripbuf; #define RIPSIZE(n) (sizeof(struct rip6) + (n-1) * sizeof(struct netinfo6)) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59C710659E3; Sun, 6 Nov 2011 19:02:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33C428FC30; Sun, 6 Nov 2011 19:02:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2cZ4037171; Sun, 6 Nov 2011 19:02:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2cmj037169; Sun, 6 Nov 2011 19:02:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2cmj037169@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227259 - head/usr.sbin/rmt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:39 -0000 Author: ed Date: Sun Nov 6 19:02:37 2011 New Revision: 227259 URL: http://svn.freebsd.org/changeset/base/227259 Log: Mark global functions and/or variables in rmt(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/rmt/rmt.c Modified: head/usr.sbin/rmt/rmt.c ============================================================================== --- head/usr.sbin/rmt/rmt.c Sun Nov 6 19:02:31 2011 (r227258) +++ head/usr.sbin/rmt/rmt.c Sun Nov 6 19:02:37 2011 (r227259) @@ -54,25 +54,25 @@ __FBSDID("$FreeBSD$"); #include #include -int tape = -1; +static int tape = -1; -char *record; -int maxrecsize = -1; +static char *record; +static int maxrecsize = -1; #define SSIZE 64 -char device[SSIZE]; -char count[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE]; +static char device[SSIZE]; +static char count[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE]; -char resp[BUFSIZ]; +static char resp[BUFSIZ]; -FILE *debug; +static FILE *debug; #define DEBUG(f) if (debug) fprintf(debug, f) #define DEBUG1(f,a) if (debug) fprintf(debug, f, a) #define DEBUG2(f,a1,a2) if (debug) fprintf(debug, f, a1, a2) -char *checkbuf(char *, int); -void error(int); -void getstring(char *); +static char *checkbuf(char *, int); +static void error(int); +static void getstring(char *); int main(int argc, char **argv) @@ -220,7 +220,7 @@ getstring(char *bp) cp[i] = '\0'; } -char * +static char * checkbuf(char *rec, int size) { @@ -240,7 +240,7 @@ checkbuf(char *rec, int size) return (rec); } -void +static void error(int num) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E2191065A79; Sun, 6 Nov 2011 19:02:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E2388FC22; Sun, 6 Nov 2011 19:02:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2ieM037210; Sun, 6 Nov 2011 19:02:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2iJ2037208; Sun, 6 Nov 2011 19:02:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2iJ2037208@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227260 - head/usr.sbin/snapinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:44 -0000 Author: ed Date: Sun Nov 6 19:02:43 2011 New Revision: 227260 URL: http://svn.freebsd.org/changeset/base/227260 Log: Mark global functions and/or variables in snapinfo(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/snapinfo/snapinfo.c Modified: head/usr.sbin/snapinfo/snapinfo.c ============================================================================== --- head/usr.sbin/snapinfo/snapinfo.c Sun Nov 6 19:02:37 2011 (r227259) +++ head/usr.sbin/snapinfo/snapinfo.c Sun Nov 6 19:02:43 2011 (r227260) @@ -39,14 +39,15 @@ #include #include -void find_inum(char *path); -void usage(void); -int compare_function(const char *, const struct stat *, int, struct FTW *); -int find_snapshot(struct statfs *sfs); - -int verbose; -int cont_search; -uint32_t inode; +static void find_inum(char *path); +static void usage(void); +static int compare_function(const char *, const struct stat *, + int, struct FTW *); +static int find_snapshot(struct statfs *sfs); + +static int verbose; +static int cont_search; +static uint32_t inode; int main(int argc, char **argv) @@ -112,7 +113,7 @@ main(int argc, char **argv) return (0); } -int +static int find_snapshot(struct statfs *sfs) { struct uufsd disk; @@ -138,7 +139,7 @@ find_snapshot(struct statfs *sfs) return 0; } -int +static int compare_function(const char *path, const struct stat *st, int flags, struct FTW * ftwv __unused) { @@ -157,7 +158,7 @@ compare_function(const char *path, const return (0); } -void +static void find_inum(char *path) { int ret; @@ -169,7 +170,7 @@ find_inum(char *path) } } -void +static void usage(void) { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:02:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 988A91065797; Sun, 6 Nov 2011 19:02:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 452C68FC1B; Sun, 6 Nov 2011 19:02:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J2oTl037249; Sun, 6 Nov 2011 19:02:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J2o02037247; Sun, 6 Nov 2011 19:02:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061902.pA6J2o02037247@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 19:02: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: r227261 - head/usr.sbin/spray X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:02:50 -0000 Author: ed Date: Sun Nov 6 19:02:49 2011 New Revision: 227261 URL: http://svn.freebsd.org/changeset/base/227261 Log: Mark global functions and/or variables in spray(8) static where possible. This allows compilers and static analyzers to do more thorough analysis. Modified: head/usr.sbin/spray/spray.c Modified: head/usr.sbin/spray/spray.c ============================================================================== --- head/usr.sbin/spray/spray.c Sun Nov 6 19:02:43 2011 (r227260) +++ head/usr.sbin/spray/spray.c Sun Nov 6 19:02:49 2011 (r227261) @@ -49,12 +49,12 @@ static void usage(void); static void print_xferstats(unsigned int, int, double); /* spray buffer */ -char spray_buffer[SPRAYMAX]; +static char spray_buffer[SPRAYMAX]; /* RPC timeouts */ -struct timeval NO_DEFAULT = { -1, -1 }; -struct timeval ONE_WAY = { 0, 0 }; -struct timeval TIMEOUT = { 25, 0 }; +static struct timeval NO_DEFAULT = { -1, -1 }; +static struct timeval ONE_WAY = { 0, 0 }; +static struct timeval TIMEOUT = { 25, 0 }; int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 19:03:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B04331065698; Sun, 6 Nov 2011 19:03:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02B18FC2A; Sun, 6 Nov 2011 19:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6J37G7037296; Sun, 6 Nov 2011 19:03:07 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6J37Nx037294; Sun, 6 Nov 2011 19:03:07 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111061903.pA6J37Nx037294@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 19:03: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: r227262 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 19:03:07 -0000 Author: ae Date: Sun Nov 6 19:03:07 2011 New Revision: 227262 URL: http://svn.freebsd.org/changeset/base/227262 Log: Remove unneeded checks. MFC after: 1 week Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 19:02:49 2011 (r227261) +++ head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 19:03:07 2011 (r227262) @@ -831,7 +831,7 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; @@ -1186,8 +1186,7 @@ checklabel(struct disklabel *lp) lp->d_secperunit = vl->d_secperunit; if (lp->d_bbsize == 0) lp->d_bbsize = vl->d_bbsize; - if (lp->d_npartitions == 0 || - lp->d_npartitions < DEFPARTITIONS || + if (lp->d_npartitions < DEFPARTITIONS || lp->d_npartitions > MAXPARTITIONS) lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:09:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6185A1065673; Sun, 6 Nov 2011 20:09:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 519778FC14; Sun, 6 Nov 2011 20:09:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6K9NrF039586; Sun, 6 Nov 2011 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6K9NjQ039584; Sun, 6 Nov 2011 20:09:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111062009.pA6K9NjQ039584@svn.freebsd.org> From: Michael Tuexen Date: Sun, 6 Nov 2011 20:09: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: r227266 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:09:23 -0000 Author: tuexen Date: Sun Nov 6 20:09:22 2011 New Revision: 227266 URL: http://svn.freebsd.org/changeset/base/227266 Log: Initialize all components of the sent COOKIE. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Nov 6 19:57:17 2011 (r227265) +++ head/sys/netinet/sctp_output.c Sun Nov 6 20:09:22 2011 (r227266) @@ -5711,6 +5711,8 @@ do_a_abort: stc.laddress[2] = 0; stc.laddress[3] = 0; stc.laddr_type = SCTP_IPV4_ADDRESS; + /* scope_id is only for v6 */ + stc.scope_id = 0; break; #endif #ifdef INET6 @@ -5719,6 +5721,7 @@ do_a_abort: memcpy(&stc.address, &sin6->sin6_addr, sizeof(struct in6_addr)); stc.addr_type = SCTP_IPV6_ADDRESS; + stc.scope_id = sin6->sin6_scope_id; if (net->src_addr_selected == 0) { /* * strange case here, the INIT should have @@ -5746,6 +5749,7 @@ do_a_abort: /* who are we */ memcpy(stc.identification, SCTP_VERSION_STRING, min(strlen(SCTP_VERSION_STRING), sizeof(stc.identification))); + memset(stc.reserved, 0, SCTP_RESERVE_SPACE); /* now the chunk header */ initack->ch.chunk_type = SCTP_INITIATION_ACK; initack->ch.chunk_flags = 0; From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:16:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E005B106564A; Sun, 6 Nov 2011 20:16:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C66C98FC0C; Sun, 6 Nov 2011 20:16:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KGoYq039895; Sun, 6 Nov 2011 20:16:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KGonx039888; Sun, 6 Nov 2011 20:16:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111062016.pA6KGonx039888@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 20:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227267 - in head/sys: dev/iscsi/initiator fs/nwfs fs/smbfs sys ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:16:51 -0000 Author: ed Date: Sun Nov 6 20:16:50 2011 New Revision: 227267 URL: http://svn.freebsd.org/changeset/base/227267 Log: Remove MALLOC_DECLAREs of nonexisting malloc-pools. After careful grepping, it seems none of these pools can be found in our source tree. They are not in use, nor are they defined. Modified: head/sys/dev/iscsi/initiator/iscsivar.h head/sys/fs/nwfs/nwfs_mount.h head/sys/fs/smbfs/smbfs.h head/sys/sys/event.h head/sys/sys/file.h head/sys/ufs/ufs/extattr.h Modified: head/sys/dev/iscsi/initiator/iscsivar.h ============================================================================== --- head/sys/dev/iscsi/initiator/iscsivar.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/dev/iscsi/initiator/iscsivar.h Sun Nov 6 20:16:50 2011 (r227267) @@ -64,7 +64,6 @@ typedef uint32_t digest_t(const void *, MALLOC_DECLARE(M_ISCSI); MALLOC_DECLARE(M_ISCSIBUF); -MALLOC_DECLARE(M_PDU); #define ISOK2DIG(dig, pp) ((dig != NULL) && ((pp->ipdu.bhs.opcode & 0x1f) != ISCSI_LOGIN_CMD)) Modified: head/sys/fs/nwfs/nwfs_mount.h ============================================================================== --- head/sys/fs/nwfs/nwfs_mount.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/fs/nwfs/nwfs_mount.h Sun Nov 6 20:16:50 2011 (r227267) @@ -65,11 +65,4 @@ struct nwfs_args { int tz; }; -#ifdef _KERNEL - -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_NWFSMNT); -#endif - -#endif #endif /* !_NWFS_MOUNT_H_ */ Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/fs/smbfs/smbfs.h Sun Nov 6 20:16:50 2011 (r227267) @@ -61,10 +61,6 @@ struct smbfs_args { #include -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_SMBFSMNT); -#endif - struct smbnode; struct smb_share; struct u_cred; Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/sys/event.h Sun Nov 6 20:16:50 2011 (r227267) @@ -147,10 +147,6 @@ struct knlist { #ifdef _KERNEL -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_KQUEUE); -#endif - /* * Flags for knote call */ Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/sys/file.h Sun Nov 6 20:16:50 2011 (r227267) @@ -185,10 +185,6 @@ struct xfile { #ifdef _KERNEL -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_FILE); -#endif - extern struct fileops vnops; extern struct fileops badfileops; extern struct fileops socketops; Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Sun Nov 6 20:09:22 2011 (r227266) +++ head/sys/ufs/ufs/extattr.h Sun Nov 6 20:16:50 2011 (r227267) @@ -115,10 +115,6 @@ struct extattr { #include -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_EXTATTR); -#endif - struct vnode; LIST_HEAD(ufs_extattr_list_head, ufs_extattr_list_entry); struct ufs_extattr_list_entry { From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:30:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EE431065670; Sun, 6 Nov 2011 20:30:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F363E8FC14; Sun, 6 Nov 2011 20:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KUL8c040447; Sun, 6 Nov 2011 20:30:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KUL73040444; Sun, 6 Nov 2011 20:30:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111062030.pA6KUL73040444@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 20:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227269 - head/usr.bin/at X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:30:22 -0000 Author: ed Date: Sun Nov 6 20:30:21 2011 New Revision: 227269 URL: http://svn.freebsd.org/changeset/base/227269 Log: Partially revert r227233. The privs.h header is not only used by at(1), it's also used by atrun(8). Just let the code the way it used to be (for now). Reported by: kwm, tinderbox Hat to: me Modified: head/usr.bin/at/at.c head/usr.bin/at/privs.h Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Sun Nov 6 20:29:18 2011 (r227268) +++ head/usr.bin/at/at.c Sun Nov 6 20:30:21 2011 (r227269) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include "panic.h" #include "parsetime.h" #include "perm.h" + +#define MAIN #include "privs.h" /* Macros */ @@ -102,8 +104,6 @@ int fcreated; char atfile[] = ATJOB_DIR "12345678901234"; char atverify = 0; /* verify time instead of queuing job */ char *namep; -uid_t real_uid, effective_uid; -gid_t real_gid, effective_gid; /* Function declarations */ Modified: head/usr.bin/at/privs.h ============================================================================== --- head/usr.bin/at/privs.h Sun Nov 6 20:29:18 2011 (r227268) +++ head/usr.bin/at/privs.h Sun Nov 6 20:30:21 2011 (r227269) @@ -59,8 +59,15 @@ * to the real userid before calling any of them. */ -extern uid_t real_uid, effective_uid; -extern gid_t real_gid, effective_gid; +#ifndef MAIN +extern +#endif +uid_t real_uid, effective_uid; + +#ifndef MAIN +extern +#endif +gid_t real_gid, effective_gid; #define RELINQUISH_PRIVS { \ real_uid = getuid(); \ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:32:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2978106566B; Sun, 6 Nov 2011 20:32:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2A218FC18; Sun, 6 Nov 2011 20:32:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KWt2N040566; Sun, 6 Nov 2011 20:32:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KWt0I040564; Sun, 6 Nov 2011 20:32:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111062032.pA6KWt0I040564@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 20:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227270 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:32:55 -0000 Author: ae Date: Sun Nov 6 20:32:55 2011 New Revision: 227270 URL: http://svn.freebsd.org/changeset/base/227270 Log: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. MFC after: 1 week Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 20:30:21 2011 (r227269) +++ head/sbin/bsdlabel/bsdlabel.c Sun Nov 6 20:32:55 2011 (r227270) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -355,7 +355,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -366,7 +366,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -411,8 +411,19 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:37:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F55C1065675; Sun, 6 Nov 2011 20:37:18 +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 DA2BD8FC1A; Sun, 6 Nov 2011 20:37:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KbHQC040745; Sun, 6 Nov 2011 20:37:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KbHGj040743; Sun, 6 Nov 2011 20:37:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111062037.pA6KbHGj040743@svn.freebsd.org> From: Christian Brueffer Date: Sun, 6 Nov 2011 20:37: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: r227271 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:37:18 -0000 Author: brueffer Date: Sun Nov 6 20:37:17 2011 New Revision: 227271 URL: http://svn.freebsd.org/changeset/base/227271 Log: Write QLogic consistently. MFC after: 3 days Modified: head/share/man/man4/qlxgb.4 Modified: head/share/man/man4/qlxgb.4 ============================================================================== --- head/share/man/man4/qlxgb.4 Sun Nov 6 20:32:55 2011 (r227270) +++ head/share/man/man4/qlxgb.4 Sun Nov 6 20:37:17 2011 (r227271) @@ -90,4 +90,4 @@ The .Nm driver was written by .An David C Somayajulu -at Qlogic Corporation. +at QLogic Corporation. From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:38:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61010106567A; Sun, 6 Nov 2011 20:38:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 385638FC26; Sun, 6 Nov 2011 20:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KcSFf040815; Sun, 6 Nov 2011 20:38:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KcSYl040813; Sun, 6 Nov 2011 20:38:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111062038.pA6KcSYl040813@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 20:38: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: r227272 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:38:28 -0000 Author: ae Date: Sun Nov 6 20:38:27 2011 New Revision: 227272 URL: http://svn.freebsd.org/changeset/base/227272 Log: Add reference to gpart(8). MFC after: 3 days Modified: head/sbin/fdisk/fdisk.8 Modified: head/sbin/fdisk/fdisk.8 ============================================================================== --- head/sbin/fdisk/fdisk.8 Sun Nov 6 20:37:17 2011 (r227271) +++ head/sbin/fdisk/fdisk.8 Sun Nov 6 20:38:27 2011 (r227272) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:39:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C86931065673; Sun, 6 Nov 2011 20:39:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8D638FC17; Sun, 6 Nov 2011 20:39:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KdZcC040890; Sun, 6 Nov 2011 20:39:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KdZKu040888; Sun, 6 Nov 2011 20:39:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111062039.pA6KdZKu040888@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 20:39: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: r227273 - head/sbin/fdisk_pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:39:35 -0000 Author: ae Date: Sun Nov 6 20:39:35 2011 New Revision: 227273 URL: http://svn.freebsd.org/changeset/base/227273 Log: Add reference to gpart(8). MFC after: 3 days Modified: head/sbin/fdisk_pc98/fdisk.8 Modified: head/sbin/fdisk_pc98/fdisk.8 ============================================================================== --- head/sbin/fdisk_pc98/fdisk.8 Sun Nov 6 20:38:27 2011 (r227272) +++ head/sbin/fdisk_pc98/fdisk.8 Sun Nov 6 20:39:35 2011 (r227273) @@ -446,6 +446,7 @@ Example: to make slice 1 the active slic .Sh SEE ALSO .Xr boot98cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:42:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66AB0106566C; Sun, 6 Nov 2011 20:42:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5722C8FC08; Sun, 6 Nov 2011 20:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KgW2S041046; Sun, 6 Nov 2011 20:42:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KgWbx041044; Sun, 6 Nov 2011 20:42:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111062042.pA6KgWbx041044@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 20:42: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: r227274 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:42:32 -0000 Author: ae Date: Sun Nov 6 20:42:32 2011 New Revision: 227274 URL: http://svn.freebsd.org/changeset/base/227274 Log: Add reference to gpart(8). MFC after: 3 days Modified: head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Sun Nov 6 20:39:35 2011 (r227273) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Sun Nov 6 20:42:32 2011 (r227274) @@ -197,7 +197,8 @@ to install the default MBR: .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , -.Xr fdisk 8 +.Xr fdisk 8 , +.Xr gpart 8 .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:46:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 32F391065675; Sun, 6 Nov 2011 20:46:19 +0000 (UTC) Date: Sun, 6 Nov 2011 20:46:19 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20111106204619.GA76768@freebsd.org> References: <201111060815.pA68FIvC008341@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <201111060815.pA68FIvC008341@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:46:19 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun Nov 6 11, Ed Schouten wrote: > Author: ed > Date: Sun Nov 6 08:15:17 2011 > New Revision: 227164 > URL: http://svn.freebsd.org/changeset/base/227164 > > Log: > Add missing static keywords to du(1) this diff was flying around in my /usr/src, which makes some code a bit more readable. maybe this is something worth having in HEAD? cheers. alex > > Modified: > head/usr.bin/du/du.c > > Modified: head/usr.bin/du/du.c > ============================================================================== > --- head/usr.bin/du/du.c Sun Nov 6 08:14:57 2011 (r227163) > +++ head/usr.bin/du/du.c Sun Nov 6 08:15:17 2011 (r227164) > @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -SLIST_HEAD(ignhead, ignentry) ignores; > +static SLIST_HEAD(ignhead, ignentry) ignores; > struct ignentry { > char *mask; > SLIST_ENTRY(ignentry) next; --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="du.c.diff" diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index cdaa70d..4089e04 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -231,15 +231,14 @@ main(int argc, char *argv[]) listall = 0; - if (aflag) { - if (sflag || dflag) - usage(); + if (aflag + dflag + sflag > 1) + usage(); + + if (aflag) listall = 1; - } else if (sflag) { - if (dflag) - usage(); + + if (sflag) depth = 0; - } if (!*argv) { argv = save; --zhXaljGHf11kAtnf-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:49:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69EDE106566C; Sun, 6 Nov 2011 20:49:17 +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 597E58FC1B; Sun, 6 Nov 2011 20:49:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6KnHG5041304; Sun, 6 Nov 2011 20:49:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6KnHq7041301; Sun, 6 Nov 2011 20:49:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111062049.pA6KnHq7041301@svn.freebsd.org> From: Christian Brueffer Date: Sun, 6 Nov 2011 20:49: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: r227275 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:49:17 -0000 Author: brueffer Date: Sun Nov 6 20:49:17 2011 New Revision: 227275 URL: http://svn.freebsd.org/changeset/base/227275 Log: Add qlxgb(4) to the hardware notes. MFC after: 3 days 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 Sun Nov 6 20:42:32 2011 (r227274) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 6 20:49:17 2011 (r227275) @@ -948,6 +948,8 @@ &hwlist.pcn; + &hwlist.qlxgb; + &hwlist.re; &hwlist.rl; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Sun Nov 6 20:42:32 2011 (r227274) +++ head/release/doc/share/misc/dev.archlist.txt Sun Nov 6 20:49:17 2011 (r227275) @@ -100,6 +100,7 @@ ohci i386,pc98,ia64,amd64,powerpc oltr i386 pcn i386,pc98,ia64,amd64 pst i386 +qlxgb amd64 rc i386 ral i386,amd64 rue i386,pc98,amd64 From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 20:59:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03164106564A; Sun, 6 Nov 2011 20:59:08 +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 E754D8FC0A; Sun, 6 Nov 2011 20:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6Kx7IP041657; Sun, 6 Nov 2011 20:59:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Kx7c9041655; Sun, 6 Nov 2011 20:59:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111062059.pA6Kx7c9041655@svn.freebsd.org> From: Christian Brueffer Date: Sun, 6 Nov 2011 20:59: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: r227276 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 20:59:08 -0000 Author: brueffer Date: Sun Nov 6 20:59:07 2011 New Revision: 227276 URL: http://svn.freebsd.org/changeset/base/227276 Log: Add qlxgb(4). MFC after: 3 days Modified: head/share/man/man4/altq.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Sun Nov 6 20:49:17 2011 (r227275) +++ head/share/man/man4/altq.4 Sun Nov 6 20:59:07 2011 (r227276) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2010 +.Dd November 6, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -150,6 +150,7 @@ They have been applied to the following .Xr nge 4 , .Xr npe 4 , .Xr nve 4 , +.Xr qlxgb 4 , .Xr ral 4 , .Xr re 4 , .Xr rl 4 , From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 21:12:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91C11065675; Sun, 6 Nov 2011 21:12:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A98218FC0A; Sun, 6 Nov 2011 21:12:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6LCqZu042270; Sun, 6 Nov 2011 21:12:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6LCqT7042268; Sun, 6 Nov 2011 21:12:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111062112.pA6LCqT7042268@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 6 Nov 2011 21:12: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: r227280 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:12:52 -0000 Author: ae Date: Sun Nov 6 21:12:52 2011 New Revision: 227280 URL: http://svn.freebsd.org/changeset/base/227280 Log: Initialize "acc" value inside the loop to reset failed attempts. PR: misc/162262 MFC after: 3 days Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Sun Nov 6 21:11:22 2011 (r227279) +++ head/sbin/fdisk/fdisk.c Sun Nov 6 21:12:52 2011 (r227280) @@ -922,11 +922,12 @@ ok(const char *str) static int decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0; + long long acc; int c; char *cp; while (1) { + acc = 0; printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); if (fgets(lbuf, LBUF, stdin) == NULL) @@ -962,7 +963,6 @@ decimal(const char *str, int *num, int d printf("%s is an invalid decimal number. Try again.\n", lbuf); } - } From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 21:33:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A32106567A; Sun, 6 Nov 2011 21:33:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BDA8FC17; Sun, 6 Nov 2011 21:33:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6LXpvc042978; Sun, 6 Nov 2011 21:33:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6LXp0T042976; Sun, 6 Nov 2011 21:33:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111062133.pA6LXp0T042976@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Nov 2011 21: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: r227281 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:33:51 -0000 Author: marius Date: Sun Nov 6 21:33:50 2011 New Revision: 227281 URL: http://svn.freebsd.org/changeset/base/227281 Log: Commit man page update missed in r227006. Modified: head/share/man/man4/esp.4 Modified: head/share/man/man4/esp.4 ============================================================================== --- head/share/man/man4/esp.4 Sun Nov 6 21:12:52 2011 (r227280) +++ head/share/man/man4/esp.4 Sun Nov 6 21:33:50 2011 (r227281) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2004 Tom Rhodes +.\" Copyright (c) 2011 Marius Strobl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,158 +25,91 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2005 +.Dd November 1, 2011 .Dt ESP 4 .Os .Sh NAME .Nm esp -.Nd Qlogic FEPS and FAS366 SCSI driver +.Nd Emulex ESP, NCR 53C9x and QLogic FAS families based SCSI controllers .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your +To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device esp" .Ed -.Sh HARDWARE +.Pp +Alternatively, to load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_esp_load="YES" +.Ed +.Sh DESCRIPTION The .Nm driver provides support for the -.Tn Qlogic -FAS216 and FAS408 +.Tn AMD +Am53C974, the +.Tn Emulex +ESP100, ESP100A, ESP200 and ESP406, the +.Tn NCR +53C90, 53C94 and 53C96 as well as the +.Tn QLogic +FAS100A, FAS216, FAS366 and FAS408 .Tn SCSI controller chips found in a wide variety of systems and peripheral boards. -This includes the -.Tn Qlogic -.Tn SCSI -cards found in most -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines. -.Pp -For -.Tn Qlogic -.Tn PCI -.Tn SCSI -host adapters, the -.Xr isp 4 -driver should be used in place of the -.Nm -driver. -.Sh IMPLEMENTATION NOTES -During the boot sequence, the +.Sh HARDWARE +Controllers supported by the .Nm -driver -searches the linked list for LUN info by LUN ID. -At this point the driver will attach on that instance, -and then attempt to attach every sub-device. -.Pp -There are at least 4 variations of the -configuration 3 register. -A second config register must be loaded to inquire the chip revision, -otherwise the -.Fn ncr53c9x_reset -function will not set the defaults correctly. -.Pp -The drive attach routine attempts to set the appropriate -bit to put the chip into Fast -.Tn SCSI -mode so that it does not -have to be figured out each time. -This will then be stored in the -.Tn NCR -registers for later use. +driver include: .Pp -The -.Nm -driver makes use of the -.Tn LSI -64854 -.Tn DMA -engine which contains three independent -channels designed to interface with -an NCR539X -.Tn SCSI -controller; -an AM7990 Ethernet controller; -and certain types of parallel port hardware. -As such this driver may eventually replace the -.Xr amd 4 -driver for network hardware. -.Sh DIAGNOSTICS -The following driver specific error messages -may be reported: -.Bl -diag -.It "esp: cannot map %d segments" -The device was unable to map segments while mapping the -.Tn SCSI -devices in -.Tn DMA -mode. -.It "unknown variant %d, devices not attached" -An unknown version of the card was found and devices will -not be attached. -.It "Unhandled function code %d" -The device returned a function code which the driver is -unable to handle, most likely during negotiation. -.It "esp:%d:%d: selection failed %d left in FIFO" -The target left the command phase prematurely. -If a command did not reach the device then it will -be reported as shown above. -.It "invalid state: %d" -The device has reached an invalid state. -.El -.Sh SEE ALSO -.Xr amd 4 , -.Xr isp 4 , -.Xr scbus 4 , -.Xr camcontrol 8 -.Pp -.Bl -item -compact +.Bl -bullet -compact +.It +MELCO IFC-DP (PC-98) +.It +Sun ESP family +.It +Sun FAS family .It -.Pa http://www.qlc.com/ +Tekram DC390 .It -.Pa http://www.sun.com/ +Tekram DC390T .El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr intro 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr sbus 4 , +.Xr scsi 4 +.Xr camcontrol 8 .Sh HISTORY The .Nm -driver was written for -.Nx -by -.An Eric S. Hvozda . +driver first appeared in +.Nx 1.3 . +The first +.Fx +version to include it was +.Fx 5.3 . +.Sh AUTHORS +.An -nosplit The .Nm -driver was then ported to -.Fx 5.3 +driver was ported to +.Fx by -.An Scott Long Aq scottl@FreeBSD.org . -.Sh AUTHORS -This manual page was written by -.An Tom Rhodes Aq trhodes@FreeBSD.org -instead of porting the original from -.Nx . +.An Scott Long +.Aq scottl@FreeBSD.org +and later on considerably improved by +.An Marius Strobl +.Aq marius@FreeBSD.org . .Sh BUGS The .Nm -driver includes the sbus front-end but lacks the -.Tn PCI -front-end. -Thus it can only support the -.Tn FEPS/FAS366 -.Tn SCSI -found in -.Tn Sun -.Tn Ultra 1e -and -.Tn Ultra 2 -machines at this time. -.Pp -This driver should eventually replace the -.Xr amd 4 -driver, but that requires porting the -.Tn PCI -front-end mentioned above. +driver should read the EEPROM settings of +.Tn Tekram +controllers. From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 21:54:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA4FE1065673; Sun, 6 Nov 2011 21:54:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91AC68FC1B; Sun, 6 Nov 2011 21:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6LsRwT043730; Sun, 6 Nov 2011 21:54:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6LsRUq043728; Sun, 6 Nov 2011 21:54:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111062154.pA6LsRUq043728@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Nov 2011 21:54: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: r227282 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:54:27 -0000 Author: marius Date: Sun Nov 6 21:54:27 2011 New Revision: 227282 URL: http://svn.freebsd.org/changeset/base/227282 Log: Add missing comma. Submitted by: brueffer Modified: head/share/man/man4/esp.4 Modified: head/share/man/man4/esp.4 ============================================================================== --- head/share/man/man4/esp.4 Sun Nov 6 21:33:50 2011 (r227281) +++ head/share/man/man4/esp.4 Sun Nov 6 21:54:27 2011 (r227282) @@ -84,7 +84,7 @@ Tekram DC390T .Xr pci 4 , .Xr sa 4 , .Xr sbus 4 , -.Xr scsi 4 +.Xr scsi 4 , .Xr camcontrol 8 .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 21:57:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3367D106566C; Sun, 6 Nov 2011 21:57:01 +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 E29938FC0A; Sun, 6 Nov 2011 21:57:00 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 216912A28CE3; Sun, 6 Nov 2011 22:56:30 +0100 (CET) Date: Sun, 6 Nov 2011 22:56:30 +0100 From: Ed Schouten To: Alexander Best Message-ID: <20111106215630.GQ2258@hoeg.nl> References: <201111060815.pA68FIvC008341@svn.freebsd.org> <20111106204619.GA76768@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rnz0oC2K6vQ5doJs" Content-Disposition: inline In-Reply-To: <20111106204619.GA76768@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:57:01 -0000 --Rnz0oC2K6vQ5doJs Content-Type: multipart/mixed; boundary="zOr5JpMIiGv/Oaxu" Content-Disposition: inline --zOr5JpMIiGv/Oaxu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alexander, * Alexander Best , 20111106 21:46: > this diff was flying around in my /usr/src, which makes some code a bit m= ore > readable. maybe this is something worth having in HEAD? Looks good. It seems we can also get rid of the `listall' variable here. The rest of the code also uses the `*flag' variables, so there's no reason why we can't just use `aflag'. Does this patch look good to you? --=20 Ed Schouten WWW: http://80386.nl/ --zOr5JpMIiGv/Oaxu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="du.c.diff" Content-Transfer-Encoding: quoted-printable Index: usr.bin/du/du.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 --- usr.bin/du/du.c (revision 227263) +++ usr.bin/du/du.c (working copy) @@ -88,7 +88,6 @@ off_t savednumber, curblocks; off_t threshold, threshold_sign; int ftsoptions; - int listall; int depth; int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; int hflag, lflag, ch, notused, rval; @@ -229,17 +228,10 @@ if (!Aflag && (cblocksize % DEV_BSIZE) !=3D 0) cblocksize =3D howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; =20 - listall =3D 0; - - if (aflag) { - if (sflag || dflag) - usage(); - listall =3D 1; - } else if (sflag) { - if (dflag) - usage(); + if (aflag + dflag + sflag > 1) + usage(); + if (sflag) depth =3D 0; - } =20 if (!*argv) { argv =3D save; @@ -320,7 +312,7 @@ howmany(p->fts_statp->st_size, cblocksize) : howmany(p->fts_statp->st_blocks, cblocksize); =20 - if (listall || p->fts_level =3D=3D 0) { + if (aflag || p->fts_level =3D=3D 0) { if (hflag) { prthumanval(curblocks); (void)printf("\t%s\n", p->fts_path); --zOr5JpMIiGv/Oaxu-- --Rnz0oC2K6vQ5doJs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOtwKNAAoJEG5e2P40kaK7jiYP/Re7g7MrZjZgLUJEbFWPxXyD tUlF/2DXlniMbaQtxAujmzdNUe5eIAnULlqyeHJLE20GqQBqo3ML0sX8RReeAcSt FErf/ZD6s4+RDPhYFKr+/0ZoPKh+bW1qQzJ7y7igE/mo6mrUNheyvAXuEXTV6ua5 nWkNLEnxFO6nUj3LeclPrC1pPfTvvWPn/ZMCJv9giEya7cy32BsuLmT6s+Z8yOI5 2T88gO0IdWQImTNF3hur57OCnVx405xrBFX830udrAL3uTr+lnWq+Zkdl5AH+elv hHCqnlj2U/H03HOGmbMku216FRWWQ0acBPBEfFPbXIfCq8Snw1NZ4C3+PbgFOJQ3 YOYqS6Mhz//QTw8nlBCgo6ipZxuHdN28f7FeufzxN+FfbX1bYQoOG40kbw5x5n+t 1X3O+jLKkLqkUy2hPuEbEeh+LuGZbNafXoWJQrxBmX6xNaAXJcrkxWUvZ57yWLRr EawUXT1fUx6l5H3eSZZu5lLwN0L5+D3C8XdjIheXPyCvwQTjmFGHv/SLy8l71rLi mh81jOheUzp9STbcELALXWPYGwrGeyg4abvA3oDmCqRPY7OsdTrmtxmE2xRrN3VZ WaPU0LhAxT2xZFwNVY+5wd6D7+Q7Pnb3XPd5C51aZYXg+uiTHafM997C5htQJxVn qLY9VRXYK6a8qaYj0hfW =JIA4 -----END PGP SIGNATURE----- --Rnz0oC2K6vQ5doJs-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 21:57:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0ED3106564A; Sun, 6 Nov 2011 21:57:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916428FC08; Sun, 6 Nov 2011 21:57:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6LvCxl043895; Sun, 6 Nov 2011 21:57:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6LvCPG043893; Sun, 6 Nov 2011 21:57:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111062157.pA6LvCPG043893@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Nov 2011 21:57: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: r227283 - head/release/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 21:57:12 -0000 Author: marcel Date: Sun Nov 6 21:57:12 2011 New Revision: 227283 URL: http://svn.freebsd.org/changeset/base/227283 Log: Add check-password.4th and screen.4th to the boot image. They are needed by the loader. Modified: head/release/ia64/mkisoimages.sh Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Sun Nov 6 21:54:27 2011 (r227282) +++ head/release/ia64/mkisoimages.sh Sun Nov 6 21:57:12 2011 (r227283) @@ -64,6 +64,8 @@ if [ $bootable = yes ]; then cp $BASE/boot/mfsroot.gz $MNT/boot fi cp $BASE/boot/support.4th $MNT/boot + cp $BASE/boot/check-password.4th $MNT/boot + cp $BASE/boot/screen.4th $MNT/boot mv $MNT/boot/loader.efi $MNT/efi/boot/bootia64.efi umount $MNT mdconfig -d -u $md From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 22:28:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C93106566C; Sun, 6 Nov 2011 22:28:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC218FC19; Sun, 6 Nov 2011 22:28:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6MSDt8044932; Sun, 6 Nov 2011 22:28:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6MSDSI044930; Sun, 6 Nov 2011 22:28:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111062228.pA6MSDSI044930@svn.freebsd.org> From: Marius Strobl Date: Sun, 6 Nov 2011 22:28: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: r227284 - head/sys/dev/esp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 22:28:14 -0000 Author: marius Date: Sun Nov 6 22:28:13 2011 New Revision: 227284 URL: http://svn.freebsd.org/changeset/base/227284 Log: Freeze the device queue if a request didn't complete without error and isn't already frozen. Modified: head/sys/dev/esp/ncr53c9x.c Modified: head/sys/dev/esp/ncr53c9x.c ============================================================================== --- head/sys/dev/esp/ncr53c9x.c Sun Nov 6 21:57:12 2011 (r227283) +++ head/sys/dev/esp/ncr53c9x.c Sun Nov 6 22:28:13 2011 (r227284) @@ -1330,11 +1330,10 @@ ncr53c9x_sched(struct ncr53c9x_softc *sc sc->sc_nexus = ecb; ncr53c9x_select(sc, ecb); break; - } else { + } else NCR_TRACE(("[%s %d:%d busy] \n", __func__, ecb->ccb->ccb_h.target_id, ecb->ccb->ccb_h.target_lun)); - } } } @@ -1413,10 +1412,10 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, */ if (ccb->ccb_h.status == CAM_REQ_CMP) { ccb->csio.scsi_status = ecb->stat; - if ((ecb->flags & ECB_ABORT) != 0) { + if ((ecb->flags & ECB_ABORT) != 0) ccb->ccb_h.status = CAM_CMD_TIMEOUT; - } else if ((ecb->flags & ECB_SENSE) != 0 && - (ecb->stat != SCSI_STATUS_CHECK_COND)) { + else if ((ecb->flags & ECB_SENSE) != 0 && + (ecb->stat != SCSI_STATUS_CHECK_COND)) { ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; @@ -1440,13 +1439,15 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, } ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR; } - } else { + } else ccb->csio.resid = ecb->dleft; - } if (ecb->stat == SCSI_STATUS_QUEUE_FULL) ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR; else if (ecb->stat == SCSI_STATUS_BUSY) ccb->ccb_h.status = CAM_SCSI_BUSY; + } else if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); } #ifdef NCR53C9X_DEBUG @@ -1474,7 +1475,7 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, } } - if (ccb->ccb_h.status == CAM_SEL_TIMEOUT) { + if ((ccb->ccb_h.status & CAM_SEL_TIMEOUT) != 0) { /* Selection timeout -- discard this LUN if empty. */ if (li->untagged == NULL && li->used == 0) { if (lun < NCR_NLUN) From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 22:30:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 31E051065672; Sun, 6 Nov 2011 22:30:01 +0000 (UTC) Date: Sun, 6 Nov 2011 22:30:01 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20111106223001.GA91996@freebsd.org> References: <201111060815.pA68FIvC008341@svn.freebsd.org> <20111106204619.GA76768@freebsd.org> <20111106215630.GQ2258@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline In-Reply-To: <20111106215630.GQ2258@hoeg.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 22:30:01 -0000 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun Nov 6 11, Ed Schouten wrote: > Hi Alexander, > > * Alexander Best , 20111106 21:46: > > this diff was flying around in my /usr/src, which makes some code a bit more > > readable. maybe this is something worth having in HEAD? > > Looks good. It seems we can also get rid of the `listall' variable here. > The rest of the code also uses the `*flag' variables, so there's no > reason why we can't just use `aflag'. Does this patch look good to you? loking good. :) i also found this man page update. cheers. alex > > -- > Ed Schouten > WWW: http://80386.nl/ --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="du.1.diff" diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 index ef8b5ac..f85cdf3 100644 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd November 6, 2008 +.Dd November 6, 2011 .Dt DU 1 .Os .Sh NAME @@ -65,7 +65,9 @@ Calculate block counts in .Ar blocksize byte blocks. This is different from the -.Fl k, m +.Fl k +and +.Fl m options or setting .Ev BLOCKSIZE and gives an estimate of how much space the examined file hierarchy would @@ -154,6 +156,25 @@ or .Fl L options are specified, storage used by any symbolic links which are followed is not counted or displayed. +.Pp +The +.Fl a, d +and +.Fl s +options are mutually exclusive. +.Pp +The +.Fl H, L +and +.Fl P +options are mutually exclusive. +.Pp +The +.Fl h, k +and +.Fl m +options all override each other; the last one specified determines +the block count used. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE --8t9RHnE3ZwKMSgU+-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 22:33:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E38FF106566C; Sun, 6 Nov 2011 22:33:04 +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 A47FD8FC0C; Sun, 6 Nov 2011 22:33:04 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 958A22A28CC8; Sun, 6 Nov 2011 23:32:33 +0100 (CET) Date: Sun, 6 Nov 2011 23:32:33 +0100 From: Ed Schouten To: Alexander Best Message-ID: <20111106223233.GR2258@hoeg.nl> References: <201111060815.pA68FIvC008341@svn.freebsd.org> <20111106204619.GA76768@freebsd.org> <20111106215630.GQ2258@hoeg.nl> <20111106223001.GA91996@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B8Vg9Vt30SMsjSDh" Content-Disposition: inline In-Reply-To: <20111106223001.GA91996@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 22:33:05 -0000 --B8Vg9Vt30SMsjSDh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Alexander, * Alexander Best , 20111106 23:30: > +The > +.Fl a, d > +and > +.Fl s > +options are mutually exclusive. > +.Pp > +The > +.Fl H, L > +and > +.Fl P > +options are mutually exclusive. This can already be derived from the SYNOPSIS, right? --=20 Ed Schouten WWW: http://80386.nl/ --B8Vg9Vt30SMsjSDh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOtwsBAAoJEG5e2P40kaK7zL0P/RIPU61JBCgjhKuzlP/f1iuA 5EFqp/0uEzOg7zIErILAUpqFXJy4hhwsKhvSyVjiGrft+35fNU1C/iysLn608DmK q6XF+SRKELeh7rWoGfpFp2ah/tOiyllLDhGu0PzI4Omga4/3fvroi3gO+iDJjU90 OOyEp+RQpXRLhA/qJtVL1MccdTFbgt8+Y4GH7ZbdhDi3XrgKpjers7DrBzyH7Dg/ Y13JhD3g3RPcE5+l2FEDIpQ9swV8i5fM6tqeNIgf1Kr1BdO4lqPG0zVl6fsrfCtf 1Xb8nmXntT/NcdEv+Okn3PdyRLjvxV/YXcYCN1h6m4Y50jfqp9lNHbj/csVaS9P7 Lq2rVbrzMsySvQzcN46ykQLv3zWstew/8F6XPmXJINUCWBch2dk4W+5ZS5+GMuUI Yjt3H3IfCWJTbUB4KuqMAZUQAzlk/4evOnzGWlgHLi0G7S1VWyBmEX8r8ALOYz/z sL1B9wymwLlF27NgSwgErDmnoiIqNWhyz1yjEHeYshYMo2BNVTcwo9z+obo78TdQ MWCl6JG8cOO/Xx9DHd7ql3RkLgloT7a+2q/qBCIzhgUbq2EdOJOtArVM1KlkSPZO ObyBkU+qli6yLQsCx+3rZbO0ph1GoUGodCB/BuANEAwp7a3vDPV1y4313D8/c3jE HqlddKJfW73g07+NutiT =5Med -----END PGP SIGNATURE----- --B8Vg9Vt30SMsjSDh-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 22:48:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 530191065673; Sun, 6 Nov 2011 22:48:50 +0000 (UTC) Date: Sun, 6 Nov 2011 22:48:50 +0000 From: Alexander Best To: Ed Schouten Message-ID: <20111106224850.GA93068@freebsd.org> References: <201111060815.pA68FIvC008341@svn.freebsd.org> <20111106204619.GA76768@freebsd.org> <20111106215630.GQ2258@hoeg.nl> <20111106223001.GA91996@freebsd.org> <20111106223233.GR2258@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111106223233.GR2258@hoeg.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227164 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 22:48:50 -0000 On Sun Nov 6 11, Ed Schouten wrote: > Hi Alexander, > > * Alexander Best , 20111106 23:30: > > +The > > +.Fl a, d > > +and > > +.Fl s > > +options are mutually exclusive. > > +.Pp > > +The > > +.Fl H, L > > +and > > +.Fl P > > +options are mutually exclusive. > > This can already be derived from the SYNOPSIS, right? partially: " du [-A] [-H | -L | -P] [-a | -s | -d depth | -t threshold] [-c] [-l] [-h | -k | -m | -B blocksize] [-n] [-x] [-I mask] [file ...]" 1) [-H | -L | -P] is correct 2) [-a | -s | -d depth | -t threshold] is not correct. the -t option can be used together with the -a, -s and -d options. 3) [-h | -k | -m | -B blocksize] is not correct. the -B option can be used together with the -h, -k and -m options. also style(9) describes "|" as "either-or" operator. for the -h, -k and -m options this isn't true. they can very well be used in a single command, but the last option backs out all the previous ones. i think the following would be better: " du [-Achklmnx] [-H | -L | -P] [-a | -s | -d depth] [-B blocksize] [-I mask] [-t threshold] [file ...]" and the paragraph " The -h, -k and -m options all override each other; the last one specified determines the block count used." cheers. alex > > -- > Ed Schouten > WWW: http://80386.nl/ From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 23:11:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B9CF106564A; Sun, 6 Nov 2011 23:11:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD968FC08; Sun, 6 Nov 2011 23:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6NBUqx046356; Sun, 6 Nov 2011 23:11:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6NBUvx046354; Sun, 6 Nov 2011 23:11:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111062311.pA6NBUvx046354@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 6 Nov 2011 23:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227285 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 23:11:31 -0000 Author: hselasky Date: Sun Nov 6 23:11:30 2011 New Revision: 227285 URL: http://svn.freebsd.org/changeset/base/227285 Log: Add support for new USB modem protocol. PR: usb/159919 MFC after: 1 week Modified: head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Sun Nov 6 22:28:13 2011 (r227284) +++ head/sys/dev/usb/serial/umodem.c Sun Nov 6 23:11:30 2011 (r227285) @@ -127,7 +127,11 @@ static const STRUCT_USB_HOST_ID umodem_d /* Generic Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), - USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)}, + /* Huawei Modem class match */ + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), + USB_IFACE_PROTOCOL(0xFF)}, /* Kyocera AH-K3001V */ {USB_VPI(USB_VENDOR_KYOCERA, USB_PRODUCT_KYOCERA_AHK3001V, 1)}, {USB_VPI(USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720, 1)}, From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 23:26:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 671551065670; Sun, 6 Nov 2011 23:26:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577C18FC0C; Sun, 6 Nov 2011 23:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6NQQkG046997; Sun, 6 Nov 2011 23:26:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6NQQjN046995; Sun, 6 Nov 2011 23:26:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111062326.pA6NQQjN046995@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 6 Nov 2011 23:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227286 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 23:26:26 -0000 Author: hselasky Date: Sun Nov 6 23:26:26 2011 New Revision: 227286 URL: http://svn.freebsd.org/changeset/base/227286 Log: Fix build breakage for 8-stable and older. MFC after: 0 days Modified: head/sys/dev/usb/usb_process.c Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Sun Nov 6 23:11:30 2011 (r227285) +++ head/sys/dev/usb/usb_process.c Sun Nov 6 23:26:26 2011 (r227286) @@ -67,13 +67,17 @@ static int usb_pcount; #define USB_THREAD_CREATE(f, s, p, ...) \ kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \ 0, "usb", __VA_ARGS__) +#if (__FreeBSD_version >= 900000) #define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check() +#else +#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curthread) +#endif #define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) #define USB_THREAD_EXIT(err) kthread_exit() #else #define USB_THREAD_CREATE(f, s, p, ...) \ kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) -#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check() +#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curproc) #define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) #define USB_THREAD_EXIT(err) kthread_exit(err) #endif From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 01:53:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F64B106564A; Mon, 7 Nov 2011 01:53:26 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7338FC16; Mon, 7 Nov 2011 01:53:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA71rQ5d051609; Mon, 7 Nov 2011 01:53:26 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA71rQxS051602; Mon, 7 Nov 2011 01:53:26 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111070153.pA71rQxS051602@svn.freebsd.org> From: Ryan Stone Date: Mon, 7 Nov 2011 01:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227290 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 01:53:26 -0000 Author: rstone Date: Mon Nov 7 01:53:25 2011 New Revision: 227290 URL: http://svn.freebsd.org/changeset/base/227290 Log: Fix the DTrace pid return trap interrupt vector. Previously we were using 31, but that vector is reserved. Without this fix, running dtrace -p would either cause the target process to crash or the kernel to page fault. Obtained from: rpaulo MFC after: 3days Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/segments.h head/sys/amd64/include/trap.h head/sys/i386/i386/trap.c head/sys/i386/include/segments.h head/sys/i386/include/trap.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/amd64/amd64/trap.c Mon Nov 7 01:53:25 2011 (r227290) @@ -125,7 +125,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -158,6 +158,9 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -245,28 +248,26 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; - + fill_frame_regs(frame, ®s); if (type == T_DTRACE_PROBE && dtrace_fasttrap_probe_ptr != NULL && dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - if (type == T_BPTFLT && + goto out; + else if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && + goto out; + else if (type == T_DTRACE_RET && dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - } + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/amd64/include/segments.h Mon Nov 7 01:53:25 2011 (r227290) @@ -214,7 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: head/sys/amd64/include/trap.h ============================================================================== --- head/sys/amd64/include/trap.h Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/amd64/include/trap.h Mon Nov 7 01:53:25 2011 (r227290) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/i386/i386/trap.c Mon Nov 7 01:53:25 2011 (r227290) @@ -136,7 +136,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 30 +#define MAX_TRAP_MSG 33 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -169,6 +169,10 @@ static char *trap_msg[] = { "machine check trap", /* 28 T_MCHK */ "SIMD floating-point exception", /* 29 T_XMMFLT */ "reserved (unknown) fault", /* 30 T_RESERVED */ + "", /* 31 unused (reserved) */ + "DTrace pid return trap", /* 32 T_DTRACE_RET */ + "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ + }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -265,10 +269,6 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if ((type == T_PROTFLT || type == T_PAGEFLT) && - dtrace_trap_func != NULL) - if ((*dtrace_trap_func)(frame, type)) - goto out; if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; @@ -287,6 +287,9 @@ trap(struct trapframe *frame) dtrace_return_probe_ptr(®s) == 0) goto out; } + if ((type == T_PROTFLT || type == T_PAGEFLT) && + dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) + goto out; #endif if ((frame->tf_eflags & PSL_I) == 0) { Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/i386/include/segments.h Mon Nov 7 01:53:25 2011 (r227290) @@ -207,7 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ -#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ +#define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: head/sys/i386/include/trap.h ============================================================================== --- head/sys/i386/include/trap.h Mon Nov 7 00:27:25 2011 (r227289) +++ head/sys/i386/include/trap.h Mon Nov 7 01:53:25 2011 (r227290) @@ -62,8 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ -#define T_DTRACE_RET 31 /* DTrace pid return */ -#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ +#define T_DTRACE_RET 32 /* DTrace pid return */ +#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 01:55:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9359E106564A; Mon, 7 Nov 2011 01:55:58 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82D088FC19; Mon, 7 Nov 2011 01:55:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA71twEe051726; Mon, 7 Nov 2011 01:55:58 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA71tw67051724; Mon, 7 Nov 2011 01:55:58 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111070155.pA71tw67051724@svn.freebsd.org> From: Ryan Stone Date: Mon, 7 Nov 2011 01: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: r227291 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 01:55:58 -0000 Author: rstone Date: Mon Nov 7 01:55:58 2011 New Revision: 227291 URL: http://svn.freebsd.org/changeset/base/227291 Log: Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to write to the .text section of a process. Obtained from: rpaulo MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Nov 7 01:53:25 2011 (r227290) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Nov 7 01:55:58 2011 (r227291) @@ -97,7 +97,7 @@ uwrite(proc_t *p, void *kaddr, size_t le return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); } -#endif +#endif /* sun */ #ifdef __i386__ #define r_rax r_eax #define r_rbx r_ebx @@ -1380,6 +1380,7 @@ fasttrap_pid_probe(struct reg *rp) { int ret = 0; uintptr_t addr = 0; + #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); @@ -1558,7 +1559,7 @@ fasttrap_pid_probe(struct reg *rp) * ------------------------ ----- * a: <= 15 * jmp ftt_size> 5 - * b: <= 15 + * b: <= 15 * int T_DTRACE_RET 2 * ----- * <= 37 @@ -1731,12 +1732,16 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); + +#if defined(sun) if (fasttrap_copyout(scratch, (char *)addr, i)) { +#else + if (uwrite(curproc, scratch, i, addr)) { +#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; } - if (tp->ftt_retids != NULL) { curthread->t_dtrace_step = 1; curthread->t_dtrace_ret = 1; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 06:24:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55390106564A; Mon, 7 Nov 2011 06:24:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA548FC0C; Mon, 7 Nov 2011 06:24:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA76OZ6E060519; Mon, 7 Nov 2011 06:24:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA76OZLM060517; Mon, 7 Nov 2011 06:24:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111070624.pA76OZLM060517@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Nov 2011 06:24: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: r227292 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 06:24:36 -0000 Author: ae Date: Mon Nov 7 06:24:35 2011 New Revision: 227292 URL: http://svn.freebsd.org/changeset/base/227292 Log: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC after: 2 week Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Mon Nov 7 01:55:58 2011 (r227291) +++ head/sbin/fdisk/fdisk.c Mon Nov 7 06:24:35 2011 (r227292) @@ -232,6 +232,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -769,49 +770,74 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 06:44:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 347D1106566B; Mon, 7 Nov 2011 06:44:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 200EE8FC0C; Mon, 7 Nov 2011 06:44:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA76ioZl061364; Mon, 7 Nov 2011 06:44:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA76imBO061270; Mon, 7 Nov 2011 06:44:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111070644.pA76imBO061270@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Nov 2011 06:44: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: r227293 - in head/sys: arm/arm arm/xscale/pxa cam cam/ata cam/scsi cddl/dev/cyclic cddl/dev/fbt compat/linux dev/aac dev/acpi_support dev/acpica dev/acpica/Osd dev/ahci dev/amr dev/ath ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 06:44:50 -0000 Author: ed Date: Mon Nov 7 06:44:47 2011 New Revision: 227293 URL: http://svn.freebsd.org/changeset/base/227293 Log: Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. This means that their use is restricted to a single C file. Modified: head/sys/arm/arm/vm_machdep.c head/sys/arm/xscale/pxa/pxa_smi.c head/sys/arm/xscale/pxa/pxa_space.c head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/cam_periph.c head/sys/cam/cam_queue.c head/sys/cam/cam_sim.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_low.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_ses.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/cddl/dev/cyclic/cyclic.c head/sys/cddl/dev/fbt/fbt.c head/sys/compat/linux/linux_futex.c head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/acpi_support/acpi_wmi.c head/sys/dev/acpica/Osd/OsdInterrupt.c head/sys/dev/acpica/Osd/OsdMemory.c head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/dev/acpica/Osd/OsdSynch.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_cmbat.c head/sys/dev/acpica/acpi_pci_link.c head/sys/dev/acpica/acpi_perf.c head/sys/dev/acpica/acpi_powerres.c head/sys/dev/acpica/acpi_video.c head/sys/dev/ahci/ahci.c head/sys/dev/amr/amr.c head/sys/dev/amr/amr_cam.c head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/if_ath.c head/sys/dev/ciss/ciss.c head/sys/dev/firewire/fwmem.c head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/firewire/sbp.c head/sys/dev/firewire/sbp_targ.c head/sys/dev/iicbus/ad7417.c head/sys/dev/iicbus/max6690.c head/sys/dev/iir/iir.c head/sys/dev/ipmi/ipmi.c head/sys/dev/iscsi/initiator/isc_subr.c head/sys/dev/iscsi/initiator/iscsi.c head/sys/dev/malo/if_malo.c head/sys/dev/mps/mps_sas.c head/sys/dev/mvs/mvs.c head/sys/dev/mwl/if_mwl.c head/sys/dev/nmdm/nmdm.c head/sys/dev/puc/puc.c head/sys/dev/quicc/quicc_core.c head/sys/dev/scc/scc_core.c head/sys/dev/siis/siis.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/spicds.c head/sys/dev/sound/pcm/ac97.c head/sys/dev/sound/pcm/feeder.c head/sys/dev/sound/pcm/mixer.c head/sys/dev/tdfx/tdfx_pci.c head/sys/dev/twa/tw_osl_freebsd.c head/sys/dev/twe/twe_freebsd.c head/sys/dev/uart/uart_core.c head/sys/dev/xen/balloon/balloon.c head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/blkfront/blkfront.c head/sys/fs/ntfs/ntfs_subr.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/udf/udf_vnops.c head/sys/geom/uzip/g_uzip.c head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c head/sys/ia64/ia64/mca.c head/sys/ia64/ia64/sapic.c head/sys/ia64/ia64/sscdisk.c head/sys/ia64/ia64/unwind.c head/sys/kern/kern_dtrace.c head/sys/kern/kern_fail.c head/sys/kern/kern_jail.c head/sys/kern/kern_lockf.c head/sys/kern/kern_rctl.c head/sys/kern/kern_timeout.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_witness.c head/sys/kern/vfs_mount.c head/sys/libkern/iconv.c head/sys/net/if.c head/sys/net/if_arcsubr.c head/sys/net/if_atmsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fwsubr.c head/sys/net/if_iso88025subr.c head/sys/net/if_spppsubr.c head/sys/net/vnet.c head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_power.c head/sys/netgraph/atm/ngatmbase.c head/sys/netgraph/atm/uni/ng_uni.c head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netgraph/ng_async.c head/sys/netgraph/ng_base.c head/sys/netgraph/ng_bpf.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_deflate.c head/sys/netgraph/ng_gif_demux.c head/sys/netgraph/ng_hub.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_l2tp.c head/sys/netgraph/ng_mppc.c head/sys/netgraph/ng_parse.c head/sys/netgraph/ng_ppp.c head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pred1.c head/sys/netgraph/ng_sample.c head/sys/netgraph/ng_socket.c head/sys/netgraph/ng_sppp.c head/sys/netgraph/ng_tag.c head/sys/netinet/igmp.c head/sys/netinet/ipfw/dn_heap.c head/sys/netinet/ipfw/ip_fw_table.c head/sys/netinet/libalias/alias_sctp.c head/sys/netinet6/mld6.c head/sys/netinet6/send.c head/sys/netipx/spx_reass.c head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_rq.c head/sys/netsmb/smb_subr.c head/sys/nfs/nfs_lock.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/include/linux/linux_idr.c head/sys/ofed/include/linux/linux_radix.c head/sys/powerpc/ofw/ofw_real.c head/sys/powerpc/ofw/rtas.c head/sys/powerpc/powermac/dbdma.c head/sys/powerpc/powermac/fcu.c head/sys/powerpc/powermac/powermac_thermal.c head/sys/powerpc/powermac/smu.c head/sys/powerpc/powermac/smusat.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_portacl/mac_portacl.c head/sys/sparc64/sparc64/iommu.c head/sys/x86/acpica/acpi_apm.c head/sys/x86/acpica/madt.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/arm/arm/vm_machdep.c Mon Nov 7 06:44:47 2011 (r227293) @@ -526,7 +526,7 @@ extern uma_zone_t l2zone; struct mtx smallalloc_mtx; -MALLOC_DEFINE(M_VMSMALLALLOC, "vm_small_alloc", "VM Small alloc data"); +static MALLOC_DEFINE(M_VMSMALLALLOC, "vm_small_alloc", "VM Small alloc data"); vm_offset_t alloc_firstaddr; Modified: head/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_smi.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/arm/xscale/pxa/pxa_smi.c Mon Nov 7 06:44:47 2011 (r227293) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PXASMI, "PXA SMI", "Data for static memory interface devices."); +static MALLOC_DEFINE(M_PXASMI, "PXA SMI", + "Data for static memory interface devices."); struct pxa_smi_softc { struct resource *ps_res[1]; Modified: head/sys/arm/xscale/pxa/pxa_space.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_space.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/arm/xscale/pxa/pxa_space.c Mon Nov 7 06:44:47 2011 (r227293) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PXATAG, "PXA bus_space tags", "Bus_space tags for PXA"); +static MALLOC_DEFINE(M_PXATAG, "PXA bus_space tags", "Bus_space tags for PXA"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/ata/ata_da.c Mon Nov 7 06:44:47 2011 (r227293) @@ -378,7 +378,7 @@ static struct periph_driver adadriver = PERIPHDRIVER_DECLARE(ada, adadriver); -MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); +static MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); static int adaopen(struct disk *dp) Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/ata/ata_pmp.c Mon Nov 7 06:44:47 2011 (r227293) @@ -147,7 +147,7 @@ static struct periph_driver pmpdriver = PERIPHDRIVER_DECLARE(pmp, pmpdriver); -MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); +static MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); static void pmpinit(void) Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/cam_periph.c Mon Nov 7 06:44:47 2011 (r227293) @@ -87,7 +87,7 @@ static int nperiph_drivers; static int initialized = 0; struct periph_driver **periph_drivers; -MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers"); +static MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers"); static int periph_selto_delay = 1000; TUNABLE_INT("kern.cam.periph_selto_delay", &periph_selto_delay); Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/cam_queue.c Mon Nov 7 06:44:47 2011 (r227293) @@ -40,9 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_CAMQ, "CAM queue", "CAM queue buffers"); -MALLOC_DEFINE(M_CAMDEVQ, "CAM dev queue", "CAM dev queue buffers"); -MALLOC_DEFINE(M_CAMCCBQ, "CAM ccb queue", "CAM ccb queue buffers"); +static MALLOC_DEFINE(M_CAMQ, "CAM queue", "CAM queue buffers"); +static MALLOC_DEFINE(M_CAMDEVQ, "CAM dev queue", "CAM dev queue buffers"); +static MALLOC_DEFINE(M_CAMCCBQ, "CAM ccb queue", "CAM ccb queue buffers"); static __inline int queue_cmp(cam_pinfo **queue_array, int i, int j); Modified: head/sys/cam/cam_sim.c ============================================================================== --- head/sys/cam/cam_sim.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/cam_sim.c Mon Nov 7 06:44:47 2011 (r227293) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #define CAM_PATH_ANY (u_int32_t)-1 -MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers"); +static MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers"); struct cam_devq * cam_simq_alloc(u_int32_t max_sim_transactions) Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_cd.c Mon Nov 7 06:44:47 2011 (r227293) @@ -336,7 +336,7 @@ static struct mtx changerq_mtx; static STAILQ_HEAD(changerlist, cdchanger) changerq; static int num_changers; -MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); +static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); static void cdinit(void) Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_ch.c Mon Nov 7 06:44:47 2011 (r227293) @@ -218,7 +218,7 @@ static struct cdevsw ch_cdevsw = { .d_name = "ch", }; -MALLOC_DEFINE(M_SCSICH, "scsi_ch", "scsi_ch buffers"); +static MALLOC_DEFINE(M_SCSICH, "scsi_ch", "scsi_ch buffers"); static void chinit(void) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_da.c Mon Nov 7 06:44:47 2011 (r227293) @@ -642,7 +642,7 @@ static struct periph_driver dadriver = PERIPHDRIVER_DECLARE(da, dadriver); -MALLOC_DEFINE(M_SCSIDA, "scsi_da", "scsi_da buffers"); +static MALLOC_DEFINE(M_SCSIDA, "scsi_da", "scsi_da buffers"); static int daopen(struct disk *dp) Modified: head/sys/cam/scsi/scsi_low.c ============================================================================== --- head/sys/cam/scsi/scsi_low.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_low.c Mon Nov 7 06:44:47 2011 (r227293) @@ -145,7 +145,7 @@ __FBSDID("$FreeBSD$"); #define SCSI_LOW_DISK_LFLAGS 0x0000ffff #define SCSI_LOW_DISK_TFLAGS 0xffff0000 -MALLOC_DEFINE(M_SCSILOW, "SCSI low", "SCSI low buffers"); +static MALLOC_DEFINE(M_SCSILOW, "SCSI low", "SCSI low buffers"); /************************************************************** * Declarations Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_sa.c Mon Nov 7 06:44:47 2011 (r227293) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); * Driver states */ -MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers"); +static MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers"); typedef enum { SA_STATE_NORMAL, SA_STATE_ABNORMAL Modified: head/sys/cam/scsi/scsi_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_ses.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_ses.c Mon Nov 7 06:44:47 2011 (r227293) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_SCSISES, "SCSI SES", "SCSI SES buffers"); +static MALLOC_DEFINE(M_SCSISES, "SCSI SES", "SCSI SES buffers"); /* * Platform Independent Driver Internal Definitions for SES devices. Modified: head/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- head/sys/cam/scsi/scsi_targ_bh.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cam/scsi/scsi_targ_bh.c Mon Nov 7 06:44:47 2011 (r227293) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_SCSIBH, "SCSI bh", "SCSI blackhole buffers"); +static MALLOC_DEFINE(M_SCSIBH, "SCSI bh", "SCSI blackhole buffers"); typedef enum { TARGBH_STATE_NORMAL, Modified: head/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- head/sys/cddl/dev/cyclic/cyclic.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cddl/dev/cyclic/cyclic.c Mon Nov 7 06:44:47 2011 (r227293) @@ -339,7 +339,7 @@ static kmem_cache_t *cyclic_id_cache; static cyc_id_t *cyclic_id_head; static cyc_backend_t cyclic_backend; -MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); +static MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); static __inline hrtime_t cyc_gethrtime(void) Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/cddl/dev/fbt/fbt.c Mon Nov 7 06:44:47 2011 (r227293) @@ -61,7 +61,7 @@ #include #include -MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); +static MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); #define FBT_PUSHL_EBP 0x55 #define FBT_MOVL_ESP_EBP0_V0 0x8b Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/compat/linux/linux_futex.c Mon Nov 7 06:44:47 2011 (r227293) @@ -65,8 +65,8 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include -MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); -MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); +static MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); +static MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); struct futex; Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/aac/aac.c Mon Nov 7 06:44:47 2011 (r227293) @@ -219,7 +219,7 @@ static struct cdevsw aac_cdevsw = { .d_name = "aac", }; -MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); +static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/aac/aac_cam.c Mon Nov 7 06:44:47 2011 (r227293) @@ -104,7 +104,7 @@ static driver_t aac_pass_driver = { DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, 0, 0); MODULE_DEPEND(aacp, cam, 1, 1, 1); -MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); +static MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); static void aac_cam_rescan(struct aac_softc *sc, uint32_t channel, uint32_t target_id) Modified: head/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- head/sys/dev/acpi_support/acpi_wmi.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpi_support/acpi_wmi.c Mon Nov 7 06:44:47 2011 (r227293) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_wmi_if.h" -MALLOC_DEFINE(M_ACPIWMI, "acpiwmi", "ACPI-WMI mapping"); +static MALLOC_DEFINE(M_ACPIWMI, "acpiwmi", "ACPI-WMI mapping"); #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("ACPI_WMI"); Modified: head/sys/dev/acpica/Osd/OsdInterrupt.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdInterrupt.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/Osd/OsdInterrupt.c Mon Nov 7 06:44:47 2011 (r227293) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("INTERRUPT") -MALLOC_DEFINE(M_ACPIINTR, "acpiintr", "ACPI interrupt"); +static MALLOC_DEFINE(M_ACPIINTR, "acpiintr", "ACPI interrupt"); struct acpi_intr { SLIST_ENTRY(acpi_intr) ai_link; Modified: head/sys/dev/acpica/Osd/OsdMemory.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdMemory.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/Osd/OsdMemory.c Mon Nov 7 06:44:47 2011 (r227293) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool"); +static MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool"); void * AcpiOsAllocate(ACPI_SIZE Size) Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Mon Nov 7 06:44:47 2011 (r227293) @@ -65,7 +65,7 @@ TUNABLE_INT("debug.acpi.max_tasks", &acp static int acpi_max_threads = ACPI_MAX_THREADS; TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads); -MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); +static MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); struct acpi_task_ctx { struct task at_task; Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/Osd/OsdSynch.c Mon Nov 7 06:44:47 2011 (r227293) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("SYNCH") -MALLOC_DEFINE(M_ACPISEM, "acpisem", "ACPI semaphore"); +static MALLOC_DEFINE(M_ACPISEM, "acpisem", "ACPI semaphore"); /* * Convert milliseconds to ticks. Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi.c Mon Nov 7 06:44:47 2011 (r227293) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); +static MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); /* Hooks for the ACPI CA debugging infrastructure */ #define _COMPONENT ACPI_BUS Modified: head/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- head/sys/dev/acpica/acpi_cmbat.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi_cmbat.c Mon Nov 7 06:44:47 2011 (r227293) @@ -46,7 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ACPICMBAT, "acpicmbat", "ACPI control method battery data"); +static MALLOC_DEFINE(M_ACPICMBAT, "acpicmbat", + "ACPI control method battery data"); /* Number of times to retry initialization before giving up. */ #define ACPI_CMBAT_RETRY_MAX 6 Modified: head/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- head/sys/dev/acpica/acpi_pci_link.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi_pci_link.c Mon Nov 7 06:44:47 2011 (r227293) @@ -120,7 +120,7 @@ struct link_res_request { int link_index; }; -MALLOC_DEFINE(M_PCI_LINK, "pci_link", "ACPI PCI Link structures"); +static MALLOC_DEFINE(M_PCI_LINK, "pci_link", "ACPI PCI Link structures"); static int pci_link_interrupt_weights[NUM_ACPI_INTERRUPTS]; static int pci_link_bios_isa_irqs; Modified: head/sys/dev/acpica/acpi_perf.c ============================================================================== --- head/sys/dev/acpica/acpi_perf.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi_perf.c Mon Nov 7 06:44:47 2011 (r227293) @@ -135,7 +135,7 @@ static devclass_t acpi_perf_devclass; DRIVER_MODULE(acpi_perf, cpu, acpi_perf_driver, acpi_perf_devclass, 0, 0); MODULE_DEPEND(acpi_perf, acpi, 1, 1, 1); -MALLOC_DEFINE(M_ACPIPERF, "acpi_perf", "ACPI Performance states"); +static MALLOC_DEFINE(M_ACPIPERF, "acpi_perf", "ACPI Performance states"); static void acpi_perf_identify(driver_t *driver, device_t parent) Modified: head/sys/dev/acpica/acpi_powerres.c ============================================================================== --- head/sys/dev/acpica/acpi_powerres.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi_powerres.c Mon Nov 7 06:44:47 2011 (r227293) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * on, turned off, etc. */ -MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources"); +static MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources"); /* Hooks for the ACPI CA debugging infrastructure */ #define _COMPONENT ACPI_POWERRES Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/acpica/acpi_video.c Mon Nov 7 06:44:47 2011 (r227293) @@ -183,7 +183,7 @@ static struct acpi_video_output_queue cr */ ACPI_SERIAL_DECL(video, "ACPI video"); ACPI_SERIAL_DECL(video_output, "ACPI video output"); -MALLOC_DEFINE(M_ACPIVIDEO, "acpivideo", "ACPI video extension"); +static MALLOC_DEFINE(M_ACPIVIDEO, "acpivideo", "ACPI video extension"); static int acpi_video_modevent(struct module *mod __unused, int evt, void *cookie __unused) Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/ahci/ahci.c Mon Nov 7 06:44:47 2011 (r227293) @@ -101,7 +101,7 @@ static void ahci_process_request_sense(d static void ahciaction(struct cam_sim *sim, union ccb *ccb); static void ahcipoll(struct cam_sim *sim); -MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); +static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); static struct { uint32_t id; Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/amr/amr.c Mon Nov 7 06:44:47 2011 (r227293) @@ -175,7 +175,7 @@ static void amr_init_sysctl(struct amr_s static int amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td); -MALLOC_DEFINE(M_AMR, "amr", "AMR memory"); +static MALLOC_DEFINE(M_AMR, "amr", "AMR memory"); /******************************************************************************** ******************************************************************************** Modified: head/sys/dev/amr/amr_cam.c ============================================================================== --- head/sys/dev/amr/amr_cam.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/amr/amr_cam.c Mon Nov 7 06:44:47 2011 (r227293) @@ -109,7 +109,7 @@ static driver_t amr_pass_driver = { DRIVER_MODULE(amrp, amr, amr_pass_driver, amr_pass_devclass, 0, 0); MODULE_DEPEND(amrp, cam, 1, 1, 1); -MALLOC_DEFINE(M_AMRCAM, "amrcam", "AMR CAM memory"); +static MALLOC_DEFINE(M_AMRCAM, "amrcam", "AMR CAM memory"); /*********************************************************************** * Enqueue/dequeue functions Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/ath/ah_osdep.c Mon Nov 7 06:44:47 2011 (r227293) @@ -85,7 +85,7 @@ SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); #endif /* AH_DEBUG */ -MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); +static MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); void* ath_hal_malloc(size_t size) Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/ath/if_ath.c Mon Nov 7 06:44:47 2011 (r227293) @@ -263,7 +263,7 @@ static int ath_bstuck_threshold = 4; /* SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); -MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); +static MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/ciss/ciss.c Mon Nov 7 06:44:47 2011 (r227293) @@ -105,7 +105,8 @@ #include #include -MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", "ciss internal data buffers"); +static MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", + "ciss internal data buffers"); /* pci interface */ static int ciss_lookup(device_t dev); Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/firewire/fwmem.c Mon Nov 7 06:44:47 2011 (r227293) @@ -84,7 +84,7 @@ SYSCTL_INT(_hw_firewire_fwmem, OID_AUTO, SYSCTL_INT(_debug, OID_AUTO, fwmem_debug, CTLFLAG_RW, &fwmem_debug, 0, "Fwmem driver debug flag"); -MALLOC_DEFINE(M_FWMEM, "fwmem", "fwmem/FireWire"); +static MALLOC_DEFINE(M_FWMEM, "fwmem", "fwmem/FireWire"); #define MAXLEN (512 << fwmem_speed) Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/firewire/if_fwe.c Mon Nov 7 06:44:47 2011 (r227293) @@ -86,7 +86,7 @@ static int stream_ch = 1; static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; -MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); +static MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/firewire/if_fwip.c Mon Nov 7 06:44:47 2011 (r227293) @@ -99,7 +99,7 @@ static int broadcast_channel = 0xc0 | 0x static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; -MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); +static MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/firewire/sbp.c Mon Nov 7 06:44:47 2011 (r227293) @@ -276,7 +276,7 @@ static void sbp_mgm_timeout (void *arg); static void sbp_timeout (void *arg); static void sbp_mgm_orb (struct sbp_dev *, int, struct sbp_ocb *); -MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire"); +static MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire"); /* cam related functions */ static void sbp_action(struct cam_sim *sim, union ccb *ccb); Modified: head/sys/dev/firewire/sbp_targ.c ============================================================================== --- head/sys/dev/firewire/sbp_targ.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/firewire/sbp_targ.c Mon Nov 7 06:44:47 2011 (r227293) @@ -95,7 +95,7 @@ #define F_HOLD (1 << 3) #define F_FREEZED (1 << 4) -MALLOC_DEFINE(M_SBP_TARG, "sbp_targ", "SBP-II/FireWire target mode"); +static MALLOC_DEFINE(M_SBP_TARG, "sbp_targ", "SBP-II/FireWire target mode"); static int debug = 0; Modified: head/sys/dev/iicbus/ad7417.c ============================================================================== --- head/sys/dev/iicbus/ad7417.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/iicbus/ad7417.c Mon Nov 7 06:44:47 2011 (r227293) @@ -121,7 +121,7 @@ static driver_t ad7417_driver = { static devclass_t ad7417_devclass; DRIVER_MODULE(ad7417, iicbus, ad7417_driver, ad7417_devclass, 0, 0); -MALLOC_DEFINE(M_AD7417, "ad7417", "Supply-Monitor AD7417"); +static MALLOC_DEFINE(M_AD7417, "ad7417", "Supply-Monitor AD7417"); static int Modified: head/sys/dev/iicbus/max6690.c ============================================================================== --- head/sys/dev/iicbus/max6690.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/iicbus/max6690.c Mon Nov 7 06:44:47 2011 (r227293) @@ -101,7 +101,7 @@ static driver_t max6690_driver = { static devclass_t max6690_devclass; DRIVER_MODULE(max6690, iicbus, max6690_driver, max6690_devclass, 0, 0); -MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); +static MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); static int max6690_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/iir/iir.c Mon Nov 7 06:44:47 2011 (r227293) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); +static MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); struct gdt_softc *gdt_wait_gdt; int gdt_wait_index; Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/ipmi/ipmi.c Mon Nov 7 06:44:47 2011 (r227293) @@ -75,7 +75,7 @@ static struct cdevsw ipmi_cdevsw = { .d_name = "ipmi", }; -MALLOC_DEFINE(M_IPMI, "ipmi", "ipmi"); +static MALLOC_DEFINE(M_IPMI, "ipmi", "ipmi"); static int ipmi_open(struct cdev *cdev, int flags, int fmt, struct thread *td) Modified: head/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_subr.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/iscsi/initiator/isc_subr.c Mon Nov 7 06:44:47 2011 (r227293) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ISC, "iSC", "iSCSI driver options"); +static MALLOC_DEFINE(M_ISC, "iSC", "iSCSI driver options"); static char * i_strdupin(char *s, size_t maxlen) Modified: head/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/iscsi/initiator/iscsi.c Mon Nov 7 06:44:47 2011 (r227293) @@ -66,7 +66,7 @@ static struct isc_softc *isc; MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI driver"); MALLOC_DEFINE(M_ISCSIBUF, "iSCbuf", "iSCSI buffers"); -MALLOC_DEFINE(M_TMP, "iSCtmp", "iSCSI tmp"); +static MALLOC_DEFINE(M_TMP, "iSCtmp", "iSCSI tmp"); #ifdef ISCSI_INITIATOR_DEBUG int iscsi_debug = ISCSI_INITIATOR_DEBUG; Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/malo/if_malo.c Mon Nov 7 06:44:47 2011 (r227293) @@ -123,7 +123,7 @@ enum { } while (0) #endif -MALLOC_DEFINE(M_MALODEV, "malodev", "malo driver dma buffers"); +static MALLOC_DEFINE(M_MALODEV, "malodev", "malo driver dma buffers"); static struct ieee80211vap *malo_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, int opmode, int flags, Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/mps/mps_sas.c Mon Nov 7 06:44:47 2011 (r227293) @@ -119,7 +119,7 @@ struct mpssas_devprobe { #define MPSSAS_DISCOVERY_TIMEOUT 20 #define MPSSAS_MAX_DISCOVERY_TIMEOUTS 10 /* 200 seconds */ -MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); +static MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, Modified: head/sys/dev/mvs/mvs.c ============================================================================== --- head/sys/dev/mvs/mvs.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/mvs/mvs.c Mon Nov 7 06:44:47 2011 (r227293) @@ -94,7 +94,7 @@ static void mvs_process_request_sense(de static void mvsaction(struct cam_sim *sim, union ccb *ccb); static void mvspoll(struct cam_sim *sim); -MALLOC_DEFINE(M_MVS, "MVS driver", "MVS driver data buffers"); +static MALLOC_DEFINE(M_MVS, "MVS driver", "MVS driver data buffers"); #define recovery_type spriv_field0 #define RECOVERY_NONE 0 Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/mwl/if_mwl.c Mon Nov 7 06:44:47 2011 (r227293) @@ -262,7 +262,7 @@ static void mwl_printtxbuf(const struct } while (0) #endif -MALLOC_DEFINE(M_MWLDEV, "mwldev", "mwl driver dma buffers"); +static MALLOC_DEFINE(M_MWLDEV, "mwldev", "mwl driver dma buffers"); /* * Each packet has fixed front matter: a 2-byte length Modified: head/sys/dev/nmdm/nmdm.c ============================================================================== --- head/sys/dev/nmdm/nmdm.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/nmdm/nmdm.c Mon Nov 7 06:44:47 2011 (r227293) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures"); +static MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures"); static tsw_inwakeup_t nmdm_outwakeup; static tsw_outwakeup_t nmdm_inwakeup; Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/puc/puc.c Mon Nov 7 06:44:47 2011 (r227293) @@ -68,7 +68,7 @@ struct puc_port { devclass_t puc_devclass; const char puc_driver_name[] = "puc"; -MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); +static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); struct puc_bar * puc_get_bar(struct puc_softc *sc, int rid) Modified: head/sys/dev/quicc/quicc_core.c ============================================================================== --- head/sys/dev/quicc/quicc_core.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/quicc/quicc_core.c Mon Nov 7 06:44:47 2011 (r227293) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); devclass_t quicc_devclass; char quicc_driver_name[] = "quicc"; -MALLOC_DEFINE(M_QUICC, "QUICC", "QUICC driver"); +static MALLOC_DEFINE(M_QUICC, "QUICC", "QUICC driver"); struct quicc_device { struct rman *qd_rman; Modified: head/sys/dev/scc/scc_core.c ============================================================================== --- head/sys/dev/scc/scc_core.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/scc/scc_core.c Mon Nov 7 06:44:47 2011 (r227293) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); devclass_t scc_devclass; char scc_driver_name[] = "scc"; -MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); +static MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); static int scc_bfe_intr(void *arg) Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/siis/siis.c Mon Nov 7 06:44:47 2011 (r227293) @@ -91,7 +91,7 @@ static void siis_process_request_sense(d static void siisaction(struct cam_sim *sim, union ccb *ccb); static void siispoll(struct cam_sim *sim); -MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers"); +static MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers"); static struct { uint32_t id; Modified: head/sys/dev/sound/pci/envy24.c ============================================================================== --- head/sys/dev/sound/pci/envy24.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pci/envy24.c Mon Nov 7 06:44:47 2011 (r227293) @@ -41,7 +41,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio"); +static MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio"); /* -------------------------------------------------------------------- */ Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pci/envy24ht.c Mon Nov 7 06:44:47 2011 (r227293) @@ -53,7 +53,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_ENVY24HT, "envy24ht", "envy24ht audio"); +static MALLOC_DEFINE(M_ENVY24HT, "envy24ht", "envy24ht audio"); /* -------------------------------------------------------------------- */ Modified: head/sys/dev/sound/pci/spicds.c ============================================================================== --- head/sys/dev/sound/pci/spicds.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pci/spicds.c Mon Nov 7 06:44:47 2011 (r227293) @@ -35,7 +35,7 @@ #include -MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec"); +static MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec"); #define SPICDS_NAMELEN 16 struct spicds_info { Modified: head/sys/dev/sound/pcm/ac97.c ============================================================================== --- head/sys/dev/sound/pcm/ac97.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pcm/ac97.c Mon Nov 7 06:44:47 2011 (r227293) @@ -38,7 +38,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); +static MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); struct ac97mixtable_entry { int reg; /* register index */ Modified: head/sys/dev/sound/pcm/feeder.c ============================================================================== --- head/sys/dev/sound/pcm/feeder.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pcm/feeder.c Mon Nov 7 06:44:47 2011 (r227293) @@ -35,7 +35,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); +static MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); #define MAXFEEDERS 256 #undef FEEDER_DEBUG Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/sound/pcm/mixer.c Mon Nov 7 06:44:47 2011 (r227293) @@ -37,7 +37,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); +static MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); static int mixer_bypass = 1; TUNABLE_INT("hw.snd.vpc_mixer_bypass", &mixer_bypass); Modified: head/sys/dev/tdfx/tdfx_pci.c ============================================================================== --- head/sys/dev/tdfx/tdfx_pci.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/tdfx/tdfx_pci.c Mon Nov 7 06:44:47 2011 (r227293) @@ -89,7 +89,7 @@ static device_method_t tdfx_methods[] = { 0, 0 } }; -MALLOC_DEFINE(M_TDFX,"tdfx_driver","3DFX Graphics[/2D]/3D Accelerator(s)"); +static MALLOC_DEFINE(M_TDFX,"tdfx_driver","3DFX Graphics[/2D]/3D Accelerators"); /* Char. Dev. file operations structure */ static struct cdevsw tdfx_cdev = { Modified: head/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- head/sys/dev/twa/tw_osl_freebsd.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/twa/tw_osl_freebsd.c Mon Nov 7 06:44:47 2011 (r227293) @@ -54,7 +54,7 @@ TW_INT32 TW_DEBUG_LEVEL_FOR_OSL = TW_OSL TW_INT32 TW_OSL_DEBUG_LEVEL_FOR_CL = TW_OSL_DEBUG; #endif /* TW_OSL_DEBUG */ -MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands"); +static MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands"); static d_open_t twa_open; Modified: head/sys/dev/twe/twe_freebsd.c ============================================================================== --- head/sys/dev/twe/twe_freebsd.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/twe/twe_freebsd.c Mon Nov 7 06:44:47 2011 (r227293) @@ -872,7 +872,7 @@ twed_detach(device_t dev) /******************************************************************************** * Allocate a command buffer */ -MALLOC_DEFINE(TWE_MALLOC_CLASS, "twe_commands", "twe commands"); +static MALLOC_DEFINE(TWE_MALLOC_CLASS, "twe_commands", "twe commands"); struct twe_request * twe_allocate_request(struct twe_softc *sc, int tag) Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/uart/uart_core.c Mon Nov 7 06:44:47 2011 (r227293) @@ -56,7 +56,7 @@ char uart_driver_name[] = "uart"; SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs = SLIST_HEAD_INITIALIZER(uart_sysdevs); -MALLOC_DEFINE(M_UART, "UART", "UART driver"); +static MALLOC_DEFINE(M_UART, "UART", "UART driver"); void uart_add_sysdev(struct uart_devinfo *di) Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/xen/balloon/balloon.c Mon Nov 7 06:44:47 2011 (r227293) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_BALLOON, "Balloon", "Xen Balloon Driver"); +static MALLOC_DEFINE(M_BALLOON, "Balloon", "Xen Balloon Driver"); struct mtx balloon_mutex; Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/xen/blkback/blkback.c Mon Nov 7 06:44:47 2011 (r227293) @@ -121,7 +121,7 @@ __FBSDID("$FreeBSD$"); /** * Custom malloc type for all driver allocations. */ -MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data"); +static MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data"); #ifdef XBB_DEBUG #define DPRINTF(fmt, args...) \ Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Nov 7 06:44:47 2011 (r227293) @@ -81,7 +81,7 @@ static int blkif_completion(struct xb_co static void blkif_free(struct xb_softc *); static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); -MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); +static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); #define GRANT_INVALID_REF 0 Modified: head/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/fs/ntfs/ntfs_subr.c Mon Nov 7 06:44:47 2011 (r227293) @@ -51,10 +51,12 @@ #include #include -MALLOC_DEFINE(M_NTFSNTVATTR, "ntfs_vattr", "NTFS file attribute information"); -MALLOC_DEFINE(M_NTFSRDATA, "ntfsd_resdata", "NTFS resident data"); -MALLOC_DEFINE(M_NTFSRUN, "ntfs_vrun", "NTFS vrun storage"); -MALLOC_DEFINE(M_NTFSDECOMP, "ntfs_decomp", "NTFS decompression temporary"); +static MALLOC_DEFINE(M_NTFSNTVATTR, "ntfs_vattr", + "NTFS file attribute information"); +static MALLOC_DEFINE(M_NTFSRDATA, "ntfsd_resdata", "NTFS resident data"); +static MALLOC_DEFINE(M_NTFSRUN, "ntfs_vrun", "NTFS vrun storage"); +static MALLOC_DEFINE(M_NTFSDECOMP, "ntfs_decomp", + "NTFS decompression temporary"); static int ntfs_ntlookupattr(struct ntfsmount *, const char *, int, int *, char **); static int ntfs_findvattr(struct ntfsmount *, struct ntnode *, struct ntvattr **, struct ntvattr **, u_int32_t, const char *, size_t, cn_t); Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/fs/smbfs/smbfs_node.c Mon Nov 7 06:44:47 2011 (r227293) @@ -58,7 +58,7 @@ extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */ -MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); +static MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); static MALLOC_DEFINE(M_SMBNODENAME, "smbufs_nname", "SMBFS node name"); int smbfs_hashprint(struct mount *mp); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/fs/udf/udf_vnops.c Mon Nov 7 06:44:47 2011 (r227293) @@ -107,8 +107,8 @@ struct vop_vector udf_fifoops = { .vop_vptofh = udf_vptofh, }; -MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); -MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); +static MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); +static MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); #define UDF_INVALID_BMAP -1 Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/geom/uzip/g_uzip.c Mon Nov 7 06:44:47 2011 (r227293) @@ -50,7 +50,7 @@ FEATURE(geom_uzip, "GEOM uzip read-only #define DPRINTF(a) #endif -MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); +static MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); #define UZIP_CLASS_NAME "UZIP" Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Mon Nov 7 06:44:47 2011 (r227293) @@ -71,7 +71,7 @@ #include -MALLOC_DEFINE(M_XFSNODE, "XFS node", "XFS vnode private part"); +static MALLOC_DEFINE(M_XFSNODE, "XFS node", "XFS vnode private part"); static vfs_mount_t _xfs_mount; static vfs_unmount_t _xfs_unmount; Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/ia64/ia64/mca.c Mon Nov 7 06:44:47 2011 (r227293) @@ -43,7 +43,7 @@ #include #include -MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); +static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); struct mca_info { STAILQ_ENTRY(mca_info) mi_link; Modified: head/sys/ia64/ia64/sapic.c ============================================================================== --- head/sys/ia64/ia64/sapic.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/ia64/ia64/sapic.c Mon Nov 7 06:44:47 2011 (r227293) @@ -99,7 +99,7 @@ struct sapic_rte { uint64_t rte_destination_id :8; }; -MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); +static MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); struct sapic *ia64_sapics[16]; /* XXX make this resizable */ int ia64_sapic_count; Modified: head/sys/ia64/ia64/sscdisk.c ============================================================================== --- head/sys/ia64/ia64/sscdisk.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/ia64/ia64/sscdisk.c Mon Nov 7 06:44:47 2011 (r227293) @@ -72,7 +72,7 @@ ssc(u_int64_t in0, u_int64_t in1, u_int6 #define SSC_NSECT 409600 #endif -MALLOC_DEFINE(M_SSC, "ssc_disk", "Simulator Disk"); +static MALLOC_DEFINE(M_SSC, "ssc_disk", "Simulator Disk"); static d_strategy_t sscstrategy; Modified: head/sys/ia64/ia64/unwind.c ============================================================================== --- head/sys/ia64/ia64/unwind.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/ia64/ia64/unwind.c Mon Nov 7 06:44:47 2011 (r227293) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_UNWIND, "Unwind", "Unwind information"); +static MALLOC_DEFINE(M_UNWIND, "Unwind", "Unwind information"); struct unw_entry { uint64_t ue_start; /* procedure start */ Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_dtrace.c Mon Nov 7 06:44:47 2011 (r227293) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); FEATURE(kdtrace_hooks, "Kernel DTrace hooks which are required to load DTrace kernel modules"); -MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); +static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); /* Return the DTrace process data size compiled in the kernel hooks. */ size_t Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_fail.c Mon Nov 7 06:44:47 2011 (r227293) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); ILOG_DEFINE_FOR_FILE(L_ISI_FAIL_POINT, L_ILOG, fail_point); #endif -MALLOC_DEFINE(M_FAIL_POINT, "Fail Points", "fail points system"); +static MALLOC_DEFINE(M_FAIL_POINT, "Fail Points", "fail points system"); #define fp_free(ptr) free(ptr, M_FAIL_POINT) #define fp_malloc(size, flags) malloc((size), M_FAIL_POINT, (flags)) Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_jail.c Mon Nov 7 06:44:47 2011 (r227293) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); -MALLOC_DEFINE(M_PRISON_RACCT, "prison_racct", "Prison racct structures"); +static MALLOC_DEFINE(M_PRISON_RACCT, "prison_racct", "Prison racct structures"); /* Keep struct prison prison0 and some code in kern_jail_set() readable. */ #ifdef INET Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_lockf.c Mon Nov 7 06:44:47 2011 (r227293) @@ -90,7 +90,7 @@ static int lockf_debug = 0; /* control d SYSCTL_INT(_debug, OID_AUTO, lockf_debug, CTLFLAG_RW, &lockf_debug, 0, ""); #endif -MALLOC_DEFINE(M_LOCKF, "lockf", "Byte-range locking structures"); +static MALLOC_DEFINE(M_LOCKF, "lockf", "Byte-range locking structures"); struct owner_edge; struct owner_vertex; Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_rctl.c Mon Nov 7 06:44:47 2011 (r227293) @@ -169,7 +169,7 @@ RW_SYSINIT(rctl_lock, &rctl_lock, "RCTL static int rctl_rule_fully_specified(const struct rctl_rule *rule); static void rctl_rule_to_sbuf(struct sbuf *sb, const struct rctl_rule *rule); -MALLOC_DEFINE(M_RCTL, "rctl", "Resource Limits"); +static MALLOC_DEFINE(M_RCTL, "rctl", "Resource Limits"); static const char * rctl_subject_type_name(int subject) Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/kern_timeout.c Mon Nov 7 06:44:47 2011 (r227293) @@ -156,7 +156,7 @@ struct callout_cpu cc_cpu; static int timeout_cpu; void (*callout_new_inserted)(int cpu, int ticks) = NULL; -MALLOC_DEFINE(M_CALLOUT, "callout", "Callout datastructures"); +static MALLOC_DEFINE(M_CALLOUT, "callout", "Callout datastructures"); /** * Locked by cc_lock: Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/subr_pcpu.c Mon Nov 7 06:44:47 2011 (r227293) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting."); +static MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting."); struct dpcpu_free { uintptr_t df_start; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/subr_witness.c Mon Nov 7 06:44:47 2011 (r227293) @@ -184,7 +184,7 @@ __FBSDID("$FreeBSD$"); #define WITNESS_INDEX_ASSERT(i) \ MPASS((i) > 0 && (i) <= w_max_used_index && (i) < WITNESS_COUNT) -MALLOC_DEFINE(M_WITNESS, "Witness", "Witness"); +static MALLOC_DEFINE(M_WITNESS, "Witness", "Witness"); /* * Lock instances. A lock instance is the data associated with a lock while Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/kern/vfs_mount.c Mon Nov 7 06:44:47 2011 (r227293) @@ -79,7 +79,7 @@ SYSCTL_INT(_vfs, OID_AUTO, usermount, CT "Unprivileged users may mount and unmount file systems"); MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure"); -MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); +static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); static uma_zone_t mount_zone; /* List of mounted filesystems. */ Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/libkern/iconv.c Mon Nov 7 06:44:47 2011 (r227293) @@ -43,7 +43,7 @@ SYSCTL_DECL(_kern_iconv); SYSCTL_NODE(_kern, OID_AUTO, iconv, CTLFLAG_RW, NULL, "kernel iconv interface"); MALLOC_DEFINE(M_ICONV, "iconv", "ICONV structures"); -MALLOC_DEFINE(M_ICONVDATA, "iconv_data", "ICONV data"); +static MALLOC_DEFINE(M_ICONVDATA, "iconv_data", "ICONV data"); MODULE_VERSION(libiconv, 2); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Nov 7 06:24:35 2011 (r227292) +++ head/sys/net/if.c Mon Nov 7 06:44:47 2011 (r227293) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 07:09:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D965106566C; Mon, 7 Nov 2011 07:09:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E58C8FC0C; Mon, 7 Nov 2011 07:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA779dQ8062323; Mon, 7 Nov 2011 07:09:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA779dZS062321; Mon, 7 Nov 2011 07:09:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111070709.pA779dZS062321@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Nov 2011 07:09: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: r227294 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 07:09:39 -0000 Author: ed Date: Mon Nov 7 07:09:38 2011 New Revision: 227294 URL: http://svn.freebsd.org/changeset/base/227294 Log: SDT's struct sdt_argtype can be marked static everywhere. It is only passed to SYSINIT/SYSUNINIT. Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Mon Nov 7 06:44:47 2011 (r227293) +++ head/sys/sys/sdt.h Mon Nov 7 07:09:38 2011 (r227294) @@ -190,7 +190,7 @@ struct sdt_provider { (uintptr_t) arg3, (uintptr_t) arg4) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) \ - struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ + static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ = { { num, type, { NULL, NULL }, \ sdt_##prov##_##mod##_##func##_##name } \ }; \ From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 07:50:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38C24106564A; Mon, 7 Nov 2011 07:50:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 293018FC0A; Mon, 7 Nov 2011 07:50:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA77oaxT063828; Mon, 7 Nov 2011 07:50:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA77oax4063826; Mon, 7 Nov 2011 07:50:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111070750.pA77oax4063826@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Nov 2011 07:50: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: r227295 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 07:50:36 -0000 Author: ae Date: Mon Nov 7 07:50:35 2011 New Revision: 227295 URL: http://svn.freebsd.org/changeset/base/227295 Log: Fix multi-line comment formatting. Pointed by: jh MFC after: 1 week Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Mon Nov 7 07:09:38 2011 (r227294) +++ head/sbin/fdisk/fdisk.c Mon Nov 7 07:50:35 2011 (r227295) @@ -822,7 +822,8 @@ write_disk(off_t sector, void *buf) warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); } else { - /* Try to write MBR directly. This may help when disk + /* + * Try to write MBR directly. This may help when disk * is not in use. * XXX: hardcoded sectorsize */ @@ -831,7 +832,8 @@ write_disk(off_t sector, void *buf) return (0); } - /* GEOM_MBR is not available or failed to write MBR. + /* + * GEOM_MBR is not available or failed to write MBR. * Now check that we have GEOM_PART and recommend to use gpart (8). */ if (geom_class_available("PART") != 0) From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 07:51:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26ED4106564A; Mon, 7 Nov 2011 07:51:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 178388FC12; Mon, 7 Nov 2011 07:51:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA77pAuV063891; Mon, 7 Nov 2011 07:51:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA77pAh0063889; Mon, 7 Nov 2011 07:51:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111070751.pA77pAh0063889@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Nov 2011 07:51: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: r227296 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 07:51:11 -0000 Author: ae Date: Mon Nov 7 07:51:10 2011 New Revision: 227296 URL: http://svn.freebsd.org/changeset/base/227296 Log: Fix multi-line comment formatting. MFC after: 2 weeks Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Mon Nov 7 07:50:35 2011 (r227295) +++ head/sbin/bsdlabel/bsdlabel.c Mon Nov 7 07:51:10 2011 (r227296) @@ -412,7 +412,8 @@ writelabel(void) serrno = errno; if (geom_class_available("PART") != 0) { - /* Since we weren't able open provider for + /* + * Since we weren't able open provider for * writing, then recommend user to use gpart(8). */ warnc(serrno, From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 09:21:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC5F1065680; Mon, 7 Nov 2011 09:21:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C57C8FC12; Mon, 7 Nov 2011 09:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA79LIET067277; Mon, 7 Nov 2011 09:21:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA79LIUU067275; Mon, 7 Nov 2011 09:21:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111070921.pA79LIUU067275@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Nov 2011 09:21: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: r227297 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:21:18 -0000 Author: ae Date: Mon Nov 7 09:21:18 2011 New Revision: 227297 URL: http://svn.freebsd.org/changeset/base/227297 Log: Reorganize write_mbr() function to be able write bootcode with different ways. Improve error reporting and also fix indenting. Now we are trying to write bootcode: 1. Directly to provider (if we can open it for writing); 2. Via GEOM_PART (if it is available); 3. Via GEOM_MBR. MFC after: 2 weeks Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Mon Nov 7 07:51:10 2011 (r227296) +++ head/usr.sbin/boot0cfg/boot0cfg.c Mon Nov 7 09:21:18 2011 (r227297) @@ -96,6 +96,7 @@ static const char fmt0[] = "# flag static const char fmt1[] = "%d 0x%02x %4u:%3u:%2u 0x%02x" " %4u:%3u:%2u %10u %10u\n"; +static int geom_class_available(const char *); static int read_mbr(const char *, u_int8_t **, int); static void write_mbr(const char *, int, u_int8_t *, int); static void display_mbr(u_int8_t *); @@ -337,67 +338,95 @@ read_mbr(const char *disk, u_int8_t **mb return sizeof(buf); } +static int +geom_class_available(const char *name) +{ + struct gclass *class; + struct gmesh mesh; + int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + return (0); +} + /* * Write out the mbr to the specified file. */ static void write_mbr(const char *fname, int flags, u_int8_t *mbr, int mbr_size) { - int fd; - ssize_t n; - const char *errmsg; - char *pname; - struct gctl_req *grq; - - fd = open(fname, O_WRONLY | flags, 0666); - if (fd != -1) { - n = write(fd, mbr, mbr_size); - close(fd); - if (n != mbr_size) - errx(1, "%s: short write", fname); - return; - } + struct gctl_req *grq; + const char *errmsg; + char *pname; + ssize_t n; + int fd; + + fd = open(fname, O_WRONLY | flags, 0666); + if (fd != -1) { + n = write(fd, mbr, mbr_size); + close(fd); + if (n != mbr_size) + errx(1, "%s: short write", fname); + return; + } - /* - * If we're called to write to a backup file, don't try to - * write through GEOM. It only generates additional errors. - */ - if (flags != 0) - return; + /* + * If we're called to write to a backup file, don't try to + * write through GEOM. + */ + if (flags != 0) + err(1, "can't open file %s to write backup", fname); + + /* Try open it read only. */ + fd = open(fname, O_RDONLY); + if (fd == -1) { + warn("error opening %s", fname); + return; + } - /* Try open it read only. */ - fd = open(fname, O_RDONLY); - if (fd == -1) { - warn("error opening %s", fname); - return; - } - pname = g_providername(fd); - if (pname == NULL) { - warn("error getting providername for %s", fname); - return; - } - grq = gctl_get_handle(); - gctl_ro_param(grq, "class", -1, "PART"); - gctl_ro_param(grq, "arg0", -1, pname); - gctl_ro_param(grq, "verb", -1, "bootcode"); - gctl_ro_param(grq, "bootcode", mbr_size, mbr); - gctl_ro_param(grq, "flags", -1, "C"); - errmsg = gctl_issue(grq); - if (errmsg == NULL) - goto out; - - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", mbr_size, mbr); - errmsg = gctl_issue(grq); - if (errmsg != NULL) - err(1, "write_mbr: %s", fname); - -out: - free(pname); - gctl_free(grq); + pname = g_providername(fd); + if (pname == NULL) { + warn("error getting providername for %s", fname); + return; + } + + /* First check that GEOM_PART is available */ + if (geom_class_available("PART") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "class", -1, "PART"); + gctl_ro_param(grq, "arg0", -1, pname); + gctl_ro_param(grq, "verb", -1, "bootcode"); + gctl_ro_param(grq, "bootcode", mbr_size, mbr); + gctl_ro_param(grq, "flags", -1, "C"); + errmsg = gctl_issue(grq); + if (errmsg != NULL && errmsg[0] != '\0') + errx(1, "GEOM_PART: write bootcode to %s failed: %s", + fname, errmsg); + gctl_free(grq); + } else if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", mbr_size, mbr); + errmsg = gctl_issue(grq); + if (errmsg != NULL) + err(1, "GEOM_MBR: write MBR to %s failed", fname); + gctl_free(grq); + } else + errx(1, "can't write MBR to %s", fname); + free(pname); } /* From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 09:29:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FAC106564A; Mon, 7 Nov 2011 09:29:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131748FC12; Mon, 7 Nov 2011 09:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA79TA88067574; Mon, 7 Nov 2011 09:29:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA79TAMI067572; Mon, 7 Nov 2011 09:29:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111070929.pA79TAMI067572@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 7 Nov 2011 09:29: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: r227298 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:29:13 -0000 Author: ae Date: Mon Nov 7 09:29:10 2011 New Revision: 227298 URL: http://svn.freebsd.org/changeset/base/227298 Log: Remove a note about disabling of GEOM protection mechanism. boot0cfg should work without such hack. MFC after: 3 days Modified: head/usr.sbin/boot0cfg/boot0cfg.8 Modified: head/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.8 Mon Nov 7 09:21:18 2011 (r227297) +++ head/usr.sbin/boot0cfg/boot0cfg.8 Mon Nov 7 09:29:10 2011 (r227298) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd November 7, 2011 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -153,21 +153,6 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El -.Sh NOTE -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. Specifically, do a -.Pp -.Dl sysctl kern.geom.debugflags=0x10 -.Pp -to allow writing to the MBR, and restore it to 0 afterwards. -.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 09:42:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 036A4106566C; Mon, 7 Nov 2011 09:42:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7D2F8FC0C; Mon, 7 Nov 2011 09:42:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA79gMws068039; Mon, 7 Nov 2011 09:42:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA79gMA3068037; Mon, 7 Nov 2011 09:42:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111070942.pA79gMA3068037@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Nov 2011 09:42: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: r227299 - head/usr.bin/dc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 09:42:23 -0000 Author: ed Date: Mon Nov 7 09:42:22 2011 New Revision: 227299 URL: http://svn.freebsd.org/changeset/base/227299 Log: Remove unneeded CFLAGS. Such optimisations should not be performed in this Makefile. Also, uqs@ suggested they have no effect, because the checksum of the resulting binary is unchanged. Discussed with: gabor, uqs Modified: head/usr.bin/dc/Makefile Modified: head/usr.bin/dc/Makefile ============================================================================== --- head/usr.bin/dc/Makefile Mon Nov 7 09:29:10 2011 (r227298) +++ head/usr.bin/dc/Makefile Mon Nov 7 09:42:22 2011 (r227299) @@ -3,7 +3,6 @@ PROG= dc SRCS= dc.c bcode.c inout.c mem.c stack.c -CFLAGS+=--param max-inline-insns-single=64 DPADD= ${LIBCRYPTO} LDADD= -lcrypto From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 14:22:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61D31065687; Mon, 7 Nov 2011 14:22:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2F58FC29; Mon, 7 Nov 2011 14:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7EMIoe082994; Mon, 7 Nov 2011 14:22:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7EMIJR082992; Mon, 7 Nov 2011 14:22:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111071422.pA7EMIJR082992@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 7 Nov 2011 14:22: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: r227308 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 14:22:18 -0000 Author: glebius Date: Mon Nov 7 14:22:18 2011 New Revision: 227308 URL: http://svn.freebsd.org/changeset/base/227308 Log: In icmp6_redirect_input: - Assert that we got a valid mbuf with rcvif pointer. [1] - Use __func__ in logging. Submitted by: prabhakar lakhera [1] Submitted by: Kristof Provost [1] Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Mon Nov 7 13:46:16 2011 (r227307) +++ head/sys/netinet6/icmp6.c Mon Nov 7 14:22:18 2011 (r227308) @@ -2360,14 +2360,11 @@ icmp6_redirect_input(struct mbuf *m, int union nd_opts ndopts; char ip6buf[INET6_ADDRSTRLEN]; - if (!m) - return; + M_ASSERTPKTHDR(m); + KASSERT(m->m_pkthdr.rcvif != NULL, ("%s: no rcvif", __func__)); ifp = m->m_pkthdr.rcvif; - if (!ifp) - return; - /* XXX if we are router, we don't update route by icmp6 redirect */ if (V_ip6_forwarding) goto freeit; @@ -2474,9 +2471,8 @@ icmp6_redirect_input(struct mbuf *m, int icmp6len -= sizeof(*nd_rd); nd6_option_init(nd_rd + 1, icmp6len, &ndopts); if (nd6_options(&ndopts) < 0) { - nd6log((LOG_INFO, "icmp6_redirect_input: " - "invalid ND option, rejected: %s\n", - icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); + nd6log((LOG_INFO, "%s: invalid ND option, rejected: %s\n", + __func__, icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); /* nd6_options have incremented stats */ goto freeit; } @@ -2487,10 +2483,9 @@ icmp6_redirect_input(struct mbuf *m, int } if (lladdr && ((ifp->if_addrlen + 2 + 7) & ~7) != lladdrlen) { - nd6log((LOG_INFO, - "icmp6_redirect_input: lladdrlen mismatch for %s " + nd6log((LOG_INFO, "%s: lladdrlen mismatch for %s " "(if %d, icmp6 packet %d): %s\n", - ip6_sprintf(ip6buf, &redtgt6), + __func__, ip6_sprintf(ip6buf, &redtgt6), ifp->if_addrlen, lladdrlen - 2, icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 15:43:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48967106566B; Mon, 7 Nov 2011 15:43:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340C68FC19; Mon, 7 Nov 2011 15:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7FhDwF085760; Mon, 7 Nov 2011 15:43:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7FhBVa085670; Mon, 7 Nov 2011 15:43:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111071543.pA7FhBVa085670@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Nov 2011 15:43: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: r227309 - in head/sys: amd64/amd64 amd64/linux32 arm/arm arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cam/ata cam/scsi compat/ia32 compat/linux compat/x86bios dev/aac dev/acpic... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 15:43:13 -0000 Author: ed Date: Mon Nov 7 15:43:11 2011 New Revision: 227309 URL: http://svn.freebsd.org/changeset/base/227309 Log: Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/busdma_machdep.c head/sys/arm/xscale/i80321/iq31244_7seg.c head/sys/arm/xscale/i8134x/iq81342_7seg.c head/sys/arm/xscale/ixp425/if_npe.c head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/linux/linux_mib.c head/sys/compat/x86bios/x86bios.c head/sys/dev/aac/aac.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/an/if_an.c head/sys/dev/ata/ata-all.c head/sys/dev/ath/ah_osdep.c head/sys/dev/atkbdc/psm.c head/sys/dev/bce/if_bce.c head/sys/dev/bge/if_bge.c head/sys/dev/bktr/bktr_os.c head/sys/dev/bwn/if_bwn.c head/sys/dev/bxe/if_bxe.c head/sys/dev/cardbus/cardbus.c head/sys/dev/cs/if_cs.c head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/dcons/dcons_os.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/fb/vesa.c head/sys/dev/fdc/fdc.c head/sys/dev/firewire/fwmem.c head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/firewire/sbp.c head/sys/dev/hifn/hifn7751.c head/sys/dev/ipmi/ipmi.c head/sys/dev/kbd/kbd.c head/sys/dev/malo/if_malo_pci.c head/sys/dev/mfi/mfi.c head/sys/dev/mmc/mmc.c head/sys/dev/mwl/mwlhal.c head/sys/dev/pccard/pccard.c head/sys/dev/pccbb/pccbb.c head/sys/dev/pccbb/pccbb_isa.c head/sys/dev/rndtest/rndtest.c head/sys/dev/rt/if_rt.c head/sys/dev/safe/safe.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sound/midi/midi.c head/sys/dev/sound/pci/maestro.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/syscons/syscons.c head/sys/dev/ubsec/ubsec.c head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/input/atp.c head/sys/dev/usb/input/uep.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/wi/if_wi.c head/sys/dev/xe/if_xe.c head/sys/dev/xen/balloon/balloon.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/pseudofs/pseudofs_vncache.c head/sys/geom/cache/g_cache.c head/sys/geom/concat/g_concat.c head/sys/geom/gate/g_gate.c head/sys/geom/geom_disk.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/mountver/g_mountver.c head/sys/geom/multipath/g_multipath.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part.c head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c head/sys/geom/raid3/g_raid3.c head/sys/geom/sched/gs_rr.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c head/sys/geom/vinum/geom_vinum.c head/sys/geom/virstor/g_virstor.c head/sys/geom/zero/g_zero.c head/sys/gnu/fs/xfs/FreeBSD/support/debug.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/busdma_machdep.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mca.c head/sys/ia64/ia64/pmap.c head/sys/kern/kern_clock.c head/sys/kern/kern_cpu.c head/sys/kern/kern_et.c head/sys/kern/kern_jail.c head/sys/kern/kern_ktr.c head/sys/kern/kern_lock.c head/sys/kern/kern_malloc.c head/sys/kern/kern_poll.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/kern_sx.c head/sys/kern/kern_tc.c head/sys/kern/kern_thr.c head/sys/kern/kern_umtx.c head/sys/kern/sched_4bsd.c head/sys/kern/subr_devstat.c head/sys/kern/subr_kdb.c head/sys/kern/subr_lock.c head/sys/kern/subr_prof.c head/sys/kern/subr_rman.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_smp.c head/sys/kern/subr_turnstile.c head/sys/kern/subr_witness.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_cache.c head/sys/mips/cavium/usb/octusb.c head/sys/mips/mips/busdma_machdep.c head/sys/net/bpf.c head/sys/net/flowtable.c head/sys/net/if_bridge.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_lagg.c head/sys/net/if_mib.c head/sys/net/if_stf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/if_vlan.c head/sys/net/netisr.c head/sys/net/raw_cb.c head/sys/net/rtsock.c head/sys/net80211/ieee80211_hwmp.c head/sys/net80211/ieee80211_mesh.c head/sys/netgraph/atm/ng_atm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netgraph/ng_socket.c head/sys/netinet/accf_http.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_mroute.c head/sys/netinet/ipfw/ip_dn_io.c head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netipx/ipx_proto.c head/sys/nlm/nlm_prot_impl.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/powerpc/fpu/fpu_emu.c head/sys/powerpc/ofw/ofw_syscons.c head/sys/powerpc/powerpc/busdma_machdep.c head/sys/powerpc/ps3/ps3disk.c head/sys/security/audit/audit.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_ifoff/mac_ifoff.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_partition/mac_partition.c head/sys/security/mac_portacl/mac_portacl.c head/sys/security/mac_seeotheruids/mac_seeotheruids.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c head/sys/sparc64/sparc64/identcpu.c head/sys/sparc64/sparc64/tick.c head/sys/ufs/ffs/ffs_softdep.c head/sys/vm/memguard.c head/sys/vm/redzone.c head/sys/vm/vm_object.c head/sys/x86/bios/vpd.c head/sys/x86/x86/busdma_machdep.c head/sys/x86/x86/io_apic.c head/sys/x86/x86/mca.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/amd64/amd64/mp_machdep.c Mon Nov 7 15:43:11 2011 (r227309) @@ -1049,7 +1049,7 @@ start_ap(int apic_id) u_int xhits_gbl[MAXCPU]; u_int xhits_pg[MAXCPU]; u_int xhits_rng[MAXCPU]; -SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, global, CTLFLAG_RW, &xhits_gbl, sizeof(xhits_gbl), "IU", ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, page, CTLFLAG_RW, &xhits_pg, Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/amd64/amd64/pmap.c Mon Nov 7 15:43:11 2011 (r227309) @@ -182,7 +182,7 @@ static vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; -SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pat_works = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works, CTLFLAG_RD, &pat_works, 1, @@ -805,7 +805,7 @@ pmap_shpgperproc_proc(SYSCTL_HANDLER_ARG SYSCTL_PROC(_vm_pmap, OID_AUTO, shpgperproc, CTLTYPE_INT|CTLFLAG_RW, &shpgperproc, 0, pmap_shpgperproc_proc, "IU", "Page share factor per proc"); -SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, "2MB page mapping counters"); static u_long pmap_pde_demotions; @@ -824,7 +824,7 @@ static u_long pmap_pde_promotions; SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, promotions, CTLFLAG_RD, &pmap_pde_promotions, 0, "2MB page promotions"); -SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD, 0, "1GB page mapping counters"); static u_long pmap_pdpe_demotions; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Nov 7 15:43:11 2011 (r227309) @@ -977,7 +977,7 @@ linux_copyout_strings(struct image_param return ((register_t *)stack_base); } -SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW, 0, +static SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW, 0, "32-bit Linux emulation"); static u_long linux32_maxdsiz = LINUX32_MAXDSIZ; Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/arm/arm/busdma_machdep.c Mon Nov 7 15:43:11 2011 (r227309) @@ -126,7 +126,7 @@ static int total_bpages; static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); Modified: head/sys/arm/xscale/i80321/iq31244_7seg.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_7seg.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/arm/xscale/i80321/iq31244_7seg.c Mon Nov 7 15:43:11 2011 (r227309) @@ -334,7 +334,7 @@ static const uint8_t snakemap[][2] = { { ~SEG_B, ~SEG_F }, }; -SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); +static SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); static int freq = 20; SYSCTL_INT(_hw_sevenseg, OID_AUTO, freq, CTLFLAG_RW, &freq, 0, "7 Seg update frequency"); Modified: head/sys/arm/xscale/i8134x/iq81342_7seg.c ============================================================================== --- head/sys/arm/xscale/i8134x/iq81342_7seg.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/arm/xscale/i8134x/iq81342_7seg.c Mon Nov 7 15:43:11 2011 (r227309) @@ -335,7 +335,7 @@ static const uint8_t snakemap[][2] = { { SEG_B, SEG_F }, }; -SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); +static SYSCTL_NODE(_hw, OID_AUTO, sevenseg, CTLFLAG_RD, 0, "7 seg"); static int freq = 20; SYSCTL_INT(_hw_sevenseg, OID_AUTO, freq, CTLFLAG_RW, &freq, 0, "7 Seg update frequency"); Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/arm/xscale/ixp425/if_npe.c Mon Nov 7 15:43:11 2011 (r227309) @@ -250,7 +250,8 @@ static int npe_setloopback(struct npe_so /* NB: all tx done processing goes through one queue */ static int tx_doneqid = -1; -SYSCTL_NODE(_hw, OID_AUTO, npe, CTLFLAG_RD, 0, "IXP4XX NPE driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, npe, CTLFLAG_RD, 0, + "IXP4XX NPE driver parameters"); static int npe_debug = 0; SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug, Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/cam/ata/ata_da.c Mon Nov 7 15:43:11 2011 (r227309) @@ -327,7 +327,7 @@ static int ada_spindown_suspend = ADA_DE static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; -SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW, &ada_legacy_aliases, 0, "Create legacy-like device aliases"); Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/cam/ata/ata_pmp.c Mon Nov 7 15:43:11 2011 (r227309) @@ -129,7 +129,7 @@ static void pmpdone(struct cam_periph * static int pmp_retry_count = PMP_DEFAULT_RETRY; static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; -SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW, &pmp_retry_count, 0, "Normal I/O retry count"); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/cam/scsi/scsi_cd.c Mon Nov 7 15:43:11 2011 (r227309) @@ -306,8 +306,9 @@ static int cd_retry_count = CD_DEFAULT_R static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; -SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); -SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, "CD Changer"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); +static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, + "CD Changer"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, &cd_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/cam/scsi/scsi_da.c Mon Nov 7 15:43:11 2011 (r227309) @@ -606,7 +606,7 @@ static int da_retry_count = DA_DEFAULT_R static int da_default_timeout = DA_DEFAULT_TIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; -SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, &da_retry_count, 0, "Normal I/O retry count"); Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/compat/ia32/ia32_sysvec.c Mon Nov 7 15:43:11 2011 (r227309) @@ -95,7 +95,7 @@ CTASSERT(sizeof(struct ia32_sigframe4) = extern const char *freebsd32_syscallnames[]; -SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); +static SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); static u_long ia32_maxdsiz = IA32_MAXDSIZ; SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RW, &ia32_maxdsiz, 0, ""); Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/compat/linux/linux_mib.c Mon Nov 7 15:43:11 2011 (r227309) @@ -66,7 +66,7 @@ static struct linux_prison lprison0 = { static unsigned linux_osd_jail_slot; -SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, +static SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); static int linux_set_osname(struct thread *td, char *osname); Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/compat/x86bios/x86bios.c Mon Nov 7 15:43:11 2011 (r227309) @@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$"); static struct mtx x86bios_lock; -SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, + "x86bios debugging"); static int x86bios_trace_call; TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call); SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0, Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/aac/aac.c Mon Nov 7 15:43:11 2011 (r227309) @@ -222,7 +222,7 @@ static struct cdevsw aac_cdevsw = { static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ -SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); /* * Device Interface Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/acpica/acpi_ec.c Mon Nov 7 15:43:11 2011 (r227309) @@ -179,7 +179,7 @@ struct acpi_ec_softc { ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); SYSCTL_DECL(_debug_acpi); -SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); +static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; TUNABLE_INT("debug.acpi.ec.burst", &ec_burst_mode); Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/acpica/acpi_smbat.c Mon Nov 7 15:43:11 2011 (r227309) @@ -63,7 +63,8 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); SYSCTL_DECL(_debug_acpi); -SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); +static SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, + "Battery debugging"); /* On some laptops with smart batteries, enabling battery monitoring * software causes keystrokes from atkbd to be lost. This has also been Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/an/if_an.c Mon Nov 7 15:43:11 2011 (r227309) @@ -203,7 +203,8 @@ static char an_conf_cache[256]; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD, 0, "Wireless driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD, 0, + "Wireless driver parameters"); /* XXX violate ethernet/netgraph callback hooks */ extern void (*ng_ether_attach_p)(struct ifnet *ifp); Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/ata/ata-all.c Mon Nov 7 15:43:11 2011 (r227309) @@ -103,7 +103,7 @@ static int ata_dma = 1; static int atapi_dma = 1; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); TUNABLE_INT("hw.ata.ata_dma", &ata_dma); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0, "ATA disk DMA mode control"); Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/ath/ah_osdep.c Mon Nov 7 15:43:11 2011 (r227309) @@ -76,7 +76,8 @@ extern void DO_HALDEBUG(struct ath_hal * /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); +static SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, + "Atheros HAL parameters"); #ifdef AH_DEBUG int ath_hal_debug = 0; Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/atkbdc/psm.c Mon Nov 7 15:43:11 2011 (r227309) @@ -2262,8 +2262,8 @@ psmtimeout(void *arg) } /* Add all sysctls under the debug.psm and hw.psm nodes */ -SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); -SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); +static SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); +static SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RW, &verbose, 0, "Verbosity level"); Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/bce/if_bce.c Mon Nov 7 15:43:11 2011 (r227309) @@ -489,7 +489,7 @@ DRIVER_MODULE(miibus, bce, miibus_driver /****************************************************************************/ /* Tunable device values */ /****************************************************************************/ -SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); /* Allowable values are TRUE or FALSE */ static int bce_verbose = TRUE; Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/bge/if_bge.c Mon Nov 7 15:43:11 2011 (r227309) @@ -520,7 +520,7 @@ static int bge_allow_asf = 1; TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); -SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0, "Allow ASF mode if available"); Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/bktr/bktr_os.c Mon Nov 7 15:43:11 2011 (r227309) @@ -108,7 +108,7 @@ int bt848_amsound = 0; /* hard-wire AM int bt848_dolby = 0; #endif -SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt"); +static SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt"); SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, ""); Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/bwn/if_bwn.c Mon Nov 7 15:43:11 2011 (r227309) @@ -73,7 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, + "Broadcom driver parameters"); /* * Tunable & sysctl variables. Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/bxe/if_bxe.c Mon Nov 7 15:43:11 2011 (r227309) @@ -423,7 +423,7 @@ DRIVER_MODULE(bxe, pci, bxe_driver, bxe_ /* * Tunable device values */ -SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); /* Allowable values are TRUE (1) or FALSE (0). */ static int bxe_dcc_enable = FALSE; Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/cardbus/cardbus.c Mon Nov 7 15:43:11 2011 (r227309) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); int cardbus_debug = 0; TUNABLE_INT("hw.cardbus.debug", &cardbus_debug); Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/cs/if_cs.c Mon Nov 7 15:43:11 2011 (r227309) @@ -103,7 +103,7 @@ devclass_t cs_devclass; driver_intr_t csintr; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cs, CTLFLAG_RD, 0, "cs device parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cs, CTLFLAG_RD, 0, "cs device parameters"); int cs_ignore_cksum_failure = 0; TUNABLE_INT("hw.cs.ignore_checksum_failure", &cs_ignore_cksum_failure); Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Mon Nov 7 15:43:11 2011 (r227309) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); /* Avoid clutter in the hw.* space, keep all toe tunables within hw.cxgb */ SYSCTL_DECL(_hw_cxgb); -SYSCTL_NODE(_hw_cxgb, OID_AUTO, toe, CTLFLAG_RD, 0, "TOE parameters"); +static SYSCTL_NODE(_hw_cxgb, OID_AUTO, toe, CTLFLAG_RD, 0, "TOE parameters"); static struct tom_tunables default_tunable_vals = { .max_host_sndbuf = 32 * 1024, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/cxgbe/t4_main.c Mon Nov 7 15:43:11 2011 (r227309) @@ -129,7 +129,8 @@ MALLOC_DEFINE(M_CXGBE, "cxgbe", "Chelsio /* * Tunables. */ -SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, + "cxgbe driver parameters"); static int force_firmware_install = 0; TUNABLE_INT("hw.cxgbe.force_firmware_install", &force_firmware_install); Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/dcons/dcons_os.c Mon Nov 7 15:43:11 2011 (r227309) @@ -93,7 +93,7 @@ static int poll_hz = DCONS_POLL_HZ; static struct dcons_softc sc[DCONS_NPORT]; -SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD, 0, "Dumb Console"); +static SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD, 0, "Dumb Console"); SYSCTL_INT(_kern_dcons, OID_AUTO, poll_hz, CTLFLAG_RW, &poll_hz, 0, "dcons polling rate"); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/e1000/if_em.c Mon Nov 7 15:43:11 2011 (r227309) @@ -330,7 +330,7 @@ MODULE_DEPEND(em, ether, 1, 1, 1); #define CSUM_TSO 0 #endif -SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, em, CTLFLAG_RD, 0, "EM driver parameters"); static int em_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int em_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/e1000/if_igb.c Mon Nov 7 15:43:11 2011 (r227309) @@ -300,7 +300,7 @@ MODULE_DEPEND(igb, ether, 1, 1, 1); * Tunable default values. *********************************************************************/ -SYSCTL_NODE(_hw, OID_AUTO, igb, CTLFLAG_RD, 0, "IGB driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, igb, CTLFLAG_RD, 0, "IGB driver parameters"); /* Descriptor defaults */ static int igb_rxd = IGB_DEFAULT_RXD; Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/fb/vesa.c Mon Nov 7 15:43:11 2011 (r227309) @@ -95,7 +95,7 @@ static size_t vesa_bios_size = 0; /* VESA video adapter */ static video_adapter_t *vesa_adp = NULL; -SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); static int vesa_shadow_rom = 0; TUNABLE_INT("debug.vesa.shadow_rom", &vesa_shadow_rom); SYSCTL_INT(_debug_vesa, OID_AUTO, shadow_rom, CTLFLAG_RDTUN, &vesa_shadow_rom, Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/fdc/fdc.c Mon Nov 7 15:43:11 2011 (r227309) @@ -267,7 +267,7 @@ static driver_filter_t fdc_intr_fast; static void fdc_reset(struct fdc_data *); static int fd_probe_disk(struct fd_data *, int *); -SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); +static SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); static int fifo_threshold = 8; SYSCTL_INT(_debug_fdc, OID_AUTO, fifo, CTLFLAG_RW, &fifo_threshold, 0, Modified: head/sys/dev/firewire/fwmem.c ============================================================================== --- head/sys/dev/firewire/fwmem.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/firewire/fwmem.c Mon Nov 7 15:43:11 2011 (r227309) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); static int fwmem_speed=2, fwmem_debug=0; static struct fw_eui64 fwmem_eui64; SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0, "FireWire Memory Access"); SYSCTL_UINT(_hw_firewire_fwmem, OID_AUTO, eui64_hi, CTLFLAG_RW, &fwmem_eui64.hi, 0, "Fwmem target EUI64 high"); Modified: head/sys/dev/firewire/if_fwe.c ============================================================================== --- head/sys/dev/firewire/if_fwe.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/firewire/if_fwe.c Mon Nov 7 15:43:11 2011 (r227309) @@ -89,7 +89,7 @@ static int rx_queue_len = FWMAXQUEUE; static MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, "Ethernet emulation subsystem"); SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RW, &stream_ch, 0, "Stream channel to use"); Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/firewire/if_fwip.c Mon Nov 7 15:43:11 2011 (r227309) @@ -102,7 +102,7 @@ static int rx_queue_len = FWMAXQUEUE; static MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, "Firewire ip subsystem"); SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len, 0, "Length of the receive queue"); Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/firewire/sbp.c Mon Nov 7 15:43:11 2011 (r227309) @@ -132,7 +132,8 @@ static int use_doorbell = 0; static int sbp_tags = 0; SYSCTL_DECL(_hw_firewire); -SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, "SBP-II Subsystem"); +static SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, + "SBP-II Subsystem"); SYSCTL_INT(_debug, OID_AUTO, sbp_debug, CTLFLAG_RW, &debug, 0, "SBP debug flag"); SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, auto_login, CTLFLAG_RW, &auto_login, 0, Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/hifn/hifn7751.c Mon Nov 7 15:43:11 2011 (r227309) @@ -184,7 +184,8 @@ READ_REG_1(struct hifn_softc *sc, bus_si } #define WRITE_REG_1(sc, reg, val) hifn_write_reg_1(sc, reg, val) -SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD, 0, "Hifn driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD, 0, + "Hifn driver parameters"); #ifdef HIFN_DEBUG static int hifn_debug = 0; Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/ipmi/ipmi.c Mon Nov 7 15:43:11 2011 (r227309) @@ -63,7 +63,8 @@ static void ipmi_dtor(void *arg); int ipmi_attached = 0; static int on = 1; -SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, "IPMI driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, + "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RW, &on, 0, ""); Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/kbd/kbd.c Mon Nov 7 15:43:11 2011 (r227309) @@ -81,7 +81,7 @@ static keyboard_switch_t *kbdsw_ini; keyboard_switch_t **kbdsw = &kbdsw_ini; static int keymap_restrict_change; -SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); +static SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); SYSCTL_INT(_hw_kbd, OID_AUTO, keymap_restrict_change, CTLFLAG_RW, &keymap_restrict_change, 0, "restrict ability to change keymap"); Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/malo/if_malo_pci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -79,7 +79,7 @@ struct malo_pci_softc { * Tunable variables. */ SYSCTL_DECL(_hw_malo); -SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, "Marvell 88W8335 driver PCI parameters"); static int msi_disable = 0; /* MSI disabled */ Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/mfi/mfi.c Mon Nov 7 15:43:11 2011 (r227309) @@ -117,7 +117,7 @@ static int mfi_check_clear_intr_ppc(str static void mfi_issue_cmd_xscale(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); static void mfi_issue_cmd_ppc(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); -SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; TUNABLE_INT("hw.mfi.event_locale", &mfi_event_locale); SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RW, &mfi_event_locale, Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/mmc/mmc.c Mon Nov 7 15:43:11 2011 (r227309) @@ -105,7 +105,7 @@ struct mmc_ivars { #define CMD_RETRIES 3 -SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); +static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); static int mmc_debug; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RW, &mmc_debug, 0, "Debug level"); Modified: head/sys/dev/mwl/mwlhal.c ============================================================================== --- head/sys/dev/mwl/mwlhal.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/mwl/mwlhal.c Mon Nov 7 15:43:11 2011 (r227309) @@ -190,7 +190,8 @@ static void dumpresult(struct mwl_hal_pr #endif /* MWLHAL_DEBUG */ SYSCTL_DECL(_hw_mwl); -SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD, 0, "Marvell HAL parameters"); +static SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD, 0, + "Marvell HAL parameters"); static __inline void MWL_HAL_LOCK(struct mwl_hal_priv *mh) Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/pccard/pccard.c Mon Nov 7 15:43:11 2011 (r227309) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCCARDDEBUG /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); int pccard_debug = 0; TUNABLE_INT("hw.pccard.debug", &pccard_debug); Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/pccbb/pccbb.c Mon Nov 7 15:43:11 2011 (r227309) @@ -129,7 +129,7 @@ __FBSDID("$FreeBSD$"); devclass_t cbb_devclass; /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); /* There's no way to say TUNEABLE_LONG to get the right types */ u_long cbb_start_mem = CBB_START_MEM; Modified: head/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- head/sys/dev/pccbb/pccbb_isa.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/pccbb/pccbb_isa.c Mon Nov 7 15:43:11 2011 (r227309) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); *****************************************************************************/ /* sysctl vars */ -SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; TUNABLE_INT("hw.cbb.intr_mask", &isa_intr_mask); Modified: head/sys/dev/rndtest/rndtest.c ============================================================================== --- head/sys/dev/rndtest/rndtest.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/rndtest/rndtest.c Mon Nov 7 15:43:11 2011 (r227309) @@ -70,8 +70,8 @@ static const struct rndtest_testfunc { #define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0])) -SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, "RNG test parameters"); - +static SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, + "RNG test parameters"); static int rndtest_retest = 120; /* interval in seconds */ SYSCTL_INT(_kern_rndtest, OID_AUTO, retest, CTLFLAG_RW, &rndtest_retest, 0, "retest interval (seconds)"); Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/rt/if_rt.c Mon Nov 7 15:43:11 2011 (r227309) @@ -136,7 +136,7 @@ static int rt_miibus_writereg(device_t, static int rt_ifmedia_upd(struct ifnet *); static void rt_ifmedia_sts(struct ifnet *, struct ifmediareq *); -SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); #ifdef IF_RT_DEBUG static int rt_debug = 0; SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLFLAG_RW, &rt_debug, 0, Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/safe/safe.c Mon Nov 7 15:43:11 2011 (r227309) @@ -147,7 +147,8 @@ static void safe_totalreset(struct safe_ static int safe_free_entry(struct safe_softc *, struct safe_ringentry *); -SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD, 0, "SafeNet driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD, 0, + "SafeNet driver parameters"); #ifdef SAFE_DEBUG static void safe_dump_dmastatus(struct safe_softc *, const char *); Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/sdhci/sdhci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -154,7 +154,7 @@ struct sdhci_softc { struct sdhci_slot slots[6]; }; -SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); +static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); int sdhci_debug; TUNABLE_INT("hw.sdhci.debug", &sdhci_debug); Modified: head/sys/dev/sound/midi/midi.c ============================================================================== --- head/sys/dev/sound/midi/midi.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/sound/midi/midi.c Mon Nov 7 15:43:11 2011 (r227309) @@ -239,7 +239,7 @@ static int midi_unload(void); * Misc declr. */ SYSCTL_NODE(_hw, OID_AUTO, midi, CTLFLAG_RD, 0, "Midi driver"); -SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD, 0, "Status device"); +static SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD, 0, "Status device"); int midi_debug; /* XXX: should this be moved into debug.midi? */ Modified: head/sys/dev/sound/pci/maestro.c ============================================================================== --- head/sys/dev/sound/pci/maestro.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/sound/pci/maestro.c Mon Nov 7 15:43:11 2011 (r227309) @@ -191,7 +191,7 @@ static unsigned int powerstate_init = /* XXX: this should move to a device specific sysctl dev.pcm.X.debug.Y via device_get_sysctl_*() as discussed on multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ -SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD, 0, ""); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_active, CTLFLAG_RW, &powerstate_active, 0, "The Dx power state when active (0-1)"); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_idle, CTLFLAG_RW, Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/sound/usb/uaudio.c Mon Nov 7 15:43:11 2011 (r227309) @@ -93,7 +93,7 @@ static int uaudio_default_channels = 0; #ifdef USB_DEBUG static int uaudio_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW, &uaudio_debug, 0, "uaudio debug level"); Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/syscons/syscons.c Mon Nov 7 15:43:11 2011 (r227309) @@ -136,8 +136,8 @@ static int sc_no_suspend_vtswitch = 0; #endif static int sc_susp_scr; -SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); -SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); +static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); +static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, &sc_saver_keyb_only, 0, "screen saver interrupted by input only"); SYSCTL_INT(_hw_syscons, OID_AUTO, bell, CTLFLAG_RW, &enable_bell, Modified: head/sys/dev/ubsec/ubsec.c ============================================================================== --- head/sys/dev/ubsec/ubsec.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/ubsec/ubsec.c Mon Nov 7 15:43:11 2011 (r227309) @@ -177,7 +177,8 @@ static int ubsec_ksigbits(struct crparam static void ubsec_kshift_r(u_int, u_int8_t *, u_int, u_int8_t *, u_int); static void ubsec_kshift_l(u_int, u_int8_t *, u_int, u_int8_t *, u_int); -SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD, 0, "Broadcom driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD, 0, + "Broadcom driver parameters"); #ifdef UBSEC_DEBUG static void ubsec_dump_pb(volatile struct ubsec_pktbuf *); Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/at91dci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -91,7 +91,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int at91dcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, at91dci, CTLFLAG_RW, 0, "USB at91dci"); SYSCTL_INT(_hw_usb_at91dci, OID_AUTO, debug, CTLFLAG_RW, &at91dcidebug, 0, "at91dci debug level"); #endif Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/atmegadci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -83,7 +83,8 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int atmegadci_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, "USB ATMEGA DCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0, + "USB ATMEGA DCI"); SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, debug, CTLFLAG_RW, &atmegadci_debug, 0, "ATMEGA DCI debug level"); #endif Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/avr32dci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int avr32dci_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI"); SYSCTL_INT(_hw_usb_avr32dci, OID_AUTO, debug, CTLFLAG_RW, &avr32dci_debug, 0, "AVR32 DCI debug level"); #endif Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/ehci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -94,7 +94,7 @@ static int ehcinohighspeed = 0; static int ehciiaadbug = 0; static int ehcilostintrbug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, &ehcidebug, 0, "Debug level"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/musb_otg.c Mon Nov 7 15:43:11 2011 (r227309) @@ -85,7 +85,7 @@ #ifdef USB_DEBUG static int musbotgdebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg"); SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, debug, CTLFLAG_RW, &musbotgdebug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/ohci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ohcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, &ohcidebug, 0, "ohci debug level"); Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/uhci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -85,7 +85,7 @@ __FBSDID("$FreeBSD$"); static int uhcidebug = 0; static int uhcinoloop = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW, &uhcidebug, 0, "uhci debug level"); SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/usb_controller.c Mon Nov 7 15:43:11 2011 (r227309) @@ -75,7 +75,7 @@ static void usb_attach_sub(device_t, str #ifdef USB_DEBUG static int usb_ctrl_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller"); SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RW, &usb_ctrl_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/uss820dci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -79,7 +79,8 @@ #ifdef USB_DEBUG static int uss820dcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, + "USB uss820dci"); SYSCTL_INT(_hw_usb_uss820dci, OID_AUTO, debug, CTLFLAG_RW, &uss820dcidebug, 0, "uss820dci debug level"); #endif Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/controller/xhci.c Mon Nov 7 15:43:11 2011 (r227309) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int xhcidebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/input/atp.c Mon Nov 7 15:43:11 2011 (r227309) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); /* Tunables */ -SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); #ifdef USB_DEBUG enum atp_log_level { Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/input/uep.c Mon Nov 7 15:43:11 2011 (r227309) @@ -57,7 +57,7 @@ #ifdef USB_DEBUG static int uep_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep"); SYSCTL_INT(_hw_usb_uep, OID_AUTO, debug, CTLFLAG_RW, &uep_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/input/uhid.c Mon Nov 7 15:43:11 2011 (r227309) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int uhid_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug, CTLFLAG_RW, &uhid_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/input/ukbd.c Mon Nov 7 15:43:11 2011 (r227309) @@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$"); static int ukbd_debug = 0; static int ukbd_no_leds = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW, &ukbd_debug, 0, "Debug level"); SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/input/ums.c Mon Nov 7 15:43:11 2011 (r227309) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ums_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); SYSCTL_INT(_hw_usb_ums, OID_AUTO, debug, CTLFLAG_RW, &ums_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/misc/udbp.c Mon Nov 7 15:43:11 2011 (r227309) @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int udbp_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); SYSCTL_INT(_hw_usb_udbp, OID_AUTO, debug, CTLFLAG_RW, &udbp_debug, 0, "udbp debug level"); #endif Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_aue.c Mon Nov 7 15:43:11 2011 (r227309) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int aue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, CTLFLAG_RW, &aue_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_axe.c Mon Nov 7 15:43:11 2011 (r227309) @@ -133,7 +133,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int axe_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, CTLFLAG_RW, &axe_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_cdce.c Mon Nov 7 15:43:11 2011 (r227309) @@ -111,7 +111,7 @@ static uint32_t cdce_m_crc32(struct mbuf static int cdce_debug = 0; static int cdce_tx_interval = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RW, &cdce_debug, 0, "Debug level"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, interval, CTLFLAG_RW, &cdce_tx_interval, 0, Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_cue.c Mon Nov 7 15:43:11 2011 (r227309) @@ -124,7 +124,7 @@ static void cue_reset(struct cue_softc * #ifdef USB_DEBUG static int cue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); SYSCTL_INT(_hw_usb_cue, OID_AUTO, debug, CTLFLAG_RW, &cue_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_ipheth.c Mon Nov 7 15:43:11 2011 (r227309) @@ -81,7 +81,7 @@ static uether_fn_t ipheth_setpromisc; #ifdef USB_DEBUG static int ipheth_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet"); SYSCTL_INT(_hw_usb_ipheth, OID_AUTO, debug, CTLFLAG_RW, &ipheth_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_kue.c Mon Nov 7 15:43:11 2011 (r227309) @@ -165,7 +165,7 @@ static void kue_reset(struct kue_softc * #ifdef USB_DEBUG static int kue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); SYSCTL_INT(_hw_usb_kue, OID_AUTO, debug, CTLFLAG_RW, &kue_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_mos.c Mon Nov 7 15:43:11 2011 (r227309) @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int mos_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos"); SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, CTLFLAG_RW, &mos_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_rue.c Mon Nov 7 15:43:11 2011 (r227309) @@ -99,7 +99,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int rue_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, CTLFLAG_RW, &rue_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_udav.c Mon Nov 7 15:43:11 2011 (r227309) @@ -187,7 +187,7 @@ static const struct usb_ether_methods ud #ifdef USB_DEBUG static int udav_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug, CTLFLAG_RW, &udav_debug, 0, "Debug level"); #endif Modified: head/sys/dev/usb/net/if_usie.c ============================================================================== --- head/sys/dev/usb/net/if_usie.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/if_usie.c Mon Nov 7 15:43:11 2011 (r227309) @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int usie_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW, 0, "sierra USB modem"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW, 0, "sierra USB modem"); SYSCTL_INT(_hw_usb_usie, OID_AUTO, debug, CTLFLAG_RW, &usie_debug, 0, "usie debug level"); #endif Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/uhso.c Mon Nov 7 15:43:11 2011 (r227309) @@ -283,7 +283,7 @@ static const STRUCT_USB_HOST_ID uhso_dev #undef UHSO_DEV }; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); static int uhso_autoswitch = 1; SYSCTL_INT(_hw_usb_uhso, OID_AUTO, auto_switch, CTLFLAG_RW, &uhso_autoswitch, 0, "Automatically switch to modem mode"); Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/net/usb_ethernet.c Mon Nov 7 15:43:11 2011 (r227309) @@ -57,7 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD, 0, "USB Ethernet parameters"); +static SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD, 0, + "USB Ethernet parameters"); #define UE_LOCK(_ue) mtx_lock((_ue)->ue_mtx) #define UE_UNLOCK(_ue) mtx_unlock((_ue)->ue_mtx) Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Nov 7 14:22:18 2011 (r227308) +++ head/sys/dev/usb/serial/u3g.c Mon Nov 7 15:43:11 2011 (r227309) @@ -66,7 +66,7 @@ #ifdef USB_DEBUG static int u3g_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, CTLFLAG_RW, &u3g_debug, 0, "Debug level"); #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 16:21:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F22A106566C; Mon, 7 Nov 2011 16:21:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4F28FC0A; Mon, 7 Nov 2011 16:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7GLoKC087042; Mon, 7 Nov 2011 16:21:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7GLob4087040; Mon, 7 Nov 2011 16:21:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111071621.pA7GLob4087040@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Nov 2011 16:21: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: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 16:21:50 -0000 Author: marcel Date: Mon Nov 7 16:21:50 2011 New Revision: 227310 URL: http://svn.freebsd.org/changeset/base/227310 Log: Don astbestos garment and remove the warning about TMPFS being experimental -- highly experimental even. So far the closest to a bug in TMPFS that people have gotten to relates to how ZFS can take away from the memory that TMPFS needs. One can argue that such is not a bug in TMPFS. Irrespective, even if there is a bug here and there in TMPFS, it's not in our own advantage to scare people away from using TMPFS. I for one have been using it, even with ZFS, very successfully. Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 7 15:43:11 2011 (r227309) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 7 16:21:50 2011 (r227310) @@ -156,9 +156,6 @@ tmpfs_mount(struct mount *mp) return EOPNOTSUPP; } - printf("WARNING: TMPFS is considered to be a highly experimental " - "feature in FreeBSD.\n"); - vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); VOP_UNLOCK(mp->mnt_vnodecovered, 0); From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 18:19:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 281B2106566B; Mon, 7 Nov 2011 18:19:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F327C8FC16; Mon, 7 Nov 2011 18:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7IJKoR090923; Mon, 7 Nov 2011 18:19:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7IJKF5090920; Mon, 7 Nov 2011 18:19:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111071819.pA7IJKF5090920@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 18:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227311 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 18:19:21 -0000 Author: yongari Date: Mon Nov 7 18:19:20 2011 New Revision: 227311 URL: http://svn.freebsd.org/changeset/base/227311 Log: Remove ti_unit member variable in softc. While I'm here use PCIR_BAR macro. Modified: head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 16:21:50 2011 (r227310) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 18:19:20 2011 (r227311) @@ -2222,7 +2222,6 @@ ti_attach(device_t dev) u_char eaddr[6]; sc = device_get_softc(dev); - sc->ti_unit = device_get_unit(dev); sc->ti_dev = dev; mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -2244,7 +2243,7 @@ ti_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = TI_PCI_LOMEM; + rid = PCIR_BAR(0); sc->ti_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -2471,8 +2470,8 @@ ti_attach(device_t dev) */ /* Register the device */ - sc->dev = make_dev(&ti_cdevsw, sc->ti_unit, UID_ROOT, GID_OPERATOR, - 0600, "ti%d", sc->ti_unit); + sc->dev = make_dev(&ti_cdevsw, device_get_unit(dev), UID_ROOT, + GID_OPERATOR, 0600, "ti%d", device_get_unit(dev)); sc->dev->si_drv1 = sc; /* @@ -2563,7 +2562,7 @@ ti_detach(device_t dev) if (sc->ti_irq) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq); if (sc->ti_res) { - bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->ti_res); } if (ifp) @@ -3115,7 +3114,7 @@ static void ti_init2(struct ti_softc *sc ifp = sc->ti_ifp; /* Specify MTU and interface index. */ - CSR_WRITE_4(sc, TI_GCR_IFINDEX, sc->ti_unit); + CSR_WRITE_4(sc, TI_GCR_IFINDEX, device_get_unit(sc->ti_dev)); CSR_WRITE_4(sc, TI_GCR_IFMTU, ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN); TI_DO_CMD(TI_CMD_UPDATE_GENCOM, 0, 0); Modified: head/sys/dev/ti/if_tireg.h ============================================================================== --- head/sys/dev/ti/if_tireg.h Mon Nov 7 16:21:50 2011 (r227310) +++ head/sys/dev/ti/if_tireg.h Mon Nov 7 18:19:20 2011 (r227311) @@ -1000,7 +1000,6 @@ struct ti_softc { struct resource *ti_irq; struct resource *ti_res; struct ifmedia ifmedia; /* media info */ - uint8_t ti_unit; /* interface number */ uint8_t ti_hwrev; /* Tigon rev (1 or 2) */ uint8_t ti_copper; /* 1000baseTX card */ uint8_t ti_linkstat; /* Link state */ From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 18:26:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 612AC1065674; Mon, 7 Nov 2011 18:26:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51A0E8FC16; Mon, 7 Nov 2011 18:26:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7IQcrO091197; Mon, 7 Nov 2011 18:26:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7IQc1j091195; Mon, 7 Nov 2011 18:26:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111071826.pA7IQc1j091195@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 18:26: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: r227312 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 18:26:38 -0000 Author: yongari Date: Mon Nov 7 18:26:38 2011 New Revision: 227312 URL: http://svn.freebsd.org/changeset/base/227312 Log: o Remove unnecessary controller reinitialization. o Do not blindly UP controller when MTU is changed. Reinitialize controller only if driver is running. o Remove useless ti_stop() in ti_watchdog() since ti_init_locked() always invokes ti_stop(). Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 18:19:20 2011 (r227311) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 18:26:38 2011 (r227312) @@ -3091,6 +3091,9 @@ ti_init_locked(void *xsc) { struct ti_softc *sc = xsc; + if (sc->ti_ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + /* Cancel pending I/O and flush buffers. */ ti_stop(sc); @@ -3369,7 +3372,10 @@ ti_ioctl(struct ifnet *ifp, u_long comma error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; - ti_init_locked(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + ti_init_locked(sc); + } } TI_UNLOCK(sc); break; @@ -3783,7 +3789,7 @@ ti_watchdog(void *arg) ifp = sc->ti_ifp; if_printf(ifp, "watchdog timeout -- resetting\n"); - ti_stop(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ti_init_locked(sc); ifp->if_oerrors++; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 19:54:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6917C1065676; Mon, 7 Nov 2011 19:54:16 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D4BC78FC0C; Mon, 7 Nov 2011 19:54:15 +0000 (UTC) Received: by ywt32 with SMTP id 32so7476448ywt.13 for ; Mon, 07 Nov 2011 11:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+XqW3t4trOX7WZAdG1eB7DK6IAn/xknr63fX19kkboU=; b=NhCD9f7EcKJylbwYnmc9ilHl7JHII3B/0bW7EM5W8MSoITglKU5AG5JmySzGz4frTl b/9a1mdqELuHwxq0SRKKxocHgBgMinEs8CuKfwRDiVpj7+s7Libs99PwFaz6U307i0o1 jHpMVfnr2t3R1syOd8dCAdqVMRUGeOPAPUdYg= Received: by 10.101.194.15 with SMTP id w15mr1905225anp.62.1320694117308; Mon, 07 Nov 2011 11:28:37 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.58.9 with HTTP; Mon, 7 Nov 2011 11:27:56 -0800 (PST) In-Reply-To: <201111071621.pA7GLob4087040@svn.freebsd.org> References: <201111071621.pA7GLob4087040@svn.freebsd.org> From: Ivan Voras Date: Mon, 7 Nov 2011 20:27:56 +0100 X-Google-Sender-Auth: Bt71rjWldZKuBV8jtElLh4mW4zs Message-ID: To: Marcel Moolenaar 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: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 19:54:16 -0000 On 7 November 2011 17:21, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Nov =C2=A07 16:21:50 2011 > New Revision: 227310 > URL: http://svn.freebsd.org/changeset/base/227310 > > Log: > =C2=A0Don astbestos garment and remove the warning about TMPFS being expe= rimental > =C2=A0-- highly experimental even. So far the closest to a bug in TMPFS t= hat people > =C2=A0have gotten to relates to how ZFS can take away from the memory tha= t TMPFS > =C2=A0needs. One can argue that such is not a bug in TMPFS. Irrespective,= even if > =C2=A0there is a bug here and there in TMPFS, it's not in our own advanta= ge to > =C2=A0scare people away from using TMPFS. I for one have been using it, e= ven with > =C2=A0ZFS, very successfully. Thanks! It should be ok by now. From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 19:57:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C6D2106568A; Mon, 7 Nov 2011 19:57:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE8D8FC0A; Mon, 7 Nov 2011 19:57:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7Jvgah094136; Mon, 7 Nov 2011 19:57:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7Jvg55094134; Mon, 7 Nov 2011 19:57:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111071957.pA7Jvg55094134@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Nov 2011 19:57: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: r227314 - head/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 19:57:42 -0000 Author: ed Date: Mon Nov 7 19:57:42 2011 New Revision: 227314 URL: http://svn.freebsd.org/changeset/base/227314 Log: Ensure pam_lastlog removes the /dev/ component of the TTY name. Some consumers of PAM remove the /dev/ component (i.e. login), while others don't (i.e. su). We must ensure that the /dev/ component is removed to ensure that the utmpx entries properly work with tools such as w(1). Discussed with: des MFC after: 1 week Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Mon Nov 7 19:53:20 2011 (r227313) +++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Mon Nov 7 19:57:42 2011 (r227314) @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #define _BSD_SOURCE #include + +#include #include #include #include @@ -96,6 +98,9 @@ pam_sm_open_session(pam_handle_t *pamh, pam_err = PAM_SERVICE_ERR; goto err; } + /* Strip /dev/ component. */ + if (strncmp(tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) + tty = (const char *)tty + sizeof(_PATH_DEV) - 1; if ((flags & PAM_SILENT) == 0) { if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) { From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 20:01:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D7BE106567C; Mon, 7 Nov 2011 20:01:34 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0C1858FC27; Mon, 7 Nov 2011 20:01:33 +0000 (UTC) Received: by qadb12 with SMTP id b12so3165640qad.13 for ; Mon, 07 Nov 2011 12:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=5wm5or3ZaGgb6x1i1CiOvXzLHLvq6P9JtaX16F34tJg=; b=EGAaxDktTb92BbvoP1jd4LIiztgJD91K4nolAhsn9c4QyuM2gUGeF6ltXFkeLQpN6H Ssa20Wnsy901GlYfUjzL19UR9orfYpdsUhFir53wfadFuYikW3oH2fKzwpLXofwNEWbw /aXSzf+zCcEMu7ouu03weLrPeZdcvc9I1ns20= MIME-Version: 1.0 Received: by 10.229.227.18 with SMTP id iy18mr3282242qcb.47.1320696093201; Mon, 07 Nov 2011 12:01:33 -0800 (PST) Received: by 10.229.212.4 with HTTP; Mon, 7 Nov 2011 12:01:33 -0800 (PST) In-Reply-To: <201111071621.pA7GLob4087040@svn.freebsd.org> References: <201111071621.pA7GLob4087040@svn.freebsd.org> Date: Mon, 7 Nov 2011 12:01:33 -0800 Message-ID: From: Xin LI To: Marcel Moolenaar 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: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 20:01:34 -0000 On Mon, Nov 7, 2011 at 8:21 AM, Marcel Moolenaar wrote= : > Author: marcel > Date: Mon Nov =C2=A07 16:21:50 2011 > New Revision: 227310 > URL: http://svn.freebsd.org/changeset/base/227310 > > Log: > =C2=A0Don astbestos garment and remove the warning about TMPFS being expe= rimental > =C2=A0-- highly experimental even. So far the closest to a bug in TMPFS t= hat people > =C2=A0have gotten to relates to how ZFS can take away from the memory tha= t TMPFS > =C2=A0needs. One can argue that such is not a bug in TMPFS. Irrespective,= even if > =C2=A0there is a bug here and there in TMPFS, it's not in our own advanta= ge to > =C2=A0scare people away from using TMPFS. I for one have been using it, e= ven with > =C2=A0ZFS, very successfully. Was the data corruption issue when mixing mmap/sendfile/read/writes fixed already? I haven't used tmpfs in such complicated environment in my use (which works well) but I remember some complains about it... Cheers, --=20 Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 21:09:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 023CF1065674; Mon, 7 Nov 2011 21:09:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6C658FC13; Mon, 7 Nov 2011 21:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7L94Nw096476; Mon, 7 Nov 2011 21:09:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7L94JR096474; Mon, 7 Nov 2011 21:09:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111072109.pA7L94JR096474@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 7 Nov 2011 21:09: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: r227315 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 21:09:05 -0000 Author: trociny Date: Mon Nov 7 21:09:04 2011 New Revision: 227315 URL: http://svn.freebsd.org/changeset/base/227315 Log: In lim_fork() assert that processes locks are held. Suggested by: kib Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Nov 7 19:57:42 2011 (r227314) +++ head/sys/kern/kern_resource.c Mon Nov 7 21:09:04 2011 (r227315) @@ -1118,6 +1118,10 @@ lim_hold(limp) void lim_fork(struct proc *p1, struct proc *p2) { + + PROC_LOCK_ASSERT(p1, MA_OWNED); + PROC_LOCK_ASSERT(p2, MA_OWNED); + p2->p_limit = lim_hold(p1->p_limit); callout_init_mtx(&p2->p_limco, &p2->p_mtx, 0); if (p1->p_cpulimit != RLIM_INFINITY) From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 21:13:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD271065674; Mon, 7 Nov 2011 21:13:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965728FC17; Mon, 7 Nov 2011 21:13:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7LDJlT096651; Mon, 7 Nov 2011 21:13:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7LDJLf096648; Mon, 7 Nov 2011 21:13:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111072113.pA7LDJLf096648@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 7 Nov 2011 21:13: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: r227316 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 21:13:19 -0000 Author: trociny Date: Mon Nov 7 21:13:19 2011 New Revision: 227316 URL: http://svn.freebsd.org/changeset/base/227316 Log: Add KVME_FLAG_SUPER and use it in sysctl_kern_proc_vmmap for marking entries with superpages. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Nov 7 21:09:04 2011 (r227315) +++ head/sys/kern/kern_proc.c Mon Nov 7 21:13:19 2011 (r227316) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_FREEBSD32 @@ -1710,7 +1712,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; + vm_paddr_t locked_pa; + int vfslocked, mincoreinfo; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1728,8 +1731,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_resident = 0; addr = entry->start; while (addr < entry->end) { - if (pmap_extract(map->pmap, addr)) + locked_pa = 0; + mincoreinfo = pmap_mincore(map->pmap, addr, &locked_pa); + if (locked_pa != 0) + vm_page_unlock(PHYS_TO_VM_PAGE(locked_pa)); + if (mincoreinfo & MINCORE_INCORE) kve->kve_resident++; + if (mincoreinfo & MINCORE_SUPER) + kve->kve_flags |= KVME_FLAG_SUPER; addr += PAGE_SIZE; } Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Nov 7 21:09:04 2011 (r227315) +++ head/sys/sys/user.h Mon Nov 7 21:13:19 2011 (r227316) @@ -412,6 +412,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 #define KVME_FLAG_NOCOREDUMP 0x00000004 +#define KVME_FLAG_SUPER 0x00000008 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 21:16:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F5D1065676; Mon, 7 Nov 2011 21:16:20 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 313668FC16; Mon, 7 Nov 2011 21:16:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7LGK0A096782; Mon, 7 Nov 2011 21:16:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7LGKHU096779; Mon, 7 Nov 2011 21:16:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111072116.pA7LGKHU096779@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 7 Nov 2011 21:16: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: r227317 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 21:16:20 -0000 Author: trociny Date: Mon Nov 7 21:16:19 2011 New Revision: 227317 URL: http://svn.freebsd.org/changeset/base/227317 Log: When displaying process virtual memory mappings print superpage mapping flag. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Mon Nov 7 21:13:19 2011 (r227316) +++ head/usr.bin/procstat/procstat.1 Mon Nov 7 21:16:19 2011 (r227317) @@ -421,6 +421,8 @@ The following mapping flags may be displ copy-on-write .It N needs copy +.It S +one or more superpage mappings are used .El .Sh EXIT STATUS .Ex -std Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Mon Nov 7 21:13:19 2011 (r227316) +++ head/usr.bin/procstat/procstat_vm.c Mon Nov 7 21:16:19 2011 (r227317) @@ -50,7 +50,7 @@ procstat_vm(struct kinfo_proc *kipp) ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %2s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %3s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); @@ -70,8 +70,9 @@ procstat_vm(struct kinfo_proc *kipp) printf("%3d ", kve->kve_ref_count); printf("%3d ", kve->kve_shadow_count); printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-"); - printf("%-1s ", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : + printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : "-"); + printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); switch (kve->kve_type) { case KVME_TYPE_NONE: str = "--"; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:11:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 186231065674; Mon, 7 Nov 2011 22:11:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E34A58FC1C; Mon, 7 Nov 2011 22:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7MBcTb098539; Mon, 7 Nov 2011 22:11:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7MBcHR098537; Mon, 7 Nov 2011 22:11:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072211.pA7MBcHR098537@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227318 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:11:39 -0000 Author: yongari Date: Mon Nov 7 22:11:38 2011 New Revision: 227318 URL: http://svn.freebsd.org/changeset/base/227318 Log: Track which ring was updated in RX handler and update only modified ring. This should reduce unnecessary register accesses. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 21:16:19 2011 (r227317) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:11:38 2011 (r227318) @@ -2647,15 +2647,17 @@ ti_rxeof(struct ti_softc *sc) struct ifnet *ifp; bus_dmamap_t map; struct ti_cmd_desc cmd; + int jumbocnt, minicnt, stdcnt; TI_LOCK_ASSERT(sc); ifp = sc->ti_ifp; + jumbocnt = minicnt = stdcnt = 0; while (sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) { struct ti_rx_desc *cur_rx; - struct mbuf *m = NULL; uint32_t rxidx; + struct mbuf *m = NULL; uint16_t vlan_tag = 0; int have_tag = 0; @@ -2670,7 +2672,7 @@ ti_rxeof(struct ti_softc *sc) } if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) { - + jumbocnt++; TI_INC(sc->ti_jumbo, TI_JUMBO_RX_RING_CNT); m = sc->ti_cdata.ti_rx_jumbo_chain[rxidx]; sc->ti_cdata.ti_rx_jumbo_chain[rxidx] = NULL; @@ -2700,6 +2702,7 @@ ti_rxeof(struct ti_softc *sc) m_adj(m, cur_rx->ti_len - m->m_pkthdr.len); #endif /* TI_PRIVATE_JUMBOS */ } else if (cur_rx->ti_flags & TI_BDFLAG_MINI_RING) { + minicnt++; TI_INC(sc->ti_mini, TI_MINI_RX_RING_CNT); m = sc->ti_cdata.ti_rx_mini_chain[rxidx]; sc->ti_cdata.ti_rx_mini_chain[rxidx] = NULL; @@ -2719,6 +2722,7 @@ ti_rxeof(struct ti_softc *sc) } m->m_len = cur_rx->ti_len; } else { + stdcnt++; TI_INC(sc->ti_std, TI_STD_RX_RING_CNT); m = sc->ti_cdata.ti_rx_std_chain[rxidx]; sc->ti_cdata.ti_rx_std_chain[rxidx] = NULL; @@ -2774,9 +2778,12 @@ ti_rxeof(struct ti_softc *sc) CSR_WRITE_4(sc, TI_GCR_RXRETURNCONS_IDX, sc->ti_rx_saved_considx); - TI_UPDATE_STDPROD(sc, sc->ti_std); - TI_UPDATE_MINIPROD(sc, sc->ti_mini); - TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo); + if (stdcnt > 0) + TI_UPDATE_STDPROD(sc, sc->ti_std); + if (minicnt > 0) + TI_UPDATE_MINIPROD(sc, sc->ti_mini); + if (jumbocnt > 0) + TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo); } static void From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:17:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B47106566C; Mon, 7 Nov 2011 22:17:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 432E38FC12; Mon, 7 Nov 2011 22:17:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7MHj29098817; Mon, 7 Nov 2011 22:17:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7MHjgr098815; Mon, 7 Nov 2011 22:17:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072217.pA7MHjgr098815@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:17: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: r227319 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:17:45 -0000 Author: yongari Date: Mon Nov 7 22:17:44 2011 New Revision: 227319 URL: http://svn.freebsd.org/changeset/base/227319 Log: Mini ring is not available on Tigon 1 so do not create DMA maps for mini ring on Tigon 1 to save resources. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 22:11:38 2011 (r227318) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:17:44 2011 (r227319) @@ -998,6 +998,11 @@ ti_alloc_dmamaps(struct ti_softc *sc) &sc->ti_cdata.ti_rx_jumbo_maps[i])) return (ENOBUFS); } + + /* Mini ring is not available on Tigon 1. */ + if (sc->ti_hwrev == TI_HWREV_TIGON) + return (0); + for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, &sc->ti_cdata.ti_rx_mini_maps[i])) From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:30:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E37B4106566B; Mon, 7 Nov 2011 22:30:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95528FC19; Mon, 7 Nov 2011 22:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7MUJrP099254; Mon, 7 Nov 2011 22:30:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7MUJWF099252; Mon, 7 Nov 2011 22:30:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111072230.pA7MUJWF099252@svn.freebsd.org> From: Michael Tuexen Date: Mon, 7 Nov 2011 22:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227320 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:30:20 -0000 Author: tuexen Date: Mon Nov 7 22:30:19 2011 New Revision: 227320 URL: http://svn.freebsd.org/changeset/base/227320 Log: When loading addresses from INITs, always use the correct local address. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Nov 7 22:17:44 2011 (r227319) +++ head/sys/netinet/sctp_pcb.c Mon Nov 7 22:30:19 2011 (r227320) @@ -6181,54 +6181,65 @@ sctp_load_addresses_from_init(struct sct sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; #endif - if (altsa == NULL) { - iph = mtod(m, struct ip *); - switch (iph->ip_v) { + iph = mtod(m, struct ip *); + switch (iph->ip_v) { #ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *sin_2; - - sin_2 = (struct sockaddr_in *)(local_sa); - memset(sin_2, 0, sizeof(sin)); - sin_2->sin_family = AF_INET; - sin_2->sin_len = sizeof(sin); - sin_2->sin_port = sh->dest_port; - sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + case IPVERSION: + { + /* its IPv4 */ + struct sockaddr_in *sin_2; + + sin_2 = (struct sockaddr_in *)(local_sa); + memset(sin_2, 0, sizeof(sin)); + sin_2->sin_family = AF_INET; + sin_2->sin_len = sizeof(sin); + sin_2->sin_port = sh->dest_port; + sin_2->sin_addr.s_addr = iph->ip_dst.s_addr; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin.sin_addr = iph->ip_src; sa = (struct sockaddr *)&sin; - break; } + break; + } #endif #ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *sin6_2; - - ip6 = mtod(m, struct ip6_hdr *); - sin6_2 = (struct sockaddr_in6 *)(local_sa); - memset(sin6_2, 0, sizeof(sin6)); - sin6_2->sin6_family = AF_INET6; - sin6_2->sin6_len = sizeof(struct sockaddr_in6); - sin6_2->sin6_port = sh->dest_port; + case IPV6_VERSION >> 4: + { + /* its IPv6 */ + struct ip6_hdr *ip6; + struct sockaddr_in6 *sin6_2; + + ip6 = mtod(m, struct ip6_hdr *); + sin6_2 = (struct sockaddr_in6 *)(local_sa); + memset(sin6_2, 0, sizeof(sin6)); + sin6_2->sin6_family = AF_INET6; + sin6_2->sin6_len = sizeof(struct sockaddr_in6); + sin6_2->sin6_port = sh->dest_port; + sin6_2->sin6_addr = ip6->ip6_dst; + if (altsa) { + /* + * For cookies we use the src address NOT + * from the packet but from the original + * INIT. + */ + sa = altsa; + } else { sin6.sin6_addr = ip6->ip6_src; sa = (struct sockaddr *)&sin6; - break; } -#endif - default: - return (-1); break; } - } else { - /* - * For cookies we use the src address NOT from the packet - * but from the original INIT - */ - sa = altsa; +#endif + default: + return (-1); + break; } /* Turn off ECN until we get through all params */ ecn_allowed = 0; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:47:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72A4106564A; Mon, 7 Nov 2011 22:47:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B748F8FC0A; Mon, 7 Nov 2011 22:47:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7MlPsF099891; Mon, 7 Nov 2011 22:47:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7MlPDJ099889; Mon, 7 Nov 2011 22:47:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072247.pA7MlPDJ099889@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:47: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: r227322 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:47:25 -0000 Author: yongari Date: Mon Nov 7 22:47:25 2011 New Revision: 227322 URL: http://svn.freebsd.org/changeset/base/227322 Log: Show RX buffer allocation failure and do not blindly send alive message to firmware. Probably the correct way for this error is to send a TI_CMD_CODE_STACK_DOWN message to firmware and let firmware handle the rest. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 22:34:07 2011 (r227321) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:47:25 2011 (r227322) @@ -3160,18 +3160,34 @@ static void ti_init2(struct ti_softc *sc } /* Init RX ring. */ - ti_init_rx_ring_std(sc); + if (ti_init_rx_ring_std(sc) != 0) { + /* XXX */ + device_printf(sc->ti_dev, "no memory for std Rx buffers.\n"); + return; + } /* Init jumbo RX ring. */ - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) - ti_init_rx_ring_jumbo(sc); + if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) { + if (ti_init_rx_ring_jumbo(sc) != 0) { + /* XXX */ + device_printf(sc->ti_dev, + "no memory for jumbo Rx buffers.\n"); + return; + } + } /* * If this is a Tigon 2, we can also configure the * mini ring. */ - if (sc->ti_hwrev == TI_HWREV_TIGON_II) - ti_init_rx_ring_mini(sc); + if (sc->ti_hwrev == TI_HWREV_TIGON_II) { + if (ti_init_rx_ring_mini(sc) != 0) { + /* XXX */ + device_printf(sc->ti_dev, + "no memory for mini Rx buffers.\n"); + return; + } + } CSR_WRITE_4(sc, TI_GCR_RXRETURNCONS_IDX, 0); sc->ti_rx_saved_considx = 0; From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:53:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D51C6106566B; Mon, 7 Nov 2011 22:53:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58A68FC20; Mon, 7 Nov 2011 22:53:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7Mr6F4000212; Mon, 7 Nov 2011 22:53:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7Mr6L4000210; Mon, 7 Nov 2011 22:53:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072253.pA7Mr6L4000210@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227323 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:53:06 -0000 Author: yongari Date: Mon Nov 7 22:53:06 2011 New Revision: 227323 URL: http://svn.freebsd.org/changeset/base/227323 Log: If ti_chipinit() fails in ti_stop(), ignore the error and release all allocated TX/RX buffer resources. If the interface is brought to up again after the error, we will leak allocated TX/RX buffers. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 22:47:25 2011 (r227322) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:53:06 2011 (r227323) @@ -3845,11 +3845,11 @@ ti_stop(struct ti_softc *sc) TI_DO_CMD(TI_CMD_HOST_STATE, TI_CMD_CODE_STACK_DOWN, 0); /* Halt and reinitialize. */ - if (ti_chipinit(sc) != 0) - return; - ti_mem_zero(sc, 0x2000, 0x100000 - 0x2000); - if (ti_chipinit(sc) != 0) - return; + if (ti_chipinit(sc) == 0) { + ti_mem_zero(sc, 0x2000, 0x100000 - 0x2000); + /* XXX ignore init errors. */ + ti_chipinit(sc); + } /* Free the RX lists. */ ti_free_rx_ring_std(sc); From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 22:58:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E47ED1065670; Mon, 7 Nov 2011 22:58:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50A38FC1A; Mon, 7 Nov 2011 22:58:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7MwnnG000436; Mon, 7 Nov 2011 22:58:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7MwnTp000434; Mon, 7 Nov 2011 22:58:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111072258.pA7MwnTp000434@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Nov 2011 22:58: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: r227324 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 22:58:50 -0000 Author: yongari Date: Mon Nov 7 22:58:49 2011 New Revision: 227324 URL: http://svn.freebsd.org/changeset/base/227324 Log: Do not allow changing MTU to be less than the minimum. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 7 22:53:06 2011 (r227323) +++ head/sys/dev/ti/if_ti.c Mon Nov 7 22:58:49 2011 (r227324) @@ -3396,7 +3396,7 @@ ti_ioctl(struct ifnet *ifp, u_long comma switch (command) { case SIOCSIFMTU: TI_LOCK(sc); - if (ifr->ifr_mtu > TI_JUMBO_MTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > TI_JUMBO_MTU) error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 01:35:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 979E6106564A; Tue, 8 Nov 2011 01:35:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B0B8FC12; Tue, 8 Nov 2011 01:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA81Z5BZ006179; Tue, 8 Nov 2011 01:35:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA81Z54F006177; Tue, 8 Nov 2011 01:35:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111080135.pA81Z54F006177@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 01:35: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: r227326 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 01:35:05 -0000 Author: adrian Date: Tue Nov 8 01:35:05 2011 New Revision: 227326 URL: http://svn.freebsd.org/changeset/base/227326 Log: Merge in ath rate flags and ath_rc_series from my 11n TX branch. This is in preparation for 802.11n TX aggregation support. Modified: head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Mon Nov 7 23:09:18 2011 (r227325) +++ head/sys/dev/ath/if_athrate.h Tue Nov 8 01:35:05 2011 (r227326) @@ -77,6 +77,21 @@ struct ath_ratectrl { struct ath_ratectrl *ath_rate_attach(struct ath_softc *); void ath_rate_detach(struct ath_ratectrl *); +#define ATH_RC_NUM 4 + +#define ATH_RC_DS_FLAG 0x01 /* dual-stream rate */ +#define ATH_RC_CW40_FLAG 0x02 /* use HT40 */ +#define ATH_RC_SGI_FLAG 0x04 /* use short-GI */ +#define ATH_RC_HT_FLAG 0x08 /* use HT */ +#define ATH_RC_RTSCTS_FLAG 0x10 /* enable RTS/CTS protection */ + +struct ath_rc_series { + uint8_t rix; /* ratetable index, not rate code */ + uint8_t ratecode; /* hardware rate code */ + uint8_t tries; + uint8_t flags; + uint32_t max4msframelen; +}; /* * State storage handling. From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 01:35:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA33D106566C; Tue, 8 Nov 2011 01:35:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA67D8FC13; Tue, 8 Nov 2011 01:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA81Zi3j006237; Tue, 8 Nov 2011 01:35:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA81Zikc006235; Tue, 8 Nov 2011 01:35:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111080135.pA81Zikc006235@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 01:35: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: r227327 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 01:35:44 -0000 Author: adrian Date: Tue Nov 8 01:35:44 2011 New Revision: 227327 URL: http://svn.freebsd.org/changeset/base/227327 Log: Bring over the 11n aggregation statistics struct from the if_ath_tx branch. Modified: head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue Nov 8 01:35:05 2011 (r227326) +++ head/sys/dev/ath/if_athioctl.h Tue Nov 8 01:35:44 2011 (r227327) @@ -35,6 +35,16 @@ #ifndef _DEV_ATH_ATHIOCTL_H #define _DEV_ATH_ATHIOCTL_H +struct ath_tx_aggr_stats { + u_int32_t aggr_pkts[64]; + u_int32_t aggr_single_pkt; + u_int32_t aggr_nonbaw_pkt; + u_int32_t aggr_aggr_pkt; + u_int32_t aggr_baw_closed_single_pkt; + u_int32_t aggr_low_hwq_single_pkt; + u_int32_t aggr_sched_nopkt; +}; + struct ath_stats { u_int32_t ast_watchdog; /* device reset by watchdog */ u_int32_t ast_hardware; /* fatal hardware error interrupts */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 02:12:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B002A1065670; Tue, 8 Nov 2011 02:12:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC5E8FC08; Tue, 8 Nov 2011 02:12:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA82CBlj007629; Tue, 8 Nov 2011 02:12:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA82CBCN007623; Tue, 8 Nov 2011 02:12:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111080212.pA82CBCN007623@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 02:12: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: r227328 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 02:12:11 -0000 Author: adrian Date: Tue Nov 8 02:12:11 2011 New Revision: 227328 URL: http://svn.freebsd.org/changeset/base/227328 Log: Begin merging in some of my 802.11n TX aggregation driver changes. * Add a PCU lock, which isn't currently used but will eventually be used to serialise some of the driver access. * Add in all the software TX aggregation state, that's kept per-node and per-TID. * Add in the software and aggregation state to ath_buf. * Add in hooks to ath_softc for aggregation state and the (upcoming) aggregation TX state calls. * Add / fix the HAL access macros. Obtained from: Linux, ath9k Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 01:35:44 2011 (r227327) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 02:12:11 2011 (r227328) @@ -3162,6 +3162,11 @@ ath_node_alloc(struct ieee80211vap *vap, } ath_rate_node_init(sc, an); + /* Setup the mutex - there's no associd yet so set the name to NULL */ + snprintf(an->an_name, sizeof(an->an_name), "%s: node %p", + device_get_nameunit(sc->sc_dev), an); + mtx_init(&an->an_mtx, an->an_name, NULL, MTX_DEF); + DPRINTF(sc, ATH_DEBUG_NODE, "%s: an %p\n", __func__, an); return &an->an_node; } @@ -3173,7 +3178,7 @@ ath_node_free(struct ieee80211_node *ni) struct ath_softc *sc = ic->ic_ifp->if_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni); - + mtx_destroy(&ATH_NODE(ni)->an_mtx); ath_rate_node_cleanup(sc, ATH_NODE(ni)); sc->sc_node_free(ni); } Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Tue Nov 8 01:35:44 2011 (r227327) +++ head/sys/dev/ath/if_ath_ahb.c Tue Nov 8 02:12:11 2011 (r227328) @@ -190,11 +190,13 @@ ath_ahb_attach(device_t dev) } ATH_LOCK_INIT(sc); + ATH_PCU_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); if (error == 0) /* success */ return 0; + ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); bad3: @@ -234,6 +236,7 @@ ath_ahb_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); return (0); Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Tue Nov 8 01:35:44 2011 (r227327) +++ head/sys/dev/ath/if_ath_pci.c Tue Nov 8 02:12:11 2011 (r227328) @@ -190,11 +190,13 @@ ath_pci_attach(device_t dev) } ATH_LOCK_INIT(sc); + ATH_PCU_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); if (error == 0) /* success */ return 0; + ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); bad3: @@ -230,6 +232,7 @@ ath_pci_detach(device_t dev) bus_dma_tag_destroy(sc->sc_dmat); bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, psc->sc_sr); + ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); return (0); Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 01:35:44 2011 (r227327) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 02:12:11 2011 (r227328) @@ -299,6 +299,68 @@ ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS) } static int +ath_sysctl_txagg(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int i, t, param = 0; + int error; + struct ath_buf *bf; + + error = sysctl_handle_int(oidp, ¶m, 0, req); + if (error || !req->newptr) + return error; + + if (param != 1) + return 0; + + printf("no tx bufs (empty list): %d\n", sc->sc_stats.ast_tx_getnobuf); + printf("no tx bufs (was busy): %d\n", sc->sc_stats.ast_tx_getbusybuf); + + printf("aggr single packet: %d\n", + sc->sc_aggr_stats.aggr_single_pkt); + printf("aggr single packet w/ BAW closed: %d\n", + sc->sc_aggr_stats.aggr_baw_closed_single_pkt); + printf("aggr non-baw packet: %d\n", + sc->sc_aggr_stats.aggr_nonbaw_pkt); + printf("aggr aggregate packet: %d\n", + sc->sc_aggr_stats.aggr_aggr_pkt); + printf("aggr single packet low hwq: %d\n", + sc->sc_aggr_stats.aggr_low_hwq_single_pkt); + printf("aggr sched, no work: %d\n", + sc->sc_aggr_stats.aggr_sched_nopkt); + for (i = 0; i < 64; i++) { + printf("%2d: %10d ", i, sc->sc_aggr_stats.aggr_pkts[i]); + if (i % 4 == 3) + printf("\n"); + } + printf("\n"); + + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + printf("HW TXQ %d: axq_depth=%d, axq_aggr_depth=%d\n", + i, + sc->sc_txq[i].axq_depth, + sc->sc_txq[i].axq_aggr_depth); + } + } + + i = t = 0; + ATH_TXBUF_LOCK(sc); + STAILQ_FOREACH(bf, &sc->sc_txbuf, bf_list) { + if (bf->bf_flags & ATH_BUF_BUSY) { + printf("Busy: %d\n", t); + i++; + } + t++; + } + ATH_TXBUF_UNLOCK(sc); + printf("Total TX buffers: %d; Total TX buffers busy: %d\n", + t, i); + + return 0; +} + +static int ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS) { struct ath_softc *sc = arg1; @@ -387,6 +449,24 @@ ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) } #endif /* IEEE80211_SUPPORT_TDMA */ +static int +ath_sysctl_forcebstuck(SYSCTL_HANDLER_ARGS) +{ + struct ath_softc *sc = arg1; + int val = 0; + int error; + + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return error; + if (val == 0) + return 0; + + taskqueue_enqueue_fast(sc->sc_tq, &sc->sc_bstucktask); + val = 0; + return 0; +} + void ath_sysctlattach(struct ath_softc *sc) { @@ -465,6 +545,15 @@ ath_sysctlattach(struct ath_softc *sc) "rfkill", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ath_sysctl_rfkill, "I", "enable/disable RF kill switch"); } + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "txagg", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_txagg, "I", ""); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "forcebstuck", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + ath_sysctl_forcebstuck, "I", ""); + if (ath_hal_hasintmit(ah)) { SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "intmit", CTLTYPE_INT | CTLFLAG_RW, sc, 0, @@ -474,6 +563,17 @@ ath_sysctlattach(struct ath_softc *sc) SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "monpass", CTLFLAG_RW, &sc->sc_monpass, 0, "mask of error frames to pass when monitoring"); + + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "hwq_limit", CTLFLAG_RW, &sc->sc_hwq_limit, 0, + ""); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tid_hwq_lo", CTLFLAG_RW, &sc->sc_tid_hwq_lo, 0, + ""); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tid_hwq_hi", CTLFLAG_RW, &sc->sc_tid_hwq_hi, 0, + ""); + #ifdef IEEE80211_SUPPORT_TDMA if (ath_hal_macversion(ah) > 0x78) { sc->sc_tdmadbaprep = 2; @@ -510,6 +610,8 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARG if (val == 0) return 0; /* Not clearing the stats is still valid */ memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + memset(&sc->sc_aggr_stats, 0, sizeof(sc->sc_aggr_stats)); + val = 0; return 0; } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Nov 8 01:35:44 2011 (r227327) +++ head/sys/dev/ath/if_athvar.h Tue Nov 8 02:12:11 2011 (r227328) @@ -83,12 +83,73 @@ struct taskqueue; struct kthread; struct ath_buf; +#define ATH_TID_MAX_BUFS (2 * IEEE80211_AGGR_BAWMAX) + +/* + * Per-TID state + * + * Note that TID 16 (WME_NUM_TID+1) is for handling non-QoS frames. + */ +struct ath_tid { + TAILQ_HEAD(,ath_buf) axq_q; /* pending buffers */ + u_int axq_depth; /* SW queue depth */ + char axq_name[48]; /* lock name */ + struct ath_node *an; /* pointer to parent */ + int tid; /* tid */ + int ac; /* which AC gets this trafic */ + int hwq_depth; /* how many buffers are on HW */ + + /* + * Entry on the ath_txq; when there's traffic + * to send + */ + TAILQ_ENTRY(ath_tid) axq_qelem; + int sched; + int paused; /* >0 if the TID has been paused */ + + /* + * Is the TID being cleaned up after a transition + * from aggregation to non-aggregation? + * When this is set to 1, this TID will be paused + * and no further traffic will be queued until all + * the hardware packets pending for this TID have been + * TXed/completed; at which point (non-aggregation) + * traffic will resume being TXed. + */ + int cleanup_inprogress; + /* + * How many hardware-queued packets are + * waiting to be cleaned up. + * This is only valid if cleanup_inprogress is 1. + */ + int incomp; + + /* + * The following implements a ring representing + * the frames in the current BAW. + * To avoid copying the array content each time + * the BAW is moved, the baw_head/baw_tail point + * to the current BAW begin/end; when the BAW is + * shifted the head/tail of the array are also + * appropriately shifted. + */ + /* active tx buffers, beginning at current BAW */ + struct ath_buf *tx_buf[ATH_TID_MAX_BUFS]; + /* where the baw head is in the array */ + int baw_head; + /* where the BAW tail is in the array */ + int baw_tail; +}; + /* driver-specific node state */ struct ath_node { struct ieee80211_node an_node; /* base class */ u_int8_t an_mgmtrix; /* min h/w rate index */ u_int8_t an_mcastrix; /* mcast h/w rate index */ struct ath_buf *an_ff_buf[WME_NUM_AC]; /* ff staging area */ + struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */ + char an_name[32]; /* eg "wlan0_a1" */ + struct mtx an_mtx; /* protecting the ath_node state */ /* variable-length rate control state follows */ }; #define ATH_NODE(ni) ((struct ath_node *)(ni)) @@ -110,6 +171,7 @@ struct ath_node { struct ath_buf { STAILQ_ENTRY(ath_buf) bf_list; + struct ath_buf * bf_next; /* next buffer in the aggregate */ int bf_nseg; uint16_t bf_txflags; /* tx descriptor flags */ uint16_t bf_flags; /* status flags (below) */ @@ -119,9 +181,63 @@ struct ath_buf { bus_dmamap_t bf_dmamap; /* DMA map for mbuf chain */ struct mbuf *bf_m; /* mbuf for buf */ struct ieee80211_node *bf_node; /* pointer to the node */ + struct ath_desc *bf_lastds; /* last descriptor for comp status */ + struct ath_buf *bf_last; /* last buffer in aggregate, or self for non-aggregate */ bus_size_t bf_mapsize; #define ATH_MAX_SCATTER ATH_TXDESC /* max(tx,rx,beacon) desc's */ bus_dma_segment_t bf_segs[ATH_MAX_SCATTER]; + + /* Completion function to call on TX complete (fail or not) */ + /* + * "fail" here is set to 1 if the queue entries were removed + * through a call to ath_tx_draintxq(). + */ + void(* bf_comp) (struct ath_softc *sc, struct ath_buf *bf, int fail); + + /* This state is kept to support software retries and aggregation */ + struct { + int bfs_seqno; /* sequence number of this packet */ + int bfs_retries; /* retry count */ + uint16_t bfs_tid; /* packet TID (or TID_MAX for no QoS) */ + uint16_t bfs_pri; /* packet AC priority */ + struct ath_txq *bfs_txq; /* eventual dest hardware TXQ */ + uint16_t bfs_pktdur; /* packet duration (at current rate?) */ + uint16_t bfs_nframes; /* number of frames in aggregate */ + uint16_t bfs_ndelim; /* number of delims for padding */ + + int bfs_aggr:1; /* part of aggregate? */ + int bfs_aggrburst:1; /* part of aggregate burst? */ + int bfs_isretried:1; /* retried frame? */ + int bfs_dobaw:1; /* actually check against BAW? */ + int bfs_addedbaw:1; /* has been added to the BAW */ + int bfs_shpream:1; /* use short preamble */ + int bfs_istxfrag:1; /* is fragmented */ + int bfs_ismrr:1; /* do multi-rate TX retry */ + int bfs_doprot:1; /* do RTS/CTS based protection */ + int bfs_doratelookup:1; /* do rate lookup before each TX */ + int bfs_nfl; /* next fragment length */ + + /* + * These fields are passed into the + * descriptor setup functions. + */ + HAL_PKT_TYPE bfs_atype; /* packet type */ + int bfs_pktlen; /* length of this packet */ + int bfs_hdrlen; /* length of this packet header */ + uint16_t bfs_al; /* length of aggregate */ + int bfs_flags; /* HAL descriptor flags */ + int bfs_txrate0; /* first TX rate */ + int bfs_try0; /* first try count */ + uint8_t bfs_ctsrate0; /* Non-zero - use this as ctsrate */ + int bfs_keyix; /* crypto key index */ + int bfs_txpower; /* tx power */ + int bfs_txantenna; /* TX antenna config */ + enum ieee80211_protmode bfs_protmode; + HAL_11N_RATE_SERIES bfs_rc11n[ATH_RC_NUM]; /* 11n TX series */ + int bfs_ctsrate; /* CTS rate */ + int bfs_ctsduration; /* CTS duration (pre-11n NICs) */ + struct ath_rc_series bfs_rc[ATH_RC_NUM]; /* non-11n TX series */ + } bf_state; }; typedef STAILQ_HEAD(, ath_buf) ath_bufhead; @@ -151,19 +267,27 @@ struct ath_descdma { * hardware queue). */ struct ath_txq { + struct ath_softc *axq_softc; /* Needed for scheduling */ u_int axq_qnum; /* hardware q number */ #define ATH_TXQ_SWQ (HAL_NUM_TX_QUEUES+1) /* qnum for s/w only queue */ u_int axq_ac; /* WME AC */ u_int axq_flags; #define ATH_TXQ_PUTPENDING 0x0001 /* ath_hal_puttxbuf pending */ u_int axq_depth; /* queue depth (stat only) */ + u_int axq_aggr_depth; /* how many aggregates are queued */ u_int axq_intrcnt; /* interrupt count */ u_int32_t *axq_link; /* link ptr in last TX desc */ STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */ struct mtx axq_lock; /* lock on q and link */ char axq_name[12]; /* e.g. "ath0_txq4" */ + /* Per-TID traffic queue for software -> hardware TX */ + TAILQ_HEAD(axq_t_s,ath_tid) axq_tidq; }; +#define ATH_NODE_LOCK(_an) mtx_lock(&(_an)->an_mtx) +#define ATH_NODE_UNLOCK(_an) mtx_unlock(&(_an)->an_mtx) +#define ATH_NODE_LOCK_ASSERT(_an) mtx_assert(&(_an)->an_mtx, MA_OWNED) + #define ATH_TXQ_LOCK_INIT(_sc, _tq) do { \ snprintf((_tq)->axq_name, sizeof((_tq)->axq_name), "%s_txq%u", \ device_get_nameunit((_sc)->sc_dev), (_tq)->axq_qnum); \ @@ -173,6 +297,7 @@ struct ath_txq { #define ATH_TXQ_LOCK(_tq) mtx_lock(&(_tq)->axq_lock) #define ATH_TXQ_UNLOCK(_tq) mtx_unlock(&(_tq)->axq_lock) #define ATH_TXQ_LOCK_ASSERT(_tq) mtx_assert(&(_tq)->axq_lock, MA_OWNED) +#define ATH_TXQ_IS_LOCKED(_tq) mtx_owned(&(_tq)->axq_lock) #define ATH_TXQ_INSERT_TAIL(_tq, _elm, _field) do { \ STAILQ_INSERT_TAIL(&(_tq)->axq_q, (_elm), _field); \ @@ -205,9 +330,20 @@ struct ath_vap { struct taskqueue; struct ath_tx99; +/* + * Whether to reset the TX/RX queue with or without + * a queue flush. + */ +typedef enum { + ATH_RESET_DEFAULT = 0, + ATH_RESET_NOLOSS = 1, + ATH_RESET_FULL = 2, +} ATH_RESET_TYPE; + struct ath_softc { struct ifnet *sc_ifp; /* interface common */ struct ath_stats sc_stats; /* interface statistics */ + struct ath_tx_aggr_stats sc_aggr_stats; int sc_debug; int sc_nvaps; /* # vaps */ int sc_nstavaps; /* # station vaps */ @@ -216,12 +352,15 @@ struct ath_softc { u_int8_t sc_nbssid0; /* # vap's using base mac */ uint32_t sc_bssidmask; /* bssid mask */ + void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); device_t sc_dev; HAL_BUS_TAG sc_st; /* bus space tag */ HAL_BUS_HANDLE sc_sh; /* bus space handle */ bus_dma_tag_t sc_dmat; /* bus DMA tag */ struct mtx sc_mtx; /* master lock (recursive) */ + struct mtx sc_pcu_mtx; /* PCU access mutex */ + char sc_pcu_mtx_name[32]; struct taskqueue *sc_tq; /* private task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ @@ -360,10 +499,38 @@ struct ath_softc { int sc_txchainmask; /* currently configured TX chainmask */ int sc_rxchainmask; /* currently configured RX chainmask */ + /* + * Aggregation twiddles + * + * hwq_limit: how busy to keep the hardware queue - don't schedule + * further packets to the hardware, regardless of the TID + * tid_hwq_lo: how low the per-TID hwq count has to be before the + * TID will be scheduled again + * tid_hwq_hi: how many frames to queue to the HWQ before the TID + * stops being scheduled. + */ + int sc_hwq_limit; + int sc_tid_hwq_lo; + int sc_tid_hwq_hi; + /* DFS related state */ void *sc_dfs; /* Used by an optional DFS module */ int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ + + /* TX AMPDU handling */ + int (*sc_addba_request)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + int (*sc_addba_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + void (*sc_addba_stop)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + void (*sc_addba_response_timeout) + (struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + void (*sc_bar_response)(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap, + int status); }; #define ATH_LOCK_INIT(_sc) \ @@ -374,6 +541,37 @@ struct ath_softc { #define ATH_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define ATH_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +/* + * The PCU lock is non-recursive and should be treated as a spinlock. + * Although currently the interrupt code is run in netisr context and + * doesn't require this, this may change in the future. + * Please keep this in mind when protecting certain code paths + * with the PCU lock. + * + * The PCU lock is used to serialise access to the PCU so things such + * as TX, RX, state change (eg channel change), channel reset and updates + * from interrupt context (eg kickpcu, txqactive bits) do not clash. + * + * Although the current single-thread taskqueue mechanism protects the + * majority of these situations by simply serialising them, there are + * a few others which occur at the same time. These include the TX path + * (which only acquires ATH_LOCK when recycling buffers to the free list), + * ath_set_channel, the channel scanning API and perhaps quite a bit more. + */ +#define ATH_PCU_LOCK_INIT(_sc) do {\ + snprintf((_sc)->sc_pcu_mtx_name, \ + sizeof((_sc)->sc_pcu_mtx_name), \ + "%s PCU lock", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_pcu_mtx, (_sc)->sc_pcu_mtx_name, \ + NULL, MTX_DEF); \ + } while (0) +#define ATH_PCU_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_pcu_mtx) +#define ATH_PCU_LOCK(_sc) mtx_lock(&(_sc)->sc_pcu_mtx) +#define ATH_PCU_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_pcu_mtx) +#define ATH_PCU_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_pcu_mtx, \ + MA_OWNED) + #define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1<ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) -#define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \ - _cipher, _delims, _seglen, _first, _last) \ - ((*(_ah)->ah_chainTxDesc((_ah), (_ds), (_pktlen), (_hdrlen), \ - (_type), (_keyix), (_cipher), (_delims), (_seglen), \ - (_first), (_last)))) #define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ _txr0, _txtr0, _antm, _rcr, _rcd) \ ((*(_ah)->ah_setupFirstTxDesc)((_ah), (_ds), (_aggrlen), (_flags), \ (_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd))) +#define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \ + _cipher, _delims, _seglen, _first, _last) \ + ((*(_ah)->ah_chainTxDesc)((_ah), (_ds), (_pktlen), (_hdrlen), \ + (_type), (_keyix), (_cipher), (_delims), (_seglen), \ + (_first), (_last))) #define ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \ ((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0))) + #define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns, _flags) \ ((*(_ah)->ah_set11nRateScenario)((_ah), (_ds), (_dur), (_rt), \ (_series), (_ns), (_flags))) + +#define ath_hal_set11n_aggr_first(_ah, _ds, _len, _num) \ + ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len), (_num))) #define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ - ((*(_ah)->ah_set11nAggrMiddle((_ah), (_ds), (_num)))) + ((*(_ah)->ah_set11nAggrMiddle)((_ah), (_ds), (_num))) +#define ath_hal_set11n_aggr_last(_ah, _ds) \ + ((*(_ah)->ah_set11nAggrLast)((_ah), (_ds))) + #define ath_hal_set11nburstduration(_ah, _ds, _dur) \ ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) +#define ath_hal_clr11n_aggr(_ah, _ds) \ + ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) /* * This is badly-named; you need to set the correct parameters From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 04:00:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B7D106566C; Tue, 8 Nov 2011 04:00:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989FD8FC0A; Tue, 8 Nov 2011 04:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA840PjE012111; Tue, 8 Nov 2011 04:00:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA840PMj012100; Tue, 8 Nov 2011 04:00:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111080400.pA840PMj012100@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 04:00: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: r227331 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 04:00:25 -0000 Author: adrian Date: Tue Nov 8 04:00:24 2011 New Revision: 227331 URL: http://svn.freebsd.org/changeset/base/227331 Log: Add 802.11h quiet time element support into net80211. This supports both station and hostap modes: * Station mode quiet time element support listens to quiet time IE's and modifies the local quiet time configuration as appropriate; * Hostap mode both obeys the locally configured quiet time period and includes it in beacon frames so stations also can obey as needed. Submitted by: Himali Patel Sponsored by: Sibridge Technologies Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_dfs.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_scan.h head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211.h Tue Nov 8 04:00:24 2011 (r227331) @@ -759,6 +759,18 @@ struct ieee80211_country_ie { /* * 802.11h Channel Switch Announcement (CSA). */ +struct ieee80211_quiet_ie { + uint8_t quiet_ie; /* IEEE80211_ELEMID_QUIET */ + uint8_t len; + uint8_t tbttcount; /* quiet start */ + uint8_t period; /* beacon intervals between quiets */ + uint16_t duration; /* TUs of each quiet*/ + uint16_t offset; /* TUs of from TBTT of quiet start */ +} __packed; + +/* + * 802.11h Channel Switch Announcement (CSA). + */ struct ieee80211_csa_ie { uint8_t csa_ie; /* IEEE80211_ELEMID_CHANSWITCHANN */ uint8_t csa_len; Modified: head/sys/net80211/ieee80211_dfs.c ============================================================================== --- head/sys/net80211/ieee80211_dfs.c Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_dfs.c Tue Nov 8 04:00:24 2011 (r227331) @@ -64,6 +64,12 @@ SYSCTL_INT(_net_wlan, OID_AUTO, cac_time &ieee80211_cac_timeout, 0, "CAC timeout (secs)"); #define CAC_TIMEOUT msecs_to_ticks(ieee80211_cac_timeout*1000) +static int +null_set_quiet(struct ieee80211_node *ni, u_int8_t *quiet_elm) +{ + return ENOSYS; +} + void ieee80211_dfs_attach(struct ieee80211com *ic) { @@ -71,6 +77,8 @@ ieee80211_dfs_attach(struct ieee80211com callout_init_mtx(&dfs->nol_timer, IEEE80211_LOCK_OBJ(ic), 0); callout_init_mtx(&dfs->cac_timer, IEEE80211_LOCK_OBJ(ic), 0); + + ic->ic_set_quiet = null_set_quiet; } void Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_input.c Tue Nov 8 04:00:24 2011 (r227331) @@ -522,6 +522,9 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_CSA: scan->csa = frm; break; + case IEEE80211_ELEMID_QUIET: + scan->quiet = frm; + break; case IEEE80211_ELEMID_FHPARMS: if (ic->ic_phytype == IEEE80211_T_FH) { scan->fhdwell = LE_READ_2(&frm[2]); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_ioctl.c Tue Nov 8 04:00:24 2011 (r227331) @@ -972,6 +972,21 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_PUREG: ireq->i_val = (vap->iv_flags & IEEE80211_F_PUREG) != 0; break; + case IEEE80211_IOC_QUIET: + ireq->i_val = vap->iv_quiet; + break; + case IEEE80211_IOC_QUIET_COUNT: + ireq->i_val = vap->iv_quiet_count; + break; + case IEEE80211_IOC_QUIET_PERIOD: + ireq->i_val = vap->iv_quiet_period; + break; + case IEEE80211_IOC_QUIET_DUR: + ireq->i_val = vap->iv_quiet_duration; + break; + case IEEE80211_IOC_QUIET_OFFSET: + ireq->i_val = vap->iv_quiet_offset; + break; case IEEE80211_IOC_BGSCAN: ireq->i_val = (vap->iv_flags & IEEE80211_F_BGSCAN) != 0; break; @@ -2939,6 +2954,24 @@ ieee80211_ioctl_set80211(struct ieee8021 if (isvap11g(vap)) error = ENETRESET; break; + case IEEE80211_IOC_QUIET: + vap->iv_quiet= ireq->i_val; + break; + case IEEE80211_IOC_QUIET_COUNT: + vap->iv_quiet_count=ireq->i_val; + break; + case IEEE80211_IOC_QUIET_PERIOD: + vap->iv_quiet_period=ireq->i_val; + break; + case IEEE80211_IOC_QUIET_OFFSET: + vap->iv_quiet_offset=ireq->i_val; + break; + case IEEE80211_IOC_QUIET_DUR: + if(ireq->i_val < vap->iv_bss->ni_intval) + vap->iv_quiet_duration = ireq->i_val; + else + error = EINVAL; + break; case IEEE80211_IOC_BGSCAN: if (ireq->i_val) { if ((vap->iv_caps & IEEE80211_C_BGSCAN) == 0) Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_ioctl.h Tue Nov 8 04:00:24 2011 (r227331) @@ -715,6 +715,11 @@ struct ieee80211req { #define IEEE80211_IOC_TDMA_SLOTLEN 203 /* TDMA: slot length (usecs) */ #define IEEE80211_IOC_TDMA_BINTERVAL 204 /* TDMA: beacon intvl (slots) */ +#define IEEE80211_IOC_QUIET 205 /* Quiet Enable/Disable */ +#define IEEE80211_IOC_QUIET_PERIOD 206 /* Quiet Period */ +#define IEEE80211_IOC_QUIET_OFFSET 207 /* Quiet Offset */ +#define IEEE80211_IOC_QUIET_DUR 208 /* Quiet Duration */ +#define IEEE80211_IOC_QUIET_COUNT 209 /* Quiet Count */ /* * Parameters for controlling a scan requested with * IEEE80211_IOC_SCAN_REQ. Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_output.c Tue Nov 8 04:00:24 2011 (r227331) @@ -1661,6 +1661,33 @@ ieee80211_add_supportedchannels(uint8_t } /* + * Add an 11h Quiet time element to a frame. + */ +static uint8_t * +ieee80211_add_quiet(uint8_t *frm, struct ieee80211vap *vap) +{ + struct ieee80211_quiet_ie *quiet = (struct ieee80211_quiet_ie *) frm; + + quiet->quiet_ie = IEEE80211_ELEMID_QUIET; + quiet->len = 6; + if (vap->iv_quiet_count_value == 1) + vap->iv_quiet_count_value = vap->iv_quiet_count; + else if (vap->iv_quiet_count_value > 1) + vap->iv_quiet_count_value--; + + if (vap->iv_quiet_count_value == 0) { + /* value 0 is reserved as per 802.11h standerd */ + vap->iv_quiet_count_value = 1; + } + + quiet->tbttcount = vap->iv_quiet_count_value; + quiet->period = vap->iv_quiet_period; + quiet->duration = htole16(vap->iv_quiet_duration); + quiet->offset = htole16(vap->iv_quiet_offset); + return frm + sizeof(*quiet); +} + +/* * Add an 11h Channel Switch Announcement element to a frame. * Note that we use the per-vap CSA count to adjust the global * counter so we can use this routine to form probe response @@ -2253,6 +2280,7 @@ ieee80211_alloc_proberesp(struct ieee802 + IEEE80211_COUNTRY_MAX_SIZE + 3 + sizeof(struct ieee80211_csa_ie) + + sizeof(struct ieee80211_quiet_ie) + 3 + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + sizeof(struct ieee80211_ie_wpa) @@ -2319,6 +2347,13 @@ ieee80211_alloc_proberesp(struct ieee802 if (ic->ic_flags & IEEE80211_F_CSAPENDING) frm = ieee80211_add_csa(frm, vap); } + if (vap->iv_flags & IEEE80211_F_DOTH) { + if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && + (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { + if (vap->iv_quiet) + frm = ieee80211_add_quiet(frm, vap); + } + } if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) frm = ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, rs); @@ -2617,9 +2652,20 @@ ieee80211_beacon_construct(struct mbuf * frm = ieee80211_add_powerconstraint(frm, vap); bo->bo_csa = frm; if (ic->ic_flags & IEEE80211_F_CSAPENDING) - frm = ieee80211_add_csa(frm, vap); + frm = ieee80211_add_csa(frm, vap); } else bo->bo_csa = frm; + + if (vap->iv_flags & IEEE80211_F_DOTH) { + bo->bo_quiet = frm; + if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && + (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { + if (vap->iv_quiet) + frm = ieee80211_add_quiet(frm,vap); + } + } else + bo->bo_quiet = frm; + if (IEEE80211_IS_CHAN_ANYG(ni->ni_chan)) { bo->bo_erp = frm; frm = ieee80211_add_erp(frm, ic); @@ -2733,7 +2779,8 @@ ieee80211_beacon_alloc(struct ieee80211_ + 2 + 4 + vap->iv_tim_len /* DTIM/IBSSPARMS */ + IEEE80211_COUNTRY_MAX_SIZE /* country */ + 2 + 1 /* power control */ - + sizeof(struct ieee80211_csa_ie) /* CSA */ + + sizeof(struct ieee80211_csa_ie) /* CSA */ + + sizeof(struct ieee80211_quiet_ie) /* Quiet */ + 2 + 1 /* ERP */ + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + (vap->iv_caps & IEEE80211_C_WPA ? /* WPA 1+2 */ @@ -2953,6 +3000,7 @@ ieee80211_beacon_update(struct ieee80211 bo->bo_appie += adjust; bo->bo_wme += adjust; bo->bo_csa += adjust; + bo->bo_quiet += adjust; bo->bo_tim_len = timlen; /* update information element */ @@ -3006,6 +3054,7 @@ ieee80211_beacon_update(struct ieee80211 #endif bo->bo_appie += sizeof(*csa); bo->bo_csa_trailer_len += sizeof(*csa); + bo->bo_quiet += sizeof(*csa); bo->bo_tim_trailer_len += sizeof(*csa); m->m_len += sizeof(*csa); m->m_pkthdr.len += sizeof(*csa); @@ -3016,6 +3065,11 @@ ieee80211_beacon_update(struct ieee80211 vap->iv_csa_count++; /* NB: don't clear IEEE80211_BEACON_CSA */ } + if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && + (vap->iv_flags_ext & IEEE80211_FEXT_DFS) ){ + if (vap->iv_quiet) + ieee80211_add_quiet(bo->bo_quiet, vap); + } if (isset(bo->bo_flags, IEEE80211_BEACON_ERP)) { /* * ERP element needs updating. Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_proto.h Tue Nov 8 04:00:24 2011 (r227331) @@ -344,6 +344,7 @@ struct ieee80211_beacon_offsets { uint16_t bo_appie_len; /* AppIE length in bytes */ uint16_t bo_csa_trailer_len; uint8_t *bo_csa; /* start of CSA element */ + uint8_t *bo_quiet; /* start of Quiet element */ uint8_t *bo_meshconf; /* start of MESHCONF element */ uint8_t *bo_spare[3]; }; Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_scan.h Tue Nov 8 04:00:24 2011 (r227331) @@ -213,6 +213,7 @@ struct ieee80211_scanparams { uint8_t *ath; uint8_t *tdma; uint8_t *csa; + uint8_t *quiet; uint8_t *meshid; uint8_t *meshconf; uint8_t *spare[3]; Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_sta.c Tue Nov 8 04:00:24 2011 (r227331) @@ -1347,6 +1347,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, scan.htcap, scan.htinfo); /* XXX state changes? */ } + if (scan.quiet) + ic->ic_set_quiet(ni, scan.quiet); if (scan.tim != NULL) { struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) scan.tim; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Nov 8 02:54:08 2011 (r227330) +++ head/sys/net80211/ieee80211_var.h Tue Nov 8 04:00:24 2011 (r227331) @@ -242,6 +242,10 @@ struct ieee80211com { int (*ic_setregdomain)(struct ieee80211com *, struct ieee80211_regdomain *, int, struct ieee80211_channel []); + + int (*ic_set_quiet)(struct ieee80211_node *, + u_int8_t *quiet_elm); + /* send/recv 802.11 management frame */ int (*ic_send_mgmt)(struct ieee80211_node *, int, int); @@ -403,6 +407,12 @@ struct ieee80211vap { uint8_t iv_dtim_period; /* DTIM period */ uint8_t iv_dtim_count; /* DTIM count from last bcn */ /* set/unset aid pwrsav state */ + uint8_t iv_quiet; /* Quiet Element */ + uint8_t iv_quiet_count; /* constant count for Quiet Element */ + uint8_t iv_quiet_count_value; /* variable count for Quiet Element */ + uint8_t iv_quiet_period; /* period for Quiet Element */ + uint16_t iv_quiet_duration; /* duration for Quiet Element */ + uint16_t iv_quiet_offset; /* offset for Quiet Element */ int iv_csa_count; /* count for doing CSA */ struct ieee80211_node *iv_bss; /* information for this node */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 08:29:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BE24106566B; Tue, 8 Nov 2011 08:29:06 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C0C58FC0A; Tue, 8 Nov 2011 08:29:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA88T695021843; Tue, 8 Nov 2011 08:29:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA88T6ZJ021840; Tue, 8 Nov 2011 08:29:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111080829.pA88T6ZJ021840@svn.freebsd.org> From: Kevin Lo Date: Tue, 8 Nov 2011 08: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: r227332 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 08:29:06 -0000 Author: kevlo Date: Tue Nov 8 08:29:05 2011 New Revision: 227332 URL: http://svn.freebsd.org/changeset/base/227332 Log: Enable PCI MMC/SD support by default on i386 and amd64 Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Nov 8 04:00:24 2011 (r227331) +++ head/sys/amd64/conf/GENERIC Tue Nov 8 08:29:05 2011 (r227332) @@ -348,3 +348,8 @@ device snd_hda # Intel High Definition device snd_ich # Intel, NVidia and other ICH AC'97 Audio device snd_uaudio # USB Audio device snd_via8233 # VIA VT8233x Audio + +# MMC/SD +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Nov 8 04:00:24 2011 (r227331) +++ head/sys/i386/conf/GENERIC Tue Nov 8 08:29:05 2011 (r227332) @@ -361,3 +361,8 @@ device snd_hda # Intel High Definition device snd_ich # Intel, NVidia and other ICH AC'97 Audio device snd_uaudio # USB Audio device snd_via8233 # VIA VT8233x Audio + +# MMC/SD +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 10:18:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6556A106566B; Tue, 8 Nov 2011 10:18:08 +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 5314C8FC1C; Tue, 8 Nov 2011 10:18:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8AI8jo027033; Tue, 8 Nov 2011 10:18:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8AI7ha027020; Tue, 8 Nov 2011 10:18:07 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201111081018.pA8AI7ha027020@svn.freebsd.org> From: Attilio Rao Date: Tue, 8 Nov 2011 10:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227333 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/kern sys/mips/conf sys/pc98/conf sys/powerpc/conf sys/sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 10:18:08 -0000 Author: attilio Date: Tue Nov 8 10:18:07 2011 New Revision: 227333 URL: http://svn.freebsd.org/changeset/base/227333 Log: Introduce the option VFS_ALLOW_NONMPSAFE and turn it on by default on all the architectures. The option allows to mount non-MPSAFE filesystem. Without it, the kernel will refuse to mount a non-MPSAFE filesytem. This patch is part of the effort of killing non-MPSAFE filesystems from the tree. No MFC is expected for this patch. Tested by: gianni Reviewed by: kib Modified: head/UPDATING head/sys/amd64/conf/DEFAULTS head/sys/arm/conf/DEFAULTS head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/DEFAULTS head/sys/ia64/conf/DEFAULTS head/sys/kern/vfs_mount.c head/sys/mips/conf/DEFAULTS head/sys/pc98/conf/DEFAULTS head/sys/powerpc/conf/DEFAULTS head/sys/sparc64/conf/DEFAULTS Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Nov 8 08:29:05 2011 (r227332) +++ head/UPDATING Tue Nov 8 10:18:07 2011 (r227333) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20111108: + The option VFS_ALLOW_NONMPSAFE option has been added in order to + explicitely support non-MPSAFE filesystems. + It is on by default for all supported platform at this present + time. + 20111101: The broken amd(4) driver has been replaced with esp(4) in the amd64, i386 and pc98 GENERIC kernel configuration files. Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/amd64/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -22,3 +22,6 @@ options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR options NEW_PCIB + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/arm/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -9,3 +9,5 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR + +options VFS_ALLOW_NONMPSAFE Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/conf/NOTES Tue Nov 8 10:18:07 2011 (r227333) @@ -1104,6 +1104,9 @@ options XFS # unsuitable for inclusion on machines with untrusted local users. options VFS_AIO +# Enable mounting of non-MPSAFE filesystems. +options VFS_ALLOW_NONMPSAFE + # Cryptographically secure random number generator; /dev/random device random Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/conf/options Tue Nov 8 10:18:07 2011 (r227333) @@ -185,6 +185,7 @@ SYSVSHM opt_sysvipc.h SW_WATCHDOG opt_watchdog.h TURNSTILE_PROFILING VFS_AIO +VFS_ALLOW_NONMPSAFE VERBOSE_SYSINIT opt_global.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/i386/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -30,3 +30,6 @@ options NATIVE device atpic options NEW_PCIB + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/ia64/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -20,3 +20,6 @@ options GEOM_PART_GPT options GEOM_PART_MBR options NEW_PCIB + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/kern/vfs_mount.c Tue Nov 8 10:18:07 2011 (r227333) @@ -37,6 +37,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vfs_allow_nonmpsafe.h" + #include #include #include @@ -798,6 +800,14 @@ vfs_domount_first( * get. No freeing of cn_pnbuf. */ error = VFS_MOUNT(mp); +#ifndef VFS_ALLOW_NONMPSAFE + if (error == 0 && VFS_NEEDSGIANT(mp)) { + (void)VFS_UNMOUNT(mp, fsflags); + error = ENXIO; + printf("%s: Mounting non-MPSAFE fs (%s) is disabled\n", + __func__, mp->mnt_vfc->vfc_name); + } +#endif if (error != 0) { vfs_unbusy(mp); vfs_mount_destroy(mp); @@ -807,6 +817,11 @@ vfs_domount_first( vrele(vp); return (error); } +#ifdef VFS_ALLOW_NONMPSAFE + if (VFS_NEEDSGIANT(mp)) + printf("%s: Mounting non-MPSAFE fs (%s) is deprecated\n", + __func__, mp->mnt_vfc->vfc_name); +#endif if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/mips/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -9,3 +9,5 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR + +options VFS_ALLOW_NONMPSAFE Modified: head/sys/pc98/conf/DEFAULTS ============================================================================== --- head/sys/pc98/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/pc98/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -29,3 +29,6 @@ options GEOM_PART_PC98 device atpic options NEW_PCIB + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/powerpc/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -12,3 +12,6 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE Modified: head/sys/sparc64/conf/DEFAULTS ============================================================================== --- head/sys/sparc64/conf/DEFAULTS Tue Nov 8 08:29:05 2011 (r227332) +++ head/sys/sparc64/conf/DEFAULTS Tue Nov 8 10:18:07 2011 (r227333) @@ -21,3 +21,6 @@ options GEOM_PART_VTOC8 options SUNKBD_EMULATE_ATKBD options NEW_PCIB + +# Allow mounting non-MPSAFE filesystems +options VFS_ALLOW_NONMPSAFE From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 10:39:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F2D6106566B; Tue, 8 Nov 2011 10:39:30 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from fallback5.mail.ru (fallback5.mail.ru [94.100.176.59]) by mx1.freebsd.org (Postfix) with ESMTP id 9AEE58FC12; Tue, 8 Nov 2011 10:39:29 +0000 (UTC) Received: from smtp27.mail.ru (smtp27.mail.ru [94.100.176.180]) by fallback5.mail.ru (mPOP.Fallback_MX) with ESMTP id 988C47798D36; Tue, 8 Nov 2011 14:26:47 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=6lYXp5we1VDODw3/hu2UbI+0feJoI46LuixSEKaPwaE=; b=3fr/MDBVaXu9R4wM1nlJB9P2afS7hcTRO2c9YklvAKjKNFGtQf/y8MZPL052UPXoJLq11vjkuvwYFNyV0eTJt3kWOkfOEahoJA4hmokWRQppn3mgymjd1kxBFsiCRSlL; Received: from [93.185.182.46] (port=31118 helo=gpr.nnz-home.ru) by smtp27.mail.ru with asmtp id 1RNitB-00011k-00; Tue, 08 Nov 2011 14:26:45 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.77 (FreeBSD)) (envelope-from ) id 1RNisp-000FoX-Tq; Tue, 08 Nov 2011 14:26:23 +0400 Date: Tue, 8 Nov 2011 14:26:23 +0400 From: Gennady Proskurin To: Marcel Moolenaar Message-ID: <20111108102623.GA60772@gpr.nnz-home.ru> References: <201111071621.pA7GLob4087040@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111071621.pA7GLob4087040@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam: Not detected X-Mras: Ok X-Mras: Ok Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 10:39:30 -0000 TMPFS is not usable without swap, it should have better algorithms to adjust it's size, depending on amount of memory/swap available. # swapoff -a # swapinfo Device 1K-blocks Used Avail Capacity # top Mem: 253M Active, 282M Inact, 933M Wired, 3972K Cache, 135M Buf, 491M Free Swap: # df -h /tmp Filesystem Size Used Avail Capacity Mounted on tmpfs 436k 436k 0B 100% /tmp no free space on /tmp # uname -a FreeBSD gpr.drweb.com 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225446M: Thu Sep 8 17:30:46 MSK 2011 gpr@gpr.drweb.com:/usr/obj/usr/src/freebsd-head/sys/DRW_A amd64 On Mon, Nov 07, 2011 at 04:21:50PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Nov 7 16:21:50 2011 > New Revision: 227310 > URL: http://svn.freebsd.org/changeset/base/227310 > > Log: > Don astbestos garment and remove the warning about TMPFS being experimental > -- highly experimental even. So far the closest to a bug in TMPFS that people > have gotten to relates to how ZFS can take away from the memory that TMPFS > needs. One can argue that such is not a bug in TMPFS. Irrespective, even if > there is a bug here and there in TMPFS, it's not in our own advantage to > scare people away from using TMPFS. I for one have been using it, even with > ZFS, very successfully. > > Modified: > head/sys/fs/tmpfs/tmpfs_vfsops.c > > Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c > ============================================================================== > --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 7 15:43:11 2011 (r227309) > +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Nov 7 16:21:50 2011 (r227310) > @@ -156,9 +156,6 @@ tmpfs_mount(struct mount *mp) > return EOPNOTSUPP; > } > > - printf("WARNING: TMPFS is considered to be a highly experimental " > - "feature in FreeBSD.\n"); > - > vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); > error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); > VOP_UNLOCK(mp->mnt_vnodecovered, 0); > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 10:52:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E0A1065672; Tue, 8 Nov 2011 10:52:46 +0000 (UTC) (envelope-from gleb.kurtsou@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 89F5D8FC15; Tue, 8 Nov 2011 10:52:45 +0000 (UTC) Received: by faar19 with SMTP id r19so523229faa.13 for ; Tue, 08 Nov 2011 02:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=/YWCDJMBloc+w/DPR4PAyZMlDM30vrsRWMw0zVbbc9o=; b=x/d1LgZ0xEgBj+f+mkrhbTfhb9/HiKfyBd+EDW1b9dhIFUj7NHAXokNoBRLQcPgXsc L7BIruFmFVdrevoRetd+8zkCG2aIJDk7wLp8pKLKmGEsURSHuFzfd0mKKKdvL7GNVWM6 a3VrXjURnP8Ozo2JjCfBgaq6MJvMzkg6QAn9A= Received: by 10.223.6.129 with SMTP id 1mr43097015faz.17.1320747758064; Tue, 08 Nov 2011 02:22:38 -0800 (PST) Received: from localhost ([91.187.1.43]) by mx.google.com with ESMTPS id t7sm769352fae.6.2011.11.08.02.22.35 (version=SSLv3 cipher=OTHER); Tue, 08 Nov 2011 02:22:36 -0800 (PST) Date: Tue, 8 Nov 2011 12:21:55 +0200 From: Gleb Kurtsou To: Xin LI Message-ID: <20111108102155.GA1657@reks.ENIGMA> References: <201111071621.pA7GLob4087040@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 10:52:46 -0000 On (07/11/2011 12:01), Xin LI wrote: > On Mon, Nov 7, 2011 at 8:21 AM, Marcel Moolenaar wrote: > > Author: marcel > > Date: Mon Nov  7 16:21:50 2011 > > New Revision: 227310 > > URL: http://svn.freebsd.org/changeset/base/227310 > > > > Log: > >  Don astbestos garment and remove the warning about TMPFS being experimental > >  -- highly experimental even. So far the closest to a bug in TMPFS that people > >  have gotten to relates to how ZFS can take away from the memory that TMPFS > >  needs. One can argue that such is not a bug in TMPFS. Irrespective, even if > >  there is a bug here and there in TMPFS, it's not in our own advantage to > >  scare people away from using TMPFS. I for one have been using it, even with > >  ZFS, very successfully. > > Was the data corruption issue when mixing mmap/sendfile/read/writes > fixed already? I haven't used tmpfs in such complicated environment > in my use (which works well) but I remember some complains about it... Sendfile was fixed quite a while ago. Regarding ZFS+TMPFS, there is a patch floating around changing TMPFS assumptions on free memory. I'm thinking about making it optional, preserving old behaviour if file system size wasn't specified during mount. I'll commit the following fix shortly: https://github.com/glk/freebsd-head/commit/15186db A bug on removing parent directory while holding reference to current one was mentioned at DevSummit. I wasn't able to reproduce it on CURRENT. I might have fixed it already while correcting similar locking issue. And it would be nice to have patch by kib@ removing double caching in head. > > Cheers, > -- > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 11:36:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 868EA1065670; Tue, 8 Nov 2011 11:36:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326C08FC1B; Tue, 8 Nov 2011 11:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8BalMQ029617; Tue, 8 Nov 2011 11:36:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8Balsp029615; Tue, 8 Nov 2011 11:36:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111081136.pA8Balsp029615@svn.freebsd.org> From: Ed Schouten Date: Tue, 8 Nov 2011 11:36: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: r227335 - head/usr.bin/du X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 11:36:47 -0000 Author: ed Date: Tue Nov 8 11:36:46 2011 New Revision: 227335 URL: http://svn.freebsd.org/changeset/base/227335 Log: Simplify getopt switch parsing. Only one of these flags can be set. Just add them together and check the value. Also, get rid of the listall variable. The code is already filled with direct *flag-comparisons. Obtained from: Alexander Best (though modified) Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Tue Nov 8 11:08:40 2011 (r227334) +++ head/usr.bin/du/du.c Tue Nov 8 11:36:46 2011 (r227335) @@ -88,7 +88,6 @@ main(int argc, char *argv[]) off_t savednumber, curblocks; off_t threshold, threshold_sign; int ftsoptions; - int listall; int depth; int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; int hflag, lflag, ch, notused, rval; @@ -229,17 +228,10 @@ main(int argc, char *argv[]) if (!Aflag && (cblocksize % DEV_BSIZE) != 0) cblocksize = howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; - listall = 0; - - if (aflag) { - if (sflag || dflag) - usage(); - listall = 1; - } else if (sflag) { - if (dflag) - usage(); + if (aflag + dflag + sflag > 1) + usage(); + if (sflag) depth = 0; - } if (!*argv) { argv = save; @@ -320,7 +312,7 @@ main(int argc, char *argv[]) howmany(p->fts_statp->st_size, cblocksize) : howmany(p->fts_statp->st_blocks, cblocksize); - if (listall || p->fts_level == 0) { + if (aflag || p->fts_level == 0) { if (hflag) { prthumanval(curblocks); (void)printf("\t%s\n", p->fts_path); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 14:22:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F9EB1065670; Tue, 8 Nov 2011 14:22:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 063C48FC15; Tue, 8 Nov 2011 14:22:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8EMeaU034929; Tue, 8 Nov 2011 14:22:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8EMeIw034927; Tue, 8 Nov 2011 14:22:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081422.pA8EMeIw034927@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 14:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227336 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 14:22:41 -0000 Author: adrian Date: Tue Nov 8 14:22:40 2011 New Revision: 227336 URL: http://svn.freebsd.org/changeset/base/227336 Log: Add quiet time element configuration support to ifconfig. This allows a hostap to specify to a set of stations that they should not transmit for a certain period of time after each beacon interval has expired. This is used when searching for radar pulses or general interference. Submitted by: Himali Patel Sponsored by: Sibridge Technologies Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Nov 8 11:36:46 2011 (r227335) +++ head/sbin/ifconfig/ifieee80211.c Tue Nov 8 14:22:40 2011 (r227336) @@ -1337,6 +1337,36 @@ set80211pureg(const char *val, int d, in } static void +set80211quiet(const char *val, int d, int s, const struct afswtch *rafp) +{ + set80211(s, IEEE80211_IOC_QUIET, d, 0, NULL); +} + +static +DECL_CMD_FUNC(set80211quietperiod, val, d) +{ + set80211(s, IEEE80211_IOC_QUIET_PERIOD, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211quietcount, val, d) +{ + set80211(s, IEEE80211_IOC_QUIET_COUNT, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211quietduration, val, d) +{ + set80211(s, IEEE80211_IOC_QUIET_DUR, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211quietoffset, val, d) +{ + set80211(s, IEEE80211_IOC_QUIET_OFFSET, atoi(val), 0, NULL); +} + +static void set80211bgscan(const char *val, int d, int s, const struct afswtch *rafp) { set80211(s, IEEE80211_IOC_BGSCAN, d, 0, NULL); @@ -5161,6 +5191,12 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD_ARG("bgscanidle", set80211bgscanidle), DEF_CMD_ARG("bgscanintvl", set80211bgscanintvl), DEF_CMD_ARG("scanvalid", set80211scanvalid), + DEF_CMD("quiet", 1, set80211quiet), + DEF_CMD("-quiet", 0, set80211quiet), + DEF_CMD_ARG("quiet_count", set80211quietcount), + DEF_CMD_ARG("quiet_period", set80211quietperiod), + DEF_CMD_ARG("quiet_dur", set80211quietduration), + DEF_CMD_ARG("quiet_offset", set80211quietoffset), DEF_CMD_ARG("roam:rssi", set80211roamrssi), DEF_CMD_ARG("roam:rate", set80211roamrate), DEF_CMD_ARG("mcastrate", set80211mcastrate), From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 14:28:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C061A106564A; Tue, 8 Nov 2011 14:28:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9749D8FC1E; Tue, 8 Nov 2011 14:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8ESXgc035178; Tue, 8 Nov 2011 14:28:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8ESXBK035176; Tue, 8 Nov 2011 14:28:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081428.pA8ESXBK035176@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 14:28: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: r227338 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 14:28:33 -0000 Author: adrian Date: Tue Nov 8 14:28:33 2011 New Revision: 227338 URL: http://svn.freebsd.org/changeset/base/227338 Log: Reject frames in STA mode which are not destined to the local STA address. Some hardware (eg the AR9160 in STA mode) seems to "leak" unicast FROMDS frames which aren't destined to itself. This angers the net80211 stack - the existing code would fail to find an address in the node table and try passing the frame up to each vap BSS. It would then be accepted in the input routine and its contents would update the local crypto and sequence number state. If the sequence number / crypto IV replay counters from the leaked frame were greater than the "real" state, subsequent "real" frames would be rejected due to out of sequence / IV replay conditions. This is also likely helpful if/when multi-STA modes are added to net80211. Sponsored by: Hobnob, Inc. Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Tue Nov 8 14:24:33 2011 (r227337) +++ head/sys/net80211/ieee80211_sta.c Tue Nov 8 14:28:33 2011 (r227338) @@ -584,6 +584,30 @@ sta_input(struct ieee80211_node *ni, str vap->iv_stats.is_rx_wrongbss++; goto out; } + + /* + * Some devices may be in a promiscuous mode + * where they receive frames for multiple station + * addresses. + * + * If we receive a data frame that isn't + * destined to our VAP MAC, drop it. + * + * XXX TODO: This is only enforced when not scanning; + * XXX it assumes a software-driven scan will put the NIC + * XXX into a "no data frames" mode before setting this + * XXX flag. Otherwise it may be possible that we'll still + * XXX process data frames whilst scanning. + */ + if ((! IEEE80211_IS_MULTICAST(wh->i_addr1)) + && (! IEEE80211_ADDR_EQ(wh->i_addr1, IF_LLADDR(ifp)))) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, + bssid, NULL, "not to cur sta: lladdr=%6D, addr1=%6D", + IF_LLADDR(ifp), ":", wh->i_addr1, ":"); + vap->iv_stats.is_rx_wrongbss++; + goto out; + } + IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 14:34:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45F74106564A; Tue, 8 Nov 2011 14:34:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 362A48FC17; Tue, 8 Nov 2011 14:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8EY2Cn035400; Tue, 8 Nov 2011 14:34:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8EY2G5035398; Tue, 8 Nov 2011 14:34:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081434.pA8EY2G5035398@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 14:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227339 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 14:34:02 -0000 Author: adrian Date: Tue Nov 8 14:34:01 2011 New Revision: 227339 URL: http://svn.freebsd.org/changeset/base/227339 Log: .. add missing include from an incorrect merge. Sponsored by: Hobnob, Inc. Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Tue Nov 8 14:28:33 2011 (r227338) +++ head/sys/net80211/ieee80211_sta.c Tue Nov 8 14:34:01 2011 (r227339) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 14:46:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30734106566B; Tue, 8 Nov 2011 14:46:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16D198FC19; Tue, 8 Nov 2011 14:46:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8Ek31M035825; Tue, 8 Nov 2011 14:46:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8Ek3EP035822; Tue, 8 Nov 2011 14:46:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081446.pA8Ek3EP035822@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 14:46: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: r227340 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 14:46:04 -0000 Author: adrian Date: Tue Nov 8 14:46:03 2011 New Revision: 227340 URL: http://svn.freebsd.org/changeset/base/227340 Log: Some cosmetic fixes to ath_rate_sample. * Use 64 bit integer types for the sample rate statistics. When TX'ing 11n aggregates, a 32 bit counter will overflow in a few hours due to the high packet throughput. * Create a default label of "" rather than defaulting to "Mb" - that way if a rate hasn't yet been selected, it won't say "-1 Mb". Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Tue Nov 8 14:34:01 2011 (r227339) +++ head/sys/dev/ath/ath_rate/sample/sample.c Tue Nov 8 14:46:03 2011 (r227340) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_inet.h" #include "opt_wlan.h" +#include "opt_ah.h" #include #include @@ -146,6 +147,8 @@ ath_rate_node_cleanup(struct ath_softc * static int dot11rate(const HAL_RATE_TABLE *rt, int rix) { + if (rix < 0) + return -1; return rt->info[rix].phy == IEEE80211_T_HT ? rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2; } @@ -153,6 +156,8 @@ dot11rate(const HAL_RATE_TABLE *rt, int static const char * dot11rate_label(const HAL_RATE_TABLE *rt, int rix) { + if (rix < 0) + return ""; return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb "; } @@ -903,13 +908,14 @@ sample_stats(void *arg, struct ieee80211 for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u %s:%4u] %8d:%-8d (%3d%%) T %8d F %4d avg %5u last %u\n", + printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) T %8ju F %4d avg %5u last %u\n", dot11rate(rt, rix), dot11rate_label(rt, rix), bin_to_size(y), - sn->stats[y][rix].total_packets, - sn->stats[y][rix].packets_acked, - (100*sn->stats[y][rix].packets_acked)/sn->stats[y][rix].total_packets, - sn->stats[y][rix].tries, + (uintmax_t) sn->stats[y][rix].total_packets, + (uintmax_t) sn->stats[y][rix].packets_acked, + (int) ((sn->stats[y][rix].packets_acked * 100ULL) / + sn->stats[y][rix].total_packets), + (uintmax_t) sn->stats[y][rix].tries, sn->stats[y][rix].successive_failures, sn->stats[y][rix].average_tx_time, ticks - sn->stats[y][rix].last_tx); Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Tue Nov 8 14:34:01 2011 (r227339) +++ head/sys/dev/ath/ath_rate/sample/sample.h Tue Nov 8 14:46:03 2011 (r227340) @@ -57,9 +57,9 @@ struct sample_softc { struct rate_stats { unsigned average_tx_time; int successive_failures; - int tries; - int total_packets; - int packets_acked; + uint64_t tries; + uint64_t total_packets; /* pkts total since assoc */ + uint64_t packets_acked; /* pkts acked since assoc */ unsigned perfect_tx_time; /* transmit time for 0 retries */ int last_tx; }; From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 14:47:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDECE106564A; Tue, 8 Nov 2011 14:47:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE72E8FC13; Tue, 8 Nov 2011 14:47:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8ElSfg035905; Tue, 8 Nov 2011 14:47:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8ElSlD035903; Tue, 8 Nov 2011 14:47:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111081447.pA8ElSlD035903@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Nov 2011 14:47: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: r227341 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 14:47:29 -0000 Author: jhb Date: Tue Nov 8 14:47:28 2011 New Revision: 227341 URL: http://svn.freebsd.org/changeset/base/227341 Log: Claim that _POSIX_ADVISORY_INFO is fully supported since posix_fadvise() was added. Submitted by: avilla Discussed with: wollman Modified: head/sys/sys/unistd.h Modified: head/sys/sys/unistd.h ============================================================================== --- head/sys/sys/unistd.h Tue Nov 8 14:46:03 2011 (r227340) +++ head/sys/sys/unistd.h Tue Nov 8 14:47:28 2011 (r227341) @@ -49,7 +49,7 @@ * the POSIX standard; however, if the relevant sysconf() function * returns -1, the functions may be stubbed out. */ -#define _POSIX_ADVISORY_INFO -1 +#define _POSIX_ADVISORY_INFO 200112L #define _POSIX_ASYNCHRONOUS_IO 0 #define _POSIX_CHOWN_RESTRICTED 1 #define _POSIX_CLOCK_SELECTION -1 From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 15:17:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F731106564A; Tue, 8 Nov 2011 15:17:55 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F7728FC12; Tue, 8 Nov 2011 15:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8FHtZO036982; Tue, 8 Nov 2011 15:17:55 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8FHtdF036980; Tue, 8 Nov 2011 15:17:55 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111081517.pA8FHtdF036980@svn.freebsd.org> From: Ryan Stone Date: Tue, 8 Nov 2011 15:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227342 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:17:55 -0000 Author: rstone Date: Tue Nov 8 15:17:54 2011 New Revision: 227342 URL: http://svn.freebsd.org/changeset/base/227342 Log: The in-kernel CTF parser caches the result of its first attempt to parse CTF data from a module. On subsequent attempts to retrieve CTF data for a module, return an error if there no CTF data. This fixes a panic if you try to enable fbt probes on a module with CTF data twice. Submitted by: Paul Ambrose (ambrosehua AT gmail DOT com) MFC after: 3 days Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Tue Nov 8 14:47:28 2011 (r227341) +++ head/sys/kern/kern_ctf.c Tue Nov 8 15:17:54 2011 (r227342) @@ -90,7 +90,7 @@ link_elf_ctf_get(linker_file_t lf, linke * ctfcnt to -1. See below. */ if (ef->ctfcnt < 0) - return (0); + return (EFTYPE); /* Now check if we've already loaded the CTF data.. */ if (ef->ctfcnt > 0) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 15:38:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7CC106564A; Tue, 8 Nov 2011 15:38:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1612C8FC08; Tue, 8 Nov 2011 15:38:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8FcLBC037639; Tue, 8 Nov 2011 15:38:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8FcLUM037635; Tue, 8 Nov 2011 15:38:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111081538.pA8FcLUM037635@svn.freebsd.org> From: Ed Schouten Date: Tue, 8 Nov 2011 15:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227343 - in head/sys: kern sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:38:22 -0000 Author: ed Date: Tue Nov 8 15:38:21 2011 New Revision: 227343 URL: http://svn.freebsd.org/changeset/base/227343 Log: Make kobj_methods constant. These structures hold no information that is modified during runtime. By marking this constant, we see approximately 600 symbols become read-only (amd64 GENERIC). While there, also mark the kobj_method structures generated by makeobjops.awk static. They are only referenced by the kobjop_desc structures within the same file. Before: $ ls -l kernel -rwxr-xr-x 1 ed wheel 15937309 Nov 8 16:29 kernel* $ size kernel text data bss dec hex filename 12260854 1358468 2848832 16468154 fb48ba kernel $ nm kernel | fgrep -c ' r ' 8240 After: $ ls -l kernel -rwxr-xr-x 1 ed wheel 15922469 Nov 8 16:25 kernel* $ size kernel text data bss dec hex filename 12302869 1302660 2848704 16454233 fb1259 kernel $ nm kernel | fgrep -c ' r ' 8838 Modified: head/sys/kern/subr_kobj.c head/sys/sys/kobj.h head/sys/tools/makeobjops.awk Modified: head/sys/kern/subr_kobj.c ============================================================================== --- head/sys/kern/subr_kobj.c Tue Nov 8 15:17:54 2011 (r227342) +++ head/sys/kern/subr_kobj.c Tue Nov 8 15:38:21 2011 (r227343) @@ -92,7 +92,7 @@ SYSINIT(kobj, SI_SUB_LOCK, SI_ORDER_ANY, * desc pointer is NULL, it is guaranteed never to match any read * descriptors. */ -static struct kobj_method null_method = { +static const struct kobj_method null_method = { 0, 0, }; Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Tue Nov 8 15:17:54 2011 (r227342) +++ head/sys/sys/kobj.h Tue Nov 8 15:38:21 2011 (r227343) @@ -34,7 +34,7 @@ */ typedef struct kobj *kobj_t; typedef struct kobj_class *kobj_class_t; -typedef struct kobj_method kobj_method_t; +typedef const struct kobj_method kobj_method_t; typedef int (*kobjop_t)(void); typedef struct kobj_ops *kobj_ops_t; typedef struct kobjop_desc *kobjop_desc_t; Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Tue Nov 8 15:17:54 2011 (r227342) +++ head/sys/tools/makeobjops.awk Tue Nov 8 15:38:21 2011 (r227343) @@ -307,7 +307,7 @@ function handle_method (static, doc) line_width, length(prototype))); # Print out the method desc - printc("struct kobj_method " mname "_method_default = {"); + printc("static const struct kobj_method " mname "_method_default = {"); printc("\t&" mname "_desc, (kobjop_t) " default_function); printc("};\n"); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 15:49:46 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DEA106564A; Tue, 8 Nov 2011 15:49:46 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 53FA28FC12; Tue, 8 Nov 2011 15:49:46 +0000 (UTC) Received: from sa-nc-common3-50.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id pA8Fnc3j051828 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 8 Nov 2011 07:49:45 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20111108102623.GA60772@gpr.nnz-home.ru> Date: Tue, 8 Nov 2011 07:49:35 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111071621.pA7GLob4087040@svn.freebsd.org> <20111108102623.GA60772@gpr.nnz-home.ru> To: Gennady Proskurin X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Marcel Moolenaar , src-committers@FreeBSD.org Subject: Re: svn commit: r227310 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 15:49:46 -0000 On Nov 8, 2011, at 2:26 AM, Gennady Proskurin wrote: > TMPFS is not usable without swap, it should have better algorithms to = adjust > it's size, depending on amount of memory/swap available. >=20 > # swapoff -a > # swapinfo=20 > Device 1K-blocks Used Avail Capacity >=20 > # top > Mem: 253M Active, 282M Inact, 933M Wired, 3972K Cache, 135M Buf, 491M = Free > Swap:=20 >=20 > # df -h /tmp > Filesystem Size Used Avail Capacity Mounted on > tmpfs 436k 436k 0B 100% /tmp >=20 > no free space on /tmp >=20 > # uname -a > FreeBSD gpr.drweb.com 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225446M: Thu Sep = 8 17:30:46 MSK 2011 = gpr@gpr.drweb.com:/usr/obj/usr/src/freebsd-head/sys/DRW_A amd64 Thanks, for the report. Can you file a PR so that we can track this. Thanks! --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 17:08:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A4C106566B; Tue, 8 Nov 2011 17:08:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C67EE8FC14; Tue, 8 Nov 2011 17:08:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8H8CTB040537; Tue, 8 Nov 2011 17:08:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8H8CnM040532; Tue, 8 Nov 2011 17:08:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081708.pA8H8CnM040532@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 17:08: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: r227344 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 17:08:13 -0000 Author: adrian Date: Tue Nov 8 17:08:12 2011 New Revision: 227344 URL: http://svn.freebsd.org/changeset/base/227344 Log: Migrate the STAILQ lists to TAILQs. A bunch of the 11n TX aggregation logic wants to traverse lists of buffers in various ways. In order to provide O(1) behaviour in this instance, use TAILQs. This does blow out the memory footprint and CPU cycles slightly for some of these operations. I may convert some of these back to STAILQs once the rest of the software transmit queue handling has been stabilised. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 15:38:21 2011 (r227343) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 17:08:12 2011 (r227344) @@ -263,7 +263,7 @@ static int ath_bstuck_threshold = 4; /* SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); -static MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); +MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ @@ -952,7 +952,7 @@ ath_vap_create(struct ieee80211com *ic, /* * Check that a beacon buffer is available; the code below assumes it. */ - if (needbeacon & STAILQ_EMPTY(&sc->sc_bbuf)) { + if (needbeacon & TAILQ_EMPTY(&sc->sc_bbuf)) { device_printf(sc->sc_dev, "no beacon buffer available\n"); goto bad; } @@ -1014,8 +1014,8 @@ ath_vap_create(struct ieee80211com *ic, * multicast frames. We know a beacon buffer is * available because we checked above. */ - avp->av_bcbuf = STAILQ_FIRST(&sc->sc_bbuf); - STAILQ_REMOVE_HEAD(&sc->sc_bbuf, bf_list); + avp->av_bcbuf = TAILQ_FIRST(&sc->sc_bbuf); + TAILQ_REMOVE(&sc->sc_bbuf, avp->av_bcbuf, bf_list); if (opmode != IEEE80211_M_IBSS || !sc->sc_hasveol) { /* * Assign the vap to a beacon xmit slot. As above @@ -1796,14 +1796,14 @@ _ath_getbuf_locked(struct ath_softc *sc) ATH_TXBUF_LOCK_ASSERT(sc); - bf = STAILQ_FIRST(&sc->sc_txbuf); + bf = TAILQ_FIRST(&sc->sc_txbuf); if (bf != NULL && (bf->bf_flags & ATH_BUF_BUSY) == 0) - STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); + TAILQ_REMOVE(&sc->sc_txbuf, bf, bf_list); else bf = NULL; if (bf == NULL) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %s\n", __func__, - STAILQ_FIRST(&sc->sc_txbuf) == NULL ? + TAILQ_FIRST(&sc->sc_txbuf) == NULL ? "out of xmit buffers" : "xmit buffer busy"); } return bf; @@ -1849,7 +1849,7 @@ ath_start(struct ifnet *ifp) IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); break; } @@ -1860,7 +1860,7 @@ ath_start(struct ifnet *ifp) * buffers to send all the fragments so all * go out or none... */ - STAILQ_INIT(&frags); + TAILQ_INIT(&frags); if ((m->m_flags & M_FRAG) && !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, @@ -1892,7 +1892,7 @@ ath_start(struct ifnet *ifp) bf->bf_m = NULL; bf->bf_node = NULL; ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ath_txfrag_cleanup(sc, &frags, ni); ATH_TXBUF_UNLOCK(sc); if (ni != NULL) @@ -1913,9 +1913,9 @@ ath_start(struct ifnet *ifp) goto reclaim; } m = next; - bf = STAILQ_FIRST(&frags); + bf = TAILQ_FIRST(&frags); KASSERT(bf != NULL, ("no buf for txfrag")); - STAILQ_REMOVE_HEAD(&frags, bf_list); + TAILQ_REMOVE(&frags, bf, bf_list); goto nextfrag; } @@ -2414,7 +2414,7 @@ ath_beacon_update(struct ieee80211vap *v static void ath_txqmove(struct ath_txq *dst, struct ath_txq *src) { - STAILQ_CONCAT(&dst->axq_q, &src->axq_q); + TAILQ_CONCAT(&dst->axq_q, &src->axq_q, bf_list); dst->axq_link = src->axq_link; src->axq_link = NULL; dst->axq_depth += src->axq_depth; @@ -2609,7 +2609,7 @@ ath_beacon_generate(struct ath_softc *sc * Move frames from the s/w mcast q to the h/w cab q. * XXX MORE_DATA bit */ - bfm = STAILQ_FIRST(&avp->av_mcastq.axq_q); + bfm = TAILQ_FIRST(&avp->av_mcastq.axq_q); if (cabq->axq_link != NULL) { *cabq->axq_link = bfm->bf_daddr; } else @@ -2620,7 +2620,7 @@ ath_beacon_generate(struct ath_softc *sc sc->sc_stats.ast_cabq_xmit += nmcastq; } /* NB: gated by beacon so safe to start here */ - if (! STAILQ_EMPTY(&(cabq->axq_q))) + if (! TAILQ_EMPTY(&(cabq->axq_q))) ath_hal_txstart(ah, cabq->axq_qnum); ATH_TXQ_UNLOCK(&avp->av_mcastq); ATH_TXQ_UNLOCK(cabq); @@ -2699,7 +2699,7 @@ ath_beacon_return(struct ath_softc *sc, ieee80211_free_node(bf->bf_node); bf->bf_node = NULL; } - STAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); } /* @@ -2710,7 +2710,7 @@ ath_beacon_free(struct ath_softc *sc) { struct ath_buf *bf; - STAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { + TAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { if (bf->bf_m != NULL) { bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); m_freem(bf->bf_m); @@ -3029,7 +3029,7 @@ ath_descdma_setup(struct ath_softc *sc, } dd->dd_bufptr = bf; - STAILQ_INIT(head); + TAILQ_INIT(head); for (i = 0; i < nbuf; i++, bf++, ds += (ndesc * desc_len)) { bf->bf_desc = (struct ath_desc *) ds; bf->bf_daddr = DS2PHYS(dd, ds); @@ -3055,7 +3055,7 @@ ath_descdma_setup(struct ath_softc *sc, ath_descdma_cleanup(sc, dd, head); return error; } - STAILQ_INSERT_TAIL(head, bf, bf_list); + TAILQ_INSERT_TAIL(head, bf, bf_list); } return 0; fail3: @@ -3084,7 +3084,7 @@ ath_descdma_cleanup(struct ath_softc *sc bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); - STAILQ_FOREACH(bf, head, bf_list) { + TAILQ_FOREACH(bf, head, bf_list) { if (bf->bf_m) { m_freem(bf->bf_m); bf->bf_m = NULL; @@ -3103,7 +3103,7 @@ ath_descdma_cleanup(struct ath_softc *sc } } - STAILQ_INIT(head); + TAILQ_INIT(head); free(dd->dd_bufptr, M_ATHDEV); memset(dd, 0, sizeof(*dd)); } @@ -3485,7 +3485,7 @@ ath_rx_proc(void *arg, int npending) sc->sc_stats.ast_rx_noise = nf; tsf = ath_hal_gettsf64(ah); do { - bf = STAILQ_FIRST(&sc->sc_rxbuf); + bf = TAILQ_FIRST(&sc->sc_rxbuf); if (sc->sc_rxslink && bf == NULL) { /* NB: shouldn't happen */ if_printf(ifp, "%s: no buffer!\n", __func__); break; @@ -3505,7 +3505,7 @@ ath_rx_proc(void *arg, int npending) */ /* XXX make debug msg */ if_printf(ifp, "%s: no mbuf!\n", __func__); - STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); + TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); goto rx_next; } ds = bf->bf_desc; @@ -3535,7 +3535,8 @@ ath_rx_proc(void *arg, int npending) #endif if (status == HAL_EINPROGRESS) break; - STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); + + TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); /* These aren't specifically errors */ if (rs->rs_flags & HAL_RX_GI) @@ -3804,7 +3805,7 @@ rx_accept: ath_led_event(sc, 0); } rx_next: - STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); } while (ath_rxbuf_init(sc, bf) == 0); /* rx signal state monitoring */ @@ -3853,7 +3854,9 @@ ath_txq_init(struct ath_softc *sc, struc txq->axq_depth = 0; txq->axq_intrcnt = 0; txq->axq_link = NULL; - STAILQ_INIT(&txq->axq_q); + txq->axq_softc = sc; + TAILQ_INIT(&txq->axq_q); + TAILQ_INIT(&txq->axq_tidq); ATH_TXQ_LOCK_INIT(sc, txq); } @@ -4088,7 +4091,7 @@ ath_tx_processq(struct ath_softc *sc, st for (;;) { ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ - bf = STAILQ_FIRST(&txq->axq_q); + bf = TAILQ_FIRST(&txq->axq_q); if (bf == NULL) { ATH_TXQ_UNLOCK(txq); break; @@ -4106,7 +4109,7 @@ ath_tx_processq(struct ath_softc *sc, st ATH_TXQ_UNLOCK(txq); break; } - ATH_TXQ_REMOVE_HEAD(txq, bf_list); + ATH_TXQ_REMOVE(txq, bf, bf_list); #ifdef IEEE80211_SUPPORT_TDMA if (txq->axq_depth > 0) { /* @@ -4199,10 +4202,10 @@ ath_tx_processq(struct ath_softc *sc, st bf->bf_node = NULL; ATH_TXBUF_LOCK(sc); - last = STAILQ_LAST(&sc->sc_txbuf, ath_buf, bf_list); + last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); if (last != NULL) last->bf_flags &= ~ATH_BUF_BUSY; - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); } #ifdef IEEE80211_SUPPORT_SUPERG @@ -4327,19 +4330,19 @@ ath_tx_draintxq(struct ath_softc *sc, st * we do not need to block ath_tx_proc */ ATH_TXBUF_LOCK(sc); - bf = STAILQ_LAST(&sc->sc_txbuf, ath_buf, bf_list); + bf = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); if (bf != NULL) bf->bf_flags &= ~ATH_BUF_BUSY; ATH_TXBUF_UNLOCK(sc); for (ix = 0;; ix++) { ATH_TXQ_LOCK(txq); - bf = STAILQ_FIRST(&txq->axq_q); + bf = TAILQ_FIRST(&txq->axq_q); if (bf == NULL) { txq->axq_link = NULL; ATH_TXQ_UNLOCK(txq); break; } - ATH_TXQ_REMOVE_HEAD(txq, bf_list); + ATH_TXQ_REMOVE(txq, bf, bf_list); ATH_TXQ_UNLOCK(txq); #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { @@ -4368,7 +4371,7 @@ ath_tx_draintxq(struct ath_softc *sc, st bf->bf_flags &= ~ATH_BUF_BUSY; ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); } } @@ -4412,7 +4415,7 @@ ath_draintxq(struct ath_softc *sc) ath_tx_draintxq(sc, &sc->sc_txq[i]); #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { - struct ath_buf *bf = STAILQ_FIRST(&sc->sc_bbuf); + struct ath_buf *bf = TAILQ_FIRST(&sc->sc_bbuf); if (bf != NULL && bf->bf_m != NULL) { ath_printtxbuf(sc, bf, sc->sc_bhalq, 0, ath_hal_txprocdesc(ah, bf->bf_desc, @@ -4450,7 +4453,7 @@ ath_stoprecv(struct ath_softc *sc) printf("%s: rx queue %p, link %p\n", __func__, (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink); ix = 0; - STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { + TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { struct ath_desc *ds = bf->bf_desc; struct ath_rx_status *rs = &bf->bf_status.ds_rxstat; HAL_STATUS status = ath_hal_rxprocdesc(ah, ds, @@ -4480,7 +4483,7 @@ ath_startrecv(struct ath_softc *sc) sc->sc_rxlink = NULL; sc->sc_rxpending = NULL; - STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { + TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { int error = ath_rxbuf_init(sc, bf); if (error != 0) { DPRINTF(sc, ATH_DEBUG_RECV, @@ -4490,7 +4493,7 @@ ath_startrecv(struct ath_softc *sc) } } - bf = STAILQ_FIRST(&sc->sc_rxbuf); + bf = TAILQ_FIRST(&sc->sc_rxbuf); ath_hal_putrxbuf(ah, bf->bf_daddr); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 15:38:21 2011 (r227343) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 17:08:12 2011 (r227344) @@ -346,7 +346,7 @@ ath_sysctl_txagg(SYSCTL_HANDLER_ARGS) i = t = 0; ATH_TXBUF_LOCK(sc); - STAILQ_FOREACH(bf, &sc->sc_txbuf, bf_list) { + TAILQ_FOREACH(bf, &sc->sc_txbuf, bf_list) { if (bf->bf_flags & ATH_BUF_BUSY) { printf("Busy: %d\n", t); i++; Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Nov 8 15:38:21 2011 (r227343) +++ head/sys/dev/ath/if_ath_tx.c Tue Nov 8 17:08:12 2011 (r227344) @@ -116,10 +116,10 @@ ath_txfrag_cleanup(struct ath_softc *sc, ATH_TXBUF_LOCK_ASSERT(sc); - STAILQ_FOREACH_SAFE(bf, frags, bf_list, next) { + TAILQ_FOREACH_SAFE(bf, frags, bf_list, next) { /* NB: bf assumed clean */ - STAILQ_REMOVE_HEAD(frags, bf_list); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + TAILQ_REMOVE(frags, bf, bf_list); + TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ieee80211_node_decref(ni); } } @@ -144,11 +144,11 @@ ath_txfrag_setup(struct ath_softc *sc, a break; } ieee80211_node_incref(ni); - STAILQ_INSERT_TAIL(frags, bf, bf_list); + TAILQ_INSERT_TAIL(frags, bf, bf_list); } ATH_TXBUF_UNLOCK(sc); - return !STAILQ_EMPTY(frags); + return !TAILQ_EMPTY(frags); } /* @@ -323,7 +323,7 @@ ath_tx_handoff(struct ath_softc *sc, str * is/was empty. */ ath_hal_puttxbuf(ah, txq->axq_qnum, - STAILQ_FIRST(&txq->axq_q)->bf_daddr); + TAILQ_FIRST(&txq->axq_q)->bf_daddr); txq->axq_flags &= ~ATH_TXQ_PUTPENDING; DPRINTF(sc, ATH_DEBUG_TDMA | ATH_DEBUG_XMIT, "%s: Q%u restarted\n", __func__, @@ -351,7 +351,7 @@ ath_tx_handoff(struct ath_softc *sc, str ath_hal_txstart(ah, txq->axq_qnum); } else { if (txq->axq_link != NULL) { - struct ath_buf *last = ATH_TXQ_LAST(txq); + struct ath_buf *last = ATH_TXQ_LAST(txq, axq_q_s); struct ieee80211_frame *wh; /* mark previous frame */ @@ -1114,7 +1114,7 @@ ath_raw_xmit(struct ieee80211_node *ni, return 0; bad2: ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); bad: ifp->if_oerrors++; Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Nov 8 15:38:21 2011 (r227343) +++ head/sys/dev/ath/if_athvar.h Tue Nov 8 17:08:12 2011 (r227344) @@ -170,7 +170,7 @@ struct ath_node { #define ATH_RSSI(x) ATH_EP_RND(x, HAL_RSSI_EP_MULTIPLIER) struct ath_buf { - STAILQ_ENTRY(ath_buf) bf_list; + TAILQ_ENTRY(ath_buf) bf_list; struct ath_buf * bf_next; /* next buffer in the aggregate */ int bf_nseg; uint16_t bf_txflags; /* tx descriptor flags */ @@ -239,7 +239,7 @@ struct ath_buf { struct ath_rc_series bfs_rc[ATH_RC_NUM]; /* non-11n TX series */ } bf_state; }; -typedef STAILQ_HEAD(, ath_buf) ath_bufhead; +typedef TAILQ_HEAD(ath_bufhead_s, ath_buf) ath_bufhead; #define ATH_BUF_BUSY 0x00000002 /* (tx) desc owned by h/w */ @@ -277,9 +277,10 @@ struct ath_txq { u_int axq_aggr_depth; /* how many aggregates are queued */ u_int axq_intrcnt; /* interrupt count */ u_int32_t *axq_link; /* link ptr in last TX desc */ - STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */ + TAILQ_HEAD(axq_q_s, ath_buf) axq_q; /* transmit queue */ struct mtx axq_lock; /* lock on q and link */ char axq_name[12]; /* e.g. "ath0_txq4" */ + /* Per-TID traffic queue for software -> hardware TX */ TAILQ_HEAD(axq_t_s,ath_tid) axq_tidq; }; @@ -299,18 +300,20 @@ struct ath_txq { #define ATH_TXQ_LOCK_ASSERT(_tq) mtx_assert(&(_tq)->axq_lock, MA_OWNED) #define ATH_TXQ_IS_LOCKED(_tq) mtx_owned(&(_tq)->axq_lock) +#define ATH_TXQ_INSERT_HEAD(_tq, _elm, _field) do { \ + TAILQ_INSERT_HEAD(&(_tq)->axq_q, (_elm), _field); \ + (_tq)->axq_depth++; \ +} while (0) #define ATH_TXQ_INSERT_TAIL(_tq, _elm, _field) do { \ - STAILQ_INSERT_TAIL(&(_tq)->axq_q, (_elm), _field); \ + TAILQ_INSERT_TAIL(&(_tq)->axq_q, (_elm), _field); \ (_tq)->axq_depth++; \ } while (0) -#define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \ - STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \ +#define ATH_TXQ_REMOVE(_tq, _elm, _field) do { \ + TAILQ_REMOVE(&(_tq)->axq_q, _elm, _field); \ (_tq)->axq_depth--; \ } while (0) /* NB: this does not do the "head empty check" that STAILQ_LAST does */ -#define ATH_TXQ_LAST(_tq) \ - ((struct ath_buf *)(void *) \ - ((char *)((_tq)->axq_q.stqh_last) - __offsetof(struct ath_buf, bf_list))) +#define ATH_TXQ_LAST(_tq, _field) TAILQ_LAST(&(_tq)->axq_q, _field) struct ath_vap { struct ieee80211vap av_vap; /* base class */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 17:23:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D29D106564A; Tue, 8 Nov 2011 17:23:44 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEC08FC0A; Tue, 8 Nov 2011 17:23:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8HNiLQ041061; Tue, 8 Nov 2011 17:23:44 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8HNiRc041057; Tue, 8 Nov 2011 17:23:44 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201111081723.pA8HNiRc041057@svn.freebsd.org> From: Olivier Houchard Date: Tue, 8 Nov 2011 17:23: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: r227345 - in head/tools/tools/netrate: netblast netreceive netsend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 17:23:44 -0000 Author: cognet Date: Tue Nov 8 17:23:43 2011 New Revision: 227345 URL: http://svn.freebsd.org/changeset/base/227345 Log: Add IPv6 support to netblast/netsend/netreceive PR: bin/161368 Submitted by: Olivier Cochard-Labbe Modified: head/tools/tools/netrate/netblast/netblast.c head/tools/tools/netrate/netreceive/netreceive.c head/tools/tools/netrate/netsend/netsend.c Modified: head/tools/tools/netrate/netblast/netblast.c ============================================================================== --- head/tools/tools/netrate/netblast/netblast.c Tue Nov 8 17:08:12 2011 (r227344) +++ head/tools/tools/netrate/netblast/netblast.c Tue Nov 8 17:23:43 2011 (r227345) @@ -32,13 +32,13 @@ #include #include - -#include +#include /* getaddrinfo */ #include #include #include #include +#include /* close */ static void usage(void) @@ -141,26 +141,25 @@ blast_loop(int s, long duration, u_char int main(int argc, char *argv[]) { - long payloadsize, port, duration; - struct sockaddr_in sin; + long payloadsize, duration; + struct addrinfo hints, *res, *res0; char *dummy, *packet; - int s; + int port, s, error; + const char *cause = NULL; if (argc != 5) usage(); - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - if (inet_aton(argv[1], &sin.sin_addr) == 0) { - perror(argv[1]); - return (-1); - } + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; port = strtoul(argv[2], &dummy, 10); - if (port < 1 || port > 65535 || *dummy != '\0') + if (port < 1 || port > 65535 || *dummy != '\0') { + fprintf(stderr, "Invalid port number: %s\n", argv[2]); usage(); - sin.sin_port = htons(port); + /*NOTREACHED*/ + } payloadsize = strtoul(argv[3], &dummy, 10); if (payloadsize < 0 || *dummy != '\0') @@ -168,29 +167,55 @@ main(int argc, char *argv[]) if (payloadsize > 32768) { fprintf(stderr, "payloadsize > 32768\n"); return (-1); + /*NOTREACHED*/ } duration = strtoul(argv[4], &dummy, 10); - if (duration < 0 || *dummy != '\0') + if (duration < 0 || *dummy != '\0') { + fprintf(stderr, "Invalid duration time: %s\n", argv[4]); usage(); + /*NOTREACHED*/ + } packet = malloc(payloadsize); if (packet == NULL) { perror("malloc"); return (-1); + /*NOTREACHED*/ } + bzero(packet, payloadsize); + error = getaddrinfo(argv[1],argv[2], &hints, &res0); + if (error) { + perror(gai_strerror(error)); + return (-1); + /*NOTREACHED*/ + } + s = -1; + for (res = res0; res; res = res->ai_next) { + s = socket(res->ai_family, res->ai_socktype, 0); + if (s < 0) { + cause = "socket"; + continue; + } - s = socket(PF_INET, SOCK_DGRAM, 0); - if (s == -1) { - perror("socket"); - return (-1); - } + if (connect(s, res->ai_addr, res->ai_addrlen) < 0) { + cause = "connect"; + close(s); + s = -1; + continue; + } - if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("connect"); + break; /* okay we got one */ + } + if (s < 0) { + perror(cause); return (-1); + /*NOTREACHED*/ } + freeaddrinfo(res0); + return (blast_loop(s, duration, packet, payloadsize)); + } Modified: head/tools/tools/netrate/netreceive/netreceive.c ============================================================================== --- head/tools/tools/netrate/netreceive/netreceive.c Tue Nov 8 17:08:12 2011 (r227344) +++ head/tools/tools/netrate/netreceive/netreceive.c Tue Nov 8 17:23:43 2011 (r227345) @@ -29,14 +29,19 @@ #include #include #include +#include #include +#include /* getaddrinfo */ #include #include #include #include +#include /* close */ + +#define MAXSOCK 20 static void usage(void) @@ -49,23 +54,26 @@ usage(void) int main(int argc, char *argv[]) { - struct sockaddr_in sin; + struct addrinfo hints, *res, *res0; char *dummy, *packet; - long port; - int s, v; + int port; + int error, v, i; + const char *cause = NULL; + int s[MAXSOCK]; + struct pollfd fds[MAXSOCK]; + int nsock; if (argc != 2) usage(); - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = AI_PASSIVE; port = strtoul(argv[1], &dummy, 10); if (port < 1 || port > 65535 || *dummy != '\0') usage(); - sin.sin_port = htons(port); packet = malloc(65536); if (packet == NULL) { @@ -74,27 +82,60 @@ main(int argc, char *argv[]) } bzero(packet, 65536); - s = socket(PF_INET, SOCK_DGRAM, 0); - if (s == -1) { - perror("socket"); + error = getaddrinfo(NULL, argv[1], &hints, &res0); + if (error) { + perror(gai_strerror(error)); return (-1); + /*NOTREACHED*/ } - v = 128 * 1024; - if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &v, sizeof(v)) < 0) { - perror("SO_RCVBUF"); - return (-1); - } + nsock = 0; + for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) { + s[nsock] = socket(res->ai_family, res->ai_socktype, + res->ai_protocol); + if (s[nsock] < 0) { + cause = "socket"; + continue; + } + + v = 128 * 1024; + if (setsockopt(s[nsock], SOL_SOCKET, SO_RCVBUF, &v, sizeof(v)) < 0) { + cause = "SO_RCVBUF"; + close(s[nsock]); + continue; + } + if (bind(s[nsock], res->ai_addr, res->ai_addrlen) < 0) { + cause = "bind"; + close(s[nsock]); + continue; + } + (void) listen(s[nsock], 5); + fds[nsock].fd = s[nsock]; + fds[nsock].events = POLLIN; - if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - perror("bind"); + nsock++; + } + if (nsock == 0) { + perror(cause); return (-1); + /*NOTREACHED*/ } printf("netreceive listening on UDP port %d\n", (u_short)port); while (1) { - if (recv(s, packet, 65536, 0) < 0) - perror("recv"); + if (poll(fds, nsock, -1) < 0) + perror("poll"); + for (i = 0; i > nsock; i++) { + if (fds[i].revents & POLLIN) { + if (recv(s[i], packet, 65536, 0) < 0) + perror("recv"); + } + if ((fds[i].revents &~ POLLIN) != 0) + perror("poll"); + } } + + /*NOTREACHED*/ + freeaddrinfo(res0); } Modified: head/tools/tools/netrate/netsend/netsend.c ============================================================================== --- head/tools/tools/netrate/netsend/netsend.c Tue Nov 8 17:08:12 2011 (r227344) +++ head/tools/tools/netrate/netsend/netsend.c Tue Nov 8 17:23:43 2011 (r227345) @@ -29,6 +29,7 @@ #include #include #include +#include /* if_nametoindex() */ #include #include @@ -40,13 +41,17 @@ #include #include +#include + /* program arguments */ struct _a { int s; + int ipv6; struct timespec interval; int port, port_max; long duration; struct sockaddr_in sin; + struct sockaddr_in6 sin6; int packet_len; void *packet; }; @@ -179,9 +184,16 @@ timing_loop(struct _a *a) ic = gettimeofday_cycles; cur_port = a->port; if (a->port == a->port_max) { - if (connect(a->s, (struct sockaddr *)&a->sin, sizeof(a->sin))) { - perror("connect"); - return (-1); + if (a->ipv6) { + if (connect(a->s, (struct sockaddr *)&a->sin6, sizeof(a->sin6))) { + perror("connect (ipv6)"); + return (-1); + } + } else { + if (connect(a->s, (struct sockaddr *)&a->sin, sizeof(a->sin))) { + perror("connect (ipv4)"); + return (-1); + } } } while (1) { @@ -215,8 +227,13 @@ timing_loop(struct _a *a) a->sin.sin_port = htons(cur_port++); if (cur_port > a->port_max) cur_port = a->port; + if (a->ipv6) { + ret = sendto(a->s, a->packet, a->packet_len, 0, + (struct sockaddr *)&a->sin6, sizeof(a->sin6)); + } else { ret = sendto(a->s, a->packet, a->packet_len, 0, (struct sockaddr *)&a->sin, sizeof(a->sin)); + } } if (ret < 0) send_errors++; @@ -254,25 +271,48 @@ main(int argc, char *argv[]) long rate, payloadsize, port; char *dummy; struct _a a; /* arguments */ + struct addrinfo hints, *res, *ressave; bzero(&a, sizeof(a)); if (argc != 6) usage(); - a.sin.sin_len = sizeof(a.sin); - a.sin.sin_family = AF_INET; - if (inet_aton(argv[1], &a.sin.sin_addr) == 0) { - perror(argv[1]); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + + if (getaddrinfo(argv[1], NULL, &hints, &res) != 0) { + fprintf(stderr, "Couldn't resolv %s\n", argv[1]); return (-1); } + ressave = res; + while (res) { + if (res->ai_family == AF_INET) { + memcpy(&a.sin, res->ai_addr, res->ai_addrlen); + a.ipv6 = 0; + break; + } else if (res->ai_family == AF_INET6) { + memcpy(&a.sin6, res->ai_addr, res->ai_addrlen); + a.ipv6 = 1; + break; + } + res = res->ai_next; + } + if (!res) { + fprintf(stderr, "Couldn't resolv %s\n", argv[1]); + exit(1); + } + freeaddrinfo(ressave); port = strtoul(argv[2], &dummy, 10); if (port < 1 || port > 65535) usage(); if (*dummy != '\0' && *dummy != '-') usage(); - a.sin.sin_port = htons(port); + if (a.ipv6) + a.sin6.sin6_port = htons(port); + else + a.sin.sin_port = htons(port); a.port = a.port_max = port; if (*dummy == '-') { /* set high port */ port = strtoul(dummy + 1, &dummy, 10); @@ -328,7 +368,10 @@ main(int argc, char *argv[]) "seconds\n", payloadsize, (intmax_t)a.interval.tv_sec, a.interval.tv_nsec, a.duration); - a.s = socket(PF_INET, SOCK_DGRAM, 0); + if (a.ipv6) + a.s = socket(PF_INET6, SOCK_DGRAM, 0); + else + a.s = socket(PF_INET, SOCK_DGRAM, 0); if (a.s == -1) { perror("socket"); return (-1); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:10:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F76106566C; Tue, 8 Nov 2011 18:10:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A328FC14; Tue, 8 Nov 2011 18:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8IA4Qg042494; Tue, 8 Nov 2011 18:10:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IA4ZX042490; Tue, 8 Nov 2011 18:10:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081810.pA8IA4ZX042490@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 18:10: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: r227346 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:10:11 -0000 Author: adrian Date: Tue Nov 8 18:10:04 2011 New Revision: 227346 URL: http://svn.freebsd.org/changeset/base/227346 Log: Merge in some fixes from the if_ath_tx branch. * Close down some of the kickpcu races, where the interrupt handler can and will run concurrently with the taskqueue. * Close down the TXQ active/completed race between the interrupt handler and the concurrently running tx completion taskqueue function. * Add some tx and rx interrupt count tracking, for debugging. * Fix the kickpcu logic in ath_rx_proc() to not simply drain and restart the TX queue - instead, assume the hardware isn't (too) confused and just restart RX DMA. This may break on previous chipsets, so if it does I'll add a HAL flag and conditionally handle this (ie, for broken chipsets, I'll just restore the "stop PCU / flush things / restart PCU" logic.) * Misc stuff Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 17:23:43 2011 (r227345) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 18:10:04 2011 (r227346) @@ -1304,6 +1304,7 @@ ath_intr(void *arg) struct ifnet *ifp = sc->sc_ifp; struct ath_hal *ah = sc->sc_ah; HAL_INT status = 0; + uint32_t txqs; if (sc->sc_invalid) { /* @@ -1377,7 +1378,7 @@ ath_intr(void *arg) } } if (status & HAL_INT_RXEOL) { - int imask = sc->sc_imask; + int imask; /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1393,26 +1394,55 @@ ath_intr(void *arg) * by a call to ath_reset() somehow, the * interrupt mask will be correctly reprogrammed. */ + ATH_LOCK(sc); + imask = sc->sc_imask; imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); ath_hal_intrset(ah, imask); /* + * Only blank sc_rxlink if we've not yet kicked + * the PCU. + * + * This isn't entirely correct - the correct solution + * would be to have a PCU lock and engage that for + * the duration of the PCU fiddling; which would include + * running the RX process. Otherwise we could end up + * messing up the RX descriptor chain and making the + * RX desc list much shorter. + */ + if (! sc->sc_kickpcu) + sc->sc_rxlink = NULL; + sc->sc_kickpcu = 1; + ATH_UNLOCK(sc); + /* * Enqueue an RX proc, to handled whatever * is in the RX queue. * This will then kick the PCU. */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); - sc->sc_rxlink = NULL; - sc->sc_kickpcu = 1; } if (status & HAL_INT_TXURN) { sc->sc_stats.ast_txurn++; /* bump tx trigger level */ ath_hal_updatetxtriglevel(ah, AH_TRUE); } - if (status & HAL_INT_RX) + if (status & HAL_INT_RX) { + sc->sc_stats.ast_rx_intr++; taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); - if (status & HAL_INT_TX) + } + if (status & HAL_INT_TX) { + sc->sc_stats.ast_tx_intr++; + /* + * Grab all the currently set bits in the HAL txq bitmap + * and blank them. This is the only place we should be + * doing this. + */ + ATH_LOCK(sc); + txqs = 0xffffffff; + ath_hal_gettxintrtxqs(sc->sc_ah, &txqs); + sc->sc_txq_active |= txqs; + ATH_UNLOCK(sc); taskqueue_enqueue(sc->sc_tq, &sc->sc_txtask); + } if (status & HAL_INT_BMISS) { sc->sc_stats.ast_bmiss++; taskqueue_enqueue(sc->sc_tq, &sc->sc_bmisstask); @@ -1433,7 +1463,16 @@ ath_intr(void *arg) * clear whatever condition caused the interrupt. */ ath_hal_mibevent(ah, &sc->sc_halstats); - ath_hal_intrset(ah, sc->sc_imask); + /* + * Don't reset the interrupt if we've just + * kicked the PCU, or we may get a nested + * RXEOL before the rxproc has had a chance + * to run. + */ + ATH_LOCK(sc); + if (sc->sc_kickpcu == 0) + ath_hal_intrset(ah, sc->sc_imask); + ATH_UNLOCK(sc); } if (status & HAL_INT_RXORN) { /* NB: hal marks HAL_INT_FATAL when RXORN is fatal */ @@ -1609,6 +1648,13 @@ ath_init(void *arg) sc->sc_beacons = 0; /* + * Initial aggregation settings. + */ + sc->sc_hwq_limit = ATH_AGGR_MIN_QDEPTH; + sc->sc_tid_hwq_lo = ATH_AGGR_SCHED_LOW; + sc->sc_tid_hwq_hi = ATH_AGGR_SCHED_HIGH; + + /* * Setup the hardware after reset: the key cache * is filled as needed and the receive engine is * set going. Frame transmit is handled entirely @@ -3478,6 +3524,7 @@ ath_rx_proc(void *arg, int npending) HAL_STATUS status; int16_t nf; u_int64_t tsf; + int npkts = 0; DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); ngood = 0; @@ -3537,6 +3584,7 @@ ath_rx_proc(void *arg, int npending) break; TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); + npkts++; /* These aren't specifically errors */ if (rs->rs_flags & HAL_RX_GI) @@ -3823,17 +3871,20 @@ rx_next: * been an RXEOL condition. */ if (sc->sc_kickpcu) { - sc->sc_kickpcu = 0; - ath_stoprecv(sc); - sc->sc_imask |= (HAL_INT_RXEOL | HAL_INT_RXORN); - if (ath_startrecv(sc) != 0) { - if_printf(ifp, - "%s: couldn't restart RX after RXEOL; resetting\n", - __func__); - ath_reset(ifp); - return; - } + device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", + __func__, npkts); + + /* XXX rxslink? */ + bf = TAILQ_FIRST(&sc->sc_rxbuf); + ath_hal_putrxbuf(ah, bf->bf_daddr); + ath_hal_rxena(ah); /* enable recv descriptors */ + ath_mode_init(sc); /* set filters, etc. */ + ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ + + ATH_LOCK(sc); ath_hal_intrset(ah, sc->sc_imask); + sc->sc_kickpcu = 0; + ATH_UNLOCK(sc); } if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { @@ -4218,13 +4269,7 @@ ath_tx_processq(struct ath_softc *sc, st return nacked; } -static __inline int -txqactive(struct ath_hal *ah, int qnum) -{ - u_int32_t txqs = 1<sc_ifp; + uint32_t txqs; - if (txqactive(sc->sc_ah, 0) && ath_tx_processq(sc, &sc->sc_txq[0])) + ATH_LOCK(sc); + txqs = sc->sc_txq_active; + sc->sc_txq_active &= ~txqs; + ATH_UNLOCK(sc); + + if (TXQACTIVE(txqs, 0) && ath_tx_processq(sc, &sc->sc_txq[0])) + /* XXX why is lastrx updated in tx code? */ sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); - if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum)) + if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) ath_tx_processq(sc, sc->sc_cabq); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; @@ -4259,20 +4311,26 @@ ath_tx_proc_q0123(void *arg, int npendin struct ath_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; int nacked; + uint32_t txqs; + + ATH_LOCK(sc); + txqs = sc->sc_txq_active; + sc->sc_txq_active &= ~txqs; + ATH_UNLOCK(sc); /* * Process each active queue. */ nacked = 0; - if (txqactive(sc->sc_ah, 0)) + if (TXQACTIVE(txqs, 0)) nacked += ath_tx_processq(sc, &sc->sc_txq[0]); - if (txqactive(sc->sc_ah, 1)) + if (TXQACTIVE(txqs, 1)) nacked += ath_tx_processq(sc, &sc->sc_txq[1]); - if (txqactive(sc->sc_ah, 2)) + if (TXQACTIVE(txqs, 2)) nacked += ath_tx_processq(sc, &sc->sc_txq[2]); - if (txqactive(sc->sc_ah, 3)) + if (TXQACTIVE(txqs, 3)) nacked += ath_tx_processq(sc, &sc->sc_txq[3]); - if (txqactive(sc->sc_ah, sc->sc_cabq->axq_qnum)) + if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) ath_tx_processq(sc, sc->sc_cabq); if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); @@ -4295,13 +4353,19 @@ ath_tx_proc(void *arg, int npending) struct ath_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; int i, nacked; + uint32_t txqs; + + ATH_LOCK(sc); + txqs = sc->sc_txq_active; + sc->sc_txq_active &= ~txqs; + ATH_UNLOCK(sc); /* * Process each active queue. */ nacked = 0; for (i = 0; i < HAL_NUM_TX_QUEUES; i++) - if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i)) + if (ATH_TXQ_SETUP(sc, i) && TXQACTIVE(txqs, i)) nacked += ath_tx_processq(sc, &sc->sc_txq[i]); if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Tue Nov 8 17:23:43 2011 (r227345) +++ head/sys/dev/ath/if_ath_tx.h Tue Nov 8 18:10:04 2011 (r227346) @@ -31,6 +31,24 @@ #ifndef __IF_ATH_TX_H__ #define __IF_ATH_TX_H__ +/* + * How 'busy' to try and keep the hardware txq + */ +#define ATH_AGGR_MIN_QDEPTH 2 + +/* + * Watermark for scheduling TIDs in order to maximise aggregation. + * + * If hwq_depth is greater than this, don't schedule the TID + * for packet scheduling - the hardware is already busy servicing + * this TID. + * + * If hwq_depth is less than this, schedule the TID for packet + * scheduling in the completion handler. + */ +#define ATH_AGGR_SCHED_HIGH 4 +#define ATH_AGGR_SCHED_LOW 2 + extern void ath_freetx(struct mbuf *m); extern void ath_txfrag_cleanup(struct ath_softc *sc, ath_bufhead *frags, struct ieee80211_node *ni); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Nov 8 17:23:43 2011 (r227345) +++ head/sys/dev/ath/if_athvar.h Tue Nov 8 18:10:04 2011 (r227346) @@ -312,7 +312,6 @@ struct ath_txq { TAILQ_REMOVE(&(_tq)->axq_q, _elm, _field); \ (_tq)->axq_depth--; \ } while (0) -/* NB: this does not do the "head empty check" that STAILQ_LAST does */ #define ATH_TXQ_LAST(_tq, _field) TAILQ_LAST(&(_tq)->axq_q, _field) struct ath_vap { @@ -397,7 +396,6 @@ struct ath_softc { sc_setcca : 1,/* set/clr CCA with TDMA */ sc_resetcal : 1,/* reset cal state next trip */ sc_rxslink : 1,/* do self-linked final descriptor */ - sc_kickpcu : 1,/* kick PCU RX on next RX proc */ sc_rxtsf32 : 1;/* RX dec TSF is 32 bits */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ @@ -424,7 +422,19 @@ struct ath_softc { u_int sc_fftxqmin; /* min frames before staging */ u_int sc_fftxqmax; /* max frames before drop */ u_int sc_txantenna; /* tx antenna (fixed or auto) */ + HAL_INT sc_imask; /* interrupt mask copy */ + /* + * These are modified in the interrupt handler as well as + * the task queues and other contexts. Thus these must be + * protected by a mutex, or they could clash. + * + * For now, access to these is behind the ATH_LOCK, + * just to save time. + */ + uint32_t sc_txq_active; /* bitmap of active TXQs */ + uint32_t sc_kickpcu; /* whether to kick the PCU */ + u_int sc_keymax; /* size of key cache */ u_int8_t sc_keymap[ATH_KEYBYTES];/* key use bit map */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:23:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD08B106564A; Tue, 8 Nov 2011 18:23:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8238FC15; Tue, 8 Nov 2011 18:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8IN2HC043002; Tue, 8 Nov 2011 18:23:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IN2BG042997; Tue, 8 Nov 2011 18:23:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111081823.pA8IN2BG042997@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Nov 2011 18:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227347 - in head/sys: conf dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:23:03 -0000 Author: yongari Date: Tue Nov 8 18:23:02 2011 New Revision: 227347 URL: http://svn.freebsd.org/changeset/base/227347 Log: Retire 'options TI_PRIVATE_JUMBOS' and replace local jumbo allocator with UMA backed jumbo allocator by default. Previously ti(4) used sf_buf(9) interface for jumbo buffers but it was broken at this moment such that enabling jumbo frame caused instant panic. Due to the nature of sf_buf(9) it heavily relies on VM changes but it seems ti(4) was not received much blessing from VM gurus. I don't understand VM magic and implications used in driver either. Switching to UMA backed jumbo allocator like other network drivers will make jumbo frame work on ti(4). While I'm here, fully allocate all RX buffers. This means ti(4) now uses 512 RX buffer and 1024 mini RX buffers. To use sf_buf(9) interface for jumbo buffers, introduce a new 'options TI_SF_BUF_JUMBO'. If it is proven that sf_buf(9) is better for jumbo buffers, interesting developers can fix the issue in future. ti(4) still needs more bus_dma(9) cleanups and should use separate DMA tag/map for each ring(standard, jumbo, mini, command, event etc) but it should work on all platforms except PAE. Special thanks to Jay[1] who provided complete remote debugging access. Tested by: Jay Borkenhagen braeburn dot org > [1] Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 8 18:10:04 2011 (r227346) +++ head/sys/conf/NOTES Tue Nov 8 18:23:02 2011 (r227347) @@ -2142,11 +2142,11 @@ device malo # Marvell Libertas wireles device mwl # Marvell 88W8363 802.11n wireless NICs. device ral # Ralink Technology RT2500 wireless NICs. -# Use "private" jumbo buffers allocated exclusively for the ti(4) driver. -# This option is incompatible with the TI_JUMBO_HDRSPLIT option below. -#options TI_PRIVATE_JUMBOS +# Use sf_buf(9) interface for jumbo buffers on ti(4) controllers. +#options TI_SF_BUF_JUMBO # Turn on the header splitting option for the ti(4) driver firmware. This # only works for Tigon II chips, and has no effect for Tigon I chips. +# This option requires the TI_SF_BUF_JUMBO option above. options TI_JUMBO_HDRSPLIT # Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Nov 8 18:10:04 2011 (r227346) +++ head/sys/conf/options Tue Nov 8 18:23:02 2011 (r227347) @@ -526,7 +526,7 @@ NGATM_CCATM opt_netgraph.h DRM_DEBUG opt_drm.h ZERO_COPY_SOCKETS opt_zero.h -TI_PRIVATE_JUMBOS opt_ti.h +TI_SF_BUF_JUMBO opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h BCE_JUMBO_HDRSPLIT opt_bce.h Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Tue Nov 8 18:10:04 2011 (r227346) +++ head/sys/dev/ti/if_ti.c Tue Nov 8 18:23:02 2011 (r227347) @@ -112,8 +112,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* #define TI_PRIVATE_JUMBOS */ -#ifndef TI_PRIVATE_JUMBOS +#ifdef TI_SF_BUF_JUMBO #include #include #endif @@ -131,9 +130,9 @@ __FBSDID("$FreeBSD$"); * We can only turn on header splitting if we're using extended receive * BDs. */ -#if defined(TI_JUMBO_HDRSPLIT) && defined(TI_PRIVATE_JUMBOS) -#error "options TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS are mutually exclusive" -#endif /* TI_JUMBO_HDRSPLIT && TI_JUMBO_HDRSPLIT */ +#if defined(TI_JUMBO_HDRSPLIT) && !defined(TI_SF_BUF_JUMBO) +#error "options TI_JUMBO_HDRSPLIT requires TI_SF_BUF_JUMBO" +#endif /* TI_JUMBO_HDRSPLIT && !TI_SF_BUF_JUMBO */ typedef enum { TI_SWAP_HTON, @@ -222,12 +221,8 @@ static void ti_handle_events(struct ti_s static int ti_alloc_dmamaps(struct ti_softc *); static void ti_free_dmamaps(struct ti_softc *); static int ti_alloc_jumbo_mem(struct ti_softc *); -#ifdef TI_PRIVATE_JUMBOS -static void *ti_jalloc(struct ti_softc *); -static void ti_jfree(void *, void *); -#endif /* TI_PRIVATE_JUMBOS */ -static int ti_newbuf_std(struct ti_softc *, int, struct mbuf *); -static int ti_newbuf_mini(struct ti_softc *, int, struct mbuf *); +static int ti_newbuf_std(struct ti_softc *, int); +static int ti_newbuf_mini(struct ti_softc *, int); static int ti_newbuf_jumbo(struct ti_softc *, int, struct mbuf *); static int ti_init_rx_ring_std(struct ti_softc *); static void ti_free_rx_ring_std(struct ti_softc *); @@ -237,6 +232,11 @@ static int ti_init_rx_ring_mini(struct t static void ti_free_rx_ring_mini(struct ti_softc *); static void ti_free_tx_ring(struct ti_softc *); static int ti_init_tx_ring(struct ti_softc *); +static void ti_discard_std(struct ti_softc *, int); +#ifndef TI_SF_BUF_JUMBO +static void ti_discard_jumbo(struct ti_softc *, int); +#endif +static void ti_discard_mini(struct ti_softc *, int); static int ti_64bitslot_war(struct ti_softc *); static int ti_chipinit(struct ti_softc *); @@ -982,21 +982,42 @@ ti_alloc_dmamaps(struct ti_softc *sc) for (i = 0; i < TI_TX_RING_CNT; i++) { sc->ti_cdata.ti_txdesc[i].tx_m = NULL; - sc->ti_cdata.ti_txdesc[i].tx_dmamap = 0; + sc->ti_cdata.ti_txdesc[i].tx_dmamap = NULL; if (bus_dmamap_create(sc->ti_mbuftx_dmat, 0, - &sc->ti_cdata.ti_txdesc[i].tx_dmamap)) + &sc->ti_cdata.ti_txdesc[i].tx_dmamap)) { + device_printf(sc->ti_dev, + "cannot create DMA map for TX\n"); return (ENOBUFS); + } } for (i = 0; i < TI_STD_RX_RING_CNT; i++) { if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_std_maps[i])) + &sc->ti_cdata.ti_rx_std_maps[i])) { + device_printf(sc->ti_dev, + "cannot create DMA map for RX\n"); return (ENOBUFS); + } + } + if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, + &sc->ti_cdata.ti_rx_std_sparemap)) { + device_printf(sc->ti_dev, + "cannot create spare DMA map for RX\n"); + return (ENOBUFS); } for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { if (bus_dmamap_create(sc->ti_jumbo_dmat, 0, - &sc->ti_cdata.ti_rx_jumbo_maps[i])) + &sc->ti_cdata.ti_rx_jumbo_maps[i])) { + device_printf(sc->ti_dev, + "cannot create DMA map for jumbo RX\n"); return (ENOBUFS); + } + } + if (bus_dmamap_create(sc->ti_jumbo_dmat, 0, + &sc->ti_cdata.ti_rx_jumbo_sparemap)) { + device_printf(sc->ti_dev, + "cannot create spare DMA map for jumbo RX\n"); + return (ENOBUFS); } /* Mini ring is not available on Tigon 1. */ @@ -1005,8 +1026,17 @@ ti_alloc_dmamaps(struct ti_softc *sc) for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_mini_maps[i])) + &sc->ti_cdata.ti_rx_mini_maps[i])) { + device_printf(sc->ti_dev, + "cannot create DMA map for mini RX\n"); return (ENOBUFS); + } + } + if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, + &sc->ti_cdata.ti_rx_mini_sparemap)) { + device_printf(sc->ti_dev, + "cannot create DMA map for mini RX\n"); + return (ENOBUFS); } return (0); @@ -1017,173 +1047,77 @@ ti_free_dmamaps(struct ti_softc *sc) { int i; - if (sc->ti_mbuftx_dmat) - for (i = 0; i < TI_TX_RING_CNT; i++) + if (sc->ti_mbuftx_dmat) { + for (i = 0; i < TI_TX_RING_CNT; i++) { if (sc->ti_cdata.ti_txdesc[i].tx_dmamap) { bus_dmamap_destroy(sc->ti_mbuftx_dmat, sc->ti_cdata.ti_txdesc[i].tx_dmamap); - sc->ti_cdata.ti_txdesc[i].tx_dmamap = 0; + sc->ti_cdata.ti_txdesc[i].tx_dmamap = NULL; } + } + } - if (sc->ti_mbufrx_dmat) - for (i = 0; i < TI_STD_RX_RING_CNT; i++) + if (sc->ti_mbufrx_dmat) { + for (i = 0; i < TI_STD_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_std_maps[i]) { bus_dmamap_destroy(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_std_maps[i]); - sc->ti_cdata.ti_rx_std_maps[i] = 0; + sc->ti_cdata.ti_rx_std_maps[i] = NULL; } + } + if (sc->ti_cdata.ti_rx_std_sparemap) { + bus_dmamap_destroy(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_std_sparemap); + sc->ti_cdata.ti_rx_std_sparemap = NULL; + } + } - if (sc->ti_jumbo_dmat) - for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) + if (sc->ti_jumbo_dmat) { + for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_jumbo_maps[i]) { bus_dmamap_destroy(sc->ti_jumbo_dmat, sc->ti_cdata.ti_rx_jumbo_maps[i]); - sc->ti_cdata.ti_rx_jumbo_maps[i] = 0; + sc->ti_cdata.ti_rx_jumbo_maps[i] = NULL; } - if (sc->ti_mbufrx_dmat) - for (i = 0; i < TI_MINI_RX_RING_CNT; i++) + } + if (sc->ti_cdata.ti_rx_jumbo_sparemap) { + bus_dmamap_destroy(sc->ti_jumbo_dmat, + sc->ti_cdata.ti_rx_jumbo_sparemap); + sc->ti_cdata.ti_rx_jumbo_sparemap = NULL; + } + } + + if (sc->ti_mbufrx_dmat) { + for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_mini_maps[i]) { bus_dmamap_destroy(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_mini_maps[i]); - sc->ti_cdata.ti_rx_mini_maps[i] = 0; + sc->ti_cdata.ti_rx_mini_maps[i] = NULL; } + } + if (sc->ti_cdata.ti_rx_mini_sparemap) { + bus_dmamap_destroy(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_mini_sparemap); + sc->ti_cdata.ti_rx_mini_sparemap = NULL; + } + } } -#ifdef TI_PRIVATE_JUMBOS - -/* - * Memory management for the jumbo receive ring is a pain in the - * butt. We need to allocate at least 9018 bytes of space per frame, - * _and_ it has to be contiguous (unless you use the extended - * jumbo descriptor format). Using malloc() all the time won't - * work: malloc() allocates memory in powers of two, which means we - * would end up wasting a considerable amount of space by allocating - * 9K chunks. We don't have a jumbo mbuf cluster pool. Thus, we have - * to do our own memory management. - * - * The driver needs to allocate a contiguous chunk of memory at boot - * time. We then chop this up ourselves into 9K pieces and use them - * as external mbuf storage. - * - * One issue here is how much memory to allocate. The jumbo ring has - * 256 slots in it, but at 9K per slot than can consume over 2MB of - * RAM. This is a bit much, especially considering we also need - * RAM for the standard ring and mini ring (on the Tigon 2). To - * save space, we only actually allocate enough memory for 64 slots - * by default, which works out to between 500 and 600K. This can - * be tuned by changing a #define in if_tireg.h. - */ +#ifndef TI_SF_BUF_JUMBO static int ti_alloc_jumbo_mem(struct ti_softc *sc) { - struct ti_jpool_entry *entry; - caddr_t ptr; - int i; - /* - * Grab a big chunk o' storage. Since we are chopping this pool up - * into ~9k chunks, there doesn't appear to be a need to use page - * alignment. - */ - if (bus_dma_tag_create(sc->ti_parent_dmat, /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - TI_JMEM, /* maxsize */ - 1, /* nsegments */ - TI_JMEM, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->ti_jumbo_dmat) != 0) { + if (bus_dma_tag_create(sc->ti_parent_dmat, 1, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, MJUM9BYTES, 1, MJUM9BYTES, 0, NULL, + NULL, &sc->ti_jumbo_dmat) != 0) { device_printf(sc->ti_dev, "Failed to allocate jumbo dmat\n"); - return (ENOBUFS); + return (ENOBUFS); } - - if (bus_dmamem_alloc(sc->ti_jumbo_dmat, - (void**)&sc->ti_cdata.ti_jumbo_buf, - BUS_DMA_NOWAIT | BUS_DMA_COHERENT, - &sc->ti_jumbo_dmamap) != 0) { - device_printf(sc->ti_dev, "Failed to allocate jumbo memory\n"); - return (ENOBUFS); - } - - SLIST_INIT(&sc->ti_jfree_listhead); - SLIST_INIT(&sc->ti_jinuse_listhead); - - /* - * Now divide it up into 9K pieces and save the addresses - * in an array. - */ - ptr = sc->ti_cdata.ti_jumbo_buf; - for (i = 0; i < TI_JSLOTS; i++) { - sc->ti_cdata.ti_jslots[i] = ptr; - ptr += TI_JLEN; - entry = malloc(sizeof(struct ti_jpool_entry), - M_DEVBUF, M_NOWAIT); - if (entry == NULL) { - device_printf(sc->ti_dev, "no memory for jumbo " - "buffer queue!\n"); - return (ENOBUFS); - } - entry->slot = i; - SLIST_INSERT_HEAD(&sc->ti_jfree_listhead, entry, jpool_entries); - } - return (0); } -/* - * Allocate a jumbo buffer. - */ -static void *ti_jalloc(struct ti_softc *sc) -{ - struct ti_jpool_entry *entry; - - entry = SLIST_FIRST(&sc->ti_jfree_listhead); - - if (entry == NULL) { - device_printf(sc->ti_dev, "no free jumbo buffers\n"); - return (NULL); - } - - SLIST_REMOVE_HEAD(&sc->ti_jfree_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->ti_jinuse_listhead, entry, jpool_entries); - return (sc->ti_cdata.ti_jslots[entry->slot]); -} - -/* - * Release a jumbo buffer. - */ -static void -ti_jfree(void *buf, void *args) -{ - struct ti_softc *sc; - int i; - struct ti_jpool_entry *entry; - - /* Extract the softc struct pointer. */ - sc = (struct ti_softc *)args; - - if (sc == NULL) - panic("ti_jfree: didn't get softc pointer!"); - - /* calculate the slot this buffer belongs to */ - i = ((vm_offset_t)buf - - (vm_offset_t)sc->ti_cdata.ti_jumbo_buf) / TI_JLEN; - - if ((i < 0) || (i >= TI_JSLOTS)) - panic("ti_jfree: asked to free buffer that we don't manage!"); - - entry = SLIST_FIRST(&sc->ti_jinuse_listhead); - if (entry == NULL) - panic("ti_jfree: buffer not in use!"); - entry->slot = i; - SLIST_REMOVE_HEAD(&sc->ti_jinuse_listhead, jpool_entries); - SLIST_INSERT_HEAD(&sc->ti_jfree_listhead, entry, jpool_entries); -} - #else static int @@ -1212,56 +1146,59 @@ ti_alloc_jumbo_mem(struct ti_softc *sc) return (0); } -#endif /* TI_PRIVATE_JUMBOS */ +#endif /* TI_SF_BUF_JUMBO */ /* * Intialize a standard receive ring descriptor. */ static int -ti_newbuf_std(struct ti_softc *sc, int i, struct mbuf *m) +ti_newbuf_std(struct ti_softc *sc, int i) { bus_dmamap_t map; - bus_dma_segment_t segs; - struct mbuf *m_new = NULL; + bus_dma_segment_t segs[1]; + struct mbuf *m; struct ti_rx_desc *r; - int nsegs; + int error, nsegs; - nsegs = 0; - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + m_adj(m, ETHER_ALIGN); - MCLGET(m_new, M_DONTWAIT); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); - } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; + error = bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_std_sparemap, m, segs, &nsegs, 0); + if (error != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + if (sc->ti_cdata.ti_rx_std_chain[i] != NULL) { + bus_dmamap_sync(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_std_maps[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_std_maps[i]); } - m_adj(m_new, ETHER_ALIGN); - sc->ti_cdata.ti_rx_std_chain[i] = m_new; - r = &sc->ti_rdata->ti_rx_std_ring[i]; map = sc->ti_cdata.ti_rx_std_maps[i]; - if (bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, map, m_new, &segs, - &nsegs, 0)) - return (ENOBUFS); - if (nsegs != 1) - return (ENOBUFS); - ti_hostaddr64(&r->ti_addr, segs.ds_addr); - r->ti_len = segs.ds_len; + sc->ti_cdata.ti_rx_std_maps[i] = sc->ti_cdata.ti_rx_std_sparemap; + sc->ti_cdata.ti_rx_std_sparemap = map; + sc->ti_cdata.ti_rx_std_chain[i] = m; + + r = &sc->ti_rdata->ti_rx_std_ring[i]; + ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); + r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_BD; r->ti_flags = 0; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_std_maps[i], + BUS_DMASYNC_PREREAD); return (0); } @@ -1270,111 +1207,112 @@ ti_newbuf_std(struct ti_softc *sc, int i * the Tigon 2. */ static int -ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m) +ti_newbuf_mini(struct ti_softc *sc, int i) { - bus_dma_segment_t segs; bus_dmamap_t map; - struct mbuf *m_new = NULL; + bus_dma_segment_t segs[1]; + struct mbuf *m; struct ti_rx_desc *r; - int nsegs; + int error, nsegs; - nsegs = 0; - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) { - return (ENOBUFS); - } - m_new->m_len = m_new->m_pkthdr.len = MHLEN; - } else { - m_new = m; - m_new->m_data = m_new->m_pktdat; - m_new->m_len = m_new->m_pkthdr.len = MHLEN; + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MHLEN; + m_adj(m, ETHER_ALIGN); + + error = bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_mini_sparemap, m, segs, &nsegs, 0); + if (error != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + if (sc->ti_cdata.ti_rx_mini_chain[i] != NULL) { + bus_dmamap_sync(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_mini_maps[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ti_mbufrx_dmat, + sc->ti_cdata.ti_rx_mini_maps[i]); } - m_adj(m_new, ETHER_ALIGN); - r = &sc->ti_rdata->ti_rx_mini_ring[i]; - sc->ti_cdata.ti_rx_mini_chain[i] = m_new; map = sc->ti_cdata.ti_rx_mini_maps[i]; - if (bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, map, m_new, &segs, - &nsegs, 0)) - return (ENOBUFS); - if (nsegs != 1) - return (ENOBUFS); - ti_hostaddr64(&r->ti_addr, segs.ds_addr); - r->ti_len = segs.ds_len; + sc->ti_cdata.ti_rx_mini_maps[i] = sc->ti_cdata.ti_rx_mini_sparemap; + sc->ti_cdata.ti_rx_mini_sparemap = map; + sc->ti_cdata.ti_rx_mini_chain[i] = m; + + r = &sc->ti_rdata->ti_rx_mini_ring[i]; + ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); + r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_BD; r->ti_flags = TI_BDFLAG_MINI_RING; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_mini_maps[i], + BUS_DMASYNC_PREREAD); return (0); } -#ifdef TI_PRIVATE_JUMBOS +#ifndef TI_SF_BUF_JUMBO /* * Initialize a jumbo receive ring descriptor. This allocates * a jumbo buffer from the pool managed internally by the driver. */ static int -ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *m) +ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *dummy) { bus_dmamap_t map; - struct mbuf *m_new = NULL; + bus_dma_segment_t segs[1]; + struct mbuf *m; struct ti_rx_desc *r; - int nsegs; - bus_dma_segment_t segs; + int error, nsegs; - if (m == NULL) { - caddr_t *buf = NULL; + (void)dummy; - /* Allocate the mbuf. */ - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) { - return (ENOBUFS); - } + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MJUM9BYTES; + m_adj(m, ETHER_ALIGN); - /* Allocate the jumbo buffer */ - buf = ti_jalloc(sc); - if (buf == NULL) { - m_freem(m_new); - device_printf(sc->ti_dev, "jumbo allocation failed " - "-- packet dropped!\n"); - return (ENOBUFS); - } + error = bus_dmamap_load_mbuf_sg(sc->ti_jumbo_dmat, + sc->ti_cdata.ti_rx_jumbo_sparemap, m, segs, &nsegs, 0); + if (error != 0) { + m_freem(m); + return (error); + } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - /* Attach the buffer to the mbuf. */ - m_new->m_data = (void *) buf; - m_new->m_len = m_new->m_pkthdr.len = TI_JUMBO_FRAMELEN; - MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree, buf, - (struct ti_softc *)sc, 0, EXT_NET_DRV); - } else { - m_new = m; - m_new->m_data = m_new->m_ext.ext_buf; - m_new->m_ext.ext_size = TI_JUMBO_FRAMELEN; + if (sc->ti_cdata.ti_rx_jumbo_chain[i] != NULL) { + bus_dmamap_sync(sc->ti_jumbo_dmat, + sc->ti_cdata.ti_rx_jumbo_maps[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->ti_jumbo_dmat, + sc->ti_cdata.ti_rx_jumbo_maps[i]); } - m_adj(m_new, ETHER_ALIGN); - /* Set up the descriptor. */ - r = &sc->ti_rdata->ti_rx_jumbo_ring[i]; - sc->ti_cdata.ti_rx_jumbo_chain[i] = m_new; map = sc->ti_cdata.ti_rx_jumbo_maps[i]; - if (bus_dmamap_load_mbuf_sg(sc->ti_jumbo_dmat, map, m_new, &segs, - &nsegs, 0)) - return (ENOBUFS); - if (nsegs != 1) - return (ENOBUFS); - ti_hostaddr64(&r->ti_addr, segs.ds_addr); - r->ti_len = segs.ds_len; + sc->ti_cdata.ti_rx_jumbo_maps[i] = sc->ti_cdata.ti_rx_jumbo_sparemap; + sc->ti_cdata.ti_rx_jumbo_sparemap = map; + sc->ti_cdata.ti_rx_jumbo_chain[i] = m; + + r = &sc->ti_rdata->ti_rx_jumbo_ring[i]; + ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); + r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_JUMBO_BD; r->ti_flags = TI_BDFLAG_JUMBO_RING; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_jumbo_dmat, map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_jumbo_dmat, sc->ti_cdata.ti_rx_jumbo_maps[i], + BUS_DMASYNC_PREREAD); return (0); } @@ -1553,13 +1491,13 @@ ti_init_rx_ring_std(struct ti_softc *sc) int i; struct ti_cmd_desc cmd; - for (i = 0; i < TI_SSLOTS; i++) { - if (ti_newbuf_std(sc, i, NULL) == ENOBUFS) + for (i = 0; i < TI_STD_RX_RING_CNT; i++) { + if (ti_newbuf_std(sc, i) != 0) return (ENOBUFS); }; - TI_UPDATE_STDPROD(sc, i - 1); - sc->ti_std = i - 1; + sc->ti_std = TI_STD_RX_RING_CNT - 1; + TI_UPDATE_STDPROD(sc, TI_STD_RX_RING_CNT - 1); return (0); } @@ -1591,12 +1529,12 @@ ti_init_rx_ring_jumbo(struct ti_softc *s int i; for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { - if (ti_newbuf_jumbo(sc, i, NULL) == ENOBUFS) + if (ti_newbuf_jumbo(sc, i, NULL) != 0) return (ENOBUFS); }; - TI_UPDATE_JUMBOPROD(sc, i - 1); - sc->ti_jumbo = i - 1; + sc->ti_jumbo = TI_JUMBO_RX_RING_CNT - 1; + TI_UPDATE_JUMBOPROD(sc, TI_JUMBO_RX_RING_CNT - 1); return (0); } @@ -1626,13 +1564,13 @@ ti_init_rx_ring_mini(struct ti_softc *sc { int i; - for (i = 0; i < TI_MSLOTS; i++) { - if (ti_newbuf_mini(sc, i, NULL) == ENOBUFS) + for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { + if (ti_newbuf_mini(sc, i) != 0) return (ENOBUFS); }; - TI_UPDATE_MINIPROD(sc, i - 1); - sc->ti_mini = i - 1; + sc->ti_mini = TI_MINI_RX_RING_CNT - 1; + TI_UPDATE_MINIPROD(sc, TI_MINI_RX_RING_CNT - 1); return (0); } @@ -2080,8 +2018,8 @@ ti_gibinit(struct ti_softc *sc) rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb; TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_jumbo_ring); -#ifdef TI_PRIVATE_JUMBOS - rcb->ti_max_len = TI_JUMBO_FRAMELEN; +#ifndef TI_SF_BUF_JUMBO + rcb->ti_max_len = MJUM9BYTES - ETHER_ALIGN; rcb->ti_flags = 0; #else rcb->ti_max_len = PAGE_SIZE; @@ -2394,7 +2332,6 @@ ti_attach(device_t dev) } if (ti_alloc_dmamaps(sc)) { - device_printf(dev, "dma map creation failed\n"); error = ENXIO; goto fail; } @@ -2542,11 +2479,6 @@ ti_detach(device_t dev) ti_free_dmamaps(sc); ifmedia_removeall(&sc->ifmedia); -#ifdef TI_PRIVATE_JUMBOS - if (sc->ti_cdata.ti_jumbo_buf) - bus_dmamem_free(sc->ti_jumbo_dmat, sc->ti_cdata.ti_jumbo_buf, - sc->ti_jumbo_dmamap); -#endif if (sc->ti_jumbo_dmat) bus_dma_tag_destroy(sc->ti_jumbo_dmat); if (sc->ti_mbuftx_dmat) @@ -2635,6 +2567,59 @@ ti_hdr_split(struct mbuf *top, int hdr_l } #endif /* TI_JUMBO_HDRSPLIT */ +static void +ti_discard_std(struct ti_softc *sc, int i) +{ + + struct ti_rx_desc *r; + + r = &sc->ti_rdata->ti_rx_std_ring[i]; + r->ti_len = MCLBYTES - ETHER_ALIGN; + r->ti_type = TI_BDTYPE_RECV_BD; + r->ti_flags = 0; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; + if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) + r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; + r->ti_idx = i; +} + +static void +ti_discard_mini(struct ti_softc *sc, int i) +{ + + struct ti_rx_desc *r; + + r = &sc->ti_rdata->ti_rx_mini_ring[i]; + r->ti_len = MHLEN - ETHER_ALIGN; + r->ti_type = TI_BDTYPE_RECV_BD; + r->ti_flags = TI_BDFLAG_MINI_RING; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; + if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) + r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; + r->ti_idx = i; +} + +#ifndef TI_SF_BUF_JUMBO +static void +ti_discard_jumbo(struct ti_softc *sc, int i) +{ + + struct ti_rx_desc *r; + + r = &sc->ti_rdata->ti_rx_mini_ring[i]; + r->ti_len = MJUM9BYTES - ETHER_ALIGN; + r->ti_type = TI_BDTYPE_RECV_JUMBO_BD; + r->ti_flags = TI_BDFLAG_JUMBO_RING; + r->ti_vlan_tag = 0; + r->ti_tcp_udp_cksum = 0; + if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) + r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; + r->ti_idx = i; +} +#endif + /* * Frame reception handling. This is called if there's a frame * on the receive return list. @@ -2650,9 +2635,11 @@ static void ti_rxeof(struct ti_softc *sc) { struct ifnet *ifp; +#ifdef TI_SF_BUF_JUMBO bus_dmamap_t map; +#endif struct ti_cmd_desc cmd; - int jumbocnt, minicnt, stdcnt; + int jumbocnt, minicnt, stdcnt, ti_len; TI_LOCK_ASSERT(sc); @@ -2669,6 +2656,7 @@ ti_rxeof(struct ti_softc *sc) cur_rx = &sc->ti_rdata->ti_rx_return_ring[sc->ti_rx_saved_considx]; rxidx = cur_rx->ti_idx; + ti_len = cur_rx->ti_len; TI_INC(sc->ti_rx_saved_considx, TI_RETURN_RING_CNT); if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) { @@ -2680,6 +2668,19 @@ ti_rxeof(struct ti_softc *sc) jumbocnt++; TI_INC(sc->ti_jumbo, TI_JUMBO_RX_RING_CNT); m = sc->ti_cdata.ti_rx_jumbo_chain[rxidx]; +#ifndef TI_SF_BUF_JUMBO + if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { + ifp->if_ierrors++; + ti_discard_jumbo(sc, rxidx); + continue; + } + if (ti_newbuf_jumbo(sc, rxidx, NULL) != 0) { + ifp->if_iqdrops++; + ti_discard_jumbo(sc, rxidx); + continue; + } + m->m_len = ti_len; +#else /* !TI_SF_BUF_JUMBO */ sc->ti_cdata.ti_rx_jumbo_chain[rxidx] = NULL; map = sc->ti_cdata.ti_rx_jumbo_maps[rxidx]; bus_dmamap_sync(sc->ti_jumbo_dmat, map, @@ -2691,64 +2692,51 @@ ti_rxeof(struct ti_softc *sc) continue; } if (ti_newbuf_jumbo(sc, sc->ti_jumbo, NULL) == ENOBUFS) { - ifp->if_ierrors++; + ifp->if_iqdrops++; ti_newbuf_jumbo(sc, sc->ti_jumbo, m); continue; } -#ifdef TI_PRIVATE_JUMBOS - m->m_len = cur_rx->ti_len; -#else /* TI_PRIVATE_JUMBOS */ #ifdef TI_JUMBO_HDRSPLIT if (sc->ti_hdrsplit) ti_hdr_split(m, TI_HOSTADDR(cur_rx->ti_addr), - cur_rx->ti_len, rxidx); + ti_len, rxidx); else #endif /* TI_JUMBO_HDRSPLIT */ - m_adj(m, cur_rx->ti_len - m->m_pkthdr.len); -#endif /* TI_PRIVATE_JUMBOS */ + m_adj(m, ti_len - m->m_pkthdr.len); +#endif /* TI_SF_BUF_JUMBO */ } else if (cur_rx->ti_flags & TI_BDFLAG_MINI_RING) { minicnt++; TI_INC(sc->ti_mini, TI_MINI_RX_RING_CNT); m = sc->ti_cdata.ti_rx_mini_chain[rxidx]; - sc->ti_cdata.ti_rx_mini_chain[rxidx] = NULL; - map = sc->ti_cdata.ti_rx_mini_maps[rxidx]; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, map); if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { ifp->if_ierrors++; - ti_newbuf_mini(sc, sc->ti_mini, m); + ti_discard_mini(sc, rxidx); continue; } - if (ti_newbuf_mini(sc, sc->ti_mini, NULL) == ENOBUFS) { - ifp->if_ierrors++; - ti_newbuf_mini(sc, sc->ti_mini, m); + if (ti_newbuf_mini(sc, rxidx) != 0) { + ifp->if_iqdrops++; + ti_discard_mini(sc, rxidx); continue; } - m->m_len = cur_rx->ti_len; + m->m_len = ti_len; } else { stdcnt++; TI_INC(sc->ti_std, TI_STD_RX_RING_CNT); m = sc->ti_cdata.ti_rx_std_chain[rxidx]; - sc->ti_cdata.ti_rx_std_chain[rxidx] = NULL; - map = sc->ti_cdata.ti_rx_std_maps[rxidx]; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, map); if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { ifp->if_ierrors++; - ti_newbuf_std(sc, sc->ti_std, m); + ti_discard_std(sc, rxidx); continue; } - if (ti_newbuf_std(sc, sc->ti_std, NULL) == ENOBUFS) { - ifp->if_ierrors++; - ti_newbuf_std(sc, sc->ti_std, m); + if (ti_newbuf_std(sc, rxidx) != 0) { + ifp->if_iqdrops++; + ti_discard_std(sc, rxidx); continue; } - m->m_len = cur_rx->ti_len; + m->m_len = ti_len; } - m->m_pkthdr.len = cur_rx->ti_len; + m->m_pkthdr.len = ti_len; ifp->if_ipackets++; m->m_pkthdr.rcvif = ifp; Modified: head/sys/dev/ti/if_tireg.h ============================================================================== --- head/sys/dev/ti/if_tireg.h Tue Nov 8 18:10:04 2011 (r227346) +++ head/sys/dev/ti/if_tireg.h Tue Nov 8 18:23:02 2011 (r227347) @@ -887,23 +887,6 @@ struct ti_event_desc { #define TI_CLRBIT(sc, reg, x) \ CSR_WRITE_4((sc), (reg), (CSR_READ_4((sc), (reg)) & ~(x))) -/* - * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS - * values are tuneable. They control the actual amount of buffers - * allocated for the standard, mini and jumbo receive rings. - */ - -#define TI_SSLOTS 256 -#define TI_MSLOTS 256 -#define TI_JSLOTS 256 - -#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN) -#define TI_JLEN (TI_JRAWLEN + (sizeof(uint64_t) - \ - (TI_JRAWLEN % sizeof(uint64_t)))) -#define TI_JPAGESZ PAGE_SIZE -#define TI_RESID (TI_JPAGESZ - (TI_JLEN * TI_JSLOTS) % TI_JPAGESZ) -#define TI_JMEM ((TI_JLEN * TI_JSLOTS) + TI_RESID) - struct ti_txdesc { struct mbuf *tx_m; bus_dmamap_t tx_dmamap; @@ -920,7 +903,7 @@ STAILQ_HEAD(ti_txdq, ti_txdesc); */ struct ti_ring_data { struct ti_rx_desc ti_rx_std_ring[TI_STD_RX_RING_CNT]; -#ifdef TI_PRIVATE_JUMBOS +#ifndef TI_SF_BUF_JUMBO struct ti_rx_desc ti_rx_jumbo_ring[TI_JUMBO_RX_RING_CNT]; #else struct ti_rx_desc_ext ti_rx_jumbo_ring[TI_JUMBO_RX_RING_CNT]; @@ -955,13 +938,13 @@ struct ti_chain_data { struct ti_txdq ti_txbusyq; struct mbuf *ti_rx_std_chain[TI_STD_RX_RING_CNT]; bus_dmamap_t ti_rx_std_maps[TI_STD_RX_RING_CNT]; + bus_dmamap_t ti_rx_std_sparemap; struct mbuf *ti_rx_jumbo_chain[TI_JUMBO_RX_RING_CNT]; bus_dmamap_t ti_rx_jumbo_maps[TI_JUMBO_RX_RING_CNT]; + bus_dmamap_t ti_rx_jumbo_sparemap; struct mbuf *ti_rx_mini_chain[TI_MINI_RX_RING_CNT]; bus_dmamap_t ti_rx_mini_maps[TI_MINI_RX_RING_CNT]; - /* Stick the jumbo mem management stuff here too. */ - caddr_t ti_jslots[TI_JSLOTS]; - void *ti_jumbo_buf; + bus_dmamap_t ti_rx_mini_sparemap; }; struct ti_type { @@ -980,11 +963,6 @@ struct ti_mc_entry { SLIST_ENTRY(ti_mc_entry) mc_entries; }; -struct ti_jpool_entry { - int slot; - SLIST_ENTRY(ti_jpool_entry) jpool_entries; -}; - typedef enum { TI_FLAG_NONE = 0x00, TI_FLAG_DEBUGING = 0x01, @@ -1006,7 +984,6 @@ struct ti_softc { int ti_hdrsplit; /* enable header splitting */ bus_dma_tag_t ti_parent_dmat; bus_dma_tag_t ti_jumbo_dmat; - bus_dmamap_t ti_jumbo_dmamap; bus_dma_tag_t ti_mbuftx_dmat; bus_dma_tag_t ti_mbufrx_dmat; bus_dma_tag_t ti_rdata_dmat; @@ -1026,8 +1003,6 @@ struct ti_softc { int ti_mini; /* current mini ring head */ int ti_jumbo; /* current jumo ring head */ SLIST_HEAD(__ti_mchead, ti_mc_entry) ti_mc_listhead; - SLIST_HEAD(__ti_jfreehead, ti_jpool_entry) ti_jfree_listhead; - SLIST_HEAD(__ti_jinusehead, ti_jpool_entry) ti_jinuse_listhead; uint32_t ti_stat_ticks; uint32_t ti_rx_coal_ticks; uint32_t ti_tx_coal_ticks; From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:35:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25BAB1065674; Tue, 8 Nov 2011 18:35:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157FA8FC23; Tue, 8 Nov 2011 18:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8IZBEp043415; Tue, 8 Nov 2011 18:35:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IZB6N043413; Tue, 8 Nov 2011 18:35:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111081835.pA8IZB6N043413@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Nov 2011 18:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227348 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:35:12 -0000 Author: yongari Date: Tue Nov 8 18:35:11 2011 New Revision: 227348 URL: http://svn.freebsd.org/changeset/base/227348 Log: ti(4) supports altq(4). Modified: head/share/man/man4/altq.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Tue Nov 8 18:23:02 2011 (r227347) +++ head/share/man/man4/altq.4 Tue Nov 8 18:35:11 2011 (r227348) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2011 +.Dd November 8, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -161,6 +161,7 @@ They have been applied to the following .Xr sk 4 , .Xr ste 4 , .Xr stge 4 , +.Xr ti 4 , .Xr txp 4 , .Xr udav 4 , .Xr ural 4 , From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:37:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A478106564A; Tue, 8 Nov 2011 18:37:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39F448FC1D; Tue, 8 Nov 2011 18:37:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8Ib0nn043508; Tue, 8 Nov 2011 18:37:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8Ib0eQ043506; Tue, 8 Nov 2011 18:37:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111081837.pA8Ib0eQ043506@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Nov 2011 18:37: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: r227349 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:37:00 -0000 Author: yongari Date: Tue Nov 8 18:36:59 2011 New Revision: 227349 URL: http://svn.freebsd.org/changeset/base/227349 Log: Document TI_SF_BUF_JUMBO and Xr altq. Modified: head/share/man/man4/ti.4 Modified: head/share/man/man4/ti.4 ============================================================================== --- head/share/man/man4/ti.4 Tue Nov 8 18:35:11 2011 (r227348) +++ head/share/man/man4/ti.4 Tue Nov 8 18:36:59 2011 (r227349) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd November 8, 2011 .Dt TI 4 .Os .Sh NAME @@ -42,7 +42,7 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device ti" -.Cd "options TI_PRIVATE_JUMBOS" +.Cd "options TI_SF_BUF_JUMBO" .Cd "options TI_JUMBO_HDRSPLIT" .Ed .Pp @@ -97,13 +97,14 @@ for more discussion on zero copy receive .Pp The .Nm -driver normally uses jumbo receive buffers allocated by the +driver uses UMA backed jumbo receive buffers, but can be configured +to use .Xr sendfile 2 -buffer allocator, but can be configured to use its own private pool of -jumbo buffers that are contiguous instead of buffers from the jumbo -allocator, which are made up of multiple page sized chunks. -To turn on private jumbos, use the -.Dv TI_PRIVATE_JUMBOS +buffer allocator. +To turn on +.Xr sendfile 2 +buffer allocator, use the +.Dv TI_SF_BUF_JUMBO option. .Pp Support for vlans is also available using the @@ -311,6 +312,7 @@ the network connection (cable). .El .Sh SEE ALSO .Xr sendfile 2 , +.Xr altq 4 , .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:37:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E594F106564A; Tue, 8 Nov 2011 18:37:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D58C88FC12; Tue, 8 Nov 2011 18:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8IbqBR043574; Tue, 8 Nov 2011 18:37:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IbqTp043572; Tue, 8 Nov 2011 18:37:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081837.pA8IbqTp043572@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 18:37: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: r227350 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:37:53 -0000 Author: adrian Date: Tue Nov 8 18:37:52 2011 New Revision: 227350 URL: http://svn.freebsd.org/changeset/base/227350 Log: Conditionally compile the PCI latency workaround; I think it's only required for some earlier NICs. Modified: head/sys/dev/ath/if_ath_pci.c Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Tue Nov 8 18:36:59 2011 (r227349) +++ head/sys/dev/ath/if_ath_pci.c Tue Nov 8 18:37:52 2011 (r227350) @@ -78,8 +78,10 @@ struct ath_pci_softc { static void ath_pci_setup(device_t dev) { +#ifdef ATH_PCI_LATENCY_WAR /* Override the system latency timer */ pci_write_config(dev, PCIR_LATTIMER, 0x80, 1); +#endif /* If a PCI NIC, force wakeup */ #ifdef ATH_PCI_WAKEUP_WAR From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:45:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D75FF106566C; Tue, 8 Nov 2011 18:45:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C68D08FC19; Tue, 8 Nov 2011 18:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8IjFTt043844; Tue, 8 Nov 2011 18:45:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IjFN8043842; Tue, 8 Nov 2011 18:45:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081845.pA8IjFN8043842@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 18:45: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: r227351 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:45:15 -0000 Author: adrian Date: Tue Nov 8 18:45:15 2011 New Revision: 227351 URL: http://svn.freebsd.org/changeset/base/227351 Log: Preparation for correct 802.11n tx/rx handling. * Change ath_rx_proc() to ath_rx_tasklet(); make that the taskqueue function. This way (eventually) ath_rx_proc() can be called from elsewhere in the packet reset/processing queue so frames aren't just "flushed" during interface resets/reconfigure. This breaks 802.11n RX aggregation tracking. * Extend ath_tx_proc() to take a 'resched' flag, which marks whether to reschedule further RX PCU reads or not. * Change ath_tx_processq() to take a "dosched" flag, which will eventually be used to indicate whether to reschedule the software TX scheduler. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 18:37:52 2011 (r227350) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 18:45:15 2011 (r227351) @@ -170,7 +170,8 @@ static int ath_rxbuf_init(struct ath_sof static void ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi, int nf); static void ath_setdefantenna(struct ath_softc *, u_int); -static void ath_rx_proc(void *, int); +static void ath_rx_proc(struct ath_softc *sc, int); +static void ath_rx_tasklet(void *, int); static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); static int ath_tx_setup(struct ath_softc *, int, int); @@ -382,7 +383,7 @@ ath_attach(u_int16_t devid, struct ath_s taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", ifp->if_xname); - TASK_INIT(&sc->sc_rxtask, 0, ath_rx_proc, sc); + TASK_INIT(&sc->sc_rxtask, 0, ath_rx_tasklet, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); TASK_INIT(&sc->sc_bstucktask,0, ath_bstuck_proc, sc); @@ -3505,13 +3506,27 @@ ath_handle_micerror(struct ieee80211com } } +/* + * Only run the RX proc if it's not already running. + * Since this may get run as part of the reset/flush path, + * the task can't clash with an existing, running tasklet. + */ static void -ath_rx_proc(void *arg, int npending) +ath_rx_tasklet(void *arg, int npending) +{ + struct ath_softc *sc = arg; + + CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); + DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); + ath_rx_proc(sc, 1); +} + +static void +ath_rx_proc(struct ath_softc *sc, int resched) { #define PA2DESC(_sc, _pa) \ ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) - struct ath_softc *sc = arg; struct ath_buf *bf; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -3526,7 +3541,7 @@ ath_rx_proc(void *arg, int npending) u_int64_t tsf; int npkts = 0; - DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); + DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: called\n", __func__); ngood = 0; nf = ath_hal_getchannoise(ah, sc->sc_curchan); sc->sc_stats.ast_rx_noise = nf; @@ -3862,7 +3877,7 @@ rx_next: sc->sc_lastrx = tsf; /* Queue DFS tasklet if needed */ - if (ath_dfs_tasklet_needed(sc, sc->sc_curchan)) + if (resched && ath_dfs_tasklet_needed(sc, sc->sc_curchan)) taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); /* @@ -3870,7 +3885,7 @@ rx_next: * need to be handled, kick the PCU if there's * been an RXEOL condition. */ - if (sc->sc_kickpcu) { + if (resched && sc->sc_kickpcu) { device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", __func__, npkts); @@ -3887,7 +3902,7 @@ rx_next: ATH_UNLOCK(sc); } - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + if (resched && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); #endif @@ -4121,7 +4136,7 @@ ath_tx_findrix(const struct ath_softc *s * Process completed xmit descriptors from the specified queue. */ static int -ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) +ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) { struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = sc->sc_ifp; @@ -4287,11 +4302,11 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txq_active &= ~txqs; ATH_UNLOCK(sc); - if (TXQACTIVE(txqs, 0) && ath_tx_processq(sc, &sc->sc_txq[0])) + if (TXQACTIVE(txqs, 0) && ath_tx_processq(sc, &sc->sc_txq[0], 1)) /* XXX why is lastrx updated in tx code? */ sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) - ath_tx_processq(sc, sc->sc_cabq); + ath_tx_processq(sc, sc->sc_cabq, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; @@ -4323,15 +4338,15 @@ ath_tx_proc_q0123(void *arg, int npendin */ nacked = 0; if (TXQACTIVE(txqs, 0)) - nacked += ath_tx_processq(sc, &sc->sc_txq[0]); + nacked += ath_tx_processq(sc, &sc->sc_txq[0], 1); if (TXQACTIVE(txqs, 1)) - nacked += ath_tx_processq(sc, &sc->sc_txq[1]); + nacked += ath_tx_processq(sc, &sc->sc_txq[1], 1); if (TXQACTIVE(txqs, 2)) - nacked += ath_tx_processq(sc, &sc->sc_txq[2]); + nacked += ath_tx_processq(sc, &sc->sc_txq[2], 1); if (TXQACTIVE(txqs, 3)) - nacked += ath_tx_processq(sc, &sc->sc_txq[3]); + nacked += ath_tx_processq(sc, &sc->sc_txq[3], 1); if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) - ath_tx_processq(sc, sc->sc_cabq); + ath_tx_processq(sc, sc->sc_cabq, 1); if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); @@ -4366,7 +4381,7 @@ ath_tx_proc(void *arg, int npending) nacked = 0; for (i = 0; i < HAL_NUM_TX_QUEUES; i++) if (ATH_TXQ_SETUP(sc, i) && TXQACTIVE(txqs, i)) - nacked += ath_tx_processq(sc, &sc->sc_txq[i]); + nacked += ath_tx_processq(sc, &sc->sc_txq[i], 1); if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:48:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746D7106566B; Tue, 8 Nov 2011 18:48:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AEEB8FC16; Tue, 8 Nov 2011 18:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8ImRd5043988; Tue, 8 Nov 2011 18:48:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8ImRnS043986; Tue, 8 Nov 2011 18:48:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081848.pA8ImRnS043986@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 18:48: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: r227352 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:48:27 -0000 Author: adrian Date: Tue Nov 8 18:48:26 2011 New Revision: 227352 URL: http://svn.freebsd.org/changeset/base/227352 Log: Break out the node cleanup and node free path, in preparation for doing software TX queue management. The software queued TX frames will be freed by the new cleanup function. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 18:45:15 2011 (r227351) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 18:48:26 2011 (r227352) @@ -163,6 +163,7 @@ static int ath_desc_alloc(struct ath_sof static void ath_desc_free(struct ath_softc *); static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); +static void ath_node_cleanup(struct ieee80211_node *); static void ath_node_free(struct ieee80211_node *); static void ath_node_getsignal(const struct ieee80211_node *, int8_t *, int8_t *); @@ -713,6 +714,8 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_node_alloc = ath_node_alloc; sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = ath_node_free; + sc->sc_node_cleanup = ic->ic_node_cleanup; + ic->ic_node_cleanup = ath_node_cleanup; ic->ic_node_getsignal = ath_node_getsignal; ic->ic_scan_start = ath_scan_start; ic->ic_scan_end = ath_scan_end; @@ -3219,14 +3222,24 @@ ath_node_alloc(struct ieee80211vap *vap, } static void +ath_node_cleanup(struct ieee80211_node *ni) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_ifp->if_softc; + + /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */ + ath_rate_node_cleanup(sc, ATH_NODE(ni)); + sc->sc_node_cleanup(ni); +} + +static void ath_node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_softc *sc = ic->ic_ifp->if_softc; DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni); mtx_destroy(&ATH_NODE(ni)->an_mtx); - ath_rate_node_cleanup(sc, ATH_NODE(ni)); sc->sc_node_free(ni); } From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 18:56:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C826D1065678; Tue, 8 Nov 2011 18:56:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B74EE8FC12; Tue, 8 Nov 2011 18:56:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8Iuq5C044299; Tue, 8 Nov 2011 18:56:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8IuqpN044295; Tue, 8 Nov 2011 18:56:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081856.pA8IuqpN044295@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 18:56: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: r227353 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 18:56:52 -0000 Author: adrian Date: Tue Nov 8 18:56:52 2011 New Revision: 227353 URL: http://svn.freebsd.org/changeset/base/227353 Log: In preparation for supporting 11n TX/RX properly, allow for TX queue draining and interface resets to be marked as ATH_RESET_DEFAULT, ATH_RESET_FULL, ATH_RESET_NOLOSS. Currently a reset is still a reset - ie, all tx/rx frames in the hardware queues are purged. This means that those frames will be lost to the 11n TX and RX aggregation state tracking, breaking AMPDU sessions. The (eventual) new semantics: * ATH_RESET_DEFAULT: full reset, this is the default for reset situations which I haven't yet figured out what they should be. * ATH_RESET_FULL: A full reset - for things such as channel changes. * ATH_RESET_NOLOSS: Don't flush TX/RX queues - handle pending RX frames and leave TX frames where they are; restart TX DMA from where it was. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 18:48:26 2011 (r227352) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 18:56:52 2011 (r227353) @@ -184,7 +184,7 @@ static void ath_tx_proc_q0123(void *, in static void ath_tx_proc(void *, int); static void ath_tx_draintxq(struct ath_softc *, struct ath_txq *); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); -static void ath_draintxq(struct ath_softc *); +static void ath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type); static void ath_stoprecv(struct ath_softc *); static int ath_startrecv(struct ath_softc *); static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); @@ -1123,7 +1123,8 @@ ath_vap_delete(struct ieee80211vap *vap) * the vap state by any frames pending on the tx queues. */ ath_hal_intrset(ah, 0); /* disable interrupts */ - ath_draintxq(sc); /* stop xmit side */ + ath_draintxq(sc, ATH_RESET_DEFAULT); /* stop hw xmit side */ + /* XXX Do all frames from all vaps/nodes need draining here? */ ath_stoprecv(sc); /* stop recv side */ } @@ -1507,7 +1508,7 @@ ath_fatal_proc(void *arg, int pending) state[0], state[1] , state[2], state[3], state[4], state[5]); } - ath_reset(ifp); + ath_reset(ifp, ATH_RESET_NOLOSS); } static void @@ -1567,7 +1568,7 @@ ath_bmiss_proc(void *arg, int pending) if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { if_printf(ifp, "bb hang detected (0x%x), resetting\n", hangs); - ath_reset(ifp); + ath_reset(ifp, ATH_RESET_NOLOSS); } else ieee80211_beacon_miss(ifp->if_l2com); } @@ -1747,7 +1748,7 @@ ath_stop_locked(struct ifnet *ifp) } ath_hal_intrset(ah, 0); } - ath_draintxq(sc); + ath_draintxq(sc, ATH_RESET_DEFAULT); if (!sc->sc_invalid) { ath_stoprecv(sc); ath_hal_phydisable(ah); @@ -1775,7 +1776,7 @@ ath_stop(struct ifnet *ifp) * to reset or reload hardware state. */ int -ath_reset(struct ifnet *ifp) +ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type) { struct ath_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; @@ -1783,7 +1784,7 @@ ath_reset(struct ifnet *ifp) HAL_STATUS status; ath_hal_intrset(ah, 0); /* disable interrupts */ - ath_draintxq(sc); /* stop xmit side */ + ath_draintxq(sc, reset_type); /* stop xmit side */ ath_stoprecv(sc); /* stop recv side */ ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ @@ -1836,7 +1837,8 @@ ath_reset_vap(struct ieee80211vap *vap, ath_hal_settxpowlimit(ah, ic->ic_txpowlimit); return 0; } - return ath_reset(ifp); + /* XXX? Full or NOLOSS? */ + return ath_reset(ifp, ATH_RESET_FULL); } struct ath_buf * @@ -2730,7 +2732,7 @@ ath_bstuck_proc(void *arg, int pending) if_printf(ifp, "stuck beacon; resetting (bmiss count %u)\n", sc->sc_bmisscount); sc->sc_stats.ast_bstuck++; - ath_reset(ifp); + ath_reset(ifp, ATH_RESET_NOLOSS); } /* @@ -4484,7 +4486,7 @@ ath_tx_stopdma(struct ath_softc *sc, str * Drain the transmit queues and reclaim resources. */ static void -ath_draintxq(struct ath_softc *sc) +ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type) { struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = sc->sc_ifp; @@ -4636,7 +4638,7 @@ ath_chan_set(struct ath_softc *sc, struc * the relevant bits of the h/w. */ ath_hal_intrset(ah, 0); /* disable interrupts */ - ath_draintxq(sc); /* clear pending tx frames */ + ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ ath_stoprecv(sc); /* turn off frame recv */ if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { if_printf(ifp, "%s: unable to reset " @@ -4726,7 +4728,7 @@ ath_calibrate(void *arg) DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: rfgain change\n", __func__); sc->sc_stats.ast_per_rfgain++; - ath_reset(ifp); + ath_reset(ifp, ATH_RESET_NOLOSS); } /* * If this long cal is after an idle period, then @@ -5392,7 +5394,7 @@ ath_watchdog(void *arg) hangs & 0xff ? "bb" : "mac", hangs); } else if_printf(ifp, "device timeout\n"); - ath_reset(ifp); + ath_reset(ifp, ATH_RESET_NOLOSS); ifp->if_oerrors++; sc->sc_stats.ast_watchdog++; } Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Nov 8 18:48:26 2011 (r227352) +++ head/sys/dev/ath/if_ath_misc.h Tue Nov 8 18:56:52 2011 (r227353) @@ -53,6 +53,6 @@ extern int ath_tx_findrix(const struct a extern struct ath_buf * ath_getbuf(struct ath_softc *sc); extern struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc); -extern int ath_reset(struct ifnet *); +extern int ath_reset(struct ifnet *, ATH_RESET_TYPE); #endif Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 18:48:26 2011 (r227352) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Nov 8 18:56:52 2011 (r227353) @@ -263,7 +263,8 @@ ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS) if (error || !req->newptr) return error; return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL : - (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0; + (ifp->if_drv_flags & IFF_DRV_RUNNING) ? + ath_reset(ifp, ATH_RESET_NOLOSS) : 0; } static int @@ -295,7 +296,8 @@ ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS) return 0; if (!ath_hal_setrfkill(ah, rfkill)) return EINVAL; - return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0; + return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? + ath_reset(ifp, ATH_RESET_FULL) : 0; } static int @@ -428,7 +430,7 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) * things in an inconsistent state. */ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) - ath_reset(sc->sc_ifp); + ath_reset(sc->sc_ifp, ATH_RESET_NOLOSS); return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 19:03:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1A421065673; Tue, 8 Nov 2011 19:02:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6F188FC21; Tue, 8 Nov 2011 19:02:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8J2xRM044534; Tue, 8 Nov 2011 19:02:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8J2xUi044532; Tue, 8 Nov 2011 19:02:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081902.pA8J2xUi044532@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 19:02: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: r227354 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:03:00 -0000 Author: adrian Date: Tue Nov 8 19:02:59 2011 New Revision: 227354 URL: http://svn.freebsd.org/changeset/base/227354 Log: Add KTR tracepoints to the ath driver, in order to debug TX, RX and interrupt handling. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 18:56:52 2011 (r227353) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 19:02:59 2011 (r227354) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -106,6 +107,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#define ATH_KTR_INTR KTR_SPARE4 +#define ATH_KTR_ERR KTR_SPARE3 /* * ATH_BCBUF determines the number of vap's that can transmit @@ -1116,6 +1119,7 @@ ath_vap_delete(struct ieee80211vap *vap) struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Quiesce the hardware while we remove the vap. In @@ -1339,6 +1343,14 @@ ath_intr(void *arg) */ ath_hal_getisr(ah, &status); /* NB: clears ISR too */ DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status); + CTR1(ATH_KTR_INTR, "ath_intr: mask=0x%.8x", status); + CTR5(ATH_KTR_INTR, + "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x", + ah->ah_intrstate[0], + ah->ah_intrstate[1], + ah->ah_intrstate[2], + ah->ah_intrstate[3], + ah->ah_intrstate[6]); status &= sc->sc_imask; /* discard unasked for bits */ /* Short-circuit un-handled interrupts */ @@ -1384,6 +1396,7 @@ ath_intr(void *arg) } if (status & HAL_INT_RXEOL) { int imask; + CTR0(ATH_KTR_ERR, "ath_intr: RXEOL"); /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1481,6 +1494,7 @@ ath_intr(void *arg) } if (status & HAL_INT_RXORN) { /* NB: hal marks HAL_INT_FATAL when RXORN is fatal */ + CTR0(ATH_KTR_ERR, "ath_intr: RXORN"); sc->sc_stats.ast_rxorn++; } } @@ -1783,8 +1797,14 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; + DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); ath_hal_intrset(ah, 0); /* disable interrupts */ ath_draintxq(sc, reset_type); /* stop xmit side */ + /* + * XXX Don't flush if ATH_RESET_NOLOSS;but we have to first + * XXX need to ensure this doesn't race with an outstanding + * XXX taskqueue call. + */ ath_stoprecv(sc); /* stop recv side */ ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ @@ -3891,6 +3911,7 @@ rx_next: if (ngood) sc->sc_lastrx = tsf; + CTR2(ATH_KTR_INTR, "ath_rx_proc: npkts=%d, ngood=%d", npkts, ngood); /* Queue DFS tasklet if needed */ if (resched && ath_dfs_tasklet_needed(sc, sc->sc_curchan)) taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); @@ -3901,6 +3922,7 @@ rx_next: * been an RXEOL condition. */ if (resched && sc->sc_kickpcu) { + CTR0(ATH_KTR_ERR, "ath_rx_proc: kickpcu"); device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", __func__, npkts); @@ -4638,7 +4660,7 @@ ath_chan_set(struct ath_softc *sc, struc * the relevant bits of the h/w. */ ath_hal_intrset(ah, 0); /* disable interrupts */ - ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ + ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ ath_stoprecv(sc); /* turn off frame recv */ if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { if_printf(ifp, "%s: unable to reset " From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 19:14:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD401065670; Tue, 8 Nov 2011 19:14:16 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324EE8FC15; Tue, 8 Nov 2011 19:14:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JEGSh044928; Tue, 8 Nov 2011 19:14:16 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8JEG4v044926; Tue, 8 Nov 2011 19:14:16 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111081914.pA8JEG4v044926@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 8 Nov 2011 19:14: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: r227355 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:14:16 -0000 Author: trociny Date: Tue Nov 8 19:14:15 2011 New Revision: 227355 URL: http://svn.freebsd.org/changeset/base/227355 Log: Bumb date after r227317. Reminded by: pluknet Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Tue Nov 8 19:02:59 2011 (r227354) +++ head/usr.bin/procstat/procstat.1 Tue Nov 8 19:14:15 2011 (r227355) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2011 +.Dd November 7, 2011 .Dt PROCSTAT 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 19:18:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85ED1065673; Tue, 8 Nov 2011 19:18:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADB378FC15; Tue, 8 Nov 2011 19:18:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JIYcn045098; Tue, 8 Nov 2011 19:18:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8JIYnG045096; Tue, 8 Nov 2011 19:18:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081918.pA8JIYnG045096@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 19: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: r227356 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:18:35 -0000 Author: adrian Date: Tue Nov 8 19:18:34 2011 New Revision: 227356 URL: http://svn.freebsd.org/changeset/base/227356 Log: Some more various fixes, etc from my 11n branch. * When doing software TX queue handling and flush, it's possible that the deletion of a VAP (eg a STA shutdown) will queue a "STA Disassociate" frame whilst the interface is being deleted. The VAP is then deleted, and the frame ends up being queued to a node that is freed before it can be TX'ed. Things go awry at this point. There's no way at the present to avoid freeing the underlying node when the vap is being deleted. It's too late in the game. I suspect the real fix is to make sure the frame is software queued with no completion information somehow, so it doesn't link back to a node whose underlying VAP has been freed. For now, we'll just have to do this. * Add some comments showing what's going on. * Move an instance of the ATH_LOCK() around to protect the interrupt set. I'll worry about changing that to a PCU lock later on once the 11n code is in the tree. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 19:14:15 2011 (r227355) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 19:18:34 2011 (r227356) @@ -1133,6 +1133,26 @@ ath_vap_delete(struct ieee80211vap *vap) } ieee80211_vap_detach(vap); + + /* + * XXX Danger Will Robinson! Danger! + * + * Because ieee80211_vap_detach() can queue a frame (the station + * diassociate message?) after we've drained the TXQ and + * flushed the software TXQ, we will end up with a frame queued + * to a node whose vap is about to be freed. + * + * To work around this, flush the hardware/software again. + * This may be racy - the ath task may be running and the packet + * may be being scheduled between sw->hw txq. Tsk. + * + * TODO: figure out why a new node gets allocated somewhere around + * here (after the ath_tx_swq() call; and after an ath_stop_locked() + * call!) + */ + + ath_draintxq(sc, ATH_RESET_DEFAULT); + ATH_LOCK(sc); /* * Reclaim beacon state. Note this must be done before @@ -1180,7 +1200,6 @@ ath_vap_delete(struct ieee80211vap *vap) sc->sc_swbmiss = 0; } #endif - ATH_UNLOCK(sc); free(avp, M_80211_VAP); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { @@ -1201,6 +1220,7 @@ ath_vap_delete(struct ieee80211vap *vap) } ath_hal_intrset(ah, sc->sc_imask); } + ATH_UNLOCK(sc); } void @@ -1798,6 +1818,7 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T HAL_STATUS status; DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); + ath_hal_intrset(ah, 0); /* disable interrupts */ ath_draintxq(sc, reset_type); /* stop xmit side */ /* @@ -2748,10 +2769,18 @@ ath_bstuck_proc(void *arg, int pending) { struct ath_softc *sc = arg; struct ifnet *ifp = sc->sc_ifp; + uint32_t hangs = 0; + + if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) + if_printf(ifp, "bb hang detected (0x%x)\n", hangs); if_printf(ifp, "stuck beacon; resetting (bmiss count %u)\n", sc->sc_bmisscount); sc->sc_stats.ast_bstuck++; + /* + * This assumes that there's no simultaneous channel mode change + * occuring. + */ ath_reset(ifp, ATH_RESET_NOLOSS); } @@ -3955,6 +3984,7 @@ ath_txq_init(struct ath_softc *sc, struc txq->axq_qnum = qnum; txq->axq_ac = 0; txq->axq_depth = 0; + txq->axq_aggr_depth = 0; txq->axq_intrcnt = 0; txq->axq_link = NULL; txq->axq_softc = sc; @@ -4085,6 +4115,10 @@ ath_txq_update(struct ath_softc *sc, int qi.tqi_burstTime = qi.tqi_readyTime; } else { #endif + /* + * XXX shouldn't this just use the default flags + * used in the previous queue setup? + */ qi.tqi_qflags = HAL_TXQ_TXOKINT_ENABLE | HAL_TXQ_TXERRINT_ENABLE | HAL_TXQ_TXDESCINT_ENABLE @@ -4430,6 +4464,7 @@ ath_tx_proc(void *arg, int npending) ath_start(ifp); } +#undef TXQACTIVE static void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 19:25:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06121106564A; Tue, 8 Nov 2011 19:25:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9C078FC12; Tue, 8 Nov 2011 19:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JPq9Z045368; Tue, 8 Nov 2011 19:25:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8JPqgY045364; Tue, 8 Nov 2011 19:25:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081925.pA8JPqgY045364@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 19:25: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: r227357 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:25:53 -0000 Author: adrian Date: Tue Nov 8 19:25:52 2011 New Revision: 227357 URL: http://svn.freebsd.org/changeset/base/227357 Log: Add a 'vap' to ath_keyset(). Add some code (which is currently disabled) which modifies the group multicast key cache behaviour. I haven't yet figured out what the exact/correct behaviour is so I'm leaving it disabled. It's worth investigating and "correcting", especially for future work with mesh/ibss and encryption. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_keycache.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 19:25:52 2011 (r227357) @@ -5165,7 +5165,7 @@ ath_setup_stationkey(struct ieee80211_no ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY; IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr); /* NB: this will create a pass-thru key entry */ - ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss); + ath_keyset(sc, vap, &ni->ni_ucastkey, vap->iv_bss); } } Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath_keycache.c Tue Nov 8 19:25:52 2011 (r227357) @@ -178,7 +178,8 @@ ath_keyset_tkip(struct ath_softc *sc, co * cache slots for TKIP with hardware MIC support. */ int -ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k, +ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap, + const struct ieee80211_key *k, struct ieee80211_node *bss) { #define N(a) (sizeof(a)/sizeof(a[0])) @@ -212,7 +213,23 @@ ath_keyset(struct ath_softc *sc, const s } else hk.kv_type = HAL_CIPHER_CLR; - if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) { + /* + * XXX TODO: check this: + * + * Group keys on hardware that supports multicast frame + * key search should only be done in adhoc/hostap mode, + * not STA mode. + * + * XXX TODO: what about mesh, tdma? + */ +#if 0 + if ((vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_IBSS) && +#else + if ( +#endif + (k->wk_flags & IEEE80211_KEY_GROUP) && + sc->sc_mcastkey) { /* * Group keys on hardware that supports multicast frame * key search use a MAC that is the sender's address with @@ -493,5 +510,5 @@ ath_key_set(struct ieee80211vap *vap, co { struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; - return ath_keyset(sc, k, vap->iv_bss); + return ath_keyset(sc, vap, k, vap->iv_bss); } Modified: head/sys/dev/ath/if_ath_keycache.h ============================================================================== --- head/sys/dev/ath/if_ath_keycache.h Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath_keycache.h Tue Nov 8 19:25:52 2011 (r227357) @@ -37,7 +37,7 @@ extern int ath_key_alloc(struct ieee8021 extern int ath_key_delete(struct ieee80211vap *, const struct ieee80211_key *); extern int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *, const u_int8_t mac[IEEE80211_ADDR_LEN]); -extern int ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k, - struct ieee80211_node *bss); +extern int ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap, + const struct ieee80211_key *k, struct ieee80211_node *bss); #endif From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:06:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD9AA1065672; Tue, 8 Nov 2011 21:06:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8F28FC12; Tue, 8 Nov 2011 21:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8L6ais048859; Tue, 8 Nov 2011 21:06:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8L6asA048857; Tue, 8 Nov 2011 21:06:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082106.pA8L6asA048857@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:06: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: r227358 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:06:36 -0000 Author: adrian Date: Tue Nov 8 21:06:36 2011 New Revision: 227358 URL: http://svn.freebsd.org/changeset/base/227358 Log: Break out the TX DMA stop code into a separate function. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 19:25:52 2011 (r227357) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:06:36 2011 (r227358) @@ -4539,17 +4539,16 @@ ath_tx_stopdma(struct ath_softc *sc, str (void) ath_hal_stoptxdma(ah, txq->axq_qnum); } -/* - * Drain the transmit queues and reclaim resources. - */ -static void -ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type) +static int +ath_stoptxdma(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; int i; /* XXX return value */ + if (sc->sc_invalid) + return 0; + if (!sc->sc_invalid) { /* don't touch the hardware if marked invalid */ DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", @@ -4561,6 +4560,24 @@ ath_draintxq(struct ath_softc *sc, ATH_R if (ATH_TXQ_SETUP(sc, i)) ath_tx_stopdma(sc, &sc->sc_txq[i]); } + + return 1; +} + +/* + * Drain the transmit queues and reclaim resources. + */ +static void +ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type) +{ +#ifdef ATH_DEBUG + struct ath_hal *ah = sc->sc_ah; +#endif + struct ifnet *ifp = sc->sc_ifp; + int i; + + (void) ath_stoptxdma(sc); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) if (ATH_TXQ_SETUP(sc, i)) ath_tx_draintxq(sc, &sc->sc_txq[i]); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:13:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13D46106566C; Tue, 8 Nov 2011 21:13:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 037868FC14; Tue, 8 Nov 2011 21:13:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8LD5M8049427; Tue, 8 Nov 2011 21:13:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8LD5Dd049423; Tue, 8 Nov 2011 21:13:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082113.pA8LD5Dd049423@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:13: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: r227359 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:13:07 -0000 Author: adrian Date: Tue Nov 8 21:13:05 2011 New Revision: 227359 URL: http://svn.freebsd.org/changeset/base/227359 Log: Change ath_buf allocation to: * Immediately return NULL if a buffer isn't available; * Track the "buffers not available" count; * Clear some fields used for tx aggregation; * Add ath_buf_clone() which clones the majority of buffer state. This is needed when retransmission of a "busy" buffer is required. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 21:06:36 2011 (r227358) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:13:05 2011 (r227359) @@ -1890,18 +1890,89 @@ _ath_getbuf_locked(struct ath_softc *sc) ATH_TXBUF_LOCK_ASSERT(sc); bf = TAILQ_FIRST(&sc->sc_txbuf); + if (bf == NULL) { + sc->sc_stats.ast_tx_getnobuf++; + } else { + if (bf->bf_flags & ATH_BUF_BUSY) { + sc->sc_stats.ast_tx_getbusybuf++; + bf = NULL; + } + } + if (bf != NULL && (bf->bf_flags & ATH_BUF_BUSY) == 0) TAILQ_REMOVE(&sc->sc_txbuf, bf, bf_list); else bf = NULL; + if (bf == NULL) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %s\n", __func__, TAILQ_FIRST(&sc->sc_txbuf) == NULL ? "out of xmit buffers" : "xmit buffer busy"); + return NULL; } + + /* Valid bf here; clear some basic fields */ + bf->bf_next = NULL; /* XXX just to be sure */ + bf->bf_last = NULL; /* XXX again, just to be sure */ + bf->bf_comp = NULL; /* XXX again, just to be sure */ + bzero(&bf->bf_state, sizeof(bf->bf_state)); + return bf; } +/* + * When retrying a software frame, buffers marked ATH_BUF_BUSY + * can't be thrown back on the queue as they could still be + * in use by the hardware. + * + * This duplicates the buffer, or returns NULL. + * + * The descriptor is also copied but the link pointers and + * the DMA segments aren't copied; this frame should thus + * be again passed through the descriptor setup/chain routines + * so the link is correct. + * + * The caller must free the buffer using ath_freebuf(). + * + * XXX TODO: this call shouldn't fail as it'll cause packet loss + * XXX in the TX pathway when retries are needed. + * XXX Figure out how to keep some buffers free, or factor the + * XXX number of busy buffers into the xmit path (ath_start()) + * XXX so we don't over-commit. + */ +struct ath_buf * +ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf) +{ + struct ath_buf *tbf; + + tbf = ath_getbuf(sc); + if (tbf == NULL) + return NULL; /* XXX failure? Why? */ + + /* Copy basics */ + tbf->bf_next = NULL; + tbf->bf_nseg = bf->bf_nseg; + tbf->bf_txflags = bf->bf_txflags; + tbf->bf_flags = bf->bf_flags & ~ATH_BUF_BUSY; + tbf->bf_status = bf->bf_status; + tbf->bf_m = bf->bf_m; + tbf->bf_node = bf->bf_node; + /* will be setup by the chain/setup function */ + tbf->bf_lastds = NULL; + /* for now, last == self */ + tbf->bf_last = tbf; + tbf->bf_comp = bf->bf_comp; + + /* NOTE: DMA segments will be setup by the setup/chain functions */ + + /* The caller has to re-init the descriptor + links */ + + /* Copy state */ + memcpy(&tbf->bf_state, &bf->bf_state, sizeof(bf->bf_state)); + + return tbf; +} + struct ath_buf * ath_getbuf(struct ath_softc *sc) { Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Nov 8 21:06:36 2011 (r227358) +++ head/sys/dev/ath/if_ath_misc.h Tue Nov 8 21:13:05 2011 (r227359) @@ -52,6 +52,8 @@ extern int ath_tx_findrix(const struct a extern struct ath_buf * ath_getbuf(struct ath_softc *sc); extern struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc); +extern struct ath_buf * ath_buf_clone(struct ath_softc *sc, + const struct ath_buf *bf); extern int ath_reset(struct ifnet *, ATH_RESET_TYPE); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:25:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98CB41065674; Tue, 8 Nov 2011 21:25:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 888D78FC1A; Tue, 8 Nov 2011 21:25:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8LPaSt049910; Tue, 8 Nov 2011 21:25:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8LPaMe049907; Tue, 8 Nov 2011 21:25:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082125.pA8LPaMe049907@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:25: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: r227360 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:25:36 -0000 Author: adrian Date: Tue Nov 8 21:25:36 2011 New Revision: 227360 URL: http://svn.freebsd.org/changeset/base/227360 Log: Change the descriptor logic to use bf_lastds to point to the last descriptor, rather than using the maths involving bf_desc[bf_nseg - 1]. When doing TX aggregation, the status will be updated in the -final- descriptor of the -final- subframe in an aggregate. Thus bf_lastds may point to the last descriptor in a completely different ath_buf. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 21:13:05 2011 (r227359) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:25:36 2011 (r227360) @@ -2503,6 +2503,8 @@ ath_beacon_setup(struct ath_softc *sc, s /* setup descriptors */ ds = bf->bf_desc; + bf->bf_last = bf; + bf->bf_lastds = ds; flags = HAL_TXDESC_NOACK; if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { @@ -2582,7 +2584,9 @@ ath_txqmove(struct ath_txq *dst, struct dst->axq_link = src->axq_link; src->axq_link = NULL; dst->axq_depth += src->axq_depth; + dst->axq_aggr_depth += src->axq_aggr_depth; src->axq_depth = 0; + src->axq_aggr_depth = 0; } /* @@ -3227,6 +3231,7 @@ ath_descdma_setup(struct ath_softc *sc, ath_descdma_cleanup(sc, dd, head); return error; } + bf->bf_lastds = bf->bf_desc; /* Just an initial value */ TAILQ_INSERT_TAIL(head, bf, bf_list); } return 0; @@ -4284,7 +4289,7 @@ ath_tx_processq(struct ath_softc *sc, st struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ath_buf *bf, *last; - struct ath_desc *ds, *ds0; + struct ath_desc *ds; struct ath_tx_status *ts; struct ieee80211_node *ni; struct ath_node *an; @@ -4304,8 +4309,7 @@ ath_tx_processq(struct ath_softc *sc, st ATH_TXQ_UNLOCK(txq); break; } - ds0 = &bf->bf_desc[0]; - ds = &bf->bf_desc[bf->bf_nseg - 1]; + ds = bf->bf_lastds; /* XXX must be setup correctly! */ ts = &bf->bf_status.ds_txstat; status = ath_hal_txprocdesc(ah, ds, ts); #ifdef ATH_DEBUG @@ -4324,13 +4328,19 @@ ath_tx_processq(struct ath_softc *sc, st * More frames follow. Mark the buffer busy * so it's not re-used while the hardware may * still re-read the link field in the descriptor. + * + * Use the last buffer in an aggregate as that + * is where the hardware may be - intermediate + * descriptors won't be "busy". */ - bf->bf_flags |= ATH_BUF_BUSY; + bf->bf_last->bf_flags |= ATH_BUF_BUSY; } else #else if (txq->axq_depth == 0) #endif txq->axq_link = NULL; + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth--; ATH_TXQ_UNLOCK(txq); ni = bf->bf_node; @@ -4565,13 +4575,15 @@ ath_tx_draintxq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth--; ATH_TXQ_UNLOCK(txq); #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; ath_printtxbuf(sc, bf, txq->axq_qnum, ix, - ath_hal_txprocdesc(ah, bf->bf_desc, + ath_hal_txprocdesc(ah, bf->bf_lastds, &bf->bf_status.ds_txstat) == HAL_OK); ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, 0, -1); @@ -4657,7 +4669,7 @@ ath_draintxq(struct ath_softc *sc, ATH_R struct ath_buf *bf = TAILQ_FIRST(&sc->sc_bbuf); if (bf != NULL && bf->bf_m != NULL) { ath_printtxbuf(sc, bf, sc->sc_bhalq, 0, - ath_hal_txprocdesc(ah, bf->bf_desc, + ath_hal_txprocdesc(ah, bf->bf_lastds, &bf->bf_status.ds_txstat) == HAL_OK); ieee80211_dump_pkt(ifp->if_l2com, mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Nov 8 21:13:05 2011 (r227359) +++ head/sys/dev/ath/if_ath_tx.c Tue Nov 8 21:25:36 2011 (r227360) @@ -225,6 +225,9 @@ ath_tx_dmasetup(struct ath_softc *sc, st return 0; } +/* + * Chain together segments+descriptors for a non-11n frame. + */ static void ath_tx_chaindesclist(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) { @@ -252,8 +255,8 @@ ath_tx_chaindesclist(struct ath_softc *s "%s: %d: %08x %08x %08x %08x %08x %08x\n", __func__, i, ds->ds_link, ds->ds_data, ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); + bf->bf_lastds = ds; } - } static void @@ -347,7 +350,9 @@ ath_tx_handoff(struct ath_softc *sc, str (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); } #endif /* IEEE80211_SUPPORT_TDMA */ - txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth++; + txq->axq_link = &bf->bf_lastds->ds_link; ath_hal_txstart(ah, txq->axq_qnum); } else { if (txq->axq_link != NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:49:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45564106564A; Tue, 8 Nov 2011 21:49:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD9C8FC22; Tue, 8 Nov 2011 21:49:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8LnYG0050718; Tue, 8 Nov 2011 21:49:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8LnYLe050715; Tue, 8 Nov 2011 21:49:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082149.pA8LnYLe050715@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:49: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: r227361 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:49:34 -0000 Author: adrian Date: Tue Nov 8 21:49:33 2011 New Revision: 227361 URL: http://svn.freebsd.org/changeset/base/227361 Log: Refactor out the TX buffer management and completion code in preparation for TX aggregation. * Add in logic which calls ath_buf bf->bf_comp if it's set. This allows for AMPDU (and RIFS, and FF, if someone desires) code to handle completion - which includes freeing subframes, retransmitting subframes, etc. * Break out the buffer free, buffer busy/unbusy default completion handler code into separate functions. This allows bf_comp methods to free and unbusy each subframe ath_buf as required. * Break out the statistics update code into a separate function, just to clean up the TX completion path a little. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 21:25:36 2011 (r227360) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:49:33 2011 (r227361) @@ -185,7 +185,6 @@ static void ath_tx_cleanup(struct ath_so static void ath_tx_proc_q0(void *, int); static void ath_tx_proc_q0123(void *, int); static void ath_tx_proc(void *, int); -static void ath_tx_draintxq(struct ath_softc *, struct ath_txq *); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); static void ath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type); static void ath_stoprecv(struct ath_softc *); @@ -4279,6 +4278,121 @@ ath_tx_findrix(const struct ath_softc *s return (rix == 0xff ? 0 : rix); } +static void +ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, + struct ath_buf *bf) +{ + struct ieee80211_node *ni = bf->bf_node; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + int sr, lr, pri; + + if (ts->ts_status == 0) { + u_int8_t txant = ts->ts_antenna; + sc->sc_stats.ast_ant_tx[txant]++; + sc->sc_ant_tx[txant]++; + if (ts->ts_finaltsi != 0) + sc->sc_stats.ast_tx_altrate++; + pri = M_WME_GETAC(bf->bf_m); + if (pri >= WME_AC_VO) + ic->ic_wme.wme_hipri_traffic++; + if ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0) + ni->ni_inact = ni->ni_inact_reload; + } else { + if (ts->ts_status & HAL_TXERR_XRETRY) + sc->sc_stats.ast_tx_xretries++; + if (ts->ts_status & HAL_TXERR_FIFO) + sc->sc_stats.ast_tx_fifoerr++; + if (ts->ts_status & HAL_TXERR_FILT) + sc->sc_stats.ast_tx_filtered++; + if (ts->ts_status & HAL_TXERR_XTXOP) + sc->sc_stats.ast_tx_xtxop++; + if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED) + sc->sc_stats.ast_tx_timerexpired++; + + if (ts->ts_status & HAL_TX_DATA_UNDERRUN) + sc->sc_stats.ast_tx_data_underrun++; + if (ts->ts_status & HAL_TX_DELIM_UNDERRUN) + sc->sc_stats.ast_tx_delim_underrun++; + + if (bf->bf_m->m_flags & M_FF) + sc->sc_stats.ast_ff_txerr++; + } + /* XXX when is this valid? */ + if (ts->ts_status & HAL_TX_DESC_CFG_ERR) + sc->sc_stats.ast_tx_desccfgerr++; + + sr = ts->ts_shortretry; + lr = ts->ts_longretry; + sc->sc_stats.ast_tx_shortretry += sr; + sc->sc_stats.ast_tx_longretry += lr; + +} + +/* + * The default completion. If fail is 1, this means + * "please don't retry the frame, and just return -1 status + * to the net80211 stack. + */ +void +ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) +{ + struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + int st; + + if (fail == 1) + st = -1; + else + st = ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0) ? + ts->ts_status : HAL_TXERR_XRETRY; + + if (bf->bf_state.bfs_dobaw) + device_printf(sc->sc_dev, + "%s: dobaw should've been cleared!\n", __func__); + if (bf->bf_next != NULL) + device_printf(sc->sc_dev, + "%s: bf_next not NULL!\n", __func__); + + /* + * Do any tx complete callback. Note this must + * be done before releasing the node reference. + * This will free the mbuf, release the net80211 + * node and recycle the ath_buf. + */ + ath_tx_freebuf(sc, bf, st); +} + +/* + * Update the busy status of the last frame on the free list. + * When doing TDMA, the busy flag tracks whether the hardware + * currently points to this buffer or not, and thus gated DMA + * may restart by re-reading the last descriptor in this + * buffer. + * + * This should be called in the completion function once one + * of the buffers has been used. + */ +static void +ath_tx_update_busy(struct ath_softc *sc) +{ + struct ath_buf *last; + + /* + * Since the last frame may still be marked + * as ATH_BUF_BUSY, unmark it here before + * finishing the frame processing. + * Since we've completed a frame (aggregate + * or otherwise), the hardware has moved on + * and is no longer referencing the previous + * descriptor. + */ + ATH_TXBUF_LOCK_ASSERT(sc); + last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); + if (last != NULL) + last->bf_flags &= ~ATH_BUF_BUSY; +} + + /* * Process completed xmit descriptors from the specified queue. */ @@ -4286,14 +4400,11 @@ static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) { struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ath_buf *bf, *last; + struct ath_buf *bf; struct ath_desc *ds; struct ath_tx_status *ts; struct ieee80211_node *ni; - struct ath_node *an; - int sr, lr, pri, nacked; + int nacked; HAL_STATUS status; DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: tx queue %u head %p link %p\n", @@ -4341,90 +4452,48 @@ ath_tx_processq(struct ath_softc *sc, st txq->axq_link = NULL; if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; - ATH_TXQ_UNLOCK(txq); ni = bf->bf_node; - if (ni != NULL) { - an = ATH_NODE(ni); - if (ts->ts_status == 0) { - u_int8_t txant = ts->ts_antenna; - sc->sc_stats.ast_ant_tx[txant]++; - sc->sc_ant_tx[txant]++; - if (ts->ts_finaltsi != 0) - sc->sc_stats.ast_tx_altrate++; - pri = M_WME_GETAC(bf->bf_m); - if (pri >= WME_AC_VO) - ic->ic_wme.wme_hipri_traffic++; - if ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0) - ni->ni_inact = ni->ni_inact_reload; - } else { - if (ts->ts_status & HAL_TXERR_XRETRY) - sc->sc_stats.ast_tx_xretries++; - if (ts->ts_status & HAL_TXERR_FIFO) - sc->sc_stats.ast_tx_fifoerr++; - if (ts->ts_status & HAL_TXERR_FILT) - sc->sc_stats.ast_tx_filtered++; - if (ts->ts_status & HAL_TXERR_XTXOP) - sc->sc_stats.ast_tx_xtxop++; - if (ts->ts_status & HAL_TXERR_TIMER_EXPIRED) - sc->sc_stats.ast_tx_timerexpired++; + /* + * If unicast frame was ack'd update RSSI, + * including the last rx time used to + * workaround phantom bmiss interrupts. + */ + if (ni != NULL && ts->ts_status == 0 && + ((bf->bf_txflags & HAL_TXDESC_NOACK) == 0)) { + nacked++; + sc->sc_stats.ast_tx_rssi = ts->ts_rssi; + ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, + ts->ts_rssi); + } + ATH_TXQ_UNLOCK(txq); - /* XXX HAL_TX_DATA_UNDERRUN */ - /* XXX HAL_TX_DELIM_UNDERRUN */ + /* If unicast frame, update general statistics */ + if (ni != NULL) { + /* update statistics */ + ath_tx_update_stats(sc, ts, bf); + } - if (bf->bf_m->m_flags & M_FF) - sc->sc_stats.ast_ff_txerr++; - } - /* XXX when is this valid? */ - if (ts->ts_status & HAL_TX_DESC_CFG_ERR) - sc->sc_stats.ast_tx_desccfgerr++; - - sr = ts->ts_shortretry; - lr = ts->ts_longretry; - sc->sc_stats.ast_tx_shortretry += sr; - sc->sc_stats.ast_tx_longretry += lr; - /* - * Hand the descriptor to the rate control algorithm. - */ + /* + * Call the completion handler. + * The completion handler is responsible for + * calling the rate control code. + * + * Frames with no completion handler get the + * rate control code called here. + */ + if (bf->bf_comp == NULL) { if ((ts->ts_status & HAL_TXERR_FILT) == 0 && (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) { /* - * If frame was ack'd update statistics, - * including the last rx time used to - * workaround phantom bmiss interrupts. + * XXX assume this isn't an aggregate + * frame. */ - if (ts->ts_status == 0) { - nacked++; - sc->sc_stats.ast_tx_rssi = ts->ts_rssi; - ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, - ts->ts_rssi); - } - ath_rate_tx_complete(sc, an, bf); + ath_rate_tx_complete(sc, ATH_NODE(ni), bf); } - /* - * Do any tx complete callback. Note this must - * be done before releasing the node reference. - */ - if (bf->bf_m->m_flags & M_TXCB) - ieee80211_process_callback(ni, bf->bf_m, - (bf->bf_txflags & HAL_TXDESC_NOACK) == 0 ? - ts->ts_status : HAL_TXERR_XRETRY); - ieee80211_free_node(ni); - } - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - - m_freem(bf->bf_m); - bf->bf_m = NULL; - bf->bf_node = NULL; - - ATH_TXBUF_LOCK(sc); - last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s); - if (last != NULL) - last->bf_flags &= ~ATH_BUF_BUSY; - TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); - ATH_TXBUF_UNLOCK(sc); + ath_tx_default_comp(sc, bf, 0); + } else + bf->bf_comp(sc, bf, 0); } #ifdef IEEE80211_SUPPORT_SUPERG /* @@ -4547,13 +4616,73 @@ ath_tx_proc(void *arg, int npending) } #undef TXQACTIVE -static void +/* + * Return a buffer to the pool and update the 'busy' flag on the + * previous 'tail' entry. + * + * This _must_ only be called when the buffer is involved in a completed + * TX. The logic is that if it was part of an active TX, the previous + * buffer on the list is now not involved in a halted TX DMA queue, waiting + * for restart (eg for TDMA.) + * + * The caller must free the mbuf and recycle the node reference. + */ +void +ath_freebuf(struct ath_softc *sc, struct ath_buf *bf) +{ + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTWRITE); + + KASSERT((bf->bf_node == NULL), ("%s: bf->bf_node != NULL\n", __func__)); + KASSERT((bf->bf_m == NULL), ("%s: bf->bf_m != NULL\n", __func__)); + + ATH_TXBUF_LOCK(sc); + ath_tx_update_busy(sc); + TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ATH_TXBUF_UNLOCK(sc); +} + +/* + * This is currently used by ath_tx_draintxq() and + * ath_tx_tid_free_pkts(). + * + * It recycles a single ath_buf. + */ +void +ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf, int status) +{ + struct ieee80211_node *ni = bf->bf_node; + struct mbuf *m0 = bf->bf_m; + + bf->bf_node = NULL; + bf->bf_m = NULL; + + /* Free the buffer, it's not needed any longer */ + ath_freebuf(sc, bf); + + if (ni != NULL) { + /* + * Do any callback and reclaim the node reference. + */ + if (m0->m_flags & M_TXCB) + ieee80211_process_callback(ni, m0, status); + ieee80211_free_node(ni); + } + m_freem(m0); + + /* + * XXX the buffer used to be freed -after-, but the DMA map was + * freed where ath_freebuf() now is. I've no idea what this + * will do. + */ +} + +void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) { #ifdef ATH_DEBUG struct ath_hal *ah = sc->sc_ah; #endif - struct ieee80211_node *ni; struct ath_buf *bf; u_int ix; @@ -4566,6 +4695,7 @@ ath_tx_draintxq(struct ath_softc *sc, st if (bf != NULL) bf->bf_flags &= ~ATH_BUF_BUSY; ATH_TXBUF_UNLOCK(sc); + for (ix = 0;; ix++) { ATH_TXQ_LOCK(txq); bf = TAILQ_FIRST(&txq->axq_q); @@ -4577,7 +4707,6 @@ ath_tx_draintxq(struct ath_softc *sc, st ATH_TXQ_REMOVE(txq, bf, bf_list); if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; - ATH_TXQ_UNLOCK(txq); #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; @@ -4589,25 +4718,23 @@ ath_tx_draintxq(struct ath_softc *sc, st bf->bf_m->m_len, 0, -1); } #endif /* ATH_DEBUG */ - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - ni = bf->bf_node; - bf->bf_node = NULL; - if (ni != NULL) { - /* - * Do any callback and reclaim the node reference. - */ - if (bf->bf_m->m_flags & M_TXCB) - ieee80211_process_callback(ni, bf->bf_m, -1); - ieee80211_free_node(ni); - } - m_freem(bf->bf_m); - bf->bf_m = NULL; + /* + * Since we're now doing magic in the completion + * functions, we -must- call it for aggregation + * destinations or BAW tracking will get upset. + */ + /* + * Clear ATH_BUF_BUSY; the completion handler + * will free the buffer. + */ + ATH_TXQ_UNLOCK(txq); bf->bf_flags &= ~ATH_BUF_BUSY; - - ATH_TXBUF_LOCK(sc); - TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); - ATH_TXBUF_UNLOCK(sc); + if (bf->bf_comp) + bf->bf_comp(sc, bf, 1); + else + ath_tx_default_comp(sc, bf, 1); } + } static void Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Nov 8 21:25:36 2011 (r227360) +++ head/sys/dev/ath/if_ath_misc.h Tue Nov 8 21:49:33 2011 (r227361) @@ -54,7 +54,14 @@ extern struct ath_buf * ath_getbuf(struc extern struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc); extern struct ath_buf * ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf); +extern void ath_freebuf(struct ath_softc *sc, struct ath_buf *bf); extern int ath_reset(struct ifnet *, ATH_RESET_TYPE); +extern void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq); +extern void ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf, + int fail); + +extern void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf, + int status); #endif From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 21:55:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1EBA106564A; Tue, 8 Nov 2011 21:55:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1EE38FC0A; Tue, 8 Nov 2011 21:55:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8LteVD050947; Tue, 8 Nov 2011 21:55:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8LteVn050945; Tue, 8 Nov 2011 21:55:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082155.pA8LteVn050945@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 21:55: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: r227362 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 21:55:40 -0000 Author: adrian Date: Tue Nov 8 21:55:40 2011 New Revision: 227362 URL: http://svn.freebsd.org/changeset/base/227362 Log: Make sure TXEOL is set on default queues. Otherwise we don't get an interrupt on the completion of a TX queue and this can cause TX hangs / timeout. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 21:49:33 2011 (r227361) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:55:40 2011 (r227362) @@ -4198,6 +4198,7 @@ ath_txq_update(struct ath_softc *sc, int | HAL_TXQ_TXERRINT_ENABLE | HAL_TXQ_TXDESCINT_ENABLE | HAL_TXQ_TXURNINT_ENABLE + | HAL_TXQ_TXEOLINT_ENABLE ; qi.tqi_aifs = wmep->wmep_aifsn; qi.tqi_cwmin = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 22:01:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEC8D1065672; Tue, 8 Nov 2011 22:01:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C485D8FC1F; Tue, 8 Nov 2011 22:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8M13Tc051175; Tue, 8 Nov 2011 22:01:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8M13TE051173; Tue, 8 Nov 2011 22:01:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082201.pA8M13TE051173@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 22:01: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: r227363 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 22:01:04 -0000 Author: adrian Date: Tue Nov 8 22:01:03 2011 New Revision: 227363 URL: http://svn.freebsd.org/changeset/base/227363 Log: Add support to the TX descriptor printing code to follow ath_buf chains. This allows for debugging of aggregate frames. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Tue Nov 8 21:55:40 2011 (r227362) +++ head/sys/dev/ath/if_ath_debug.c Tue Nov 8 22:01:03 2011 (r227363) @@ -123,33 +123,44 @@ ath_printrxbuf(struct ath_softc *sc, con } void -ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *bf, +ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, u_int qnum, u_int ix, int done) { - const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + const struct ath_tx_status *ts = &first_bf->bf_last->bf_status.ds_txstat; + const struct ath_buf *bf = first_bf; struct ath_hal *ah = sc->sc_ah; const struct ath_desc *ds; int i; printf("Q%u[%3u]", qnum, ix); - for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { - printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:04%x%s\n" - " %08x %08x %08x %08x %08x %08x\n", - ds, (const struct ath_desc *)bf->bf_daddr + i, - ds->ds_link, ds->ds_data, bf->bf_txflags, - !done ? "" : (ts->ts_status == 0) ? " *" : " !", - ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); - if (ah->ah_magic == 0x20065416) { - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", - ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], - ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], - ds->ds_hw[10],ds->ds_hw[11]); - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", - ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14], - ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17], - ds->ds_hw[18], ds->ds_hw[19]); + while (bf != NULL) { + for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { + printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%04x%s\n" + " TXF: %04x Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n" + " %08x %08x %08x %08x %08x %08x\n", + ds, (const struct ath_desc *)bf->bf_daddr + i, + ds->ds_link, ds->ds_data, bf->bf_txflags, + !done ? "" : (ts->ts_status == 0) ? " *" : " !", + bf->bf_state.bfs_flags, + bf->bf_state.bfs_seqno, + bf->bf_state.bfs_retries, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw, + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); + if (ah->ah_magic == 0x20065416) { + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], + ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], + ds->ds_hw[10],ds->ds_hw[11]); + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14], + ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17], + ds->ds_hw[18], ds->ds_hw[19]); + } } + printf(" [end]\n"); + bf = bf->bf_next; } } From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 22:43:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01562106566B; Tue, 8 Nov 2011 22:43:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E33378FC1E; Tue, 8 Nov 2011 22:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8MhD1o052564; Tue, 8 Nov 2011 22:43:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8MhDVr052556; Tue, 8 Nov 2011 22:43:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082243.pA8MhDVr052556@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 22:43: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: r227364 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 22:43:14 -0000 Author: adrian Date: Tue Nov 8 22:43:13 2011 New Revision: 227364 URL: http://svn.freebsd.org/changeset/base/227364 Log: Introduce TX aggregation and software TX queue management for Atheros AR5416 and later wireless devices. This is a very large commit - the complete history can be found in the user/adrian/if_ath_tx branch. Legacy (ie, pre-AR5416) devices also use the per-software TXQ support and (in theory) can support non-aggregation ADDBA sessions. However, the net80211 stack doesn't currently support this. In summary: TX path: * queued frames normally go onto a per-TID, per-node queue * some special frames (eg ADDBA control frames) are thrown directly onto the relevant hardware queue so they can go out before any software queued frames are queued. * Add methods to create, suspend, resume and tear down an aggregation session. * Add in software retransmission of both normal and aggregate frames. * Add in completion handling of aggregate frames, including parsing the block ack bitmap provided by the hardware. * Write an aggregation function which can assemble frames into an aggregate based on the selected rate control and channel configuration. * The per-TID queues are locked based on their target hardware TX queue. This matches what ath9k/atheros does, and thus simplified porting over some of the aggregation logic. * When doing TX aggregation, stick the sequence number allocation in the TX path rather than net80211 TX path, and protect it by the TXQ lock. Rate control: * Delay rate control selection until the frame is about to be queued to the hardware, so retried frames can have their rate control choices changed. Frames with a static rate control selection have that applied before each TX, just to simplify the TX path (ie, not have "static" and "dynamic" rate control special cased.) * Teach ath_rate_sample about aggregates - both completion and errors. * Add an EWMA for tracking what the current "good" MCS rate is based on failure rates. Misc: * Introduce a bunch of dirty hacks and workarounds so TID mapping and net80211 frame inspection can be kept out of the net80211 layer. Because of the way this code works (and it's from Atheros and Linux ath9k), there is a consistent, 1:1 mapping between TID and AC. So we need to ensure that frames going to a specific TID will _always_ end up on the right AC, and vice versa, or the completion/locking will simply get very confused. I plan on addressing this mess in the future. Known issues: * There is no BAR frame transmission just yet. A whole lot of tidying up needs to occur before BAR frame TX can occur in the "correct" place - ie, once the TID TX queue has been drained. * Interface reset/purge/etc results in frames in the TX and RX queues being removed. This creates holes in the sequence numbers being assigned and the TX/RX AMPDU code (on either side) just hangs. * There's no filtered frame support at the present moment, so stations going into power saving mode will simply have a number of frames dropped - likely resulting in a traffic "hang". * Raw frame TX is going to just not function with 11n aggregation. Likely this needs to be modified to always override the sequence number if the frame is going into an aggregation session. However, general raw frame injection currently doesn't work in general in net80211, so let's just ignore this for now until this is sorted out. * HT protection is just not implemented and won't be until the above is sorted out. In addition, the AR5416 has issues RTS protecting large aggregates (anything >8k), so the work around needs to be ported and tested. Thus, this will be put on hold until the above work is complete. * The rate control module 'sample' is the only currently supported module; onoe/amrr haven't been tested and have likely bit rotted a little. I'll follow up with some commits to make them work again for non-11n rates, but they won't be updated to handle 11n and aggregation. If someone wishes to do so then they're welcome to send along patches. * .. and "sample" doesn't really do a good job of 11n TX. Specifically, the metrics used (packet TX time and failure/success rates) isn't as useful for 11n. It's likely that it should be extended to take into account the aggregate throughput possible and then choose a rate which maximises that. Ie, it may be acceptable for a higher MCS rate with a higher failure to be used if it gives a more acceptable throughput/latency then a lower MCS rate @ a lower error rate. Again, patches will be gratefully accepted. Because of this, ATH_ENABLE_11N is still not enabled by default. Sponsored by: Hobnob, Inc. Obtained from: Linux, Atheros Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_ath_tx_ht.h head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Tue Nov 8 22:01:03 2011 (r227363) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Tue Nov 8 22:43:13 2011 (r227364) @@ -122,19 +122,21 @@ ath_rate_findrate(struct ath_softc *sc, */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, uint8_t *rix, uint8_t *try) + uint8_t rix0, struct ath_rc_series *rc) { struct amrr_node *amn = ATH_NODE_AMRR(an); -/* rix[0] = amn->amn_tx_rate0; */ - rix[1] = amn->amn_tx_rate1; - rix[2] = amn->amn_tx_rate2; - rix[3] = amn->amn_tx_rate3; - - try[0] = amn->amn_tx_try0; - try[1] = amn->amn_tx_try1; - try[2] = amn->amn_tx_try2; - try[3] = amn->amn_tx_try3; + rc[0].flags = rc[1].flags = rc[2].flags = rc[3].flags = 0; + + rc[0].rix = amn->amn_tx_rate0; + rc[1].rix = amn->amn_tx_rate1; + rc[2].rix = amn->amn_tx_rate2; + rc[3].rix = amn->amn_tx_rate3; + + rc[0].tries = amn->amn_tx_try0; + rc[1].tries = amn->amn_tx_try1; + rc[2].tries = amn->amn_tx_try2; + rc[3].tries = amn->amn_tx_try3; } @@ -153,10 +155,10 @@ ath_rate_setupxtxdesc(struct ath_softc * void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, - const struct ath_buf *bf) + const struct ath_rc_series *rc, const struct ath_tx_status *ts, + int frame_size, int nframes, int nbad) { struct amrr_node *amn = ATH_NODE_AMRR(an); - const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; int sr = ts->ts_shortretry; int lr = ts->ts_longretry; int retry_count = sr + lr; Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Tue Nov 8 22:01:03 2011 (r227363) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Tue Nov 8 22:43:13 2011 (r227364) @@ -130,19 +130,21 @@ ath_rate_findrate(struct ath_softc *sc, */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, uint8_t *rix, uint8_t *try) + uint8_t rix0, struct ath_rc_series *rc) { struct onoe_node *on = ATH_NODE_ONOE(an); -/* rix[0] = on->on_tx_rate0; */ - rix[1] = on->on_tx_rate1; - rix[2] = on->on_tx_rate2; - rix[3] = on->on_tx_rate3; - - try[0] = on->on_tx_try0; - try[1] = 2; - try[2] = 2; - try[3] = 2; + rc[0].flags = rc[1].flags = rc[2].flags = rc[3].flags = 0; + + rc[0].rix = on->on_tx_rate0; + rc[1].rix = on->on_tx_rate1; + rc[2].rix = on->on_tx_rate2; + rc[3].rix = on->on_tx_rate3; + + rc[0].tries = on->on_tx_try0; + rc[1].tries = 2; + rc[2].tries = 2; + rc[3].tries = 2; } void @@ -160,10 +162,10 @@ ath_rate_setupxtxdesc(struct ath_softc * void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, - const struct ath_buf *bf) + const struct ath_rc_series *rc, const struct ath_tx_status *ts, + int frame_size, int nframes, int nbad) { struct onoe_node *on = ATH_NODE_ONOE(an); - const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; if (ts->ts_status == 0) on->on_tx_ok++; Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Tue Nov 8 22:01:03 2011 (r227363) +++ head/sys/dev/ath/ath_rate/sample/sample.c Tue Nov 8 22:43:13 2011 (r227364) @@ -170,12 +170,13 @@ pick_best_rate(struct ath_node *an, cons int size_bin, int require_acked_before) { struct sample_node *sn = ATH_NODE_SAMPLE(an); - int best_rate_rix, best_rate_tt; + int best_rate_rix, best_rate_tt, best_rate_pct; uint32_t mask; - int rix, tt; + int rix, tt, pct; best_rate_rix = 0; best_rate_tt = 0; + best_rate_pct = 0; for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) /* not a supported rate */ continue; @@ -192,13 +193,54 @@ pick_best_rate(struct ath_node *an, cons !sn->stats[size_bin][rix].packets_acked)) continue; + /* Calculate percentage if possible */ + if (sn->stats[size_bin][rix].total_packets > 0) { + pct = sn->stats[size_bin][rix].ewma_pct; + } else { + /* XXX for now, assume 95% ok */ + pct = 95; + } + /* don't use a bit-rate that has been failing */ if (sn->stats[size_bin][rix].successive_failures > 3) continue; - if (best_rate_tt == 0 || tt < best_rate_tt) { - best_rate_tt = tt; - best_rate_rix = rix; + /* + * For HT, Don't use a bit rate that is much more + * lossy than the best. + * + * XXX this isn't optimal; it's just designed to + * eliminate rates that are going to be obviously + * worse. + */ + if (an->an_node.ni_flags & IEEE80211_NODE_HT) { + if (best_rate_pct > (pct + 50)) + continue; + } + + /* + * For non-MCS rates, use the current average txtime for + * comparison. + */ + if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { + if (best_rate_tt == 0 || tt <= best_rate_tt) { + best_rate_tt = tt; + best_rate_rix = rix; + best_rate_pct = pct; + } + } + + /* + * Since 2 stream rates have slightly higher TX times, + * allow a little bit of leeway. This should later + * be abstracted out and properly handled. + */ + if (an->an_node.ni_flags & IEEE80211_NODE_HT) { + if (best_rate_tt == 0 || (tt * 8 <= best_rate_tt * 10)) { + best_rate_tt = tt; + best_rate_rix = rix; + best_rate_pct = pct; + } } } return (best_rate_tt ? best_rate_rix : -1); @@ -257,6 +299,28 @@ pick_sample_rate(struct sample_softc *ss goto nextrate; } + /* + * When doing aggregation, successive failures don't happen + * as often, as sometimes some of the sub-frames get through. + * + * If the sample rix average tx time is greater than the + * average tx time of the current rix, don't immediately use + * the rate for sampling. + */ + if (an->an_node.ni_flags & IEEE80211_NODE_HT) { + if ((sn->stats[size_bin][rix].average_tx_time * 10 > + sn->stats[size_bin][current_rix].average_tx_time * 9) && + (ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout)) { + mask &= ~(1< 11M for non-HT rates */ if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { @@ -320,6 +384,96 @@ ath_rate_update_static_rix(struct ath_so } } +/* + * Pick a non-HT rate to begin using. + */ +static int +ath_rate_pick_seed_rate_legacy(struct ath_softc *sc, struct ath_node *an, + int frameLen) +{ +#define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) +#define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) +#define RATE(ix) (DOT11RATE(ix) / 2) + int rix = -1; + const HAL_RATE_TABLE *rt = sc->sc_currates; + struct sample_node *sn = ATH_NODE_SAMPLE(an); + const int size_bin = size_to_bin(frameLen); + + /* no packet has been sent successfully yet */ + for (rix = rt->rateCount-1; rix > 0; rix--) { + if ((sn->ratemask & (1<info[rix].phy == IEEE80211_T_HT) + continue; + + /* + * Pick the highest rate <= 36 Mbps + * that hasn't failed. + */ + if (DOT11RATE(rix) <= 72 && + sn->stats[size_bin][rix].successive_failures == 0) { + break; + } + } + return rix; +#undef RATE +#undef MCS +#undef DOT11RATE +} + +/* + * Pick a HT rate to begin using. + * + * Don't use any non-HT rates; only consider HT rates. + */ +static int +ath_rate_pick_seed_rate_ht(struct ath_softc *sc, struct ath_node *an, + int frameLen) +{ +#define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) +#define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) +#define RATE(ix) (DOT11RATE(ix) / 2) + int rix = -1, ht_rix = -1; + const HAL_RATE_TABLE *rt = sc->sc_currates; + struct sample_node *sn = ATH_NODE_SAMPLE(an); + const int size_bin = size_to_bin(frameLen); + + /* no packet has been sent successfully yet */ + for (rix = rt->rateCount-1; rix > 0; rix--) { + /* Skip rates we can't use */ + if ((sn->ratemask & (1<info[rix].phy == IEEE80211_T_HT) + ht_rix = rix; + + /* Skip non-HT rates */ + if (rt->info[rix].phy != IEEE80211_T_HT) + continue; + + /* + * Pick a medium-speed rate regardless of stream count + * which has not seen any failures. Higher rates may fail; + * we'll try them later. + */ + if (((MCS(rix) & 0x7) <= 4) && + sn->stats[size_bin][rix].successive_failures == 0) { + break; + } + } + + /* + * If all the MCS rates have successive failures, rix should be + * > 0; otherwise use the lowest MCS rix (hopefully MCS 0.) + */ + return MAX(rix, ht_rix); +#undef RATE +#undef MCS +#undef DOT11RATE +} void @@ -363,9 +517,14 @@ ath_rate_findrate(struct ath_softc *sc, if (sn->sample_tt[size_bin] < average_tx_time * (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { rix = pick_sample_rate(ssc, an, rt, size_bin); IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "size %u sample rate %d current rate %d", - bin_to_size(size_bin), RATE(rix), - RATE(sn->current_rix[size_bin])); + &an->an_node, "att %d sample_tt %d size %u sample rate %d %s current rate %d %s", + average_tx_time, + sn->sample_tt[size_bin], + bin_to_size(size_bin), + dot11rate(rt, rix), + dot11rate_label(rt, rix), + dot11rate(rt, sn->current_rix[size_bin]), + dot11rate_label(rt, sn->current_rix[size_bin])); if (rix != sn->current_rix[size_bin]) { sn->current_sample_rix[size_bin] = rix; } else { @@ -376,29 +535,58 @@ ath_rate_findrate(struct ath_softc *sc, change_rates = 0; if (!sn->packets_sent[size_bin] || best_rix == -1) { /* no packet has been sent successfully yet */ - for (rix = rt->rateCount-1; rix > 0; rix--) { - if ((sn->ratemask & (1<stats[size_bin][rix].successive_failures == 0) { - break; - } - } change_rates = 1; - best_rix = rix; + if (an->an_node.ni_flags & IEEE80211_NODE_HT) + best_rix = + ath_rate_pick_seed_rate_ht(sc, an, frameLen); + else + best_rix = + ath_rate_pick_seed_rate_legacy(sc, an, frameLen); } else if (sn->packets_sent[size_bin] < 20) { /* let the bit-rate switch quickly during the first few packets */ + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, &an->an_node, + "%s: switching quickly..", __func__); change_rates = 1; } else if (ticks - ssc->min_switch > sn->ticks_since_switch[size_bin]) { /* min_switch seconds have gone by */ + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, &an->an_node, + "%s: min_switch %d > ticks_since_switch %d..", + __func__, ticks - ssc->min_switch, sn->ticks_since_switch[size_bin]); change_rates = 1; - } else if (2*average_tx_time < sn->stats[size_bin][sn->current_rix[size_bin]].average_tx_time) { + } else if ((! (an->an_node.ni_flags & IEEE80211_NODE_HT)) && + (2*average_tx_time < sn->stats[size_bin][sn->current_rix[size_bin]].average_tx_time)) { /* the current bit-rate is twice as slow as the best one */ + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, &an->an_node, + "%s: 2x att (= %d) < cur_rix att %d", + __func__, + 2 * average_tx_time, sn->stats[size_bin][sn->current_rix[size_bin]].average_tx_time); change_rates = 1; + } else if ((an->an_node.ni_flags & IEEE80211_NODE_HT)) { + int cur_rix = sn->current_rix[size_bin]; + int cur_att = sn->stats[size_bin][cur_rix].average_tx_time; + /* + * If the node is HT, upgrade it if the MCS rate is + * higher and the average tx time is within 20% of + * the current rate. It can fail a little. + * + * This is likely not optimal! + */ +#if 0 + printf("cur rix/att %x/%d, best rix/att %x/%d\n", + MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); +#endif + if ((MCS(best_rix) > MCS(cur_rix)) && + (average_tx_time * 8) <= (cur_att * 10)) { + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, &an->an_node, + "%s: HT: best_rix 0x%d > cur_rix 0x%x, average_tx_time %d, cur_att %d", + __func__, + MCS(best_rix), MCS(cur_rix), average_tx_time, cur_att); + change_rates = 1; + } } sn->packets_since_sample[size_bin]++; @@ -450,22 +638,24 @@ done: */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, uint8_t *rix, uint8_t *try) + uint8_t rix0, struct ath_rc_series *rc) { struct sample_node *sn = ATH_NODE_SAMPLE(an); const struct txschedule *sched = &sn->sched[rix0]; KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", rix0, sched->r0)); -/* rix[0] = sched->r0; */ - rix[1] = sched->r1; - rix[2] = sched->r2; - rix[3] = sched->r3; - - try[0] = sched->t0; - try[1] = sched->t1; - try[2] = sched->t2; - try[3] = sched->t3; + rc[0].flags = rc[1].flags = rc[2].flags = rc[3].flags = 0; + + rc[0].rix = sched->r0; + rc[1].rix = sched->r1; + rc[2].rix = sched->r2; + rc[3].rix = sched->r3; + + rc[0].tries = sched->t0; + rc[1].tries = sched->t1; + rc[2].tries = sched->t2; + rc[3].tries = sched->t3; } void @@ -493,6 +683,71 @@ ath_rate_setupxtxdesc(struct ath_softc * s3code, sched->t3); /* series 3 */ } +/* + * Update the EWMA percentage. + * + * This is a simple hack to track an EWMA based on the current + * rate scenario. For the rate codes which failed, this will + * record a 0% against it. For the rate code which succeeded, + * EWMA will record the nbad*100/nframes percentage against it. + */ +static void +update_ewma_stats(struct ath_softc *sc, struct ath_node *an, + int frame_size, + int rix0, int tries0, + int rix1, int tries1, + int rix2, int tries2, + int rix3, int tries3, + int short_tries, int tries, int status, + int nframes, int nbad) +{ + struct sample_node *sn = ATH_NODE_SAMPLE(an); + struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); + const int size_bin = size_to_bin(frame_size); + int tries_so_far; + int pct; + int rix = rix0; + + /* Calculate percentage based on current rate */ + if (nframes == 0) + nframes = nbad = 1; + pct = ((nframes - nbad) * 1000) / nframes; + + /* Figure out which rate index succeeded */ + tries_so_far = tries0; + + if (tries1 && tries_so_far < tries) { + tries_so_far += tries1; + rix = rix1; + /* XXX bump ewma pct */ + } + + if (tries2 && tries_so_far < tries) { + tries_so_far += tries2; + rix = rix2; + /* XXX bump ewma pct */ + } + + if (tries3 && tries_so_far < tries) { + rix = rix3; + /* XXX bump ewma pct */ + } + + /* rix is the successful rate, update EWMA for final rix */ + if (sn->stats[size_bin][rix].total_packets < + ssc->smoothing_minpackets) { + /* just average the first few packets */ + int a_pct = (sn->stats[size_bin][rix].packets_acked * 1000) / + (sn->stats[size_bin][rix].total_packets); + sn->stats[size_bin][rix].ewma_pct = a_pct; + } else { + /* use a ewma */ + sn->stats[size_bin][rix].ewma_pct = + ((sn->stats[size_bin][rix].ewma_pct * ssc->smoothing_rate) + + (pct * (100 - ssc->smoothing_rate))) / 100; + } +} + static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, @@ -500,10 +755,12 @@ update_stats(struct ath_softc *sc, struc int rix1, int tries1, int rix2, int tries2, int rix3, int tries3, - int short_tries, int tries, int status) + int short_tries, int tries, int status, + int nframes, int nbad) { struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); + const HAL_RATE_TABLE *rt = sc->sc_currates; const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); int tt, tries_so_far; @@ -542,7 +799,7 @@ update_stats(struct ath_softc *sc, struc /* just average the first few packets */ int avg_tx = sn->stats[size_bin][rix0].average_tx_time; int packets = sn->stats[size_bin][rix0].total_packets; - sn->stats[size_bin][rix0].average_tx_time = (tt+(avg_tx*packets))/(packets+1); + sn->stats[size_bin][rix0].average_tx_time = (tt+(avg_tx*packets))/(packets+nframes); } else { /* use a ewma */ sn->stats[size_bin][rix0].average_tx_time = @@ -550,38 +807,50 @@ update_stats(struct ath_softc *sc, struc (tt * (100 - ssc->smoothing_rate))) / 100; } - if (status != 0) { + /* + * XXX Don't mark the higher bit rates as also having failed; as this + * unfortunately stops those rates from being tasted when trying to + * TX. This happens with 11n aggregation. + */ + if (nframes == nbad) { +#if 0 int y; - sn->stats[size_bin][rix0].successive_failures++; +#endif + sn->stats[size_bin][rix0].successive_failures += nbad; +#if 0 for (y = size_bin+1; y < NUM_PACKET_SIZE_BINS; y++) { /* * Also say larger packets failed since we * assume if a small packet fails at a * bit-rate then a larger one will also. */ - sn->stats[y][rix0].successive_failures++; + sn->stats[y][rix0].successive_failures += nbad; sn->stats[y][rix0].last_tx = ticks; sn->stats[y][rix0].tries += tries; - sn->stats[y][rix0].total_packets++; + sn->stats[y][rix0].total_packets += nframes; } +#endif } else { - sn->stats[size_bin][rix0].packets_acked++; + sn->stats[size_bin][rix0].packets_acked += (nframes - nbad); sn->stats[size_bin][rix0].successive_failures = 0; } sn->stats[size_bin][rix0].tries += tries; sn->stats[size_bin][rix0].last_tx = ticks; - sn->stats[size_bin][rix0].total_packets++; + sn->stats[size_bin][rix0].total_packets += nframes; if (rix0 == sn->current_sample_rix[size_bin]) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d %s sample rate %d tries (%d/%d) tt %d avg_tt (%d/%d)", +"%s: size %d %s sample rate %d %s tries (%d/%d) tt %d avg_tt (%d/%d) nfrm %d nbad %d", __func__, size, status ? "FAIL" : "OK", - rix0, short_tries, tries, tt, + dot11rate(rt, rix0), + dot11rate_label(rt, rix0), + short_tries, tries, tt, sn->stats[size_bin][rix0].average_tx_time, - sn->stats[size_bin][rix0].perfect_tx_time); + sn->stats[size_bin][rix0].perfect_tx_time, + nframes, nbad); sn->sample_tt[size_bin] = tt; sn->current_sample_rix[size_bin] = -1; } @@ -596,21 +865,21 @@ badrate(struct ifnet *ifp, int series, i void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, - const struct ath_buf *bf) + const struct ath_rc_series *rc, const struct ath_tx_status *ts, + int frame_size, int nframes, int nbad) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct sample_node *sn = ATH_NODE_SAMPLE(an); - const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; - const struct ath_desc *ds0 = &bf->bf_desc[0]; - int final_rix, short_tries, long_tries, frame_size; + int final_rix, short_tries, long_tries; const HAL_RATE_TABLE *rt = sc->sc_currates; + int status = ts->ts_status; int mrr; final_rix = rt->rateCodeToIndex[ts->ts_rate]; short_tries = ts->ts_shortretry; long_tries = ts->ts_longretry + 1; - frame_size = ds0->ds_ctl0 & 0x0fff; /* low-order 12 bits of ds_ctl0 */ + if (frame_size == 0) /* NB: should not happen */ frame_size = 1500; @@ -620,63 +889,73 @@ ath_rate_tx_complete(struct ath_softc *s "%s: size %d %s rate/try %d/%d no rates yet", __func__, bin_to_size(size_to_bin(frame_size)), - ts->ts_status ? "FAIL" : "OK", + status ? "FAIL" : "OK", short_tries, long_tries); return; } mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT); if (!mrr || ts->ts_finaltsi == 0) { if (!IS_RATE_DEFINED(sn, final_rix)) { - badrate(ifp, 0, ts->ts_rate, long_tries, ts->ts_status); + badrate(ifp, 0, ts->ts_rate, long_tries, status); return; } /* * Only one rate was used; optimize work. */ IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "%s: size %d (%d bytes) %s rate/try %d %s/%d/%d", + &an->an_node, "%s: size %d (%d bytes) %s rate/try %d %s/%d/%d nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, - ts->ts_status ? "FAIL" : "OK", - dot11rate(rt, final_rix), dot11rate_label(rt, final_rix), short_tries, long_tries); + status ? "FAIL" : "OK", + dot11rate(rt, final_rix), dot11rate_label(rt, final_rix), + short_tries, long_tries, nframes, nbad); update_stats(sc, an, frame_size, final_rix, long_tries, 0, 0, 0, 0, 0, 0, - short_tries, long_tries, ts->ts_status); + short_tries, long_tries, status, + nframes, nbad); + update_ewma_stats(sc, an, frame_size, + final_rix, long_tries, + 0, 0, + 0, 0, + 0, 0, + short_tries, long_tries, status, + nframes, nbad); + } else { - int hwrates[4], tries[4], rix[4]; int finalTSIdx = ts->ts_finaltsi; int i; /* * Process intermediate rates that failed. */ - ath_hal_gettxcompletionrates(sc->sc_ah, ds0, hwrates, tries); - - for (i = 0; i < 4; i++) { - rix[i] = rt->rateCodeToIndex[hwrates[i]]; - } IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d (%d bytes) finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d]", +"%s: size %d (%d bytes) finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d] nframes/nbad [%d/%d]", __func__, bin_to_size(size_to_bin(frame_size)), frame_size, finalTSIdx, - long_tries, - ts->ts_status ? "FAIL" : "OK", - dot11rate(rt, rix[0]), dot11rate_label(rt, rix[0]), tries[0], - dot11rate(rt, rix[1]), dot11rate_label(rt, rix[1]), tries[1], - dot11rate(rt, rix[2]), dot11rate_label(rt, rix[2]), tries[2], - dot11rate(rt, rix[3]), dot11rate_label(rt, rix[3]), tries[3]); + long_tries, + status ? "FAIL" : "OK", + dot11rate(rt, rc[0].rix), + dot11rate_label(rt, rc[0].rix), rc[0].tries, + dot11rate(rt, rc[1].rix), + dot11rate_label(rt, rc[1].rix), rc[1].tries, + dot11rate(rt, rc[2].rix), + dot11rate_label(rt, rc[2].rix), rc[2].tries, + dot11rate(rt, rc[3].rix), + dot11rate_label(rt, rc[3].rix), rc[3].tries, + nframes, nbad); for (i = 0; i < 4; i++) { - if (tries[i] && !IS_RATE_DEFINED(sn, rix[i])) - badrate(ifp, 0, hwrates[i], tries[i], ts->ts_status); + if (rc[i].tries && !IS_RATE_DEFINED(sn, rc[i].rix)) + badrate(ifp, 0, rc[i].ratecode, rc[i].tries, + status); } /* @@ -686,48 +965,62 @@ ath_rate_tx_complete(struct ath_softc *s * sample higher rates 1 try at a time doing so * may unfairly penalize them. */ - if (tries[0]) { - update_stats(sc, an, frame_size, - rix[0], tries[0], - rix[1], tries[1], - rix[2], tries[2], - rix[3], tries[3], - short_tries, long_tries, - long_tries > tries[0]); - long_tries -= tries[0]; + if (rc[0].tries) { + update_stats(sc, an, frame_size, + rc[0].rix, rc[0].tries, + rc[1].rix, rc[1].tries, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + short_tries, long_tries, + long_tries > rc[0].tries, + nframes, nbad); + long_tries -= rc[0].tries; } - if (tries[1] && finalTSIdx > 0) { - update_stats(sc, an, frame_size, - rix[1], tries[1], - rix[2], tries[2], - rix[3], tries[3], - 0, 0, - short_tries, long_tries, - ts->ts_status); - long_tries -= tries[1]; + if (rc[1].tries && finalTSIdx > 0) { + update_stats(sc, an, frame_size, + rc[1].rix, rc[1].tries, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + 0, 0, + short_tries, long_tries, + status, + nframes, nbad); + long_tries -= rc[1].tries; } - if (tries[2] && finalTSIdx > 1) { - update_stats(sc, an, frame_size, - rix[2], tries[2], - rix[3], tries[3], + if (rc[2].tries && finalTSIdx > 1) { + update_stats(sc, an, frame_size, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, 0, 0, 0, 0, - short_tries, long_tries, - ts->ts_status); - long_tries -= tries[2]; + short_tries, long_tries, + status, + nframes, nbad); + long_tries -= rc[2].tries; } - if (tries[3] && finalTSIdx > 2) { - update_stats(sc, an, frame_size, - rix[3], tries[3], + if (rc[3].tries && finalTSIdx > 2) { + update_stats(sc, an, frame_size, + rc[3].rix, rc[3].tries, 0, 0, 0, 0, 0, 0, - short_tries, long_tries, - ts->ts_status); + short_tries, long_tries, + status, + nframes, nbad); } + + update_ewma_stats(sc, an, frame_size, + rc[0].rix, rc[0].tries, + rc[1].rix, rc[1].tries, + rc[2].rix, rc[2].tries, + rc[3].rix, rc[3].tries, + short_tries, long_tries, + long_tries > rc[0].tries, + nframes, nbad); + } } @@ -849,6 +1142,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, sn->stats[y][rix].total_packets = 0; sn->stats[y][rix].packets_acked = 0; sn->stats[y][rix].last_tx = 0; + sn->stats[y][rix].ewma_pct = 0; sn->stats[y][rix].perfect_tx_time = calc_usecs_unicast_packet(sc, size, rix, 0, 0, @@ -886,18 +1180,24 @@ sample_stats(void *arg, struct ieee80211 uint32_t mask; int rix, y; - printf("\n[%s] refcnt %d static_rix %d ratemask 0x%x\n", + printf("\n[%s] refcnt %d static_rix (%d %s) ratemask 0x%x\n", ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni), - sn->static_rix, sn->ratemask); + dot11rate(rt, sn->static_rix), + dot11rate_label(rt, sn->static_rix), + sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { printf("[%4u] cur rix %d (%d %s) since switch: packets %d ticks %u\n", bin_to_size(y), sn->current_rix[y], dot11rate(rt, sn->current_rix[y]), dot11rate_label(rt, sn->current_rix[y]), sn->packets_since_switch[y], sn->ticks_since_switch[y]); - printf("[%4u] last sample %d cur sample %d packets sent %d\n", - bin_to_size(y), sn->last_sample_rix[y], - sn->current_sample_rix[y], sn->packets_sent[y]); + printf("[%4u] last sample (%d %s) cur sample (%d %s) packets sent %d\n", + bin_to_size(y), + dot11rate(rt, sn->last_sample_rix[y]), + dot11rate_label(rt, sn->last_sample_rix[y]), + dot11rate(rt, sn->current_sample_rix[y]), + dot11rate_label(rt, sn->current_sample_rix[y]), + sn->packets_sent[y]); printf("[%4u] packets since sample %d sample tt %u\n", bin_to_size(y), sn->packets_since_sample[y], sn->sample_tt[y]); @@ -908,13 +1208,15 @@ sample_stats(void *arg, struct ieee80211 for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) T %8ju F %4d avg %5u last %u\n", + printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) (EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n", dot11rate(rt, rix), dot11rate_label(rt, rix), bin_to_size(y), (uintmax_t) sn->stats[y][rix].total_packets, (uintmax_t) sn->stats[y][rix].packets_acked, (int) ((sn->stats[y][rix].packets_acked * 100ULL) / sn->stats[y][rix].total_packets), + sn->stats[y][rix].ewma_pct / 10, + sn->stats[y][rix].ewma_pct % 10, (uintmax_t) sn->stats[y][rix].tries, sn->stats[y][rix].successive_failures, sn->stats[y][rix].average_tx_time, Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Tue Nov 8 22:01:03 2011 (r227363) +++ head/sys/dev/ath/ath_rate/sample/sample.h Tue Nov 8 22:43:13 2011 (r227364) @@ -51,6 +51,7 @@ struct sample_softc { int max_successive_failures; int stale_failure_timeout; /* how long to honor max_successive_failures */ int min_switch; /* min time between rate changes */ + int min_good_pct; /* min good percentage for a rate to be considered */ }; #define ATH_SOFTC_SAMPLE(sc) ((struct sample_softc *)sc->sc_rc) @@ -60,6 +61,7 @@ struct rate_stats { uint64_t tries; uint64_t total_packets; /* pkts total since assoc */ uint64_t packets_acked; /* pkts acked since assoc */ + int ewma_pct; /* EWMA percentage */ unsigned perfect_tx_time; /* transmit time for 0 retries */ int last_tx; }; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 22:01:03 2011 (r227363) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 22:43:13 2011 (r227364) @@ -723,6 +723,19 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_scan_end = ath_scan_end; ic->ic_set_channel = ath_set_channel; + /* 802.11n specific - but just override anyway */ + sc->sc_addba_request = ic->ic_addba_request; + sc->sc_addba_response = ic->ic_addba_response; + sc->sc_addba_stop = ic->ic_addba_stop; + sc->sc_bar_response = ic->ic_bar_response; + sc->sc_addba_response_timeout = ic->ic_addba_response_timeout; + + ic->ic_addba_request = ath_addba_request; + ic->ic_addba_response = ath_addba_response; + ic->ic_addba_response_timeout = ath_addba_response_timeout; + ic->ic_addba_stop = ath_addba_stop; + ic->ic_bar_response = ath_bar_response; + ieee80211_radiotap_attach(ic, &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), ATH_TX_RADIOTAP_PRESENT, @@ -3343,6 +3356,9 @@ ath_node_alloc(struct ieee80211vap *vap, device_get_nameunit(sc->sc_dev), an); mtx_init(&an->an_mtx, an->an_name, NULL, MTX_DEF); + /* XXX setup ath_tid */ + ath_tx_tid_init(sc, an); + DPRINTF(sc, ATH_DEBUG_NODE, "%s: an %p\n", __func__, an); return &an->an_node; } @@ -3354,6 +3370,7 @@ ath_node_cleanup(struct ieee80211_node * struct ath_softc *sc = ic->ic_ifp->if_softc; /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */ + ath_tx_node_flush(sc, ATH_NODE(ni)); ath_rate_node_cleanup(sc, ATH_NODE(ni)); sc->sc_node_cleanup(ni); } @@ -4364,6 +4381,29 @@ ath_tx_default_comp(struct ath_softc *sc } /* + * Update rate control with the given completion status. + */ +void +ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, + struct ath_rc_series *rc, struct ath_tx_status *ts, int frmlen, + int nframes, int nbad) +{ + struct ath_node *an; + + /* Only for unicast frames */ + if (ni == NULL) + return; + + an = ATH_NODE(ni); + + if ((ts->ts_status & HAL_TXERR_FILT) == 0) { + ATH_NODE_LOCK(an); + ath_rate_tx_complete(sc, an, rc, ts, frmlen, nframes, nbad); + ATH_NODE_UNLOCK(an); + } +} + +/* * Update the busy status of the last frame on the free list. * When doing TDMA, the busy flag tracks whether the hardware * currently points to this buffer or not, and thus gated DMA @@ -4396,6 +4436,8 @@ ath_tx_update_busy(struct ath_softc *sc) /* * Process completed xmit descriptors from the specified queue. + * Kick the packet scheduler if needed. This can occur from this + * particular task. */ static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) @@ -4405,6 +4447,7 @@ ath_tx_processq(struct ath_softc *sc, st struct ath_desc *ds; struct ath_tx_status *ts; struct ieee80211_node *ni; + struct ath_node *an; int nacked; HAL_STATUS status; @@ -4471,6 +4514,7 @@ ath_tx_processq(struct ath_softc *sc, st /* If unicast frame, update general statistics */ if (ni != NULL) { + an = ATH_NODE(ni); /* update statistics */ ath_tx_update_stats(sc, ts, bf); } @@ -4490,7 +4534,10 @@ ath_tx_processq(struct ath_softc *sc, st * XXX assume this isn't an aggregate * frame. */ - ath_rate_tx_complete(sc, ATH_NODE(ni), bf); + ath_tx_update_ratectrl(sc, ni, + bf->bf_state.bfs_rc, ts, + bf->bf_state.bfs_pktlen, 1, + (ts->ts_status == 0 ? 0 : 1)); } ath_tx_default_comp(sc, bf, 0); } else @@ -4503,6 +4550,14 @@ ath_tx_processq(struct ath_softc *sc, st if (txq->axq_depth <= 1) ieee80211_ff_flush(ic, txq->axq_ac); #endif + + /* Kick the TXQ scheduler */ + if (dosched) { + ATH_TXQ_LOCK(txq); + ath_txq_sched(sc, txq); + ATH_TXQ_UNLOCK(txq); + } + return nacked; } @@ -4736,6 +4791,11 @@ ath_tx_draintxq(struct ath_softc *sc, st ath_tx_default_comp(sc, bf, 1); } + /* + * Drain software queued frames which are on + * active TIDs. + */ + ath_tx_txq_drain(sc, txq); } static void Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Nov 8 22:01:03 2011 (r227363) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 22:50:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B740106566C; Tue, 8 Nov 2011 22:50:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ACBD8FC15; Tue, 8 Nov 2011 22:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8MoSQl052860; Tue, 8 Nov 2011 22:50:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8MoSMi052856; Tue, 8 Nov 2011 22:50:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111082250.pA8MoSMi052856@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 22:50: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: r227365 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 22:50:29 -0000 Author: adrian Date: Tue Nov 8 22:50:28 2011 New Revision: 227365 URL: http://svn.freebsd.org/changeset/base/227365 Log: Fix the KTR option to compile by default - it was referencing some unmerged interrupt status debugging code from my branch. * Add ah_intrstate[8] which will have the record of the last call to ath_hal_getintr(). * Wrap the KTR code behind ATH_KTR_INTR_DEBUG. * Add the HAL interrupt debugging behind AH_INTERRUPT_DEBUGGING. This is only done for the AR5416 and later NICs but it will be trivial to add to the earlier NICs if required. Neither are enabled by default, although to minimise HAL binary API differences, the ah_intrstate[] array is always compiled into the ath_hal struct. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Nov 8 22:43:13 2011 (r227364) +++ head/sys/dev/ath/ath_hal/ah.h Tue Nov 8 22:50:28 2011 (r227365) @@ -810,6 +810,8 @@ struct ath_hal { uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ + uint32_t ah_intrstate[8]; /* last int state */ + HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Nov 8 22:43:13 2011 (r227364) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Nov 8 22:50:28 2011 (r227365) @@ -70,6 +70,13 @@ ar5416GetPendingInterrupts(struct ath_ha uint32_t isr, isr0, isr1, sync_cause = 0; HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; +#ifdef AH_INTERRUPT_DEBUGGING + /* + * Blank the interrupt debugging area regardless. + */ + bzero(&ah->ah_intrstate, sizeof(ah->ah_intrstate)); +#endif + /* * Verify there's a mac interrupt and the RTC is on. */ @@ -90,6 +97,16 @@ ar5416GetPendingInterrupts(struct ath_ha return AH_FALSE; } +#ifdef AH_INTERRUPT_DEBUGGING + ah->ah_intrstate[0] = isr; + ah->ah_intrstate[1] = OS_REG_READ(ah, AR_ISR_S0); + ah->ah_intrstate[2] = OS_REG_READ(ah, AR_ISR_S1); + ah->ah_intrstate[3] = OS_REG_READ(ah, AR_ISR_S2); + ah->ah_intrstate[4] = OS_REG_READ(ah, AR_ISR_S3); + ah->ah_intrstate[5] = OS_REG_READ(ah, AR_ISR_S4); + ah->ah_intrstate[6] = OS_REG_READ(ah, AR_ISR_S5); +#endif + if (isr != 0) { struct ath_hal_5212 *ahp = AH5212(ah); uint32_t mask2; Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 22:43:13 2011 (r227364) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 22:50:28 2011 (r227365) @@ -1376,6 +1376,7 @@ ath_intr(void *arg) ath_hal_getisr(ah, &status); /* NB: clears ISR too */ DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status); CTR1(ATH_KTR_INTR, "ath_intr: mask=0x%.8x", status); +#ifdef ATH_KTR_INTR_DEBUG CTR5(ATH_KTR_INTR, "ath_intr: ISR=0x%.8x, ISR_S0=0x%.8x, ISR_S1=0x%.8x, ISR_S2=0x%.8x, ISR_S5=0x%.8x", ah->ah_intrstate[0], @@ -1383,6 +1384,7 @@ ath_intr(void *arg) ah->ah_intrstate[2], ah->ah_intrstate[3], ah->ah_intrstate[6]); +#endif status &= sc->sc_imask; /* discard unasked for bits */ /* Short-circuit un-handled interrupts */ From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 23:02:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA51106564A; Tue, 8 Nov 2011 23:02:33 +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 0BC658FC12; Tue, 8 Nov 2011 23:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8N2Wq5053360; Tue, 8 Nov 2011 23:02:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8N2Wmj053356; Tue, 8 Nov 2011 23:02:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111082302.pA8N2Wmj053356@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 8 Nov 2011 23:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 23:02:33 -0000 Author: jilles Date: Tue Nov 8 23:02:32 2011 New Revision: 227366 URL: http://svn.freebsd.org/changeset/base/227366 Log: rc.d: Eliminate some unnecessary non-POSIX constructs: * set - ... * empty braces * ^ in character class Modified: head/etc/rc.d/routing head/etc/rc.d/syscons head/etc/rc.subr Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Tue Nov 8 22:50:28 2011 (r227365) +++ head/etc/rc.d/routing Tue Nov 8 23:02:32 2011 (r227366) @@ -247,6 +247,7 @@ static_atm() static_ipx() { + : } ropts_init() Modified: head/etc/rc.d/syscons ============================================================================== --- head/etc/rc.d/syscons Tue Nov 8 22:50:28 2011 (r227365) +++ head/etc/rc.d/syscons Tue Nov 8 23:02:32 2011 (r227366) @@ -99,7 +99,7 @@ syscons_configure_keyboard() *) sc_init echo -n ' keychange' - set - ${keychange} + set -- ${keychange} while [ $# -gt 0 ]; do kbdcontrol <${kbddev} -f "$1" "$2" shift; shift Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Tue Nov 8 22:50:28 2011 (r227365) +++ head/etc/rc.subr Tue Nov 8 23:02:32 2011 (r227366) @@ -1638,7 +1638,7 @@ find_local_scripts_old () { continue zlist="$zlist $file" done - for file in ${dir}/[^0-9]*.sh; do + for file in ${dir}/[!0-9]*.sh; do grep '^# PROVIDE:' $file >/dev/null 2>&1 && continue slist="$slist $file" From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 23:19:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79805106566B; Tue, 8 Nov 2011 23:19:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FEE8FC0A; Tue, 8 Nov 2011 23:19:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8NJMOC053941; Tue, 8 Nov 2011 23:19:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8NJMSc053939; Tue, 8 Nov 2011 23:19:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111082319.pA8NJMSc053939@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Nov 2011 23:19: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: r227367 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 23:19:22 -0000 Author: yongari Date: Tue Nov 8 23:19:22 2011 New Revision: 227367 URL: http://svn.freebsd.org/changeset/base/227367 Log: Comment out TI_JUMBO_HDRSPLIT. TI_JUMBO_HDRSPLIT requires TI_SF_BUF_JUMBO. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Nov 8 23:02:32 2011 (r227366) +++ head/sys/conf/NOTES Tue Nov 8 23:19:22 2011 (r227367) @@ -2147,7 +2147,7 @@ device ral # Ralink Technology RT2500 # Turn on the header splitting option for the ti(4) driver firmware. This # only works for Tigon II chips, and has no effect for Tigon I chips. # This option requires the TI_SF_BUF_JUMBO option above. -options TI_JUMBO_HDRSPLIT +#options TI_JUMBO_HDRSPLIT # # Use header splitting feature on bce(4) adapters. From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 23:44:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A984B106566B; Tue, 8 Nov 2011 23:44:26 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9922B8FC1C; Tue, 8 Nov 2011 23:44:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8NiQYj054740; Tue, 8 Nov 2011 23:44:26 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8NiQxn054736; Tue, 8 Nov 2011 23:44:26 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201111082344.pA8NiQxn054736@svn.freebsd.org> From: Josh Paetzel Date: Tue, 8 Nov 2011 23:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227368 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 23:44:26 -0000 Author: jpaetzel Date: Tue Nov 8 23:44:26 2011 New Revision: 227368 URL: http://svn.freebsd.org/changeset/base/227368 Log: Welcome the initial patches for OSX bootcamp support!!! This should let you select the ada0p3 hybrid MBR/GPT partition, and do an installation to it. Approved by: kib (mentor) Obtained from: kris@pcbsd.org MFC after: 3 days Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh head/usr.sbin/pc-sysinstall/backend/functions-disk.sh head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Tue Nov 8 23:19:22 2011 (r227367) +++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh Tue Nov 8 23:44:26 2011 (r227368) @@ -179,7 +179,9 @@ setup_gpart_partitions() else PARTLETTER="a" CURPART="1" - rc_halt "gpart create -s BSD ${_wSlice}" + if [ "${_pType}" = "mbr" ] ; then + rc_halt "gpart create -s BSD ${_wSlice}" + fi fi while read line @@ -255,6 +257,9 @@ setup_gpart_partitions() if [ "${CURPART}" = "1" -a "$_pType" = "mbr" ] ; then export FOUNDROOT="0" fi + if [ "${CURPART}" = "1" -a "$_pType" = "gptslice" ] ; then + export FOUNDROOT="0" + fi fi check_for_mount "${MNT}" "/boot" @@ -266,6 +271,9 @@ setup_gpart_partitions() if [ "${CURPART}" != "1" -a "${_pType}" = "mbr" ] ; then exit_err "/boot partition must be first partition" fi + if [ "${CURPART}" != "1" -a "${_pType}" = "gptslice" ] ; then + exit_err "/boot partition must be first partition" + fi if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] ; then exit_err "/boot partition must be formatted with UFS" @@ -287,7 +295,7 @@ setup_gpart_partitions() # Check if using zfs mirror echo ${XTRAOPTS} | grep -q "mirror" 2>/dev/null if [ $? -eq 0 -a "$FS" = "ZFS" ] ; then - if [ "${_pType}" = "gpt" ] ; then + if [ "${_pType}" = "gpt" -o "${_pType}" = "gptslice" ] ; then XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_pDisk}p${CURPART}") else XTRAOPTS=$(setup_zfs_mirror_parts "$XTRAOPTS" "${_wSlice}") @@ -305,11 +313,17 @@ setup_gpart_partitions() if [ "${_pType}" = "gpt" ] ; then if [ "$CURPART" = "2" ] ; then # If this is GPT, make sure first partition is aligned to 4k + sleep 2 rc_halt "gpart add -b 2016 ${SOUT} -t ${PARTYPE} ${_pDisk}" else + sleep 2 rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_pDisk}" fi + elif [ "${_pType}" = "gptslice" ]; then + sleep 2 + rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_wSlice}" else + sleep 2 rc_halt "gpart add ${SOUT} -t ${PARTYPE} -i ${CURPART} ${_wSlice}" fi @@ -338,7 +352,7 @@ setup_gpart_partitions() echo "${ENCPASS}" >${PARTDIR}-enc/${_dFile}p${CURPART}-encpass fi else - # MBR Partition + # MBR Partition or GPT slice _dFile="`echo $_wSlice | sed 's|/|-|g'`" echo "${FS}:${MNT}:${ENC}:${PLABEL}:MBR:${XTRAOPTS}:${IMAGE}" >${PARTDIR}/${_dFile}${PARTLETTER} # Clear out any headers @@ -422,7 +436,7 @@ populate_disk_label() if [ "$type" = "mbr" ] ; then wrkslice="${diskid}s${slicenum}" fi - if [ "$type" = "gpt" ] ; then + if [ "$type" = "gpt" -o "$type" = "gptslice" ] ; then wrkslice="${diskid}p${slicenum}" fi @@ -459,6 +473,9 @@ setup_disk_label() if [ "$type" = "gpt" -a ! -e "${disk}p${pnum}" ] ; then exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" fi + if [ "$type" = "gptslice" -a ! -e "${disk}p${pnum}" ] ; then + exit_err "ERROR: The partition ${i} doesn't exist! gpart failure!" + fi done # Setup some files which we'll be referring to Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Tue Nov 8 23:19:22 2011 (r227367) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Tue Nov 8 23:44:26 2011 (r227368) @@ -496,6 +496,13 @@ setup_disk_slice() run_gpart_slice "${DISK}" "${BMANAGER}" "${s}" ;; + p1|p2|p3|p4|p5|p6|p7|p8|p9|p10|p11|p12|p13|p14|p15|p16|p17|p18|p19|p20) + tmpSLICE="${DISK}${PTYPE}" + # Get the number of the gpt partition we are working on + s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" + run_gpart_gpt_part "${DISK}" "${BMANAGER}" "${s}" + ;; + free) tmpSLICE="${DISK}s${LASTSLICE}" run_gpart_free "${DISK}" "${LASTSLICE}" "${BMANAGER}" @@ -704,6 +711,58 @@ run_gpart_full() fi }; +# Function which runs gpart on a specified gpt partition +run_gpart_gpt_part() +{ + DISK=$1 + + # Set the slice we will use later + slice="${1}p${3}" + + # Set our sysctl so we can overwrite any geom using drives + sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT} + + # Get the number of the slice we are working on + slicenum="$3" + + # Stop any journaling + stop_gjournal "${slice}" + + # Make sure we have disabled swap on this drive + if [ -e "${slice}b" ] + then + swapoff ${slice}b >/dev/null 2>/dev/null + swapoff ${slice}b.eli >/dev/null 2>/dev/null + fi + + # Modify partition type + echo_log "Running gpart modify on ${DISK}" + rc_halt "gpart modify -t freebsd -i ${slicenum} ${DISK}" + sleep 2 + + # Clean up old partition + echo_log "Cleaning up $slice" + rc_halt "dd if=/dev/zero of=${DISK}p${slicenum} count=1024" + + sleep 4 + + # Init the MBR partition + rc_halt "gpart create -s BSD ${DISK}p${slicenum}" + + # Set the slice to the format we'll be using for gpart later + slice=`echo "${1}:${3}:gptslice" | sed 's|/|-|g'` + + # Lets save our slice, so we know what to look for in the config file later on + if [ -z "$WORKINGSLICES" ] + then + WORKINGSLICES="${slice}" + export WORKINGSLICES + else + WORKINGSLICES="${WORKINGSLICES} ${slice}" + export WORKINGSLICES + fi +}; + # Function which runs gpart on a specified s1-4 slice run_gpart_slice() { Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Tue Nov 8 23:19:22 2011 (r227367) +++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh Tue Nov 8 23:44:26 2011 (r227368) @@ -70,7 +70,6 @@ check_value installMode "fresh upgrade e check_value installType "PCBSD FreeBSD" check_value installMedium "dvd usb ftp rsync image local" check_value packageType "uzip tar rsync split" -if_check_value_exists partition "all s1 s2 s3 s4 free image" if_check_value_exists mirrorbal "load prefer round-robin split" # We passed all sanity checks! Yay, lets start the install From owner-svn-src-head@FreeBSD.ORG Tue Nov 8 23:54:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD4C106566C; Tue, 8 Nov 2011 23:54:39 +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 5B5528FC14; Tue, 8 Nov 2011 23:54:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8NsdKZ055082; Tue, 8 Nov 2011 23:54:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8NsdhP055080; Tue, 8 Nov 2011 23:54:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201111082354.pA8NsdhP055080@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 8 Nov 2011 23:54: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: r227369 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 23:54:39 -0000 Author: jilles Date: Tue Nov 8 23:54:39 2011 New Revision: 227369 URL: http://svn.freebsd.org/changeset/base/227369 Log: sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic. With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged. Modified: head/bin/sh/arith_yacc.c Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Tue Nov 8 23:44:26 2011 (r227368) +++ head/bin/sh/arith_yacc.c Tue Nov 8 23:54:39 2011 (r227369) @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t yyerror("divide error"); return op == ARITH_REM ? a % b : a / b; case ARITH_MUL: - return a * b; + return (uintmax_t)a * (uintmax_t)b; case ARITH_ADD: - return a + b; + return (uintmax_t)a + (uintmax_t)b; case ARITH_SUB: - return a - b; + return (uintmax_t)a - (uintmax_t)b; case ARITH_LSHIFT: return a << b; case ARITH_RSHIFT: From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 01:40:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40BC31065676; Wed, 9 Nov 2011 01:40:47 +0000 (UTC) (envelope-from grog@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FE5F8FC0C; Wed, 9 Nov 2011 01:40:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA91elb1058501; Wed, 9 Nov 2011 01:40:47 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA91elaY058496; Wed, 9 Nov 2011 01:40:47 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201111090140.pA91elaY058496@svn.freebsd.org> From: Greg Lehey Date: Wed, 9 Nov 2011 01:40: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: r227370 - head/usr.bin/calendar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 01:40:47 -0000 Author: grog Date: Wed Nov 9 01:40:46 2011 New Revision: 227370 URL: http://svn.freebsd.org/changeset/base/227370 Log: Tidy up command line processing: - Add ? option to optstring. - Sort options alphabetically. - Vertical space. Tidy up usage() function. Bring man page in sync with source. Ensure that debug code is only executed with the -d option. Submitted by: Christiane Yeardley Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/calendar.c head/usr.bin/calendar/io.c head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Tue Nov 8 23:54:39 2011 (r227369) +++ head/usr.bin/calendar/calendar.1 Wed Nov 9 01:40:46 2011 (r227370) @@ -36,11 +36,14 @@ .Nd reminder service .Sh SYNOPSIS .Nm -.Op Fl a .Op Fl A Ar num +.Op Fl a .Op Fl B Ar num +.Op Fl D Ar moon|sun +.Op Fl d .Op Fl F Ar friday .Op Fl f Ar calendarfile +.Op Fl l Ar longitude .Oo .Bk -words .Fl t Ar dd Ns @@ -49,16 +52,14 @@ .Sm on .Ek .Oc -.Op Fl W Ar num .Op Fl U Ar UTC-offset -.Op Fl l Ar longitude +.Op Fl W Ar num .Sh DESCRIPTION The .Nm utility checks the current directory for a file named .Pa calendar -and displays lines that begin with either today's date -or tomorrow's. +and displays lines that fall into the specified date range. On the day before a weekend (normally Friday), events for the next three days are displayed. .Pp @@ -76,6 +77,10 @@ This requires super-user privileges. Print lines from today and the previous .Ar num days (backward, past). +.It Fl D Ar moon|sun +Print UTC offset, longitude and moon or sun information. +.It Fl d +Debug option: print current date information. .It Fl F Ar friday Specify which day of the week is ``Friday'' (the day before the weekend begins). @@ -84,6 +89,11 @@ Default is 5. Use .Pa calendarfile as the default calendar file. +.It Fl l Ar longitude +Perform lunar and solar calculations from this longitude. +If neither longitude nor UTC offset is specified, the calculations will +be based on the difference between UTC time and localtime. +If both are specified, UTC offset overrides longitude. .It Xo Fl t .Sm off .Ar dd @@ -91,12 +101,11 @@ as the default calendar file. .Sm on .Xc For test purposes only: set date directly to argument values. -.It Fl l Ar longitude , Fl U Ar UTC-offset -Only one is needed: -Perform lunar and solar calculations from this longitude or from -this UTC offset. -If neither is specified, the calculations will be based on the -difference between UTC time and localtime. +.It Fl U Ar UTC-offset +Perform lunar and solar calculations from this UTC offset. +If neither UTC offset nor longitude is specified, the calculations +will be based on the difference between UTC time and localtime. +If both are specified, UTC offset overrides longitude. .It Fl W Ar num Print lines from today and the next .Ar num Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Tue Nov 8 23:54:39 2011 (r227369) +++ head/usr.bin/calendar/calendar.c Wed Nov 9 01:40:46 2011 (r227370) @@ -35,7 +35,7 @@ static const char copyright[] = #if 0 #ifndef lint -static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; +static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #endif #endif @@ -79,7 +79,7 @@ main(int argc, char *argv[]) (void)setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "-A:aB:dD:F:f:l:t:U:W:")) != -1) + while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1) switch (ch) { case '-': /* backward contemptible */ case 'a': @@ -90,10 +90,6 @@ main(int argc, char *argv[]) doall = 1; break; - case 'f': /* other calendar file */ - calendarFile = optarg; - break; - case 'W': /* we don't need no steenking Fridays */ Friday = -1; /* FALLTHROUGH */ @@ -106,26 +102,34 @@ main(int argc, char *argv[]) f_dayBefore = atoi(optarg); break; + case 'D': /* debug output of sun and moon info */ + DEBUG = optarg; + break; + + case 'd': /* debug output of current date */ + debug = 1; + break; + case 'F': /* Change the time: When does weekend start? */ Friday = atoi(optarg); break; + + case 'f': /* other calendar file */ + calendarFile = optarg; + break; + case 'l': /* Change longitudal position */ EastLongitude = strtol(optarg, NULL, 10); break; - case 'U': /* Change UTC offset */ - UTCOffset = strtod(optarg, NULL); - break; - case 'd': - debug = 1; - break; - case 'D': - DEBUG = optarg; - break; - case 't': /* other date, undocumented, for tests */ + case 't': /* other date, for tests */ f_time = Mktime(optarg); break; + case 'U': /* Change UTC offset */ + UTCOffset = strtod(optarg, NULL); + break; + case '?': default: usage(); @@ -216,10 +220,9 @@ usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: calendar [-a] [-A days] [-B days] [-F friday] " - "[-f calendarfile]", - " [-d] [-t dd[.mm[.year]]] [-W days]", - " [-U utcoffset] [-l longitude]" + "usage: calendar [-A days] [-a] [-B days] [-D sun|moon] [-d]", + " [-F friday] [-f calendarfile] [-l longitude]", + " [-t dd[.mm[.year]]] [-U utcoffset] [-W days]" ); exit(1); } Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Tue Nov 8 23:54:39 2011 (r227369) +++ head/usr.bin/calendar/io.c Wed Nov 9 01:40:46 2011 (r227370) @@ -176,7 +176,8 @@ cal(void) *pp = p; if (count < 0) { /* Show error status based on return value */ - fprintf(stderr, "Ignored: %s\n", buf); + if (debug) + fprintf(stderr, "Ignored: %s\n", buf); if (count == -1) continue; count = -count + 1; Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Tue Nov 8 23:54:39 2011 (r227369) +++ head/usr.bin/calendar/parsedata.c Wed Nov 9 01:40:46 2011 (r227370) @@ -10,7 +10,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 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 @@ -22,7 +22,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + * */ #include @@ -79,7 +79,7 @@ static char *floattotime(double f); * '300' ... '359' | '360' ... '365' * ModifierIndex ::= 'Second' | 'Third' | 'Fourth' | 'Fifth' | * 'First' | 'Last' - * + * * SpecialDay ::= 'Easter' | 'Paskha' | 'ChineseNewYear' * */ @@ -313,7 +313,7 @@ fail: allfine: *p = pold; return (1); - + } static void @@ -407,7 +407,7 @@ parsedaymonth(char *date, int *yearp, in * * Month: 1-12 * Monthname: Jan .. Dec - * Day: 1-31 + * Day: 1-31 * Weekday: Mon .. Sun * */ @@ -754,10 +754,13 @@ parsedaymonth(char *date, int *yearp, in continue; } - printf("Unprocessed:\n"); - debug_determinestyle(2, date, lflags, month, imonth, - dayofmonth, idayofmonth, dayofweek, idayofweek, - modifieroffset, modifierindex, specialday, syear, iyear); + if (debug) { + printf("Unprocessed:\n"); + debug_determinestyle(2, date, lflags, month, imonth, + dayofmonth, idayofmonth, dayofweek, idayofweek, + modifieroffset, modifierindex, specialday, syear, + iyear); + } retvalsign = -1; } @@ -1045,7 +1048,7 @@ dodebug(char *what) printf("\n"); } - + return; } From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 01:49:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B25331065670; Wed, 9 Nov 2011 01:49:16 +0000 (UTC) Date: Wed, 9 Nov 2011 01:49:16 +0000 From: Alexey Dokuchaev To: Jilles Tjoelker Message-ID: <20111109014916.GA75862@FreeBSD.org> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201111082302.pA8N2Wmj053356@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 01:49:16 -0000 On Tue, Nov 08, 2011 at 11:02:32PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Tue Nov 8 23:02:32 2011 > New Revision: 227366 > URL: http://svn.freebsd.org/changeset/base/227366 > > Log: > rc.d: Eliminate some unnecessary non-POSIX constructs: > > * ^ in character class > > - for file in ${dir}/[^0-9]*.sh; do > + for file in ${dir}/[!0-9]*.sh; do I don't have my copy of POSIX handy, but looking at SUSv2, circumflex `^' is documented as non-matching list expression specifier, while `!' is not. I am reading it wrong? ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 04:08:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC7F106564A; Wed, 9 Nov 2011 04:08:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0F08FC0A; Wed, 9 Nov 2011 04:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9481wH063403; Wed, 9 Nov 2011 04:08:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9481FR063401; Wed, 9 Nov 2011 04:08:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090408.pA9481FR063401@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 04:08: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: r227371 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 04:08:01 -0000 Author: adrian Date: Wed Nov 9 04:08:01 2011 New Revision: 227371 URL: http://svn.freebsd.org/changeset/base/227371 Log: Fix the compile to work when IEEE80211_DEBUG isn't defined. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed Nov 9 01:40:46 2011 (r227370) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed Nov 9 04:08:01 2011 (r227371) @@ -760,7 +760,9 @@ update_stats(struct ath_softc *sc, struc { struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); +#ifdef IEEE80211_DEBUG const HAL_RATE_TABLE *rt = sc->sc_currates; +#endif const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); int tt, tries_so_far; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 04:35:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72AAA106566B; Wed, 9 Nov 2011 04:35:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 621598FC19; Wed, 9 Nov 2011 04:35:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA94ZXXC064399; Wed, 9 Nov 2011 04:35:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA94ZXND064396; Wed, 9 Nov 2011 04:35:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090435.pA94ZXND064396@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 04:35: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: r227372 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 04:35:33 -0000 Author: adrian Date: Wed Nov 9 04:35:33 2011 New Revision: 227372 URL: http://svn.freebsd.org/changeset/base/227372 Log: Try to make it more obvious when users are using the PCI or PCIe versions of the 11n chips. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Wed Nov 9 04:08:01 2011 (r227371) +++ head/sys/dev/ath/ath_hal/ah.c Wed Nov 9 04:35:33 2011 (r227372) @@ -114,11 +114,15 @@ ath_hal_mac_name(struct ath_hal *ah) case AR_XSREV_VERSION_SOWL: return "9160"; case AR_XSREV_VERSION_MERLIN: - return "9280"; + if (AH_PRIVATE(ah)->ah_ispcie) + return "9280"; + return "9220"; case AR_XSREV_VERSION_KITE: return "9285"; case AR_XSREV_VERSION_KIWI: - return "9287"; + if (AH_PRIVATE(ah)->ah_ispcie) + return "9287"; + return "9227"; } return "????"; } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Nov 9 04:08:01 2011 (r227371) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Nov 9 04:35:33 2011 (r227372) @@ -916,9 +916,12 @@ ar5416FillCapabilityInfo(struct ath_hal static const char* ar5416Probe(uint16_t vendorid, uint16_t devid) { - if (vendorid == ATHEROS_VENDOR_ID && - (devid == AR5416_DEVID_PCI || devid == AR5416_DEVID_PCIE)) - return "Atheros 5416"; + if (vendorid == ATHEROS_VENDOR_ID) { + if (devid == AR5416_DEVID_PCI) + return "Atheros 5416"; + if (devid == AR5416_DEVID_PCIE) + return "Atheros 5418"; + } return AH_NULL; } AH_CHIP(AR5416, ar5416Probe, ar5416Attach); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 04:38:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49752106566B; Wed, 9 Nov 2011 04:38:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DA28FC08; Wed, 9 Nov 2011 04:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA94cSHK064519; Wed, 9 Nov 2011 04:38:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA94cS9r064516; Wed, 9 Nov 2011 04:38:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090438.pA94cS9r064516@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 04:38: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: r227373 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 04:38:28 -0000 Author: adrian Date: Wed Nov 9 04:38:27 2011 New Revision: 227373 URL: http://svn.freebsd.org/changeset/base/227373 Log: Add in some more PCI/PCIe differentiation. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Nov 9 04:35:33 2011 (r227372) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Nov 9 04:38:27 2011 (r227373) @@ -892,9 +892,12 @@ ar9280SetAntennaSwitch(struct ath_hal *a static const char* ar9280Probe(uint16_t vendorid, uint16_t devid) { - if (vendorid == ATHEROS_VENDOR_ID && - (devid == AR9280_DEVID_PCI || devid == AR9280_DEVID_PCIE)) - return "Atheros 9280"; + if (vendorid == ATHEROS_VENDOR_ID) { + if (devid == AR9280_DEVID_PCI) + return "Atheros 9220"; + if (devid == AR9280_DEVID_PCIE) + return "Atheros 9280"; + } return AH_NULL; } AH_CHIP(AR9280, ar9280Probe, ar9280Attach); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Nov 9 04:35:33 2011 (r227372) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Nov 9 04:38:27 2011 (r227373) @@ -471,9 +471,12 @@ ar9287SetAntennaSwitch(struct ath_hal *a static const char* ar9287Probe(uint16_t vendorid, uint16_t devid) { - if (vendorid == ATHEROS_VENDOR_ID && - (devid == AR9287_DEVID_PCI || devid == AR9287_DEVID_PCIE)) - return "Atheros 9287"; + if (vendorid == ATHEROS_VENDOR_ID) { + if (devid == AR9287_DEVID_PCI) + return "Atheros 9227"; + if (devid == AR9287_DEVID_PCIE) + return "Atheros 9287"; + } return AH_NULL; } AH_CHIP(AR9287, ar9287Probe, ar9287Attach); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:25:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807D1106566B; Wed, 9 Nov 2011 05:25:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 657E98FC12; Wed, 9 Nov 2011 05:25:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95PUJi066051; Wed, 9 Nov 2011 05:25:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95PU3T066047; Wed, 9 Nov 2011 05:25:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090525.pA95PU3T066047@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:25: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: r227374 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:25:30 -0000 Author: adrian Date: Wed Nov 9 05:25:30 2011 New Revision: 227374 URL: http://svn.freebsd.org/changeset/base/227374 Log: Port over a new routine which grabs the percentage of time spent in TX frame, RX frame, RX clear, RX extension clear. This is useful for estimating channel business. The same routines should be written for AR5210->AR5212 where appopriate. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 04:38:27 2011 (r227373) +++ head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 05:25:30 2011 (r227374) @@ -1025,6 +1025,9 @@ struct ath_hal { struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, struct ath_desc *, u_int); + uint32_t __ahdecl(*ah_get_mib_cycle_counts_pct) (struct ath_hal *, + uint32_t *, uint32_t *, uint32_t *, uint32_t *); + uint32_t __ahdecl(*ah_get11nExtBusy)(struct ath_hal *); void __ahdecl(*ah_set11nMac2040)(struct ath_hal *, HAL_HT_MACMODE); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Nov 9 04:38:27 2011 (r227373) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Nov 9 05:25:30 2011 (r227374) @@ -112,11 +112,13 @@ struct ath_hal_5416 { int ah_hangs; /* h/w hangs state */ uint8_t ah_keytype[AR5416_KEYTABLE_SIZE]; /* - * Extension Channel Rx Clear State + * Primary/Extension Channel Tx, Rx, Rx Clear State */ uint32_t ah_cycleCount; uint32_t ah_ctlBusy; uint32_t ah_extBusy; + uint32_t ah_rxBusy; + uint32_t ah_txBusy; uint32_t ah_rx_chainmask; uint32_t ah_tx_chainmask; @@ -194,6 +196,9 @@ extern uint32_t ar5416GetCurRssi(struct extern HAL_BOOL ar5416SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); extern HAL_BOOL ar5416SetDecompMask(struct ath_hal *, uint16_t, int); extern void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int); +extern uint32_t ar5416GetMibCycleCountsPct(struct ath_hal *ah, + uint32_t *rxc_pcnt, uint32_t *rxextc_pcnt, uint32_t *rxf_pcnt, + uint32_t *txf_pcnt); extern uint32_t ar5416Get11nExtBusy(struct ath_hal *ah); extern void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode); extern HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Wed Nov 9 04:38:27 2011 (r227373) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Wed Nov 9 05:25:30 2011 (r227374) @@ -172,6 +172,57 @@ ar5416SetCoverageClass(struct ath_hal *a } /* + * Return the busy for rx_frame, rx_clear, and tx_frame + */ +uint32_t +ar5416GetMibCycleCountsPct(struct ath_hal *ah, uint32_t *rxc_pcnt, + uint32_t *extc_pcnt, uint32_t *rxf_pcnt, uint32_t *txf_pcnt) +{ + struct ath_hal_5416 *ahp = AH5416(ah); + u_int32_t good = 1; + + /* XXX freeze/unfreeze mib counters */ + uint32_t rc = OS_REG_READ(ah, AR_RCCNT); + uint32_t ec = OS_REG_READ(ah, AR_EXTRCCNT); + uint32_t rf = OS_REG_READ(ah, AR_RFCNT); + uint32_t tf = OS_REG_READ(ah, AR_TFCNT); + uint32_t cc = OS_REG_READ(ah, AR_CCCNT); /* read cycles last */ + + if (ahp->ah_cycleCount == 0 || ahp->ah_cycleCount > cc) { + /* + * Cycle counter wrap (or initial call); it's not possible + * to accurately calculate a value because the registers + * right shift rather than wrap--so punt and return 0. + */ + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: cycle counter wrap. ExtBusy = 0\n", __func__); + good = 0; + } else { + uint32_t cc_d = cc - ahp->ah_cycleCount; + uint32_t rc_d = rc - ahp->ah_ctlBusy; + uint32_t ec_d = ec - ahp->ah_extBusy; + uint32_t rf_d = rf - ahp->ah_rxBusy; + uint32_t tf_d = tf - ahp->ah_txBusy; + + if (cc_d != 0) { + *rxc_pcnt = rc_d * 100 / cc_d; + *rxf_pcnt = rf_d * 100 / cc_d; + *txf_pcnt = tf_d * 100 / cc_d; + *extc_pcnt = ec_d * 100 / cc_d; + } else { + good = 0; + } + } + ahp->ah_cycleCount = cc; + ahp->ah_rxBusy = rf; + ahp->ah_ctlBusy = rc; + ahp->ah_txBusy = tf; + ahp->ah_extBusy = ec; + + return good; +} + +/* * Return approximation of extension channel busy over an time interval * 0% (clear) -> 100% (busy) * From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:30:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B9DA1065701; Wed, 9 Nov 2011 05:30:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4165A8FC15; Wed, 9 Nov 2011 05:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95UPjk066233; Wed, 9 Nov 2011 05:30:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95UPpn066229; Wed, 9 Nov 2011 05:30:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090530.pA95UPpn066229@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:30: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: r227375 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:30:25 -0000 Author: adrian Date: Wed Nov 9 05:30:24 2011 New Revision: 227375 URL: http://svn.freebsd.org/changeset/base/227375 Log: Add a new HAL parameter which forces a full reset rather than warm reset. This forces a full reset of the baseband/radio and seems needed to clear some issues (with Merlin at least) when the baseband gets confused in a very noisy environment. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 05:25:30 2011 (r227374) +++ head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 05:30:24 2011 (r227375) @@ -780,6 +780,7 @@ typedef struct int ah_dma_beacon_response_time;/* in TU's */ int ah_sw_beacon_response_time; /* in TU's */ int ah_additional_swba_backoff; /* in TU's */ + int ah_force_full_reset; /* force full chip reset rather then warm reset */ } HAL_OPS_CONFIG; /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 05:25:30 2011 (r227374) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 05:30:24 2011 (r227375) @@ -146,7 +146,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO /* For chips on which the RTC reset is done, save TSF before it gets cleared */ if (AR_SREV_HOWL(ah) || - (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))) + (AR_SREV_MERLIN(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) || + (ah->ah_config.ah_force_full_reset)) tsf = ar5416GetTsf64(ah); /* Mark PHY as inactive; marked active in ar5416InitBB() */ @@ -733,12 +735,15 @@ ar5416ChipReset(struct ath_hal *ah, cons { OS_MARK(ah, AH_MARK_CHIPRESET, chan ? chan->ic_freq : 0); /* - * Warm reset is optimistic. + * Warm reset is optimistic for open-loop TX power control. */ if (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) return AH_FALSE; + } else if (ah->ah_config.ah_force_full_reset) { + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) + return AH_FALSE; } else { if (!ar5416SetResetReg(ah, HAL_RESET_WARM)) return AH_FALSE; Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Wed Nov 9 05:25:30 2011 (r227374) +++ head/sys/dev/ath/if_ath_sysctl.c Wed Nov 9 05:30:24 2011 (r227375) @@ -893,4 +893,9 @@ ath_sysctl_hal_attach(struct ath_softc * SYSCTL_ADD_INT(ctx, child, OID_AUTO, "swba_backoff", CTLFLAG_RW, &sc->sc_ah->ah_config.ah_additional_swba_backoff, 0, "Atheros HAL additional SWBA backoff time"); + + sc->sc_ah->ah_config.ah_force_full_reset = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "force_full_reset", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_force_full_reset, 0, + "Force full chip reset rather than a warm reset"); } From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:37:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7928D106566B; Wed, 9 Nov 2011 05:37:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682288FC0A; Wed, 9 Nov 2011 05:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95bBYW066486; Wed, 9 Nov 2011 05:37:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95bBbe066484; Wed, 9 Nov 2011 05:37:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090537.pA95bBbe066484@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:37: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: r227376 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:37:11 -0000 Author: adrian Date: Wed Nov 9 05:37:11 2011 New Revision: 227376 URL: http://svn.freebsd.org/changeset/base/227376 Log: Include some ANI fixes for the AR5416. * If we fall through from an ANI command (eg because it's out of range, or it's disabled) then fall through to the next ANI command rather then being stuck there. * Fix some off-by-one comparisons, meaning the final level in some parameters were never tweaked. Obtained from: Atheros Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:30:24 2011 (r227375) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:37:11 2011 (r227376) @@ -227,7 +227,7 @@ ar5416AniControl(struct ath_hal *ah, HAL u_int level = param; HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_NOISE_IMMUNITY_LEVEL: set level = %d\n", __func__, level); - if (level >= params->maxNoiseImmunityLevel) { + if (level > params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: immunity level out of range (%u > %u)\n", __func__, level, params->maxNoiseImmunityLevel); @@ -314,7 +314,7 @@ ar5416AniControl(struct ath_hal *ah, HAL u_int level = param; HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_FIRSTEP_LEVEL: level = %d\n", __func__, level); - if (level >= params->maxFirstepLevel) { + if (level > params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: firstep level out of range (%u > %u)\n", __func__, level, params->maxFirstepLevel); @@ -333,7 +333,7 @@ ar5416AniControl(struct ath_hal *ah, HAL u_int level = param; HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_SPUR_IMMUNITY_LEVEL: level = %d\n", __func__, level); - if (level >= params->maxSpurImmunityLevel) { + if (level > params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: spur immunity level out of range (%u > %u)\n", __func__, level, params->maxSpurImmunityLevel); @@ -418,9 +418,9 @@ ar5416AniOfdmErrTrigger(struct ath_hal * * raise firstep level */ if (aniState->firstepLevel+1 < params->maxFirstepLevel) { - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel + 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel + 1)) + return; } } else if (rssi > params->rssiThrLow) { /* @@ -432,9 +432,9 @@ ar5416AniOfdmErrTrigger(struct ath_hal * HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_TRUE); if (aniState->firstepLevel+1 < params->maxFirstepLevel) - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel + 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel + 1)) + return; } else { /* * Beacon rssi is low, if in 11b/g mode, turn off ofdm @@ -447,9 +447,9 @@ ar5416AniOfdmErrTrigger(struct ath_hal * HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_FALSE); if (aniState->firstepLevel > 0) - ar5416AniControl(ah, - HAL_ANI_FIRSTEP_LEVEL, 0); - return; + if (ar5416AniControl(ah, + HAL_ANI_FIRSTEP_LEVEL, 0)) + return; } } } @@ -729,41 +729,41 @@ ar5416AniLowerImmunity(struct ath_hal *a * detection or lower firstep level. */ if (aniState->ofdmWeakSigDetectOff) { - ar5416AniControl(ah, + if (ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, - AH_TRUE); - return; + AH_TRUE)) + return; } if (aniState->firstepLevel > 0) { - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; } } else { /* * Beacon rssi is low, reduce firstep level. */ if (aniState->firstepLevel > 0) { - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; } } } /* then lower spur immunity level, down to zero */ if (aniState->spurImmunityLevel > 0) { - ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, - aniState->spurImmunityLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, + aniState->spurImmunityLevel - 1)) + return; } /* * if all else fails, lower noise immunity level down to a min value * zero for now */ if (aniState->noiseImmunityLevel > 0) { - ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, - aniState->noiseImmunityLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, + aniState->noiseImmunityLevel - 1)) + return; } } From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:39:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6121F1065670; Wed, 9 Nov 2011 05:39:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 509C48FC14; Wed, 9 Nov 2011 05:39:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95dHYZ066577; Wed, 9 Nov 2011 05:39:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95dH5q066575; Wed, 9 Nov 2011 05:39:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090539.pA95dH5q066575@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:39: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: r227377 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:39:17 -0000 Author: adrian Date: Wed Nov 9 05:39:17 2011 New Revision: 227377 URL: http://svn.freebsd.org/changeset/base/227377 Log: .. and add some ANI fixes missing from the last ANI commit. Obtained from: Atheros Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:37:11 2011 (r227376) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:39:17 2011 (r227377) @@ -384,18 +384,16 @@ ar5416AniOfdmErrTrigger(struct ath_hal * aniState = ahp->ah_curani; params = aniState->params; /* First, raise noise immunity level, up to max */ - if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL)) && - (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) { - ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, - aniState->noiseImmunityLevel + 1); - return; + if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if (ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, + aniState->noiseImmunityLevel + 1)) + return; } /* then, raise spur immunity level, up to max */ - if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL)) && - (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) { - ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, - aniState->spurImmunityLevel + 1); - return; + if (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel) { + if (ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, + aniState->spurImmunityLevel + 1)) + return; } if (ANI_ENA_RSSI(ah)) { From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:41:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4DE1065675; Wed, 9 Nov 2011 05:41:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098648FC0A; Wed, 9 Nov 2011 05:41:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95feZZ066688; Wed, 9 Nov 2011 05:41:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95feFa066686; Wed, 9 Nov 2011 05:41:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090541.pA95feFa066686@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:41: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: r227378 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:41:41 -0000 Author: adrian Date: Wed Nov 9 05:41:40 2011 New Revision: 227378 URL: http://svn.freebsd.org/changeset/base/227378 Log: Add logic to ANI to tweak the firstep parameter when in hostap mode. This is normally done based on the beacon RSSI but this isn't available in hostap mode. Obtained from: Atheros Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:39:17 2011 (r227377) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:41:40 2011 (r227378) @@ -396,6 +396,18 @@ ar5416AniOfdmErrTrigger(struct ath_hal * return; } + /* + * In the case of AP mode operation, we cannot bucketize beacons + * according to RSSI. Instead, raise Firstep level, up to max, and + * simply return. + */ + if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { + if (aniState->firstepLevel < params->maxFirstepLevel) { + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel + 1)) + return; + } + } if (ANI_ENA_RSSI(ah)) { int32_t rssi = BEACON_RSSI(ahp); if (rssi > params->rssiThrHigh) { @@ -713,6 +725,19 @@ ar5416AniLowerImmunity(struct ath_hal *a aniState = ahp->ah_curani; params = aniState->params; + + /* + * In the case of AP mode operation, we cannot bucketize beacons + * according to RSSI. Instead, lower Firstep level, down to min, and + * simply return. + */ + if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { + if (aniState->firstepLevel > 0) { + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; + } + } if (ANI_ENA_RSSI(ah)) { int32_t rssi = BEACON_RSSI(ahp); if (rssi > params->rssiThrHigh) { From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:43:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 218401065672; Wed, 9 Nov 2011 05:43:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 110C18FC17; Wed, 9 Nov 2011 05:43:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95hmk0066793; Wed, 9 Nov 2011 05:43:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95hmr8066791; Wed, 9 Nov 2011 05:43:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090543.pA95hmr8066791@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:43: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: r227379 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:43:49 -0000 Author: adrian Date: Wed Nov 9 05:43:48 2011 New Revision: 227379 URL: http://svn.freebsd.org/changeset/base/227379 Log: Use a restricted set of parameters when operating in hostap mode. The 5ghz hostap mode (where DFS is being done) requires ANI to be disabled or the radar detection parameters don't work as advertised (as they're based on signal strength level, and tweaking ANI affects the signal strangth, dynamic range and power increase the baseband is looking for in order to detect it as a "signal".) Obtained from: Linux, Atheros Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:41:40 2011 (r227378) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:43:48 2011 (r227379) @@ -592,6 +592,16 @@ ar5416AniReset(struct ath_hal *ah, const goto finish; } + /* + * Use a restrictive set of ANI parameters for hostap mode. + */ + if (opmode == HAL_M_HOSTAP) { + if (IEEE80211_IS_CHAN_2GHZ(chan)) + AH5416(ah)->ah_ani_function = + HAL_ANI_SPUR_IMMUNITY_LEVEL | HAL_ANI_FIRSTEP_LEVEL; + else + AH5416(ah)->ah_ani_function = 0; + } /* * Automatic processing is done only in station mode right now. From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:45:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF5F1106566B; Wed, 9 Nov 2011 05:45:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE94F8FC0C; Wed, 9 Nov 2011 05:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95jUoN066898; Wed, 9 Nov 2011 05:45:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95jUoq066896; Wed, 9 Nov 2011 05:45:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090545.pA95jUoq066896@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:45: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: r227380 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:45:31 -0000 Author: adrian Date: Wed Nov 9 05:45:30 2011 New Revision: 227380 URL: http://svn.freebsd.org/changeset/base/227380 Log: Disable OFDM weak signal detection by default. Leave this to be enabled if required by STA operation. This quietens a lot of OFDM errors seen in hostap mode, where there are no beacon RSSI levels to tune the dynamic range of the baseband. This may reduce reception range at the fringes, but does increase stability. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:43:48 2011 (r227379) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:45:30 2011 (r227380) @@ -631,7 +631,7 @@ ar5416AniReset(struct ath_hal *ah, const ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, 0); ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, 0); ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, - AH_TRUE); + AH_FALSE); ar5416AniControl(ah, HAL_ANI_CCK_WEAK_SIGNAL_THR, AH_FALSE); ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, 0); ichan->privFlags |= CHANNEL_ANI_SETUP; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 05:48:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97BB81065673; Wed, 9 Nov 2011 05:48:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D9B48FC19; Wed, 9 Nov 2011 05:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA95mK0X067011; Wed, 9 Nov 2011 05:48:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA95mK1x067009; Wed, 9 Nov 2011 05:48:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111090548.pA95mK1x067009@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 05:48: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: r227381 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 05:48:20 -0000 Author: adrian Date: Wed Nov 9 05:48:20 2011 New Revision: 227381 URL: http://svn.freebsd.org/changeset/base/227381 Log: Migrate the AR5416 ANI code to use the previously introduced method to fetch the current channel busy statistics, rather than duplicating it here. This forms the (very crude) basis for doing basic channel surveying. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:45:30 2011 (r227380) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Wed Nov 9 05:48:20 2011 (r227381) @@ -815,15 +815,15 @@ ar5416AniGetListenTime(struct ath_hal *a { struct ath_hal_5212 *ahp = AH5212(ah); struct ar5212AniState *aniState; - uint32_t txFrameCount, rxFrameCount, cycleCount; + uint32_t rxc_pct, extc_pct, rxf_pct, txf_pct; int32_t listenTime; + int good; - txFrameCount = OS_REG_READ(ah, AR_TFCNT); - rxFrameCount = OS_REG_READ(ah, AR_RFCNT); - cycleCount = OS_REG_READ(ah, AR_CCCNT); + good = ar5416GetMibCycleCountsPct(ah, + &rxc_pct, &extc_pct, &rxf_pct, &txf_pct); aniState = ahp->ah_curani; - if (aniState->cycleCount == 0 || aniState->cycleCount > cycleCount) { + if (good == 0) { /* * Cycle counter wrap (or initial call); it's not possible * to accurately calculate a value because the registers @@ -832,14 +832,18 @@ ar5416AniGetListenTime(struct ath_hal *a listenTime = 0; ahp->ah_stats.ast_ani_lzero++; } else { - int32_t ccdelta = cycleCount - aniState->cycleCount; - int32_t rfdelta = rxFrameCount - aniState->rxFrameCount; - int32_t tfdelta = txFrameCount - aniState->txFrameCount; + int32_t ccdelta = AH5416(ah)->ah_cycleCount - aniState->cycleCount; + int32_t rfdelta = AH5416(ah)->ah_rxBusy - aniState->rxFrameCount; + int32_t tfdelta = AH5416(ah)->ah_txBusy - aniState->txFrameCount; listenTime = (ccdelta - rfdelta - tfdelta) / CLOCK_RATE; } - aniState->cycleCount = cycleCount; - aniState->txFrameCount = txFrameCount; - aniState->rxFrameCount = rxFrameCount; + aniState->cycleCount = AH5416(ah)->ah_cycleCount; + aniState->txFrameCount = AH5416(ah)->ah_rxBusy; + aniState->rxFrameCount = AH5416(ah)->ah_txBusy; + + HALDEBUG(ah, HAL_DEBUG_ANI, "rxc=%d, extc=%d, rxf=%d, txf=%d\n", + rxc_pct, extc_pct, rxf_pct, txf_pct); + return listenTime; } @@ -906,10 +910,13 @@ ar5416AniPoll(struct ath_hal *ah, const /* XXX can aniState be null? */ if (aniState == AH_NULL) return; + + /* Always update from the MIB, for statistics gathering */ + listenTime = ar5416AniGetListenTime(ah); + if (!ANI_ENA(ah)) return; - listenTime = ar5416AniGetListenTime(ah); if (listenTime < 0) { ahp->ah_stats.ast_ani_lneg++; /* restart ANI period if listenTime is invalid */ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 06:51:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18E56106564A; Wed, 9 Nov 2011 06:51:46 +0000 (UTC) (envelope-from netch@segfault.kiev.ua) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.freebsd.org (Postfix) with ESMTP id 939148FC14; Wed, 9 Nov 2011 06:51:45 +0000 (UTC) Received: from segfault.kiev.ua (localhost.segfault.kiev.ua [127.0.0.1]) by segfault.kiev.ua (8.14.4/8.14.4/8.Who.Cares) with ESMTP id pA96ZIam047918; Wed, 9 Nov 2011 08:35:18 +0200 (EET) (envelope-from netch@segfault.kiev.ua) Received: (from netch@localhost) by segfault.kiev.ua (8.14.4/8.14.4/Submit) id pA96ZDnT047915; Wed, 9 Nov 2011 08:35:13 +0200 (EET) (envelope-from netch) Date: Wed, 9 Nov 2011 08:35:13 +0200 From: Valentin Nechayev To: Alexey Dokuchaev Message-ID: <20111109063513.GD25476@netch.kiev.ua> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> <20111109014916.GA75862@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109014916.GA75862@FreeBSD.org> X-42: On Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 06:51:46 -0000 Wed, Nov 09, 2011 at 01:49:16, danfe wrote about "Re: svn commit: r227366 - in head/etc: . rc.d": > > rc.d: Eliminate some unnecessary non-POSIX constructs: > > > > * ^ in character class > > > > - for file in ${dir}/[^0-9]*.sh; do > > + for file in ${dir}/[!0-9]*.sh; do > > I don't have my copy of POSIX handy, but looking at SUSv2, circumflex `^' is > documented as non-matching list expression specifier, while `!' is not. > > I am reading it wrong? You are right - Posix.1-2008 says the same - '^' as matching reverse and nothing for '!' A non-matching list expression begins with a ( '^' ), and specifies a list that shall match any single-character collating element except for the expressions represented in the list after the leading . -netch- From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 07:48:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13AFA106564A; Wed, 9 Nov 2011 07:48:49 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE1A58FC16; Wed, 9 Nov 2011 07:48:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA97mmb4070817; Wed, 9 Nov 2011 07:48:48 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA97mmN9070814; Wed, 9 Nov 2011 07:48:48 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201111090748.pA97mmN9070814@svn.freebsd.org> From: Gleb Kurtsou Date: Wed, 9 Nov 2011 07:48: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: r227382 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 07:48:49 -0000 Author: gleb Date: Wed Nov 9 07:48:48 2011 New Revision: 227382 URL: http://svn.freebsd.org/changeset/base/227382 Log: Use implementation independent inoNN_t scalars for on-disk UFS structures Approved by: mdf (mentor) Modified: head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dinode.h Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Wed Nov 9 05:48:20 2011 (r227381) +++ head/sys/ufs/ffs/fs.h Wed Nov 9 07:48:48 2011 (r227382) @@ -338,7 +338,7 @@ struct fs { ufs2_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ int64_t fs_pendingblocks; /* (u) blocks being freed */ u_int32_t fs_pendinginodes; /* (u) inodes being freed */ - ino_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ + uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ u_int32_t fs_avgfilesize; /* expected average file size */ u_int32_t fs_avgfpdir; /* expected # of files per directory */ int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ @@ -695,11 +695,11 @@ struct jsegrec { */ struct jrefrec { uint32_t jr_op; - ino_t jr_ino; - ino_t jr_parent; + uint32_t jr_ino; + uint32_t jr_parent; uint16_t jr_nlink; uint16_t jr_mode; - off_t jr_diroff; + int64_t jr_diroff; uint64_t jr_unused; }; @@ -709,11 +709,11 @@ struct jrefrec { */ struct jmvrec { uint32_t jm_op; - ino_t jm_ino; - ino_t jm_parent; + uint32_t jm_ino; + uint32_t jm_parent; uint16_t jm_unused; - off_t jm_oldoff; - off_t jm_newoff; + int64_t jm_oldoff; + int64_t jm_newoff; }; /* @@ -737,7 +737,7 @@ struct jblkrec { struct jtrncrec { uint32_t jt_op; uint32_t jt_ino; - off_t jt_size; + int64_t jt_size; uint32_t jt_extsize; uint32_t jt_pad[3]; }; Modified: head/sys/ufs/ufs/dinode.h ============================================================================== --- head/sys/ufs/ufs/dinode.h Wed Nov 9 05:48:20 2011 (r227381) +++ head/sys/ufs/ufs/dinode.h Wed Nov 9 07:48:48 2011 (r227382) @@ -146,7 +146,7 @@ struct ufs2_dinode { ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ u_int64_t di_modrev; /* 232: i_modrev for NFSv4 */ - ino_t di_freelink; /* 240: SUJ: Next unlinked inode. */ + uint32_t di_freelink; /* 240: SUJ: Next unlinked inode. */ uint32_t di_spare[3]; /* 244: Reserved; currently unused */ }; @@ -168,7 +168,7 @@ struct ufs2_dinode { struct ufs1_dinode { u_int16_t di_mode; /* 0: IFMT, permissions; see below. */ int16_t di_nlink; /* 2: File link count. */ - ino_t di_freelink; /* 4: SUJ: Next unlinked inode. */ + uint32_t di_freelink; /* 4: SUJ: Next unlinked inode. */ u_int64_t di_size; /* 8: File byte count. */ int32_t di_atime; /* 16: Last access time. */ int32_t di_atimensec; /* 20: Last access time. */ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 08:36:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DEA106566B; Wed, 9 Nov 2011 08:36:00 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 96D8F8FC0C; Wed, 9 Nov 2011 08:35:59 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep12-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20111109083557.KQNH1724.viefep12-int.chello.at@edge04.upcmail.net>; Wed, 9 Nov 2011 09:35:57 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge04.upcmail.net with edge id uwbs1h00p0a5KZh04wbtEM; Wed, 09 Nov 2011 09:35:57 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 412B66D421; Wed, 9 Nov 2011 09:35:51 +0100 (CET) Date: Wed, 9 Nov 2011 09:35:51 +0100 From: Stefan Farfeleder To: Jilles Tjoelker Message-ID: <20111109083545.GC1598@mole.fafoe.narf.at> References: <201111082354.pA8NsdhP055080@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111082354.pA8NsdhP055080@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Cloudmark-Analysis: v=1.1 cv=7AjrSHUygkxmgKj9+ZdWPzZoKYzIcpgZMIt1Yxqn8hE= c=1 sm=0 a=wom5GMh1gUkA:10 a=vtY-WIFys40A:10 a=dBRESv0yCI8A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=mp3zRhi_tjVsM90RcpoA:9 a=_9n0mCyewBjp4DwR7fcA:7 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227369 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 08:36:00 -0000 On Tue, Nov 08, 2011 at 11:54:39PM +0000, Jilles Tjoelker wrote: > Author: jilles > Date: Tue Nov 8 23:54:39 2011 > New Revision: 227369 > URL: http://svn.freebsd.org/changeset/base/227369 > > Log: > sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic. > > With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged. > > Modified: > head/bin/sh/arith_yacc.c > > Modified: head/bin/sh/arith_yacc.c > ============================================================================== > --- head/bin/sh/arith_yacc.c Tue Nov 8 23:44:26 2011 (r227368) > +++ head/bin/sh/arith_yacc.c Tue Nov 8 23:54:39 2011 (r227369) > @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t > yyerror("divide error"); > return op == ARITH_REM ? a % b : a / b; > case ARITH_MUL: > - return a * b; > + return (uintmax_t)a * (uintmax_t)b; > case ARITH_ADD: > - return a + b; > + return (uintmax_t)a + (uintmax_t)b; > case ARITH_SUB: > - return a - b; > + return (uintmax_t)a - (uintmax_t)b; > case ARITH_LSHIFT: > return a << b; > case ARITH_RSHIFT: > Isn't the behaviour undefined too when you convert an out-of-range uintmax_t value back into an intmax_t value? Stefan From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 09:15:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97101106566B; Wed, 9 Nov 2011 09:15:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6498FC15; Wed, 9 Nov 2011 09:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA99Fw3b073766; Wed, 9 Nov 2011 09:15:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA99FvXc073764; Wed, 9 Nov 2011 09:15:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111090915.pA99FvXc073764@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Nov 2011 09:15: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: r227383 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 09:15:58 -0000 Author: hselasky Date: Wed Nov 9 09:15:57 2011 New Revision: 227383 URL: http://svn.freebsd.org/changeset/base/227383 Log: Some minor corrections to a modem driver. PR: usb/162307 MFC after: 3 days Modified: head/sys/dev/usb/serial/uslcom.c Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Wed Nov 9 07:48:48 2011 (r227382) +++ head/sys/dev/usb/serial/uslcom.c Wed Nov 9 09:15:57 2011 (r227383) @@ -100,18 +100,17 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_PARITY_ODD 0x10 #define USLCOM_PARITY_EVEN 0x20 -#define USLCOM_PORT_NO 0xFFFF /* XXX think this should be 0 --hps */ +#define USLCOM_PORT_NO 0x0000 /* USLCOM_BREAK values */ #define USLCOM_BREAK_OFF 0x00 #define USLCOM_BREAK_ON 0x01 /* USLCOM_SET_FLOWCTRL values - 1st word */ -#define USLCOM_FLOW_DTR_ON 0x00000001 +#define USLCOM_FLOW_DTR_ON 0x00000001 /* DTR static active */ #define USLCOM_FLOW_CTS_HS 0x00000008 /* CTS handshake */ -#define USLCOM_FLOW_RESERVED 0xFFFFFF80 /* USLCOM_SET_FLOWCTRL values - 2nd word */ -#define USLCOM_FLOW_RTS_ON 0x00000040 +#define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ #define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ enum { @@ -540,14 +539,12 @@ uslcom_param(struct ucom_softc *ucom, st } if (t->c_cflag & CRTSCTS) { - flowctrl[0] = htole32(USLCOM_FLOW_RESERVED | - USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS); + flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS); flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS); flowctrl[2] = 0; flowctrl[3] = 0; } else { - flowctrl[0] = htole32(USLCOM_FLOW_RESERVED | - USLCOM_FLOW_DTR_ON); + flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON); flowctrl[1] = htole32(USLCOM_FLOW_RTS_ON); flowctrl[2] = 0; flowctrl[3] = 0; @@ -692,7 +689,7 @@ tr_setup: req.bmRequestType = USLCOM_READ; req.bRequest = USLCOM_RCTRL; USETW(req.wValue, 0); - USETW(req.wIndex, 0); + USETW(req.wIndex, USLCOM_PORT_NO); USETW(req.wLength, sizeof(buf)); usbd_xfer_set_frames(xfer, 2); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 11:00:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7186E106564A; Wed, 9 Nov 2011 11:00:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48BEF8FC16; Wed, 9 Nov 2011 11:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9B0U1k079838; Wed, 9 Nov 2011 11:00:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9B0UDx079834; Wed, 9 Nov 2011 11:00:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111091100.pA9B0UDx079834@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Nov 2011 11: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: r227384 - in head/sys: kern sys tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 11:00:30 -0000 Author: ed Date: Wed Nov 9 11:00:29 2011 New Revision: 227384 URL: http://svn.freebsd.org/changeset/base/227384 Log: Simplify the code emitted by makeobjops.awk slightly. Just place the default kobj_method inside the kobjop_desc structure. There's no need to give these kobj_methods their own symbol. This shaves off 10 KB of a GENERIC kernel binary. Modified: head/sys/kern/subr_kobj.c head/sys/sys/kobj.h head/sys/tools/makeobjops.awk Modified: head/sys/kern/subr_kobj.c ============================================================================== --- head/sys/kern/subr_kobj.c Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/kern/subr_kobj.c Wed Nov 9 11:00:29 2011 (r227384) @@ -251,7 +251,7 @@ kobj_lookup_method(kobj_class_t cls, ce = kobj_lookup_method_mi(cls, desc); if (!ce) - ce = desc->deflt; + ce = &desc->deflt; *cep = ce; return ce; } Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/sys/kobj.h Wed Nov 9 11:00:29 2011 (r227384) @@ -86,7 +86,7 @@ struct kobj_ops { struct kobjop_desc { unsigned int id; /* unique ID */ - kobj_method_t *deflt; /* default implementation */ + kobj_method_t deflt; /* default implementation */ }; /* Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Wed Nov 9 09:15:57 2011 (r227383) +++ head/sys/tools/makeobjops.awk Wed Nov 9 11:00:29 2011 (r227384) @@ -306,13 +306,8 @@ function handle_method (static, doc) printh(format_line(prototype argument_list ");", line_width, length(prototype))); - # Print out the method desc - printc("static const struct kobj_method " mname "_method_default = {"); - printc("\t&" mname "_desc, (kobjop_t) " default_function); - printc("};\n"); - printc("struct kobjop_desc " mname "_desc = {"); - printc("\t0, &" mname "_method_default"); + printc("\t0, { &" mname "_desc, (kobjop_t)" default_function " }"); printc("};\n"); # Print out the method itself From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 13:26:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB3B106564A; Wed, 9 Nov 2011 13:26:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F62C8FC0C; Wed, 9 Nov 2011 13:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9DQxDD084416; Wed, 9 Nov 2011 13:26:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9DQxNT084414; Wed, 9 Nov 2011 13:26:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111091326.pA9DQxNT084414@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Nov 2011 13:26: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: r227385 - head/sys/tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:26:59 -0000 Author: ed Date: Wed Nov 9 13:26:59 2011 New Revision: 227385 URL: http://svn.freebsd.org/changeset/base/227385 Log: Restore the comment that I removed by accident. The comment still applies to this block of code. Modified: head/sys/tools/makeobjops.awk Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Wed Nov 9 11:00:29 2011 (r227384) +++ head/sys/tools/makeobjops.awk Wed Nov 9 13:26:59 2011 (r227385) @@ -306,6 +306,7 @@ function handle_method (static, doc) printh(format_line(prototype argument_list ");", line_width, length(prototype))); + # Print out the method desc printc("struct kobjop_desc " mname "_desc = {"); printc("\t0, { &" mname "_desc, (kobjop_t)" default_function " }"); printc("};\n"); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 13:27:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766CF1065672; Wed, 9 Nov 2011 13:27:17 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 00BC08FC0A; Wed, 9 Nov 2011 13:27:17 +0000 (UTC) Received: from [172.20.47.5] (unknown [12.21.1.3]) by cyrus.watson.org (Postfix) with ESMTPSA id 75B8846B23; Wed, 9 Nov 2011 08:27:16 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <86r51lcyn2.fsf@kopusha.home.net> Date: Wed, 9 Nov 2011 08:27:16 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <2494F45C-AEEA-43D6-B373-AACF747A09B6@freebsd.org> References: <201111061047.pA6AlKnc017568@svn.freebsd.org> <86r51lcyn2.fsf@kopusha.home.net> To: Mikolaj Golub X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227207 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:27:17 -0000 On 6 Nov 2011, at 05:51, Mikolaj Golub wrote: > On Sun, 6 Nov 2011 10:47:20 +0000 (UTC) Mikolaj Golub wrote: >=20 > MG> Author: trociny > MG> Date: Sun Nov 6 10:47:20 2011 > MG> New Revision: 227207 > MG> URL: http://svn.freebsd.org/changeset/base/227207 >=20 > MG> Log: > MG> Cache SO_REUSEPORT socket option in inpcb-layer in order to = avoid > MG> inp_socket->so_options dereference when we may not acquire the = lock on > MG> the inpcb. > MG> =20 > MG> This fixes the crash due to NULL pointer dereference in > MG> in_pcbbind_setup() when inp_socket->so_options in a pcb returned = by > MG> in_pcblookup_local() was checked. > MG> =20 > MG> Reported by: dave jones , Arnaud = Lacombe > MG> Suggested by: rwatson > MG> Glanced by: rwatson > MG> Tested by: dave jones >=20 > This commit fixes the panic reported by Dave for 9.0 triggered by > named. Robert has helped very much suggesting the solution and looking > at the patches. Unfortunately being saturated on free time he > couldn't do thorough review of the final version confirming only that > presumably the approach was correct. >=20 > I made an effort to check that there was no regression and = SO_REUSEADDR > worked the same way as it had worked before. But I can't be 100% = confident > that I haven't broken something. Because of this I am going to MFC > only after the release. >=20 > Here is the initial discussion of the issue: >=20 > = http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029858.html Hi Mikolaj: In light of some additional reports of races reminiscent of this one = (i.e., the UDP crash report on net@ a few days ago), I wonder if we = should change plans and attempt to get this in the release? I'm sorry I = haven't had a chance to do a more thorough review, and will try to get = to that later this week now that my current batch of meetings is winding = down. Robert= From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 13:48:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029A8106564A; Wed, 9 Nov 2011 13:48:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD22B8FC0A; Wed, 9 Nov 2011 13:48:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9DmN02085102; Wed, 9 Nov 2011 13:48:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9DmNlS085099; Wed, 9 Nov 2011 13:48:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111091348.pA9DmNlS085099@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 9 Nov 2011 13:48: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: r227386 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 13:48:24 -0000 Author: nwhitehorn Date: Wed Nov 9 13:48:23 2011 New Revision: 227386 URL: http://svn.freebsd.org/changeset/base/227386 Log: Fix a bug where the pmap_cpu_bootstrap() ap argument could be clobbered. Luckily, it mostly wasn't important, so this didn't cause major problems. Also improve register reuse when setting up trap frames very slightly. Submitted by: Justin Hibbits MFC after: 5 days Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Wed Nov 9 13:26:59 2011 (r227385) +++ head/sys/powerpc/aim/trap_subr32.S Wed Nov 9 13:48:23 2011 (r227386) @@ -303,6 +303,7 @@ cpu_reset: lis %r3,1@l bla CNAME(cpudep_ap_early_bootstrap) + lis %r3,1@l bla CNAME(pmap_cpu_bootstrap) bla CNAME(cpudep_ap_bootstrap) mr %r1,%r3 @@ -665,8 +666,8 @@ disitrap: GET_CPUINFO(%r1) lwz %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DAR)(%r1) /* get DAR */ stw %r30,(PC_DBSAVE +CPUSAVE_AIM_DAR)(%r1) /* save DAR */ - lwz %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) /* get DSISR */ - stw %r30,(PC_DBSAVE +CPUSAVE_AIM_DSISR)(%r1) /* save DSISR */ + lwz %r31,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) /* get DSISR */ + stw %r31,(PC_DBSAVE +CPUSAVE_AIM_DSISR)(%r1) /* save DSISR */ lwz %r30,(PC_DISISAVE+CPUSAVE_R28)(%r1) /* get r28 */ stw %r30,(PC_DBSAVE +CPUSAVE_R28)(%r1) /* save r28 */ lwz %r31,(PC_DISISAVE+CPUSAVE_R29)(%r1) /* get r29 */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Wed Nov 9 13:26:59 2011 (r227385) +++ head/sys/powerpc/aim/trap_subr64.S Wed Nov 9 13:48:23 2011 (r227386) @@ -301,6 +301,7 @@ cpu_reset: lis %r3,1@l bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop + lis %r3,1@l bl CNAME(pmap_cpu_bootstrap) /* Turn on virtual memory */ nop bl CNAME(cpudep_ap_bootstrap) /* Set up PCPU and stack */ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 14:08:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704921065677; Wed, 9 Nov 2011 14:08:15 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id EF5D78FC17; Wed, 9 Nov 2011 14:08:13 +0000 (UTC) Received: by eyd10 with SMTP id 10so1880181eyd.13 for ; Wed, 09 Nov 2011 06:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=YscLD5niNdSVZLNbmzOLdSQMfDdJi4f9ufLY/JtqYWs=; b=Ho4S9MTIEZuEQzIgeSRyk5/FXZPa85hhcG3g1e/dz5Bq+HGoqATjLyUVEP+Np44ZB+ OZv/pGluJcErHZZJTm+n9hzmn4DMOxsJUaWU0kypG1m6qNv4b1nhbIZwJ/EQS+yASv/6 sRJQegClnByNNYUjZZCuyuTyhRxcovFuI82gs= Received: by 10.14.16.1 with SMTP id g1mr200585eeg.77.1320847692729; Wed, 09 Nov 2011 06:08:12 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id o4sm13842675eeb.0.2011.11.09.06.08.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 06:08:09 -0800 (PST) From: Mikolaj Golub To: "Robert N. M. Watson" Organization: TOA Ukraine References: <201111061047.pA6AlKnc017568@svn.freebsd.org> <86r51lcyn2.fsf@kopusha.home.net> <2494F45C-AEEA-43D6-B373-AACF747A09B6@freebsd.org> Sender: Mikolaj Golub Date: Wed, 09 Nov 2011 16:08:06 +0200 In-Reply-To: <2494F45C-AEEA-43D6-B373-AACF747A09B6@freebsd.org> (Robert N. M. Watson's message of "Wed, 9 Nov 2011 08:27:16 -0500") Message-ID: <86vcqtgzi1.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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: r227207 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 14:08:15 -0000 On Wed, 9 Nov 2011 08:27:16 -0500 Robert N. M. Watson wrote: RNMW> On 6 Nov 2011, at 05:51, Mikolaj Golub wrote: >> On Sun, 6 Nov 2011 10:47:20 +0000 (UTC) Mikolaj Golub wrote: >> >> MG> Author: trociny >> MG> Date: Sun Nov 6 10:47:20 2011 >> MG> New Revision: 227207 >> MG> URL: http://svn.freebsd.org/changeset/base/227207 >> >> MG> Log: >> MG> Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid >> MG> inp_socket->so_options dereference when we may not acquire the lock on >> MG> the inpcb. >> MG> >> MG> This fixes the crash due to NULL pointer dereference in >> MG> in_pcbbind_setup() when inp_socket->so_options in a pcb returned by >> MG> in_pcblookup_local() was checked. >> MG> >> MG> Reported by: dave jones , Arnaud Lacombe >> MG> Suggested by: rwatson >> MG> Glanced by: rwatson >> MG> Tested by: dave jones >> >> This commit fixes the panic reported by Dave for 9.0 triggered by >> named. Robert has helped very much suggesting the solution and looking >> at the patches. Unfortunately being saturated on free time he >> couldn't do thorough review of the final version confirming only that >> presumably the approach was correct. >> >> I made an effort to check that there was no regression and SO_REUSEADDR >> worked the same way as it had worked before. But I can't be 100% confident >> that I haven't broken something. Because of this I am going to MFC >> only after the release. >> >> Here is the initial discussion of the issue: >> >> http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029858.html RNMW> Hi Mikolaj: Hi, RNMW> In light of some additional reports of races reminiscent of this one RNMW> (i.e., the UDP crash report on net@ a few days ago), I wonder if we RNMW> should change plans and attempt to get this in the release? I'm sorry I RNMW> haven't had a chance to do a more thorough review, and will try to get RNMW> to that later this week now that my current batch of meetings is RNMW> winding down. I think I saw that report (from sobomax@) and actully it looked for me like not related to this fix. Actually I was not able to find an explanation how it could have happened there :-). Also, although it has not been mentioned in the message according to reffered sources it was stable/8 and it looks like there have been many changes since then in the code. Sure I may have missed something. Nevertheless, I have no any objections to get this fix in the release if people say it is good idea. -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 14:30:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2667106566B; Wed, 9 Nov 2011 14:30:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E24638FC12; Wed, 9 Nov 2011 14:30:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9EUwNs086470; Wed, 9 Nov 2011 14:30:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9EUwHg086468; Wed, 9 Nov 2011 14:30:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111091430.pA9EUwHg086468@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 14:30: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: r227387 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 14:30:59 -0000 Author: adrian Date: Wed Nov 9 14:30:58 2011 New Revision: 227387 URL: http://svn.freebsd.org/changeset/base/227387 Log: Tidy up the AR9287 HAL a tiny bit - fix up AR9280 references. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Nov 9 13:48:23 2011 (r227386) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Nov 9 14:30:58 2011 (r227387) @@ -76,7 +76,7 @@ ar9287AniSetup(struct ath_hal *ah) /* * These are the parameters from the AR5416 ANI code; * they likely need quite a bit of adjustment for the - * AR9280. + * AR9287. */ static const struct ar5212AniParams aniparams = { .maxNoiseImmunityLevel = 4, /* levels 0..4 */ @@ -402,13 +402,6 @@ ar9287WriteIni(struct ath_hal *ah, const regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, 1, regWrites); } -#define AR_BASE_FREQ_2GHZ 2300 -#define AR_BASE_FREQ_5GHZ 4900 -#define AR_SPUR_FEEQ_BOUND_HT40 19 -#define AR_SPUR_FEEQ_BOUND_HT20 10 - - - /* * Fill all software cached or static hardware state information. * Return failure if capabilities are to come from EEPROM and @@ -460,7 +453,7 @@ ar9287FillCapabilityInfo(struct ath_hal * This has been disabled - having the HAL flip chainmasks on/off * when attempting to implement 11n disrupts things. For now, just * leave this flipped off and worry about implementing TX diversity - * for legacy and MCS0-7 when 11n is fully functioning. + * for legacy and MCS0-15 when 11n is fully functioning. */ HAL_BOOL ar9287SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings) From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 14:34:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C07B1065675; Wed, 9 Nov 2011 14:34:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5293A8FC22; Wed, 9 Nov 2011 14:34:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9EYPg8086616; Wed, 9 Nov 2011 14:34:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9EYP5g086614; Wed, 9 Nov 2011 14:34:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111091434.pA9EYP5g086614@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 14:34: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: r227388 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 14:34:25 -0000 Author: adrian Date: Wed Nov 9 14:34:25 2011 New Revision: 227388 URL: http://svn.freebsd.org/changeset/base/227388 Log: * Force the MAC to wakeup before we try resetting it, to ensure it actually _gets_ reset properly. * Add some more comments describing why things are done. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 14:30:58 2011 (r227387) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 14:34:25 2011 (r227388) @@ -1214,6 +1214,12 @@ ar5416PhyDisable(struct ath_hal *ah) HAL_BOOL ar5416SetResetReg(struct ath_hal *ah, uint32_t type) { + /* + * Set force wake + */ + OS_REG_WRITE(ah, AR_RTC_FORCE_WAKE, + AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT); + switch (type) { case HAL_RESET_POWER_ON: return ar5416SetResetPowerOn(ah); @@ -1244,10 +1250,15 @@ ar5416SetResetPowerOn(struct ath_hal *ah AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT); /* - * RTC reset and clear + * PowerOn reset can be used in open loop power control or failure recovery. + * If we do RTC reset while DMA is still running, hardware may corrupt memory. + * Therefore, we need to reset AHB first to stop DMA. */ if (! AR_SREV_HOWL(ah)) OS_REG_WRITE(ah, AR_RC, AR_RC_AHB); + /* + * RTC reset and clear + */ OS_REG_WRITE(ah, AR_RTC_RESET, 0); OS_DELAY(20); @@ -1298,6 +1309,11 @@ ar5416SetReset(struct ath_hal *ah, int t #endif /* AH_SUPPORT_AR9130 */ /* * Reset AHB + * + * (In case the last interrupt source was a bus timeout.) + * XXX TODO: this is not the way to do it! It should be recorded + * XXX by the interrupt handler and passed _into_ the + * XXX reset path routine so this occurs. */ tmpReg = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE); if (tmpReg & (AR_INTR_SYNC_LOCAL_TIMEOUT|AR_INTR_SYNC_RADM_CPL_TIMEOUT)) { From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 14:37:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7B21065677; Wed, 9 Nov 2011 14:37:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F63E8FC1E; Wed, 9 Nov 2011 14:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9EblG3086768; Wed, 9 Nov 2011 14:37:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9EblHW086766; Wed, 9 Nov 2011 14:37:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111091437.pA9EblHW086766@svn.freebsd.org> From: John Baldwin Date: Wed, 9 Nov 2011 14:37: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: r227389 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 14:37:47 -0000 Author: jhb Date: Wed Nov 9 14:37:47 2011 New Revision: 227389 URL: http://svn.freebsd.org/changeset/base/227389 Log: Revert some debugging printfs that crept into 223695. Modified: head/sys/boot/i386/libi386/bioscd.c Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Wed Nov 9 14:34:25 2011 (r227388) +++ head/sys/boot/i386/libi386/bioscd.c Wed Nov 9 14:37:47 2011 (r227389) @@ -117,7 +117,6 @@ bc_bios2unit(int biosdev) int i; DEBUG("looking for bios device 0x%x", biosdev); - printf("looking for bios device 0x%x, nbcinfo=%d\n", biosdev, nbcinfo); for (i = 0; i < nbcinfo; i++) { DEBUG("bc unit %d is BIOS device 0x%x", i, bcinfo[i].bc_unit); if (bcinfo[i].bc_unit == biosdev) @@ -149,7 +148,6 @@ bc_init(void) int bc_add(int biosdev) { - printf("bc_add(%d)\n", biosdev); if (nbcinfo >= MAXBCDEV) return (-1); @@ -161,10 +159,8 @@ bc_add(int biosdev) v86.ds = VTOPSEG(&bcinfo[nbcinfo].bc_sp); v86.esi = VTOPOFF(&bcinfo[nbcinfo].bc_sp); v86int(); - if ((v86.eax & 0xff00) != 0) { - printf("CD probe failed, eax=0x%08x\n", v86.eax); + if ((v86.eax & 0xff00) != 0) return (-1); - } printf("BIOS CD is cd%d\n", nbcinfo); nbcinfo++; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 15:21:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A8C31065679; Wed, 9 Nov 2011 15:21:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7F48FC0A; Wed, 9 Nov 2011 15:21:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9FLmex088193; Wed, 9 Nov 2011 15:21:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9FLmX2088191; Wed, 9 Nov 2011 15:21:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201111091521.pA9FLmX2088191@svn.freebsd.org> From: Josh Paetzel Date: Wed, 9 Nov 2011 15:21: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: r227390 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 15:21:48 -0000 Author: jpaetzel Date: Wed Nov 9 15:21:48 2011 New Revision: 227390 URL: http://svn.freebsd.org/changeset/base/227390 Log: Add myself. Approved by: kib (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Nov 9 14:37:47 2011 (r227389) +++ head/share/misc/committers-src.dot Wed Nov 9 15:21:48 2011 (r227390) @@ -167,6 +167,7 @@ jls [label="Jordan Sissel\njls@FreeBSD.o joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1993/11/14"] jon [label="Jonathan Chen\njon@FreeBSD.org\n2000/10/17"] jonathan [label="Jonathan Anderson\njonathan@FreeBSD.org\n2010/10/07"] +jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2011/01/21"] julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/??/??"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] @@ -443,6 +444,7 @@ kan -> kib kib -> ae kib -> dchagin +kib -> jpaetzel kib -> lulf kib -> melifaro kib -> pho From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 15:59:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22F19106566B; Wed, 9 Nov 2011 15:59:03 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12D638FC14; Wed, 9 Nov 2011 15:59:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9Fx2vc089323; Wed, 9 Nov 2011 15:59:02 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9Fx2GY089321; Wed, 9 Nov 2011 15:59:02 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111091559.pA9Fx2GY089321@svn.freebsd.org> From: Fabien Thomas Date: Wed, 9 Nov 2011 15:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227391 - head/contrib/gcc/config/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 15:59:03 -0000 Author: fabient Date: Wed Nov 9 15:59:02 2011 New Revision: 227391 URL: http://svn.freebsd.org/changeset/base/227391 Log: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 PR: 161128 MFC after: 1 week Modified: head/contrib/gcc/config/arm/arm.c Modified: head/contrib/gcc/config/arm/arm.c ============================================================================== --- head/contrib/gcc/config/arm/arm.c Wed Nov 9 15:21:48 2011 (r227390) +++ head/contrib/gcc/config/arm/arm.c Wed Nov 9 15:59:02 2011 (r227391) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 17:13:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E00A1065674; Wed, 9 Nov 2011 17:13:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9AD8FC08; Wed, 9 Nov 2011 17:13:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9HDgHr091732; Wed, 9 Nov 2011 17:13:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9HDgZT091730; Wed, 9 Nov 2011 17:13:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111091713.pA9HDgZT091730@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Nov 2011 17:13: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: r227392 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:13:42 -0000 Author: kib Date: Wed Nov 9 17:13:41 2011 New Revision: 227392 URL: http://svn.freebsd.org/changeset/base/227392 Log: Assert that _PRELE() is done for the held process. Tested by: pho MFC after: 1 week Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Nov 9 15:59:02 2011 (r227391) +++ head/sys/sys/proc.h Wed Nov 9 17:13:41 2011 (r227392) @@ -755,6 +755,7 @@ MALLOC_DECLARE(M_SUBPROC); } while (0) #define _PRELE(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ + PROC_ASSERT_HELD(p); \ (--(p)->p_lock); \ if (((p)->p_flag & P_WEXIT) && (p)->p_lock == 0) \ wakeup(&(p)->p_lock); \ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 17:15:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B653C106566C; Wed, 9 Nov 2011 17:15:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6B278FC17; Wed, 9 Nov 2011 17:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9HFp7k091834; Wed, 9 Nov 2011 17:15:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9HFpeH091832; Wed, 9 Nov 2011 17:15:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111091715.pA9HFpeH091832@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Nov 2011 17:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227393 - head/sys/fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:15:51 -0000 Author: kib Date: Wed Nov 9 17:15:51 2011 New Revision: 227393 URL: http://svn.freebsd.org/changeset/base/227393 Log: Lock the thread lock around block that retrieves td_wmesg. Otherwise, procfs could see a thread with assigned td_wchan but still NULL td_wmesg. Reported and tested by: pho MFC after: 1 week Modified: head/sys/fs/procfs/procfs_status.c Modified: head/sys/fs/procfs/procfs_status.c ============================================================================== --- head/sys/fs/procfs/procfs_status.c Wed Nov 9 17:13:41 2011 (r227392) +++ head/sys/fs/procfs/procfs_status.c Wed Nov 9 17:15:51 2011 (r227393) @@ -113,12 +113,14 @@ procfs_doprocstatus(PFS_FILL_ARGS) } tdfirst = FIRST_THREAD_IN_PROC(p); + thread_lock(tdfirst); if (tdfirst->td_wchan != NULL) { KASSERT(tdfirst->td_wmesg != NULL, ("wchan %p has no wmesg", tdfirst->td_wchan)); wmesg = tdfirst->td_wmesg; } else wmesg = "nochan"; + thread_unlock(tdfirst); if (p->p_flag & P_INMEM) { struct timeval start, ut, st; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 17:25:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 004E21065673; Wed, 9 Nov 2011 17:25:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48378FC0A; Wed, 9 Nov 2011 17:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9HPhZZ092221; Wed, 9 Nov 2011 17:25:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9HPhXh092218; Wed, 9 Nov 2011 17:25:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111091725.pA9HPhXh092218@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Nov 2011 17:25: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: r227394 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:25:44 -0000 Author: kib Date: Wed Nov 9 17:25:43 2011 New Revision: 227394 URL: http://svn.freebsd.org/changeset/base/227394 Log: Stopped process may legitimately have some threads sleeping and not suspended, if the sleep is uninterruptible. Reported and tested by: pho MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Nov 9 17:15:51 2011 (r227393) +++ head/sys/amd64/amd64/machdep.c Wed Nov 9 17:25:43 2011 (r227394) @@ -2047,7 +2047,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), ("not suspended thread %p", td)); fpugetregs(td); fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Nov 9 17:15:51 2011 (r227393) +++ head/sys/i386/i386/machdep.c Wed Nov 9 17:25:43 2011 (r227394) @@ -3299,7 +3299,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 17:38:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B05E106564A; Wed, 9 Nov 2011 17:38:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61CD08FC12; Wed, 9 Nov 2011 17:38:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9HcRg6092641; Wed, 9 Nov 2011 17:38:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9HcRIe092639; Wed, 9 Nov 2011 17:38:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111091738.pA9HcRIe092639@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 17:38: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: r227395 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:38:27 -0000 Author: adrian Date: Wed Nov 9 17:38:27 2011 New Revision: 227395 URL: http://svn.freebsd.org/changeset/base/227395 Log: Flip on processing interrupt profile events for mips24k. This is a bit hackish and should be made more generic (ie, support more than two hard-coded performance counter+config register pairs) so it can be used for mips74k and other chips. All this does is process the initial interrupt event. It doesn't (yet) handle callgraph events, so even if you route the exception/interrupt to this routine and flip the bit on, it will hang and crash pmc unless you disable callgraph support when you enable a sample based PMC. Modified: head/sys/dev/hwpmc/hwpmc_mips24k.c Modified: head/sys/dev/hwpmc/hwpmc_mips24k.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mips24k.c Wed Nov 9 17:25:43 2011 (r227394) +++ head/sys/dev/hwpmc/hwpmc_mips24k.c Wed Nov 9 17:38:27 2011 (r227395) @@ -254,6 +254,8 @@ mips24k_allocate_pmc(int cpu, int ri, st config |= MIPS24K_PMC_USER_ENABLE; if ((caps & (PMC_CAP_USER | PMC_CAP_SYSTEM)) == 0) config |= MIPS24K_PMC_ENABLE; + if (caps & PMC_CAP_INTERRUPT) + config |= MIPS24K_PMC_INTERRUPT_ENABLE; pm->pm_md.pm_mips24k.pm_mips24k_evsel = config; @@ -404,7 +406,65 @@ mips24k_release_pmc(int cpu, int ri, str static int mips24k_intr(int cpu, struct trapframe *tf) { - return 0; + int error; + int retval, ri; + struct pmc *pm; + struct mips24k_cpu *pc; + uint32_t r, r0, r2; + + KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), + ("[mips24k,%d] CPU %d out of range", __LINE__, cpu)); + + retval = 0; + pc = mips24k_pcpu[cpu]; + + /* Stop PMCs without clearing the counter */ + r0 = mips_rd_perfcnt0(); + mips_wr_perfcnt0(r0 & ~(0x1f)); + r2 = mips_rd_perfcnt2(); + mips_wr_perfcnt2(r2 & ~(0x1f)); + + for (ri = 0; ri < mips24k_npmcs; ri++) { + pm = mips24k_pcpu[cpu]->pc_mipspmcs[ri].phw_pmc; + if (pm == NULL) + continue; + if (! PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) + continue; + + r = mips24k_pmcn_read(ri); + + /* If bit 31 is set, the counter has overflowed */ + if ((r & 0x80000000) == 0) + continue; + + retval = 1; + if (pm->pm_state != PMC_STATE_RUNNING) + continue; + error = pmc_process_interrupt(cpu, pm, tf, + TRAPF_USERMODE(tf)); + if (error) { + /* Clear/disable the relevant counter */ + if (ri == 0) + r0 = 0; + else if (ri == 1) + r2 = 0; + mips24k_stop_pmc(cpu, ri); + } + + /* Reload sampling count */ + mips24k_write_pmc(cpu, ri, pm->pm_sc.pm_reloadcount); + } + + /* + * Re-enable the PMC counters where they left off. + * + * Any counter which overflowed will have its sample count + * reloaded in the loop above. + */ + mips_wr_perfcnt0(r0); + mips_wr_perfcnt2(r2); + + return retval; } static int From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 17:56:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78D21065670; Wed, 9 Nov 2011 17:56:08 +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 5A98F8FC0A; Wed, 9 Nov 2011 17:56:08 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 7928F2A28CD1; Wed, 9 Nov 2011 18:55:37 +0100 (CET) Date: Wed, 9 Nov 2011 18:55:37 +0100 From: Ed Schouten To: Fabien Thomas Message-ID: <20111109175537.GB2164@hoeg.nl> References: <201111091559.pA9Fx2GY089321@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline In-Reply-To: <201111091559.pA9Fx2GY089321@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227391 - head/contrib/gcc/config/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 17:56:08 -0000 --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Fabien Thomas , 20111109 16:59: > Import gcc fix for -fstack-protector that produces segfaulting > binaries on arm/armel. Maybe we can now enable -fstack-protector on arm as well? It's currently disabled in and /sys/conf/kern.mk. Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --8P1HSweYDcXXzwPJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOur6ZAAoJEG5e2P40kaK7aNMP/2imh0ixDaBbyrk7ysCnCNlz Xe3WKoVfj5nZshkebTzouphhUHvSgrE3ZzboT9uqNeLHGwHoNJmrI3jFY5ccY+G0 VVrzXeMUOWWD8oVU6HqWyfLKN5g1eW47SHzxw0KjA8Fy0p7od/lPr+aONyHh0r0F 5ld5B218rbPhUDF3nSm1DXrxgY4VNfCW2XR1WOMbBHD1NDZS6U85yY+k/ZPHe5cV +RFx/Zb7dooksmwPyRszjdLJcqOUE7jRccJssaBqNS++VHFH3fytsdJD1EDoUs74 iSlyMRF/qL0Reu68RotsvRmPrYu29ukZM85wfpdvMinsf6Us11CgeBQC+M3fUhyO CuYCtxvIxoOZGIcEaDafRN+PldO7QEGfpFNlF2R0Ybt03cgr+C/ybIBbEJRTQSKv XE5nhgMVeUk0rPGLFVKnaR2/YKoTr+heGaPsTJRmB10/dtrzvmwZjKv71RHgDNCW I+ySsWZHimHAYBMX/hPHiyqLgwR8rKDDpX6eoxACE4iYeDupDHuAxqZabfrmAS8X DIf0KGfAVXXlpk7pXCK8FDfxAUHTc4d11n9ugu+apBVLeNOd8TkAa94ZbCU0tbiq 6yw7kw3IzZGDCptzDOH42eFRCpwmL18pEDPwiAsbVjGUju42+1jDpdtcMAHqjPWS jtVMMsSB+nb2l52Z6/xb =MufM -----END PGP SIGNATURE----- --8P1HSweYDcXXzwPJ-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 18:01:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16982106566C; Wed, 9 Nov 2011 18:01:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A34678FC08; Wed, 9 Nov 2011 18:01:07 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pA9I0vs8004933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Nov 2011 20:00:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pA9HVSL5071621; Wed, 9 Nov 2011 19:31:28 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pA9HVSZT071620; Wed, 9 Nov 2011 19:31:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Nov 2011 19:31:28 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20111109173128.GF50300@deviant.kiev.zoral.com.ua> References: <201111091725.pA9HPhXh092218@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O5LZf7nZwJBw2QY0" Content-Disposition: inline In-Reply-To: <201111091725.pA9HPhXh092218@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r227394 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 18:01:08 -0000 --O5LZf7nZwJBw2QY0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 09, 2011 at 05:25:43PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Nov 9 17:25:43 2011 > New Revision: 227394 > URL: http://svn.freebsd.org/changeset/base/227394 >=20 > Log: > Stopped process may legitimately have some threads sleeping and not > suspended, if the sleep is uninterruptible. Even more, stopped process might have some threads still running in the kernel mode, or inhibited due to wait on blockable locks. I was unable to design an expression that would assert that such thread will be stopped at the kernel->user boundary. The assertion itself is useful and catched several bugs, but theoretically can cause false positives. If any report of the fired assert for kernel-mode thread is provided, I will remove the assertions. > =20 > Reported and tested by: pho > MFC after: 1 week >=20 > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/i386/i386/machdep.c >=20 > Modified: head/sys/amd64/amd64/machdep.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/amd64/amd64/machdep.c Wed Nov 9 17:15:51 2011 (r227393) > +++ head/sys/amd64/amd64/machdep.c Wed Nov 9 17:25:43 2011 (r227394) > @@ -2047,7 +2047,8 @@ int > fill_fpregs(struct thread *td, struct fpreg *fpregs) > { > =20 > - KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td), > + KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td) || > + (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), > ("not suspended thread %p", td)); > fpugetregs(td); > fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); >=20 > Modified: head/sys/i386/i386/machdep.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/i386/i386/machdep.c Wed Nov 9 17:15:51 2011 (r227393) > +++ head/sys/i386/i386/machdep.c Wed Nov 9 17:25:43 2011 (r227394) > @@ -3299,7 +3299,8 @@ int > fill_fpregs(struct thread *td, struct fpreg *fpregs) > { > =20 > - KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td), > + KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td) || > + (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), > ("not suspended thread %p", td)); > #ifdef DEV_NPX > npxgetregs(td); --O5LZf7nZwJBw2QY0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEUEARECAAYFAk66uPAACgkQC3+MBN1Mb4iVQgCgyNICrEdJebqo7MtFOXKdwuJ9 BZYAlRcKOW/R6XRZhWWBIhgLR743YUQ= =NItd -----END PGP SIGNATURE----- --O5LZf7nZwJBw2QY0-- From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 18:11:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAA0C1065677; Wed, 9 Nov 2011 18:11:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A9CD8FC26; Wed, 9 Nov 2011 18:11:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9IBTgW093709; Wed, 9 Nov 2011 18:11:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9IBT7h093706; Wed, 9 Nov 2011 18:11:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111091811.pA9IBT7h093706@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Nov 2011 18:11: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: r227396 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 18:11:29 -0000 Author: hselasky Date: Wed Nov 9 18:11:29 2011 New Revision: 227396 URL: http://svn.freebsd.org/changeset/base/227396 Log: Fix size of USB 3.0 descriptor field. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Nov 9 17:38:27 2011 (r227395) +++ head/sys/dev/usb/controller/xhci.c Wed Nov 9 18:11:29 2011 (r227396) @@ -2841,7 +2841,8 @@ struct xhci_bos_desc xhci_bosd = { HSETW(.wSpeedsSupported, 0x000C), .bFunctionalitySupport = 8, .bU1DevExitLat = 255, /* dummy - not used */ - .bU2DevExitLat = 255, /* dummy - not used */ + .wU2DevExitLat[0] = 0x00, + .wU2DevExitLat[1] = 0x08, }, .cidd = { .bLength = sizeof(xhci_bosd.cidd), Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Nov 9 17:38:27 2011 (r227395) +++ head/sys/dev/usb/usb.h Wed Nov 9 18:11:29 2011 (r227396) @@ -336,7 +336,7 @@ struct usb_devcap_ss_descriptor { uWord wSpeedsSupported; uByte bFunctionalitySupport; uByte bU1DevExitLat; - uByte bU2DevExitLat; + uWord wU2DevExitLat; } __packed; typedef struct usb_devcap_ss_descriptor usb_devcap_ss_descriptor_t; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 18:24:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2A2F1065672; Wed, 9 Nov 2011 18:24:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A86AD8FC16; Wed, 9 Nov 2011 18:24:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9IOK4x094189; Wed, 9 Nov 2011 18:24:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9IOKBK094187; Wed, 9 Nov 2011 18:24:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111091824.pA9IOKBK094187@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 18:24: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: r227398 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 18:24:21 -0000 Author: adrian Date: Wed Nov 9 18:24:20 2011 New Revision: 227398 URL: http://svn.freebsd.org/changeset/base/227398 Log: If software retransmit occurs with an ath_buf marked ATH_BUF_BUSY, it's cloned and that clone is retransmitted. This means that the ath_buf pointer squirreled away on the baw window array is suddenly wrong and was causing all kinds of console output. This updates the pointer in that particular BAW slot to the new ath_buf after ensuring that: * the new and old buffers have the same seqno; * the current slot pointer matches the old buffer pointer. This quietens the debugging output (again), restoring said debugging to only signify when a broken condition has occured. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Nov 9 18:12:42 2011 (r227397) +++ head/sys/dev/ath/if_ath_tx.c Wed Nov 9 18:24:20 2011 (r227398) @@ -1900,6 +1900,56 @@ ath_tx_addto_baw(struct ath_softc *sc, s } /* + * Flip the BAW buffer entry over from the existing one to the new one. + * + * When software retransmitting a (sub-)frame, it is entirely possible that + * the frame ath_buf is marked as BUSY and can't be immediately reused. + * In that instance the buffer is cloned and the new buffer is used for + * retransmit. We thus need to update the ath_buf slot in the BAW buf + * tracking array to maintain consistency. + */ +static void +ath_tx_switch_baw_buf(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *old_bf, struct ath_buf *new_bf) +{ + int index, cindex; + struct ieee80211_tx_ampdu *tap; + int seqno = SEQNO(old_bf->bf_state.bfs_seqno); + + ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + + tap = ath_tx_get_tx_tid(an, tid->tid); + index = ATH_BA_INDEX(tap->txa_start, seqno); + cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); + + /* + * Just warn for now; if it happens then we should find out + * about it. It's highly likely the aggregation session will + * soon hang. + */ + if (old_bf->bf_state.bfs_seqno != new_bf->bf_state.bfs_seqno) { + device_printf(sc->sc_dev, "%s: retransmitted buffer" + " has mismatching seqno's, BA session may hang.\n", + __func__); + device_printf(sc->sc_dev, "%s: old seqno=%d, new_seqno=%d\n", + __func__, + old_bf->bf_state.bfs_seqno, + new_bf->bf_state.bfs_seqno); + } + + if (tid->tx_buf[cindex] != old_bf) { + device_printf(sc->sc_dev, "%s: ath_buf pointer incorrect; " + " has m BA session may hang.\n", + __func__); + device_printf(sc->sc_dev, "%s: old bf=%p, new bf=%p\n", + __func__, + old_bf, new_bf); + } + + tid->tx_buf[cindex] = new_bf; +} + +/* * seq_start - left edge of BAW * seq_next - current/next sequence number to allocate * @@ -2619,7 +2669,8 @@ ath_tx_set_retry(struct ath_softc *sc, s } static struct ath_buf * -ath_tx_retry_clone(struct ath_softc *sc, struct ath_buf *bf) +ath_tx_retry_clone(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf) { struct ath_buf *nbf; int error; @@ -2657,6 +2708,10 @@ ath_tx_retry_clone(struct ath_softc *sc, return NULL; } + /* Update BAW if required, before we free the original buf */ + if (bf->bf_state.bfs_dobaw) + ath_tx_switch_baw_buf(sc, an, tid, bf, nbf); + /* Free current buffer; return the older buffer */ bf->bf_m = NULL; bf->bf_node = NULL; @@ -2699,7 +2754,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft if ((bf->bf_state.bfs_retries < SWMAX_RETRIES) && (bf->bf_flags & ATH_BUF_BUSY)) { struct ath_buf *nbf; - nbf = ath_tx_retry_clone(sc, bf); + nbf = ath_tx_retry_clone(sc, an, atid, bf); if (nbf) /* bf has been freed at this point */ bf = nbf; @@ -2791,7 +2846,7 @@ ath_tx_retry_subframe(struct ath_softc * if ((bf->bf_state.bfs_retries < SWMAX_RETRIES) && (bf->bf_flags & ATH_BUF_BUSY)) { struct ath_buf *nbf; - nbf = ath_tx_retry_clone(sc, bf); + nbf = ath_tx_retry_clone(sc, an, atid, bf); if (nbf) /* bf has been freed at this point */ bf = nbf; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 18:25:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4C21065670; Wed, 9 Nov 2011 18:25:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098C08FC1C; Wed, 9 Nov 2011 18:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9IPo4V094283; Wed, 9 Nov 2011 18:25:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9IPoKF094276; Wed, 9 Nov 2011 18:25:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111091825.pA9IPoKF094276@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 9 Nov 2011 18:25: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: r227399 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 18:25:51 -0000 Author: kib Date: Wed Nov 9 18:25:50 2011 New Revision: 227399 URL: http://svn.freebsd.org/changeset/base/227399 Log: Attempt to improve formatting and content of several comments for amd64 and i386 MD code. Based on suggestions by: bde MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/include/signal.h head/sys/amd64/include/ucontext.h head/sys/i386/i386/trap.c head/sys/i386/include/signal.h head/sys/i386/include/ucontext.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/amd64/amd64/trap.c Wed Nov 9 18:25:50 2011 (r227399) @@ -900,9 +900,9 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" /* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. + * System call handler for native binaries. The trap frame is already + * set up by the assembler trampoline and a pointer to it is saved in + * td_frame. */ void amd64_syscall(struct thread *td, int traced) Modified: head/sys/amd64/include/signal.h ============================================================================== --- head/sys/amd64/include/signal.h Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/amd64/include/signal.h Wed Nov 9 18:25:50 2011 (r227399) @@ -47,18 +47,14 @@ typedef long sig_atomic_t; #include /* codes for SIGILL, SIGFPE */ /* - * Only the kernel should need these old type definitions. - */ -/* * Information pushed on stack when a signal is delivered. * This is used by the kernel to restore state following * execution of the signal handler. It is also made available * to the handler to allow it to restore state properly if * a non-standard exit is performed. - */ -/* - * The sequence of the fields/registers in struct sigcontext should match - * those in mcontext_t. + * + * The sequence of the fields/registers after sc_mask in struct + * sigcontext must match those in mcontext_t and struct trapframe. */ struct sigcontext { struct __sigset sc_mask; /* signal mask to restore */ @@ -93,8 +89,8 @@ struct sigcontext { long sc_ss; long sc_len; /* sizeof(mcontext_t) */ /* - * XXX - See and for - * the following fields. + * See and for the following + * fields. */ long sc_fpformat; long sc_ownedfp; Modified: head/sys/amd64/include/ucontext.h ============================================================================== --- head/sys/amd64/include/ucontext.h Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/amd64/include/ucontext.h Wed Nov 9 18:25:50 2011 (r227399) @@ -41,12 +41,13 @@ typedef struct __mcontext { /* - * The first 24 fields must match the definition of - * sigcontext. So that we can support sigcontext - * and ucontext_t at the same time. + * The definition of mcontext_t must match the layout of + * struct sigcontext after the sc_mask member. This is so + * that we can support sigcontext and ucontext_t at the same + * time. */ - __register_t mc_onstack; /* XXX - sigcontext compat. */ - __register_t mc_rdi; /* machine state (struct trapframe) */ + __register_t mc_onstack; /* XXX - sigcontext compat. */ + __register_t mc_rdi; /* machine state (struct trapframe) */ __register_t mc_rsi; __register_t mc_rdx; __register_t mc_rcx; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/i386/i386/trap.c Wed Nov 9 18:25:50 2011 (r227399) @@ -1065,9 +1065,8 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" /* - * syscall - system call request C handler - * - * A system call is essentially treated as a trap. + * syscall - system call request C handler. A system call is + * essentially treated as a trap by reusing the frame layout. */ void syscall(struct trapframe *frame) Modified: head/sys/i386/include/signal.h ============================================================================== --- head/sys/i386/include/signal.h Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/i386/include/signal.h Wed Nov 9 18:25:50 2011 (r227399) @@ -46,16 +46,17 @@ typedef int sig_atomic_t; #include /* codes for SIGILL, SIGFPE */ /* - * Only the kernel should need these old type definitions. - */ -#if defined(_KERNEL) && defined(COMPAT_43) -/* * Information pushed on stack when a signal is delivered. * This is used by the kernel to restore state following * execution of the signal handler. It is also made available * to the handler to allow it to restore state properly if * a non-standard exit is performed. */ + +#if defined(_KERNEL) && defined(COMPAT_43) +/* + * Only the kernel should need these old type definitions. + */ struct osigcontext { int sc_onstack; /* sigstack state to restore */ osigset_t sc_mask; /* signal mask to restore */ @@ -83,7 +84,7 @@ struct osigcontext { /* * The sequence of the fields/registers in struct sigcontext should match - * those in mcontext_t. + * those in mcontext_t and struct trapframe. */ struct sigcontext { struct __sigset sc_mask; /* signal mask to restore */ @@ -109,8 +110,8 @@ struct sigcontext { int sc_ss; int sc_len; /* sizeof(mcontext_t) */ /* - * XXX - See and for - * the following fields. + * See and for + * the following fields. */ int sc_fpformat; int sc_ownedfp; Modified: head/sys/i386/include/ucontext.h ============================================================================== --- head/sys/i386/include/ucontext.h Wed Nov 9 18:24:20 2011 (r227398) +++ head/sys/i386/include/ucontext.h Wed Nov 9 18:25:50 2011 (r227399) @@ -33,9 +33,9 @@ typedef struct __mcontext { /* - * The first 20 fields must match the definition of - * sigcontext. So that we can support sigcontext - * and ucontext_t at the same time. + * The definition of mcontext_t shall match the layout of + * struct sigcontext after the sc_mask member. So that we can + * support sigcontext and ucontext_t at the same time. */ __register_t mc_onstack; /* XXX - sigcontext compat. */ __register_t mc_gs; /* machine state (struct trapframe) */ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 18:48:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 773411065670; Wed, 9 Nov 2011 18:48:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 674378FC15; Wed, 9 Nov 2011 18:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9Ima3H095083; Wed, 9 Nov 2011 18:48:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9ImahZ095080; Wed, 9 Nov 2011 18:48:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111091848.pA9ImahZ095080@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Nov 2011 18:48: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: r227401 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 18:48:36 -0000 Author: hselasky Date: Wed Nov 9 18:48:36 2011 New Revision: 227401 URL: http://svn.freebsd.org/changeset/base/227401 Log: Fix size of USB 3.0 descriptor field. MFC after: 3 days Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Nov 9 18:26:19 2011 (r227400) +++ head/sys/dev/usb/controller/xhci.c Wed Nov 9 18:48:36 2011 (r227401) @@ -2831,7 +2831,7 @@ struct xhci_bos_desc xhci_bosd = { .bLength = sizeof(xhci_bosd.usb2extd), .bDescriptorType = 1, .bDevCapabilityType = 2, - .bmAttributes = 2, + .bmAttributes[0] = 2, }, .usbdcd = { .bLength = sizeof(xhci_bosd.usbdcd), Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Wed Nov 9 18:26:19 2011 (r227400) +++ head/sys/dev/usb/usb.h Wed Nov 9 18:48:36 2011 (r227401) @@ -323,7 +323,7 @@ struct usb_devcap_usb2ext_descriptor { uByte bLength; uByte bDescriptorType; uByte bDevCapabilityType; - uByte bmAttributes; + uDWord bmAttributes; #define USB_V2EXT_LPM 0x02 } __packed; typedef struct usb_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t; From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 19:00:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CC6C1065674; Wed, 9 Nov 2011 19:00:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E832B8FC16; Wed, 9 Nov 2011 19:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9J0R1f095597; Wed, 9 Nov 2011 19:00:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9J0Rc0095595; Wed, 9 Nov 2011 19:00:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111091900.pA9J0Rc0095595@svn.freebsd.org> From: Dimitry Andric Date: Wed, 9 Nov 2011 19:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227403 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 19:00:28 -0000 Author: dim Date: Wed Nov 9 19:00:27 2011 New Revision: 227403 URL: http://svn.freebsd.org/changeset/base/227403 Log: Move building of clang's tblgen tools (and required libraries) from the bootstrap-tools stage to the cross-tools stage. These tools are only needed for generating llvm/clang include files, and are not necessary for bootstrapping the build itself. This shaves off some build time, because the required libraries are now just built twice (during the cross-tools and world stages), instead of three times. Also, if you build world using WITHOUT_CLANG= in src.conf(5), no llvm or clang code will be compiled at all anymore. MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 9 18:51:41 2011 (r227402) +++ head/Makefile.inc1 Wed Nov 9 19:00:27 2011 (r227403) @@ -1029,14 +1029,6 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${MK_CLANG} != "no" -_clang_tblgen= \ - lib/clang/libllvmsupport \ - lib/clang/libllvmtablegen \ - usr.bin/clang/tblgen \ - usr.bin/clang/clang-tblgen -.endif - .if ${MK_CDDL} != "no" && \ ${BOOTSTRAPPING} < 800038 && \ !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) @@ -1053,7 +1045,6 @@ _dtc= gnu/usr.bin/dtc # FreeBSD versions that need the tool built at this stage of the build. bootstrap-tools: .for _tool in \ - ${_clang_tblgen} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ @@ -1149,9 +1140,13 @@ _binutils= gnu/usr.bin/binutils .endif .if ${MK_CLANG} != "no" +_clang_tblgen= lib/clang/libllvmsupport \ + lib/clang/libllvmtablegen \ + usr.bin/clang/tblgen \ + usr.bin/clang/clang-tblgen .if ${CC:T:Mclang} == "clang" -_clang= usr.bin/clang _clang_libs= lib/clang +_clang= usr.bin/clang .endif .endif @@ -1161,6 +1156,7 @@ _cc= gnu/usr.bin/cc cross-tools: .for _tool in \ + ${_clang_tblgen} \ ${_clang_libs} \ ${_clang} \ ${_binutils} \ From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 19:03:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09D79106566B; Wed, 9 Nov 2011 19:03:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3EF8FC13; Wed, 9 Nov 2011 19:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9J3QN1095722; Wed, 9 Nov 2011 19:03:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9J3Qrv095715; Wed, 9 Nov 2011 19:03:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111091903.pA9J3Qrv095715@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Nov 2011 19:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227404 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 19:03:27 -0000 Author: hselasky Date: Wed Nov 9 19:03:26 2011 New Revision: 227404 URL: http://svn.freebsd.org/changeset/base/227404 Log: Add definition of some USB 3.0 descriptors to libusb 1.0 and libusb 2.0. Some header file parts of this patch were taken from a patch submitted by Maya Erez to the LibUSB developers list. MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10_desc.c head/lib/libusb/libusb20_desc.c head/lib/libusb/libusb20_desc.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/Makefile Wed Nov 9 19:03:26 2011 (r227404) @@ -74,6 +74,10 @@ MLINKS += libusb.3 libusb_get_config_des MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 MLINKS += libusb.3 libusb_free_config_descriptor.3 MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 +MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_parse_bos_descriptor.3 +MLINKS += libusb.3 libusb_free_bos_descriptor.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 MLINKS += libusb.3 libusb_submit_transfer.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/libusb.3 Wed Nov 9 19:03:26 2011 (r227404) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2011 +.Dd November 9, 2011 .Dt LIBUSB 3 .Os .Sh NAME @@ -316,6 +316,40 @@ Retrieve a string descriptor in C style Returns the positive number of bytes in the resulting ASCII string on success and a LIBUSB_ERROR code on failure. .Pp +.Ft int +.Fn libusb_parse_ss_endpoint_comp "const void *buf" "int len" "libusb_ss_endpoint_companion_descriptor **ep_comp" +This function parses the USB 3.0 endpoint companion descriptor in host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +Typically these arguments are the extra and extra_length fields of the +endpoint descriptor. +On success the pointer to resulting descriptor is stored at the location given by +.Fa ep_comp. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed USB 3.0 endpoint companion descriptor must be +freed using the libusb_free_ss_endpoint_comp function. +.Pp +.Ft void +.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp" +This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor. +.Pp +.Ft int +.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos" +This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by +.Fa buf +and having a length of +.Fa len. +On success the pointer to resulting descriptor is stored at the location given by +.Fa bos. +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed BOS descriptor must be freed using the +libusb_free_bos_descriptor function. +.Pp +.Ft void +.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" +This function is NULL safe and frees a parsed BOS descriptor. +.Pp .Sh USB ASYNCHRONOUS I/O .Pp .Ft struct libusb_transfer * Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/libusb.h Wed Nov 9 19:03:26 2011 (r227404) @@ -63,6 +63,16 @@ enum libusb_descriptor_type { LIBUSB_DT_REPORT = 0x22, LIBUSB_DT_PHYSICAL = 0x23, LIBUSB_DT_HUB = 0x29, + LIBUSB_DT_BOS = 0x0f, + LIBUSB_DT_DEVICE_CAPABILITY = 0x10, + LIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +enum libusb_device_capability_type { + LIBUSB_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; #define LIBUSB_DT_DEVICE_SIZE 18 @@ -71,6 +81,10 @@ enum libusb_descriptor_type { #define LIBUSB_DT_ENDPOINT_SIZE 7 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 #define LIBUSB_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB_DT_BOS_SIZE 5 +#define LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f #define LIBUSB_ENDPOINT_DIR_MASK 0x80 @@ -230,6 +244,14 @@ typedef struct libusb_endpoint_descripto int extra_length; } libusb_endpoint_descriptor __aligned(sizeof(void *)); +typedef struct libusb_ss_endpoint_companion_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bMaxBurst; + uint8_t bmAttributes; + uint16_t wBytesPerInterval; +} libusb_ss_endpoint_companion_descriptor __aligned(sizeof(void *)); + typedef struct libusb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; @@ -264,6 +286,39 @@ typedef struct libusb_config_descriptor int extra_length; } libusb_config_descriptor __aligned(sizeof(void *)); +typedef struct libusb_usb_2_0_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint32_t bmAttributes; +#define LIBUSB_USB_2_0_CAPABILITY_LPM_SUPPORT (1 << 1) +} libusb_usb_2_0_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_ss_usb_device_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bmAttributes; +#define LIBUSB_SS_USB_CAPABILITY_LPM_SUPPORT (1 << 1) + uint16_t wSpeedSupported; +#define LIBUSB_CAPABILITY_LOW_SPEED_OPERATION (1) +#define LIBUSB_CAPABILITY_FULL_SPEED_OPERATION (1 << 1) +#define LIBUSB_CAPABILITY_HIGH_SPEED_OPERATION (1 << 2) +#define LIBUSB_CAPABILITY_5GBPS_OPERATION (1 << 3) + uint8_t bFunctionalitySupport; + uint8_t bU1DevExitLat; + uint16_t wU2DevExitLat; +} libusb_ss_usb_device_capability_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_bos_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumDeviceCapabilities; + struct libusb_usb_2_0_device_capability_descriptor *usb_2_0_ext_cap; + struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; +} libusb_bos_descriptor __aligned(sizeof(void *)); + typedef struct libusb_control_setup { uint8_t bmRequestType; uint8_t bRequest; @@ -345,6 +400,10 @@ int libusb_get_config_descriptor_by_valu void libusb_free_config_descriptor(struct libusb_config_descriptor *config); int libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length); int libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length); +int libusb_parse_ss_endpoint_comp(const void *buf, int len, struct libusb_ss_endpoint_companion_descriptor **ep_comp); +void libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp); +int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos); +void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); /* Asynchronous device I/O */ Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/libusb10_desc.c Wed Nov 9 19:03:26 2011 (r227404) @@ -298,7 +298,7 @@ libusb_get_string_descriptor_ascii(libus uint8_t desc_index, unsigned char *data, int length) { if (pdev == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -318,7 +318,7 @@ libusb_get_descriptor(libusb_device_hand uint8_t desc_index, uint8_t *data, int length) { if (devh == NULL || data == NULL || length < 1) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); if (length > 65535) length = 65535; @@ -327,3 +327,172 @@ libusb_get_descriptor(libusb_device_hand LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, length, 1000)); } + +int +libusb_parse_ss_endpoint_comp(const void *buf, int len, + struct libusb_ss_endpoint_companion_descriptor **ep_comp) +{ + if (buf == NULL || ep_comp == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *ep_comp = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE && + dtype == LIBUSB_DT_SS_ENDPOINT_COMPANION) { + struct libusb_ss_endpoint_companion_descriptor *ptr; + + ptr = malloc(sizeof(*ptr)); + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + ptr->bLength = LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE; + ptr->bDescriptorType = dtype; + ptr->bMaxBurst = ((const uint8_t *)buf)[2]; + ptr->bmAttributes = ((const uint8_t *)buf)[3]; + ptr->wBytesPerInterval = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + + *ep_comp = ptr; + + return (0); /* success */ + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp) +{ + if (ep_comp == NULL) + return; + + free(ep_comp); +} + +int +libusb_parse_bos_descriptor(const void *buf, int len, + struct libusb_bos_descriptor **bos) +{ + struct libusb_bos_descriptor *ptr; + struct libusb_usb_2_0_device_capability_descriptor *dcap_20; + struct libusb_ss_usb_device_capability_descriptor *ss_cap; + + if (buf == NULL || bos == NULL || len < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + if (len > 65535) + len = 65535; + + *bos = ptr = NULL; + + while (len != 0) { + uint8_t dlen; + uint8_t dtype; + + dlen = ((const uint8_t *)buf)[0]; + dtype = ((const uint8_t *)buf)[1]; + + if (dlen < 2 || dlen > len) + break; + + if (dlen >= LIBUSB_DT_BOS_SIZE && + dtype == LIBUSB_DT_BOS) { + + ptr = malloc(sizeof(*ptr) + sizeof(*dcap_20) + + sizeof(*ss_cap)); + + if (ptr == NULL) + return (LIBUSB_ERROR_NO_MEM); + + *bos = ptr; + + ptr->bLength = LIBUSB_DT_BOS_SIZE; + ptr->bDescriptorType = dtype; + ptr->wTotalLength = ((const uint8_t *)buf)[2] | + (((const uint8_t *)buf)[3] << 8); + ptr->bNumDeviceCapabilities = ((const uint8_t *)buf)[4]; + ptr->usb_2_0_ext_cap = NULL; + ptr->ss_usb_cap = NULL; + + dcap_20 = (void *)(ptr + 1); + ss_cap = (void *)(dcap_20 + 1); + } + if (dlen >= 3 && + ptr != NULL && + dtype == LIBUSB_DT_DEVICE_CAPABILITY) { + switch (((const uint8_t *)buf)[2]) { + case LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY: + if (ptr->usb_2_0_ext_cap != NULL) + break; + if (dlen < LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE) + break; + + ptr->usb_2_0_ext_cap = dcap_20; + + dcap_20->bLength = LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE; + dcap_20->bDescriptorType = dtype; + dcap_20->bDevCapabilityType = ((const uint8_t *)buf)[2]; + dcap_20->bmAttributes = ((const uint8_t *)buf)[3] | + (((const uint8_t *)buf)[4] << 8) | + (((const uint8_t *)buf)[5] << 16) | + (((const uint8_t *)buf)[6] << 24); + break; + + case LIBUSB_SS_USB_DEVICE_CAPABILITY: + if (ptr->ss_usb_cap != NULL) + break; + if (dlen < LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE) + break; + + ptr->ss_usb_cap = ss_cap; + + ss_cap->bLength = LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE; + ss_cap->bDescriptorType = dtype; + ss_cap->bDevCapabilityType = ((const uint8_t *)buf)[2]; + ss_cap->bmAttributes = ((const uint8_t *)buf)[3]; + ss_cap->wSpeedSupported = ((const uint8_t *)buf)[4] | + (((const uint8_t *)buf)[5] << 8); + ss_cap->bFunctionalitySupport = ((const uint8_t *)buf)[6]; + ss_cap->bU1DevExitLat = ((const uint8_t *)buf)[7]; + ss_cap->wU2DevExitLat = ((const uint8_t *)buf)[8] | + (((const uint8_t *)buf)[9] << 8); + break; + + default: + break; + } + } + + buf = ((const uint8_t *)buf) + dlen; + len -= dlen; + } + if (ptr != NULL) + return (0); /* success */ + + return (LIBUSB_ERROR_IO); +} + +void +libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos) +{ + if (bos == NULL) + return; + + free(bos); +} Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/libusb20_desc.c Wed Nov 9 19:03:26 2011 (r227404) @@ -41,6 +41,10 @@ LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_END LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_INTERFACE_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONFIG_DESC); LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_CONTROL_SETUP); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_ENDPT_COMP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_USB_20_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_SS_USB_DEVCAP_DESC); +LIBUSB20_MAKE_STRUCT_FORMAT(LIBUSB20_BOS_DESCRIPTOR); /*------------------------------------------------------------------------* * libusb20_parse_config_desc Modified: head/lib/libusb/libusb20_desc.h ============================================================================== --- head/lib/libusb/libusb20_desc.h Wed Nov 9 19:00:27 2011 (r227403) +++ head/lib/libusb/libusb20_desc.h Wed Nov 9 19:03:26 2011 (r227404) @@ -264,6 +264,43 @@ LIBUSB20_MAKE_STRUCT(LIBUSB20_CONFIG_DES LIBUSB20_MAKE_STRUCT(LIBUSB20_CONTROL_SETUP); +#define LIBUSB20_SS_ENDPT_COMP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bMaxBurst, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wBytesPerInterval, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_ENDPT_COMP_DESC); + +#define LIBUSB20_USB_20_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT32_T, bmAttributes, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_USB_20_DEVCAP_DESC); + +#define LIBUSB20_SS_USB_DEVCAP_DESC(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT8_T, bDevCapabilityType, ) \ + m(n, UINT8_T, bmAttributes, ) \ + m(n, UINT16_T, wSpeedSupported, ) \ + m(n, UINT8_T, bFunctionalitySupport, ) \ + m(n, UINT8_T, bU1DevExitLat, ) \ + m(n, UINT16_T, wU2DevExitLat, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_SS_USB_DEVCAP_DESC); + +#define LIBUSB20_BOS_DESCRIPTOR(m,n) \ + m(n, UINT8_T, bLength, ) \ + m(n, UINT8_T, bDescriptorType, ) \ + m(n, UINT16_T, wTotalLength, ) \ + m(n, UINT8_T, bNumDeviceCapabilities, ) \ + +LIBUSB20_MAKE_STRUCT(LIBUSB20_BOS_DESCRIPTOR); + /* standard USB stuff */ /** \ingroup desc @@ -333,6 +370,24 @@ enum libusb20_descriptor_type { /** Hub descriptor */ LIBUSB20_DT_HUB = 0x29, + + /** Binary Object Store, BOS */ + LIBUSB20_DT_BOS = 0x0f, + + /** Device Capability */ + LIBUSB20_DT_DEVICE_CAPABILITY = 0x10, + + /** SuperSpeed endpoint companion */ + LIBUSB20_DT_SS_ENDPOINT_COMPANION = 0x30, +}; + +/** \ingroup desc + * Device capability types as defined by the USB specification. */ +enum libusb20_device_capability_type { + LIBUSB20_WIRELESS_USB_DEVICE_CAPABILITY = 0x1, + LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY = 0x2, + LIBUSB20_SS_USB_DEVICE_CAPABILITY = 0x3, + LIBUSB20_CONTAINER_ID_DEVICE_CAPABILITY = 0x4, }; /* Descriptor sizes per descriptor type */ @@ -342,6 +397,10 @@ enum libusb20_descriptor_type { #define LIBUSB20_DT_ENDPOINT_SIZE 7 #define LIBUSB20_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ #define LIBUSB20_DT_HUB_NONVAR_SIZE 7 +#define LIBUSB20_DT_SS_ENDPOINT_COMPANION_SIZE 6 +#define LIBUSB20_DT_BOS_SIZE 5 +#define LIBUSB20_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 +#define LIBUSB20_SS_USB_DEVICE_CAPABILITY_SIZE 10 #define LIBUSB20_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ #define LIBUSB20_ENDPOINT_DIR_MASK 0x80 From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 19:09:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1B6F106564A; Wed, 9 Nov 2011 19:09:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1C618FC15; Wed, 9 Nov 2011 19:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9J939L095920; Wed, 9 Nov 2011 19:09:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9J93MC095918; Wed, 9 Nov 2011 19:09:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111091909.pA9J93MC095918@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 19:09: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: r227405 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 19:09:04 -0000 Author: adrian Date: Wed Nov 9 19:09:03 2011 New Revision: 227405 URL: http://svn.freebsd.org/changeset/base/227405 Log: Even though the HAL doesn't currently support Kiwi 1.0/1.1, be "more correct" about the Kiwi setup. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 19:03:26 2011 (r227404) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Nov 9 19:09:03 2011 (r227405) @@ -2629,7 +2629,7 @@ ar5416OverrideIni(struct ath_hal *ah, co if (!AR_SREV_9271(ah)) val &= ~AR_PCU_MISC_MODE2_HWWAR1; - if (AR_SREV_KIWI_11_OR_LATER(ah)) + if (AR_SREV_KIWI_10_OR_LATER(ah)) val = val & (~AR_PCU_MISC_MODE2_HWWAR2); OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 20:35:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEFA106566B; Wed, 9 Nov 2011 20:35:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9308FC0A; Wed, 9 Nov 2011 20:35:32 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4495F1DD415; Wed, 9 Nov 2011 21:35:29 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 2AE9E28468; Wed, 9 Nov 2011 21:35:29 +0100 (CET) Date: Wed, 9 Nov 2011 21:35:29 +0100 From: Jilles Tjoelker To: Stefan Farfeleder Message-ID: <20111109203528.GA29992@stack.nl> References: <201111082354.pA8NsdhP055080@svn.freebsd.org> <20111109083545.GC1598@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109083545.GC1598@mole.fafoe.narf.at> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227369 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 20:35:32 -0000 On Wed, Nov 09, 2011 at 09:35:51AM +0100, Stefan Farfeleder wrote: > On Tue, Nov 08, 2011 at 11:54:39PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue Nov 8 23:54:39 2011 > > New Revision: 227369 > > URL: http://svn.freebsd.org/changeset/base/227369 > > Log: > > sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic. > > With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged. > > Modified: > > head/bin/sh/arith_yacc.c > > Modified: head/bin/sh/arith_yacc.c > > ============================================================================== > > --- head/bin/sh/arith_yacc.c Tue Nov 8 23:44:26 2011 (r227368) > > +++ head/bin/sh/arith_yacc.c Tue Nov 8 23:54:39 2011 (r227369) > > @@ -131,11 +131,11 @@ static arith_t do_binop(int op, arith_t > > yyerror("divide error"); > > return op == ARITH_REM ? a % b : a / b; > > case ARITH_MUL: > > - return a * b; > > + return (uintmax_t)a * (uintmax_t)b; > > case ARITH_ADD: > > - return a + b; > > + return (uintmax_t)a + (uintmax_t)b; > > case ARITH_SUB: > > - return a - b; > > + return (uintmax_t)a - (uintmax_t)b; > > case ARITH_LSHIFT: > > return a << b; > > case ARITH_RSHIFT: > Isn't the behaviour undefined too when you convert an out-of-range > uintmax_t value back into an intmax_t value? The result is implementation-defined or an implementation-defined signal is raised. GCC documentation (gcc.info 4.5 Integers implementation) says this ] * `The result of, or the signal raised by, converting an integer to a ] signed integer type when the value cannot be represented in an ] object of that type (C90 6.2.1.2, C99 6.3.1.3).' ] For conversion to a type of width N, the value is reduced modulo ] 2^N to be within range of the type; no signal is raised. which is exactly what we need. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 21:01:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B77A0106566C; Wed, 9 Nov 2011 21:01:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4638FC14; Wed, 9 Nov 2011 21:01:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9L1ohS099792; Wed, 9 Nov 2011 21:01:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9L1och099790; Wed, 9 Nov 2011 21:01:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111092101.pA9L1och099790@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Nov 2011 21:01: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: r227407 - head/sbin/ffsinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 21:01:50 -0000 Author: ed Date: Wed Nov 9 21:01:50 2011 New Revision: 227407 URL: http://svn.freebsd.org/changeset/base/227407 Log: Remove trailing whitespace. Modified: head/sbin/ffsinfo/Makefile Modified: head/sbin/ffsinfo/Makefile ============================================================================== --- head/sbin/ffsinfo/Makefile Wed Nov 9 20:12:59 2011 (r227406) +++ head/sbin/ffsinfo/Makefile Wed Nov 9 21:01:50 2011 (r227407) @@ -15,5 +15,5 @@ WARNS?= 1 CFLAGS+=-DFS_DEBUG -I${GROWFS} DPADD= ${LIBUFS} LDADD= -lufs - -.include + +.include From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 21:31:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC7A1065672; Wed, 9 Nov 2011 21:31:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3968FC12; Wed, 9 Nov 2011 21:31:29 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id D4DD0358C51; Wed, 9 Nov 2011 22:31:27 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id B098828468; Wed, 9 Nov 2011 22:31:27 +0100 (CET) Date: Wed, 9 Nov 2011 22:31:27 +0100 From: Jilles Tjoelker To: Alexey Dokuchaev Message-ID: <20111109213127.GB29992@stack.nl> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> <20111109014916.GA75862@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109014916.GA75862@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 21:31:29 -0000 On Wed, Nov 09, 2011 at 01:49:16AM +0000, Alexey Dokuchaev wrote: > On Tue, Nov 08, 2011 at 11:02:32PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue Nov 8 23:02:32 2011 > > New Revision: 227366 > > URL: http://svn.freebsd.org/changeset/base/227366 > > Log: > > rc.d: Eliminate some unnecessary non-POSIX constructs: > > * ^ in character class > > - for file in ${dir}/[^0-9]*.sh; do > > + for file in ${dir}/[!0-9]*.sh; do > I don't have my copy of POSIX handy, but looking at SUSv2, circumflex `^' is > documented as non-matching list expression specifier, while `!' is not. > I am reading it wrong? Shell patterns are different from regular expressions. In SUSv4, XCU 2.13 Pattern Matching Notation describes shell patterns. In particular, the role of the '^' to negate a bracket expression is instead fulfilled by '!'; a '^' directly after the '[' produces unspecified results (so that the common RE-like behaviour is allowed). Historically, this is because the Bourne shell interprets '^' as a synonym for '|' (pipe) and therefore it cannot occur in a pattern unquoted. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 21:41:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D236510656AA; Wed, 9 Nov 2011 21:41:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1DD8FC0C; Wed, 9 Nov 2011 21:41:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9LfIUn001166; Wed, 9 Nov 2011 21:41:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9LfIqB001164; Wed, 9 Nov 2011 21:41:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111092141.pA9LfIqB001164@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 21:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227408 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 21:41:18 -0000 Author: adrian Date: Wed Nov 9 21:41:18 2011 New Revision: 227408 URL: http://svn.freebsd.org/changeset/base/227408 Log: Commit a missing fix - the AR_SREV_KIWI_10_OR_LATER() check. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Nov 9 21:01:50 2011 (r227407) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Nov 9 21:41:18 2011 (r227408) @@ -612,10 +612,10 @@ #define AR_XSREV_REVISION_KITE_11 1 /* Kite 1.1 */ #define AR_XSREV_REVISION_KITE_12 2 /* Kite 1.2 */ #define AR_XSREV_VERSION_KIWI 0x180 /* Kiwi (AR9287) */ -#define AR_XSREV_REVISION_KIWI_10 0 -#define AR_XSREV_REVISION_KIWI_11 1 -#define AR_XSREV_REVISION_KIWI_12 2 -#define AR_XSREV_REVISION_KIWI_13 3 +#define AR_XSREV_REVISION_KIWI_10 0 /* Kiwi 1.0 */ +#define AR_XSREV_REVISION_KIWI_11 1 /* Kiwi 1.1 */ +#define AR_XSREV_REVISION_KIWI_12 2 /* Kiwi 1.2 */ +#define AR_XSREV_REVISION_KIWI_13 3 /* Kiwi 1.3 */ /* Owl (AR5416) */ #define AR_SREV_OWL(_ah) \ @@ -701,6 +701,10 @@ #define AR_SREV_KIWI(_ah) \ (AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_KIWI) +#define AR_SREV_KIWI_10_OR_LATER(_ah) \ + (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_KIWI) + +/* XXX TODO: make these handle macVersion > Kiwi */ #define AR_SREV_KIWI_11_OR_LATER(_ah) \ (AR_SREV_KIWI(_ah) && \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KIWI_11) From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 21:53:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8E67106567D; Wed, 9 Nov 2011 21:53:49 +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 A8B958FC12; Wed, 9 Nov 2011 21:53:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9Lrnrv001585; Wed, 9 Nov 2011 21:53:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9LrnIH001583; Wed, 9 Nov 2011 21:53:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111092153.pA9LrnIH001583@svn.freebsd.org> From: Xin LI Date: Wed, 9 Nov 2011 21:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227409 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 21:53:49 -0000 Author: delphij Date: Wed Nov 9 21:53:49 2011 New Revision: 227409 URL: http://svn.freebsd.org/changeset/base/227409 Log: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS MFC after: 3 days Submitted by: scottl Ok'ed by: jhb Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Wed Nov 9 21:41:18 2011 (r227408) +++ head/sys/dev/mfi/mfi.c Wed Nov 9 21:53:49 2011 (r227409) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 22:39:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A21E1065673; Wed, 9 Nov 2011 22:39:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 784768FC08; Wed, 9 Nov 2011 22:39:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9MdiJh003086; Wed, 9 Nov 2011 22:39:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9Mdiq2003078; Wed, 9 Nov 2011 22:39:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111092239.pA9Mdiq2003078@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 22:39: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: r227410 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 22:39:44 -0000 Author: adrian Date: Wed Nov 9 22:39:44 2011 New Revision: 227410 URL: http://svn.freebsd.org/changeset/base/227410 Log: Introduce a work-around for issues with the AR5416 based MAC on SMP devices. The AR5416 MAC (which shows up in the AR5008, AR9001, AR9002 devices) has issues with PCI transactions on SMP machines. This work-around enforces that register access is serialised through a (global for now) spinlock. This should stop the hangs people have seen with the AR5416 PCI devices on SMP hosts. Obtained by: Linux, Atheros Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/ah_osdep.c Wed Nov 9 22:39:44 2011 (r227410) @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include @@ -59,6 +61,17 @@ #define BUSTAG(ah) ((ah)->ah_st) #endif +/* + * This lock is used to seralise register access for chips which have + * problems w/ SMP CPUs issuing concurrent PCI transactions. + * + * XXX This is a global lock for now; it should be pushed to + * a per-device lock in some platform-independent fashion. + */ +struct mtx ah_regser_mtx; +MTX_SYSINIT(ah_regser, &ah_regser_mtx, "Atheros register access mutex", + MTX_SPIN); + extern void ath_hal_printf(struct ath_hal *, const char*, ...) __printflike(2,3); extern void ath_hal_vprintf(struct ath_hal *, const char*, __va_list) @@ -250,12 +263,16 @@ ath_hal_reg_write(struct ath_hal *ah, u_ alq_post(ath_hal_alq, ale); } } + if (ah->ah_config.ah_serialise_reg_war) + mtx_lock_spin(&ah_regser_mtx); #if _BYTE_ORDER == _BIG_ENDIAN if (OS_REG_UNSWAPPED(reg)) bus_space_write_4(tag, h, reg, val); else #endif bus_space_write_stream_4(tag, h, reg, val); + if (ah->ah_config.ah_serialise_reg_war) + mtx_unlock_spin(&ah_regser_mtx); } u_int32_t @@ -265,12 +282,16 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; + if (ah->ah_config.ah_serialise_reg_war) + mtx_lock_spin(&ah_regser_mtx); #if _BYTE_ORDER == _BIG_ENDIAN if (OS_REG_UNSWAPPED(reg)) val = bus_space_read_4(tag, h, reg); else #endif val = bus_space_read_stream_4(tag, h, reg); + if (ah->ah_config.ah_serialise_reg_war) + mtx_unlock_spin(&ah_regser_mtx); if (ath_hal_alq) { struct ale *ale = ath_hal_alq_get(ah); if (ale) { @@ -316,12 +337,16 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; + if (ah->ah_config.ah_serialise_reg_war) + mtx_lock_spin(&ah_regser_mtx); #if _BYTE_ORDER == _BIG_ENDIAN if (OS_REG_UNSWAPPED(reg)) bus_space_write_4(tag, h, reg, val); else #endif bus_space_write_stream_4(tag, h, reg, val); + if (ah->ah_config.ah_serialise_reg_war) + mtx_unlock_spin(&ah_regser_mtx); } u_int32_t @@ -331,12 +356,16 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; + if (ah->ah_config.ah_serialise_reg_war) + mtx_lock_spin(&ah_regser_mtx); #if _BYTE_ORDER == _BIG_ENDIAN if (OS_REG_UNSWAPPED(reg)) val = bus_space_read_4(tag, h, reg); else #endif val = bus_space_read_stream_4(tag, h, reg); + if (ah->ah_config.ah_serialise_reg_war) + mtx_unlock_spin(&ah_regser_mtx); return val; } #endif /* AH_DEBUG || AH_REGOPS_FUNC */ Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/ath_hal/ah.c Wed Nov 9 22:39:44 2011 (r227410) @@ -665,6 +665,8 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->halHasLongRxDescTsf ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_BB_READ_WAR: /* Baseband read WAR */ return pCap->halHasBBReadWar? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_SERIALISE_WAR: /* PCI register serialisation */ + return pCap->halSerialiseRegWar ? HAL_OK : HAL_ENOTSUPP; default: return HAL_EINVAL; } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/ath_hal/ah.h Wed Nov 9 22:39:44 2011 (r227410) @@ -150,6 +150,7 @@ typedef enum { HAL_CAP_RXDESC_SELFLINK = 242, /* support a self-linked tail RX descriptor */ HAL_CAP_LONG_RXDESC_TSF = 243, /* hardware supports 32bit TSF in RX descriptor */ HAL_CAP_BB_READ_WAR = 244, /* baseband read WAR */ + HAL_CAP_SERIALISE_WAR = 245, /* serialise register access on PCI */ } HAL_CAPABILITY_TYPE; /* @@ -781,6 +782,7 @@ typedef struct int ah_sw_beacon_response_time; /* in TU's */ int ah_additional_swba_backoff; /* in TU's */ int ah_force_full_reset; /* force full chip reset rather then warm reset */ + int ah_serialise_reg_war; /* force serialisation of register IO */ } HAL_OPS_CONFIG; /* Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Nov 9 22:39:44 2011 (r227410) @@ -210,7 +210,8 @@ typedef struct { halHasRxSelfLinkedTail : 1, halSupportsFastClock5GHz : 1, /* Hardware supports 5ghz fast clock; check eeprom/channel before using */ halHasLongRxDescTsf : 1, - halHasBBReadWar : 1; + halHasBBReadWar : 1, + halSerialiseRegWar : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; uint16_t halKeyCacheSize; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Nov 9 22:39:44 2011 (r227410) @@ -908,8 +908,24 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halRfSilentSupport = AH_TRUE; } + /* + * The MAC will mark frames as RXed if there's a descriptor + * to write them to. So if it hits a self-linked final descriptor, + * it'll keep ACKing frames even though they're being silently + * dropped. Thus, this particular feature of the driver can't + * be used for 802.11n devices. + */ ahpriv->ah_rxornIsFatal = AH_FALSE; + /* + * If it's a PCI NIC, ask the HAL OS layer to serialise + * register access, or SMP machines may cause the hardware + * to hang. This is applicable to AR5416 and AR9220; I'm not + * sure about AR9160 or AR9227. + */ + if (! AH_PRIVATE(ah)->ah_ispcie) + pCap->halSerialiseRegWar = 1; + return AH_TRUE; } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/if_ath.c Wed Nov 9 22:39:44 2011 (r227410) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* for mp_ncpus */ #include @@ -675,6 +676,17 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * Check if the hardware requires PCI register serialisation. + * Some of the Owl based MACs require this. + */ + if (mp_ncpus > 1 && + ath_hal_getcapability(ah, HAL_CAP_SERIALISE_WAR, + 0, NULL) == HAL_OK) { + sc->sc_ah->ah_config.ah_serialise_reg_war = 1; + device_printf(sc->sc_dev, "Enabling register serialisation\n"); + } + + /* * Indicate we need the 802.11 header padded to a * 32-bit boundary for 4-address and QoS frames. */ Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Wed Nov 9 21:53:49 2011 (r227409) +++ head/sys/dev/ath/if_ath_sysctl.c Wed Nov 9 22:39:44 2011 (r227410) @@ -898,4 +898,11 @@ ath_sysctl_hal_attach(struct ath_softc * SYSCTL_ADD_INT(ctx, child, OID_AUTO, "force_full_reset", CTLFLAG_RW, &sc->sc_ah->ah_config.ah_force_full_reset, 0, "Force full chip reset rather than a warm reset"); + + /* + * This is initialised by the driver. + */ + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "serialise_reg_war", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_serialise_reg_war, 0, + "Force register access serialisation"); } From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 23:28:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A95E1106566C; Wed, 9 Nov 2011 23:28:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98D408FC16; Wed, 9 Nov 2011 23:28:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9NSlVM004628; Wed, 9 Nov 2011 23:28:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9NSlFH004626; Wed, 9 Nov 2011 23:28:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111092328.pA9NSlFH004626@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 23:28: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: r227411 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 23:28:47 -0000 Author: adrian Date: Wed Nov 9 23:28:47 2011 New Revision: 227411 URL: http://svn.freebsd.org/changeset/base/227411 Log: Bump this up to where it used to be. I need to investigate this a little closer, but it seems that in noisy environments the NF load takes longer than 5 * DELAY(10) and this is messing up future NF calibrations. (The background: NF calibrations begin at the value programmed in after the load has completed, so if this is never loaded in, the NF calibrations only ever start at the currently calibrated NF value, rather than starting at something high (say -50.) More investigation about the effect on 11n RX and calibration results are needed. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed Nov 9 22:39:44 2011 (r227410) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed Nov 9 23:28:47 2011 (r227411) @@ -642,15 +642,7 @@ ar5416LoadNF(struct ath_hal *ah, const s OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); /* Wait for load to complete, should be fast, a few 10s of us. */ - /* - * XXX For now, don't be so aggressive in waiting for the NF - * XXX load to complete. A very busy 11n RX load will cause this - * XXX to always fail; so just leave it. - * XXX Later on we may wish to split longcal into two parts - one to do - * XXX the initial longcal, and one to load in an updated NF value - * XXX once it's finished - say, by checking it every 500ms. - */ - if (! ar5212WaitNFCalComplete(ah, 5)) { + if (! ar5212WaitNFCalComplete(ah, 1000)) { /* * We timed out waiting for the noisefloor to load, probably due to an * in-progress rx. Simply return here and allow the load plenty of time From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 23:37:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4730B1065672; Wed, 9 Nov 2011 23:37:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36F3E8FC0A; Wed, 9 Nov 2011 23:37:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9NbEV2004930; Wed, 9 Nov 2011 23:37:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9NbEYZ004928; Wed, 9 Nov 2011 23:37:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111092337.pA9NbEYZ004928@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 23:37: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: r227412 - head/sys/modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 23:37:14 -0000 Author: adrian Date: Wed Nov 9 23:37:13 2011 New Revision: 227412 URL: http://svn.freebsd.org/changeset/base/227412 Log: Use the system-provided opt_ah.h if one is provided. This implies that users who are building the driver do so with KERNBUILDDIR set to the compile/CONFIG directory so the various opt_* sources can be pulled in. Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Wed Nov 9 23:28:47 2011 (r227411) +++ head/sys/modules/ath/Makefile Wed Nov 9 23:37:13 2011 (r227412) @@ -140,7 +140,9 @@ SRCS+= dfs_null.c CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal +.if !defined(KERNBUILDDIR) opt_ah.h: echo '#define AH_SUPPORT_AR5416 1' > $@ +.endif .include From owner-svn-src-head@FreeBSD.ORG Wed Nov 9 23:53:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7301065670; Wed, 9 Nov 2011 23:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C23D8FC0C; Wed, 9 Nov 2011 23:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA9NrDNL005436; Wed, 9 Nov 2011 23:53:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA9NrDUg005433; Wed, 9 Nov 2011 23:53:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111092353.pA9NrDUg005433@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Nov 2011 23:53: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: r227413 - in head/sys/modules: ath_ahb ath_pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2011 23:53:13 -0000 Author: adrian Date: Wed Nov 9 23:53:13 2011 New Revision: 227413 URL: http://svn.freebsd.org/changeset/base/227413 Log: Since these include wlan/ath/ah headers and these can change definitions based on the state of the kernel compile environment, ensure the opt_*.h files are available. Modified: head/sys/modules/ath_ahb/Makefile head/sys/modules/ath_pci/Makefile Modified: head/sys/modules/ath_ahb/Makefile ============================================================================== --- head/sys/modules/ath_ahb/Makefile Wed Nov 9 23:37:13 2011 (r227412) +++ head/sys/modules/ath_ahb/Makefile Wed Nov 9 23:53:13 2011 (r227413) @@ -34,7 +34,7 @@ KMOD= if_ath_ahb SRCS= if_ath_ahb.c -SRCS+= device_if.h bus_if.h +SRCS+= device_if.h bus_if.h opt_wlan.h opt_ath.h opt_ah.h CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal Modified: head/sys/modules/ath_pci/Makefile ============================================================================== --- head/sys/modules/ath_pci/Makefile Wed Nov 9 23:37:13 2011 (r227412) +++ head/sys/modules/ath_pci/Makefile Wed Nov 9 23:53:13 2011 (r227413) @@ -34,7 +34,7 @@ KMOD= if_ath_pci SRCS= if_ath_pci.c -SRCS+= device_if.h bus_if.h pci_if.h opt_ah.h +SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h opt_ath.h opt_ah.h CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 01:44:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B72B106566B; Thu, 10 Nov 2011 01:44:06 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B4CD8FC08; Thu, 10 Nov 2011 01:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAA1i6kU008900; Thu, 10 Nov 2011 01:44:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAA1i6Se008898; Thu, 10 Nov 2011 01:44:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111100144.pAA1i6Se008898@svn.freebsd.org> From: Kevin Lo Date: Thu, 10 Nov 2011 01:44: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: r227414 - head/lib/libc/regex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 01:44:06 -0000 Author: kevlo Date: Thu Nov 10 01:44:05 2011 New Revision: 227414 URL: http://svn.freebsd.org/changeset/base/227414 Log: - Don't handle out-of-memory condition - Fix types of function arguments match their declaration Reviewed by: delphij Obtained from: NetBSD Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Wed Nov 9 23:53:13 2011 (r227413) +++ head/lib/libc/regex/regcomp.c Thu Nov 10 01:44:05 2011 (r227414) @@ -109,7 +109,7 @@ static sopno dupl(struct parse *p, sopno static void doemit(struct parse *p, sop op, size_t opnd); static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos); static void dofwd(struct parse *p, sopno pos, sop value); -static void enlarge(struct parse *p, sopno size); +static int enlarge(struct parse *p, sopno size); static void stripsnug(struct parse *p, struct re_guts *g); static void findmust(struct parse *p, struct re_guts *g); static int altoffset(sop *scan, int offset); @@ -285,11 +285,11 @@ regcomp(regex_t * __restrict preg, /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(struct parse *p, int stop); + == static void p_ere(struct parse *p, wint_t stop); */ static void p_ere(struct parse *p, - int stop) /* character this ERE should end at */ + wint_t stop) /* character this ERE should end at */ { char c; sopno prevback; @@ -493,8 +493,8 @@ p_str(struct parse *p) /* - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(struct parse *p, int end1, \ - == int end2); + == static void p_bre(struct parse *p, wint_t end1, \ + == wint_t end2); * Giving end1 as OUT essentially eliminates the end1/end2 check. * * This implementation is a bit of a kludge, in that a trailing $ is first @@ -503,8 +503,8 @@ p_str(struct parse *p) */ static void p_bre(struct parse *p, - int end1, /* first terminating character */ - int end2) /* second terminating character */ + wint_t end1, /* first terminating character */ + wint_t end2) /* second terminating character */ { sopno start = HERE(); int first = 1; /* first subexpression? */ @@ -840,7 +840,7 @@ p_b_eclass(struct parse *p, cset *cs) /* - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(struct parse *p); + == static wint_t p_b_symbol(struct parse *p); */ static wint_t /* value of symbol */ p_b_symbol(struct parse *p) @@ -859,7 +859,7 @@ p_b_symbol(struct parse *p) /* - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(struct parse *p, int endc); + == static wint_t p_b_coll_elem(struct parse *p, wint_t endc); */ static wint_t /* value of collating element */ p_b_coll_elem(struct parse *p, @@ -894,7 +894,7 @@ p_b_coll_elem(struct parse *p, /* - othercase - return the case counterpart of an alphabetic - == static char othercase(int ch); + == static wint_t othercase(wint_t ch); */ static wint_t /* if no counterpart, return ch */ othercase(wint_t ch) @@ -910,7 +910,7 @@ othercase(wint_t ch) /* - bothcases - emit a dualcase version of a two-case character - == static void bothcases(struct parse *p, int ch); + == static void bothcases(struct parse *p, wint_t ch); * * Boy, is this implementation ever a kludge... */ @@ -939,7 +939,7 @@ bothcases(struct parse *p, wint_t ch) /* - ordinary - emit an ordinary character - == static void ordinary(struct parse *p, int ch); + == static void ordinary(struct parse *p, wint_t ch); */ static void ordinary(struct parse *p, wint_t ch) @@ -1246,8 +1246,8 @@ dupl(struct parse *p, assert(finish >= start); if (len == 0) return(ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ - assert(p->ssize >= p->slen + len); + if (!enlarge(p, p->ssize + len)) /* this many unexpected additions */ + return(ret); (void) memcpy((char *)(p->strip + p->slen), (char *)(p->strip + start), (size_t)len*sizeof(sop)); p->slen += len; @@ -1274,8 +1274,8 @@ doemit(struct parse *p, sop op, size_t o /* deal with undersized strip */ if (p->slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); + if (!enlarge(p, (p->ssize+1) / 2 * 3)) /* +50% */ + return; /* finally, it's all reduced to the easy case */ p->strip[p->slen++] = SOP(op, opnd); @@ -1334,23 +1334,24 @@ dofwd(struct parse *p, sopno pos, sop va /* - enlarge - enlarge the strip - == static void enlarge(struct parse *p, sopno size); + == static int enlarge(struct parse *p, sopno size); */ -static void +static int enlarge(struct parse *p, sopno size) { sop *sp; if (p->ssize >= size) - return; + return 1; sp = (sop *)realloc(p->strip, size*sizeof(sop)); if (sp == NULL) { SETERROR(REG_ESPACE); - return; + return 0; } p->strip = sp; p->ssize = size; + return 1; } /* From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 02:10:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D87131065673; Thu, 10 Nov 2011 02:10:22 +0000 (UTC) Date: Thu, 10 Nov 2011 02:10:22 +0000 From: Alexey Dokuchaev To: Jilles Tjoelker Message-ID: <20111110021022.GC43300@FreeBSD.org> References: <201111082302.pA8N2Wmj053356@svn.freebsd.org> <20111109014916.GA75862@FreeBSD.org> <20111109213127.GB29992@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20111109213127.GB29992@stack.nl> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227366 - in head/etc: . rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 02:10:22 -0000 On Wed, Nov 09, 2011 at 10:31:27PM +0100, Jilles Tjoelker wrote: > Shell patterns are different from regular expressions. I suspected something like this, yes... > In SUSv4, XCU 2.13 Pattern Matching Notation describes shell patterns. > In particular, the role of the '^' to negate a bracket expression is > instead fulfilled by '!'; a '^' directly after the '[' produces > unspecified results (so that the common RE-like behaviour is allowed). > Historically, this is because the Bourne shell interprets '^' as a > synonym for '|' (pipe) and therefore it cannot occur in a pattern > unquoted. Thanks for the explanation. Always wanted to try using ^ as pipe, but all modern shells seem to not support it anymore. ./danfe From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 03:25:25 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A172106564A; Thu, 10 Nov 2011 03:25:25 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id A63808FC14; Thu, 10 Nov 2011 03:25:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id pAA3PMiu043229; Thu, 10 Nov 2011 07:25:22 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id pAA3PMvX043228; Thu, 10 Nov 2011 07:25:22 +0400 (MSK) (envelope-from ache) Date: Thu, 10 Nov 2011 07:25:21 +0400 From: Andrey Chernov To: Kevin Lo Message-ID: <20111110032521.GA42953@vniz.net> Mail-Followup-To: Andrey Chernov , Kevin Lo , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201111100144.pAA1i6Se008898@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111100144.pAA1i6Se008898@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r227414 - head/lib/libc/regex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 03:25:25 -0000 On Thu, Nov 10, 2011 at 01:44:06AM +0000, Kevin Lo wrote: > - == static void p_ere(struct parse *p, int stop); > + == static void p_ere(struct parse *p, wint_t stop); > */ > static void > p_ere(struct parse *p, > - int stop) /* character this ERE should end at */ > + wint_t stop) /* character this ERE should end at */ > { > char c; > sopno prevback; IMHO mechanical converting char to int (first prototypes "fixing" round), then int to wint_t (your next round) will leads to broken things like direct comparison of raw char and encoded wint_t: while (MORE() && (c = PEEK()) != '|' && c != stop) while the true prototype for p_ere() is: static void p_ere(struct parse *p, char stop); This is the first thing I notice, so the whole patch should be carefully inspected and fixed. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 06:19:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 199911065774; Thu, 10 Nov 2011 06:19:19 +0000 (UTC) (envelope-from rm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0923C8FC0A; Thu, 10 Nov 2011 06:19:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAA6JIkW017682; Thu, 10 Nov 2011 06:19:18 GMT (envelope-from rm@svn.freebsd.org) Received: (from rm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAA6JIBO017680; Thu, 10 Nov 2011 06:19:18 GMT (envelope-from rm@svn.freebsd.org) Message-Id: <201111100619.pAA6JIBO017680@svn.freebsd.org> From: Ruslan Mahmatkhanov Date: Thu, 10 Nov 2011 06:19: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: r227415 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 06:19:19 -0000 Author: rm (ports committer) Date: Thu Nov 10 06:19:18 2011 New Revision: 227415 URL: http://svn.freebsd.org/changeset/base/227415 Log: Add myself. Approved by: novel (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Nov 10 01:44:05 2011 (r227414) +++ head/share/misc/committers-ports.dot Thu Nov 10 06:19:18 2011 (r227415) @@ -156,6 +156,7 @@ pgollucci [label="Philip M. Gollucci\npg rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] +rm [label="Ruslan Mahmatkhanov\nrm@FreeBSD.org\n2010/11/06"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] @@ -366,6 +367,7 @@ nork -> ale novel -> alexbl novel -> ehaupt +novel -> rm obrien -> mharo obrien -> gerald From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 06:20:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36175106564A; Thu, 10 Nov 2011 06:20:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25D4E8FC15; Thu, 10 Nov 2011 06:20:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAA6KJgY017749; Thu, 10 Nov 2011 06:20:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAA6KJ3h017747; Thu, 10 Nov 2011 06:20:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111100620.pAA6KJ3h017747@svn.freebsd.org> From: Doug Barton Date: Thu, 10 Nov 2011 06:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227416 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 06:20:19 -0000 Author: dougb Date: Thu Nov 10 06:20:18 2011 New Revision: 227416 URL: http://svn.freebsd.org/changeset/base/227416 Log: Document that flock can return ENOLCK Modified: head/lib/libc/sys/flock.2 Modified: head/lib/libc/sys/flock.2 ============================================================================== --- head/lib/libc/sys/flock.2 Thu Nov 10 06:19:18 2011 (r227415) +++ head/lib/libc/sys/flock.2 Thu Nov 10 06:20:18 2011 (r227416) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 06:24:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D452106564A; Thu, 10 Nov 2011 06:24:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8398FC17; Thu, 10 Nov 2011 06:24:18 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 9D1145B; Thu, 10 Nov 2011 07:24:15 +0100 (CET) Date: Thu, 10 Nov 2011 07:23:23 +0100 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20111110062322.GA1696@garage.freebsd.pl> References: <201111091725.pA9HPhXh092218@svn.freebsd.org> <20111109173128.GF50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <20111109173128.GF50300@deviant.kiev.zoral.com.ua> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227394 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 06:24:18 -0000 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 09, 2011 at 07:31:28PM +0200, Kostik Belousov wrote: > On Wed, Nov 09, 2011 at 05:25:43PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Nov 9 17:25:43 2011 > > New Revision: 227394 > > URL: http://svn.freebsd.org/changeset/base/227394 > >=20 > > Log: > > Stopped process may legitimately have some threads sleeping and not > > suspended, if the sleep is uninterruptible. > Even more, stopped process might have some threads still running in the > kernel mode, or inhibited due to wait on blockable locks. I was unable > to design an expression that would assert that such thread will be stopped > at the kernel->user boundary. >=20 > The assertion itself is useful and catched several bugs, but theoretically > can cause false positives. If any report of the fired assert for kernel-m= ode > thread is provided, I will remove the assertions. If in five years some change will make it to fire and you won't be around, nobody will remember this e-mail of yours and someone will spend time on looking for a bug that doesn't exist. If we know it can cause false positives, I'd be in favour of removing it or changing it into a warning or at the very least moving this information into commit log. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk67bdoACgkQForvXbEpPzTLvwCg4Iqm65F8LtbXFirnK6zmcoPd d+wAn36S8Mj3S65ThbLyEWwnalvSoQDy =5qir -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 07:26:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47CAA106566B; Thu, 10 Nov 2011 07:26:30 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2678FC08; Thu, 10 Nov 2011 07:26:26 +0000 (UTC) Received: by ggnk3 with SMTP id k3so3735121ggn.13 for ; Wed, 09 Nov 2011 23:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=ZRh0e/ed8u0251p2t0gK19j+9sbYAEC0ES2ktnHX8jw=; b=hGB6f2iS0MPXn0YBHxYaLGwIw7yY0qRcHbSWzZQpZ7V3YXjhpbK3aQ9cHqboDu/Dy/ YnrVQ8DhRCndJGDFk/aCvvuKmqskIZZnX9OUOkAyd2l+nkBAeOrjoSg4fGKTP/oGJDA0 uL7qy18ttZK3MzUDR+OtzU3Bn/Of3m+TDYtQE= MIME-Version: 1.0 Received: by 10.182.192.103 with SMTP id hf7mr1606690obc.29.1320909985864; Wed, 09 Nov 2011 23:26:25 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.89.41 with HTTP; Wed, 9 Nov 2011 23:26:25 -0800 (PST) In-Reply-To: <201111100619.pAA6JIBO017680@svn.freebsd.org> References: <201111100619.pAA6JIBO017680@svn.freebsd.org> Date: Thu, 10 Nov 2011 10:26:25 +0300 X-Google-Sender-Auth: 66VQscmvJgNgMr_XSBJmYigYr6A Message-ID: From: Sergey Kandaurov To: Ruslan Mahmatkhanov 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: r227415 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 07:26:30 -0000 On 10 November 2011 10:19, Ruslan Mahmatkhanov wrote: > Author: rm (ports committer) > Date: Thu Nov 10 06:19:18 2011 > New Revision: 227415 > URL: http://svn.freebsd.org/changeset/base/227415 > > Log: > =A0Add myself. > > =A0Approved by: =A0novel (mentor) > > Modified: > =A0head/share/misc/committers-ports.dot > > Modified: head/share/misc/committers-ports.dot > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/misc/committers-ports.dot =A0 =A0 =A0 =A0Thu Nov 10 01:44:= 05 2011 =A0 =A0 =A0 =A0(r227414) > +++ head/share/misc/committers-ports.dot =A0 =A0 =A0 =A0Thu Nov 10 06:19:= 18 2011 =A0 =A0 =A0 =A0(r227415) > @@ -156,6 +156,7 @@ pgollucci [label=3D"Philip M. Gollucci\npg > =A0rafan [label=3D"Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] > =A0rakuco [label=3D"Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22= "] > =A0rene [label=3D"Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] > +rm [label=3D"Ruslan Mahmatkhanov\nrm@FreeBSD.org\n2010/11/06"] 2010? :) > =A0rnoland [label=3D"Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] > =A0romain [label=3D"Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] > =A0sahil [label=3D"Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] > @@ -366,6 +367,7 @@ nork -> ale > > =A0novel -> alexbl > =A0novel -> ehaupt > +novel -> rm > > =A0obrien -> mharo > =A0obrien -> gerald > --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 08:03:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17E69106564A; Thu, 10 Nov 2011 08:03:32 +0000 (UTC) (envelope-from rm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 077758FC12; Thu, 10 Nov 2011 08:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAA83V4Y020989; Thu, 10 Nov 2011 08:03:31 GMT (envelope-from rm@svn.freebsd.org) Received: (from rm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAA83V2u020987; Thu, 10 Nov 2011 08:03:31 GMT (envelope-from rm@svn.freebsd.org) Message-Id: <201111100803.pAA83V2u020987@svn.freebsd.org> From: Ruslan Mahmatkhanov Date: Thu, 10 Nov 2011 08:03: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: r227417 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 08:03:32 -0000 Author: rm (ports committer) Date: Thu Nov 10 08:03:31 2011 New Revision: 227417 URL: http://svn.freebsd.org/changeset/base/227417 Log: Fix date of commit bit proposing (s/2010/2011/) Spotted by: pluknet Approved by: novel (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Nov 10 06:20:18 2011 (r227416) +++ head/share/misc/committers-ports.dot Thu Nov 10 08:03:31 2011 (r227417) @@ -156,7 +156,7 @@ pgollucci [label="Philip M. Gollucci\npg rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] -rm [label="Ruslan Mahmatkhanov\nrm@FreeBSD.org\n2010/11/06"] +rm [label="Ruslan Mahmatkhanov\nrm@FreeBSD.org\n2011/11/06"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"] romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 10:08:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C54C106567A; Thu, 10 Nov 2011 10:08:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E997D8FC1E; Thu, 10 Nov 2011 10:08:43 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAAA8dtj023557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Nov 2011 12:08:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAAA8dDk074865; Thu, 10 Nov 2011 12:08:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAAA8dap074864; Thu, 10 Nov 2011 12:08:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Nov 2011 12:08:39 +0200 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20111110100839.GK50300@deviant.kiev.zoral.com.ua> References: <201111091725.pA9HPhXh092218@svn.freebsd.org> <20111109173128.GF50300@deviant.kiev.zoral.com.ua> <20111110062322.GA1696@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q7Dt3iDhSkbxWkBL" Content-Disposition: inline In-Reply-To: <20111110062322.GA1696@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227394 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 10:08:44 -0000 --Q7Dt3iDhSkbxWkBL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 10, 2011 at 07:23:23AM +0100, Pawel Jakub Dawidek wrote: > On Wed, Nov 09, 2011 at 07:31:28PM +0200, Kostik Belousov wrote: > > On Wed, Nov 09, 2011 at 05:25:43PM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Wed Nov 9 17:25:43 2011 > > > New Revision: 227394 > > > URL: http://svn.freebsd.org/changeset/base/227394 > > >=20 > > > Log: > > > Stopped process may legitimately have some threads sleeping and not > > > suspended, if the sleep is uninterruptible. > > Even more, stopped process might have some threads still running in the > > kernel mode, or inhibited due to wait on blockable locks. I was unable > > to design an expression that would assert that such thread will be stop= ped > > at the kernel->user boundary. > >=20 > > The assertion itself is useful and catched several bugs, but theoretica= lly > > can cause false positives. If any report of the fired assert for kernel= -mode > > thread is provided, I will remove the assertions. >=20 > If in five years some change will make it to fire and you won't be > around, nobody will remember this e-mail of yours and someone will spend > time on looking for a bug that doesn't exist. >=20 > If we know it can cause false positives, I'd be in favour of removing it > or changing it into a warning or at the very least moving this > information into commit log. Yes, I do agree that removing the assertion is the most straightforward solution, but on the assertion already catched more real bugs then caused headaches (my headache, BTW). Either I change the third or condition to plain P_SHOULDSTOP(), or create a way to assert exactly what I need. --Q7Dt3iDhSkbxWkBL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk67oqcACgkQC3+MBN1Mb4i7UQCbBBAr44zlXh779kHR51peBQZP pTUAnAgkhE+nhoHx84FAffaPMCq6ZIab =P2mO -----END PGP SIGNATURE----- --Q7Dt3iDhSkbxWkBL-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 11:17:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86927106564A; Thu, 10 Nov 2011 11:17:41 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D50A8FC13; Thu, 10 Nov 2011 11:17:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAABHfNX036799; Thu, 10 Nov 2011 11:17:41 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAABHf1R036797; Thu, 10 Nov 2011 11:17:41 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111101117.pAABHf1R036797@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 10 Nov 2011 11:17: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: r227418 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 11:17:41 -0000 Author: pluknet Date: Thu Nov 10 11:17:40 2011 New Revision: 227418 URL: http://svn.freebsd.org/changeset/base/227418 Log: Sync definitions with header. Modified: head/share/man/man4/mtio.4 Modified: head/share/man/man4/mtio.4 ============================================================================== --- head/share/man/man4/mtio.4 Thu Nov 10 08:03:31 2011 (r227417) +++ head/share/man/man4/mtio.4 Thu Nov 10 11:17:40 2011 (r227418) @@ -35,7 +35,7 @@ .\" @(#)mtio.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 11, 1996 +.Dd November 11, 2011 .Dt MTIO 4 .Os .Sh NAME @@ -97,7 +97,7 @@ The following definitions are from /* structure for MTIOCTOP - mag tape op command */ struct mtop { short mt_op; /* operations defined below */ - daddr_t mt_count; /* how many of them */ + int32_t mt_count; /* how many of them */ }; /* operations */ @@ -165,19 +165,25 @@ struct mtget { short mt_dsreg; /* ``drive status'' register */ short mt_erreg; /* ``error'' register */ /* end device-dependent registers */ + /* + * Note that the residual count, while maintained, may be + * be nonsense because the size of the residual may (greatly) + * exceed 32 K-bytes. Use the MTIOCERRSTAT ioctl to get a + * more accurate count. + */ short mt_resid; /* residual count */ #if defined (__FreeBSD__) - daddr_t mt_blksiz; /* presently operating blocksize */ - daddr_t mt_density; /* presently operating density */ + int32_t mt_blksiz; /* presently operating blocksize */ + int32_t mt_density; /* presently operating density */ u_int32_t mt_comp; /* presently operating compression */ - daddr_t mt_blksiz0; /* blocksize for mode 0 */ - daddr_t mt_blksiz1; /* blocksize for mode 1 */ - daddr_t mt_blksiz2; /* blocksize for mode 2 */ - daddr_t mt_blksiz3; /* blocksize for mode 3 */ - daddr_t mt_density0; /* density for mode 0 */ - daddr_t mt_density1; /* density for mode 1 */ - daddr_t mt_density2; /* density for mode 2 */ - daddr_t mt_density3; /* density for mode 3 */ + int32_t mt_blksiz0; /* blocksize for mode 0 */ + int32_t mt_blksiz1; /* blocksize for mode 1 */ + int32_t mt_blksiz2; /* blocksize for mode 2 */ + int32_t mt_blksiz3; /* blocksize for mode 3 */ + int32_t mt_density0; /* density for mode 0 */ + int32_t mt_density1; /* density for mode 1 */ + int32_t mt_density2; /* density for mode 2 */ + int32_t mt_density3; /* density for mode 3 */ /* the following are not yet implemented */ u_int32_t mt_comp0; /* compression type for mode 0 */ u_int32_t mt_comp1; /* compression type for mode 1 */ @@ -185,8 +191,8 @@ struct mtget { u_int32_t mt_comp3; /* compression type for mode 3 */ /* end not yet implemented */ #endif - daddr_t mt_fileno; /* relative file number of current position */ - daddr_t mt_blkno; /* relative block number of current position */ + int32_t mt_fileno; /* relative file number of current position */ + int32_t mt_blkno; /* relative block number of current position */ }; /* structure for MTIOCERRSTAT - tape get error status command */ @@ -198,10 +204,10 @@ struct scsi_tape_errors { * of issuing an MTIOCERRSTAT unlatches and clears them. */ u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */ - u_int32_t io_resid; /* residual count from last Data I/O */ + int32_t io_resid; /* residual count from last Data I/O */ u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */ u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */ - u_int32_t ctl_resid; /* residual count from last Control I/O */ + int32_t ctl_resid; /* residual count from last Control I/O */ u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */ /* * These are the read and write cumulative error counters. @@ -276,20 +282,6 @@ union mterrstat { #define DEFTAPE "/dev/nsa0" #endif -#ifdef _KERNEL -/* - * minor device number - */ - -#define T_UNIT 003 /* unit selection */ -#define T_NOREWIND 004 /* no rewind on close */ -#define T_DENSEL 030 /* density select */ -#define T_800BPI 000 /* select 800 bpi */ -#define T_1600BPI 010 /* select 1600 bpi */ -#define T_6250BPI 020 /* select 6250 bpi */ -#define T_BADBPI 030 /* undefined selection */ -#endif - #endif /* !_SYS_MTIO_H_ */ .Ed .Sh FILES From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 12:05:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEC71106566C; Thu, 10 Nov 2011 12:05:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1E78FC15; Thu, 10 Nov 2011 12:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAC5Qm4038661; Thu, 10 Nov 2011 12:05:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAC5QTV038659; Thu, 10 Nov 2011 12:05:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111101205.pAAC5QTV038659@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 10 Nov 2011 12:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227419 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 12:05:26 -0000 Author: glebius Date: Thu Nov 10 12:05:26 2011 New Revision: 227419 URL: http://svn.freebsd.org/changeset/base/227419 Log: Note that NAT instance argument can be tablearg. PR: misc/162265 Submitted by: Paul Procacci Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Thu Nov 10 11:17:40 2011 (r227418) +++ head/sbin/ipfw/ipfw.8 Thu Nov 10 12:05:26 2011 (r227419) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2011 +.Dd November 10, 2011 .Dt IPFW 8 .Os .Sh NAME @@ -769,7 +769,7 @@ To enable .Cm fwd a custom kernel needs to be compiled with the option .Cd "options IPFIREWALL_FORWARD" . -.It Cm nat Ar nat_nr +.It Cm nat Ar nat_nr | tablearg Pass packet to a nat instance (for network address translation, address redirect, etc.): From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 12:16:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B549106566C; Thu, 10 Nov 2011 12:16:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 09E368FC12; Thu, 10 Nov 2011 12:16:49 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 2B30518F; Thu, 10 Nov 2011 13:16:48 +0100 (CET) Date: Thu, 10 Nov 2011 13:15:57 +0100 From: Pawel Jakub Dawidek To: Kostik Belousov Message-ID: <20111110121557.GC1659@garage.freebsd.pl> References: <201111091725.pA9HPhXh092218@svn.freebsd.org> <20111109173128.GF50300@deviant.kiev.zoral.com.ua> <20111110062322.GA1696@garage.freebsd.pl> <20111110100839.GK50300@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9UV9rz0O2dU/yYYn" Content-Disposition: inline In-Reply-To: <20111110100839.GK50300@deviant.kiev.zoral.com.ua> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227394 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 12:16:51 -0000 --9UV9rz0O2dU/yYYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 10, 2011 at 12:08:39PM +0200, Kostik Belousov wrote: > On Thu, Nov 10, 2011 at 07:23:23AM +0100, Pawel Jakub Dawidek wrote: > > On Wed, Nov 09, 2011 at 07:31:28PM +0200, Kostik Belousov wrote: > > > On Wed, Nov 09, 2011 at 05:25:43PM +0000, Konstantin Belousov wrote: > > > > Author: kib > > > > Date: Wed Nov 9 17:25:43 2011 > > > > New Revision: 227394 > > > > URL: http://svn.freebsd.org/changeset/base/227394 > > > >=20 > > > > Log: > > > > Stopped process may legitimately have some threads sleeping and n= ot > > > > suspended, if the sleep is uninterruptible. > > > Even more, stopped process might have some threads still running in t= he > > > kernel mode, or inhibited due to wait on blockable locks. I was unable > > > to design an expression that would assert that such thread will be st= opped > > > at the kernel->user boundary. > > >=20 > > > The assertion itself is useful and catched several bugs, but theoreti= cally > > > can cause false positives. If any report of the fired assert for kern= el-mode > > > thread is provided, I will remove the assertions. > >=20 > > If in five years some change will make it to fire and you won't be > > around, nobody will remember this e-mail of yours and someone will spend > > time on looking for a bug that doesn't exist. > >=20 > > If we know it can cause false positives, I'd be in favour of removing it > > or changing it into a warning or at the very least moving this > > information into commit log. > Yes, I do agree that removing the assertion is the most straightforward > solution, but on the assertion already catched more real bugs then > caused headaches (my headache, BTW). Either I change the third or conditi= on > to plain P_SHOULDSTOP(), or create a way to assert exactly what I need. Maybe it would be easier to implement entire check in a function where you have more flexibility and just use function's result in assertion? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --9UV9rz0O2dU/yYYn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk67wHwACgkQForvXbEpPzRnmACguMu0LvQfHiu6Flkol5Bew5ys vQQAn3FIvYHUSyF6U6zWpnYbtw93c8SY =+fgY -----END PGP SIGNATURE----- --9UV9rz0O2dU/yYYn-- From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 17:01:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50ED0106564A; Thu, 10 Nov 2011 17:01:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406C78FC08; Thu, 10 Nov 2011 17:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAH1ZVJ047925; Thu, 10 Nov 2011 17:01:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAH1ZIc047923; Thu, 10 Nov 2011 17:01:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111101701.pAAH1ZIc047923@svn.freebsd.org> From: Adrian Chadd Date: Thu, 10 Nov 2011 17:01: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: r227421 - head/sys/modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 17:01:35 -0000 Author: adrian Date: Thu Nov 10 17:01:34 2011 New Revision: 227421 URL: http://svn.freebsd.org/changeset/base/227421 Log: Add a missing reference to AR9287. Sponsored by: Hobnob, Inc. Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Thu Nov 10 16:50:36 2011 (r227420) +++ head/sys/modules/ath/Makefile Thu Nov 10 17:01:34 2011 (r227421) @@ -75,7 +75,7 @@ SRCS+= ar2425.c SRCS+= ar5413.c # -# AR5416, AR9130, AR9160, AR9220, AR9280, AR9285 support. +# AR5416, AR9130, AR9160, AR9220, AR9280, AR9285, AR9287 support. # Note enabling this support requires defining AH_SUPPORT_AR5416 # in opt_ah.h so the 11n tx/rx descriptor format is handled. From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 20:15:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7C43106564A; Thu, 10 Nov 2011 20:15:35 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EEE18FC14; Thu, 10 Nov 2011 20:15:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAKFZ4F054601; Thu, 10 Nov 2011 20:15:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAKFZ0k054599; Thu, 10 Nov 2011 20:15:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111102015.pAAKFZ0k054599@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Nov 2011 20:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227427 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 20:15:35 -0000 Author: dim Date: Thu Nov 10 20:15:35 2011 New Revision: 227427 URL: http://svn.freebsd.org/changeset/base/227427 Log: Revert r227403 for now. Since the cross-tools stage purposefully doesn't have ${WORLDTMP}/usr/bin in its PATH, if you build world with CC=clang, tblgen tools from /usr/bin will be used instead of the ones built under ${WORLDTMP}. This can lead to various errors, especially if you upgrade from an older clang. Note that building world with gcc would not experience these problems, because it only uses the tblgen tools in the world stage, where PATH does contain ${WORLDTMP}/usr/bin. Pointy hat to: dim Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 10 19:54:00 2011 (r227426) +++ head/Makefile.inc1 Thu Nov 10 20:15:35 2011 (r227427) @@ -1029,6 +1029,14 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptre _crunchgen= usr.sbin/crunch/crunchgen .endif +.if ${MK_CLANG} != "no" +_clang_tblgen= \ + lib/clang/libllvmsupport \ + lib/clang/libllvmtablegen \ + usr.bin/clang/tblgen \ + usr.bin/clang/clang-tblgen +.endif + .if ${MK_CDDL} != "no" && \ ${BOOTSTRAPPING} < 800038 && \ !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) @@ -1045,6 +1053,7 @@ _dtc= gnu/usr.bin/dtc # FreeBSD versions that need the tool built at this stage of the build. bootstrap-tools: .for _tool in \ + ${_clang_tblgen} \ ${_dtrace_tools} \ ${_strfile} \ ${_gperf} \ @@ -1140,13 +1149,9 @@ _binutils= gnu/usr.bin/binutils .endif .if ${MK_CLANG} != "no" -_clang_tblgen= lib/clang/libllvmsupport \ - lib/clang/libllvmtablegen \ - usr.bin/clang/tblgen \ - usr.bin/clang/clang-tblgen .if ${CC:T:Mclang} == "clang" -_clang_libs= lib/clang _clang= usr.bin/clang +_clang_libs= lib/clang .endif .endif @@ -1156,7 +1161,6 @@ _cc= gnu/usr.bin/cc cross-tools: .for _tool in \ - ${_clang_tblgen} \ ${_clang_libs} \ ${_clang} \ ${_binutils} \ From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 21:07:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 815ED106568A; Thu, 10 Nov 2011 21:07:15 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 717688FC18; Thu, 10 Nov 2011 21:07:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAL7FSR056378; Thu, 10 Nov 2011 21:07:15 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAL7Fsw056376; Thu, 10 Nov 2011 21:07:15 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111102107.pAAL7Fsw056376@svn.freebsd.org> From: Ryan Stone Date: Thu, 10 Nov 2011 21:07: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: r227429 - head/usr.sbin/config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 21:07:15 -0000 Author: rstone Date: Thu Nov 10 21:07:14 2011 New Revision: 227429 URL: http://svn.freebsd.org/changeset/base/227429 Log: The generated Makefile for the kernel was not running ctfconvert on object files corresponding to source files that had the compile-with option set in conf/files. This means that any fbt probes for functions in that object file would not have correct argument types. The fix is to run ctfconvert on any target file that does not have the no-obj option set in files. PR: bin/160275 Reported by: Paul Ambrose (ambrosehua AT gmail DOT com) MFC after: 1 week Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Thu Nov 10 20:28:30 2011 (r227428) +++ head/usr.sbin/config/mkmakefile.c Thu Nov 10 21:07:14 2011 (r227429) @@ -762,16 +762,21 @@ do_rules(FILE *f) break; } snprintf(cmd, sizeof(cmd), - "${%s_%c%s}\n\t@${NORMAL_CTFCONVERT}", ftype, + "${%s_%c%s}\n", ftype, toupper(och), ftp->f_flags & NOWERROR ? "_NOWERROR" : ""); compilewith = cmd; } *cp = och; if (strlen(ftp->f_objprefix)) - fprintf(f, "\t%s $S/%s\n\n", compilewith, np); + fprintf(f, "\t%s $S/%s\n", compilewith, np); else - fprintf(f, "\t%s\n\n", compilewith); + fprintf(f, "\t%s\n", compilewith); + + if (!(ftp->f_flags & NO_OBJ)) + fprintf(f, "\t@${NORMAL_CTFCONVERT}\n\n"); + else + fprintf(f, "\n"); } } From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 22:03:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E85E106566C; Thu, 10 Nov 2011 22:03:36 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040498FC14; Thu, 10 Nov 2011 22:03:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAM3ZDg058091; Thu, 10 Nov 2011 22:03:35 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAM3ZuO058089; Thu, 10 Nov 2011 22:03:35 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111102203.pAAM3ZuO058089@svn.freebsd.org> From: Ryan Stone Date: Thu, 10 Nov 2011 22:03: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: r227430 - head/sys/cddl/dev/dtrace/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 22:03:36 -0000 Author: rstone Date: Thu Nov 10 22:03:35 2011 New Revision: 227430 URL: http://svn.freebsd.org/changeset/base/227430 Log: On i386, fbt probes are implemented by writing an invalid opcode over certain instructions in a function prologue or epilogue. DTrace has a hook into the invalid opcode fault handler that checks whether the fault was due to an probe and if so, runs the DTrace magic. Upon returning from an invalid opcode fault caused by a probe, DTrace must emulate the instruction that was replaced with the invalid opcode and then return control to the instruction following the invalid opcode. There were a pair of related bugs in the emulation for the leave instruction. The leave instruction is used to pop off a stack frame prior to returning from a function. The emulation for this instruction must move the trap frame for the invalid opcode fault down the stack to the bottom of the stack frame that is being removed, and then execute an iret. At two points in this process, the emulation code was storing values above the current value of the stack pointer. This opened up a window in which if we were two take an interrupt, the trap frame for the interrupt would overwrite the values stored on the stack, causing the system to panic later. The first bug was that at one point the emulation code saves the new value for $esp above the current stack pointer value. The fix is to save this value instead inside of the original trap frame. At this point we do not need the original trap frame so this is safe. The second bug is that when the emulate code loads $esp from the stack, it points part-way through the new trap frame instead of at its beginning. The emulation code adjusts the stack pointer to the correct value immediately afterwards, but this still leaves a one instruction window in which an interrupt would corrupt this trap frame. Fix this by adjusting the stack frame value before loading it into $esp. This fixes panics in invop_leave on i386 when using fbt return probes. Reviewed by: rpaulo, attilio MFC after: 1 week Modified: head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Modified: head/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Thu Nov 10 21:07:14 2011 (r227429) +++ head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Thu Nov 10 22:03:35 2011 (r227430) @@ -125,11 +125,11 @@ invop_leave: movl 8(%esp), %eax /* load calling EIP */ incl %eax /* increment over LOCK prefix */ movl %eax, -8(%ebx) /* store calling EIP */ - movl %ebx, -4(%esp) /* temporarily store new %esp */ + subl $8, %ebx /* adjust for three pushes, one pop */ + movl %ebx, 8(%esp) /* temporarily store new %esp */ popl %ebx /* pop off temp */ popl %eax /* pop off temp */ - movl -12(%esp), %esp /* set stack pointer */ - subl $8, %esp /* adjust for three pushes, one pop */ + movl (%esp), %esp /* set stack pointer */ iret /* return from interrupt */ invop_nop: /* From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 22:15:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60DFD106566C; Thu, 10 Nov 2011 22:15:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5038A8FC08; Thu, 10 Nov 2011 22:15:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAMFCba058484; Thu, 10 Nov 2011 22:15:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAAMFCNB058482; Thu, 10 Nov 2011 22:15:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111102215.pAAMFCNB058482@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Nov 2011 22:15: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: r227431 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 22:15:12 -0000 Author: yongari Date: Thu Nov 10 22:15:11 2011 New Revision: 227431 URL: http://svn.freebsd.org/changeset/base/227431 Log: style. No functional changes. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Thu Nov 10 22:03:35 2011 (r227430) +++ head/sys/dev/ti/if_ti.c Thu Nov 10 22:15:11 2011 (r227431) @@ -507,8 +507,7 @@ ti_copy_mem(struct ti_softc *sc, uint32_ * At the moment, we don't handle non-aligned cases, we just bail. * If this proves to be a problem, it will be fixed. */ - if ((readdata == 0) - && (tigon_addr & 0x3)) { + if (readdata == 0 && (tigon_addr & 0x3) != 0) { device_printf(sc->ti_dev, "%s: tigon address %#x isn't " "word-aligned\n", __func__, tigon_addr); device_printf(sc->ti_dev, "%s: unaligned writes aren't " @@ -557,11 +556,8 @@ ti_copy_mem(struct ti_softc *sc, uint32_ ti_offset = TI_WINDOW + (segptr & (TI_WINLEN -1)); if (readdata) { - - bus_space_read_region_4(sc->ti_btag, - sc->ti_bhandle, ti_offset, - (uint32_t *)tmparray, - segsize >> 2); + bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle, + ti_offset, (uint32_t *)tmparray, segsize >> 2); if (useraddr) { /* * Yeah, this is a little on the kludgy @@ -569,29 +565,28 @@ ti_copy_mem(struct ti_softc *sc, uint32_ * used for debugging. */ ti_bcopy_swap(tmparray, tmparray2, segsize, - TI_SWAP_NTOH); + TI_SWAP_NTOH); TI_UNLOCK(sc); if (first_pass) { copyout(&tmparray2[segresid], ptr, - segsize - segresid); + segsize - segresid); first_pass = 0; } else copyout(tmparray2, ptr, segsize); TI_LOCK(sc); } else { if (first_pass) { - ti_bcopy_swap(tmparray, tmparray2, - segsize, TI_SWAP_NTOH); + segsize, TI_SWAP_NTOH); TI_UNLOCK(sc); bcopy(&tmparray2[segresid], ptr, - segsize - segresid); + segsize - segresid); TI_LOCK(sc); first_pass = 0; } else ti_bcopy_swap(tmparray, ptr, segsize, - TI_SWAP_NTOH); + TI_SWAP_NTOH); } } else { @@ -600,15 +595,13 @@ ti_copy_mem(struct ti_softc *sc, uint32_ copyin(ptr, tmparray2, segsize); TI_LOCK(sc); ti_bcopy_swap(tmparray2, tmparray, segsize, - TI_SWAP_HTON); + TI_SWAP_HTON); } else ti_bcopy_swap(ptr, tmparray, segsize, - TI_SWAP_HTON); + TI_SWAP_HTON); - bus_space_write_region_4(sc->ti_btag, - sc->ti_bhandle, ti_offset, - (uint32_t *)tmparray, - segsize >> 2); + bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle, + ti_offset, (uint32_t *)tmparray, segsize >> 2); } segptr += segsize; ptr += segsize; @@ -619,8 +612,8 @@ ti_copy_mem(struct ti_softc *sc, uint32_ * Handle leftover, non-word-aligned bytes. */ if (resid != 0) { - uint32_t tmpval, tmpval2; - bus_size_t ti_offset; + uint32_t tmpval, tmpval2; + bus_size_t ti_offset; /* * Set the segment pointer. @@ -635,7 +628,7 @@ ti_copy_mem(struct ti_softc *sc, uint32_ * writes, since we'll be doing read/modify/write. */ bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle, - ti_offset, &tmpval, 1); + ti_offset, &tmpval, 1); /* * Next, translate this from little-endian to big-endian @@ -677,7 +670,7 @@ ti_copy_mem(struct ti_softc *sc, uint32_ tmpval = htonl(tmpval2); bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle, - ti_offset, &tmpval, 1); + ti_offset, &tmpval, 1); } } @@ -788,8 +781,7 @@ ti_bcopy_swap(const void *src, void *dst size_t tmplen; if (len & 0x3) { - printf("ti_bcopy_swap: length %zd isn't 32-bit aligned\n", - len); + printf("ti_bcopy_swap: length %zd isn't 32-bit aligned\n", len); return (-1); } @@ -799,12 +791,9 @@ ti_bcopy_swap(const void *src, void *dst while (tmplen) { if (swap_type == TI_SWAP_NTOH) - *(uint32_t *)tmpdst = - ntohl(*(const uint32_t *)tmpsrc); + *(uint32_t *)tmpdst = ntohl(*(const uint32_t *)tmpsrc); else - *(uint32_t *)tmpdst = - htonl(*(const uint32_t *)tmpsrc); - + *(uint32_t *)tmpdst = htonl(*(const uint32_t *)tmpsrc); tmpsrc += 4; tmpdst += 4; tmplen -= 4; @@ -1768,7 +1757,8 @@ ti_setmulti(struct ti_softc *sc) * around it on the Tigon 2 by setting a bit in the PCI state register, * but for the Tigon 1 we must give up and abort the interface attach. */ -static int ti_64bitslot_war(struct ti_softc *sc) +static int +ti_64bitslot_war(struct ti_softc *sc) { if (!(CSR_READ_4(sc, TI_PCI_STATE) & TI_PCISTATE_32BIT_BUS)) { @@ -3532,7 +3522,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, TI_LOCK(sc); bcopy(&sc->ti_rdata->ti_info.ti_stats, outstats, - sizeof(struct ti_stats)); + sizeof(struct ti_stats)); TI_UNLOCK(sc); break; } @@ -3604,7 +3594,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, break; } case TIIOCSETTRACE: { - ti_trace_type trace_type; + ti_trace_type trace_type; trace_type = *(ti_trace_type *)addr; @@ -3629,7 +3619,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, trace_start = CSR_READ_4(sc, TI_GCR_NICTRACE_START); cur_trace_ptr = CSR_READ_4(sc, TI_GCR_NICTRACE_PTR); trace_len = CSR_READ_4(sc, TI_GCR_NICTRACE_LEN); - #if 0 if_printf(sc->ti_ifp, "trace_start = %#x, cur_trace_ptr = %#x, " "trace_len = %d\n", trace_start, @@ -3637,20 +3626,17 @@ ti_ioctl2(struct cdev *dev, u_long cmd, if_printf(sc->ti_ifp, "trace_buf->buf_len = %d\n", trace_buf->buf_len); #endif - error = ti_copy_mem(sc, trace_start, min(trace_len, - trace_buf->buf_len), - (caddr_t)trace_buf->buf, 1, 1); - + trace_buf->buf_len), (caddr_t)trace_buf->buf, 1, 1); if (error == 0) { trace_buf->fill_len = min(trace_len, - trace_buf->buf_len); + trace_buf->buf_len); if (cur_trace_ptr < trace_start) trace_buf->cur_trace_ptr = - trace_start - cur_trace_ptr; + trace_start - cur_trace_ptr; else trace_buf->cur_trace_ptr = - cur_trace_ptr - trace_start; + cur_trace_ptr - trace_start; } else trace_buf->fill_len = 0; TI_UNLOCK(sc); @@ -3699,25 +3685,22 @@ ti_ioctl2(struct cdev *dev, u_long cmd, * nothing else. */ TI_LOCK(sc); - if ((mem_param->tgAddr >= TI_BEG_SRAM) - && ((mem_param->tgAddr + mem_param->len) <= sram_end)) { + if (mem_param->tgAddr >= TI_BEG_SRAM && + mem_param->tgAddr + mem_param->len <= sram_end) { /* * In this instance, we always copy to/from user * space, so the user space argument is set to 1. */ error = ti_copy_mem(sc, mem_param->tgAddr, - mem_param->len, - mem_param->userAddr, 1, - (cmd == ALT_READ_TG_MEM) ? 1 : 0); - } else if ((mem_param->tgAddr >= TI_BEG_SCRATCH) - && (mem_param->tgAddr <= scratch_end)) { + mem_param->len, mem_param->userAddr, 1, + cmd == ALT_READ_TG_MEM ? 1 : 0); + } else if (mem_param->tgAddr >= TI_BEG_SCRATCH && + mem_param->tgAddr <= scratch_end) { error = ti_copy_scratch(sc, mem_param->tgAddr, - mem_param->len, - mem_param->userAddr, 1, - (cmd == ALT_READ_TG_MEM) ? - 1 : 0, TI_PROCESSOR_A); - } else if ((mem_param->tgAddr >= TI_BEG_SCRATCH_B_DEBUG) - && (mem_param->tgAddr <= TI_BEG_SCRATCH_B_DEBUG)) { + mem_param->len, mem_param->userAddr, 1, + cmd == ALT_READ_TG_MEM ? 1 : 0, TI_PROCESSOR_A); + } else if (mem_param->tgAddr >= TI_BEG_SCRATCH_B_DEBUG && + mem_param->tgAddr <= TI_BEG_SCRATCH_B_DEBUG) { if (sc->ti_hwrev == TI_HWREV_TIGON) { if_printf(sc->ti_ifp, "invalid memory range for Tigon I\n"); @@ -3725,11 +3708,9 @@ ti_ioctl2(struct cdev *dev, u_long cmd, break; } error = ti_copy_scratch(sc, mem_param->tgAddr - - TI_SCRATCH_DEBUG_OFF, - mem_param->len, - mem_param->userAddr, 1, - (cmd == ALT_READ_TG_MEM) ? - 1 : 0, TI_PROCESSOR_B); + TI_SCRATCH_DEBUG_OFF, mem_param->len, + mem_param->userAddr, 1, + cmd == ALT_READ_TG_MEM ? 1 : 0, TI_PROCESSOR_B); } else { if_printf(sc->ti_ifp, "memory address %#x len %d is " "out of supported range\n", @@ -3743,8 +3724,8 @@ ti_ioctl2(struct cdev *dev, u_long cmd, case ALT_READ_TG_REG: case ALT_WRITE_TG_REG: { - struct tg_reg *regs; - uint32_t tmpval; + struct tg_reg *regs; + uint32_t tmpval; regs = (struct tg_reg *)addr; @@ -3758,7 +3739,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, TI_LOCK(sc); if (cmd == ALT_READ_TG_REG) { bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle, - regs->addr, &tmpval, 1); + regs->addr, &tmpval, 1); regs->data = ntohl(tmpval); #if 0 if ((regs->addr == TI_CPU_STATE) @@ -3770,7 +3751,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, } else { tmpval = htonl(regs->data); bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle, - regs->addr, &tmpval, 1); + regs->addr, &tmpval, 1); } TI_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 23:14:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBEF1106566C; Thu, 10 Nov 2011 23:14:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4B88FC0C; Thu, 10 Nov 2011 23:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAANE4bK060367; Thu, 10 Nov 2011 23:14:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAANE4bv060365; Thu, 10 Nov 2011 23:14:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111102314.pAANE4bv060365@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 10 Nov 2011 23:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227432 - head/sys/dev/ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 23:14:04 -0000 Author: yongari Date: Thu Nov 10 23:14:04 2011 New Revision: 227432 URL: http://svn.freebsd.org/changeset/base/227432 Log: Remove dead ifdef. Driver should always check raised interrupt is for the device. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Thu Nov 10 22:15:11 2011 (r227431) +++ head/sys/dev/ti/if_ti.c Thu Nov 10 23:14:04 2011 (r227432) @@ -2825,14 +2825,11 @@ ti_intr(void *xsc) TI_LOCK(sc); ifp = sc->ti_ifp; -/*#ifdef notdef*/ - /* Avoid this for now -- checking this register is expensive. */ /* Make sure this is really our interrupt. */ if (!(CSR_READ_4(sc, TI_MISC_HOST_CTL) & TI_MHC_INTSTATE)) { TI_UNLOCK(sc); return; } -/*#endif*/ /* Ack interrupt and stop others from occuring. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1); From owner-svn-src-head@FreeBSD.ORG Thu Nov 10 23:17:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A259106564A; Thu, 10 Nov 2011 23:17:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAB38FC0C; Thu, 10 Nov 2011 23:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAANH08u060524; Thu, 10 Nov 2011 23:17:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAANH0PQ060522; Thu, 10 Nov 2011 23:17:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111102317.pAANH0PQ060522@svn.freebsd.org> From: Adrian Chadd Date: Thu, 10 Nov 2011 23:17: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: r227433 - head/sys/modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2011 23:17:00 -0000 Author: adrian Date: Thu Nov 10 23:16:59 2011 New Revision: 227433 URL: http://svn.freebsd.org/changeset/base/227433 Log: Revert this previous commit for now - although this override unfortunately results in the HAL being built without HAL debugging/diagnostic support, the module building process needs to be somehow taught to not build AR5416+ NICs if AH_SUPPORT_AR5416 isn't defined in opt_ah.h . Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Thu Nov 10 23:14:04 2011 (r227432) +++ head/sys/modules/ath/Makefile Thu Nov 10 23:16:59 2011 (r227433) @@ -140,9 +140,7 @@ SRCS+= dfs_null.c CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal -.if !defined(KERNBUILDDIR) opt_ah.h: echo '#define AH_SUPPORT_AR5416 1' > $@ -.endif .include From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 00:48:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4AF8106566C; Fri, 11 Nov 2011 00:48:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4F838FC0C; Fri, 11 Nov 2011 00:48:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB0mfxg063371; Fri, 11 Nov 2011 00:48:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB0mfEu063369; Fri, 11 Nov 2011 00:48:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111110048.pAB0mfEu063369@svn.freebsd.org> From: Adrian Chadd Date: Fri, 11 Nov 2011 00:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227434 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 00:48:41 -0000 Author: adrian Date: Fri Nov 11 00:48:41 2011 New Revision: 227434 URL: http://svn.freebsd.org/changeset/base/227434 Log: Correct device id comments. Modified: head/sys/dev/ath/ath_hal/ah_devid.h Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Thu Nov 10 23:16:59 2011 (r227433) +++ head/sys/dev/ath/ath_hal/ah_devid.h Fri Nov 11 00:48:41 2011 (r227434) @@ -73,11 +73,11 @@ /* AR5416 compatible devid's */ #define AR5416_DEVID_PCI 0x0023 /* AR5416 PCI (MB/CB) Owl */ -#define AR5416_DEVID_PCIE 0x0024 /* AR5416 PCI-E (XB) Owl */ +#define AR5416_DEVID_PCIE 0x0024 /* AR5418 PCI-E (XB) Owl */ #define AR5416_AR9130_DEVID 0x000b /* AR9130 SoC WiMAC */ #define AR9160_DEVID_PCI 0x0027 /* AR9160 PCI Sowl */ #define AR9280_DEVID_PCI 0x0029 /* AR9280 PCI Merlin */ -#define AR9280_DEVID_PCIE 0x002a /* AR9280 PCI-E Merlin */ +#define AR9280_DEVID_PCIE 0x002a /* AR9220 PCI-E Merlin */ #define AR9285_DEVID_PCIE 0x002b /* AR9285 PCI-E Kite */ #define AR2427_DEVID_PCIE 0x002c /* AR2427 PCI-E w/ 802.11n bonded out */ #define AR9287_DEVID_PCI 0x002d /* AR9227 PCI Kiwi */ From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 01:35:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 071D0106566C; Fri, 11 Nov 2011 01:35:08 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D23F78FC08; Fri, 11 Nov 2011 01:35:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB1Z76f064843; Fri, 11 Nov 2011 01:35:07 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB1Z7Q6064841; Fri, 11 Nov 2011 01:35:07 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111110135.pAB1Z7Q6064841@svn.freebsd.org> From: Kevin Lo Date: Fri, 11 Nov 2011 01:35: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: r227435 - head/lib/libc/regex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 01:35:08 -0000 Author: kevlo Date: Fri Nov 11 01:35:07 2011 New Revision: 227435 URL: http://svn.freebsd.org/changeset/base/227435 Log: Converting int to wint_t leads to broekn comparison of raw char and encoded wint_t. Spotted by: ache Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Fri Nov 11 00:48:41 2011 (r227434) +++ head/lib/libc/regex/regcomp.c Fri Nov 11 01:35:07 2011 (r227435) @@ -81,10 +81,10 @@ extern "C" { #endif /* === regcomp.c === */ -static void p_ere(struct parse *p, wint_t stop); +static void p_ere(struct parse *p, int stop); static void p_ere_exp(struct parse *p); static void p_str(struct parse *p); -static void p_bre(struct parse *p, wint_t end1, wint_t end2); +static void p_bre(struct parse *p, int end1, int end2); static int p_simp_re(struct parse *p, int starordinary); static int p_count(struct parse *p); static void p_bracket(struct parse *p); @@ -285,11 +285,11 @@ regcomp(regex_t * __restrict preg, /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(struct parse *p, wint_t stop); + == static void p_ere(struct parse *p, int_t stop); */ static void p_ere(struct parse *p, - wint_t stop) /* character this ERE should end at */ + int stop) /* character this ERE should end at */ { char c; sopno prevback; @@ -493,8 +493,8 @@ p_str(struct parse *p) /* - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(struct parse *p, wint_t end1, \ - == wint_t end2); + == static void p_bre(struct parse *p, int end1, \ + == int end2); * Giving end1 as OUT essentially eliminates the end1/end2 check. * * This implementation is a bit of a kludge, in that a trailing $ is first @@ -503,8 +503,8 @@ p_str(struct parse *p) */ static void p_bre(struct parse *p, - wint_t end1, /* first terminating character */ - wint_t end2) /* second terminating character */ + int end1, /* first terminating character */ + int end2) /* second terminating character */ { sopno start = HERE(); int first = 1; /* first subexpression? */ From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 03:49:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF2F2106566B; Fri, 11 Nov 2011 03:49:42 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDA338FC15; Fri, 11 Nov 2011 03:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB3ngTD069612; Fri, 11 Nov 2011 03:49:42 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB3ngUZ069609; Fri, 11 Nov 2011 03:49:42 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201111110349.pAB3ngUZ069609@svn.freebsd.org> From: Ryan Stone Date: Fri, 11 Nov 2011 03:49: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: r227441 - in head/sys: amd64/linux32 cddl/dev/systrace compat/freebsd32 i386/linux kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 03:49:43 -0000 Author: rstone Date: Fri Nov 11 03:49:42 2011 New Revision: 227441 URL: http://svn.freebsd.org/changeset/base/227441 Log: Correct the types of the arguments to return probes of the syscall provider. Previously we were erroneously supplying the argument types of the corresponding entry probe. Reviewed by: rpaulo MFC after: 1 week Modified: head/sys/amd64/linux32/linux32_systrace_args.c head/sys/cddl/dev/systrace/systrace.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/i386/linux/linux_systrace_args.c head/sys/kern/makesyscalls.sh head/sys/kern/systrace_args.c Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Fri Nov 11 02:15:44 2011 (r227440) +++ head/sys/amd64/linux32/linux32_systrace_args.c Fri Nov 11 03:49:42 2011 (r227441) @@ -2095,7 +2095,7 @@ systrace_args(int sysnum, void *params, }; } static void -systrace_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) +systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) { const char *p = NULL; switch (sysnum) { @@ -5124,3 +5124,1168 @@ systrace_setargdesc(int sysnum, int ndx, if (p != NULL) strlcpy(desc, p, descsz); } +static void +systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) +{ + const char *p = NULL; + switch (sysnum) { +#define nosys linux_nosys + /* sys_exit */ + case 1: + if (ndx == 0 || ndx == 1) + p = "void"; + break; + /* linux_fork */ + case 2: + /* read */ + case 3: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* write */ + case 4: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_open */ + case 5: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* close */ + case 6: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_waitpid */ + case 7: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_creat */ + case 8: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_link */ + case 9: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_unlink */ + case 10: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_execve */ + case 11: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_chdir */ + case 12: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_time */ + case 13: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mknod */ + case 14: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_chmod */ + case 15: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lchown16 */ + case 16: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_stat */ + case 18: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lseek */ + case 19: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getpid */ + case 20: + /* linux_mount */ + case 21: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_oldumount */ + case 22: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setuid16 */ + case 23: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getuid16 */ + case 24: + /* linux_stime */ + case 25: + /* linux_ptrace */ + case 26: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_alarm */ + case 27: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_pause */ + case 29: + /* linux_utime */ + case 30: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_access */ + case 33: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_nice */ + case 34: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* sync */ + case 36: + /* linux_kill */ + case 37: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rename */ + case 38: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mkdir */ + case 39: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rmdir */ + case 40: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* dup */ + case 41: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_pipe */ + case 42: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_times */ + case 43: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_brk */ + case 45: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setgid16 */ + case 46: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getgid16 */ + case 47: + /* linux_signal */ + case 48: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_geteuid16 */ + case 49: + /* linux_getegid16 */ + case 50: + /* acct */ + case 51: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_umount */ + case 52: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_ioctl */ + case 54: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fcntl */ + case 55: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setpgid */ + case 57: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_olduname */ + case 59: + /* umask */ + case 60: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* chroot */ + case 61: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_ustat */ + case 62: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* dup2 */ + case 63: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getppid */ + case 64: + /* getpgrp */ + case 65: + /* setsid */ + case 66: + /* linux_sigaction */ + case 67: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sgetmask */ + case 68: + /* linux_ssetmask */ + case 69: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setreuid16 */ + case 70: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setregid16 */ + case 71: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sigsuspend */ + case 72: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sigpending */ + case 73: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sethostname */ + case 74: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setrlimit */ + case 75: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_old_getrlimit */ + case 76: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getrusage */ + case 77: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_gettimeofday */ + case 78: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_settimeofday */ + case 79: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getgroups16 */ + case 80: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setgroups16 */ + case 81: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_old_select */ + case 82: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_symlink */ + case 83: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lstat */ + case 84: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_readlink */ + case 85: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* swapon */ + case 87: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_reboot */ + case 88: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_readdir */ + case 89: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mmap */ + case 90: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* munmap */ + case 91: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_truncate */ + case 92: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_ftruncate */ + case 93: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* fchmod */ + case 94: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* fchown */ + case 95: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getpriority */ + case 96: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setpriority */ + case 97: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_statfs */ + case 99: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fstatfs */ + case 100: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_socketcall */ + case 102: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_syslog */ + case 103: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setitimer */ + case 104: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getitimer */ + case 105: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_newstat */ + case 106: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_newlstat */ + case 107: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_newfstat */ + case 108: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_uname */ + case 109: + /* linux_iopl */ + case 110: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_vhangup */ + case 111: + /* linux_wait4 */ + case 114: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_swapoff */ + case 115: + /* linux_sysinfo */ + case 116: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_ipc */ + case 117: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* fsync */ + case 118: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sigreturn */ + case 119: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_clone */ + case 120: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setdomainname */ + case 121: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_newuname */ + case 122: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_adjtimex */ + case 124: + /* linux_mprotect */ + case 125: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sigprocmask */ + case 126: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_create_module */ + case 127: + /* linux_init_module */ + case 128: + /* linux_delete_module */ + case 129: + /* linux_get_kernel_syms */ + case 130: + /* linux_quotactl */ + case 131: + /* getpgid */ + case 132: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* fchdir */ + case 133: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_bdflush */ + case 134: + /* linux_sysfs */ + case 135: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_personality */ + case 136: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setfsuid16 */ + case 138: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setfsgid16 */ + case 139: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_llseek */ + case 140: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getdents */ + case 141: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_select */ + case 142: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* flock */ + case 143: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_msync */ + case 144: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_readv */ + case 145: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_writev */ + case 146: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getsid */ + case 147: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fdatasync */ + case 148: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sysctl */ + case 149: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* mlock */ + case 150: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* munlock */ + case 151: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* mlockall */ + case 152: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* munlockall */ + case 153: + /* sched_setparam */ + case 154: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* sched_getparam */ + case 155: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_setscheduler */ + case 156: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_getscheduler */ + case 157: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* sched_yield */ + case 158: + /* linux_sched_get_priority_max */ + case 159: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_get_priority_min */ + case 160: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_rr_get_interval */ + case 161: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_nanosleep */ + case 162: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mremap */ + case 163: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setresuid16 */ + case 164: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getresuid16 */ + case 165: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_query_module */ + case 167: + /* poll */ + case 168: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_nfsservctl */ + case 169: + /* linux_setresgid16 */ + case 170: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getresgid16 */ + case 171: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_prctl */ + case 172: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigreturn */ + case 173: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigaction */ + case 174: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigprocmask */ + case 175: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigpending */ + case 176: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigtimedwait */ + case 177: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_rt_sigqueueinfo */ + case 178: + /* linux_rt_sigsuspend */ + case 179: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_pread */ + case 180: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_pwrite */ + case 181: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_chown16 */ + case 182: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getcwd */ + case 183: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_capget */ + case 184: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_capset */ + case 185: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sigaltstack */ + case 186: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sendfile */ + case 187: + /* linux_vfork */ + case 190: + /* linux_getrlimit */ + case 191: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mmap2 */ + case 192: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_truncate64 */ + case 193: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_ftruncate64 */ + case 194: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_stat64 */ + case 195: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lstat64 */ + case 196: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fstat64 */ + case 197: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lchown */ + case 198: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getuid */ + case 199: + /* linux_getgid */ + case 200: + /* geteuid */ + case 201: + /* getegid */ + case 202: + /* setreuid */ + case 203: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setregid */ + case 204: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getgroups */ + case 205: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setgroups */ + case 206: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* fchown */ + case 207: + /* setresuid */ + case 208: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* getresuid */ + case 209: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setresgid */ + case 210: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* getresgid */ + case 211: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_chown */ + case 212: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setuid */ + case 213: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* setgid */ + case 214: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setfsuid */ + case 215: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_setfsgid */ + case 216: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_pivot_root */ + case 217: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_mincore */ + case 218: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* madvise */ + case 219: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_getdents64 */ + case 220: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fcntl64 */ + case 221: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_gettid */ + case 224: + /* linux_setxattr */ + case 226: + /* linux_lsetxattr */ + case 227: + /* linux_fsetxattr */ + case 228: + /* linux_getxattr */ + case 229: + /* linux_lgetxattr */ + case 230: + /* linux_fgetxattr */ + case 231: + /* linux_listxattr */ + case 232: + /* linux_llistxattr */ + case 233: + /* linux_flistxattr */ + case 234: + /* linux_removexattr */ + case 235: + /* linux_lremovexattr */ + case 236: + /* linux_fremovexattr */ + case 237: + /* linux_tkill */ + case 238: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sys_futex */ + case 240: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_setaffinity */ + case 241: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_sched_getaffinity */ + case 242: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_set_thread_area */ + case 243: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_fadvise64 */ + case 250: + /* linux_exit_group */ + case 252: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_lookup_dcookie */ + case 253: + /* linux_epoll_create */ + case 254: + /* linux_epoll_ctl */ + case 255: + /* linux_epoll_wait */ + case 256: + /* linux_remap_file_pages */ + case 257: + /* linux_set_tid_address */ + case 258: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_timer_create */ + case 259: + /* linux_timer_settime */ + case 260: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 04:10:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D411065670; Fri, 11 Nov 2011 04:10:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 708F28FC0A; Fri, 11 Nov 2011 04:10:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB4Aaht070299; Fri, 11 Nov 2011 04:10:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB4AawS070296; Fri, 11 Nov 2011 04:10:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111110410.pAB4AawS070296@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Nov 2011 04:10: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: r227442 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 04:10:36 -0000 Author: kib Date: Fri Nov 11 04:10:36 2011 New Revision: 227442 URL: http://svn.freebsd.org/changeset/base/227442 Log: Weaken the part of assertions added in the r227394. Only check that the process state is stopped. MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Nov 11 03:49:42 2011 (r227441) +++ head/sys/amd64/amd64/machdep.c Fri Nov 11 04:10:36 2011 (r227442) @@ -2048,7 +2048,7 @@ fill_fpregs(struct thread *td, struct fp { KASSERT(td == curthread || TD_IS_SUSPENDED(td) || - (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); fpugetregs(td); fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Nov 11 03:49:42 2011 (r227441) +++ head/sys/i386/i386/machdep.c Fri Nov 11 04:10:36 2011 (r227442) @@ -3300,7 +3300,7 @@ fill_fpregs(struct thread *td, struct fp { KASSERT(td == curthread || TD_IS_SUSPENDED(td) || - (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)), + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 04:12:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBF44106575F; Fri, 11 Nov 2011 04:12:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5F18FC08; Fri, 11 Nov 2011 04:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB4CwFr070418; Fri, 11 Nov 2011 04:12:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB4Cwlr070416; Fri, 11 Nov 2011 04:12:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111110412.pAB4Cwlr070416@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Nov 2011 04:12: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: r227443 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 04:12:58 -0000 Author: kib Date: Fri Nov 11 04:12:58 2011 New Revision: 227443 URL: http://svn.freebsd.org/changeset/base/227443 Log: Guard against the unlikely case of the alias path containing the '%' symbols. Reported by: arundel MFC after: 1 week Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Nov 11 04:10:36 2011 (r227442) +++ head/sys/kern/kern_conf.c Fri Nov 11 04:12:58 2011 (r227443) @@ -1016,7 +1016,7 @@ make_dev_physpath_alias(int flags, struc old_alias = NULL; ret = 0; } else { - ret = make_dev_alias_p(flags, cdev, pdev, devfspath); + ret = make_dev_alias_p(flags, cdev, pdev, "%s", devfspath); } out: if (old_alias != NULL) From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 04:13:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99091065670; Fri, 11 Nov 2011 04:13:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9BB08FC13; Fri, 11 Nov 2011 04:13:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB4Dlvd070473; Fri, 11 Nov 2011 04:13:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB4Dlcd070471; Fri, 11 Nov 2011 04:13:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111110413.pAB4Dlcd070471@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Nov 2011 04:13: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: r227444 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 04:13:47 -0000 Author: kib Date: Fri Nov 11 04:13:47 2011 New Revision: 227444 URL: http://svn.freebsd.org/changeset/base/227444 Log: Style. MFC after: 1 week Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Nov 11 04:12:58 2011 (r227443) +++ head/sys/kern/kern_conf.c Fri Nov 11 04:13:47 2011 (r227444) @@ -1009,8 +1009,7 @@ make_dev_physpath_alias(int flags, struc } sprintf(devfspath, "%s/%s", physpath, pdev->si_name); - if (old_alias != NULL - && strcmp(old_alias->si_name, devfspath) == 0) { + if (old_alias != NULL && strcmp(old_alias->si_name, devfspath) == 0) { /* Retain the existing alias. */ *cdev = old_alias; old_alias = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 07:17:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2C7F106564A; Fri, 11 Nov 2011 07:17:00 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A30888FC14; Fri, 11 Nov 2011 07:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB7H0LC077447; Fri, 11 Nov 2011 07:17:00 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAB7H05L077445; Fri, 11 Nov 2011 07:17:00 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201111110717.pAB7H05L077445@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 11 Nov 2011 07:17: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: r227447 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 07:17:00 -0000 Author: pluknet Date: Fri Nov 11 07:17:00 2011 New Revision: 227447 URL: http://svn.freebsd.org/changeset/base/227447 Log: struct timespec32: change types of tv_sec and tv_nsec fields to signed to match native struct timespec ABI on __LP32__. This change is a prerequisite for upcoming futimens()/utimensat() in whose implementations it is assumed that timespec32 can take a negative value. MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Fri Nov 11 04:22:43 2011 (r227446) +++ head/sys/compat/freebsd32/freebsd32.h Fri Nov 11 07:17:00 2011 (r227447) @@ -52,8 +52,8 @@ struct timeval32 { } while (0) struct timespec32 { - u_int32_t tv_sec; - u_int32_t tv_nsec; + int32_t tv_sec; + int32_t tv_nsec; }; #define TS_CP(src,dst,fld) do { \ CP((src).fld,(dst).fld,tv_sec); \ From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 12:06:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 630EB106564A; Fri, 11 Nov 2011 12:06:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52AD38FC14; Fri, 11 Nov 2011 12:06:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABC69Ag090230; Fri, 11 Nov 2011 12:06:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABC69w8090228; Fri, 11 Nov 2011 12:06:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111111206.pABC69w8090228@svn.freebsd.org> From: Christian Brueffer Date: Fri, 11 Nov 2011 12:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227448 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 12:06:09 -0000 Author: brueffer Date: Fri Nov 11 12:06:09 2011 New Revision: 227448 URL: http://svn.freebsd.org/changeset/base/227448 Log: Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. MFC after: 3 days Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Fri Nov 11 07:17:00 2011 (r227447) +++ head/share/man/man4/mps.4 Fri Nov 11 12:06:09 2011 (r227448) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 14:09:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D637C106564A; Fri, 11 Nov 2011 14:09:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D658FC19; Fri, 11 Nov 2011 14:09:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABE99cO093997; Fri, 11 Nov 2011 14:09:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABE99qt093995; Fri, 11 Nov 2011 14:09:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111111409.pABE99qt093995@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 11 Nov 2011 14:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227449 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 14:09:09 -0000 Author: trociny Date: Fri Nov 11 14:09:09 2011 New Revision: 227449 URL: http://svn.freebsd.org/changeset/base/227449 Log: Fix false positive EADDRINUSE that could be returned by bind, due to the typo made in r227207. Reported by: kib Tested by: kib Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Fri Nov 11 12:06:09 2011 (r227448) +++ head/sys/netinet6/in6_pcb.c Fri Nov 11 14:09:09 2011 (r227449) @@ -270,7 +270,7 @@ in6_pcbbind(register struct inpcb *inp, } else if (t && (reuseport == 0 || (t->inp_flags2 & INP_REUSEPORT) == 0) && (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_vflag & INP_IPV6PROTO) == 0)) + (t->inp_vflag & INP_IPV6PROTO) != 0)) return (EADDRINUSE); } #endif From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 19:15:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9DE106564A; Fri, 11 Nov 2011 19:15:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 841828FC16; Fri, 11 Nov 2011 19:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABJFWc7003782; Fri, 11 Nov 2011 19:15:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABJFWEi003780; Fri, 11 Nov 2011 19:15:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111111915.pABJFWEi003780@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 11 Nov 2011 19:15: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: r227452 - head/sys/dev/ae X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 19:15:32 -0000 Author: yongari Date: Fri Nov 11 19:15:32 2011 New Revision: 227452 URL: http://svn.freebsd.org/changeset/base/227452 Log: To send a frame, controller requires a prepended TX header and the length of frame should be treated as multiple of 4. Actual frame length is set in the TX header. The TX header position should be aligned on 4 byte boundary and actual frame start position should be aligned on 4 byte boundary as well. This means we need 4(TX header length) + 3(frame length fixup) additional free space in TX buffer in addition to actual frame length. Make sure TX handler check these additional bytes. ae_tx_avail_size() returns actual free space in TX buffer to ease the calculation of available TX buffer space in caller. While I'm here, replace magic number to appropriate sizeof operator to enhance readability. This change should fix controller lockup issue happened under certain conditions but it still does not fix watchdog timeout. It seems the watchdog timeout is side-effect of TxS and TxD mismatches. The root cause of TxD/TxD mismatch is not known yet but it looks like silicon bug. I guess driver may have to reinitialize controller whenever it sees TxS and TxD mismatches but leave it as it was at this moment. PR: kern/145918 Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Nov 11 15:24:17 2011 (r227451) +++ head/sys/dev/ae/if_ae.c Fri Nov 11 19:15:32 2011 (r227452) @@ -1431,7 +1431,7 @@ ae_tx_avail_size(ae_softc_t *sc) else avail = sc->txd_ack - sc->txd_cur; - return (avail - 4); /* 4-byte header. */ + return (avail); } static int @@ -1448,7 +1448,7 @@ ae_encap(ae_softc_t *sc, struct mbuf **m len = m0->m_pkthdr.len; if ((sc->flags & AE_FLAG_TXAVAIL) == 0 || - ae_tx_avail_size(sc) < len) { + len + sizeof(ae_txd_t) + 3 > ae_tx_avail_size(sc)) { #ifdef AE_DEBUG if_printf(sc->ifp, "No free Tx available.\n"); #endif @@ -1457,11 +1457,10 @@ ae_encap(ae_softc_t *sc, struct mbuf **m hdr = (ae_txd_t *)(sc->txd_base + sc->txd_cur); bzero(hdr, sizeof(*hdr)); - sc->txd_cur = (sc->txd_cur + 4) % AE_TXD_BUFSIZE_DEFAULT; /* Header - size. */ - to_end = AE_TXD_BUFSIZE_DEFAULT - sc->txd_cur; /* Space available to - * the end of the ring - */ + /* Skip header size. */ + sc->txd_cur = (sc->txd_cur + sizeof(ae_txd_t)) % AE_TXD_BUFSIZE_DEFAULT; + /* Space available to the end of the ring */ + to_end = AE_TXD_BUFSIZE_DEFAULT - sc->txd_cur; if (to_end >= len) { m_copydata(m0, 0, len, (caddr_t)(sc->txd_base + sc->txd_cur)); } else { @@ -1840,8 +1839,8 @@ ae_tx_intr(ae_softc_t *sc) /* * Move txd ack and align on 4-byte boundary. */ - sc->txd_ack = ((sc->txd_ack + le16toh(txd->len) + 4 + 3) & ~3) % - AE_TXD_BUFSIZE_DEFAULT; + sc->txd_ack = ((sc->txd_ack + le16toh(txd->len) + + sizeof(ae_txs_t) + 3) & ~3) % AE_TXD_BUFSIZE_DEFAULT; if ((flags & AE_TXS_SUCCESS) != 0) ifp->if_opackets++; From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 20:13:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B957106566C; Fri, 11 Nov 2011 20:13:25 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B9598FC15; Fri, 11 Nov 2011 20:13:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABKDPpn006859; Fri, 11 Nov 2011 20:13:25 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABKDPVc006857; Fri, 11 Nov 2011 20:13:25 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111112013.pABKDPVc006857@svn.freebsd.org> From: David Chisnall Date: Fri, 11 Nov 2011 20:13: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: r227453 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 20:13:25 -0000 Author: theraven Date: Fri Nov 11 20:13:24 2011 New Revision: 227453 URL: http://svn.freebsd.org/changeset/base/227453 Log: Added myself to committers-src.dot Approved by: dim (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Nov 11 19:15:32 2011 (r227452) +++ head/share/misc/committers-src.dot Fri Nov 11 20:13:24 2011 (r227453) @@ -238,6 +238,7 @@ stas [label="Stanislav Sedov\nstas@FreeB suz [label="SUZUKI Shinsuke\nsuz@FreeBSD.org\n2002/03/26"] syrinx [label="Shteryana Shopova\nsyrinx@FreeBSD.org\n2006/10/07"] takawata [label="Takanori Watanabe\ntakawata@FreeBSD.org\n2000/07/06"] +theraven [label="David Chisnall\ntheraven@FreeBSD.org\n2011/11/11"] thompsa [label="Andrew Thompson\nthompsa@FreeBSD.org\n2005/05/25"] ticso [label="Bernd Walter\nticso@FreeBSD.org\n2002/01/31"] tijl [label="Tijl Coosemans\ntijl@FreeBSD.org\n2010/07/16"] @@ -304,6 +305,7 @@ brian -> joe brooks -> bushman brooks -> jamie +brooks -> theraven bz -> anchie bz -> jamie @@ -333,6 +335,8 @@ dds -> versus dfr -> zml +dim -> theraven + dwmalone -> fanf dwmalone -> peadar dwmalone -> snb From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 20:31:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91D27106566B; Fri, 11 Nov 2011 20:31:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68BB68FC0A; Fri, 11 Nov 2011 20:31:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABKVmAB007555; Fri, 11 Nov 2011 20:31:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABKVmas007553; Fri, 11 Nov 2011 20:31:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111112031.pABKVmas007553@svn.freebsd.org> From: Xin LI Date: Fri, 11 Nov 2011 20:31: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: r227454 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 20:31:48 -0000 Author: delphij Date: Fri Nov 11 20:31:48 2011 New Revision: 227454 URL: http://svn.freebsd.org/changeset/base/227454 Log: Use __packed to prevent alignment from taking place, which otherwise may change the on-disk format in an incompatible way. Without this change, msdosfs created on FreeBSD/arm would not be mountable. PR: bin/162486 Submitted by: Ian Lepore Reported by: Mattia Rossi MFC after: 3 days Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Fri Nov 11 20:13:24 2011 (r227453) +++ head/sbin/newfs_msdos/newfs_msdos.c Fri Nov 11 20:31:48 2011 (r227454) @@ -99,7 +99,7 @@ static const char rcsid[] = struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ u_int8_t bsOemName[8]; /* OEM name and version */ -}; +} __packed; struct bsbpb { u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ @@ -114,7 +114,7 @@ struct bsbpb { u_int8_t bpbHeads[2]; /* drive heads */ u_int8_t bpbHiddenSecs[4]; /* hidden sectors */ u_int8_t bpbHugeSectors[4]; /* big total sectors */ -}; +} __packed; struct bsxbpb { u_int8_t bpbBigFATsecs[4]; /* big sectors per FAT */ @@ -124,7 +124,7 @@ struct bsxbpb { u_int8_t bpbFSInfo[2]; /* file system info sector */ u_int8_t bpbBackup[2]; /* backup boot sector */ u_int8_t bpbReserved[12]; /* reserved */ -}; +} __packed; struct bsx { u_int8_t exDriveNumber; /* drive number */ @@ -133,7 +133,7 @@ struct bsx { u_int8_t exVolumeID[4]; /* volume ID number */ u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ -}; +} __packed; struct de { u_int8_t deName[11]; /* name and extension */ @@ -143,7 +143,7 @@ struct de { u_int8_t deMDate[2]; /* creation date */ u_int8_t deStartCluster[2]; /* starting cluster */ u_int8_t deFileSize[4]; /* size */ -}; +} __packed; struct bpb { u_int bpbBytesPerSec; /* bytes per sector */ From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 21:14:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A3A4106566C; Fri, 11 Nov 2011 21:14:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A8FF58FC1A; Fri, 11 Nov 2011 21:14:20 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pABLEENj024384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Nov 2011 23:14:15 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pABLEEBS084464; Fri, 11 Nov 2011 23:14:14 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pABLEEow084463; Fri, 11 Nov 2011 23:14:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Nov 2011 23:14:14 +0200 From: Kostik Belousov To: Xin LI Message-ID: <20111111211414.GL50300@deviant.kiev.zoral.com.ua> References: <201111112031.pABKVmas007553@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ovupWV8IBBMgtvuU" Content-Disposition: inline In-Reply-To: <201111112031.pABKVmas007553@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227454 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 21:14:21 -0000 --ovupWV8IBBMgtvuU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 11, 2011 at 08:31:48PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Nov 11 20:31:48 2011 > New Revision: 227454 > URL: http://svn.freebsd.org/changeset/base/227454 >=20 > Log: > Use __packed to prevent alignment from taking place, which otherwise may > change the on-disk format in an incompatible way. Without this change, > msdosfs created on FreeBSD/arm would not be mountable. > =20 > PR: bin/162486 > Submitted by: Ian Lepore > Reported by: Mattia Rossi > MFC after: 3 days I suspect there is much more places with the similar issues. FAT structure definitions were not centralized, AFAIR. --ovupWV8IBBMgtvuU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk69kCUACgkQC3+MBN1Mb4jqDACePz8/qHm1VoEiZLj6W0AbdU4q ZaoAoKgiS2ndKSLq52UZsN/Q9M2CHHr7 =GS9V -----END PGP SIGNATURE----- --ovupWV8IBBMgtvuU-- From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 22:24:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1172106567C; Fri, 11 Nov 2011 22:24:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 976D28FC1C; Fri, 11 Nov 2011 22:24:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABMOGOV011304; Fri, 11 Nov 2011 22:24:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABMOG0R011302; Fri, 11 Nov 2011 22:24:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111112224.pABMOG0R011302@svn.freebsd.org> From: Eitan Adler Date: Fri, 11 Nov 2011 22:24: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: r227457 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 22:24:16 -0000 Author: eadler (ports committer) Date: Fri Nov 11 22:24:16 2011 New Revision: 227457 URL: http://svn.freebsd.org/changeset/base/227457 Log: - add support for CP-104EL-A and CP-104JU to puc PR: 151365 Submitted by: Joerg Niendorf Approved by: jhb Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Fri Nov 11 21:57:31 2011 (r227456) +++ head/sys/dev/puc/pucdata.c Fri Nov 11 22:24:16 2011 (r227457) @@ -51,6 +51,7 @@ static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -518,12 +519,25 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1120, 0xffff, 0, "Moxa Technologies, CP-112UL", DEFAULT_RCLK * 8, @@ -1086,6 +1100,19 @@ puc_config_icbook(struct puc_softc *sc, } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + const struct puc_cfg *cfg = sc->sc_cfg; + + if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 22:27:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D731B1065673; Fri, 11 Nov 2011 22:27:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC62C8FC14; Fri, 11 Nov 2011 22:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABMR9fv011440; Fri, 11 Nov 2011 22:27:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABMR9QG011434; Fri, 11 Nov 2011 22:27:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111112227.pABMR9QG011434@svn.freebsd.org> From: Eitan Adler Date: Fri, 11 Nov 2011 22:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227458 - in head: secure/usr.bin/openssl/man sys/dev/isp sys/netinet/ipfw usr.bin/compress/doc usr.sbin/pkg_install/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 22:27:10 -0000 Author: eadler (ports committer) Date: Fri Nov 11 22:27:09 2011 New Revision: 227458 URL: http://svn.freebsd.org/changeset/base/227458 Log: - add a missing "be" and "in" - fix other errors introduced when committing r226436 - add 'function' to a sentence where it makes sense Submitted by: delphij Submitted by: dougb Submitted by: jhb Approved by: dougb Approved by: jhb Modified: head/secure/usr.bin/openssl/man/ca.1 head/sys/dev/isp/DriverManual.txt head/sys/netinet/ipfw/dummynet.txt head/usr.bin/compress/doc/NOTES head/usr.sbin/pkg_install/lib/version.c Modified: head/secure/usr.bin/openssl/man/ca.1 ============================================================================== --- head/secure/usr.bin/openssl/man/ca.1 Fri Nov 11 22:24:16 2011 (r227457) +++ head/secure/usr.bin/openssl/man/ca.1 Fri Nov 11 22:27:09 2011 (r227458) @@ -205,7 +205,7 @@ section for information on the required .IP "\fB\-infiles\fR" 4 .IX Item "-infiles" if present this should be the last option, all subsequent arguments -are assumed to the names of files containing certificate requests. +are assumed to be the names of files containing certificate requests. .IP "\fB\-out filename\fR" 4 .IX Item "-out filename" the output file to output certificates to. The default is standard Modified: head/sys/dev/isp/DriverManual.txt ============================================================================== --- head/sys/dev/isp/DriverManual.txt Fri Nov 11 22:24:16 2011 (r227457) +++ head/sys/dev/isp/DriverManual.txt Fri Nov 11 22:27:09 2011 (r227458) @@ -327,7 +327,7 @@ here in clarifying some of this. A succesful execution of isp_init will lead to the driver 'registering' itself with this platform's SCSI subsystem. One assumed action for this -is the registry of a function the SCSI subsystem for this platform +is the registry of a function that the SCSI subsystem for this platform will call when it has a SCSI command to run. The platform specific module function that receives this will do whatever Modified: head/sys/netinet/ipfw/dummynet.txt ============================================================================== --- head/sys/netinet/ipfw/dummynet.txt Fri Nov 11 22:24:16 2011 (r227457) +++ head/sys/netinet/ipfw/dummynet.txt Fri Nov 11 22:27:09 2011 (r227458) @@ -325,7 +325,7 @@ we do the following: dummynet_task() =============== -The dummynet_task() is the main dummynet processing function and is +The dummynet_task() function is the main dummynet processing function and is called every tick. This function first calculate the new current time, then it checks if it is the time to wake up object from the system_heap comparing the current time and the key of the heap. Two types of object (really the Modified: head/usr.bin/compress/doc/NOTES ============================================================================== --- head/usr.bin/compress/doc/NOTES Fri Nov 11 22:24:16 2011 (r227457) +++ head/usr.bin/compress/doc/NOTES Fri Nov 11 22:27:09 2011 (r227458) @@ -51,7 +51,7 @@ comprehensive survey of an area which wi Until the dust clears, how you approach ideas which are patented depends on how paranoid you are of a legal onslaught. Arbitrary? Yes. But -the patent bar the CCPA (Court of Customs and Patent Appeals) +the patent bar of the CCPA (Court of Customs and Patent Appeals) thanks you for any uncertainty as they, at least, stand to gain from any trouble. Modified: head/usr.sbin/pkg_install/lib/version.c ============================================================================== --- head/usr.sbin/pkg_install/lib/version.c Fri Nov 11 22:24:16 2011 (r227457) +++ head/usr.sbin/pkg_install/lib/version.c Fri Nov 11 22:27:09 2011 (r227458) @@ -66,7 +66,7 @@ split_version(const char *pkgname, const if (pkgname == NULL) errx(2, "%s: Passed NULL pkgname.", __func__); - /* Look for the last '-' the pkgname */ + /* Look for the last '-' in the pkgname */ ch = strrchr(pkgname, '-'); /* Cheat if we are just passed a version, not a valid package name */ versionstr = ch ? ch + 1 : pkgname; From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 22:57:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19FBD1065670; Fri, 11 Nov 2011 22:57:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08A358FC18; Fri, 11 Nov 2011 22:57:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABMvqJT012450; Fri, 11 Nov 2011 22:57:52 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABMvqjl012442; Fri, 11 Nov 2011 22:57:52 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201111112257.pABMvqjl012442@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Nov 2011 22:57: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: r227459 - in head/sys: dev/lmc net netgraph netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 22:57:53 -0000 Author: brooks Date: Fri Nov 11 22:57:52 2011 New Revision: 227459 URL: http://svn.freebsd.org/changeset/base/227459 Log: In r191367 the need for if_free_type() was removed and a new member if_alloctype was used to store the origional interface type. Take advantage of this change by removing all existing uses of if_free_type() in favor of if_free(). MFC after: 1 Month Modified: head/sys/dev/lmc/if_lmc.c head/sys/net/if_bridge.c head/sys/net/if_lagg.c head/sys/net/if_tap.c head/sys/net/if_vlan.c head/sys/netgraph/ng_fec.c head/sys/netinet/ip_carp.c Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/dev/lmc/if_lmc.c Fri Nov 11 22:57:52 2011 (r227459) @@ -4945,7 +4945,9 @@ lmc_ifnet_detach(softc_t *sc) /* Detach from the ifnet kernel interface. */ if_detach(sc->ifp); -# if (__FreeBSD_version >= 600000) +# if (defined(__FreeBSD__) && __FreeBSD_version >= 800082) + if_free(sc->ifp); +# elif (defined(__FreeBSD__) && __FreeBSD_version >= 600000) if_free_type(sc->ifp, NSPPP ? IFT_PPP : IFT_OTHER); # endif } Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/net/if_bridge.c Fri Nov 11 22:57:52 2011 (r227459) @@ -676,7 +676,7 @@ bridge_clone_destroy(struct ifnet *ifp) bstp_detach(&sc->sc_stp); ether_ifdetach(ifp); - if_free_type(ifp, IFT_ETHER); + if_free(ifp); /* Tear down the routing table. */ bridge_rtable_fini(sc); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/net/if_lagg.c Fri Nov 11 22:57:52 2011 (r227459) @@ -275,7 +275,7 @@ lagg_clone_create(struct if_clone *ifc, if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) { sc->sc_proto = lagg_protos[i].ti_proto; if ((error = lagg_protos[i].ti_attach(sc)) != 0) { - if_free_type(ifp, IFT_ETHER); + if_free(ifp); free(sc, M_DEVBUF); return (error); } @@ -293,7 +293,6 @@ lagg_clone_create(struct if_clone *ifc, ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO); if_initname(ifp, ifc->ifc_name, unit); - ifp->if_type = IFT_ETHER; ifp->if_softc = sc; ifp->if_start = lagg_start; ifp->if_init = lagg_init; @@ -305,7 +304,7 @@ lagg_clone_create(struct if_clone *ifc, IFQ_SET_READY(&ifp->if_snd); /* - * Attach as an ordinary ethernet device, childs will be attached + * Attach as an ordinary ethernet device, children will be attached * as special device IFT_IEEE8023ADLAG. */ ether_ifattach(ifp, eaddr); @@ -352,7 +351,7 @@ lagg_clone_destroy(struct ifnet *ifp) ifmedia_removeall(&sc->sc_media); ether_ifdetach(ifp); - if_free_type(ifp, IFT_ETHER); + if_free(ifp); mtx_lock(&lagg_list_mtx); SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); Modified: head/sys/net/if_tap.c ============================================================================== --- head/sys/net/if_tap.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/net/if_tap.c Fri Nov 11 22:57:52 2011 (r227459) @@ -218,7 +218,7 @@ tap_destroy(struct tap_softc *tp) knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); ether_ifdetach(ifp); - if_free_type(ifp, IFT_ETHER); + if_free(ifp); mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/net/if_vlan.c Fri Nov 11 22:57:52 2011 (r227459) @@ -967,7 +967,7 @@ vlan_clone_create(struct if_clone *ifc, */ ether_ifdetach(ifp); vlan_unconfig(ifp); - if_free_type(ifp, IFT_ETHER); + if_free(ifp); ifc_free_unit(ifc, unit); free(ifv, M_VLAN); @@ -989,7 +989,7 @@ vlan_clone_destroy(struct if_clone *ifc, ether_ifdetach(ifp); /* first, remove it from system-wide lists */ vlan_unconfig(ifp); /* now it can be unconfigured and freed */ - if_free_type(ifp, IFT_ETHER); + if_free(ifp); free(ifv, M_VLAN); ifc_free_unit(ifc, unit); Modified: head/sys/netgraph/ng_fec.c ============================================================================== --- head/sys/netgraph/ng_fec.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/netgraph/ng_fec.c Fri Nov 11 22:57:52 2011 (r227459) @@ -1332,7 +1332,7 @@ ng_fec_shutdown(node_p node) } ether_ifdetach(priv->ifp); - if_free_type(priv->ifp, IFT_ETHER); + if_free(priv->ifp); ifmedia_removeall(&priv->ifmedia); ng_fec_free_unit(priv->unit); free(priv, M_NETGRAPH); Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Nov 11 22:27:09 2011 (r227458) +++ head/sys/netinet/ip_carp.c Fri Nov 11 22:57:52 2011 (r227459) @@ -472,7 +472,7 @@ carp_clone_destroy(struct ifnet *ifp) mtx_unlock(&carp_mtx); bpfdetach(ifp); if_detach(ifp); - if_free_type(ifp, IFT_ETHER); + if_free(ifp); #ifdef INET free(sc->sc_imo.imo_membership, M_CARP); #endif From owner-svn-src-head@FreeBSD.ORG Fri Nov 11 23:22:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7538106566C; Fri, 11 Nov 2011 23:22:38 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6AD88FC0A; Fri, 11 Nov 2011 23:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pABNMc1p013264; Fri, 11 Nov 2011 23:22:38 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pABNMc8S013259; Fri, 11 Nov 2011 23:22:38 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201111112322.pABNMc8S013259@svn.freebsd.org> From: Qing Li Date: Fri, 11 Nov 2011 23:22: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: r227460 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 23:22:38 -0000 Author: qingli Date: Fri Nov 11 23:22:38 2011 New Revision: 227460 URL: http://svn.freebsd.org/changeset/base/227460 Log: A default route learned from the RAs could be deleted manually after its installation. This removal may be accidental and can prevent the default route from being installed in the future if the associated default router has the best preference. The cause is the lack of status update in the default router on the state of its route installation in the kernel FIB. This patch fixes the described problem. Reviewed by: hrs, discussed with hrs MFC after: 5 days Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Fri Nov 11 22:57:52 2011 (r227459) +++ head/sys/netinet6/in6.c Fri Nov 11 23:22:38 2011 (r227460) @@ -152,7 +152,7 @@ in6_ifaddloop(struct ifaddr *ifa) ia = ifa2ia6(ifa); ifp = ifa->ifa_ifp; IF_AFDATA_LOCK(ifp); - ifa->ifa_rtrequest = NULL; + ifa->ifa_rtrequest = nd6_rtrequest; /* XXX QL * we need to report rt_newaddrmsg Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Fri Nov 11 22:57:52 2011 (r227459) +++ head/sys/netinet6/nd6.c Fri Nov 11 23:22:38 2011 (r227460) @@ -1174,6 +1174,46 @@ done: } +/* + * Rejuvenate this function for routing operations related + * processing. + */ +void +nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) +{ + struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct nd_defrouter *dr; + struct ifnet *ifp = rt->rt_ifp; + + RT_LOCK_ASSERT(rt); + + switch (req) { + case RTM_ADD: + break; + + case RTM_DELETE: + if (!ifp) + return; + /* + * Only indirect routes are interesting. + */ + if ((rt->rt_flags & RTF_GATEWAY) == 0) + return; + /* + * check for default route + */ + if (IN6_ARE_ADDR_EQUAL(&in6addr_any, + &SIN6(rt_key(rt))->sin6_addr)) { + + dr = defrouter_lookup(&gateway->sin6_addr, ifp); + if (dr != NULL) + dr->installed = 0; + } + break; + } +} + + int nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) { Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Fri Nov 11 22:57:52 2011 (r227459) +++ head/sys/netinet6/nd6.h Fri Nov 11 23:22:38 2011 (r227460) @@ -406,6 +406,7 @@ void nd6_purge __P((struct ifnet *)); void nd6_nud_hint __P((struct rtentry *, struct in6_addr *, int)); int nd6_resolve __P((struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *)); +void nd6_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *)); int nd6_ioctl __P((u_long, caddr_t, struct ifnet *)); struct llentry *nd6_cache_lladdr __P((struct ifnet *, struct in6_addr *, char *, int, int, int)); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Fri Nov 11 22:57:52 2011 (r227459) +++ head/sys/netinet6/nd6_rtr.c Fri Nov 11 23:22:38 2011 (r227460) @@ -751,9 +751,10 @@ defrtrlist_update(struct nd_defrouter *n /* * If the preference does not change, there's no need - * to sort the entries. + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. */ - if (rtpref(new) == oldpref) { + if (dr->installed && rtpref(new) == oldpref) { splx(s); return (dr); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 08:16:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F165C106564A; Sat, 12 Nov 2011 08:16:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEF0E8FC1A; Sat, 12 Nov 2011 08:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAC8Gj2M033004; Sat, 12 Nov 2011 08:16:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAC8GjG7032976; Sat, 12 Nov 2011 08:16:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111120816.pAC8GjG7032976@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 12 Nov 2011 08:16: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: r227461 - in head/sys/dev/usb: . controller net serial storage template wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 08:16:46 -0000 Author: hselasky Date: Sat Nov 12 08:16:45 2011 New Revision: 227461 URL: http://svn.freebsd.org/changeset/base/227461 Log: Style change. - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/controller/at91dci.c Sat Nov 12 08:16:45 2011 (r227461) @@ -2123,7 +2123,7 @@ tr_handle_get_port_status: if (sc->sc_flags.status_vbus && sc->sc_flags.status_bus_reset) { /* reset endpoint flags */ - bzero(sc->sc_ep_flags, sizeof(sc->sc_ep_flags)); + memset(sc->sc_ep_flags, 0, sizeof(sc->sc_ep_flags)); } } if (sc->sc_flags.change_suspend) { Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/controller/avr32dci.c Sat Nov 12 08:16:45 2011 (r227461) @@ -415,12 +415,11 @@ repeat: buf_res.length = count; } /* receive data */ - bcopy(sc->physdata + + memcpy(buf_res.buffer, sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + - (td->ep_no << 16) + (td->offset % td->max_packet_size), - buf_res.buffer, buf_res.length) + (td->ep_no << 16) + (td->offset % td->max_packet_size), buf_res.length); /* update counters */ - count -= buf_res.length; + count -= buf_res.length; td->offset += buf_res.length; td->remainder -= buf_res.length; } @@ -491,12 +490,12 @@ repeat: buf_res.length = count; } /* transmit data */ - bcopy(buf_res.buffer, sc->physdata + + memcpy(sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + (td->ep_no << 16) + (td->offset % td->max_packet_size), - buf_res.length) + buf_res.buffer, buf_res.length); /* update counters */ - count -= buf_res.length; + count -= buf_res.length; td->offset += buf_res.length; td->remainder -= buf_res.length; } Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/controller/ehci.c Sat Nov 12 08:16:45 2011 (r227461) @@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude break; case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): DPRINTFN(9, "get port status i=%d\n", Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/controller/ohci.c Sat Nov 12 08:16:45 2011 (r227461) @@ -2347,7 +2347,7 @@ ohci_roothub_exec(struct usb_device *ude case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): DPRINTFN(9, "get port status i=%d\n", Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/controller/uhci.c Sat Nov 12 08:16:45 2011 (r227461) @@ -2702,7 +2702,7 @@ uhci_roothub_exec(struct usb_device *ude break; case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): len = 16; - bzero(sc->sc_hub_desc.temp, 16); + memset(sc->sc_hub_desc.temp, 0, 16); break; case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): if (index == 1) Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/net/if_kue.c Sat Nov 12 08:16:45 2011 (r227461) @@ -380,8 +380,9 @@ kue_setmulti(struct usb_ether *ue) */ if (i == KUE_MCFILTCNT(sc)) break; - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - KUE_MCFILT(sc, i), ETHER_ADDR_LEN); + memcpy(KUE_MCFILT(sc, i), + LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + ETHER_ADDR_LEN); i++; } if_maddr_runlock(ifp); Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/net/uhso.c Sat Nov 12 08:16:45 2011 (r227461) @@ -1153,7 +1153,7 @@ uhso_mux_read_callback(struct usb_xfer * /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - bzero(&req, sizeof(struct usb_device_request)); + memset(&req, 0, sizeof(struct usb_device_request)); req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UCDC_GET_ENCAPSULATED_RESPONSE; USETW(req.wValue, 0); @@ -1206,7 +1206,7 @@ uhso_mux_write_callback(struct usb_xfer usbd_get_page(pc, 0, &res); - bzero(&req, sizeof(struct usb_device_request)); + memset(&req, 0, sizeof(struct usb_device_request)); req.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.bRequest = UCDC_SEND_ENCAPSULATED_COMMAND; USETW(req.wValue, 0); @@ -1731,7 +1731,7 @@ uhso_if_rxflush(void *arg) * copy the IP-packet into it. */ m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - bcopy(mtod(m0, uint8_t *), mtod(m, uint8_t *), iplen); + memcpy(mtod(m, uint8_t *), mtod(m0, uint8_t *), iplen); m->m_pkthdr.len = m->m_len = iplen; /* Adjust the size of the original mbuf */ Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/serial/ufoma.c Sat Nov 12 08:16:45 2011 (r227461) @@ -438,7 +438,7 @@ ufoma_attach(device_t dev) goto detach; } sc->sc_modetable[0] = (elements + 1); - bcopy(mad->bMode, &sc->sc_modetable[1], elements); + memcpy(&sc->sc_modetable[1], mad->bMode, elements); sc->sc_currentmode = UMCPC_ACM_MODE_UNLINKED; sc->sc_modetoactivate = mad->bMode[0]; @@ -968,7 +968,7 @@ ufoma_cfg_param(struct ucom_softc *ucom, } DPRINTF("\n"); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/serial/uftdi.c Sat Nov 12 08:16:45 2011 (r227461) @@ -560,7 +560,7 @@ static int uftdi_set_parm_soft(struct termios *t, struct uftdi_param_config *cfg, uint8_t type) { - bzero(cfg, sizeof(*cfg)); + memset(cfg, 0, sizeof(*cfg)); switch (type) { case UFTDI_TYPE_SIO: Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/serial/umodem.c Sat Nov 12 08:16:45 2011 (r227461) @@ -540,7 +540,7 @@ umodem_cfg_param(struct ucom_softc *ucom DPRINTF("sc=%p\n", sc); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/serial/uplcom.c Sat Nov 12 08:16:45 2011 (r227461) @@ -659,7 +659,7 @@ uplcom_cfg_param(struct ucom_softc *ucom DPRINTF("sc = %p\n", sc); - bzero(&ls, sizeof(ls)); + memset(&ls, 0, sizeof(ls)); USETDW(ls.dwDTERate, t->c_ospeed); Modified: head/sys/dev/usb/serial/uvisor.c ============================================================================== --- head/sys/dev/usb/serial/uvisor.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/serial/uvisor.c Sat Nov 12 08:16:45 2011 (r227461) @@ -311,8 +311,9 @@ uvisor_attach(device_t dev) int error; DPRINTF("sc=%p\n", sc); - bcopy(uvisor_config, uvisor_config_copy, + memcpy(uvisor_config_copy, uvisor_config, sizeof(uvisor_config_copy)); + device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uvisor", NULL, MTX_DEF); Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/storage/umass.c Sat Nov 12 08:16:45 2011 (r227461) @@ -891,7 +891,7 @@ umass_attach(device_t dev) int32_t err; /* - * NOTE: the softc struct is bzero-ed in device_set_driver. + * NOTE: the softc struct is cleared in device_set_driver. * We can safely call umass_detach without specifically * initializing the struct. */ @@ -1305,11 +1305,13 @@ umass_t_bbb_command_callback(struct usb_ } sc->cbw.bCDBLength = sc->sc_transfer.cmd_len; - bcopy(sc->sc_transfer.cmd_data, sc->cbw.CBWCDB, + memcpy(sc->cbw.CBWCDB, sc->sc_transfer.cmd_data, sc->sc_transfer.cmd_len); - bzero(sc->sc_transfer.cmd_data + sc->sc_transfer.cmd_len, - sizeof(sc->cbw.CBWCDB) - sc->sc_transfer.cmd_len); + memset(sc->sc_transfer.cmd_data + + sc->sc_transfer.cmd_len, 0, + sizeof(sc->cbw.CBWCDB) - + sc->sc_transfer.cmd_len); DIF(UDMASS_BBB, umass_bbb_dump_cbw(sc, &sc->cbw)); @@ -1480,9 +1482,9 @@ umass_t_bbb_status_callback(struct usb_x /* Zero missing parts of the CSW: */ - if (actlen < sizeof(sc->csw)) { - bzero(&sc->csw, sizeof(sc->csw)); - } + if (actlen < sizeof(sc->csw)) + memset(&sc->csw, 0, sizeof(sc->csw)); + pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_out(pc, 0, &sc->csw, actlen); @@ -2755,7 +2757,7 @@ umass_scsi_transform(struct umass_softc if (sc->sc_quirks & NO_TEST_UNIT_READY) { DPRINTF(sc, UDMASS_SCSI, "Converted TEST_UNIT_READY " "to START_UNIT\n"); - bzero(sc->sc_transfer.cmd_data, cmd_len); + memset(sc->sc_transfer.cmd_data, 0, cmd_len); sc->sc_transfer.cmd_data[0] = START_STOP_UNIT; sc->sc_transfer.cmd_data[4] = SSS_START; return (1); @@ -2768,14 +2770,14 @@ umass_scsi_transform(struct umass_softc * information. */ if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); sc->sc_transfer.cmd_data[4] = SHORT_INQUIRY_LENGTH; return (1); } break; } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); } @@ -2810,10 +2812,11 @@ umass_rbc_transform(struct umass_softc * case REQUEST_SENSE: case PREVENT_ALLOW: - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); if ((sc->sc_quirks & RBC_PAD_TO_12) && (cmd_len < 12)) { - bzero(sc->sc_transfer.cmd_data + cmd_len, 12 - cmd_len); + memset(sc->sc_transfer.cmd_data + cmd_len, + 0, 12 - cmd_len); cmd_len = 12; } sc->sc_transfer.cmd_len = cmd_len; @@ -2841,7 +2844,7 @@ umass_ufi_transform(struct umass_softc * sc->sc_transfer.cmd_len = UFI_COMMAND_LENGTH; /* Zero the command data */ - bzero(sc->sc_transfer.cmd_data, UFI_COMMAND_LENGTH); + memset(sc->sc_transfer.cmd_data, 0, UFI_COMMAND_LENGTH); switch (cmd_ptr[0]) { /* @@ -2898,7 +2901,7 @@ umass_ufi_transform(struct umass_softc * return (0); /* failure */ } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); /* success */ } @@ -2919,7 +2922,7 @@ umass_atapi_transform(struct umass_softc sc->sc_transfer.cmd_len = ATAPI_COMMAND_LENGTH; /* Zero the command data */ - bzero(sc->sc_transfer.cmd_data, ATAPI_COMMAND_LENGTH); + memset(sc->sc_transfer.cmd_data, 0, ATAPI_COMMAND_LENGTH); switch (cmd_ptr[0]) { /* @@ -2933,7 +2936,7 @@ umass_atapi_transform(struct umass_softc * information. */ if (sc->sc_quirks & FORCE_SHORT_INQUIRY) { - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); sc->sc_transfer.cmd_data[4] = SHORT_INQUIRY_LENGTH; return (1); @@ -2994,7 +2997,7 @@ umass_atapi_transform(struct umass_softc break; } - bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); + memcpy(sc->sc_transfer.cmd_data, cmd_ptr, cmd_len); return (1); /* success */ } Modified: head/sys/dev/usb/storage/urio.c ============================================================================== --- head/sys/dev/usb/storage/urio.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/storage/urio.c Sat Nov 12 08:16:45 2011 (r227461) @@ -440,7 +440,7 @@ urio_ioctl(struct usb_fifo *fifo, u_long error = EPERM; goto done; } - bzero(&ur, sizeof(ur)); + memset(&ur, 0, sizeof(ur)); rio_cmd = addr; ur.ucr_request.bmRequestType = rio_cmd->requesttype | UT_READ_VENDOR_DEVICE; @@ -451,7 +451,7 @@ urio_ioctl(struct usb_fifo *fifo, u_long error = EPERM; goto done; } - bzero(&ur, sizeof(ur)); + memset(&ur, 0, sizeof(ur)); rio_cmd = addr; ur.ucr_request.bmRequestType = rio_cmd->requesttype | UT_WRITE_VENDOR_DEVICE; Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/storage/ustorage_fs.c Sat Nov 12 08:16:45 2011 (r227461) @@ -355,7 +355,7 @@ ustorage_fs_attach(device_t dev) int unit; /* - * NOTE: the softc struct is bzero-ed in device_set_driver. + * NOTE: the softc struct is cleared in device_set_driver. * We can safely call ustorage_fs_detach without specifically * initializing the struct. */ @@ -371,7 +371,9 @@ ustorage_fs_attach(device_t dev) * further */ ustorage_fs_ramdisk = - malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, M_ZERO | M_WAITOK); + malloc(USTORAGE_FS_RAM_SECT << 9, M_USB, + M_ZERO | M_WAITOK); + if (ustorage_fs_ramdisk == NULL) { return (ENOMEM); } Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/template/usb_template.c Sat Nov 12 08:16:45 2011 (r227461) @@ -913,7 +913,7 @@ usb_hw_ep_resolve(struct usb_device *ude } ues = udev->bus->scratch[0].hw_ep_scratch; - bzero(ues, sizeof(*ues)); + memset(ues, 0, sizeof(*ues)); ues->ep_max = ues->ep; ues->cd = (void *)desc; @@ -1240,7 +1240,7 @@ usb_temp_setup(struct usb_device *udev, } uts = udev->bus->scratch[0].temp_setup; - bzero(uts, sizeof(*uts)); + memset(uts, 0, sizeof(*uts)); uts->usb_speed = udev->speed; uts->self_powered = udev->flags.self_powered; Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_busdma.c Sat Nov 12 08:16:45 2011 (r227461) @@ -80,9 +80,9 @@ void usbd_get_page(struct usb_page_cache *pc, usb_frlength_t offset, struct usb_page_search *res) { +#if USB_HAVE_BUSDMA struct usb_page *page; -#if USB_HAVE_BUSDMA if (pc->page_start) { /* Case 1 - something has been loaded into DMA */ @@ -145,7 +145,7 @@ usbd_copy_in(struct usb_page_cache *cach if (buf_res.length > len) { buf_res.length = len; } - bcopy(ptr, buf_res.buffer, buf_res.length); + memcpy(buf_res.buffer, ptr, buf_res.length); offset += buf_res.length; len -= buf_res.length; @@ -267,7 +267,7 @@ usbd_copy_out(struct usb_page_cache *cac if (res.length > len) { res.length = len; } - bcopy(res.buffer, ptr, res.length); + memcpy(ptr, res.buffer, res.length); offset += res.length; len -= res.length; @@ -325,7 +325,7 @@ usbd_frame_zero(struct usb_page_cache *c if (res.length > len) { res.length = len; } - bzero(res.buffer, res.length); + memset(res.buffer, 0, res.length); offset += res.length; len -= res.length; @@ -560,7 +560,7 @@ usb_pc_alloc_mem(struct usb_page_cache * bus_dmamem_free(utag->tag, ptr, map); goto error; } - bzero(ptr, size); + memset(ptr, 0, size); usb_pc_cpu_flush(pc); @@ -797,7 +797,7 @@ usb_dma_tag_setup(struct usb_dma_parent_ struct mtx *mtx, usb_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt) { - bzero(udpt, sizeof(*udpt)); + memset(udpt, 0, sizeof(*udpt)); /* sanity checking */ if ((nudt == 0) || @@ -818,7 +818,7 @@ usb_dma_tag_setup(struct usb_dma_parent_ udpt->dma_bits = ndmabits; while (nudt--) { - bzero(udt, sizeof(*udt)); + memset(udt, 0, sizeof(*udt)); udt->tag_parent = udpt; udt++; } Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_compat_linux.c Sat Nov 12 08:16:45 2011 (r227461) @@ -564,7 +564,7 @@ usb_clear_halt(struct usb_device *dev, s type = uhe->desc.bmAttributes & UE_XFERTYPE; addr = uhe->desc.bEndpointAddress; - bzero(cfg, sizeof(cfg)); + memset(cfg, 0, sizeof(cfg)); cfg[0].type = type; cfg[0].endpoint = addr & UE_ADDR; @@ -709,12 +709,12 @@ usb_control_msg(struct usb_device *dev, urb->dev = dev; urb->endpoint = uhe; - bcopy(&req, urb->setup_packet, sizeof(req)); + memcpy(urb->setup_packet, &req, sizeof(req)); if (size && (!(req.bmRequestType & UT_READ))) { /* move the data to a real buffer */ - bcopy(data, USB_ADD_BYTES(urb->setup_packet, - sizeof(req)), size); + memcpy(USB_ADD_BYTES(urb->setup_packet, sizeof(req)), + data, size); } err = usb_start_wait_urb(urb, timeout, &actlen); @@ -789,7 +789,7 @@ usb_setup_endpoint(struct usb_device *de if (bufsize == 0) { return (0); } - bzero(cfg, sizeof(cfg)); + memset(cfg, 0, sizeof(cfg)); if (type == UE_ISOCHRONOUS) { @@ -1251,7 +1251,7 @@ usb_init_urb(struct urb *urb) if (urb == NULL) { return; } - bzero(urb, sizeof(*urb)); + memset(urb, 0, sizeof(*urb)); } /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_dev.c Sat Nov 12 08:16:45 2011 (r227461) @@ -1809,8 +1809,8 @@ usb_fifo_free_buffer(struct usb_fifo *f) } /* reset queues */ - bzero(&f->free_q, sizeof(f->free_q)); - bzero(&f->used_q, sizeof(f->used_q)); + memset(&f->free_q, 0, sizeof(f->free_q)); + memset(&f->used_q, 0, sizeof(f->used_q)); } void @@ -1909,7 +1909,7 @@ usb_fifo_put_data_linear(struct usb_fifo io_len = MIN(len, m->cur_data_len); - bcopy(ptr, m->cur_data_ptr, io_len); + memcpy(m->cur_data_ptr, ptr, io_len); m->cur_data_len = io_len; ptr = USB_ADD_BYTES(ptr, io_len); @@ -2052,7 +2052,7 @@ usb_fifo_get_data_linear(struct usb_fifo io_len = MIN(len, m->cur_data_len); - bcopy(m->cur_data_ptr, ptr, io_len); + memcpy(ptr, m->cur_data_ptr, io_len); len -= io_len; ptr = USB_ADD_BYTES(ptr, io_len); Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_generic.c Sat Nov 12 08:16:45 2011 (r227461) @@ -240,7 +240,7 @@ ugen_open_pipe_write(struct usb_fifo *f) /* transfers are already opened */ return (0); } - bzero(usb_config, sizeof(usb_config)); + memset(usb_config, 0, sizeof(usb_config)); usb_config[1].type = UE_CONTROL; usb_config[1].endpoint = 0; @@ -308,7 +308,7 @@ ugen_open_pipe_read(struct usb_fifo *f) /* transfers are already opened */ return (0); } - bzero(usb_config, sizeof(usb_config)); + memset(usb_config, 0, sizeof(usb_config)); usb_config[1].type = UE_CONTROL; usb_config[1].endpoint = 0; Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_msctest.c Sat Nov 12 08:16:45 2011 (r227461) @@ -475,8 +475,8 @@ bbb_command_start(struct bbb_transfer *s sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; sc->cmd_len = cmd_len; - bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); - bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); + memset(&sc->cbw.CBWCDB, 0, sizeof(sc->cbw.CBWCDB)); + memcpy(&sc->cbw.CBWCDB, cmd_ptr, cmd_len); DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, &sc->cbw.CBWCDB, ":"); mtx_lock(&sc->mtx); Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_request.c Sat Nov 12 08:16:45 2011 (r227461) @@ -517,7 +517,7 @@ usbd_do_request_flags(struct usb_device } } else #endif - bcopy(desc, data, length); + memcpy(data, desc, length); } goto done; /* success */ } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/usb_transfer.c Sat Nov 12 08:16:45 2011 (r227461) @@ -858,7 +858,7 @@ usbd_transfer_setup(struct usb_device *u if (parm.err) { goto done; } - bzero(&parm, sizeof(parm)); + memset(&parm, 0, sizeof(parm)); parm.udev = udev; parm.speed = usbd_get_speed(udev); @@ -982,7 +982,7 @@ usbd_transfer_setup(struct usb_device *u * memory: */ xfer = &dummy; - bzero(&dummy, sizeof(dummy)); + memset(&dummy, 0, sizeof(dummy)); refcount++; } Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/wlan/if_uath.c Sat Nov 12 08:16:45 2011 (r227461) @@ -710,12 +710,12 @@ uath_cmdsend(struct uath_softc *sc, uint cmd->buflen = roundup2(sizeof(struct uath_cmd_hdr) + ilen, 4); hdr = (struct uath_cmd_hdr *)cmd->buf; - bzero(hdr, sizeof (struct uath_cmd_hdr)); /* XXX not needed */ + memset(hdr, 0, sizeof(struct uath_cmd_hdr)); hdr->len = htobe32(cmd->buflen); hdr->code = htobe32(code); hdr->msgid = cmd->msgid; /* don't care about endianness */ hdr->magic = htobe32((cmd->flags & UATH_CMD_FLAG_MAGIC) ? 1 << 24 : 0); - bcopy(idata, (uint8_t *)(hdr + 1), ilen); + memcpy((uint8_t *)(hdr + 1), idata, ilen); #ifdef UATH_DEBUG if (sc->sc_debug & UATH_DEBUG_CMDS) { @@ -1403,7 +1403,7 @@ uath_dataflush(struct uath_softc *sc) chunk->flags = UATH_CFLAGS_FINAL; chunk->length = htobe16(sizeof (struct uath_tx_desc)); - bzero(desc, sizeof(struct uath_tx_desc)); + memset(desc, 0, sizeof(struct uath_tx_desc)); desc->msglen = htobe32(sizeof(struct uath_tx_desc)); desc->msgid = (sc->sc_msgid++) + 1; /* don't care about endianness */ desc->type = htobe32(WDCMSG_FLUSH); @@ -1482,7 +1482,7 @@ uath_set_chan(struct uath_softc *sc, str #endif struct uath_cmd_reset reset; - bzero(&reset, sizeof reset); + memset(&reset, 0, sizeof(reset)); if (IEEE80211_IS_CHAN_2GHZ(c)) reset.flags |= htobe32(UATH_CHAN_2GHZ); if (IEEE80211_IS_CHAN_5GHZ(c)) @@ -1971,7 +1971,7 @@ uath_create_connection(struct uath_softc struct uath_cmd_create_connection create; ni = ieee80211_ref_node(vap->iv_bss); - bzero(&create, sizeof create); + memset(&create, 0, sizeof(create)); create.connid = htobe32(connid); create.bssid = htobe32(0); /* XXX packed or not? */ @@ -2000,7 +2000,7 @@ uath_set_rates(struct uath_softc *sc, co { struct uath_cmd_rates rates; - bzero(&rates, sizeof rates); + memset(&rates, 0, sizeof(rates)); rates.connid = htobe32(UATH_ID_BSS); /* XXX */ rates.size = htobe32(sizeof(struct uath_cmd_rateset)); /* XXX bounds check rs->rs_nrates */ @@ -2022,7 +2022,7 @@ uath_write_associd(struct uath_softc *sc struct uath_cmd_set_associd associd; ni = ieee80211_ref_node(vap->iv_bss); - bzero(&associd, sizeof associd); + memset(&associd, 0, sizeof(associd)); associd.defaultrateix = htobe32(1); /* XXX */ associd.associd = htobe32(ni->ni_associd); associd.timoffset = htobe32(0x3b); /* XXX */ @@ -2168,7 +2168,7 @@ uath_set_key(struct uath_softc *sc, cons struct uath_cmd_crypto crypto; int i; - bzero(&crypto, sizeof crypto); + memset(&crypto, 0, sizeof(crypto)); crypto.keyidx = htobe32(index); crypto.magic1 = htobe32(1); crypto.size = htobe32(368); @@ -2176,7 +2176,7 @@ uath_set_key(struct uath_softc *sc, cons crypto.flags = htobe32(0x80000068); if (index != UATH_DEFAULT_KEY) crypto.flags |= htobe32(index << 16); - memset(crypto.magic2, 0xff, sizeof crypto.magic2); + memset(crypto.magic2, 0xff, sizeof(crypto.magic2)); /* * Each byte of the key must be XOR'ed with 10101010 before being Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/wlan/if_upgt.c Sat Nov 12 08:16:45 2011 (r227461) @@ -432,7 +432,7 @@ upgt_get_stats(struct upgt_softc *sc) /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -540,7 +540,7 @@ upgt_set_led(struct upgt_softc *sc, int /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -670,7 +670,7 @@ upgt_set_macfilter(struct upgt_softc *sc /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -785,11 +785,11 @@ upgt_setup_rates(struct ieee80211vap *va * will pickup a rate. */ if (ic->ic_curmode == IEEE80211_MODE_11B) - bcopy(rateset_auto_11b, sc->sc_cur_rateset, + memcpy(sc->sc_cur_rateset, rateset_auto_11b, sizeof(sc->sc_cur_rateset)); if (ic->ic_curmode == IEEE80211_MODE_11G || ic->ic_curmode == IEEE80211_MODE_AUTO) - bcopy(rateset_auto_11g, sc->sc_cur_rateset, + memcpy(sc->sc_cur_rateset, rateset_auto_11g, sizeof(sc->sc_cur_rateset)); } else { /* set a fixed rate */ @@ -975,7 +975,7 @@ upgt_set_chan(struct upgt_softc *sc, str /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -998,11 +998,11 @@ upgt_set_chan(struct upgt_softc *sc, str chan->settings = sc->sc_eeprom_freq6_settings; chan->unknown3 = UPGT_CHANNEL_UNKNOWN3; - bcopy(&sc->sc_eeprom_freq3[channel].data, chan->freq3_1, + memcpy(chan->freq3_1, &sc->sc_eeprom_freq3[channel].data, sizeof(chan->freq3_1)); - bcopy(&sc->sc_eeprom_freq4[channel], chan->freq4, + memcpy(chan->freq4, &sc->sc_eeprom_freq4[channel], sizeof(sc->sc_eeprom_freq4[channel])); - bcopy(&sc->sc_eeprom_freq3[channel].data, chan->freq3_2, + memcpy(chan->freq3_2, &sc->sc_eeprom_freq3[channel].data, sizeof(chan->freq3_2)); data_cmd->buflen = sizeof(*mem) + sizeof(*chan); @@ -1331,7 +1331,7 @@ upgt_eeprom_read(struct upgt_softc *sc) /* * Transmit the URB containing the CMD data. */ - bzero(data_cmd->buf, MCLBYTES); + memset(data_cmd->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data_cmd->buf; mem->addr = htole32(sc->sc_memaddr_frame_start + @@ -1423,8 +1423,9 @@ upgt_rxeof(struct usb_xfer *xfer, struct "received EEPROM block (offset=%d, len=%d)\n", eeprom_offset, eeprom_len); - bcopy(data->buf + sizeof(struct upgt_lmac_eeprom) + 4, - sc->sc_eeprom + eeprom_offset, eeprom_len); + memcpy(sc->sc_eeprom + eeprom_offset, + data->buf + sizeof(struct upgt_lmac_eeprom) + 4, + eeprom_len); /* EEPROM data has arrived in time, wakeup. */ wakeup(sc); @@ -1498,7 +1499,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t * return (NULL); } m_adj(m, ETHER_ALIGN); - bcopy(rxdesc->data, mtod(m, char *), pkglen); + memcpy(mtod(m, char *), rxdesc->data, pkglen); /* trim FCS */ m->m_len = m->m_pkthdr.len = pkglen - IEEE80211_CRC_LEN; m->m_pkthdr.rcvif = ifp; @@ -1620,7 +1621,7 @@ upgt_fw_load(struct upgt_softc *sc) goto fail; } data_cmd->buflen = sizeof(start_fwload_cmd); - bcopy(start_fwload_cmd, data_cmd->buf, data_cmd->buflen); + memcpy(data_cmd->buf, start_fwload_cmd, data_cmd->buflen); upgt_bulk_tx(sc, data_cmd); /* send X2 header */ @@ -1631,7 +1632,7 @@ upgt_fw_load(struct upgt_softc *sc) } data_cmd->buflen = sizeof(struct upgt_fw_x2_header); x2 = (struct upgt_fw_x2_header *)data_cmd->buf; - bcopy(UPGT_X2_SIGNATURE, x2->signature, UPGT_X2_SIGNATURE_SIZE); + memcpy(x2->signature, UPGT_X2_SIGNATURE, UPGT_X2_SIGNATURE_SIZE); x2->startaddr = htole32(UPGT_MEMADDR_FIRMWARE_START); x2->len = htole32(fw->datasize); x2->crc = upgt_crc32_le((uint8_t *)data_cmd->buf + @@ -1925,7 +1926,7 @@ upgt_device_reset(struct upgt_softc *sc) UPGT_UNLOCK(sc); return (ENOBUFS); } - bcopy(init_cmd, data->buf, sizeof(init_cmd)); + memcpy(data->buf, init_cmd, sizeof(init_cmd)); data->buflen = sizeof(init_cmd); upgt_bulk_tx(sc, data); usb_pause_mtx(&sc->sc_mtx, 100); @@ -2178,7 +2179,7 @@ upgt_tx_start(struct upgt_softc *sc, str } /* Transmit the URB containing the TX data. */ - bzero(data->buf, MCLBYTES); + memset(data->buf, 0, MCLBYTES); mem = (struct upgt_lmac_mem *)data->buf; mem->addr = htole32(data->addr); txdesc = (struct upgt_lmac_tx_desc *)(mem + 1); @@ -2192,7 +2193,7 @@ upgt_tx_start(struct upgt_softc *sc, str } else { /* data frames */ txdesc->header1.flags = UPGT_H1_FLAGS_TX_DATA; - bcopy(sc->sc_cur_rateset, txdesc->rates, sizeof(txdesc->rates)); + memcpy(txdesc->rates, sc->sc_cur_rateset, sizeof(txdesc->rates)); } txdesc->header1.type = UPGT_H1_TYPE_TX_DATA; txdesc->header1.len = htole16(m->m_pkthdr.len); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Nov 12 08:16:45 2011 (r227461) @@ -1745,7 +1745,7 @@ urtw_tx_start(struct urtw_softc *sc, str if ((0 == xferlen % 64) || (0 == xferlen % 512)) xferlen += 1; - bzero(data->buf, URTW_TX_MAXSIZE); + memset(data->buf, 0, URTW_TX_MAXSIZE); flags = m0->m_pkthdr.len & 0xfff; flags |= URTW_TX_FLAG_NO_ENC; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Nov 11 23:22:38 2011 (r227460) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Nov 12 08:16:45 2011 (r227461) @@ -683,7 +683,7 @@ zyd_intr_read_callback(struct usb_xfer * if (i != cnt) continue; /* copy answer into caller-supplied buffer */ - bcopy(cmd->data, rqp->odata, rqp->olen); + memcpy(rqp->odata, cmd->data, rqp->olen); DPRINTF(sc, ZYD_DEBUG_CMD, "command %p complete, data = %*D \n", rqp, rqp->olen, rqp->odata, ":"); @@ -783,7 +783,7 @@ zyd_cmd(struct zyd_softc *sc, uint16_t c return (EINVAL); cmd.code = htole16(code); - bcopy(idata, cmd.data, ilen); + memcpy(cmd.data, idata, ilen); DPRINTF(sc, ZYD_DEBUG_CMD, "sending cmd %p = %*D\n", &rq, ilen, idata, ":"); From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 08:19:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05673106564A; Sat, 12 Nov 2011 08:19:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E98288FC16; Sat, 12 Nov 2011 08:19:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAC8Jawg033123; Sat, 12 Nov 2011 08:19:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAC8JadU033121; Sat, 12 Nov 2011 08:19:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111120819.pAC8JadU033121@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 12 Nov 2011 08:19: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: r227462 - head/sys/dev/usb/storage X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 08:19:37 -0000 Author: hselasky Date: Sat Nov 12 08:19:36 2011 New Revision: 227462 URL: http://svn.freebsd.org/changeset/base/227462 Log: Enable power save mode for the USB storage device driver. MFC after: 1 week Modified: head/sys/dev/usb/storage/ustorage_fs.c Modified: head/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- head/sys/dev/usb/storage/ustorage_fs.c Sat Nov 12 08:16:45 2011 (r227461) +++ head/sys/dev/usb/storage/ustorage_fs.c Sat Nov 12 08:19:36 2011 (r227462) @@ -364,6 +364,9 @@ ustorage_fs_attach(device_t dev) sc->sc_udev = uaa->device; unit = device_get_unit(dev); + /* enable power saving mode */ + usbd_set_power_mode(uaa->device, USB_POWER_MODE_SAVE); + if (unit == 0) { if (ustorage_fs_ramdisk == NULL) { /* From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 08:40:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD7F1065672; Sat, 12 Nov 2011 08:40:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EBC8FC15; Sat, 12 Nov 2011 08:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAC8eq6f033811; Sat, 12 Nov 2011 08:40:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAC8eqSI033808; Sat, 12 Nov 2011 08:40:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111120840.pAC8eqSI033808@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 12 Nov 2011 08:40: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: r227463 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 08:40:52 -0000 Author: hselasky Date: Sat Nov 12 08:40:52 2011 New Revision: 227463 URL: http://svn.freebsd.org/changeset/base/227463 Log: - This patch adds custom IOCTLs to read and write the 4 GPIO pins on the cp2103 usb-to-serial chip. - This patch also makes the line status polling asynchronous, to reduce the time needed to change the GPIO pins. Submitted by: JD Louw MFC after: 1 week Modified: head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/usb_ioctl.h Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Sat Nov 12 08:19:36 2011 (r227462) +++ head/sys/dev/usb/serial/uslcom.c Sat Nov 12 08:40:52 2011 (r227463) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR uslcom_debug @@ -75,6 +76,7 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_CTRL 0x07 #define USLCOM_RCTRL 0x08 #define USLCOM_SET_FLOWCTRL 0x13 +#define USLCOM_VENDOR_SPECIFIC 0xff /* USLCOM_UART values */ #define USLCOM_UART_DISABLE 0x00 @@ -113,6 +115,10 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ #define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ +/* USLCOM_VENDOR_SPECIFIC values */ +#define USLCOM_WRITE_LATCH 0x37E1 +#define USLCOM_READ_LATCH 0x00C2 + enum { USLCOM_BULK_DT_WR, USLCOM_BULK_DT_RD, @@ -123,6 +129,7 @@ enum { struct uslcom_softc { struct ucom_super_softc sc_super_ucom; struct ucom_softc sc_ucom; + struct usb_callout sc_watchdog; struct usb_xfer *sc_xfer[USLCOM_N_TRANSFER]; struct usb_device *sc_udev; @@ -145,6 +152,8 @@ static void uslcom_close(struct ucom_sof static void uslcom_set_dtr(struct ucom_softc *, uint8_t); static void uslcom_set_rts(struct ucom_softc *, uint8_t); static void uslcom_set_break(struct ucom_softc *, uint8_t); +static int uslcom_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, + struct thread *); static int uslcom_pre_param(struct ucom_softc *, struct termios *); static void uslcom_param(struct ucom_softc *, struct termios *); static void uslcom_get_status(struct ucom_softc *, uint8_t *, uint8_t *); @@ -177,7 +186,6 @@ static const struct usb_config uslcom_co .type = UE_CONTROL, .endpoint = 0x00, .direction = UE_DIR_ANY, - .interval = 150, /* poll status every 150 ms */ .bufsize = sizeof(struct usb_device_request) + 8, .flags = {.pipe_bof = 1,}, .callback = &uslcom_control_callback, @@ -192,6 +200,7 @@ static struct ucom_callback uslcom_callb .ucom_cfg_set_dtr = &uslcom_set_dtr, .ucom_cfg_set_rts = &uslcom_set_rts, .ucom_cfg_set_break = &uslcom_set_break, + .ucom_ioctl = &uslcom_ioctl, .ucom_cfg_param = &uslcom_param, .ucom_pre_param = &uslcom_pre_param, .ucom_start_read = &uslcom_start_read, @@ -308,6 +317,19 @@ MODULE_DEPEND(uslcom, ucom, 1, 1, 1); MODULE_DEPEND(uslcom, usb, 1, 1, 1); MODULE_VERSION(uslcom, 1); +static void +uslcom_watchdog(void *arg) +{ + struct uslcom_softc *sc = arg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + + usbd_transfer_start(sc->sc_xfer[USLCOM_CTRL_DT_RD]); + + usb_callout_reset(&sc->sc_watchdog, + hz / 4, &uslcom_watchdog, sc); +} + static int uslcom_probe(device_t dev) { @@ -338,6 +360,7 @@ uslcom_attach(device_t dev) device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uslcom", NULL, MTX_DEF); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mtx, 0); sc->sc_udev = uaa->device; @@ -378,6 +401,8 @@ uslcom_detach(device_t dev) ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, USLCOM_N_TRANSFER); + + usb_callout_drain(&sc->sc_watchdog); mtx_destroy(&sc->sc_mtx); return (0); @@ -399,8 +424,9 @@ uslcom_open(struct ucom_softc *ucom) &req, NULL, 0, 1000)) { DPRINTF("UART enable failed (ignored)\n"); } - /* Start polling status */ - usbd_transfer_start(sc->sc_xfer[USLCOM_CTRL_DT_RD]); + + /* start polling status */ + uslcom_watchdog(sc); } static void @@ -409,8 +435,8 @@ uslcom_close(struct ucom_softc *ucom) struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; - /* Stop polling status */ - usbd_transfer_stop(sc->sc_xfer[USLCOM_CTRL_DT_RD]); + /* stop polling status */ + usb_callout_stop(&sc->sc_watchdog); req.bmRequestType = USLCOM_WRITE; req.bRequest = USLCOM_UART; @@ -591,6 +617,55 @@ uslcom_set_break(struct ucom_softc *ucom } } +static int +uslcom_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, + int flag, struct thread *td) +{ + struct uslcom_softc *sc = ucom->sc_parent; + struct usb_device_request req; + int error = 0; + uint8_t latch; + + DPRINTF("cmd=0x%08x\n", cmd); + + switch (cmd) { + case USB_GET_GPIO: + req.bmRequestType = USLCOM_READ; + req.bRequest = USLCOM_VENDOR_SPECIFIC; + USETW(req.wValue, USLCOM_READ_LATCH); + USETW(req.wIndex, 0); + USETW(req.wLength, sizeof(latch)); + + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, &latch, 0, 1000)) { + DPRINTF("Get LATCH failed\n"); + error = EIO; + } + *(int *)data = latch; + break; + + case USB_SET_GPIO: + req.bmRequestType = USLCOM_WRITE; + req.bRequest = USLCOM_VENDOR_SPECIFIC; + USETW(req.wValue, USLCOM_WRITE_LATCH); + USETW(req.wIndex, (*(int *)data)); + USETW(req.wLength, 0); + + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, NULL, 0, 1000)) { + DPRINTF("Set LATCH failed\n"); + error = EIO; + } + break; + + default: + DPRINTF("Unknown IOCTL\n"); + error = ENOIOCTL; + break; + } + return (error); +} + static void uslcom_write_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -681,11 +756,9 @@ uslcom_control_callback(struct usb_xfer sc->sc_msr = msr; ucom_status_change(&sc->sc_ucom); } - - /* FALLTHROUGH */ + break; case USB_ST_SETUP: -tr_setup: req.bmRequestType = USLCOM_READ; req.bRequest = USLCOM_RCTRL; USETW(req.wValue, 0); @@ -702,10 +775,8 @@ tr_setup: break; default: /* error */ - if (error != USB_ERR_CANCELLED) { + if (error != USB_ERR_CANCELLED) DPRINTF("error=%s\n", usbd_errstr(error)); - goto tr_setup; - } break; } } Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Sat Nov 12 08:19:36 2011 (r227462) +++ head/sys/dev/usb/usb_ioctl.h Sat Nov 12 08:40:52 2011 (r227463) @@ -289,6 +289,10 @@ struct usb_gen_quirk { #define USB_GET_CM_OVER_DATA _IOR ('U', 180, int) #define USB_SET_CM_OVER_DATA _IOW ('U', 181, int) +/* GPIO control */ +#define USB_GET_GPIO _IOR ('U', 182, int) +#define USB_SET_GPIO _IOW ('U', 183, int) + /* USB file system interface */ #define USB_FS_START _IOW ('U', 192, struct usb_fs_start) #define USB_FS_STOP _IOW ('U', 193, struct usb_fs_stop) From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 09:52:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D57B1065670; Sat, 12 Nov 2011 09:52:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BA298FC16; Sat, 12 Nov 2011 09:52:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAC9qSjD036034; Sat, 12 Nov 2011 09:52:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAC9qSUL036029; Sat, 12 Nov 2011 09:52:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201111120952.pAC9qSUL036029@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Nov 2011 09:52: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: r227464 - in head: sbin/geom/class/multipath sys/geom/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 09:52:28 -0000 Author: mav Date: Sat Nov 12 09:52:27 2011 New Revision: 227464 URL: http://svn.freebsd.org/changeset/base/227464 Log: Major GEOM MULTIPATH class rewrite: - Improved locking and destruction process to fix crashes. - Improved "automatic" configuration method to make it consistent and safe by reading metadata back from all specified paths after writing to one. - Added provider size check to reduce chance of ordering conflict with other GEOM classes. - Added "manual" configuration method without using on-disk metadata. - Added "add" and "remove" commands to allow manage paths manually. - Failed paths are no longer dropped from geom, but only marked as FAIL and excluded from I/O operations. - Automatically restore failed paths when all others paths are marked as failed, for example, because of device-caused (not transport) errors. - Added "fail" and "restore" commands to manually control FAIL flag. - geom is now destroyed on last path disconnection. - Added optional Active/Active mode support. Unlike Active/Passive mode, load evenly distributed between all working paths. If supported by the device, it allows to significantly improve performance, utilizing bandwidth of all paths. It is controlled by -A option during creation. Disabled by default now. - Improved `status` and `list` commands output. Sponsored by: iXsystems, inc. MFC after: 1 month Modified: head/sbin/geom/class/multipath/geom_multipath.c head/sbin/geom/class/multipath/gmultipath.8 head/sys/geom/multipath/g_multipath.c head/sys/geom/multipath/g_multipath.h Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 08:40:52 2011 (r227463) +++ head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 09:52:27 2011 (r227464) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,31 +49,58 @@ uint32_t version = G_MULTIPATH_VERSION; static void mp_main(struct gctl_req *, unsigned int); static void mp_label(struct gctl_req *); static void mp_clear(struct gctl_req *); -static void mp_add(struct gctl_req *); struct g_command class_commands[] = { { - "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - "[-v] name prov ..." + "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, + { + { 'A', "active_active", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-vA] name prov ..." }, { - "add", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, G_NULL_OPTS, - "[-v] name prov ..." + "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, mp_main, + { + { 'A', "active_active", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + "[-vA] name prov ..." }, { - "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] prov ..." + "add", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" }, { - "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, - "[-v] prov ..." + "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" + }, + { + "fail", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" + }, + { + "restore", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name prov" }, { "rotate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, - "[-v] prov ..." + "[-v] name" }, { "getactive", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "stop", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + "[-v] name" + }, + { + "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, "[-v] prov ..." }, G_CMD_SENTINEL @@ -90,8 +118,6 @@ mp_main(struct gctl_req *req, unsigned i } if (strcmp(name, "label") == 0) { mp_label(req); - } else if (strcmp(name, "add") == 0) { - mp_add(req); } else if (strcmp(name, "clear") == 0) { mp_clear(req); } else { @@ -103,13 +129,13 @@ static void mp_label(struct gctl_req *req) { struct g_multipath_metadata md; - off_t disksiz = 0, msize; - uint8_t *sector; + off_t disksize = 0, msize; + uint8_t *sector, *rsector; char *ptr; uuid_t uuid; uint32_t secsize = 0, ssize, status; - const char *name, *mpname; - int error, i, nargs; + const char *name, *name2, *mpname; + int error, i, nargs, fd; nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { @@ -132,14 +158,14 @@ mp_label(struct gctl_req *req) } if (i == 1) { secsize = ssize; - disksiz = msize; + disksize = msize; } else { if (secsize != ssize) { gctl_error(req, "%s sector size %u different.", name, ssize); return; } - if (disksiz != msize) { + if (disksize != msize) { gctl_error(req, "%s media size %ju different.", name, (intmax_t)msize); return; @@ -155,7 +181,7 @@ mp_label(struct gctl_req *req) md.md_version = G_MULTIPATH_VERSION; mpname = gctl_get_ascii(req, "arg0"); strlcpy(md.md_name, mpname, sizeof(md.md_name)); - md.md_size = disksiz; + md.md_size = disksize; md.md_sectorsize = secsize; uuid_create(&uuid, &status); if (status != uuid_s_ok) { @@ -168,19 +194,10 @@ mp_label(struct gctl_req *req) return; } strlcpy(md.md_uuid, ptr, sizeof (md.md_uuid)); + md.md_active_active = gctl_get_int(req, "active_active"); free(ptr); /* - * Clear metadata on initial provider first. - */ - name = gctl_get_ascii(req, "arg1"); - error = g_metadata_clear(name, NULL); - if (error != 0) { - gctl_error(req, "cannot clear metadata on %s: %s.", name, strerror(error)); - return; - } - - /* * Allocate a sector to write as metadata. */ sector = malloc(secsize); @@ -189,6 +206,12 @@ mp_label(struct gctl_req *req) return; } memset(sector, 0, secsize); + rsector = malloc(secsize); + if (rsector == NULL) { + free(sector); + gctl_error(req, "unable to allocate metadata buffer"); + return; + } /* * encode the metadata @@ -198,6 +221,7 @@ mp_label(struct gctl_req *req) /* * Store metadata on the initial provider. */ + name = gctl_get_ascii(req, "arg1"); error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); @@ -205,20 +229,29 @@ mp_label(struct gctl_req *req) } /* - * Now add the rest of the providers. + * Now touch the rest of the providers to hint retaste. */ - error = gctl_change_param(req, "verb", -1, "add"); - if (error) { - gctl_error(req, "unable to change verb to \"add\": %s.", strerror(error)); - return; - } for (i = 2; i < nargs; i++) { - error = gctl_change_param(req, "arg1", -1, gctl_get_ascii(req, "arg%d", i)); - if (error) { - gctl_error(req, "unable to add %s to %s: %s.", gctl_get_ascii(req, "arg%d", i), mpname, strerror(error)); + name2 = gctl_get_ascii(req, "arg%d", i); + fd = g_open(name2, 1); + if (fd < 0) { + fprintf(stderr, "Unable to open %s: %s.\n", + name2, strerror(errno)); + continue; + } + if (pread(fd, rsector, secsize, disksize - secsize) != + secsize) { + fprintf(stderr, "Unable to read metadata from %s: %s.\n", + name2, strerror(errno)); + g_close(fd); continue; } - mp_add(req); + g_close(fd); + if (memcmp(sector, rsector, secsize)) { + fprintf(stderr, "No metadata found on %s." + " It is not a path of %s.\n", + name2, name); + } } } @@ -247,13 +280,3 @@ mp_clear(struct gctl_req *req) } } -static void -mp_add(struct gctl_req *req) -{ - const char *errstr; - - errstr = gctl_issue(req); - if (errstr != NULL && errstr[0] != '\0') { - gctl_error(req, "%s", errstr); - } -} Modified: head/sbin/geom/class/multipath/gmultipath.8 ============================================================================== --- head/sbin/geom/class/multipath/gmultipath.8 Sat Nov 12 08:40:52 2011 (r227463) +++ head/sbin/geom/class/multipath/gmultipath.8 Sat Nov 12 09:52:27 2011 (r227464) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2007 +.Dd October 31, 2011 .Dt GMULTIPATH 8 .Os .Sh NAME @@ -32,11 +32,48 @@ .Nd "disk multipath control utility" .Sh SYNOPSIS .Nm +.Cm create +.Op Fl Av +.Ar name +.Ar prov ... +.Nm .Cm label -.Op Fl hv +.Op Fl Av .Ar name .Ar prov ... .Nm +.Cm add +.Op Fl v +.Ar name prov +.Nm +.Cm remove +.Op Fl v +.Ar name prov +.Nm +.Cm fail +.Op Fl v +.Ar name prov +.Nm +.Cm restore +.Op Fl v +.Ar name prov +.Nm +.Cm rotate +.Op Fl v +.Ar name +.Nm +.Cm getactive +.Op Fl v +.Ar name +.Nm +.Cm destroy +.Op Fl v +.Ar name +.Nm +.Cm stop +.Op Fl v +.Ar name +.Nm .Cm clear .Op Fl v .Ar prov ... @@ -53,27 +90,79 @@ The .Nm utility is used for device multipath configuration. .Pp -Only automatic configuration is supported at the present time via the -.Cm label -command. -This operation writes a label on the last sector of the underlying -disk device with a contained name and UUID. -The UUID guarantees uniqueness -in a shared storage environment but is in general too cumbersome to use. +The multipath device can be configured using two different methods: +.Dq manual +or +.Dq automatic . +When using the +.Dq manual +method, no metadata are stored on the devices, so the multipath +device has to be configured by hand every time it is needed. +Additional device paths also won't be detected automatically. +The +.Dq automatic +method uses on-disk metadata to detect device and all it's paths. +Metadata use the last sector of the underlying disk device and +include device name and UUID. +The UUID guarantees uniqueness in a shared storage environment +but is in general too cumbersome to use. The name is what is exported via the device interface. .Pp The first argument to .Nm indicates an action to be performed: .Bl -tag -width ".Cm destroy" +.It Cm create +Create multipath device with +.Dq manual +method without writing any on-disk metadata. +It is up to administrator, how to properly identify device paths. +Kernel will only check that all given providers have same media and +sector sizes. +.Pp +.Fl A +option enables Active/Active mode, otherwise Active/Passive mode is used +by default. .It Cm label -Label the given underlying device with the specified +Create multipath device with +.Dq automatic +method. +Label the first given provider with on-disk metadata using the specified .Ar name . -The kernel module -.Pa geom_multipath.ko -will be loaded if it is not loaded already. +The rest of given providers will be retasted to detect these metadata. +It reliably protects against specifying unrelated providers. +Providers with no matching metadata detected will not be added to the device. +.Pp +.Fl A +option enables Active/Active mode, otherwise Active/Passive mode is used +by default. +.It Cm add +Add the given provider as a path to the given multipath device. +Should normally be used only for devices created with +.Dq manual +method, unless you know what you are doing (you are sure that it is another +device path, but tasting its metadata in regular +.Dq automatic +way is not possible). +.It Cm remove +Remove the given provider as a path from the given multipath device. +If the last path removed, the multipath device will be destroyed. +.It Cm fail +Mark specified provider as a path of the specified multipath device as failed. +If there are other paths present, new requests will be forwarded there. +.It Cm restore +Mark specified provider as a path of the specified multipath device as +operational, allowing it to handle requests. +.It Cm rotate +Change the active provider/path in Active/Passive mode. +.It Cm getactive +Get the currently active provider(s)/path(s). +.It Cm destroy +Destroy the given multipath device clearing metadata. +.It Cm stop +Stop the given multipath device without clearing metadata. .It Cm clear -Clear metadata on the given device. +Clear metadata on the given provider. .It Cm list See .Xr geom 8 . @@ -101,14 +190,15 @@ Debug level of the GEOM class. This can be set to 0 (default) or 1 to disable or enable various forms of chattiness. +.It Va kern.geom.multipath.exclusive : No 1 +Open underlying providers exclusively, preventing individual paths access. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh MULTIPATH ARCHITECTURE .Pp -This is an active/passive -multiple path architecture with no device knowledge or presumptions other -than size matching built in. +This is a multiple path architecture with no device knowledge or +presumptions other than size matching built in. Therefore the user must exercise some care in selecting providers that do indeed represent multiple paths to the same underlying disk device. @@ -133,15 +223,16 @@ of multiple pathnames refer to the same system operator who will use tools and knowledge of their own storage subsystem to make the correct configuration selection. .Pp -As an active/passive architecture, only one path has I/O moving on it +There are Active/Passive and Active/Active operation modes supported. +In Active/Passive mode only one path has I/O moving on it at any point in time. This I/O continues until an I/O is returned with a generic I/O error or a "Nonexistent Device" error. -When this occurs, -the active device is kicked out of the -.Nm MULTIPATH -GEOM class and the next in a list is selected, the failed I/O reissued -and the system proceeds. +When this occurs, that path is marked FAIL, the next path +in a list is selected as active and the failed I/O reissued. +In Active/Active mode all paths not marked FAIL may handle I/O same time. +Requests are distributed between paths to equalize load. +For capable devices it allows to utilize bandwidth of all paths. .Pp When new devices are added to the system the .Nm MULTIPATH @@ -149,9 +240,9 @@ GEOM class is given an opportunity to ta If a new device has a .Nm MULTIPATH -label, the device is used to either create a new +on-disk metadata label, the device is used to either create a new .Nm MULTIPATH -GEOM, or to attach to the end of the list of devices for an existing +GEOM, or been added the list of paths for an existing .Nm MULTIPATH GEOM. .Pp @@ -176,7 +267,7 @@ of an RSCN event from the Fabric Domain a rescan to occur and cause the attachment and configuration of any (now) new devices to occur, causing the taste event described above. .Pp -This means that this active/passive architecture is not a one-shot path +This means that this multipath architecture is not a one-shot path failover, but can be considered to be steady state as long as failed paths are repaired (automatically or otherwise). .Pp @@ -184,7 +275,7 @@ Automatic rescanning is not a requiremen Nor is Fibre Channel. The same failover mechanisms work equally well for traditional "Parallel" -SCSI but require manual intervention with +SCSI but may require manual intervention with .Xr camcontrol 8 to cause the reattachment of repaired device links. .Sh EXAMPLES @@ -226,9 +317,9 @@ mount /dev/multipath/FREDa /mnt.... .Pp The resultant console output looks something like: .Bd -literal -offset indent -GEOM_MULTIPATH: adding da0 to Fred/b631385f-c61c-11db-b884-0011116ae789 -GEOM_MULTIPATH: da0 now active path in Fred -GEOM_MULTIPATH: adding da2 to Fred/b631385f-c61c-11db-b884-0011116ae789 +GEOM_MULTIPATH: da0 added to FRED +GEOM_MULTIPATH: da0 is now active path in FRED +GEOM_MULTIPATH: da2 added to FRED .Ed .Sh SEE ALSO .Xr geom 4 , @@ -240,24 +331,6 @@ GEOM_MULTIPATH: adding da2 to Fred/b6313 .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 -.Sh BUGS -The -.Nm -should allow for a manual method of pairing disks. -.Pp -There is currently no way for -.Pa geom_multipath.ko -to distinguish between various label instances of the same provider. -That -is devices such as -.Ar da0 -and -.Ar da0c -can be tasted and instantiated as multiple paths for the same device. -Technically, this is correct, but pretty useless. -This will be fixed soon -(I hope), but to avoid this it is a good idea to destroy any label on -the disk object prior to labelling it with -.Nm . .Sh AUTHOR .An Matthew Jacob Aq mjacob@FreeBSD.org +.An Alexander Motin Aq mav@FreeBSD.org Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Sat Nov 12 08:40:52 2011 (r227463) +++ head/sys/geom/multipath/g_multipath.c Sat Nov 12 09:52:27 2011 (r227464) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2011 Alexander Motin * Copyright (c) 2006-2007 Matthew Jacob * All rights reserved. * @@ -53,6 +54,9 @@ static SYSCTL_NODE(_kern_geom, OID_AUTO, static u_int g_multipath_debug = 0; SYSCTL_UINT(_kern_geom_multipath, OID_AUTO, debug, CTLFLAG_RW, &g_multipath_debug, 0, "Debug level"); +static u_int g_multipath_exclusive = 1; +SYSCTL_UINT(_kern_geom_multipath, OID_AUTO, exclusive, CTLFLAG_RW, + &g_multipath_exclusive, 0, "Exclusively open providers"); static enum { GKT_NIL, @@ -79,6 +83,7 @@ static g_taste_t g_multipath_taste; static g_ctl_req_t g_multipath_config; static g_init_t g_multipath_init; static g_fini_t g_multipath_fini; +static g_dumpconf_t g_multipath_dumpconf; struct g_class g_multipath_class = { .name = G_MULTIPATH_CLASS_NAME, @@ -90,35 +95,144 @@ struct g_class g_multipath_class = { .fini = g_multipath_fini }; -#define MP_BAD 0x1 -#define MP_POSTED 0x2 +#define MP_FAIL 0x00000001 +#define MP_LOST 0x00000002 +#define MP_NEW 0x00000004 +#define MP_POSTED 0x00000008 +#define MP_BAD (MP_FAIL | MP_LOST | MP_NEW) +#define MP_IDLE 0x00000010 +#define MP_IDLE_MASK 0xfffffff0 + +static int +g_multipath_good(struct g_geom *gp) +{ + struct g_consumer *cp; + int n = 0; + + LIST_FOREACH(cp, &gp->consumer, consumer) { + if ((cp->index & MP_BAD) == 0) + n++; + } + return (n); +} + +static void +g_multipath_fault(struct g_consumer *cp, int cause) +{ + struct g_multipath_softc *sc; + struct g_consumer *lcp; + struct g_geom *gp; + + gp = cp->geom; + sc = gp->softc; + cp->index |= cause; + if (g_multipath_good(gp) == 0 && sc->sc_ndisks > 0) { + LIST_FOREACH(lcp, &gp->consumer, consumer) { + if (lcp->provider == NULL || + (lcp->index & (MP_LOST | MP_NEW))) + continue; + if (sc->sc_ndisks > 1 && lcp == cp) + continue; + printf("GEOM_MULTIPATH: " + "all paths in %s were marked FAIL, restore %s\n", + sc->sc_name, lcp->provider->name); + lcp->index &= ~MP_FAIL; + } + } + if (cp != sc->sc_active) + return; + sc->sc_active = NULL; + LIST_FOREACH(lcp, &gp->consumer, consumer) { + if ((lcp->index & MP_BAD) == 0) { + sc->sc_active = lcp; + break; + } + } + if (sc->sc_active == NULL) { + printf("GEOM_MULTIPATH: out of providers for %s\n", + sc->sc_name); + } else if (!sc->sc_active_active) { + printf("GEOM_MULTIPATH: %s is now active path in %s\n", + sc->sc_active->provider->name, sc->sc_name); + } +} + +static struct g_consumer * +g_multipath_choose(struct g_geom *gp) +{ + struct g_multipath_softc *sc; + struct g_consumer *best, *cp; + + sc = gp->softc; + if (!sc->sc_active_active) + return (sc->sc_active); + best = NULL; + LIST_FOREACH(cp, &gp->consumer, consumer) { + if (cp->index & MP_BAD) + continue; + cp->index += MP_IDLE; + if (best == NULL || cp->private < best->private || + (cp->private == best->private && cp->index > best->index)) + best = cp; + } + if (best != NULL) + best->index &= ~MP_IDLE_MASK; + return (best); +} static void g_mpd(void *arg, int flags __unused) { + struct g_geom *gp; + struct g_multipath_softc *sc; struct g_consumer *cp; + int w; g_topology_assert(); cp = arg; - if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + gp = cp->geom; + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) { + w = cp->acw; g_access(cp, -cp->acr, -cp->acw, -cp->ace); + if (w > 0 && cp->provider != NULL && + (cp->provider->geom->flags & G_GEOM_WITHER) == 0) { + g_post_event(g_mpd, cp, M_WAITOK, NULL); + return; + } + } + sc = gp->softc; + mtx_lock(&sc->sc_mtx); if (cp->provider) { printf("GEOM_MULTIPATH: %s removed from %s\n", - cp->provider->name, cp->geom->name); + cp->provider->name, gp->name); g_detach(cp); } g_destroy_consumer(cp); + mtx_unlock(&sc->sc_mtx); + if (LIST_EMPTY(&gp->consumer)) + g_multipath_destroy(gp); } static void g_multipath_orphan(struct g_consumer *cp) { - if ((cp->index & MP_POSTED) == 0) { + struct g_multipath_softc *sc; + uintptr_t *cnt; + + g_topology_assert(); + printf("GEOM_MULTIPATH: %s in %s was disconnected\n", + cp->provider->name, cp->geom->name); + sc = cp->geom->softc; + cnt = (uintptr_t *)&cp->private; + mtx_lock(&sc->sc_mtx); + sc->sc_ndisks--; + g_multipath_fault(cp, MP_LOST); + if (*cnt == 0 && (cp->index & MP_POSTED) == 0) { cp->index |= MP_POSTED; - printf("GEOM_MULTIPATH: %s orphaned in %s\n", - cp->provider->name, cp->geom->name); + mtx_unlock(&sc->sc_mtx); g_mpd(cp, 0); - } + } else + mtx_unlock(&sc->sc_mtx); } static void @@ -128,20 +242,29 @@ g_multipath_start(struct bio *bp) struct g_geom *gp; struct g_consumer *cp; struct bio *cbp; + uintptr_t *cnt; gp = bp->bio_to->geom; sc = gp->softc; KASSERT(sc != NULL, ("NULL sc")); - cp = sc->cp_active; - if (cp == NULL) { - g_io_deliver(bp, ENXIO); - return; - } cbp = g_clone_bio(bp); if (cbp == NULL) { g_io_deliver(bp, ENOMEM); return; } + mtx_lock(&sc->sc_mtx); + cp = g_multipath_choose(gp); + if (cp == NULL) { + mtx_unlock(&sc->sc_mtx); + g_destroy_bio(cbp); + g_io_deliver(bp, ENXIO); + return; + } + if ((uintptr_t)bp->bio_driver1 < sc->sc_ndisks) + bp->bio_driver1 = (void *)(uintptr_t)sc->sc_ndisks; + cnt = (uintptr_t *)&cp->private; + (*cnt)++; + mtx_unlock(&sc->sc_mtx); cbp->bio_done = g_multipath_done; g_io_request(cbp, cp); } @@ -149,12 +272,27 @@ g_multipath_start(struct bio *bp) static void g_multipath_done(struct bio *bp) { + struct g_multipath_softc *sc; + struct g_consumer *cp; + uintptr_t *cnt; + if (bp->bio_error == ENXIO || bp->bio_error == EIO) { mtx_lock(&gmtbq_mtx); bioq_insert_tail(&gmtbq, bp); - wakeup(&g_multipath_kt_state); mtx_unlock(&gmtbq_mtx); + wakeup(&g_multipath_kt_state); } else { + cp = bp->bio_from; + sc = cp->geom->softc; + cnt = (uintptr_t *)&cp->private; + mtx_lock(&sc->sc_mtx); + (*cnt)--; + if (*cnt == 0 && (cp->index & MP_LOST)) { + cp->index |= MP_POSTED; + mtx_unlock(&sc->sc_mtx); + g_post_event(g_mpd, cp, M_WAITOK, NULL); + } else + mtx_unlock(&sc->sc_mtx); g_std_done(bp); } } @@ -167,6 +305,7 @@ g_multipath_done_error(struct bio *bp) struct g_multipath_softc *sc; struct g_consumer *cp; struct g_provider *pp; + uintptr_t *cnt; /* * If we had a failure, we have to check first to see @@ -176,47 +315,31 @@ g_multipath_done_error(struct bio *bp) * to the next available consumer. */ - g_topology_lock(); pbp = bp->bio_parent; gp = pbp->bio_to->geom; sc = gp->softc; cp = bp->bio_from; pp = cp->provider; + cnt = (uintptr_t *)&cp->private; - cp->index |= MP_BAD; - if (cp->nend == cp->nstart && pp->nend == pp->nstart) { + mtx_lock(&sc->sc_mtx); + printf("GEOM_MULTIPATH: Error %d, %s in %s marked FAIL\n", + bp->bio_error, pp->name, sc->sc_name); + g_multipath_fault(cp, MP_FAIL); + (*cnt)--; + if (*cnt == 0 && (cp->index & (MP_LOST | MP_POSTED)) == MP_LOST) { cp->index |= MP_POSTED; - g_post_event(g_mpd, cp, M_NOWAIT, NULL); - } - if (cp == sc->cp_active) { - struct g_consumer *lcp; - printf("GEOM_MULTIPATH: %s failed in %s\n", - pp->name, sc->sc_name); - sc->cp_active = NULL; - LIST_FOREACH(lcp, &gp->consumer, consumer) { - if ((lcp->index & MP_BAD) == 0) { - sc->cp_active = lcp; - break; - } - } - 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(); - return; - } else { - printf("GEOM_MULTIPATH: %s now active path in %s\n", - sc->cp_active->provider->name, sc->sc_name); - } - } - g_topology_unlock(); + mtx_unlock(&sc->sc_mtx); + g_post_event(g_mpd, cp, M_WAITOK, NULL); + } else + mtx_unlock(&sc->sc_mtx); /* * If we can fruitfully restart the I/O, do so. */ - if (sc->cp_active) { + if (pbp->bio_children < (uintptr_t)pbp->bio_driver1) { + pbp->bio_inbed++; g_destroy_bio(bp); - pbp->bio_children--; g_multipath_start(pbp); } else { g_std_done(bp); @@ -254,6 +377,7 @@ g_multipath_access(struct g_provider *pp { struct g_geom *gp; struct g_consumer *cp, *badcp = NULL; + struct g_multipath_softc *sc; int error; gp = pp->geom; @@ -265,6 +389,10 @@ g_multipath_access(struct g_provider *pp goto fail; } } + sc = gp->softc; + sc->sc_opened += dr + dw + de; + if (sc->sc_stopping && sc->sc_opened == 0) + g_multipath_destroy(gp); return (0); fail: @@ -286,6 +414,9 @@ g_multipath_create(struct g_class *mp, s g_topology_assert(); LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL || sc->sc_stopping) + continue; if (strcmp(gp->name, md->md_name) == 0) { printf("GEOM_MULTIPATH: name %s already exists\n", md->md_name); @@ -295,19 +426,25 @@ g_multipath_create(struct g_class *mp, s gp = g_new_geomf(mp, md->md_name); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->sc_mtx, "multipath", NULL, MTX_DEF); + memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid)); + memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name)); + sc->sc_active_active = md->md_active_active; gp->softc = sc; gp->start = g_multipath_start; gp->orphan = g_multipath_orphan; gp->access = g_multipath_access; - memcpy(sc->sc_uuid, md->md_uuid, sizeof (sc->sc_uuid)); - memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name)); + gp->dumpconf = g_multipath_dumpconf; pp = g_new_providerf(gp, "multipath/%s", md->md_name); - /* limit the provider to not have it stomp on metadata */ - pp->mediasize = md->md_size - md->md_sectorsize; - pp->sectorsize = md->md_sectorsize; - sc->pp = pp; + if (md->md_size != 0) { + pp->mediasize = md->md_size - + ((md->md_uuid[0] != 0) ? md->md_sectorsize : 0); + pp->sectorsize = md->md_sectorsize; + } + sc->sc_pp = pp; g_error_provider(pp, 0); + printf("GEOM_MULTIPATH: %s created\n", gp->name); return (gp); } @@ -316,7 +453,7 @@ g_multipath_add_disk(struct g_geom *gp, { struct g_multipath_softc *sc; struct g_consumer *cp, *nxtcp; - int error; + int error, acr, acw, ace; g_topology_assert(); @@ -337,6 +474,8 @@ g_multipath_add_disk(struct g_geom *gp, } nxtcp = LIST_FIRST(&gp->consumer); cp = g_new_consumer(gp); + cp->private = NULL; + cp->index = MP_NEW; error = g_attach(cp, pp); if (error != 0) { printf("GEOM_MULTIPATH: cannot attach %s to %s", @@ -344,29 +483,51 @@ g_multipath_add_disk(struct g_geom *gp, g_destroy_consumer(cp); return (error); } - cp->private = sc; - cp->index = 0; /* * Set access permissions on new consumer to match other consumers */ - if (nxtcp && (nxtcp->acr + nxtcp->acw + nxtcp->ace)) { - error = g_access(cp, nxtcp->acr, nxtcp->acw, nxtcp->ace); - if (error) { - printf("GEOM_MULTIPATH: cannot set access in " - "attaching %s to %s/%s (%d)\n", - pp->name, sc->sc_name, sc->sc_uuid, error); - g_detach(cp); - g_destroy_consumer(cp); - return (error); - } + if (sc->sc_pp) { + acr = sc->sc_pp->acr; + acw = sc->sc_pp->acw; + ace = sc->sc_pp->ace; + } else + acr = acw = ace = 0; + if (g_multipath_exclusive) { + acr++; + acw++; + ace++; + } + error = g_access(cp, acr, acw, ace); + if (error) { + printf("GEOM_MULTIPATH: cannot set access in " + "attaching %s to %s (%d)\n", + pp->name, sc->sc_name, error); + g_detach(cp); + g_destroy_consumer(cp); + return (error); } - printf("GEOM_MULTIPATH: adding %s to %s/%s\n", - pp->name, sc->sc_name, sc->sc_uuid); - if (sc->cp_active == NULL) { - sc->cp_active = cp; - printf("GEOM_MULTIPATH: %s now active path in %s\n", - pp->name, sc->sc_name); + if (sc->sc_pp != NULL && sc->sc_pp->mediasize == 0) { + sc->sc_pp->mediasize = pp->mediasize - + ((sc->sc_uuid[0] != 0) ? pp->sectorsize : 0); + sc->sc_pp->sectorsize = pp->sectorsize; + } + if (sc->sc_pp != NULL && + sc->sc_pp->stripesize == 0 && sc->sc_pp->stripeoffset == 0) { + sc->sc_pp->stripesize = pp->stripesize; + sc->sc_pp->stripeoffset = pp->stripeoffset; + } + mtx_lock(&sc->sc_mtx); + cp->index = 0; + sc->sc_ndisks++; + mtx_unlock(&sc->sc_mtx); + printf("GEOM_MULTIPATH: %s added to %s\n", + pp->name, sc->sc_name); + if (sc->sc_active == NULL) { + sc->sc_active = cp; + if (!sc->sc_active_active) + printf("GEOM_MULTIPATH: %s is now active path in %s\n", + pp->name, sc->sc_name); } return (0); } @@ -374,17 +535,41 @@ g_multipath_add_disk(struct g_geom *gp, static int g_multipath_destroy(struct g_geom *gp) { - struct g_provider *pp; + struct g_multipath_softc *sc; + struct g_consumer *cp, *cp1; g_topology_assert(); if (gp->softc == NULL) return (ENXIO); - pp = LIST_FIRST(&gp->provider); - if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) - return (EBUSY); - printf("GEOM_MULTIPATH: destroying %s\n", gp->name); + sc = gp->softc; + if (!sc->sc_stopping) { + printf("GEOM_MULTIPATH: destroying %s\n", gp->name); + sc->sc_stopping = 1; + } + if (sc->sc_opened != 0) { + if (sc->sc_pp != NULL) { + g_wither_provider(sc->sc_pp, ENXIO); + sc->sc_pp = NULL; + } + return (EINPROGRESS); + } + LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { + mtx_lock(&sc->sc_mtx); + if ((cp->index & MP_POSTED) == 0) { + cp->index |= MP_POSTED; + mtx_unlock(&sc->sc_mtx); + g_mpd(cp, 0); + if (cp1 == NULL) + return(0); /* Recursion happened. */ + } else + mtx_unlock(&sc->sc_mtx); + } + if (!LIST_EMPTY(&gp->consumer)) + return (EINPROGRESS); + mtx_destroy(&sc->sc_mtx); g_free(gp->softc); gp->softc = NULL; + printf("GEOM_MULTIPATH: %s destroyed\n", gp->name); g_wither_geom(gp, ENXIO); return (0); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 10:17:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B13B3106566B; Sat, 12 Nov 2011 10:17:23 +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 A1BBC8FC12; Sat, 12 Nov 2011 10:17:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACAHNt8036883; Sat, 12 Nov 2011 10:17:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACAHNSJ036881; Sat, 12 Nov 2011 10:17:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111121017.pACAHNSJ036881@svn.freebsd.org> From: Christian Brueffer Date: Sat, 12 Nov 2011 10:17: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: r227465 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 10:17:23 -0000 Author: brueffer Date: Sat Nov 12 10:17:23 2011 New Revision: 227465 URL: http://svn.freebsd.org/changeset/base/227465 Log: Grammar and mdoc cleanup. MFC after: 3 days Modified: head/share/man/man4/mvs.4 Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Sat Nov 12 09:52:27 2011 (r227464) +++ head/share/man/man4/mvs.4 Sat Nov 12 10:17:23 2011 (r227465) @@ -109,7 +109,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -118,6 +119,7 @@ given precedence as the more functional The .Nm driver supports the following controllers: +.Pp .Bl -tag -compact .It Gen-I (SATA 1.5Gbps): .Bl -bullet -compact @@ -155,10 +157,10 @@ driver supports the following controller MV78100 SoC .El .El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -172,4 +174,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 10:30:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768981065674; Sat, 12 Nov 2011 10:30:15 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66B048FC0A; Sat, 12 Nov 2011 10:30:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACAUFSA037309; Sat, 12 Nov 2011 10:30:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACAUFho037307; Sat, 12 Nov 2011 10:30:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111121030.pACAUFho037307@svn.freebsd.org> From: Christian Brueffer Date: Sat, 12 Nov 2011 10:30: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: r227466 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 10:30:15 -0000 Author: brueffer Date: Sat Nov 12 10:30:14 2011 New Revision: 227466 URL: http://svn.freebsd.org/changeset/base/227466 Log: Added mps(4) and mvs(4). MFC after: 3 days 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 Sat Nov 12 10:17:23 2011 (r227465) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 10:30:14 2011 (r227466) @@ -798,8 +798,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 10:35:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681371065670; Sat, 12 Nov 2011 10:35:57 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id E37278FC0C; Sat, 12 Nov 2011 10:35:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id pACAN7rn064485; Sat, 12 Nov 2011 14:23:07 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Sat, 12 Nov 2011 14:23:07 +0400 (MSK) From: Dmitry Morozovsky To: Eitan Adler In-Reply-To: <201111112224.pABMOG0R011302@svn.freebsd.org> Message-ID: References: <201111112224.pABMOG0R011302@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (woozle.rinet.ru [0.0.0.0]); Sat, 12 Nov 2011 14:23:07 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227457 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 10:35:57 -0000 On Fri, 11 Nov 2011, Eitan Adler wrote: > Author: eadler (ports committer) > Date: Fri Nov 11 22:24:16 2011 > New Revision: 227457 > URL: http://svn.freebsd.org/changeset/base/227457 > > Log: > - add support for CP-104EL-A and CP-104JU to puc > > PR: 151365 > Submitted by: Joerg Niendorf > Approved by: jhb this change seems to be non-intrusive, could we please have it in 9.0-R? Thanks! -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 14:39:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890A5106566C; Sat, 12 Nov 2011 14:39:20 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7827E8FC15; Sat, 12 Nov 2011 14:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACEdKAD048889; Sat, 12 Nov 2011 14:39:20 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACEdKrN048887; Sat, 12 Nov 2011 14:39:20 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111121439.pACEdKrN048887@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Nov 2011 14:39: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: r227467 - head/share/monetdef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 14:39:20 -0000 Author: theraven Date: Sat Nov 12 14:39:20 2011 New Revision: 227467 URL: http://svn.freebsd.org/changeset/base/227467 Log: Fix the number of decimal digits used for Swiss Francs (0 -> 2). Found by the libc++ test suite. If there is some locale test suite somewhere, it might be worth running it... Approved by: dim (mentor) Modified: head/share/monetdef/zh_CN.UTF-8.src Modified: head/share/monetdef/zh_CN.UTF-8.src ============================================================================== --- head/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 10:30:14 2011 (r227466) +++ head/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 14:39:20 2011 (r227467) @@ -18,9 +18,9 @@ CNY # negative_sign - # int_frac_digits -0 +2 # frac_digits -0 +2 # p_cs_precedes 1 # p_sep_by_space From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 16:47:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AE2E106564A; Sat, 12 Nov 2011 16:47:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7238FC12; Sat, 12 Nov 2011 16:47:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACGlOC6053109; Sat, 12 Nov 2011 16:47:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACGlOY7053106; Sat, 12 Nov 2011 16:47:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111121647.pACGlOY7053106@svn.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2011 16:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227468 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 16:47:24 -0000 Author: adrian Date: Sat Nov 12 16:47:23 2011 New Revision: 227468 URL: http://svn.freebsd.org/changeset/base/227468 Log: Disable writing to the extension CYCPWR1 register. This seems to make ANI behave better on the AR5416/AR5418. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Nov 12 14:39:20 2011 (r227467) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Nov 12 16:47:23 2011 (r227468) @@ -342,11 +342,6 @@ ar5416AniControl(struct ath_hal *ah, HAL OS_REG_RMW_FIELD(ah, AR_PHY_TIMING5, AR_PHY_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - /* Only set the ext channel cycpwr_thr1 field for ht/40 */ - if (IEEE80211_IS_CHAN_HT40(AH_PRIVATE(ah)->ah_curchan)) - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA, - AR_PHY_EXT_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - if (level > aniState->spurImmunityLevel) ahp->ah_stats.ast_ani_spurup++; else if (level < aniState->spurImmunityLevel) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat Nov 12 14:39:20 2011 (r227467) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat Nov 12 16:47:23 2011 (r227468) @@ -121,12 +121,6 @@ #define AR_PHY_EXT_MINCCA_PWR_S 23 #define AR_PHY_EXT_CCA_THRESH62 0x007F0000 #define AR_PHY_EXT_CCA_THRESH62_S 16 -/* - * This duplicates AR_PHY_EXT_CCA_CYCPWR_THR1; it reads more like - * an ANI register this way. - */ -#define AR_PHY_EXT_TIMING5_CYCPWR_THR1 0x0000FE00 -#define AR_PHY_EXT_TIMING5_CYCPWR_THR1_S 9 #define AR9280_PHY_EXT_MINCCA_PWR 0x01FF0000 #define AR9280_PHY_EXT_MINCCA_PWR_S 16 From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 19:02:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CB5106564A; Sat, 12 Nov 2011 19:02:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 643B48FC0C; Sat, 12 Nov 2011 19:02:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACJ2t7r057361; Sat, 12 Nov 2011 19:02:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACJ2tHC057359; Sat, 12 Nov 2011 19:02:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201111121902.pACJ2tHC057359@svn.freebsd.org> From: Ed Maste Date: Sat, 12 Nov 2011 19:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227470 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 19:02:55 -0000 Author: emaste Date: Sat Nov 12 19:02:55 2011 New Revision: 227470 URL: http://svn.freebsd.org/changeset/base/227470 Log: Report the amount of memory from smbios data if provided. This should get the correct memory size even if a 32-bit image is running on a machine with > 4GB of memory. This can be useful is using a 32-bit installer on a machine which will eventually run a 64-bit image. Reviewed by: kmoore Modified: head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Sat Nov 12 17:12:33 2011 (r227469) +++ head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh Sat Nov 12 19:02:55 2011 (r227470) @@ -25,4 +25,8 @@ # # $FreeBSD$ -expr $(sysctl -n hw.realmem) / 1048576 +if smbios_mem=$(kenv -q smbios.memory.enabled); then + expr $smbios_mem / 1024 +else + expr $(sysctl -n hw.realmem) / 1048576 +fi From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 19:45:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B4EC1065670; Sat, 12 Nov 2011 19:45:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BFDD8FC13; Sat, 12 Nov 2011 19:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACJjukR058673; Sat, 12 Nov 2011 19:45:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACJjuuV058671; Sat, 12 Nov 2011 19:45:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111121945.pACJjuuV058671@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Nov 2011 19:45: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: r227471 - head/sbin/geom/class/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 19:45:56 -0000 Author: dim Date: Sat Nov 12 19:45:56 2011 New Revision: 227471 URL: http://svn.freebsd.org/changeset/base/227471 Log: Fix buildworld breakage due after r227464. Pointy hat to: mav Modified: head/sbin/geom/class/multipath/geom_multipath.c Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 19:02:55 2011 (r227470) +++ head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 19:45:56 2011 (r227471) @@ -240,7 +240,7 @@ mp_label(struct gctl_req *req) continue; } if (pread(fd, rsector, secsize, disksize - secsize) != - secsize) { + (ssize_t)secsize) { fprintf(stderr, "Unable to read metadata from %s: %s.\n", name2, strerror(errno)); g_close(fd); From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 19:55:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C931065672; Sat, 12 Nov 2011 19:55:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29ED68FC0A; Sat, 12 Nov 2011 19:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACJtnYm058998; Sat, 12 Nov 2011 19:55:49 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACJtnjk058996; Sat, 12 Nov 2011 19:55:49 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111121955.pACJtnjk058996@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Nov 2011 19:55: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: r227472 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 19:55:49 -0000 Author: theraven Date: Sat Nov 12 19:55:48 2011 New Revision: 227472 URL: http://svn.freebsd.org/changeset/base/227472 Log: Expose the unimplemented libm functions in the math.h header. This allows C++'s to work without the compiler complaining that the C++ versions are calling implicitly-declared functions. You will still get a linker error when they are called. OpenBSD 5.0 claims to fully implement the C99 stuff, so might be worth investigating... Reviewed by: das Approved by: dim (mentor) Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Nov 12 19:45:56 2011 (r227471) +++ head/lib/msun/src/math.h Sat Nov 12 19:55:48 2011 (r227472) @@ -395,32 +395,32 @@ float significandf(float); * long double versions of ISO/POSIX math functions */ #if __ISO_C_VISIBLE >= 1999 -#if 0 +#if _DECLARE_C99_LDBL_MATH long double acoshl(long double); #endif long double acosl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double asinhl(long double); #endif long double asinl(long double); long double atan2l(long double, long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double atanhl(long double); #endif long double atanl(long double); long double cbrtl(long double); long double ceill(long double); long double copysignl(long double, long double) __pure2; -#if 0 +#if _DECLARE_C99_LDBL_MATH long double coshl(long double); #endif long double cosl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double erfcl(long double); long double erfl(long double); #endif long double exp2l(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double expl(long double); long double expm1l(long double); #endif @@ -435,18 +435,18 @@ long double frexpl(long double value, in long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double lgammal(long double); #endif long long llrintl(long double); long long llroundl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double log10l(long double); long double log1pl(long double); long double log2l(long double); #endif long double logbl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double logl(long double); #endif long lrintl(long double); @@ -458,7 +458,7 @@ long double nextafterl(long double, long double nexttoward(double, long double); float nexttowardf(float, long double); long double nexttowardl(long double, long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double powl(long double, long double); #endif long double remainderl(long double, long double); @@ -467,16 +467,16 @@ long double rintl(long double); long double roundl(long double); long double scalblnl(long double, long); long double scalbnl(long double, int); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double sinhl(long double); #endif long double sinl(long double); long double sqrtl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double tanhl(long double); #endif long double tanl(long double); -#if 0 +#if _DECLARE_C99_LDBL_MATH long double tgammal(long double); #endif long double truncl(long double); From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 20:01:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D6651065673; Sat, 12 Nov 2011 20:01:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DFAB8FC0A; Sat, 12 Nov 2011 20:01:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACK1UT5059240; Sat, 12 Nov 2011 20:01:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACK1UML059238; Sat, 12 Nov 2011 20:01:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201111122001.pACK1UML059238@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Nov 2011 20:01: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: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 20:01:31 -0000 Author: mav Date: Sat Nov 12 20:01:30 2011 New Revision: 227473 URL: http://svn.freebsd.org/changeset/base/227473 Log: Fix build on some archs after r227464. Modified: head/sbin/geom/class/multipath/geom_multipath.c Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 19:55:48 2011 (r227472) +++ head/sbin/geom/class/multipath/geom_multipath.c Sat Nov 12 20:01:30 2011 (r227473) @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) uint8_t *sector, *rsector; char *ptr; uuid_t uuid; - uint32_t secsize = 0, ssize, status; + ssize_t secsize = 0, ssize; + uint32_t status; const char *name, *name2, *mpname; int error, i, nargs, fd; @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) disksize = msize; } else { if (secsize != ssize) { - gctl_error(req, "%s sector size %u different.", - name, ssize); + gctl_error(req, "%s sector size %ju different.", + name, (intmax_t)ssize); return; } if (disksize != msize) { From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 20:16:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496AC106564A; Sat, 12 Nov 2011 20:16:07 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3973C8FC0C; Sat, 12 Nov 2011 20:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACKG78r059724; Sat, 12 Nov 2011 20:16:07 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACKG7sr059722; Sat, 12 Nov 2011 20:16:07 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111122016.pACKG7sr059722@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Nov 2011 20:16: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: r227474 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 20:16:07 -0000 Author: theraven Date: Sat Nov 12 20:16:06 2011 New Revision: 227474 URL: http://svn.freebsd.org/changeset/base/227474 Log: Fix SIGATOMIC_M{IN,AX} on x86-64. These are meant to be the minimum values that are allowed in a sig_atomic_t, but it looks like they were just copied from the x86 versions, so these definitions violate the C and C++ specs. Mismatch was spotted by the libc++ test suite. Approved by: dim (mentor) Modified: head/sys/amd64/include/_stdint.h Modified: head/sys/amd64/include/_stdint.h ============================================================================== --- head/sys/amd64/include/_stdint.h Sat Nov 12 20:01:30 2011 (r227473) +++ head/sys/amd64/include/_stdint.h Sat Nov 12 20:16:06 2011 (r227474) @@ -150,8 +150,8 @@ #define PTRDIFF_MAX INT64_MAX /* Limits of sig_atomic_t. */ -#define SIG_ATOMIC_MIN INT32_MIN -#define SIG_ATOMIC_MAX INT32_MAX +#define SIG_ATOMIC_MIN LONG_MIN +#define SIG_ATOMIC_MAX LONG_MAX /* Limit of size_t. */ #define SIZE_MAX UINT64_MAX From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 20:16:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C7D91065680; Sat, 12 Nov 2011 20:16:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id A7D318FC08; Sat, 12 Nov 2011 20:16:24 +0000 (UTC) Received: by ggnk3 with SMTP id k3so7347335ggn.13 for ; Sat, 12 Nov 2011 12:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=W8gRU0HlqWfrAEChJG9ky2Ie3Eig45ALY4rtr2+DhG8=; b=df0uXilQWeRk7ctQszgq5JFYndEDBIf2vr80dezLDPqxdN+XIvtKgOCCE8wNB4twY7 38hPDUOVpSDTKhZ8WzhaKHI+4eiEbrlDsRDH7G0M18UNzylidOK8RaKJg28nMmyGULtl rdQrmPbLdejh+KgtuPKoYwvzh9+ncX5RvAzD8= MIME-Version: 1.0 Received: by 10.182.41.69 with SMTP id d5mr3805435obl.47.1321128983907; Sat, 12 Nov 2011 12:16:23 -0800 (PST) Received: by 10.182.7.34 with HTTP; Sat, 12 Nov 2011 12:16:23 -0800 (PST) In-Reply-To: <201111122001.pACK1UML059238@svn.freebsd.org> References: <201111122001.pACK1UML059238@svn.freebsd.org> Date: Sat, 12 Nov 2011 12:16:23 -0800 Message-ID: From: Garrett Cooper To: Alexander Motin 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: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 20:16:25 -0000 On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wrote: > Author: mav > Date: Sat Nov 12 20:01:30 2011 > New Revision: 227473 > URL: http://svn.freebsd.org/changeset/base/227473 > > Log: > =A0Fix build on some archs after r227464. > > Modified: > =A0head/sbin/geom/class/multipath/geom_multipath.c > > Modified: head/sbin/geom/class/multipath/geom_multipath.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12 19= :55:48 2011 =A0 =A0 =A0 =A0(r227472) > +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12 20= :01:30 2011 =A0 =A0 =A0 =A0(r227473) > @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) > =A0 =A0 =A0 =A0uint8_t *sector, *rsector; > =A0 =A0 =A0 =A0char *ptr; > =A0 =A0 =A0 =A0uuid_t uuid; > - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; > + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; > + =A0 =A0 =A0 uint32_t status; > =A0 =A0 =A0 =A0const char *name, *name2, *mpname; > =A0 =A0 =A0 =A0int error, i, nargs, fd; > > @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_error(= req, "%s sector size %u different.", > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nam= e, ssize); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_error(= req, "%s sector size %ju different.", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nam= e, (intmax_t)ssize); Shouldn't that be uintmax_t, not intmax_t ? -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 20:25:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 108F41065670; Sat, 12 Nov 2011 20:25:12 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00D878FC0C; Sat, 12 Nov 2011 20:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACKPBjU060041; Sat, 12 Nov 2011 20:25:11 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACKPBJm060039; Sat, 12 Nov 2011 20:25:11 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111122025.pACKPBJm060039@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Nov 2011 20:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227475 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 20:25:12 -0000 Author: theraven Date: Sat Nov 12 20:25:11 2011 New Revision: 227475 URL: http://svn.freebsd.org/changeset/base/227475 Log: Expose all of the C99 limits.h stuff when we're in C++11 mode (or some approximation thereof). C++11 finally adds long long to C++. Now even C++ programmers are allowed to use 64-bit integers! Approved by: dim (mentor) Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Nov 12 20:16:06 2011 (r227474) +++ head/sys/sys/cdefs.h Sat Nov 12 20:25:11 2011 (r227475) @@ -253,6 +253,17 @@ #define __LONG_LONG_SUPPORTED #endif +/* C++11 exposes a load of C99 stuff */ +#if __cplusplus >= 201103L +# define __LONG_LONG_SUPPORTED +# ifndef __STDC_LIMIT_MACROS +# define __STDC_LIMIT_MACROS +# endif +# ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +# endif +#endif + /* * GCC 2.95 provides `__restrict' as an extension to C90 to support the * C99-specific `restrict' type qualifier. We happen to use `__restrict' as From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 20:45:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8FA106566B; Sat, 12 Nov 2011 20:45:11 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB5A8FC0C; Sat, 12 Nov 2011 20:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACKjBrL060686; Sat, 12 Nov 2011 20:45:11 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACKjBdP060684; Sat, 12 Nov 2011 20:45:11 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111122045.pACKjBdP060684@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Nov 2011 20:45: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: r227476 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 20:45:11 -0000 Author: theraven Date: Sat Nov 12 20:45:10 2011 New Revision: 227476 URL: http://svn.freebsd.org/changeset/base/227476 Log: Don't expose the wctype.h macros in C++ mode. They cause problems when people try to invoke the namespaced versions of the functions of the same names. Approved by: dim (mentor) Modified: head/include/wctype.h Modified: head/include/wctype.h ============================================================================== --- head/include/wctype.h Sat Nov 12 20:25:11 2011 (r227475) +++ head/include/wctype.h Sat Nov 12 20:45:10 2011 (r227476) @@ -89,6 +89,7 @@ wint_t nextwctype(wint_t, wctype_t); #endif __END_DECLS +#ifndef __cplusplus #define iswalnum(wc) __istype((wc), _CTYPE_A|_CTYPE_D) #define iswalpha(wc) __istype((wc), _CTYPE_A) #define iswblank(wc) __istype((wc), _CTYPE_B) @@ -113,6 +114,7 @@ __END_DECLS #define iswphonogram(wc) __istype((wc), _CTYPE_Q) #define iswrune(wc) __istype((wc), 0xFFFFFF00L) #define iswspecial(wc) __istype((wc), _CTYPE_T) -#endif +#endif /* __BSD_VISIBLE */ +#endif /* __cplusplus */ #endif /* _WCTYPE_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 21:30:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F1B2106566C for ; Sat, 12 Nov 2011 21:30:11 +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 941AA8FC13 for ; Sat, 12 Nov 2011 21:30:10 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id pACL902k067463; Sat, 12 Nov 2011 22:09:00 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id pACL90ha067462; Sat, 12 Nov 2011 22:09:00 +0100 (CET) (envelope-from marius) Date: Sat, 12 Nov 2011 22:09:00 +0100 From: Marius Strobl To: Alexander Motin Message-ID: <20111112210900.GJ56603@alchemy.franken.de> References: <201111012312.pA1NCNuY089112@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111012312.pA1NCNuY089112@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: r227009 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 21:30:11 -0000 On Tue, Nov 01, 2011 at 11:12:23PM +0000, Alexander Motin wrote: > Author: mav > Date: Tue Nov 1 23:12:22 2011 > New Revision: 227009 > URL: http://svn.freebsd.org/changeset/base/227009 > > Log: > Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb() > instead of destroy_dev(). It moves device destruction waiting out of the > topology lock and so fixes dead lock between orphanization and closing. > Real provider and geom destruction called from swi context after device > destroyed as callback of the destroy_dev_sched_cb(). > This change causes fsck_ffs(8) and mount(8) to hang unkillably on sparc64 when the kernel is built with either GEOM_PART_GPT or GEOM_LABEL. When breaking into the kernel the backtrace so far looked like one of these two ways: g_wither_washer() at g_wither_washer+0x18 g_run_events() at g_run_events+0x4dc g_event_procbody() at g_event_procbody+0x8c fork_exit() at fork_exit+0x9c fork_trampoline() at fork_trampoline+0x8 find_instance() at find_instance+0x80 _sx_xlock() at _sx_xlock+0xf0 g_run_events() at g_run_events+0xb0 g_event_procbody() at g_event_procbody+0x8c fork_exit() at fork_exit+0x9c fork_trampoline() at fork_trampoline+0x8 I've no clue about geom(4) so I also have no idea how to debug this. Marius From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 23:17:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5048106564A; Sat, 12 Nov 2011 23:17:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3F0B8FC13; Sat, 12 Nov 2011 23:17:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACNH1ep065779; Sat, 12 Nov 2011 23:17:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACNH1Yo065777; Sat, 12 Nov 2011 23:17:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111122317.pACNH1Yo065777@svn.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2011 23:17: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: r227477 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 23:17:01 -0000 Author: adrian Date: Sat Nov 12 23:17:01 2011 New Revision: 227477 URL: http://svn.freebsd.org/changeset/base/227477 Log: Add documentation for the new quiet time IE options. Submitted by: Himali Patel Sponsored by: Sibridge Technologies Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat Nov 12 20:45:10 2011 (r227476) +++ head/sbin/ifconfig/ifconfig.8 Sat Nov 12 23:17:01 2011 (r227477) @@ -1088,6 +1088,38 @@ The specifies the number of beacon intervals between DTIM and must be in the range 1 to 15. By default DTIM is 1 (i.e., DTIM occurs at each beacon). +.It Cm quiet +Enable the use of quiet IE. Hostap will use this to silent other +stations to reduce interference for radar detection when +operating on 5Ghz frequency and doth support is enabled. +Use +.Fl quiet +to disable this functionality. +.It Cm quiet_period Ar period +Set the QUIET +.Ar period +to the number of beacon intervals between the start of regularly +scheduled quiet intervals defined by Quiet element. +.It Cm quiet_count Ar count +Set the QUIET +.Ar count +to the number of TBTTs until the beacon interval during which the +next quiet interval shall start. A value of 1 indicates the quiet +interval will start during the beacon interval starting at the next +TBTT. A value 0 is reserved. +.It Cm quiet_offset Ar offset +Set the QUIET +.Ar offset +to the offset of the start of the quiet interval from the TBTT +specified by the Quiet count, expressed in TUs. +The value of the +.Ar offset +shall be less than one beacon interval. +.It Cm quiet_duration Ar dur +Set the QUIET +.Ar dur +to the duration of the Quiet interval, expressed in TUs. +The value should be less than beacon interval. .It Cm dturbo Enable the use of Atheros Dynamic Turbo mode when communicating with another Dynamic Turbo-capable station. From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 23:17:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBA701065677; Sat, 12 Nov 2011 23:17:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAEFF8FC0C; Sat, 12 Nov 2011 23:17:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACNHsGN065840; Sat, 12 Nov 2011 23:17:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACNHs07065838; Sat, 12 Nov 2011 23:17:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111122317.pACNHs07065838@svn.freebsd.org> From: Dimitry Andric Date: Sat, 12 Nov 2011 23:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227478 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 23:17:55 -0000 Author: dim Date: Sat Nov 12 23:17:54 2011 New Revision: 227478 URL: http://svn.freebsd.org/changeset/base/227478 Log: Fix kernel build breakage after r227475. I had forgotten kernels are built with -Wundef, as opposed to world. Additionally, cdefs.h tends to not use indentation for preprocessor directives, so remove that too. Pointy hat to: me Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Nov 12 23:17:01 2011 (r227477) +++ head/sys/sys/cdefs.h Sat Nov 12 23:17:54 2011 (r227478) @@ -254,14 +254,14 @@ #endif /* C++11 exposes a load of C99 stuff */ -#if __cplusplus >= 201103L -# define __LONG_LONG_SUPPORTED -# ifndef __STDC_LIMIT_MACROS -# define __STDC_LIMIT_MACROS -# endif -# ifndef __STDC_CONSTANT_MACROS -# define __STDC_CONSTANT_MACROS -# endif +#if defined(__cplusplus) && __cplusplus >= 201103L +#define __LONG_LONG_SUPPORTED +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +#define __STDC_CONSTANT_MACROS +#endif #endif /* From owner-svn-src-head@FreeBSD.ORG Sat Nov 12 23:30:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF191065670; Sat, 12 Nov 2011 23:30:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73D5A8FC08; Sat, 12 Nov 2011 23:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pACNUvVT066267; Sat, 12 Nov 2011 23:30:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pACNUvAI066265; Sat, 12 Nov 2011 23:30:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111122330.pACNUvAI066265@svn.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2011 23:30: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: r227479 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2011 23:30:57 -0000 Author: adrian Date: Sat Nov 12 23:30:57 2011 New Revision: 227479 URL: http://svn.freebsd.org/changeset/base/227479 Log: Bump date. Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat Nov 12 23:17:54 2011 (r227478) +++ head/sbin/ifconfig/ifconfig.8 Sat Nov 12 23:30:57 2011 (r227479) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 13, 2011 +.Dd November 12, 2011 .Dt IFCONFIG 8 .Os .Sh NAME